forked from QwikDev/qwik
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ci build/test cli, use jsxImportSource (QwikDev#154)
Co-authored-by: Adam Bradley <adamdbradley@users.noreply.github.com>
- Loading branch information
1 parent
b693643
commit 8b7916d
Showing
53 changed files
with
753 additions
and
797 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
const { accessSync, readFileSync } = require('fs'); | ||
const assert = require('assert'); | ||
const { join } = require('path'); | ||
|
||
async function validateCreateQwikCli() { | ||
console.log(`👾 validating create-qwik...`); | ||
|
||
const distDevDir = join(__dirname, '..', 'dist-dev'); | ||
|
||
const cliDir = join(distDevDir, 'create-qwik'); | ||
accessSync(cliDir); | ||
|
||
const cliBin = join(cliDir, 'create-qwik'); | ||
accessSync(cliBin); | ||
|
||
const cliPkgJsonPath = join(cliDir, 'package.json'); | ||
const cliPkgJson = JSON.parse(readFileSync(cliPkgJsonPath, 'utf-8')); | ||
assert.strictEqual(cliPkgJson.name, 'create-qwik'); | ||
|
||
const startersDir = join(cliDir, 'starters'); | ||
accessSync(startersDir); | ||
|
||
const appsDir = join(startersDir, 'apps'); | ||
accessSync(appsDir); | ||
|
||
const serversDir = join(startersDir, 'servers'); | ||
accessSync(serversDir); | ||
|
||
const cliApi = join(cliDir, 'index.js'); | ||
const api = require(cliApi); | ||
const starters = await api.getStarters(); | ||
assert.ok(starters.apps.length > 0); | ||
assert.ok(starters.servers.length > 0); | ||
|
||
const outDir = join(distDevDir, 'my-todo-app'); | ||
const result = await api.generateStarter({ | ||
projectName: 'My ToDo App', | ||
appId: 'todo', | ||
serverId: 'express', | ||
outDir: outDir, | ||
}); | ||
|
||
assert.strictEqual(result.projectName, 'My ToDo App'); | ||
assert.strictEqual(result.appId, 'todo'); | ||
assert.strictEqual(result.serverId, 'express'); | ||
assert.strictEqual(result.outDir, outDir); | ||
|
||
accessSync(result.outDir); | ||
|
||
const appPkgJsonPath = join(result.outDir, 'package.json'); | ||
const appPkgJson = JSON.parse(readFileSync(appPkgJsonPath, 'utf-8')); | ||
assert.strictEqual(appPkgJson.name, 'my-todo-app'); | ||
|
||
const tsconfigPath = join(result.outDir, 'tsconfig.json'); | ||
accessSync(tsconfigPath); | ||
|
||
console.log(`👽 create-qwik validated\n`); | ||
} | ||
|
||
validateCreateQwikCli(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.