Skip to content

Commit

Permalink
fix(scripts): use json-stringify as parser for package.json (#4559)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored Mar 21, 2023
1 parent 435c4ab commit 69f53ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/generate-clients/copy-to-clients.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const copyToClients = async (sourceDir, destinationDir, solo) => {
] = `node ../../scripts/generate-clients/single-service --solo ${serviceName}`;
}

writeFileSync(destSubPath, prettier.format(JSON.stringify(mergedManifest), { parser: "json" }));
writeFileSync(destSubPath, prettier.format(JSON.stringify(mergedManifest), { parser: "json-stringify" }));
} else if (packageSub === "typedoc.json") {
const typedocJson = {
extends: ["../../typedoc.client.json"],
Expand Down Expand Up @@ -216,7 +216,7 @@ const copyServerTests = async (sourceDir, destinationDir) => {
// don't generate documentation for private packages
delete mergedManifest.scripts["build:docs"];
}
writeFileSync(destSubPath, prettier.format(JSON.stringify(mergedManifest), { parser: "json" }));
writeFileSync(destSubPath, prettier.format(JSON.stringify(mergedManifest), { parser: "json-stringify" }));
} else if (overWritableSubs.includes(packageSub) || !existsSync(destSubPath)) {
if (lstatSync(packageSubPath).isDirectory()) removeSync(destSubPath);
copySync(packageSubPath, destSubPath, {
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-versions/updateVersions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export const updateVersions = (depToVersionHash) => {
const packageJsonPath = join(workspacePath, "package.json");
const packageJson = JSON.parse(readFileSync(packageJsonPath).toString());
const updatedPackageJson = getUpdatedPackageJson(packageJson, depToVersionHash);
writeFileSync(packageJsonPath, format(JSON.stringify(updatedPackageJson), { parser: "json" }));
writeFileSync(packageJsonPath, format(JSON.stringify(updatedPackageJson), { parser: "json-stringify" }));
});
};

0 comments on commit 69f53ce

Please sign in to comment.