From 8ee5972c0c071951493cb9ccd9dc2ad8dad53f11 Mon Sep 17 00:00:00 2001 From: Gonzalo Riestra Date: Mon, 13 Apr 2026 11:06:52 +0200 Subject: [PATCH] Default to pnpm/pnpx internally --- .github/workflows/release.yml | 1 - .github/workflows/tests-pr.yml | 4 +- bin/create-notification-pr.js | 2 +- bin/docs/build-dev-docs.sh | 10 ++--- dev.yml | 2 +- package.json | 2 +- packages/e2e/scripts/cleanup-test-apps.ts | 9 +++-- packages/e2e/scripts/create-test-apps.ts | 47 ++++++++++++----------- packages/e2e/setup/app.ts | 2 +- 9 files changed, 41 insertions(+), 38 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 36890f91e86..2ac894eca26 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,7 +71,6 @@ jobs: > If the versions don't match, you might have multiple global instances installed. > Use `which shopify` to find out which one you are running and uninstall it." - comment_package_manager: 'npm' comment_command_flags: '--@shopify:registry=https://registry.npmjs.org' build_script: "node bin/update-cli-kit-version.js && pnpm nx run-many --target=bundle --all --skip-nx-cache --output-style=stream && pnpm refresh-manifests" env: diff --git a/.github/workflows/tests-pr.yml b/.github/workflows/tests-pr.yml index e04fe7b08d7..182fae6906c 100644 --- a/.github/workflows/tests-pr.yml +++ b/.github/workflows/tests-pr.yml @@ -234,7 +234,7 @@ jobs: - name: Build run: pnpm nx run-many --all --skip-nx-cache --target=build --output-style=stream - name: Install Playwright Chromium - run: npx playwright install chromium + run: pnpm exec playwright install chromium working-directory: packages/e2e - name: Rebuild node-pty run: pnpm rebuild node-pty @@ -245,7 +245,7 @@ jobs: E2E_ACCOUNT_PASSWORD: ${{ secrets.E2E_ACCOUNT_PASSWORD }} E2E_STORE_FQDN: ${{ secrets.E2E_STORE_FQDN }} E2E_ORG_ID: ${{ secrets.E2E_ORG_ID }} - run: npx playwright test + run: pnpm exec playwright test - name: Upload Playwright report uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} diff --git a/bin/create-notification-pr.js b/bin/create-notification-pr.js index 3e65c4fe274..207ebb550a5 100755 --- a/bin/create-notification-pr.js +++ b/bin/create-notification-pr.js @@ -65,7 +65,7 @@ async function createPR() { '**Please update the release highlights before merging.**', '', '### How to test', - '- `npx http-server ~/src/github.com/Shopify/static-cdn-assets`', + '- `pnpx http-server ~/src/github.com/Shopify/static-cdn-assets`', '- `SHOPIFY_CLI_NOTIFICATIONS_URL=http://127.0.0.1:8080/static-24h/cli/notifications.json shopify version`', "- You may need to clear the CLI cache with `shopify cache clear` and run the command twice to see the notification (it's fetched in the background).", '', diff --git a/bin/docs/build-dev-docs.sh b/bin/docs/build-dev-docs.sh index 960754f8bd1..98eedfed6fb 100644 --- a/bin/docs/build-dev-docs.sh +++ b/bin/docs/build-dev-docs.sh @@ -1,12 +1,12 @@ echo "STARTING" -COMPILE_DOCS="npx tsc --project bin/docs/tsconfig.docs.json --moduleResolution node --target esNext && npx generate-docs --overridePath ./bin/docs/typeOverride.json --input ./docs-shopify.dev/commands --output ./docs-shopify.dev/generated && rm -rf docs-shopify.dev/commands/**/*.doc.js docs-shopify.dev/commands/*.doc.js" -COMPILE_STATIC_PAGES="npx tsc docs-shopify.dev/static/*.doc.ts --moduleResolution node --target esNext && npx generate-docs --isLandingPage --input ./docs-shopify.dev/static --output ./docs-shopify.dev/generated && rm -rf docs-shopify.dev/static/*.doc.js" -COMPILE_CATEGORY_PAGES="npx tsc docs-shopify.dev/categories/*.doc.ts --moduleResolution node --target esNext && generate-docs --isCategoryPage --input ./docs-shopify.dev/categories --output ./docs-shopify.dev/generated && rm -rf docs-shopify.dev/categories/*.doc.js" +COMPILE_DOCS="pnpx tsc --project bin/docs/tsconfig.docs.json --moduleResolution node --target esNext && pnpx generate-docs --overridePath ./bin/docs/typeOverride.json --input ./docs-shopify.dev/commands --output ./docs-shopify.dev/generated && rm -rf docs-shopify.dev/commands/**/*.doc.js docs-shopify.dev/commands/*.doc.js" +COMPILE_STATIC_PAGES="pnpx tsc docs-shopify.dev/static/*.doc.ts --moduleResolution node --target esNext && pnpx generate-docs --isLandingPage --input ./docs-shopify.dev/static --output ./docs-shopify.dev/generated && rm -rf docs-shopify.dev/static/*.doc.js" +COMPILE_CATEGORY_PAGES="pnpx tsc docs-shopify.dev/categories/*.doc.ts --moduleResolution node --target esNext && pnpx generate-docs --isCategoryPage --input ./docs-shopify.dev/categories --output ./docs-shopify.dev/generated && rm -rf docs-shopify.dev/categories/*.doc.js" if [ "$1" = "isTest" ]; then -COMPILE_DOCS="npx tsc --project bin/docs/tsconfig.docs.json --moduleResolution node --target esNext && npx generate-docs --overridePath ./bin/docs/typeOverride.json --input ./docs-shopify.dev/commands --output ./docs-shopify.dev/static/temp && rm -rf docs-shopify.dev/commands/**/*.doc.js docs-shopify.dev/commands/*.doc.js" -COMPILE_STATIC_PAGES="npx tsc docs-shopify.dev/static/*.doc.ts --moduleResolution node --target esNext && npx generate-docs --isLandingPage --input ./docs-shopify.dev/static/docs-shopify.dev --output ./docs-shopify.dev/static/temp && rm -rf docs-shopify.dev/static/*.doc.js" +COMPILE_DOCS="pnpx tsc --project bin/docs/tsconfig.docs.json --moduleResolution node --target esNext && pnpx generate-docs --overridePath ./bin/docs/typeOverride.json --input ./docs-shopify.dev/commands --output ./docs-shopify.dev/static/temp && rm -rf docs-shopify.dev/commands/**/*.doc.js docs-shopify.dev/commands/*.doc.js" +COMPILE_STATIC_PAGES="pnpx tsc docs-shopify.dev/static/*.doc.ts --moduleResolution node --target esNext && pnpx generate-docs --isLandingPage --input ./docs-shopify.dev/static/docs-shopify.dev --output ./docs-shopify.dev/static/temp && rm -rf docs-shopify.dev/static/*.doc.js" fi echo $1 diff --git a/dev.yml b/dev.yml index 9fae8e5435f..aabc7393898 100644 --- a/dev.yml +++ b/dev.yml @@ -23,7 +23,7 @@ up: meet: 'true' - custom: name: 'Install Playwright Chromium' - met?: cd packages/e2e && npx playwright install chromium + met?: cd packages/e2e && pnpx playwright install chromium meet: 'true' - custom: name: 'Rebuild node-pty' diff --git a/package.json b/package.json index 2c1f05eb392..d8d82599c2b 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "bundle-for-release": "nx run-many --target=bundle --all --skip-nx-cache", "changeset-manifests": "changeset version && pnpm install --no-frozen-lockfile && pnpm refresh-manifests && pnpm refresh-readme && pnpm refresh-code-documentation && bin/update-cli-kit-version.js", "clean": "nx run-many --target=clean --all --skip-nx-cache && nx reset", - "create-app": "nx build create-app && node packages/create-app/bin/dev.js --package-manager npm", + "create-app": "nx build create-app && node packages/create-app/bin/dev.js --package-manager pnpm", "deploy-experimental": "node bin/deploy-experimental.js", "graph": "nx graph", "graphql-codegen:get-graphql-schemas": "bin/get-graphql-schemas.js", diff --git a/packages/e2e/scripts/cleanup-test-apps.ts b/packages/e2e/scripts/cleanup-test-apps.ts index 4785c73e4b3..74750a25014 100644 --- a/packages/e2e/scripts/cleanup-test-apps.ts +++ b/packages/e2e/scripts/cleanup-test-apps.ts @@ -1,6 +1,6 @@ /** * Deletes all test apps from the dev dashboard via browser automation. - * Run: npx tsx packages/e2e/scripts/cleanup-test-apps.ts + * Run: pnpx tsx packages/e2e/scripts/cleanup-test-apps.ts * * Pass --dry-run to list apps without deleting. * Pass --filter to only delete apps matching the pattern. @@ -128,7 +128,7 @@ async function main() { await page.waitForTimeout(2000) // Check for 500 error and retry - const pageText = await page.textContent('body') ?? '' + const pageText = (await page.textContent('body')) ?? '' if (pageText.includes('500') || pageText.includes('Internal Server Error')) { console.log('Got 500 error, retrying...') await page.reload({waitUntil: 'domcontentloaded'}) @@ -136,7 +136,10 @@ async function main() { } // Check for org selection page - const orgLink = page.locator('a, button').filter({hasText: /core-build|cli-e2e/i}).first() + const orgLink = page + .locator('a, button') + .filter({hasText: /core-build|cli-e2e/i}) + .first() if (await orgLink.isVisible({timeout: 3000}).catch(() => false)) { console.log('Org selection detected, clicking...') await orgLink.click() diff --git a/packages/e2e/scripts/create-test-apps.ts b/packages/e2e/scripts/create-test-apps.ts index 89bbe732a6c..91d7e602b22 100644 --- a/packages/e2e/scripts/create-test-apps.ts +++ b/packages/e2e/scripts/create-test-apps.ts @@ -1,6 +1,6 @@ /** * Creates test apps in the authenticated org and prints their client IDs. - * Run: npx tsx packages/e2e/scripts/create-test-apps.ts + * Run: pnpx tsx packages/e2e/scripts/create-test-apps.ts */ import * as fs from 'fs' @@ -39,7 +39,7 @@ if (!email || !password) { } const baseEnv: Record = { - ...process.env as Record, + ...(process.env as Record), NODE_OPTIONS: '', SHOPIFY_RUN_AS_USER: '0', FORCE_COLOR: '0', @@ -86,16 +86,16 @@ async function createAppInteractive(tmpDir: string, appName: string): Promise { @@ -104,11 +104,7 @@ async function createAppInteractive(tmpDir: string, appName: string): Promise output, prompt, 60_000) @@ -130,9 +126,7 @@ async function createAppInteractive(tmpDir: string, appName: string): Promise e.isDirectory() && fs.existsSync(path.join(appDir, e.name, 'shopify.app.toml')), - ) + const created = entries.find((e) => e.isDirectory() && fs.existsSync(path.join(appDir, e.name, 'shopify.app.toml'))) if (!created) throw new Error(`No app directory found in ${appDir}`) const tomlPath = path.join(appDir, created.name, 'shopify.app.toml') @@ -147,11 +141,16 @@ async function oauthLogin() { const nodePty = await import('node-pty') const spawnEnv = {...baseEnv, BROWSER: 'none'} const pty = nodePty.spawn('node', [cliPath, 'auth', 'login'], { - name: 'xterm-color', cols: 120, rows: 30, env: spawnEnv, + name: 'xterm-color', + cols: 120, + rows: 30, + env: spawnEnv, }) let output = '' - pty.onData((data: string) => { output += data }) + pty.onData((data: string) => { + output += data + }) await waitForText(() => output, 'Press any key to open the login page', 30_000) pty.write(' ') @@ -169,7 +168,9 @@ async function oauthLogin() { await completeLogin(page, urlMatch[0], email!, password!) await waitForText(() => output, 'Logged in', 60_000) - try { pty.kill() } catch {} + try { + pty.kill() + } catch {} await browser.close() } diff --git a/packages/e2e/setup/app.ts b/packages/e2e/setup/app.ts index 262ac738d59..962e1c9c4a2 100644 --- a/packages/e2e/setup/app.ts +++ b/packages/e2e/setup/app.ts @@ -26,7 +26,7 @@ export async function createApp(ctx: { const name = ctx.name ?? 'e2e-test-app' const template = ctx.template ?? 'reactRouter' const packageManager = - ctx.packageManager ?? (process.env.E2E_PACKAGE_MANAGER as 'npm' | 'yarn' | 'pnpm' | 'bun') ?? 'npm' + ctx.packageManager ?? (process.env.E2E_PACKAGE_MANAGER as 'npm' | 'yarn' | 'pnpm' | 'bun') ?? 'pnpm' const args = [ '--name',