Skip to content

Commit

Permalink
feat: 增加编译命令
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudcome committed Mar 15, 2023
1 parent 6b932f8 commit 34c49a1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bin/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

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

start();
await start();
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,28 @@
"scripts": {
"prepare": "husky install",
"lint": "eslint src/**/*.ts",
"test": "echo 'test success'",
"build": "echo 'build success'"
"test": "echo 'no test'",
"build": "tsc -p tsconfig.build.json"
},
"engines": {
"node": ">=16"
},
"engineStrict": true,
"type": "module",
"module": "./dist/index.js",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./helper": {
"import": "./dist/helper.js",
"types": "./dist/helper.d.ts"
},
"./package.json": "./package.json"
},
"bin": {
"oas-gen-ts": "bin/index.js"
"oas-gen-ts": "bin/index.mjs"
},
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion src/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import path from 'node:path';
export const templatesDir = path.join(__dirname, '../templates');
export const axiosImportDefault = `import { Axios } from 'axios';
const axios = new Axios();`;
export const helpersImport = `import { formatHeaders, formatBody } from 'oas-gen-ts/client'`;
export const helpersImport = `import { formatHeaders, formatBody } from 'oas-gen-ts/helpers';`;
8 changes: 8 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": false,
"declaration": true,
"outDir": "dist"
}
}

0 comments on commit 34c49a1

Please sign in to comment.