MCPcopy Create free account
hub / github.com/remix-run/react-router / updatePackageJson

Function updatePackageJson

scripts/changes/version.ts:188–199  ·  view source on GitHub ↗

* Updates package.json version

(packageDirName: string, newVersion: string)

Source from the content-addressed store, hash-verified

186 * Updates package.json version
187 */
188function updatePackageJson(packageDirName: string, newVersion: string) {
189 if (preview) {
190 console.log(` • Would update package.json to ${newVersion}`);
191 return;
192 }
193
194 let packageJsonPath = getPackageFile(packageDirName, "package.json");
195 let packageJson = readJson(packageJsonPath);
196 packageJson.version = newVersion;
197 writeJson(packageJsonPath, packageJson);
198 console.log(` ✓ Updated package.json to ${newVersion}`);
199}
200
201/**
202 * Updates CHANGELOG.md with new content

Callers 1

version.tsFile · 0.70

Calls 4

getPackageFileFunction · 0.90
readJsonFunction · 0.90
writeJsonFunction · 0.90
logMethod · 0.80

Tested by

no test coverage detected