Skip to content

Commit 366dead

Browse files
committed
Build the tests' copies of the CLI without source maps
The specs that run the real CLI compile it into node_modules/.cache, where each map names sources outside that folder and Vite warns about every one.
1 parent eb59cd0 commit 366dead

4 files changed

Lines changed: 52 additions & 4 deletions

File tree

‎packages/stackctl/e2e/cli.ts‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,19 @@ export async function buildCli(): Promise<void> {
3636
fs.rmSync(buildDir, { recursive: true, force: true });
3737
await promisify(execFile)(
3838
process.execPath,
39-
[tsc, '-p', path.join(packageDir, 'tsconfig.build.json'), '--outDir', buildDir],
39+
[
40+
tsc,
41+
'-p',
42+
path.join(packageDir, 'tsconfig.build.json'),
43+
'--outDir',
44+
buildDir,
45+
// A build the tests only run: no source maps, which would name sources outside the
46+
// build's folder, and no declarations.
47+
'--sourceMap',
48+
'false',
49+
'--declaration',
50+
'false',
51+
],
4052
{ cwd: packageDir },
4153
);
4254
}

‎packages/stackctl/src/cli.spec.ts‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,19 @@ beforeAll(async () => {
173173
fs.rmSync(buildDir, { recursive: true, force: true });
174174
await execa(
175175
'node',
176-
[tsc, '-p', path.join(packageDir, 'tsconfig.build.json'), '--outDir', buildDir],
176+
[
177+
tsc,
178+
'-p',
179+
path.join(packageDir, 'tsconfig.build.json'),
180+
'--outDir',
181+
buildDir,
182+
// A build the tests only run: no source maps, which would name sources outside the
183+
// build's folder, and no declarations.
184+
'--sourceMap',
185+
'false',
186+
'--declaration',
187+
'false',
188+
],
177189
{ cwd: packageDir },
178190
);
179191

‎packages/stackctl/src/commands/stop.spec.ts‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,19 @@ beforeAll(async () => {
6464
fs.rmSync(buildDir, { recursive: true, force: true });
6565
await execa(
6666
'node',
67-
[tsc, '-p', path.join(packageDir, 'tsconfig.build.json'), '--outDir', buildDir],
67+
[
68+
tsc,
69+
'-p',
70+
path.join(packageDir, 'tsconfig.build.json'),
71+
'--outDir',
72+
buildDir,
73+
// A build the tests only run: no source maps, which would name sources outside the
74+
// build's folder, and no declarations.
75+
'--sourceMap',
76+
'false',
77+
'--declaration',
78+
'false',
79+
],
6880
{ cwd: packageDir },
6981
);
7082

‎packages/stackctl/src/one-off/sdk.spec.ts‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,19 @@ beforeAll(async () => {
3939
fs.rmSync(buildDir, { recursive: true, force: true });
4040
await execa(
4141
'node',
42-
[tsc, '-p', path.join(packageDir, 'tsconfig.build.json'), '--outDir', buildDir],
42+
[
43+
tsc,
44+
'-p',
45+
path.join(packageDir, 'tsconfig.build.json'),
46+
'--outDir',
47+
buildDir,
48+
// A build the tests only run: no source maps, which would name sources outside the
49+
// build's folder, and no declarations.
50+
'--sourceMap',
51+
'false',
52+
'--declaration',
53+
'false',
54+
],
4355
{ cwd: packageDir },
4456
);
4557
sdk = (await import(pathToFileURL(path.join(buildDir, 'index.js')).href)) as IndexModule;

0 commit comments

Comments
 (0)