Skip to content

Look deeper for package.json? #63

Closed
@darvanen

Description

@darvanen

Not all php libraries keep their JS dependencies at the root of the library, instead opting to have them contained in a subfolder such as app or theme.

This issue is to ask whether or not it would possible and desirable to scan the entire module for a package.json file to add to the root project.

What steps will reproduce the problem?

Create a Drupal project and require foxy:

composer create-project drupal/recommended-project test_foxy_collapsiblock
composer require foxy/foxy

Require a module with foxy enabled and package.json below the root (theme folder in this case)

composer require drupal/collapsiblock:4.x-dev#b381e7a

What is the expected result?

Collapsiblock should be built as a dependency in the project's root package.json file:

{
    "license": "GPL-2.0-or-later",
    "dependencies": {
        "@composer-asset/drupal--collapsiblock": "file:./vendor/foxy/composer-asset/drupal/collapsiblock"
    }
}

What do you get instead?

Empty dependencies:

{
    "license": "GPL-2.0-or-later"
}

Additional info

Q A
Version 1.3.0
PHP version 8.1
Operating system Mac OS Sonoma 14.4.1 (23E224)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions