Fix custom-ocliff-loader.ts hydrogen loader strategy for hydrogen-cli local development#6827
Fix custom-ocliff-loader.ts hydrogen loader strategy for hydrogen-cli local development#6827
Conversation
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success3718 tests passing in 1438 suites. Report generated by 🧪jest coverage report action from 2b31382 |
|
Changes make sense, thank you for the pairing @andguy95. We'll want to make sure @Shopify/app-inner-loop takes a peek as they have historically made the changes to the file. |
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationsWe found no new type declarations in this PR Existing type declarationspackages/cli-kit/dist/public/node/custom-oclif-loader.d.ts@@ -1,6 +1,6 @@
-import { Command, Config } from '@oclif/core';
+import { Config } from '@oclif/core';
import { Options } from '@oclif/core/interfaces';
export declare class ShopifyConfig extends Config {
constructor(options: Options);
- customPriority(commands: Command.Loadable[]): Command.Loadable | undefined;
+ load(): Promise<void>;
}
\ No newline at end of file
|
WHY are these changes introduced?
During local development of the
@shopify/cliin theShopify/hydrogenyou are no longer able to see your changes when running thenpx shopify hydrogencommands because thecustom-ocliff-loader.tsno longer loads the localShopify/hydrgencli in theShopify/hydrogenmonorepo.These versions below are good:
In OCLIF v4,
determinePriorityis a standalone utility function (not an instance method), so we can't override it to customize command priority incustom-ocliff-loader.ts.WHAT is this pull request doing?
Change the
custom-ocliff-loader.tsto manually replace bundled hydrogen commands with external ones after loading completes if in dev mode.How to test your changes?
dev.tsinhydrogen/packages/cli/src/commands/hydrogen/dev.tsrun()cliproject runnpm run buildtemplate/skeletonproject runnpx shopify hydrogen devshopify-devpointing to a locally built version of theShopiy/clialias shopify-dev='/Users/$USER/bin/shopify'Measuring impact
How do we know this change was effective? Please choose one:
Checklist