Skip to content

[Toolkit] Validate recipe dependency versions and Importmap package names - #4373

Open
Kocal wants to merge 1 commit into
symfony:2.xfrom
Kocal:toolkit/dependency-version-validation
Open

Kocal wants to merge 1 commit into
symfony:2.xfrom
Kocal:toolkit/dependency-version-validation

Conversation

@Kocal

@Kocal Kocal commented Nov 26, 2026

Copy link
Copy Markdown
Member
Q A
Bug fix? yes
New feature? no
Deprecations? no
Documentation? no
Issues
License MIT

Recipe dependencies are only checked for their package name. The version constraint of a Composer or NPM dependency, and the name of an Importmap package, accept any string, and they are printed as is in the "Next steps" commands of ux:install.

The manifest validation now accepts a version constraint only when it is made of real constraint parts (operators, versions, *, x, dev-*, latest) joined by a space, a comma or |/||. Importmap package names follow the NPM name rule, with an optional path. The NPM name rule no longer accepts a leading - or a character between 9 and ~, which the previous character range allowed by mistake.

ux:install also escapes the console markup in the suggested commands and shell-quotes the arguments that need it, such as >=1.2 <2.0. All first-party kit manifests still load.

Merge-up to 3.x: the dependencies are parsed by DependencyParser instead of RecipeManifest::fromJson(). It builds the same ConstraintVersion and ImportmapPackageDependency objects, so the checks in their constructors carry over. Apply the formatPackages() change to the 3.x InstallCommand, add : void to the new test methods, and move the CHANGELOG line under the unreleased 3.x version. Not run on 3.x.

…ames

| Q              | A
| -------------- | ---
| Bug fix?       | yes
| New feature?   | no
| Deprecations?  | no
| Documentation? | no
| Issues         |
| License        | MIT

Recipe dependencies are only checked for their package name. The version constraint of a Composer or NPM dependency, and the name of an Importmap package, accept any string, and they are printed as is in the "Next steps" commands of `ux:install`.

The manifest validation now accepts a version constraint only when it is made of real constraint parts (operators, versions, `*`, `x`, `dev-*`, `latest`) joined by a space, a comma or `|`/`||`. Importmap package names follow the NPM name rule, with an optional path. The NPM name rule no longer accepts a leading `-` or a character between `9` and `~`, which the previous character range allowed by mistake.

`ux:install` also escapes the console markup in the suggested commands and shell-quotes the arguments that need it, such as `>=1.2 <2.0`. All first-party kit manifests still load.

Merge-up to 3.x: the dependencies are parsed by `DependencyParser` instead of `RecipeManifest::fromJson()`. It builds the same `ConstraintVersion` and `ImportmapPackageDependency` objects, so the checks in their constructors carry over. Apply the `formatPackages()` change to the 3.x `InstallCommand`, add `: void` to the new test methods, and move the CHANGELOG line under the unreleased 3.x version. Not run on 3.x.
@carsonbot carsonbot added Bug Bug Fix Toolkit Status: Needs Review Needs to be reviewed labels Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Bug Fix Status: Needs Review Needs to be reviewed Toolkit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants