Skip to content

Commit 4dcf609

Browse files
committed
fetch version directly from package.json
1 parent 861a539 commit 4dcf609

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

RELEASING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ $ git add . && git commit -m 'npm run translations'
3131
```
3232

3333
- Check and finalize `CHANGELOG.md`
34-
- Set release version number in `modules/core/context.js` and `package.json`
34+
- Set release version number in `package.json`
3535

3636
```bash
3737
$ git add . && git commit -m 'vA.B.C'

modules/core/context.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { dispatch as d3_dispatch } from 'd3-dispatch';
44
import { json as d3_json } from 'd3-fetch';
55
import { select as d3_select } from 'd3-selection';
66

7+
import packageJSON from '../../package.json';
8+
79
import { t } from '../core/localizer';
810

911
import { fileFetcher } from './file_fetcher';
@@ -25,7 +27,7 @@ export function coreContext() {
2527
let context = utilRebind({}, dispatch, 'on');
2628
let _deferred = new Set();
2729

28-
context.version = '2.24.0-dev';
30+
context.version = packageJSON.version;
2931
context.privacyVersion = '20201202';
3032

3133
// iD will alter the hash so cache the parameters intended to setup the session

modules/core/file_fetcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import parseVersion from 'vparse';
22
import { presetsCdnUrl, ociCdnUrl, wmfSitematrixCdnUrl } from '../../config/id.js';
3-
// Double check this resolves to iD's `package.json`
3+
44
import packageJSON from '../../package.json';
55

66
let _mainFileFetcher = coreFileFetcher(); // singleton

0 commit comments

Comments
 (0)