MCPcopy
hub / github.com/QwikDev/qwik / scaffoldQwikProject

Function scaffoldQwikProject

e2e/qwik-cli-e2e/utils/index.ts:11–34  ·  view source on GitHub ↗
(type: QwikProjectType)

Source from the content-addressed store, hash-verified

9
10export type QwikProjectType = 'playground' | 'library' | 'empty';
11export function scaffoldQwikProject(type: QwikProjectType): {
12 tmpDir: string;
13 cleanupFn: () => void;
14} {
15 const tmpHostDirData = getTmpDirSync(
16 process.env.TEMP_E2E_PATH ? `${process.env.TEMP_E2E_PATH}/${type}` : undefined
17 );
18 const cleanupFn = () => {
19 if (!tmpHostDirData.overridden) {
20 cleanup(tmpHostDirData.path);
21 } else {
22 log('Custom E2E test path was used, skipping the removal of test folder');
23 }
24 };
25 try {
26 const tmpDir = runCreateQwikCommand(tmpHostDirData.path, type);
27 log(`Created test application at "${tmpDir}"`);
28 replacePackagesWithLocalOnes(tmpDir);
29 return { cleanupFn, tmpDir };
30 } catch (error) {
31 cleanupFn();
32 throw error;
33 }
34}
35
36function cleanup(tmpDir: string) {
37 log(`Removing tmp dir "${tmpDir}"`);

Callers 1

serve.spec.tsFile · 0.90

Calls 5

getTmpDirSyncFunction · 0.85
runCreateQwikCommandFunction · 0.85
cleanupFnFunction · 0.85
logFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…