minotor 1.0.2 → 1.0.3

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.
@@ -1,5 +1,5 @@
1
1
  import { StopId } from '../stops/stops.js';
2
- import { StopsIndex } from '../umdIndex.js';
2
+ import { StopsIndex } from '../stops/stopsIndex.js';
3
3
  import { Query } from './query.js';
4
4
  import { Route } from './route.js';
5
5
  import { ReachingTime, TripLeg } from './router.js';
@@ -1,7 +1,7 @@
1
1
  import { StopId } from '../stops/stops.js';
2
+ import { StopsIndex } from '../stops/stopsIndex.js';
2
3
  import { Time } from '../timetable/time.js';
3
4
  import { Timetable } from '../timetable/timetable.js';
4
- import { StopsIndex } from '../umdIndex.js';
5
5
  import { Query } from './query.js';
6
6
  import { Result } from './result.js';
7
7
  import { Leg } from './route.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minotor",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A lightweight client-side transit router.",
5
5
  "keywords": [
6
6
  "minotor",
@@ -22,20 +22,25 @@
22
22
  "url": "https://github.com/aubryio/minotor.git"
23
23
  },
24
24
  "type": "module",
25
- "main": "dist/bundle.cjs.js",
26
- "module": "dist/bundle.esm.js",
27
- "browser": "dist/bundle.umd.js",
25
+ "main": "dist/router.cjs.js",
26
+ "module": "dist/router.esm.js",
27
+ "browser": "dist/router.umd.js",
28
+ "types": "./dist/router.d.ts",
28
29
  "bin": {
29
30
  "minotor": "./dist/cli.mjs"
30
31
  },
31
32
  "exports": {
32
33
  ".": {
33
- "import": "./dist/bundle.esm.js",
34
- "require": "./dist/bundle.cjs.js",
35
- "types": "./dist/index.d.ts"
34
+ "import": "./dist/router.esm.js",
35
+ "require": "./dist/router.cjs.js",
36
+ "types": "./dist/router.d.ts"
37
+ },
38
+ "./parser.js": {
39
+ "import": "./dist/parser.esm.js",
40
+ "require": "./dist/parser.cjs.js",
41
+ "types": "./dist/parser.d.ts"
36
42
  }
37
43
  },
38
- "types": "./dist/index.d.ts",
39
44
  "engines": {
40
45
  "node": ">=21.1.0",
41
46
  "npm": ">=10.9.1"
package/rollup.config.js CHANGED
@@ -5,26 +5,37 @@ import terser from '@rollup/plugin-terser';
5
5
 
6
6
  export default [
7
7
  {
8
- input: 'src/umdIndex.ts',
9
- output: {
10
- file: 'dist/bundle.umd.js',
11
- format: 'umd',
12
- name: 'minotor',
13
- sourcemap: true,
14
- },
8
+ input: 'src/router.ts',
9
+ output: [
10
+ {
11
+ file: 'dist/router.umd.js',
12
+ format: 'umd',
13
+ name: 'minotor',
14
+ sourcemap: true,
15
+ },
16
+ {
17
+ file: 'dist/router.esm.js',
18
+ format: 'es',
19
+ sourcemap: true,
20
+ },
21
+ {
22
+ file: 'dist/router.cjs.js',
23
+ format: 'cjs',
24
+ sourcemap: true,
25
+ },
26
+ ],
15
27
  plugins: [resolve(), commonjs(), typescript(), terser()],
16
28
  },
17
- // CommonJS and ES module builds for Node.js and bundlers
18
29
  {
19
- input: 'src/index.ts',
30
+ input: 'src/parser.ts',
20
31
  output: [
21
32
  {
22
- file: 'dist/bundle.esm.js',
33
+ file: 'dist/parser.esm.js',
23
34
  format: 'es',
24
35
  sourcemap: true,
25
36
  },
26
37
  {
27
- file: 'dist/bundle.cjs.js',
38
+ file: 'dist/parser.cjs.js',
28
39
  format: 'cjs',
29
40
  sourcemap: true,
30
41
  },
@@ -3,7 +3,7 @@ import fs from 'fs';
3
3
  import log from 'loglevel';
4
4
  import { DateTime } from 'luxon';
5
5
 
6
- import { chGtfsProfile, GtfsParser, GtfsProfile } from '../index.js';
6
+ import { chGtfsProfile, GtfsParser, GtfsProfile } from '../parser.js';
7
7
  import { startRepl } from './repl.js';
8
8
 
9
9
  const program = new Command();
package/src/cli/repl.ts CHANGED
@@ -2,7 +2,7 @@ import repl from 'node:repl';
2
2
 
3
3
  import fs from 'fs';
4
4
 
5
- import { Query, Router, StopsIndex, Time, Timetable } from '../index.js';
5
+ import { Query, Router, StopsIndex, Time, Timetable } from '../router.js';
6
6
  import { plotGraphToDotFile, prettyPrintRoute } from './utils.js';
7
7
 
8
8
  export const startRepl = (stopsPath: string, timetablePath: string) => {
package/src/cli/utils.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import fs from 'fs';
2
2
 
3
- import { Plotter, Result, Route } from '../index.js';
3
+ import { Plotter, Result, Route } from '../router.js';
4
4
 
5
5
  export const prettyPrintRoute = (route: Route): void => {
6
6
  route.legs.forEach((leg, index) => {
package/src/parser.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { GtfsParser, GtfsProfile } from './gtfs/parser.js';
2
+ import { chGtfsProfile } from './gtfs/profiles/ch.js';
3
+
4
+ export { chGtfsProfile, GtfsParser, GtfsProfile };
@@ -1,7 +1,3 @@
1
- /*
2
- * An index containing only browser compatible modules for the UMD build.
3
- */
4
-
5
1
  import { Plotter } from './routing/plotter.js';
6
2
  import { Query } from './routing/query.js';
7
3
  import { Result } from './routing/result.js';
@@ -1,5 +1,5 @@
1
1
  import { StopId } from '../stops/stops.js';
2
- import { StopsIndex } from '../umdIndex.js';
2
+ import { StopsIndex } from '../stops/stopsIndex.js';
3
3
  import { Query } from './query.js';
4
4
  import { Leg, Route } from './route.js';
5
5
  import { ReachingTime, TripLeg } from './router.js';
@@ -1,9 +1,9 @@
1
1
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
2
2
  import { StopId } from '../stops/stops.js';
3
+ import { StopsIndex } from '../stops/stopsIndex.js';
3
4
  import { Duration } from '../timetable/duration.js';
4
5
  import { Time } from '../timetable/time.js';
5
6
  import { Timetable } from '../timetable/timetable.js';
6
- import { StopsIndex } from '../umdIndex.js';
7
7
  import { Query } from './query.js';
8
8
  import { Result } from './result.js';
9
9
  import { Leg } from './route.js';