From dae0bb0685e246ce394d5447770b0ad3e8136bbf Mon Sep 17 00:00:00 2001 From: Erjan Gavalji Date: Wed, 12 Nov 2014 13:51:10 +0200 Subject: [PATCH 1/4] Bump package version to 0.4.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5ed29a766a..d7faac7cda 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nativescript", "preferGlobal": true, - "version": "0.3.2", + "version": "0.4.0", "author": "Telerik ", "description": "Command-line interface for building NativeScript projects", "bin": { From 786b3676b273e0d197df8d8936109c1be1c7b819 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Thu, 13 Nov 2014 12:22:44 +0200 Subject: [PATCH 2/4] Change default profile-dir Change default profile-dir to be: - %localappdata%\.nativescript-cli for Windows - ~/.local/share/.nativescript-cli for MacOS and Linux Update common lib where the following change is applied: DefaultValue is passed to the setProfileDir method. Different CLI-s have different defaultProfileDirs. setProfileDir method will use the passed on the command line profile-dir or the default one passed as parameter to the function. --- lib/common | 2 +- lib/options.ts | 13 +++++++++++-- test/stubs.ts | 8 ++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/common b/lib/common index 915d5872e0..fef717eb2a 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 915d5872e06e0ca4a642b1f0df5e9aa9a28344f7 +Subproject commit fef717eb2a517b05339e81b87b214fac53be6a19 diff --git a/lib/options.ts b/lib/options.ts index e0c29014f9..cf438f7f67 100644 --- a/lib/options.ts +++ b/lib/options.ts @@ -4,6 +4,7 @@ import path = require("path"); import helpers = require("./common/helpers"); import commonOptions = require("./common/options"); import osenv = require("osenv"); +import hostInfo = require("./common/host-info"); var knownOpts:any = { "frameworkPath": String, @@ -23,11 +24,19 @@ var knownOpts:any = { _.extend(knownOpts, commonOptions.knownOpts); _.extend(shorthands, commonOptions.shorthands); -commonOptions.setProfileDir(".nativescript-cli"); +var defaultProfileDir = ""; +var nativeScriptCacheFolder = ".nativescript-cli"; +if(hostInfo.isWindows()) { + defaultProfileDir = path.join(process.env.LocalAppData, nativeScriptCacheFolder); +} else { + defaultProfileDir = path.join(osenv.home(), ".local/share", nativeScriptCacheFolder); +} + +commonOptions.setProfileDir(defaultProfileDir); var parsed = helpers.getParsedOptions(knownOpts, shorthands); Object.keys(parsed).forEach((opt) => exports[opt] = parsed[opt]); exports.knownOpts = knownOpts; declare var exports:any; -export = exports; \ No newline at end of file +export = exports; diff --git a/test/stubs.ts b/test/stubs.ts index 9cdef9d031..c8e1b2dbf4 100644 --- a/test/stubs.ts +++ b/test/stubs.ts @@ -119,6 +119,14 @@ export class FileSystemStub implements IFileSystem { symlink(sourePath: string, destinationPath: string): IFuture { return undefined; } + + closeStream(stream: any): IFuture { + return undefined; + } + + setCurrentUserAsOwner(path: string, owner: string): IFuture { + return undefined; + } } export class ErrorsStub implements IErrors { From 054f9390ee459d5e57dfcffa8c9782abc7f30f06 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Mon, 17 Nov 2014 10:03:52 +0200 Subject: [PATCH 3/4] Fix tabtab for -- options Add implementation of IOptionsService interface with one method - getKnownOptions. This method is used in commands service in order to get full list of supported -- options. As each CLI have its own list of knownOptions and the mobile lib has only some of them, the implementation of the interface has to be outside of the lib. This way we can use autocomplete for all available options, not only for the common ones. --- lib/bootstrap.ts | 1 + lib/services/options-service.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 lib/services/options-service.ts diff --git a/lib/bootstrap.ts b/lib/bootstrap.ts index c26c2acf3f..e46818651d 100644 --- a/lib/bootstrap.ts +++ b/lib/bootstrap.ts @@ -34,3 +34,4 @@ $injector.requireCommand("list-devices", "./commands/list-devices"); $injector.require("npm", "./node-package-manager"); $injector.require("config", "./config"); +$injector.require("optionsService", "./services/options-service"); diff --git a/lib/services/options-service.ts b/lib/services/options-service.ts new file mode 100644 index 0000000000..23c2139790 --- /dev/null +++ b/lib/services/options-service.ts @@ -0,0 +1,12 @@ +/// + +"use strict"; + +import options = require("../options"); + +export class OptionsService implements IOptionsService { + public getKnownOptions(): string[]{ + return Object.keys(options.knownOpts); + } +} +$injector.register("optionsService", OptionsService); From 3207705788d81b8a510d518323ec4612b169954b Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Tue, 25 Nov 2014 17:52:41 +0200 Subject: [PATCH 4/4] Fix analytics timeout Change dependency of xmlhttprequest to use Telerik fork. Update common lib, where the following change is applied: EqatecMonitor.js call setTimeout of XMLHttpRequest with default value - 10000 ms. Add SetRequestTimeout method to EqatecMonitor which sets global timeout variable (currently this method is not used). The timeout is required in order to prevent console hanging when analytics cannot send the request. --- lib/common | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common b/lib/common index fef717eb2a..33b81c2682 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit fef717eb2a517b05339e81b87b214fac53be6a19 +Subproject commit 33b81c26827c3f872be810789a987a6061452efb diff --git a/package.json b/package.json index d7faac7cda..a0f62127f5 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "underscore": "1.5.2", "unzip": "0.1.9", "watchr": "2.4.11", - "xmlhttprequest": "1.6.0", + "xmlhttprequest": "https://github.com/telerik/node-XMLHttpRequest/tarball/master", "yargs": "1.2.2" }, "analyze": true,