Skip to content

Commit ef73c18

Browse files
authored
Upgrade to client generator 0.8.1 to test changes (#2863)
upgrade to client generator 0.8.1 to test changes
1 parent bcfd938 commit ef73c18

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

app/api/__generated__/Api.ts

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

app/api/__generated__/validate.ts

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

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"devDependencies": {
8080
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
8181
"@mswjs/http-middleware": "^0.10.3",
82-
"@oxide/openapi-gen-ts": "~0.7.0",
82+
"@oxide/openapi-gen-ts": "~0.8.1",
8383
"@playwright/test": "^1.54.1",
8484
"@testing-library/dom": "^10.4.0",
8585
"@testing-library/jest-dom": "^6.6.3",

tools/generate_api_client.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,25 @@ GEN_DIR="$PWD/app/api/__generated__"
1414

1515
SPEC_URL="https://raw.githubusercontent.com/oxidecomputer/omicron/$OMICRON_SHA/openapi/nexus.json"
1616

17+
HEADER=$(cat <<'EOF'
18+
/**
19+
* This Source Code Form is subject to the terms of the Mozilla Public
20+
* License, v. 2.0. If a copy of the MPL was not distributed with this
21+
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
22+
*
23+
* Copyright Oxide Computer Company
24+
*/
25+
26+
EOF)
27+
1728
# use versions of these packages specified in dev deps
1829
npm run openapi-gen-ts -- $SPEC_URL $GEN_DIR --features msw
30+
31+
for f in Api.ts msw-handlers.ts validate.ts; do
32+
(printf '%s\n\n' "$HEADER"; cat "$GEN_DIR/$f") > "$GEN_DIR/$f.tmp"
33+
mv "$GEN_DIR/$f.tmp" "$GEN_DIR/$f"
34+
done
35+
1936
npm run prettier -- --write --log-level error "$GEN_DIR"
2037
2138
cat > $GEN_DIR/OMICRON_VERSION <<EOF

0 commit comments

Comments
 (0)