Skip to content

Commit 5773c84

Browse files
committed
remove deprecated args
1 parent 9574ca8 commit 5773c84

File tree

3 files changed

+9
-31
lines changed

3 files changed

+9
-31
lines changed

packages/cli/oclif.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6346,7 +6346,7 @@
63466346
"pluginAlias": "@shopify/cli",
63476347
"pluginName": "@shopify/cli",
63486348
"pluginType": "core",
6349-
"strict": false,
6349+
"strict": true,
63506350
"summary": "Set a remote theme as the live theme."
63516351
},
63526352
"theme:pull": {

packages/theme/src/cli/commands/theme/publish.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import ThemeCommand from '../../utilities/theme-command.js'
22
import {themeFlags} from '../../flags.js'
3-
import {publish, renderArgumentsWarning} from '../../services/publish.js'
3+
import {publish} from '../../services/publish.js'
44
import {Flags} from '@oclif/core'
55
import {globalFlags} from '@shopify/cli-kit/node/cli'
66
import {OutputFlags} from '@oclif/core/interfaces'
@@ -21,9 +21,6 @@ If you want to publish your local theme, then you need to run \`shopify theme pu
2121

2222
static description = this.descriptionWithoutMarkdown()
2323

24-
// Accept any number of args without naming them
25-
static strict = false
26-
2724
static flags = {
2825
...globalFlags,
2926
...themeFlags,
@@ -41,16 +38,7 @@ If you want to publish your local theme, then you need to run \`shopify theme pu
4138

4239
static multiEnvironmentsFlags = ['store', 'password', 'theme']
4340

44-
async command(flags: PublishFlags, adminSession: AdminSession) {
45-
// Deprecated use of passing the theme id as an argument
46-
// ex: `shopify theme publish <themeid>`
47-
const positionalArgValue =
48-
this.argv && this.argv.length > 0 && typeof this.argv[0] === 'string' ? this.argv[0] : undefined
49-
50-
if (!flags.theme && positionalArgValue) {
51-
flags.theme = positionalArgValue
52-
renderArgumentsWarning(positionalArgValue)
53-
}
54-
await publish(adminSession, flags)
41+
async command(flags: PublishFlags, adminSession: AdminSession, multiEnvironment?: boolean) {
42+
await publish(adminSession, flags, multiEnvironment)
5543
}
5644
}

packages/theme/src/cli/services/publish.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,16 @@ import {themeComponent} from '../utilities/theme-ui.js'
33
import {themePublish} from '@shopify/cli-kit/node/themes/api'
44
import {themePreviewUrl} from '@shopify/cli-kit/node/themes/urls'
55
import {Theme} from '@shopify/cli-kit/node/themes/types'
6-
import {renderConfirmationPrompt, renderSuccess, renderWarning} from '@shopify/cli-kit/node/ui'
6+
import {renderConfirmationPrompt, renderSuccess} from '@shopify/cli-kit/node/ui'
77
import {AdminSession} from '@shopify/cli-kit/node/session'
88

9-
export function renderArgumentsWarning(id: string) {
10-
renderWarning({
11-
body: [
12-
'The theme ID positional argument is deprecated. Use the',
13-
{command: '--theme'},
14-
'flag instead:\n\n',
15-
{command: `$ shopify theme publish --theme ${id}`},
16-
{char: '.'},
17-
],
18-
})
19-
}
20-
219
interface PublishServiceOptions {
2210
theme: string | undefined
2311
force: boolean
12+
environment?: string
2413
}
2514

26-
export async function publish(adminSession: AdminSession, options: PublishServiceOptions) {
15+
export async function publish(adminSession: AdminSession, options: PublishServiceOptions, multiEnvironment?: boolean) {
2716
const themeToPublish = await findOrSelectTheme(adminSession, {
2817
header: 'Select a theme to publish',
2918
filter: {
@@ -35,7 +24,7 @@ export async function publish(adminSession: AdminSession, options: PublishServic
3524

3625
const previewUrl = themePreviewUrl({...themeToPublish, role: 'live'} as Theme, adminSession)
3726

38-
if (!options.force) {
27+
if (!options.force && !multiEnvironment) {
3928
const accept = await renderConfirmationPrompt({
4029
message: `Do you want to make '${themeToPublish.name}' the new live theme on ${adminSession.storeFqdn}?`,
4130
confirmationMessage: `Yes, make '${themeToPublish.name}' the new live theme`,
@@ -47,6 +36,7 @@ export async function publish(adminSession: AdminSession, options: PublishServic
4736
await themePublish(themeToPublish.id, adminSession)
4837

4938
renderSuccess({
39+
headline: options.environment ? `Environment: ${options.environment}` : undefined,
5040
body: [
5141
'The theme',
5242
...themeComponent(themeToPublish),

0 commit comments

Comments
 (0)