@akylas/nativescript-cli 8.8.7 → 8.9.4
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/config/test-deps-versions-generated.json +16 -0
- package/docs/man_pages/project/configuration/widget-ios.md +24 -0
- package/docs/man_pages/project/configuration/widget.md +24 -0
- package/docs/man_pages/start.md +1 -1
- package/lib/.d.ts +1 -0
- package/lib/bootstrap.js +1 -0
- package/lib/bun-package-manager.js +1 -1
- package/lib/commands/generate.js +2 -41
- package/lib/commands/widget.js +799 -0
- package/lib/common/file-system.js +1 -2
- package/lib/common/logger/logger.js +4 -4
- package/lib/common/mobile/android/android-emulator-services.js +1 -1
- package/lib/common/mobile/emulator-helper.js +1 -0
- package/lib/common/mobile/mobile-core/devices-service.js +2 -1
- package/lib/common/opener.js +2 -2
- package/lib/common/services/hooks-service.js +23 -6
- package/lib/constants.js +1 -1
- package/lib/controllers/migrate-controller.js +8 -8
- package/lib/controllers/prepare-controller.js +2 -4
- package/lib/definitions/ios.d.ts +11 -1
- package/lib/definitions/project.d.ts +50 -24
- package/lib/node-package-manager.js +1 -1
- package/lib/services/analytics/analytics-service.js +2 -1
- package/lib/services/android/gradle-build-args-service.js +1 -1
- package/lib/services/android-plugin-build-service.js +1 -1
- package/lib/services/assets-generation/assets-generation-service.js +33 -15
- package/lib/services/ios/spm-service.js +10 -1
- package/lib/services/ios-debugger-port-service.js +1 -1
- package/lib/services/ios-project-service.js +45 -14
- package/lib/services/livesync/android-livesync-tool.js +1 -1
- package/lib/services/project-config-service.js +12 -3
- package/lib/services/webpack/webpack-compiler-service.js +4 -3
- package/lib/tools/config-manipulation/config-transformer.js +9 -0
- package/package.json +47 -53
- package/vendor/gradle-app/app/build.gradle +347 -119
- package/vendor/gradle-app/build.gradle +7 -7
|
@@ -19,7 +19,6 @@ const helpers_1 = require("./helpers");
|
|
|
19
19
|
const constants_1 = require("../constants");
|
|
20
20
|
const os_1 = require("os");
|
|
21
21
|
const archiver_1 = require("archiver");
|
|
22
|
-
const stringifyPackage = require("stringify-package");
|
|
23
22
|
const mkdirp = require("mkdirp");
|
|
24
23
|
const detectNewline = require("detect-newline");
|
|
25
24
|
let FileSystem = FileSystem_1 = class FileSystem {
|
|
@@ -235,7 +234,7 @@ let FileSystem = FileSystem_1 = class FileSystem {
|
|
|
235
234
|
const existingFile = this.readText(filename);
|
|
236
235
|
newline = detectNewline(existingFile);
|
|
237
236
|
}
|
|
238
|
-
stringifiedData =
|
|
237
|
+
stringifiedData = JSON.stringify(data, null, space).concat(newline);
|
|
239
238
|
}
|
|
240
239
|
else {
|
|
241
240
|
stringifiedData = JSON.stringify(data, null, space);
|
|
@@ -18,7 +18,7 @@ const cli_layout_1 = require("./layouts/cli-layout");
|
|
|
18
18
|
const constants_1 = require("../../constants");
|
|
19
19
|
const yok_1 = require("../yok");
|
|
20
20
|
const color_1 = require("../../color");
|
|
21
|
-
const
|
|
21
|
+
const marked_terminal_1 = require("marked-terminal");
|
|
22
22
|
class Logger {
|
|
23
23
|
constructor($config) {
|
|
24
24
|
this.$config = $config;
|
|
@@ -27,7 +27,7 @@ class Logger {
|
|
|
27
27
|
this.passwordReplacement = "$1$3*******$2$4";
|
|
28
28
|
this.defaultLogLevel = this.$config.DEBUG
|
|
29
29
|
? constants_1.LoggerLevel.TRACE
|
|
30
|
-
: constants_1.LoggerLevel.
|
|
30
|
+
: constants_1.LoggerLevel.WARN;
|
|
31
31
|
}
|
|
32
32
|
initialize(opts) {
|
|
33
33
|
opts = opts || {};
|
|
@@ -123,8 +123,8 @@ class Logger {
|
|
|
123
123
|
},
|
|
124
124
|
},
|
|
125
125
|
};
|
|
126
|
-
marked_1.marked.use(markedTerminal(opts));
|
|
127
|
-
const formattedMessage =
|
|
126
|
+
marked_1.marked.use((0, marked_terminal_1.markedTerminal)(opts));
|
|
127
|
+
const formattedMessage = marked_1.marked.parse(util.format.apply(null, args));
|
|
128
128
|
this.info(formattedMessage, { [constants_1.LoggerConfigData.skipNewLine]: true });
|
|
129
129
|
}
|
|
130
130
|
isVerbose() {
|
|
@@ -146,7 +146,7 @@ class AndroidEmulatorServices {
|
|
|
146
146
|
}
|
|
147
147
|
const minVersion = semver.coerce(constants_1.AndroidVirtualDevice.MIN_ANDROID_VERSION);
|
|
148
148
|
const bestVersion = best && best.version && semver.coerce(best.version);
|
|
149
|
-
return bestVersion
|
|
149
|
+
return !bestVersion || semver.gte(bestVersion, minVersion) ? best : null;
|
|
150
150
|
}
|
|
151
151
|
async waitForEmulatorBootToComplete(emulator, endTimeEpoch, timeout) {
|
|
152
152
|
this.$logger.info("Waiting for emulator device initialization...", {
|
|
@@ -498,7 +498,8 @@ class DevicesService extends events_1.EventEmitter {
|
|
|
498
498
|
}
|
|
499
499
|
if (data.platform === this.$devicePlatformsConstants.visionOS &&
|
|
500
500
|
deviceInstances.length) {
|
|
501
|
-
const runningDeviceInstance = deviceInstances.find((device) => device.deviceInfo.platform ===
|
|
501
|
+
const runningDeviceInstance = deviceInstances.find((device) => device.deviceInfo.platform ===
|
|
502
|
+
this.$devicePlatformsConstants.visionOS);
|
|
502
503
|
if (!runningDeviceInstance) {
|
|
503
504
|
return this.startEmulatorCore(data);
|
|
504
505
|
}
|
package/lib/common/opener.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Opener = void 0;
|
|
4
|
-
const
|
|
4
|
+
const xopen = require("open");
|
|
5
5
|
const yok_1 = require("./yok");
|
|
6
6
|
class Opener {
|
|
7
7
|
open(target, appname) {
|
|
8
|
-
return (
|
|
8
|
+
return xopen(target, {
|
|
9
9
|
app: {
|
|
10
10
|
name: appname,
|
|
11
11
|
},
|
|
@@ -93,24 +93,38 @@ class HooksService {
|
|
|
93
93
|
}
|
|
94
94
|
return _.flatten(results);
|
|
95
95
|
}
|
|
96
|
+
isESModule(hook) {
|
|
97
|
+
const ext = path.extname(hook.fullPath).toLowerCase();
|
|
98
|
+
return ext === ".mjs";
|
|
99
|
+
}
|
|
96
100
|
async executeHook(directoryPath, hookName, hook, hookArguments) {
|
|
97
101
|
hookArguments = hookArguments || {};
|
|
98
102
|
let result;
|
|
99
103
|
const relativePath = path.relative(directoryPath, hook.fullPath);
|
|
100
104
|
const trackId = relativePath.replace(new RegExp("\\" + path.sep, "g"), constants_1.AnalyticsEventLabelDelimiter);
|
|
105
|
+
const isESM = this.isESModule(hook);
|
|
101
106
|
let command = this.getSheBangInterpreter(hook);
|
|
102
107
|
let inProc = false;
|
|
103
108
|
if (!command) {
|
|
104
109
|
command = hook.fullPath;
|
|
105
|
-
if (path.extname(hook.fullPath).toLowerCase()
|
|
110
|
+
if ([".mjs", ".cjs", ".js"].includes(path.extname(hook.fullPath).toLowerCase())) {
|
|
106
111
|
command = process.argv[0];
|
|
107
|
-
inProc =
|
|
112
|
+
inProc = isESM
|
|
113
|
+
? true
|
|
114
|
+
: this.shouldExecuteInProcess(this.$fs.readText(hook.fullPath));
|
|
108
115
|
}
|
|
109
116
|
}
|
|
110
117
|
const startTime = this.$performanceService.now();
|
|
111
118
|
if (inProc) {
|
|
112
119
|
this.$logger.trace("Executing %s hook at location %s in-process", hookName, hook.fullPath);
|
|
113
|
-
|
|
120
|
+
let hookEntryPoint;
|
|
121
|
+
if (isESM) {
|
|
122
|
+
const { default: hookFn } = await Promise.resolve(`${hook.fullPath}`).then(s => require(s));
|
|
123
|
+
hookEntryPoint = hookFn;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
hookEntryPoint = require(hook.fullPath);
|
|
127
|
+
}
|
|
114
128
|
this.$logger.trace(`Validating ${hookName} arguments.`);
|
|
115
129
|
const invalidArguments = this.validateHookArguments(hookEntryPoint, hook.fullPath);
|
|
116
130
|
if (invalidArguments.length) {
|
|
@@ -119,7 +133,8 @@ class HooksService {
|
|
|
119
133
|
}
|
|
120
134
|
const projectDataHookArg = hookArguments["hookArgs"] && hookArguments["hookArgs"]["projectData"];
|
|
121
135
|
if (projectDataHookArg) {
|
|
122
|
-
hookArguments["projectData"] = hookArguments["$projectData"] =
|
|
136
|
+
hookArguments["projectData"] = hookArguments["$projectData"] =
|
|
137
|
+
projectDataHookArg;
|
|
123
138
|
}
|
|
124
139
|
const maybePromise = this.$injector.resolve(hookEntryPoint, hookArguments);
|
|
125
140
|
if (maybePromise) {
|
|
@@ -215,9 +230,11 @@ class HooksService {
|
|
|
215
230
|
prepareEnvironment(hookFullPath) {
|
|
216
231
|
const clientName = this.$staticConfig.CLIENT_NAME.toUpperCase();
|
|
217
232
|
const environment = {};
|
|
218
|
-
environment[util.format("%s-COMMANDLINE", clientName)] =
|
|
233
|
+
environment[util.format("%s-COMMANDLINE", clientName)] =
|
|
234
|
+
process.argv.join(" ");
|
|
219
235
|
environment[util.format("%s-HOOK_FULL_PATH", clientName)] = hookFullPath;
|
|
220
|
-
environment[util.format("%s-VERSION", clientName)] =
|
|
236
|
+
environment[util.format("%s-VERSION", clientName)] =
|
|
237
|
+
this.$staticConfig.version;
|
|
221
238
|
return {
|
|
222
239
|
cwd: this.$projectHelper.projectDir,
|
|
223
240
|
stdio: "inherit",
|
package/lib/constants.js
CHANGED
|
@@ -69,7 +69,7 @@ exports.APK_EXTENSION_NAME = ".apk";
|
|
|
69
69
|
exports.AAB_EXTENSION_NAME = ".aab";
|
|
70
70
|
exports.APKS_EXTENSION_NAME = ".apks";
|
|
71
71
|
exports.HASHES_FILE_NAME = ".nshashes";
|
|
72
|
-
exports.TNS_NATIVE_SOURCE_GROUP_NAME = "
|
|
72
|
+
exports.TNS_NATIVE_SOURCE_GROUP_NAME = "AppResourcesSrc";
|
|
73
73
|
exports.NATIVE_SOURCE_FOLDER = "src";
|
|
74
74
|
exports.APPLICATION_RESPONSE_TIMEOUT_SECONDS = 60;
|
|
75
75
|
exports.NATIVE_EXTENSION_FOLDER = "extensions";
|
|
@@ -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: "~8.
|
|
43
|
+
desiredVersion: "~8.9.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: "~8.
|
|
53
|
+
desiredVersion: "~8.9.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: "^19.0.0",
|
|
104
104
|
async shouldMigrateAction(dependency, projectData, loose) {
|
|
105
105
|
if (!this.hasDependency(dependency, projectData)) {
|
|
106
106
|
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: "~5.
|
|
150
|
+
desiredVersion: "~5.7.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: "~8.
|
|
179
|
+
desiredVersion: "~8.9.0",
|
|
180
180
|
isDev: true,
|
|
181
181
|
},
|
|
182
182
|
{
|
|
183
183
|
packageName: "@nativescript/android",
|
|
184
184
|
minVersion: "7.0.0",
|
|
185
|
-
desiredVersion: "~8.
|
|
185
|
+
desiredVersion: "~8.9.0",
|
|
186
186
|
isDev: true,
|
|
187
187
|
},
|
|
188
188
|
];
|
|
@@ -722,7 +722,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
722
722
|
}
|
|
723
723
|
async migrateNativeScriptAngular() {
|
|
724
724
|
const minVersion = "10.0.0";
|
|
725
|
-
const desiredVersion = "~
|
|
725
|
+
const desiredVersion = "~19.1.0";
|
|
726
726
|
const dependencies = [
|
|
727
727
|
{
|
|
728
728
|
packageName: "@angular/animations",
|
|
@@ -781,7 +781,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
781
781
|
{
|
|
782
782
|
packageName: "zone.js",
|
|
783
783
|
minVersion: "0.11.1",
|
|
784
|
-
desiredVersion: "~0.
|
|
784
|
+
desiredVersion: "~0.15.0",
|
|
785
785
|
shouldAddIfMissing: true,
|
|
786
786
|
},
|
|
787
787
|
{
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.PrepareController = void 0;
|
|
10
|
-
const
|
|
10
|
+
const chokidar_1 = require("chokidar");
|
|
11
11
|
const events_1 = require("events");
|
|
12
12
|
const _ = require("lodash");
|
|
13
13
|
const path = require("path");
|
|
@@ -186,9 +186,7 @@ class PrepareController extends events_1.EventEmitter {
|
|
|
186
186
|
},
|
|
187
187
|
ignored: ["**/.*", ".*"],
|
|
188
188
|
};
|
|
189
|
-
const watcher =
|
|
190
|
-
.watch(patterns, watcherOptions)
|
|
191
|
-
.on("all", async (event, filePath) => {
|
|
189
|
+
const watcher = (0, chokidar_1.watch)(patterns, watcherOptions).on("all", async (event, filePath) => {
|
|
192
190
|
if (this.isFileWatcherPaused())
|
|
193
191
|
return;
|
|
194
192
|
filePath = path.join(projectData.projectDir, filePath);
|
package/lib/definitions/ios.d.ts
CHANGED
|
@@ -41,8 +41,18 @@ declare global {
|
|
|
41
41
|
): Promise<string>;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
type IosSPMPackage = IosSPMPackageDefinition & { targets?: string[] };
|
|
45
|
+
|
|
44
46
|
interface ISPMService {
|
|
45
|
-
applySPMPackages(
|
|
47
|
+
applySPMPackages(
|
|
48
|
+
platformData: IPlatformData,
|
|
49
|
+
projectData: IProjectData,
|
|
50
|
+
pluginSpmPackages?: IosSPMPackage[]
|
|
51
|
+
);
|
|
52
|
+
getSPMPackages(
|
|
53
|
+
projectData: IProjectData,
|
|
54
|
+
platform: string
|
|
55
|
+
): IosSPMPackage[];
|
|
46
56
|
}
|
|
47
57
|
|
|
48
58
|
interface IXcodebuildArgsService {
|
|
@@ -101,10 +101,36 @@ interface INsConfigPlaform {
|
|
|
101
101
|
id?: string;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
interface IOSSPMPackageBase {
|
|
105
|
+
name: string;
|
|
106
|
+
libs: string[];
|
|
107
|
+
/**
|
|
108
|
+
* Optional: If you have more targets (like widgets for example)
|
|
109
|
+
* you can list their names here to include the Swift Package with them
|
|
110
|
+
*/
|
|
111
|
+
targets?: string[];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface IOSRemoteSPMPackage extends IOSSPMPackageBase {
|
|
115
|
+
repositoryURL: string;
|
|
116
|
+
version: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface IOSLocalSPMPackage extends IOSSPMPackageBase {
|
|
120
|
+
path: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export type IOSSPMPackage = IOSRemoteSPMPackage | IOSLocalSPMPackage;
|
|
124
|
+
|
|
104
125
|
interface INsConfigIOS extends INsConfigPlaform {
|
|
105
126
|
discardUncaughtJsExceptions?: boolean;
|
|
106
127
|
runtimePackageName?: string
|
|
107
128
|
cocoapodUseBundleExec?: boolean
|
|
129
|
+
/**
|
|
130
|
+
* Swift Package Manager
|
|
131
|
+
* List packages to be included in the iOS build.
|
|
132
|
+
*/
|
|
133
|
+
SPMPackages?: Array<IOSSPMPackage>;
|
|
108
134
|
}
|
|
109
135
|
|
|
110
136
|
interface INSConfigVisionOS extends INsConfigIOS {}
|
|
@@ -218,7 +244,7 @@ interface IProjectData extends ICreateProjectData {
|
|
|
218
244
|
initializeProjectData(projectDir?: string): void;
|
|
219
245
|
initializeProjectDataFromContent(
|
|
220
246
|
packageJsonContent: string,
|
|
221
|
-
projectDir?: string
|
|
247
|
+
projectDir?: string,
|
|
222
248
|
): void;
|
|
223
249
|
getAppDirectoryPath(projectDir?: string): string;
|
|
224
250
|
getAppDirectoryRelativePath(): string;
|
|
@@ -309,7 +335,7 @@ interface IProjectDataService {
|
|
|
309
335
|
*/
|
|
310
336
|
getRuntimePackage(
|
|
311
337
|
projectDir: string,
|
|
312
|
-
platform: SupportedPlatform
|
|
338
|
+
platform: SupportedPlatform,
|
|
313
339
|
): IBasePluginData;
|
|
314
340
|
|
|
315
341
|
/**
|
|
@@ -329,7 +355,7 @@ interface IProjectCleanupService {
|
|
|
329
355
|
*/
|
|
330
356
|
clean(
|
|
331
357
|
pathsToClean: string[],
|
|
332
|
-
options?: IProjectCleanupOptions
|
|
358
|
+
options?: IProjectCleanupOptions,
|
|
333
359
|
): Promise<IProjectCleanupResult>;
|
|
334
360
|
|
|
335
361
|
/**
|
|
@@ -338,7 +364,7 @@ interface IProjectCleanupService {
|
|
|
338
364
|
*/
|
|
339
365
|
cleanPath(
|
|
340
366
|
pathToClean: string,
|
|
341
|
-
options?: IProjectCleanupOptions
|
|
367
|
+
options?: IProjectCleanupOptions,
|
|
342
368
|
): Promise<IProjectCleanupResult>;
|
|
343
369
|
}
|
|
344
370
|
|
|
@@ -440,7 +466,7 @@ interface IProjectConfigService {
|
|
|
440
466
|
|
|
441
467
|
writeLegacyNSConfigIfNeeded(
|
|
442
468
|
projectDir: string,
|
|
443
|
-
runtimePackage: IBasePluginData
|
|
469
|
+
runtimePackage: IBasePluginData,
|
|
444
470
|
): Promise<void>;
|
|
445
471
|
}
|
|
446
472
|
|
|
@@ -543,14 +569,14 @@ interface IProjectTemplatesService {
|
|
|
543
569
|
*/
|
|
544
570
|
prepareTemplate(
|
|
545
571
|
templateName: string,
|
|
546
|
-
projectDir: string
|
|
572
|
+
projectDir: string,
|
|
547
573
|
): Promise<ITemplateData>;
|
|
548
574
|
}
|
|
549
575
|
|
|
550
576
|
interface IPlatformProjectServiceBase {
|
|
551
577
|
getPluginPlatformsFolderPath(
|
|
552
578
|
pluginData: IPluginData,
|
|
553
|
-
platform: string
|
|
579
|
+
platform: string,
|
|
554
580
|
): string;
|
|
555
581
|
getFrameworkVersion(projectData: IProjectData): string;
|
|
556
582
|
}
|
|
@@ -612,7 +638,7 @@ interface ILocalBuildService {
|
|
|
612
638
|
*/
|
|
613
639
|
build(
|
|
614
640
|
platform: string,
|
|
615
|
-
platformBuildOptions: IPlatformBuildData
|
|
641
|
+
platformBuildOptions: IPlatformBuildData,
|
|
616
642
|
): Promise<string>;
|
|
617
643
|
/**
|
|
618
644
|
* Removes build artifacts specific to the platform
|
|
@@ -632,7 +658,7 @@ interface ITestExecutionService {
|
|
|
632
658
|
startKarmaServer(
|
|
633
659
|
platform: string,
|
|
634
660
|
liveSyncInfo: ILiveSyncInfo,
|
|
635
|
-
deviceDescriptors: ILiveSyncDeviceDescriptor[]
|
|
661
|
+
deviceDescriptors: ILiveSyncDeviceDescriptor[],
|
|
636
662
|
): Promise<void>;
|
|
637
663
|
canStartKarmaServer(projectData: IProjectData): Promise<boolean>;
|
|
638
664
|
}
|
|
@@ -666,17 +692,17 @@ interface ICocoaPodsService {
|
|
|
666
692
|
*/
|
|
667
693
|
applyPodfileFromAppResources(
|
|
668
694
|
projectData: IProjectData,
|
|
669
|
-
platformData: IPlatformData
|
|
695
|
+
platformData: IPlatformData,
|
|
670
696
|
): Promise<void>;
|
|
671
697
|
|
|
672
698
|
applyPodfileArchExclusions(
|
|
673
699
|
projectData: IProjectData,
|
|
674
|
-
platformData: IPlatformData
|
|
700
|
+
platformData: IPlatformData,
|
|
675
701
|
): Promise<void>;
|
|
676
702
|
|
|
677
703
|
applyPodfileFromExtensions(
|
|
678
704
|
projectData: IProjectData,
|
|
679
|
-
platformData: IPlatformData
|
|
705
|
+
platformData: IPlatformData,
|
|
680
706
|
): Promise<void>;
|
|
681
707
|
|
|
682
708
|
/**
|
|
@@ -691,7 +717,7 @@ interface ICocoaPodsService {
|
|
|
691
717
|
moduleName: string,
|
|
692
718
|
podfilePath: string,
|
|
693
719
|
projectData: IProjectData,
|
|
694
|
-
platformData: IPlatformData
|
|
720
|
+
platformData: IPlatformData,
|
|
695
721
|
): Promise<void>;
|
|
696
722
|
|
|
697
723
|
/**
|
|
@@ -713,7 +739,7 @@ interface ICocoaPodsService {
|
|
|
713
739
|
moduleName: string,
|
|
714
740
|
podfilePath: string,
|
|
715
741
|
projectData: IProjectData,
|
|
716
|
-
nativeProjectPath: string
|
|
742
|
+
nativeProjectPath: string,
|
|
717
743
|
): void;
|
|
718
744
|
|
|
719
745
|
/**
|
|
@@ -731,7 +757,7 @@ interface ICocoaPodsService {
|
|
|
731
757
|
*/
|
|
732
758
|
executePodInstall(
|
|
733
759
|
projectRoot: string,
|
|
734
|
-
xcodeProjPath: string
|
|
760
|
+
xcodeProjPath: string,
|
|
735
761
|
): Promise<ISpawnResult>;
|
|
736
762
|
|
|
737
763
|
/**
|
|
@@ -743,7 +769,7 @@ interface ICocoaPodsService {
|
|
|
743
769
|
mergePodXcconfigFile(
|
|
744
770
|
projectData: IProjectData,
|
|
745
771
|
platformData: IPlatformData,
|
|
746
|
-
opts: IRelease
|
|
772
|
+
opts: IRelease,
|
|
747
773
|
): Promise<void>;
|
|
748
774
|
}
|
|
749
775
|
|
|
@@ -751,16 +777,16 @@ interface ICocoaPodsPlatformManager {
|
|
|
751
777
|
addPlatformSection(
|
|
752
778
|
projectData: IProjectData,
|
|
753
779
|
podfilePlatformData: IPodfilePlatformData,
|
|
754
|
-
projectPodfileContent: string
|
|
780
|
+
projectPodfileContent: string,
|
|
755
781
|
): string;
|
|
756
782
|
removePlatformSection(
|
|
757
783
|
moduleName: string,
|
|
758
784
|
projectPodFileContent: string,
|
|
759
|
-
podfilePath: string
|
|
785
|
+
podfilePath: string,
|
|
760
786
|
): string;
|
|
761
787
|
replacePlatformRow(
|
|
762
788
|
podfileContent: string,
|
|
763
|
-
podfilePath: string
|
|
789
|
+
podfilePath: string,
|
|
764
790
|
): { replacedContent: string; podfilePlatformData: IPodfilePlatformData };
|
|
765
791
|
}
|
|
766
792
|
|
|
@@ -785,24 +811,24 @@ interface IIOSNativeTargetService {
|
|
|
785
811
|
targetType: string,
|
|
786
812
|
project: IXcode.project,
|
|
787
813
|
platformData: IPlatformData,
|
|
788
|
-
parentTarget?: string
|
|
814
|
+
parentTarget?: string,
|
|
789
815
|
): IXcode.target;
|
|
790
816
|
prepareSigning(
|
|
791
817
|
targetUuids: string[],
|
|
792
818
|
projectData: IProjectData,
|
|
793
|
-
projectPath: string
|
|
819
|
+
projectPath: string,
|
|
794
820
|
): void;
|
|
795
821
|
getTargetDirectories(folderPath: string): string[];
|
|
796
822
|
setXcodeTargetBuildConfigurationProperties(
|
|
797
823
|
properties: IXcodeTargetBuildConfigurationProperty[],
|
|
798
824
|
targetName: string,
|
|
799
|
-
project: IXcode.project
|
|
825
|
+
project: IXcode.project,
|
|
800
826
|
): void;
|
|
801
827
|
setConfigurationsFromJsonFile(
|
|
802
828
|
jsonPath: string,
|
|
803
829
|
targetUuid: string,
|
|
804
830
|
targetName: string,
|
|
805
|
-
project: IXcode.project
|
|
831
|
+
project: IXcode.project,
|
|
806
832
|
): void;
|
|
807
833
|
}
|
|
808
834
|
|
|
@@ -811,7 +837,7 @@ interface IIOSNativeTargetService {
|
|
|
811
837
|
*/
|
|
812
838
|
interface IIOSExtensionsService {
|
|
813
839
|
addExtensionsFromPath(
|
|
814
|
-
options: IAddExtensionsFromPathOptions
|
|
840
|
+
options: IAddExtensionsFromPathOptions,
|
|
815
841
|
): Promise<boolean>;
|
|
816
842
|
removeExtensions(options: IRemoveExtensionsOptions): void;
|
|
817
843
|
}
|
|
@@ -30,7 +30,7 @@ class NodePackageManager extends base_package_manager_1.BasePackageManager {
|
|
|
30
30
|
const packageJsonPath = (0, path_1.join)(pathToSave, "package.json");
|
|
31
31
|
const jsonContentBefore = this.$fs.readJson(packageJsonPath);
|
|
32
32
|
const flags = this.getFlagsString(config, true);
|
|
33
|
-
let params = ["install"
|
|
33
|
+
let params = ["install"];
|
|
34
34
|
const isInstallingAllDependencies = packageName === pathToSave;
|
|
35
35
|
if (!isInstallingAllDependencies) {
|
|
36
36
|
params.push(packageName);
|
|
@@ -167,7 +167,8 @@ class AnalyticsService {
|
|
|
167
167
|
const projectData = this.$projectDataService.getProjectData(projectDir);
|
|
168
168
|
customDimensions["cd2"] =
|
|
169
169
|
projectData.projectType;
|
|
170
|
-
customDimensions["cd9"] =
|
|
170
|
+
customDimensions["cd9"] =
|
|
171
|
+
projectData.isShared.toString();
|
|
171
172
|
}
|
|
172
173
|
return customDimensions;
|
|
173
174
|
}
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.AssetsGenerationService = void 0;
|
|
10
|
-
const
|
|
10
|
+
const JimpModule = require("jimp");
|
|
11
11
|
const Color = require("color");
|
|
12
12
|
const decorators_1 = require("../../common/decorators");
|
|
13
13
|
const constants_1 = require("../../constants");
|
|
@@ -67,7 +67,7 @@ class AssetsGenerationService {
|
|
|
67
67
|
}
|
|
68
68
|
try {
|
|
69
69
|
const color = (_e = (_c = generationData[(_b = assetItem.data) === null || _b === void 0 ? void 0 : _b.fromKey]) !== null && _c !== void 0 ? _c : (_d = assetItem.data) === null || _d === void 0 ? void 0 : _d.default) !== null && _e !== void 0 ? _e : "white";
|
|
70
|
-
const colorHEX =
|
|
70
|
+
const colorHEX = JimpModule.cssColorToHex(color);
|
|
71
71
|
const hex = (_f = colorHEX === null || colorHEX === void 0 ? void 0 : colorHEX.toString(16).substring(0, 6)) !== null && _f !== void 0 ? _f : "FFFFFF";
|
|
72
72
|
this.$fs.writeFile(assetItem.path, [
|
|
73
73
|
`<?xml version="1.0" encoding="utf-8"?>`,
|
|
@@ -112,38 +112,49 @@ class AssetsGenerationService {
|
|
|
112
112
|
constants_1.AssetConstants.defaultOverlayImageScale;
|
|
113
113
|
const imageResize = Math.round(Math.min(width, height) * overlayImageScale);
|
|
114
114
|
image = await this.resize(generationData.imagePath, imageResize, imageResize);
|
|
115
|
-
image = this.generateImage(background, width, height,
|
|
115
|
+
image = this.generateImage(background, width, height, image);
|
|
116
116
|
break;
|
|
117
117
|
case "blank":
|
|
118
|
-
image = this.generateImage(background, width, height
|
|
118
|
+
image = this.generateImage(background, width, height);
|
|
119
119
|
break;
|
|
120
120
|
case "resize":
|
|
121
121
|
image = await this.resize(generationData.imagePath, width, height);
|
|
122
122
|
break;
|
|
123
123
|
case "outerScale":
|
|
124
124
|
image = await this.resize(generationData.imagePath, assetItem.width, assetItem.height);
|
|
125
|
-
image = this.generateImage("#00000000", width, height,
|
|
125
|
+
image = this.generateImage("#00000000", width, height, image);
|
|
126
126
|
break;
|
|
127
127
|
default:
|
|
128
128
|
throw new Error(`Invalid image generation operation: ${operation}`);
|
|
129
129
|
}
|
|
130
130
|
if (assetItem.rgba === false) {
|
|
131
|
-
image = image.
|
|
131
|
+
image = this.generateImage("#FFFFFF", image.width, image.height, image);
|
|
132
|
+
}
|
|
133
|
+
if (this.isAssetFilePath(outputPath)) {
|
|
134
|
+
image.write(outputPath);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
this.$logger.warn(`Incorrect destination path ${outputPath} for image ${assetItem.filename}`);
|
|
132
138
|
}
|
|
133
|
-
image.write(outputPath);
|
|
134
139
|
}
|
|
135
140
|
}
|
|
136
141
|
async resize(imagePath, width, height) {
|
|
137
|
-
const image = await Jimp.read(imagePath);
|
|
138
|
-
return image.scaleToFit(
|
|
142
|
+
const image = await JimpModule.Jimp.read(imagePath);
|
|
143
|
+
return image.scaleToFit({
|
|
144
|
+
w: width,
|
|
145
|
+
h: height,
|
|
146
|
+
});
|
|
139
147
|
}
|
|
140
|
-
generateImage(background, width, height,
|
|
141
|
-
const J = Jimp;
|
|
148
|
+
generateImage(background, width, height, overlayImage) {
|
|
142
149
|
const backgroundColor = this.getRgbaNumber(background);
|
|
143
|
-
let image = new
|
|
150
|
+
let image = new JimpModule.Jimp({
|
|
151
|
+
width,
|
|
152
|
+
height,
|
|
153
|
+
color: backgroundColor,
|
|
154
|
+
});
|
|
144
155
|
if (overlayImage) {
|
|
145
|
-
const centeredWidth = (width - overlayImage.
|
|
146
|
-
const centeredHeight = (height - overlayImage.
|
|
156
|
+
const centeredWidth = (width - overlayImage.width) / 2;
|
|
157
|
+
const centeredHeight = (height - overlayImage.height) / 2;
|
|
147
158
|
image = image.composite(overlayImage, centeredWidth, centeredHeight);
|
|
148
159
|
}
|
|
149
160
|
return image;
|
|
@@ -152,7 +163,14 @@ class AssetsGenerationService {
|
|
|
152
163
|
const color = new Color(colorString);
|
|
153
164
|
const colorRgb = color.rgb();
|
|
154
165
|
const alpha = Math.round(colorRgb.alpha() * 255);
|
|
155
|
-
return
|
|
166
|
+
return JimpModule.rgbaToInt(colorRgb.red(), colorRgb.green(), colorRgb.blue(), alpha);
|
|
167
|
+
}
|
|
168
|
+
isAssetFilePath(path) {
|
|
169
|
+
if (!path) {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
const index = path.lastIndexOf(".");
|
|
173
|
+
return index > -1 && index < path.length - 1;
|
|
156
174
|
}
|
|
157
175
|
}
|
|
158
176
|
exports.AssetsGenerationService = AssetsGenerationService;
|
|
@@ -15,9 +15,13 @@ class SPMService {
|
|
|
15
15
|
const spmPackages = this.$projectConfigService.getValue(`${platform}.SPMPackages`, []);
|
|
16
16
|
return spmPackages;
|
|
17
17
|
}
|
|
18
|
-
async applySPMPackages(platformData, projectData) {
|
|
18
|
+
async applySPMPackages(platformData, projectData, pluginSpmPackages) {
|
|
19
|
+
var _a;
|
|
19
20
|
try {
|
|
20
21
|
const spmPackages = this.getSPMPackages(projectData, platformData.platformNameLowerCase);
|
|
22
|
+
if (pluginSpmPackages === null || pluginSpmPackages === void 0 ? void 0 : pluginSpmPackages.length) {
|
|
23
|
+
spmPackages.push(...pluginSpmPackages);
|
|
24
|
+
}
|
|
21
25
|
if (!spmPackages.length) {
|
|
22
26
|
this.$logger.trace("SPM: no SPM packages to apply.");
|
|
23
27
|
return;
|
|
@@ -40,6 +44,11 @@ class SPMService {
|
|
|
40
44
|
}
|
|
41
45
|
this.$logger.trace(`SPM: adding package ${pkg.name} to project.`, pkg);
|
|
42
46
|
await project.ios.addSPMPackage(projectData.projectName, pkg);
|
|
47
|
+
if ((_a = pkg.targets) === null || _a === void 0 ? void 0 : _a.length) {
|
|
48
|
+
for (const target of pkg.targets) {
|
|
49
|
+
await project.ios.addSPMPackage(target, pkg);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
43
52
|
}
|
|
44
53
|
await project.commit();
|
|
45
54
|
await this.resolveSPMDependencies(platformData, projectData);
|