Skip to content

Commit 34c49a1

Browse files
committed
feat: 增加编译命令
1 parent 6b932f8 commit 34c49a1

File tree

5 files changed

+26
-6
lines changed

5 files changed

+26
-6
lines changed

bin/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
import { start } from '../dist';
44

5-
start();
5+
await start();

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,28 @@
55
"scripts": {
66
"prepare": "husky install",
77
"lint": "eslint src/**/*.ts",
8-
"test": "echo 'test success'",
9-
"build": "echo 'build success'"
8+
"test": "echo 'no test'",
9+
"build": "tsc -p tsconfig.build.json"
1010
},
1111
"engines": {
1212
"node": ">=16"
1313
},
1414
"engineStrict": true,
1515
"type": "module",
16+
"module": "./dist/index.js",
17+
"exports": {
18+
".": {
19+
"import": "./dist/index.js",
20+
"types": "./dist/index.d.ts"
21+
},
22+
"./helper": {
23+
"import": "./dist/helper.js",
24+
"types": "./dist/helper.d.ts"
25+
},
26+
"./package.json": "./package.json"
27+
},
1628
"bin": {
17-
"oas-gen-ts": "bin/index.js"
29+
"oas-gen-ts": "bin/index.mjs"
1830
},
1931
"files": [
2032
"dist",

src/const.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ import path from 'node:path';
33
export const templatesDir = path.join(__dirname, '../templates');
44
export const axiosImportDefault = `import { Axios } from 'axios';
55
const axios = new Axios();`;
6-
export const helpersImport = `import { formatHeaders, formatBody } from 'oas-gen-ts/client'`;
6+
export const helpersImport = `import { formatHeaders, formatBody } from 'oas-gen-ts/helpers';`;

tsconfig.build.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"noEmit": false,
5+
"declaration": true,
6+
"outDir": "dist"
7+
}
8+
}

0 commit comments

Comments
 (0)