-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetch metafield definitions on start-up #597
base: main
Are you sure you want to change the base?
Conversation
const isWin = process.platform === 'win32'; | ||
|
||
export async function fetchMetafieldDefinitions() { | ||
const path = getShopifyCliPath(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current CLI does not have the ability to pull metafields, so tophat this build the CLI PR here and hardcode this value to the path.
E.g.
const path = '<where-ever-you-cloned-it>/cli/packages/cli/bin/dev.js'
@@ -10,6 +11,7 @@ const fileSystems: Record<string, AbstractFileSystem> = { | |||
}; | |||
|
|||
startServer(connection, new VsCodeFileSystem(connection, fileSystems)); | |||
fetchMetafieldDefinitions(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should somehow be injected in startServer's fetchMetafieldsForURI
injection.
IIRC the metafields should be loaded per theme root, not per workspace.
I don't 100% know how the shopify cli works and if there's an auth per theme, but I don't think someone running a monorepo will necessarily have the same metafield definitions for shop A & shop B
@charlespwd Should we also only do this if we're working with themes, and not theme app extensions? |
I think so. At least until we validate we have a solution for them. Can they even use metafields? Probably? We do have a |
What are you adding in this PR?
Part of #502
What's next? Any followup issues?
.shopify/metafields.json
as part of gitignore for themes?Before you deploy
changeset