From ef999948caa6c9240be07b4b313ab7f4c09f2e1a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Jul 2026 17:31:01 +0000 Subject: [PATCH 1/5] feat: migrate http-client-python eng scripts from tsx to native Node.js TypeScript Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com> --- ...-client-python-native-ts-20260728173051.md | 7 ++++ .../eng/scripts/ci/format.ts | 12 +++---- .../http-client-python/eng/scripts/ci/lint.ts | 12 +++---- .../eng/scripts/ci/regenerate.ts | 12 +++---- .../eng/scripts/ci/typecheck.ts | 12 +++---- .../eng/scripts/setup/build.ts | 2 +- .../eng/scripts/setup/install.ts | 2 +- .../eng/scripts/setup/prepare.ts | 2 +- .../eng/scripts/setup/run-python3.ts | 4 +-- packages/http-client-python/package.json | 33 +++++++++---------- 10 files changed, 52 insertions(+), 46 deletions(-) create mode 100644 .chronus/changes/http-client-python-native-ts-20260728173051.md diff --git a/.chronus/changes/http-client-python-native-ts-20260728173051.md b/.chronus/changes/http-client-python-native-ts-20260728173051.md new file mode 100644 index 00000000000..c75cf331a61 --- /dev/null +++ b/.chronus/changes/http-client-python-native-ts-20260728173051.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/http-client-python" +--- + +Migrate eng scripts from tsx to native Node.js TypeScript support diff --git a/packages/http-client-python/eng/scripts/ci/format.ts b/packages/http-client-python/eng/scripts/ci/format.ts index 96d08dedc39..96d53ba24dc 100644 --- a/packages/http-client-python/eng/scripts/ci/format.ts +++ b/packages/http-client-python/eng/scripts/ci/format.ts @@ -33,7 +33,7 @@ const argv = parseArgs({ if (argv.values.help) { console.log(` -${pc.bold("Usage:")} tsx format.ts [options] +${pc.bold("Usage:")} node format.ts [options] ${pc.bold("Description:")} Format code using Prettier (TypeScript) and Black (Python). @@ -56,19 +56,19 @@ ${pc.bold("Options:")} ${pc.bold("Examples:")} ${pc.dim("# Format emitter + pygen source (default)")} - tsx format.ts + node format.ts ${pc.dim("# Format only TypeScript emitter")} - tsx format.ts --emitter + node format.ts --emitter ${pc.dim("# Format only pygen source code")} - tsx format.ts --generator + node format.ts --generator ${pc.dim("# Check formatting without making changes")} - tsx format.ts --check + node format.ts --check ${pc.dim("# Format generated SDK packages")} - tsx format.ts --generated + node format.ts --generated `); process.exit(0); } diff --git a/packages/http-client-python/eng/scripts/ci/lint.ts b/packages/http-client-python/eng/scripts/ci/lint.ts index 37c9469fd8a..eb3ff082c5a 100644 --- a/packages/http-client-python/eng/scripts/ci/lint.ts +++ b/packages/http-client-python/eng/scripts/ci/lint.ts @@ -34,7 +34,7 @@ const argv = parseArgs({ if (argv.values.help) { console.log(` -${pc.bold("Usage:")} tsx lint.ts [options] +${pc.bold("Usage:")} node lint.ts [options] ${pc.bold("Description:")} Run linting checks on the codebase. @@ -59,19 +59,19 @@ ${pc.bold("Options:")} ${pc.bold("Examples:")} ${pc.dim("# Lint emitter + pygen source (default)")} - tsx lint.ts + node lint.ts ${pc.dim("# Lint only TypeScript emitter")} - tsx lint.ts --emitter + node lint.ts --emitter ${pc.dim("# Lint only pygen source code")} - tsx lint.ts --generator + node lint.ts --generator ${pc.dim("# Lint generated SDK packages")} - tsx lint.ts --generated + node lint.ts --generated ${pc.dim("# Lint generated SDK packages for azure only")} - tsx lint.ts --generated --flavor=azure + node lint.ts --generated --flavor=azure `); process.exit(0); } diff --git a/packages/http-client-python/eng/scripts/ci/regenerate.ts b/packages/http-client-python/eng/scripts/ci/regenerate.ts index e6c8cee1110..4a3db1dc874 100644 --- a/packages/http-client-python/eng/scripts/ci/regenerate.ts +++ b/packages/http-client-python/eng/scripts/ci/regenerate.ts @@ -28,7 +28,7 @@ import { RegenerateContext, RegenerateFlags, runParallel, -} from "./regenerate-common.js"; +} from "./regenerate-common.ts"; // Parse arguments const argv = parseArgs({ @@ -47,7 +47,7 @@ const argv = parseArgs({ if (argv.values.help) { console.log(` -${pc.bold("Usage:")} tsx regenerate.ts [options] +${pc.bold("Usage:")} node regenerate.ts [options] ${pc.bold("Description:")} Regenerates Python SDK code from TypeSpec definitions using in-process compilation. @@ -75,16 +75,16 @@ ${pc.bold("Options:")} ${pc.bold("Examples:")} ${pc.dim("# Regenerate all packages for both flavors")} - tsx regenerate.ts + node regenerate.ts ${pc.dim("# Regenerate only Azure packages")} - tsx regenerate.ts --flavor azure + node regenerate.ts --flavor azure ${pc.dim("# Regenerate a specific package by name")} - tsx regenerate.ts --flavor azure --name authentication-api-key + node regenerate.ts --flavor azure --name authentication-api-key ${pc.dim("# Regenerate with more parallelism")} - tsx regenerate.ts --jobs 50 + node regenerate.ts --jobs 50 `); process.exit(0); } diff --git a/packages/http-client-python/eng/scripts/ci/typecheck.ts b/packages/http-client-python/eng/scripts/ci/typecheck.ts index ff794d418ec..7a62ef22cb6 100644 --- a/packages/http-client-python/eng/scripts/ci/typecheck.ts +++ b/packages/http-client-python/eng/scripts/ci/typecheck.ts @@ -33,7 +33,7 @@ const argv = parseArgs({ if (argv.values.help) { console.log(` -${pc.bold("Usage:")} tsx typecheck.ts [options] +${pc.bold("Usage:")} node typecheck.ts [options] ${pc.bold("Description:")} Run type checking (mypy + pyright) on Python code. @@ -58,19 +58,19 @@ ${pc.bold("Options:")} ${pc.bold("Examples:")} ${pc.dim("# Type check pygen source (default - runs both mypy and pyright)")} - tsx typecheck.ts + node typecheck.ts ${pc.dim("# Run only mypy on pygen source")} - tsx typecheck.ts --mypy + node typecheck.ts --mypy ${pc.dim("# Run only pyright on pygen source")} - tsx typecheck.ts --pyright + node typecheck.ts --pyright ${pc.dim("# Type check generated SDK packages")} - tsx typecheck.ts --generated + node typecheck.ts --generated ${pc.dim("# Type check generated SDK packages for azure only")} - tsx typecheck.ts --generated --flavor=azure + node typecheck.ts --generated --flavor=azure `); process.exit(0); } diff --git a/packages/http-client-python/eng/scripts/setup/build.ts b/packages/http-client-python/eng/scripts/setup/build.ts index 71c258e68c6..dc09e006631 100644 --- a/packages/http-client-python/eng/scripts/setup/build.ts +++ b/packages/http-client-python/eng/scripts/setup/build.ts @@ -1,5 +1,5 @@ import { exec } from "child_process"; -import { runPython3 } from "./run-python3.js"; +import { runPython3 } from "./run-python3.ts"; async function main() { await runPython3("./eng/scripts/setup/build_pygen_wheel.py"); diff --git a/packages/http-client-python/eng/scripts/setup/install.ts b/packages/http-client-python/eng/scripts/setup/install.ts index 0835e6e4cfd..e85cba53d64 100644 --- a/packages/http-client-python/eng/scripts/setup/install.ts +++ b/packages/http-client-python/eng/scripts/setup/install.ts @@ -1,5 +1,5 @@ import cp from "child_process"; -import { patchPythonPath } from "./system-requirements.js"; +import { patchPythonPath } from "./system-requirements.ts"; async function main() { let pythonCommand: string[]; diff --git a/packages/http-client-python/eng/scripts/setup/prepare.ts b/packages/http-client-python/eng/scripts/setup/prepare.ts index d3cea514a62..dd3f6e92645 100644 --- a/packages/http-client-python/eng/scripts/setup/prepare.ts +++ b/packages/http-client-python/eng/scripts/setup/prepare.ts @@ -1,4 +1,4 @@ -import { runPython3 } from "./run-python3.js"; +import { runPython3 } from "./run-python3.ts"; async function main() { try { diff --git a/packages/http-client-python/eng/scripts/setup/run-python3.ts b/packages/http-client-python/eng/scripts/setup/run-python3.ts index 422a28be733..6cfdcf6d391 100644 --- a/packages/http-client-python/eng/scripts/setup/run-python3.ts +++ b/packages/http-client-python/eng/scripts/setup/run-python3.ts @@ -4,10 +4,10 @@ // path resolution algorithm as AutoRest so that the behavior // is fully consistent (and also supports AUTOREST_PYTHON_EXE). // -// Invoke it like so: "tsx run-python3.ts script.py" +// Invoke it like so: "node run-python3.ts script.py" import cp from "child_process"; -import { patchPythonPath } from "./system-requirements.js"; +import { patchPythonPath } from "./system-requirements.ts"; export async function runPython3(...args: string[]) { const command = await patchPythonPath(["python", ...args], { diff --git a/packages/http-client-python/package.json b/packages/http-client-python/package.json index 25f1b0409a5..94b39065660 100644 --- a/packages/http-client-python/package.json +++ b/packages/http-client-python/package.json @@ -34,24 +34,24 @@ }, "scripts": { "clean": "rimraf ./dist ./temp ./venv ./tests/generated", - "build": "tsc -p ./emitter/tsconfig.build.json && tsx ./eng/scripts/setup/build.ts", + "build": "tsc -p ./emitter/tsconfig.build.json && node ./eng/scripts/setup/build.ts", "watch": "tsc -p ./emitter/tsconfig.build.json --watch", - "install": "tsx ./eng/scripts/setup/install.ts", - "prepare": "tsx ./eng/scripts/setup/prepare.ts", + "install": "node ./eng/scripts/setup/install.ts", + "prepare": "node ./eng/scripts/setup/prepare.ts", "setup": "npm run build && npm run install", - "test": "tsx ./eng/scripts/ci/run-tests.ts", - "test:emitter": "tsx ./eng/scripts/ci/run-tests.ts --emitter", - "test:generator": "tsx ./eng/scripts/ci/run-tests.ts --generator", - "lint": "tsx ./eng/scripts/ci/lint.ts", - "lint:generated": "tsx ./eng/scripts/ci/lint.ts --generated", - "format": "tsx ./eng/scripts/ci/format.ts", - "format:check": "tsx ./eng/scripts/ci/format.ts --check", - "format:generated": "tsx ./eng/scripts/ci/format.ts --generated", - "typecheck": "tsx ./eng/scripts/ci/typecheck.ts", - "typecheck:generated": "tsx ./eng/scripts/ci/typecheck.ts --generated", - "regenerate": "tsx ./eng/scripts/ci/regenerate.ts", + "test": "node ./eng/scripts/ci/run-tests.ts", + "test:emitter": "node ./eng/scripts/ci/run-tests.ts --emitter", + "test:generator": "node ./eng/scripts/ci/run-tests.ts --generator", + "lint": "node ./eng/scripts/ci/lint.ts", + "lint:generated": "node ./eng/scripts/ci/lint.ts --generated", + "format": "node ./eng/scripts/ci/format.ts", + "format:check": "node ./eng/scripts/ci/format.ts --check", + "format:generated": "node ./eng/scripts/ci/format.ts --generated", + "typecheck": "node ./eng/scripts/ci/typecheck.ts", + "typecheck:generated": "node ./eng/scripts/ci/typecheck.ts --generated", + "regenerate": "node ./eng/scripts/ci/regenerate.ts", "ci": "npm run test:emitter && npm run ci:generated", - "ci:generated": "tsx ./eng/scripts/ci/run-tests.ts --generator --env=ci", + "ci:generated": "node ./eng/scripts/ci/run-tests.ts --generator --env=ci", "change:version": "pnpm chronus version --ignore-policies --only @typespec/http-client-python", "change:add": "pnpm chronus add", "regen-docs": "node ../../packages/tspd/cmd/tspd.js doc . --enable-experimental --output-dir ../../website/src/content/docs/docs/emitters/clients/http-client-python/reference --skip-js", @@ -99,8 +99,7 @@ "js-yaml": "^4.2.0", "marked": "^15.0.6", "pyodide": "0.26.2", - "semver": "~7.6.2", - "tsx": "^4.21.0" + "semver": "~7.6.2" }, "devDependencies": { "@azure-tools/typespec-autorest": "~0.70.0", From ab802ef226e122cc91e7d4f4da867187a14f0d3d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Jul 2026 18:30:14 +0000 Subject: [PATCH 2/5] fix: add type keyword to type-only imports for native Node.js TS compatibility Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com> --- packages/http-client-python/eng/scripts/ci/regenerate.ts | 4 ++-- .../eng/scripts/setup/system-requirements.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/http-client-python/eng/scripts/ci/regenerate.ts b/packages/http-client-python/eng/scripts/ci/regenerate.ts index 4a3db1dc874..8c3d7ac976c 100644 --- a/packages/http-client-python/eng/scripts/ci/regenerate.ts +++ b/packages/http-client-python/eng/scripts/ci/regenerate.ts @@ -25,8 +25,8 @@ import { getSubdirectories, prepareBaselineOfGeneratedCode, preprocess, - RegenerateContext, - RegenerateFlags, + type RegenerateContext, + type RegenerateFlags, runParallel, } from "./regenerate-common.ts"; diff --git a/packages/http-client-python/eng/scripts/setup/system-requirements.ts b/packages/http-client-python/eng/scripts/setup/system-requirements.ts index f47685db629..e4b3bf61268 100644 --- a/packages/http-client-python/eng/scripts/setup/system-requirements.ts +++ b/packages/http-client-python/eng/scripts/setup/system-requirements.ts @@ -1,4 +1,4 @@ -import { ChildProcess, spawn, SpawnOptions } from "child_process"; +import { ChildProcess, spawn, type SpawnOptions } from "child_process"; /* * Copied from @autorest/system-requirements From 93e9e43503d5b163fd0f4cee34715795d4889c2b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Jul 2026 19:42:17 +0000 Subject: [PATCH 3/5] fix: add JS bootstrappers and tsconfig for setup scripts to fix node_modules type stripping - Create eng/scripts/setup/install-runner.js and prepare-runner.js as plain JavaScript bootstrappers that work in any Node.js context (including under node_modules where type stripping is not allowed) - Create eng/scripts/setup/tsconfig.build.json to compile setup scripts to dist/scripts/setup/ using rewriteRelativeImportExtensions so .ts imports become .js in the compiled output - Update package.json: install/prepare lifecycle scripts use the .js runners; build step now also compiles setup scripts to dist/ Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com> --- .../eng/scripts/setup/install-runner.js | 33 ++ .../eng/scripts/setup/prepare-runner.js | 33 ++ .../eng/scripts/setup/tsconfig.build.json | 19 + packages/http-client-python/package-lock.json | 503 +----------------- packages/http-client-python/package.json | 6 +- 5 files changed, 92 insertions(+), 502 deletions(-) create mode 100644 packages/http-client-python/eng/scripts/setup/install-runner.js create mode 100644 packages/http-client-python/eng/scripts/setup/prepare-runner.js create mode 100644 packages/http-client-python/eng/scripts/setup/tsconfig.build.json diff --git a/packages/http-client-python/eng/scripts/setup/install-runner.js b/packages/http-client-python/eng/scripts/setup/install-runner.js new file mode 100644 index 00000000000..672acd8b90e --- /dev/null +++ b/packages/http-client-python/eng/scripts/setup/install-runner.js @@ -0,0 +1,33 @@ +// Plain JavaScript bootstrap for the npm `install` lifecycle script. +// This file must stay as plain JavaScript because it may run from within +// node_modules (when the package is installed as a dependency), where +// Node.js refuses to strip TypeScript types. +// +// When installed from npm/tgz the compiled dist/scripts/setup/install.js is +// used. When running in the repository itself (dev context) the TypeScript +// source is loaded directly via Node.js native type stripping. +import { existsSync } from "node:fs"; +import { fileURLToPath } from "node:url"; +import { dirname, join } from "node:path"; + +const __dirname = dirname(fileURLToPath(import.meta.url)); +const compiledPath = join(__dirname, "../../../dist/scripts/setup/install.js"); + +try { + if (existsSync(compiledPath)) { + // Installed from npm package: use pre-compiled JavaScript. + await import(compiledPath); + } else { + // Development context: TypeScript source works via native type stripping. + await import("./install.ts"); + } +} catch (err) { + if (err?.code === "ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING") { + // Running from node_modules without pre-compiled JS — this shouldn't + // happen for a properly built package, but fail gracefully rather than + // blocking the install. + console.log("Python environment setup skipped: run 'npm run build' first."); + } else { + throw err; + } +} diff --git a/packages/http-client-python/eng/scripts/setup/prepare-runner.js b/packages/http-client-python/eng/scripts/setup/prepare-runner.js new file mode 100644 index 00000000000..28c321039e5 --- /dev/null +++ b/packages/http-client-python/eng/scripts/setup/prepare-runner.js @@ -0,0 +1,33 @@ +// Plain JavaScript bootstrap for the npm `prepare` lifecycle script. +// This file must stay as plain JavaScript because it may run from within +// node_modules (when the package is installed as a dependency), where +// Node.js refuses to strip TypeScript types. +// +// When installed from npm/tgz the compiled dist/scripts/setup/prepare.js is +// used. When running in the repository itself (dev context) the TypeScript +// source is loaded directly via Node.js native type stripping. +import { existsSync } from "node:fs"; +import { fileURLToPath } from "node:url"; +import { dirname, join } from "node:path"; + +const __dirname = dirname(fileURLToPath(import.meta.url)); +const compiledPath = join(__dirname, "../../../dist/scripts/setup/prepare.js"); + +try { + if (existsSync(compiledPath)) { + // Installed from npm package: use pre-compiled JavaScript. + await import(compiledPath); + } else { + // Development context: TypeScript source works via native type stripping. + await import("./prepare.ts"); + } +} catch (err) { + if (err?.code === "ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING") { + // Running from node_modules without pre-compiled JS — this shouldn't + // happen for a properly built package, but fail gracefully rather than + // blocking the install. + console.log("Python environment prepare skipped: run 'npm run build' first."); + } else { + throw err; + } +} diff --git a/packages/http-client-python/eng/scripts/setup/tsconfig.build.json b/packages/http-client-python/eng/scripts/setup/tsconfig.build.json new file mode 100644 index 00000000000..8b35b4fef4a --- /dev/null +++ b/packages/http-client-python/eng/scripts/setup/tsconfig.build.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "noEmit": false, + "rootDir": ".", + "outDir": "../../../dist/scripts/setup", + "allowImportingTsExtensions": true, + "rewriteRelativeImportExtensions": true, + "declaration": false, + "declarationMap": false, + "sourceMap": false, + "strict": true, + "skipLibCheck": true, + "types": ["node"] + }, + "include": ["./**/*.ts"] +} diff --git a/packages/http-client-python/package-lock.json b/packages/http-client-python/package-lock.json index 24fce49d063..ebaa9b6e8f6 100644 --- a/packages/http-client-python/package-lock.json +++ b/packages/http-client-python/package-lock.json @@ -1,20 +1,19 @@ { "name": "@typespec/http-client-python", - "version": "0.34.2", + "version": "0.35.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@typespec/http-client-python", - "version": "0.34.2", + "version": "0.35.0", "hasInstallScript": true, "license": "MIT", "dependencies": { "js-yaml": "^4.2.0", "marked": "^15.0.6", "pyodide": "0.26.2", - "semver": "~7.6.2", - "tsx": "^4.21.0" + "semver": "~7.6.2" }, "devDependencies": { "@azure-tools/azure-http-specs": "0.1.0-alpha.43", @@ -539,422 +538,6 @@ "tslib": "^2.4.0" } }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz", - "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==", - "cpu": [ - "ppc64" - ], - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz", - "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==", - "cpu": [ - "arm" - ], - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz", - "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz", - "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz", - "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz", - "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz", - "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz", - "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz", - "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==", - "cpu": [ - "arm" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz", - "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz", - "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==", - "cpu": [ - "ia32" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz", - "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==", - "cpu": [ - "loong64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz", - "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==", - "cpu": [ - "mips64el" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz", - "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==", - "cpu": [ - "ppc64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz", - "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==", - "cpu": [ - "riscv64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz", - "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==", - "cpu": [ - "s390x" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz", - "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz", - "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz", - "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz", - "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz", - "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz", - "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz", - "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz", - "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==", - "cpu": [ - "arm64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz", - "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==", - "cpu": [ - "ia32" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz", - "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==", - "cpu": [ - "x64" - ], - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.9.1", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", @@ -3625,47 +3208,6 @@ "node": ">= 0.4" } }, - "node_modules/esbuild": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz", - "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==", - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.27.3", - "@esbuild/android-arm": "0.27.3", - "@esbuild/android-arm64": "0.27.3", - "@esbuild/android-x64": "0.27.3", - "@esbuild/darwin-arm64": "0.27.3", - "@esbuild/darwin-x64": "0.27.3", - "@esbuild/freebsd-arm64": "0.27.3", - "@esbuild/freebsd-x64": "0.27.3", - "@esbuild/linux-arm": "0.27.3", - "@esbuild/linux-arm64": "0.27.3", - "@esbuild/linux-ia32": "0.27.3", - "@esbuild/linux-loong64": "0.27.3", - "@esbuild/linux-mips64el": "0.27.3", - "@esbuild/linux-ppc64": "0.27.3", - "@esbuild/linux-riscv64": "0.27.3", - "@esbuild/linux-s390x": "0.27.3", - "@esbuild/linux-x64": "0.27.3", - "@esbuild/netbsd-arm64": "0.27.3", - "@esbuild/netbsd-x64": "0.27.3", - "@esbuild/openbsd-arm64": "0.27.3", - "@esbuild/openbsd-x64": "0.27.3", - "@esbuild/openharmony-arm64": "0.27.3", - "@esbuild/sunos-x64": "0.27.3", - "@esbuild/win32-arm64": "0.27.3", - "@esbuild/win32-ia32": "0.27.3", - "@esbuild/win32-x64": "0.27.3" - } - }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -4238,6 +3780,7 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -4318,17 +3861,6 @@ "node": ">= 0.4" } }, - "node_modules/get-tsconfig": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.0.tgz", - "integrity": "sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==", - "dependencies": { - "resolve-pkg-maps": "^1.0.0" - }, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, "node_modules/glob": { "version": "13.0.3", "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.3.tgz", @@ -5980,14 +5512,6 @@ "node": ">=4" } }, - "node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", - "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" - } - }, "node_modules/rimraf": { "version": "6.1.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.2.tgz", @@ -6722,25 +6246,6 @@ "dev": true, "license": "0BSD" }, - "node_modules/tsx": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.21.0.tgz", - "integrity": "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==", - "license": "MIT", - "dependencies": { - "esbuild": "~0.27.0", - "get-tsconfig": "^4.7.5" - }, - "bin": { - "tsx": "dist/cli.mjs" - }, - "engines": { - "node": ">=18.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - } - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/packages/http-client-python/package.json b/packages/http-client-python/package.json index 94b39065660..e6a546df702 100644 --- a/packages/http-client-python/package.json +++ b/packages/http-client-python/package.json @@ -34,10 +34,10 @@ }, "scripts": { "clean": "rimraf ./dist ./temp ./venv ./tests/generated", - "build": "tsc -p ./emitter/tsconfig.build.json && node ./eng/scripts/setup/build.ts", + "build": "tsc -p ./emitter/tsconfig.build.json && node ./eng/scripts/setup/build.ts && tsc -p ./eng/scripts/setup/tsconfig.build.json", "watch": "tsc -p ./emitter/tsconfig.build.json --watch", - "install": "node ./eng/scripts/setup/install.ts", - "prepare": "node ./eng/scripts/setup/prepare.ts", + "install": "node ./eng/scripts/setup/install-runner.js", + "prepare": "node ./eng/scripts/setup/prepare-runner.js", "setup": "npm run build && npm run install", "test": "node ./eng/scripts/ci/run-tests.ts", "test:emitter": "node ./eng/scripts/ci/run-tests.ts --emitter", From c839d0894f8c246dfea70b60059a814944457d24 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Jul 2026 20:27:46 +0000 Subject: [PATCH 4/5] fix: add eslint-disable-line no-console to runner bootstrap files Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com> --- packages/http-client-python/eng/scripts/setup/install-runner.js | 2 +- packages/http-client-python/eng/scripts/setup/prepare-runner.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/http-client-python/eng/scripts/setup/install-runner.js b/packages/http-client-python/eng/scripts/setup/install-runner.js index 672acd8b90e..d3a286d502d 100644 --- a/packages/http-client-python/eng/scripts/setup/install-runner.js +++ b/packages/http-client-python/eng/scripts/setup/install-runner.js @@ -26,7 +26,7 @@ try { // Running from node_modules without pre-compiled JS — this shouldn't // happen for a properly built package, but fail gracefully rather than // blocking the install. - console.log("Python environment setup skipped: run 'npm run build' first."); + console.log("Python environment setup skipped: run 'npm run build' first."); // eslint-disable-line no-console } else { throw err; } diff --git a/packages/http-client-python/eng/scripts/setup/prepare-runner.js b/packages/http-client-python/eng/scripts/setup/prepare-runner.js index 28c321039e5..4fa0fda7d6a 100644 --- a/packages/http-client-python/eng/scripts/setup/prepare-runner.js +++ b/packages/http-client-python/eng/scripts/setup/prepare-runner.js @@ -26,7 +26,7 @@ try { // Running from node_modules without pre-compiled JS — this shouldn't // happen for a properly built package, but fail gracefully rather than // blocking the install. - console.log("Python environment prepare skipped: run 'npm run build' first."); + console.log("Python environment prepare skipped: run 'npm run build' first."); // eslint-disable-line no-console } else { throw err; } From 9c9118b0bc57f7a76bfbff2b9b923271034ff673 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 30 Jul 2026 15:37:24 +0000 Subject: [PATCH 5/5] style: sort imports in install-runner.js and prepare-runner.js Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com> --- packages/http-client-python/eng/scripts/setup/install-runner.js | 2 +- packages/http-client-python/eng/scripts/setup/prepare-runner.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/http-client-python/eng/scripts/setup/install-runner.js b/packages/http-client-python/eng/scripts/setup/install-runner.js index f04ba07ac61..e0830b1f174 100644 --- a/packages/http-client-python/eng/scripts/setup/install-runner.js +++ b/packages/http-client-python/eng/scripts/setup/install-runner.js @@ -7,8 +7,8 @@ // used. When running in the repository itself (dev context) the TypeScript // source is loaded directly via Node.js native type stripping. import { existsSync } from "node:fs"; -import { fileURLToPath, pathToFileURL } from "node:url"; import { dirname, join } from "node:path"; +import { fileURLToPath, pathToFileURL } from "node:url"; const __dirname = dirname(fileURLToPath(import.meta.url)); const compiledPath = join(__dirname, "../../../dist/scripts/setup/install.js"); diff --git a/packages/http-client-python/eng/scripts/setup/prepare-runner.js b/packages/http-client-python/eng/scripts/setup/prepare-runner.js index dedfe484159..df5bf856453 100644 --- a/packages/http-client-python/eng/scripts/setup/prepare-runner.js +++ b/packages/http-client-python/eng/scripts/setup/prepare-runner.js @@ -7,8 +7,8 @@ // used. When running in the repository itself (dev context) the TypeScript // source is loaded directly via Node.js native type stripping. import { existsSync } from "node:fs"; -import { fileURLToPath, pathToFileURL } from "node:url"; import { dirname, join } from "node:path"; +import { fileURLToPath, pathToFileURL } from "node:url"; const __dirname = dirname(fileURLToPath(import.meta.url)); const compiledPath = join(__dirname, "../../../dist/scripts/setup/prepare.js");