Conversation
a720cd9 to
dbb7bd3
Compare
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success3691 tests passing in 1434 suites. Report generated by 🧪jest coverage report action from 6d16a4a |
dbb7bd3 to
3cc6b58
Compare
|
This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. |
3cc6b58 to
28c8da5
Compare
28c8da5 to
1ff8979
Compare
2c41f40 to
48c5296
Compare
|
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. |
| // Ensure shopify.app.toml exists in the app directory | ||
| await ensureAppToml(this.appDirectory) | ||
|
|
||
| // Ensure package.json exists in the app directory | ||
| await ensurePackageJson(this.appDirectory) |
There was a problem hiding this comment.
We were adding a default TOML and Json if for some reason they were not created, but that would mask actual errors.
48c5296 to
6d16a4a
Compare
|
/snapit |
|
🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm. Test the snapshot by installing your package globally: npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260205101033Caution After installing, validate the version by running just |
|
What is the impact of doing this on previous versions? Do all versions 3.84+ support the new schema? |
|
Yes, all versions above 3.84 (and much earlier) support the new schema, so this shouldn't have any impact. |
|
|
||
| get includeConfigOnDeploy() { | ||
| if (isLegacyAppSchema(this.configuration)) return false | ||
| return this.configuration.build?.include_config_on_deploy |
There was a problem hiding this comment.
I thought this was deprecated, is this only needed for 1P apps?
| export function usesLegacyScopesBehavior(config: AppConfiguration) { | ||
| if (isLegacyAppSchema(config)) return true | ||
| if (isCurrentAppSchema(config)) return config.access_scopes?.use_legacy_install_flow ?? false | ||
| return false | ||
| return (config as CurrentAppConfiguration).access_scopes?.use_legacy_install_flow === true | ||
| } |
There was a problem hiding this comment.
I think this function is not used anywhere anymore
| if (isCurrentAppSchema(this.configuration)) return this.configuration.embedded | ||
| return this.appIsLaunchable() | ||
| get appIsEmbedded(): boolean { | ||
| return (this.configuration as CurrentAppConfiguration).embedded |
There was a problem hiding this comment.
it's weird that we need to cast to CurrentAppConfiguration everywhere, we should be able to simplify this and make this.configuration of type CurrentAppConfiguration directly no?
| type LoadedAppConfigFromConfigState<TConfigState> = TConfigState extends AppConfigurationStateLinked | ||
| ? CurrentAppConfiguration | ||
| : LegacyAppConfiguration | ||
| : never |
There was a problem hiding this comment.
Seeing a change below, AppConfigurationState = AppConfigurationStateLinked then shouldn't this always be CurrentAppConfiguration? why the never?
| export type AppConfigurationStateLinked = AppConfigurationStateBasics & { | ||
| state: 'connected-app' | ||
| basicConfiguration: BasicAppConfigurationWithoutModules | ||
| isTemplateForm: boolean |
There was a problem hiding this comment.
not sure if this is a bit contradictory, a Linked app shouldn't be in template form right?
| // If the app is not linked, force a link. | ||
| if (configState.state === 'template-only' || forceRelink) { | ||
| // If forceRelink is true, force a link. | ||
| if (forceRelink) { |
There was a problem hiding this comment.
don't we need to still force a link if the app doesn't have a client id?
| localAppInfo: { | ||
| appDirectory?: string | ||
| format: 'legacy' | 'current' | ||
| format: 'current' |
There was a problem hiding this comment.
format is always current right? should we just remove the format property?
| path: joinPath(dir, '/shopify.app.toml'), | ||
| client_id: 'test-client-id', | ||
| access_scopes: {scopes: ''}, | ||
| } as AppConfiguration, |
There was a problem hiding this comment.
Why do you need the casting here? I think it should work without it :thinking_face: (same for other places where you cast to AppConfiguration)
| } | ||
|
|
||
| type AppConfigurationState = AppConfigurationStateLinked | AppConfigurationStateTemplate | ||
| type AppConfigurationState = AppConfigurationStateLinked |
There was a problem hiding this comment.
Can we just delete AppConfigurationStateLinked, and make everything just AppConfigurationState?
There was a problem hiding this comment.
And maybe instead of isTemplateForm we can call it isLinkedif client_id !== ''?
A toml might be missing the client_id and is unlinked, but doesn't mean is from a template
WHY are these changes introduced?
We have a lot of code to support the legacy app schema in the CLI and templates, but that schema only works for the template state (before linking), so it doesn't make sense to keep it.
The subscriptions-reference-app template was ready.
WHAT is this pull request doing?
client_idrequired in app schema (templates must includeclient_id = "")[access_scopes]section)How to test your changes?
npm i -g @shopify/cli@0.0.0-snapshot-20260205101033shopify app init --template=https://github.com/Shopify/shopify-app-template-react-router#add-client-id-to-tomlshopify app init --template=https://github.com/Shopify/shopify-app-template-none#add-client-id-to-tomlshopify app init --template=https://github.com/Shopify/shopify-app-template-remix#add-client-id-to-tomlshopify app init --template=https://github.com/Shopify/shopify-app-template-ruby#add-client-id-to-tomlshopify app init --template=https://github.com/Shopify/shopify-app-template-node#add-client-id-to-tomlshopify app init --template=https://github.com/Shopify/shopify-app-template-php#add-client-id-to-tomlshopify app init --template https://github.com/Shopify/shopify-app-template-react-router#include-declarative-definition-and-client-id(related to Support flexible templates forapp init#6751)shopify app dev,shopify app deploy...Measuring impact
How do we know this change was effective? Please choose one:
Checklist