-
Notifications
You must be signed in to change notification settings - Fork 125
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
Add editor extension collection spec #3551
Conversation
Thanks for your contribution! Depending on what you are working on, you may want to request a review from a Shopify team:
|
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success1590 tests passing in 744 suites. Report generated by 🧪jest coverage report action from 3720a1e |
We detected some changes at either packages/*/src or packages/cli-kit/assets/cli-ruby/** and there are no updates in the .changeset. |
schema: EditorExtensionCollectionSchema, | ||
appModuleFeatures: (_) => ['bundling'], | ||
deployConfig: async (config, _) => { | ||
if (config.in_collection && isArrayofStrings(config.in_collection)) { |
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.
This may end up going in future. We are thinking of changing this property to includes
and then we will also have extension.include
so we will not need this logic anymore
const editorExtensionCollectionSpecification = createExtensionSpecification({ | ||
identifier: 'editor_extension_collection', | ||
schema: EditorExtensionCollectionSchema, | ||
appModuleFeatures: (_) => ['bundling'], |
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.
validation and localization to follow in other PRs
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'm pretty sure you don't need bundling
here, can you try to remove it?
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.
Ah yes, just removed it! Thanks
packages/app/src/cli/models/extensions/specifications/editor_extension_collection.ts
Show resolved
Hide resolved
handle: zod.string(), | ||
}) | ||
|
||
export const EditorExtensionCollectionSchema = BaseSchema.extend({ | ||
in_collection: zod.union([zod.array(InCollectionSchema), zod.array(zod.string())]).optional(), | ||
include: zod.array(IncludeSchema).optional(), |
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.
Both optional so you can use either one of them without needing to declare the other. We will add validation to make sure at least one of them exists
packages/app/src/cli/models/extensions/specifications/editor_extension_collection.ts
Outdated
Show resolved
Hide resolved
load collection in cli add tests InCollection interface remove check for is array in_collection optional remove bundling update in collection logic update to includes and include update logic
d89f8dd
to
3720a1e
Compare
WHY are these changes introduced?
Fixes https://github.com/Shopify/core-issues/issues/66051
Also check your spin branch out to
https://github.com/Shopify/shopify/pull/490149
https://github.com/Shopify/partners/pull/53863
WHAT is this pull request doing?
Adding new extension collection spec to the cli
How to test your changes?
To have an extension code locally clone Shopify/customer-accounts-ui-extension-dev and also clone CLI locally
spin up customer-accounts-ui-extension-dev
'editor_extension_collection'
for example the link looks like https://partners.build-extension-collections.oluwatimi-owoturo.us.spin.dev/internal/organizations/1You should see
customer-accounts-ui-extension-dev
in_collection
array. You can also try using the other method (extensions.in_collection) in the template to reference the extension handle and make sure both are not included at the same time.shopify_dev.app_static_extension_configs
tablePost-release steps
This will not be visible in prod because it is behind a beta flag
Measuring impact
How do we know this change was effective? Please choose one:
Checklist
dev
ordeploy
have been reflected in the internal flowchart.