From fa6c1842564728c19502bb33d89fb06f2b106e97 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Mon, 20 Jul 2026 14:47:25 -0400 Subject: [PATCH 1/4] Replace npm/npx usage with pnpm to stop npm warnings pnpm exports its settings (catalog, verify-deps-before-run, etc.) as npm_config_* env vars, so any npm/npx invoked inside pnpm's environment printed 'npm warn Unknown env config'. This removes those invocations: - Remove root preinstall 'npx only-allow pnpm' (source of install-time warnings); pnpm stays enforced via packageManager + engine-strict. - Convert 'npm run'/'npx'/'npm pack' to pnpm equivalents in internal package.json scripts, helper scripts, CI and ADO pipelines. - Update user-facing docs and regenerate typespec-ts scenario-suite headers and the doc-update gh-aw lock file. Excludes core submodule, tspd-generated package READMEs, standalone npm subprojects (typespec-java emitter-tests), tsp-client/azure-rest-api-specs docs, and generated customer-facing SDK templates. --- .../cleanup-npm-usage-2026-07-20-13-49-00.md | 14 ++++++++++++++ .github/workflows/ci.yml | 4 ++-- .github/workflows/consistency.yml | 2 +- .github/workflows/doc-update.lock.yml | 8 ++++---- .github/workflows/doc-update.md | 8 ++++---- CONTRIBUTING.md | 6 +++--- README.md | 2 +- eng/pipelines/jobs/spector-coverage.yml | 2 +- eng/pipelines/pr-tools.yml | 4 ++-- eng/pipelines/templates/install-browsers.yml | 2 +- .../templates/upload-spector-coverage.yml | 4 ++-- eng/scripts/doc-updater/src/precompute.ts | 4 ++-- eng/scripts/doc-updater/src/print-allowed-paths.ts | 4 ++-- eng/scripts/doc-updater/src/update-meta.ts | 4 ++-- package.json | 1 - packages/samples/README.md | 8 ++++---- packages/typespec-autorest-canonical/package.json | 2 +- packages/typespec-autorest/package.json | 2 +- .../typespec-azure-playground-website/README.md | 6 +++--- .../typespec-azure-playground-website/package.json | 4 ++-- packages/typespec-azure-portal-core/package.json | 2 +- .../typespec-azure-resource-manager/package.json | 2 +- .../typespec-client-generator-core/package.json | 2 +- packages/typespec-go/.scripts/spector.js | 2 +- packages/typespec-go/.scripts/test-update.js | 2 +- packages/typespec-go/docs/development.md | 2 +- packages/typespec-java/package.json | 2 +- packages/typespec-ts/package.json | 14 +++++++------- .../test/commands/gen-scenario-suites.ts | 4 ++-- .../modular-unit/scenario-suites.guard.test.ts | 4 ++-- .../modular-unit/scenario-suites/anonymous.test.ts | 2 +- .../scenario-suites/api-operations.test.ts | 2 +- .../scenario-suites/classic-client.test.ts | 2 +- .../scenario-suites/client-context.test.ts | 2 +- .../scenario-suites/empty-project.test.ts | 2 +- .../scenario-suites/enum-union.test.ts | 2 +- .../modular-unit/scenario-suites/example.test.ts | 2 +- .../scenario-suites/models-generator.test.ts | 2 +- .../modular-unit/scenario-suites/models.test.ts | 2 +- .../scenario-suites/models__api-version.test.ts | 2 +- .../scenario-suites/models__arm.test.ts | 2 +- .../models__deserialization.test.ts | 2 +- .../models__nested-enum__flatten.test.ts | 2 +- .../models__nested-enum__not-flatten.test.ts | 2 +- .../scenario-suites/models__nullable.test.ts | 2 +- .../models__property-flatten.test.ts | 2 +- .../scenario-suites/models__response.test.ts | 2 +- .../scenario-suites/models__serialization.test.ts | 2 +- .../scenario-suites/models__template.test.ts | 2 +- .../modular-unit/scenario-suites/multipart.test.ts | 2 +- .../scenario-suites/operations.test.ts | 2 +- .../scenario-suites/operations__body-param.test.ts | 2 +- .../operations__cookie-param.test.ts | 2 +- .../operations__error-deserialization.test.ts | 2 +- .../operations__header-param.test.ts | 2 +- .../scenario-suites/operations__pagination.test.ts | 2 +- .../scenario-suites/operations__path-param.test.ts | 2 +- .../operations__query-param.test.ts | 2 +- .../operations__storage-compat.test.ts | 2 +- .../scenario-suites/payload__xml.test.ts | 2 +- .../scenario-suites/samples__client.test.ts | 2 +- .../samples__client__disable-hierarchy.test.ts | 2 +- .../samples__client__enable-hierarchy.test.ts | 2 +- .../scenario-suites/samples__operations.test.ts | 2 +- .../scenario-suites/samples__parameters.test.ts | 2 +- .../samples__property-flatten.test.ts | 2 +- .../scenario-suites/test__operations.test.ts | 2 +- .../scenario-suites/test__parameters.test.ts | 2 +- .../scenario-suites/test__responses.test.ts | 2 +- .../docs/docs/emitters/typespec-autorest/index.md | 2 +- 70 files changed, 110 insertions(+), 97 deletions(-) create mode 100644 .chronus/changes/cleanup-npm-usage-2026-07-20-13-49-00.md diff --git a/.chronus/changes/cleanup-npm-usage-2026-07-20-13-49-00.md b/.chronus/changes/cleanup-npm-usage-2026-07-20-13-49-00.md new file mode 100644 index 0000000000..dad6204f4a --- /dev/null +++ b/.chronus/changes/cleanup-npm-usage-2026-07-20-13-49-00.md @@ -0,0 +1,14 @@ +--- +changeKind: internal +packages: + - "@azure-tools/typespec-autorest" + - "@azure-tools/typespec-autorest-canonical" + - "@azure-tools/typespec-azure-portal-core" + - "@azure-tools/typespec-azure-resource-manager" + - "@azure-tools/typespec-client-generator-core" + - "@azure-tools/typespec-go" + - "@azure-tools/typespec-java" + - "@azure-tools/typespec-ts" +--- + +Replace `npm`/`npx` usage in build and test scripts with `pnpm` equivalents to stop `npm warn Unknown env config` warnings when running inside the pnpm workspace. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 408a8ea18c..aaa041e11a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,7 +105,7 @@ jobs: - name: Install playwright browsers run: | sudo dpkg --configure -a - npx playwright install --with-deps + pnpm exec playwright install --with-deps working-directory: packages/typespec-azure-playground-website - name: Build @@ -138,7 +138,7 @@ jobs: run: pnpm --filter "@typespec/internal-build-utils..." run build - name: Install autorest & script dependencies - run: npm install -g autorest && cd eng/scripts && npm install + run: pnpm add -g autorest && cd eng/scripts && pnpm install - name: Swagger - Resource Manager Linting run: node eng/scripts/lint-resourcemanager.js "packages/samples/test/output/azure/resource-manager" diff --git a/.github/workflows/consistency.yml b/.github/workflows/consistency.yml index 0714e05d10..4719fb5cb3 100644 --- a/.github/workflows/consistency.yml +++ b/.github/workflows/consistency.yml @@ -33,7 +33,7 @@ jobs: - run: pnpm install name: Install dependencies - - run: npx chronus verify --since ${{ github.event.pull_request.base.ref }} + - run: pnpm exec chronus verify --since ${{ github.event.pull_request.base.ref }} name: Check changelog if: | !startsWith(github.head_ref, 'publish/') && diff --git a/.github/workflows/doc-update.lock.yml b/.github/workflows/doc-update.lock.yml index 27e31158fd..f5bde5860c 100644 --- a/.github/workflows/doc-update.lock.yml +++ b/.github/workflows/doc-update.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"37d85b7fda9ad514f1f8555d7a659647ff0c2e6423cf915fdc1944b69054e508","body_hash":"2899a091cbdde5f7c4f51c0dbe2dfce58b0a08ba63f12202bd7ecc6982500716","compiler_version":"v0.80.9","strict":true,"agent_id":"copilot","agent_model":"claude-opus-4.8","engine_versions":{"copilot":"1.0.63"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"1a2f5a2eddd25dc655b34169233a290271fcbb98ea0cbdc1ca6445001f88a76d","body_hash":"702c2fc338cffc698b71beb9cc2eaed5735a65872d904d2be76c1a702f29b239","compiler_version":"v0.80.9","strict":true,"agent_id":"copilot","agent_model":"claude-opus-4.8","engine_versions":{"copilot":"1.0.63"}} # gh-aw-manifest: {"version":1,"secrets":["GH_AW_CI_TRIGGER_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"27d5ce7f107fe9357f9df03efb73ab90386fccae","version":"v5.0.5"},{"repo":"actions/cache/save","sha":"27d5ce7f107fe9357f9df03efb73ab90386fccae","version":"v5.0.5"},{"repo":"actions/checkout","sha":"34e114876b0b11c390a56381ad16ebd13914f8d5","version":"v4.3.1"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"373c709c69115d41ff229c7e5df9f8788daa9553","version":"v9"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-dotnet","sha":"9a946fdbd5fb07b82b2f5a4466058b876ab72bb2","version":"v5.3.0"},{"repo":"actions/setup-go","sha":"4a3601121dd01d1626a1e23e37211e3254c1c06c","version":"v6.4.0"},{"repo":"actions/setup-java","sha":"be666c2fcd27ec809703dec50e508c2fdc7f6654","version":"v5.2.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/setup-python","sha":"a309ff8b426b58ec0e2a45f0f869d46889d02405","version":"v6.2.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"8c7d04ebf1ece56cd381446125da3e0f6896294a","version":"v0.80.9"},{"repo":"pnpm/action-setup","sha":"f40ffcd9367d9f12939873eb1018b921a783ffaa","version":"v4"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.7","digest":"sha256:aae231e4635c8999d039c132f1602d3df850fe9b84a00aa2b5ac981179b5661c","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.7@sha256:aae231e4635c8999d039c132f1602d3df850fe9b84a00aa2b5ac981179b5661c"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.7","digest":"sha256:009caf2e3d88fa77b64e9a03a95a228fc58db0f1701c6d324b29ba5a3c7c79b6","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.7@sha256:009caf2e3d88fa77b64e9a03a95a228fc58db0f1701c6d324b29ba5a3c7c79b6"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.7","digest":"sha256:deb1d4e19de62d51cee0508057a596a19315c3423ada4d675cad136dc8037c96","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.7@sha256:deb1d4e19de62d51cee0508057a596a19315c3423ada4d675cad136dc8037c96"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.27","digest":"sha256:fe984bddde4ec05d756d9043edb0a32912e6b7b72f6a121b1082f29221421cc7","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.27@sha256:fe984bddde4ec05d756d9043edb0a32912e6b7b72f6a121b1082f29221421cc7"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.4.0","digest":"sha256:2afb26356481d1a350e14544a6e160f7f7ec1561a1ea309b823665abf0309036","pinned_image":"ghcr.io/github/github-mcp-server:v1.4.0@sha256:2afb26356481d1a350e14544a6e160f7f7ec1561a1ea309b823665abf0309036"}]} # This file was automatically generated by gh-aw (v0.80.9). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # @@ -490,14 +490,14 @@ jobs: - name: Install repo dependencies run: pnpm install - name: Install doc-updater dependencies - run: npm install + run: pnpm install working-directory: eng/scripts/doc-updater - env: CONFIG_INPUT: ${{ github.event.inputs.config }} FULL_REBUILD_INPUT: ${{ github.event.inputs.full_rebuild }} GH_TOKEN: ${{ github.token }} name: Pre-compute context - run: "REBUILD_FLAG=\"\"\nif [ \"$FULL_REBUILD_INPUT\" = \"true\" ]; then\n REBUILD_FLAG=\"--full-rebuild\"\nfi\n\nnpx tsx eng/scripts/doc-updater/src/precompute.ts \\\n --config \"$CONFIG_INPUT\" \\\n --output /tmp/gh-aw/agent/context.json \\\n ${REBUILD_FLAG:+\"$REBUILD_FLAG\"}\n" + run: "REBUILD_FLAG=\"\"\nif [ \"$FULL_REBUILD_INPUT\" = \"true\" ]; then\n REBUILD_FLAG=\"--full-rebuild\"\nfi\n\npnpm exec tsx eng/scripts/doc-updater/src/precompute.ts \\\n --config \"$CONFIG_INPUT\" \\\n --output /tmp/gh-aw/agent/context.json \\\n ${REBUILD_FLAG:+\"$REBUILD_FLAG\"}\n" - name: Configure Git credentials env: @@ -1026,7 +1026,7 @@ jobs: - env: CONFIG_INPUT: ${{ github.event.inputs.config }} name: Validate file scope - run: "CONFIG=\"$CONFIG_INPUT\"\nALLOWED_FILE=\"eng/scripts/doc-updater/configs/${CONFIG}.yaml\"\n\n# Read allowedPaths using the doc-updater config loader\nALLOWED_PATHS=$(npx tsx eng/scripts/doc-updater/src/print-allowed-paths.ts --config \"$CONFIG\")\n\nif [ -z \"$ALLOWED_PATHS\" ]; then\n echo \"WARNING: No allowedPaths in config, skipping validation\"\n exit 0\nfi\n\n# Check every changed file against allowedPaths\nCHANGED=$(git diff --name-only HEAD 2>/dev/null || echo \"\")\nif [ -z \"$CHANGED\" ]; then\n echo \"No files changed.\"\n exit 0\nfi\n\nVIOLATIONS=\"\"\nwhile IFS= read -r file; do\n ALLOWED=false\n while IFS= read -r pattern; do\n if [[ \"$file\" == \"$pattern\"* ]]; then\n ALLOWED=true\n break\n fi\n done <<< \"$ALLOWED_PATHS\"\n if [ \"$ALLOWED\" = false ]; then\n VIOLATIONS=\"${VIOLATIONS} - ${file}\\n\"\n fi\ndone <<< \"$CHANGED\"\n\nif [ -n \"$VIOLATIONS\" ]; then\n echo \"::error::Agent modified files outside allowed paths:\"\n echo -e \"$VIOLATIONS\"\n exit 1\nfi\n\necho \"All modified files are within allowed paths.\"\n" + run: "CONFIG=\"$CONFIG_INPUT\"\nALLOWED_FILE=\"eng/scripts/doc-updater/configs/${CONFIG}.yaml\"\n\n# Read allowedPaths using the doc-updater config loader\nALLOWED_PATHS=$(pnpm exec tsx eng/scripts/doc-updater/src/print-allowed-paths.ts --config \"$CONFIG\")\n\nif [ -z \"$ALLOWED_PATHS\" ]; then\n echo \"WARNING: No allowedPaths in config, skipping validation\"\n exit 0\nfi\n\n# Check every changed file against allowedPaths\nCHANGED=$(git diff --name-only HEAD 2>/dev/null || echo \"\")\nif [ -z \"$CHANGED\" ]; then\n echo \"No files changed.\"\n exit 0\nfi\n\nVIOLATIONS=\"\"\nwhile IFS= read -r file; do\n ALLOWED=false\n while IFS= read -r pattern; do\n if [[ \"$file\" == \"$pattern\"* ]]; then\n ALLOWED=true\n break\n fi\n done <<< \"$ALLOWED_PATHS\"\n if [ \"$ALLOWED\" = false ]; then\n VIOLATIONS=\"${VIOLATIONS} - ${file}\\n\"\n fi\ndone <<< \"$CHANGED\"\n\nif [ -n \"$VIOLATIONS\" ]; then\n echo \"::error::Agent modified files outside allowed paths:\"\n echo -e \"$VIOLATIONS\"\n exit 1\nfi\n\necho \"All modified files are within allowed paths.\"\n" - name: Upload agent artifacts if: always() diff --git a/.github/workflows/doc-update.md b/.github/workflows/doc-update.md index a679ac40d8..abbf5dab39 100644 --- a/.github/workflows/doc-update.md +++ b/.github/workflows/doc-update.md @@ -54,7 +54,7 @@ steps: - name: Install doc-updater dependencies working-directory: eng/scripts/doc-updater - run: npm install + run: pnpm install - name: Pre-compute context env: @@ -67,7 +67,7 @@ steps: REBUILD_FLAG="--full-rebuild" fi - npx tsx eng/scripts/doc-updater/src/precompute.ts \ + pnpm exec tsx eng/scripts/doc-updater/src/precompute.ts \ --config "$CONFIG_INPUT" \ --output /tmp/gh-aw/agent/context.json \ ${REBUILD_FLAG:+"$REBUILD_FLAG"} @@ -102,7 +102,7 @@ post-steps: ALLOWED_FILE="eng/scripts/doc-updater/configs/${CONFIG}.yaml" # Read allowedPaths using the doc-updater config loader - ALLOWED_PATHS=$(npx tsx eng/scripts/doc-updater/src/print-allowed-paths.ts --config "$CONFIG") + ALLOWED_PATHS=$(pnpm exec tsx eng/scripts/doc-updater/src/print-allowed-paths.ts --config "$CONFIG") if [ -z "$ALLOWED_PATHS" ]; then echo "WARNING: No allowedPaths in config, skipping validation" @@ -170,7 +170,7 @@ been pre-computed and is available in `/tmp/gh-aw/agent/context.json`. - **Do not defer work.** Fix every issue you find in this run. Do not leave "remaining gaps" or "future work" in the knowledge base or PR description — the knowledge base is for lessons learned, not a to-do list. - **Update the knowledge base** at `knowledgePath` as you work (see Knowledge Base Rules below). - **Create exactly one pull request at the very end.** Only the main agent (you) may call `create_pull_request`, and only once, after ALL steps and ALL file edits are complete. Never delegate PR creation to a sub-agent. -- **Update metadata as your final step before creating the PR.** Run `npx tsx eng/scripts/doc-updater/src/update-meta.ts --config --commit ` (using the config name and `checkoutCommit` from the context) via the bash tool. This records the checkout commit hash so the next incremental run knows where to start. This must be done inside the agent so the metadata file is captured by safe-outputs. +- **Update metadata as your final step before creating the PR.** Run `pnpm exec tsx eng/scripts/doc-updater/src/update-meta.ts --config --commit ` (using the config name and `checkoutCommit` from the context) via the bash tool. This records the checkout commit hash so the next incremental run knows where to start. This must be done inside the agent so the metadata file is captured by safe-outputs. ## Knowledge Base Rules diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 01f7ed7e8e..9791b6e8c3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -204,7 +204,7 @@ The package also needs a `vitest.config.ts` — the root vitest workspace config ```json { "scripts": { - "test": "npm run test:vitest && npm run test:extra", + "test": "pnpm test:vitest && pnpm test:extra", "test:vitest": "vitest run", "test:extra": "dotnet test" } @@ -287,12 +287,12 @@ Do the following to publish a new release: main branch (both typespec-azure and core should point to main). 4. Generate release notes for TypeSpec once the full list of changes are in. - 1. In your fork of the core (typespec) repo, run `npx chronus changelog --policy typespec > out.md`. + 1. In your fork of the core (typespec) repo, run `pnpm exec chronus changelog --policy typespec > out.md`. 2. Create a new entry in `./core/website/src/content/docs/docs/release-notes` for this release and paste the contents of `out.md` into the new file. Reorganize the file to have the following sections in order: _Breaking Changes_, _Deprecations_, _Features_, and _Bug Fixes_. Skip the section if there are no entries in it. Also add a blurb above these sections for any especially notable updates. Example PR: https://github.com/microsoft/typespec/pull/4102 5. Generate release notes for TypeSpec Azure once the full list of changes are in. - 1. In your fork of the typespec-azure repo, run `npx chronus changelog --policy typespec-azure > out.md`. + 1. In your fork of the typespec-azure repo, run `pnpm exec chronus changelog --policy typespec-azure > out.md`. 2. Create a new entry in `./website/src/content/docs/docs/release-notes` for this release and paste the contents of `out.md` into the new file. Reorganize the file to have the following sections in order: _Breaking Changes_, _Deprecations_, _Features_, and _Bug Fixes_. Skip the section if there are no entries in it. Also add a blurb above these sections for any especially notable updates. Example PR: https://github.com/Azure/typespec-azure/pull/1306 diff --git a/README.md b/README.md index b23fc4dad6..ff695d26e9 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ For TypeSpec language documentation, see https://typespec.io/docs. If you are team working on Azure, see TypeSpec Azure development documentation https://azure.github.io/typespec-azure. You should pre-install as well `@azure-tools/typespec-azure-core` to define Azure resources, and `@azure-tools/typespec-autorest` to export in Swagger: ``` -npm install @typespec/rest @typespec/openapi3 @azure-tools/typespec-azure-core @azure-tools/typespec-autorest +pnpm add @typespec/rest @typespec/openapi3 @azure-tools/typespec-azure-core @azure-tools/typespec-autorest ``` > If you plan to use the output openapi with autorest or any of the azure sdk tooling _you should use typespec-autorest_, the openapi3 emitter is not going to have any of the ms extensions (pageable, lro, client name, etc.) and so it will be losing information. diff --git a/eng/pipelines/jobs/spector-coverage.yml b/eng/pipelines/jobs/spector-coverage.yml index b1cd593695..cde1067a39 100644 --- a/eng/pipelines/jobs/spector-coverage.yml +++ b/eng/pipelines/jobs/spector-coverage.yml @@ -162,7 +162,7 @@ jobs: scriptType: "bash" scriptLocation: "inlineScript" inlineScript: >- - npx tsp-spector upload-coverage + pnpm exec tsp-spector upload-coverage --coverageFile ./coverage/spector-coverage-typescript-azure.json --generatorName "@azure-tools/typespec-ts" --storageAccountName typespec diff --git a/eng/pipelines/pr-tools.yml b/eng/pipelines/pr-tools.yml index d6000499f3..b91d211c6c 100644 --- a/eng/pipelines/pr-tools.yml +++ b/eng/pipelines/pr-tools.yml @@ -64,7 +64,7 @@ extends: - template: /eng/common/pipelines/templates/steps/login-to-github.yml - - script: npx tsx core/eng/tsp-core/scripts/create-tryit-comment.ts "typespec-azure" + - script: pnpm exec tsx core/eng/tsp-core/scripts/create-tryit-comment.ts "typespec-azure" displayName: Check already commented env: GH_TOKEN: $(GH_TOKEN) @@ -80,7 +80,7 @@ extends: - template: /eng/common/pipelines/templates/steps/login-to-github.yml - - script: npx -p @chronus/github-pr-commenter@0.5.0 chronus-github-pr-commenter + - script: pnpm dlx @chronus/github-pr-commenter@0.5.0 chronus-github-pr-commenter displayName: Make comment about changes env: GITHUB_TOKEN: $(GH_TOKEN) diff --git a/eng/pipelines/templates/install-browsers.yml b/eng/pipelines/templates/install-browsers.yml index 3555c4160f..409e9046ec 100644 --- a/eng/pipelines/templates/install-browsers.yml +++ b/eng/pipelines/templates/install-browsers.yml @@ -2,6 +2,6 @@ steps: - script: | sudo dpkg --configure -a - npx playwright install --with-deps + pnpm exec playwright install --with-deps displayName: Install playwright browsers workingDirectory: packages/typespec-azure-playground-website diff --git a/eng/pipelines/templates/upload-spector-coverage.yml b/eng/pipelines/templates/upload-spector-coverage.yml index 41f6606286..d3536c710f 100644 --- a/eng/pipelines/templates/upload-spector-coverage.yml +++ b/eng/pipelines/templates/upload-spector-coverage.yml @@ -36,7 +36,7 @@ steps: scriptType: "bash" scriptLocation: "inlineScript" inlineScript: >- - npx tsp-spector upload-coverage + pnpm exec tsp-spector upload-coverage --coverageFile ./spec-coverage.json --generatorName "${{ parameters.UnbrandedGeneratorName }}" --storageAccountName typespec @@ -53,7 +53,7 @@ steps: scriptType: "bash" scriptLocation: "inlineScript" inlineScript: >- - npx tsp-spector upload-coverage + pnpm exec tsp-spector upload-coverage --coverageFile ./spec-coverage.json --generatorName "${{ parameters.GeneratorName }}" --storageAccountName typespec diff --git a/eng/scripts/doc-updater/src/precompute.ts b/eng/scripts/doc-updater/src/precompute.ts index 71e3d9ad9f..f62d648d92 100644 --- a/eng/scripts/doc-updater/src/precompute.ts +++ b/eng/scripts/doc-updater/src/precompute.ts @@ -7,7 +7,7 @@ * language instructions and thus resist prompt injection. * * Usage: - * npx tsx src/precompute.ts --config --output [--full-rebuild] + * pnpm exec tsx src/precompute.ts --config --output [--full-rebuild] */ import { mkdir, writeFile } from "node:fs/promises"; @@ -120,7 +120,7 @@ function parsePrecomputeArgs(): PrecomputeArgs { if (!parsed.config || !parsed.output) { console.error( - "Usage: npx tsx src/precompute.ts --config --output [--full-rebuild]", + "Usage: pnpm exec tsx src/precompute.ts --config --output [--full-rebuild]", ); process.exit(1); } diff --git a/eng/scripts/doc-updater/src/print-allowed-paths.ts b/eng/scripts/doc-updater/src/print-allowed-paths.ts index b134912ccf..6000dc47bc 100644 --- a/eng/scripts/doc-updater/src/print-allowed-paths.ts +++ b/eng/scripts/doc-updater/src/print-allowed-paths.ts @@ -6,7 +6,7 @@ * or root-level node module resolution. * * Usage: - * npx tsx eng/scripts/doc-updater/src/print-allowed-paths.ts --config + * pnpm exec tsx eng/scripts/doc-updater/src/print-allowed-paths.ts --config */ import { loadConfig } from "./config.js"; @@ -23,7 +23,7 @@ function parseArgs(): { config: string } { if (!config) { console.error( - "Usage: npx tsx eng/scripts/doc-updater/src/print-allowed-paths.ts --config ", + "Usage: pnpm exec tsx eng/scripts/doc-updater/src/print-allowed-paths.ts --config ", ); process.exit(1); } diff --git a/eng/scripts/doc-updater/src/update-meta.ts b/eng/scripts/doc-updater/src/update-meta.ts index 6530135a6f..8dea5b7817 100644 --- a/eng/scripts/doc-updater/src/update-meta.ts +++ b/eng/scripts/doc-updater/src/update-meta.ts @@ -5,7 +5,7 @@ * run knows where to start. * * Usage: - * npx tsx src/update-meta.ts --config --commit + * pnpm exec tsx src/update-meta.ts --config --commit */ import { loadConfig } from "./config.js"; @@ -25,7 +25,7 @@ function parseArgs(): { config: string; commit: string } { } if (!config || !commit) { - console.error("Usage: npx tsx src/update-meta.ts --config --commit "); + console.error("Usage: pnpm exec tsx src/update-meta.ts --config --commit "); process.exit(1); } diff --git a/package.json b/package.json index 3c1a320f22..0c384d182a 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ "lint:extra": "pnpm run-all lint:extra", "lint:fix": "oxlint . --fix", "pack:all": "chronus pack --pack-destination ./temp/artifacts", - "preinstall": "npx only-allow pnpm", "prepare-publish": "node ./eng/scripts/prepare-publish.js", "purge": "rimraf --glob \"packages/*/node_modules/\" --glob \"core/packages/*/node_modules/\"", "regen-docs": "pnpm run-all regen-docs", diff --git a/packages/samples/README.md b/packages/samples/README.md index b58e3f6a8c..0b71b469d2 100644 --- a/packages/samples/README.md +++ b/packages/samples/README.md @@ -1,10 +1,10 @@ # Typespec Azure Samples ```bash -npm run test # Check Samples match snapshots -npm run test:ci # run test same as CI +pnpm test # Check Samples match snapshots +pnpm test:ci # run test same as CI -npm run test:regen -- -g "" # Regen of this name +pnpm test:regen -- -g "" # Regen of this name -npm run test:regen # Regen all samples. +pnpm test:regen # Regen all samples. ``` diff --git a/packages/typespec-autorest-canonical/package.json b/packages/typespec-autorest-canonical/package.json index 7e5999c159..ef9d4a9e01 100644 --- a/packages/typespec-autorest-canonical/package.json +++ b/packages/typespec-autorest-canonical/package.json @@ -35,7 +35,7 @@ }, "scripts": { "clean": "rimraf ./dist ./temp", - "build": " tsc -p tsconfig.build.json && npm run lint-typespec-library", + "build": " tsc -p tsconfig.build.json && pnpm lint-typespec-library", "watch": "tsc -p tsconfig.build.json --watch", "lint-typespec-library": "tsp compile . --warn-as-error --import @typespec/library-linter --no-emit", "test": "vitest run", diff --git a/packages/typespec-autorest/package.json b/packages/typespec-autorest/package.json index 8368c14247..0944cad6b1 100644 --- a/packages/typespec-autorest/package.json +++ b/packages/typespec-autorest/package.json @@ -36,7 +36,7 @@ }, "scripts": { "clean": "rimraf ./dist ./temp", - "build": "npm run gen-extern-signature && npm run regen-autorest-openapi-schema && npm run regen-service-yaml-schema && tsc -p tsconfig.build.json && npm run lint-typespec-library", + "build": "pnpm gen-extern-signature && pnpm regen-autorest-openapi-schema && pnpm regen-service-yaml-schema && tsc -p tsconfig.build.json && pnpm lint-typespec-library", "watch": "tsc -p tsconfig.build.json --watch", "gen-extern-signature": "tspd --enable-experimental gen-extern-signature .", "lint-typespec-library": "tsp compile . --warn-as-error --import @typespec/library-linter --no-emit", diff --git a/packages/typespec-azure-playground-website/README.md b/packages/typespec-azure-playground-website/README.md index b08c34274d..13c9aa2fd9 100644 --- a/packages/typespec-azure-playground-website/README.md +++ b/packages/typespec-azure-playground-website/README.md @@ -4,9 +4,9 @@ A self contained website for the TypeSpec Azure Playground. ## Use -- `npm start` to start in dev mode -- `npm run preview` to build and preview prod mode -- `npm run build` to build for production +- `pnpm start` to start in dev mode +- `pnpm preview` to build and preview prod mode +- `pnpm build` to build for production ## Configuration diff --git a/packages/typespec-azure-playground-website/package.json b/packages/typespec-azure-playground-website/package.json index a9191e9eb8..79ce265b77 100644 --- a/packages/typespec-azure-playground-website/package.json +++ b/packages/typespec-azure-playground-website/package.json @@ -34,9 +34,9 @@ "scripts": { "clean": "rimraf ./dist ./dist-dev ./temp ./samples/dist", "build-samples": "tsx ./samples/build.ts", - "build": "npm run build-samples && tsc -p tsconfig.build.json && vite build 2>&1", + "build": "pnpm build-samples && tsc -p tsconfig.build.json && vite build 2>&1", "preview": "pnpm build && vite preview", - "start": "npm run -s watch", + "start": "pnpm -s watch", "test": "vitest run", "test:ci": "vitest run", "test:watch": "vitest -w", diff --git a/packages/typespec-azure-portal-core/package.json b/packages/typespec-azure-portal-core/package.json index 26176168b3..ca80eb6209 100644 --- a/packages/typespec-azure-portal-core/package.json +++ b/packages/typespec-azure-portal-core/package.json @@ -8,7 +8,7 @@ "readme": "https://github.com/Azure/typespec-azure/blob/main/packages/typespec-azure-portal-core/README.md", "scripts": { "clean": "rimraf ./dist ./temp", - "build": "tsc -p tsconfig.build.json && npm run lint-typespec-library", + "build": "tsc -p tsconfig.build.json && pnpm lint-typespec-library", "watch": "tsc -p tsconfig.build.json --watch", "lint-typespec-library": "tsp compile . --warn-as-error --import @typespec/library-linter --no-emit", "test": "vitest run", diff --git a/packages/typespec-azure-resource-manager/package.json b/packages/typespec-azure-resource-manager/package.json index b67b410f18..26a9f4cbd1 100644 --- a/packages/typespec-azure-resource-manager/package.json +++ b/packages/typespec-azure-resource-manager/package.json @@ -39,7 +39,7 @@ }, "scripts": { "clean": "rimraf ./dist ./temp", - "build": "npm run gen-extern-signature && tsc -p tsconfig.build.json && npm run lint-typespec-library", + "build": "pnpm gen-extern-signature && tsc -p tsconfig.build.json && pnpm lint-typespec-library", "watch": "tsc -p tsconfig.build.json --watch", "gen-extern-signature": "tspd --enable-experimental gen-extern-signature .", "lint-typespec-library": "tsp compile . --warn-as-error --import @typespec/library-linter --no-emit", diff --git a/packages/typespec-client-generator-core/package.json b/packages/typespec-client-generator-core/package.json index fcb8103803..785134e59c 100644 --- a/packages/typespec-client-generator-core/package.json +++ b/packages/typespec-client-generator-core/package.json @@ -37,7 +37,7 @@ }, "scripts": { "clean": "rimraf ./dist ./temp", - "build": "npm run gen-extern-signature && tsc -p tsconfig.build.json && npm run lint-typespec-library", + "build": "pnpm gen-extern-signature && tsc -p tsconfig.build.json && pnpm lint-typespec-library", "watch": "tsc -p tsconfig.build.json --watch", "gen-extern-signature": "tspd --enable-experimental gen-extern-signature .", "lint-typespec-library": "tsp compile . --warn-as-error --import @typespec/library-linter --no-emit", diff --git a/packages/typespec-go/.scripts/spector.js b/packages/typespec-go/.scripts/spector.js index a3e8c67eed..441bbe8e21 100644 --- a/packages/typespec-go/.scripts/spector.js +++ b/packages/typespec-go/.scripts/spector.js @@ -34,6 +34,6 @@ if (switches.length === 0) { throw new Error("missing arg: [--start] [--stop]"); } -const cmdLine = "npx tsp-spector " + switches.join(" "); +const cmdLine = "pnpm exec tsp-spector " + switches.join(" "); console.log(cmdLine); execSync(cmdLine, execSyncOptions); diff --git a/packages/typespec-go/.scripts/test-update.js b/packages/typespec-go/.scripts/test-update.js index 2743650737..4ef10b19f9 100644 --- a/packages/typespec-go/.scripts/test-update.js +++ b/packages/typespec-go/.scripts/test-update.js @@ -22,7 +22,7 @@ const genSuites = resolve(scriptDir, "..", "test", "unittest", "gen-scenario-sui execSync(`node "${genSuites}"`, { stdio: "inherit" }); const extra = process.argv.slice(2).join(" "); -const cmdLine = `npx vitest run --pass-with-no-tests ${extra}`.trim(); +const cmdLine = `pnpm exec vitest run --pass-with-no-tests ${extra}`.trim(); console.log(cmdLine); execSync(cmdLine, { stdio: "inherit", diff --git a/packages/typespec-go/docs/development.md b/packages/typespec-go/docs/development.md index 561785ca94..7d3e6c29b5 100644 --- a/packages/typespec-go/docs/development.md +++ b/packages/typespec-go/docs/development.md @@ -190,4 +190,4 @@ Before you do, make sure to: 1. Format your code (`pnpm format` from the repo root, or check with `pnpm format:check`). 2. Rebuild and regenerate everything so the committed fixtures reflect your change. -3. Add a changelog entry with [Chronus](https://github.com/microsoft/chronus) by running `npx chronus add` from the repo root and following the prompts. This creates a change file under `.chronus/changes/` that you should commit with your PR. +3. Add a changelog entry with [Chronus](https://github.com/microsoft/chronus) by running `pnpm exec chronus add` from the repo root and following the prompts. This creates a change file under `.chronus/changes/` that you should commit with your PR. diff --git a/packages/typespec-java/package.json b/packages/typespec-java/package.json index 757b624a70..b8aa438970 100644 --- a/packages/typespec-java/package.json +++ b/packages/typespec-java/package.json @@ -29,7 +29,7 @@ }, "scripts": { "clean": "rimraf ./dist ./temp ./generator", - "build": "npm run build:emitter && npm run build:generator", + "build": "pnpm build:emitter && pnpm build:generator", "build:emitter": "pwsh -NoProfile -File Copy-Sources.ps1 && tsc -p .", "build:generator": "pwsh -NoProfile -File Build-Generator.ps1", "watch": "tsc -p . --watch", diff --git a/packages/typespec-ts/package.json b/packages/typespec-ts/package.json index fcdcd05733..116da93909 100644 --- a/packages/typespec-ts/package.json +++ b/packages/typespec-ts/package.json @@ -19,24 +19,24 @@ "test-next:coverage": "vitest run --project test-next --coverage", "clean": "rimraf ./dist ./typespec-output", "build": "tsc -p .", - "test": "npm run test-next && npm run unit-test && npm run integration-test-ci", + "test": "pnpm test-next && pnpm unit-test && pnpm integration-test-ci", "lint": "oxlint . --deny-warnings", "lint:fix": "oxlint . --fix", "check:tree": "node ./test/commands/check-clean-tree.ts", - "integration-test-ci": "npm run copy:typespec && npm run spector-test", - "spector-test": "concurrently --kill-others --success first \"npm:start-test-server\" \"npm:generate-and-run\"", + "integration-test-ci": "pnpm copy:typespec && pnpm spector-test", + "spector-test": "concurrently --kill-others --success first \"pnpm start-test-server\" \"pnpm generate-and-run\"", "start-test-server": "node ./test/commands/start-test-server.js", "copy:typespec": "node ./test/commands/copy-typespec.ts", - "generate-and-run": "npm run generate-tsp-only:client && concurrently --kill-others-on-fail \"npm:integration-test:alone\" \"npm:generate-tsp-only:declarations\" && npm run stop-test-server -- -p 3002", + "generate-and-run": "pnpm generate-tsp-only:client && concurrently --kill-others-on-fail \"pnpm integration-test:alone\" \"pnpm generate-tsp-only:declarations\" && pnpm stop-test-server -- -p 3002", "generate-tsp-only": "node ./test/commands/gen-spector.js", "generate-tsp-only:client": "node ./test/commands/gen-spector.js --phase=client", "generate-tsp-only:declarations": "node ./test/commands/gen-spector.js --phase=declarations", - "regen-test-baselines": "npm run generate-tsp-only", + "regen-test-baselines": "pnpm generate-tsp-only", "integration-test:alone": "vitest run --project integration-azure-modular", - "stop-test-server": "npx tsp-spector server stop", + "stop-test-server": "pnpm exec tsp-spector server stop", "unit-test": "cross-env NODE_OPTIONS=--max-old-space-size=1024 vitest run --project unit-modular", "gen:scenario-suites": "node ./test/commands/gen-scenario-suites.ts", - "regen-docs": "npm run build && tspd doc . --enable-experimental --output-dir ../../website/src/content/docs/docs/emitters/clients/typespec-ts/reference --skip-js" + "regen-docs": "pnpm build && tspd doc . --enable-experimental --output-dir ../../website/src/content/docs/docs/emitters/clients/typespec-ts/reference --skip-js" }, "author": "Jose Heredia ", "license": "MIT", diff --git a/packages/typespec-ts/test/commands/gen-scenario-suites.ts b/packages/typespec-ts/test/commands/gen-scenario-suites.ts index 5ca2a58895..da1c288942 100644 --- a/packages/typespec-ts/test/commands/gen-scenario-suites.ts +++ b/packages/typespec-ts/test/commands/gen-scenario-suites.ts @@ -5,7 +5,7 @@ * files lets vitest run them in parallel worker processes, which dramatically * reduces wall-clock time and per-worker memory. * - * Run with: `npm run gen:scenario-suites` + * Run with: `pnpm gen:scenario-suites` * * The `coverage` guard test in `scenario-suites.guard.test.ts` fails if the * generated files drift from the scenario directory tree, prompting a re-run. @@ -45,7 +45,7 @@ export function suiteFileName(relDir: string): string { function suiteFileContent(relDir: string): string { const posixRel = relDir.split(path.sep).join("/"); const location = `./test/modular-unit/scenarios/${posixRel}`; - return `// Generated by \`npm run gen:scenario-suites\`. Do not edit by hand. + return `// Generated by \`pnpm gen:scenario-suites\`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites.guard.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites.guard.test.ts index cfdb8e8f72..3dfa67966f 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites.guard.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites.guard.test.ts @@ -12,7 +12,7 @@ function suiteFileName(relDir: string): string { /** * Guards against silent coverage loss: every leaf scenario directory must have * exactly one generated suite file, and vice versa. If this fails after adding - * or moving scenarios, run `npm run gen:scenario-suites`. + * or moving scenarios, run `pnpm gen:scenario-suites`. */ it("every scenario leaf directory has a generated suite file", () => { const expected = getLeafScenarioDirs().map(suiteFileName).sort(); @@ -23,6 +23,6 @@ it("every scenario leaf directory has a generated suite file", () => { assert.deepEqual( actual, expected, - "Scenario suite files are out of sync with the scenario directory tree. Run `npm run gen:scenario-suites` to regenerate them.", + "Scenario suite files are out of sync with the scenario directory tree. Run `pnpm gen:scenario-suites` to regenerate them.", ); }); diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/anonymous.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/anonymous.test.ts index 66038a2d2d..f089bcf754 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/anonymous.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/anonymous.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/api-operations.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/api-operations.test.ts index 3032e37cb7..18f2876b72 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/api-operations.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/api-operations.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/classic-client.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/classic-client.test.ts index 314019e123..802321424d 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/classic-client.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/classic-client.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/client-context.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/client-context.test.ts index ab8e49557e..72a561961f 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/client-context.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/client-context.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/empty-project.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/empty-project.test.ts index b6f1363fdb..78b4d9dbc8 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/empty-project.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/empty-project.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/enum-union.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/enum-union.test.ts index 1c4e12d737..b9916ccf40 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/enum-union.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/enum-union.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/example.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/example.test.ts index 234daa02bf..c1336bfb88 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/example.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/example.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/models-generator.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/models-generator.test.ts index d89a52bbc9..5137d09511 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/models-generator.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/models-generator.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/models.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/models.test.ts index 1db72e427f..966f1aed4c 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/models.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/models.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/models__api-version.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/models__api-version.test.ts index 1521f85aee..bcbfd045ae 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/models__api-version.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/models__api-version.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/models__arm.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/models__arm.test.ts index 9bcc68b627..1a71596d79 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/models__arm.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/models__arm.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/models__deserialization.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/models__deserialization.test.ts index 4202a90d8d..b59d03f9a0 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/models__deserialization.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/models__deserialization.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/models__nested-enum__flatten.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/models__nested-enum__flatten.test.ts index 20bc80ae76..d78438d3de 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/models__nested-enum__flatten.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/models__nested-enum__flatten.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/models__nested-enum__not-flatten.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/models__nested-enum__not-flatten.test.ts index 9e60aff34e..00696652e5 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/models__nested-enum__not-flatten.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/models__nested-enum__not-flatten.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/models__nullable.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/models__nullable.test.ts index 2aa72c94fe..73668fff4e 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/models__nullable.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/models__nullable.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/models__property-flatten.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/models__property-flatten.test.ts index f2712d19f5..071fb3c4eb 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/models__property-flatten.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/models__property-flatten.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/models__response.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/models__response.test.ts index 15c6859b52..e2fa92d035 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/models__response.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/models__response.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/models__serialization.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/models__serialization.test.ts index cf2a28e65f..c8b1fcdaf1 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/models__serialization.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/models__serialization.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/models__template.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/models__template.test.ts index 71a8e6cf34..b88dd40210 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/models__template.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/models__template.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/multipart.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/multipart.test.ts index 78af28a6e9..45443ee368 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/multipart.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/multipart.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/operations.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/operations.test.ts index 444bc37fe2..b6b0454763 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/operations.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/operations.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/operations__body-param.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/operations__body-param.test.ts index 46382435d0..1716d4c5a3 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/operations__body-param.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/operations__body-param.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/operations__cookie-param.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/operations__cookie-param.test.ts index 2433fbac19..11af12dcf4 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/operations__cookie-param.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/operations__cookie-param.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/operations__error-deserialization.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/operations__error-deserialization.test.ts index 20df8770c4..8cbe456879 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/operations__error-deserialization.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/operations__error-deserialization.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/operations__header-param.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/operations__header-param.test.ts index 18c62f4fe3..5a3dd33329 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/operations__header-param.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/operations__header-param.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/operations__pagination.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/operations__pagination.test.ts index c0c0f8d4fb..c1da32e53a 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/operations__pagination.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/operations__pagination.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/operations__path-param.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/operations__path-param.test.ts index aff29e111e..3ac090da66 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/operations__path-param.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/operations__path-param.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/operations__query-param.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/operations__query-param.test.ts index 2cecbd772e..738674c7a8 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/operations__query-param.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/operations__query-param.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/operations__storage-compat.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/operations__storage-compat.test.ts index 8b80623375..af3b1f1810 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/operations__storage-compat.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/operations__storage-compat.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/payload__xml.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/payload__xml.test.ts index 84e1804881..0f2738f315 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/payload__xml.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/payload__xml.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/samples__client.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/samples__client.test.ts index 54a15d5225..225d704eef 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/samples__client.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/samples__client.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/samples__client__disable-hierarchy.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/samples__client__disable-hierarchy.test.ts index 0532a786e3..85fdba36c7 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/samples__client__disable-hierarchy.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/samples__client__disable-hierarchy.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/samples__client__enable-hierarchy.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/samples__client__enable-hierarchy.test.ts index e664a0653d..10b8f3157f 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/samples__client__enable-hierarchy.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/samples__client__enable-hierarchy.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/samples__operations.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/samples__operations.test.ts index 1dc41aa2d8..587377b380 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/samples__operations.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/samples__operations.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/samples__parameters.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/samples__parameters.test.ts index 74b199eb9e..838abb02c0 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/samples__parameters.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/samples__parameters.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/samples__property-flatten.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/samples__property-flatten.test.ts index 505ff1445b..c48580675a 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/samples__property-flatten.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/samples__property-flatten.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/test__operations.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/test__operations.test.ts index fda78a65c7..9665a29c90 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/test__operations.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/test__operations.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/test__parameters.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/test__parameters.test.ts index 1c28733566..bce13e73dc 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/test__parameters.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/test__parameters.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/packages/typespec-ts/test/modular-unit/scenario-suites/test__responses.test.ts b/packages/typespec-ts/test/modular-unit/scenario-suites/test__responses.test.ts index af4a822277..b542700f07 100644 --- a/packages/typespec-ts/test/modular-unit/scenario-suites/test__responses.test.ts +++ b/packages/typespec-ts/test/modular-unit/scenario-suites/test__responses.test.ts @@ -1,4 +1,4 @@ -// Generated by `npm run gen:scenario-suites`. Do not edit by hand. +// Generated by `pnpm gen:scenario-suites`. Do not edit by hand. import { describe } from "vitest"; import { describeScenarioDir } from "../scenario-runner.js"; diff --git a/website/src/content/docs/docs/emitters/typespec-autorest/index.md b/website/src/content/docs/docs/emitters/typespec-autorest/index.md index db8b10a116..25a7b6bdce 100644 --- a/website/src/content/docs/docs/emitters/typespec-autorest/index.md +++ b/website/src/content/docs/docs/emitters/typespec-autorest/index.md @@ -22,7 +22,7 @@ The generated OpenAPI spec will have custom `x-ms-` extensions properties and co } ``` -2. Run `npm install` to install the dependency +2. Run `pnpm install` to install the dependency 3. Import `@azure-tools/typespec-autorest` in your `main.tsp` file ```typespec From 804b7a165f12c5206d43b5085395e680153a9715 Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Mon, 20 Jul 2026 14:54:46 -0400 Subject: [PATCH 2/4] Keep npm for standalone eng/scripts autorest install in CI This CI step runs as a standalone shell (not inside pnpm's env) so it never produced the npm warn messages; autorest is a global external CLI and eng/scripts is a standalone non-workspace npm package. pnpm add -g autorest failed because the pnpm global bin dir isn't on PATH. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aaa041e11a..8c12e6304d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -138,7 +138,7 @@ jobs: run: pnpm --filter "@typespec/internal-build-utils..." run build - name: Install autorest & script dependencies - run: pnpm add -g autorest && cd eng/scripts && pnpm install + run: npm install -g autorest && cd eng/scripts && npm install - name: Swagger - Resource Manager Linting run: node eng/scripts/lint-resourcemanager.js "packages/samples/test/output/azure/resource-manager" From fbf6ad27cf5ba2c92fdad1dfb99bd8f3fc066caa Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Mon, 20 Jul 2026 15:33:50 -0400 Subject: [PATCH 3/4] Fix residual npm warn in spector test; revert standalone CI npx conversions - start-test-server.js spawned 'npx tsp-spector' inside pnpm's env, which re-emitted the npm warn Unknown env config warnings -> use 'pnpm exec'. - Revert all standalone CI/pipeline npx->pnpm conversions: they run outside pnpm's env (so they don't cause the warnings) and several ADO jobs lack pnpm on PATH (pnpm: command not found in the PR commenter job). --- .github/workflows/ci.yml | 2 +- .github/workflows/consistency.yml | 2 +- .github/workflows/doc-update.lock.yml | 8 ++++---- .github/workflows/doc-update.md | 8 ++++---- eng/pipelines/jobs/spector-coverage.yml | 2 +- eng/pipelines/pr-tools.yml | 4 ++-- eng/pipelines/templates/install-browsers.yml | 2 +- eng/pipelines/templates/upload-spector-coverage.yml | 4 ++-- eng/scripts/doc-updater/src/precompute.ts | 4 ++-- eng/scripts/doc-updater/src/print-allowed-paths.ts | 4 ++-- eng/scripts/doc-updater/src/update-meta.ts | 4 ++-- packages/typespec-ts/test/commands/start-test-server.js | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c12e6304d..408a8ea18c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,7 +105,7 @@ jobs: - name: Install playwright browsers run: | sudo dpkg --configure -a - pnpm exec playwright install --with-deps + npx playwright install --with-deps working-directory: packages/typespec-azure-playground-website - name: Build diff --git a/.github/workflows/consistency.yml b/.github/workflows/consistency.yml index 4719fb5cb3..0714e05d10 100644 --- a/.github/workflows/consistency.yml +++ b/.github/workflows/consistency.yml @@ -33,7 +33,7 @@ jobs: - run: pnpm install name: Install dependencies - - run: pnpm exec chronus verify --since ${{ github.event.pull_request.base.ref }} + - run: npx chronus verify --since ${{ github.event.pull_request.base.ref }} name: Check changelog if: | !startsWith(github.head_ref, 'publish/') && diff --git a/.github/workflows/doc-update.lock.yml b/.github/workflows/doc-update.lock.yml index f5bde5860c..27e31158fd 100644 --- a/.github/workflows/doc-update.lock.yml +++ b/.github/workflows/doc-update.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"1a2f5a2eddd25dc655b34169233a290271fcbb98ea0cbdc1ca6445001f88a76d","body_hash":"702c2fc338cffc698b71beb9cc2eaed5735a65872d904d2be76c1a702f29b239","compiler_version":"v0.80.9","strict":true,"agent_id":"copilot","agent_model":"claude-opus-4.8","engine_versions":{"copilot":"1.0.63"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"37d85b7fda9ad514f1f8555d7a659647ff0c2e6423cf915fdc1944b69054e508","body_hash":"2899a091cbdde5f7c4f51c0dbe2dfce58b0a08ba63f12202bd7ecc6982500716","compiler_version":"v0.80.9","strict":true,"agent_id":"copilot","agent_model":"claude-opus-4.8","engine_versions":{"copilot":"1.0.63"}} # gh-aw-manifest: {"version":1,"secrets":["GH_AW_CI_TRIGGER_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"27d5ce7f107fe9357f9df03efb73ab90386fccae","version":"v5.0.5"},{"repo":"actions/cache/save","sha":"27d5ce7f107fe9357f9df03efb73ab90386fccae","version":"v5.0.5"},{"repo":"actions/checkout","sha":"34e114876b0b11c390a56381ad16ebd13914f8d5","version":"v4.3.1"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"373c709c69115d41ff229c7e5df9f8788daa9553","version":"v9"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-dotnet","sha":"9a946fdbd5fb07b82b2f5a4466058b876ab72bb2","version":"v5.3.0"},{"repo":"actions/setup-go","sha":"4a3601121dd01d1626a1e23e37211e3254c1c06c","version":"v6.4.0"},{"repo":"actions/setup-java","sha":"be666c2fcd27ec809703dec50e508c2fdc7f6654","version":"v5.2.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/setup-python","sha":"a309ff8b426b58ec0e2a45f0f869d46889d02405","version":"v6.2.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"8c7d04ebf1ece56cd381446125da3e0f6896294a","version":"v0.80.9"},{"repo":"pnpm/action-setup","sha":"f40ffcd9367d9f12939873eb1018b921a783ffaa","version":"v4"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.7","digest":"sha256:aae231e4635c8999d039c132f1602d3df850fe9b84a00aa2b5ac981179b5661c","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.7@sha256:aae231e4635c8999d039c132f1602d3df850fe9b84a00aa2b5ac981179b5661c"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.7","digest":"sha256:009caf2e3d88fa77b64e9a03a95a228fc58db0f1701c6d324b29ba5a3c7c79b6","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.7@sha256:009caf2e3d88fa77b64e9a03a95a228fc58db0f1701c6d324b29ba5a3c7c79b6"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.7","digest":"sha256:deb1d4e19de62d51cee0508057a596a19315c3423ada4d675cad136dc8037c96","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.7@sha256:deb1d4e19de62d51cee0508057a596a19315c3423ada4d675cad136dc8037c96"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.27","digest":"sha256:fe984bddde4ec05d756d9043edb0a32912e6b7b72f6a121b1082f29221421cc7","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.27@sha256:fe984bddde4ec05d756d9043edb0a32912e6b7b72f6a121b1082f29221421cc7"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.4.0","digest":"sha256:2afb26356481d1a350e14544a6e160f7f7ec1561a1ea309b823665abf0309036","pinned_image":"ghcr.io/github/github-mcp-server:v1.4.0@sha256:2afb26356481d1a350e14544a6e160f7f7ec1561a1ea309b823665abf0309036"}]} # This file was automatically generated by gh-aw (v0.80.9). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # @@ -490,14 +490,14 @@ jobs: - name: Install repo dependencies run: pnpm install - name: Install doc-updater dependencies - run: pnpm install + run: npm install working-directory: eng/scripts/doc-updater - env: CONFIG_INPUT: ${{ github.event.inputs.config }} FULL_REBUILD_INPUT: ${{ github.event.inputs.full_rebuild }} GH_TOKEN: ${{ github.token }} name: Pre-compute context - run: "REBUILD_FLAG=\"\"\nif [ \"$FULL_REBUILD_INPUT\" = \"true\" ]; then\n REBUILD_FLAG=\"--full-rebuild\"\nfi\n\npnpm exec tsx eng/scripts/doc-updater/src/precompute.ts \\\n --config \"$CONFIG_INPUT\" \\\n --output /tmp/gh-aw/agent/context.json \\\n ${REBUILD_FLAG:+\"$REBUILD_FLAG\"}\n" + run: "REBUILD_FLAG=\"\"\nif [ \"$FULL_REBUILD_INPUT\" = \"true\" ]; then\n REBUILD_FLAG=\"--full-rebuild\"\nfi\n\nnpx tsx eng/scripts/doc-updater/src/precompute.ts \\\n --config \"$CONFIG_INPUT\" \\\n --output /tmp/gh-aw/agent/context.json \\\n ${REBUILD_FLAG:+\"$REBUILD_FLAG\"}\n" - name: Configure Git credentials env: @@ -1026,7 +1026,7 @@ jobs: - env: CONFIG_INPUT: ${{ github.event.inputs.config }} name: Validate file scope - run: "CONFIG=\"$CONFIG_INPUT\"\nALLOWED_FILE=\"eng/scripts/doc-updater/configs/${CONFIG}.yaml\"\n\n# Read allowedPaths using the doc-updater config loader\nALLOWED_PATHS=$(pnpm exec tsx eng/scripts/doc-updater/src/print-allowed-paths.ts --config \"$CONFIG\")\n\nif [ -z \"$ALLOWED_PATHS\" ]; then\n echo \"WARNING: No allowedPaths in config, skipping validation\"\n exit 0\nfi\n\n# Check every changed file against allowedPaths\nCHANGED=$(git diff --name-only HEAD 2>/dev/null || echo \"\")\nif [ -z \"$CHANGED\" ]; then\n echo \"No files changed.\"\n exit 0\nfi\n\nVIOLATIONS=\"\"\nwhile IFS= read -r file; do\n ALLOWED=false\n while IFS= read -r pattern; do\n if [[ \"$file\" == \"$pattern\"* ]]; then\n ALLOWED=true\n break\n fi\n done <<< \"$ALLOWED_PATHS\"\n if [ \"$ALLOWED\" = false ]; then\n VIOLATIONS=\"${VIOLATIONS} - ${file}\\n\"\n fi\ndone <<< \"$CHANGED\"\n\nif [ -n \"$VIOLATIONS\" ]; then\n echo \"::error::Agent modified files outside allowed paths:\"\n echo -e \"$VIOLATIONS\"\n exit 1\nfi\n\necho \"All modified files are within allowed paths.\"\n" + run: "CONFIG=\"$CONFIG_INPUT\"\nALLOWED_FILE=\"eng/scripts/doc-updater/configs/${CONFIG}.yaml\"\n\n# Read allowedPaths using the doc-updater config loader\nALLOWED_PATHS=$(npx tsx eng/scripts/doc-updater/src/print-allowed-paths.ts --config \"$CONFIG\")\n\nif [ -z \"$ALLOWED_PATHS\" ]; then\n echo \"WARNING: No allowedPaths in config, skipping validation\"\n exit 0\nfi\n\n# Check every changed file against allowedPaths\nCHANGED=$(git diff --name-only HEAD 2>/dev/null || echo \"\")\nif [ -z \"$CHANGED\" ]; then\n echo \"No files changed.\"\n exit 0\nfi\n\nVIOLATIONS=\"\"\nwhile IFS= read -r file; do\n ALLOWED=false\n while IFS= read -r pattern; do\n if [[ \"$file\" == \"$pattern\"* ]]; then\n ALLOWED=true\n break\n fi\n done <<< \"$ALLOWED_PATHS\"\n if [ \"$ALLOWED\" = false ]; then\n VIOLATIONS=\"${VIOLATIONS} - ${file}\\n\"\n fi\ndone <<< \"$CHANGED\"\n\nif [ -n \"$VIOLATIONS\" ]; then\n echo \"::error::Agent modified files outside allowed paths:\"\n echo -e \"$VIOLATIONS\"\n exit 1\nfi\n\necho \"All modified files are within allowed paths.\"\n" - name: Upload agent artifacts if: always() diff --git a/.github/workflows/doc-update.md b/.github/workflows/doc-update.md index abbf5dab39..a679ac40d8 100644 --- a/.github/workflows/doc-update.md +++ b/.github/workflows/doc-update.md @@ -54,7 +54,7 @@ steps: - name: Install doc-updater dependencies working-directory: eng/scripts/doc-updater - run: pnpm install + run: npm install - name: Pre-compute context env: @@ -67,7 +67,7 @@ steps: REBUILD_FLAG="--full-rebuild" fi - pnpm exec tsx eng/scripts/doc-updater/src/precompute.ts \ + npx tsx eng/scripts/doc-updater/src/precompute.ts \ --config "$CONFIG_INPUT" \ --output /tmp/gh-aw/agent/context.json \ ${REBUILD_FLAG:+"$REBUILD_FLAG"} @@ -102,7 +102,7 @@ post-steps: ALLOWED_FILE="eng/scripts/doc-updater/configs/${CONFIG}.yaml" # Read allowedPaths using the doc-updater config loader - ALLOWED_PATHS=$(pnpm exec tsx eng/scripts/doc-updater/src/print-allowed-paths.ts --config "$CONFIG") + ALLOWED_PATHS=$(npx tsx eng/scripts/doc-updater/src/print-allowed-paths.ts --config "$CONFIG") if [ -z "$ALLOWED_PATHS" ]; then echo "WARNING: No allowedPaths in config, skipping validation" @@ -170,7 +170,7 @@ been pre-computed and is available in `/tmp/gh-aw/agent/context.json`. - **Do not defer work.** Fix every issue you find in this run. Do not leave "remaining gaps" or "future work" in the knowledge base or PR description — the knowledge base is for lessons learned, not a to-do list. - **Update the knowledge base** at `knowledgePath` as you work (see Knowledge Base Rules below). - **Create exactly one pull request at the very end.** Only the main agent (you) may call `create_pull_request`, and only once, after ALL steps and ALL file edits are complete. Never delegate PR creation to a sub-agent. -- **Update metadata as your final step before creating the PR.** Run `pnpm exec tsx eng/scripts/doc-updater/src/update-meta.ts --config --commit ` (using the config name and `checkoutCommit` from the context) via the bash tool. This records the checkout commit hash so the next incremental run knows where to start. This must be done inside the agent so the metadata file is captured by safe-outputs. +- **Update metadata as your final step before creating the PR.** Run `npx tsx eng/scripts/doc-updater/src/update-meta.ts --config --commit ` (using the config name and `checkoutCommit` from the context) via the bash tool. This records the checkout commit hash so the next incremental run knows where to start. This must be done inside the agent so the metadata file is captured by safe-outputs. ## Knowledge Base Rules diff --git a/eng/pipelines/jobs/spector-coverage.yml b/eng/pipelines/jobs/spector-coverage.yml index cde1067a39..b1cd593695 100644 --- a/eng/pipelines/jobs/spector-coverage.yml +++ b/eng/pipelines/jobs/spector-coverage.yml @@ -162,7 +162,7 @@ jobs: scriptType: "bash" scriptLocation: "inlineScript" inlineScript: >- - pnpm exec tsp-spector upload-coverage + npx tsp-spector upload-coverage --coverageFile ./coverage/spector-coverage-typescript-azure.json --generatorName "@azure-tools/typespec-ts" --storageAccountName typespec diff --git a/eng/pipelines/pr-tools.yml b/eng/pipelines/pr-tools.yml index b91d211c6c..d6000499f3 100644 --- a/eng/pipelines/pr-tools.yml +++ b/eng/pipelines/pr-tools.yml @@ -64,7 +64,7 @@ extends: - template: /eng/common/pipelines/templates/steps/login-to-github.yml - - script: pnpm exec tsx core/eng/tsp-core/scripts/create-tryit-comment.ts "typespec-azure" + - script: npx tsx core/eng/tsp-core/scripts/create-tryit-comment.ts "typespec-azure" displayName: Check already commented env: GH_TOKEN: $(GH_TOKEN) @@ -80,7 +80,7 @@ extends: - template: /eng/common/pipelines/templates/steps/login-to-github.yml - - script: pnpm dlx @chronus/github-pr-commenter@0.5.0 chronus-github-pr-commenter + - script: npx -p @chronus/github-pr-commenter@0.5.0 chronus-github-pr-commenter displayName: Make comment about changes env: GITHUB_TOKEN: $(GH_TOKEN) diff --git a/eng/pipelines/templates/install-browsers.yml b/eng/pipelines/templates/install-browsers.yml index 409e9046ec..3555c4160f 100644 --- a/eng/pipelines/templates/install-browsers.yml +++ b/eng/pipelines/templates/install-browsers.yml @@ -2,6 +2,6 @@ steps: - script: | sudo dpkg --configure -a - pnpm exec playwright install --with-deps + npx playwright install --with-deps displayName: Install playwright browsers workingDirectory: packages/typespec-azure-playground-website diff --git a/eng/pipelines/templates/upload-spector-coverage.yml b/eng/pipelines/templates/upload-spector-coverage.yml index d3536c710f..41f6606286 100644 --- a/eng/pipelines/templates/upload-spector-coverage.yml +++ b/eng/pipelines/templates/upload-spector-coverage.yml @@ -36,7 +36,7 @@ steps: scriptType: "bash" scriptLocation: "inlineScript" inlineScript: >- - pnpm exec tsp-spector upload-coverage + npx tsp-spector upload-coverage --coverageFile ./spec-coverage.json --generatorName "${{ parameters.UnbrandedGeneratorName }}" --storageAccountName typespec @@ -53,7 +53,7 @@ steps: scriptType: "bash" scriptLocation: "inlineScript" inlineScript: >- - pnpm exec tsp-spector upload-coverage + npx tsp-spector upload-coverage --coverageFile ./spec-coverage.json --generatorName "${{ parameters.GeneratorName }}" --storageAccountName typespec diff --git a/eng/scripts/doc-updater/src/precompute.ts b/eng/scripts/doc-updater/src/precompute.ts index f62d648d92..71e3d9ad9f 100644 --- a/eng/scripts/doc-updater/src/precompute.ts +++ b/eng/scripts/doc-updater/src/precompute.ts @@ -7,7 +7,7 @@ * language instructions and thus resist prompt injection. * * Usage: - * pnpm exec tsx src/precompute.ts --config --output [--full-rebuild] + * npx tsx src/precompute.ts --config --output [--full-rebuild] */ import { mkdir, writeFile } from "node:fs/promises"; @@ -120,7 +120,7 @@ function parsePrecomputeArgs(): PrecomputeArgs { if (!parsed.config || !parsed.output) { console.error( - "Usage: pnpm exec tsx src/precompute.ts --config --output [--full-rebuild]", + "Usage: npx tsx src/precompute.ts --config --output [--full-rebuild]", ); process.exit(1); } diff --git a/eng/scripts/doc-updater/src/print-allowed-paths.ts b/eng/scripts/doc-updater/src/print-allowed-paths.ts index 6000dc47bc..b134912ccf 100644 --- a/eng/scripts/doc-updater/src/print-allowed-paths.ts +++ b/eng/scripts/doc-updater/src/print-allowed-paths.ts @@ -6,7 +6,7 @@ * or root-level node module resolution. * * Usage: - * pnpm exec tsx eng/scripts/doc-updater/src/print-allowed-paths.ts --config + * npx tsx eng/scripts/doc-updater/src/print-allowed-paths.ts --config */ import { loadConfig } from "./config.js"; @@ -23,7 +23,7 @@ function parseArgs(): { config: string } { if (!config) { console.error( - "Usage: pnpm exec tsx eng/scripts/doc-updater/src/print-allowed-paths.ts --config ", + "Usage: npx tsx eng/scripts/doc-updater/src/print-allowed-paths.ts --config ", ); process.exit(1); } diff --git a/eng/scripts/doc-updater/src/update-meta.ts b/eng/scripts/doc-updater/src/update-meta.ts index 8dea5b7817..6530135a6f 100644 --- a/eng/scripts/doc-updater/src/update-meta.ts +++ b/eng/scripts/doc-updater/src/update-meta.ts @@ -5,7 +5,7 @@ * run knows where to start. * * Usage: - * pnpm exec tsx src/update-meta.ts --config --commit + * npx tsx src/update-meta.ts --config --commit */ import { loadConfig } from "./config.js"; @@ -25,7 +25,7 @@ function parseArgs(): { config: string; commit: string } { } if (!config || !commit) { - console.error("Usage: pnpm exec tsx src/update-meta.ts --config --commit "); + console.error("Usage: npx tsx src/update-meta.ts --config --commit "); process.exit(1); } diff --git a/packages/typespec-ts/test/commands/start-test-server.js b/packages/typespec-ts/test/commands/start-test-server.js index 14c7bd8d0b..9dd44a3376 100644 --- a/packages/typespec-ts/test/commands/start-test-server.js +++ b/packages/typespec-ts/test/commands/start-test-server.js @@ -25,8 +25,8 @@ try { } const child = spawn( - "npx", - ["tsp-spector", "serve", ...SPEC_PATHS, "--port", PORT, "--coverageFile", COVERAGE_FILE], + "pnpm", + ["exec", "tsp-spector", "serve", ...SPEC_PATHS, "--port", PORT, "--coverageFile", COVERAGE_FILE], { stdio: "inherit", shell: true }, ); From 2df5cbdebbd4a924deaa4f36c91af614e21b1bbf Mon Sep 17 00:00:00 2001 From: Timothee Guerin Date: Mon, 20 Jul 2026 15:52:35 -0400 Subject: [PATCH 4/4] Fix stop-test-server port forwarding under pnpm pnpm forwards '--' literally to the script, so 'pnpm stop-test-server -- -p 3002' resolved to 'tsp-spector server stop -- -p 3002'; yargs then treated '-p 3002' as positional args after '--' and used the default port 3000, causing ECONNREFUSED against the real server on 3002. Bake the port into the stop-test-server script and drop the fragile '--' arg forwarding. Verified locally: starting the server on 3002 then 'pnpm stop-test-server' now prints 'Stopped server running at port 3002.' and exits 0. --- packages/typespec-ts/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/typespec-ts/package.json b/packages/typespec-ts/package.json index 116da93909..3b4c3566d4 100644 --- a/packages/typespec-ts/package.json +++ b/packages/typespec-ts/package.json @@ -27,13 +27,13 @@ "spector-test": "concurrently --kill-others --success first \"pnpm start-test-server\" \"pnpm generate-and-run\"", "start-test-server": "node ./test/commands/start-test-server.js", "copy:typespec": "node ./test/commands/copy-typespec.ts", - "generate-and-run": "pnpm generate-tsp-only:client && concurrently --kill-others-on-fail \"pnpm integration-test:alone\" \"pnpm generate-tsp-only:declarations\" && pnpm stop-test-server -- -p 3002", + "generate-and-run": "pnpm generate-tsp-only:client && concurrently --kill-others-on-fail \"pnpm integration-test:alone\" \"pnpm generate-tsp-only:declarations\" && pnpm stop-test-server", "generate-tsp-only": "node ./test/commands/gen-spector.js", "generate-tsp-only:client": "node ./test/commands/gen-spector.js --phase=client", "generate-tsp-only:declarations": "node ./test/commands/gen-spector.js --phase=declarations", "regen-test-baselines": "pnpm generate-tsp-only", "integration-test:alone": "vitest run --project integration-azure-modular", - "stop-test-server": "pnpm exec tsp-spector server stop", + "stop-test-server": "pnpm exec tsp-spector server stop -p 3002", "unit-test": "cross-env NODE_OPTIONS=--max-old-space-size=1024 vitest run --project unit-modular", "gen:scenario-suites": "node ./test/commands/gen-scenario-suites.ts", "regen-docs": "pnpm build && tspd doc . --enable-experimental --output-dir ../../website/src/content/docs/docs/emitters/clients/typespec-ts/reference --skip-js"