nativescript 9.1.0-alpha.1 → 9.1.0-alpha.10
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.
- package/lib/commands/prepare.js +5 -0
- package/lib/common/definitions/mobile.d.ts +15 -10
- package/lib/common/mobile/android/android-emulator-services.js +11 -3
- package/lib/common/mobile/emulator-helper.js +1 -0
- package/lib/common/mobile/ios/device/ios-device-file-system.js +29 -1
- package/lib/controllers/prepare-controller.js +53 -11
- package/lib/controllers/run-controller.js +200 -13
- package/lib/data/prepare-data.js +4 -0
- package/lib/declarations.d.ts +38 -42
- package/lib/definitions/project.d.ts +16 -0
- package/lib/options.js +1 -0
- package/lib/services/android-plugin-build-service.js +20 -12
- package/lib/services/bundler/bundler-compiler-service.js +160 -2
- package/lib/services/ios/xcodebuild-args-service.js +26 -0
- package/lib/services/ios-project-service.js +28 -4
- package/lib/services/livesync/ios-livesync-service.js +113 -2
- package/lib/services/plugins-service.js +12 -4
- package/lib/services/project-data-service.js +14 -11
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +64 -0
- package/node_modules/debug/src/browser.js +272 -0
- package/node_modules/debug/src/common.js +292 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +38 -0
- package/node_modules/ms/readme.md +59 -0
- package/node_modules/universal-analytics/.travis.yml +11 -0
- package/node_modules/universal-analytics/AcceptableParams.md +757 -0
- package/node_modules/universal-analytics/HISTORY.md +170 -0
- package/node_modules/universal-analytics/Makefile +5 -0
- package/node_modules/universal-analytics/README.md +651 -0
- package/node_modules/universal-analytics/index.js +2 -0
- package/node_modules/universal-analytics/lib/config.js +171 -0
- package/node_modules/universal-analytics/lib/index.js +563 -0
- package/node_modules/universal-analytics/lib/request.js +73 -0
- package/node_modules/universal-analytics/lib/utils.js +29 -0
- package/node_modules/universal-analytics/package.json +33 -0
- package/node_modules/universal-analytics/test/_enqueue.js +144 -0
- package/node_modules/universal-analytics/test/event.js +346 -0
- package/node_modules/universal-analytics/test/exception.js +233 -0
- package/node_modules/universal-analytics/test/index.js +141 -0
- package/node_modules/universal-analytics/test/item.js +550 -0
- package/node_modules/universal-analytics/test/middleware.js +119 -0
- package/node_modules/universal-analytics/test/mocha.opts +3 -0
- package/node_modules/universal-analytics/test/pageview.js +286 -0
- package/node_modules/universal-analytics/test/send.js +232 -0
- package/node_modules/universal-analytics/test/set.js +68 -0
- package/node_modules/universal-analytics/test/timing.js +363 -0
- package/node_modules/universal-analytics/test/transaction.js +371 -0
- package/node_modules/uuid/LICENSE.md +9 -0
- package/node_modules/uuid/README.md +510 -0
- package/node_modules/uuid/dist/cjs/index.d.ts +15 -0
- package/node_modules/uuid/dist/cjs/index.js +31 -0
- package/node_modules/uuid/dist/cjs/max.d.ts +2 -0
- package/node_modules/uuid/dist/cjs/max.js +3 -0
- package/node_modules/uuid/dist/cjs/md5.d.ts +4 -0
- package/node_modules/uuid/dist/cjs/md5.js +13 -0
- package/node_modules/uuid/dist/cjs/native.d.ts +6 -0
- package/node_modules/uuid/dist/cjs/native.js +4 -0
- package/node_modules/uuid/dist/cjs/nil.d.ts +2 -0
- package/node_modules/uuid/dist/cjs/nil.js +3 -0
- package/node_modules/uuid/dist/cjs/package.json +1 -0
- package/node_modules/uuid/dist/cjs/parse.d.ts +2 -0
- package/node_modules/uuid/dist/cjs/parse.js +11 -0
- package/node_modules/uuid/dist/cjs/regex.d.ts +2 -0
- package/node_modules/uuid/dist/cjs/regex.js +3 -0
- package/node_modules/uuid/dist/cjs/rng.d.ts +1 -0
- package/node_modules/uuid/dist/cjs/rng.js +13 -0
- package/node_modules/uuid/dist/cjs/sha1.d.ts +4 -0
- package/node_modules/uuid/dist/cjs/sha1.js +13 -0
- package/node_modules/uuid/dist/cjs/stringify.d.ts +3 -0
- package/node_modules/uuid/dist/cjs/stringify.js +39 -0
- package/node_modules/uuid/dist/cjs/types.d.ts +21 -0
- package/node_modules/uuid/dist/cjs/types.js +2 -0
- package/node_modules/uuid/dist/cjs/uuid-bin.d.ts +1 -0
- package/node_modules/uuid/dist/cjs/uuid-bin.js +72 -0
- package/node_modules/uuid/dist/cjs/v1.d.ts +11 -0
- package/node_modules/uuid/dist/cjs/v1.js +87 -0
- package/node_modules/uuid/dist/cjs/v1ToV6.d.ts +2 -0
- package/node_modules/uuid/dist/cjs/v1ToV6.js +13 -0
- package/node_modules/uuid/dist/cjs/v3.d.ts +9 -0
- package/node_modules/uuid/dist/cjs/v3.js +14 -0
- package/node_modules/uuid/dist/cjs/v35.d.ts +7 -0
- package/node_modules/uuid/dist/cjs/v35.js +41 -0
- package/node_modules/uuid/dist/cjs/v4.d.ts +4 -0
- package/node_modules/uuid/dist/cjs/v4.js +29 -0
- package/node_modules/uuid/dist/cjs/v5.d.ts +9 -0
- package/node_modules/uuid/dist/cjs/v5.js +14 -0
- package/node_modules/uuid/dist/cjs/v6.d.ts +4 -0
- package/node_modules/uuid/dist/cjs/v6.js +19 -0
- package/node_modules/uuid/dist/cjs/v6ToV1.d.ts +2 -0
- package/node_modules/uuid/dist/cjs/v6ToV1.js +13 -0
- package/node_modules/uuid/dist/cjs/v7.d.ts +9 -0
- package/node_modules/uuid/dist/cjs/v7.js +69 -0
- package/node_modules/uuid/dist/cjs/validate.d.ts +2 -0
- package/node_modules/uuid/dist/cjs/validate.js +7 -0
- package/node_modules/uuid/dist/cjs/version.d.ts +2 -0
- package/node_modules/uuid/dist/cjs/version.js +10 -0
- package/node_modules/uuid/dist/cjs-browser/index.d.ts +15 -0
- package/node_modules/uuid/dist/cjs-browser/index.js +31 -0
- package/node_modules/uuid/dist/cjs-browser/max.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/max.js +3 -0
- package/node_modules/uuid/dist/cjs-browser/md5.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/md5.js +137 -0
- package/node_modules/uuid/dist/cjs-browser/native.d.ts +4 -0
- package/node_modules/uuid/dist/cjs-browser/native.js +4 -0
- package/node_modules/uuid/dist/cjs-browser/nil.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/nil.js +3 -0
- package/node_modules/uuid/dist/cjs-browser/package.json +1 -0
- package/node_modules/uuid/dist/cjs-browser/parse.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/parse.js +11 -0
- package/node_modules/uuid/dist/cjs-browser/regex.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/regex.js +3 -0
- package/node_modules/uuid/dist/cjs-browser/rng.d.ts +1 -0
- package/node_modules/uuid/dist/cjs-browser/rng.js +14 -0
- package/node_modules/uuid/dist/cjs-browser/sha1.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/sha1.js +72 -0
- package/node_modules/uuid/dist/cjs-browser/stringify.d.ts +3 -0
- package/node_modules/uuid/dist/cjs-browser/stringify.js +39 -0
- package/node_modules/uuid/dist/cjs-browser/types.d.ts +21 -0
- package/node_modules/uuid/dist/cjs-browser/types.js +2 -0
- package/node_modules/uuid/dist/cjs-browser/uuid-bin.d.ts +1 -0
- package/node_modules/uuid/dist/cjs-browser/uuid-bin.js +72 -0
- package/node_modules/uuid/dist/cjs-browser/v1.d.ts +11 -0
- package/node_modules/uuid/dist/cjs-browser/v1.js +87 -0
- package/node_modules/uuid/dist/cjs-browser/v1ToV6.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/v1ToV6.js +13 -0
- package/node_modules/uuid/dist/cjs-browser/v3.d.ts +9 -0
- package/node_modules/uuid/dist/cjs-browser/v3.js +14 -0
- package/node_modules/uuid/dist/cjs-browser/v35.d.ts +7 -0
- package/node_modules/uuid/dist/cjs-browser/v35.js +41 -0
- package/node_modules/uuid/dist/cjs-browser/v4.d.ts +4 -0
- package/node_modules/uuid/dist/cjs-browser/v4.js +29 -0
- package/node_modules/uuid/dist/cjs-browser/v5.d.ts +9 -0
- package/node_modules/uuid/dist/cjs-browser/v5.js +14 -0
- package/node_modules/uuid/dist/cjs-browser/v6.d.ts +4 -0
- package/node_modules/uuid/dist/cjs-browser/v6.js +19 -0
- package/node_modules/uuid/dist/cjs-browser/v6ToV1.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/v6ToV1.js +13 -0
- package/node_modules/uuid/dist/cjs-browser/v7.d.ts +9 -0
- package/node_modules/uuid/dist/cjs-browser/v7.js +69 -0
- package/node_modules/uuid/dist/cjs-browser/validate.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/validate.js +7 -0
- package/node_modules/uuid/dist/cjs-browser/version.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/version.js +10 -0
- package/node_modules/uuid/dist/esm/bin/uuid +2 -0
- package/node_modules/uuid/dist/esm/index.d.ts +15 -0
- package/node_modules/uuid/dist/esm/index.js +14 -0
- package/node_modules/uuid/dist/esm/max.d.ts +2 -0
- package/node_modules/uuid/dist/esm/max.js +1 -0
- package/node_modules/uuid/dist/esm/md5.d.ts +4 -0
- package/node_modules/uuid/dist/esm/md5.js +11 -0
- package/node_modules/uuid/dist/esm/native.d.ts +6 -0
- package/node_modules/uuid/dist/esm/native.js +2 -0
- package/node_modules/uuid/dist/esm/nil.d.ts +2 -0
- package/node_modules/uuid/dist/esm/nil.js +1 -0
- package/node_modules/uuid/dist/esm/parse.d.ts +2 -0
- package/node_modules/uuid/dist/esm/parse.js +9 -0
- package/node_modules/uuid/dist/esm/regex.d.ts +2 -0
- package/node_modules/uuid/dist/esm/regex.js +1 -0
- package/node_modules/uuid/dist/esm/rng.d.ts +1 -0
- package/node_modules/uuid/dist/esm/rng.js +10 -0
- package/node_modules/uuid/dist/esm/sha1.d.ts +4 -0
- package/node_modules/uuid/dist/esm/sha1.js +11 -0
- package/node_modules/uuid/dist/esm/stringify.d.ts +3 -0
- package/node_modules/uuid/dist/esm/stringify.js +35 -0
- package/node_modules/uuid/dist/esm/types.d.ts +21 -0
- package/node_modules/uuid/dist/esm/types.js +1 -0
- package/node_modules/uuid/dist/esm/uuid-bin.d.ts +1 -0
- package/node_modules/uuid/dist/esm/uuid-bin.js +70 -0
- package/node_modules/uuid/dist/esm/v1.d.ts +11 -0
- package/node_modules/uuid/dist/esm/v1.js +83 -0
- package/node_modules/uuid/dist/esm/v1ToV6.d.ts +2 -0
- package/node_modules/uuid/dist/esm/v1ToV6.js +10 -0
- package/node_modules/uuid/dist/esm/v3.d.ts +9 -0
- package/node_modules/uuid/dist/esm/v3.js +9 -0
- package/node_modules/uuid/dist/esm/v35.d.ts +7 -0
- package/node_modules/uuid/dist/esm/v35.js +36 -0
- package/node_modules/uuid/dist/esm/v4.d.ts +4 -0
- package/node_modules/uuid/dist/esm/v4.js +27 -0
- package/node_modules/uuid/dist/esm/v5.d.ts +9 -0
- package/node_modules/uuid/dist/esm/v5.js +9 -0
- package/node_modules/uuid/dist/esm/v6.d.ts +4 -0
- package/node_modules/uuid/dist/esm/v6.js +17 -0
- package/node_modules/uuid/dist/esm/v6ToV1.d.ts +2 -0
- package/node_modules/uuid/dist/esm/v6ToV1.js +10 -0
- package/node_modules/uuid/dist/esm/v7.d.ts +9 -0
- package/node_modules/uuid/dist/esm/v7.js +65 -0
- package/node_modules/uuid/dist/esm/validate.d.ts +2 -0
- package/node_modules/uuid/dist/esm/validate.js +5 -0
- package/node_modules/uuid/dist/esm/version.d.ts +2 -0
- package/node_modules/uuid/dist/esm/version.js +8 -0
- package/node_modules/uuid/dist/esm-browser/index.d.ts +15 -0
- package/node_modules/uuid/dist/esm-browser/index.js +14 -0
- package/node_modules/uuid/dist/esm-browser/max.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/max.js +1 -0
- package/node_modules/uuid/dist/esm-browser/md5.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/md5.js +135 -0
- package/node_modules/uuid/dist/esm-browser/native.d.ts +4 -0
- package/node_modules/uuid/dist/esm-browser/native.js +2 -0
- package/node_modules/uuid/dist/esm-browser/nil.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/nil.js +1 -0
- package/node_modules/uuid/dist/esm-browser/parse.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/parse.js +9 -0
- package/node_modules/uuid/dist/esm-browser/regex.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/regex.js +1 -0
- package/node_modules/uuid/dist/esm-browser/rng.d.ts +1 -0
- package/node_modules/uuid/dist/esm-browser/rng.js +11 -0
- package/node_modules/uuid/dist/esm-browser/sha1.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/sha1.js +70 -0
- package/node_modules/uuid/dist/esm-browser/stringify.d.ts +3 -0
- package/node_modules/uuid/dist/esm-browser/stringify.js +35 -0
- package/node_modules/uuid/dist/esm-browser/types.d.ts +21 -0
- package/node_modules/uuid/dist/esm-browser/types.js +1 -0
- package/node_modules/uuid/dist/esm-browser/uuid-bin.d.ts +1 -0
- package/node_modules/uuid/dist/esm-browser/uuid-bin.js +70 -0
- package/node_modules/uuid/dist/esm-browser/v1.d.ts +11 -0
- package/node_modules/uuid/dist/esm-browser/v1.js +83 -0
- package/node_modules/uuid/dist/esm-browser/v1ToV6.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/v1ToV6.js +10 -0
- package/node_modules/uuid/dist/esm-browser/v3.d.ts +9 -0
- package/node_modules/uuid/dist/esm-browser/v3.js +9 -0
- package/node_modules/uuid/dist/esm-browser/v35.d.ts +7 -0
- package/node_modules/uuid/dist/esm-browser/v35.js +36 -0
- package/node_modules/uuid/dist/esm-browser/v4.d.ts +4 -0
- package/node_modules/uuid/dist/esm-browser/v4.js +27 -0
- package/node_modules/uuid/dist/esm-browser/v5.d.ts +9 -0
- package/node_modules/uuid/dist/esm-browser/v5.js +9 -0
- package/node_modules/uuid/dist/esm-browser/v6.d.ts +4 -0
- package/node_modules/uuid/dist/esm-browser/v6.js +17 -0
- package/node_modules/uuid/dist/esm-browser/v6ToV1.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/v6ToV1.js +10 -0
- package/node_modules/uuid/dist/esm-browser/v7.d.ts +9 -0
- package/node_modules/uuid/dist/esm-browser/v7.js +65 -0
- package/node_modules/uuid/dist/esm-browser/validate.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/validate.js +5 -0
- package/node_modules/uuid/dist/esm-browser/version.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/version.js +8 -0
- package/node_modules/uuid/package.json +132 -0
- package/package.json +8 -4
package/lib/declarations.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ interface INodePackageManager {
|
|
|
31
31
|
install(
|
|
32
32
|
packageName: string,
|
|
33
33
|
pathToSave: string,
|
|
34
|
-
config: INodePackageManagerInstallOptions
|
|
34
|
+
config: INodePackageManagerInstallOptions,
|
|
35
35
|
): Promise<INpmInstallResultInfo>;
|
|
36
36
|
|
|
37
37
|
/**
|
|
@@ -44,7 +44,7 @@ interface INodePackageManager {
|
|
|
44
44
|
uninstall(
|
|
45
45
|
packageName: string,
|
|
46
46
|
config?: IDictionary<string | boolean>,
|
|
47
|
-
path?: string
|
|
47
|
+
path?: string,
|
|
48
48
|
): Promise<string>;
|
|
49
49
|
|
|
50
50
|
/**
|
|
@@ -84,7 +84,7 @@ interface INodePackageManager {
|
|
|
84
84
|
*/
|
|
85
85
|
search(
|
|
86
86
|
filter: string[],
|
|
87
|
-
config: IDictionary<string | boolean
|
|
87
|
+
config: IDictionary<string | boolean>,
|
|
88
88
|
): Promise<string>;
|
|
89
89
|
|
|
90
90
|
/**
|
|
@@ -130,7 +130,7 @@ interface IPerformanceService {
|
|
|
130
130
|
methodInfo: string,
|
|
131
131
|
startTime: number,
|
|
132
132
|
endTime: number,
|
|
133
|
-
args: any[]
|
|
133
|
+
args: any[],
|
|
134
134
|
): void;
|
|
135
135
|
|
|
136
136
|
// Will return a reference time in milliseconds
|
|
@@ -141,39 +141,39 @@ interface IPackageInstallationManager {
|
|
|
141
141
|
install(
|
|
142
142
|
packageName: string,
|
|
143
143
|
packageDir: string,
|
|
144
|
-
options?: INpmInstallOptions
|
|
144
|
+
options?: INpmInstallOptions,
|
|
145
145
|
): Promise<any>;
|
|
146
146
|
uninstall(
|
|
147
147
|
packageName: string,
|
|
148
148
|
packageDir: string,
|
|
149
|
-
options?: IDictionary<string | boolean
|
|
149
|
+
options?: IDictionary<string | boolean>,
|
|
150
150
|
): Promise<any>;
|
|
151
151
|
getLatestVersion(packageName: string): Promise<string>;
|
|
152
152
|
getNextVersion(packageName: string): Promise<string>;
|
|
153
153
|
getLatestCompatibleVersion(
|
|
154
154
|
packageName: string,
|
|
155
|
-
referenceVersion?: string
|
|
155
|
+
referenceVersion?: string,
|
|
156
156
|
): Promise<string>;
|
|
157
157
|
getMaxSatisfyingVersion(
|
|
158
158
|
packageName: string,
|
|
159
|
-
versionRange: string
|
|
159
|
+
versionRange: string,
|
|
160
160
|
): Promise<string>;
|
|
161
161
|
getLatestCompatibleVersionSafe(
|
|
162
162
|
packageName: string,
|
|
163
|
-
referenceVersion?: string
|
|
163
|
+
referenceVersion?: string,
|
|
164
164
|
): Promise<string>;
|
|
165
165
|
getInspectorFromCache(
|
|
166
166
|
inspectorNpmPackageName: string,
|
|
167
|
-
projectDir: string
|
|
167
|
+
projectDir: string,
|
|
168
168
|
): Promise<string>;
|
|
169
169
|
clearInspectorCache(): void;
|
|
170
170
|
getInstalledDependencyVersion(
|
|
171
171
|
packageName: string,
|
|
172
|
-
projectDir?: string
|
|
172
|
+
projectDir?: string,
|
|
173
173
|
): Promise<string>;
|
|
174
174
|
getMaxSatisfyingVersionSafe(
|
|
175
175
|
packageName: string,
|
|
176
|
-
versionIdentifier: string
|
|
176
|
+
versionIdentifier: string,
|
|
177
177
|
): Promise<string>;
|
|
178
178
|
}
|
|
179
179
|
|
|
@@ -181,8 +181,7 @@ interface IPackageInstallationManager {
|
|
|
181
181
|
* Describes options that can be passed to manipulate package installation.
|
|
182
182
|
*/
|
|
183
183
|
interface INodePackageManagerInstallOptions
|
|
184
|
-
extends INpmInstallConfigurationOptions,
|
|
185
|
-
IDictionary<string | boolean> {
|
|
184
|
+
extends INpmInstallConfigurationOptions, IDictionary<string | boolean> {
|
|
186
185
|
/**
|
|
187
186
|
* Destination of the installation.
|
|
188
187
|
* @type {string}
|
|
@@ -266,7 +265,7 @@ interface INpmPeerDependencyInfo {
|
|
|
266
265
|
* @type {string}
|
|
267
266
|
*/
|
|
268
267
|
requires: string;
|
|
269
|
-
}
|
|
268
|
+
},
|
|
270
269
|
];
|
|
271
270
|
/**
|
|
272
271
|
* Dependencies of the dependency.
|
|
@@ -550,8 +549,7 @@ interface INpmInstallConfigurationOptionsBase {
|
|
|
550
549
|
ignoreScripts: boolean; //npm flag
|
|
551
550
|
}
|
|
552
551
|
|
|
553
|
-
interface INpmInstallConfigurationOptions
|
|
554
|
-
extends INpmInstallConfigurationOptionsBase {
|
|
552
|
+
interface INpmInstallConfigurationOptions extends INpmInstallConfigurationOptionsBase {
|
|
555
553
|
disableNpmInstall: boolean;
|
|
556
554
|
}
|
|
557
555
|
|
|
@@ -597,7 +595,8 @@ interface ITypingsOptions {
|
|
|
597
595
|
}
|
|
598
596
|
|
|
599
597
|
interface IOptions
|
|
600
|
-
extends
|
|
598
|
+
extends
|
|
599
|
+
IRelease,
|
|
601
600
|
IDeviceIdentifier,
|
|
602
601
|
IJustLaunch,
|
|
603
602
|
IAvd,
|
|
@@ -622,7 +621,7 @@ interface IOptions
|
|
|
622
621
|
argv: IYargArgv;
|
|
623
622
|
validateOptions(
|
|
624
623
|
commandSpecificDashedOptions?: IDictionary<IDashedOption>,
|
|
625
|
-
projectData?: IProjectData
|
|
624
|
+
projectData?: IProjectData,
|
|
626
625
|
): void;
|
|
627
626
|
options: IDictionary<IDashedOption>;
|
|
628
627
|
shorthands: string[];
|
|
@@ -709,6 +708,7 @@ interface IOptions
|
|
|
709
708
|
dryRun: boolean;
|
|
710
709
|
|
|
711
710
|
platformOverride: string;
|
|
711
|
+
skipNative: boolean;
|
|
712
712
|
uniqueBundle: boolean;
|
|
713
713
|
// allow arbitrary options
|
|
714
714
|
[optionName: string]: any;
|
|
@@ -719,26 +719,22 @@ interface IEnvOptions {
|
|
|
719
719
|
}
|
|
720
720
|
|
|
721
721
|
interface IAndroidBuildOptionsSettings
|
|
722
|
-
extends IAndroidReleaseOptions,
|
|
723
|
-
IRelease,
|
|
724
|
-
Partial<IHasAndroidBundle> {}
|
|
722
|
+
extends IAndroidReleaseOptions, IRelease, Partial<IHasAndroidBundle> {}
|
|
725
723
|
|
|
726
724
|
interface IHasAndroidBundle {
|
|
727
725
|
androidBundle: boolean;
|
|
728
726
|
}
|
|
729
727
|
|
|
730
728
|
interface IPlatformBuildData
|
|
731
|
-
extends IRelease,
|
|
732
|
-
IHasUseHotModuleReloadOption,
|
|
733
|
-
IBuildConfig,
|
|
734
|
-
IEnvOptions {}
|
|
729
|
+
extends IRelease, IHasUseHotModuleReloadOption, IBuildConfig, IEnvOptions {}
|
|
735
730
|
|
|
736
731
|
interface IDeviceEmulator extends IHasEmulatorOption, IDeviceIdentifier {}
|
|
737
732
|
|
|
738
733
|
interface IRunPlatformOptions extends IJustLaunch, IDeviceEmulator {}
|
|
739
734
|
|
|
740
735
|
interface IDeployPlatformOptions
|
|
741
|
-
extends
|
|
736
|
+
extends
|
|
737
|
+
IAndroidReleaseOptions,
|
|
742
738
|
IRelease,
|
|
743
739
|
IClean,
|
|
744
740
|
IDeviceEmulator,
|
|
@@ -834,7 +830,7 @@ interface IAndroidToolsInfo {
|
|
|
834
830
|
*/
|
|
835
831
|
validateJavacVersion(
|
|
836
832
|
installedJavaVersion: string,
|
|
837
|
-
options?: IAndroidToolsInfoOptions
|
|
833
|
+
options?: IAndroidToolsInfoOptions,
|
|
838
834
|
): boolean;
|
|
839
835
|
|
|
840
836
|
/**
|
|
@@ -913,14 +909,14 @@ interface IAppDebugSocketProxyFactory extends NodeJS.EventEmitter {
|
|
|
913
909
|
device: Mobile.IiOSDevice,
|
|
914
910
|
appId: string,
|
|
915
911
|
projectName: string,
|
|
916
|
-
projectDir: string
|
|
912
|
+
projectDir: string,
|
|
917
913
|
): Promise<any>;
|
|
918
914
|
|
|
919
915
|
ensureWebSocketProxy(
|
|
920
916
|
device: Mobile.IiOSDevice,
|
|
921
917
|
appId: string,
|
|
922
918
|
projectName: string,
|
|
923
|
-
projectDir: string
|
|
919
|
+
projectDir: string,
|
|
924
920
|
): Promise<any>;
|
|
925
921
|
|
|
926
922
|
removeAllProxies(): void;
|
|
@@ -939,12 +935,12 @@ interface IiOSSocketRequestExecutor {
|
|
|
939
935
|
executeAttachRequest(
|
|
940
936
|
device: Mobile.IiOSDevice,
|
|
941
937
|
timeout: number,
|
|
942
|
-
projectId: string
|
|
938
|
+
projectId: string,
|
|
943
939
|
): Promise<void>;
|
|
944
940
|
executeRefreshRequest(
|
|
945
941
|
device: Mobile.IiOSDevice,
|
|
946
942
|
timeout: number,
|
|
947
|
-
appId: string
|
|
943
|
+
appId: string,
|
|
948
944
|
): Promise<boolean>;
|
|
949
945
|
}
|
|
950
946
|
|
|
@@ -995,7 +991,7 @@ interface IProjectNameService {
|
|
|
995
991
|
*/
|
|
996
992
|
ensureValidName(
|
|
997
993
|
projectName: string,
|
|
998
|
-
validateOptions?: { force: boolean }
|
|
994
|
+
validateOptions?: { force: boolean },
|
|
999
995
|
): Promise<string>;
|
|
1000
996
|
}
|
|
1001
997
|
|
|
@@ -1089,7 +1085,7 @@ interface IBundleValidatorHelper {
|
|
|
1089
1085
|
*/
|
|
1090
1086
|
getBundlerDependencyVersion(
|
|
1091
1087
|
projectData: IProjectData,
|
|
1092
|
-
bundlerName?: string
|
|
1088
|
+
bundlerName?: string,
|
|
1093
1089
|
): string;
|
|
1094
1090
|
}
|
|
1095
1091
|
|
|
@@ -1171,7 +1167,7 @@ interface IAssetsGenerationService {
|
|
|
1171
1167
|
* @returns {Promise<void>}
|
|
1172
1168
|
*/
|
|
1173
1169
|
generateSplashScreens(
|
|
1174
|
-
splashesGenerationData: IResourceGenerationData
|
|
1170
|
+
splashesGenerationData: IResourceGenerationData,
|
|
1175
1171
|
): Promise<void>;
|
|
1176
1172
|
}
|
|
1177
1173
|
|
|
@@ -1207,7 +1203,7 @@ interface IPlatformValidationService {
|
|
|
1207
1203
|
provision: true | string,
|
|
1208
1204
|
teamId: true | string,
|
|
1209
1205
|
projectData: IProjectData,
|
|
1210
|
-
platform?: string
|
|
1206
|
+
platform?: string,
|
|
1211
1207
|
): Promise<boolean>;
|
|
1212
1208
|
|
|
1213
1209
|
validatePlatformInstalled(platform: string, projectData: IProjectData): void;
|
|
@@ -1220,7 +1216,7 @@ interface IPlatformValidationService {
|
|
|
1220
1216
|
*/
|
|
1221
1217
|
isPlatformSupportedForOS(
|
|
1222
1218
|
platform: string,
|
|
1223
|
-
projectData: IProjectData
|
|
1219
|
+
projectData: IProjectData,
|
|
1224
1220
|
): boolean;
|
|
1225
1221
|
}
|
|
1226
1222
|
|
|
@@ -1228,27 +1224,27 @@ interface IPlatformCommandHelper {
|
|
|
1228
1224
|
addPlatforms(
|
|
1229
1225
|
platforms: string[],
|
|
1230
1226
|
projectData: IProjectData,
|
|
1231
|
-
frameworkPath?: string
|
|
1227
|
+
frameworkPath?: string,
|
|
1232
1228
|
): Promise<void>;
|
|
1233
1229
|
cleanPlatforms(
|
|
1234
1230
|
platforms: string[],
|
|
1235
1231
|
projectData: IProjectData,
|
|
1236
|
-
frameworkPath: string
|
|
1232
|
+
frameworkPath: string,
|
|
1237
1233
|
): Promise<void>;
|
|
1238
1234
|
removePlatforms(
|
|
1239
1235
|
platforms: string[],
|
|
1240
|
-
projectData: IProjectData
|
|
1236
|
+
projectData: IProjectData,
|
|
1241
1237
|
): Promise<void>;
|
|
1242
1238
|
updatePlatforms(
|
|
1243
1239
|
platforms: string[],
|
|
1244
|
-
projectData: IProjectData
|
|
1240
|
+
projectData: IProjectData,
|
|
1245
1241
|
): Promise<void>;
|
|
1246
1242
|
getInstalledPlatforms(projectData: IProjectData): string[];
|
|
1247
1243
|
getAvailablePlatforms(projectData: IProjectData): string[];
|
|
1248
1244
|
getPreparedPlatforms(projectData: IProjectData): string[];
|
|
1249
1245
|
getCurrentPlatformVersion(
|
|
1250
1246
|
platform: string,
|
|
1251
|
-
projectData: IProjectData
|
|
1247
|
+
projectData: IProjectData,
|
|
1252
1248
|
): string;
|
|
1253
1249
|
}
|
|
1254
1250
|
|
|
@@ -130,6 +130,10 @@ interface INsConfigIOS extends INsConfigPlaform {
|
|
|
130
130
|
* List packages to be included in the iOS build.
|
|
131
131
|
*/
|
|
132
132
|
SPMPackages?: Array<IOSSPMPackage>;
|
|
133
|
+
/**
|
|
134
|
+
* Custom runtime package name
|
|
135
|
+
*/
|
|
136
|
+
runtimePackageName?: string;
|
|
133
137
|
}
|
|
134
138
|
|
|
135
139
|
interface INSConfigVisionOS extends INsConfigIOS {}
|
|
@@ -168,6 +172,11 @@ interface INsConfigAndroid extends INsConfigPlaform {
|
|
|
168
172
|
enableLineBreakpoints?: boolean;
|
|
169
173
|
|
|
170
174
|
enableMultithreadedJavascript?: boolean;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Custom runtime package name
|
|
178
|
+
*/
|
|
179
|
+
runtimePackageName?: string;
|
|
171
180
|
}
|
|
172
181
|
|
|
173
182
|
interface INsConfigHooks {
|
|
@@ -191,6 +200,13 @@ interface INsConfig {
|
|
|
191
200
|
ignoredNativeDependencies?: string[];
|
|
192
201
|
hooks?: INsConfigHooks[];
|
|
193
202
|
projectName?: string;
|
|
203
|
+
/**
|
|
204
|
+
* Legacy keys still found in user configs. Declared so the
|
|
205
|
+
* runtime-package.json generation (PrepareController) can strip them
|
|
206
|
+
* via destructuring without losing type safety.
|
|
207
|
+
*/
|
|
208
|
+
webpackPackageName?: string;
|
|
209
|
+
buildPath?: string;
|
|
194
210
|
}
|
|
195
211
|
|
|
196
212
|
interface IProjectData extends ICreateProjectData {
|
package/lib/options.js
CHANGED
|
@@ -225,6 +225,7 @@ class Options {
|
|
|
225
225
|
default: true,
|
|
226
226
|
},
|
|
227
227
|
dryRun: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
228
|
+
skipNative: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
228
229
|
uniqueBundle: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
229
230
|
};
|
|
230
231
|
}
|
|
@@ -276,31 +276,37 @@ class AndroidPluginBuildService {
|
|
|
276
276
|
}
|
|
277
277
|
if (!runtimeGradleVersions) {
|
|
278
278
|
const latestRuntimeVersion = await this.getLatestRuntimeVersion();
|
|
279
|
-
runtimeGradleVersions =
|
|
279
|
+
runtimeGradleVersions =
|
|
280
|
+
await this.getGradleVersions(latestRuntimeVersion);
|
|
280
281
|
this.$logger.trace(`Got gradle versions ${JSON.stringify(runtimeGradleVersions)} from the latest runtime v${latestRuntimeVersion}`);
|
|
281
282
|
}
|
|
282
283
|
return runtimeGradleVersions || {};
|
|
283
284
|
}
|
|
284
285
|
async getLatestRuntimeVersion() {
|
|
285
|
-
var _a;
|
|
286
|
+
var _a, _b, _c;
|
|
286
287
|
let runtimeVersion = null;
|
|
288
|
+
const packageName = ((_b = (_a = this.$projectData.nsConfig) === null || _a === void 0 ? void 0 : _a.android) === null || _b === void 0 ? void 0 : _b.runtimePackageName) ||
|
|
289
|
+
constants_1.SCOPED_ANDROID_RUNTIME_NAME;
|
|
287
290
|
try {
|
|
288
|
-
let result = await this.$packageManager.view(
|
|
291
|
+
let result = await this.$packageManager.view(packageName, {
|
|
289
292
|
"dist-tags": true,
|
|
290
293
|
});
|
|
291
|
-
result = (
|
|
294
|
+
result = (_c = result === null || result === void 0 ? void 0 : result["dist-tags"]) !== null && _c !== void 0 ? _c : result;
|
|
292
295
|
runtimeVersion = result.latest;
|
|
293
296
|
}
|
|
294
297
|
catch (err) {
|
|
295
298
|
this.$logger.trace(`Error while getting latest android runtime version from view command: ${err}`);
|
|
296
|
-
const registryData = await this.$packageManager.getRegistryPackageData(
|
|
299
|
+
const registryData = await this.$packageManager.getRegistryPackageData(packageName);
|
|
297
300
|
runtimeVersion = registryData["dist-tags"].latest;
|
|
298
301
|
}
|
|
299
302
|
return runtimeVersion;
|
|
300
303
|
}
|
|
301
304
|
getLocalGradleVersions() {
|
|
305
|
+
var _a, _b;
|
|
306
|
+
const packageName = ((_b = (_a = this.$projectData.nsConfig) === null || _a === void 0 ? void 0 : _a.android) === null || _b === void 0 ? void 0 : _b.runtimePackageName) ||
|
|
307
|
+
constants_1.SCOPED_ANDROID_RUNTIME_NAME;
|
|
302
308
|
// try reading from installed runtime first before reading from the npm registry...
|
|
303
|
-
const installedRuntimePackageJSONPath = (0, resolve_package_path_1.resolvePackageJSONPath)(
|
|
309
|
+
const installedRuntimePackageJSONPath = (0, resolve_package_path_1.resolvePackageJSONPath)(packageName, {
|
|
304
310
|
paths: [this.$projectData.projectDir],
|
|
305
311
|
});
|
|
306
312
|
if (!installedRuntimePackageJSONPath) {
|
|
@@ -327,16 +333,18 @@ class AndroidPluginBuildService {
|
|
|
327
333
|
return null;
|
|
328
334
|
}
|
|
329
335
|
async getGradleVersions(runtimeVersion) {
|
|
330
|
-
var _a, _b;
|
|
336
|
+
var _a, _b, _c, _d;
|
|
331
337
|
let runtimeGradleVersions = null;
|
|
332
338
|
const localVersionInfo = this.getLocalGradleVersions();
|
|
333
339
|
if (localVersionInfo) {
|
|
334
340
|
return localVersionInfo;
|
|
335
341
|
}
|
|
342
|
+
const packageName = ((_b = (_a = this.$projectData.nsConfig) === null || _a === void 0 ? void 0 : _a.android) === null || _b === void 0 ? void 0 : _b.runtimePackageName) ||
|
|
343
|
+
constants_1.SCOPED_ANDROID_RUNTIME_NAME;
|
|
336
344
|
// fallback to reading from npm...
|
|
337
345
|
try {
|
|
338
|
-
let output = await this.$packageManager.view(`${
|
|
339
|
-
output = (
|
|
346
|
+
let output = await this.$packageManager.view(`${packageName}@${runtimeVersion}`, { version_info: true });
|
|
347
|
+
output = (_c = output === null || output === void 0 ? void 0 : output["version_info"]) !== null && _c !== void 0 ? _c : output;
|
|
340
348
|
if (!output) {
|
|
341
349
|
/**
|
|
342
350
|
* fallback to the old 'gradle' key in package.json
|
|
@@ -346,8 +354,8 @@ class AndroidPluginBuildService {
|
|
|
346
354
|
* gradle: { version: '6.4', android: '3.6.4' }
|
|
347
355
|
*
|
|
348
356
|
*/
|
|
349
|
-
output = await this.$packageManager.view(`${
|
|
350
|
-
output = (
|
|
357
|
+
output = await this.$packageManager.view(`${packageName}@${runtimeVersion}`, { gradle: true });
|
|
358
|
+
output = (_d = output === null || output === void 0 ? void 0 : output["gradle"]) !== null && _d !== void 0 ? _d : output;
|
|
351
359
|
const { version, android } = output;
|
|
352
360
|
// covert output to the new format...
|
|
353
361
|
output = {
|
|
@@ -359,7 +367,7 @@ class AndroidPluginBuildService {
|
|
|
359
367
|
}
|
|
360
368
|
catch (err) {
|
|
361
369
|
this.$logger.trace(`Error while getting gradle data for android runtime from view command: ${err}`);
|
|
362
|
-
const registryData = await this.$packageManager.getRegistryPackageData(
|
|
370
|
+
const registryData = await this.$packageManager.getRegistryPackageData(packageName);
|
|
363
371
|
runtimeGradleVersions = registryData.versions[runtimeVersion];
|
|
364
372
|
}
|
|
365
373
|
const result = this.getGradleVersionsCore(runtimeGradleVersions);
|
|
@@ -8,6 +8,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.BundlerCompilerService = void 0;
|
|
10
10
|
const path = require("path");
|
|
11
|
+
const net = require("net");
|
|
11
12
|
const semver = require("semver");
|
|
12
13
|
const _ = require("lodash");
|
|
13
14
|
const events_1 = require("events");
|
|
@@ -34,8 +35,15 @@ class BundlerCompilerService extends events_1.EventEmitter {
|
|
|
34
35
|
this.$packageInstallationManager = $packageInstallationManager;
|
|
35
36
|
this.$projectConfigService = $projectConfigService;
|
|
36
37
|
this.bundlerProcesses = {};
|
|
38
|
+
// Vite-only: the long-lived `vite serve` dev server the device fetches
|
|
39
|
+
// modules and HMR updates from. Keyed by platform, managed by this CLI
|
|
40
|
+
// so users no longer need a separate `concurrently`/`wait-on` process.
|
|
41
|
+
this.viteServeProcesses = {};
|
|
37
42
|
this.expectedHashes = {};
|
|
38
43
|
}
|
|
44
|
+
getViteDistOutputPath(projectDir) {
|
|
45
|
+
return path.join(projectDir, process.env.NS_VITE_DIST_DIR || constants_1.VITE_DIST_FOLDER_NAME);
|
|
46
|
+
}
|
|
39
47
|
async compileWithWatch(platformData, projectData, prepareData) {
|
|
40
48
|
return new Promise(async (resolve, reject) => {
|
|
41
49
|
if (this.bundlerProcesses[platformData.platformNameLowerCase]) {
|
|
@@ -44,6 +52,14 @@ class BundlerCompilerService extends events_1.EventEmitter {
|
|
|
44
52
|
}
|
|
45
53
|
let isFirstBundlerWatchCompilation = true;
|
|
46
54
|
prepareData.watch = true;
|
|
55
|
+
// Bring up the Vite HMR dev server the device fetches modules /
|
|
56
|
+
// HMR updates from. No-op unless bundler is vite + hmr + watch.
|
|
57
|
+
// Fired in parallel with the build watcher; both child processes
|
|
58
|
+
// inherit the adb-reverse env the run-controller set before
|
|
59
|
+
// prepare, so neither one spawns adb on its own. Intentionally not
|
|
60
|
+
// awaited — the device only connects to it at app launch, well
|
|
61
|
+
// after the first build.
|
|
62
|
+
this.startViteDevServer(platformData, projectData, prepareData);
|
|
47
63
|
try {
|
|
48
64
|
const childProcess = await this.startBundleProcess(platformData, projectData, prepareData);
|
|
49
65
|
// Handle Vite differently from webpack
|
|
@@ -67,7 +83,7 @@ class BundlerCompilerService extends events_1.EventEmitter {
|
|
|
67
83
|
console.log("Received Vite IPC message:", message);
|
|
68
84
|
}
|
|
69
85
|
// Copy Vite output files directly to platform destination
|
|
70
|
-
const distOutput =
|
|
86
|
+
const distOutput = this.getViteDistOutputPath(projectData.projectDir);
|
|
71
87
|
const destDir = path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName);
|
|
72
88
|
if (debugLog) {
|
|
73
89
|
console.log(`Copying from ${distOutput} to ${destDir}.`);
|
|
@@ -232,7 +248,7 @@ class BundlerCompilerService extends events_1.EventEmitter {
|
|
|
232
248
|
// launch with `Check failed: has_pending_exception()`.
|
|
233
249
|
if (isVite) {
|
|
234
250
|
try {
|
|
235
|
-
const distOutput =
|
|
251
|
+
const distOutput = this.getViteDistOutputPath(projectData.projectDir);
|
|
236
252
|
const destDir = path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName);
|
|
237
253
|
this.copyViteBundleToNative(distOutput, destDir);
|
|
238
254
|
}
|
|
@@ -343,6 +359,141 @@ class BundlerCompilerService extends events_1.EventEmitter {
|
|
|
343
359
|
await this.$cleanupService.addKillProcess(childProcess.pid.toString());
|
|
344
360
|
return childProcess;
|
|
345
361
|
}
|
|
362
|
+
getViteHmrPort() {
|
|
363
|
+
const fromEnv = Number(process.env.NS_HMR_PORT);
|
|
364
|
+
return Number.isFinite(fromEnv) && fromEnv > 0 ? fromEnv : 5173;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Spawn and manage the Vite dev server (`vite serve`) for HMR.
|
|
368
|
+
*
|
|
369
|
+
* Why the CLI owns this. With Vite, HMR needs a long-lived dev server
|
|
370
|
+
* (HTTP + the `/ns-hmr` websocket on port 5173) that the device fetches
|
|
371
|
+
* modules and hot updates from — it is SEPARATE from the
|
|
372
|
+
* `vite build --watch` process that emits the `bundle.mjs` bootstrap
|
|
373
|
+
* baked into the app. Historically users wired this up themselves with
|
|
374
|
+
* `concurrently`/`wait-on`, which left two uncoordinated processes both
|
|
375
|
+
* touching adb during cold start (the source of the Android
|
|
376
|
+
* "Searching for devices…" freeze). By spawning it here as a child of
|
|
377
|
+
* the CLI, the dev server inherits the CLI's environment — crucially
|
|
378
|
+
* `NS_ADB_REVERSE_READY`/`NS_DEVICE_SERIAL`/`NS_ADB_PATH` set by the
|
|
379
|
+
* run-controller — so the CLI is the single adb owner and the dev
|
|
380
|
+
* server never spawns adb itself.
|
|
381
|
+
*
|
|
382
|
+
* No-op unless bundler is vite, HMR is on, watch mode, and not release.
|
|
383
|
+
* Best-effort: failures are logged, never thrown — a dev-server hiccup
|
|
384
|
+
* must not fail the run.
|
|
385
|
+
*/
|
|
386
|
+
async startViteDevServer(platformData, projectData, prepareData) {
|
|
387
|
+
try {
|
|
388
|
+
if (this.getBundler() !== "vite") {
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
if (!prepareData.watch || !prepareData.hmr || prepareData.release) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
const key = platformData.platformNameLowerCase;
|
|
395
|
+
if (this.viteServeProcesses[key]) {
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
const port = this.getViteHmrPort();
|
|
399
|
+
// One dev server per port. Simultaneous multi-platform HMR in a
|
|
400
|
+
// single CLI invocation would collide on 5173 — that case still
|
|
401
|
+
// needs a distinct NS_HMR_PORT per platform, so skip + warn rather
|
|
402
|
+
// than fail to bind.
|
|
403
|
+
const collidingPlatform = Object.keys(this.viteServeProcesses)[0];
|
|
404
|
+
if (collidingPlatform) {
|
|
405
|
+
this.$logger.warn(`Vite dev server already running for '${collidingPlatform}' on port ${port}; skipping a second server for '${key}'. For simultaneous multi-platform HMR, set a distinct NS_HMR_PORT per platform.`);
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
const envData = this.buildEnvData(platformData.platformNameLowerCase, projectData, prepareData);
|
|
409
|
+
const cliArgs = await this.buildEnvCommandLineParams(envData, platformData, projectData, prepareData);
|
|
410
|
+
const additionalNodeArgs = semver.major(process.version) <= 8 ? ["--harmony"] : [];
|
|
411
|
+
if (await this.shouldUsePreserveSymlinksOption()) {
|
|
412
|
+
additionalNodeArgs.push("--preserve-symlinks");
|
|
413
|
+
}
|
|
414
|
+
// `vite serve` (not `build`): runs the dev server and watches on
|
|
415
|
+
// its own — no `--watch`. Env flags (`--env.android --env.hmr …`)
|
|
416
|
+
// go after `--` so vite's CLI doesn't choke on unknown options.
|
|
417
|
+
const args = [
|
|
418
|
+
...additionalNodeArgs,
|
|
419
|
+
this.getBundlerExecutablePath(projectData),
|
|
420
|
+
"serve",
|
|
421
|
+
`--config=${projectData.bundlerConfigPath}`,
|
|
422
|
+
`--mode=development`,
|
|
423
|
+
"--",
|
|
424
|
+
...cliArgs,
|
|
425
|
+
].filter(Boolean);
|
|
426
|
+
const options = {
|
|
427
|
+
cwd: projectData.projectDir,
|
|
428
|
+
// Inherit so the dev server's URLs/logs stream to the user as
|
|
429
|
+
// before. No IPC needed here — the build watcher provides the
|
|
430
|
+
// bundle-complete IPC; the dev server is fetched over HTTP/ws.
|
|
431
|
+
stdio: "inherit",
|
|
432
|
+
env: {
|
|
433
|
+
...process.env,
|
|
434
|
+
NATIVESCRIPT_BUNDLER_ENV: JSON.stringify(envData),
|
|
435
|
+
},
|
|
436
|
+
};
|
|
437
|
+
if (this.$hostInfo.isWindows) {
|
|
438
|
+
Object.assign(options.env, { APPDATA: process.env.appData });
|
|
439
|
+
}
|
|
440
|
+
this.$logger.info(`Starting Vite dev server (HMR) for ${key} on port ${port}…`);
|
|
441
|
+
const childProcess = this.$childProcess.spawn(process.execPath, args, options);
|
|
442
|
+
this.viteServeProcesses[key] = childProcess;
|
|
443
|
+
await this.$cleanupService.addKillProcess(childProcess.pid.toString());
|
|
444
|
+
childProcess.once("exit", (code) => {
|
|
445
|
+
delete this.viteServeProcesses[key];
|
|
446
|
+
if (code) {
|
|
447
|
+
this.$logger.warn(`Vite dev server for ${key} exited with code ${code}.`);
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
// Bounded readiness probe so we can surface a clear log once the
|
|
451
|
+
// device can actually reach modules.
|
|
452
|
+
const ready = await this.waitForPort(port, 30000);
|
|
453
|
+
if (ready) {
|
|
454
|
+
this.$logger.info(`Vite dev server ready on port ${port} (HMR for ${key}).`);
|
|
455
|
+
}
|
|
456
|
+
else {
|
|
457
|
+
this.$logger.trace(`Vite dev server port ${port} not observed open within the readiness probe window; continuing (it may bind shortly).`);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
catch (err) {
|
|
461
|
+
this.$logger.warn(`Failed to start the Vite dev server: ${err}. HMR may be unavailable.`);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Resolve true once `127.0.0.1:<port>` accepts a TCP connection, or
|
|
466
|
+
* false after `timeoutMs`. Used to detect the Vite dev server is up.
|
|
467
|
+
*/
|
|
468
|
+
waitForPort(port, timeoutMs) {
|
|
469
|
+
const deadline = Date.now() + timeoutMs;
|
|
470
|
+
return new Promise((resolve) => {
|
|
471
|
+
const attempt = () => {
|
|
472
|
+
const socket = net.connect({ port, host: "127.0.0.1" });
|
|
473
|
+
let settled = false;
|
|
474
|
+
const done = (ok) => {
|
|
475
|
+
if (settled) {
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
settled = true;
|
|
479
|
+
socket.destroy();
|
|
480
|
+
if (ok) {
|
|
481
|
+
resolve(true);
|
|
482
|
+
}
|
|
483
|
+
else if (Date.now() >= deadline) {
|
|
484
|
+
resolve(false);
|
|
485
|
+
}
|
|
486
|
+
else {
|
|
487
|
+
setTimeout(attempt, 250);
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
socket.once("connect", () => done(true));
|
|
491
|
+
socket.once("error", () => done(false));
|
|
492
|
+
socket.setTimeout(1000, () => done(false));
|
|
493
|
+
};
|
|
494
|
+
attempt();
|
|
495
|
+
});
|
|
496
|
+
}
|
|
346
497
|
buildEnvData(platform, projectData, prepareData) {
|
|
347
498
|
var _a, _b, _c;
|
|
348
499
|
const { env } = prepareData;
|
|
@@ -474,6 +625,13 @@ class BundlerCompilerService extends events_1.EventEmitter {
|
|
|
474
625
|
bundlerProcess.kill("SIGINT");
|
|
475
626
|
delete this.bundlerProcesses[platform];
|
|
476
627
|
}
|
|
628
|
+
// Tear down the Vite dev server we manage alongside the build watcher.
|
|
629
|
+
const viteServeProcess = this.viteServeProcesses[platform];
|
|
630
|
+
if (viteServeProcess) {
|
|
631
|
+
await this.$cleanupService.removeKillProcess(viteServeProcess.pid.toString());
|
|
632
|
+
viteServeProcess.kill("SIGINT");
|
|
633
|
+
delete this.viteServeProcesses[platform];
|
|
634
|
+
}
|
|
477
635
|
}
|
|
478
636
|
handleHMRMessage(message, platformData, projectData, prepareData) {
|
|
479
637
|
// handle new bundler hmr packets
|
|
@@ -100,10 +100,17 @@ class XcodebuildArgsService {
|
|
|
100
100
|
// Introduced in Xcode 14+
|
|
101
101
|
// ref: https://forums.swift.org/t/telling-xcode-14-beta-4-to-trust-build-tool-plugins-programatically/59305/5
|
|
102
102
|
const skipPackageValidation = "-skipPackagePluginValidation";
|
|
103
|
+
// Introduced in Xcode 15+ to trust Swift macros (compiler plugins)
|
|
104
|
+
// non-interactively. Required for SPM packages that ship macros
|
|
105
|
+
// (e.g. apple/RealityKitScripting), otherwise the build fails with:
|
|
106
|
+
// "Macro '...' from package '...' must be enabled before it can be used"
|
|
107
|
+
// ref: https://developer.apple.com/documentation/xcode/writing-swift-macros
|
|
108
|
+
const skipMacroValidation = "-skipMacroValidation";
|
|
103
109
|
const extraArgs = [
|
|
104
110
|
"-scheme",
|
|
105
111
|
projectData.projectName,
|
|
106
112
|
skipPackageValidation,
|
|
113
|
+
skipMacroValidation,
|
|
107
114
|
];
|
|
108
115
|
const BUILD_SETTINGS_FILE_PATH = path.join(projectData.appResourcesDirectoryPath, platformData.normalizedPlatformName, constants.BUILD_XCCONFIG_FILE_NAME);
|
|
109
116
|
// Only include explicit properties from build.xcconfig
|
|
@@ -112,6 +119,17 @@ class XcodebuildArgsService {
|
|
|
112
119
|
// like cocoapods issues related to ASSETCATALOG_COMPILER_APPICON_NAME
|
|
113
120
|
// references: https://medium.com/@iostechset/why-cocoapods-eats-app-icons-79fe729808d4
|
|
114
121
|
// https://github.com/CocoaPods/CocoaPods/issues/7003
|
|
122
|
+
// Xcode 26 makes Swift "explicitly built modules" the default. A
|
|
123
|
+
// regression there prevents macro/compiler-plugin SPM targets from
|
|
124
|
+
// resolving their swift-syntax module dependencies, failing with:
|
|
125
|
+
// "Unable to resolve module dependency: 'SwiftSyntax'" (and SwiftParser,
|
|
126
|
+
// SwiftSyntaxMacros, SwiftCompilerPlugin, SwiftDiagnostics).
|
|
127
|
+
// Passed as a command-line build setting so it overrides ALL targets,
|
|
128
|
+
// including the package targets we don't control.
|
|
129
|
+
// ref: https://forums.swift.org/t/xcode-26-unable-to-find-module-dependency/80516
|
|
130
|
+
const explicitModulesProperty = "SWIFT_ENABLE_EXPLICIT_MODULES";
|
|
131
|
+
const explicitModulesValue = this.$xcconfigService.readPropertyValue(BUILD_SETTINGS_FILE_PATH, explicitModulesProperty) || "NO";
|
|
132
|
+
extraArgs.push(`${explicitModulesProperty}=${explicitModulesValue}`);
|
|
115
133
|
const deployTargetProperty = "IPHONEOS_DEPLOYMENT_TARGET";
|
|
116
134
|
const deployTargetVersion = this.$xcconfigService.readPropertyValue(BUILD_SETTINGS_FILE_PATH, deployTargetProperty);
|
|
117
135
|
if (deployTargetVersion) {
|
|
@@ -122,6 +140,14 @@ class XcodebuildArgsService {
|
|
|
122
140
|
if (swiftUIBootValue) {
|
|
123
141
|
extraArgs.push(`${swiftUIBootProperty}=${swiftUIBootValue}`);
|
|
124
142
|
}
|
|
143
|
+
// Swift macro/compiler-plugin SPM targets must be code-signed with a
|
|
144
|
+
// development team when building for a device. Pass DEVELOPMENT_TEAM as a
|
|
145
|
+
// command-line build setting so it applies to SPM package targets too.
|
|
146
|
+
const developmentTeamProperty = "DEVELOPMENT_TEAM";
|
|
147
|
+
const developmentTeamValue = this.$xcconfigService.readPropertyValue(BUILD_SETTINGS_FILE_PATH, developmentTeamProperty);
|
|
148
|
+
if (developmentTeamValue) {
|
|
149
|
+
extraArgs.push(`${developmentTeamProperty}=${developmentTeamValue}`);
|
|
150
|
+
}
|
|
125
151
|
if (this.$fs.exists(xcworkspacePath)) {
|
|
126
152
|
return ["-workspace", xcworkspacePath, ...extraArgs];
|
|
127
153
|
}
|