@yarnpkg/pnpify
Advanced tools
Comparing version 2.0.0-rc.5 to 2.0.0-rc.6
@@ -42,3 +42,3 @@ #!/usr/bin/env node | ||
const child = cross_spawn_1.default(name, argv, { | ||
env: Object.assign({}, process.env, { NODE_OPTIONS }), | ||
env: Object.assign(Object.assign({}, process.env), { NODE_OPTIONS }), | ||
stdio: `inherit`, | ||
@@ -45,0 +45,0 @@ }); |
@@ -29,3 +29,3 @@ "use strict"; | ||
const data = JSON.parse(content); | ||
const patched = `${JSON.stringify(Object.assign({}, data, settings), null, 2)}\n`; | ||
const patched = `${JSON.stringify(Object.assign(Object.assign({}, data), settings), null, 2)}\n`; | ||
await fslib_1.xfs.mkdirpPromise(fslib_1.ppath.dirname(settingsPath)); | ||
@@ -32,0 +32,0 @@ await fslib_1.xfs.changeFilePromise(settingsPath, patched); |
@@ -57,3 +57,3 @@ "use strict"; | ||
const fullOriginalPath = this.pathUtils.resolve(p); | ||
return Object.assign({}, this.pathResolver.resolvePath(fullOriginalPath), { fullOriginalPath }); | ||
return Object.assign(Object.assign({}, this.pathResolver.resolvePath(fullOriginalPath)), { fullOriginalPath }); | ||
} | ||
@@ -79,13 +79,12 @@ } | ||
if (pnpPath.resolvedPath !== pnpPath.fullOriginalPath) { | ||
let stat; | ||
try { | ||
const stats = this.baseFs.lstatSync(pnpPath.statPath || pnpPath.resolvedPath); | ||
if (stats.isDirectory()) { | ||
stat = this.baseFs.lstatSync(pnpPath.statPath || pnpPath.resolvedPath); | ||
} | ||
catch (e) { } | ||
if (stat) { | ||
if (!pnpPath.isSymlink && stat.isDirectory()) | ||
throw PortableNodeModulesFs.createFsError('EINVAL', `invalid argument, ${op} '${p}'`); | ||
} | ||
else { | ||
return onSymlink(stats, this.pathUtils.relative(this.pathUtils.dirname(pnpPath.fullOriginalPath), pnpPath.statPath || pnpPath.resolvedPath)); | ||
} | ||
return onSymlink(stat, this.pathUtils.relative(this.pathUtils.dirname(pnpPath.fullOriginalPath), pnpPath.statPath || pnpPath.resolvedPath)); | ||
} | ||
catch (e) { | ||
} | ||
} | ||
@@ -92,0 +91,0 @@ } |
@@ -34,2 +34,6 @@ import { PortablePath, Filename } from '@yarnpkg/fslib'; | ||
dirList?: Set<Filename>; | ||
/** | ||
* If true, the entry is meant to be a symbolic link to the location pointed by resolvedPath. | ||
*/ | ||
isSymlink?: boolean; | ||
} | ||
@@ -36,0 +40,0 @@ /** |
@@ -80,2 +80,4 @@ "use strict"; | ||
let issuer = this.getIssuer(this.pnp, nodePath); | ||
// Keep track of whether the last component is meant to be a symlink or not | ||
let isSymlink = false; | ||
// If we have something left in a path to parse, do that | ||
@@ -100,3 +102,4 @@ if (issuer && nodePath.length > issuer.length) { | ||
let res = this.pnp.resolveToUnqualified(pkgName, fslib_1.ppath.join(issuer, fslib_1.ppath.sep)); | ||
issuer = res === null || res === issuer ? undefined : res; | ||
isSymlink = res === issuer; | ||
issuer = res === null ? undefined : res; | ||
} | ||
@@ -135,2 +138,9 @@ catch (e) { | ||
result.resolvedPath = fslib_1.ppath.join(issuer, request); | ||
if (isSymlink) { | ||
// We only enforce a symlink if the target is exactly the folder of | ||
// the issuer. If it's a file inside it, we just use the actual entry. | ||
if (!request) { | ||
result.isSymlink = isSymlink; | ||
} | ||
} | ||
} | ||
@@ -137,0 +147,0 @@ } |
{ | ||
"name": "@yarnpkg/pnpify", | ||
"version": "2.0.0-rc.5", | ||
"version": "2.0.0-rc.6", | ||
"main": "./lib/index.js", | ||
@@ -8,3 +8,3 @@ "bin": "./lib/cli.js", | ||
"dependencies": { | ||
"@yarnpkg/fslib": "2.0.0-rc.3", | ||
"@yarnpkg/fslib": "2.0.0-rc.4", | ||
"cross-spawn": "^6.0.5" | ||
@@ -14,5 +14,5 @@ }, | ||
"@yarnpkg/monorepo": "0.0.0", | ||
"@yarnpkg/pnp": "2.0.0-rc.4", | ||
"@yarnpkg/pnp": "2.0.0-rc.5", | ||
"eslint": "^5.16.0", | ||
"typescript": "^3.5.3" | ||
"typescript": "next" | ||
}, | ||
@@ -19,0 +19,0 @@ "peerDependencies": { |
39280
906
+ Added@yarnpkg/fslib@2.0.0-rc.4(transitive)
- Removed@yarnpkg/fslib@2.0.0-rc.3(transitive)
Updated@yarnpkg/fslib@2.0.0-rc.4