Skip to content

Commit

Permalink
Use json2js build rule instead of import assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed May 13, 2024
1 parent dffb19c commit 6054bbb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import globals from 'globals';
export default [
{
ignores: [
'unused/*.js',
'static/i/hebcal-app-*.min.js',
'src/*.json.js',
'dist',
],
},
js.configs.recommended,
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
"transliteration": "^2.3.5"
},
"scripts": {
"build": "rollup -c",
"build:rollup": "rollup -c",
"build:json2js": "for f in src/*.json; do echo 'export default' > $f.js && cat $f >> $f.js; done",
"build": "npm run build:json2js && npm run build:rollup",
"prepublish": "npm run build",
"readme": "npx jsdoc2md dist/index.js",
"test": "ava"
Expand Down
2 changes: 1 addition & 1 deletion src/geodb.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Database from 'better-sqlite3';
import {Location} from '@hebcal/core';
import '@hebcal/cities';
import city2geonameid from './city2geonameid.json' with {type: "json"};
import city2geonameid from './city2geonameid.json.js';
import {transliterate} from 'transliteration';
import {munge} from './munge.js';

Expand Down
2 changes: 1 addition & 1 deletion src/geodb.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import os from 'os';
import fs from 'fs';
import path from 'path';
import pino from 'pino';
import legacyCities from './legacy.json' with {type: "json"};
import legacyCities from './legacy.json.js';
import {makeDummyZipsDb} from './makeDummyZipsDb.js';
import {makeDummyInfoTxt} from './makeDummyInfoTxt.js';
import {munge} from './munge.js';
Expand Down

0 comments on commit 6054bbb

Please sign in to comment.