gtfs-to-html 2.12.9 → 2.12.11

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/README.md CHANGED
@@ -121,6 +121,13 @@ Are you using `gtfs-to-html`? Let us know via email [gtfs@blinktag.com](mailto:g
121
121
 
122
122
  Pull requests are welcome, as well as [feedback and reporting issues](https://github.com/blinktaginc/gtfs-to-html/issues).
123
123
 
124
+ ### Development Setup
125
+
126
+ pnpm install
127
+ pnpm run build
128
+
129
+ `pnpm install` installs dependencies. `pnpm run build` compiles TypeScript and vendors browser-compatible libraries (maplibre-gl, pbf, anchorme, etc.) from devDependencies into `dist/browser` via `scripts/copy-browser-assets.js`. These vendored files are included in the published npm package so consumers don't need to run any postinstall steps.
130
+
124
131
  ## Tests
125
132
 
126
133
  npm test
package/dist/app/index.js CHANGED
@@ -330,27 +330,6 @@ function isGtfsToHtmlError(error) {
330
330
  return candidate.name === "GtfsToHtmlError" && typeof candidate.message === "string" && typeof candidate.code === "string" && typeof candidate.category === "string" && typeof candidate.isOperational === "boolean";
331
331
  }
332
332
 
333
- // src/lib/log-utils.ts
334
- import { clearLine, cursorTo } from "readline";
335
- import { noop } from "lodash-es";
336
- import * as colors from "yoctocolors";
337
- import { getAgencies, getFeedInfo, isGtfsError as isGtfsError2, formatGtfsError } from "gtfs";
338
- import Table from "cli-table";
339
- function logWarning(config2) {
340
- if (config2.logFunction) {
341
- return config2.logFunction;
342
- }
343
- return (text) => {
344
- process.stdout.write(`
345
- ${formatWarning(text)}
346
- `);
347
- };
348
- }
349
- function formatWarning(text) {
350
- const warningMessage = `${colors.underline("Warning")}: ${text}`;
351
- return colors.yellow(warningMessage);
352
- }
353
-
354
333
  // src/lib/file-utils.ts
355
334
  var homeDirectory = homedir();
356
335
  function getPathToThisModuleFolder() {
@@ -426,6 +405,27 @@ import { getShapesAsGeoJSON, getStopsAsGeoJSON } from "gtfs";
426
405
  import simplify from "@turf/simplify";
427
406
  import { featureCollection, round } from "@turf/helpers";
428
407
 
408
+ // src/lib/log-utils.ts
409
+ import { clearLine, cursorTo } from "readline";
410
+ import { noop } from "lodash-es";
411
+ import * as colors from "yoctocolors";
412
+ import { getAgencies, getFeedInfo, isGtfsError as isGtfsError2, formatGtfsError } from "gtfs";
413
+ import Table from "cli-table";
414
+ function logWarning(config2) {
415
+ if (config2.logFunction) {
416
+ return config2.logFunction;
417
+ }
418
+ return (text) => {
419
+ process.stdout.write(`
420
+ ${formatWarning(text)}
421
+ `);
422
+ };
423
+ }
424
+ function formatWarning(text) {
425
+ const warningMessage = `${colors.underline("Warning")}: ${text}`;
426
+ return colors.yellow(warningMessage);
427
+ }
428
+
429
429
  // src/lib/trip-id-utils.ts
430
430
  var getBaseTripId = (tripId) => tripId.replace(/_freq_\d+$/, "");
431
431
  var getBaseTripIds = (trips) => Array.from(new Set(trips.map((trip) => getBaseTripId(trip.trip_id))));
@@ -509,7 +509,7 @@ function getAgencyGeoJSON(config2) {
509
509
  // package.json
510
510
  var package_default = {
511
511
  name: "gtfs-to-html",
512
- version: "2.12.9",
512
+ version: "2.12.11",
513
513
  private: false,
514
514
  description: "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
515
515
  keywords: [
@@ -552,33 +552,27 @@ var package_default = {
552
552
  "gtfs-to-html": "dist/bin/gtfs-to-html.js"
553
553
  },
554
554
  scripts: {
555
- build: "tsup",
556
- postbuild: "node scripts/postinstall.js",
555
+ build: "tsup && node scripts/copy-browser-assets.js",
557
556
  start: "node ./dist/app",
558
557
  prepare: "husky && pnpm run build",
559
- postinstall: "node scripts/postinstall.js"
558
+ prepack: "husky && pnpm run build"
560
559
  },
561
560
  dependencies: {
562
- "@maplibre/maplibre-gl-geocoder": "^1.9.4",
563
561
  "@turf/helpers": "^7.3.5",
564
562
  "@turf/simplify": "^7.3.5",
565
- anchorme: "^3.0.8",
566
563
  archiver: "^8.0.0",
567
564
  "cli-table": "^0.3.11",
568
565
  "css.escape": "^1.5.1",
569
566
  "csv-stringify": "^6.7.0",
570
567
  express: "^5.2.1",
571
- gtfs: "^4.18.5",
572
- "gtfs-realtime-pbf-js-module": "^1.0.0",
568
+ gtfs: "^4.18.6",
573
569
  "js-beautify": "^1.15.4",
574
570
  "lodash-es": "^4.18.1",
575
- "maplibre-gl": "^5.24.0",
576
- marked: "^18.0.3",
571
+ marked: "^18.0.4",
577
572
  moment: "^2.30.1",
578
- pbf: "^4.0.1",
579
573
  "pretty-error": "^4.0.0",
580
574
  pug: "^3.0.4",
581
- puppeteer: "^24.43.1",
575
+ puppeteer: "^25.0.4",
582
576
  "sanitize-filename": "^1.6.4",
583
577
  "sanitize-html": "^2.17.4",
584
578
  sqlstring: "^2.3.3",
@@ -587,6 +581,7 @@ var package_default = {
587
581
  yoctocolors: "^2.1.2"
588
582
  },
589
583
  devDependencies: {
584
+ "@maplibre/maplibre-gl-geocoder": "^1.9.4",
590
585
  "@types/archiver": "^7.0.0",
591
586
  "@types/cli-table": "^0.3.4",
592
587
  "@types/express": "^5.0.6",
@@ -598,8 +593,12 @@ var package_default = {
598
593
  "@types/sqlstring": "^2.3.2",
599
594
  "@types/toposort": "^2.0.7",
600
595
  "@types/yargs": "^17.0.35",
596
+ anchorme: "^3.0.8",
597
+ "gtfs-realtime-pbf-js-module": "^1.0.0",
601
598
  husky: "^9.1.7",
602
- "lint-staged": "^17.0.4",
599
+ "lint-staged": "^17.0.5",
600
+ "maplibre-gl": "^5.24.0",
601
+ pbf: "^4.0.2",
603
602
  prettier: "^3.8.3",
604
603
  tsup: "^8.5.1",
605
604
  typescript: "^6.0.3"
@@ -607,7 +606,7 @@ var package_default = {
607
606
  engines: {
608
607
  node: ">= 22"
609
608
  },
610
- packageManager: "pnpm@11.1.1+sha512.d1fdf5f73c617b64fa1a56a81c3c8dfe0e966e33a6010aa256b517ae77be21d93e05affc0de1a83b0e4f29d569f68b446ae8f068cd7247c0bb3df0fb4d7bdf9a",
609
+ packageManager: "pnpm@11.3.0",
611
610
  "release-it": {
612
611
  github: {
613
612
  release: true
@@ -2446,30 +2445,12 @@ app.use((req, res, next) => {
2446
2445
  });
2447
2446
  var staticAssetPath = config.templatePath === void 0 ? getPathToViewsFolder(config) : untildify(config.templatePath);
2448
2447
  app.use(express.static(staticAssetPath));
2449
- var frontendLibraryPaths = [
2450
- { route: "/js", package: "pbf", subPath: "dist" },
2451
- { route: "/js", package: "gtfs-realtime-pbf-js-module", subPath: "" },
2452
- { route: "/js", package: "anchorme", subPath: "../../dist/browser" },
2453
- { route: "/js", package: "maplibre-gl", subPath: "../dist" },
2454
- {
2455
- route: "/js",
2456
- package: "@maplibre/maplibre-gl-geocoder",
2457
- subPath: "../dist"
2458
- },
2459
- { route: "/css", package: "maplibre-gl", subPath: "../dist" },
2460
- {
2461
- route: "/css",
2462
- package: "@maplibre/maplibre-gl-geocoder",
2463
- subPath: "../dist"
2464
- }
2465
- ];
2466
- var resolvePackagePath = (packageName, subPath) => {
2467
- const packagePath = dirname2(fileURLToPath2(import.meta.resolve(packageName)));
2468
- return subPath ? join2(packagePath, subPath) : packagePath;
2469
- };
2470
- for (const { route, package: pkg, subPath } of frontendLibraryPaths) {
2471
- app.use(route, express.static(resolvePackagePath(pkg, subPath)));
2472
- }
2448
+ var browserAssetsPath = join2(
2449
+ dirname2(fileURLToPath2(import.meta.url)),
2450
+ "../browser"
2451
+ );
2452
+ app.use("/js", express.static(browserAssetsPath));
2453
+ app.use("/css", express.static(browserAssetsPath));
2473
2454
  app.get("/", async (req, res, next) => {
2474
2455
  try {
2475
2456
  const timetablePages = [];