-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Merge branch 'experimental' into fd-vite-rsc-consume-response
- Loading branch information
Showing
106 changed files
with
729 additions
and
938 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
import renderHydrogen from '@shopify/hydrogen/entry-client'; | ||
import {setShopifyConfig} from '@shopify/hydrogen/client'; | ||
import shopifyConfig from '../shopify.config'; | ||
|
||
setShopifyConfig(shopifyConfig); | ||
|
||
function ClientApp({children}) { | ||
return children; | ||
} | ||
|
||
export default renderHydrogen(ClientApp); | ||
export default renderHydrogen(ClientApp, {shopifyConfig}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
import renderHydrogen from '@shopify/hydrogen/entry-server'; | ||
import {setShopifyConfig} from '@shopify/hydrogen'; | ||
import shopifyConfig from '../shopify.config'; | ||
|
||
setShopifyConfig(shopifyConfig); | ||
|
||
import App from './App.server'; | ||
|
||
export default renderHydrogen(App, () => { | ||
// Custom hook | ||
}); | ||
export default renderHydrogen(App, {shopifyConfig}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import {resolve, basename, extname} from 'path'; | ||
import debug from 'debug'; | ||
|
||
import {InputError, tree} from './utilities'; | ||
import {CONFIG_DIRECTORY} from './config'; | ||
import {Env} from './types'; | ||
|
||
interface ModuleType { | ||
default: (env: Env) => Promise<void>; | ||
} | ||
|
||
export class Command { | ||
private logger: debug.Debugger; | ||
private module: ModuleType | null = null; | ||
private modulePath: string | null = null; | ||
|
||
constructor(public command: string) { | ||
this.logger = debug(`hydrogen/${command}`); | ||
} | ||
|
||
async run(env: Env) { | ||
this.logger(`Running ${this.command}`); | ||
|
||
if (!this.modulePath) { | ||
return; | ||
} | ||
|
||
try { | ||
this.module = await import(this.modulePath); | ||
|
||
if (!this.module) { | ||
return; | ||
} | ||
|
||
await this.module.default({ | ||
...env, | ||
logger: this.logger, | ||
}); | ||
} catch (error) { | ||
this.logger(error); | ||
console.error(error); | ||
env.ui.say(`Command module not found at ${this.modulePath} ${error}`, { | ||
error: true, | ||
}); | ||
|
||
throw new InputError(); | ||
} | ||
|
||
this.logger(`Finished ${this.command}`); | ||
} | ||
|
||
async load() { | ||
this.logger(`Loading ${this.command}`); | ||
|
||
const localCommands = await tree(resolve(CONFIG_DIRECTORY, 'commands')); | ||
|
||
this.modulePath = | ||
[...localCommands.files, ...localCommands.directories].find( | ||
matchCommand(this.command) | ||
) || `./commands/${this.command}`; | ||
|
||
this.logger(`Loaded ${this.modulePath}`); | ||
} | ||
} | ||
|
||
function commandNameFromPath(path?: string) { | ||
return path ? basename(path, extname(path)) : ''; | ||
} | ||
|
||
function matchCommand(inputCommand: string) { | ||
return (command: string) => | ||
inputCommand.split('/').includes(commandNameFromPath(command)); | ||
} |
84 changes: 0 additions & 84 deletions
84
packages/cli/src/commands/check/rules/eslint/tests/eslint.test.ts.ts
This file was deleted.
Oops, something went wrong.
45 changes: 0 additions & 45 deletions
45
packages/cli/src/commands/check/rules/hydrogen/tests/hydrogen.test.ts
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
packages/cli/src/commands/check/rules/node/tests/node.test.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,5 @@ export async function loadConfig( | |
logger(error); | ||
} | ||
} | ||
|
||
export const CONFIG_DIRECTORY = '.hydrogen'; |
Oops, something went wrong.