Skip to content

Commit ae8b6b5

Browse files
committed
rename to doctor-release, fix absolute paths, and gate via env var
1 parent 09a76de commit ae8b6b5

File tree

13 files changed

+171
-169
lines changed

13 files changed

+171
-169
lines changed

packages/cli/oclif.manifest.json

Lines changed: 91 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -3062,98 +3062,6 @@
30623062
"strict": true,
30633063
"summary": "Trigger delivery of a sample webhook topic payload to a designated address."
30643064
},
3065-
"audit": {
3066-
"aliases": [
3067-
],
3068-
"args": {
3069-
},
3070-
"description": "Run CLI audit tests",
3071-
"enableJsonFlag": false,
3072-
"flags": {
3073-
},
3074-
"hasDynamicHelp": false,
3075-
"hidden": true,
3076-
"hiddenAliases": [
3077-
],
3078-
"id": "audit",
3079-
"pluginAlias": "@shopify/cli",
3080-
"pluginName": "@shopify/cli",
3081-
"pluginType": "core",
3082-
"strict": true
3083-
},
3084-
"audit:theme": {
3085-
"aliases": [
3086-
],
3087-
"args": {
3088-
},
3089-
"description": "Run all theme command audit tests",
3090-
"enableJsonFlag": false,
3091-
"flags": {
3092-
"environment": {
3093-
"char": "e",
3094-
"description": "The environment to use from shopify.theme.toml (required for store-connected tests).",
3095-
"env": "SHOPIFY_FLAG_ENVIRONMENT",
3096-
"hasDynamicHelp": false,
3097-
"multiple": false,
3098-
"name": "environment",
3099-
"required": true,
3100-
"type": "option"
3101-
},
3102-
"no-color": {
3103-
"allowNo": false,
3104-
"description": "Disable color output.",
3105-
"env": "SHOPIFY_FLAG_NO_COLOR",
3106-
"hidden": false,
3107-
"name": "no-color",
3108-
"type": "boolean"
3109-
},
3110-
"password": {
3111-
"description": "Password from Theme Access app (overrides environment).",
3112-
"env": "SHOPIFY_FLAG_PASSWORD",
3113-
"hasDynamicHelp": false,
3114-
"multiple": false,
3115-
"name": "password",
3116-
"type": "option"
3117-
},
3118-
"path": {
3119-
"char": "p",
3120-
"default": ".",
3121-
"description": "The path to run tests in. Defaults to current directory.",
3122-
"env": "SHOPIFY_FLAG_PATH",
3123-
"hasDynamicHelp": false,
3124-
"multiple": false,
3125-
"name": "path",
3126-
"type": "option"
3127-
},
3128-
"store": {
3129-
"char": "s",
3130-
"description": "Store URL (overrides environment).",
3131-
"env": "SHOPIFY_FLAG_STORE",
3132-
"hasDynamicHelp": false,
3133-
"multiple": false,
3134-
"name": "store",
3135-
"type": "option"
3136-
},
3137-
"verbose": {
3138-
"allowNo": false,
3139-
"description": "Increase the verbosity of the output.",
3140-
"env": "SHOPIFY_FLAG_VERBOSE",
3141-
"hidden": false,
3142-
"name": "verbose",
3143-
"type": "boolean"
3144-
}
3145-
},
3146-
"hasDynamicHelp": false,
3147-
"hidden": true,
3148-
"hiddenAliases": [
3149-
"audit theme"
3150-
],
3151-
"id": "audit:theme",
3152-
"pluginAlias": "@shopify/cli",
3153-
"pluginName": "@shopify/cli",
3154-
"pluginType": "core",
3155-
"strict": true
3156-
},
31573065
"auth:login": {
31583066
"aliases": [
31593067
],
@@ -3500,6 +3408,97 @@
35003408
"pluginType": "core",
35013409
"strict": true
35023410
},
3411+
"doctor-release": {
3412+
"aliases": [
3413+
],
3414+
"args": {
3415+
},
3416+
"description": "Run CLI doctor-release tests",
3417+
"enableJsonFlag": false,
3418+
"flags": {
3419+
},
3420+
"hasDynamicHelp": false,
3421+
"hidden": true,
3422+
"hiddenAliases": [
3423+
],
3424+
"id": "doctor-release",
3425+
"pluginAlias": "@shopify/cli",
3426+
"pluginName": "@shopify/cli",
3427+
"pluginType": "core",
3428+
"strict": true
3429+
},
3430+
"doctor-release:theme": {
3431+
"aliases": [
3432+
],
3433+
"args": {
3434+
},
3435+
"description": "Run all theme command doctor-release tests",
3436+
"enableJsonFlag": false,
3437+
"flags": {
3438+
"environment": {
3439+
"char": "e",
3440+
"description": "The environment to use from shopify.theme.toml (required for store-connected tests).",
3441+
"env": "SHOPIFY_FLAG_ENVIRONMENT",
3442+
"hasDynamicHelp": false,
3443+
"multiple": false,
3444+
"name": "environment",
3445+
"required": true,
3446+
"type": "option"
3447+
},
3448+
"no-color": {
3449+
"allowNo": false,
3450+
"description": "Disable color output.",
3451+
"env": "SHOPIFY_FLAG_NO_COLOR",
3452+
"hidden": false,
3453+
"name": "no-color",
3454+
"type": "boolean"
3455+
},
3456+
"password": {
3457+
"description": "Password from Theme Access app (overrides environment).",
3458+
"env": "SHOPIFY_FLAG_PASSWORD",
3459+
"hasDynamicHelp": false,
3460+
"multiple": false,
3461+
"name": "password",
3462+
"type": "option"
3463+
},
3464+
"path": {
3465+
"char": "p",
3466+
"default": ".",
3467+
"description": "The path to run tests in. Defaults to current directory.",
3468+
"env": "SHOPIFY_FLAG_PATH",
3469+
"hasDynamicHelp": false,
3470+
"multiple": false,
3471+
"name": "path",
3472+
"type": "option"
3473+
},
3474+
"store": {
3475+
"char": "s",
3476+
"description": "Store URL (overrides environment).",
3477+
"env": "SHOPIFY_FLAG_STORE",
3478+
"hasDynamicHelp": false,
3479+
"multiple": false,
3480+
"name": "store",
3481+
"type": "option"
3482+
},
3483+
"verbose": {
3484+
"allowNo": false,
3485+
"description": "Increase the verbosity of the output.",
3486+
"env": "SHOPIFY_FLAG_VERBOSE",
3487+
"hidden": false,
3488+
"name": "verbose",
3489+
"type": "boolean"
3490+
}
3491+
},
3492+
"hasDynamicHelp": false,
3493+
"hidden": true,
3494+
"hiddenAliases": [
3495+
],
3496+
"id": "doctor-release:theme",
3497+
"pluginAlias": "@shopify/cli",
3498+
"pluginName": "@shopify/cli",
3499+
"pluginType": "core",
3500+
"strict": true
3501+
},
35033502
"help": {
35043503
"aliases": [
35053504
],

packages/cli/src/cli/commands/audit/audit.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import Command from '@shopify/cli-kit/node/base-command'
2+
import {firstPartyDev} from '@shopify/cli-kit/node/context/local'
3+
import {renderInfo} from '@shopify/cli-kit/node/ui'
4+
5+
export default class DoctorRelease extends Command {
6+
static description = 'Run CLI doctor-release tests'
7+
static hidden = true
8+
9+
async run(): Promise<void> {
10+
if (!firstPartyDev()) {
11+
return
12+
}
13+
14+
renderInfo({
15+
headline: 'Shopify CLI Doctor Release.',
16+
body: [
17+
'Available doctor-release commands:',
18+
'',
19+
' shopify doctor-release theme -e <environment> Run all theme command tests',
20+
'',
21+
'The -e/--environment flag is required to specify the store configuration.',
22+
'Use --help with any command for more options.',
23+
],
24+
})
25+
}
26+
}

packages/cli/src/cli/commands/audit/theme/index.ts renamed to packages/cli/src/cli/commands/doctor-release/theme/index.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import {runThemeAudit} from '../../../services/audit/theme/runner.js'
1+
import {runThemeDoctor} from '../../../services/doctor-release/theme/runner.js'
22
import Command from '@shopify/cli-kit/node/base-command'
33
import {globalFlags} from '@shopify/cli-kit/node/cli'
44
import {Flags} from '@oclif/core'
55
import {resolvePath, cwd} from '@shopify/cli-kit/node/path'
6+
import {firstPartyDev} from '@shopify/cli-kit/node/context/local'
67

7-
export default class AuditTheme extends Command {
8-
static description = 'Run all theme command audit tests'
8+
export default class DoctorReleaseTheme extends Command {
9+
static description = 'Run all theme command doctor-release tests'
910
static hidden = true
10-
static hiddenAliases = ['audit theme']
1111

1212
static flags = {
1313
...globalFlags,
@@ -36,9 +36,13 @@ export default class AuditTheme extends Command {
3636
}
3737

3838
async run(): Promise<void> {
39-
const {flags} = await this.parse(AuditTheme)
39+
if (!firstPartyDev()) {
40+
return
41+
}
42+
43+
const {flags} = await this.parse(DoctorReleaseTheme)
4044

41-
const results = await runThemeAudit({
45+
const results = await runThemeDoctor({
4246
path: flags.path,
4347
environment: flags.environment,
4448
store: flags.store,

packages/cli/src/cli/services/audit/context.ts renamed to packages/cli/src/cli/services/doctor-release/context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {cwd} from '@shopify/cli-kit/node/path'
2-
import type {AuditContext, ThemeAuditOptions} from './types.js'
2+
import type {DoctorContext, ThemeDoctorOptions} from './types.js'
33

4-
export function createAuditContext(options: ThemeAuditOptions): AuditContext {
4+
export function createDoctorContext(options: ThemeDoctorOptions): DoctorContext {
55
return {
66
workingDirectory: options.path ?? cwd(),
77
environment: options.environment,

packages/cli/src/cli/services/audit/framework.test.ts renamed to packages/cli/src/cli/services/doctor-release/framework.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import {AuditSuite} from './framework.js'
1+
import {DoctorSuite} from './framework.js'
22
import {describe, expect, test, vi, beforeEach} from 'vitest'
3-
import type {AuditContext} from './types.js'
3+
import type {DoctorContext} from './types.js'
44

55
vi.mock('@shopify/cli-kit/node/fs')
66
vi.mock('@shopify/cli-kit/node/system')
77

88
/**
9-
* Creates a minimal AuditContext for testing
9+
* Creates a minimal DoctorContext for testing
1010
*/
11-
function createTestContext(overrides?: Partial<AuditContext>): AuditContext {
11+
function createTestContext(overrides?: Partial<DoctorContext>): DoctorContext {
1212
return {
1313
workingDirectory: '/test/dir',
1414
environment: 'test',
@@ -18,9 +18,9 @@ function createTestContext(overrides?: Partial<AuditContext>): AuditContext {
1818
}
1919

2020
/**
21-
* Concrete test suite for testing AuditSuite behavior
21+
* Concrete test suite for testing DoctorSuite behavior
2222
*/
23-
class TestSuite extends AuditSuite {
23+
class TestSuite extends DoctorSuite {
2424
static description = 'Test suite for framework testing'
2525

2626
private readonly testDefinitions: {name: string; fn: () => Promise<void>}[] = []
@@ -45,9 +45,9 @@ class TestSuite extends AuditSuite {
4545
}
4646
}
4747

48-
describe('AuditSuite', () => {
48+
describe('DoctorSuite', () => {
4949
let suite: TestSuite
50-
let context: AuditContext
50+
let context: DoctorContext
5151

5252
beforeEach(() => {
5353
suite = new TestSuite()

0 commit comments

Comments
 (0)