Closed windaishi closed 3 months ago
We decided against the approach taken in https://github.com/pickware/scs-commander/pull/36.
We should instead try to build a transform which takes a composer-style semver constraint with a Shopware generation version as an input, and outputs a version constraints which is compliant with https://github.com/npm/node-semver after stripping the Shopware generation. This probably entails tokenizing the original constraints, stripping the generation from version literals and transforming some constraint expressions (such as ~6.x.y.z
) into equivalent represenations using range expressions.
We have decided (Teammeeting 01.12.2021) to implement the required version compare functionality as a separate npm-package shopware-version-compare
, which should be based on https://github.com/omichelsen/compare-versions. Our package will only provide the necessary subset of all composer version expression and will be used by the scs-commander as well as the business platform (in the near future).
@stefanheppenheimer Post ist nicht mehr ganz aktuell.
Folgendermaßen soll das Problem gelöst werden:
npm
-Package erstellt werden, welches composer-version-constraint-evaluator
heißt. Dieses soll Version-Constraints wie die von Composer auswerten können.shopware-plugins
nutzen.versionSatisfiesConstraint(version: string, constraint: string): bool
scs-commander
verwendet werden.Nach einer Entscheidung mit @svenmuennich wollen wir den Ansatz dieses issues nicht weiter verfolgen. Siehe Folgeissue in shopware-plugins: https://github.com/pickware/shopware-plugins/issues/6897
When uploading a plugin that specifies it's compatibility to
shopware/core
with a version range like: "~6.3.0.2" the scs-commander fails with an error message.To fix this, the npm package
semver
can't be used because the syntax for composer is slightly different and alsosemver
does not support 4 version digits.We need to implement our own version constraint checking.