gtfs 3.4.0 → 3.5.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/CHANGELOG.md +11 -0
- package/lib/db.js +2 -1
- package/lib/log-utils.js +8 -7
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.5.0] - 2022-07-10
|
|
9
|
+
|
|
10
|
+
### Updated
|
|
11
|
+
|
|
12
|
+
- Use yoctocolors instead of chalk
|
|
13
|
+
- Dependency updates
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Support untildify in sqlitePath config variable
|
|
18
|
+
|
|
8
19
|
## [3.4.0] - 2022-06-12
|
|
9
20
|
|
|
10
21
|
### Updated
|
package/lib/db.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import sqlite3 from 'sqlite3';
|
|
2
2
|
import { open } from 'sqlite';
|
|
3
3
|
import { setDefaultConfig } from './utils.js';
|
|
4
|
+
import untildify from 'untildify';
|
|
4
5
|
const dbs = {};
|
|
5
6
|
|
|
6
7
|
export async function openDb(initialConfig) {
|
|
7
8
|
const config = setDefaultConfig(initialConfig);
|
|
8
9
|
if (!dbs[config.sqlitePath]) {
|
|
9
10
|
dbs[config.sqlitePath] = await open({
|
|
10
|
-
filename: config.sqlitePath,
|
|
11
|
+
filename: untildify(config.sqlitePath),
|
|
11
12
|
driver: sqlite3.Database,
|
|
12
13
|
});
|
|
13
14
|
}
|
package/lib/log-utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { clearLine, cursorTo } from 'node:readline';
|
|
2
2
|
import PrettyError from 'pretty-error';
|
|
3
3
|
import { noop } from 'lodash-es';
|
|
4
|
-
import
|
|
4
|
+
import * as colors from 'yoctocolors';
|
|
5
5
|
|
|
6
6
|
const pe = new PrettyError();
|
|
7
7
|
pe.start();
|
|
@@ -60,17 +60,18 @@ export function logError(config) {
|
|
|
60
60
|
* Format console warning text
|
|
61
61
|
*/
|
|
62
62
|
export function formatWarning(text) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
)} ${chalk.yellow(text)}`;
|
|
63
|
+
const warningMessage = `${colors.underline('Warning')}: ${text}`;
|
|
64
|
+
return colors.yellow(warningMessage);
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
/*
|
|
69
68
|
* Format console error text
|
|
70
69
|
*/
|
|
71
70
|
export function formatError(error) {
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
const messageText = error instanceof Error ? error.message : error;
|
|
72
|
+
const errorMessage = `${colors.underline('Error')}: ${messageText.replace(
|
|
73
|
+
'Error: ',
|
|
74
|
+
''
|
|
75
75
|
)}`;
|
|
76
|
+
return colors.red(errorMessage);
|
|
76
77
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gtfs",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "Import GTFS transit data into SQLite and query routes, stops, times, fares and more",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"transit",
|
|
@@ -72,9 +72,8 @@
|
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@turf/helpers": "^6.5.0",
|
|
75
|
-
"
|
|
76
|
-
"csv-
|
|
77
|
-
"csv-stringify": "^6.1.0",
|
|
75
|
+
"csv-parse": "^5.2.2",
|
|
76
|
+
"csv-stringify": "^6.1.3",
|
|
78
77
|
"gtfs-realtime-bindings": "^0.0.6",
|
|
79
78
|
"lodash-es": "^4.17.21",
|
|
80
79
|
"long": "^5.2.0",
|
|
@@ -91,16 +90,17 @@
|
|
|
91
90
|
"tmp-promise": "^3.0.3",
|
|
92
91
|
"untildify": "^4.0.0",
|
|
93
92
|
"unzipper": "^0.10.11",
|
|
94
|
-
"yargs": "^17.5.1"
|
|
93
|
+
"yargs": "^17.5.1",
|
|
94
|
+
"yoctocolors": "^1.0.0"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
97
|
"dtslint": "^4.2.1",
|
|
98
|
-
"eslint": "^8.
|
|
98
|
+
"eslint": "^8.19.0",
|
|
99
99
|
"eslint-config-prettier": "^8.5.0",
|
|
100
100
|
"eslint-config-xo": "^0.41.0",
|
|
101
101
|
"husky": "^8.0.1",
|
|
102
102
|
"mocha": "^10.0.0",
|
|
103
|
-
"prettier": "^2.
|
|
103
|
+
"prettier": "^2.7.1",
|
|
104
104
|
"pretty-quick": "^3.1.3",
|
|
105
105
|
"should": "^13.2.3"
|
|
106
106
|
},
|