Skip to content

Commit 697eca0

Browse files
Merge pull request #7830 from Shopify/downgrade-oclif
Pin oclif to 4.8.3
2 parents 27c6ebc + 0ff46b8 commit 697eca0

9 files changed

Lines changed: 73 additions & 34 deletions

File tree

‎packages/app/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"dependencies": {
6161
"@graphql-typed-document-node/core": "3.2.0",
6262
"@luckycatfactory/esbuild-graphql-loader": "3.8.1",
63-
"@oclif/core": "4.11.4",
63+
"@oclif/core": "4.8.3",
6464
"@shopify/cli-kit": "4.1.0",
6565
"@shopify/plugin-cloudflare": "4.1.0",
6666
"@shopify/organizations": "4.1.0",

‎packages/cli-kit/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"@bugsnag/js": "8.9.0",
107107
"@graphql-typed-document-node/core": "3.2.0",
108108
"@iarna/toml": "2.2.5",
109-
"@oclif/core": "4.11.4",
109+
"@oclif/core": "4.8.3",
110110
"@shopify/polaris": "12.27.0",
111111
"@shopify/polaris-icons": "8.11.1",
112112
"@shopify/toml-patch": "0.3.0",

‎packages/cli-kit/src/public/node/cli-launcher.test.ts‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import {launchCLI} from './cli-launcher.js'
2-
import {describe, expect, test} from 'vitest'
2+
import {ShopifyConfig} from './custom-oclif-loader.js'
3+
import {run} from '@oclif/core'
4+
import {describe, expect, test, vi} from 'vitest'
35

46
describe('launchCLI', () => {
57
test('launches the CLI successfully with help flag', async () => {
@@ -11,4 +13,23 @@ describe('launchCLI', () => {
1113
test('fails if args are invalid', async () => {
1214
await expect(launchCLI({moduleURL: import.meta.url, argv: ['this', 'is', 'invalid']})).rejects.toThrow()
1315
})
16+
17+
test('preserves the loaded Shopify config so commands can be loaded lazily', async () => {
18+
const command = {id: 'lazy-test'} as any
19+
const config = new ShopifyConfig({root: import.meta.url})
20+
const lazyCommandLoader = vi.fn().mockResolvedValue({
21+
run: vi.fn().mockResolvedValue('ok'),
22+
})
23+
24+
config.setLazyCommandLoader(lazyCommandLoader)
25+
config.findCommand = vi.fn().mockReturnValue(command)
26+
config.runHook = vi.fn().mockResolvedValue({successes: [], failures: []})
27+
config.pjson = {oclif: {}} as any
28+
config.userAgent = '@shopify/cli-kit/test'
29+
30+
await expect(run(['lazy-test'], config)).resolves.toBe('ok')
31+
32+
expect(lazyCommandLoader).toHaveBeenCalledWith('lazy-test')
33+
expect(config.findCommand).toHaveBeenCalledWith('lazy-test')
34+
})
1435
})

‎packages/cli/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"global-agent": "3.0.0"
5858
},
5959
"devDependencies": {
60-
"@oclif/core": "4.11.4",
60+
"@oclif/core": "4.8.3",
6161
"@oclif/plugin-commands": "4.1.57",
6262
"@oclif/plugin-plugins": "5.4.47",
6363
"@shopify/app": "4.1.0",

‎packages/plugin-cloudflare/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
]
4646
},
4747
"dependencies": {
48-
"@oclif/core": "4.11.4",
48+
"@oclif/core": "4.8.3",
4949
"@shopify/cli-kit": "4.1.0"
5050
},
5151
"devDependencies": {

‎packages/plugin-did-you-mean/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
]
4141
},
4242
"dependencies": {
43-
"@oclif/core": "4.11.4",
43+
"@oclif/core": "4.8.3",
4444
"@shopify/cli-kit": "4.1.0",
4545
"n-gram": "2.0.2"
4646
},

‎packages/store/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
},
4141
"dependencies": {
4242
"@graphql-typed-document-node/core": "3.2.0",
43-
"@oclif/core": "4.11.4",
43+
"@oclif/core": "4.8.3",
4444
"@shopify/cli-kit": "4.1.0",
4545
"@shopify/organizations": "4.1.0"
4646
},

‎packages/theme/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
]
4141
},
4242
"dependencies": {
43-
"@oclif/core": "4.11.4",
43+
"@oclif/core": "4.8.3",
4444
"@shopify/cli-kit": "4.1.0",
4545
"@shopify/theme-check-node": "3.26.1",
4646
"@shopify/theme-language-server-node": "2.21.3",

‎pnpm-lock.yaml‎

Lines changed: 44 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)