mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
parent
c1b45abfca
commit
e3643ccfc0
6 changed files with 1794 additions and 5 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -35,9 +35,6 @@ packages/app/.vercel
|
||||||
packages/app/coverage
|
packages/app/coverage
|
||||||
packages/app/out
|
packages/app/out
|
||||||
|
|
||||||
# OpenAPI spec
|
|
||||||
packages/public/openapi.json
|
|
||||||
|
|
||||||
# optional npm cache directory
|
# optional npm cache directory
|
||||||
**/.npm
|
**/.npm
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
set -e
|
||||||
|
|
||||||
. "$(dirname -- "$0")/_/husky.sh"
|
. "$(dirname -- "$0")/_/husky.sh"
|
||||||
|
|
||||||
npx lint-staged
|
npx lint-staged
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,11 @@
|
||||||
"release": "npx changeset tag && npx changeset publish"
|
"release": "npx changeset tag && npx changeset publish"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
|
"packages/api/src/routers/external-api/**/*.ts": [
|
||||||
|
"prettier --write --ignore-unknown",
|
||||||
|
"eslint --fix --quiet",
|
||||||
|
"sh -c 'cd packages/api && yarn run docgen && git add openapi.json'"
|
||||||
|
],
|
||||||
"**/*.{ts,tsx}": [
|
"**/*.{ts,tsx}": [
|
||||||
"prettier --write --ignore-unknown",
|
"prettier --write --ignore-unknown",
|
||||||
"eslint --fix --quiet"
|
"eslint --fix --quiet"
|
||||||
|
|
|
||||||
1785
packages/api/openapi.json
Normal file
1785
packages/api/openapi.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -5,7 +5,7 @@ import swaggerJsdoc from 'swagger-jsdoc';
|
||||||
import { swaggerOptions } from '../src/utils/swagger';
|
import { swaggerOptions } from '../src/utils/swagger';
|
||||||
|
|
||||||
const specs = swaggerJsdoc(swaggerOptions);
|
const specs = swaggerJsdoc(swaggerOptions);
|
||||||
const outputPath = path.resolve(__dirname, '../../public/openapi.json');
|
const outputPath = path.resolve(__dirname, '../openapi.json');
|
||||||
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
||||||
fs.writeFileSync(outputPath, JSON.stringify(specs, null, 2));
|
fs.writeFileSync(outputPath, JSON.stringify(specs, null, 2));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ export function setupSwagger(app: Application) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Optionally save the spec to a file
|
// Optionally save the spec to a file
|
||||||
const outputPath = path.resolve(__dirname, '../../../public/openapi.json');
|
const outputPath = path.resolve(__dirname, '../../openapi.json');
|
||||||
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
||||||
fs.writeFileSync(outputPath, JSON.stringify(specs, null, 2));
|
fs.writeFileSync(outputPath, JSON.stringify(specs, null, 2));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue