@hebcal/geo-sqlite 5.10.3 → 5.10.5

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.
@@ -2,6 +2,7 @@
2
2
 
3
3
  import {buildGeonamesSqlite} from '@hebcal/geo-sqlite';
4
4
  import {pino} from 'pino';
5
+ import pretty from 'pino-pretty';
5
6
  import minimist from 'minimist';
6
7
 
7
8
  const argv = minimist(process.argv.slice(2), {
@@ -15,13 +16,14 @@ if (argv.help) {
15
16
  process.exit(0);
16
17
  }
17
18
 
18
- const logger = pino({
19
- level: argv.quiet ? 'warn' : 'info',
20
- transport: {
21
- target: 'pino-pretty',
22
- options: {translateTime: 'SYS:standard', ignore: 'pid,hostname'},
23
- },
24
- });
19
+ // Run pino-pretty synchronously as the destination stream rather than via a
20
+ // worker-thread transport. The worker thread (thread-stream) can keep the
21
+ // process alive indefinitely on some platforms (e.g. GitHub Codespaces); a
22
+ // synchronous stream lets the process exit naturally once the work is done.
23
+ const logger = pino({level: argv.quiet ? 'warn' : 'info'}, pretty({
24
+ translateTime: 'SYS:standard',
25
+ ignore: 'pid,hostname',
26
+ }));
25
27
 
26
28
  const args = argv._;
27
29
  if (args.length !== 7) {
package/bin/make-test-dbs CHANGED
@@ -7,6 +7,7 @@
7
7
 
8
8
  import {buildGeonamesSqlite, makeZipsSqlite} from '@hebcal/geo-sqlite';
9
9
  import {pino} from 'pino';
10
+ import pretty from 'pino-pretty';
10
11
  import {statSync} from 'fs';
11
12
  import path from 'path';
12
13
 
@@ -15,13 +16,14 @@ const repoDir = path.join(outDir, 'node_modules/@hebcal/geo-sqlite');
15
16
 
16
17
  const population = process.env.POPULATION ? +process.env.POPULATION : 0;
17
18
 
18
- const logger = pino({
19
- level: 'info',
20
- transport: {
21
- target: 'pino-pretty',
22
- options: {translateTime: 'SYS:standard', ignore: 'pid,hostname'},
23
- },
24
- });
19
+ // Run pino-pretty synchronously as the destination stream rather than via a
20
+ // worker-thread transport. The worker thread (thread-stream) can keep the
21
+ // process alive indefinitely on some platforms (e.g. GitHub Codespaces); a
22
+ // synchronous stream lets the process exit naturally once the work is done.
23
+ const logger = pino({level: 'info'}, pretty({
24
+ translateTime: 'SYS:standard',
25
+ ignore: 'pid,hostname',
26
+ }));
25
27
 
26
28
  const geonamesDb = path.join(outDir, 'geonames.sqlite3');
27
29
  const zipsDb = path.join(outDir, 'zips.sqlite3');
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/geo-sqlite v5.10.3 */
1
+ /*! @hebcal/geo-sqlite v5.10.5 */
2
2
  import { DatabaseSync } from 'node:sqlite';
3
3
  import fs$1, { existsSync } from 'node:fs';
4
4
  import QuickLRU from 'quick-lru';
@@ -512,7 +512,7 @@ function munge(s) {
512
512
  }
513
513
 
514
514
  // DO NOT EDIT THIS AUTO-GENERATED FILE!
515
- const version = '5.10.3';
515
+ const version = '5.10.5';
516
516
 
517
517
  const GEONAME_SQL = `SELECT
518
518
  g.name as name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/geo-sqlite",
3
- "version": "5.10.3",
3
+ "version": "5.10.5",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "keywords": [
6
6
  "hebcal"
@@ -39,7 +39,7 @@
39
39
  ],
40
40
  "dependencies": {
41
41
  "@hebcal/cities": "^6.1.0",
42
- "@hebcal/core": "^6.5.0",
42
+ "@hebcal/core": "^6.5.2",
43
43
  "minimist": "^1.2.8",
44
44
  "pino": "^10.3.1",
45
45
  "pino-pretty": "^13.1.3",
@@ -65,13 +65,13 @@
65
65
  "@eslint/js": "^10.0.1",
66
66
  "@rollup/plugin-json": "^6.1.0",
67
67
  "@rollup/plugin-node-resolve": "^16.0.3",
68
- "ava": "^8.0.0",
69
- "eslint": "^10.3.0",
68
+ "ava": "^8.0.1",
69
+ "eslint": "^10.4.1",
70
70
  "eslint-config-google": "^0.14.0",
71
71
  "eslint-plugin-n": "^18.0.1",
72
72
  "globals": "^17.6.0",
73
73
  "jsdoc": "^4.0.5",
74
74
  "jsdoc-to-markdown": "^9.1.3",
75
- "rollup": "^4.60.3"
75
+ "rollup": "^4.60.4"
76
76
  }
77
77
  }
package/zips-dummy.sql CHANGED
@@ -1,17 +1,26 @@
1
1
  CREATE TABLE ZIPCodes_Primary (
2
2
  ZipCode char(5) NOT NULL PRIMARY KEY,
3
- CityMixedCase varchar(35) NULL,
4
- State char(2),
5
- Latitude decimal(12, 6),
6
- Longitude decimal(12, 6),
7
- Elevation int NULL,
8
- TimeZone char(2) NULL,
9
- DayLightSaving char(1) NULL,
3
+ CityMixedCase varchar(35) NOT NULL,
4
+ State char(2) NOT NULL,
5
+ Latitude decimal(12, 6) NOT NULL,
6
+ Longitude decimal(12, 6) NOT NULL,
7
+ Elevation int NOT NULL,
8
+ TimeZone char(2) NOT NULL,
9
+ DayLightSaving char(1) NOT NULL,
10
10
  Population int NULL
11
11
  );
12
12
 
13
- CREATE VIRTUAL TABLE ZIPCodes_CityFullText
14
- USING fts4(ZipCode,CityMixedCase,State,Latitude,Longitude,TimeZone,DayLightSaving,Population);
13
+ INSERT INTO ZIPCodes_Primary VALUES('01109','Springfield','MA',42.118748,-72.549032,209,'5','Y',30968);
14
+ INSERT INTO ZIPCodes_Primary VALUES('02906','Providence','RI',41.83815,-71.393139,89,'5','Y',25559);
15
+ INSERT INTO ZIPCodes_Primary VALUES('62704','Springfield','IL',39.771921,-89.686047,579,'6','Y',39157);
16
+ INSERT INTO ZIPCodes_Primary VALUES('85226','Chandler','AZ',33.266332,-111.943009,1157,'7','N',40689);
17
+ INSERT INTO ZIPCodes_Primary VALUES('90210','Beverly Hills','CA',34.103131,-118.416253,719,'8','Y',21134);
18
+ INSERT INTO ZIPCodes_Primary VALUES('90035','Los Angeles','CA',34.052107,-118.385271,140,'8','Y',31080);
15
19
 
16
20
  CREATE VIRTUAL TABLE ZIPCodes_CityFullText5
17
21
  USING fts5(ZipCode UNINDEXED,CityMixedCase,Population UNINDEXED,longname);
22
+
23
+ INSERT INTO ZIPCodes_CityFullText5
24
+ SELECT ZipCode,CityMixedCase,Population,
25
+ CityMixedCase||', '||State||' '||ZipCode
26
+ FROM ZIPCodes_Primary;