Skip to content

Commit 71dcfd7

Browse files
authored
Rename prepare script to prepack for compat with yarn (#1980)
* Rename prepare script to prepack * Update justfile * Update build-manifest.mjs
1 parent 6558cbe commit 71dcfd7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

justfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ pre-debug *ARGS:
6464
just build-tsc && just build-pack "$@"
6565
coverage-report *ARGS:
6666
nyc report --reporter=lcov "$@"
67-
__prepare_template__ *ARGS:
67+
__prepack_template__ *ARGS:
6868
just clean && just build-nopack "$@"
69-
prepare *ARGS:
69+
prepack *ARGS:
7070
rimraf temp dist tsconfig.schema.json tsconfig.schemastore-schema.json tsconfig.tsbuildinfo tests/ts-node-packed.tgz tests/node_modules tests/tmp && tsc -b ./tsconfig.build-dist.json && typescript-json-schema --topRef --refs --validationKeywords allOf --out tsconfig.schema.json tsconfig.build-schema.json TsConfigSchema && node --require ./register ./scripts/create-merged-schema "$@"
7171
api-extractor *ARGS:
7272
api-extractor run --local --verbose "$@"

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
"test-local": "yarn fmt && yarn build-tsc && yarn build-pack && yarn test-spec",
7575
"pre-debug": "yarn build-tsc && yarn build-pack",
7676
"coverage-report": "nyc report --reporter=lcov",
77-
"__prepare_template__": "yarn clean && yarn build-nopack",
78-
"prepare": "rimraf temp dist tsconfig.schema.json tsconfig.schemastore-schema.json tsconfig.tsbuildinfo tests/ts-node-packed.tgz tests/node_modules tests/tmp && tsc -b ./tsconfig.build-dist.json && typescript-json-schema --topRef --refs --validationKeywords allOf --out tsconfig.schema.json tsconfig.build-schema.json TsConfigSchema && node --require ./register ./scripts/create-merged-schema",
77+
"__prepack_template__": "yarn clean && yarn build-nopack",
78+
"prepack": "rimraf temp dist tsconfig.schema.json tsconfig.schemastore-schema.json tsconfig.tsbuildinfo tests/ts-node-packed.tgz tests/node_modules tests/tmp && tsc -b ./tsconfig.build-dist.json && typescript-json-schema --topRef --refs --validationKeywords allOf --out tsconfig.schema.json tsconfig.build-schema.json TsConfigSchema && node --require ./register ./scripts/create-merged-schema",
7979
"api-extractor": "api-extractor run --local --verbose"
8080
},
8181
"repository": {

scripts/build-manifest.mjs

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ const manifestPath = resolve(
1010
);
1111
const pkg = JSON.parse(readFileSync(manifestPath, 'utf8'));
1212

13-
// Fully splat the "prepare" script so that it does not contain references to a package manager, neither `yarn` nor `npm`
14-
pkg.scripts.prepare = pkg.scripts.__prepare_template__;
13+
// Fully splat the "prepack" script so that it does not contain references to a package manager, neither `yarn` nor `npm`
14+
pkg.scripts.prepack = pkg.scripts.__prepack_template__;
1515
while (true) {
16-
let before = pkg.scripts.prepare;
17-
pkg.scripts.prepare = pkg.scripts.prepare.replace(
16+
let before = pkg.scripts.prepack;
17+
pkg.scripts.prepack = pkg.scripts.prepack.replace(
1818
/yarn (\S+)/g,
1919
($0, $1) => pkg.scripts[$1]
2020
);
21-
if (pkg.scripts.prepare === before) break;
21+
if (pkg.scripts.prepack === before) break;
2222
}
2323

2424
writeFileSync(manifestPath, JSON.stringify(pkg, null, 2) + '\n');

0 commit comments

Comments
 (0)