Skip to content

Commit e75b382

Browse files
Merge branch 'main' into upgrade-graphql
2 parents 5585d11 + 936d7ac commit e75b382

File tree

28 files changed

+652
-430
lines changed

28 files changed

+652
-430
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
@@ -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
}

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'

packages/app/src/cli/models/app/validation/common.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ function isValidUrl(input: string, httpsOnly: boolean) {
2020
export function ensurePathStartsWithSlash(arg: unknown) {
2121
return typeof arg === 'string' && !arg.startsWith('/') ? `/${arg}` : arg
2222
}
23+
24+
export const APP_NAME_MAX_LENGTH = 30
25+
26+
export function isValidName(name: string): boolean {
27+
return name.length <= APP_NAME_MAX_LENGTH
28+
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {Organization, MinimalOrganizationApp, OrganizationStore, MinimalAppIdent
33
import {getTomls} from '../utilities/app/config/getTomls.js'
44
import {setCachedCommandTomlMap} from '../services/local-storage.js'
55
import {Paginateable} from '../utilities/developer-platform-client.js'
6+
import {APP_NAME_MAX_LENGTH} from '../models/app/validation/common.js'
67
import {
78
RenderAutocompleteOptions,
89
renderAutocompletePrompt,
@@ -129,8 +130,8 @@ export async function appNamePrompt(currentName: string): Promise<string> {
129130
if (value.length === 0) {
130131
return "App name can't be empty"
131132
}
132-
if (value.length > 30) {
133-
return 'Enter a shorter name (30 character max.)'
133+
if (value.length > APP_NAME_MAX_LENGTH) {
134+
return `Enter a shorter name (${APP_NAME_MAX_LENGTH} character max.)`
134135
}
135136
if (value.includes('shopify')) {
136137
return 'Name can\'t contain "shopify." Enter another name.'

0 commit comments

Comments
 (0)