mirror of
https://github.com/KaySar12/NextZen-UserService.git
synced 2025-03-15 15:15:35 +07:00
parent
ac34a1356d
commit
f5fcd9ed92
38
.github/workflows/publish_npm.yml
vendored
Normal file
38
.github/workflows/publish_npm.yml
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
name: publish npm
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*.*.*
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
publish-npm:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
registry-url: https://registry.npmjs.org/
|
||||
- name: Get version
|
||||
id: get_version
|
||||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
||||
- name: Set version
|
||||
run: |
|
||||
apt install jq
|
||||
jq '.version="${{ steps.get_version.outputs.VERSION }}"' package.json > package.json.new
|
||||
mv package.json.new package.json
|
||||
- name: Generate SDK
|
||||
run: |
|
||||
npm cache clean --force
|
||||
npm install @openapitools/openapi-generator-cli -g
|
||||
make build
|
||||
- run: npm i
|
||||
- run: npm run start
|
||||
- run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
7
.gitignore
vendored
7
.gitignore
vendored
@ -19,4 +19,9 @@
|
||||
target/
|
||||
dist/
|
||||
__debug_bin
|
||||
codegen/
|
||||
codegen/
|
||||
|
||||
node_modules/
|
||||
dist/
|
||||
.idea
|
||||
.package-lock.json
|
25
README.md
25
README.md
@ -3,3 +3,28 @@
|
||||
[](https://pkg.go.dev/github.com/IceWhaleTech/CasaOS-UserService) [](https://goreportcard.com/report/github.com/IceWhaleTech/CasaOS-UserService) [](https://github.com/IceWhaleTech/CasaOS-UserService/actions/workflows/release.yml) [](https://codecov.io/gh/IceWhaleTech/CasaOS-UserService)
|
||||
|
||||
User Service provides user management functionalities to CasaOS.
|
||||
|
||||
|
||||
|
||||
## publish api to npm
|
||||
|
||||
### edit version in package.json
|
||||
|
||||
### run
|
||||
```bash
|
||||
yarn
|
||||
|
||||
yarn start
|
||||
```
|
||||
|
||||
### publish
|
||||
|
||||
Manual publish
|
||||
```bash
|
||||
yarn publish
|
||||
```
|
||||
|
||||
Auto publish
|
||||
```bash
|
||||
git push origin dev**
|
||||
```
|
36
package.json
Normal file
36
package.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "casaos-userservice-openapi",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"build": "rm -rf dist && tsc && rm -rf generate",
|
||||
"generate:local": "openapi-generator-cli generate -g typescript-axios -i ./api/user-service/openapi.yaml -o ./generate",
|
||||
"generate:npx": "npx @openapitools/openapi-generator-cli generate -g typescript-axios -i ./api/user-service/openapi.yaml -o ./generate",
|
||||
"generate:ts": "npx openapi-typescript-codegen --input ./api/user-service/openapi.yaml --output ./generate",
|
||||
"publish": "npm publish --access public",
|
||||
"start": "yarn generate:ts && yarn build"
|
||||
},
|
||||
"homepage": "https://github.com/IceWhaleTech/CasaOS-UserService#readme",
|
||||
"description": "Casaos-Localstorage Typescript+Axios SDK",
|
||||
"keywords": [
|
||||
"CasaOS-UserService",
|
||||
"SDK",
|
||||
"CasaOS-UserService Axios"
|
||||
],
|
||||
"main": "dist/index",
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"axios": "^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@openapitools/openapi-generator-cli": "2.5.2",
|
||||
"@types/node": "^18.8.3",
|
||||
"openapi-typescript-codegen": "^0.23.0",
|
||||
"typescript": "^4.9.5"
|
||||
},
|
||||
"author": "casaos",
|
||||
"license": "Apache-2.0"
|
||||
}
|
25
tsconfig.json
Normal file
25
tsconfig.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"lib": [
|
||||
"es2017",
|
||||
"DOM"
|
||||
],
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": false,
|
||||
"strict": true,
|
||||
"useUnknownInCatchVariables": false,
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"outDir": "dist",
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
],
|
||||
"main": "generate/index"
|
||||
}
|
Loading…
Reference in New Issue
Block a user