From c777d83f40cd4f12f18abde8f72a05c1e18b8df9 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] =?UTF-8?q?feat(docs):=20=E2=9C=A8=20Pulling=20version=20n?= =?UTF-8?q?umber=20from=20helia.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com> --- 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 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`)