Skip to content

Commit 96bcf2b

Browse files
committed
add npm bash
1 parent a1d7721 commit 96bcf2b

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

generate-npm.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
LATEST_TAG=$(git tag --sort=-creatordate | head -n 1)
4+
if [ -z "$LATEST_TAG" ]; then
5+
LATEST_TAG="v0.0.1"
6+
fi
7+
openapi-generator-cli generate -g typescript-axios -i ./icewhale-drive/openapi.yaml -o ./generate/icewhale-drive
8+
9+
# 使用 jq 设置新的版本号
10+
jq --arg version "$LATEST_TAG" '.version |= $version' package.json > tmp.json && mv tmp.json package.json
11+
12+
npm publish --access public
13+
14+
rm -rf generate

package.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "@icewhale/icewhale-openapi",
3+
"version": "v0.0.1",
4+
"scripts": {
5+
"clean": "rm -rf generate",
6+
"build": "rm -rf dist && tsc && yarn clean",
7+
"generate:local": "openapi-generator-cli generate -g typescript-axios -i ./icewhale-files/openapi.yaml -o ./generate",
8+
"generate:npx": "npx @openapitools/openapi-generator-cli generate -g typescript-axios -i ./api/zimaos/openapi.yaml -o ./generate",
9+
"generate:ts": "npx openapi-typescript-codegen --input ./api/zimaos/openapi.yaml --output ./generate",
10+
"start": "yarn generate:local && yarn build"
11+
},
12+
"homepage": "https://github.com/IceWhaleTech/icewhale-openapi#readme",
13+
"description": "ZimaOS Typescript+Axios SDK",
14+
"keywords": [
15+
"ZimaOS",
16+
"SDK",
17+
"ZimaOS Axios",
18+
"icewhale",
19+
"openapi"
20+
],
21+
"main": "generate",
22+
"files": [
23+
"LICENSE",
24+
"README.md",
25+
"dist",
26+
"generate"
27+
],
28+
"dependencies": {
29+
"axios": "^1.1.0"
30+
},
31+
"devDependencies": {
32+
"all-contributors-cli": "^6.24.0",
33+
"@openapitools/openapi-generator-cli": "2.5.2",
34+
"@types/node": "^18.8.3",
35+
"openapi-typescript-codegen": "^0.23.0",
36+
"typescript": "^4.9.5"
37+
},
38+
"author": "zimaos",
39+
"license": "Apache-2.0"
40+
}

0 commit comments

Comments
 (0)