From: Jérôme Benoit Date: Mon, 3 Jul 2023 21:45:12 +0000 (+0200) Subject: fix: fix version handling in pool information X-Git-Tag: v2.6.8~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=92b1feaaa9e726011c02035817cbe8f48e2d7bd5;p=poolifier.git fix: fix version handling in pool information Signed-off-by: Jérôme Benoit --- 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'