gtfs-to-html 2.6.6 → 2.6.8

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/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.6.8] - 2024-06-21
9
+
10
+ ### Updated
11
+ - Dependency updates
12
+ - Improved convertRoutesToTimetablePages function
13
+
14
+ ## [2.6.7] - 2024-05-28
15
+
16
+ ### Fixed
17
+ - Handle config with no agency_key
18
+
19
+ ### Updated
20
+ - Dependency updates
21
+
8
22
  ## [2.6.6] - 2024-05-14
9
23
 
10
24
  ### Updated
@@ -68,7 +68,7 @@ const gtfsToHtml = async (initialConfig) => {
68
68
  }
69
69
 
70
70
  const agencyKey = config.agencies
71
- .map((agency) => agency.agency_key)
71
+ .map((agency) => agency.agency_key ?? 'unknown')
72
72
  .join('-');
73
73
  const exportPath = path.join(process.cwd(), 'html', sanitize(agencyKey));
74
74
  const outputStats = {
package/lib/utils.js CHANGED
@@ -579,25 +579,41 @@ const convertRoutesToTimetablePages = (config) => {
579
579
  {
580
580
  route_id: route.route_id,
581
581
  },
582
- ['trip_headsign', 'direction_id'],
582
+ ['trip_headsign', 'direction_id', 'trip_id', 'service_id'],
583
583
  );
584
584
  const directions = uniqBy(trips, (trip) => trip.direction_id);
585
585
  const dayGroups = groupBy(calendars, calendarToCalendarCode);
586
586
  const calendarDateGroups = groupBy(calendarDates, 'service_id');
587
587
 
588
588
  return directions.map((direction) => [
589
- Object.values(dayGroups).map((calendars) =>
590
- convertRouteToTimetablePage(route, direction, calendars, null, config),
591
- ),
592
- Object.values(calendarDateGroups).map((calendarDates) =>
593
- convertRouteToTimetablePage(
594
- route,
595
- direction,
596
- null,
597
- calendarDates,
598
- config,
599
- ),
600
- ),
589
+ Object.values(dayGroups).map((calendars) => {
590
+ const tripsForCalendars = trips.filter((trip) =>
591
+ some(calendars, { service_id: trip.service_id }),
592
+ );
593
+ if (tripsForCalendars.length > 0) {
594
+ return convertRouteToTimetablePage(
595
+ route,
596
+ direction,
597
+ calendars,
598
+ null,
599
+ config,
600
+ );
601
+ }
602
+ }),
603
+ Object.values(calendarDateGroups).map((calendarDates) => {
604
+ const tripsForCalendarDates = trips.filter((trip) =>
605
+ some(calendarDates, { service_id: trip.service_id }),
606
+ );
607
+ if (tripsForCalendarDates.length > 0) {
608
+ return convertRouteToTimetablePage(
609
+ route,
610
+ direction,
611
+ null,
612
+ calendarDates,
613
+ config,
614
+ );
615
+ }
616
+ }),
601
617
  ]);
602
618
  });
603
619
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gtfs-to-html",
3
- "version": "2.6.6",
3
+ "version": "2.6.8",
4
4
  "private": false,
5
5
  "description": "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
6
6
  "keywords": [
@@ -35,23 +35,23 @@
35
35
  "start": "node ./app"
36
36
  },
37
37
  "dependencies": {
38
- "@turf/helpers": "^6.5.0",
39
- "@turf/simplify": "^6.5.0",
38
+ "@turf/helpers": "^7.0.0",
39
+ "@turf/simplify": "^7.0.0",
40
40
  "archiver": "^7.0.1",
41
41
  "cli-table": "^0.3.11",
42
42
  "copy-dir": "^1.3.0",
43
43
  "csv-stringify": "^6.5.0",
44
44
  "express": "^4.19.2",
45
- "gtfs": "^4.10.4",
45
+ "gtfs": "^4.12.0",
46
46
  "insane": "^2.6.2",
47
47
  "js-beautify": "^1.15.1",
48
48
  "lodash-es": "^4.17.21",
49
- "marked": "^12.0.2",
49
+ "marked": "^13.0.0",
50
50
  "moment": "^2.30.1",
51
51
  "morgan": "^1.10.0",
52
52
  "pretty-error": "^4.0.0",
53
- "pug": "^3.0.2",
54
- "puppeteer": "^22.8.1",
53
+ "pug": "^3.0.3",
54
+ "puppeteer": "^22.12.0",
55
55
  "sanitize-filename": "^1.6.3",
56
56
  "sqlstring": "^2.3.3",
57
57
  "timer-machine": "^1.1.0",
@@ -62,8 +62,8 @@
62
62
  },
63
63
  "devDependencies": {
64
64
  "husky": "^9.0.11",
65
- "lint-staged": "^15.2.2",
66
- "prettier": "^3.2.5"
65
+ "lint-staged": "^15.2.7",
66
+ "prettier": "^3.3.2"
67
67
  },
68
68
  "engines": {
69
69
  "node": ">= 18.0.0"
@@ -81,7 +81,7 @@ API along with your API token.
81
81
  "agencies": [
82
82
  {
83
83
  "agency_key": "county-connection",
84
- "url": "http://cccta.org/GTFS/google_transit.zip"
84
+ "url": "https://countyconnection.com/GTFS/google_transit.zip"
85
85
  }
86
86
  ]
87
87
  }
@@ -278,7 +278,7 @@ const config = {
278
278
  agencies: [
279
279
  {
280
280
  agency_key: 'county-connection',
281
- url: 'http://countyconnection.com/GTFS/google_transit.zip',
281
+ url: 'https://countyconnection.com/GTFS/google_transit.zip',
282
282
  exclude: ['shapes'],
283
283
  },
284
284
  ],
package/www/package.json CHANGED
@@ -9,11 +9,11 @@
9
9
  "deploy": "docusaurus deploy"
10
10
  },
11
11
  "dependencies": {
12
- "@docusaurus/core": "^3.2.1",
13
- "@docusaurus/preset-classic": "^3.2.1",
14
- "clsx": "^2.1.0",
15
- "react": "^18.2.0",
16
- "react-dom": "^18.2.0"
12
+ "@docusaurus/core": "^3.4.0",
13
+ "@docusaurus/preset-classic": "^3.4.0",
14
+ "clsx": "^2.1.1",
15
+ "react": "^18.3.1",
16
+ "react-dom": "^18.3.1"
17
17
  },
18
18
  "engines": {
19
19
  "node": ">=18.0"