nativescript 9.1.0-rc.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,
|
|
@@ -56,6 +56,7 @@ export declare class MigrateController extends UpdateControllerBase implements I
|
|
|
56
56
|
private migrateConfigs;
|
|
57
57
|
private migrateUnitTestRunner;
|
|
58
58
|
private migrateTSConfig;
|
|
59
|
+
private migrateTSConfigForTypeScript6;
|
|
59
60
|
private checkOrCreatePolyfillsTS;
|
|
60
61
|
private migrateNativeScriptAngular;
|
|
61
62
|
private migrateNativeScriptVue;
|
|
@@ -40,7 +40,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
40
40
|
{
|
|
41
41
|
packageName: "@nativescript/core",
|
|
42
42
|
minVersion: "6.5.0",
|
|
43
|
-
desiredVersion: "~9.
|
|
43
|
+
desiredVersion: "~9.1.0",
|
|
44
44
|
shouldAddIfMissing: true,
|
|
45
45
|
},
|
|
46
46
|
{
|
|
@@ -50,7 +50,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
50
50
|
{
|
|
51
51
|
packageName: "@nativescript/types",
|
|
52
52
|
minVersion: "7.0.0",
|
|
53
|
-
desiredVersion: "~9.
|
|
53
|
+
desiredVersion: "~9.1.0",
|
|
54
54
|
isDev: true,
|
|
55
55
|
},
|
|
56
56
|
{
|
|
@@ -100,7 +100,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
100
100
|
{
|
|
101
101
|
packageName: "@nativescript/angular",
|
|
102
102
|
minVersion: "10.0.0",
|
|
103
|
-
desiredVersion: "
|
|
103
|
+
desiredVersion: "~22.0.0",
|
|
104
104
|
async shouldMigrateAction(dependency, projectData, loose) {
|
|
105
105
|
if (!this.hasDependency(dependency, projectData)) {
|
|
106
106
|
return false;
|
|
@@ -134,7 +134,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
134
134
|
{
|
|
135
135
|
packageName: "@nativescript/unit-test-runner",
|
|
136
136
|
minVersion: "1.0.0",
|
|
137
|
-
desiredVersion: "~
|
|
137
|
+
desiredVersion: "~4.0.1",
|
|
138
138
|
async shouldMigrateAction(dependency, projectData, loose) {
|
|
139
139
|
if (!this.hasDependency(dependency, projectData)) {
|
|
140
140
|
return false;
|
|
@@ -147,7 +147,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
147
147
|
packageName: "typescript",
|
|
148
148
|
isDev: true,
|
|
149
149
|
minVersion: "3.7.0",
|
|
150
|
-
desiredVersion: "~
|
|
150
|
+
desiredVersion: "~6.0.0",
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
153
|
packageName: "node-sass",
|
|
@@ -176,13 +176,13 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
176
176
|
{
|
|
177
177
|
packageName: "@nativescript/ios",
|
|
178
178
|
minVersion: "6.5.3",
|
|
179
|
-
desiredVersion: "~9.
|
|
179
|
+
desiredVersion: "~9.1.0",
|
|
180
180
|
isDev: true,
|
|
181
181
|
},
|
|
182
182
|
{
|
|
183
183
|
packageName: "@nativescript/android",
|
|
184
184
|
minVersion: "7.0.0",
|
|
185
|
-
desiredVersion: "~9.
|
|
185
|
+
desiredVersion: "~9.1.0",
|
|
186
186
|
isDev: true,
|
|
187
187
|
},
|
|
188
188
|
];
|
|
@@ -680,6 +680,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
680
680
|
configContents.compilerOptions.lib = [
|
|
681
681
|
...new Set([...(configContents.compilerOptions.lib || []), "ESNext"]),
|
|
682
682
|
];
|
|
683
|
+
this.migrateTSConfigForTypeScript6(configContents.compilerOptions);
|
|
683
684
|
if (isAngular) {
|
|
684
685
|
if (configContents.files) {
|
|
685
686
|
configContents.files = [
|
|
@@ -698,6 +699,32 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
698
699
|
return false;
|
|
699
700
|
}
|
|
700
701
|
}
|
|
702
|
+
migrateTSConfigForTypeScript6(compilerOptions) {
|
|
703
|
+
var _a, _b, _c;
|
|
704
|
+
const baseUrl = (_a = compilerOptions.baseUrl) !== null && _a !== void 0 ? _a : ".";
|
|
705
|
+
delete compilerOptions.baseUrl;
|
|
706
|
+
delete compilerOptions.downlevelIteration;
|
|
707
|
+
const toRelative = (target) => {
|
|
708
|
+
if (path.posix.isAbsolute(target)) {
|
|
709
|
+
return target;
|
|
710
|
+
}
|
|
711
|
+
const rebased = path.posix.join(baseUrl, target);
|
|
712
|
+
return rebased.startsWith(".") ? rebased : `./${rebased}`;
|
|
713
|
+
};
|
|
714
|
+
if (compilerOptions.paths) {
|
|
715
|
+
compilerOptions.paths = _.mapValues(compilerOptions.paths, (targets) => targets.map(toRelative));
|
|
716
|
+
}
|
|
717
|
+
if (compilerOptions.typeRoots) {
|
|
718
|
+
compilerOptions.typeRoots = [
|
|
719
|
+
...new Set([
|
|
720
|
+
...compilerOptions.typeRoots.map(toRelative),
|
|
721
|
+
"./node_modules/@types",
|
|
722
|
+
]),
|
|
723
|
+
];
|
|
724
|
+
}
|
|
725
|
+
compilerOptions.strict = (_b = compilerOptions.strict) !== null && _b !== void 0 ? _b : false;
|
|
726
|
+
compilerOptions.skipLibCheck = (_c = compilerOptions.skipLibCheck) !== null && _c !== void 0 ? _c : true;
|
|
727
|
+
}
|
|
701
728
|
async checkOrCreatePolyfillsTS(projectData) {
|
|
702
729
|
const { projectDir, appDirectoryPath } = projectData;
|
|
703
730
|
const possiblePaths = [
|
|
@@ -720,7 +747,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
720
747
|
}
|
|
721
748
|
async migrateNativeScriptAngular() {
|
|
722
749
|
const minVersion = "10.0.0";
|
|
723
|
-
const desiredVersion = "~
|
|
750
|
+
const desiredVersion = "~22.0.0";
|
|
724
751
|
const dependencies = [
|
|
725
752
|
{
|
|
726
753
|
packageName: "@angular/animations",
|
|
@@ -779,7 +806,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
779
806
|
{
|
|
780
807
|
packageName: "zone.js",
|
|
781
808
|
minVersion: "0.11.1",
|
|
782
|
-
desiredVersion: "~0.
|
|
809
|
+
desiredVersion: "~0.16.0",
|
|
783
810
|
shouldAddIfMissing: true,
|
|
784
811
|
},
|
|
785
812
|
{
|
|
@@ -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