Open
Conversation
- Add @shopify/toml-patch for TOML manipulation - Create utilities for API version management and schema updates - Add check-api-version.js to auto-update extension API versions - Add configure-extension-directories.js to manage app config - Add update-schemas.js script for schema updates with CLI - Update README with simplified instructions - Add yarn commands for API version maintenance - Add .gitignore entry for shopify.app.toml
- Rename script file to better reflect its actual function - Update package.json script reference
andrewhassan
reviewed
May 7, 2025
Comment on lines
+12
to
+14
| const date = dayjs(); | ||
| const year = date.year(); | ||
| const month = date.month(); |
Contributor
There was a problem hiding this comment.
We can use JS dates directly instead of bringing in a new dependency.
Suggested change
| const date = dayjs(); | |
| const year = date.year(); | |
| const month = date.month(); | |
| const date = new Date(); | |
| const year = date.getFullYear(); | |
| const month = date.getMonth(); |
| import { updateTomlValues } from '@shopify/toml-patch'; | ||
|
|
||
| const ROOT_DIR = '.'; | ||
| const FILE_PATTERN = '**/shopify.extension.toml.liquid'; |
Contributor
There was a problem hiding this comment.
Do we only want to update the versions for Liquid files? This would exclude the sample apps.
| console.log(`Updated API version in ${filePath} to ${latestVersion}`); | ||
|
|
||
| } catch (error) { | ||
| console.error(`Error updating API version in ${filePath}:`, error.message); |
Contributor
There was a problem hiding this comment.
It seems like some functions run into this error because the liquid placeholder logic doesn't create a valid TOML file. For example order-routing/rust/location-rules/default/shopify.extension.toml.liquid:
{% if uid %}uid = "{{ uid }}"{% endif %}
Maybe we need a different approach that doesn't really expect a valid TOML file. Perhaps a simple find/replace would be sufficient here (assuming nobody does any Liquid shenanigans with the API version).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds utilities for managing API versions and function schemas:
Changes
Benefits