diff --git a/package.json b/package.json index bda639add..e716853ff 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,9 @@ "release": "run-s build docs:no-publish npm:release docs", "npm:release": "aegir exec --bail false npm -- publish", "release:rc": "aegir release-rc", - "docs": "NODE_OPTIONS=--max_old_space_size=8192 aegir docs -- --exclude packages/interop --excludeExternals", - "docs:no-publish": "NODE_OPTIONS=--max_old_space_size=8192 aegir docs --publish false -- --exclude packages/interop" + "update:version": "node scripts/update-version.js", + "docs": "npm run update:version && NODE_OPTIONS=--max_old_space_size=8192 aegir docs -- --exclude packages/interop --excludeExternals", + "docs:no-publish": "npm run update:version && NODE_OPTIONS=--max_old_space_size=8192 aegir docs --publish false -- --exclude packages/interop" }, "devDependencies": { "aegir": "^41.0.0", diff --git a/scripts/update-version.js b/scripts/update-version.js new file mode 100644 index 000000000..209783268 --- /dev/null +++ b/scripts/update-version.js @@ -0,0 +1,6 @@ +import heliaPkg from '../packages/helia/package.json' assert { type: 'json'} +import rootPkg from '../package.json' assert { type: 'json'} +import { writeFile } from 'fs/promises' + +rootPkg.version = heliaPkg.version +await writeFile(new URL('../package.json', import.meta.url), `${JSON.stringify(rootPkg, null, 2)}\n`)