fix: use version from package.json
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 4 Jul 2023 14:34:51 +0000 (16:34 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 4 Jul 2023 14:34:51 +0000 (16:34 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
.release-it.json
rollup.config.mjs
src/pools/version.ts

index 8e2292859259d6bccdf632127e43757a9f5dec7c..f9dd74e2121cea562a5c546556c6310d6f3512b5 100644 (file)
@@ -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",
index 1410f161af83887ede02a8f98eb6bdcec7d35738..a6db43ec71a93b1a5bf8ba2649aefc45c1a528e9 100644 (file)
@@ -48,6 +48,7 @@ export default {
     'node:cluster',
     'node:crypto',
     'node:events',
+    'node:module',
     'node:os',
     'node:perf_hooks',
     'node:worker_threads'
index c7e075025b40287407aae52571104276c228f182..14e559c4f941da93194624ae36b5b4e5243aad9a 100644 (file)
@@ -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<string, unknown>
+).version as string