Skip to content

Commit 7846bce

Browse files
committed
Merge branch 'master' into feature/webpack-only
# Conflicts: # lib/services/android-project-service.ts # test/plugins-service.ts
2 parents a695d94 + 59a7310 commit 7846bce

File tree

91 files changed

+726
-513
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+726
-513
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ module.exports = function (grunt) {
236236
});
237237
grunt.registerTask("lint", ["tslint:build"]);
238238
grunt.registerTask("all", ["clean", "test", "lint"]);
239-
grunt.registerTask("rebuild", ["clean", "ts:devlib"]);
239+
grunt.registerTask("rebuild", ["clean", "default"]);
240240
grunt.registerTask("default", ["ts:devlib", "generate_unit_testing_dependencies"]);
241241
grunt.registerTask("docs-jekyll", ['template']);
242242
};

PublicAPI.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ const tns = require("nativescript");
7070
* [deviceLog](#devicelog)
7171
* [previewQrCodeService](#previewqrcodeservice)
7272
* [getPlaygroundAppQrCode](#getplaygroundappqrcode)
73+
* [cleanupService](#cleanupservice)
74+
* [setCleanupLogFile](#setcleanuplogfile)
7375

7476
## Module projectService
7577

@@ -1487,6 +1489,31 @@ tns.previewQrCodeService.getPlaygroundAppQrCode()
14871489
});
14881490
```
14891491
1492+
## cleanupService
1493+
The `cleanupService` is used to handle actions that should be executed after CLI's process had exited. This is an internal service, that runs detached childProcess in which it executes CLI's cleanup actions once CLI is dead. As the process is detached, logs from it are not shown anywhere, so the service exposes a way to add log file in which the child process will write its logs.
1494+
1495+
### setCleanupLogFile
1496+
Defines the log file location where the child cleanup process will write its logs.
1497+
1498+
> NOTE: You must call this method immediately after requiring NativeScript CLI. In case you call it after the cleanup process had started, it will not use the passed log file.
1499+
1500+
* Definition
1501+
```TypeScript
1502+
/**
1503+
* Sets the file in which the cleanup process will write its logs.
1504+
* This method must be called before starting the cleanup process, i.e. when CLI is initialized.
1505+
* @param {string} filePath Path to file where the logs will be written. The logs are appended to the passed file.
1506+
* @returns {void}
1507+
*/
1508+
setCleanupLogFile(filePath: string): void;
1509+
```
1510+
1511+
* Usage
1512+
```JavaScript
1513+
const tns = require("nativescript");
1514+
tns.cleanupService.setCleanupLogFile("/Users/username/cleanup-logs.txt");
1515+
```
1516+
14901517
## How to add a new method to Public API
14911518
CLI is designed as command line tool and when it is used as a library, it does not give you access to all of the methods. This is mainly implementation detail. Most of the CLI's code is created to work in command line, not as a library, so before adding method to public API, most probably it will require some modification.
14921519
For example the `$options` injected module contains information about all `--` options passed on the terminal. When the CLI is used as a library, the options are not populated. Before adding method to public API, make sure its implementation does not rely on `$options`.

config/test-dependencies.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,25 @@
2828
{
2929
"name": "karma-qunit",
3030
"framework": "qunit"
31+
},
32+
{
33+
"name": "@types/karma-chai",
34+
"framework": "mocha",
35+
"projectType": ".ts"
36+
},
37+
{
38+
"name": "@types/mocha",
39+
"framework": "mocha",
40+
"projectType": ".ts"
41+
},
42+
{
43+
"name": "@types/jasmine",
44+
"framework": "jasmine",
45+
"projectType": ".ts"
46+
},
47+
{
48+
"name": "@types/qunit",
49+
"framework": "qunit",
50+
"projectType": ".ts"
3151
}
3252
]

docs/build-jekyll-md.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ rm -rf docs-cli
55
npm install --ignore-scripts
66

77
grunt docs-jekyll
8-
cd docs-cli
9-
mv index.md start.md
8+
if [ -d docs-cli ]; then
9+
cd docs-cli
10+
mv index.md start.md
11+
fi

docs/man_pages/project/testing/build-android.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ General | `$ tns build android [--compileSdk <API Level>] [--key-store-path <Fil
2626
* `--key-store-alias-password` - Provides the password for the alias specified with `--key-store-alias-password`. You can use the `--key-store-*` options along with `--release` to produce a signed release build. You need to specify all `--key-store-*` options.
2727
* `--copy-to` - Specifies the file path where the built `.apk` will be copied. If it points to a non-existent directory path, it will be created. If the specified value is existing directory, the original file name will be used.
2828
* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application.
29-
* `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. For example: `--env.uglify --env.snapshot`.
29+
* `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. Supported additional flags:
30+
* `--env.aot` - creates Ahead-Of-Time build (Angular only).
31+
* `--env.snapshot`- creates [Snapshot](https://docs.nativescript.org/performance-optimizations/bundling-with-webpack#v8-heap-snapshot) (only for release builds on Mac OS & for Android).
32+
* `--env.uglify` - provides basic obfuscation and smaller app size.
33+
* `--env.report` - creates a Webpack report inside a `report` folder in the root folder.
34+
* `--env.sourceMap` - creates inline source maps (useful for debbuging bundled app).
35+
* `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release).
3036
* `--aab` - Specifies that the build will produce an Android App Bundle(`.aab`) file.
3137

3238
<% if(isHtml) { %>

docs/man_pages/project/testing/build-ios.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,18 @@ General | `$ tns build ios [--for-device] [--release] [--copy-to <File Path>] [-
2323

2424
* `--release` - If set, produces a release build. Otherwise, produces a debug build.
2525
* `--for-device` - If set, produces an application package that you can deploy on device. Otherwise, produces a build that you can run only in the native iOS Simulator.
26+
* `--i-cloud-container-environment` - If set, adds the passed `iCloudContainerEnvironment` when exporting an application package with the `--for-device` option.
2627
* `--copy-to` - Specifies the file path where the built `.ipa` will be copied. If it points to a non-existent directory path, it will be created. If the specified value is existing directory, the original file name will be used.
2728
* `--team-id` - If used without parameter, lists all team names and ids. If used with team name or id, it will switch to automatic signing mode and configure the .xcodeproj file of your app. In this case .xcconfig should not contain any provisioning/team id flags. This team id will be further used for codesigning the app. For Xcode 9.0+, xcodebuild will be allowed to update and modify automatically managed provisioning profiles.
2829
* `--provision` - If used without parameter, lists all eligible provisioning profiles. If used with UUID or name of your provisioning profile, it will switch to manual signing mode and configure the .xcodeproj file of your app. In this case xcconfig should not contain any provisioning/team id flags. This provisioning profile will be further used for codesigning the app.
2930
* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application.
30-
* `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. For example: `--env.uglify --env.snapshot`.
31+
* `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. Supported additional flags:
32+
* `--env.aot` - creates Ahead-Of-Time build (Angular only).
33+
* `--env.snapshot`- creates [Snapshot](https://docs.nativescript.org/performance-optimizations/bundling-with-webpack#v8-heap-snapshot) (only for release builds on Mac OS & for Android).
34+
* `--env.uglify` - provides basic obfuscation and smaller app size.
35+
* `--env.report` - creates a Webpack report inside a `report` folder in the root folder.
36+
* `--env.sourceMap` - creates inline source maps (useful for debbuging bundled app).
37+
* `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release).
3138

3239
<% } %>
3340

docs/man_pages/project/testing/build.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,22 @@ Usage | Synopsis
2222

2323
<% if(isHtml) { %>
2424

25-
### Command Limitations
25+
### Options
26+
27+
* `--justlaunch` - If set, does not print the application output in the console.
28+
* `--release` - If set, produces a release build. Otherwise, produces a debug build.
29+
* `--device` - Specifies a connected device/emulator to start and run the app. `<Device ID>` is the index or `Device Identifier` of the target device as listed by the `$ tns device <Platform> --available-devices` command.
30+
* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application.
31+
* `--hmr` - (Beta) Enables the hot module replacement (HMR) feature. HMR depends on `webpack` and adding the `--hmr` flag to the command will automatically enable the `--bundle` option as well. <% if(isConsole) { %> The HMR feature is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398.<% } %>
32+
* `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. Supported additional flags:
33+
* `--env.aot` - creates Ahead-Of-Time build (Angular only).
34+
* `--env.snapshot`- creates [Snapshot](https://docs.nativescript.org/performance-optimizations/bundling-with-webpack#v8-heap-snapshot) (only for release builds on Mac OS & for Android).
35+
* `--env.uglify` - provides basic obfuscation and smaller app size.
36+
* `--env.report` - creates a Webpack report inside a `report` folder in the root folder.
37+
* `--env.sourceMap` - creates inline source maps (useful for debbuging bundled app).
38+
* `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release).
39+
* `--syncAllFiles` - Watches all production dependencies inside node_modules for changes. Triggers project rebuild if necessary!
2640

27-
* You can run the `$ tns build ios` command only on macOS systems.
2841

2942
### Related Commands
3043

docs/man_pages/project/testing/run-android.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ Start a default emulator if none are running, or run application on all connecte
3333
* `--key-store-alias-password` - Provides the password for the alias specified with `--key-store-alias-password`. You can use the `--key-store-*` options along with `--release` to produce a signed release build. You need to specify all `--key-store-*` options.
3434
* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application.
3535
* `--hmr` - (Beta) Enables the hot module replacement (HMR) feature. HMR depends on `webpack` and adding the `--hmr` flag to the command will automatically enable the `--bundle` option as well. <% if(isConsole) { %> The HMR feature is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398.<% } %>
36-
* `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. For example: `--env.uglify --env.snapshot`.
36+
* `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times.
37+
* `--env.aot` - creates Ahead-Of-Time build (Angular only).
38+
* `--env.snapshot`- creates [Snapshot](https://docs.nativescript.org/performance-optimizations/bundling-with-webpack#v8-heap-snapshot) (only for release builds on Mac OS & for Android).
39+
* `--env.uglify` - provides basic obfuscation and smaller app size.
40+
* `--env.report` - creates a Webpack report inside a `report` folder in the root folder.
41+
* `--env.sourceMap` - creates inline source maps (useful for debbuging bundled app).
42+
* `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release).
3743
* `--syncAllFiles` - Watches all production dependencies inside node_modules for changes. Triggers project rebuild if necessary!
3844

3945
<% if(isHtml) { %>

docs/man_pages/project/testing/run-ios.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ Start an emulator with specified device identifier and sdk | `$ tns run ios [--d
3636
* `--release` - If set, produces a release build. Otherwise, produces a debug build.
3737
* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application.
3838
* `--hmr` - (Beta) Enables the hot module replacement (HMR) feature. HMR depends on `webpack` and adding the `--hmr` flag to the command will automatically enable the `--bundle` option as well. <% if(isConsole) { %> The HMR feature is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398.<% } %>
39-
* `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. For example: `--env.uglify --env.snapshot`.
39+
* `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times.
40+
* `--env.aot` - creates Ahead-Of-Time build (Angular only).
41+
* `--env.snapshot`- creates [Snapshot](https://docs.nativescript.org/performance-optimizations/bundling-with-webpack#v8-heap-snapshot) (only for release builds on Mac OS & for Android).
42+
* `--env.uglify` - provides basic obfuscation and smaller app size.
43+
* `--env.report` - creates a Webpack report inside a `report` folder in the root folder.
44+
* `--env.sourceMap` - creates inline source maps (useful for debbuging bundled app).
45+
* `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release).
4046
* `--syncAllFiles` - Watches all production dependencies inside node_modules for changes. Triggers project rebuild if necessary!
4147

4248
<% } %>

docs/man_pages/project/testing/run.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ Run on a selected connected device or running emulator. Will start emulator with
2424
* `--device` - Specifies a connected device/emulator to start and run the app. `<Device ID>` is the index or `Device Identifier` of the target device as listed by the `$ tns device <Platform> --available-devices` command.
2525
* `--bundle` - Specifies that the `webpack` bundler will be used to bundle the application.
2626
* `--hmr` - (Beta) Enables the hot module replacement (HMR) feature. HMR depends on `webpack` and adding the `--hmr` flag to the command will automatically enable the `--bundle` option as well. <% if(isConsole) { %> The HMR feature is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/NativeScript/issues/6398.<% } %>
27-
* `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. For example: `--env.uglify --env.snapshot`.
27+
* `--env.*` - Specifies additional flags that the bundler may process. May be passed multiple times. Supported additional flags:
28+
* `--env.aot` - creates Ahead-Of-Time build (Angular only).
29+
* `--env.snapshot`- creates [Snapshot](https://docs.nativescript.org/performance-optimizations/bundling-with-webpack#v8-heap-snapshot) (only for release builds on Mac OS & for Android).
30+
* `--env.uglify` - provides basic obfuscation and smaller app size.
31+
* `--env.report` - creates a Webpack report inside a `report` folder in the root folder.
32+
* `--env.sourceMap` - creates inline source maps (useful for debbuging bundled app).
33+
* `--env.hiddenSourceMap` - creates sources maps in the root folder (useful for Crashlytics usage with bundled app in release).
2834
* `--syncAllFiles` - Watches all production dependencies inside node_modules for changes. Triggers project rebuild if necessary!
2935

3036

0 commit comments

Comments
 (0)