From 3f547eaffb7b81eac5389d8ddb40b4957770f400 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 4 Jul 2023 16:34:51 +0200 Subject: [PATCH] fix: use version from package.json MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .release-it.json | 2 +- rollup.config.mjs | 1 + src/pools/version.ts | 8 +++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.release-it.json b/.release-it.json index 8e229285..f9dd74e2 100644 --- a/.release-it.json +++ b/.release-it.json @@ -14,7 +14,7 @@ }, "plugins": { "@release-it/bumper": { - "out": ["sonar-project.properties", "src/pools/version.ts"] + "out": ["sonar-project.properties"] }, "@release-it/keep-a-changelog": { "filename": "CHANGELOG.md", diff --git a/rollup.config.mjs b/rollup.config.mjs index 1410f161..a6db43ec 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -48,6 +48,7 @@ export default { 'node:cluster', 'node:crypto', 'node:events', + 'node:module', 'node:os', 'node:perf_hooks', 'node:worker_threads' diff --git a/src/pools/version.ts b/src/pools/version.ts index c7e07502..14e559c4 100644 --- a/src/pools/version.ts +++ b/src/pools/version.ts @@ -1 +1,7 @@ -export const version = '2.6.8' +import { createRequire } from 'node:module' + +const require = createRequire(import.meta.url) + +export const version = ( + require('../../package.json') as Record +).version as string -- 2.34.1