From 92b1feaaa9e726011c02035817cbe8f48e2d7bd5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 3 Jul 2023 23:45:12 +0200 Subject: [PATCH] fix: fix version handling in pool information 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 +- CHANGELOG.md | 4 ++++ rollup.config.mjs | 1 - src/pools/abstract-pool.ts | 8 +------- src/pools/version.ts | 1 + 5 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 src/pools/version.ts diff --git a/.release-it.json b/.release-it.json index f9dd74e2..8e229285 100644 --- a/.release-it.json +++ b/.release-it.json @@ -14,7 +14,7 @@ }, "plugins": { "@release-it/bumper": { - "out": ["sonar-project.properties"] + "out": ["sonar-project.properties", "src/pools/version.ts"] }, "@release-it/keep-a-changelog": { "filename": "CHANGELOG.md", diff --git a/CHANGELOG.md b/CHANGELOG.md index 7776aee4..e93a9599 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Brown paper bag release to fix version handling in pool information. + ## [2.6.7] - 2023-07-03 ### Fixed diff --git a/rollup.config.mjs b/rollup.config.mjs index d88f9734..1410f161 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -48,7 +48,6 @@ export default { 'node:cluster', 'node:crypto', 'node:events', - 'node:fs', 'node:os', 'node:perf_hooks', 'node:worker_threads' diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 03f8c199..796cff1d 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -1,6 +1,5 @@ import crypto from 'node:crypto' import { performance } from 'node:perf_hooks' -import { readFileSync } from 'node:fs' import type { MessageValue, PromiseResponseWrapper } from '../utility-types' import { DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS, @@ -39,12 +38,7 @@ import { type WorkerChoiceStrategyOptions } from './selection-strategies/selection-strategies-types' import { WorkerChoiceStrategyContext } from './selection-strategies/worker-choice-strategy-context' - -const version = ( - JSON.parse( - readFileSync(new URL('../../package.json', import.meta.url), 'utf8') - ) as Record -).version as string +import { version } from './version' /** * Base class that implements some shared logic for all poolifier pools. diff --git a/src/pools/version.ts b/src/pools/version.ts new file mode 100644 index 00000000..b19388c9 --- /dev/null +++ b/src/pools/version.ts @@ -0,0 +1 @@ +export const version = '2.6.7' -- 2.34.1