MCPcopy Index your code
hub / github.com/QwikDev/qwik / validateCreateQwikCli

Function validateCreateQwikCli

scripts/validate-cli.ts:21–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19const __dirname = fileURLToPath(new URL('.', import.meta.url));
20
21async function validateCreateQwikCli() {
22 console.log(`👾 validating create-qwik...`);
23
24 const cliDir = join(__dirname, '..', 'packages', 'create-qwik');
25 accessSync(cliDir);
26
27 const cliBin = join(cliDir, 'create-qwik.cjs');
28 accessSync(cliBin);
29
30 const cliPkgJsonPath = join(cliDir, 'package.json');
31 const cliPkgJson = JSON.parse(readFileSync(cliPkgJsonPath, 'utf-8'));
32 assert.strictEqual(cliPkgJson.name, 'create-qwik');
33 const qwikVersion = cliPkgJson.version;
34
35 const startersDir = join(cliDir, 'dist', 'starters');
36 accessSync(startersDir);
37
38 const appsDir = join(startersDir, 'apps');
39 accessSync(appsDir);
40
41 const cliApi = join(cliDir, 'dist', 'index.cjs');
42 console.log(`💫 import cli api: ${cliApi}`);
43 const api: typeof import('create-qwik') = await import(pathToFileURL(cliApi).href);
44
45 const tmpDir = join(__dirname, '..', 'dist-dev');
46
47 await Promise.all([
48 validateStarter(api, tmpDir, 'playground', true, `👻`, qwikVersion),
49 validateStarter(api, tmpDir, 'empty', true, `🫙`, qwikVersion),
50 validateStarter(api, tmpDir, 'library', false, `📚`, qwikVersion),
51 ]).catch((e) => {
52 console.error(e);
53 panic(String(e));
54 });
55
56 console.log(`👽 create-qwik validated\n`);
57}
58
59async function validateStarter(
60 api: typeof import('create-qwik'),

Callers 1

validate-cli.tsFile · 0.85

Calls 4

panicFunction · 0.90
joinFunction · 0.85
validateStarterFunction · 0.85
parseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…