TD-253: Add frontend codegen (#11)

This commit is contained in:
Rinat Arsaev 2022-04-08 15:51:34 +03:00 committed by GitHub
parent d04a8e5b49
commit f780d07c93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 3900 additions and 434 deletions

22
.github/workflows/frontend-pr.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: 'Frontend: PR'
on:
pull_request:
branches: ['*']
jobs:
configured:
uses: valitydev/action-frontend/.github/workflows/configured.yml@v0.1
check:
name: Check
runs-on: ubuntu-latest
needs: configured
if: needs.configured.outputs.exists == 'true'
steps:
- uses: actions/checkout@v3
- uses: valitydev/action-frontend/setup@v0.1
- run: npm ci
- name: Build
run: npm run build
- name: Codegen
run: npm run codegen

26
.github/workflows/frontend-publish.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: 'Frontend: Publish'
on:
push:
branches: ['master', 'main']
jobs:
configured:
uses: valitydev/action-frontend/.github/workflows/configured.yml@v0.1
publish:
name: Publish
runs-on: ubuntu-latest
needs: configured
if: needs.configured.outputs.exists == 'true'
steps:
- uses: actions/checkout@v3
- uses: valitydev/action-frontend/setup@v0.1
- run: npm ci
- name: Build
run: npm run build
- name: Codegen
run: npm run codegen
- uses: valitydev/action-frontend/publish@v0.1
with:
npm-token: ${{ secrets.NPM_TOKEN }}
directory: ./lib

2
.gitignore vendored
View File

@ -36,3 +36,5 @@ node_modules
# CI # CI
.wercker .wercker
# Frontend
/lib

View File

@ -1,8 +0,0 @@
all: build
build:
npm install
npm run build
start:
npm start

10
openapitools.json Normal file
View File

@ -0,0 +1,10 @@
{
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "6.0.0-20220330.230127-109",
"repository": {
"downloadUrl": "https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.0.0-SNAPSHOT/openapi-generator-cli-${versionName}.jar"
}
}
}

4242
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,15 @@
{ {
"name": "RBKmoney-openapi-spec", "name": "@vality/swag-url-shortener",
"version": "0.0.1", "version": "0.1.0",
"dependencies": { "scripts": {
"bower": "^1.7.7", "build": "node ./scripts/build.js",
"swagger": "swagger-repo",
"test": "swagger-repo validate",
"start": "gulp serve",
"codegen": "vality-openapi generate ./web_deploy/swagger.json"
},
"devDependencies": {
"@vality/openapi-generator-cli": "0.1.1-fbfe66e.0",
"connect": "^3.4.1", "connect": "^3.4.1",
"cors": "^2.7.1", "cors": "^2.7.1",
"deploy-to-gh-pages": "^1.1.0", "deploy-to-gh-pages": "^1.1.0",
@ -13,12 +20,5 @@
"shelljs": "^0.7.0", "shelljs": "^0.7.0",
"swagger-repo": "^1.0.0", "swagger-repo": "^1.0.0",
"swagger-ui": "^2.1.4" "swagger-ui": "^2.1.4"
},
"private": true,
"scripts": {
"build": "node ./scripts/build.js",
"swagger": "swagger-repo",
"test": "swagger-repo validate",
"start": "gulp serve"
} }
} }