Skip to content

Commit 6b989ae

Browse files
authored
Merge pull request #7068 from Shopify/an-remove-custom-oclif-loader
feat: remove custom-oclif-loader
2 parents 3ba5e2b + 07d4304 commit 6b989ae

4 files changed

Lines changed: 12 additions & 103 deletions

File tree

.changeset/all-suns-read.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/cli-kit': patch
3+
---
4+
5+
Remove `custom-oclif-loader.ts` and use oclif's `Config` directly. The development-only shim for loading a local `@shopify/cli-hydrogen` plugin is no longer needed as the Hydrogen repo now handles this via its own patch scripts.

packages/cli-kit/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
"./error-handler.js",
8383
"../../public/node/context/local.js",
8484
"./context/local.js",
85-
"./custom-oclif-loader.js",
8685
"@oclif/core",
8786
"./path.js",
8887
"./system.js",

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,29 @@ interface Options {
66
}
77

88
/**
9-
* Launches the CLI through our custom OCLIF loader.
9+
* Launches the CLI.
1010
*
1111
* @param options - Options.
1212
* @returns A promise that resolves when the CLI has been launched.
1313
*/
1414
export async function launchCLI(options: Options): Promise<void> {
1515
const {errorHandler} = await import('./error-handler.js')
1616
const {isDevelopment} = await import('./context/local.js')
17-
const oclif = await import('@oclif/core')
18-
const {ShopifyConfig} = await import('./custom-oclif-loader.js')
17+
const {Config, run, flush, Errors, settings} = await import('@oclif/core')
1918

2019
if (isDevelopment()) {
21-
oclif.default.settings.debug = true
20+
settings.debug = true
2221
}
2322

2423
try {
25-
// Use a custom OCLIF config to customize the behavior of the CLI
26-
const config = new ShopifyConfig({root: fileURLToPath(options.moduleURL)})
24+
const config = new Config({root: fileURLToPath(options.moduleURL)})
2725
await config.load()
2826

29-
await oclif.default.run(options.argv, config)
30-
await oclif.default.flush()
27+
await run(options.argv, config)
28+
await flush()
3129
// eslint-disable-next-line no-catch-all/no-catch-all
3230
} catch (error) {
3331
await errorHandler(error as Error)
34-
return oclif.default.Errors.handle(error as Error)
32+
return Errors.handle(error as Error)
3533
}
3634
}

packages/cli-kit/src/public/node/custom-oclif-loader.ts

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)