Skip to content

Commit 44c646f

Browse files
committed
update API client gen script to use tsx directly
1 parent f5245ab commit 44c646f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/update-pinned-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Setup
44

5-
The API generation script assumes you have `omicron` and `oxide.ts` cloned under the same parent directory as the console. You should also run `npm install` in `oxide.ts/generator`.
5+
The API generation script assumes you have `oxide.ts` cloned under the same parent directory as the console and have run `npm install` in there.
66

77
## Instructions
88

tools/generate_api_client.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
#
66
# Copyright Oxide Computer Company
77

8-
98
set -o errexit # exit if anything fails
109
set -o pipefail
1110
set -o xtrace
1211

13-
# script assumes omicron and oxide.ts are cloned under the same parent dir as
14-
# console and have run `npm install` inside oxide.ts/generator
12+
# script assumes oxide.ts is cloned under the same parent dir as console and
13+
# you've run `npm install` over there
1514

1615
OMICRON_SHA=$(head -n 1 OMICRON_VERSION)
1716
GEN_DIR="$PWD/app/api/__generated__"
1817

19-
# this will be less horrific when the package is published? or maybe not
20-
npm run --silent --prefix ../oxide.ts gen-from $OMICRON_SHA $GEN_DIR
18+
SPEC_URL="https://raw.githubusercontent.com/oxidecomputer/omicron/$OMICRON_SHA/openapi/nexus.json"
19+
20+
npx tsx ../oxide.ts/generator/index.ts $SPEC_URL $GEN_DIR
2121
npx prettier --write --log-level error "$GEN_DIR"
2222

2323
# hack until we start pulling this from npm. we don't want this file

0 commit comments

Comments
 (0)