1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00
denoland-deno/cli/npm
David Sherret 40a72f3555
fix(npm): support non-all lowercase package names (#16669)
Supports package names that aren't all lowercase.

This stores the package with a leading underscore (since that's not
allowed in npm's registry and no package exists with a leading
underscore) then base32 encoded (A-Z0-9) so it can be lowercased and
avoid collisions.

Global cache dir:

```
$DENO_DIR/npm/registry.npmjs.org/_{base32_encode(package_name).to_lowercase()}/{version}
```

node_modules dir `.deno` folder:

```
node_modules/.deno/_{base32_encode(package_name).to_lowercase()}@{version}/node_modules/<package-name>
```

Within node_modules folder:

```
node_modules/<package-name>
```

So, direct childs of the node_modules folder can have collisions between
packages like `JSON` vs `json`, but this is already something npm itself
doesn't handle well. Plus, Deno doesn't actually ever resolve to the
`node_modules/<package-name>` folder, but just has that for
compatibility. Additionally, packages in the `.deno` dir could have
collissions if they have multiple dependencies that only differ in
casing or a dependency that has different casing, but if someone is
doing that then they're already going to have trouble with npm and they
are asking for trouble in general.
2022-11-16 18:44:31 +00:00
..
resolution fix(npm): support dist tags specified in npm package dependencies (#16652) 2022-11-15 20:52:27 -05:00
resolvers fix(npm): support non-all lowercase package names (#16669) 2022-11-16 18:44:31 +00:00
semver fix(npm): support dist tags specified in npm package dependencies (#16652) 2022-11-15 20:52:27 -05:00
cache.rs fix(npm): support non-all lowercase package names (#16669) 2022-11-16 18:44:31 +00:00
mod.rs feat(unstable/npm): module graph derived npm specifier resolution order (#16602) 2022-11-11 21:26:14 -05:00
registry.rs fix(npm): support dist tags specified in npm package dependencies (#16652) 2022-11-15 20:52:27 -05:00
tarball.rs feat(unstable/npm): support peer dependencies (#16561) 2022-11-08 14:17:24 -05:00