diff --git a/LICENSE b/LICENSE index 061c440..4e63bb7 100755 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright (c) 2015-2019 Progress Software Corporation + Copyright (c) 2021 NativeScript TSC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index f767caa..8165bcb 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ If your version of NativeScript is incompatible with the extension you will see 4. To install the extension drag and drop the `nativescript-*.*.*.vsix` package in the VS Code. ### How to disable the analytics -The anonymous usage data collected by Progress from the NativeScript extension for Visual Studio Code is used strictly to improve the product and its services, and enhance the overall user experience. +The anonymous usage data collected by us from the NativeScript extension for Visual Studio Code is used strictly to improve the product and its services, and enhance the overall user experience. If you have previously enabled the analytics option, you can disable it by following the steps outlined below: diff --git a/package.json b/package.json index b502da0..21e0113 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nativescript", - "version": "0.12.0", + "version": "0.12.3", "minNativescriptCliVersion": "2.5.0", "icon": "images/icon.png", "displayName": "NativeScript", diff --git a/src/analytics/analyticsService.ts b/src/analytics/analyticsService.ts index e25dbb0..1c1003d 100644 --- a/src/analytics/analyticsService.ts +++ b/src/analytics/analyticsService.ts @@ -10,10 +10,7 @@ export class AnalyticsService { private static HAS_ANALYTICS_PROMPT_SHOWN_KEY = 'nativescript.hasAnalyticsPromptShown'; private static CLIENT_ID_KEY = 'nativescript.analyticsClientId'; private static DOCS_LINK = 'https://github.com/NativeScript/nativescript-vscode-extension/blob/master/README.md#how-to-disable-the-analytics'; - private static ANALYTICS_PROMPT_MESSAGE = `Help us improve the NativeScript extension by allowing Progress to collect anonymous usage data. - For more information about the gathered information and how it is used, - read our [privacy statement](https://www.progress.com/legal/privacy-policy). - You can [disable the analytics and data collection](${AnalyticsService.DOCS_LINK}) at any given time. + private static ANALYTICS_PROMPT_MESSAGE = `Help us improve the NativeScript extension by allowing us to collect anonymous usage data. Do you want to enable analytics?`; private static ANALYTICS_PROMPT_ACCEPT_ACTION = 'Yes'; diff --git a/src/main.ts b/src/main.ts index 3c13170..4f7554a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -14,34 +14,35 @@ import { SUGGESTION_PROVIDERS } from './services/language-services/suggestions'; // this method is called when the extension is activated export function activate(context: vscode.ExtensionContext) { services.globalState = context.globalState; - services.cliPath = 'tns'; + services.cliPath = services.workspaceConfigService.tnsPath || services.cliPath || + 'tns'; const channel = vscode.window.createOutputChannel('NativeScript Extension'); services.logger = new ChannelLogger(channel); const packageJSON = vscode.extensions.getExtension('nativescript.nativescript').packageJSON; - const cliVersion = services.cli().executeGetVersion(); + // const cliVersion = services.cli().executeGetVersion(); - if (!cliVersion) { - // tslint:disable-next-line:max-line-length - vscode.window.showErrorMessage("NativeScript CLI not found. Use 'nativescript.tnsPath' workspace setting to explicitly set the absolute path to the NativeScript CLI."); + // if (!cliVersion) { + // // tslint:disable-next-line:max-line-length + // vscode.window.showErrorMessage("NativeScript CLI not found. Use 'nativescript.tnsPath' workspace setting to explicitly set the absolute path to the NativeScript CLI."); - return; - } + // return; + // } - if (!semver.gte(cliVersion, packageJSON.minNativescriptCliVersion)) { - // tslint:disable-next-line:max-line-length - vscode.window.showErrorMessage(`The existing NativeScript extension is compatible with NativeScript CLI v${packageJSON.minNativescriptCliVersion} or greater. - The currently installed NativeScript CLI is v${cliVersion}.You can update the NativeScript CLI by executing 'npm install -g nativescript'.`); + // if (!semver.gte(cliVersion, packageJSON.minNativescriptCliVersion)) { + // // tslint:disable-next-line:max-line-length + // vscode.window.showErrorMessage(`The existing NativeScript extension is compatible with NativeScript CLI v${packageJSON.minNativescriptCliVersion} or greater. + // The currently installed NativeScript CLI is v${cliVersion}.You can update the NativeScript CLI by executing 'npm install -g nativescript'.`); - return; - } + // return; + // } - services.cliVersion = cliVersion; + // services.cliVersion = cliVersion; services.extensionVersion = packageJSON.version; - logExtensionInfo(cliVersion, packageJSON); + // logExtensionInfo(cliVersion, packageJSON); services.analyticsService.initialize(); diff --git a/src/project/androidProject.ts b/src/project/androidProject.ts index 7245e52..49f5c81 100644 --- a/src/project/androidProject.ts +++ b/src/project/androidProject.ts @@ -41,8 +41,9 @@ export class AndroidProject extends Project { const debugProcess: ChildProcess = options.launchTests ? super.executeTestCommand(args) : super.executeDebugCommand(args); const tnsOutputEventEmitter: EventEmitter = new EventEmitter(); - const shouldWaitAfterRestartMessage = semver.lt(semver.coerce(this.cliVersion), '5.1.0'); - const waitForRestartMessage = shouldWaitAfterRestartMessage || args.indexOf('--debug-brk') > -1; + // const shouldWaitAfterRestartMessage = semver.lt(semver.coerce(this.cliVersion), '5.1.0'); + // const waitForRestartMessage = shouldWaitAfterRestartMessage || args.indexOf('--debug-brk') > -1; + const waitForRestartMessage = args.indexOf('--debug-brk') > -1; this.configureReadyEvent(debugProcess.stdout, tnsOutputEventEmitter, waitForRestartMessage); diff --git a/src/services/buildService.ts b/src/services/buildService.ts index 36905c6..1939973 100644 --- a/src/services/buildService.ts +++ b/src/services/buildService.ts @@ -20,7 +20,8 @@ export class BuildService { } public async processRequest(args: any): Promise { - const tnsPath = services.workspaceConfigService.tnsPath; + const tnsPath = services.workspaceConfigService.tnsPath || services.cliPath || + 'tns'; this._logger.log(`[NSDebugAdapter] Using tns CLI on path '${tnsPath}'\n`); const tnsPathResolved = (tnsPath !== 'tns' && !path.isAbsolute(tnsPath)) ? path.join(args.appRoot, tnsPath) : tnsPath; @@ -33,9 +34,9 @@ export class BuildService { services.analyticsService.launchDebugger(args.request, args.platform); // Run CLI Command - const version = project.cli.executeGetVersion(); + // const version = project.cli.executeGetVersion(); - this._logger.log(`[NSDebugAdapter] Using tns CLI v${version} on path '${project.cli.path}'\n`); + // this._logger.log(`[NSDebugAdapter] Using tns CLI v${version} on path '${project.cli.path}'\n`); this._logger.log('[NSDebugAdapter] Running tns command...\n'); let cliCommand: IDebugResult;