From: Jérôme Benoit Date: Tue, 4 Jul 2023 14:34:51 +0000 (+0200) Subject: fix: use version from package.json X-Git-Tag: v2.6.9~20^2~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=3f547eaffb7b81eac5389d8ddb40b4957770f400;p=poolifier.git fix: use version from package.json Signed-off-by: Jérôme Benoit --- 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