Skip to content

Allow package.json to be located in subdirectories by processing paths #1379

Open
@MaxiGalaxi

Description

@MaxiGalaxi

Description

Enable the NpmProvider to locate and process package.json files that are not in the root directory by correctly handling and resolving paths from the project root.

Possible Solution

npm_provider.py:

@property
def package_file(self) -> Path:
    package_path = next(
        (Path(p) for p in self.config.settings["version_files"] if p.endswith("package.json")),
        None
    )
    if package_path is None:
        raise FileNotFoundError("No package.json found in version_files")
    return package_path

Additional context

No response

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @MaxiGalaxi

        Issue actions

          Allow package.json to be located in subdirectories by processing paths · Issue #1379 · commitizen-tools/commitizen