Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@parcel/node-resolver-core

Package Overview
Dependencies
Maintainers
1
Versions
889
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/node-resolver-core - npm Package Compare versions

Comparing version 2.0.0-nightly.1917 to 2.0.0-nightly.1920

20

lib/NodeResolver.js

@@ -169,5 +169,5 @@ "use strict";

let relativePath = (0, _utils.relatifyPath)(basedir, fullPath);
let relativeFilePath = (0, _utils.relativePath)(basedir, fullPath);
if (relativePath.length < maxlength) {
if (relativeFilePath.length < maxlength) {
let stats = await this.options.inputFS.stat(fullPath);

@@ -177,3 +177,3 @@ let isDir = stats.isDirectory();

if (isDir || stats.isFile()) {
collected.push(relativePath);
collected.push(relativeFilePath);
} // If it's a directory, run over each item within said directory...

@@ -385,7 +385,7 @@

// If we can't load the file do a fuzzySearch for potential hints
let relativeFileSpecifier = (0, _utils.relatifyPath)(parentdir, filename);
let relativeFileSpecifier = (0, _utils.relativePath)(parentdir, filename);
let potentialFiles = await this.findAlternativeFiles(relativeFileSpecifier, parentdir);
throw new _diagnostic.default({
diagnostic: {
message: `Cannot load file '${relativeFileSpecifier}' in '${(0, _utils.relatifyPath)(this.options.projectRoot, parentdir)}'.`,
message: `Cannot load file '${relativeFileSpecifier}' in '${(0, _utils.relativePath)(this.options.projectRoot, parentdir)}'.`,
hints: potentialFiles.map(r => {

@@ -534,3 +534,3 @@ return `Did you mean __${r}__?`;

let fileSpecifier = (0, _utils.relatifyPath)(dir, failedEntry.filename);
let fileSpecifier = (0, _utils.relativePath)(dir, failedEntry.filename);
let alternatives = await this.findAlternativeFiles(fileSpecifier, pkg.pkgdir);

@@ -689,7 +689,7 @@ let alternative = alternatives[0];

if (_path.default.isAbsolute(filename)) {
filename = (0, _utils.relatifyPath)(dir, filename);
filename = (0, _utils.relativePath)(dir, filename);
alias = await this.lookupAlias(aliases, filename, dir);
} else {
// It is a node_module. First try the entire filename as a key.
alias = await this.lookupAlias(aliases, filename.replace(/\\/g, '/'), dir);
alias = await this.lookupAlias(aliases, (0, _utils.normalizeSeparators)(filename), dir);

@@ -787,5 +787,5 @@ if (alias == null) {

if (splitOn < 0) {
return [name.replace(/\\/g, '/'), undefined];
return [(0, _utils.normalizeSeparators)(name), undefined];
} else {
return [name.substring(0, splitOn).replace(/\\/g, '/'), name.substring(splitOn + 1) || undefined];
return [(0, _utils.normalizeSeparators)(name.substring(0, splitOn)), name.substring(splitOn + 1) || undefined];
}

@@ -792,0 +792,0 @@ }

{
"name": "@parcel/node-resolver-core",
"version": "2.0.0-nightly.1917+3f9c496b",
"version": "2.0.0-nightly.1920+8fdd6193",
"license": "MIT",

@@ -18,9 +18,9 @@ "publishConfig": {

"dependencies": {
"@parcel/diagnostic": "2.0.0-nightly.295+3f9c496b",
"@parcel/node-libs-browser": "2.0.0-nightly.1917+3f9c496b",
"@parcel/utils": "2.0.0-nightly.295+3f9c496b",
"@parcel/diagnostic": "2.0.0-nightly.298+8fdd6193",
"@parcel/node-libs-browser": "2.0.0-nightly.1920+8fdd6193",
"@parcel/utils": "2.0.0-nightly.298+8fdd6193",
"micromatch": "^3.0.4",
"nullthrows": "^1.1.1"
},
"gitHead": "3f9c496b1ee7c72a4c051e903001462ce6eef449"
"gitHead": "8fdd6193a20d0e82e7639115fe31dd0ff145589b"
}

@@ -12,3 +12,8 @@ // @flow

import path from 'path';
import {isGlob, fuzzySearch, relatifyPath} from '@parcel/utils';
import {
isGlob,
fuzzySearch,
relativePath,
normalizeSeparators,
} from '@parcel/utils';
import ThrowableDiagnostic, {

@@ -200,8 +205,8 @@ generateJSONCodeHighlights,

let fullPath = path.join(dir, item);
let relativePath = relatifyPath(basedir, fullPath);
if (relativePath.length < maxlength) {
let relativeFilePath = relativePath(basedir, fullPath);
if (relativeFilePath.length < maxlength) {
let stats = await this.options.inputFS.stat(fullPath);
let isDir = stats.isDirectory();
if (isDir || stats.isFile()) {
collected.push(relativePath);
collected.push(relativeFilePath);
}

@@ -437,3 +442,3 @@

// If we can't load the file do a fuzzySearch for potential hints
let relativeFileSpecifier = relatifyPath(parentdir, filename);
let relativeFileSpecifier = relativePath(parentdir, filename);
let potentialFiles = await this.findAlternativeFiles(

@@ -446,3 +451,3 @@ relativeFileSpecifier,

diagnostic: {
message: `Cannot load file '${relativeFileSpecifier}' in '${relatifyPath(
message: `Cannot load file '${relativeFileSpecifier}' in '${relativePath(
this.options.projectRoot,

@@ -598,3 +603,3 @@ parentdir,

let fileSpecifier = relatifyPath(dir, failedEntry.filename);
let fileSpecifier = relativePath(dir, failedEntry.filename);
let alternatives = await this.findAlternativeFiles(

@@ -799,3 +804,3 @@ fileSpecifier,

if (path.isAbsolute(filename)) {
filename = relatifyPath(dir, filename);
filename = relativePath(dir, filename);
alias = await this.lookupAlias(aliases, filename, dir);

@@ -806,3 +811,3 @@ } else {

aliases,
filename.replace(/\\/g, '/'),
normalizeSeparators(filename),
dir,

@@ -893,6 +898,6 @@ );

if (splitOn < 0) {
return [name.replace(/\\/g, '/'), undefined];
return [normalizeSeparators(name), undefined];
} else {
return [
name.substring(0, splitOn).replace(/\\/g, '/'),
normalizeSeparators(name.substring(0, splitOn)),
name.substring(splitOn + 1) || undefined,

@@ -899,0 +904,0 @@ ];

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc