summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/npm
AgeCommit message (Collapse)Author
2022-12-19fix(npm): conditional exports with --node-modules-dir (#17111)Bartek Iwańczuk
This commit fixes conditional exports in `require()` implementation if `--node-modules-dir` flag is used.
2022-12-15fix(npm): improve exports resolution when type checking (#17071)David Sherret
Closes #17012
2022-12-05fix(npm): dependency types were sometimes not being resolved when package ↵David Sherret
had no types entry (#16958) Closes #16957
2022-12-01chore(npm): fix types tests (#16882)David Sherret
2022-11-30fix(npm): improve package.json exports support for types (#16880)David Sherret
2022-11-29fix(ext/node): allow absolute path in createRequire (#16853)Yoshiya Hinosawa
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-11-28fix(npm): don't resolve JS files when resolving types (#16854)David Sherret
Closes #16851
2022-11-27fix(npm): ensure npm package downloaded once per run when using `--reload` ↵David Sherret
(#16842)
2022-11-25fix(npm): better error message when attempting to use typescript in npm ↵David Sherret
packages (#16813)
2022-11-24fix(npm/types): resolve main entrypoint declaration file when no types entry ↵David Sherret
(#16791) Closes #16782
2022-11-24fix(npm/check): prioritize exports over types entry (#16788)David Sherret
2022-11-22fix: Make npm packages works with import maps (#16754)Bartek Iwańczuk
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-11-19fix(npm): handle directory resolution when resolving declaration files (#16706)David Sherret
Also fixes resolving specifiers like `./something.generated` in declaration files. Closes #16695
2022-11-19fix(ext/node): handle URL in createRequire (#16682)Yoshiya Hinosawa
2022-11-16fix(npm): using types for packages with subpath (#16656)Bartek Iwańczuk
For CommonJS packages we were not trying different extensions for files specified as subpath of the package ([package_name]/[subpath]). This commit fixes that.
2022-11-16fix(npm): support non-all lowercase package names (#16669)David Sherret
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-16fix(npm): don't fail if conditional exports don't contains types (#16651)Bartek Iwańczuk
If resolving types for an npm package, we didn't find "types" entry in the conditional exports declaration we were falling-through to regular resolution, instead of short-circuiting and giving up on resolving types, which might lead to unwarranted errors. Closes https://github.com/denoland/deno/issues/16649
2022-11-15fix(npm): probing for files that have a file stem (#16641)Bartek Iwańczuk
2022-11-13feat(npm): require --unstable for npm specifiers in remote modules (#16612)David Sherret
2022-11-11perf: more efficient `deno cache` and npm package info usage (#16592)David Sherret
1. There was a lot of cloning going on with `NpmPackageInfo`. This is now stored in an `Arc<NpmPackageInfo>` and cloning only happens on the individual version. 2. The package cache is now cleared from memory after resolution. 3. This surfaced a bug in `deno cache` and I noticed it can be more efficient if we have multiple root specifiers if we provide all the specifiers as roots.
2022-11-10feat: remove --unstable flag requirement for npm: specifiers (#16473)Bartek Iwańczuk
This commit makes "npm:" specifiers not require "--unstable" flag. At the moment some APIs used by Node polyfills still require "--unstable" which will be addressed in follow up PRs.
2022-11-08feat(unstable/npm): support peer dependencies (#16561)David Sherret
This adds support for peer dependencies in npm packages. 1. If not found higher in the tree (ancestor and ancestor siblings), peer dependencies are resolved like a dependency similar to npm 7. 2. Optional peer dependencies are only resolved if found higher in the tree. 3. This creates "copy packages" or duplicates of a package when a package has different resolution due to peer dependency resolution—see https://pnpm.io/how-peers-are-resolved. Unlike pnpm though, duplicates of packages will have `_1`, `_2`, etc. added to the end of the package version in the directory in order to minimize the chance of hitting the max file path limit on Windows. This is done for both the local "node_modules" directory and also the global npm cache. The files are hard linked in this case to reduce hard drive space. This is a first pass and the code is definitely more inefficient than it could be. Closes #15823
2022-11-06fix(npm): fix CJS resolution with local node_modules dir (#16547)Bartek Iwańczuk
This commit fixes CJS resolution when there's a local "node_modules/" directory. Before this commit relative imports from CJS files where resolved relative to root directory of the package instead of relative to referrer file.
2022-11-02fix(npm): add `console` global for node environment (#16519)David Sherret
This global is already isolated to node during type checking. Closes #16518
2022-11-02fix(lock): autodiscovery of lockfile (#16498)Bartek Iwańczuk
This commit adds autodiscovery of lockfile. This only happens if Deno discovers the configuration file (either "deno.json" or "deno.jsonc"). In such case Deno tries to load "deno.lock" file that sits next to the configuration file, or creates one for user if the lockfile doesn't exist yet. As a consequence, "--lock" and "--lock-write" flags had been updated. "--lock" no longer requires a value, if one is not provided, it defaults to "./deno.lock" resolved from the current working directory. "--lock-write" description was updated to say that it forces to overwrite a lockfile. Autodiscovery is currently not handled by the LSP.
2022-10-31feat(unstable/npm): `deno info --json` support for npm specifiers (#16472)David Sherret
2022-10-28feat: support npm specifiers in `deno info` for display text output only ↵David Sherret
(#16470)
2022-10-27chore(npm): add explicit tests for `module.exports` assignment with type ↵David Sherret
checking (#16435)
2022-10-25chore: fix flaky esm_module_deno_test test (#16419)David Sherret
2022-10-25fix(npm): add support for npm packages in lock files (#15938)Bartek Iwańczuk
This commit adds support for npm packages in the lock file.
2022-10-21feat(unstable/npm): initial type checking of npm specifiers (#16332)David Sherret
2022-10-17feat(unstable/npm): support providing npm dist-tag in npm package specifier ↵David Sherret
(#16293)
2022-10-03feat(unstable): add support for npm specifier cli arguments for 'deno cache' ↵Bartek Iwańczuk
(#16141) This commit adds support for npm specifier in "deno cache" subcommand. ``` $ deno cache --unstable npm:vite npm:chalk https://deno.land/std/http/file_server.ts ``` Besides downloading requested npm package(s), it will also download necessary code from "std/node/".
2022-10-03fix(npm): better error is version is specified after subpath (#16131)Bartek Iwańczuk
2022-10-03fix(npm): panic on invalid package name (#16123)Bartek Iwańczuk
2022-10-01fix(npm): handle json files in require (#16125)Bartek Iwańczuk
2022-09-28feat(npm): functionality to support child_process.fork (#15891)David Sherret
2022-09-22feat(npm): add flag for creating and resolving npm packages to a local ↵David Sherret
node_modules folder (#15971)
2022-09-22feat(npm): add support for --reload=npm: and --reload=npm:<package> (#15972)Bartek Iwańczuk
2022-09-17fix(ext/node): fix builtin module module (#15904)Yoshiya Hinosawa
2022-09-14fix(npm): binary entrypoint for .js or no extension (#15900)Bartek Iwańczuk
2022-09-12fix(npm): use shim from deno_node crate for 'module' built-in module (#15881)Bartek Iwańczuk
2022-09-12fix(npm): support cjs resolution of package subpath with package.json (#15855)David Sherret
2022-09-12fix(npm): align Deno importing Node cjs with Node esm importing cjs (#15879)David Sherret
2022-09-10fix(npm): align Node esm code importing cjs with Node (#15838)David Sherret
2022-09-10fix(npm): remove export binding to match node (#15837)David Sherret
2022-09-08fix(npm): recursive translation of reexports, remove window global in node ↵Bartek Iwańczuk
code (#15806) Co-authored-by: David Sherret <dsherret@gmail.com>
2022-09-07feat: add --no-npm flag to disable npm: imports (#15673)Bartek Iwańczuk
This commit adds "--no-npm" flag, it's similar to "--no-remote" flag. This flag makes Deno error out if "npm:" specifier is encountered.
2022-09-03fix(npm): add more context to errors when file doesn't exist (#15749)Bartek Iwańczuk
2022-09-02fix(npm): correct exact matching of pre-release versions (#15745)David Sherret