nativescript 9.1.0 → 9.1.1-dev.0
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.
|
@@ -53,7 +53,9 @@ class BasePackageManager {
|
|
|
53
53
|
}
|
|
54
54
|
async processPackageManagerInstall(packageName, params, opts) {
|
|
55
55
|
const npmExecutable = this.getPackageManagerExecutableName();
|
|
56
|
-
const stdioValue = (0, helpers_1.isInteractive)()
|
|
56
|
+
const stdioValue = (0, helpers_1.isInteractive)()
|
|
57
|
+
? "inherit"
|
|
58
|
+
: ["ignore", "pipe", "pipe"];
|
|
57
59
|
await this.$childProcess.spawnFromEvent(npmExecutable, params, "close", {
|
|
58
60
|
cwd: opts.cwd,
|
|
59
61
|
stdio: stdioValue,
|
|
@@ -28,10 +28,16 @@ class PnpmPackageManager extends base_package_manager_1.BasePackageManager {
|
|
|
28
28
|
if (config.ignoreScripts) {
|
|
29
29
|
config["ignore-scripts"] = true;
|
|
30
30
|
}
|
|
31
|
+
delete config.ignoreScripts;
|
|
32
|
+
delete config.path;
|
|
33
|
+
delete config.frameworkPath;
|
|
31
34
|
const packageJsonPath = path.join(pathToSave, "package.json");
|
|
32
35
|
const jsonContentBefore = this.$fs.readJson(packageJsonPath);
|
|
33
36
|
const flags = this.getFlagsString(config, true);
|
|
34
|
-
let params = ["i"
|
|
37
|
+
let params = ["i"];
|
|
38
|
+
if (!this.projectManagesOwnHoisting(pathToSave)) {
|
|
39
|
+
params.push("--shamefully-hoist");
|
|
40
|
+
}
|
|
35
41
|
const isInstallingAllDependencies = packageName === pathToSave;
|
|
36
42
|
if (!isInstallingAllDependencies) {
|
|
37
43
|
params.push(packageName);
|
|
@@ -92,7 +98,38 @@ class PnpmPackageManager extends base_package_manager_1.BasePackageManager {
|
|
|
92
98
|
}
|
|
93
99
|
async getCachePath() {
|
|
94
100
|
const cachePath = await this.$childProcess.exec(`pnpm config get cache`);
|
|
95
|
-
|
|
101
|
+
const cacheDir = cachePath && cachePath.trim();
|
|
102
|
+
if (cacheDir && cacheDir !== "undefined" && cacheDir !== "null") {
|
|
103
|
+
return path.join(cacheDir, constants_1.CACACHE_DIRECTORY_NAME);
|
|
104
|
+
}
|
|
105
|
+
const storePath = await this.$childProcess.exec(`pnpm store path`);
|
|
106
|
+
return path.join(path.dirname(storePath.trim()), constants_1.CACACHE_DIRECTORY_NAME);
|
|
107
|
+
}
|
|
108
|
+
projectManagesOwnHoisting(installDir) {
|
|
109
|
+
const layoutKeyPattern = /^\s*(shamefully-hoist|node-linker|hoist|hoist-pattern|public-hoist-pattern)\s*[=:]/m;
|
|
110
|
+
let dir = path.resolve(installDir);
|
|
111
|
+
while (true) {
|
|
112
|
+
if (this.$fs.exists(path.join(dir, "pnpm-workspace.yaml"))) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
const npmrcPath = path.join(dir, ".npmrc");
|
|
116
|
+
if (this.$fs.exists(npmrcPath)) {
|
|
117
|
+
try {
|
|
118
|
+
const npmrcContent = this.$fs.readText(npmrcPath);
|
|
119
|
+
if (npmrcContent && layoutKeyPattern.test(npmrcContent)) {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
this.$logger.trace(`Unable to read ${npmrcPath}. Error is: `, err);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const parent = path.dirname(dir);
|
|
128
|
+
if (parent === dir) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
dir = parent;
|
|
132
|
+
}
|
|
96
133
|
}
|
|
97
134
|
}
|
|
98
135
|
exports.PnpmPackageManager = PnpmPackageManager;
|
package/package.json
CHANGED