node/test/es-module
Joyee Cheung 45c477c2e6
lib: restructure cjs and esm loaders
Create `lib/internal/modules` and restructure the module loaders
to make the purpose of those files clearer.

Also make it clear in the code that the object exported by
`lib/internal/modules/cjs/loader.js` is `CJSModule` instead of the
ambiguous `Module`.

Before:

```
lib
├── ...
├── internal
│       ├── loaders
│       │     ├── CreateDynamicModule.js
│       │     ├── DefaultResolve.js
│       │     ├── Loader.js
│       │     ├── ModuleJob.js
│       │     ├── ModuleMap.js
│       │     ├── ModuleWrap.js
│       │     └── Translators.js
│       └── module.js
└── module.js
```

After:

```
lib
├── ...
├── internal
│       ├── ...
│       └── modules
│              ├── cjs
│              │     ├── helpers.js
│              │     └── loader.js
│              └── esm
│                    ├── CreateDynamicModule.js
│                    ├── DefaultResolve.js
│                    ├── Loader.js
│                    ├── ModuleJob.js
│                    ├── ModuleMap.js
│                    └── Translators.js
└── module.js # deleted in this commit to work with git file mode
```

Backport-PR-URL: https://github.com/nodejs/node/pull/19374
PR-URL: https://github.com/nodejs/node/pull/19177
Refs: https://github.com/nodejs/node/pull/19112
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-04-04 16:21:19 +02:00
..
es-module.status
esm-snapshot-mutator.js
esm-snapshot.js
json.json
test-esm-basic-imports.mjs
test-esm-cyclic-dynamic-import.mjs module: fix cyclical dynamic import 2018-03-07 09:29:50 -08:00
test-esm-double-encoding-native%20.js
test-esm-double-encoding.mjs
test-esm-dynamic-import.js module: enable dynamic import flag for esmodules 2018-02-20 16:15:59 -05:00
test-esm-encoded-path-native.js
test-esm-encoded-path.mjs
test-esm-example-loader.js
test-esm-forbidden-globals.mjs
test-esm-json.mjs
test-esm-loader-dependency.mjs
test-esm-loader-modulemap.js lib: restructure cjs and esm loaders 2018-04-04 16:21:19 +02:00
test-esm-loader-search.js lib: restructure cjs and esm loaders 2018-04-04 16:21:19 +02:00
test-esm-main-lookup.mjs module: fix main lookup regression from #18728 2018-03-07 09:32:45 -08:00
test-esm-named-exports.mjs
test-esm-namespace.mjs
test-esm-ok.mjs
test-esm-preserve-symlinks-not-found-plain.mjs
test-esm-preserve-symlinks-not-found.mjs
test-esm-preserve-symlinks.js test: move tmpdir to submodule of common 2018-02-21 10:18:51 -05:00
test-esm-require-cache.mjs
test-esm-resolve-hook.mjs
test-esm-shared-loader-dep.mjs
test-esm-shebang.mjs
test-esm-snapshot.mjs
test-esm-symlink-main.js module: skip preserveSymlinks for main 2018-04-02 16:09:28 +02:00
test-esm-symlink.js test: specify 'dir' for directory symlinks 2018-03-05 10:07:17 +00:00
testcfg.py