feat(http-client-python): migrate eng scripts from tsx to native Node.js TypeScript - #11425
feat(http-client-python): migrate eng scripts from tsx to native Node.js TypeScript#11425timotheeguerin with Copilot wants to merge 6 commits into
Conversation
…js TypeScript Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Python emitter diffBaseline No changes to generated output. Rendered diff: inline on the run summary, or the emitter-diff-html artifact. Informational check (eng/emitter-diff); does not block the PR. |
|
@copilot the build is failing did you check it was passing? |
…atibility Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
... Fixed in the latest commit. The root cause: Node.js native type stripping doesn't do import elision — it strips type annotations but leaves import statements untouched.
|
|
@copilot still failing pm install typespec-http-client-python-0.35.0.tgz |
…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>
Fixed in the latest commit. Root cause: Node.js 22+ native TypeScript type stripping is explicitly disabled for files under Fix:
|
|
@copilot still failing the build 29:5 warning Unexpected console statement no-console /mnt/vss/_work/1/s/packages/http-client-python/eng/scripts/setup/prepare-runner.js ✖ 2 problems (0 errors, 2 warnings) ESLint found too many warnings (maximum: 0). === Linting Python Generator (pygen) === [RUN] /mnt/vss/_work/1/s/packages/http-client-python/venv/bin/python -m pylint generator/pygen --rcfile=eng/scripts/ci/config/pylintrc --recursive=y --py-version=3.10 Your code has been rated at 10.00/10 [PASS] /mnt/vss/_work/1/s/packages/http-client-python/venv/bin/python completed successfully ##[error]PowerShell e |
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Fixed — added |
commit: |
|
@copilot still failing DO test the FULL build locally and make sure it passes also pull main and merge conflicts |
…tive-node-typescript # Conflicts: # packages/http-client-python/package.json Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
... Fixed in the latest commits. The Windows failure was |
|
@copilot run formatter |
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Done — sorted the |
Mirrors the change from Azure/typespec-azure#5068: replace
tsxas the TypeScript script runner with Node.js native TypeScript support (Node 22+ strips types natively).Changes
package.json: Replace alltsx ./eng/scripts/...invocations withnode ./eng/scripts/...; removetsxfromdependencieseng/scripts/setup/*.tsandeng/scripts/ci/regenerate.ts: Change relative imports from.js→.tsextensions (required for native Node TS resolution)tsx <script>.tsusage examples tonode <script>.ts