Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manifest field #5

Closed
arcanis opened this issue Aug 27, 2020 · 2 comments
Closed

Manifest field #5

arcanis opened this issue Aug 27, 2020 · 2 comments

Comments

@arcanis
Copy link
Contributor

arcanis commented Aug 27, 2020

The current implementation uses engines.pm in order to define the package manager, but it's perhaps not the best location to store this information. The engines field intends to specify which versions of the package manager are capable of properly installing the package, not the project (the distinction matters: the project is whatever you clone, whereas the package is whatever people consume when running yarn add my-package).

In particular, engines are typically checked even on transitive dependencies whereas we would want the pmm definition to only be considered for the top-level manifest, and ignored for all others. It also avoids potential issues with older package managers that would print a warning with projects that would list an "unknown engine field".

Of note: package managers have their own fields in the engines field (respectively engines.npm, engines.yarn, engines.pnpm). Those would be completely ignore by pmm, which would only care about the top-level field. So, for instance, if you wish to indicate that your package needs to be installed by Yarn 1.20+ or npm 6+ and that its project needs to be developed using Yarn 1.22.4, you'd write:

{
  "packageManager": "[email protected]",
  "engines": {
    "yarn": "^1.20",
    "npm": "^6"
  }
}

Note however that I personally wouldn't recommend using engines.yarn (or any of the others) - a package should be compatible with every reasonable package manager.

@arcanis
Copy link
Contributor Author

arcanis commented Aug 27, 2020

cc @ChALkeR

@arcanis
Copy link
Contributor Author

arcanis commented Sep 8, 2020

Renamed engines.pm to packageManager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant