mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
module: runtime deprecate trailing slash patterns
PR-URL: https://github.com/nodejs/node/pull/40117 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
3101c09d1d
commit
64287e4d45
4 files changed
+4
-6
No files matched your search
@@ -2820,13 +2820,16 @@ and `'mgf1HashAlgorithm'`.
|
||||
### DEP0155: Trailing slashes in pattern specifier resolutions
|
||||
<!-- YAML
|
||||
changes:
|
||||
- version: REPLACEME
|
||||
pr-url: https://github.com/nodejs/node/pull/40117
|
||||
description: Runtime deprecation.
|
||||
- version: REPLACEME
|
||||
pr-url: https://github.com/nodejs/node/pull/40039
|
||||
description: Documentation-only deprecation
|
||||
with `--pending-deprecation` support.
|
||||
-->
|
||||
|
||||
Type: Documentation-only (supports [`--pending-deprecation`][])
|
||||
Type: Runtime
|
||||
|
||||
The remapping of specifiers ending in `"/"` like `import 'pkg/x/'` is deprecated
|
||||
for package `"exports"` and `"imports"` pattern resolutions.
|
||||
|
||||
@@ -39,7 +39,6 @@ const { sep, relative, resolve } = require('path');
|
||||
const preserveSymlinks = getOptionValue('--preserve-symlinks');
|
||||
const preserveSymlinksMain = getOptionValue('--preserve-symlinks-main');
|
||||
const typeFlag = getOptionValue('--input-type');
|
||||
const pendingDeprecation = getOptionValue('--pending-deprecation');
|
||||
const { URL, pathToFileURL, fileURLToPath } = require('internal/url');
|
||||
const {
|
||||
ERR_INPUT_TYPE_NOT_ALLOWED,
|
||||
@@ -107,7 +106,6 @@ function emitFolderMapDeprecation(match, pjsonUrl, isExports, base) {
|
||||
}
|
||||
|
||||
function emitTrailingSlashPatternDeprecation(match, pjsonUrl, isExports, base) {
|
||||
if (!pendingDeprecation) return;
|
||||
const pjsonPath = fileURLToPath(pjsonUrl);
|
||||
if (emittedPackageWarnings.has(pjsonPath + '|' + match))
|
||||
return;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// Flags: --pending-deprecation
|
||||
import { mustCall } from '../common/index.mjs';
|
||||
import assert from 'assert';
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// Flags: --pending-deprecation
|
||||
|
||||
import '../common/index.mjs';
|
||||
import assert from 'assert';
|
||||
import fixtures from '../common/fixtures.js';
|
||||
|
||||
Reference in new issue
Block a user