pickware / scs-commander

A CLI tool for managing plugins in the Shopware Community Store.
MIT License
13 stars 2 forks source link

For Shopware 6 plugins: Version check does not support composer version ranges #35

Closed windaishi closed 3 months ago

windaishi commented 4 years ago

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 also semver does not support 4 version digits.

We need to implement our own version constraint checking.

fixpunkt commented 4 years 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.

stefanheppenheimer commented 2 years ago

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).

https://www.notion.so/pickware/Teammeeting-01-12-2021-Zust-ndigkeit-POS-Releases-Version-Compare-im-SCS-Commander-bfd8c4dcd75741d99db587b47f1dd82c

windaishi commented 6 months ago

@stefanheppenheimer Post ist nicht mehr ganz aktuell.

Folgendermaßen soll das Problem gelöst werden:

  1. Es soll ein neues npm-Package erstellt werden, welches composer-version-constraint-evaluator heißt. Dieses soll Version-Constraints wie die von Composer auswerten können.
  2. Für den Anfang sollen nur bestimmte Constraints unterstützt werden, und zwar genau diese, welche wir gerade im Repo shopware-plugins nutzen.
  3. Wenn das Paket eine Contraint auswerten soll, die es nicht unterstützt, soll ein Fehler geworfen werden.
  4. Das Paket wird eine zentrale Funktion besitzen, welche folgendes Interface besitzt: versionSatisfiesConstraint(version: string, constraint: string): bool
  5. Das Paket, was @stefanheppenheimer nennt, zu nutzen bringt wahrscheinlich keinen Vorteil.
  6. Das Paket soll dann im scs-commander verwendet werden.
hanneswernery commented 3 months ago

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