@akylas/nativescript-cli 8.8.7 → 8.10.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.
Files changed (85) hide show
  1. package/config/test-deps-versions-generated.json +16 -0
  2. package/docs/build-jekyll-md.sh +1 -1
  3. package/docs/man_pages/config/config-get.md +36 -0
  4. package/docs/man_pages/config/config-set.md +40 -0
  5. package/docs/man_pages/config/config.md +39 -0
  6. package/docs/man_pages/project/configuration/widget-ios.md +24 -0
  7. package/docs/man_pages/project/configuration/widget.md +24 -0
  8. package/docs/man_pages/project/hooks/hooks.md +35 -0
  9. package/docs/man_pages/start.md +2 -1
  10. package/lib/.d.ts +9 -3
  11. package/lib/bootstrap.js +4 -1
  12. package/lib/bun-package-manager.js +1 -1
  13. package/lib/color.js +38 -7
  14. package/lib/commands/build.js +18 -2
  15. package/lib/commands/clean.js +1 -2
  16. package/lib/commands/config.js +1 -1
  17. package/lib/commands/embedding/embed.js +1 -1
  18. package/lib/commands/generate.js +2 -41
  19. package/lib/commands/hooks/common.js +79 -0
  20. package/lib/commands/hooks/hooks-lock.js +100 -0
  21. package/lib/commands/hooks/hooks.js +71 -0
  22. package/lib/commands/post-install.js +2 -2
  23. package/lib/commands/typings.js +29 -18
  24. package/lib/commands/widget.js +799 -0
  25. package/lib/common/definitions/extensibility.d.ts +2 -2
  26. package/lib/common/definitions/mobile.d.ts +72 -72
  27. package/lib/common/file-system.js +1 -2
  28. package/lib/common/header.js +3 -3
  29. package/lib/common/logger/layouts/cli-layout.js +1 -1
  30. package/lib/common/logger/logger.js +5 -5
  31. package/lib/common/mobile/android/android-device.js +1 -1
  32. package/lib/common/mobile/android/android-emulator-services.js +9 -7
  33. package/lib/common/mobile/device-log-provider.js +3 -4
  34. package/lib/common/mobile/emulator-helper.js +1 -0
  35. package/lib/common/mobile/mobile-core/devices-service.js +2 -1
  36. package/lib/common/opener.js +2 -2
  37. package/lib/common/project-helper.js +15 -2
  38. package/lib/common/services/hooks-service.js +23 -6
  39. package/lib/common/verify-node-version.js +1 -1
  40. package/lib/constants.js +8 -5
  41. package/lib/controllers/migrate-controller.js +11 -12
  42. package/lib/controllers/prepare-controller.js +11 -13
  43. package/lib/controllers/run-controller.js +1 -1
  44. package/lib/declarations.d.ts +5 -0
  45. package/lib/definitions/hooks.d.ts +1 -0
  46. package/lib/definitions/ios.d.ts +11 -1
  47. package/lib/definitions/nativescript-dev-xcode.d.ts +25 -1
  48. package/lib/definitions/project.d.ts +102 -25
  49. package/lib/definitions/temp-service.d.ts +6 -2
  50. package/lib/helpers/key-command-helper.js +2 -1
  51. package/lib/nativescript-cli.js +28 -0
  52. package/lib/node-package-manager.js +1 -1
  53. package/lib/options.js +4 -0
  54. package/lib/project-data.js +10 -4
  55. package/lib/services/analytics/analytics-broker-process.js +1 -1
  56. package/lib/services/analytics/analytics-service.js +2 -1
  57. package/lib/services/analytics-settings-service.js +2 -1
  58. package/lib/services/android/gradle-build-args-service.js +8 -4
  59. package/lib/services/android/gradle-build-service.js +4 -1
  60. package/lib/services/android-plugin-build-service.js +1 -1
  61. package/lib/services/android-project-service.js +12 -10
  62. package/lib/services/assets-generation/assets-generation-service.js +33 -15
  63. package/lib/services/{webpack/webpack-compiler-service.js → bundler/bundler-compiler-service.js} +258 -88
  64. package/lib/services/bundler/bundler.js +2 -0
  65. package/lib/services/extensibility-service.js +1 -1
  66. package/lib/services/ios/spm-service.js +22 -2
  67. package/lib/services/ios/xcodebuild-args-service.js +7 -5
  68. package/lib/services/ios-debugger-port-service.js +1 -1
  69. package/lib/services/ios-project-service.js +45 -15
  70. package/lib/services/ios-watch-app-service.js +540 -16
  71. package/lib/services/livesync/android-livesync-tool.js +4 -2
  72. package/lib/services/plugins-service.js +1 -0
  73. package/lib/services/project-changes-service.js +1 -1
  74. package/lib/services/project-config-service.js +12 -3
  75. package/lib/services/temp-service.js +16 -4
  76. package/lib/services/versions-service.js +2 -1
  77. package/lib/tools/config-manipulation/config-transformer.js +9 -0
  78. package/package.json +59 -66
  79. package/vendor/aab-tool/README.txt +1 -1
  80. package/vendor/aab-tool/bundletool.jar +0 -0
  81. package/vendor/gradle-app/app/build.gradle +365 -130
  82. package/vendor/gradle-app/app/gradle.properties +45 -0
  83. package/vendor/gradle-app/build.gradle +7 -7
  84. package/vendor/gradle-plugin/build.gradle +7 -6
  85. package/lib/services/webpack/webpack.d.ts +0 -227
