diff --git a/bin/version.ts b/bin/version.ts index d5742e473..5f7569e5c 100644 --- a/bin/version.ts +++ b/bin/version.ts @@ -34,8 +34,11 @@ const newVersion = (() => { patch = Number(patch) + 1; } else if (argv._.includes('minor')) { minor = Number(minor) + 1; + patch = 0; } else if (argv._.includes('major')) { major = Number(major) + 1; + minor = 0; + patch = 0; } else { // else use the first argument return argv._[0].toString(); @@ -53,8 +56,12 @@ const packages = workspaces .filter(workspace => workspace.includes('packages')) .map(packagePath => packagePath.replace('packages', '@dfinity')); +// Update version in root package.json +workspaces.push('.'); + workspaces.forEach(async workspace => { const packagePath = path.resolve(__dirname, '..', workspace, 'package.json'); + console.log(packagePath); const json = JSON.parse(fs.readFileSync(packagePath).toString()); // Set version for package @@ -74,6 +81,7 @@ workspaces.forEach(async workspace => { // Write file fs.writeFileSync(packagePath, JSON.stringify(json)); }); + function updateDeps(dependencies: Record) { for (const dep in dependencies) { if (Object.prototype.hasOwnProperty.call(dependencies, dep)) { @@ -84,16 +92,3 @@ function updateDeps(dependencies: Record) { } return dependencies; } -// Update version in root package.json -fs.writeFileSync(path.resolve(__dirname, '..', 'package.json'), JSON.stringify(rootPackage)); - -// Prettier format the modified package.json files -exec(`npm run prettier:format`, error => { - if (error) { - throw new Error(JSON.stringify(error)); - } - - // wrap up - console.log('success!'); - console.timeEnd('script duration'); -}); diff --git a/docs/generated/changelog.html b/docs/generated/changelog.html index 138919cb3..2165722f8 100644 --- a/docs/generated/changelog.html +++ b/docs/generated/changelog.html @@ -23,6 +23,10 @@

Version 0.10.5

Readme for more details
  • Reduces the maxTimeToLive default setting from 24 hours to 8
  • +
  • + Versioning tool now sets patch version to 0 for minor version updates, or patch and minor + versions to 0 for major version updates +
  • Version 0.10.3