Skip to content

Conversation

Kocal
Copy link
Member

@Kocal Kocal commented Sep 11, 2025

Q A
Bug fix? no
New feature? yes
Docs? no
Issues Fix #...
License MIT

Following #3073 (comment)

before:

    "dependencies": [
        {
            "type": "php",
            "name": "twig/extra-bundle"
        },
        {
            "type": "php",
            "name": "twig/html-extra",
            "version": "^3.12.0"
        },
        {
            "type": "php",
            "name": "tales-from-a-dev/twig-tailwind-extra"
        },
        {
            "type": "npm",
            "name": "el-transition"
        },
        {
            "type": "importmap",
            "package": "el-transition"
        },
        {
            "type": "recipe",
            "name": "Button"
        }
    ]

after:

    "dependencies": {
        "recipe": [
            "Button"
        ],
        "composer": [
            "twig/extra-bundle",
            "twig/html-extra:^3.12.0",
            "tales-from-a-dev/twig-tailwind-extra"
        ],
        "npm": [
            "el-transition"
        ],
        "importmap": [
            "el-transition"
        ]
    }

This pull request refactors the dependency structure for all shadcn kit manifest files and updates the schema-kit-recipe-v1.json schema to match. The main goal is to simplify and standardize how dependencies are declared, moving from an array of objects to a categorized object of arrays. This makes dependencies easier to read, maintain, and process programmatically.

Manifest dependency refactor:

  • All manifest.json files under src/Toolkit/kits/shadcn/ now declare dependencies as an object with keys like composer, npm, importmap, and recipe, each mapping to an array of package names. This replaces the previous verbose array-of-objects format. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19]

Schema update:

  • The src/Toolkit/schema-kit-recipe-v1.json schema is updated to reflect the new dependency format. The dependencies property is now an object with keys for each dependency type, each containing an array of strings. The schema also removes the type property and the examples-dir property, and updates descriptions for clarity.

These changes ensure consistency across all kit manifests and make the schema and manifests easier to extend and validate in the future.

@Kocal Kocal self-assigned this Sep 11, 2025
@carsonbot carsonbot added Feature New Feature Toolkit Status: Needs Review Needs to be reviewed labels Sep 11, 2025
@Kocal Kocal force-pushed the toolkit-rework-manifest-dependencies branch from f0956ed to 5fa3353 Compare September 11, 2025 07:46
@Kocal Kocal requested a review from Copilot September 11, 2025 07:48
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR transforms the JSON schema structure for Recipe dependencies from an array-based format to an object-based format. The change simplifies dependency specification by grouping dependencies by type (recipe, composer, npm, importmap) and using simpler string formats for package specifications instead of verbose objects.

Key changes:

  • Replace array of dependency objects with categorized object structure
  • Rename Version class to ConstraintVersion for better clarity
  • Update dependency parsing to handle inline version constraints (e.g., package:^1.0.0)
  • Modernize all manifest.json files across the shadcn kit

Reviewed Changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Toolkit/src/Recipe/RecipeManifest.php Core parsing logic updated to handle new dependency object format
src/Toolkit/src/Dependency/ConstraintVersion.php Renamed from Version class for better semantic clarity
src/Toolkit/src/Dependency/PhpPackageDependency.php Updated to use ConstraintVersion instead of Version
src/Toolkit/src/Dependency/NpmPackageDependency.php Updated to use ConstraintVersion instead of Version
src/Toolkit/schema-kit-recipe-v1.json Updated JSON schema to reflect new dependency structure
Test files Updated to reflect new dependency format and class naming
Kit manifest files Migrated from old array format to new object format

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Kocal Kocal force-pushed the toolkit-rework-manifest-dependencies branch from 5fa3353 to df8bd64 Compare September 11, 2025 07:50
@Kocal Kocal merged commit 3daf951 into symfony:2.x Sep 11, 2025
29 checks passed
@Kocal Kocal deleted the toolkit-rework-manifest-dependencies branch September 11, 2025 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New Feature Status: Needs Review Needs to be reviewed Toolkit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants