pnpm install --shamefully-hoist
works
This commit is contained in:
parent
f2c83c1bc3
commit
ed4c3aaaec
2 changed files with 3 additions and 7 deletions
|
@ -1,7 +1,6 @@
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as cp from 'child_process';
|
import * as cp from 'child_process';
|
||||||
import * as denodeify from 'denodeify';
|
|
||||||
import * as parseSemver from 'parse-semver';
|
import * as parseSemver from 'parse-semver';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
import { CancellationToken } from './util';
|
import { CancellationToken } from './util';
|
||||||
|
@ -113,16 +112,13 @@ async function asPnpmDependency(prefix: string, tree: PnpmTreeNode, prune: boole
|
||||||
}
|
}
|
||||||
|
|
||||||
let name = tree.name || tree.from;
|
let name = tree.name || tree.from;
|
||||||
let s = path.sep;
|
|
||||||
|
|
||||||
const dependencyPath = await denodeify(fs.realpath)(`${prefix}${s}${name}`);
|
const dependencyPath = path.join(prefix, name);
|
||||||
const children: YarnDependency[] = [];
|
const children: YarnDependency[] = [];
|
||||||
|
|
||||||
console.log(dependencyPath);
|
|
||||||
|
|
||||||
const deps = await Promise.all(
|
const deps = await Promise.all(
|
||||||
_.values(tree.dependencies || {})
|
_.values(tree.dependencies || {})
|
||||||
.map(child => asPnpmDependency(`${dependencyPath}${s}..`, child, prune))
|
.map(child => asPnpmDependency(prefix, child, prune))
|
||||||
);
|
);
|
||||||
for(const dep of deps) {
|
for(const dep of deps) {
|
||||||
if (dep) {
|
if (dep) {
|
||||||
|
|
|
@ -923,7 +923,7 @@ const defaultIgnore = [
|
||||||
function collectAllFiles(cwd: string, useYarn = false, usePackageManager: "yarn" | "npm" | "pnpm" = "npm", dependencyEntryPoints?: string[]): Promise<string[]> {
|
function collectAllFiles(cwd: string, useYarn = false, usePackageManager: "yarn" | "npm" | "pnpm" = "npm", dependencyEntryPoints?: string[]): Promise<string[]> {
|
||||||
return getDependencies(cwd, useYarn, usePackageManager, dependencyEntryPoints).then(deps => {
|
return getDependencies(cwd, useYarn, usePackageManager, dependencyEntryPoints).then(deps => {
|
||||||
const promises: Promise<string[]>[] = deps.map(dep => {
|
const promises: Promise<string[]>[] = deps.map(dep => {
|
||||||
return glob('**', { cwd: dep, nodir: true, dot: true, ignore: 'node_modules/**' })
|
return glob('**', { cwd: dep, nodir: true, dot: true, follow: usePackageManager == "pnpm", ignore: 'node_modules/**' })
|
||||||
.then(files => files
|
.then(files => files
|
||||||
.map(f => path.relative(cwd, path.join(dep, f)))
|
.map(f => path.relative(cwd, path.join(dep, f)))
|
||||||
.map(f => f.replace(/\\/g, '/')));
|
.map(f => f.replace(/\\/g, '/')));
|
||||||
|
|
Loading…
Add table
Reference in a new issue