diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-10-25 14:39:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-25 14:39:00 -0400 |
commit | be97170a193e8cecc5ce03ecd3c1d0add4a06bf7 (patch) | |
tree | fab7d266e208db93dcf0870dda70f7da56ade735 /test_util/src/npm.rs | |
parent | 093b3eee58181ec45839d0fe10b8157326a102b2 (diff) |
feat(unstable): ability to `npm install` then `deno run main.ts` (#20967)
This PR adds a new unstable "bring your own node_modules" (BYONM)
functionality currently behind a `--unstable-byonm` flag (`"unstable":
["byonm"]` in a deno.json).
This enables users to run a separate install command (ex. `npm install`,
`pnpm install`) then run `deno run main.ts` and Deno will respect the
layout of the node_modules directory as setup by the separate install
command. It also works with npm/yarn/pnpm workspaces.
For this PR, the behaviour is opted into by specifying
`--unstable-byonm`/`"unstable": ["byonm"]`, but in the future we may
make this the default behaviour as outlined in
https://github.com/denoland/deno/issues/18967#issuecomment-1761248941
This is an extremely rough initial implementation. Errors are
terrible in this and the LSP requires frequent restarts. Improvements
will be done in follow up PRs.
Diffstat (limited to 'test_util/src/npm.rs')
-rw-r--r-- | test_util/src/npm.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test_util/src/npm.rs b/test_util/src/npm.rs index 98308ae21..9cbadad5c 100644 --- a/test_util/src/npm.rs +++ b/test_util/src/npm.rs @@ -104,7 +104,7 @@ fn get_npm_package(package_name: &str) -> Result<Option<CustomNpmPackage>> { let mut hash_ctx = Context::new(&SHA512); hash_ctx.update(&tarball_bytes); let digest = hash_ctx.finish(); - let tarball_checksum = base64::encode(digest.as_ref()).to_lowercase(); + let tarball_checksum = base64::encode(digest.as_ref()); // create the registry file JSON for this version let mut dist = serde_json::Map::new(); |