mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2025-03-14 13:08:27 +03:00
setup openapi spec build chain
This commit is contained in:
parent
9afb63c738
commit
428d60ebb0
7 changed files with 6080 additions and 1 deletions
8
Makefile
8
Makefile
|
@ -31,15 +31,23 @@ docker-publish:
|
|||
|
||||
frontend:
|
||||
cd browser && wasm-pack build --release
|
||||
cd docs/openapi/ yarn build
|
||||
yarn install
|
||||
yarn build
|
||||
|
||||
frontend-test:
|
||||
cd browser && wasm-pack test --release --headless --chrome
|
||||
cd browser && wasm-pack test --release --headless --firefox
|
||||
cd docs/openapi && yarn test
|
||||
cd browser && cargo test
|
||||
yarn test
|
||||
|
||||
lint:
|
||||
cargo fmt -v --all -- --emit files
|
||||
cargo clippy --workspace --tests --all-features
|
||||
yarn lint
|
||||
cd docs/openapi && yarn test
|
||||
|
||||
migrate:
|
||||
cargo run --bin tests-migrate
|
||||
|
||||
|
|
4
docs/openapi/.gitignore
vendored
Normal file
4
docs/openapi/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
./.idea
|
||||
./node_modules/
|
||||
./dist/
|
||||
_build/
|
3406
docs/openapi/package-lock.json
generated
Normal file
3406
docs/openapi/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
27
docs/openapi/package.json
Normal file
27
docs/openapi/package.json
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "mcaptcha-api",
|
||||
"version": "0.1.0",
|
||||
"description": "This service is used to discover bridge interfaces that operate on forges.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "swagger-cli bundle openapi.yaml --outfile dist/openapi.yaml --type yaml",
|
||||
"test": "npm run build && spectral lint dist/openapi.yaml",
|
||||
"serve": "npm run build && redoc-cli serve dist/openapi.yaml --port 7000 --options.onlyRequiredInSamples",
|
||||
"html": "npm run build && redoc-cli bundle dist/openapi.yaml --output dist/index.html --options.onlyRequiredInSamples",
|
||||
"clean": "rm -r dist"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/dat-adi/northstar.git"
|
||||
},
|
||||
"license": "AGPL3",
|
||||
"bugs": {
|
||||
"url": "https://github.com/dat-adi/northstar/issues"
|
||||
},
|
||||
"homepage": "https://github.com/dat-adi/northstar#readme",
|
||||
"dependencies": {
|
||||
"@apidevtools/swagger-cli": "^4.0.4",
|
||||
"@stoplight/spectral": "^5.8.1",
|
||||
"redoc-cli": "^0.10.3"
|
||||
}
|
||||
}
|
2634
docs/openapi/yarn.lock
Normal file
2634
docs/openapi/yarn.lock
Normal file
File diff suppressed because it is too large
Load diff
|
@ -73,7 +73,7 @@ pub fn handle_embedded_file(path: &str) -> HttpResponse {
|
|||
async fn dist(path: web::Path<String>) -> impl Responder {
|
||||
handle_embedded_file(&path)
|
||||
}
|
||||
const OPEN_API_SPEC: &str = include_str!("../openapi.yaml");
|
||||
const OPEN_API_SPEC: &str = include_str!("../docs/openapi/dist/openapi.yaml");
|
||||
|
||||
#[my_codegen::get(path = "DOCS.spec")]
|
||||
async fn spec() -> HttpResponse {
|
||||
|
|
Loading…
Add table
Reference in a new issue