@ham2k/lib-cqmag-data 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/scripts/generate.js +15 -3
- package/src/data/cqww.js +1 -1
- package/src/data/cqwwByPrefix.js +1 -1
- package/src/data/cqwwEntities.js +1 -0
- package/src/data/cqwwEntitiesByPrefix.js +1 -0
- package/src/data/cqzones.js +1 -0
- package/src/data/cqzonesForStates.js +1 -0
- package/src/data/waeEntities.js +1 -0
- package/src/index.js +3 -3
- /package/data/{cqz-for-states.json → cqzones-for-states.json} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ham2k/lib-cqmag-data",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"devDependencies": {
|
|
10
10
|
"@ham2k/lib-country-files": "^0.8",
|
|
11
11
|
"@ham2k/lib-dxcc-data": "^0.0.1",
|
|
12
|
-
"jest": "^29
|
|
13
|
-
"standard": "^17
|
|
12
|
+
"jest": "^29",
|
|
13
|
+
"standard": "^17"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"generate": "node ./scripts/generate.js",
|
package/scripts/generate.js
CHANGED
|
@@ -2,14 +2,26 @@ import fs from 'fs'
|
|
|
2
2
|
import { preprocessCQWWData } from '../src/lib/preprocessing.js'
|
|
3
3
|
import { ENTITIES } from '@ham2k/lib-dxcc-data'
|
|
4
4
|
|
|
5
|
+
import { createRequire } from "node:module"
|
|
6
|
+
const require = createRequire(import.meta.url)
|
|
7
|
+
const CQZONES_FOR_STATES = require('../data/cqzones-for-states.json')
|
|
8
|
+
const CQZONES = require('../data/cqzones.json')
|
|
9
|
+
const WAE = require('../data/wae.json')
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
5
13
|
console.log('Generating CQWW json')
|
|
6
14
|
|
|
7
15
|
const cqww = preprocessCQWWData(ENTITIES)
|
|
8
16
|
|
|
9
17
|
fs.writeFileSync('src/data/cqwwByPrefix.json', JSON.stringify(cqww), 'utf8')
|
|
10
|
-
fs.writeFileSync('src/data/
|
|
18
|
+
fs.writeFileSync('src/data/cqwwEntitiesByPrefix.js', `export const CQWW_ENTITIES_BY_PREFIX = ${JSON.stringify(cqww)}`, 'utf8')
|
|
11
19
|
fs.writeFileSync('src/data/cqww.json', JSON.stringify(Object.values(cqww)), 'utf8')
|
|
12
|
-
fs.writeFileSync('src/data/
|
|
20
|
+
fs.writeFileSync('src/data/cqwwEntities.js', `export const CQWW_ENTITIES = ${JSON.stringify(Object.values(cqww))}`, 'utf8')
|
|
21
|
+
|
|
22
|
+
fs.writeFileSync('src/data/cqzones.js', `export const CQZONES = ${JSON.stringify(CQZONES)}`, 'utf8')
|
|
23
|
+
fs.writeFileSync('src/data/cqzonesForStates.js', `export const CQZONES_FOR_STATES = ${JSON.stringify(CQZONES)}`, 'utf8')
|
|
24
|
+
fs.writeFileSync('src/data/waeEntities.js', `export const WAE_ENTITIES = ${JSON.stringify(CQZONES)}`, 'utf8')
|
|
13
25
|
|
|
14
|
-
console.log('CQ WW
|
|
26
|
+
console.log('CQ WW Entity info written to `data`')
|
|
15
27
|
console.log('')
|