diff --git a/package-lock.json b/package-lock.json index 5531b84..3198e2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@digicatapult/sqnc-process-management", - "version": "2.2.133", + "version": "2.2.134", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@digicatapult/sqnc-process-management", - "version": "2.2.133", + "version": "2.2.134", "license": "Apache-2.0", "dependencies": { "@polkadot/api": "^14.3.1", @@ -41,7 +41,7 @@ "testcontainers": "^10.14.0" }, "engines": { - "node": ">=20.x.x", + "node": ">=22.x.x", "npm": ">=10.x.x" } }, diff --git a/package.json b/package.json index d6b0eb6..cd93edc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@digicatapult/sqnc-process-management", - "version": "2.2.133", + "version": "2.2.134", "description": "SQNC Process Management Flow", "main": "./lib/index.js", "bin": { @@ -26,7 +26,7 @@ "/build" ], "engines": { - "node": ">=20.x.x", + "node": ">=22.x.x", "npm": ">=10.x.x" }, "author": "Digital Catapult", diff --git a/src/__tests__/version.test.ts b/src/__tests__/version.test.ts new file mode 100644 index 0000000..35a4fa9 --- /dev/null +++ b/src/__tests__/version.test.ts @@ -0,0 +1,12 @@ +import { expect } from 'chai' + +import version from '../version' + + +describe('version helper', () => { + it('returns a version number from package.json', () => { + expect(typeof version).to.equal('string') + expect(version).to.match((/^(\d+\.)?(\d+\.)?(\*|\d+)$/g)) + }) + +}) diff --git a/src/version.ts b/src/version.ts index 0ddcb27..c3d7f69 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,3 +1,3 @@ -import packageJson from '../package.json' assert { type: 'json' } -const { version } = packageJson -export default version \ No newline at end of file +const packageJson = await import('../package.json', { with: { type: 'json' }}) +const { version } = packageJson.default +export default version