(
api: typeof import('create-qwik'),
distDir: string,
starterId: string,
app: boolean,
emoji: string,
qwikVersion: string
)
| 57 | } |
| 58 | |
| 59 | async function validateStarter( |
| 60 | api: typeof import('create-qwik'), |
| 61 | distDir: string, |
| 62 | starterId: string, |
| 63 | app: boolean, |
| 64 | emoji: string, |
| 65 | qwikVersion: string |
| 66 | ) { |
| 67 | const appDir = join(distDir, 'e2e-' + starterId); |
| 68 | |
| 69 | console.log(`${emoji} ${appDir}`); |
| 70 | rmSync(appDir, { force: true, recursive: true }); |
| 71 | |
| 72 | const result = await api.createApp({ |
| 73 | starterId, |
| 74 | outDir: appDir, |
| 75 | }); |
| 76 | |
| 77 | assert.strictEqual(result.starterId, starterId); |
| 78 | assert.strictEqual(result.outDir, appDir); |
| 79 | |
| 80 | accessSync(result.outDir); |
| 81 | |
| 82 | const appPkgJsonPath = join(result.outDir, 'package.json'); |
| 83 | const appPkgJson = JSON.parse(readFileSync(appPkgJsonPath, 'utf-8')); |
| 84 | |
| 85 | assertRightQwikDepsVersions(appPkgJson, qwikVersion, starterId); |
| 86 | |
| 87 | // Ensure that npm will use an existing version |
| 88 | appPkgJson.devDependencies['@builder.io/qwik'] = 'latest'; |
| 89 | appPkgJson.devDependencies['@builder.io/qwik-city'] = 'latest'; |
| 90 | appPkgJson.devDependencies['eslint-plugin-qwik'] = 'latest'; |
| 91 | appPkgJson.devDependencies['eslint'] = 'latest'; |
| 92 | writeFileSync(appPkgJsonPath, JSON.stringify(appPkgJson, null, 2)); |
| 93 | |
| 94 | const tsconfigPath = join(result.outDir, 'tsconfig.json'); |
| 95 | accessSync(tsconfigPath); |
| 96 | |
| 97 | const { execa } = await import('execa'); |
| 98 | console.log(`${emoji} ${starterId}: npm install`); |
| 99 | await execa('npm', ['install'], { cwd: appDir, stdout: 'inherit' }); |
| 100 | |
| 101 | // console.log(`${emoji} ${projectName}: copy @builder.io/qwik distribution`); |
| 102 | // const qwikNodeModule = join(appDir, 'node_modules', '@builder.io', 'qwik'); |
| 103 | // rmSync(qwikNodeModule, { force: true, recursive: true }); |
| 104 | // const distQwik = join(__dirname, '..', 'packages', 'qwik', 'dist'); |
| 105 | // cpSync(distQwik, qwikNodeModule); |
| 106 | |
| 107 | // console.log(`${emoji} ${projectName}: copy eslint-plugin-qwik distribution`); |
| 108 | // const eslintNodeModule = join(appDir, 'node_modules', 'eslint-plugin-qwik'); |
| 109 | // rmSync(eslintNodeModule, { force: true, recursive: true }); |
| 110 | // const distEslintQwik = join(__dirname, '..', 'packages', 'eslint-plugin-qwik', 'dist'); |
| 111 | // cpSync(distEslintQwik, eslintNodeModule); |
| 112 | |
| 113 | // console.log(`${emoji} ${projectName}: copy @types`); |
| 114 | // const typesNodeModule = join(appDir, 'node_modules', '@types'); |
| 115 | // const distTypesQwik = join(__dirname, '..', 'node_modules', '@types'); |
| 116 | // cpSync(distTypesQwik, typesNodeModule); |
no test coverage detected