Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/all-suns-read.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/cli-kit': patch
---

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.
1 change: 0 additions & 1 deletion packages/cli-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
"./error-handler.js",
"../../public/node/context/local.js",
"./context/local.js",
"./custom-oclif-loader.js",
"@oclif/core",
"./path.js",
"./system.js",
Expand Down
16 changes: 7 additions & 9 deletions packages/cli-kit/src/public/node/cli-launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,29 @@ interface Options {
}

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

if (isDevelopment()) {
oclif.default.settings.debug = true
settings.debug = true
}

try {
// Use a custom OCLIF config to customize the behavior of the CLI
const config = new ShopifyConfig({root: fileURLToPath(options.moduleURL)})
const config = new Config({root: fileURLToPath(options.moduleURL)})
await config.load()

await oclif.default.run(options.argv, config)
await oclif.default.flush()
await run(options.argv, config)
await flush()
// eslint-disable-next-line no-catch-all/no-catch-all
} catch (error) {
await errorHandler(error as Error)
return oclif.default.Errors.handle(error as Error)
return Errors.handle(error as Error)
}
}
93 changes: 0 additions & 93 deletions packages/cli-kit/src/public/node/custom-oclif-loader.ts

This file was deleted.

Loading