@@ -167,7 +167,7 @@ export default {
167
167
  if (!this.$fs.exists(configFilePath)) {
168
168
  this.writeDefaultConfig(this.projectHelper.projectDir);
169
169
  }
170
- if (typeof value === "object") {
170
+ if (!Array.isArray(value) && typeof value === "object") {
171
171
  let allSuccessful = true;
172
172
  for (const prop of this.flattenObjectToPaths(value)) {
173
173
  if (!(await this.setValue(prop.key, prop.value))) {
@@ -195,7 +195,7 @@ export default {
195
195
  this.$logger.error(`Failed to update config.` + error);
196
196
  }
197
197
  finally {
198
- if (this.getValue(key) !== value) {
198
+ if (!Array.isArray(this.getValue(key)) && this.getValue(key) !== value) {
199
199
  this.$logger.error(`${os_1.EOL}Failed to update ${hasTSConfig ? constants_1.CONFIG_FILE_NAME_TS : constants_1.CONFIG_FILE_NAME_JS}.${os_1.EOL}`);
200
200
  this.$logger.printMarkdown(`Please manually update \`${hasTSConfig ? constants_1.CONFIG_FILE_NAME_TS : constants_1.CONFIG_FILE_NAME_JS}\` and set \`${key}\` to \`${value}\`.${os_1.EOL}`);
201
201
  this.$fs.writeFile(configFilePath, configContent);
@@ -297,7 +297,16 @@ You may add \`nsconfig.json\` to \`.gitignore\` as the CLI will regenerate it as
297
297
  flattenObjectToPaths(obj, basePath) {
298
298
  const toPath = (key) => [basePath, key].filter(Boolean).join(".");
299
299
  return Object.keys(obj).reduce((all, key) => {
300
- if (typeof obj[key] === "object") {
300
+ if (Array.isArray(obj[key])) {
301
+ return [
302
+ ...all,
303
+ {
304
+ key: toPath(key),
305
+ value: obj[key],
306
+ },
307
+ ];
308
+ }
309
+ else if (typeof obj[key] === "object" && obj[key] !== null) {
301
310
  return [...all, ...this.flattenObjectToPaths(obj[key], toPath(key))];
302
311
  }
303
312
  return [
@@ -1,20 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TempService = void 0;
4
- const temp = require("temp");
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+ const os_1 = require("os");
5
7
  const yok_1 = require("../common/yok");
6
8
  class TempService {
7
9
  constructor($cleanupService) {
8
10
  this.$cleanupService = $cleanupService;
9
- temp.track();
10
11
  }
11
12
  async mkdirSync(affixes) {
12
- const pathToDir = temp.mkdirSync(affixes);
13
+ var _a;
14
+ const opts = typeof affixes === "string" ? { prefix: affixes } : affixes;
15
+ const baseDir = (opts === null || opts === void 0 ? void 0 : opts.dir) ? opts.dir : (0, os_1.tmpdir)();
16
+ const prefix = ((_a = opts === null || opts === void 0 ? void 0 : opts.prefix) !== null && _a !== void 0 ? _a : "ns-").replace(/\s+/g, "-");
17
+ const pathToDir = fs.mkdtempSync(path.join(baseDir, prefix));
13
18
  await this.$cleanupService.addCleanupDeleteAction(pathToDir);
14
19
  return pathToDir;
15
20
  }
16
21
  async path(options) {
17
- const pathToFile = temp.path(options);
22
+ var _a, _b;
23
+ const opts = typeof options === "string" ? { prefix: options } : options;
24
+ const baseDir = (opts === null || opts === void 0 ? void 0 : opts.dir) ? opts.dir : (0, os_1.tmpdir)();
25
+ const prefix = ((_a = opts === null || opts === void 0 ? void 0 : opts.prefix) !== null && _a !== void 0 ? _a : "ns-").replace(/\s+/g, "-");
26
+ const suffix = (_b = opts === null || opts === void 0 ? void 0 : opts.suffix) !== null && _b !== void 0 ? _b : "";
27
+ const unique = Math.random().toString(36).slice(2);
28
+ const filePath = path.join(baseDir, `${prefix}${unique}${suffix}`);
29
+ const pathToFile = filePath;
18
30
  await this.$cleanupService.addCleanupDeleteAction(pathToFile);
19
31
  return pathToFile;
20
32
  }
@@ -43,7 +43,8 @@ class VersionsService {
43
43
  const versionInformations = [];
44
44
  if (this.projectData) {
45
45
  const nodeModulesPath = path.join(this.projectData.projectDir, constants.NODE_MODULES_FOLDER_NAME);
46
- const scopedPackagePath = path.join(nodeModulesPath, constants.SCOPED_TNS_CORE_MODULES);
46
+ const packageName = this.projectData.nsConfig.corePackageName || constants.SCOPED_TNS_CORE_MODULES;
47
+ const scopedPackagePath = path.join(nodeModulesPath, packageName);
47
48
  const tnsCoreModulesPath = path.join(nodeModulesPath, constants.TNS_CORE_MODULES_NAME);
48
49
  const dependsOnNonScopedPackage = !!this.projectData.dependencies[constants.TNS_CORE_MODULES_NAME];
49
50
  const dependsOnScopedPackage = !!this.projectData.dependencies[constants.SCOPED_TNS_CORE_MODULES];
@@ -102,6 +102,15 @@ class ConfigTransformer {
102
102
  else if (typeof value === "number" || typeof value === "boolean") {
103
103
  return `${value}`;
104
104
  }
105
+ else if (Array.isArray(value)) {
106
+ return `[${value.map((v) => this.createInitializer(v)).join(", ")}]`;
107
+ }
108
+ else if (typeof value === "object" && value !== null) {
109
+ const properties = Object.entries(value)
110
+ .map(([key, val]) => `${key}: ${this.createInitializer(val)}`)
111
+ .join(", ");
112
+ return `{ ${properties} }`;
113
+ }
105
114
  return `{}`;
106
115
  }
107
116
  setInitializerValue(initializer, newValue) {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@akylas/nativescript-cli",
3
3
  "main": "./lib/nativescript-cli-lib.js",
4
- "version": "8.8.7",
5
- "author": "NativeScript <support@nativescript.org>",
4
+ "version": "8.10.0",
5
+ "author": "NativeScript <oss@nativescript.org>",
6
6
  "description": "Command-line interface for building NativeScript projects",
7
7
  "bin": {
8
8
  "nativescript": "./bin/tns",
@@ -33,7 +33,7 @@
33
33
  "build": "grunt",
34
34
  "build.all": "grunt test",
35
35
  "dev": "tsc --watch",
36
- "setup": "npm i --ignore-scripts && npx husky install",
36
+ "setup": "npm i --ignore-scripts && npx husky",
37
37
  "test": "npm run tsc && mocha --config=test/.mocharc.yml",
38
38
  "postinstall": "node postinstall.js",
39
39
  "preuninstall": "node preuninstall.js",
@@ -52,23 +52,20 @@
52
52
  },
53
53
  "keywords": [
54
54
  "nativescript",
55
- "telerik",
56
- "mobile"
55
+ "typescript",
56
+ "javascript"
57
57
  ],
58
58
  "dependencies": {
59
- "@foxt/js-srp": "^0.0.3-patch2",
60
- "@nativescript/doctor": "2.0.15",
61
- "@nativescript/schematics-executor": "0.0.2",
62
- "@npmcli/arborist": "^7.2.0",
63
- "@npmcli/move-file": "^2.0.1",
59
+ "@foxt/js-srp": "0.0.3-patch2",
60
+ "@nativescript/doctor": "2.0.17",
61
+ "@nativescript/hook": "3.0.4",
62
+ "@npmcli/arborist": "9.1.6",
63
+ "@nstudio/trapezedev-project": "7.2.3",
64
64
  "@rigor789/resolve-package-path": "1.0.7",
65
- "@rigor789/trapezedev-project": "7.1.2",
66
- "ansi-colors": "^4.1.3",
67
- "archiver": "^7.0.1",
68
- "axios": "1.7.7",
65
+ "archiver": "7.0.1",
66
+ "axios": "1.13.2",
69
67
  "byline": "5.0.0",
70
- "chalk": "4.1.2",
71
- "chokidar": "4.0.1",
68
+ "chokidar": "4.0.3",
72
69
  "cli-table3": "0.6.5",
73
70
  "color": "4.2.3",
74
71
  "convert-source-map": "2.0.0",
@@ -76,86 +73,77 @@
76
73
  "email-validator": "2.0.4",
77
74
  "esprima": "4.0.1",
78
75
  "font-finder": "1.1.0",
79
- "glob": "11.0.0",
80
76
  "ios-device-lib": "0.9.4",
81
77
  "ios-mobileprovision-finder": "1.2.1",
82
- "ios-sim-portable": "4.5.0",
83
- "jimp": "0.22.10",
78
+ "ios-sim-portable": "4.5.1",
79
+ "jimp": "1.6.0",
84
80
  "lodash": "4.17.21",
85
81
  "log4js": "6.9.1",
86
- "marked": "13.0.3",
87
- "marked-terminal": "7.1.0",
88
- "minimatch": "10.0.1",
82
+ "marked": "15.0.12",
83
+ "marked-terminal": "7.3.0",
84
+ "minimatch": "10.1.1",
89
85
  "mkdirp": "3.0.1",
90
86
  "mute-stream": "2.0.0",
91
- "nativescript-dev-xcode": "0.8.0",
92
- "open": "10.1.0",
87
+ "nativescript-dev-xcode": "0.8.1",
88
+ "open": "8.4.2",
93
89
  "ora": "5.4.1",
94
- "pacote": "15.1.1",
90
+ "pacote": "21.0.3",
95
91
  "pbxproj-dom": "1.2.0",
96
92
  "plist": "3.1.0",
97
93
  "plist-merge-patch": "0.2.0",
98
- "prettier": "3.3.3",
94
+ "prettier": "3.6.2",
99
95
  "prompts": "2.4.2",
100
96
  "proper-lockfile": "4.1.2",
101
- "proxy-lib": "0.4.0",
97
+ "proxy-lib": "0.4.1",
102
98
  "qr-image": "3.2.0",
103
99
  "qrcode-terminal": "0.12.0",
104
- "semver": "7.6.3",
105
- "shelljs": "0.8.5",
106
- "simple-git": "3.27.0",
100
+ "semver": "7.7.3",
101
+ "shelljs": "0.10.0",
102
+ "simple-git": "3.30.0",
107
103
  "simple-plist": "1.4.0",
108
- "source-map": "0.8.0-beta.0",
109
- "stringify-package": "1.0.1",
110
- "tar": "7.4.3",
111
- "temp": "0.9.4",
112
- "ts-morph": "17.0.1",
104
+ "source-map": "0.7.6",
105
+ "tar": "7.5.2",
106
+ "ts-morph": "25.0.1",
113
107
  "tunnel": "0.0.6",
114
- "typescript": "5.6.3",
108
+ "typescript": "5.7.3",
115
109
  "universal-analytics": "0.5.3",
116
- "uuid": "10.0.0",
110
+ "uuid": "11.1.0",
117
111
  "winreg": "1.2.5",
118
- "ws": "8.18.0",
112
+ "ws": "8.18.3",
119
113
  "xml2js": "0.6.2",
120
114
  "yargs": "17.7.2"
121
115
  },
122
116
  "devDependencies": {
123
- "@types/archiver": "^6.0.2",
117
+ "@types/archiver": "^6.0.3",
124
118
  "@types/byline": "^4.2.36",
125
- "@types/chai": "4.3.4",
126
- "@types/chai-as-promised": "7.1.5",
127
- "@types/chokidar": "2.1.3",
128
- "@types/color": "3.0.6",
119
+ "@types/chai": "5.2.2",
120
+ "@types/chai-as-promised": "8.0.2",
121
+ "@types/color": "4.2.0",
129
122
  "@types/convert-source-map": "2.0.3",
130
- "@types/form-data": "2.5.0",
131
- "@types/glob": "^8.1.0",
132
- "@types/lodash": "4.17.10",
133
- "@types/marked": "^6.0.0",
134
- "@types/node": "22.7.5",
135
- "@types/npmcli__arborist": "^5.6.11",
136
- "@types/ora": "3.2.0",
123
+ "@types/lodash": "4.17.20",
124
+ "@types/marked-terminal": "^6.1.1",
125
+ "@types/node": "^22.0.0",
126
+ "@types/npmcli__arborist": "^6.3.0",
137
127
  "@types/pacote": "^11.1.8",
138
128
  "@types/plist": "^3.0.5",
139
- "@types/prettier": "3.0.0",
140
129
  "@types/prompts": "2.4.9",
141
130
  "@types/proper-lockfile": "4.1.4",
142
131
  "@types/qr-image": "3.2.9",
143
132
  "@types/retry": "0.12.5",
144
- "@types/semver": "7.5.8",
145
- "@types/shelljs": "^0.8.15",
133
+ "@types/semver": "7.7.1",
134
+ "@types/shelljs": "^0.8.11",
146
135
  "@types/sinon": "^17.0.3",
147
- "@types/source-map": "0.5.7",
148
- "@types/tabtab": "^3.0.4",
136
+ "@types/tabtab": "^3.0.2",
149
137
  "@types/tar": "6.1.13",
150
- "@types/temp": "0.9.4",
151
138
  "@types/tunnel": "0.0.7",
152
139
  "@types/universal-analytics": "0.4.8",
153
140
  "@types/uuid": "^10.0.0",
154
- "@types/ws": "8.5.12",
141
+ "@types/ws": "8.18.1",
155
142
  "@types/xml2js": "0.4.14",
156
143
  "@types/yargs": "17.0.33",
157
- "chai": "4.3.7",
158
- "chai-as-promised": "7.1.1",
144
+ "braces": ">=3.0.3",
145
+ "chai": "5.3.3",
146
+ "chai-as-promised": "8.0.2",
159
147
  "conventional-changelog-cli": "^5.0.0",
160
148
  "grunt": "1.6.1",
161
149
  "grunt-contrib-clean": "2.0.1",
@@ -164,14 +152,14 @@
164
152
  "grunt-shell": "4.0.0",
165
153
  "grunt-template": "1.0.0",
166
154
  "grunt-ts": "6.0.0-beta.22",
167
- "husky": "8.0.3",
155
+ "husky": "9.1.7",
168
156
  "istanbul": "0.4.5",
169
- "latest-version": "5.1.0",
170
- "lint-staged": "^13.2.0",
171
- "mocha": "10.2.0",
172
- "sinon": "15.0.3",
157
+ "lint-staged": "~15.5.2",
158
+ "mocha": "11.7.4",
159
+ "sinon": "19.0.5",
173
160
  "source-map-support": "0.5.21",
174
- "standard-version": "9.5.0"
161
+ "standard-version": "9.5.0",
162
+ "xml2js": ">=0.5.0"
175
163
  },
176
164
  "optionalDependencies": {
177
165
  "fsevents": "*"
@@ -187,9 +175,14 @@
187
175
  "analyze": true,
188
176
  "license": "Apache-2.0",
189
177
  "engines": {
190
- "node": ">=14.0.0"
178
+ "node": ">=20.0.0"
191
179
  },
192
180
  "lint-staged": {
193
181
  "*.ts": "prettier --write"
182
+ },
183
+ "packageManager": "yarn@4.10.3",
184
+ "resolutions": {
185
+ "nativescript-dev-xcode@0.8.1": "patch:nativescript-dev-xcode@npm%3A0.8.1#./.yarn/patches/nativescript-dev-xcode-npm-0.8.1-c14b82ef0b.patch",
186
+ "@nstudio/trapezedev-project@7.2.3": "patch:@nstudio/trapezedev-project@npm%3A7.2.3#./.yarn/patches/@nstudio-trapezedev-project-npm-7.2.3-6b4d535c7d.patch"
194
187
  }
195
188
  }
@@ -1 +1 @@
1
- Downloaded from https://github.com/google/bundletool/releases/tag/1.15.6
1
+ Downloaded from https://github.com/google/bundletool/releases/tag/1.18.2
Binary file