Skip to content

Commit 8ac971d

Browse files
committed
adds refresh schema command
1 parent 169751a commit 8ac971d

File tree

3 files changed

+199
-1
lines changed

3 files changed

+199
-1
lines changed

package-lock.json

Lines changed: 189 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"lint:fix": "npm run lint -- --fix",
2929
"format": "prettier --write --no-error-on-unmatched-pattern '**/*.{ts,js}' '!dist/**'",
3030
"format:check": "prettier --check --no-error-on-unmatched-pattern '**/*.{ts,js}' '!dist/**'",
31-
"prepare": "husky install"
31+
"prepare": "husky install",
32+
"schema": "./tools/refresh_schema.sh"
3233
},
3334
"repository": {
3435
"type": "git",
@@ -68,6 +69,7 @@
6869
"husky": "^8.0.3",
6970
"jest": "^29.4.3",
7071
"lint-staged": "^13.2.0",
72+
"openapi-typescript": "^5.4.1",
7173
"prettier": "^2.8.4",
7274
"ts-jest": "^29.0.5",
7375
"tsup": "^6.7.0",

tools/refresh_schema.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
var="${1:-master}"
6+
npx openapi-typescript https://raw.githubusercontent.com/weaviate/weaviate/${var}/openapi-specs/schema.json -o ./src/openapi/schema.ts
7+
npx prettier --write --no-error-on-unmatched-pattern './src/openapi/schema.ts'

0 commit comments

Comments
 (0)