Skip to content

Infer npm dependencies from package.json #188

@cowboyd

Description

@cowboyd

npm specifies its direct dependencies in package.json as well as other types of dependencies like peerDependencies, devDependencies, and optionalDependencies, and so it should serve as the primary source of truth for what a package's dependencies are. Otherwise you end up needing to manually keep this information in sync with .changes/config.json in order have correct behavior.

I've already run afoul of this twice in @simulacrum where I thought that changing a dependency would be reflected in the publishing result.

{
    "@simulacrum/server": {
      "path": "./packages/server",
      "manager": "javascript",
      "dependencies": ["@simulacrum/ui", "@simulacrum/client"]
    }
}

All the information we need is there: the type of dependency (javascript), the path to package.json (packages/server/packages.json), and so it should be straightforward to find the value of internal dependencies on @simulacrum/ui, and @simulacrum/client from the source.

This change ought to make it simpler to reckon with other types of dependencies since a separate field would not need to be added for "devDependencies", or for more npm-specific dependency types like "optional" and "peer"

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions