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.
- package/.cspell.json +65 -42
- package/CHANGELOG.md +9 -3
- package/LICENSE +1 -1
- package/README.md +7 -6
- package/dist/cli/perf.d.ts +2 -2
- package/dist/cli.mjs +560 -711
- package/dist/cli.mjs.map +1 -1
- package/dist/gtfs/profiles/extended.d.ts +2 -0
- package/dist/gtfs/profiles/standard.d.ts +1 -1
- package/dist/parser.cjs.js +393 -614
- package/dist/parser.cjs.js.map +1 -1
- package/dist/parser.d.ts +3 -2
- package/dist/parser.esm.js +392 -614
- package/dist/parser.esm.js.map +1 -1
- package/dist/router.cjs.js +1 -1
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.d.ts +1 -2
- package/dist/router.esm.js +1 -1
- package/dist/router.esm.js.map +1 -1
- package/dist/router.umd.js +1 -1
- package/dist/router.umd.js.map +1 -1
- package/dist/routing/query.d.ts +11 -12
- package/dist/routing/result.d.ts +9 -5
- package/dist/routing/route.d.ts +5 -6
- package/dist/routing/router.d.ts +1 -2
- package/dist/stops/io.d.ts +1 -1
- package/dist/stops/proto/{stops.d.ts → v1/stops.d.ts} +8 -8
- package/dist/stops/stops.d.ts +1 -1
- package/dist/stops/stopsIndex.d.ts +1 -1
- package/dist/timetable/io.d.ts +2 -2
- package/dist/timetable/proto/{timetable.d.ts → v1/timetable.d.ts} +18 -17
- package/dist/timetable/route.d.ts +7 -10
- package/dist/timetable/time.d.ts +64 -115
- package/dist/timetable/timetable.d.ts +1 -2
- package/package.json +8 -8
- package/src/__e2e__/router.test.ts +29 -15
- package/src/__e2e__/timetable/stops.bin +2 -2
- package/src/__e2e__/timetable/timetable.bin +2 -2
- package/src/cli/minotor.ts +14 -5
- package/src/cli/perf.ts +20 -17
- package/src/cli/repl.ts +30 -22
- package/src/gtfs/__tests__/parser.test.ts +13 -11
- package/src/gtfs/__tests__/time.test.ts +2 -2
- package/src/gtfs/__tests__/transfers.test.ts +18 -19
- package/src/gtfs/__tests__/trips.test.ts +43 -49
- package/src/gtfs/parser.ts +2 -2
- package/src/gtfs/profiles/__tests__/extended.test.ts +15 -0
- package/src/gtfs/profiles/extended.ts +146 -0
- package/src/gtfs/profiles/standard.ts +1 -1
- package/src/gtfs/routes.ts +2 -2
- package/src/gtfs/time.ts +2 -2
- package/src/gtfs/transfers.ts +5 -6
- package/src/gtfs/trips.ts +5 -5
- package/src/parser.ts +3 -2
- package/src/router.ts +1 -2
- package/src/routing/__tests__/plotter.test.ts +14 -15
- package/src/routing/__tests__/result.test.ts +95 -96
- package/src/routing/__tests__/route.test.ts +9 -19
- package/src/routing/__tests__/router.test.ts +191 -228
- package/src/routing/plotter.ts +11 -7
- package/src/routing/query.ts +12 -15
- package/src/routing/result.ts +55 -22
- package/src/routing/route.ts +34 -36
- package/src/routing/router.ts +28 -22
- package/src/stops/__tests__/stopFinder.test.ts +3 -3
- package/src/stops/io.ts +13 -16
- package/src/stops/proto/v1/stops.proto +27 -0
- package/src/stops/proto/{stops.ts → v1/stops.ts} +41 -54
- package/src/stops/stops.ts +1 -1
- package/src/stops/stopsIndex.ts +5 -7
- package/src/timetable/__tests__/io.test.ts +15 -26
- package/src/timetable/__tests__/route.test.ts +31 -43
- package/src/timetable/__tests__/time.test.ts +79 -461
- package/src/timetable/__tests__/timetable.test.ts +16 -17
- package/src/timetable/io.ts +38 -35
- package/src/timetable/proto/{timetable.proto → v1/timetable.proto} +29 -28
- package/src/timetable/proto/{timetable.ts → v1/timetable.ts} +103 -109
- package/src/timetable/route.ts +25 -55
- package/src/timetable/time.ts +125 -229
- package/src/timetable/timetable.ts +2 -10
- package/dist/gtfs/profiles/ch.d.ts +0 -2
- package/dist/timetable/duration.d.ts +0 -46
- package/src/gtfs/profiles/__tests__/ch.test.ts +0 -15
- package/src/gtfs/profiles/ch.ts +0 -53
- package/src/stops/proto/stops.proto +0 -27
- package/src/timetable/duration.ts +0 -78
- /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
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
44
|
+
"lswfbh",
|
|
45
|
+
"luxon",
|
|
46
|
+
"Marshrutka",
|
|
47
|
+
"Métro",
|
|
48
|
+
"Minotor",
|
|
49
|
+
"minotor",
|
|
50
|
+
"Mmin",
|
|
34
51
|
"Moléson",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"gare",
|
|
38
|
-
"funi",
|
|
39
|
-
"Francey",
|
|
40
|
-
"téléphérique",
|
|
52
|
+
"moleson",
|
|
53
|
+
"Montjuïc",
|
|
41
54
|
"Moritz",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
55
|
+
"Naye",
|
|
56
|
+
"NeTEx",
|
|
57
|
+
"Neuveville",
|
|
58
|
+
"nodesep",
|
|
44
59
|
"Olten",
|
|
45
|
-
"
|
|
60
|
+
"penwidth",
|
|
61
|
+
"protoc",
|
|
46
62
|
"rankdir",
|
|
47
|
-
"bgcolor",
|
|
48
|
-
"nodesep",
|
|
49
63
|
"ranksep",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
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
|
-
|
|
1
|
+
# [11.0.0](https://github.com/aubryio/minotor/compare/v10.1.0...v11.0.0) (2026-04-13)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Performance Improvements
|
|
5
5
|
|
|
6
|
-
*
|
|
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
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-
|
|
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,
|
|
58
|
+
import { GtfsParser, extendedGtfsProfile } from 'minotor/parser';
|
|
59
59
|
|
|
60
|
-
const parser = new GtfsParser('gtfs-feed.zip',
|
|
61
|
-
const
|
|
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
|
|
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(
|
|
94
|
+
.departureTime(8*60)
|
|
94
95
|
.maxTransfers(5)
|
|
95
96
|
.build();
|
|
96
97
|
const result = router.route(query);
|
package/dist/cli/perf.d.ts
CHANGED
|
@@ -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,
|
|
21
|
+
export declare const testRouterPerformance: (router: Router, tasks: Query[], iterations: number) => PerformanceResult[];
|
|
22
22
|
/**
|
|
23
23
|
*
|
|
24
24
|
* @param results
|