1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00
denoland-deno/tests/specs/install
Nathan Whitaker 275418473e
fix(install): store tags associated with package in node_modules dir (#26000)
Fixes #25998. Fixes https://github.com/denoland/deno/issues/25928.

Originally I was just going to make this an error message instead of a
panic, but once I got to a minimal repro I felt that this really should
work.

The panic occurs when you have `nodeModulesDir: manual` (or a
package.json present), and you have an npm package with a tag in your
deno.json (see the spec test that illustrates this).

This code path only actually executes when trying to choose an
appropriate package version from `node_modules/.deno`, so we should be
able to fix it by storing some extra data at install time.

The fix proposed here is to repurpose the `.initialized` file that we
store in `node_modules` to store the tags associated with a package.
Basically, if you have a version requirement with a tag (e.g.
`npm:chalk@latest`), when we set up the node_modules folder for that
package, we store the tag (`latest`) in `.initialized`. Then, when doing
BYONM resolution, if we have a version requirement with a tag, we read
that file and check if the tag is present.

The downside is that we do more work when setting up `node_modules`. We
_could_ do this only when BYONM is enabled, but that would have the
downside of needing to re-run `deno install` when you switch from auto
-> manual, though maybe that's not a big deal.
2024-10-02 17:16:46 -07:00
..
alias_pkg_json_and_deno_json_jsr_pkg fix(byonm): resolve npm deps of jsr deps (#25399) 2024-09-04 14:00:44 +00:00
alias_pkg_json_and_deno_json_npm_pkg fix: remove recently added deno.json node_modules aliasing (#25542) 2024-09-09 20:19:29 +00:00
byonm_jsr_npm_dep fix(byonm): resolve npm deps of jsr deps (#25399) 2024-09-04 14:00:44 +00:00
byonm_run_tag_after_install fix(install): store tags associated with package in node_modules dir (#26000) 2024-10-02 17:16:46 -07:00
future_install_add_dist_tag chore: remove DENO_FUTURE=1 from spec tests (#25329) 2024-08-31 21:25:32 +00:00
future_install_global chore: remove DENO_FUTURE=1 from spec tests (#25329) 2024-08-31 21:25:32 +00:00
future_install_local_add_deno chore: remove DENO_FUTURE=1 from spec tests (#25329) 2024-08-31 21:25:32 +00:00
future_install_local_add_npm chore: remove DENO_FUTURE=1 from spec tests (#25329) 2024-08-31 21:25:32 +00:00
future_install_local_deno feat: add --allow-import flag (#25469) 2024-09-26 01:50:54 +00:00
future_install_node_modules chore: remove DENO_FUTURE=1 from spec tests (#25329) 2024-08-31 21:25:32 +00:00
future_install_node_modules_tag chore: remove DENO_FUTURE=1 from spec tests (#25329) 2024-08-31 21:25:32 +00:00
install_add_dev feat(add/install): Flag to add dev dependency to package.json (#25495) 2024-09-07 02:22:27 -07:00
install_deprecated_package fix(cli): Warn on not-run lifecycle scripts with global cache (#25786) 2024-09-24 19:23:57 +00:00
install_entrypoint feat(install): deno install with entrypoint (#25411) 2024-09-04 13:06:16 -07:00
install_single_http_url_without_global_flag fix(install): recommend using deno install -g when using a single http url (#25388) 2024-09-03 17:55:29 +02:00
move_after_install chore: remove DENO_FUTURE=1 from spec tests (#25329) 2024-08-31 21:25:32 +00:00
non_existent_optional_peer fix: Update deno_npm to fix deno install with crossws (#25837) 2024-09-24 02:12:48 +00:00
workspace_member_with_tag_dep fix(install): compare versions directly to decide whether to create a child node_modules dir for a workspace member (#26001) 2024-10-02 15:11:43 -07:00
workspace_node_modules_not_exists fix(install): Make sure target node_modules exists when symlinking (#25494) 2024-09-06 19:08:56 +00:00