Skip to content

Commit 24b6476

Browse files
Merge pull request #7254 from Shopify/default-to-pnpm-internally
Default to pnpm/pnpx internally
2 parents 45cdabf + 8ee5972 commit 24b6476

9 files changed

Lines changed: 41 additions & 38 deletions

File tree

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ jobs:
7171
> If the versions don't match, you might have multiple global instances installed.
7272
7373
> Use `which shopify` to find out which one you are running and uninstall it."
74-
comment_package_manager: 'npm'
7574
comment_command_flags: '--@shopify:registry=https://registry.npmjs.org'
7675
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"
7776
env:

.github/workflows/tests-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ jobs:
234234
- name: Build
235235
run: pnpm nx run-many --all --skip-nx-cache --target=build --output-style=stream
236236
- name: Install Playwright Chromium
237-
run: npx playwright install chromium
237+
run: pnpm exec playwright install chromium
238238
working-directory: packages/e2e
239239
- name: Rebuild node-pty
240240
run: pnpm rebuild node-pty
@@ -245,7 +245,7 @@ jobs:
245245
E2E_ACCOUNT_PASSWORD: ${{ secrets.E2E_ACCOUNT_PASSWORD }}
246246
E2E_STORE_FQDN: ${{ secrets.E2E_STORE_FQDN }}
247247
E2E_ORG_ID: ${{ secrets.E2E_ORG_ID }}
248-
run: npx playwright test
248+
run: pnpm exec playwright test
249249
- name: Upload Playwright report
250250
uses: actions/upload-artifact@v4
251251
if: ${{ !cancelled() }}

