fetch version directly from package.json

This commit is contained in:
Martin Raifer
2022-11-14 19:46:30 +01:00
parent 861a53921c
commit 4dcf6090d8
3 changed files with 5 additions and 3 deletions

View File

@@ -31,7 +31,7 @@ $ git add . && git commit -m 'npm run translations'
```
- Check and finalize `CHANGELOG.md`
- Set release version number in `modules/core/context.js` and `package.json`
- Set release version number in `package.json`
```bash
$ git add . && git commit -m 'vA.B.C'

View File

@@ -4,6 +4,8 @@ import { dispatch as d3_dispatch } from 'd3-dispatch';
import { json as d3_json } from 'd3-fetch';
import { select as d3_select } from 'd3-selection';
import packageJSON from '../../package.json';
import { t } from '../core/localizer';
import { fileFetcher } from './file_fetcher';
@@ -25,7 +27,7 @@ export function coreContext() {
let context = utilRebind({}, dispatch, 'on');
let _deferred = new Set();
context.version = '2.24.0-dev';
context.version = packageJSON.version;
context.privacyVersion = '20201202';
// iD will alter the hash so cache the parameters intended to setup the session

View File

@@ -1,6 +1,6 @@
import parseVersion from 'vparse';
import { presetsCdnUrl, ociCdnUrl, wmfSitematrixCdnUrl } from '../../config/id.js';
// Double check this resolves to iD's `package.json`
import packageJSON from '../../package.json';
let _mainFileFetcher = coreFileFetcher(); // singleton