diff --git a/frontend/app/src/app/_helpers/data/sample-configuration.ts b/frontend/app/src/app/_helpers/data/sample-configuration.ts index bc9bfd15..ee2bf03e 100644 --- a/frontend/app/src/app/_helpers/data/sample-configuration.ts +++ b/frontend/app/src/app/_helpers/data/sample-configuration.ts @@ -21,7 +21,7 @@ import { SCThingOriginType, SCThingType, } from '@openstapps/core'; -import packageInfo from '@openstapps/core/package.json'; +import {CORE_VERSION} from '@openstapps/core'; import {Polygon} from 'geojson'; // provides sample aggregations to be used in tests or backendless development @@ -195,7 +195,7 @@ export const sampleIndexResponse: SCIndexResponse = { }, auth: {}, backend: { - SCVersion: packageInfo.version, + SCVersion: CORE_VERSION, externalRequestTimeout: 5000, hiddenTypes: [SCThingType.DateSeries, SCThingType.Diff, SCThingType.Floor], mappingIgnoredTags: [], diff --git a/frontend/app/src/app/modules/config/config.provider.ts b/frontend/app/src/app/modules/config/config.provider.ts index 259f1790..eed00bec 100644 --- a/frontend/app/src/app/modules/config/config.provider.ts +++ b/frontend/app/src/app/modules/config/config.provider.ts @@ -15,7 +15,7 @@ import {Injectable} from '@angular/core'; import {Client} from '@openstapps/api'; import {SCAppConfiguration, SCIndexResponse} from '@openstapps/core'; -import packageInfo from '@openstapps/core/package.json'; +import {CORE_VERSION} from '@openstapps/core'; import {NGXLogger} from 'ngx-logger'; import {environment} from '../../../environments/environment'; import {StAppsWebHttpClient} from '../data/stapps-web-http-client.provider'; @@ -55,7 +55,7 @@ export class ConfigProvider { /** * Version of the @openstapps/core package that app is using */ - scVersion = packageInfo.version; + scVersion = CORE_VERSION; /** * First session indicator (config not found in storage) diff --git a/packages/core/package.json b/packages/core/package.json index 91ce69ea..e6c5257d 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -76,15 +76,6 @@ "typedoc": "0.24.8", "typescript": "5.1.6" }, - "tsup": { - "entry": [ - "src/index.ts" - ], - "sourcemap": true, - "clean": true, - "format": "esm", - "outDir": "lib" - }, "prettier": "@openstapps/prettier-config", "eslintConfig": { "extends": [ diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 9902c884..6bc46df9 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,3 +1,5 @@ +export const CORE_VERSION = process.env.CORE_VERSION!; + export * from './guards.js'; export * from './meta.js'; export * from './translator.js'; diff --git a/packages/core/tsup.config.ts b/packages/core/tsup.config.ts new file mode 100644 index 00000000..c5ce8390 --- /dev/null +++ b/packages/core/tsup.config.ts @@ -0,0 +1,13 @@ +import {defineConfig} from 'tsup'; +import packageJson from './package.json' assert {type: 'json'}; + +export default defineConfig({ + entry: ['src/index.ts'], + sourcemap: true, + clean: true, + format: 'esm', + outDir: 'lib', + env: { + CORE_VERSION: packageJson.version, + }, +});