minotor 10.0.1 → 11.0.0

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.
Files changed (87) hide show
  1. package/.cspell.json +65 -42
  2. package/CHANGELOG.md +9 -3
  3. package/LICENSE +1 -1
  4. package/README.md +7 -6
  5. package/dist/cli/perf.d.ts +2 -2
  6. package/dist/cli.mjs +560 -711
  7. package/dist/cli.mjs.map +1 -1
  8. package/dist/gtfs/profiles/extended.d.ts +2 -0
  9. package/dist/gtfs/profiles/standard.d.ts +1 -1
  10. package/dist/parser.cjs.js +393 -614
  11. package/dist/parser.cjs.js.map +1 -1
  12. package/dist/parser.d.ts +3 -2
  13. package/dist/parser.esm.js +392 -614
  14. package/dist/parser.esm.js.map +1 -1
  15. package/dist/router.cjs.js +1 -1
  16. package/dist/router.cjs.js.map +1 -1
  17. package/dist/router.d.ts +1 -2
  18. package/dist/router.esm.js +1 -1
  19. package/dist/router.esm.js.map +1 -1
  20. package/dist/router.umd.js +1 -1
  21. package/dist/router.umd.js.map +1 -1
  22. package/dist/routing/query.d.ts +11 -12
  23. package/dist/routing/result.d.ts +9 -5
  24. package/dist/routing/route.d.ts +5 -6
  25. package/dist/routing/router.d.ts +1 -2
  26. package/dist/stops/io.d.ts +1 -1
  27. package/dist/stops/proto/{stops.d.ts → v1/stops.d.ts} +8 -8
  28. package/dist/stops/stops.d.ts +1 -1
  29. package/dist/stops/stopsIndex.d.ts +1 -1
  30. package/dist/timetable/io.d.ts +2 -2
  31. package/dist/timetable/proto/{timetable.d.ts → v1/timetable.d.ts} +18 -17
  32. package/dist/timetable/route.d.ts +7 -10
  33. package/dist/timetable/time.d.ts +64 -115
  34. package/dist/timetable/timetable.d.ts +1 -2
  35. package/package.json +8 -8
  36. package/src/__e2e__/router.test.ts +29 -15
  37. package/src/__e2e__/timetable/stops.bin +2 -2
  38. package/src/__e2e__/timetable/timetable.bin +2 -2
  39. package/src/cli/minotor.ts +14 -5
  40. package/src/cli/perf.ts +20 -17
  41. package/src/cli/repl.ts +30 -22
  42. package/src/gtfs/__tests__/parser.test.ts +13 -11
  43. package/src/gtfs/__tests__/time.test.ts +2 -2
  44. package/src/gtfs/__tests__/transfers.test.ts +18 -19
  45. package/src/gtfs/__tests__/trips.test.ts +43 -49
  46. package/src/gtfs/parser.ts +2 -2
  47. package/src/gtfs/profiles/__tests__/extended.test.ts +15 -0
  48. package/src/gtfs/profiles/extended.ts +146 -0
  49. package/src/gtfs/profiles/standard.ts +1 -1
  50. package/src/gtfs/routes.ts +2 -2
  51. package/src/gtfs/time.ts +2 -2
  52. package/src/gtfs/transfers.ts +5 -6
  53. package/src/gtfs/trips.ts +5 -5
  54. package/src/parser.ts +3 -2
  55. package/src/router.ts +1 -2
  56. package/src/routing/__tests__/plotter.test.ts +14 -15
  57. package/src/routing/__tests__/result.test.ts +95 -96
  58. package/src/routing/__tests__/route.test.ts +9 -19
  59. package/src/routing/__tests__/router.test.ts +191 -228
  60. package/src/routing/plotter.ts +11 -7
  61. package/src/routing/query.ts +12 -15
  62. package/src/routing/result.ts +55 -22
  63. package/src/routing/route.ts +34 -36
  64. package/src/routing/router.ts +28 -22
  65. package/src/stops/__tests__/stopFinder.test.ts +3 -3
  66. package/src/stops/io.ts +13 -16
  67. package/src/stops/proto/v1/stops.proto +27 -0
  68. package/src/stops/proto/{stops.ts → v1/stops.ts} +41 -54
  69. package/src/stops/stops.ts +1 -1
  70. package/src/stops/stopsIndex.ts +5 -7
  71. package/src/timetable/__tests__/io.test.ts +15 -26
  72. package/src/timetable/__tests__/route.test.ts +31 -43
  73. package/src/timetable/__tests__/time.test.ts +79 -461
  74. package/src/timetable/__tests__/timetable.test.ts +16 -17
  75. package/src/timetable/io.ts +38 -35
  76. package/src/timetable/proto/{timetable.proto → v1/timetable.proto} +29 -28
  77. package/src/timetable/proto/{timetable.ts → v1/timetable.ts} +103 -109
  78. package/src/timetable/route.ts +25 -55
  79. package/src/timetable/time.ts +125 -229
  80. package/src/timetable/timetable.ts +2 -10
  81. package/dist/gtfs/profiles/ch.d.ts +0 -2
  82. package/dist/timetable/duration.d.ts +0 -46
  83. package/src/gtfs/profiles/__tests__/ch.test.ts +0 -15
  84. package/src/gtfs/profiles/ch.ts +0 -53
  85. package/src/stops/proto/stops.proto +0 -27
  86. package/src/timetable/duration.ts +0 -78
  87. /package/dist/gtfs/profiles/__tests__/{ch.test.d.ts → extended.test.d.ts} +0 -0
