mirror of
https://github.com/denoland/deno.git
synced 2025-01-11 08:33:43 -05:00
40a72f3555
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. |
||
---|---|---|
.. | ||
builtin_module_module | ||
cached_only | ||
cached_only_after_first_run | ||
check_errors | ||
child_process_fork_test | ||
cjs_local_global_decls | ||
cjs_module_export_assignment | ||
cjs_module_export_assignment_number | ||
cjs_reexport_collision | ||
cjs_sub_path | ||
cjs_this_in_exports | ||
cjs_with_deps | ||
cjs_yargs | ||
compare_globals | ||
conditional_exports | ||
dual_cjs_esm | ||
dynamic_import | ||
env_var_re_export | ||
error_version_after_subpath | ||
esm | ||
esm_import_cjs_default | ||
import_map | ||
info | ||
invalid_package_name | ||
lock_file | ||
mixed_case_package_name | ||
no_npm_after_first_run | ||
no_types_in_conditional_exports | ||
nonexistent_file | ||
peer_deps_with_copied_folders | ||
registry | ||
reload | ||
remote_npm_specifier | ||
require_added_nm_folder | ||
require_json | ||
sub_paths | ||
tarball_with_global_header | ||
translate_cjs_to_esm | ||
types_ambient_module | ||
deno_cache.out | ||
deno_run_cjs.out | ||
deno_run_cowsay.out | ||
deno_run_cowthink.out | ||
deno_run_esm.out | ||
deno_run_no_ext.out | ||
deno_run_non_existent.out | ||
README.md |
npm test data
This folder contains test data for npm specifiers.
Registry
The registry is served by the test server (server in test_util) at
http://localhost:4545/npm/registry/ via the ./registry
folder.
Updating with real npm packages
- Set the
DENO_TEST_UTIL_UPDATE_NPM=1
environment variable - Run the test and it should download the packages.
Using a custom npm package
- Add the custom package to
./registry/@denotest
- Reference
npm:@denotest/<your-package-name>
in the tests.