Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit b173974

Browse files
committed
Split off entry point
1 parent bb1c2dd commit b173974

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@
7070
"build:json-response-schemas": "ts-json-schema-generator --path src/types/route-responses.ts -o src/types/route-responses.generated.json && ts-json-schema-generator --path src/types/models.ts -o src/types/models.generated.json",
7171
"test": "npm run build:json-response-schemas && ava",
7272
"test:watch": "npm run build:json-response-schemas && ava --watch",
73-
"cli:dev": "esr src/cli/index.ts"
73+
"cli:dev": "esr src/cli/entry.ts"
7474
},
7575
"bin": {
76-
"seamapi": "./dist/cli/index.js",
77-
"seam": "./dist/cli/index.js"
76+
"seamapi": "./dist/cli/entry.js",
77+
"seam": "./dist/cli/entry.js"
7878
},
7979
"repository": "https://github.com/hello-seam/seamapi-javascript"
8080
}

src/cli/entry.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env node
2+
import { cli } from "./index"
3+
4+
cli.parse()

src/cli/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
#!/usr/bin/env node
21
import commonOptions from "./global-options"
32

4-
commonOptions
3+
export const cli = commonOptions
54
.commandDir("./commands", {
65
extensions: [process.env.NODE_ENV === "production" ? "js" : "ts"],
76
visit: (command) => {
87
return command.default
98
},
109
})
1110
.demandCommand()
12-
.parse()
11+
.strict()

0 commit comments

Comments
 (0)