Repository navigation
Expand file tree
/
Copy pathtypescript.toml
More file actions
119 lines (104 loc) · 3.97 KB
/
Copy pathtypescript.toml
File metadata and controls
119 lines (104 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# TypeScript SDK tasks (sdk/typescript). Codegen runs `buf generate` (buf and
# the connect-es plugin come from the package's own devDependencies); buf
# self-compiles proto/, so no protoc is required.
["sdk:ts:install"]
description = "Install TypeScript SDK dependencies"
dir = "sdk/typescript"
run = "npm ci"
run_windows = "powershell -NoProfile -ExecutionPolicy Bypass -File ../../tasks/scripts/typescript-install.ps1"
hide = true
["sdk:ts:proto"]
description = "Generate TypeScript protobuf stubs for the SDK"
depends = ["sdk:ts:install"]
dir = "sdk/typescript"
run = "npm run gen"
run_windows = "powershell -NoProfile -ExecutionPolicy Bypass -File ../../tasks/scripts/typescript-proto.ps1"
# Lints the repo-level proto module (buf.yaml at the root) against STANDARD.
# buf ships only in the SDK's devDependencies today, so this depends on the
# SDK install and runs buf from there; the target is all of proto/, not just
# the SDK's client-surface subset.
["proto:lint"]
description = "Lint proto/ with buf (repo-level buf.yaml)"
depends = ["sdk:ts:install"]
run = "./sdk/typescript/node_modules/.bin/buf lint"
run_windows = "sdk\\typescript\\node_modules\\.bin\\buf.cmd lint"
["sdk:ts:typecheck"]
description = "Type-check the TypeScript SDK"
depends = ["sdk:ts:proto"]
dir = "sdk/typescript"
run = "npm run typecheck"
["sdk:ts:lint"]
description = "Lint + format-check the TypeScript SDK (Biome, read-only)"
depends = ["sdk:ts:install"]
dir = "sdk/typescript"
run = "npm run lint"
["sdk:ts:format"]
description = "Format the TypeScript SDK and apply safe fixes (Biome, writes)"
depends = ["sdk:ts:install"]
dir = "sdk/typescript"
run = "npm run format"
["sdk:ts:build"]
description = "Build the TypeScript SDK (emit dist/)"
depends = ["sdk:ts:proto"]
dir = "sdk/typescript"
run = "npm run build"
["sdk:ts:test"]
description = "Run TypeScript SDK unit tests (Vitest, in-memory transport)"
depends = ["sdk:ts:proto"]
dir = "sdk/typescript"
run = "npm test"
["e2e:sdk:ts:exec"]
description = "Test public TypeScript interactive exec against a Docker-backed gateway"
depends = ["sdk:ts:build"]
run = "e2e/with-docker-gateway.sh node --test sdk/typescript/e2e/interactive-exec.mjs"
["sdk:ts:ci"]
description = "TypeScript SDK checks (proto lint, Biome lint, codegen, typecheck, test, build)"
depends = [
"proto:lint",
"sdk:ts:lint",
"sdk:ts:typecheck",
"sdk:ts:test",
"sdk:ts:build",
]
hide = true
# Publish to the registry in package.json publishConfig. Set OPENSHELL_NPM_VERSION
# to stamp the version from the release tag (release.py get-version --npm); the
# package.json placeholder 0.0.0 is restored afterward, mirroring the Cargo
# version stamping in tasks/python.toml. Auth is expected via a .npmrc the caller
# writes (CI) or the user's own npm login.
#
# Prerelease versions (e.g. 0.0.37-dev.N.gSHA from an off-tag build) must not
# claim the `latest` dist-tag, so they publish under `next` instead — npm also
# refuses a bare `npm publish` for a prerelease. Set OPENSHELL_NPM_PUBLISH_ARGS
# (e.g. `--dry-run`) to pass extra flags through; CI uses this to validate the
# publishable artifact on PRs without uploading.
["sdk:ts:publish"]
description = "Publish the TypeScript SDK to its configured registry"
depends = ["sdk:ts:build"]
dir = "sdk/typescript"
run = """
#!/usr/bin/env bash
set -euo pipefail
ORIGINAL_PKG=""
cleanup() {
if [ -n "$ORIGINAL_PKG" ] && [ -f "$ORIGINAL_PKG" ]; then
cp "$ORIGINAL_PKG" package.json
rm -f "$ORIGINAL_PKG"
fi
}
trap cleanup EXIT
DIST_TAG="latest"
if [ -n "${OPENSHELL_NPM_VERSION:-}" ]; then
ORIGINAL_PKG=$(mktemp)
cp package.json "$ORIGINAL_PKG"
npm pkg set version="$OPENSHELL_NPM_VERSION"
# A hyphen means a SemVer prerelease (X.Y.Z-dev.N...) -> publish off `latest`.
case "$OPENSHELL_NPM_VERSION" in
*-*) DIST_TAG="next" ;;
esac
fi
npm publish --tag "$DIST_TAG" ${OPENSHELL_NPM_PUBLISH_ARGS:-}
"""
hide = true