gtfs-to-html 2.10.10 → 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 +142 -9
- package/dist/app/index.js.map +1 -1
- package/dist/bin/gtfs-to-html.js +133 -11
- package/dist/bin/gtfs-to-html.js.map +1 -1
- package/dist/index.js +133 -11
- package/dist/index.js.map +1 -1
- package/package.json +14 -14
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";
|
|
@@ -499,9 +499,126 @@ function formatTripNameForCSV(trip, timetable) {
|
|
|
499
499
|
}
|
|
500
500
|
|
|
501
501
|
// package.json
|
|
502
|
-
var
|
|
502
|
+
var package_default = {
|
|
503
|
+
name: "gtfs-to-html",
|
|
504
|
+
version: "2.10.12",
|
|
505
|
+
private: false,
|
|
506
|
+
description: "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
|
|
507
|
+
keywords: [
|
|
508
|
+
"transit",
|
|
509
|
+
"gtfs",
|
|
510
|
+
"gtfs-realtime",
|
|
511
|
+
"transportation",
|
|
512
|
+
"timetables"
|
|
513
|
+
],
|
|
514
|
+
homepage: "https://gtfstohtml.com",
|
|
515
|
+
bugs: {
|
|
516
|
+
url: "https://github.com/blinktaginc/gtfs-to-html/issues"
|
|
517
|
+
},
|
|
518
|
+
repository: "git://github.com/blinktaginc/gtfs-to-html",
|
|
519
|
+
license: "MIT",
|
|
520
|
+
author: "Brendan Nee <brendan@blinktag.com>",
|
|
521
|
+
contributors: [
|
|
522
|
+
"Evan Siroky <evan.siroky@yahoo.com>",
|
|
523
|
+
"Nathan Selikoff",
|
|
524
|
+
"Aaron Antrim <aaron@trilliumtransit.com>",
|
|
525
|
+
"Thomas Craig <thomas@trilliumtransit.com>",
|
|
526
|
+
"Holly Kvalheim",
|
|
527
|
+
"Pawajoro",
|
|
528
|
+
"Andrea Mignone",
|
|
529
|
+
"Evo Stamatov"
|
|
530
|
+
],
|
|
531
|
+
type: "module",
|
|
532
|
+
main: "./dist/index.js",
|
|
533
|
+
types: "./dist/index.d.ts",
|
|
534
|
+
files: [
|
|
535
|
+
"dist",
|
|
536
|
+
"docker",
|
|
537
|
+
"examples",
|
|
538
|
+
"views/default",
|
|
539
|
+
"config-sample.json"
|
|
540
|
+
],
|
|
541
|
+
bin: {
|
|
542
|
+
"gtfs-to-html": "dist/bin/gtfs-to-html.js"
|
|
543
|
+
},
|
|
544
|
+
scripts: {
|
|
545
|
+
build: "tsup",
|
|
546
|
+
start: "node ./dist/app",
|
|
547
|
+
prepare: "husky"
|
|
548
|
+
},
|
|
549
|
+
dependencies: {
|
|
550
|
+
"@turf/helpers": "^7.2.0",
|
|
551
|
+
"@turf/simplify": "^7.2.0",
|
|
552
|
+
anchorme: "^3.0.8",
|
|
553
|
+
archiver: "^7.0.1",
|
|
554
|
+
"cli-table": "^0.3.11",
|
|
555
|
+
"csv-stringify": "^6.5.2",
|
|
556
|
+
express: "^5.1.0",
|
|
557
|
+
gtfs: "^4.17.3",
|
|
558
|
+
"gtfs-realtime-pbf-js-module": "^1.0.0",
|
|
559
|
+
"js-beautify": "^1.15.4",
|
|
560
|
+
"lodash-es": "^4.17.21",
|
|
561
|
+
marked: "^15.0.12",
|
|
562
|
+
moment: "^2.30.1",
|
|
563
|
+
pbf: "^4.0.1",
|
|
564
|
+
"pretty-error": "^4.0.0",
|
|
565
|
+
pug: "^3.0.3",
|
|
566
|
+
puppeteer: "^24.9.0",
|
|
567
|
+
"sanitize-filename": "^1.6.3",
|
|
568
|
+
"sanitize-html": "^2.17.0",
|
|
569
|
+
sqlstring: "^2.3.3",
|
|
570
|
+
"timer-machine": "^1.1.0",
|
|
571
|
+
toposort: "^2.0.2",
|
|
572
|
+
untildify: "^5.0.0",
|
|
573
|
+
yargs: "^17.7.2",
|
|
574
|
+
yoctocolors: "^2.1.1"
|
|
575
|
+
},
|
|
576
|
+
devDependencies: {
|
|
577
|
+
"@types/archiver": "^6.0.3",
|
|
578
|
+
"@types/express": "^5.0.2",
|
|
579
|
+
"@types/insane": "^1.0.0",
|
|
580
|
+
"@types/js-beautify": "^1.14.3",
|
|
581
|
+
"@types/lodash-es": "^4.17.12",
|
|
582
|
+
"@types/morgan": "^1.9.9",
|
|
583
|
+
"@types/node": "^22.15.19",
|
|
584
|
+
"@types/pug": "^2.0.10",
|
|
585
|
+
"@types/sanitize-html": "^2.16.0",
|
|
586
|
+
"@types/timer-machine": "^1.1.3",
|
|
587
|
+
"@types/yargs": "^17.0.33",
|
|
588
|
+
husky: "^9.1.7",
|
|
589
|
+
"lint-staged": "^16.0.0",
|
|
590
|
+
prettier: "^3.5.3",
|
|
591
|
+
tsup: "^8.5.0",
|
|
592
|
+
typescript: "^5.8.3"
|
|
593
|
+
},
|
|
594
|
+
engines: {
|
|
595
|
+
node: ">= 20.11.0"
|
|
596
|
+
},
|
|
597
|
+
"release-it": {
|
|
598
|
+
github: {
|
|
599
|
+
release: true
|
|
600
|
+
},
|
|
601
|
+
plugins: {
|
|
602
|
+
"@release-it/keep-a-changelog": {
|
|
603
|
+
filename: "CHANGELOG.md"
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
hooks: {
|
|
607
|
+
"after:bump": "npm run build"
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
prettier: {
|
|
611
|
+
singleQuote: true
|
|
612
|
+
},
|
|
613
|
+
"lint-staged": {
|
|
614
|
+
"*.js": "prettier --write",
|
|
615
|
+
"*.ts": "prettier --write",
|
|
616
|
+
"*.json": "prettier --write"
|
|
617
|
+
}
|
|
618
|
+
};
|
|
503
619
|
|
|
504
620
|
// src/lib/utils.ts
|
|
621
|
+
var { version } = package_default;
|
|
505
622
|
var isTimepoint = (stoptime) => {
|
|
506
623
|
if (isNullOrEmpty(stoptime.timepoint)) {
|
|
507
624
|
return !isNullOrEmpty(stoptime.arrival_time) && !isNullOrEmpty(stoptime.departure_time);
|
|
@@ -936,10 +1053,15 @@ var getStopOrder = (timetable, config) => {
|
|
|
936
1053
|
}
|
|
937
1054
|
try {
|
|
938
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
|
+
);
|
|
939
1061
|
for (const trip of timetable.orderedTrips) {
|
|
940
1062
|
const sortedStopIds = trip.stoptimes.filter((stoptime) => {
|
|
941
1063
|
if (config.showOnlyTimepoint === true) {
|
|
942
|
-
return
|
|
1064
|
+
return timepointStopIds.has(stoptime.stop_id);
|
|
943
1065
|
}
|
|
944
1066
|
return true;
|
|
945
1067
|
}).map((stoptime) => stoptime.stop_id);
|
|
@@ -965,12 +1087,12 @@ var getStopOrder = (timetable, config) => {
|
|
|
965
1087
|
(stoptime) => stoptime.stop_id
|
|
966
1088
|
);
|
|
967
1089
|
const missingStopIds = difference(
|
|
968
|
-
|
|
1090
|
+
new Set(
|
|
969
1091
|
timetable.orderedTrips.flatMap(
|
|
970
1092
|
(trip) => trip.stoptimes.map((stoptime) => stoptime.stop_id)
|
|
971
1093
|
)
|
|
972
1094
|
),
|
|
973
|
-
|
|
1095
|
+
new Set(stopIds)
|
|
974
1096
|
);
|
|
975
1097
|
if (missingStopIds.length > 0) {
|
|
976
1098
|
timetable.warnings.push(
|
|
@@ -2151,8 +2273,8 @@ async function renderPdf(htmlPath) {
|
|
|
2151
2273
|
}
|
|
2152
2274
|
|
|
2153
2275
|
// src/lib/gtfs-to-html.ts
|
|
2154
|
-
import path from "
|
|
2155
|
-
import { mkdir as mkdir2, writeFile } from "
|
|
2276
|
+
import path from "path";
|
|
2277
|
+
import { mkdir as mkdir2, writeFile } from "fs/promises";
|
|
2156
2278
|
import { openDb as openDb2, importGtfs } from "gtfs";
|
|
2157
2279
|
import sanitize2 from "sanitize-filename";
|
|
2158
2280
|
import Timer from "timer-machine";
|