@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.
- package/config/test-deps-versions-generated.json +16 -0
- package/docs/build-jekyll-md.sh +1 -1
- package/docs/man_pages/config/config-get.md +36 -0
- package/docs/man_pages/config/config-set.md +40 -0
- package/docs/man_pages/config/config.md +39 -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/project/hooks/hooks.md +35 -0
- package/docs/man_pages/start.md +2 -1
- package/lib/.d.ts +9 -3
- package/lib/bootstrap.js +4 -1
- package/lib/bun-package-manager.js +1 -1
- package/lib/color.js +38 -7
- package/lib/commands/build.js +18 -2
- package/lib/commands/clean.js +1 -2
- package/lib/commands/config.js +1 -1
- package/lib/commands/embedding/embed.js +1 -1
- package/lib/commands/generate.js +2 -41
- package/lib/commands/hooks/common.js +79 -0
- package/lib/commands/hooks/hooks-lock.js +100 -0
- package/lib/commands/hooks/hooks.js +71 -0
- package/lib/commands/post-install.js +2 -2
- package/lib/commands/typings.js +29 -18
- package/lib/commands/widget.js +799 -0
- package/lib/common/definitions/extensibility.d.ts +2 -2
- package/lib/common/definitions/mobile.d.ts +72 -72
- package/lib/common/file-system.js +1 -2
- package/lib/common/header.js +3 -3
- package/lib/common/logger/layouts/cli-layout.js +1 -1
- package/lib/common/logger/logger.js +5 -5
- package/lib/common/mobile/android/android-device.js +1 -1
- package/lib/common/mobile/android/android-emulator-services.js +9 -7
- package/lib/common/mobile/device-log-provider.js +3 -4
- 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/project-helper.js +15 -2
- package/lib/common/services/hooks-service.js +23 -6
- package/lib/common/verify-node-version.js +1 -1
- package/lib/constants.js +8 -5
- package/lib/controllers/migrate-controller.js +11 -12
- package/lib/controllers/prepare-controller.js +11 -13
- package/lib/controllers/run-controller.js +1 -1
- package/lib/declarations.d.ts +5 -0
- package/lib/definitions/hooks.d.ts +1 -0
- package/lib/definitions/ios.d.ts +11 -1
- package/lib/definitions/nativescript-dev-xcode.d.ts +25 -1
- package/lib/definitions/project.d.ts +102 -25
- package/lib/definitions/temp-service.d.ts +6 -2
- package/lib/helpers/key-command-helper.js +2 -1
- package/lib/nativescript-cli.js +28 -0
- package/lib/node-package-manager.js +1 -1
- package/lib/options.js +4 -0
- package/lib/project-data.js +10 -4
- package/lib/services/analytics/analytics-broker-process.js +1 -1
- package/lib/services/analytics/analytics-service.js +2 -1
- package/lib/services/analytics-settings-service.js +2 -1
- package/lib/services/android/gradle-build-args-service.js +8 -4
- package/lib/services/android/gradle-build-service.js +4 -1
- package/lib/services/android-plugin-build-service.js +1 -1
- package/lib/services/android-project-service.js +12 -10
- package/lib/services/assets-generation/assets-generation-service.js +33 -15
- package/lib/services/{webpack/webpack-compiler-service.js → bundler/bundler-compiler-service.js} +258 -88
- package/lib/services/bundler/bundler.js +2 -0
- package/lib/services/extensibility-service.js +1 -1
- package/lib/services/ios/spm-service.js +22 -2
- package/lib/services/ios/xcodebuild-args-service.js +7 -5
- package/lib/services/ios-debugger-port-service.js +1 -1
- package/lib/services/ios-project-service.js +45 -15
- package/lib/services/ios-watch-app-service.js +540 -16
- package/lib/services/livesync/android-livesync-tool.js +4 -2
- package/lib/services/plugins-service.js +1 -0
- package/lib/services/project-changes-service.js +1 -1
- package/lib/services/project-config-service.js +12 -3
- package/lib/services/temp-service.js +16 -4
- package/lib/services/versions-service.js +2 -1
- package/lib/tools/config-manipulation/config-transformer.js +9 -0
- package/package.json +59 -66
- package/vendor/aab-tool/README.txt +1 -1
- package/vendor/aab-tool/bundletool.jar +0 -0
- package/vendor/gradle-app/app/build.gradle +365 -130
- package/vendor/gradle-app/app/gradle.properties +45 -0
- package/vendor/gradle-app/build.gradle +7 -7
- package/vendor/gradle-plugin/build.gradle +7 -6
- package/lib/services/webpack/webpack.d.ts +0 -227
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
|
|
3
|
+
"karma": "6.4.4",
|
|
4
|
+
"karma-coverage": "2.2.1",
|
|
5
|
+
"karma-nativescript-launcher": "1.0.0",
|
|
6
|
+
"mocha": "11.7.5",
|
|
7
|
+
"karma-mocha": "2.0.1",
|
|
8
|
+
"karma-chai": "0.1.0",
|
|
9
|
+
"karma-jasmine": "4.0.2",
|
|
10
|
+
"karma-qunit": "4.2.1",
|
|
11
|
+
"@types/karma-chai": "0.1.8",
|
|
12
|
+
"@types/mocha": "10.0.10",
|
|
13
|
+
"@types/jasmine": "5.1.15",
|
|
14
|
+
"@types/qunit": "2.19.13",
|
|
15
|
+
"nyc": "17.1.0"
|
|
16
|
+
}
|
package/docs/build-jekyll-md.sh
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<% if (isJekyll) { %>---
|
|
2
|
+
title: ns config get
|
|
3
|
+
position: 2
|
|
4
|
+
---<% } %>
|
|
5
|
+
|
|
6
|
+
# ns config get
|
|
7
|
+
|
|
8
|
+
### Description
|
|
9
|
+
|
|
10
|
+
Prints the value for a specific key from the project's NativeScript configuration.
|
|
11
|
+
|
|
12
|
+
### Commands
|
|
13
|
+
|
|
14
|
+
Usage | Synopsis
|
|
15
|
+
------|-------
|
|
16
|
+
General | `$ ns config get <key>`
|
|
17
|
+
|
|
18
|
+
### Arguments
|
|
19
|
+
|
|
20
|
+
* `<key>` — The configuration key in dot-notation. Examples: `ios.id`, `android.codeCache`, `bundler`.
|
|
21
|
+
|
|
22
|
+
### Examples
|
|
23
|
+
|
|
24
|
+
* `$ ns config get ios.id`
|
|
25
|
+
* `$ ns config get android.codeCache`
|
|
26
|
+
* `$ ns config get bundler`
|
|
27
|
+
|
|
28
|
+
<% if(isHtml) { %>
|
|
29
|
+
|
|
30
|
+
### Related Commands
|
|
31
|
+
|
|
32
|
+
Command | Description
|
|
33
|
+
----------|----------
|
|
34
|
+
[config](config.html) | Lists all configuration values for the current project.
|
|
35
|
+
[config set](config-set.html) | Sets the value for the specified configuration key.
|
|
36
|
+
<% } %>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<% if (isJekyll) { %>---
|
|
2
|
+
title: ns config set
|
|
3
|
+
position: 3
|
|
4
|
+
---<% } %>
|
|
5
|
+
|
|
6
|
+
# ns config set
|
|
7
|
+
|
|
8
|
+
### Description
|
|
9
|
+
|
|
10
|
+
Sets the value for a specific key in the project's NativeScript configuration.
|
|
11
|
+
|
|
12
|
+
### Commands
|
|
13
|
+
|
|
14
|
+
Usage | Synopsis
|
|
15
|
+
------|-------
|
|
16
|
+
General | `$ ns config set <key> <value>`
|
|
17
|
+
|
|
18
|
+
### Arguments
|
|
19
|
+
|
|
20
|
+
* `<key>` — The configuration key in dot-notation. Examples: `ios.id`, `android.codeCache`, `bundler`.
|
|
21
|
+
* `<value>` — The value to set. Parsed as JSON when possible (e.g. `true`, `42`, `{ "foo": "bar" }`). Otherwise treated as a string.
|
|
22
|
+
|
|
23
|
+
### Examples
|
|
24
|
+
|
|
25
|
+
* `$ ns config set ios.id org.nativescript.myapp`
|
|
26
|
+
* `$ ns config set android.codeCache true`
|
|
27
|
+
* `$ ns config set bundler vite`
|
|
28
|
+
|
|
29
|
+
### Notes
|
|
30
|
+
|
|
31
|
+
* Setting whole objects is not supported. Update individual keys instead. For example, use:
|
|
32
|
+
`$ ns config set android.codeCache true`
|
|
33
|
+
|
|
34
|
+
### Related Commands
|
|
35
|
+
|
|
36
|
+
Command | Description
|
|
37
|
+
----------|----------
|
|
38
|
+
[config](config.html) | Lists all configuration values for the current project.
|
|
39
|
+
[config get](config-get.html) | Prints the value for the specified configuration key.
|
|
40
|
+
<% } %>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<% if (isJekyll) { %>---
|
|
2
|
+
title: ns config
|
|
3
|
+
position: 1
|
|
4
|
+
---<% } %>
|
|
5
|
+
|
|
6
|
+
# ns config
|
|
7
|
+
|
|
8
|
+
### Description
|
|
9
|
+
|
|
10
|
+
View and manage your project's NativeScript configuration stored in `nativescript.config.(js|ts)` (or legacy `nsconfig.json`).
|
|
11
|
+
|
|
12
|
+
### Commands
|
|
13
|
+
|
|
14
|
+
Usage | Synopsis
|
|
15
|
+
------|---------
|
|
16
|
+
List all config | `$ ns config`
|
|
17
|
+
Get a value | `$ ns config get <key>`
|
|
18
|
+
Set a value | `$ ns config set <key> <value>`
|
|
19
|
+
|
|
20
|
+
### Examples
|
|
21
|
+
|
|
22
|
+
* `$ ns config` — prints all configuration values.
|
|
23
|
+
* `$ ns config get ios.id` — prints the iOS bundle identifier.
|
|
24
|
+
* `$ ns config set android.codeCache true` — enables Android V8 code cache.
|
|
25
|
+
|
|
26
|
+
### Notes
|
|
27
|
+
|
|
28
|
+
* Keys use dot-notation, for example: `ios.id`, `android.codeCache`, `bundler`.
|
|
29
|
+
* Values are parsed as JSON when possible. Use quotes for strings with spaces.
|
|
30
|
+
|
|
31
|
+
<% if(isHtml) { %>
|
|
32
|
+
|
|
33
|
+
### Related Commands
|
|
34
|
+
|
|
35
|
+
Command | Description
|
|
36
|
+
----------|----------
|
|
37
|
+
[config get](config-get.html) | Prints the value for the specified configuration key.
|
|
38
|
+
[config set](config-set.html) | Sets the value for the specified configuration key.
|
|
39
|
+
<% } %>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<% if (isJekyll) { %>---
|
|
2
|
+
title: ns widget ios
|
|
3
|
+
position: 11
|
|
4
|
+
---<% } %>
|
|
5
|
+
|
|
6
|
+
# ns widget ios
|
|
7
|
+
|
|
8
|
+
### Description
|
|
9
|
+
|
|
10
|
+
Interactively adds a new iOS widget based on a predefined template.
|
|
11
|
+
|
|
12
|
+
### Commands
|
|
13
|
+
|
|
14
|
+
Usage | Synopsis
|
|
15
|
+
------|-------
|
|
16
|
+
General | `$ ns widget ios`
|
|
17
|
+
|
|
18
|
+
<% if(isHtml) { %>
|
|
19
|
+
|
|
20
|
+
### Command Limitations
|
|
21
|
+
|
|
22
|
+
* You can run `$ ns widget ios` only on macOS systems.
|
|
23
|
+
|
|
24
|
+
<% } %>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<% if (isJekyll) { %>---
|
|
2
|
+
title: ns widget ios
|
|
3
|
+
position: 11
|
|
4
|
+
---<% } %>
|
|
5
|
+
|
|
6
|
+
# ns widget ios
|
|
7
|
+
|
|
8
|
+
### Description
|
|
9
|
+
|
|
10
|
+
Interactively adds a new iOS widget based on a predefined template.
|
|
11
|
+
|
|
12
|
+
### Commands
|
|
13
|
+
|
|
14
|
+
Usage | Synopsis
|
|
15
|
+
------|-------
|
|
16
|
+
General | `$ ns widget ios`
|
|
17
|
+
|
|
18
|
+
<% if(isHtml) { %>
|
|
19
|
+
|
|
20
|
+
### Command Limitations
|
|
21
|
+
|
|
22
|
+
* You can run `$ ns widget ios` only on macOS systems.
|
|
23
|
+
|
|
24
|
+
<% } %>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<% if (isJekyll) { %>---
|
|
2
|
+
title: ns hooks
|
|
3
|
+
position: 1
|
|
4
|
+
---<% } %>
|
|
5
|
+
|
|
6
|
+
# ns create
|
|
7
|
+
|
|
8
|
+
### Description
|
|
9
|
+
|
|
10
|
+
Manages lifecycle hooks from installed plugins.
|
|
11
|
+
|
|
12
|
+
### Commands
|
|
13
|
+
|
|
14
|
+
Usage | Synopsis
|
|
15
|
+
---------|---------
|
|
16
|
+
Install | `$ ns hooks install`
|
|
17
|
+
List | `$ ns hooks list`
|
|
18
|
+
Lock | `$ ns hooks lock`
|
|
19
|
+
Verify | `$ ns hooks verify`
|
|
20
|
+
|
|
21
|
+
#### Install
|
|
22
|
+
|
|
23
|
+
Installs hooks from each installed plugin dependency.
|
|
24
|
+
|
|
25
|
+
#### List
|
|
26
|
+
|
|
27
|
+
Lists the plugins which have hooks and which scripts they install
|
|
28
|
+
|
|
29
|
+
#### Lock
|
|
30
|
+
|
|
31
|
+
Generates a `hooks-lock.json` containing the hooks that are in the current versions of the plugins.
|
|
32
|
+
|
|
33
|
+
#### Verify
|
|
34
|
+
|
|
35
|
+
Verifies that the hooks contained in the installed plugins match those listed in the `hooks-lock.json` file.
|
package/docs/man_pages/start.md
CHANGED
|
@@ -50,7 +50,8 @@ Command | Description
|
|
|
50
50
|
[install](project/configuration/install.html) | Installs all platforms and dependencies described in the `package.json` file in the current directory.
|
|
51
51
|
[plugin](lib-management/plugin.html) | Lets you manage the plugins for your project.
|
|
52
52
|
[open](project/configuration/open.md) | Opens the native project in Xcode/Android Studio.
|
|
53
|
-
|
|
53
|
+
[widget ios](project/configuration/widget.md) | Adds a new iOS widget to the project.
|
|
54
|
+
[hooks](project/hooks/hooks.html) | Installs lifecycle hooks from plugins.
|
|
54
55
|
## Publishing Commands
|
|
55
56
|
Command | Description
|
|
56
57
|
---|---
|
package/lib/.d.ts
CHANGED
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
/// <reference path="commands/generate-assets.ts" />
|
|
24
24
|
/// <reference path="commands/generate-help.ts" />
|
|
25
25
|
/// <reference path="commands/generate.ts" />
|
|
26
|
+
/// <reference path="commands/hooks/common.ts" />
|
|
27
|
+
/// <reference path="commands/hooks/hooks-lock.ts" />
|
|
28
|
+
/// <reference path="commands/hooks/hooks.ts" />
|
|
26
29
|
/// <reference path="commands/info.ts" />
|
|
27
30
|
/// <reference path="commands/install.ts" />
|
|
28
31
|
/// <reference path="commands/list-platforms.ts" />
|
|
@@ -48,6 +51,7 @@
|
|
|
48
51
|
/// <reference path="commands/typings.ts" />
|
|
49
52
|
/// <reference path="commands/update-platform.ts" />
|
|
50
53
|
/// <reference path="commands/update.ts" />
|
|
54
|
+
/// <reference path="commands/widget.ts" />
|
|
51
55
|
/// <reference path="common/bootstrap.ts" />
|
|
52
56
|
/// <reference path="common/child-process.ts" />
|
|
53
57
|
/// <reference path="common/codeGeneration/code-entity.ts" />
|
|
@@ -256,6 +260,7 @@
|
|
|
256
260
|
/// <reference path="definitions/files-hash-service.d.ts" />
|
|
257
261
|
/// <reference path="definitions/gradle.d.ts" />
|
|
258
262
|
/// <reference path="definitions/hmr-status-service.d.ts" />
|
|
263
|
+
/// <reference path="definitions/hooks.d.ts" />
|
|
259
264
|
/// <reference path="definitions/initialize-service.d.ts" />
|
|
260
265
|
/// <reference path="definitions/ios-debugger-port-service.d.ts" />
|
|
261
266
|
/// <reference path="definitions/ios.d.ts" />
|
|
@@ -343,6 +348,8 @@
|
|
|
343
348
|
/// <reference path="services/build-artifacts-service.ts" />
|
|
344
349
|
/// <reference path="services/build-data-service.ts" />
|
|
345
350
|
/// <reference path="services/build-info-file-service.ts" />
|
|
351
|
+
/// <reference path="services/bundler/bundler-compiler-service.ts" />
|
|
352
|
+
/// <reference path="services/bundler/bundler.ts" />
|
|
346
353
|
/// <reference path="services/cleanup-service.ts" />
|
|
347
354
|
/// <reference path="services/cocoapods-platform-manager.ts" />
|
|
348
355
|
/// <reference path="services/cocoapods-service.ts" />
|
|
@@ -418,8 +425,6 @@
|
|
|
418
425
|
/// <reference path="services/user-settings-service.ts" />
|
|
419
426
|
/// <reference path="services/versions-service.ts" />
|
|
420
427
|
/// <reference path="services/watch-ignore-list-service.ts" />
|
|
421
|
-
/// <reference path="services/webpack/webpack-compiler-service.ts" />
|
|
422
|
-
/// <reference path="services/webpack/webpack.d.ts" />
|
|
423
428
|
/// <reference path="services/xcconfig-service.ts" />
|
|
424
429
|
/// <reference path="services/xcproj-service.ts" />
|
|
425
430
|
/// <reference path="shared-event-bus.ts" />
|
|
@@ -464,6 +469,7 @@
|
|
|
464
469
|
/// <reference path="../test/services/android-plugin-build-service.ts" />
|
|
465
470
|
/// <reference path="../test/services/android-project-service.ts" />
|
|
466
471
|
/// <reference path="../test/services/android/gradle-build-args-service.ts" />
|
|
472
|
+
/// <reference path="../test/services/bundler/bundler-compiler-service.ts" />
|
|
467
473
|
/// <reference path="../test/services/doctor-service.ts" />
|
|
468
474
|
/// <reference path="../test/services/extensibility-service.ts" />
|
|
469
475
|
/// <reference path="../test/services/ios-debugger-port-service.ts" />
|
|
@@ -486,7 +492,7 @@
|
|
|
486
492
|
/// <reference path="../test/services/project-data-service.ts" />
|
|
487
493
|
/// <reference path="../test/services/test-execution-service.ts" />
|
|
488
494
|
/// <reference path="../test/services/user-settings-service.ts" />
|
|
489
|
-
/// <reference path="../test/
|
|
495
|
+
/// <reference path="../test/spm-service.ts" />
|
|
490
496
|
/// <reference path="../test/stubs.ts" />
|
|
491
497
|
/// <reference path="../test/sys-info.ts" />
|
|
492
498
|
/// <reference path="../test/test-bootstrap.ts" />
|
package/lib/bootstrap.js
CHANGED
|
@@ -128,6 +128,8 @@ yok_1.injector.requireCommand("plugin|remove", "./commands/plugin/remove-plugin"
|
|
|
128
128
|
yok_1.injector.requireCommand("plugin|update", "./commands/plugin/update-plugin");
|
|
129
129
|
yok_1.injector.requireCommand("plugin|build", "./commands/plugin/build-plugin");
|
|
130
130
|
yok_1.injector.requireCommand("plugin|create", "./commands/plugin/create-plugin");
|
|
131
|
+
yok_1.injector.requireCommand(["hooks|*list", "hooks|install"], "./commands/hooks/hooks");
|
|
132
|
+
yok_1.injector.requireCommand(["hooks|lock", "hooks|verify"], "./commands/hooks/hooks-lock");
|
|
131
133
|
yok_1.injector.require("doctorService", "./services/doctor-service");
|
|
132
134
|
yok_1.injector.require("xcprojService", "./services/xcproj-service");
|
|
133
135
|
yok_1.injector.require("versionsService", "./services/versions-service");
|
|
@@ -185,7 +187,7 @@ yok_1.injector.require("qrCodeTerminalService", "./services/qr-code-terminal-ser
|
|
|
185
187
|
yok_1.injector.require("testInitializationService", "./services/test-initialization-service");
|
|
186
188
|
yok_1.injector.require("networkConnectivityValidator", "./helpers/network-connectivity-validator");
|
|
187
189
|
yok_1.injector.requirePublic("cleanupService", "./services/cleanup-service");
|
|
188
|
-
yok_1.injector.require("
|
|
190
|
+
yok_1.injector.require("bundlerCompilerService", "./services/bundler/bundler-compiler-service");
|
|
189
191
|
yok_1.injector.require("applePortalSessionService", "./services/apple-portal/apple-portal-session-service");
|
|
190
192
|
yok_1.injector.require("applePortalCookieService", "./services/apple-portal/apple-portal-cookie-service");
|
|
191
193
|
yok_1.injector.require("applePortalApplicationService", "./services/apple-portal/apple-portal-application-service");
|
|
@@ -208,4 +210,5 @@ yok_1.injector.requireCommand([
|
|
|
208
210
|
"native|add|swift",
|
|
209
211
|
"native|add|objective-c",
|
|
210
212
|
], "./commands/native-add");
|
|
213
|
+
yok_1.injector.requireCommand(["widget", "widget|ios"], "./commands/widget");
|
|
211
214
|
require("./key-commands/bootstrap");
|
|
@@ -30,7 +30,7 @@ class BunPackageManager extends base_package_manager_1.BasePackageManager {
|
|
|
30
30
|
const packageJsonPath = path.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);
|
package/lib/color.js
CHANGED
|
@@ -1,10 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.color = void 0;
|
|
3
|
+
exports.stripColors = exports.color = void 0;
|
|
4
|
+
const node_util_1 = require("node:util");
|
|
5
|
+
exports.color = {
|
|
6
|
+
reset: (text) => (0, node_util_1.styleText)("reset", text),
|
|
7
|
+
bold: (text) => (0, node_util_1.styleText)("bold", text),
|
|
8
|
+
dim: (text) => (0, node_util_1.styleText)("dim", text),
|
|
9
|
+
italic: (text) => (0, node_util_1.styleText)("italic", text),
|
|
10
|
+
underline: (text) => (0, node_util_1.styleText)("underline", text),
|
|
11
|
+
inverse: (text) => (0, node_util_1.styleText)("inverse", text),
|
|
12
|
+
hidden: (text) => (0, node_util_1.styleText)("hidden", text),
|
|
13
|
+
strikethrough: (text) => (0, node_util_1.styleText)("strikethrough", text),
|
|
14
|
+
black: (text) => (0, node_util_1.styleText)("black", text),
|
|
15
|
+
red: (text) => (0, node_util_1.styleText)("red", text),
|
|
16
|
+
blue: (text) => (0, node_util_1.styleText)("blue", text),
|
|
17
|
+
magenta: (text) => (0, node_util_1.styleText)("magenta", text),
|
|
18
|
+
cyan: (text) => (0, node_util_1.styleText)("cyan", text),
|
|
19
|
+
white: (text) => (0, node_util_1.styleText)("white", text),
|
|
20
|
+
gray: (text) => (0, node_util_1.styleText)("gray", text),
|
|
21
|
+
yellow: (text) => (0, node_util_1.styleText)("yellow", text),
|
|
22
|
+
green: (text) => (0, node_util_1.styleText)("green", text),
|
|
23
|
+
grey: (text) => (0, node_util_1.styleText)("grey", text),
|
|
24
|
+
bgBlack: (text) => (0, node_util_1.styleText)("bgBlack", text),
|
|
25
|
+
bgBlackBright: (text) => (0, node_util_1.styleText)("bgBlackBright", text),
|
|
26
|
+
bgRed: (text) => (0, node_util_1.styleText)("bgRed", text),
|
|
27
|
+
bgGreen: (text) => (0, node_util_1.styleText)("bgGreen", text),
|
|
28
|
+
bgYellow: (text) => (0, node_util_1.styleText)("bgYellow", text),
|
|
29
|
+
bgBlue: (text) => (0, node_util_1.styleText)("bgBlue", text),
|
|
30
|
+
bgMagenta: (text) => (0, node_util_1.styleText)("bgMagenta", text),
|
|
31
|
+
bgCyan: (text) => (0, node_util_1.styleText)("bgCyan", text),
|
|
32
|
+
bgWhite: (text) => (0, node_util_1.styleText)("bgWhite", text),
|
|
33
|
+
cyanBright: (text) => (0, node_util_1.styleText)("cyanBright", text),
|
|
34
|
+
whiteBright: (text) => (0, node_util_1.styleText)("whiteBright", text),
|
|
35
|
+
greenBright: (text) => (0, node_util_1.styleText)("greenBright", text),
|
|
36
|
+
yellowBright: (text) => (0, node_util_1.styleText)("yellowBright", text),
|
|
37
|
+
redBright: (text) => (0, node_util_1.styleText)("redBright", text),
|
|
38
|
+
styleText: node_util_1.styleText,
|
|
39
|
+
};
|
|
40
|
+
const stripColors = (text) => (0, node_util_1.stripVTControlCharacters)(text);
|
|
4
41
|
exports.stripColors = stripColors;
|
|
5
|
-
const ansi = require("ansi-colors");
|
|
6
|
-
const chalk = require("chalk");
|
|
7
|
-
function stripColors(formatStr) {
|
|
8
|
-
return ansi.stripColor(formatStr);
|
|
9
|
-
}
|
|
10
|
-
exports.color = chalk;
|
package/lib/commands/build.js
CHANGED
|
@@ -122,9 +122,25 @@ class BuildVisionOsCommand extends BuildIosCommand {
|
|
|
122
122
|
this.$options = $options;
|
|
123
123
|
this.$migrateController = $migrateController;
|
|
124
124
|
}
|
|
125
|
+
async execute(args) {
|
|
126
|
+
await this.executeCore([
|
|
127
|
+
this.$devicePlatformsConstants.visionOS.toLowerCase(),
|
|
128
|
+
]);
|
|
129
|
+
}
|
|
125
130
|
async canExecute(args) {
|
|
126
|
-
|
|
127
|
-
|
|
131
|
+
const platform = this.$devicePlatformsConstants.visionOS;
|
|
132
|
+
if (!this.$options.force) {
|
|
133
|
+
await this.$migrateController.validate({
|
|
134
|
+
projectDir: this.$projectData.projectDir,
|
|
135
|
+
platforms: [platform],
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
super.validatePlatform(platform);
|
|
139
|
+
let canExecute = await super.canExecuteCommandBase(platform);
|
|
140
|
+
if (canExecute) {
|
|
141
|
+
canExecute = await super.validateArgs(args, platform);
|
|
142
|
+
}
|
|
143
|
+
return canExecute;
|
|
128
144
|
}
|
|
129
145
|
}
|
|
130
146
|
exports.BuildVisionOsCommand = BuildVisionOsCommand;
|
package/lib/commands/clean.js
CHANGED
|
@@ -70,7 +70,6 @@ class CleanCommand {
|
|
|
70
70
|
constants.HOOKS_DIR_NAME,
|
|
71
71
|
this.$projectData.getBuildRelativeDirectoryPath(),
|
|
72
72
|
constants.NODE_MODULES_FOLDER_NAME,
|
|
73
|
-
constants.PACKAGE_LOCK_JSON_FILE_NAME,
|
|
74
73
|
];
|
|
75
74
|
try {
|
|
76
75
|
const overridePathsToClean = this.$projectConfigService.getValue("cli.pathsToClean");
|
|
@@ -167,7 +166,7 @@ class CleanCommand {
|
|
|
167
166
|
optionsPerPage: process.stdout.rows - 6,
|
|
168
167
|
});
|
|
169
168
|
this.$logger.clearScreen();
|
|
170
|
-
spinner.warn(`This will run "${color_1.color.yellow(`ns clean`)}" in all the selected projects and ${color_1.color.red
|
|
169
|
+
spinner.warn(`This will run "${color_1.color.yellow(`ns clean`)}" in all the selected projects and ${color_1.color.styleText(["red", "bold"], "delete files from your system")}!`);
|
|
171
170
|
spinner.warn(`This action cannot be undone!`);
|
|
172
171
|
let confirmed = await this.$prompter.confirm("Are you sure you want to clean the selected projects?");
|
|
173
172
|
if (!confirmed) {
|
package/lib/commands/config.js
CHANGED
|
@@ -81,7 +81,7 @@ class ConfigSetCommand {
|
|
|
81
81
|
const convertedValue = this.getConvertedValue(value);
|
|
82
82
|
const existingKey = current !== undefined;
|
|
83
83
|
const keyDisplay = color_1.color.green(key);
|
|
84
|
-
const currentDisplay = color_1.color.yellow(current);
|
|
84
|
+
const currentDisplay = current ? color_1.color.yellow(current) : "";
|
|
85
85
|
const updatedDisplay = color_1.color.cyan(convertedValue);
|
|
86
86
|
this.$logger.info(`${existingKey ? "Updating" : "Setting"} ${keyDisplay}${existingKey ? ` from ${currentDisplay} ` : " "}to ${updatedDisplay}`);
|
|
87
87
|
try {
|
|
@@ -31,7 +31,7 @@ class EmbedCommand extends prepare_1.PrepareCommand {
|
|
|
31
31
|
const hostProjectPath = args[1];
|
|
32
32
|
const resolvedHostProjectPath = this.resolveHostProjectPath(hostProjectPath);
|
|
33
33
|
if (!this.$fs.exists(resolvedHostProjectPath)) {
|
|
34
|
-
this.$logger.error(`The host project path ${color_1.color.yellow(hostProjectPath)} (resolved to: ${color_1.color.yellow
|
|
34
|
+
this.$logger.error(`The host project path ${color_1.color.yellow(hostProjectPath)} (resolved to: ${color_1.color.styleText(["yellow", "dim"], resolvedHostProjectPath)}) does not exist.`);
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
this.$options["hostProjectPath"] = resolvedHostProjectPath;
|
package/lib/commands/generate.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GenerateCommand = void 0;
|
|
4
|
-
const schematics_executor_1 = require("@nativescript/schematics-executor");
|
|
5
4
|
const yok_1 = require("../common/yok");
|
|
6
5
|
class GenerateCommand {
|
|
7
|
-
constructor($logger, $
|
|
6
|
+
constructor($logger, $errors) {
|
|
8
7
|
this.$logger = $logger;
|
|
9
|
-
this.$options = $options;
|
|
10
8
|
this.$errors = $errors;
|
|
11
9
|
this.allowedParameters = [];
|
|
12
10
|
}
|
|
13
11
|
async execute(_rawArgs) {
|
|
14
12
|
try {
|
|
15
|
-
|
|
13
|
+
this.$logger.info("If you have ideas for this command, please discuss at https://nativescript.org/discord");
|
|
16
14
|
}
|
|
17
15
|
catch (error) {
|
|
18
16
|
this.$errors.fail(error.message);
|
|
@@ -24,46 +22,9 @@ class GenerateCommand {
|
|
|
24
22
|
return true;
|
|
25
23
|
}
|
|
26
24
|
validateExecutionOptions() {
|
|
27
|
-
if (!this.executionOptions.schematic) {
|
|
28
|
-
this.$errors.failWithHelp(`The generate command requires a schematic name to be specified.`);
|
|
29
|
-
}
|
|
30
25
|
}
|
|
31
26
|
setExecutionOptions(rawArgs) {
|
|
32
|
-
const options = this.parseRawArgs(rawArgs);
|
|
33
|
-
this.executionOptions = {
|
|
34
|
-
...options,
|
|
35
|
-
logger: this.$logger,
|
|
36
|
-
directory: process.cwd(),
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
parseRawArgs(rawArgs) {
|
|
40
|
-
const collection = this.$options.collection;
|
|
41
|
-
const schematic = rawArgs.shift();
|
|
42
|
-
const { options, args } = parseSchematicSettings(rawArgs);
|
|
43
|
-
return {
|
|
44
|
-
collection,
|
|
45
|
-
schematic,
|
|
46
|
-
schematicOptions: options,
|
|
47
|
-
schematicArgs: args,
|
|
48
|
-
};
|
|
49
27
|
}
|
|
50
28
|
}
|
|
51
29
|
exports.GenerateCommand = GenerateCommand;
|
|
52
|
-
function parseSchematicSettings(rawArgs) {
|
|
53
|
-
const [optionStrings, args] = partition(rawArgs, (item) => item.includes("="));
|
|
54
|
-
const options = optionStrings
|
|
55
|
-
.map((o) => o.split("="))
|
|
56
|
-
.map(([key, ...value]) => [key, value.join("=")])
|
|
57
|
-
.reduce((obj, [key, value]) => {
|
|
58
|
-
return { ...obj, [key]: value };
|
|
59
|
-
}, {});
|
|
60
|
-
return { options, args };
|
|
61
|
-
}
|
|
62
|
-
function partition(array, predicate) {
|
|
63
|
-
return array.reduce(([pass, fail], item) => {
|
|
64
|
-
return predicate(item)
|
|
65
|
-
? [[...pass, item], fail]
|
|
66
|
-
: [pass, [...fail, item]];
|
|
67
|
-
}, [[], []]);
|
|
68
|
-
}
|
|
69
30
|
yok_1.injector.registerCommand("generate", GenerateCommand);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HooksVerify = exports.LOCK_FILE_NAME = void 0;
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const crypto = require("crypto");
|
|
6
|
+
exports.LOCK_FILE_NAME = "nativescript-lock.json";
|
|
7
|
+
class HooksVerify {
|
|
8
|
+
constructor($projectData, $errors, $fs, $logger) {
|
|
9
|
+
this.$projectData = $projectData;
|
|
10
|
+
this.$errors = $errors;
|
|
11
|
+
this.$fs = $fs;
|
|
12
|
+
this.$logger = $logger;
|
|
13
|
+
this.allowedParameters = [];
|
|
14
|
+
this.$projectData.initializeProjectData();
|
|
15
|
+
}
|
|
16
|
+
async verifyHooksLock(plugins, hooksLockPath) {
|
|
17
|
+
var _a;
|
|
18
|
+
let lockFileContent;
|
|
19
|
+
let hooksLock;
|
|
20
|
+
try {
|
|
21
|
+
lockFileContent = this.$fs.readText(hooksLockPath, "utf8");
|
|
22
|
+
hooksLock = JSON.parse(lockFileContent);
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
this.$errors.fail(`❌ Failed to read or parse ${exports.LOCK_FILE_NAME} at ${hooksLockPath}`);
|
|
26
|
+
}
|
|
27
|
+
const lockMap = new Map();
|
|
28
|
+
for (const plugin of hooksLock) {
|
|
29
|
+
const hookMap = new Map();
|
|
30
|
+
for (const hook of plugin.hooks) {
|
|
31
|
+
hookMap.set(hook.type, hook.hash);
|
|
32
|
+
}
|
|
33
|
+
lockMap.set(plugin.name, hookMap);
|
|
34
|
+
}
|
|
35
|
+
let isValid = true;
|
|
36
|
+
for (const plugin of plugins) {
|
|
37
|
+
const pluginLockHooks = lockMap.get(plugin.name);
|
|
38
|
+
if (!pluginLockHooks) {
|
|
39
|
+
this.$logger.error(`❌ Plugin '${plugin.name}' not found in ${exports.LOCK_FILE_NAME}`);
|
|
40
|
+
isValid = false;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
for (const hook of ((_a = plugin.nativescript) === null || _a === void 0 ? void 0 : _a.hooks) || []) {
|
|
44
|
+
const expectedHash = pluginLockHooks.get(hook.type);
|
|
45
|
+
if (!expectedHash) {
|
|
46
|
+
this.$logger.error(`❌ Missing hook '${hook.type}' for plugin '${plugin.name}' in ${exports.LOCK_FILE_NAME}`);
|
|
47
|
+
isValid = false;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
let fileContent;
|
|
51
|
+
try {
|
|
52
|
+
fileContent = this.$fs.readFile(path.join(plugin.fullPath, hook.script));
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
this.$logger.error(`❌ Cannot read script file '${hook.script}' for hook '${hook.type}' in plugin '${plugin.name}'`);
|
|
56
|
+
isValid = false;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const actualHash = crypto
|
|
60
|
+
.createHash("sha256")
|
|
61
|
+
.update(fileContent)
|
|
62
|
+
.digest("hex");
|
|
63
|
+
if (actualHash !== expectedHash) {
|
|
64
|
+
this.$logger.error(`❌ Hash mismatch for '${hook.script}' (${hook.type} in ${plugin.name}):`);
|
|
65
|
+
this.$logger.error(` Expected: ${expectedHash}`);
|
|
66
|
+
this.$logger.error(` Actual: ${actualHash}`);
|
|
67
|
+
isValid = false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (isValid) {
|
|
72
|
+
this.$logger.info("✅ All hooks verified successfully. No issues found.");
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
this.$errors.fail("❌ One or more hooks failed verification.");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.HooksVerify = HooksVerify;
|