Skip to content

Commit 4d189a9

Browse files
authored
Merge pull request #406 from anolilab/fix/preview-release-json-parse
fix(ci): keep pnpm warnings out of the preview release JSON
2 parents b5efc89 + a171a91 commit 4d189a9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

scripts/publish-preview-release.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ if (!env.CHANGED_FILES) {
1313
exit(0);
1414
}
1515

16-
const json = execSync(`pnpm exec nx show projects --affected --exclude=*-bench,docs,storybook --files=${process.env.CHANGED_FILES} --json`).toString("utf8");
16+
// `--silent` keeps pnpm's own output off stdout. The build step ahead of this script rewrites the
17+
// `typesVersions` field of the built package.json files, after which every pnpm invocation prints
18+
// "[WARN] Your node_modules are out of sync with your lockfile" in front of the JSON below.
19+
const json = execSync(`pnpm --silent exec nx show projects --affected --exclude=*-bench,docs,storybook --files=${process.env.CHANGED_FILES} --json`).toString(
20+
"utf8",
21+
);
1722

1823
/** @type {Array<{ path: string, private: boolean, peerDependencies?: Record<string, string> }>} */
1924
const affectedRepoPackages = JSON.parse(json);

0 commit comments

Comments
 (0)