From f5e6af4ed05a068caf98d7d7ff6d7b10ba868b72 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Thu, 16 Mar 2017 23:52:42 +0200 Subject: [PATCH] Fix hooks execution when using CLI as lib When NS CLI is used as library, project hooks are not executed as hooksService gets the project dir from `$options` or current working dir. Fix this by getting the projectDir from the hookArgs object. The object is constructed from method parameters. We check if there's `projectDir` or `projectData.projectDir` arg. Also fix the caching of hooks - each time when we try to execute them, we'll search the directories for hooks. This is required for long living process. Additionally use semver's package definitions from `@types` repo. Rename two `.d.ts` files which were incorrectly set as `.ts`. --- lib/common | 2 +- lib/{declarations.ts => declarations.d.ts} | 0 lib/definitions/{libref.ts => libref.d.ts} | 0 package.json | 6 ++++-- 4 files changed, 5 insertions(+), 3 deletions(-) rename lib/{declarations.ts => declarations.d.ts} (100%) rename lib/definitions/{libref.ts => libref.d.ts} (100%) diff --git a/lib/common b/lib/common index 5e861259be..efe25172a8 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 5e861259bef7783f71262b5aec8a6711f487c189 +Subproject commit efe25172a8ccb39e04200d78447e984dc46b25c8 diff --git a/lib/declarations.ts b/lib/declarations.d.ts similarity index 100% rename from lib/declarations.ts rename to lib/declarations.d.ts diff --git a/lib/definitions/libref.ts b/lib/definitions/libref.d.ts similarity index 100% rename from lib/definitions/libref.ts rename to lib/definitions/libref.d.ts diff --git a/package.json b/package.json index 334c782065..1c1762b902 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "plistlib": "0.2.1", "progress-stream": "1.1.1", "properties-parser": "0.2.3", - "semver": "5.0.1", + "semver": "5.3.0", "shelljs": "0.7.6", "source-map": "0.5.6", "tabtab": "https://github.com/Icenium/node-tabtab/tarball/master", @@ -73,7 +73,8 @@ "xcode": "https://github.com/NativeScript/node-xcode/archive/1.4.0.tar.gz", "xmldom": "0.1.21", "xmlhttprequest": "https://github.com/telerik/node-XMLHttpRequest/tarball/master", - "yargs": "6.0.0" + "yargs": "6.0.0", + "zipstream": "https://github.com/Icenium/node-zipstream/tarball/master" }, "analyze": true, "devDependencies": { @@ -81,6 +82,7 @@ "@types/chai-as-promised": "0.0.29", "@types/lodash": "4.14.50", "@types/node": "6.0.61", + "@types/semver": "^5.3.31", "@types/source-map": "0.5.0", "chai": "3.5.0", "chai-as-promised": "6.0.0",