Skip to content

Commit 40f098f

Browse files
committed
test-cli-e2e: fix pnpm pack
1 parent 19ad014 commit 40f098f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

e2e/qwik-cli-e2e/utils/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { ChildProcess, exec, execSync } from 'child_process';
2+
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'fs';
3+
import { yellow } from 'kleur/colors';
4+
import { dirname, join, resolve } from 'path';
25
import { dirSync } from 'tmp';
3-
import { existsSync, mkdirSync, readFileSync, rmSync, rmdirSync, writeFileSync } from 'fs';
4-
import { promisify } from 'util';
5-
import { resolve, join, dirname } from 'path';
66
import treeKill from 'tree-kill';
7-
import { yellow } from 'kleur/colors';
7+
import { promisify } from 'util';
88
import { createDocument } from '../../../packages/qwik/src/testing/document';
99

1010
export function scaffoldQwikProject(): { tmpDir: string; cleanupFn: () => void } {
@@ -106,6 +106,7 @@ export function runCommandUntil(
106106

107107
function checkCriteria(c: any) {
108108
output += c.toString();
109+
console.warn(output);
109110
if (criteria(stripConsoleColors(output)) && !complete) {
110111
complete = true;
111112
res(p);

e2e/qwik-cli-e2e/utils/setup.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ function packPackages() {
2828
const tarballPaths: { name: string; absolutePath: string }[] = [];
2929
const tarballOutDir = join(workspaceRoot, 'temp', 'tarballs');
3030
for (const [name, cfg] of Object.entries(packageCfg)) {
31-
const out = execSync(`pnpm pack --pack-destination=${tarballOutDir}`, {
31+
const out = execSync(`pnpm pack --json --pack-destination=${tarballOutDir}`, {
3232
cwd: join(workspaceRoot, cfg.packagePath),
3333
encoding: 'utf-8',
3434
});
35-
tarballPaths.push({ name, absolutePath: out.replace(/(\r\n|\n|\r)/gm, '') });
35+
const json = JSON.parse(out);
36+
tarballPaths.push({ name, absolutePath: json.filename });
3637
}
3738
writeFileSync(join(tarballOutDir, 'paths.json'), JSON.stringify(tarballPaths));
3839
}

0 commit comments

Comments
 (0)