Skip to content

Commit 9e65868

Browse files
Merge branch 'main' into auto-update-graphql-deps
2 parents d46faa6 + c846e6f commit 9e65868

File tree

31 files changed

+1077
-741
lines changed

31 files changed

+1077
-741
lines changed

.changeset/curvy-kangaroos-flow.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@shopify/cli-kit': patch
3+
'@shopify/theme': patch
4+
---
5+
6+
Improve mechanism that adds `.shopify` to `.gitignore` to avoid duplicate entries

.changeset/giant-crews-act.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/theme': patch
3+
---
4+
5+
Fix the local dev proxy for `/checkouts` and `/accounts/logout` to avoid 401 and 403 errors.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/theme': patch
3+
---
4+
5+
Update `shopify theme push -x` documentation (it uploads, doesn't download)

docs-shopify.dev/commands/interfaces/theme-push.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export interface themepush {
1919
'-e, --environment <value>'?: string
2020

2121
/**
22-
* Skip downloading the specified files (Multiple flags allowed).
22+
* Skip uploading the specified files (Multiple flags allowed).
2323
* @environment SHOPIFY_FLAG_IGNORE
2424
*/
2525
'-x, --ignore <value>'?: string

docs-shopify.dev/generated/generated_docs_data.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6350,12 +6350,12 @@
63506350
"syntaxKind": "PropertySignature",
63516351
"name": "-x, --ignore <value>",
63526352
"value": "string",
6353-
"description": "Skip downloading the specified files (Multiple flags allowed).",
6353+
"description": "Skip uploading the specified files (Multiple flags allowed).",
63546354
"isOptional": true,
63556355
"environmentValue": "SHOPIFY_FLAG_IGNORE"
63566356
}
63576357
],
6358-
"value": "export interface themepush {\n /**\n * Allow push to a live theme.\n * @environment SHOPIFY_FLAG_ALLOW_LIVE\n */\n '-a, --allow-live'?: ''\n\n /**\n * Push theme files from your remote development theme.\n * @environment SHOPIFY_FLAG_DEVELOPMENT\n */\n '-d, --development'?: ''\n\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment <value>'?: string\n\n /**\n * Skip downloading the specified files (Multiple flags allowed).\n * @environment SHOPIFY_FLAG_IGNORE\n */\n '-x, --ignore <value>'?: string\n\n /**\n * Output the result as JSON.\n * @environment SHOPIFY_FLAG_JSON\n */\n '-j, --json'?: ''\n\n /**\n * Push theme files from your remote live theme.\n * @environment SHOPIFY_FLAG_LIVE\n */\n '-l, --live'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Prevent deleting remote files that don't exist locally.\n * @environment SHOPIFY_FLAG_NODELETE\n */\n '-n, --nodelete'?: ''\n\n /**\n * Push only the specified files (Multiple flags allowed).\n * @environment SHOPIFY_FLAG_ONLY\n */\n '-o, --only <value>'?: string\n\n /**\n * Password generated from the Theme Access app.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password <value>'?: string\n\n /**\n * The path to your theme directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path <value>'?: string\n\n /**\n * Publish as the live theme after uploading.\n * @environment SHOPIFY_FLAG_PUBLISH\n */\n '-p, --publish'?: ''\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store <value>'?: string\n\n /**\n * Require theme check to pass without errors before pushing. Warnings are allowed.\n * @environment SHOPIFY_FLAG_STRICT_PUSH\n */\n '--strict'?: ''\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme <value>'?: string\n\n /**\n * Create a new unpublished theme and push to it.\n * @environment SHOPIFY_FLAG_UNPUBLISHED\n */\n '-u, --unpublished'?: ''\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}"
6358+
"value": "export interface themepush {\n /**\n * Allow push to a live theme.\n * @environment SHOPIFY_FLAG_ALLOW_LIVE\n */\n '-a, --allow-live'?: ''\n\n /**\n * Push theme files from your remote development theme.\n * @environment SHOPIFY_FLAG_DEVELOPMENT\n */\n '-d, --development'?: ''\n\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment <value>'?: string\n\n /**\n * Skip uploading the specified files (Multiple flags allowed).\n * @environment SHOPIFY_FLAG_IGNORE\n */\n '-x, --ignore <value>'?: string\n\n /**\n * Output the result as JSON.\n * @environment SHOPIFY_FLAG_JSON\n */\n '-j, --json'?: ''\n\n /**\n * Push theme files from your remote live theme.\n * @environment SHOPIFY_FLAG_LIVE\n */\n '-l, --live'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Prevent deleting remote files that don't exist locally.\n * @environment SHOPIFY_FLAG_NODELETE\n */\n '-n, --nodelete'?: ''\n\n /**\n * Push only the specified files (Multiple flags allowed).\n * @environment SHOPIFY_FLAG_ONLY\n */\n '-o, --only <value>'?: string\n\n /**\n * Password generated from the Theme Access app.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password <value>'?: string\n\n /**\n * The path to your theme directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path <value>'?: string\n\n /**\n * Publish as the live theme after uploading.\n * @environment SHOPIFY_FLAG_PUBLISH\n */\n '-p, --publish'?: ''\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store <value>'?: string\n\n /**\n * Require theme check to pass without errors before pushing. Warnings are allowed.\n * @environment SHOPIFY_FLAG_STRICT_PUSH\n */\n '--strict'?: ''\n\n /**\n * Theme ID or name of the remote theme.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme <value>'?: string\n\n /**\n * Create a new unpublished theme and push to it.\n * @environment SHOPIFY_FLAG_UNPUBLISHED\n */\n '-u, --unpublished'?: ''\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}"
63596359
}
63606360
}
63616361
}

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
},
4040
"devDependencies": {
4141
"@bugsnag/source-maps": "^2.3.1",
42-
"@changesets/cli": "2.26.2",
42+
"@changesets/cli": "2.27.12",
4343
"@graphql-codegen/cli": "5.0.2",
4444
"@graphql-codegen/near-operation-file-preset": "3.0.0",
4545
"@nx/eslint-plugin": "19.8.14",
@@ -55,7 +55,7 @@
5555
"bugsnag-build-reporter": "^2.0.0",
5656
"commander": "^9.4.0",
5757
"cross-env": "^7.0.3",
58-
"esbuild": "0.24.0",
58+
"esbuild": "0.24.2",
5959
"eslint": "^8.48.0",
6060
"execa": "^7.2.0",
6161
"fast-glob": "3.3.3",
@@ -102,7 +102,8 @@
102102
"whatwg-url": "14.0.0",
103103
"supports-hyperlinks": "3.1.0",
104104
"@shopify/cli-hydrogen>@shopify/cli-kit": "link:./packages/cli-kit",
105-
"@shopify/cli-hydrogen>@shopify/plugin-cloudflare": "link:./packages/plugin-cloudflare"
105+
"@shopify/cli-hydrogen>@shopify/plugin-cloudflare": "link:./packages/plugin-cloudflare",
106+
"nanoid": "3.3.8"
106107
},
107108
"knip": {
108109
"$schema": "https://unpkg.com/knip@5/schema.json",

packages/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"camelcase-keys": "9.1.3",
6464
"chokidar": "3.6.0",
6565
"diff": "5.2.0",
66-
"esbuild": "0.24.0",
66+
"esbuild": "0.24.2",
6767
"express": "4.21.2",
6868
"graphql-request": "5.2.0",
6969
"h3": "0.7.21",

packages/app/src/cli/services/dev.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {getCachedAppInfo, setCachedAppInfo} from './local-storage.js'
2525
import {canEnablePreviewMode} from './extensions/common.js'
2626
import {fetchAppRemoteConfiguration} from './app/select-app.js'
2727
import {patchAppConfigurationFile} from './app/patch-app-configuration-file.js'
28+
import {DevSessionStatusManager} from './dev/processes/dev-session-status-manager.js'
2829
import {DeveloperPlatformClient} from '../utilities/developer-platform-client.js'
2930
import {Web, isCurrentAppSchema, getAppScopesArray, AppLinkedInterface} from '../models/app/app.js'
3031
import {Organization, OrganizationApp, OrganizationStore} from '../models/organization.js'
@@ -71,9 +72,9 @@ export interface DevOptions {
7172
export async function dev(commandOptions: DevOptions) {
7273
const config = await prepareForDev(commandOptions)
7374
await actionsBeforeSettingUpDevProcesses(config)
74-
const {processes, graphiqlUrl, previewUrl} = await setupDevProcesses(config)
75+
const {processes, graphiqlUrl, previewUrl, devSessionStatusManager} = await setupDevProcesses(config)
7576
await actionsBeforeLaunchingDevProcesses(config)
76-
await launchDevProcesses({processes, previewUrl, graphiqlUrl, config})
77+
await launchDevProcesses({processes, previewUrl, graphiqlUrl, config, devSessionStatusManager})
7778
}
7879

7980
async function prepareForDev(commandOptions: DevOptions): Promise<DevConfig> {
@@ -117,10 +118,10 @@ async function prepareForDev(commandOptions: DevOptions): Promise<DevConfig> {
117118
await installAppDependencies(app)
118119
}
119120

120-
const graphiqlPort = commandOptions.graphiqlPort || (await getAvailableTCPPort(ports.graphiql))
121+
const graphiqlPort = commandOptions.graphiqlPort ?? (await getAvailableTCPPort(ports.graphiql))
121122
const {graphiqlKey} = commandOptions
122123

123-
if (graphiqlPort !== (commandOptions.graphiqlPort || ports.graphiql)) {
124+
if (graphiqlPort !== (commandOptions.graphiqlPort ?? ports.graphiql)) {
124125
renderWarning({
125126
headline: [
126127
'A random port will be used for GraphiQL because',
@@ -224,7 +225,7 @@ export async function warnIfScopesDifferBeforeDev({
224225
scopesMessage(getAppScopesArray(localApp.configuration)),
225226
'\n',
226227
'Scopes in Partner Dashboard:',
227-
scopesMessage(remoteAccess?.scopes?.split(',') || []),
228+
scopesMessage(remoteAccess?.scopes?.split(',') ?? []),
228229
],
229230
nextSteps,
230231
})
@@ -301,7 +302,7 @@ async function setupNetworkingOptions(
301302
...frontEndOptions,
302303
tunnelClient,
303304
}),
304-
getBackendPort() || backendConfig?.configuration.port || getAvailableTCPPort(),
305+
getBackendPort() ?? backendConfig?.configuration.port ?? getAvailableTCPPort(),
305306
getURLs(remoteAppConfig),
306307
])
307308
const proxyUrl = usingLocalhost ? `${frontendUrl}:${proxyPort}` : frontendUrl
@@ -330,11 +331,13 @@ async function launchDevProcesses({
330331
previewUrl,
331332
graphiqlUrl,
332333
config,
334+
devSessionStatusManager,
333335
}: {
334336
processes: DevProcesses
335337
previewUrl: string
336338
graphiqlUrl: string | undefined
337339
config: DevConfig
340+
devSessionStatusManager: DevSessionStatusManager
338341
}) {
339342
const abortController = new AbortController()
340343
const processesForTaskRunner: OutputProcess[] = processes.map((process) => {
@@ -375,6 +378,7 @@ async function launchDevProcesses({
375378
abortController,
376379
developerPreview: developerPreviewController(apiKey, developerPlatformClient),
377380
shopFqdn: config.storeFqdn,
381+
devSessionStatusManager,
378382
})
379383
}
380384

packages/app/src/cli/services/dev/processes/dev-session-status-manager.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import {devSessionStatusManager, DevSessionStatus} from './dev-session-status-manager.js'
1+
import {DevSessionStatus, DevSessionStatusManager} from './dev-session-status-manager.js'
22
import {describe, test, expect, beforeEach, vi} from 'vitest'
33

44
describe('DevSessionStatusManager', () => {
5+
const devSessionStatusManager = new DevSessionStatusManager()
6+
57
beforeEach(() => {
68
devSessionStatusManager.removeAllListeners()
79
devSessionStatusManager.reset()

packages/app/src/cli/services/dev/processes/dev-session-status-manager.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@ import {EventEmitter} from 'events'
44
export interface DevSessionStatus {
55
isReady: boolean
66
previewURL?: string
7+
graphiqlURL?: string
78
}
89

9-
class DevSessionStatusManager extends EventEmitter {
10+
export class DevSessionStatusManager extends EventEmitter {
1011
private currentStatus: DevSessionStatus = {
1112
isReady: false,
1213
previewURL: undefined,
14+
graphiqlURL: undefined,
15+
}
16+
17+
constructor(defaultStatus?: DevSessionStatus) {
18+
super()
19+
if (defaultStatus) this.currentStatus = defaultStatus
1320
}
1421

1522
updateStatus(status: Partial<DevSessionStatus>) {
@@ -29,8 +36,7 @@ class DevSessionStatusManager extends EventEmitter {
2936
this.currentStatus = {
3037
isReady: false,
3138
previewURL: undefined,
39+
graphiqlURL: undefined,
3240
}
3341
}
3442
}
35-
36-
export const devSessionStatusManager = new DevSessionStatusManager()

0 commit comments

Comments
 (0)