Skip to content

Commit 102eb5b

Browse files
Merge branch 'main' into upgrade-oclif
2 parents 28bbdf9 + bf55c1a commit 102eb5b

File tree

46 files changed

+1860
-1416
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1860
-1416
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.

.changeset/lemon-eggs-exist.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/app': patch
3+
---
4+
5+
Improve error message in function replay command when log directory doesnt exist
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)

.changeset/witty-planes-crash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/cli': patch
3+
---
4+
5+
Bump cli-hydrogen to 9.0.5

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
@@ -6310,12 +6310,12 @@
63106310
"syntaxKind": "PropertySignature",
63116311
"name": "-x, --ignore <value>",
63126312
"value": "string",
6313-
"description": "Skip downloading the specified files (Multiple flags allowed).",
6313+
"description": "Skip uploading the specified files (Multiple flags allowed).",
63146314
"isOptional": true,
63156315
"environmentValue": "SHOPIFY_FLAG_IGNORE"
63166316
}
63176317
],
6318-
"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}"
6318+
"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}"
63196319
}
63206320
}
63216321
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"changeset-build-no-docs": "changeset version && pnpm install --no-frozen-lockfile && pnpm build && bin/update-cli-kit-version.js",
1212
"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",
1313
"clean": "nx run-many --target=clean --all --skip-nx-cache && nx reset",
14-
"create-app": "nx build create-app && cross-env SHOPIFY_FLAG_PACKAGE_MANAGER=npm node packages/create-app/bin/dev.js",
14+
"create-app": "nx build create-app && node packages/create-app/bin/dev.js --package-manager npm",
1515
"deploy-experimental": "node bin/deploy-experimental.js",
1616
"graph": "nx graph",
1717
"graphql-codegen:get-graphql-schemas": "bin/get-graphql-schemas.js",
@@ -40,7 +40,7 @@
4040
"devDependencies": {
4141
"@bugsnag/source-maps": "^2.3.1",
4242
"@changesets/cli": "2.27.12",
43-
"@graphql-codegen/cli": "5.0.2",
43+
"@graphql-codegen/cli": "5.0.4",
4444
"@graphql-codegen/near-operation-file-preset": "3.0.0",
4545
"@nx/eslint-plugin": "19.8.14",
4646
"@nx/workspace": "19.8.14",
@@ -54,14 +54,13 @@
5454
"ansi-colors": "^4.1.3",
5555
"bugsnag-build-reporter": "^2.0.0",
5656
"commander": "^9.4.0",
57-
"cross-env": "^7.0.3",
5857
"esbuild": "0.24.2",
5958
"eslint": "^8.48.0",
6059
"execa": "^7.2.0",
6160
"fast-glob": "3.3.3",
6261
"find-up": "^6.3.0",
6362
"fs-extra": "^11.1.0",
64-
"graphql": "^16.8.1",
63+
"graphql": "^16.10.0",
6564
"graphql-codegen-typescript-operation-types": "2.0.1",
6665
"graphql-tag": "^2.12.6",
6766
"json-stringify-deterministic": "1.0.12",
@@ -101,6 +100,7 @@
101100
"@oclif/core": "3.26.5",
102101
"whatwg-url": "14.0.0",
103102
"supports-hyperlinks": "3.1.0",
103+
"@graphql-tools/utils": "10.7.2",
104104
"@shopify/cli-hydrogen>@shopify/cli-kit": "link:./packages/cli-kit",
105105
"@shopify/cli-hydrogen>@shopify/plugin-cloudflare": "link:./packages/plugin-cloudflare",
106106
"nanoid": "3.3.8"

packages/app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"clean": "nx clean",
3838
"lint": "nx lint",
3939
"lint:fix": "nx lint:fix",
40-
"prepack": "cross-env NODE_ENV=production pnpm nx build && cp ../../README.md README.md",
40+
"prepack": "NODE_ENV=production pnpm nx build && cp ../../README.md README.md",
4141
"test": "nx run app:test",
4242
"test:coverage": "nx test:coverage",
4343
"test:watch": "nx test:watch",
@@ -65,7 +65,7 @@
6565
"diff": "5.2.0",
6666
"esbuild": "0.24.2",
6767
"express": "4.21.2",
68-
"graphql-request": "5.2.0",
68+
"graphql-request": "6.1.0",
6969
"h3": "0.7.21",
7070
"http-proxy": "1.18.1",
7171
"ignore": "6.0.2",

packages/app/src/cli/commands/app/init.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {validateFlavorValue, validateTemplateValue} from '../../services/init/va
77
import {MinimalOrganizationApp, Organization, OrganizationApp} from '../../models/organization.js'
88
import {appNamePrompt, createAsNewAppPrompt, selectAppPrompt} from '../../prompts/dev.js'
99
import {searchForAppsByNameFactory} from '../../services/dev/prompt-helpers.js'
10+
import {isValidName} from '../../models/app/validation/common.js'
1011
import {Flags} from '@oclif/core'
1112
import {globalFlags} from '@shopify/cli-kit/node/cli'
1213
import {resolvePath, cwd} from '@shopify/cli-kit/node/path'
@@ -72,7 +73,7 @@ export default class Init extends AppCommand {
7273
validateFlavorValue(flags.template, flags.flavor)
7374

7475
const inferredPackageManager = inferPackageManager(flags['package-manager'])
75-
const name = flags.name ?? (await generateRandomNameForSubdirectory({suffix: 'app', directory: flags.path}))
76+
const name = flags.name ?? (await getAppName(flags.path))
7677

7778
// Force user authentication before prompting.
7879
let developerPlatformClient = selectDeveloperPlatformClient()
@@ -126,6 +127,15 @@ export default class Init extends AppCommand {
126127
}
127128
}
128129

130+
async function getAppName(directory: string): Promise<string> {
131+
for (let i = 0; i < 3; i++) {
132+
// eslint-disable-next-line no-await-in-loop
133+
const name = await generateRandomNameForSubdirectory({suffix: 'app', directory})
134+
if (isValidName(name)) return name
135+
}
136+
return ''
137+
}
138+
129139
export type SelectAppOrNewAppNameResult =
130140
| {
131141
result: 'new'

0 commit comments

Comments
 (0)