feat: Eslint for Magento driver exports in package.json#4447
Draft
joannalauu wants to merge 3 commits intodevelopfrom
Draft
feat: Eslint for Magento driver exports in package.json#4447joannalauu wants to merge 3 commits intodevelopfrom
exports in package.json#4447joannalauu wants to merge 3 commits intodevelopfrom
Conversation
exports in package.json
03d22a0 to
27476cb
Compare
joannalauu
commented
Apr 22, 2026
| const VERSION_FROM_KEY_RE = /^magento-(\d+\.\d+\.\d+)$/; | ||
| const VERSION_DIR_RE = /^\d+\.\d+\.\d+$/; | ||
|
|
||
| function readPackageVersions(pkgDir) { |
Contributor
Author
There was a problem hiding this comment.
Different packages have a different set of Magento versions. For example, order has versions 2-4-0 and 2-4-1 while external-router has versions 2.4.1, 2.4.2, 2.4.3. There is unresolved complexity on whether we should define different versions for different packages, or standardize versions across all packages so that we can set the version once for all packages
joannalauu
commented
Apr 22, 2026
Comment on lines
+14
to
+16
| const MAGENTO_KEY_RE = /^magento-\d+\.\d+\.\d+$/; | ||
| const VERSION_FROM_KEY_RE = /^magento-(\d+\.\d+\.\d+)$/; | ||
| const VERSION_DIR_RE = /^\d+\.\d+\.\d+$/; |
Contributor
Author
There was a problem hiding this comment.
This currently expects the folder of the versioned Magento driver to be named as driver/magento/<v>.<v>.<v>. However, in the order package, it is named as driver/magento/<v>-<v>-<v>, which deviates from expected pattern
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.
PR Checklist
PR Type
Current behavior
Fixes: #4436
New behavior
Provides the following eslint errors to ensure naming consistency in Magento driver
exportsin package.json:invalidKey: Key{{key}}is not a valid Magento version condition. Expectedmagento-<major>.<minor>.<patch>missingVersion: Missing Magento version condition{{key}}. All@daffodilpackages exposing a Magento driver must declare the same set of versionsentryNotObject: Condition{{key}}must be an object withtypesanddefaultfieldsmissingField: Condition{{key}}is missing required field{{field}}- this checks that there are exports conditions for all Magento driver versions in that packagetypesPathMismatch: Condition{{key}}has atypespath that does not reference./driver/magento/{{version}}/defaultPathMismatch: Condition{{key}}has adefaultpath that does not end with-magento-{{version}}.mjsBreaking change?
Additional context