node/test/fixtures/es-modules
Joyee Cheung 3fb7426f83
module: check --experimental-require-module separately from detection
Previously we assumed if `--experimental-detect-module` is true, then
`--experimental-require-module` is true, which isn't the case, as
the two can be enabled/disabled separately. This patch fixes the
checks so `--no-experimental-require-module` is still effective when
`--experimental-detect-module` is enabled.

Drive-by: make the assertion messages more informative and remove
obsolete TODO about allowing TLA in entrypoints handled by
require(esm).

PR-URL: https://github.com/nodejs/node/pull/55250
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2024-10-08 20:26:13 +00:00
..
cjs-esm-esm-cycle module: cache synchronous module jobs before linking 2024-05-09 00:25:14 +00:00
deprecated-folders-ignore module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
dynamic-import module: implement NODE_COMPILE_CACHE for automatic on-disk code caching 2024-04-17 23:39:45 +02:00
esm-cjs-esm-cycle module: disallow CJS <-> ESM edges in a cycle from require(esm) 2024-04-08 14:45:55 +00:00
esm-cjs-esm-esm-cycle module: disallow CJS <-> ESM edges in a cycle from require(esm) 2024-04-08 14:45:55 +00:00
esm-esm-cjs-esm-cycle module: disallow CJS <-> ESM edges in a cycle from require(esm) 2024-04-08 14:45:55 +00:00
esm-esm-cjs-esm-esm-cycle module: disallow CJS <-> ESM edges in a cycle from require(esm) 2024-04-08 14:45:55 +00:00
exports-both module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
exports-import-default module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
exports-import-only module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
exports-require-only module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
folder%25with percentage# esm: fix hint on invalid module specifier 2023-12-23 20:38:08 +00:00
json-cache
legacy-main-resolver
module-condition module: implement the "module-sync" exports condition 2024-09-25 06:35:26 +00:00
module-counter-by-type
package-cjs-named-error
package-default-extension module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
package-ends-node_modules src: do not treat all paths ending with node_modules as such 2023-12-25 11:44:26 +00:00
package-type-commonjs esm: bypass CJS loader in default load under --default-type=module 2023-11-10 09:20:46 +01:00
package-type-module esm: detect ESM syntax in ambiguous JavaScript 2023-10-20 15:44:56 +00:00
package-without-pjson
package-without-type module: warn on detection in typeless package 2024-03-23 00:38:31 +00:00
pjson-invalid
pjson-main
pkgimports
require-and-import module: fix submodules loaded by require() and import() 2024-04-16 14:07:44 +00:00
self-deprecated-folders
tla module: report unfinished TLA in ambiguous modules 2024-09-19 10:34:13 +00:00
transpiled-cjs-require-module module: add __esModule to require()'d ESM 2024-07-11 18:59:31 +00:00
builtin-imports-case.mjs
cjs-esm-esm.js
cjs-esm.js
cjs-exports-invalid.mjs
cjs-exports.mjs esm: export 'module.exports' on ESM CJS wrapper 2024-10-02 12:30:23 -07:00
cjs-file.cjs
cjs.js
conditional-exports.js
conditional-exports.mjs
data-import.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
dep1.js
dep2.js
es-note-error-1.cjs
es-note-error-1.mjs
es-note-error-2.cjs
es-note-error-2.mjs
es-note-error-3.cjs
es-note-error-3.mjs
es-note-error-4.cjs
es-note-error-4.mjs
es-note-promiserej-import-2.cjs
es-note-unexpected-export-1.cjs
es-note-unexpected-export-2.cjs
es-note-unexpected-import-1.cjs
es-note-unexpected-import-3.cjs
es-note-unexpected-import-4.cjs
es-note-unexpected-import-5.cjs
esm-snapshot-mutator.js
esm-snapshot.js
esm-top-level-await.mjs module: execute --import sequentially 2023-11-01 12:38:01 +00:00
export-es-module-2.mjs module: add __esModule to require()'d ESM 2024-07-11 18:59:31 +00:00
export-es-module.mjs module: add __esModule to require()'d ESM 2024-07-11 18:59:31 +00:00
export-name-code-injection.wasm module: fix code injection through export names 2023-10-13 18:03:52 -03:00
export-name-code-injection.wat module: fix code injection through export names 2023-10-13 18:03:52 -03:00
export-name-syntax-error.wasm module: fix code injection through export names 2023-10-13 18:03:52 -03:00
export-name-syntax-error.wat module: fix code injection through export names 2023-10-13 18:03:52 -03:00
exports-cases2.js
exports-cases3.js
exports-cases.js
file.ext
file.unknown
import-data-url.mjs lib,esm: handle bypass network-import via data: 2024-07-12 12:48:54 +00:00
import-esm.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
import-invalid-ext.mjs
import-invalid-pjson.mjs
import-json-named-export.mjs esm: use import attributes instead of import assertions 2023-10-14 03:52:38 +00:00
import-name.wasm module: fix code injection through export names 2023-10-13 18:03:52 -03:00
import-name.wat module: fix code injection through export names 2023-10-13 18:03:52 -03:00
import-process-exit.mjs
import-resolve-exports.mjs
imported-esm.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
imports-loose.mjs
imports-noext.mjs
invalid-cjs.js
invalid-posix-host.mjs
json-modules.mjs esm: use import attributes instead of import assertions 2023-10-14 03:52:38 +00:00
loop.mjs
loose.js module: check --experimental-require-module separately from detection 2024-10-08 20:26:13 +00:00
message.mjs
mjs-file.mjs
noext
noext-esm
noext-wasm
pattern-trailing-slash.mjs
print-3.mjs
print-entrypoint.mjs module: support loading entrypoint as url 2024-09-27 15:26:48 +08:00
process-exit.mjs
reference-error.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
require-cjs.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
require-esm-throws-with-loaders.js esm: move hooks test with others 2024-06-25 10:08:44 +00:00
require-reference-error.cjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
require-syntax-error.cjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
require-throw-error.cjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
required-cjs.js module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
runmain.mjs
should-not-be-resolved.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
simple.wasm
simple.wat
stateful.mjs
symlink.mjs
syntax-error.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
test-esm-comma,.mjs
test-esm-double-encoding-native%20.mjs
test-esm-ok.mjs
throw-error.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
wasm-dep.mjs
wasm-modules.mjs