Skip to content

Commit 48f5135

Browse files
committed
Merge branch 'release' into tachev/merge-release-into-master
2 parents 75c9ea0 + 528fc24 commit 48f5135

23 files changed

+221
-68
lines changed

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,43 @@
11
NativeScript CLI Changelog
22
================
33

4+
6.1.2 (2019, September 18)
5+
==
6+
7+
### Fixed
8+
* [Fixed #5018](https://github.com/NativeScript/nativescript-cli/issues/5018): Track runtime versions on add and on build, run, deploy
9+
10+
11+
6.1.1 (2019, September 17)
12+
==
13+
14+
### Fixed
15+
16+
* [Fixed #5015](https://github.com/NativeScript/nativescript-cli/pull/5015): CLI passes `--preserve-symlinks` to the webpack itself, not to the Node.js
17+
* [Fixed #4893](https://github.com/NativeScript/nativescript-cli/issues/4893): `tns preview` crashes when scanning on devices with different platforms
18+
* [Fixed #4939](https://github.com/NativeScript/nativescript-cli/issues/4939): Xcode 11 warning: `CFBundleIdentifier value must be the same as PRODUCT_BUNDLE_IDENTIFIER`
19+
20+
6.1.0 (2019, September 04)
21+
==
22+
23+
### New
24+
25+
* [Implemented #4229](https://github.com/NativeScript/nativescript-cli/issues/4229): Do not display command usage help after execution is started
26+
* [Implemented #4909](https://github.com/NativeScript/nativescript-cli/issues/4909): Support for Xcode 11 and iOS 13
27+
* [Implemented #4926](https://github.com/NativeScript/nativescript-cli/issues/4926): Android SDK 29 support
28+
* [Implemented #4947](https://github.com/NativeScript/nativescript-cli/issues/4947): Add tracking for both React NativeScript and Svelte Native projects
29+
* [Implemented #4966](https://github.com/NativeScript/nativescript-cli/issues/4966): Support LiveSync to iOS Wi-Fi devices
30+
* [Implemented #4974](https://github.com/NativeScript/nativescript-cli/issues/4974): Ask the users why they've uninstalled NativeScript CLI
31+
* [Implemented #4976](https://github.com/NativeScript/nativescript-cli/issues/4976): Handle changes in iOS and Android Runtime 6.1.0 logging
32+
* [Implemented #4980](https://github.com/NativeScript/nativescript-cli/issues/4980): Update message for subscribing to NativeScript newsletter
33+
* [Implemented #4992](https://github.com/NativeScript/nativescript-cli/pull/4992): Allow tns to be able to use npm configuration properly
34+
35+
### Fixed
36+
37+
* [Fixed #4936](https://github.com/NativeScript/nativescript-cli/issues/4936): HMR not recovering after exception in Angular lazy routes
38+
* [Fixed #4958](https://github.com/NativeScript/nativescript-cli/issues/4958): `tns doctor` fails when setup is not correct and user selects to fix it manually
39+
* [Fixed #4971](https://github.com/NativeScript/nativescript-cli/issues/4971): Not needed checks are executed on `pod install`
40+
441
6.0.3 (2019, August 05)
542
==
643
* [Fixed #4914](https://github.com/NativeScript/nativescript-cli/issues/4914): livesync not working with command tns test android

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,10 @@ The <code>--insecure</code> flag allows you to perform insecure SSL connections
143143
#### Limitations
144144

145145
* You can provide the `<Username>` and `<Password>` attributes only on Windows systems.
146-
* Proxy settings for the npm and the Android Gradle need to be configured separately. For more information, see the following articles:
146+
* Proxy settings for the npm, the Android Gradle and (optional) Docker need to be configured separately. For more information, see the following articles:
147147
* [Configure the npm proxy](https://docs.npmjs.com/misc/config#https-proxy)
148148
* [Configure the Android Gradle proxy](https://docs.gradle.org/3.3/userguide/build_environment.html#sec:accessing_the_web_via_a_proxy)
149+
* [Configure the Docker proxy](https://docs.docker.com/network/proxy/)
149150

150151
### Display Current Proxy Settings
151152

docs/man_pages/general/proxy-set.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ General | `$ tns proxy set [<Url> <% if(isWindows) {%>[<Username> [<Password>]]<
3131
### Command Limitations
3232

3333
* You can set credentials only on Windows systems.
34-
* Proxy settings for npm and (Android) Gradle need to be set separately.
34+
* Proxy settings for npm, (Android) Gradle and (optional) Docker need to be set separately.
3535
* configuring `npm` proxy - https://docs.npmjs.com/misc/config#https-proxy
3636
* (Android) configuring Gradle proxy - set global configuration in the user directory - _<USER_HOME>/.gradle/gradle.properties_ - https://docs.gradle.org/3.3/userguide/build_environment.html#sec:accessing_the_web_via_a_proxy
37+
* configuring Docker proxy - https://docs.docker.com/network/proxy/
3738

3839
### Related Commands
3940

lib/bootstrap.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ $injector.require("gradleCommandService", "./services/android/gradle-command-ser
1515
$injector.require("gradleBuildService", "./services/android/gradle-build-service");
1616
$injector.require("gradleBuildArgsService", "./services/android/gradle-build-args-service");
1717
$injector.require("iOSEntitlementsService", "./services/ios-entitlements-service");
18+
$injector.require("iOSNativeTargetService", "./services/ios-native-target-service");
1819
$injector.require("iOSExtensionsService", "./services/ios-extensions-service");
1920
$injector.require("iOSWatchAppService", "./services/ios-watch-app-service");
2021
$injector.require("iOSProjectService", "./services/ios-project-service");

lib/constants.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ export const enum TrackActionNames {
186186
AcceptTracking = "Accept Tracking",
187187
Performance = "Performance",
188188
PreviewAppData = "Preview App Data",
189-
UninstallCLI = "Uninstall CLI"
189+
UninstallCLI = "Uninstall CLI",
190+
UsingRuntimeVersion = "Using Runtime Version",
191+
AddPlatform = "Add Platform"
190192
}
191193

192194
export const AnalyticsEventLabelDelimiter = "__";

lib/controllers/deploy-controller.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ export class DeployController {
1111

1212
const executeAction = async (device: Mobile.IDevice) => {
1313
const deviceDescriptor = _.find(deviceDescriptors, dd => dd.identifier === device.deviceInfo.identifier);
14-
await this.$prepareController.prepare(deviceDescriptor.buildData);
14+
const prepareData = {
15+
...deviceDescriptor.buildData,
16+
nativePrepare: { skipNativePrepare: !!deviceDescriptor.skipNativePrepare }
17+
};
18+
await this.$prepareController.prepare(prepareData);
1519
const packageFilePath = await deviceDescriptor.buildAction();
1620
await this.$deviceInstallAppService.installOnDevice(device, { ...deviceDescriptor.buildData, buildForDevice: !device.isEmulator }, packageFilePath);
1721
};

lib/controllers/prepare-controller.ts

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import * as choki from "chokidar";
22
import { hook } from "../common/helpers";
3-
import { performanceLog } from "../common/decorators";
3+
import { performanceLog, cache } from "../common/decorators";
44
import { EventEmitter } from "events";
55
import * as path from "path";
6-
import { PREPARE_READY_EVENT_NAME, WEBPACK_COMPILATION_COMPLETE, PACKAGE_JSON_FILE_NAME, PLATFORMS_DIR_NAME } from "../constants";
7-
6+
import { PREPARE_READY_EVENT_NAME, WEBPACK_COMPILATION_COMPLETE, PACKAGE_JSON_FILE_NAME, PLATFORMS_DIR_NAME, TrackActionNames, AnalyticsEventLabelDelimiter } from "../constants";
87
interface IPlatformWatcherData {
98
hasWebpackCompilerProcess: boolean;
109
nativeFilesWatcher: choki.FSWatcher;
@@ -27,12 +26,14 @@ export class PrepareController extends EventEmitter {
2726
private $projectChangesService: IProjectChangesService,
2827
private $projectDataService: IProjectDataService,
2928
private $webpackCompilerService: IWebpackCompilerService,
30-
private $watchIgnoreListService: IWatchIgnoreListService
29+
private $watchIgnoreListService: IWatchIgnoreListService,
30+
private $analyticsService: IAnalyticsService
3131
) { super(); }
3232

3333
public async prepare(prepareData: IPrepareData): Promise<IPrepareResultData> {
3434
const projectData = this.$projectDataService.getProjectData(prepareData.projectDir);
3535

36+
await this.trackRuntimeVersion(prepareData.platform, projectData);
3637
await this.$pluginsService.ensureAllDependenciesAreInstalled(projectData);
3738

3839
return this.prepareCore(prepareData, projectData);
@@ -127,6 +128,21 @@ export class PrepareController extends EventEmitter {
127128
}
128129

129130
private async startNativeWatcherWithPrepare(platformData: IPlatformData, projectData: IProjectData, prepareData: IPrepareData): Promise<boolean> {
131+
let newNativeWatchStarted = false;
132+
let hasNativeChanges = false;
133+
134+
if (prepareData.watchNative) {
135+
newNativeWatchStarted = await this.startNativeWatcher(platformData, projectData);
136+
}
137+
138+
if (newNativeWatchStarted) {
139+
hasNativeChanges = await this.$prepareNativePlatformService.prepareNativePlatform(platformData, projectData, prepareData);
140+
}
141+
142+
return hasNativeChanges;
143+
}
144+
145+
private async startNativeWatcher(platformData: IPlatformData, projectData: IProjectData): Promise<boolean> {
130146
if (this.watchersData[projectData.projectDir][platformData.platformNameLowerCase].nativeFilesWatcher) {
131147
return false;
132148
}
@@ -155,9 +171,7 @@ export class PrepareController extends EventEmitter {
155171

156172
this.watchersData[projectData.projectDir][platformData.platformNameLowerCase].nativeFilesWatcher = watcher;
157173

158-
const hasNativeChanges = await this.$prepareNativePlatformService.prepareNativePlatform(platformData, projectData, prepareData);
159-
160-
return hasNativeChanges;
174+
return true;
161175
}
162176

163177
@hook('watchPatterns')
@@ -186,5 +200,24 @@ export class PrepareController extends EventEmitter {
186200
this.persistedData.push(filesChangeEventData);
187201
}
188202
}
203+
204+
@cache()
205+
private async trackRuntimeVersion(platform: string, projectData: IProjectData): Promise<void> {
206+
let runtimeVersion: string = null;
207+
try {
208+
const platformData = this.$platformsDataService.getPlatformData(platform, projectData);
209+
const runtimeVersionData = this.$projectDataService.getNSValue(projectData.projectDir, platformData.frameworkPackageName);
210+
runtimeVersion = runtimeVersionData && runtimeVersionData.version;
211+
} catch (err) {
212+
this.$logger.trace(`Unable to get runtime version for project directory: ${projectData.projectDir} and platform ${platform}. Error is: `, err);
213+
}
214+
215+
if (runtimeVersion) {
216+
await this.$analyticsService.trackEventActionInGoogleAnalytics({
217+
action: TrackActionNames.UsingRuntimeVersion,
218+
additionalData: `${platform.toLowerCase()}${AnalyticsEventLabelDelimiter}${runtimeVersion}`
219+
});
220+
}
221+
}
189222
}
190223
$injector.register("prepareController", PrepareController);

lib/controllers/preview-app-controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export class PreviewAppController extends EventEmitter implements IPreviewAppCon
9999
data.env = data.env || {};
100100
data.env.externals = this.$previewAppPluginsService.getExternalPlugins(device);
101101

102-
const prepareData = this.$prepareDataService.getPrepareData(data.projectDir, device.platform.toLowerCase(), { ...data, nativePrepare: { skipNativePrepare: true }, watch: true });
102+
const prepareData = this.$prepareDataService.getPrepareData(data.projectDir, device.platform.toLowerCase(), { ...data, nativePrepare: { skipNativePrepare: true }, watch: true, watchNative: false });
103103
await this.$prepareController.prepare(prepareData);
104104

105105
try {

lib/data/prepare-data.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export class PrepareData extends ControllerDataBase {
55
public hmr: boolean;
66
public env: any;
77
public watch?: boolean;
8+
public watchNative: boolean = true;
89

910
constructor(public projectDir: string, public platform: string, data: any) {
1011
super(projectDir, platform, data);
@@ -16,6 +17,9 @@ export class PrepareData extends ControllerDataBase {
1617
hmr: data.hmr || data.useHotModuleReload
1718
};
1819
this.watch = data.watch;
20+
if (_.isBoolean(data.watchNative)) {
21+
this.watchNative = data.watchNative;
22+
}
1923
}
2024
}
2125

lib/definitions/prepare.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ declare global {
77
hmr: boolean;
88
env: any;
99
watch?: boolean;
10+
watchNative: boolean
1011
}
1112

1213
interface IiOSCodeSigningData {

0 commit comments

Comments
 (0)