package/.cspell.json CHANGED
@@ -2,58 +2,81 @@
2
2
  "version": "0.2",
3
3
  "language": "en",
4
4
  "words": [
5
- "Minotor",
6
- "gtfs",
7
- "minotor",
8
- "luxon",
9
- "Gtfs",
10
- "GTFS",
11
- "Tilleul",
12
- "Cathédrale",
13
- "tcrqn",
14
- "tcrqo",
15
- "lswfbh",
16
- "Neuveville",
17
- "Cathedrale",
5
+ "alightable",
6
+ "Ascenseur",
7
+ "Aufzug",
8
+ "bgcolor",
9
+ "boardable",
18
10
  "bufbuild",
19
- "protoc",
11
+ "Bulle",
12
+ "catchable",
13
+ "Cathedrale",
14
+ "Cathédrale",
15
+ "Davos",
16
+ "Delling",
17
+ "Dolderbahn",
18
+ "dolmuş",
19
+ "dropoff",
20
+ "Dymchurch",
21
+ "Engadin",
22
+ "Eurostar",
23
+ "fontname",
24
+ "Francey",
25
+ "funi",
26
+ "gare",
27
+ "Gatwick",
20
28
  "geokdbush",
21
- "kdbush",
22
- "slimsearch",
23
29
  "geospatial",
24
- "NeTEx",
30
+ "GNER",
31
+ "graphviz",
32
+ "Gruyères",
33
+ "GTFS",
34
+ "Gtfs",
35
+ "gtfs",
36
+ "Haut",
37
+ "Heathrow",
38
+ "Hythe",
39
+ "isochrone",
40
+ "kdbush",
41
+ "Klosters",
25
42
  "Ksfdp",
26
- "Tsvg",
27
43
  "Landquart",
28
- "Davos",
29
- "moleson",
30
- "Klosters",
31
- "Engadin",
32
- "isochrone",
33
- "Delling",
44
+ "lswfbh",
45
+ "luxon",
46
+ "Marshrutka",
47
+ "Métro",
48
+ "Minotor",
49
+ "minotor",
50
+ "Mmin",
34
51
  "Moléson",
35
- "Bulle",
36
- "Gruyères",
37
- "gare",
38
- "funi",
39
- "Francey",
40
- "téléphérique",
52
+ "moleson",
53
+ "Montjuïc",
41
54
  "Moritz",
42
- "Haut",
43
- "Rhin",
55
+ "Naye",
56
+ "NeTEx",
57
+ "Neuveville",
58
+ "nodesep",
44
59
  "Olten",
45
- "graphviz",
60
+ "penwidth",
61
+ "protoc",
46
62
  "rankdir",
47
- "bgcolor",
48
- "nodesep",
49
63
  "ranksep",
50
- "fontname",
51
- "dropoff",
52
- "boardable",
53
- "alightable",
54
- "penwidth",
55
- "catchable",
56
- "Tpng"
64
+ "Regio",
65
+ "Regionalzug",
66
+ "Rhin",
67
+ "Rigiblick",
68
+ "Rochers",
69
+ "Roissy",
70
+ "slimsearch",
71
+ "tcrqn",
72
+ "tcrqo",
73
+ "Telecabin",
74
+ "Telefèric",
75
+ "téléphérique",
76
+ "Tilleul",
77
+ "Tpng",
78
+ "Tsvg",
79
+ "Wokingham"
57
80
  ],
