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

[Feature] Enable specifying semver ranges instead of a specific Node version #32

Open
sheerlox opened this issue Jan 17, 2025 · 1 comment

Comments

@sheerlox
Copy link
Owner

sheerlox commented Jan 17, 2025

If no installed version (whether system (#31) or Nodelix) is available -> install the latest version satisfying the range.

If Nodelix is used by multiple libraries a project depends on, maximizing the supported Node version range from each library will make installation faster and take less disk space.

@sheerlox sheerlox changed the title [Feature] Enable specifying semver ranges for the Node version [Feature] Enable specifying semver ranges instead of a specific Node version Jan 17, 2025
@sheerlox
Copy link
Owner Author

sheerlox commented Feb 3, 2025

Oh, wait ... even better: enable specifying auto as a version, which would determine the most recent Node.js version to install in order be compatible with all packages engine spec 👀

I think this is a good idea because specifying a Node version in our config.exs is duplicating already existing information (library engine compatibility).

This would involve something like:

  • detecting all packages (and their versions) from package.json files & mix nodelix.npm install calls
  • fetching their respective package.json files from npm
  • resolving the optimal Node version/range to use for compatibility.

Resolving to a range would still be preferable for the same reason this issue exists.

Given all of this is a bit operationally intensive, it would probably benefit from being a separate Mix task that updates the Node version/range in the config, and that could be run in CI for dependency update PRs (e.g. Renovate/Dependabot).

Note: just dropping random thoughts tbh 😆

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