From a43823aebc8ef76916f48ae782fc0fb80a790964 Mon Sep 17 00:00:00 2001 From: Nishant Arora <1895906+whizzzkid@users.noreply.github.com> Date: Mon, 23 Oct 2023 23:22:51 -0600 Subject: [PATCH] docs(version): :sparkles: Pulling version number from helia. --- package.json | 5 +++-- scripts/update-version.js | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 scripts/update-version.js diff --git a/package.json b/package.json index bda639ad..e716853f 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 00000000..20978326 --- /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`)