Skip to content

Commit e624282

Browse files
committed
HYPERFLEET-1024 - Use local reproducible tsp instead of global one
1 parent f418cac commit e624282

4 files changed

Lines changed: 5 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ jobs:
2424
- name: Install dependencies
2525
run: npm ci
2626

27-
- name: Install TypeSpec compiler
28-
run: npm install -g @typespec/compiler@1.11
29-
3027
- name: Install Spectral CLI
3128
run: npm install -g @stoplight/spectral-cli
3229

.github/workflows/release.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ jobs:
2525
- name: Install dependencies
2626
run: npm ci
2727

28-
- name: Install TypeSpec compiler
29-
run: npm install -g @typespec/compiler@1.11
30-
3128
- name: Extract version
3229
id: version
3330
run: |

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
### Fixed
2424

2525
- `Error.instance` field format changed from `uri` to `uri-reference` per RFC 7807 (instance identifies a specific occurrence and may be a relative URI reference)
26+
- `build-schema.sh` now resolves `tsp` from `node_modules/.bin/` instead of requiring a global install, eliminating version mismatch between the globally installed compiler and the lockfile-pinned version
2627

2728
## [1.0.10] - 2026-05-05
2829

build-schema.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ if [ ! -f "main.tsp" ]; then
8282
fi
8383

8484
# Check if tsp command is available
85-
if ! command -v tsp &> /dev/null; then
86-
echo -e "${RED}Error: tsp command not found. Please install TypeSpec compiler.${NC}"
87-
echo "Install with: npm install -g @typespec/compiler"
85+
if [ ! -x "${SCRIPT_DIR}/node_modules/.bin/tsp" ]; then
86+
echo -e "${RED}Error: tsp not found in node_modules. Run 'npm install' first.${NC}"
8887
exit 1
8988
fi
89+
TSP="${SCRIPT_DIR}/node_modules/.bin/tsp"
9090

9191
# Check if api-spec-converter is available when swagger output is requested
9292
if [ "$GENERATE_SWAGGER" = true ]; then
@@ -133,7 +133,7 @@ cleanup() {
133133
}
134134
trap cleanup EXIT
135135

136-
if tsp compile main.tsp --output-dir "$TEMP_OUTPUT_DIR"; then
136+
if "$TSP" compile main.tsp --output-dir "$TEMP_OUTPUT_DIR"; then
137137
# Move the generated schema to the provider-specific directory
138138
if [ -f "${TEMP_OUTPUT_DIR}/schema/openapi.yaml" ]; then
139139
mv "${TEMP_OUTPUT_DIR}/schema/openapi.yaml" "${OUTPUT_DIR}/openapi.yaml"

0 commit comments

Comments
 (0)