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

Commit 2a8cc6d

Browse files
committed
Set up packaging
1 parent 141d502 commit 2a8cc6d

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@
6969
"format:check": "prettier --check .",
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",
72-
"test:watch": "npm run build:json-response-schemas && ava --watch"
72+
"test:watch": "npm run build:json-response-schemas && ava --watch",
73+
"cli:dev": "esr src/cli/index.ts"
74+
},
75+
"bin": {
76+
"seamapi": "./dist/cli/index.js",
77+
"seam": "./dist/cli/index.js"
7378
},
7479
"repository": "https://github.com/hello-seam/seamapi-javascript"
7580
}

src/cli/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/usr/bin/env node
22
import commonOptions from "./global-options"
33

4-
// todo: bash auto-completion
5-
64
commonOptions
75
.commandDir("./commands", {
8-
extensions: ["ts"],
6+
extensions: [process.env.NODE_ENV === "production" ? "js" : "ts"],
97
visit: (command) => {
108
return command.default
119
},

tsup.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import { defineConfig } from "tsup"
22

33
export default defineConfig({
4-
entry: ["src/index.ts"],
4+
entry: ["src/index.ts", "src/cli/**/*.ts"],
55
dts: true,
66
sourcemap: true,
77
format: ["cjs", "esm"],
8+
env: {
9+
NODE_ENV: "production",
10+
},
811
})

0 commit comments

Comments
 (0)