1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-26 16:09:27 -05:00
denoland-deno/cli/tests/testdata/npm
David Sherret be97170a19
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.
2023-10-25 14:39:00 -04:00
..
binary_package
builtin_module_module
cached_only
cached_only_after_first_run
check_errors
child_process_fork_test
cjs-invalid-name-exports
cjs_local_global_decls
cjs_module_export_assignment
cjs_module_export_assignment_number
cjs_reexport_collision
cjs_require_esm_error
cjs_require_esm_mjs_error
cjs_sub_path refactor: remove DENO_UNSTABLE_NPM_SYNC_DOWNLOAD and custom sync functionality (#20504) 2023-09-14 17:51:28 +00:00
cjs_this_in_exports
cjs_with_deps refactor: remove DENO_UNSTABLE_NPM_SYNC_DOWNLOAD and custom sync functionality (#20504) 2023-09-14 17:51:28 +00:00
cjs_yargs refactor: remove DENO_UNSTABLE_NPM_SYNC_DOWNLOAD and custom sync functionality (#20504) 2023-09-14 17:51:28 +00:00
compare_globals refactor: remove DENO_UNSTABLE_NPM_SYNC_DOWNLOAD and custom sync functionality (#20504) 2023-09-14 17:51:28 +00:00
conditional_exports refactor: remove DENO_UNSTABLE_NPM_SYNC_DOWNLOAD and custom sync functionality (#20504) 2023-09-14 17:51:28 +00:00
create_require
d_ext fix(node): resolve file.d specifiers in npm packages (#20918) 2023-10-17 00:26:38 +09:00
directory_import
dual_cjs_esm
dynamic_import
dynamic_import_deno_ts_from_npm
dynamic_import_invalid_package_name
dynamic_import_json fix(ext/node): fix import json using npm specifier (#19723) 2023-08-01 23:20:08 +00:00
dynamic_import_reload_same_package
env_var_re_export
error_version_after_subpath
esm
esm_import_cjs_default
file_dts_dmts_dcts fix(npm): improve declaration resolution for filename with different extensions (#19966) 2023-07-28 11:24:22 -04:00
import_json fix(ext/node): fix import json using npm specifier (#19723) 2023-08-01 23:20:08 +00:00
import_map refactor: remove DENO_UNSTABLE_NPM_SYNC_DOWNLOAD and custom sync functionality (#20504) 2023-09-14 17:51:28 +00:00
info refactor: upgrade deno_ast 0.28 and deno_semver 0.4 (#20193) 2023-08-21 09:53:52 +00:00
invalid_package_name refactor: upgrade deno_ast 0.28 and deno_semver 0.4 (#20193) 2023-08-21 09:53:52 +00:00
local_dir_resolves_symlinks
lock_file
mixed_case_package_name refactor: remove DENO_UNSTABLE_NPM_SYNC_DOWNLOAD and custom sync functionality (#20504) 2023-09-14 17:51:28 +00:00
no_npm_after_first_run
no_types_cjs
no_types_in_conditional_exports
node_modules_deno_node_modules
node_modules_import
nonexistent_file
peer_deps_with_copied_folders refactor: remove DENO_UNSTABLE_NPM_SYNC_DOWNLOAD and custom sync functionality (#20504) 2023-09-14 17:51:28 +00:00
permissions_outside_package
registry feat(unstable): ability to npm install then deno run main.ts (#20967) 2023-10-25 14:39:00 -04:00
reload
remote_npm_specifier
require_added_nm_folder
require_json
require_main
require_resolve_url fix(npm): do not panic providing file url to require.resolve paths (#20182) 2023-08-17 10:39:06 -04:00
reserved_word_exports
run_existing_npm_package fix(cli): for main-module that exists in package.json, use the version defined in package.json directly (#20328) 2023-09-18 20:02:58 +00:00
run_existing_npm_package_with_subpath fix(cli): for main-module that exists in package.json, use the version defined in package.json directly (#20328) 2023-09-18 20:02:58 +00:00
sub_paths
tarball_with_global_header
translate_cjs_to_esm
types
types_ambient_module
types_entry_value_not_exists
types_exports_import_types
types_no_types_entry refactor: remove DENO_UNSTABLE_NPM_SYNC_DOWNLOAD and custom sync functionality (#20504) 2023-09-14 17:51:28 +00:00
typescript_file_in_package
deno_cache.out refactor: remove DENO_UNSTABLE_NPM_SYNC_DOWNLOAD and custom sync functionality (#20504) 2023-09-14 17:51:28 +00:00
deno_run_cjs.out
deno_run_cowsay.out
deno_run_cowsay_no_permissions.out
deno_run_cowthink.out
deno_run_esm.out
deno_run_no_bin_entrypoint.out refactor(ext/node): remove dependency on deno_npm and deno_semver (#20718) 2023-09-28 22:43:45 +02:00
deno_run_no_bin_entrypoint_non_existent_subpath.out refactor(ext/node): remove dependency on deno_npm and deno_semver (#20718) 2023-09-28 22:43:45 +02:00
deno_run_no_ext.out
deno_run_non_existent.out
deno_run_special_chars_in_bin_name.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

  1. Set the DENO_TEST_UTIL_UPDATE_NPM=1 environment variable
  2. Run the test and it should download the packages.

Using a custom npm package

  1. Add the custom package to ./registry/@denotest
  2. Reference npm:@denotest/<your-package-name> in the tests.