Skip to content

Commit 1b40476

Browse files
committed
fix: do not lock web-codegen-scorer to pnpm
1 parent fe8c2a8 commit 1b40476

File tree

1 file changed

+20
-31
lines changed

1 file changed

+20
-31
lines changed

scripts/release-build.ts

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { join } from 'path';
2-
import { rm, cp, readFile, writeFile } from 'fs/promises';
1+
import {join} from 'path';
2+
import {rm, cp, readFile, writeFile} from 'fs/promises';
33
import yargs from 'yargs';
4-
import { hideBin } from 'yargs/helpers';
5-
import { globSync as glob } from 'tinyglobby';
6-
import { executeCommand } from '../runner/utils/exec.js';
4+
import {hideBin} from 'yargs/helpers';
5+
import {globSync as glob} from 'tinyglobby';
6+
import {executeCommand} from '../runner/utils/exec.js';
77

88
const root = join(import.meta.dirname, '..');
99
const runnerSource = join(root, 'runner');
@@ -28,7 +28,7 @@ const args = yargs(hideBin(process.argv))
2828
console.log('Building release output...');
2929

3030
// Clear out the target directory.
31-
await rm(targetDirectory, { recursive: true, force: true });
31+
await rm(targetDirectory, {recursive: true, force: true});
3232

3333
// Build the runner. This also creates `dist`.
3434
await executeCommand('pnpm build-runner', runnerSource, undefined, {
@@ -38,7 +38,7 @@ const args = yargs(hideBin(process.argv))
3838
// Generate the package.json.
3939
await writeFile(
4040
join(targetDirectory, 'package.json'),
41-
await getPackageJson(join(root, 'package.json'), args.version)
41+
await getPackageJson(join(root, 'package.json'), args.version),
4242
);
4343

4444
// Copy the readme and license.
@@ -50,18 +50,10 @@ const args = yargs(hideBin(process.argv))
5050
glob('**/*', {
5151
cwd: join(root, 'examples'),
5252
dot: true,
53-
ignore: [
54-
'**/node_modules/**',
55-
'**/dist/**',
56-
'**/.vinxi/**',
57-
'**/.output/**',
58-
],
59-
}).map((agentFile) =>
60-
cp(
61-
join(root, 'examples', agentFile),
62-
join(targetDirectory, 'examples', agentFile)
63-
)
64-
)
53+
ignore: ['**/node_modules/**', '**/dist/**', '**/.vinxi/**', '**/.output/**'],
54+
}).map(agentFile =>
55+
cp(join(root, 'examples', agentFile), join(targetDirectory, 'examples', agentFile)),
56+
),
6557
);
6658

6759
// The user journey testing requires various files to work.
@@ -71,12 +63,12 @@ const args = yargs(hideBin(process.argv))
7163
cwd: join(root, browserAgentRelativePath),
7264
dot: true,
7365
ignore: ['*.ts', 'README.md'],
74-
}).map((agentFile) =>
66+
}).map(agentFile =>
7567
cp(
7668
join(root, browserAgentRelativePath, agentFile),
77-
join(targetDirectory, browserAgentRelativePath, agentFile)
78-
)
79-
)
69+
join(targetDirectory, browserAgentRelativePath, agentFile),
70+
),
71+
),
8072
);
8173

8274
if (!args.runnerOnly) {
@@ -86,28 +78,24 @@ const args = yargs(hideBin(process.argv))
8678
});
8779

8880
// Copy the report artifacts into the `dist`.
89-
await cp(reportAppDist, targetDirectory, { recursive: true });
81+
await cp(reportAppDist, targetDirectory, {recursive: true});
9082
}
9183

9284
console.log(`Release output has been built in ${targetDirectory}`);
9385
})();
9486

95-
async function getPackageJson(
96-
path: string,
97-
version: string | null
98-
): Promise<string> {
87+
async function getPackageJson(path: string, version: string | null): Promise<string> {
9988
const content = await readFile(path, 'utf8');
10089
const parsed = JSON.parse(content) as {
10190
version: string;
10291
scripts?: unknown;
10392
devDependencies?: unknown;
93+
engines?: unknown;
10494
};
10595

10696
if (version) {
10797
if (version === parsed.version) {
108-
throw new Error(
109-
`Specified version is the same version as the current one.`
110-
);
98+
throw new Error(`Specified version is the same version as the current one.`);
11199
} else {
112100
parsed.version = version;
113101
}
@@ -116,6 +104,7 @@ async function getPackageJson(
116104
// Delete some fields that aren't relevant for end users.
117105
delete parsed.scripts;
118106
delete parsed.devDependencies;
107+
delete parsed.engines;
119108

120109
return JSON.stringify(parsed, undefined, 2);
121110
}

0 commit comments

Comments
 (0)