@nyc-transit-kit/cli 0.1.3 → 0.1.4
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 +25 -2
- package/package.json +7 -7
- package/src/config.ts +14 -4
package/README.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @nyc-transit-kit/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Bun CLI for inspecting official NYC and MTA transit data through
|
|
4
|
+
`nyc-transit-kit`.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
## Runtime
|
|
7
|
+
|
|
8
|
+
The published CLI bin is a Bun-shebang wrapper. Install with Bun and run with
|
|
9
|
+
`bunx`:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
bun add -d @nyc-transit-kit/cli
|
|
13
|
+
bunx ntk --version --json
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Every command supports `--help`; commands that produce machine-readable output
|
|
17
|
+
support `--json`.
|
|
18
|
+
|
|
19
|
+
## Configuration
|
|
20
|
+
|
|
21
|
+
`SOCRATA_APP_TOKEN` is optional and used only by CLI Socrata-backed requests.
|
|
22
|
+
Core library packages receive app tokens through explicit config instead of
|
|
23
|
+
reading environment variables.
|
|
24
|
+
|
|
25
|
+
## Docs
|
|
26
|
+
|
|
27
|
+
See the repository README, `docs/getting-started.md`, and
|
|
28
|
+
`docs/api-reference.md` for the full command and package surface.
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nyc-transit-kit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"sideEffects": false,
|
|
6
7
|
"bin": {
|
|
@@ -24,17 +25,16 @@
|
|
|
24
25
|
},
|
|
25
26
|
"dependencies": {
|
|
26
27
|
"@effect/platform-bun": "4.0.0-beta.92",
|
|
27
|
-
"@nyc-transit-kit/contracts": "0.1.
|
|
28
|
-
"@nyc-transit-kit/mta": "0.1.
|
|
29
|
-
"@nyc-transit-kit/nyc-dot": "0.1.
|
|
30
|
-
"@nyc-transit-kit/nyc-open-data": "0.1.
|
|
31
|
-
"@nyc-transit-kit/soda3": "0.1.
|
|
28
|
+
"@nyc-transit-kit/contracts": "0.1.4",
|
|
29
|
+
"@nyc-transit-kit/mta": "0.1.4",
|
|
30
|
+
"@nyc-transit-kit/nyc-dot": "0.1.4",
|
|
31
|
+
"@nyc-transit-kit/nyc-open-data": "0.1.4",
|
|
32
|
+
"@nyc-transit-kit/soda3": "0.1.4",
|
|
32
33
|
"effect": "4.0.0-beta.92"
|
|
33
34
|
},
|
|
34
35
|
"publishConfig": {
|
|
35
36
|
"access": "public"
|
|
36
37
|
},
|
|
37
|
-
"license": "MIT",
|
|
38
38
|
"repository": {
|
|
39
39
|
"type": "git",
|
|
40
40
|
"url": "git+https://github.com/mannyc2/nyc-transit-kit.git",
|
package/src/config.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { MtaHttpLive, mtaConfigLayer } from "@nyc-transit-kit/mta/client"
|
|
1
2
|
import { GtfsRealtimeDecoder } from "@nyc-transit-kit/mta/gtfs-realtime"
|
|
2
|
-
import { MtaHttpLive } from "@nyc-transit-kit/mta/gtfs-static"
|
|
3
3
|
import { Soda3ClientConfig, Soda3HttpLive } from "@nyc-transit-kit/soda3/client"
|
|
4
4
|
import * as Layer from "effect/Layer"
|
|
5
5
|
|
|
@@ -11,11 +11,21 @@ export const soda3CliLayer = (config: Soda3CliLayerConfig) =>
|
|
|
11
11
|
Layer.mergeAll(
|
|
12
12
|
Layer.succeed(Soda3ClientConfig)({
|
|
13
13
|
appToken: config.appToken,
|
|
14
|
-
retryTimes: 2
|
|
14
|
+
retryTimes: 2,
|
|
15
|
+
retryDelayMs: 250
|
|
15
16
|
}),
|
|
16
17
|
Soda3HttpLive
|
|
17
18
|
)
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
const mtaCliConfigLayer = mtaConfigLayer({
|
|
21
|
+
retryTimes: 2,
|
|
22
|
+
retryDelayMs: 250
|
|
23
|
+
})
|
|
20
24
|
|
|
21
|
-
export const
|
|
25
|
+
export const mtaCliLayer = Layer.mergeAll(MtaHttpLive, mtaCliConfigLayer)
|
|
26
|
+
|
|
27
|
+
export const mtaRealtimeCliLayer = Layer.mergeAll(
|
|
28
|
+
MtaHttpLive,
|
|
29
|
+
mtaCliConfigLayer,
|
|
30
|
+
GtfsRealtimeDecoder.Live
|
|
31
|
+
)
|