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/app/index.js
CHANGED
|
@@ -5,9 +5,9 @@ var __export = (target, all) => {
|
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
// src/app/index.ts
|
|
8
|
-
import { dirname as dirname2, join as join2 } from "
|
|
9
|
-
import { fileURLToPath as fileURLToPath2 } from "
|
|
10
|
-
import { readFileSync } from "
|
|
8
|
+
import { dirname as dirname2, join as join2 } from "path";
|
|
9
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
10
|
+
import { readFileSync } from "fs";
|
|
11
11
|
import yargs from "yargs";
|
|
12
12
|
import { hideBin } from "yargs/helpers";
|
|
13
13
|
import { openDb as openDb2 } from "gtfs";
|
|
@@ -130,8 +130,18 @@ import sqlString from "sqlstring";
|
|
|
130
130
|
import toposort from "toposort";
|
|
131
131
|
|
|
132
132
|
// src/lib/file-utils.ts
|
|
133
|
-
import { dirname, join, resolve } from "
|
|
134
|
-
import {
|
|
133
|
+
import { dirname, join, resolve } from "path";
|
|
134
|
+
import { createWriteStream } from "fs";
|
|
135
|
+
import { fileURLToPath } from "url";
|
|
136
|
+
import {
|
|
137
|
+
access,
|
|
138
|
+
cp,
|
|
139
|
+
copyFile,
|
|
140
|
+
mkdir,
|
|
141
|
+
readdir,
|
|
142
|
+
readFile,
|
|
143
|
+
rm
|
|
144
|
+
} from "fs/promises";
|
|
135
145
|
import * as _ from "lodash-es";
|
|
136
146
|
import archiver from "archiver";
|
|
137
147
|
import beautify from "js-beautify";
|
|
@@ -312,6 +322,7 @@ import simplify from "@turf/simplify";
|
|
|
312
322
|
import { featureCollection, round } from "@turf/helpers";
|
|
313
323
|
|
|
314
324
|
// src/lib/log-utils.ts
|
|
325
|
+
import { clearLine, cursorTo } from "readline";
|
|
315
326
|
import { noop } from "lodash-es";
|
|
316
327
|
import * as colors from "yoctocolors";
|
|
317
328
|
import { getFeedInfo } from "gtfs";
|
|
@@ -407,9 +418,126 @@ function getAgencyGeoJSON(config2) {
|
|
|
407
418
|
}
|
|
408
419
|
|
|
409
420
|
// package.json
|
|
410
|
-
var
|
|
421
|
+
var package_default = {
|
|
422
|
+
name: "gtfs-to-html",
|
|
423
|
+
version: "2.10.12",
|
|
424
|
+
private: false,
|
|
425
|
+
description: "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
|
|
426
|
+
keywords: [
|
|
427
|
+
"transit",
|
|
428
|
+
"gtfs",
|
|
429
|
+
"gtfs-realtime",
|
|
430
|
+
"transportation",
|
|
431
|
+
"timetables"
|
|
432
|
+
],
|
|
433
|
+
homepage: "https://gtfstohtml.com",
|
|
434
|
+
bugs: {
|
|
435
|
+
url: "https://github.com/blinktaginc/gtfs-to-html/issues"
|
|
436
|
+
},
|
|
437
|
+
repository: "git://github.com/blinktaginc/gtfs-to-html",
|
|
438
|
+
license: "MIT",
|
|
439
|
+
author: "Brendan Nee <brendan@blinktag.com>",
|
|
440
|
+
contributors: [
|
|
441
|
+
"Evan Siroky <evan.siroky@yahoo.com>",
|
|
442
|
+
"Nathan Selikoff",
|
|
443
|
+
"Aaron Antrim <aaron@trilliumtransit.com>",
|
|
444
|
+
"Thomas Craig <thomas@trilliumtransit.com>",
|
|
445
|
+
"Holly Kvalheim",
|
|
446
|
+
"Pawajoro",
|
|
447
|
+
"Andrea Mignone",
|
|
448
|
+
"Evo Stamatov"
|
|
449
|
+
],
|
|
450
|
+
type: "module",
|
|
451
|
+
main: "./dist/index.js",
|
|
452
|
+
types: "./dist/index.d.ts",
|
|
453
|
+
files: [
|
|
454
|
+
"dist",
|
|
455
|
+
"docker",
|
|
456
|
+
"examples",
|
|
457
|
+
"views/default",
|
|
458
|
+
"config-sample.json"
|
|
459
|
+
],
|
|
460
|
+
bin: {
|
|
461
|
+
"gtfs-to-html": "dist/bin/gtfs-to-html.js"
|
|
462
|
+
},
|
|
463
|
+
scripts: {
|
|
464
|
+
build: "tsup",
|
|
465
|
+
start: "node ./dist/app",
|
|
466
|
+
prepare: "husky"
|
|
467
|
+
},
|
|
468
|
+
dependencies: {
|
|
469
|
+
"@turf/helpers": "^7.2.0",
|
|
470
|
+
"@turf/simplify": "^7.2.0",
|
|
471
|
+
anchorme: "^3.0.8",
|
|
472
|
+
archiver: "^7.0.1",
|
|
473
|
+
"cli-table": "^0.3.11",
|
|
474
|
+
"csv-stringify": "^6.5.2",
|
|
475
|
+
express: "^5.1.0",
|
|
476
|
+
gtfs: "^4.17.3",
|
|
477
|
+
"gtfs-realtime-pbf-js-module": "^1.0.0",
|
|
478
|
+
"js-beautify": "^1.15.4",
|
|
479
|
+
"lodash-es": "^4.17.21",
|
|
480
|
+
marked: "^15.0.12",
|
|
481
|
+
moment: "^2.30.1",
|
|
482
|
+
pbf: "^4.0.1",
|
|
483
|
+
"pretty-error": "^4.0.0",
|
|
484
|
+
pug: "^3.0.3",
|
|
485
|
+
puppeteer: "^24.9.0",
|
|
486
|
+
"sanitize-filename": "^1.6.3",
|
|
487
|
+
"sanitize-html": "^2.17.0",
|
|
488
|
+
sqlstring: "^2.3.3",
|
|
489
|
+
"timer-machine": "^1.1.0",
|
|
490
|
+
toposort: "^2.0.2",
|
|
491
|
+
untildify: "^5.0.0",
|
|
492
|
+
yargs: "^17.7.2",
|
|
493
|
+
yoctocolors: "^2.1.1"
|
|
494
|
+
},
|
|
495
|
+
devDependencies: {
|
|
496
|
+
"@types/archiver": "^6.0.3",
|
|
497
|
+
"@types/express": "^5.0.2",
|
|
498
|
+
"@types/insane": "^1.0.0",
|
|
499
|
+
"@types/js-beautify": "^1.14.3",
|
|
500
|
+
"@types/lodash-es": "^4.17.12",
|
|
501
|
+
"@types/morgan": "^1.9.9",
|
|
502
|
+
"@types/node": "^22.15.19",
|
|
503
|
+
"@types/pug": "^2.0.10",
|
|
504
|
+
"@types/sanitize-html": "^2.16.0",
|
|
505
|
+
"@types/timer-machine": "^1.1.3",
|
|
506
|
+
"@types/yargs": "^17.0.33",
|
|
507
|
+
husky: "^9.1.7",
|
|
508
|
+
"lint-staged": "^16.0.0",
|
|
509
|
+
prettier: "^3.5.3",
|
|
510
|
+
tsup: "^8.5.0",
|
|
511
|
+
typescript: "^5.8.3"
|
|
512
|
+
},
|
|
513
|
+
engines: {
|
|
514
|
+
node: ">= 20.11.0"
|
|
515
|
+
},
|
|
516
|
+
"release-it": {
|
|
517
|
+
github: {
|
|
518
|
+
release: true
|
|
519
|
+
},
|
|
520
|
+
plugins: {
|
|
521
|
+
"@release-it/keep-a-changelog": {
|
|
522
|
+
filename: "CHANGELOG.md"
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
hooks: {
|
|
526
|
+
"after:bump": "npm run build"
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
prettier: {
|
|
530
|
+
singleQuote: true
|
|
531
|
+
},
|
|
532
|
+
"lint-staged": {
|
|
533
|
+
"*.js": "prettier --write",
|
|
534
|
+
"*.ts": "prettier --write",
|
|
535
|
+
"*.json": "prettier --write"
|
|
536
|
+
}
|
|
537
|
+
};
|
|
411
538
|
|
|
412
539
|
// src/lib/utils.ts
|
|
540
|
+
var { version } = package_default;
|
|
413
541
|
var isTimepoint = (stoptime) => {
|
|
414
542
|
if (isNullOrEmpty(stoptime.timepoint)) {
|
|
415
543
|
return !isNullOrEmpty(stoptime.arrival_time) && !isNullOrEmpty(stoptime.departure_time);
|
|
@@ -844,10 +972,15 @@ var getStopOrder = (timetable, config2) => {
|
|
|
844
972
|
}
|
|
845
973
|
try {
|
|
846
974
|
const stopGraph = [];
|
|
975
|
+
const timepointStopIds = new Set(
|
|
976
|
+
timetable.orderedTrips.flatMap(
|
|
977
|
+
(trip) => trip.stoptimes.filter((stoptime) => isTimepoint(stoptime)).map((stoptime) => stoptime.stop_id)
|
|
978
|
+
)
|
|
979
|
+
);
|
|
847
980
|
for (const trip of timetable.orderedTrips) {
|
|
848
981
|
const sortedStopIds = trip.stoptimes.filter((stoptime) => {
|
|
849
982
|
if (config2.showOnlyTimepoint === true) {
|
|
850
|
-
return
|
|
983
|
+
return timepointStopIds.has(stoptime.stop_id);
|
|
851
984
|
}
|
|
852
985
|
return true;
|
|
853
986
|
}).map((stoptime) => stoptime.stop_id);
|
|
@@ -873,12 +1006,12 @@ var getStopOrder = (timetable, config2) => {
|
|
|
873
1006
|
(stoptime) => stoptime.stop_id
|
|
874
1007
|
);
|
|
875
1008
|
const missingStopIds = difference(
|
|
876
|
-
|
|
1009
|
+
new Set(
|
|
877
1010
|
timetable.orderedTrips.flatMap(
|
|
878
1011
|
(trip) => trip.stoptimes.map((stoptime) => stoptime.stop_id)
|
|
879
1012
|
)
|
|
880
1013
|
),
|
|
881
|
-
|
|
1014
|
+
new Set(stopIds)
|
|
882
1015
|
);
|
|
883
1016
|
if (missingStopIds.length > 0) {
|
|
884
1017
|
timetable.warnings.push(
|