58
81
  "flagWords": [],
59
82
  "ignorePaths": [
package/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
- ## [10.0.1](https://github.com/aubryio/minotor/compare/v10.0.0...v10.0.1) (2026-01-25)
1
+ # [11.0.0](https://github.com/aubryio/minotor/compare/v10.1.0...v11.0.0) (2026-04-13)
2
2
 
3
3
 
4
- ### Bug Fixes
4
+ ### Performance Improvements
5
5
 
6
- * update dependencies to fix vulnerability ([b001ace](https://github.com/aubryio/minotor/commit/b001ace5b7d7c17f28308d71a1174b165cad63a7))
6
+ * use plain numbers to represent times and durations ([#61](https://github.com/aubryio/minotor/issues/61)) ([b72cc6d](https://github.com/aubryio/minotor/commit/b72cc6d2ed7c0ccabc6b0c0c0c0c1e07fd4b77be))
7
+
8
+
9
+ ### BREAKING CHANGES
10
+
11
+ * new protobuf format and versioning scheme incompatible with earlier versions of the
12
+ library.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024-2025 Aubry Cholleton
3
+ Copyright (c) 2024-2026 Aubry Cholleton
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -42,7 +42,7 @@ A more complete isochrone map showcase can be found on [isochrone.ch](https://is
42
42
 
43
43
  | Feed | Parsing time | Timetable Size for a Day (Compressed) |
44
44
  | ------------------------------------------------------------------------------------------ | ------------ | ------------------------------------- |
45
- | [Swiss GTFS feed](https://data.opentransportdata.swiss/en/dataset/timetable-2025-gtfs2020) | ~2 minutes | 20 MB (5MB) |
45
+ | [Swiss GTFS feed](https://data.opentransportdata.swiss/en/dataset/timetable-2026-gtfs2020) | ~2 minutes | 20 MB (5MB) |
46
46
 
47
47
  ## Get started
48
48
 
@@ -55,10 +55,11 @@ A more complete isochrone map showcase can be found on [isochrone.ch](https://is
55
55
  #### GTFS Feed parsing (Node.js only)
56
56
 
57
57
  ```
58
- import { GtfsParser, chGtfsProfile } from 'minotor/parser';
58
+ import { GtfsParser, extendedGtfsProfile } from 'minotor/parser';
59
59
 
60
- const parser = new GtfsParser('gtfs-feed.zip', chGtfsProfile);
61
- const { timetable, stopsIndex } = await parser.parse(new Date());
60
+ const parser = new GtfsParser('gtfs-feed.zip', extendedGtfsProfile);
61
+ const timetable = await parser.parseTimetable(new Date());
62
+ const stopsIndex = await parser.parseStops();
62
63
  ```
63
64
 
64
65
  Note that times are only represented at the minute level so they can fit on 16 bits.
@@ -83,14 +84,14 @@ Or by location:
83
84
  #### Routing (Browser or Node.js)
84
85
 
85
86
  ```
86
- import { Query, Router, Time } from 'minotor';
87
+ import { Query, Router } from 'minotor';
87
88
 
88
89
  const router = new Router(timetable, stopsIndex);
89
90
 
90
91
  const query = new Query.Builder()
91
92
  .from('Parent8504100')
92
93
  .to('Parent8504748')
93
- .departureTime(Time.fromHMS(8,0,0))
94
+ .departureTime(8*60)
94
95
  .maxTransfers(5)
95
96
  .build();
96
97
  const result = router.route(query);
@@ -9,7 +9,7 @@ type PerformanceResult = {
9
9
  * @param filePath
10
10
  * @returns
11
11
  */
12
- export declare const loadQueriesFromJson: (filePath: string) => Query[];
12
+ export declare const loadQueriesFromJson: (filePath: string, stopsIndex: StopsIndex) => Query[];
13
13
  /**
14
14
  *
15
15
  * @param router
@@ -18,7 +18,7 @@ export declare const loadQueriesFromJson: (filePath: string) => Query[];
18
18
  * @param iterations
19
19
  * @returns
20
20
  */
21
- export declare const testRouterPerformance: (router: Router, stopsIndex: StopsIndex, tasks: Query[], iterations: number) => PerformanceResult[];
21
+ export declare const testRouterPerformance: (router: Router, tasks: Query[], iterations: number) => PerformanceResult[];
22
22
  /**
23
23
  *
24
24
  * @param results