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