10000 Expected Version Provider Behavior - npm should update package.json, package-lock.json if present, and npm-shrinkwrap.json if present. · Issue #804 · commitizen-tools/commitizen · GitHub
[go: up one dir, main page]

Skip to content
Expected Version Provider Behavior - npm should update package.json, package-lock.json if present, and npm-shrinkwrap.json if present. #804
Closed
@davidlday

Description

@davidlday

Description

NomProvider currently only updates package.json. However, it is common practice to check both package.json and package-lock.json into git / scm, thus both files should be updated simultaneously.

Possible Solution

Using NpmProvider should by default update both package.json and package-lock.json, with the option of skipping package-lock.json.

Another option would be to have JsonProvider update multiple files using with a unique JSON expression per file. This would allow developers to implement on their own. Configuration could look something like:

[tool.commitizen]
version_provider = "json"
version_files = [
    "package.json:.version",
    "package-lock.json:.version",
    "package-lock.json:.package.''.version"
]

Additional context

See issue #659

Additional context

No response

UPDATED: Fixed the JSON expressions to match what should really be matched.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0