gtfs-to-html 2.10.11 → 2.10.12
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/dist/app/index.js +34 -18
- package/dist/app/index.js.map +1 -1
- package/dist/bin/gtfs-to-html.js +25 -20
- package/dist/bin/gtfs-to-html.js.map +1 -1
- package/dist/index.js +25 -20
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
package/dist/bin/gtfs-to-html.js
CHANGED
|
@@ -11,9 +11,9 @@ import { hideBin } from "yargs/helpers";
|
|
|
11
11
|
import PrettyError from "pretty-error";
|
|
12
12
|
|
|
13
13
|
// src/lib/file-utils.ts
|
|
14
|
-
import { dirname, join, resolve } from "
|
|
15
|
-
import { createWriteStream } from "
|
|
16
|
-
import { fileURLToPath } from "
|
|
14
|
+
import { dirname, join, resolve } from "path";
|
|
15
|
+
import { createWriteStream } from "fs";
|
|
16
|
+
import { fileURLToPath } from "url";
|
|
17
17
|
import {
|
|
18
18
|
access,
|
|
19
19
|
cp,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
readdir,
|
|
23
23
|
readFile,
|
|
24
24
|
rm
|
|
25
|
-
} from "
|
|
25
|
+
} from "fs/promises";
|
|
26
26
|
import * as _ from "lodash-es";
|
|
27
27
|
import archiver from "archiver";
|
|
28
28
|
import beautify from "js-beautify";
|
|
@@ -155,7 +155,7 @@ import simplify from "@turf/simplify";
|
|
|
155
155
|
import { featureCollection, round } from "@turf/helpers";
|
|
156
156
|
|
|
157
157
|
// src/lib/log-utils.ts
|
|
158
|
-
import { clearLine, cursorTo } from "
|
|
158
|
+
import { clearLine, cursorTo } from "readline";
|
|
159
159
|
import { noop } from "lodash-es";
|
|
160
160
|
import * as colors from "yoctocolors";
|
|
161
161
|
import { getFeedInfo } from "gtfs";
|
|
@@ -501,7 +501,7 @@ function formatTripNameForCSV(trip, timetable) {
|
|
|
501
501
|
// package.json
|
|
502
502
|
var package_default = {
|
|
503
503
|
name: "gtfs-to-html",
|
|
504
|
-
version: "2.10.
|
|
504
|
+
version: "2.10.12",
|
|
505
505
|
private: false,
|
|
506
506
|
description: "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
|
|
507
507
|
keywords: [
|
|
@@ -554,18 +554,18 @@ var package_default = {
|
|
|
554
554
|
"cli-table": "^0.3.11",
|
|
555
555
|
"csv-stringify": "^6.5.2",
|
|
556
556
|
express: "^5.1.0",
|
|
557
|
-
gtfs: "^4.17.
|
|
557
|
+
gtfs: "^4.17.3",
|
|
558
558
|
"gtfs-realtime-pbf-js-module": "^1.0.0",
|
|
559
559
|
"js-beautify": "^1.15.4",
|
|
560
560
|
"lodash-es": "^4.17.21",
|
|
561
|
-
marked: "^15.0.
|
|
561
|
+
marked: "^15.0.12",
|
|
562
562
|
moment: "^2.30.1",
|
|
563
563
|
pbf: "^4.0.1",
|
|
564
564
|
"pretty-error": "^4.0.0",
|
|
565
565
|
pug: "^3.0.3",
|
|
566
|
-
puppeteer: "^24.
|
|
566
|
+
puppeteer: "^24.9.0",
|
|
567
567
|
"sanitize-filename": "^1.6.3",
|
|
568
|
-
"sanitize-html": "^2.
|
|
568
|
+
"sanitize-html": "^2.17.0",
|
|
569
569
|
sqlstring: "^2.3.3",
|
|
570
570
|
"timer-machine": "^1.1.0",
|
|
571
571
|
toposort: "^2.0.2",
|
|
@@ -575,20 +575,20 @@ var package_default = {
|
|
|
575
575
|
},
|
|
576
576
|
devDependencies: {
|
|
577
577
|
"@types/archiver": "^6.0.3",
|
|
578
|
-
"@types/express": "^5.0.
|
|
578
|
+
"@types/express": "^5.0.2",
|
|
579
579
|
"@types/insane": "^1.0.0",
|
|
580
580
|
"@types/js-beautify": "^1.14.3",
|
|
581
581
|
"@types/lodash-es": "^4.17.12",
|
|
582
582
|
"@types/morgan": "^1.9.9",
|
|
583
|
-
"@types/node": "^22.
|
|
583
|
+
"@types/node": "^22.15.19",
|
|
584
584
|
"@types/pug": "^2.0.10",
|
|
585
|
-
"@types/sanitize-html": "^2.
|
|
585
|
+
"@types/sanitize-html": "^2.16.0",
|
|
586
586
|
"@types/timer-machine": "^1.1.3",
|
|
587
587
|
"@types/yargs": "^17.0.33",
|
|
588
588
|
husky: "^9.1.7",
|
|
589
|
-
"lint-staged": "^
|
|
589
|
+
"lint-staged": "^16.0.0",
|
|
590
590
|
prettier: "^3.5.3",
|
|
591
|
-
tsup: "^8.
|
|
591
|
+
tsup: "^8.5.0",
|
|
592
592
|
typescript: "^5.8.3"
|
|
593
593
|
},
|
|
594
594
|
engines: {
|
|
@@ -1053,10 +1053,15 @@ var getStopOrder = (timetable, config) => {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
try {
|
|
1055
1055
|
const stopGraph = [];
|
|
1056
|
+
const timepointStopIds = new Set(
|
|
1057
|
+
timetable.orderedTrips.flatMap(
|
|
1058
|
+
(trip) => trip.stoptimes.filter((stoptime) => isTimepoint(stoptime)).map((stoptime) => stoptime.stop_id)
|
|
1059
|
+
)
|
|
1060
|
+
);
|
|
1056
1061
|
for (const trip of timetable.orderedTrips) {
|
|
1057
1062
|
const sortedStopIds = trip.stoptimes.filter((stoptime) => {
|
|
1058
1063
|
if (config.showOnlyTimepoint === true) {
|
|
1059
|
-
return
|
|
1064
|
+
return timepointStopIds.has(stoptime.stop_id);
|
|
1060
1065
|
}
|
|
1061
1066
|
return true;
|
|
1062
1067
|
}).map((stoptime) => stoptime.stop_id);
|
|
@@ -1082,12 +1087,12 @@ var getStopOrder = (timetable, config) => {
|
|
|
1082
1087
|
(stoptime) => stoptime.stop_id
|
|
1083
1088
|
);
|
|
1084
1089
|
const missingStopIds = difference(
|
|
1085
|
-
|
|
1090
|
+
new Set(
|
|
1086
1091
|
timetable.orderedTrips.flatMap(
|
|
1087
1092
|
(trip) => trip.stoptimes.map((stoptime) => stoptime.stop_id)
|
|
1088
1093
|
)
|
|
1089
1094
|
),
|
|
1090
|
-
|
|
1095
|
+
new Set(stopIds)
|
|
1091
1096
|
);
|
|
1092
1097
|
if (missingStopIds.length > 0) {
|
|
1093
1098
|
timetable.warnings.push(
|
|
@@ -2268,8 +2273,8 @@ async function renderPdf(htmlPath) {
|
|
|
2268
2273
|
}
|
|
2269
2274
|
|
|
2270
2275
|
// src/lib/gtfs-to-html.ts
|
|
2271
|
-
import path from "
|
|
2272
|
-
import { mkdir as mkdir2, writeFile } from "
|
|
2276
|
+
import path from "path";
|
|
2277
|
+
import { mkdir as mkdir2, writeFile } from "fs/promises";
|
|
2273
2278
|
import { openDb as openDb2, importGtfs } from "gtfs";
|
|
2274
2279
|
import sanitize2 from "sanitize-filename";
|
|
2275
2280
|
import Timer from "timer-machine";
|