@atlaspack/node-resolver-core 3.6.1 → 3.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Wrapper.js +1 -18
- package/package.json +6 -6
package/lib/Wrapper.js
CHANGED
@@ -240,7 +240,6 @@ class NodeResolver {
|
|
240
240
|
if (this.options.shouldAutoInstall && packageManager) {
|
241
241
|
var _this$options$logger2;
|
242
242
|
(_this$options$logger2 = this.options.logger) === null || _this$options$logger2 === void 0 || _this$options$logger2.warn({
|
243
|
-
// @ts-expect-error TS2345
|
244
243
|
message: (0, _diagnostic().md)`Auto installing polyfill for Node builtin module "${packageName}"...`,
|
245
244
|
codeFrames: options.loc ? [{
|
246
245
|
filePath: options.loc.filePath,
|
@@ -266,16 +265,13 @@ class NodeResolver {
|
|
266
265
|
} else {
|
267
266
|
throw new (_diagnostic().default)({
|
268
267
|
diagnostic: {
|
269
|
-
// @ts-expect-error TS2345
|
270
268
|
message: (0, _diagnostic().md)`Node builtin polyfill "${packageName}" is not installed, but auto install is disabled.`,
|
271
269
|
codeFrames: options.loc ? [{
|
272
270
|
filePath: options.loc.filePath,
|
273
271
|
codeHighlights: [(0, _diagnostic().convertSourceLocationToHighlight)(options.loc, 'used here')]
|
274
272
|
}] : [],
|
275
273
|
documentationURL: 'https://parceljs.org/features/node-emulation/#polyfilling-%26-excluding-builtin-node-modules',
|
276
|
-
hints: [
|
277
|
-
// @ts-expect-error TS2345
|
278
|
-
(0, _diagnostic().md)`Install the "${packageName}" package with your package manager, and run Parcel again.`]
|
274
|
+
hints: [(0, _diagnostic().md)`Install the "${packageName}" package with your package manager, and run Parcel again.`]
|
279
275
|
}
|
280
276
|
});
|
281
277
|
}
|
@@ -329,7 +325,6 @@ class NodeResolver {
|
|
329
325
|
);
|
330
326
|
|
331
327
|
return {
|
332
|
-
// @ts-expect-error TS2345
|
333
328
|
message: (0, _diagnostic().md)`Cannot load file '${relative}' in '${(0, _utils().relativePath)(this.options.projectRoot, dir)}'.`,
|
334
329
|
hints: potentialFiles.map(r => {
|
335
330
|
return `Did you mean '__${r}__'?`;
|
@@ -340,7 +335,6 @@ class NodeResolver {
|
|
340
335
|
{
|
341
336
|
let alternativeModules = await (0, _utils().findAlternativeNodeModules)(this.options.fs, error.module, options.parent ? _path().default.dirname(options.parent) : this.options.projectRoot);
|
342
337
|
return {
|
343
|
-
// @ts-expect-error TS2345
|
344
338
|
message: (0, _diagnostic().md)`Cannot find module '${error.module}'`,
|
345
339
|
hints: alternativeModules.map(r => {
|
346
340
|
return `Did you mean '__${r}__'?`;
|
@@ -355,7 +349,6 @@ class NodeResolver {
|
|
355
349
|
let alternative = alternatives[0];
|
356
350
|
let pkgContent = await this.options.fs.readFile(error.package_path, 'utf8');
|
357
351
|
return {
|
358
|
-
// @ts-expect-error TS2345
|
359
352
|
message: (0, _diagnostic().md)`Could not load '${fileSpecifier}' from module '${error.module}' found in package.json#${error.field}`,
|
360
353
|
codeFrames: [{
|
361
354
|
filePath: error.package_path,
|
@@ -364,7 +357,6 @@ class NodeResolver {
|
|
364
357
|
codeHighlights: (0, _diagnostic().generateJSONCodeHighlights)(pkgContent, [{
|
365
358
|
key: `/${error.field}`,
|
366
359
|
type: 'value',
|
367
|
-
// @ts-expect-error TS2345
|
368
360
|
message: (0, _diagnostic().md)`'${fileSpecifier}' does not exist${alternative ? `, did you mean '${alternative}'?` : ''}'`
|
369
361
|
}])
|
370
362
|
}]
|
@@ -384,7 +376,6 @@ class NodeResolver {
|
|
384
376
|
relative = './' + relative;
|
385
377
|
}
|
386
378
|
return {
|
387
|
-
// @ts-expect-error TS2345
|
388
379
|
message: (0, _diagnostic().md)`Cannot load file '${relative}' from module '${error.module}'`,
|
389
380
|
hints: potentialFiles.map(r => {
|
390
381
|
return `Did you mean '__${error.module}/${r}__'?`;
|
@@ -440,7 +431,6 @@ class NodeResolver {
|
|
440
431
|
case 'UnknownScheme':
|
441
432
|
{
|
442
433
|
return {
|
443
|
-
// @ts-expect-error TS2345
|
444
434
|
message: (0, _diagnostic().md)`Unknown url scheme or pipeline '${error.scheme}:'`
|
445
435
|
};
|
446
436
|
}
|
@@ -452,7 +442,6 @@ class NodeResolver {
|
|
452
442
|
case 'PackagePathNotExported':
|
453
443
|
{
|
454
444
|
return {
|
455
|
-
// @ts-expect-error TS2345
|
456
445
|
message: (0, _diagnostic().md)`Module '${options.filename}' is not exported from the '${error.module}' package`,
|
457
446
|
codeFrames: [{
|
458
447
|
filePath: error.path,
|
@@ -469,7 +458,6 @@ class NodeResolver {
|
|
469
458
|
{
|
470
459
|
let parsed = (0, _jsonSourcemap().parse)(pkgContent);
|
471
460
|
return {
|
472
|
-
// @ts-expect-error TS2345
|
473
461
|
message: (0, _diagnostic().md)`Package import '${options.filename}' is not defined in the '${error.module}' package`,
|
474
462
|
codeFrames: [{
|
475
463
|
filePath: error.path,
|
@@ -485,7 +473,6 @@ class NodeResolver {
|
|
485
473
|
case 'InvalidPackageTarget':
|
486
474
|
{
|
487
475
|
return {
|
488
|
-
// @ts-expect-error TS2345
|
489
476
|
message: (0, _diagnostic().md)`Invalid package target in the '${error.module} package. Targets may not refer to files outside the package.`,
|
490
477
|
codeFrames: [{
|
491
478
|
filePath: error.path,
|
@@ -502,7 +489,6 @@ class NodeResolver {
|
|
502
489
|
case 'InvalidSpecifier':
|
503
490
|
{
|
504
491
|
return {
|
505
|
-
// @ts-expect-error TS2345
|
506
492
|
message: (0, _diagnostic().md)`Invalid package import specifier '${options.filename}'.`
|
507
493
|
};
|
508
494
|
}
|
@@ -512,7 +498,6 @@ class NodeResolver {
|
|
512
498
|
case 'PackageJsonNotFound':
|
513
499
|
{
|
514
500
|
return {
|
515
|
-
// @ts-expect-error TS2345
|
516
501
|
message: (0, _diagnostic().md)`Cannot find a package.json above '${(0, _utils().relativePath)(this.options.projectRoot, options.parent ? _path().default.dirname(options.parent) : this.options.projectRoot)}'`
|
517
502
|
};
|
518
503
|
}
|
@@ -558,7 +543,6 @@ class NodeResolver {
|
|
558
543
|
if (!((_pkg$dependencies = pkg.dependencies) !== null && _pkg$dependencies !== void 0 && _pkg$dependencies[moduleName]) && !((_pkg$peerDependencies = pkg.peerDependencies) !== null && _pkg$peerDependencies !== void 0 && _pkg$peerDependencies[moduleName]) && !((_pkg$engines = pkg.engines) !== null && _pkg$engines !== void 0 && _pkg$engines[moduleName])) {
|
559
544
|
let pkgContent = await this.options.fs.readFile(pkgfile, 'utf8');
|
560
545
|
return {
|
561
|
-
// @ts-expect-error TS2345
|
562
546
|
message: (0, _diagnostic().md)`External dependency "${moduleName}" is not declared in package.json.`,
|
563
547
|
codeFrames: [{
|
564
548
|
filePath: pkgfile,
|
@@ -590,7 +574,6 @@ class NodeResolver {
|
|
590
574
|
let pkgContent = await this.options.fs.readFile(pkgfile, 'utf8');
|
591
575
|
let field = (_pkg$dependencies3 = pkg.dependencies) !== null && _pkg$dependencies3 !== void 0 && _pkg$dependencies3[moduleName] ? 'dependencies' : 'peerDependencies';
|
592
576
|
return {
|
593
|
-
// @ts-expect-error TS2345
|
594
577
|
message: (0, _diagnostic().md)`External dependency "${moduleName}" does not satisfy required semver range "${range}".`,
|
595
578
|
codeFrames: [{
|
596
579
|
filePath: pkgfile,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaspack/node-resolver-core",
|
3
|
-
"version": "3.6.
|
3
|
+
"version": "3.6.2",
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -25,11 +25,11 @@
|
|
25
25
|
],
|
26
26
|
"dependencies": {
|
27
27
|
"@mischnic/json-sourcemap": "^0.1.0",
|
28
|
-
"@atlaspack/diagnostic": "2.14.
|
29
|
-
"@atlaspack/feature-flags": "2.23.
|
30
|
-
"@atlaspack/fs": "2.15.
|
31
|
-
"@atlaspack/rust": "3.6.
|
32
|
-
"@atlaspack/utils": "2.18.
|
28
|
+
"@atlaspack/diagnostic": "2.14.3",
|
29
|
+
"@atlaspack/feature-flags": "2.23.1",
|
30
|
+
"@atlaspack/fs": "2.15.21",
|
31
|
+
"@atlaspack/rust": "3.6.1",
|
32
|
+
"@atlaspack/utils": "2.18.3",
|
33
33
|
"nullthrows": "^1.1.1",
|
34
34
|
"semver": "^7.5.2"
|
35
35
|
},
|