@ham2k/lib-cqmag-data 0.0.16 → 0.1.0

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/jest.config.js ADDED
@@ -0,0 +1 @@
1
+ export default { transform: {} }
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@ham2k/lib-cqmag-data",
3
- "version": "0.0.16",
4
- "type": "commonjs",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "./src/index.js",
5
6
  "exports": {
6
7
  ".": "./src/index.js"
7
8
  },
@@ -13,7 +14,7 @@
13
14
  },
14
15
  "scripts": {
15
16
  "generate": "node ./scripts/generate.js",
16
- "test": "jest"
17
+ "test": "node --experimental-vm-modules ./node_modules/.bin/jest"
17
18
  },
18
19
  "standard": {
19
20
  "env": [
@@ -1,14 +1,14 @@
1
- const fs = require('fs')
2
- const path = require('path')
3
- const { preprocessCQWWData } = require('../src/lib/preprocessing')
4
- const { ENTITIES } = require('@ham2k/lib-dxcc-data')
1
+ import fs from 'fs'
2
+ import path from 'path'
3
+ import { preprocessCQWWData } from '../src/lib/preprocessing.js'
4
+ import { ENTITIES } from '@ham2k/lib-dxcc-data'
5
5
 
6
6
  console.log('Generating CQWW json')
7
7
 
8
8
  const cqww = preprocessCQWWData(ENTITIES)
9
9
 
10
- fs.writeFileSync(path.join(__dirname, '../src/data/cqwwByPrefix.json'), JSON.stringify(cqww), 'utf8')
11
- fs.writeFileSync(path.join(__dirname, '../src/data/cqww.json'), JSON.stringify(Object.values(cqww)), 'utf8')
10
+ fs.writeFileSync('src/data/cqwwByPrefix.json', JSON.stringify(cqww), 'utf8')
11
+ fs.writeFileSync('src/data/cqww.json', JSON.stringify(Object.values(cqww)), 'utf8')
12
12
 
13
13
  console.log('CQ WW Entities written to data/cqww.json and cqwwByPrefix.json')
14
14
  console.log('')