bin/create-notification-pr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ async function createPR() {
6565
'**Please update the release highlights before merging.**',
6666
'',
6767
'### How to test',
68-
'- `npx http-server ~/src/github.com/Shopify/static-cdn-assets`',
68+
'- `pnpx http-server ~/src/github.com/Shopify/static-cdn-assets`',
6969
'- `SHOPIFY_CLI_NOTIFICATIONS_URL=http://127.0.0.1:8080/static-24h/cli/notifications.json shopify version`',
7070
"- 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).",
7171
'',

bin/docs/build-dev-docs.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
echo "STARTING"
2-
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"
3-
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"
4-
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"
2+
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"
3+
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"
4+
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"
55

66
if [ "$1" = "isTest" ];
77
then
8-
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"
9-
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"
8+
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"
9+
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"
1010
fi
1111

1212
echo $1

dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ up:
2323
meet: 'true'
2424
- custom:
2525
name: 'Install Playwright Chromium'
26-
met?: cd packages/e2e && npx playwright install chromium
26+
met?: cd packages/e2e && pnpx playwright install chromium
2727
meet: 'true'
2828
- custom:
2929
name: 'Rebuild node-pty'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"bundle-for-release": "nx run-many --target=bundle --all --skip-nx-cache",
1111
"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",
1212
"clean": "nx run-many --target=clean --all --skip-nx-cache && nx reset",
13-
"create-app": "nx build create-app && node packages/create-app/bin/dev.js --package-manager npm",
13+
"create-app": "nx build create-app && node packages/create-app/bin/dev.js --package-manager pnpm",
1414
"deploy-experimental": "node bin/deploy-experimental.js",
1515
"graph": "nx graph",
1616
"graphql-codegen:get-graphql-schemas": "bin/get-graphql-schemas.js",

packages/e2e/scripts/cleanup-test-apps.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Deletes all test apps from the dev dashboard via browser automation.
3-
* Run: npx tsx packages/e2e/scripts/cleanup-test-apps.ts
3+
* Run: pnpx tsx packages/e2e/scripts/cleanup-test-apps.ts
44
*
55
* Pass --dry-run to list apps without deleting.
66
* Pass --filter <pattern> to only delete apps matching the pattern.
@@ -128,15 +128,18 @@ async function main() {
128128
await page.waitForTimeout(2000)
129129

130130
// Check for 500 error and retry
131-
const pageText = await page.textContent('body') ?? ''
131+
const pageText = (await page.textContent('body')) ?? ''
132132
if (pageText.includes('500') || pageText.includes('Internal Server Error')) {
133133
console.log('Got 500 error, retrying...')
134134
await page.reload({waitUntil: 'domcontentloaded'})
135135
await page.waitForTimeout(3000)
136136
}
137137

138138
// Check for org selection page
139-
const orgLink = page.locator('a, button').filter({hasText: /core-build|cli-e2e/i}).first()
139+
const orgLink = page
140+
.locator('a, button')
141+
.filter({hasText: /core-build|cli-e2e/i})
142+
.first()
140143
if (await orgLink.isVisible({timeout: 3000}).catch(() => false)) {
141144
console.log('Org selection detected, clicking...')
142145
await orgLink.click()

packages/e2e/scripts/create-test-apps.ts

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Creates test apps in the authenticated org and prints their client IDs.
3-
* Run: npx tsx packages/e2e/scripts/create-test-apps.ts
3+
* Run: pnpx tsx packages/e2e/scripts/create-test-apps.ts
44
*/
55

66
import * as fs from 'fs'
@@ -39,7 +39,7 @@ if (!email || !password) {
3939
}
4040

4141
const baseEnv: Record<string, string> = {
42-
...process.env as Record<string, string>,
42+
...(process.env as Record<string, string>),
4343
NODE_OPTIONS: '',
4444
SHOPIFY_RUN_AS_USER: '0',
4545
FORCE_COLOR: '0',
@@ -86,16 +86,16 @@ async function createAppInteractive(tmpDir: string, appName: string): Promise<st
8686
fs.mkdirSync(appDir)
8787

8888
const nodePty = await import('node-pty')
89-
const pty = nodePty.spawn('node', [
90-
createAppPath,
91-
'--name', appName,
92-
'--path', appDir,
93-
'--template', 'none',
94-
'--package-manager', 'npm',
95-
'--local',
96-
], {
97-
name: 'xterm-color', cols: 120, rows: 30, env: baseEnv,
98-
})
89+
const pty = nodePty.spawn(
90+
'node',
91+
[createAppPath, '--name', appName, '--path', appDir, '--template', 'none', '--package-manager', 'pnpm', '--local'],
92+
{
93+
name: 'xterm-color',
94+
cols: 120,
95+
rows: 30,
96+
env: baseEnv,
97+
},
98+
)
9999

100100
let output = ''
101101
pty.onData((data: string) => {
@@ -104,11 +104,7 @@ async function createAppInteractive(tmpDir: string, appName: string): Promise<st
104104
})
105105

106106
// Answer each interactive prompt as it appears
107-
const prompts = [
108-
'Which organization',
109-
'Create this project as a new app',
110-
'App name',
111-
]
107+
const prompts = ['Which organization', 'Create this project as a new app', 'App name']
112108
for (const prompt of prompts) {
113109
try {
114110
await waitForText(() => output, prompt, 60_000)
@@ -130,9 +126,7 @@ async function createAppInteractive(tmpDir: string, appName: string): Promise<st
130126

131127
// Find the app dir and extract client_id
132128
const entries = fs.readdirSync(appDir, {withFileTypes: true})
133-
const created = entries.find(
134-
(e) => e.isDirectory() && fs.existsSync(path.join(appDir, e.name, 'shopify.app.toml')),
135-
)
129+
const created = entries.find((e) => e.isDirectory() && fs.existsSync(path.join(appDir, e.name, 'shopify.app.toml')))
136130
if (!created) throw new Error(`No app directory found in ${appDir}`)
137131

138132
const tomlPath = path.join(appDir, created.name, 'shopify.app.toml')
@@ -147,11 +141,16 @@ async function oauthLogin() {
147141
const nodePty = await import('node-pty')
148142
const spawnEnv = {...baseEnv, BROWSER: 'none'}
149143
const pty = nodePty.spawn('node', [cliPath, 'auth', 'login'], {
150-
name: 'xterm-color', cols: 120, rows: 30, env: spawnEnv,
144+
name: 'xterm-color',
145+
cols: 120,
146+
rows: 30,
147+
env: spawnEnv,
151148
})
152149

153150
let output = ''
154-
pty.onData((data: string) => { output += data })
151+
pty.onData((data: string) => {
152+
output += data
153+
})
155154

156155
await waitForText(() => output, 'Press any key to open the login page', 30_000)
157156
pty.write(' ')
@@ -169,7 +168,9 @@ async function oauthLogin() {
169168
await completeLogin(page, urlMatch[0], email!, password!)
170169

171170
await waitForText(() => output, 'Logged in', 60_000)
172-
try { pty.kill() } catch {}
171+
try {
172+
pty.kill()
173+
} catch {}
173174
await browser.close()
174175
}
175176

packages/e2e/setup/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function createApp(ctx: {
2626
const name = ctx.name ?? 'e2e-test-app'
2727
const template = ctx.template ?? 'reactRouter'
2828
const packageManager =
29-
ctx.packageManager ?? (process.env.E2E_PACKAGE_MANAGER as 'npm' | 'yarn' | 'pnpm' | 'bun') ?? 'npm'
29+
ctx.packageManager ?? (process.env.E2E_PACKAGE_MANAGER as 'npm' | 'yarn' | 'pnpm' | 'bun') ?? 'pnpm'
3030

3131
const args = [
3232
'--name',

0 commit comments

Comments
 (0)