From 0e266df537cc9be676560e47232a75d399ff9018 Mon Sep 17 00:00:00 2001 From: VladimirAmiorkov Date: Thu, 17 Oct 2019 11:48:05 +0300 Subject: [PATCH 01/35] chore: change version for "master" branch --- nativescript-angular/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index 1211118bd..bd93bb37c 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -1,6 +1,6 @@ { "name": "nativescript-angular", - "version": "8.2.2", + "version": "8.3.0", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", From ed16c122bc1500a58e56e71e7f369064432183b2 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Mon, 7 Oct 2019 15:19:11 +0300 Subject: [PATCH 02/35] initial commit --- e2e/modal-navigation-ng/app/app.component.ts | 4 +- e2e/modal-navigation-ng/app/app.module.ts | 5 +- e2e/modal-navigation-ng/app/app.routing.ts | 2 +- .../app/home/home.component.ts | 11 +- .../app/layout.component.ts | 4 +- e2e/modal-navigation-ng/app/main.aot.ts | 6 +- e2e/modal-navigation-ng/app/main.ts | 5 +- .../modal-nested/modal-nested.component.ts | 2 +- .../modal-second/modal-second.component.ts | 2 +- .../modal-shared-second.component.ts | 4 +- .../modal-view-content.component.ts | 2 +- .../app/modal-shared/modal-view.component.ts | 2 +- .../modal-router/modal-router.component.ts | 4 +- .../app/modal/modal.component.ts | 4 +- .../app/named-router.component.ts | 4 +- .../navigation/basic.navigation.component.ts | 2 +- .../app/second/second.component.ts | 6 +- e2e/modal-navigation-ng/app/tab.component.ts | 8 +- e2e/modal-navigation-ng/package.json | 2 +- e2e/single-page/app/app-routing.module.ts | 2 +- e2e/single-page/app/app.module.ts | 6 +- e2e/single-page/app/first/first.component.ts | 6 +- e2e/single-page/app/main.aot.ts | 2 +- e2e/single-page/app/main.ts | 2 +- .../app/second/modal/modal.component.ts | 2 +- .../app/second/second.component.ts | 4 +- e2e/single-page/package.json | 7 +- .../animations/index.ts | 1 + .../directives/index.ts | 1 + .../file-system/ns-file-system.ts | 1 + nativescript-angular-package/forms/index.ts | 1 + .../forms/value-accessors/index.ts | 1 + .../http-client/index.ts | 1 + nativescript-angular-package/package.json | 36 ++++ nativescript-angular-package/router/index.ts | 1 + .../testing/index.d.ts | 14 ++ nativescript-angular-package/testing/index.js | 38 ++++ nativescript-angular-package/testing/index.ts | 29 +++ .../nativescript_test_component_renderer.d.ts | 7 + .../nativescript_test_component_renderer.js | 26 +++ .../nativescript_test_component_renderer.ts | 19 ++ .../testing/src/util.d.ts | 47 +++++ .../testing/src/util.js | 182 +++++++++++++++++ .../testing/src/util.ts | 192 ++++++++++++++++++ .../value-accessors/base-value-accessor.ts | 3 + .../zone-js/README.md | 0 .../zone-js/testing.jasmine.d.ts | 2 + .../zone-js/testing.jasmine.ts | 3 + .../zone-js/testing.mocha.d.ts | 2 + .../zone-js/testing.mocha.ts | 2 + nativescript-angular/animations/index.ts | 3 + nativescript-angular/index.ts | 3 + nativescript-angular/package.json | 2 +- nativescript-angular/platform.ts | 1 + nativescript-angular/router/router.module.ts | 9 +- ng-sample/package.json | 5 +- 56 files changed, 678 insertions(+), 64 deletions(-) create mode 100644 nativescript-angular-package/animations/index.ts create mode 100644 nativescript-angular-package/directives/index.ts create mode 100644 nativescript-angular-package/file-system/ns-file-system.ts create mode 100644 nativescript-angular-package/forms/index.ts create mode 100644 nativescript-angular-package/forms/value-accessors/index.ts create mode 100644 nativescript-angular-package/http-client/index.ts create mode 100644 nativescript-angular-package/package.json create mode 100644 nativescript-angular-package/router/index.ts create mode 100644 nativescript-angular-package/testing/index.d.ts create mode 100644 nativescript-angular-package/testing/index.js create mode 100644 nativescript-angular-package/testing/index.ts create mode 100644 nativescript-angular-package/testing/src/nativescript_test_component_renderer.d.ts create mode 100644 nativescript-angular-package/testing/src/nativescript_test_component_renderer.js create mode 100644 nativescript-angular-package/testing/src/nativescript_test_component_renderer.ts create mode 100644 nativescript-angular-package/testing/src/util.d.ts create mode 100644 nativescript-angular-package/testing/src/util.js create mode 100644 nativescript-angular-package/testing/src/util.ts create mode 100644 nativescript-angular-package/value-accessors/base-value-accessor.ts rename {nativescript-angular => nativescript-angular-package}/zone-js/README.md (100%) create mode 100644 nativescript-angular-package/zone-js/testing.jasmine.d.ts create mode 100644 nativescript-angular-package/zone-js/testing.jasmine.ts create mode 100644 nativescript-angular-package/zone-js/testing.mocha.d.ts create mode 100644 nativescript-angular-package/zone-js/testing.mocha.ts diff --git a/e2e/modal-navigation-ng/app/app.component.ts b/e2e/modal-navigation-ng/app/app.component.ts index 45decfedf..d7ca1d8cc 100644 --- a/e2e/modal-navigation-ng/app/app.component.ts +++ b/e2e/modal-navigation-ng/app/app.component.ts @@ -1,11 +1,11 @@ import { Component, ViewContainerRef } from "@angular/core"; import { Router, NavigationEnd } from "@angular/router"; -import { NSLocationStrategy } from "nativescript-angular/router/ns-location-strategy"; +// import { NSLocationStrategy } from "@nativescript/angular/router/ns-location-strategy"; import { ViewContainerRefService } from "./shared/ViewContainerRefService"; import { AppModule } from "./app.module"; -import { ModalDialogOptions, ModalDialogService } from "nativescript-angular"; +import { ModalDialogOptions, ModalDialogService, NSLocationStrategy } from "@nativescript/angular"; import { ModalViewComponent } from "./modal-shared/modal-view.component"; @Component({ diff --git a/e2e/modal-navigation-ng/app/app.module.ts b/e2e/modal-navigation-ng/app/app.module.ts index b868bf401..407831a81 100644 --- a/e2e/modal-navigation-ng/app/app.module.ts +++ b/e2e/modal-navigation-ng/app/app.module.ts @@ -1,5 +1,5 @@ import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core"; -import { NativeScriptModule } from "nativescript-angular/nativescript.module"; +import { NativeScriptModule } from "@nativescript/angular/nativescript.module"; import { AppRoutingModule } from "./app.routing"; import { AppComponent } from "./app.component"; import { NamedRouterComponent } from "./named-router.component"; @@ -20,8 +20,7 @@ import { ModalSharedSecondComponent } from "./modal-shared/modal-shared-second.c import { ViewContainerRefService } from "./shared/ViewContainerRefService"; import { enable as traceEnable, addCategories } from "tns-core-modules/trace"; -import { routerTraceCategory } from "nativescript-angular/trace"; -import { NativeScriptPlatformRef } from "nativescript-angular"; +import { NativeScriptPlatformRef, routerTraceCategory } from "@nativescript/angular"; addCategories(routerTraceCategory); traceEnable(); diff --git a/e2e/modal-navigation-ng/app/app.routing.ts b/e2e/modal-navigation-ng/app/app.routing.ts index 263f4a1b1..8cc09094e 100644 --- a/e2e/modal-navigation-ng/app/app.routing.ts +++ b/e2e/modal-navigation-ng/app/app.routing.ts @@ -1,5 +1,5 @@ import { NgModule } from "@angular/core"; -import { NativeScriptRouterModule } from "nativescript-angular/router"; +import { NativeScriptRouterModule } from "@nativescript/angular/router"; import { Routes, Router } from "@angular/router"; import { HomeComponent } from "./home/home.component"; diff --git a/e2e/modal-navigation-ng/app/home/home.component.ts b/e2e/modal-navigation-ng/app/home/home.component.ts index 72e8f889e..d4240f0de 100644 --- a/e2e/modal-navigation-ng/app/home/home.component.ts +++ b/e2e/modal-navigation-ng/app/home/home.component.ts @@ -1,15 +1,6 @@ import { Component, ViewContainerRef } from "@angular/core"; -import { ModalDialogService, ModalDialogOptions } from "nativescript-angular/directives/dialogs"; -import { RouterExtensions } from "nativescript-angular/router"; -import { EventData } from "tns-core-modules/data/observable"; - +import { ModalDialogService, RouterExtensions } from "@nativescript/angular"; import { ViewContainerRefService } from "../shared/ViewContainerRefService"; -import { ModalRouterComponent } from "../modal/modal-router/modal-router.component"; -import { ModalComponent } from "../modal/modal.component"; -import { ModalViewComponent } from "../modal-shared/modal-view.component"; -import { confirm } from "tns-core-modules/ui/dialogs"; - -import { AppModule } from "../app.module"; @Component({ moduleId: module.id, diff --git a/e2e/modal-navigation-ng/app/layout.component.ts b/e2e/modal-navigation-ng/app/layout.component.ts index fe6ee9a9d..800cb131b 100644 --- a/e2e/modal-navigation-ng/app/layout.component.ts +++ b/e2e/modal-navigation-ng/app/layout.component.ts @@ -1,7 +1,7 @@ import { Component, ViewContainerRef } from "@angular/core"; import { Router, NavigationEnd } from "@angular/router"; -import { NSLocationStrategy } from "nativescript-angular/router/ns-location-strategy"; -import { ModalDialogService, ModalDialogOptions } from "nativescript-angular/directives/dialogs"; +import { NSLocationStrategy } from "@nativescript/angular/router"; +import { ModalDialogService, ModalDialogOptions } from "@nativescript/angular/directives/dialogs"; import { ModalViewComponent } from "./modal-shared/modal-view.component"; import { ViewContainerRefService } from "./shared/ViewContainerRefService"; import { AppModule } from "./app.module"; diff --git a/e2e/modal-navigation-ng/app/main.aot.ts b/e2e/modal-navigation-ng/app/main.aot.ts index fef7c8714..a73c8cbd2 100644 --- a/e2e/modal-navigation-ng/app/main.aot.ts +++ b/e2e/modal-navigation-ng/app/main.aot.ts @@ -1,7 +1,9 @@ // this import should be first in order to load some required settings (like globals and reflect-metadata) -import { platformNativeScript } from "nativescript-angular/platform-static"; +import { platformNativeScript } from "@nativescript/angular"; +console.log(">>>>>>>>main.aot.ts"); + import { AppModule } from "./app.module"; -import { NativeScriptPlatformRef } from "nativescript-angular"; +import { NativeScriptPlatformRef } from "@nativescript/angular"; // "./app.module.ngfactory" is a dynamically generated module when compiled with AoT. import { AppModuleNgFactory } from "./app.module.ngfactory"; diff --git a/e2e/modal-navigation-ng/app/main.ts b/e2e/modal-navigation-ng/app/main.ts index 9e19c0134..74e583111 100644 --- a/e2e/modal-navigation-ng/app/main.ts +++ b/e2e/modal-navigation-ng/app/main.ts @@ -1,8 +1,9 @@ // this import should be first in order to load some required settings (like globals and reflect-metadata) -import { platformNativeScriptDynamic } from "nativescript-angular/platform"; +import { platformNativeScriptDynamic } from "@nativescript/angular"; +console.log(">>>>>>>>main.ts"); import { AppModule } from "./app.module"; -import { NativeScriptPlatformRef } from "nativescript-angular"; +import { NativeScriptPlatformRef } from "@nativescript/angular"; AppModule.platformRef = platformNativeScriptDynamic(); AppModule.platformRef.bootstrapModule(AppModule); \ No newline at end of file diff --git a/e2e/modal-navigation-ng/app/modal-nested/modal-nested.component.ts b/e2e/modal-navigation-ng/app/modal-nested/modal-nested.component.ts index 89cb66c56..4f6afb141 100644 --- a/e2e/modal-navigation-ng/app/modal-nested/modal-nested.component.ts +++ b/e2e/modal-navigation-ng/app/modal-nested/modal-nested.component.ts @@ -1,6 +1,6 @@ import { Component } from "@angular/core"; import { View, ShownModallyData } from "tns-core-modules/ui/core/view" -import { ModalDialogParams } from "nativescript-angular/directives/dialogs"; +import { ModalDialogParams } from "@nativescript/angular/directives/dialogs"; @Component({ moduleId: module.id, diff --git a/e2e/modal-navigation-ng/app/modal-second/modal-second.component.ts b/e2e/modal-navigation-ng/app/modal-second/modal-second.component.ts index 7b69233e6..f335c2600 100644 --- a/e2e/modal-navigation-ng/app/modal-second/modal-second.component.ts +++ b/e2e/modal-navigation-ng/app/modal-second/modal-second.component.ts @@ -1,7 +1,7 @@ import { Component } from "@angular/core"; import { View } from "tns-core-modules/ui/core/view" import { ActivatedRoute } from "@angular/router"; -import { RouterExtensions } from "nativescript-angular/router"; +import { RouterExtensions } from "@nativescript/angular/router"; @Component({ moduleId: module.id, diff --git a/e2e/modal-navigation-ng/app/modal-shared/modal-shared-second.component.ts b/e2e/modal-navigation-ng/app/modal-shared/modal-shared-second.component.ts index 26e1b7bcc..5b8099703 100644 --- a/e2e/modal-navigation-ng/app/modal-shared/modal-shared-second.component.ts +++ b/e2e/modal-navigation-ng/app/modal-shared/modal-shared-second.component.ts @@ -1,9 +1,9 @@ import { Component } from "@angular/core"; -import { ModalDialogOptions, ModalDialogService } from "nativescript-angular/modal-dialog"; +import { ModalDialogOptions, ModalDialogService } from "@nativescript/angular/modal-dialog"; import { ViewContainerRefService } from "../shared/ViewContainerRefService"; import { ModalViewComponent } from "../modal-shared/modal-view.component"; -import { RouterExtensions } from "nativescript-angular/router"; +import { RouterExtensions } from "@nativescript/angular/router"; @Component({ selector: "ns-second", diff --git a/e2e/modal-navigation-ng/app/modal-shared/modal-view-content.component.ts b/e2e/modal-navigation-ng/app/modal-shared/modal-view-content.component.ts index f194354bf..d1e0a8ef2 100644 --- a/e2e/modal-navigation-ng/app/modal-shared/modal-view-content.component.ts +++ b/e2e/modal-navigation-ng/app/modal-shared/modal-view-content.component.ts @@ -1,5 +1,5 @@ import { Component } from "@angular/core"; -import { ModalDialogParams } from "nativescript-angular/modal-dialog"; +import { ModalDialogParams } from "@nativescript/angular/modal-dialog"; @Component({ selector: "ModalViewContent", diff --git a/e2e/modal-navigation-ng/app/modal-shared/modal-view.component.ts b/e2e/modal-navigation-ng/app/modal-shared/modal-view.component.ts index 7089b8e14..e05981c1b 100644 --- a/e2e/modal-navigation-ng/app/modal-shared/modal-view.component.ts +++ b/e2e/modal-navigation-ng/app/modal-shared/modal-view.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from "@angular/core"; -import { RouterExtensions } from "nativescript-angular/router"; +import { RouterExtensions } from "@nativescript/angular/router"; @Component({ selector: "ModalView", diff --git a/e2e/modal-navigation-ng/app/modal/modal-router/modal-router.component.ts b/e2e/modal-navigation-ng/app/modal/modal-router/modal-router.component.ts index 268235e5b..d79059d5d 100644 --- a/e2e/modal-navigation-ng/app/modal/modal-router/modal-router.component.ts +++ b/e2e/modal-navigation-ng/app/modal/modal-router/modal-router.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from "@angular/core"; import { ActivatedRoute } from "@angular/router"; -import { RouterExtensions } from "nativescript-angular/router"; -import { ModalDialogParams } from "nativescript-angular/directives/dialogs"; +import { RouterExtensions } from "@nativescript/angular/router"; +import { ModalDialogParams } from "@nativescript/angular/directives/dialogs"; @Component({ moduleId: module.id, diff --git a/e2e/modal-navigation-ng/app/modal/modal.component.ts b/e2e/modal-navigation-ng/app/modal/modal.component.ts index a7caca12a..9e30b1046 100644 --- a/e2e/modal-navigation-ng/app/modal/modal.component.ts +++ b/e2e/modal-navigation-ng/app/modal/modal.component.ts @@ -1,6 +1,6 @@ import { Component, ViewContainerRef } from "@angular/core"; -import { ModalDialogParams, ModalDialogOptions, ModalDialogService } from "nativescript-angular/directives/dialogs"; -import { RouterExtensions, PageRoute } from "nativescript-angular/router"; +import { ModalDialogParams, ModalDialogOptions, ModalDialogService } from "@nativescript/angular/directives/dialogs"; +import { RouterExtensions, PageRoute } from "@nativescript/angular/router"; import { ActivatedRoute } from "@angular/router"; import { View, ShownModallyData, EventData } from "tns-core-modules/ui/core/view" import { confirm } from "tns-core-modules/ui/dialogs"; diff --git a/e2e/modal-navigation-ng/app/named-router.component.ts b/e2e/modal-navigation-ng/app/named-router.component.ts index 745ed6f11..69fbfc851 100644 --- a/e2e/modal-navigation-ng/app/named-router.component.ts +++ b/e2e/modal-navigation-ng/app/named-router.component.ts @@ -1,10 +1,10 @@ import { Component, ViewContainerRef } from "@angular/core"; import { Router, NavigationEnd } from "@angular/router"; -import { NSLocationStrategy } from "nativescript-angular/router/ns-location-strategy"; +import { NSLocationStrategy } from "@nativescript/angular"; import { ViewContainerRefService } from "./shared/ViewContainerRefService"; import { AppModule } from "./app.module"; -import { ModalDialogOptions, ModalDialogService } from "nativescript-angular"; +import { ModalDialogOptions, ModalDialogService } from "@nativescript/angular"; import { ModalViewComponent } from "./modal-shared/modal-view.component"; @Component({ diff --git a/e2e/modal-navigation-ng/app/navigation/basic.navigation.component.ts b/e2e/modal-navigation-ng/app/navigation/basic.navigation.component.ts index bf194fb2f..485744492 100644 --- a/e2e/modal-navigation-ng/app/navigation/basic.navigation.component.ts +++ b/e2e/modal-navigation-ng/app/navigation/basic.navigation.component.ts @@ -1,6 +1,6 @@ import { Component, ViewContainerRef, Input, ViewChild, ElementRef } from "@angular/core"; import { Router, NavigationEnd } from "@angular/router"; -import { ModalDialogService, ModalDialogOptions } from "nativescript-angular/directives/dialogs"; +import { ModalDialogService, ModalDialogOptions } from "@nativescript/angular/directives/dialogs"; import { ModalComponent } from "../modal/modal.component"; import { ModalRouterComponent } from "../modal/modal-router/modal-router.component"; import { confirm } from "tns-core-modules/ui/dialogs"; diff --git a/e2e/modal-navigation-ng/app/second/second.component.ts b/e2e/modal-navigation-ng/app/second/second.component.ts index dc048a5ac..2d2a26ca5 100644 --- a/e2e/modal-navigation-ng/app/second/second.component.ts +++ b/e2e/modal-navigation-ng/app/second/second.component.ts @@ -1,11 +1,11 @@ import { Component, ViewContainerRef } from "@angular/core"; -import { ModalDialogService, ModalDialogOptions } from "nativescript-angular/directives/dialogs"; +import { ModalDialogService, ModalDialogOptions } from "@nativescript/angular/directives/dialogs"; import { EventData } from "tns-core-modules/data/observable"; import { Frame } from "tns-core-modules/ui/frame"; import { View } from "tns-core-modules/ui/core/view"; import { ModalRouterComponent } from "../modal/modal-router/modal-router.component"; -import { PageRouterOutlet } from "nativescript-angular/router/page-router-outlet"; -import { RouterExtensions } from "nativescript-angular/router"; +import { PageRouterOutlet } from "@nativescript/angular/router/page-router-outlet"; +import { RouterExtensions } from "@nativescript/angular/router"; import { ModalComponent } from "../modal/modal.component"; import { AppModule } from "../app.module"; @Component({ diff --git a/e2e/modal-navigation-ng/app/tab.component.ts b/e2e/modal-navigation-ng/app/tab.component.ts index b72c056dc..dd7e094dc 100644 --- a/e2e/modal-navigation-ng/app/tab.component.ts +++ b/e2e/modal-navigation-ng/app/tab.component.ts @@ -1,10 +1,10 @@ import { Component, ViewContainerRef } from "@angular/core"; import { Router, NavigationEnd } from "@angular/router"; -import { NSLocationStrategy } from "nativescript-angular/router/ns-location-strategy"; +// import { NSLocationStrategy } from "@nativescript/angular"; import { ViewContainerRefService } from "./shared/ViewContainerRefService"; import { AppModule } from "./app.module"; -import { ModalDialogOptions, ModalDialogService } from "nativescript-angular"; +import { ModalDialogOptions, ModalDialogService } from "@nativescript/angular"; import { ModalViewComponent } from "./modal-shared/modal-view.component"; @Component({ @@ -14,14 +14,14 @@ import { ModalViewComponent } from "./modal-shared/modal-view.component"; export class TabComponent { constructor( router: Router, - location: NSLocationStrategy, + // location: NSLocationStrategy, private _vcRef: ViewContainerRef, private _viewContainerRefService: ViewContainerRefService, private modal: ModalDialogService) { router.events.subscribe(e => { if (e instanceof NavigationEnd) { console.log("[ROUTER]: " + e.toString()); - console.log(location.toString()); + // console.log(location.toString()); } }); diff --git a/e2e/modal-navigation-ng/package.json b/e2e/modal-navigation-ng/package.json index 2454a4121..9ccc07d80 100644 --- a/e2e/modal-navigation-ng/package.json +++ b/e2e/modal-navigation-ng/package.json @@ -21,7 +21,7 @@ "@angular/platform-browser": "~8.2.0", "@angular/platform-browser-dynamic": "~8.2.0", "@angular/router": "~8.2.0", - "nativescript-angular": "file:../../nativescript-angular", + "@nativescript/angular": "file:../../nativescript-angular", "nativescript-theme-core": "~1.0.4", "reflect-metadata": "~0.1.8", "rxjs": "^6.4.0", diff --git a/e2e/single-page/app/app-routing.module.ts b/e2e/single-page/app/app-routing.module.ts index 2b650ee77..a1528f7ff 100644 --- a/e2e/single-page/app/app-routing.module.ts +++ b/e2e/single-page/app/app-routing.module.ts @@ -1,5 +1,5 @@ import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core"; -import { NativeScriptRouterModule } from "nativescript-angular/router"; +import { NativeScriptRouterModule } from "@nativescript/angular/router"; import { FirstComponent } from "./first/first.component" import { SecondComponent } from "./second/second.component" diff --git a/e2e/single-page/app/app.module.ts b/e2e/single-page/app/app.module.ts index d2187c691..9210f46d2 100644 --- a/e2e/single-page/app/app.module.ts +++ b/e2e/single-page/app/app.module.ts @@ -1,6 +1,6 @@ import { NgModule, NgModuleFactoryLoader, NO_ERRORS_SCHEMA } from "@angular/core"; -import { NativeScriptModule } from "nativescript-angular/nativescript.module"; -import { NSModuleFactoryLoader } from "nativescript-angular/router"; +import { NativeScriptModule } from "@nativescript/angular/nativescript.module"; +import { NSModuleFactoryLoader } from "@nativescript/angular/router"; import { AppRoutingModule, @@ -9,7 +9,7 @@ import { import { AppComponent } from "./app.component"; -import { rendererTraceCategory, viewUtilCategory, routeReuseStrategyTraceCategory, routerTraceCategory } from "nativescript-angular/trace"; +import { routeReuseStrategyTraceCategory, routerTraceCategory } from "@nativescript/angular/trace"; import { setCategories, enable } from "tns-core-modules/trace"; import { ModalComponent } from "./second/modal/modal.component"; setCategories(routerTraceCategory + "," + routeReuseStrategyTraceCategory); diff --git a/e2e/single-page/app/first/first.component.ts b/e2e/single-page/app/first/first.component.ts index 58956ec8f..aaef09a8d 100644 --- a/e2e/single-page/app/first/first.component.ts +++ b/e2e/single-page/app/first/first.component.ts @@ -1,10 +1,6 @@ -import { Component, OnInit, OnDestroy, OnChanges } from "@angular/core"; -import { ActivatedRoute, Router, Route } from "@angular/router"; -import { Location } from "@angular/common"; +import { Component, OnInit, OnDestroy } from "@angular/core"; import { Page } from "tns-core-modules/ui/page"; -import { Observable } from "rxjs"; -import { FrameService } from "nativescript-angular/platform-providers"; @Component({ selector: "first", diff --git a/e2e/single-page/app/main.aot.ts b/e2e/single-page/app/main.aot.ts index 10352ce3c..d0302e23e 100644 --- a/e2e/single-page/app/main.aot.ts +++ b/e2e/single-page/app/main.aot.ts @@ -1,4 +1,4 @@ -import { platformNativeScript } from "nativescript-angular/platform-static"; +import { platformNativeScript } from "@nativescript/angular/platform-static"; import { AppModuleNgFactory } from "./app.module.ngfactory"; platformNativeScript({ createFrameOnBootstrap: true }).bootstrapModuleFactory(AppModuleNgFactory); diff --git a/e2e/single-page/app/main.ts b/e2e/single-page/app/main.ts index 864356357..52e4bc5a2 100644 --- a/e2e/single-page/app/main.ts +++ b/e2e/single-page/app/main.ts @@ -1,4 +1,4 @@ -import { platformNativeScriptDynamic } from "nativescript-angular/platform"; +import { platformNativeScriptDynamic } from "@nativescript/angular/platform"; import { AppModule } from "./app.module"; platformNativeScriptDynamic({ createFrameOnBootstrap: true }).bootstrapModule(AppModule); diff --git a/e2e/single-page/app/second/modal/modal.component.ts b/e2e/single-page/app/second/modal/modal.component.ts index 6a954147a..895f47679 100644 --- a/e2e/single-page/app/second/modal/modal.component.ts +++ b/e2e/single-page/app/second/modal/modal.component.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { ModalDialogParams } from "nativescript-angular/modal-dialog"; +import { ModalDialogParams } from "@nativescript/angular/modal-dialog"; @Component({ moduleId: module.id, diff --git a/e2e/single-page/app/second/second.component.ts b/e2e/single-page/app/second/second.component.ts index f06bb1299..1e829a71f 100644 --- a/e2e/single-page/app/second/second.component.ts +++ b/e2e/single-page/app/second/second.component.ts @@ -1,11 +1,11 @@ import { Component, OnInit, OnDestroy, ViewContainerRef } from "@angular/core"; import { ActivatedRoute, Router, Route } from "@angular/router"; -import { ModalDialogService, ModalDialogOptions } from "nativescript-angular"; +import { ModalDialogService, ModalDialogOptions } from "@nativescript/angular"; import { Page } from "tns-core-modules/ui/page"; import { Observable } from "rxjs"; import { map } from "rxjs/operators"; -import { RouterExtensions } from "nativescript-angular/router"; +import { RouterExtensions } from "@nativescript/angular/router"; import { ModalComponent } from "./modal/modal.component"; @Component({ diff --git a/e2e/single-page/package.json b/e2e/single-page/package.json index 001d8b0a6..d04dc01e2 100644 --- a/e2e/single-page/package.json +++ b/e2e/single-page/package.json @@ -4,7 +4,10 @@ "readme": "NativeScript Application", "repository": "", "nativescript": { - "id": "org.nativescript.singlepage" + "id": "org.nativescript.singlepage", + "tns-ios": { + "version": "6.1.1" + } }, "dependencies": { "@angular/animations": "~8.2.0", @@ -15,7 +18,7 @@ "@angular/platform-browser": "~8.2.0", "@angular/platform-browser-dynamic": "~8.2.0", "@angular/router": "~8.2.0", - "nativescript-angular": "file:../../nativescript-angular", + "@nativescript/angular": "file:../../nativescript-angular", "nativescript-intl": "^3.0.0", "reflect-metadata": "~0.1.8", "rxjs": "^6.4.0", diff --git a/nativescript-angular-package/animations/index.ts b/nativescript-angular-package/animations/index.ts new file mode 100644 index 000000000..3add12158 --- /dev/null +++ b/nativescript-angular-package/animations/index.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/animations"; \ No newline at end of file diff --git a/nativescript-angular-package/directives/index.ts b/nativescript-angular-package/directives/index.ts new file mode 100644 index 000000000..d32d1c9a8 --- /dev/null +++ b/nativescript-angular-package/directives/index.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/directives"; \ No newline at end of file diff --git a/nativescript-angular-package/file-system/ns-file-system.ts b/nativescript-angular-package/file-system/ns-file-system.ts new file mode 100644 index 000000000..e7b0b52dd --- /dev/null +++ b/nativescript-angular-package/file-system/ns-file-system.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/file-system/ns-file-system"; \ No newline at end of file diff --git a/nativescript-angular-package/forms/index.ts b/nativescript-angular-package/forms/index.ts new file mode 100644 index 000000000..4c8c3c933 --- /dev/null +++ b/nativescript-angular-package/forms/index.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/forms" \ No newline at end of file diff --git a/nativescript-angular-package/forms/value-accessors/index.ts b/nativescript-angular-package/forms/value-accessors/index.ts new file mode 100644 index 000000000..37a248724 --- /dev/null +++ b/nativescript-angular-package/forms/value-accessors/index.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/forms/value-accessors"; \ No newline at end of file diff --git a/nativescript-angular-package/http-client/index.ts b/nativescript-angular-package/http-client/index.ts new file mode 100644 index 000000000..939d93e6d --- /dev/null +++ b/nativescript-angular-package/http-client/index.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/http-client" \ No newline at end of file diff --git a/nativescript-angular-package/package.json b/nativescript-angular-package/package.json new file mode 100644 index 000000000..d833dbf91 --- /dev/null +++ b/nativescript-angular-package/package.json @@ -0,0 +1,36 @@ +{ + "name": "nativescript-angular", + "version": "8.3.0", + "description": "An Angular renderer that lets you build mobile apps with NativeScript.", + "homepage": "https://www.nativescript.org/", + "bugs": "https://github.com/NativeScript/nativescript-angular/issues", + "author": { + "name": "NativeScript Team" + }, + "contributors": [ + "Hristo Deshev ", + "Alexander Vakrilov ", + "Stanimira Vlaeva " + ], + "nativescript": { + "platforms": { + "android": "6.0.0", + "ios": "6.0.0" + } + }, + "keywords": [ + "NativeScript", + "Angular" + ], + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "https://github.com/NativeScript/nativescript-angular.git" + }, + "bin": { + "update-app-ng-deps": "./bin/update-app-ng-deps" + }, + "dependencies": { + "@nativescript/angular": "file:../nativescript-angular" + } +} diff --git a/nativescript-angular-package/router/index.ts b/nativescript-angular-package/router/index.ts new file mode 100644 index 000000000..77b052733 --- /dev/null +++ b/nativescript-angular-package/router/index.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/router"; diff --git a/nativescript-angular-package/testing/index.d.ts b/nativescript-angular-package/testing/index.d.ts new file mode 100644 index 000000000..b64f8eedc --- /dev/null +++ b/nativescript-angular-package/testing/index.d.ts @@ -0,0 +1,14 @@ +export * from "./src/util"; +/** + * Providers array is exported for cases where a custom module has to be constructed + * to test a particular piece of code. This can happen, for example, if you are trying + * to test dynamic component loading and need to specify an entryComponent for the testing + * module. + */ +export declare const NATIVESCRIPT_TESTING_PROVIDERS: any[]; +/** + * NativeScript testing support module. Enables use of TestBed for angular components, directives, + * pipes, and services. + */ +export declare class NativeScriptTestingModule { +} diff --git a/nativescript-angular-package/testing/index.js b/nativescript-angular-package/testing/index.js new file mode 100644 index 000000000..abead4076 --- /dev/null +++ b/nativescript-angular-package/testing/index.js @@ -0,0 +1,38 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = require("@angular/core"); +var testing_1 = require("@angular/core/testing"); +var nativescript_test_component_renderer_1 = require("./src/nativescript_test_component_renderer"); +var platform_common_1 = require("../platform-common"); +var platform_providers_1 = require("../platform-providers"); +var util_1 = require("./src/util"); +__export(require("./src/util")); +/** + * Providers array is exported for cases where a custom module has to be constructed + * to test a particular piece of code. This can happen, for example, if you are trying + * to test dynamic component loading and need to specify an entryComponent for the testing + * module. + */ +exports.NATIVESCRIPT_TESTING_PROVIDERS = [ + platform_common_1.COMMON_PROVIDERS, + { provide: platform_providers_1.APP_ROOT_VIEW, useFactory: util_1.testingRootView }, + { provide: testing_1.TestComponentRenderer, useClass: nativescript_test_component_renderer_1.NativeScriptTestComponentRenderer }, +]; +/** + * NativeScript testing support module. Enables use of TestBed for angular components, directives, + * pipes, and services. + */ +var NativeScriptTestingModule = /** @class */ (function () { + function NativeScriptTestingModule() { + } + NativeScriptTestingModule = __decorate([ + core_1.NgModule({ + providers: exports.NATIVESCRIPT_TESTING_PROVIDERS + }) + ], NativeScriptTestingModule); + return NativeScriptTestingModule; +}()); +exports.NativeScriptTestingModule = NativeScriptTestingModule; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/testing/index.ts b/nativescript-angular-package/testing/index.ts new file mode 100644 index 000000000..d8d00bbe6 --- /dev/null +++ b/nativescript-angular-package/testing/index.ts @@ -0,0 +1,29 @@ +import { NgModule } from "@angular/core"; +import { TestComponentRenderer } from "@angular/core/testing"; +import { NativeScriptTestComponentRenderer } from "./src/nativescript_test_component_renderer"; +import { COMMON_PROVIDERS } from "../platform-common"; +import { APP_ROOT_VIEW } from "../platform-providers"; +import { testingRootView } from "./src/util"; +export * from "./src/util"; + +/** + * Providers array is exported for cases where a custom module has to be constructed + * to test a particular piece of code. This can happen, for example, if you are trying + * to test dynamic component loading and need to specify an entryComponent for the testing + * module. + */ +export const NATIVESCRIPT_TESTING_PROVIDERS: any[] = [ + COMMON_PROVIDERS, + {provide: APP_ROOT_VIEW, useFactory: testingRootView}, + {provide: TestComponentRenderer, useClass: NativeScriptTestComponentRenderer}, +]; + +/** + * NativeScript testing support module. Enables use of TestBed for angular components, directives, + * pipes, and services. + */ +@NgModule({ + providers: NATIVESCRIPT_TESTING_PROVIDERS +}) +export class NativeScriptTestingModule { +} diff --git a/nativescript-angular-package/testing/src/nativescript_test_component_renderer.d.ts b/nativescript-angular-package/testing/src/nativescript_test_component_renderer.d.ts new file mode 100644 index 000000000..a6a23a2ab --- /dev/null +++ b/nativescript-angular-package/testing/src/nativescript_test_component_renderer.d.ts @@ -0,0 +1,7 @@ +import { TestComponentRenderer } from "@angular/core/testing"; +/** + * A NativeScript based implementation of the TestComponentRenderer. + */ +export declare class NativeScriptTestComponentRenderer extends TestComponentRenderer { + insertRootElement(rootElId: string): void; +} diff --git a/nativescript-angular-package/testing/src/nativescript_test_component_renderer.js b/nativescript-angular-package/testing/src/nativescript_test_component_renderer.js new file mode 100644 index 000000000..df91149f4 --- /dev/null +++ b/nativescript-angular-package/testing/src/nativescript_test_component_renderer.js @@ -0,0 +1,26 @@ +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = require("@angular/core"); +var testing_1 = require("@angular/core/testing"); +var proxy_view_container_1 = require("tns-core-modules/ui/proxy-view-container"); +var util_1 = require("./util"); +/** + * A NativeScript based implementation of the TestComponentRenderer. + */ +var NativeScriptTestComponentRenderer = /** @class */ (function (_super) { + __extends(NativeScriptTestComponentRenderer, _super); + function NativeScriptTestComponentRenderer() { + return _super !== null && _super.apply(this, arguments) || this; + } + NativeScriptTestComponentRenderer.prototype.insertRootElement = function (rootElId) { + var layout = new proxy_view_container_1.ProxyViewContainer(); + layout.id = rootElId; + var rootLayout = util_1.testingRootView(); + rootLayout.addChild(layout); + }; + NativeScriptTestComponentRenderer = __decorate([ + core_1.Injectable() + ], NativeScriptTestComponentRenderer); + return NativeScriptTestComponentRenderer; +}(testing_1.TestComponentRenderer)); +exports.NativeScriptTestComponentRenderer = NativeScriptTestComponentRenderer; +//# sourceMappingURL=nativescript_test_component_renderer.js.map \ No newline at end of file diff --git a/nativescript-angular-package/testing/src/nativescript_test_component_renderer.ts b/nativescript-angular-package/testing/src/nativescript_test_component_renderer.ts new file mode 100644 index 000000000..87ad55660 --- /dev/null +++ b/nativescript-angular-package/testing/src/nativescript_test_component_renderer.ts @@ -0,0 +1,19 @@ +import { Injectable } from "@angular/core"; +import { TestComponentRenderer } from "@angular/core/testing"; +import { ProxyViewContainer } from "tns-core-modules/ui/proxy-view-container"; +import { testingRootView } from "./util"; + +/** + * A NativeScript based implementation of the TestComponentRenderer. + */ +@Injectable() +export class NativeScriptTestComponentRenderer extends TestComponentRenderer { + + insertRootElement(rootElId: string) { + const layout = new ProxyViewContainer(); + layout.id = rootElId; + + const rootLayout = testingRootView(); + rootLayout.addChild(layout); + } +} diff --git a/nativescript-angular-package/testing/src/util.d.ts b/nativescript-angular-package/testing/src/util.d.ts new file mode 100644 index 000000000..7aa6bcae5 --- /dev/null +++ b/nativescript-angular-package/testing/src/util.d.ts @@ -0,0 +1,47 @@ +import { LayoutBase } from "tns-core-modules/ui/layouts/layout-base"; +import { ComponentFixture } from "@angular/core/testing"; +import { Type } from "@angular/core"; +/** + * Get a reference to the fixtures container. + */ +export declare function testingRootView(): LayoutBase; +/** + * Return a promise that resolves after (durationMs) milliseconds + */ +export declare function promiseWait(durationMs: number): () => Promise<{}>; +/** + * Perform basic TestBed environment initialization. Call this once in the main entry point to your tests. + */ +export declare function nsTestBedInit(): void; +/** + * Helper for configuring a TestBed instance for rendering components for test. Ideally this + * would not be needed, and in truth it's just a wrapper to eliminate some boilerplate. It + * exists because when you need to specify `entryComponents` for a test the setup becomes quite + * a bit more complex than if you're just doing a basic component test. + * + * More about entryComponents complexity: https://github.com/angular/angular/issues/12079 + * + * Use: + * ``` + * beforeEach(nsTestBedBeforeEach([MyComponent,MyFailComponent])); + * ``` + * + * **NOTE*** Remember to pair with {@see nsTestBedAfterEach} + * + * @param components Any components that you will create during the test + * @param providers Any services your tests depend on + * @param imports Any module imports your tests depend on + * @param entryComponents Any entry components that your tests depend on + */ +export declare function nsTestBedBeforeEach(components: any[], providers?: any[], imports?: any[], entryComponents?: any[]): (done: any) => void; +/** + * Helper for a basic component TestBed clean up. + * @param resetEnv When true the testing environment will be reset + * @param resetFn When resetting the environment, use this init function + */ +export declare function nsTestBedAfterEach(resetEnv?: boolean, resetFn?: typeof nsTestBedInit): () => void; +/** + * Render a component using the TestBed helper, and return a promise that resolves when the + * ComponentFixture is fully initialized. + */ +export declare function nsTestBedRender(componentType: Type): Promise>; diff --git a/nativescript-angular-package/testing/src/util.js b/nativescript-angular-package/testing/src/util.js new file mode 100644 index 000000000..55329ffff --- /dev/null +++ b/nativescript-angular-package/testing/src/util.js @@ -0,0 +1,182 @@ +Object.defineProperty(exports, "__esModule", { value: true }); +var frame_1 = require("tns-core-modules/ui/frame"); +var testing_1 = require("@angular/core/testing"); +var core_1 = require("@angular/core"); +var nativescript_module_1 = require("../../nativescript.module"); +var testing_2 = require("@angular/platform-browser-dynamic/testing"); +var platform_1 = require("../../platform"); +var index_1 = require("../index"); +var common_1 = require("@angular/common"); +var grid_layout_1 = require("tns-core-modules/ui/layouts/grid-layout"); +var TESTING_ROOT_ID = "__testing_container"; +/** + * Get a reference to the fixtures container. + */ +function testingRootView() { + var rootPageLayout = frame_1.topmost().currentPage.content; + var testingRoot; + rootPageLayout.eachChild(function (child) { + if (child.id === TESTING_ROOT_ID) { + testingRoot = child; + return false; + } + return true; + }); + if (!testingRoot) { + testingRoot = new grid_layout_1.GridLayout(); + testingRoot.id = TESTING_ROOT_ID; + grid_layout_1.GridLayout.setColumnSpan(testingRoot, 100); + grid_layout_1.GridLayout.setRowSpan(testingRoot, 100); + rootPageLayout.addChild(testingRoot); + } + return testingRoot; +} +exports.testingRootView = testingRootView; +/** + * Declared test contexts. When the suite is done this map should be empty if all lifecycle + * calls have happened as expected. + * @private + */ +var activeTestFixtures = []; +/** + * Return a promise that resolves after (durationMs) milliseconds + */ +function promiseWait(durationMs) { + return function () { return new Promise(function (resolve) { return setTimeout(function () { return resolve(); }, durationMs); }); }; +} +exports.promiseWait = promiseWait; +/** + * Perform basic TestBed environment initialization. Call this once in the main entry point to your tests. + */ +function nsTestBedInit() { + testing_1.TestBed.initTestEnvironment(index_1.NativeScriptTestingModule, testing_2.platformBrowserDynamicTesting(platform_1.NS_COMPILER_PROVIDERS)); +} +exports.nsTestBedInit = nsTestBedInit; +/** + * Helper for configuring a TestBed instance for rendering components for test. Ideally this + * would not be needed, and in truth it's just a wrapper to eliminate some boilerplate. It + * exists because when you need to specify `entryComponents` for a test the setup becomes quite + * a bit more complex than if you're just doing a basic component test. + * + * More about entryComponents complexity: https://github.com/angular/angular/issues/12079 + * + * Use: + * ``` + * beforeEach(nsTestBedBeforeEach([MyComponent,MyFailComponent])); + * ``` + * + * **NOTE*** Remember to pair with {@see nsTestBedAfterEach} + * + * @param components Any components that you will create during the test + * @param providers Any services your tests depend on + * @param imports Any module imports your tests depend on + * @param entryComponents Any entry components that your tests depend on + */ +function nsTestBedBeforeEach(components, providers, imports, entryComponents) { + if (providers === void 0) { providers = []; } + if (imports === void 0) { imports = []; } + if (entryComponents === void 0) { entryComponents = []; } + return function (done) { + activeTestFixtures.push([]); + // If there are no entry components we can take the simple path. + if (entryComponents.length === 0) { + testing_1.TestBed.configureTestingModule({ + declarations: components.slice(), + providers: providers.slice(), + imports: [nativescript_module_1.NativeScriptModule].concat(imports) + }); + } + else { + // If there are entry components, we have to reset the testing platform. + // + // There's got to be a better way... (o_O) + testing_1.TestBed.resetTestEnvironment(); + var EntryComponentsTestModule = /** @class */ (function () { + function EntryComponentsTestModule() { + } + EntryComponentsTestModule = __decorate([ + core_1.NgModule({ + declarations: entryComponents, + exports: entryComponents, + entryComponents: entryComponents + }) + ], EntryComponentsTestModule); + return EntryComponentsTestModule; + }()); + testing_1.TestBed.initTestEnvironment(EntryComponentsTestModule, testing_2.platformBrowserDynamicTesting(platform_1.NS_COMPILER_PROVIDERS)); + testing_1.TestBed.configureTestingModule({ + declarations: components, + imports: [ + nativescript_module_1.NativeScriptModule, index_1.NativeScriptTestingModule, common_1.CommonModule + ].concat(imports), + providers: providers.concat(index_1.NATIVESCRIPT_TESTING_PROVIDERS), + }); + } + testing_1.TestBed.compileComponents() + .then(function () { return done(); }) + .catch(function (e) { + console.log("Failed to instantiate test component with error: " + e); + console.log(e.stack); + done(); + }); + }; +} +exports.nsTestBedBeforeEach = nsTestBedBeforeEach; +/** + * Helper for a basic component TestBed clean up. + * @param resetEnv When true the testing environment will be reset + * @param resetFn When resetting the environment, use this init function + */ +function nsTestBedAfterEach(resetEnv, resetFn) { + if (resetEnv === void 0) { resetEnv = true; } + if (resetFn === void 0) { resetFn = nsTestBedInit; } + return function () { + if (activeTestFixtures.length === 0) { + throw new Error("There are no more declared fixtures." + + "Did you call \"nsTestBedBeforeEach\" and \"nsTestBedAfterEach\" an equal number of times?"); + } + var root = testingRootView(); + var fixtures = activeTestFixtures.pop(); + fixtures.forEach(function (fixture) { + var fixtureView = fixture.nativeElement; + if (fixtureView.parent === root) { + root.removeChild(fixtureView); + } + fixture.destroy(); + }); + testing_1.TestBed.resetTestingModule(); + if (resetEnv) { + testing_1.TestBed.resetTestEnvironment(); + resetFn(); + } + }; +} +exports.nsTestBedAfterEach = nsTestBedAfterEach; +/** + * Render a component using the TestBed helper, and return a promise that resolves when the + * ComponentFixture is fully initialized. + */ +function nsTestBedRender(componentType) { + var fixture = testing_1.TestBed.createComponent(componentType); + fixture.detectChanges(); + return fixture.whenRenderingDone() + // TODO(jd): it seems that the whenStable and whenRenderingDone utilities of ComponentFixture + // do not work as expected. I looked at how to fix it and it's not clear how to provide + // a {N} specific subclass, because ComponentFixture is newed directly rather than injected + // What to do about it? Maybe fakeAsync can help? For now just setTimeout for 100ms (x_X) + .then(promiseWait(100)) + .then(function () { + var list = activeTestFixtures[activeTestFixtures.length - 1]; + if (!list) { + console.warn("nsTestBedRender called without nsTestBedBeforeEach/nsTestBedAfter each. " + + "You are responsible for calling 'fixture.destroy()' when your test is done " + + "in order to clean up the components that are created."); + } + else { + list.push(fixture); + } + return fixture; + }); +} +exports.nsTestBedRender = nsTestBedRender; +//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/nativescript-angular-package/testing/src/util.ts b/nativescript-angular-package/testing/src/util.ts new file mode 100644 index 000000000..5f2e514b8 --- /dev/null +++ b/nativescript-angular-package/testing/src/util.ts @@ -0,0 +1,192 @@ + +import { View } from "tns-core-modules/ui/core/view"; +import { topmost } from "tns-core-modules/ui/frame"; +import { LayoutBase } from "tns-core-modules/ui/layouts/layout-base"; +import { ComponentFixture, TestBed } from "@angular/core/testing"; +import { NgModule, Type } from "@angular/core"; +import { NativeScriptModule } from "../../nativescript.module"; +import { platformBrowserDynamicTesting } from "@angular/platform-browser-dynamic/testing"; +import { NS_COMPILER_PROVIDERS } from "../../platform"; +import { NATIVESCRIPT_TESTING_PROVIDERS, NativeScriptTestingModule } from "../index"; +import { CommonModule } from "@angular/common"; +import { GridLayout } from "tns-core-modules/ui/layouts/grid-layout"; + +const TESTING_ROOT_ID = "__testing_container"; + +/** + * Get a reference to the fixtures container. + */ +export function testingRootView(): LayoutBase { + const rootPageLayout = topmost().currentPage.content as LayoutBase; + + let testingRoot: LayoutBase; + rootPageLayout.eachChild(child => { + if (child.id === TESTING_ROOT_ID) { + testingRoot = child as LayoutBase; + return false; + } + return true; + }); + + if (!testingRoot) { + testingRoot = new GridLayout(); + testingRoot.id = TESTING_ROOT_ID; + GridLayout.setColumnSpan(testingRoot, 100); + GridLayout.setRowSpan(testingRoot, 100); + rootPageLayout.addChild(testingRoot); + } + + return testingRoot; +} + + +/** + * Declared test contexts. When the suite is done this map should be empty if all lifecycle + * calls have happened as expected. + * @private + */ +const activeTestFixtures: ComponentFixture[][] = []; + +/** + * Return a promise that resolves after (durationMs) milliseconds + */ +export function promiseWait(durationMs: number) { + return () => new Promise((resolve) => setTimeout(() => resolve(), durationMs)); +} + +/** + * Perform basic TestBed environment initialization. Call this once in the main entry point to your tests. + */ +export function nsTestBedInit() { + TestBed.initTestEnvironment( + NativeScriptTestingModule, + platformBrowserDynamicTesting(NS_COMPILER_PROVIDERS) + ); +} + +/** + * Helper for configuring a TestBed instance for rendering components for test. Ideally this + * would not be needed, and in truth it's just a wrapper to eliminate some boilerplate. It + * exists because when you need to specify `entryComponents` for a test the setup becomes quite + * a bit more complex than if you're just doing a basic component test. + * + * More about entryComponents complexity: https://github.com/angular/angular/issues/12079 + * + * Use: + * ``` + * beforeEach(nsTestBedBeforeEach([MyComponent,MyFailComponent])); + * ``` + * + * **NOTE*** Remember to pair with {@see nsTestBedAfterEach} + * + * @param components Any components that you will create during the test + * @param providers Any services your tests depend on + * @param imports Any module imports your tests depend on + * @param entryComponents Any entry components that your tests depend on + */ +export function nsTestBedBeforeEach( + components: any[], + providers: any[] = [], + imports: any[] = [], + entryComponents: any[] = []) { + return (done) => { + activeTestFixtures.push([]); + // If there are no entry components we can take the simple path. + if (entryComponents.length === 0) { + TestBed.configureTestingModule({ + declarations: [...components], + providers: [...providers], + imports: [NativeScriptModule, ...imports] + }); + } else { + // If there are entry components, we have to reset the testing platform. + // + // There's got to be a better way... (o_O) + TestBed.resetTestEnvironment(); + @NgModule({ + declarations: entryComponents, + exports: entryComponents, + entryComponents: entryComponents + }) + class EntryComponentsTestModule { + } + TestBed.initTestEnvironment( + EntryComponentsTestModule, + platformBrowserDynamicTesting(NS_COMPILER_PROVIDERS) + ); + TestBed.configureTestingModule({ + declarations: components, + imports: [ + NativeScriptModule, NativeScriptTestingModule, CommonModule, + ...imports + ], + providers: [...providers, ...NATIVESCRIPT_TESTING_PROVIDERS], + }); + } + TestBed.compileComponents() + .then(() => done()) + .catch((e) => { + console.log(`Failed to instantiate test component with error: ${e}`); + console.log(e.stack); + done(); + }); + }; +} + +/** + * Helper for a basic component TestBed clean up. + * @param resetEnv When true the testing environment will be reset + * @param resetFn When resetting the environment, use this init function + */ +export function nsTestBedAfterEach(resetEnv = true, resetFn = nsTestBedInit) { + return () => { + if (activeTestFixtures.length === 0) { + throw new Error( + `There are no more declared fixtures.` + + `Did you call "nsTestBedBeforeEach" and "nsTestBedAfterEach" an equal number of times?` + ); + } + const root = testingRootView() as LayoutBase; + const fixtures = activeTestFixtures.pop(); + fixtures.forEach((fixture) => { + const fixtureView = fixture.nativeElement; + if (fixtureView.parent === root) { + root.removeChild(fixtureView); + } + fixture.destroy(); + }); + TestBed.resetTestingModule(); + if (resetEnv) { + TestBed.resetTestEnvironment(); + resetFn(); + } + }; +} + +/** + * Render a component using the TestBed helper, and return a promise that resolves when the + * ComponentFixture is fully initialized. + */ +export function nsTestBedRender(componentType: Type): Promise> { + const fixture = TestBed.createComponent(componentType); + fixture.detectChanges(); + return fixture.whenRenderingDone() + // TODO(jd): it seems that the whenStable and whenRenderingDone utilities of ComponentFixture + // do not work as expected. I looked at how to fix it and it's not clear how to provide + // a {N} specific subclass, because ComponentFixture is newed directly rather than injected + // What to do about it? Maybe fakeAsync can help? For now just setTimeout for 100ms (x_X) + .then(promiseWait(100)) + .then(() => { + const list = activeTestFixtures[activeTestFixtures.length - 1]; + if (!list) { + console.warn( + "nsTestBedRender called without nsTestBedBeforeEach/nsTestBedAfter each. " + + "You are responsible for calling 'fixture.destroy()' when your test is done " + + "in order to clean up the components that are created." + ); + } else { + list.push(fixture); + } + return fixture; + }); +} diff --git a/nativescript-angular-package/value-accessors/base-value-accessor.ts b/nativescript-angular-package/value-accessors/base-value-accessor.ts new file mode 100644 index 000000000..7c5fd2186 --- /dev/null +++ b/nativescript-angular-package/value-accessors/base-value-accessor.ts @@ -0,0 +1,3 @@ +// This file is only for compatibility with pre 4.4.0 releases. +// Please use "nativescript-angular/forms/value-accessors/base-value-accessor" +export * from "@nativescript/angular/forms/value-accessors/base-value-accessor"; diff --git a/nativescript-angular/zone-js/README.md b/nativescript-angular-package/zone-js/README.md similarity index 100% rename from nativescript-angular/zone-js/README.md rename to nativescript-angular-package/zone-js/README.md diff --git a/nativescript-angular-package/zone-js/testing.jasmine.d.ts b/nativescript-angular-package/zone-js/testing.jasmine.d.ts new file mode 100644 index 000000000..16b219e32 --- /dev/null +++ b/nativescript-angular-package/zone-js/testing.jasmine.d.ts @@ -0,0 +1,2 @@ +import "../platform"; +import "./dist/zone-nativescript.jasmine.js"; diff --git a/nativescript-angular-package/zone-js/testing.jasmine.ts b/nativescript-angular-package/zone-js/testing.jasmine.ts new file mode 100644 index 000000000..0d852527d --- /dev/null +++ b/nativescript-angular-package/zone-js/testing.jasmine.ts @@ -0,0 +1,3 @@ +// Bootstrap helper module for jasmine spec tests +import "@nativescript/angular/platform"; +import "@nativescript/angular/dist/zone-nativescript.jasmine.js"; diff --git a/nativescript-angular-package/zone-js/testing.mocha.d.ts b/nativescript-angular-package/zone-js/testing.mocha.d.ts new file mode 100644 index 000000000..0f75b1d11 --- /dev/null +++ b/nativescript-angular-package/zone-js/testing.mocha.d.ts @@ -0,0 +1,2 @@ +import "../platform"; +import "./dist/zone-nativescript.mocha.js"; diff --git a/nativescript-angular-package/zone-js/testing.mocha.ts b/nativescript-angular-package/zone-js/testing.mocha.ts new file mode 100644 index 000000000..f91c4168b --- /dev/null +++ b/nativescript-angular-package/zone-js/testing.mocha.ts @@ -0,0 +1,2 @@ +import "@nativescript/angular/platform"; +import "@nativescript/angular/dist/zone-nativescript.mocha.js"; diff --git a/nativescript-angular/animations/index.ts b/nativescript-angular/animations/index.ts index d5754740b..2b54a81e9 100644 --- a/nativescript-angular/animations/index.ts +++ b/nativescript-angular/animations/index.ts @@ -1 +1,4 @@ export * from "./animations.module"; +export * from "./animation-player"; +export * from "./animation-driver"; +export * from "./utils"; diff --git a/nativescript-angular/index.ts b/nativescript-angular/index.ts index db3cb4279..68ddbb1b6 100644 --- a/nativescript-angular/index.ts +++ b/nativescript-angular/index.ts @@ -15,6 +15,9 @@ export * from "./renderer"; export * from "./view-util"; export * from "./resource-loader"; +export * from "./nativescript.module"; +export * from "./platform"; + export { ViewClass, ViewClassMeta, diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index bd93bb37c..4d5472187 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -1,5 +1,5 @@ { - "name": "nativescript-angular", + "name": "@nativescript/angular", "version": "8.3.0", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", diff --git a/nativescript-angular/platform.ts b/nativescript-angular/platform.ts index 8919d34fd..80b6a16e1 100644 --- a/nativescript-angular/platform.ts +++ b/nativescript-angular/platform.ts @@ -2,6 +2,7 @@ // It's needed to handle __metadata calls inside @angular/core import "reflect-metadata"; +console.log(">>>>>>>>>>>import reflect-metadata;"); // Import platform-common immediately after reflect-metadata - because rest of the polyfills. import { NativeScriptPlatformRef, diff --git a/nativescript-angular/router/router.module.ts b/nativescript-angular/router/router.module.ts index 5246eeea0..dc7a30f1d 100644 --- a/nativescript-angular/router/router.module.ts +++ b/nativescript-angular/router/router.module.ts @@ -4,7 +4,7 @@ import { LocationStrategy, PlatformLocation } from "@angular/common"; import { NSRouterLink } from "./ns-router-link"; import { NSRouterLinkActive } from "./ns-router-link-active"; import { PageRouterOutlet } from "./page-router-outlet"; -import { NSLocationStrategy, LocationState } from "./ns-location-strategy"; +import { NSLocationStrategy } from "./ns-location-strategy"; import { NativescriptPlatformLocation } from "./ns-platform-location"; import { NSRouteReuseStrategy } from "./ns-route-reuse-strategy"; import { RouterExtensions } from "./router-extensions"; @@ -15,9 +15,12 @@ import { NSEmptyOutletComponent } from "./ns-empty-outlet.component"; export { PageRoute } from "./page-router-outlet"; export { RouterExtensions } from "./router-extensions"; export { NSModuleFactoryLoader } from "./ns-module-factory-loader"; -export { NSEmptyOutletComponent } from "./ns-empty-outlet.component"; -export type LocationState = LocationState; +export { NSRouterLink } from "./ns-router-link"; +export { NSRouterLinkActive } from "./ns-router-link-active"; +export { PageRouterOutlet } from "./page-router-outlet"; +export { NSEmptyOutletComponent } from "./ns-empty-outlet.component"; +export { NSLocationStrategy } from "./ns-location-strategy"; const ROUTER_DIRECTIVES = [NSRouterLink, NSRouterLinkActive, PageRouterOutlet, NSEmptyOutletComponent]; diff --git a/ng-sample/package.json b/ng-sample/package.json index 8dbf3d5ae..3ee18ca2e 100644 --- a/ng-sample/package.json +++ b/ng-sample/package.json @@ -1,6 +1,9 @@ { "nativescript": { - "id": "org.nativescript.ngsample" + "id": "org.nativescript.ngsample", + "tns-ios": { + "version": "6.1.1" + } }, "name": "tns-template-hello-world", "main": "app.js", From 2ca7acdfc67d885ddab9610850021e1e15fe118d Mon Sep 17 00:00:00 2001 From: Teodor Bozhikov Date: Mon, 7 Oct 2019 19:31:57 +0300 Subject: [PATCH 03/35] save progress --- e2e/router-tab-view/package.json | 15 +++++++++------ e2e/single-page/package.json | 2 +- nativescript-angular-package/index.ts | 1 + .../nativescript.module.ts | 1 + nativescript-angular-package/package.json | 4 ++-- nativescript-angular-package/platform-static.ts | 1 + nativescript-angular-package/platform.ts | 1 + .../router/ns-location-strategy.ts | 1 + nativescript-angular-package/trace.ts | 1 + 9 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 nativescript-angular-package/index.ts create mode 100644 nativescript-angular-package/nativescript.module.ts create mode 100644 nativescript-angular-package/platform-static.ts create mode 100644 nativescript-angular-package/platform.ts create mode 100644 nativescript-angular-package/router/ns-location-strategy.ts create mode 100644 nativescript-angular-package/trace.ts diff --git a/e2e/router-tab-view/package.json b/e2e/router-tab-view/package.json index 4637596b4..d5f6327e5 100644 --- a/e2e/router-tab-view/package.json +++ b/e2e/router-tab-view/package.json @@ -4,7 +4,10 @@ "readme": "NativeScript Application", "repository": "", "nativescript": { - "id": "org.nativescript.routertabview" + "id": "org.nativescript.routertabview", + "tns-ios": { + "version": "6.1.1" + } }, "dependencies": { "@angular/animations": "~8.2.0", @@ -15,7 +18,7 @@ "@angular/platform-browser": "~8.2.0", "@angular/platform-browser-dynamic": "~8.2.0", "@angular/router": "~8.2.0", - "nativescript-angular": "file:../../nativescript-angular", + "nativescript-angular": "file:../../nativescript-angular-package", "nativescript-theme-core": "~1.0.4", "reflect-metadata": "~0.1.8", "rxjs": "^6.4.0", @@ -23,6 +26,8 @@ "zone.js": "^0.9.1" }, "devDependencies": { + "@angular/compiler-cli": "~8.2.0", + "@ngtools/webpack": "~8.2.0", "@types/chai": "~4.1.7", "@types/mocha": "~5.2.5", "@types/node": "~10.12.18", @@ -33,10 +38,8 @@ "mocha": "~5.2.0", "mochawesome": "~3.1.2", "nativescript-dev-appium": "^6.0.0", - "nativescript-dev-webpack": "next", - "typescript": "~3.5.3", - "@angular/compiler-cli": "~8.2.0", - "@ngtools/webpack": "~8.2.0" + "nativescript-dev-webpack": "^1.3.0-next-2019-10-02-144239-03", + "typescript": "~3.5.3" }, "scripts": { "e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json", diff --git a/e2e/single-page/package.json b/e2e/single-page/package.json index d04dc01e2..55719ded9 100644 --- a/e2e/single-page/package.json +++ b/e2e/single-page/package.json @@ -18,7 +18,7 @@ "@angular/platform-browser": "~8.2.0", "@angular/platform-browser-dynamic": "~8.2.0", "@angular/router": "~8.2.0", - "@nativescript/angular": "file:../../nativescript-angular", + "nativescript-angular": "file:../../nativescript-angular-package", "nativescript-intl": "^3.0.0", "reflect-metadata": "~0.1.8", "rxjs": "^6.4.0", diff --git a/nativescript-angular-package/index.ts b/nativescript-angular-package/index.ts new file mode 100644 index 000000000..2d2419d19 --- /dev/null +++ b/nativescript-angular-package/index.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/nativescript.module.ts b/nativescript-angular-package/nativescript.module.ts new file mode 100644 index 000000000..fc5956f1c --- /dev/null +++ b/nativescript-angular-package/nativescript.module.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/nativescript.module"; \ No newline at end of file diff --git a/nativescript-angular-package/package.json b/nativescript-angular-package/package.json index d833dbf91..43fecdadb 100644 --- a/nativescript-angular-package/package.json +++ b/nativescript-angular-package/package.json @@ -28,9 +28,9 @@ "url": "https://github.com/NativeScript/nativescript-angular.git" }, "bin": { - "update-app-ng-deps": "./bin/update-app-ng-deps" + "update-app-ng-deps": "node_modules/@nativescript/angular/bin/update-app-ng-deps" }, "dependencies": { "@nativescript/angular": "file:../nativescript-angular" } -} +} \ No newline at end of file diff --git a/nativescript-angular-package/platform-static.ts b/nativescript-angular-package/platform-static.ts new file mode 100644 index 000000000..e63c475ec --- /dev/null +++ b/nativescript-angular-package/platform-static.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/platform-static"; \ No newline at end of file diff --git a/nativescript-angular-package/platform.ts b/nativescript-angular-package/platform.ts new file mode 100644 index 000000000..7e8e49eee --- /dev/null +++ b/nativescript-angular-package/platform.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/platform"; \ No newline at end of file diff --git a/nativescript-angular-package/router/ns-location-strategy.ts b/nativescript-angular-package/router/ns-location-strategy.ts new file mode 100644 index 000000000..3d94eb407 --- /dev/null +++ b/nativescript-angular-package/router/ns-location-strategy.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/router/ns-location-strategy"; \ No newline at end of file diff --git a/nativescript-angular-package/trace.ts b/nativescript-angular-package/trace.ts new file mode 100644 index 000000000..87044475c --- /dev/null +++ b/nativescript-angular-package/trace.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/trace"; \ No newline at end of file From 55da9f35e2cbf62fc745c51f9ec5250cf576d2f6 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Tue, 8 Oct 2019 16:41:33 +0300 Subject: [PATCH 04/35] chore: make most of e2e apps work with the revamped older package --- e2e/animation-examples/package.json | 4 +- e2e/animation-examples/tsconfig.json | 3 + e2e/modal-navigation-ng/tsconfig.json | 3 + e2e/nested-router-tab-view/package.json | 7 +- e2e/nested-router-tab-view/tsconfig.json | 3 + e2e/renderer/package.json | 7 +- e2e/renderer/tsconfig.json | 3 + e2e/routable-animations/package.json | 7 +- e2e/routable-animations/tsconfig.json | 3 + e2e/router-tab-view/app/app.component.ts | 3 +- e2e/router-tab-view/app/app.module.ts | 3 +- e2e/router-tab-view/package.json | 7 +- e2e/router-tab-view/tsconfig.json | 3 + e2e/router/package.json | 7 +- e2e/router/tsconfig.json | 3 + .../animations/index.d.ts | 1 + .../animations/index.js | 6 + nativescript-angular-package/common.ts | 1 + .../directives/dialogs.ts | 1 + .../directives/index.d.ts | 1 + .../directives/index.js | 6 + .../file-system/ns-file-system.d.ts | 1 + .../file-system/ns-file-system.js | 6 + nativescript-angular-package/forms/index.d.ts | 1 + nativescript-angular-package/forms/index.js | 6 + .../forms/value-accessors/index.d.ts | 1 + .../forms/value-accessors/index.js | 6 + .../http-client/index.d.ts | 1 + .../http-client/index.js | 6 + nativescript-angular-package/index.d.ts | 1 + nativescript-angular-package/index.js | 6 + .../nativescript.module.d.ts | 1 + .../nativescript.module.js | 6 + nativescript-angular-package/package.json | 2 +- .../platform-static.d.ts | 1 + .../platform-static.js | 6 + nativescript-angular-package/platform.d.ts | 1 + nativescript-angular-package/platform.js | 6 + .../router/index.d.ts | 1 + nativescript-angular-package/router/index.js | 6 + .../router/ns-location-strategy.d.ts | 1 + .../router/ns-location-strategy.js | 6 + .../testing/index.d.ts | 15 +- nativescript-angular-package/testing/index.js | 34 +-- nativescript-angular-package/testing/index.ts | 30 +-- .../nativescript_test_component_renderer.d.ts | 8 +- .../nativescript_test_component_renderer.js | 28 +-- .../nativescript_test_component_renderer.ts | 20 +- .../testing/src/util.d.ts | 48 +---- .../testing/src/util.js | 184 +---------------- .../testing/src/util.ts | 193 +----------------- nativescript-angular-package/trace.d.ts | 1 + nativescript-angular-package/trace.js | 6 + nativescript-angular-package/tsconfig.json | 31 +++ .../value-accessors/base-value-accessor.d.ts | 1 + .../value-accessors/base-value-accessor.js | 8 + .../zone-js/testing.jasmine.d.ts | 4 +- .../zone-js/testing.jasmine.js | 5 + .../zone-js/testing.mocha.d.ts | 4 +- .../zone-js/testing.mocha.js | 4 + nativescript-angular/tsconfig.json | 16 +- 61 files changed, 221 insertions(+), 573 deletions(-) create mode 100644 nativescript-angular-package/animations/index.d.ts create mode 100644 nativescript-angular-package/animations/index.js create mode 100644 nativescript-angular-package/common.ts create mode 100644 nativescript-angular-package/directives/dialogs.ts create mode 100644 nativescript-angular-package/directives/index.d.ts create mode 100644 nativescript-angular-package/directives/index.js create mode 100644 nativescript-angular-package/file-system/ns-file-system.d.ts create mode 100644 nativescript-angular-package/file-system/ns-file-system.js create mode 100644 nativescript-angular-package/forms/index.d.ts create mode 100644 nativescript-angular-package/forms/index.js create mode 100644 nativescript-angular-package/forms/value-accessors/index.d.ts create mode 100644 nativescript-angular-package/forms/value-accessors/index.js create mode 100644 nativescript-angular-package/http-client/index.d.ts create mode 100644 nativescript-angular-package/http-client/index.js create mode 100644 nativescript-angular-package/index.d.ts create mode 100644 nativescript-angular-package/index.js create mode 100644 nativescript-angular-package/nativescript.module.d.ts create mode 100644 nativescript-angular-package/nativescript.module.js create mode 100644 nativescript-angular-package/platform-static.d.ts create mode 100644 nativescript-angular-package/platform-static.js create mode 100644 nativescript-angular-package/platform.d.ts create mode 100644 nativescript-angular-package/platform.js create mode 100644 nativescript-angular-package/router/index.d.ts create mode 100644 nativescript-angular-package/router/index.js create mode 100644 nativescript-angular-package/router/ns-location-strategy.d.ts create mode 100644 nativescript-angular-package/router/ns-location-strategy.js create mode 100644 nativescript-angular-package/trace.d.ts create mode 100644 nativescript-angular-package/trace.js create mode 100644 nativescript-angular-package/tsconfig.json create mode 100644 nativescript-angular-package/value-accessors/base-value-accessor.d.ts create mode 100644 nativescript-angular-package/value-accessors/base-value-accessor.js create mode 100644 nativescript-angular-package/zone-js/testing.jasmine.js create mode 100644 nativescript-angular-package/zone-js/testing.mocha.js diff --git a/e2e/animation-examples/package.json b/e2e/animation-examples/package.json index 1cece5d65..1406a75c5 100644 --- a/e2e/animation-examples/package.json +++ b/e2e/animation-examples/package.json @@ -6,7 +6,7 @@ "nativescript": { "id": "org.nativescript.ng4animations", "tns-ios": { - "version": "latest" + "version": "6.1.1" }, "tns-android": { "version": "latest" @@ -21,7 +21,7 @@ "@angular/platform-browser": "~8.2.0", "@angular/platform-browser-dynamic": "~8.2.0", "@angular/router": "~8.2.0", - "nativescript-angular": "file:../../nativescript-angular", + "nativescript-angular": "file:../../nativescript-angular-package", "nativescript-theme-core": "~1.0.2", "reflect-metadata": "~0.1.8", "rxjs": "^6.4.0", diff --git a/e2e/animation-examples/tsconfig.json b/e2e/animation-examples/tsconfig.json index d93d819b4..65295d0f2 100644 --- a/e2e/animation-examples/tsconfig.json +++ b/e2e/animation-examples/tsconfig.json @@ -23,10 +23,13 @@ } }, "include": [ + "../../nativescript-angular-package", "../../nativescript-angular", "**/*" ], "exclude": [ + "../../nativescript-angular-package/node_modules", + "../../nativescript-angular-package/**/*.d.ts", "../../nativescript-angular/node_modules", "../../nativescript-angular/**/*.d.ts", "node_modules", diff --git a/e2e/modal-navigation-ng/tsconfig.json b/e2e/modal-navigation-ng/tsconfig.json index d93d819b4..65295d0f2 100644 --- a/e2e/modal-navigation-ng/tsconfig.json +++ b/e2e/modal-navigation-ng/tsconfig.json @@ -23,10 +23,13 @@ } }, "include": [ + "../../nativescript-angular-package", "../../nativescript-angular", "**/*" ], "exclude": [ + "../../nativescript-angular-package/node_modules", + "../../nativescript-angular-package/**/*.d.ts", "../../nativescript-angular/node_modules", "../../nativescript-angular/**/*.d.ts", "node_modules", diff --git a/e2e/nested-router-tab-view/package.json b/e2e/nested-router-tab-view/package.json index caef1096f..4dadc8300 100644 --- a/e2e/nested-router-tab-view/package.json +++ b/e2e/nested-router-tab-view/package.json @@ -4,7 +4,10 @@ "readme": "NativeScript Application", "repository": "", "nativescript": { - "id": "org.nativescript.nestedroutertabview" + "id": "org.nativescript.nestedroutertabview", + "tns-ios": { + "version": "6.1.1" + } }, "dependencies": { "@angular/animations": "~8.2.0", @@ -15,7 +18,7 @@ "@angular/platform-browser": "~8.2.0", "@angular/platform-browser-dynamic": "~8.2.0", "@angular/router": "~8.2.0", - "nativescript-angular": "file:../../nativescript-angular", + "nativescript-angular": "file:../../nativescript-angular-package", "nativescript-theme-core": "~1.0.4", "reflect-metadata": "~0.1.8", "rxjs": "^6.4.0", diff --git a/e2e/nested-router-tab-view/tsconfig.json b/e2e/nested-router-tab-view/tsconfig.json index d93d819b4..65295d0f2 100644 --- a/e2e/nested-router-tab-view/tsconfig.json +++ b/e2e/nested-router-tab-view/tsconfig.json @@ -23,10 +23,13 @@ } }, "include": [ + "../../nativescript-angular-package", "../../nativescript-angular", "**/*" ], "exclude": [ + "../../nativescript-angular-package/node_modules", + "../../nativescript-angular-package/**/*.d.ts", "../../nativescript-angular/node_modules", "../../nativescript-angular/**/*.d.ts", "node_modules", diff --git a/e2e/renderer/package.json b/e2e/renderer/package.json index 16b90f954..dbb60c328 100644 --- a/e2e/renderer/package.json +++ b/e2e/renderer/package.json @@ -4,7 +4,10 @@ "readme": "NativeScript Application", "repository": "", "nativescript": { - "id": "org.nativescript.renderer" + "id": "org.nativescript.renderer", + "tns-ios": { + "version": "6.1.1" + } }, "dependencies": { "@angular/animations": "~8.2.0", @@ -15,7 +18,7 @@ "@angular/platform-browser": "~8.2.0", "@angular/platform-browser-dynamic": "~8.2.0", "@angular/router": "~8.2.0", - "nativescript-angular": "file:../../nativescript-angular", + "nativescript-angular": "file:../../nativescript-angular-package", "nativescript-theme-core": "~1.0.4", "reflect-metadata": "~0.1.8", "rxjs": "^6.4.0", diff --git a/e2e/renderer/tsconfig.json b/e2e/renderer/tsconfig.json index d93d819b4..65295d0f2 100644 --- a/e2e/renderer/tsconfig.json +++ b/e2e/renderer/tsconfig.json @@ -23,10 +23,13 @@ } }, "include": [ + "../../nativescript-angular-package", "../../nativescript-angular", "**/*" ], "exclude": [ + "../../nativescript-angular-package/node_modules", + "../../nativescript-angular-package/**/*.d.ts", "../../nativescript-angular/node_modules", "../../nativescript-angular/**/*.d.ts", "node_modules", diff --git a/e2e/routable-animations/package.json b/e2e/routable-animations/package.json index 98cd54e14..f5ee83e44 100644 --- a/e2e/routable-animations/package.json +++ b/e2e/routable-animations/package.json @@ -4,7 +4,10 @@ "readme": "NativeScript Application", "repository": "", "nativescript": { - "id": "org.nativescript.nsroanimations" + "id": "org.nativescript.nsroanimations", + "tns-ios": { + "version": "6.1.1" + } }, "dependencies": { "@angular/animations": "~8.2.0", @@ -15,7 +18,7 @@ "@angular/platform-browser": "~8.2.0", "@angular/platform-browser-dynamic": "~8.2.0", "@angular/router": "~8.2.0", - "nativescript-angular": "next", + "nativescript-angular": "file:../../nativescript-angular-package", "nativescript-theme-core": "~1.0.2", "reflect-metadata": "~0.1.8", "rxjs": "^6.4.0", diff --git a/e2e/routable-animations/tsconfig.json b/e2e/routable-animations/tsconfig.json index d93d819b4..65295d0f2 100644 --- a/e2e/routable-animations/tsconfig.json +++ b/e2e/routable-animations/tsconfig.json @@ -23,10 +23,13 @@ } }, "include": [ + "../../nativescript-angular-package", "../../nativescript-angular", "**/*" ], "exclude": [ + "../../nativescript-angular-package/node_modules", + "../../nativescript-angular-package/**/*.d.ts", "../../nativescript-angular/node_modules", "../../nativescript-angular/**/*.d.ts", "node_modules", diff --git a/e2e/router-tab-view/app/app.component.ts b/e2e/router-tab-view/app/app.component.ts index 7c18980d7..20ccd80c4 100644 --- a/e2e/router-tab-view/app/app.component.ts +++ b/e2e/router-tab-view/app/app.component.ts @@ -1,9 +1,8 @@ -import { Component, OnInit, AfterViewInit, AfterContentInit, ViewChild } from "@angular/core"; +import { Component, ViewChild } from "@angular/core"; import { TabViewDirective } from "nativescript-angular/directives"; import { Router, NavigationEnd } from "@angular/router"; import { NSLocationStrategy } from "nativescript-angular/router/ns-location-strategy"; - @Component({ selector: "ns-app", templateUrl: "app.component.html", diff --git a/e2e/router-tab-view/app/app.module.ts b/e2e/router-tab-view/app/app.module.ts index 7f98a48a2..532eb125e 100644 --- a/e2e/router-tab-view/app/app.module.ts +++ b/e2e/router-tab-view/app/app.module.ts @@ -5,8 +5,7 @@ import { AppComponent } from "./app.component"; import { DataService } from "./data.service"; -import { enable as traceEnable, addCategories } from "tns-core-modules/trace"; -import { routerTraceCategory } from "nativescript-angular/trace"; +import { enable as traceEnable } from "tns-core-modules/trace"; // addCategories(routerTraceCategory); traceEnable(); diff --git a/e2e/router-tab-view/package.json b/e2e/router-tab-view/package.json index d5f6327e5..3dd3759ca 100644 --- a/e2e/router-tab-view/package.json +++ b/e2e/router-tab-view/package.json @@ -26,8 +26,8 @@ "zone.js": "^0.9.1" }, "devDependencies": { - "@angular/compiler-cli": "~8.2.0", - "@ngtools/webpack": "~8.2.0", + "@angular/compiler-cli": "8.2.0", + "@ngtools/webpack": "8.2.0", "@types/chai": "~4.1.7", "@types/mocha": "~5.2.5", "@types/node": "~10.12.18", @@ -43,6 +43,7 @@ }, "scripts": { "e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json", - "compile-tests": "tsc -p e2e --watch" + "compile-tests": "tsc -p e2e --watch", + "update-app-ng-deps": "update-app-ng-deps" } } diff --git a/e2e/router-tab-view/tsconfig.json b/e2e/router-tab-view/tsconfig.json index d93d819b4..65295d0f2 100644 --- a/e2e/router-tab-view/tsconfig.json +++ b/e2e/router-tab-view/tsconfig.json @@ -23,10 +23,13 @@ } }, "include": [ + "../../nativescript-angular-package", "../../nativescript-angular", "**/*" ], "exclude": [ + "../../nativescript-angular-package/node_modules", + "../../nativescript-angular-package/**/*.d.ts", "../../nativescript-angular/node_modules", "../../nativescript-angular/**/*.d.ts", "node_modules", diff --git a/e2e/router/package.json b/e2e/router/package.json index 65d8c663c..0e9615bca 100644 --- a/e2e/router/package.json +++ b/e2e/router/package.json @@ -4,7 +4,10 @@ "readme": "NativeScript Application", "repository": "", "nativescript": { - "id": "org.nativescript.router" + "id": "org.nativescript.router", + "tns-ios": { + "version": "6.1.1" + } }, "dependencies": { "@angular/animations": "~8.2.0", @@ -15,7 +18,7 @@ "@angular/platform-browser": "~8.2.0", "@angular/platform-browser-dynamic": "~8.2.0", "@angular/router": "~8.2.0", - "nativescript-angular": "file:../../nativescript-angular", + "nativescript-angular": "file:../../nativescript-angular-package", "nativescript-intl": "^3.0.0", "reflect-metadata": "~0.1.8", "rxjs": "^6.4.0", diff --git a/e2e/router/tsconfig.json b/e2e/router/tsconfig.json index d93d819b4..65295d0f2 100644 --- a/e2e/router/tsconfig.json +++ b/e2e/router/tsconfig.json @@ -23,10 +23,13 @@ } }, "include": [ + "../../nativescript-angular-package", "../../nativescript-angular", "**/*" ], "exclude": [ + "../../nativescript-angular-package/node_modules", + "../../nativescript-angular-package/**/*.d.ts", "../../nativescript-angular/node_modules", "../../nativescript-angular/**/*.d.ts", "node_modules", diff --git a/nativescript-angular-package/animations/index.d.ts b/nativescript-angular-package/animations/index.d.ts new file mode 100644 index 000000000..22c163ab5 --- /dev/null +++ b/nativescript-angular-package/animations/index.d.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/animations"; diff --git a/nativescript-angular-package/animations/index.js b/nativescript-angular-package/animations/index.js new file mode 100644 index 000000000..88c23833a --- /dev/null +++ b/nativescript-angular-package/animations/index.js @@ -0,0 +1,6 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("@nativescript/angular/animations")); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/common.ts b/nativescript-angular-package/common.ts new file mode 100644 index 000000000..8734f5c94 --- /dev/null +++ b/nativescript-angular-package/common.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/common"; \ No newline at end of file diff --git a/nativescript-angular-package/directives/dialogs.ts b/nativescript-angular-package/directives/dialogs.ts new file mode 100644 index 000000000..f7aa4b95b --- /dev/null +++ b/nativescript-angular-package/directives/dialogs.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/directives/dialogs"; \ No newline at end of file diff --git a/nativescript-angular-package/directives/index.d.ts b/nativescript-angular-package/directives/index.d.ts new file mode 100644 index 000000000..11ddf0fbc --- /dev/null +++ b/nativescript-angular-package/directives/index.d.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/directives"; diff --git a/nativescript-angular-package/directives/index.js b/nativescript-angular-package/directives/index.js new file mode 100644 index 000000000..53c96fb1a --- /dev/null +++ b/nativescript-angular-package/directives/index.js @@ -0,0 +1,6 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("@nativescript/angular/directives")); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/file-system/ns-file-system.d.ts b/nativescript-angular-package/file-system/ns-file-system.d.ts new file mode 100644 index 000000000..72ca4fd50 --- /dev/null +++ b/nativescript-angular-package/file-system/ns-file-system.d.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/file-system/ns-file-system"; diff --git a/nativescript-angular-package/file-system/ns-file-system.js b/nativescript-angular-package/file-system/ns-file-system.js new file mode 100644 index 000000000..d76860636 --- /dev/null +++ b/nativescript-angular-package/file-system/ns-file-system.js @@ -0,0 +1,6 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("@nativescript/angular/file-system/ns-file-system")); +//# sourceMappingURL=ns-file-system.js.map \ No newline at end of file diff --git a/nativescript-angular-package/forms/index.d.ts b/nativescript-angular-package/forms/index.d.ts new file mode 100644 index 000000000..eb2a2e738 --- /dev/null +++ b/nativescript-angular-package/forms/index.d.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/forms"; diff --git a/nativescript-angular-package/forms/index.js b/nativescript-angular-package/forms/index.js new file mode 100644 index 000000000..d2e7e160d --- /dev/null +++ b/nativescript-angular-package/forms/index.js @@ -0,0 +1,6 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("@nativescript/angular/forms")); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/forms/value-accessors/index.d.ts b/nativescript-angular-package/forms/value-accessors/index.d.ts new file mode 100644 index 000000000..6c194379f --- /dev/null +++ b/nativescript-angular-package/forms/value-accessors/index.d.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/forms/value-accessors"; diff --git a/nativescript-angular-package/forms/value-accessors/index.js b/nativescript-angular-package/forms/value-accessors/index.js new file mode 100644 index 000000000..f069f68a1 --- /dev/null +++ b/nativescript-angular-package/forms/value-accessors/index.js @@ -0,0 +1,6 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("@nativescript/angular/forms/value-accessors")); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/http-client/index.d.ts b/nativescript-angular-package/http-client/index.d.ts new file mode 100644 index 000000000..fdc589afb --- /dev/null +++ b/nativescript-angular-package/http-client/index.d.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/http-client"; diff --git a/nativescript-angular-package/http-client/index.js b/nativescript-angular-package/http-client/index.js new file mode 100644 index 000000000..643a1c99c --- /dev/null +++ b/nativescript-angular-package/http-client/index.js @@ -0,0 +1,6 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("@nativescript/angular/http-client")); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/index.d.ts b/nativescript-angular-package/index.d.ts new file mode 100644 index 000000000..053585d6a --- /dev/null +++ b/nativescript-angular-package/index.d.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular"; diff --git a/nativescript-angular-package/index.js b/nativescript-angular-package/index.js new file mode 100644 index 000000000..213789b35 --- /dev/null +++ b/nativescript-angular-package/index.js @@ -0,0 +1,6 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("@nativescript/angular")); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/nativescript.module.d.ts b/nativescript-angular-package/nativescript.module.d.ts new file mode 100644 index 000000000..14f180d77 --- /dev/null +++ b/nativescript-angular-package/nativescript.module.d.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/nativescript.module"; diff --git a/nativescript-angular-package/nativescript.module.js b/nativescript-angular-package/nativescript.module.js new file mode 100644 index 000000000..c7fd7e7c9 --- /dev/null +++ b/nativescript-angular-package/nativescript.module.js @@ -0,0 +1,6 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("@nativescript/angular/nativescript.module")); +//# sourceMappingURL=nativescript.module.js.map \ No newline at end of file diff --git a/nativescript-angular-package/package.json b/nativescript-angular-package/package.json index 43fecdadb..237ecf9a5 100644 --- a/nativescript-angular-package/package.json +++ b/nativescript-angular-package/package.json @@ -33,4 +33,4 @@ "dependencies": { "@nativescript/angular": "file:../nativescript-angular" } -} \ No newline at end of file +} diff --git a/nativescript-angular-package/platform-static.d.ts b/nativescript-angular-package/platform-static.d.ts new file mode 100644 index 000000000..2f00f47df --- /dev/null +++ b/nativescript-angular-package/platform-static.d.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/platform-static"; diff --git a/nativescript-angular-package/platform-static.js b/nativescript-angular-package/platform-static.js new file mode 100644 index 000000000..d964e5e48 --- /dev/null +++ b/nativescript-angular-package/platform-static.js @@ -0,0 +1,6 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("@nativescript/angular/platform-static")); +//# sourceMappingURL=platform-static.js.map \ No newline at end of file diff --git a/nativescript-angular-package/platform.d.ts b/nativescript-angular-package/platform.d.ts new file mode 100644 index 000000000..9dc2cb01d --- /dev/null +++ b/nativescript-angular-package/platform.d.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/platform"; diff --git a/nativescript-angular-package/platform.js b/nativescript-angular-package/platform.js new file mode 100644 index 000000000..fd8886184 --- /dev/null +++ b/nativescript-angular-package/platform.js @@ -0,0 +1,6 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("@nativescript/angular/platform")); +//# sourceMappingURL=platform.js.map \ No newline at end of file diff --git a/nativescript-angular-package/router/index.d.ts b/nativescript-angular-package/router/index.d.ts new file mode 100644 index 000000000..77b052733 --- /dev/null +++ b/nativescript-angular-package/router/index.d.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/router"; diff --git a/nativescript-angular-package/router/index.js b/nativescript-angular-package/router/index.js new file mode 100644 index 000000000..e89617aa4 --- /dev/null +++ b/nativescript-angular-package/router/index.js @@ -0,0 +1,6 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("@nativescript/angular/router")); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/router/ns-location-strategy.d.ts b/nativescript-angular-package/router/ns-location-strategy.d.ts new file mode 100644 index 000000000..24a9e237b --- /dev/null +++ b/nativescript-angular-package/router/ns-location-strategy.d.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/router/ns-location-strategy"; diff --git a/nativescript-angular-package/router/ns-location-strategy.js b/nativescript-angular-package/router/ns-location-strategy.js new file mode 100644 index 000000000..a5b0855e1 --- /dev/null +++ b/nativescript-angular-package/router/ns-location-strategy.js @@ -0,0 +1,6 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("@nativescript/angular/router/ns-location-strategy")); +//# sourceMappingURL=ns-location-strategy.js.map \ No newline at end of file diff --git a/nativescript-angular-package/testing/index.d.ts b/nativescript-angular-package/testing/index.d.ts index b64f8eedc..081f86727 100644 --- a/nativescript-angular-package/testing/index.d.ts +++ b/nativescript-angular-package/testing/index.d.ts @@ -1,14 +1 @@ -export * from "./src/util"; -/** - * Providers array is exported for cases where a custom module has to be constructed - * to test a particular piece of code. This can happen, for example, if you are trying - * to test dynamic component loading and need to specify an entryComponent for the testing - * module. - */ -export declare const NATIVESCRIPT_TESTING_PROVIDERS: any[]; -/** - * NativeScript testing support module. Enables use of TestBed for angular components, directives, - * pipes, and services. - */ -export declare class NativeScriptTestingModule { -} +export * from "@nativescript/angular/testing"; diff --git a/nativescript-angular-package/testing/index.js b/nativescript-angular-package/testing/index.js index abead4076..8cc533f24 100644 --- a/nativescript-angular-package/testing/index.js +++ b/nativescript-angular-package/testing/index.js @@ -2,37 +2,5 @@ function __export(m) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } Object.defineProperty(exports, "__esModule", { value: true }); -var core_1 = require("@angular/core"); -var testing_1 = require("@angular/core/testing"); -var nativescript_test_component_renderer_1 = require("./src/nativescript_test_component_renderer"); -var platform_common_1 = require("../platform-common"); -var platform_providers_1 = require("../platform-providers"); -var util_1 = require("./src/util"); -__export(require("./src/util")); -/** - * Providers array is exported for cases where a custom module has to be constructed - * to test a particular piece of code. This can happen, for example, if you are trying - * to test dynamic component loading and need to specify an entryComponent for the testing - * module. - */ -exports.NATIVESCRIPT_TESTING_PROVIDERS = [ - platform_common_1.COMMON_PROVIDERS, - { provide: platform_providers_1.APP_ROOT_VIEW, useFactory: util_1.testingRootView }, - { provide: testing_1.TestComponentRenderer, useClass: nativescript_test_component_renderer_1.NativeScriptTestComponentRenderer }, -]; -/** - * NativeScript testing support module. Enables use of TestBed for angular components, directives, - * pipes, and services. - */ -var NativeScriptTestingModule = /** @class */ (function () { - function NativeScriptTestingModule() { - } - NativeScriptTestingModule = __decorate([ - core_1.NgModule({ - providers: exports.NATIVESCRIPT_TESTING_PROVIDERS - }) - ], NativeScriptTestingModule); - return NativeScriptTestingModule; -}()); -exports.NativeScriptTestingModule = NativeScriptTestingModule; +__export(require("@nativescript/angular/testing")); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/testing/index.ts b/nativescript-angular-package/testing/index.ts index d8d00bbe6..3939f9dd3 100644 --- a/nativescript-angular-package/testing/index.ts +++ b/nativescript-angular-package/testing/index.ts @@ -1,29 +1 @@ -import { NgModule } from "@angular/core"; -import { TestComponentRenderer } from "@angular/core/testing"; -import { NativeScriptTestComponentRenderer } from "./src/nativescript_test_component_renderer"; -import { COMMON_PROVIDERS } from "../platform-common"; -import { APP_ROOT_VIEW } from "../platform-providers"; -import { testingRootView } from "./src/util"; -export * from "./src/util"; - -/** - * Providers array is exported for cases where a custom module has to be constructed - * to test a particular piece of code. This can happen, for example, if you are trying - * to test dynamic component loading and need to specify an entryComponent for the testing - * module. - */ -export const NATIVESCRIPT_TESTING_PROVIDERS: any[] = [ - COMMON_PROVIDERS, - {provide: APP_ROOT_VIEW, useFactory: testingRootView}, - {provide: TestComponentRenderer, useClass: NativeScriptTestComponentRenderer}, -]; - -/** - * NativeScript testing support module. Enables use of TestBed for angular components, directives, - * pipes, and services. - */ -@NgModule({ - providers: NATIVESCRIPT_TESTING_PROVIDERS -}) -export class NativeScriptTestingModule { -} +export * from "@nativescript/angular/testing" \ No newline at end of file diff --git a/nativescript-angular-package/testing/src/nativescript_test_component_renderer.d.ts b/nativescript-angular-package/testing/src/nativescript_test_component_renderer.d.ts index a6a23a2ab..3693f4083 100644 --- a/nativescript-angular-package/testing/src/nativescript_test_component_renderer.d.ts +++ b/nativescript-angular-package/testing/src/nativescript_test_component_renderer.d.ts @@ -1,7 +1 @@ -import { TestComponentRenderer } from "@angular/core/testing"; -/** - * A NativeScript based implementation of the TestComponentRenderer. - */ -export declare class NativeScriptTestComponentRenderer extends TestComponentRenderer { - insertRootElement(rootElId: string): void; -} +export * from "@nativescript/angular/testing/src/nativescript_test_component_renderer"; diff --git a/nativescript-angular-package/testing/src/nativescript_test_component_renderer.js b/nativescript-angular-package/testing/src/nativescript_test_component_renderer.js index df91149f4..be0b3e9c5 100644 --- a/nativescript-angular-package/testing/src/nativescript_test_component_renderer.js +++ b/nativescript-angular-package/testing/src/nativescript_test_component_renderer.js @@ -1,26 +1,6 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} Object.defineProperty(exports, "__esModule", { value: true }); -var core_1 = require("@angular/core"); -var testing_1 = require("@angular/core/testing"); -var proxy_view_container_1 = require("tns-core-modules/ui/proxy-view-container"); -var util_1 = require("./util"); -/** - * A NativeScript based implementation of the TestComponentRenderer. - */ -var NativeScriptTestComponentRenderer = /** @class */ (function (_super) { - __extends(NativeScriptTestComponentRenderer, _super); - function NativeScriptTestComponentRenderer() { - return _super !== null && _super.apply(this, arguments) || this; - } - NativeScriptTestComponentRenderer.prototype.insertRootElement = function (rootElId) { - var layout = new proxy_view_container_1.ProxyViewContainer(); - layout.id = rootElId; - var rootLayout = util_1.testingRootView(); - rootLayout.addChild(layout); - }; - NativeScriptTestComponentRenderer = __decorate([ - core_1.Injectable() - ], NativeScriptTestComponentRenderer); - return NativeScriptTestComponentRenderer; -}(testing_1.TestComponentRenderer)); -exports.NativeScriptTestComponentRenderer = NativeScriptTestComponentRenderer; +__export(require("@nativescript/angular/testing/src/nativescript_test_component_renderer")); //# sourceMappingURL=nativescript_test_component_renderer.js.map \ No newline at end of file diff --git a/nativescript-angular-package/testing/src/nativescript_test_component_renderer.ts b/nativescript-angular-package/testing/src/nativescript_test_component_renderer.ts index 87ad55660..f06c592a4 100644 --- a/nativescript-angular-package/testing/src/nativescript_test_component_renderer.ts +++ b/nativescript-angular-package/testing/src/nativescript_test_component_renderer.ts @@ -1,19 +1 @@ -import { Injectable } from "@angular/core"; -import { TestComponentRenderer } from "@angular/core/testing"; -import { ProxyViewContainer } from "tns-core-modules/ui/proxy-view-container"; -import { testingRootView } from "./util"; - -/** - * A NativeScript based implementation of the TestComponentRenderer. - */ -@Injectable() -export class NativeScriptTestComponentRenderer extends TestComponentRenderer { - - insertRootElement(rootElId: string) { - const layout = new ProxyViewContainer(); - layout.id = rootElId; - - const rootLayout = testingRootView(); - rootLayout.addChild(layout); - } -} +export * from "@nativescript/angular/testing/src/nativescript_test_component_renderer"; \ No newline at end of file diff --git a/nativescript-angular-package/testing/src/util.d.ts b/nativescript-angular-package/testing/src/util.d.ts index 7aa6bcae5..42234d6e5 100644 --- a/nativescript-angular-package/testing/src/util.d.ts +++ b/nativescript-angular-package/testing/src/util.d.ts @@ -1,47 +1 @@ -import { LayoutBase } from "tns-core-modules/ui/layouts/layout-base"; -import { ComponentFixture } from "@angular/core/testing"; -import { Type } from "@angular/core"; -/** - * Get a reference to the fixtures container. - */ -export declare function testingRootView(): LayoutBase; -/** - * Return a promise that resolves after (durationMs) milliseconds - */ -export declare function promiseWait(durationMs: number): () => Promise<{}>; -/** - * Perform basic TestBed environment initialization. Call this once in the main entry point to your tests. - */ -export declare function nsTestBedInit(): void; -/** - * Helper for configuring a TestBed instance for rendering components for test. Ideally this - * would not be needed, and in truth it's just a wrapper to eliminate some boilerplate. It - * exists because when you need to specify `entryComponents` for a test the setup becomes quite - * a bit more complex than if you're just doing a basic component test. - * - * More about entryComponents complexity: https://github.com/angular/angular/issues/12079 - * - * Use: - * ``` - * beforeEach(nsTestBedBeforeEach([MyComponent,MyFailComponent])); - * ``` - * - * **NOTE*** Remember to pair with {@see nsTestBedAfterEach} - * - * @param components Any components that you will create during the test - * @param providers Any services your tests depend on - * @param imports Any module imports your tests depend on - * @param entryComponents Any entry components that your tests depend on - */ -export declare function nsTestBedBeforeEach(components: any[], providers?: any[], imports?: any[], entryComponents?: any[]): (done: any) => void; -/** - * Helper for a basic component TestBed clean up. - * @param resetEnv When true the testing environment will be reset - * @param resetFn When resetting the environment, use this init function - */ -export declare function nsTestBedAfterEach(resetEnv?: boolean, resetFn?: typeof nsTestBedInit): () => void; -/** - * Render a component using the TestBed helper, and return a promise that resolves when the - * ComponentFixture is fully initialized. - */ -export declare function nsTestBedRender(componentType: Type): Promise>; +export * from "@nativescript/angular/testing/src/util"; diff --git a/nativescript-angular-package/testing/src/util.js b/nativescript-angular-package/testing/src/util.js index 55329ffff..6b092e87f 100644 --- a/nativescript-angular-package/testing/src/util.js +++ b/nativescript-angular-package/testing/src/util.js @@ -1,182 +1,6 @@ -Object.defineProperty(exports, "__esModule", { value: true }); -var frame_1 = require("tns-core-modules/ui/frame"); -var testing_1 = require("@angular/core/testing"); -var core_1 = require("@angular/core"); -var nativescript_module_1 = require("../../nativescript.module"); -var testing_2 = require("@angular/platform-browser-dynamic/testing"); -var platform_1 = require("../../platform"); -var index_1 = require("../index"); -var common_1 = require("@angular/common"); -var grid_layout_1 = require("tns-core-modules/ui/layouts/grid-layout"); -var TESTING_ROOT_ID = "__testing_container"; -/** - * Get a reference to the fixtures container. - */ -function testingRootView() { - var rootPageLayout = frame_1.topmost().currentPage.content; - var testingRoot; - rootPageLayout.eachChild(function (child) { - if (child.id === TESTING_ROOT_ID) { - testingRoot = child; - return false; - } - return true; - }); - if (!testingRoot) { - testingRoot = new grid_layout_1.GridLayout(); - testingRoot.id = TESTING_ROOT_ID; - grid_layout_1.GridLayout.setColumnSpan(testingRoot, 100); - grid_layout_1.GridLayout.setRowSpan(testingRoot, 100); - rootPageLayout.addChild(testingRoot); - } - return testingRoot; -} -exports.testingRootView = testingRootView; -/** - * Declared test contexts. When the suite is done this map should be empty if all lifecycle - * calls have happened as expected. - * @private - */ -var activeTestFixtures = []; -/** - * Return a promise that resolves after (durationMs) milliseconds - */ -function promiseWait(durationMs) { - return function () { return new Promise(function (resolve) { return setTimeout(function () { return resolve(); }, durationMs); }); }; -} -exports.promiseWait = promiseWait; -/** - * Perform basic TestBed environment initialization. Call this once in the main entry point to your tests. - */ -function nsTestBedInit() { - testing_1.TestBed.initTestEnvironment(index_1.NativeScriptTestingModule, testing_2.platformBrowserDynamicTesting(platform_1.NS_COMPILER_PROVIDERS)); -} -exports.nsTestBedInit = nsTestBedInit; -/** - * Helper for configuring a TestBed instance for rendering components for test. Ideally this - * would not be needed, and in truth it's just a wrapper to eliminate some boilerplate. It - * exists because when you need to specify `entryComponents` for a test the setup becomes quite - * a bit more complex than if you're just doing a basic component test. - * - * More about entryComponents complexity: https://github.com/angular/angular/issues/12079 - * - * Use: - * ``` - * beforeEach(nsTestBedBeforeEach([MyComponent,MyFailComponent])); - * ``` - * - * **NOTE*** Remember to pair with {@see nsTestBedAfterEach} - * - * @param components Any components that you will create during the test - * @param providers Any services your tests depend on - * @param imports Any module imports your tests depend on - * @param entryComponents Any entry components that your tests depend on - */ -function nsTestBedBeforeEach(components, providers, imports, entryComponents) { - if (providers === void 0) { providers = []; } - if (imports === void 0) { imports = []; } - if (entryComponents === void 0) { entryComponents = []; } - return function (done) { - activeTestFixtures.push([]); - // If there are no entry components we can take the simple path. - if (entryComponents.length === 0) { - testing_1.TestBed.configureTestingModule({ - declarations: components.slice(), - providers: providers.slice(), - imports: [nativescript_module_1.NativeScriptModule].concat(imports) - }); - } - else { - // If there are entry components, we have to reset the testing platform. - // - // There's got to be a better way... (o_O) - testing_1.TestBed.resetTestEnvironment(); - var EntryComponentsTestModule = /** @class */ (function () { - function EntryComponentsTestModule() { - } - EntryComponentsTestModule = __decorate([ - core_1.NgModule({ - declarations: entryComponents, - exports: entryComponents, - entryComponents: entryComponents - }) - ], EntryComponentsTestModule); - return EntryComponentsTestModule; - }()); - testing_1.TestBed.initTestEnvironment(EntryComponentsTestModule, testing_2.platformBrowserDynamicTesting(platform_1.NS_COMPILER_PROVIDERS)); - testing_1.TestBed.configureTestingModule({ - declarations: components, - imports: [ - nativescript_module_1.NativeScriptModule, index_1.NativeScriptTestingModule, common_1.CommonModule - ].concat(imports), - providers: providers.concat(index_1.NATIVESCRIPT_TESTING_PROVIDERS), - }); - } - testing_1.TestBed.compileComponents() - .then(function () { return done(); }) - .catch(function (e) { - console.log("Failed to instantiate test component with error: " + e); - console.log(e.stack); - done(); - }); - }; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } -exports.nsTestBedBeforeEach = nsTestBedBeforeEach; -/** - * Helper for a basic component TestBed clean up. - * @param resetEnv When true the testing environment will be reset - * @param resetFn When resetting the environment, use this init function - */ -function nsTestBedAfterEach(resetEnv, resetFn) { - if (resetEnv === void 0) { resetEnv = true; } - if (resetFn === void 0) { resetFn = nsTestBedInit; } - return function () { - if (activeTestFixtures.length === 0) { - throw new Error("There are no more declared fixtures." + - "Did you call \"nsTestBedBeforeEach\" and \"nsTestBedAfterEach\" an equal number of times?"); - } - var root = testingRootView(); - var fixtures = activeTestFixtures.pop(); - fixtures.forEach(function (fixture) { - var fixtureView = fixture.nativeElement; - if (fixtureView.parent === root) { - root.removeChild(fixtureView); - } - fixture.destroy(); - }); - testing_1.TestBed.resetTestingModule(); - if (resetEnv) { - testing_1.TestBed.resetTestEnvironment(); - resetFn(); - } - }; -} -exports.nsTestBedAfterEach = nsTestBedAfterEach; -/** - * Render a component using the TestBed helper, and return a promise that resolves when the - * ComponentFixture is fully initialized. - */ -function nsTestBedRender(componentType) { - var fixture = testing_1.TestBed.createComponent(componentType); - fixture.detectChanges(); - return fixture.whenRenderingDone() - // TODO(jd): it seems that the whenStable and whenRenderingDone utilities of ComponentFixture - // do not work as expected. I looked at how to fix it and it's not clear how to provide - // a {N} specific subclass, because ComponentFixture is newed directly rather than injected - // What to do about it? Maybe fakeAsync can help? For now just setTimeout for 100ms (x_X) - .then(promiseWait(100)) - .then(function () { - var list = activeTestFixtures[activeTestFixtures.length - 1]; - if (!list) { - console.warn("nsTestBedRender called without nsTestBedBeforeEach/nsTestBedAfter each. " + - "You are responsible for calling 'fixture.destroy()' when your test is done " + - "in order to clean up the components that are created."); - } - else { - list.push(fixture); - } - return fixture; - }); -} -exports.nsTestBedRender = nsTestBedRender; +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("@nativescript/angular/testing/src/util")); //# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/nativescript-angular-package/testing/src/util.ts b/nativescript-angular-package/testing/src/util.ts index 5f2e514b8..42234d6e5 100644 --- a/nativescript-angular-package/testing/src/util.ts +++ b/nativescript-angular-package/testing/src/util.ts @@ -1,192 +1 @@ - -import { View } from "tns-core-modules/ui/core/view"; -import { topmost } from "tns-core-modules/ui/frame"; -import { LayoutBase } from "tns-core-modules/ui/layouts/layout-base"; -import { ComponentFixture, TestBed } from "@angular/core/testing"; -import { NgModule, Type } from "@angular/core"; -import { NativeScriptModule } from "../../nativescript.module"; -import { platformBrowserDynamicTesting } from "@angular/platform-browser-dynamic/testing"; -import { NS_COMPILER_PROVIDERS } from "../../platform"; -import { NATIVESCRIPT_TESTING_PROVIDERS, NativeScriptTestingModule } from "../index"; -import { CommonModule } from "@angular/common"; -import { GridLayout } from "tns-core-modules/ui/layouts/grid-layout"; - -const TESTING_ROOT_ID = "__testing_container"; - -/** - * Get a reference to the fixtures container. - */ -export function testingRootView(): LayoutBase { - const rootPageLayout = topmost().currentPage.content as LayoutBase; - - let testingRoot: LayoutBase; - rootPageLayout.eachChild(child => { - if (child.id === TESTING_ROOT_ID) { - testingRoot = child as LayoutBase; - return false; - } - return true; - }); - - if (!testingRoot) { - testingRoot = new GridLayout(); - testingRoot.id = TESTING_ROOT_ID; - GridLayout.setColumnSpan(testingRoot, 100); - GridLayout.setRowSpan(testingRoot, 100); - rootPageLayout.addChild(testingRoot); - } - - return testingRoot; -} - - -/** - * Declared test contexts. When the suite is done this map should be empty if all lifecycle - * calls have happened as expected. - * @private - */ -const activeTestFixtures: ComponentFixture[][] = []; - -/** - * Return a promise that resolves after (durationMs) milliseconds - */ -export function promiseWait(durationMs: number) { - return () => new Promise((resolve) => setTimeout(() => resolve(), durationMs)); -} - -/** - * Perform basic TestBed environment initialization. Call this once in the main entry point to your tests. - */ -export function nsTestBedInit() { - TestBed.initTestEnvironment( - NativeScriptTestingModule, - platformBrowserDynamicTesting(NS_COMPILER_PROVIDERS) - ); -} - -/** - * Helper for configuring a TestBed instance for rendering components for test. Ideally this - * would not be needed, and in truth it's just a wrapper to eliminate some boilerplate. It - * exists because when you need to specify `entryComponents` for a test the setup becomes quite - * a bit more complex than if you're just doing a basic component test. - * - * More about entryComponents complexity: https://github.com/angular/angular/issues/12079 - * - * Use: - * ``` - * beforeEach(nsTestBedBeforeEach([MyComponent,MyFailComponent])); - * ``` - * - * **NOTE*** Remember to pair with {@see nsTestBedAfterEach} - * - * @param components Any components that you will create during the test - * @param providers Any services your tests depend on - * @param imports Any module imports your tests depend on - * @param entryComponents Any entry components that your tests depend on - */ -export function nsTestBedBeforeEach( - components: any[], - providers: any[] = [], - imports: any[] = [], - entryComponents: any[] = []) { - return (done) => { - activeTestFixtures.push([]); - // If there are no entry components we can take the simple path. - if (entryComponents.length === 0) { - TestBed.configureTestingModule({ - declarations: [...components], - providers: [...providers], - imports: [NativeScriptModule, ...imports] - }); - } else { - // If there are entry components, we have to reset the testing platform. - // - // There's got to be a better way... (o_O) - TestBed.resetTestEnvironment(); - @NgModule({ - declarations: entryComponents, - exports: entryComponents, - entryComponents: entryComponents - }) - class EntryComponentsTestModule { - } - TestBed.initTestEnvironment( - EntryComponentsTestModule, - platformBrowserDynamicTesting(NS_COMPILER_PROVIDERS) - ); - TestBed.configureTestingModule({ - declarations: components, - imports: [ - NativeScriptModule, NativeScriptTestingModule, CommonModule, - ...imports - ], - providers: [...providers, ...NATIVESCRIPT_TESTING_PROVIDERS], - }); - } - TestBed.compileComponents() - .then(() => done()) - .catch((e) => { - console.log(`Failed to instantiate test component with error: ${e}`); - console.log(e.stack); - done(); - }); - }; -} - -/** - * Helper for a basic component TestBed clean up. - * @param resetEnv When true the testing environment will be reset - * @param resetFn When resetting the environment, use this init function - */ -export function nsTestBedAfterEach(resetEnv = true, resetFn = nsTestBedInit) { - return () => { - if (activeTestFixtures.length === 0) { - throw new Error( - `There are no more declared fixtures.` + - `Did you call "nsTestBedBeforeEach" and "nsTestBedAfterEach" an equal number of times?` - ); - } - const root = testingRootView() as LayoutBase; - const fixtures = activeTestFixtures.pop(); - fixtures.forEach((fixture) => { - const fixtureView = fixture.nativeElement; - if (fixtureView.parent === root) { - root.removeChild(fixtureView); - } - fixture.destroy(); - }); - TestBed.resetTestingModule(); - if (resetEnv) { - TestBed.resetTestEnvironment(); - resetFn(); - } - }; -} - -/** - * Render a component using the TestBed helper, and return a promise that resolves when the - * ComponentFixture is fully initialized. - */ -export function nsTestBedRender(componentType: Type): Promise> { - const fixture = TestBed.createComponent(componentType); - fixture.detectChanges(); - return fixture.whenRenderingDone() - // TODO(jd): it seems that the whenStable and whenRenderingDone utilities of ComponentFixture - // do not work as expected. I looked at how to fix it and it's not clear how to provide - // a {N} specific subclass, because ComponentFixture is newed directly rather than injected - // What to do about it? Maybe fakeAsync can help? For now just setTimeout for 100ms (x_X) - .then(promiseWait(100)) - .then(() => { - const list = activeTestFixtures[activeTestFixtures.length - 1]; - if (!list) { - console.warn( - "nsTestBedRender called without nsTestBedBeforeEach/nsTestBedAfter each. " + - "You are responsible for calling 'fixture.destroy()' when your test is done " + - "in order to clean up the components that are created." - ); - } else { - list.push(fixture); - } - return fixture; - }); -} +export * from "@nativescript/angular/testing/src/util"; diff --git a/nativescript-angular-package/trace.d.ts b/nativescript-angular-package/trace.d.ts new file mode 100644 index 000000000..b84be0630 --- /dev/null +++ b/nativescript-angular-package/trace.d.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/trace"; diff --git a/nativescript-angular-package/trace.js b/nativescript-angular-package/trace.js new file mode 100644 index 000000000..a3a33b970 --- /dev/null +++ b/nativescript-angular-package/trace.js @@ -0,0 +1,6 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(require("@nativescript/angular/trace")); +//# sourceMappingURL=trace.js.map \ No newline at end of file diff --git a/nativescript-angular-package/tsconfig.json b/nativescript-angular-package/tsconfig.json new file mode 100644 index 000000000..903f75e65 --- /dev/null +++ b/nativescript-angular-package/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitUseStrict": true, + "noEmitHelpers": true, + "declaration": true, + "removeComments": false, + "noEmitOnError": true, + "noImplicitAny": false, + "lib": [ + "dom", + "es6", + "es2015.iterable" + ], + "baseUrl": "." + }, + "angularCompilerOptions": { + "genDir": ".", + "skipMetadataEmit": false, + "skipTemplateCodegen": true, + "strictMetadataEmit": true + }, + "include": [ + "**/*.ts" + ] +} diff --git a/nativescript-angular-package/value-accessors/base-value-accessor.d.ts b/nativescript-angular-package/value-accessors/base-value-accessor.d.ts new file mode 100644 index 000000000..70e0fa328 --- /dev/null +++ b/nativescript-angular-package/value-accessors/base-value-accessor.d.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/forms/value-accessors/base-value-accessor"; diff --git a/nativescript-angular-package/value-accessors/base-value-accessor.js b/nativescript-angular-package/value-accessors/base-value-accessor.js new file mode 100644 index 000000000..aec3a0abb --- /dev/null +++ b/nativescript-angular-package/value-accessors/base-value-accessor.js @@ -0,0 +1,8 @@ +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +// This file is only for compatibility with pre 4.4.0 releases. +// Please use "nativescript-angular/forms/value-accessors/base-value-accessor" +__export(require("@nativescript/angular/forms/value-accessors/base-value-accessor")); +//# sourceMappingURL=base-value-accessor.js.map \ No newline at end of file diff --git a/nativescript-angular-package/zone-js/testing.jasmine.d.ts b/nativescript-angular-package/zone-js/testing.jasmine.d.ts index 16b219e32..80c58274d 100644 --- a/nativescript-angular-package/zone-js/testing.jasmine.d.ts +++ b/nativescript-angular-package/zone-js/testing.jasmine.d.ts @@ -1,2 +1,2 @@ -import "../platform"; -import "./dist/zone-nativescript.jasmine.js"; +import "@nativescript/angular/platform"; +import "@nativescript/angular/dist/zone-nativescript.jasmine.js"; diff --git a/nativescript-angular-package/zone-js/testing.jasmine.js b/nativescript-angular-package/zone-js/testing.jasmine.js new file mode 100644 index 000000000..e280ced3c --- /dev/null +++ b/nativescript-angular-package/zone-js/testing.jasmine.js @@ -0,0 +1,5 @@ +Object.defineProperty(exports, "__esModule", { value: true }); +// Bootstrap helper module for jasmine spec tests +require("@nativescript/angular/platform"); +require("@nativescript/angular/dist/zone-nativescript.jasmine.js"); +//# sourceMappingURL=testing.jasmine.js.map \ No newline at end of file diff --git a/nativescript-angular-package/zone-js/testing.mocha.d.ts b/nativescript-angular-package/zone-js/testing.mocha.d.ts index 0f75b1d11..f91c4168b 100644 --- a/nativescript-angular-package/zone-js/testing.mocha.d.ts +++ b/nativescript-angular-package/zone-js/testing.mocha.d.ts @@ -1,2 +1,2 @@ -import "../platform"; -import "./dist/zone-nativescript.mocha.js"; +import "@nativescript/angular/platform"; +import "@nativescript/angular/dist/zone-nativescript.mocha.js"; diff --git a/nativescript-angular-package/zone-js/testing.mocha.js b/nativescript-angular-package/zone-js/testing.mocha.js new file mode 100644 index 000000000..07554f862 --- /dev/null +++ b/nativescript-angular-package/zone-js/testing.mocha.js @@ -0,0 +1,4 @@ +Object.defineProperty(exports, "__esModule", { value: true }); +require("@nativescript/angular/platform"); +require("@nativescript/angular/dist/zone-nativescript.mocha.js"); +//# sourceMappingURL=testing.mocha.js.map \ No newline at end of file diff --git a/nativescript-angular/tsconfig.json b/nativescript-angular/tsconfig.json index e8a09f283..79e3addf9 100644 --- a/nativescript-angular/tsconfig.json +++ b/nativescript-angular/tsconfig.json @@ -13,15 +13,19 @@ "noEmitOnError": true, "noImplicitAny": false, "lib": [ - "dom", - "es6", - "es2015.iterable" - ] + "dom", + "es6", + "es2015.iterable" + ], + "baseUrl": "." }, "angularCompilerOptions": { "genDir": ".", "skipMetadataEmit": false, "skipTemplateCodegen": true, "strictMetadataEmit": true - } -} + }, + "include": [ + "**/*.ts" + ] +} \ No newline at end of file From 1d640af5432e90b19f3c67147cd4a3d26fe3d2c7 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Tue, 8 Oct 2019 18:07:20 +0300 Subject: [PATCH 05/35] fix: single-page test app --- e2e/modal-navigation-ng/app/app.component.ts | 4 ++-- e2e/modal-navigation-ng/app/app.module.ts | 4 ++-- e2e/modal-navigation-ng/app/app.routing.ts | 2 +- e2e/modal-navigation-ng/app/home/home.component.ts | 2 +- e2e/modal-navigation-ng/app/layout.component.ts | 4 ++-- e2e/modal-navigation-ng/app/main.aot.ts | 4 ++-- e2e/modal-navigation-ng/app/main.ts | 4 ++-- .../app/modal-nested/modal-nested.component.ts | 2 +- .../app/modal-second/modal-second.component.ts | 2 +- .../app/modal-shared/modal-shared-second.component.ts | 4 ++-- .../app/modal-shared/modal-view-content.component.ts | 2 +- .../app/modal-shared/modal-view.component.ts | 2 +- .../app/modal/modal-router/modal-router.component.ts | 4 ++-- e2e/modal-navigation-ng/app/modal/modal.component.ts | 4 ++-- e2e/modal-navigation-ng/app/named-router.component.ts | 4 ++-- .../app/navigation/basic.navigation.component.ts | 2 +- e2e/modal-navigation-ng/app/second/second.component.ts | 6 +++--- e2e/modal-navigation-ng/app/tab.component.ts | 4 ++-- e2e/modal-navigation-ng/package.json | 2 +- e2e/single-page/app/app-routing.module.ts | 2 +- e2e/single-page/app/app.module.ts | 7 ++++--- e2e/single-page/app/main.aot.ts | 2 +- e2e/single-page/app/main.ts | 2 +- e2e/single-page/app/second/modal/modal.component.ts | 2 +- e2e/single-page/app/second/second.component.ts | 4 ++-- e2e/single-page/tsconfig.json | 3 +++ nativescript-angular-package/directives/action-bar.ts | 1 + nativescript-angular-package/modal-dialog.ts | 1 + nativescript-angular-package/router/page-router-outlet.ts | 1 + 29 files changed, 47 insertions(+), 40 deletions(-) create mode 100644 nativescript-angular-package/directives/action-bar.ts create mode 100644 nativescript-angular-package/modal-dialog.ts create mode 100644 nativescript-angular-package/router/page-router-outlet.ts diff --git a/e2e/modal-navigation-ng/app/app.component.ts b/e2e/modal-navigation-ng/app/app.component.ts index d7ca1d8cc..3292900e5 100644 --- a/e2e/modal-navigation-ng/app/app.component.ts +++ b/e2e/modal-navigation-ng/app/app.component.ts @@ -1,11 +1,11 @@ import { Component, ViewContainerRef } from "@angular/core"; import { Router, NavigationEnd } from "@angular/router"; -// import { NSLocationStrategy } from "@nativescript/angular/router/ns-location-strategy"; +// import { NSLocationStrategy } from "nativescript-angular/router/ns-location-strategy"; import { ViewContainerRefService } from "./shared/ViewContainerRefService"; import { AppModule } from "./app.module"; -import { ModalDialogOptions, ModalDialogService, NSLocationStrategy } from "@nativescript/angular"; +import { ModalDialogOptions, ModalDialogService, NSLocationStrategy } from "nativescript-angular"; import { ModalViewComponent } from "./modal-shared/modal-view.component"; @Component({ diff --git a/e2e/modal-navigation-ng/app/app.module.ts b/e2e/modal-navigation-ng/app/app.module.ts index 407831a81..a307dd468 100644 --- a/e2e/modal-navigation-ng/app/app.module.ts +++ b/e2e/modal-navigation-ng/app/app.module.ts @@ -1,5 +1,5 @@ import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core"; -import { NativeScriptModule } from "@nativescript/angular/nativescript.module"; +import { NativeScriptModule } from "nativescript-angular/nativescript.module"; import { AppRoutingModule } from "./app.routing"; import { AppComponent } from "./app.component"; import { NamedRouterComponent } from "./named-router.component"; @@ -20,7 +20,7 @@ import { ModalSharedSecondComponent } from "./modal-shared/modal-shared-second.c import { ViewContainerRefService } from "./shared/ViewContainerRefService"; import { enable as traceEnable, addCategories } from "tns-core-modules/trace"; -import { NativeScriptPlatformRef, routerTraceCategory } from "@nativescript/angular"; +import { NativeScriptPlatformRef, routerTraceCategory } from "nativescript-angular"; addCategories(routerTraceCategory); traceEnable(); diff --git a/e2e/modal-navigation-ng/app/app.routing.ts b/e2e/modal-navigation-ng/app/app.routing.ts index 8cc09094e..263f4a1b1 100644 --- a/e2e/modal-navigation-ng/app/app.routing.ts +++ b/e2e/modal-navigation-ng/app/app.routing.ts @@ -1,5 +1,5 @@ import { NgModule } from "@angular/core"; -import { NativeScriptRouterModule } from "@nativescript/angular/router"; +import { NativeScriptRouterModule } from "nativescript-angular/router"; import { Routes, Router } from "@angular/router"; import { HomeComponent } from "./home/home.component"; diff --git a/e2e/modal-navigation-ng/app/home/home.component.ts b/e2e/modal-navigation-ng/app/home/home.component.ts index d4240f0de..51ed6f720 100644 --- a/e2e/modal-navigation-ng/app/home/home.component.ts +++ b/e2e/modal-navigation-ng/app/home/home.component.ts @@ -1,5 +1,5 @@ import { Component, ViewContainerRef } from "@angular/core"; -import { ModalDialogService, RouterExtensions } from "@nativescript/angular"; +import { ModalDialogService, RouterExtensions } from "nativescript-angular"; import { ViewContainerRefService } from "../shared/ViewContainerRefService"; @Component({ diff --git a/e2e/modal-navigation-ng/app/layout.component.ts b/e2e/modal-navigation-ng/app/layout.component.ts index 800cb131b..ff6fdf9b2 100644 --- a/e2e/modal-navigation-ng/app/layout.component.ts +++ b/e2e/modal-navigation-ng/app/layout.component.ts @@ -1,7 +1,7 @@ import { Component, ViewContainerRef } from "@angular/core"; import { Router, NavigationEnd } from "@angular/router"; -import { NSLocationStrategy } from "@nativescript/angular/router"; -import { ModalDialogService, ModalDialogOptions } from "@nativescript/angular/directives/dialogs"; +import { NSLocationStrategy } from "nativescript-angular/router"; +import { ModalDialogService, ModalDialogOptions } from "nativescript-angular/directives/dialogs"; import { ModalViewComponent } from "./modal-shared/modal-view.component"; import { ViewContainerRefService } from "./shared/ViewContainerRefService"; import { AppModule } from "./app.module"; diff --git a/e2e/modal-navigation-ng/app/main.aot.ts b/e2e/modal-navigation-ng/app/main.aot.ts index a73c8cbd2..f124e81aa 100644 --- a/e2e/modal-navigation-ng/app/main.aot.ts +++ b/e2e/modal-navigation-ng/app/main.aot.ts @@ -1,9 +1,9 @@ // this import should be first in order to load some required settings (like globals and reflect-metadata) -import { platformNativeScript } from "@nativescript/angular"; +import { platformNativeScript } from "nativescript-angular"; console.log(">>>>>>>>main.aot.ts"); import { AppModule } from "./app.module"; -import { NativeScriptPlatformRef } from "@nativescript/angular"; +import { NativeScriptPlatformRef } from "nativescript-angular"; // "./app.module.ngfactory" is a dynamically generated module when compiled with AoT. import { AppModuleNgFactory } from "./app.module.ngfactory"; diff --git a/e2e/modal-navigation-ng/app/main.ts b/e2e/modal-navigation-ng/app/main.ts index 74e583111..05aabbfcd 100644 --- a/e2e/modal-navigation-ng/app/main.ts +++ b/e2e/modal-navigation-ng/app/main.ts @@ -1,9 +1,9 @@ // this import should be first in order to load some required settings (like globals and reflect-metadata) -import { platformNativeScriptDynamic } from "@nativescript/angular"; +import { platformNativeScriptDynamic } from "nativescript-angular"; console.log(">>>>>>>>main.ts"); import { AppModule } from "./app.module"; -import { NativeScriptPlatformRef } from "@nativescript/angular"; +import { NativeScriptPlatformRef } from "nativescript-angular"; AppModule.platformRef = platformNativeScriptDynamic(); AppModule.platformRef.bootstrapModule(AppModule); \ No newline at end of file diff --git a/e2e/modal-navigation-ng/app/modal-nested/modal-nested.component.ts b/e2e/modal-navigation-ng/app/modal-nested/modal-nested.component.ts index 4f6afb141..89cb66c56 100644 --- a/e2e/modal-navigation-ng/app/modal-nested/modal-nested.component.ts +++ b/e2e/modal-navigation-ng/app/modal-nested/modal-nested.component.ts @@ -1,6 +1,6 @@ import { Component } from "@angular/core"; import { View, ShownModallyData } from "tns-core-modules/ui/core/view" -import { ModalDialogParams } from "@nativescript/angular/directives/dialogs"; +import { ModalDialogParams } from "nativescript-angular/directives/dialogs"; @Component({ moduleId: module.id, diff --git a/e2e/modal-navigation-ng/app/modal-second/modal-second.component.ts b/e2e/modal-navigation-ng/app/modal-second/modal-second.component.ts index f335c2600..7b69233e6 100644 --- a/e2e/modal-navigation-ng/app/modal-second/modal-second.component.ts +++ b/e2e/modal-navigation-ng/app/modal-second/modal-second.component.ts @@ -1,7 +1,7 @@ import { Component } from "@angular/core"; import { View } from "tns-core-modules/ui/core/view" import { ActivatedRoute } from "@angular/router"; -import { RouterExtensions } from "@nativescript/angular/router"; +import { RouterExtensions } from "nativescript-angular/router"; @Component({ moduleId: module.id, diff --git a/e2e/modal-navigation-ng/app/modal-shared/modal-shared-second.component.ts b/e2e/modal-navigation-ng/app/modal-shared/modal-shared-second.component.ts index 5b8099703..26e1b7bcc 100644 --- a/e2e/modal-navigation-ng/app/modal-shared/modal-shared-second.component.ts +++ b/e2e/modal-navigation-ng/app/modal-shared/modal-shared-second.component.ts @@ -1,9 +1,9 @@ import { Component } from "@angular/core"; -import { ModalDialogOptions, ModalDialogService } from "@nativescript/angular/modal-dialog"; +import { ModalDialogOptions, ModalDialogService } from "nativescript-angular/modal-dialog"; import { ViewContainerRefService } from "../shared/ViewContainerRefService"; import { ModalViewComponent } from "../modal-shared/modal-view.component"; -import { RouterExtensions } from "@nativescript/angular/router"; +import { RouterExtensions } from "nativescript-angular/router"; @Component({ selector: "ns-second", diff --git a/e2e/modal-navigation-ng/app/modal-shared/modal-view-content.component.ts b/e2e/modal-navigation-ng/app/modal-shared/modal-view-content.component.ts index d1e0a8ef2..f194354bf 100644 --- a/e2e/modal-navigation-ng/app/modal-shared/modal-view-content.component.ts +++ b/e2e/modal-navigation-ng/app/modal-shared/modal-view-content.component.ts @@ -1,5 +1,5 @@ import { Component } from "@angular/core"; -import { ModalDialogParams } from "@nativescript/angular/modal-dialog"; +import { ModalDialogParams } from "nativescript-angular/modal-dialog"; @Component({ selector: "ModalViewContent", diff --git a/e2e/modal-navigation-ng/app/modal-shared/modal-view.component.ts b/e2e/modal-navigation-ng/app/modal-shared/modal-view.component.ts index e05981c1b..7089b8e14 100644 --- a/e2e/modal-navigation-ng/app/modal-shared/modal-view.component.ts +++ b/e2e/modal-navigation-ng/app/modal-shared/modal-view.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from "@angular/core"; -import { RouterExtensions } from "@nativescript/angular/router"; +import { RouterExtensions } from "nativescript-angular/router"; @Component({ selector: "ModalView", diff --git a/e2e/modal-navigation-ng/app/modal/modal-router/modal-router.component.ts b/e2e/modal-navigation-ng/app/modal/modal-router/modal-router.component.ts index d79059d5d..268235e5b 100644 --- a/e2e/modal-navigation-ng/app/modal/modal-router/modal-router.component.ts +++ b/e2e/modal-navigation-ng/app/modal/modal-router/modal-router.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from "@angular/core"; import { ActivatedRoute } from "@angular/router"; -import { RouterExtensions } from "@nativescript/angular/router"; -import { ModalDialogParams } from "@nativescript/angular/directives/dialogs"; +import { RouterExtensions } from "nativescript-angular/router"; +import { ModalDialogParams } from "nativescript-angular/directives/dialogs"; @Component({ moduleId: module.id, diff --git a/e2e/modal-navigation-ng/app/modal/modal.component.ts b/e2e/modal-navigation-ng/app/modal/modal.component.ts index 9e30b1046..a7caca12a 100644 --- a/e2e/modal-navigation-ng/app/modal/modal.component.ts +++ b/e2e/modal-navigation-ng/app/modal/modal.component.ts @@ -1,6 +1,6 @@ import { Component, ViewContainerRef } from "@angular/core"; -import { ModalDialogParams, ModalDialogOptions, ModalDialogService } from "@nativescript/angular/directives/dialogs"; -import { RouterExtensions, PageRoute } from "@nativescript/angular/router"; +import { ModalDialogParams, ModalDialogOptions, ModalDialogService } from "nativescript-angular/directives/dialogs"; +import { RouterExtensions, PageRoute } from "nativescript-angular/router"; import { ActivatedRoute } from "@angular/router"; import { View, ShownModallyData, EventData } from "tns-core-modules/ui/core/view" import { confirm } from "tns-core-modules/ui/dialogs"; diff --git a/e2e/modal-navigation-ng/app/named-router.component.ts b/e2e/modal-navigation-ng/app/named-router.component.ts index 69fbfc851..ab11d1fd8 100644 --- a/e2e/modal-navigation-ng/app/named-router.component.ts +++ b/e2e/modal-navigation-ng/app/named-router.component.ts @@ -1,10 +1,10 @@ import { Component, ViewContainerRef } from "@angular/core"; import { Router, NavigationEnd } from "@angular/router"; -import { NSLocationStrategy } from "@nativescript/angular"; +import { NSLocationStrategy } from "nativescript-angular"; import { ViewContainerRefService } from "./shared/ViewContainerRefService"; import { AppModule } from "./app.module"; -import { ModalDialogOptions, ModalDialogService } from "@nativescript/angular"; +import { ModalDialogOptions, ModalDialogService } from "nativescript-angular"; import { ModalViewComponent } from "./modal-shared/modal-view.component"; @Component({ diff --git a/e2e/modal-navigation-ng/app/navigation/basic.navigation.component.ts b/e2e/modal-navigation-ng/app/navigation/basic.navigation.component.ts index 485744492..bf194fb2f 100644 --- a/e2e/modal-navigation-ng/app/navigation/basic.navigation.component.ts +++ b/e2e/modal-navigation-ng/app/navigation/basic.navigation.component.ts @@ -1,6 +1,6 @@ import { Component, ViewContainerRef, Input, ViewChild, ElementRef } from "@angular/core"; import { Router, NavigationEnd } from "@angular/router"; -import { ModalDialogService, ModalDialogOptions } from "@nativescript/angular/directives/dialogs"; +import { ModalDialogService, ModalDialogOptions } from "nativescript-angular/directives/dialogs"; import { ModalComponent } from "../modal/modal.component"; import { ModalRouterComponent } from "../modal/modal-router/modal-router.component"; import { confirm } from "tns-core-modules/ui/dialogs"; diff --git a/e2e/modal-navigation-ng/app/second/second.component.ts b/e2e/modal-navigation-ng/app/second/second.component.ts index 2d2a26ca5..dc048a5ac 100644 --- a/e2e/modal-navigation-ng/app/second/second.component.ts +++ b/e2e/modal-navigation-ng/app/second/second.component.ts @@ -1,11 +1,11 @@ import { Component, ViewContainerRef } from "@angular/core"; -import { ModalDialogService, ModalDialogOptions } from "@nativescript/angular/directives/dialogs"; +import { ModalDialogService, ModalDialogOptions } from "nativescript-angular/directives/dialogs"; import { EventData } from "tns-core-modules/data/observable"; import { Frame } from "tns-core-modules/ui/frame"; import { View } from "tns-core-modules/ui/core/view"; import { ModalRouterComponent } from "../modal/modal-router/modal-router.component"; -import { PageRouterOutlet } from "@nativescript/angular/router/page-router-outlet"; -import { RouterExtensions } from "@nativescript/angular/router"; +import { PageRouterOutlet } from "nativescript-angular/router/page-router-outlet"; +import { RouterExtensions } from "nativescript-angular/router"; import { ModalComponent } from "../modal/modal.component"; import { AppModule } from "../app.module"; @Component({ diff --git a/e2e/modal-navigation-ng/app/tab.component.ts b/e2e/modal-navigation-ng/app/tab.component.ts index dd7e094dc..30610f863 100644 --- a/e2e/modal-navigation-ng/app/tab.component.ts +++ b/e2e/modal-navigation-ng/app/tab.component.ts @@ -1,10 +1,10 @@ import { Component, ViewContainerRef } from "@angular/core"; import { Router, NavigationEnd } from "@angular/router"; -// import { NSLocationStrategy } from "@nativescript/angular"; +// import { NSLocationStrategy } from "nativescript-angular"; import { ViewContainerRefService } from "./shared/ViewContainerRefService"; import { AppModule } from "./app.module"; -import { ModalDialogOptions, ModalDialogService } from "@nativescript/angular"; +import { ModalDialogOptions, ModalDialogService } from "nativescript-angular"; import { ModalViewComponent } from "./modal-shared/modal-view.component"; @Component({ diff --git a/e2e/modal-navigation-ng/package.json b/e2e/modal-navigation-ng/package.json index 9ccc07d80..5bd81ea31 100644 --- a/e2e/modal-navigation-ng/package.json +++ b/e2e/modal-navigation-ng/package.json @@ -21,7 +21,7 @@ "@angular/platform-browser": "~8.2.0", "@angular/platform-browser-dynamic": "~8.2.0", "@angular/router": "~8.2.0", - "@nativescript/angular": "file:../../nativescript-angular", + "nativescript-angular": "file:../../nativescript-angular-package", "nativescript-theme-core": "~1.0.4", "reflect-metadata": "~0.1.8", "rxjs": "^6.4.0", diff --git a/e2e/single-page/app/app-routing.module.ts b/e2e/single-page/app/app-routing.module.ts index a1528f7ff..2b650ee77 100644 --- a/e2e/single-page/app/app-routing.module.ts +++ b/e2e/single-page/app/app-routing.module.ts @@ -1,5 +1,5 @@ import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core"; -import { NativeScriptRouterModule } from "@nativescript/angular/router"; +import { NativeScriptRouterModule } from "nativescript-angular/router"; import { FirstComponent } from "./first/first.component" import { SecondComponent } from "./second/second.component" diff --git a/e2e/single-page/app/app.module.ts b/e2e/single-page/app/app.module.ts index 9210f46d2..4a13ad7fe 100644 --- a/e2e/single-page/app/app.module.ts +++ b/e2e/single-page/app/app.module.ts @@ -1,6 +1,7 @@ import { NgModule, NgModuleFactoryLoader, NO_ERRORS_SCHEMA } from "@angular/core"; -import { NativeScriptModule } from "@nativescript/angular/nativescript.module"; -import { NSModuleFactoryLoader } from "@nativescript/angular/router"; +import { NativeScriptModule } from "nativescript-angular/nativescript.module"; +import { NSModuleFactoryLoader } from "nativescript-angular/router"; + import { isNavigationButton } from "nativescript-angular/directives/action-bar"; import { AppRoutingModule, @@ -9,7 +10,7 @@ import { import { AppComponent } from "./app.component"; -import { routeReuseStrategyTraceCategory, routerTraceCategory } from "@nativescript/angular/trace"; +import { routeReuseStrategyTraceCategory, routerTraceCategory } from "nativescript-angular/trace"; import { setCategories, enable } from "tns-core-modules/trace"; import { ModalComponent } from "./second/modal/modal.component"; setCategories(routerTraceCategory + "," + routeReuseStrategyTraceCategory); diff --git a/e2e/single-page/app/main.aot.ts b/e2e/single-page/app/main.aot.ts index d0302e23e..10352ce3c 100644 --- a/e2e/single-page/app/main.aot.ts +++ b/e2e/single-page/app/main.aot.ts @@ -1,4 +1,4 @@ -import { platformNativeScript } from "@nativescript/angular/platform-static"; +import { platformNativeScript } from "nativescript-angular/platform-static"; import { AppModuleNgFactory } from "./app.module.ngfactory"; platformNativeScript({ createFrameOnBootstrap: true }).bootstrapModuleFactory(AppModuleNgFactory); diff --git a/e2e/single-page/app/main.ts b/e2e/single-page/app/main.ts index 52e4bc5a2..864356357 100644 --- a/e2e/single-page/app/main.ts +++ b/e2e/single-page/app/main.ts @@ -1,4 +1,4 @@ -import { platformNativeScriptDynamic } from "@nativescript/angular/platform"; +import { platformNativeScriptDynamic } from "nativescript-angular/platform"; import { AppModule } from "./app.module"; platformNativeScriptDynamic({ createFrameOnBootstrap: true }).bootstrapModule(AppModule); diff --git a/e2e/single-page/app/second/modal/modal.component.ts b/e2e/single-page/app/second/modal/modal.component.ts index 895f47679..6a954147a 100644 --- a/e2e/single-page/app/second/modal/modal.component.ts +++ b/e2e/single-page/app/second/modal/modal.component.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { ModalDialogParams } from "@nativescript/angular/modal-dialog"; +import { ModalDialogParams } from "nativescript-angular/modal-dialog"; @Component({ moduleId: module.id, diff --git a/e2e/single-page/app/second/second.component.ts b/e2e/single-page/app/second/second.component.ts index 1e829a71f..f06bb1299 100644 --- a/e2e/single-page/app/second/second.component.ts +++ b/e2e/single-page/app/second/second.component.ts @@ -1,11 +1,11 @@ import { Component, OnInit, OnDestroy, ViewContainerRef } from "@angular/core"; import { ActivatedRoute, Router, Route } from "@angular/router"; -import { ModalDialogService, ModalDialogOptions } from "@nativescript/angular"; +import { ModalDialogService, ModalDialogOptions } from "nativescript-angular"; import { Page } from "tns-core-modules/ui/page"; import { Observable } from "rxjs"; import { map } from "rxjs/operators"; -import { RouterExtensions } from "@nativescript/angular/router"; +import { RouterExtensions } from "nativescript-angular/router"; import { ModalComponent } from "./modal/modal.component"; @Component({ diff --git a/e2e/single-page/tsconfig.json b/e2e/single-page/tsconfig.json index d93d819b4..65295d0f2 100644 --- a/e2e/single-page/tsconfig.json +++ b/e2e/single-page/tsconfig.json @@ -23,10 +23,13 @@ } }, "include": [ + "../../nativescript-angular-package", "../../nativescript-angular", "**/*" ], "exclude": [ + "../../nativescript-angular-package/node_modules", + "../../nativescript-angular-package/**/*.d.ts", "../../nativescript-angular/node_modules", "../../nativescript-angular/**/*.d.ts", "node_modules", diff --git a/nativescript-angular-package/directives/action-bar.ts b/nativescript-angular-package/directives/action-bar.ts new file mode 100644 index 000000000..5337b967b --- /dev/null +++ b/nativescript-angular-package/directives/action-bar.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/directives/action-bar"; \ No newline at end of file diff --git a/nativescript-angular-package/modal-dialog.ts b/nativescript-angular-package/modal-dialog.ts new file mode 100644 index 000000000..9dad19c5e --- /dev/null +++ b/nativescript-angular-package/modal-dialog.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/modal-dialog" \ No newline at end of file diff --git a/nativescript-angular-package/router/page-router-outlet.ts b/nativescript-angular-package/router/page-router-outlet.ts new file mode 100644 index 000000000..f181cf615 --- /dev/null +++ b/nativescript-angular-package/router/page-router-outlet.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/router/page-router-outlet"; \ No newline at end of file From 109009563e130c04a158ff7b60dec381849a4bbe Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Wed, 9 Oct 2019 14:44:21 +0300 Subject: [PATCH 06/35] fix: revert changes to modal navigation e2e --- e2e/modal-navigation-ng/app/app.component.ts | 4 ++-- e2e/modal-navigation-ng/app/app.module.ts | 3 ++- e2e/modal-navigation-ng/app/home/home.component.ts | 11 ++++++++++- e2e/modal-navigation-ng/app/layout.component.ts | 2 +- e2e/modal-navigation-ng/app/main.aot.ts | 4 +--- e2e/modal-navigation-ng/app/main.ts | 3 +-- e2e/modal-navigation-ng/app/named-router.component.ts | 2 +- e2e/modal-navigation-ng/app/tab.component.ts | 6 +++--- 8 files changed, 21 insertions(+), 14 deletions(-) diff --git a/e2e/modal-navigation-ng/app/app.component.ts b/e2e/modal-navigation-ng/app/app.component.ts index 3292900e5..45decfedf 100644 --- a/e2e/modal-navigation-ng/app/app.component.ts +++ b/e2e/modal-navigation-ng/app/app.component.ts @@ -1,11 +1,11 @@ import { Component, ViewContainerRef } from "@angular/core"; import { Router, NavigationEnd } from "@angular/router"; -// import { NSLocationStrategy } from "nativescript-angular/router/ns-location-strategy"; +import { NSLocationStrategy } from "nativescript-angular/router/ns-location-strategy"; import { ViewContainerRefService } from "./shared/ViewContainerRefService"; import { AppModule } from "./app.module"; -import { ModalDialogOptions, ModalDialogService, NSLocationStrategy } from "nativescript-angular"; +import { ModalDialogOptions, ModalDialogService } from "nativescript-angular"; import { ModalViewComponent } from "./modal-shared/modal-view.component"; @Component({ diff --git a/e2e/modal-navigation-ng/app/app.module.ts b/e2e/modal-navigation-ng/app/app.module.ts index a307dd468..b868bf401 100644 --- a/e2e/modal-navigation-ng/app/app.module.ts +++ b/e2e/modal-navigation-ng/app/app.module.ts @@ -20,7 +20,8 @@ import { ModalSharedSecondComponent } from "./modal-shared/modal-shared-second.c import { ViewContainerRefService } from "./shared/ViewContainerRefService"; import { enable as traceEnable, addCategories } from "tns-core-modules/trace"; -import { NativeScriptPlatformRef, routerTraceCategory } from "nativescript-angular"; +import { routerTraceCategory } from "nativescript-angular/trace"; +import { NativeScriptPlatformRef } from "nativescript-angular"; addCategories(routerTraceCategory); traceEnable(); diff --git a/e2e/modal-navigation-ng/app/home/home.component.ts b/e2e/modal-navigation-ng/app/home/home.component.ts index 51ed6f720..72e8f889e 100644 --- a/e2e/modal-navigation-ng/app/home/home.component.ts +++ b/e2e/modal-navigation-ng/app/home/home.component.ts @@ -1,6 +1,15 @@ import { Component, ViewContainerRef } from "@angular/core"; -import { ModalDialogService, RouterExtensions } from "nativescript-angular"; +import { ModalDialogService, ModalDialogOptions } from "nativescript-angular/directives/dialogs"; +import { RouterExtensions } from "nativescript-angular/router"; +import { EventData } from "tns-core-modules/data/observable"; + import { ViewContainerRefService } from "../shared/ViewContainerRefService"; +import { ModalRouterComponent } from "../modal/modal-router/modal-router.component"; +import { ModalComponent } from "../modal/modal.component"; +import { ModalViewComponent } from "../modal-shared/modal-view.component"; +import { confirm } from "tns-core-modules/ui/dialogs"; + +import { AppModule } from "../app.module"; @Component({ moduleId: module.id, diff --git a/e2e/modal-navigation-ng/app/layout.component.ts b/e2e/modal-navigation-ng/app/layout.component.ts index ff6fdf9b2..fe6ee9a9d 100644 --- a/e2e/modal-navigation-ng/app/layout.component.ts +++ b/e2e/modal-navigation-ng/app/layout.component.ts @@ -1,6 +1,6 @@ import { Component, ViewContainerRef } from "@angular/core"; import { Router, NavigationEnd } from "@angular/router"; -import { NSLocationStrategy } from "nativescript-angular/router"; +import { NSLocationStrategy } from "nativescript-angular/router/ns-location-strategy"; import { ModalDialogService, ModalDialogOptions } from "nativescript-angular/directives/dialogs"; import { ModalViewComponent } from "./modal-shared/modal-view.component"; import { ViewContainerRefService } from "./shared/ViewContainerRefService"; diff --git a/e2e/modal-navigation-ng/app/main.aot.ts b/e2e/modal-navigation-ng/app/main.aot.ts index f124e81aa..fef7c8714 100644 --- a/e2e/modal-navigation-ng/app/main.aot.ts +++ b/e2e/modal-navigation-ng/app/main.aot.ts @@ -1,7 +1,5 @@ // this import should be first in order to load some required settings (like globals and reflect-metadata) -import { platformNativeScript } from "nativescript-angular"; -console.log(">>>>>>>>main.aot.ts"); - +import { platformNativeScript } from "nativescript-angular/platform-static"; import { AppModule } from "./app.module"; import { NativeScriptPlatformRef } from "nativescript-angular"; // "./app.module.ngfactory" is a dynamically generated module when compiled with AoT. diff --git a/e2e/modal-navigation-ng/app/main.ts b/e2e/modal-navigation-ng/app/main.ts index 05aabbfcd..9e19c0134 100644 --- a/e2e/modal-navigation-ng/app/main.ts +++ b/e2e/modal-navigation-ng/app/main.ts @@ -1,6 +1,5 @@ // this import should be first in order to load some required settings (like globals and reflect-metadata) -import { platformNativeScriptDynamic } from "nativescript-angular"; -console.log(">>>>>>>>main.ts"); +import { platformNativeScriptDynamic } from "nativescript-angular/platform"; import { AppModule } from "./app.module"; import { NativeScriptPlatformRef } from "nativescript-angular"; diff --git a/e2e/modal-navigation-ng/app/named-router.component.ts b/e2e/modal-navigation-ng/app/named-router.component.ts index ab11d1fd8..745ed6f11 100644 --- a/e2e/modal-navigation-ng/app/named-router.component.ts +++ b/e2e/modal-navigation-ng/app/named-router.component.ts @@ -1,6 +1,6 @@ import { Component, ViewContainerRef } from "@angular/core"; import { Router, NavigationEnd } from "@angular/router"; -import { NSLocationStrategy } from "nativescript-angular"; +import { NSLocationStrategy } from "nativescript-angular/router/ns-location-strategy"; import { ViewContainerRefService } from "./shared/ViewContainerRefService"; import { AppModule } from "./app.module"; diff --git a/e2e/modal-navigation-ng/app/tab.component.ts b/e2e/modal-navigation-ng/app/tab.component.ts index 30610f863..b72c056dc 100644 --- a/e2e/modal-navigation-ng/app/tab.component.ts +++ b/e2e/modal-navigation-ng/app/tab.component.ts @@ -1,6 +1,6 @@ import { Component, ViewContainerRef } from "@angular/core"; import { Router, NavigationEnd } from "@angular/router"; -// import { NSLocationStrategy } from "nativescript-angular"; +import { NSLocationStrategy } from "nativescript-angular/router/ns-location-strategy"; import { ViewContainerRefService } from "./shared/ViewContainerRefService"; import { AppModule } from "./app.module"; @@ -14,14 +14,14 @@ import { ModalViewComponent } from "./modal-shared/modal-view.component"; export class TabComponent { constructor( router: Router, - // location: NSLocationStrategy, + location: NSLocationStrategy, private _vcRef: ViewContainerRef, private _viewContainerRefService: ViewContainerRefService, private modal: ModalDialogService) { router.events.subscribe(e => { if (e instanceof NavigationEnd) { console.log("[ROUTER]: " + e.toString()); - // console.log(location.toString()); + console.log(location.toString()); } }); From 10b92531f182613674c351a02d4c01c2c3444d35 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Wed, 9 Oct 2019 17:50:34 +0300 Subject: [PATCH 07/35] chore: reorganise exports --- .../element-registry.ts | 1 + nativescript-angular-package/index.ts | 10 ++++++- .../platform-providers.ts | 1 + nativescript-angular-package/renderer.ts | 1 + .../resource-loader.ts | 1 + .../router/ns-route-reuse-strategy.ts | 1 + .../router/ns-router-link.ts | 1 + nativescript-angular-package/view-util.ts | 1 + nativescript-angular/common.ts | 2 ++ nativescript-angular/directives/index.ts | 29 ++++++++++++------- nativescript-angular/forms/forms.module.ts | 9 ++++++ nativescript-angular/index.ts | 13 +-------- nativescript-angular/nativescript.module.ts | 2 ++ nativescript-angular/router/router.module.ts | 6 +--- tests/package.json | 10 +++++-- tests/tsconfig.json | 3 ++ 16 files changed, 60 insertions(+), 31 deletions(-) create mode 100644 nativescript-angular-package/element-registry.ts create mode 100644 nativescript-angular-package/platform-providers.ts create mode 100644 nativescript-angular-package/renderer.ts create mode 100644 nativescript-angular-package/resource-loader.ts create mode 100644 nativescript-angular-package/router/ns-route-reuse-strategy.ts create mode 100644 nativescript-angular-package/router/ns-router-link.ts create mode 100644 nativescript-angular-package/view-util.ts diff --git a/nativescript-angular-package/element-registry.ts b/nativescript-angular-package/element-registry.ts new file mode 100644 index 000000000..46a37d420 --- /dev/null +++ b/nativescript-angular-package/element-registry.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/element-registry"; \ No newline at end of file diff --git a/nativescript-angular-package/index.ts b/nativescript-angular-package/index.ts index 2d2419d19..03145e814 100644 --- a/nativescript-angular-package/index.ts +++ b/nativescript-angular-package/index.ts @@ -1 +1,9 @@ -export * from "@nativescript/angular"; \ No newline at end of file +export * from "@nativescript/angular"; +export * from "@nativescript/angular/forms"; +export * from "@nativescript/angular/router"; +export * from "@nativescript/angular/file-system/ns-file-system"; +export * from "@nativescript/angular/modal-dialog"; +export * from "@nativescript/angular/forms/value-accessors/base-value-accessor"; +export * from "@nativescript/angular/trace"; +export * from "@nativescript/angular/renderer"; +export * from "@nativescript/angular/view-util"; diff --git a/nativescript-angular-package/platform-providers.ts b/nativescript-angular-package/platform-providers.ts new file mode 100644 index 000000000..dcc447e8d --- /dev/null +++ b/nativescript-angular-package/platform-providers.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/platform-providers"; \ No newline at end of file diff --git a/nativescript-angular-package/renderer.ts b/nativescript-angular-package/renderer.ts new file mode 100644 index 000000000..6dd053d7a --- /dev/null +++ b/nativescript-angular-package/renderer.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/renderer"; \ No newline at end of file diff --git a/nativescript-angular-package/resource-loader.ts b/nativescript-angular-package/resource-loader.ts new file mode 100644 index 000000000..e9e2794a8 --- /dev/null +++ b/nativescript-angular-package/resource-loader.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/resource-loader"; \ No newline at end of file diff --git a/nativescript-angular-package/router/ns-route-reuse-strategy.ts b/nativescript-angular-package/router/ns-route-reuse-strategy.ts new file mode 100644 index 000000000..fa6306cfc --- /dev/null +++ b/nativescript-angular-package/router/ns-route-reuse-strategy.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/router/ns-route-reuse-strategy"; \ No newline at end of file diff --git a/nativescript-angular-package/router/ns-router-link.ts b/nativescript-angular-package/router/ns-router-link.ts new file mode 100644 index 000000000..fa87694d9 --- /dev/null +++ b/nativescript-angular-package/router/ns-router-link.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/router/ns-router-link"; \ No newline at end of file diff --git a/nativescript-angular-package/view-util.ts b/nativescript-angular-package/view-util.ts new file mode 100644 index 000000000..53ecbb10e --- /dev/null +++ b/nativescript-angular-package/view-util.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/view-util"; \ No newline at end of file diff --git a/nativescript-angular/common.ts b/nativescript-angular/common.ts index c6b119eef..f148d787e 100644 --- a/nativescript-angular/common.ts +++ b/nativescript-angular/common.ts @@ -38,3 +38,5 @@ import { NS_DIRECTIVES } from "./directives"; }) export class NativeScriptCommonModule { } + +export * from "./directives"; diff --git a/nativescript-angular/directives/index.ts b/nativescript-angular/directives/index.ts index 6b68054e3..57efac10f 100644 --- a/nativescript-angular/directives/index.ts +++ b/nativescript-angular/directives/index.ts @@ -1,5 +1,5 @@ import { ListViewComponent } from "./list-view-comp"; -import { TemplateKeyDirective } from "./templated-items-comp"; +import { TemplateKeyDirective, SetupItemViewArgs } from "./templated-items-comp"; import { TabViewDirective, TabViewItemDirective } from "./tab-view"; import { ActionBarComponent, @@ -8,22 +8,25 @@ import { NavigationButtonDirective } from "./action-bar"; import { AndroidFilterComponent, IosFilterComponent } from "./platform-filters"; +import { ModalDialogHost, ModalDialogOptions, ModalDialogParams, ModalDialogService } from "./dialogs"; -export { ListViewComponent } from "./list-view-comp"; -export { SetupItemViewArgs, TemplateKeyDirective } from "./templated-items-comp"; - -export { TabViewDirective, TabViewItemDirective } from "./tab-view"; -export { +export const NS_DIRECTIVES = [ + ListViewComponent, + TemplateKeyDirective, + TabViewDirective, + TabViewItemDirective, ActionBarComponent, ActionBarScope, ActionItemDirective, - NavigationButtonDirective -} from "./action-bar"; -export { AndroidFilterComponent, IosFilterComponent } from "./platform-filters"; + NavigationButtonDirective, + AndroidFilterComponent, + IosFilterComponent, +]; -export const NS_DIRECTIVES = [ +export { ListViewComponent, TemplateKeyDirective, + SetupItemViewArgs, TabViewDirective, TabViewItemDirective, ActionBarComponent, @@ -32,4 +35,8 @@ export const NS_DIRECTIVES = [ NavigationButtonDirective, AndroidFilterComponent, IosFilterComponent, -]; + ModalDialogHost, + ModalDialogOptions, + ModalDialogParams, + ModalDialogService +}; diff --git a/nativescript-angular/forms/forms.module.ts b/nativescript-angular/forms/forms.module.ts index 814b08727..50511eafc 100644 --- a/nativescript-angular/forms/forms.module.ts +++ b/nativescript-angular/forms/forms.module.ts @@ -18,6 +18,15 @@ export const FORMS_DIRECTIVES = [ NumberValueAccessor, ]; +export { + TextValueAccessor, + CheckedValueAccessor, + DateValueAccessor, + TimeValueAccessor, + SelectedIndexValueAccessor, + NumberValueAccessor +}; + @NgModule({ declarations: FORMS_DIRECTIVES, providers: [ diff --git a/nativescript-angular/index.ts b/nativescript-angular/index.ts index 68ddbb1b6..e217aa056 100644 --- a/nativescript-angular/index.ts +++ b/nativescript-angular/index.ts @@ -3,20 +3,11 @@ import "tns-core-modules/application"; export * from "./platform-common"; export * from "./platform"; export * from "./platform-static"; -export * from "./router"; -export * from "./forms"; -export * from "./directives"; -export * from "./common/detached-loader"; -export * from "./trace"; export * from "./platform-providers"; -export * from "./file-system/ns-file-system"; -export * from "./modal-dialog"; -export * from "./renderer"; -export * from "./view-util"; export * from "./resource-loader"; export * from "./nativescript.module"; -export * from "./platform"; +export * from "./common"; export { ViewClass, @@ -27,5 +18,3 @@ export { isKnownView, registerElement, } from "./element-registry"; - -export * from "./forms/value-accessors/base-value-accessor"; diff --git a/nativescript-angular/nativescript.module.ts b/nativescript-angular/nativescript.module.ts index 439c20b9d..8a4da1ef6 100644 --- a/nativescript-angular/nativescript.module.ts +++ b/nativescript-angular/nativescript.module.ts @@ -33,6 +33,8 @@ export function errorHandlerFactory() { return new ErrorHandler(); } +export { DetachedLoader }; + @NgModule({ declarations: [ DetachedLoader, diff --git a/nativescript-angular/router/router.module.ts b/nativescript-angular/router/router.module.ts index dc7a30f1d..1c8095c09 100644 --- a/nativescript-angular/router/router.module.ts +++ b/nativescript-angular/router/router.module.ts @@ -16,11 +16,7 @@ export { PageRoute } from "./page-router-outlet"; export { RouterExtensions } from "./router-extensions"; export { NSModuleFactoryLoader } from "./ns-module-factory-loader"; -export { NSRouterLink } from "./ns-router-link"; -export { NSRouterLinkActive } from "./ns-router-link-active"; -export { PageRouterOutlet } from "./page-router-outlet"; -export { NSEmptyOutletComponent } from "./ns-empty-outlet.component"; -export { NSLocationStrategy } from "./ns-location-strategy"; +export { NSRouterLink, NSRouterLinkActive, PageRouterOutlet, NSEmptyOutletComponent, NSLocationStrategy }; const ROUTER_DIRECTIVES = [NSRouterLink, NSRouterLinkActive, PageRouterOutlet, NSEmptyOutletComponent]; diff --git a/tests/package.json b/tests/package.json index 55bd35ee1..416795986 100644 --- a/tests/package.json +++ b/tests/package.json @@ -1,6 +1,12 @@ { "nativescript": { - "id": "org.nativescript.ngtests" + "id": "org.nativescript.ngtests", + "tns-ios": { + "version": "6.1.1" + }, + "tns-android": { + "version": "6.1.2" + } }, "name": "ngtests", "version": "1.0.0", @@ -27,7 +33,7 @@ "@angular/platform-browser": "~8.2.0", "@angular/platform-browser-dynamic": "~8.2.0", "@angular/router": "~8.2.0", - "nativescript-angular": "../nativescript-angular", + "nativescript-angular": "../nativescript-angular-package", "nativescript-unit-test-runner": "0.7.0", "rxjs": "^6.4.0", "tns-core-modules": "next", diff --git a/tests/tsconfig.json b/tests/tsconfig.json index d24fffdf3..730d1b343 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -23,10 +23,13 @@ } }, "include": [ + "../nativescript-angular-package", "../nativescript-angular", "**/*" ], "exclude": [ + "../nativescript-angular-package/node_modules", + "../nativescript-angular-package/**/*.d.ts", "../nativescript-angular/node_modules", "../nativescript-angular/**/*.d.ts", "node_modules", From f519624622b2774a3eb10e31fb4edf1d3b2d5ed2 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Thu, 10 Oct 2019 11:50:00 +0300 Subject: [PATCH 08/35] chore: remove comment --- nativescript-angular/platform.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/nativescript-angular/platform.ts b/nativescript-angular/platform.ts index 80b6a16e1..8919d34fd 100644 --- a/nativescript-angular/platform.ts +++ b/nativescript-angular/platform.ts @@ -2,7 +2,6 @@ // It's needed to handle __metadata calls inside @angular/core import "reflect-metadata"; -console.log(">>>>>>>>>>>import reflect-metadata;"); // Import platform-common immediately after reflect-metadata - because rest of the polyfills. import { NativeScriptPlatformRef, From f725a6edb961e9f86b5efea63a01eb6962c00800 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Thu, 10 Oct 2019 13:49:15 +0300 Subject: [PATCH 09/35] fix: unit tests after refactoring --- nativescript-angular-package/zone-js/testing.mocha.ts | 2 +- tests/app/tests/renderer-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nativescript-angular-package/zone-js/testing.mocha.ts b/nativescript-angular-package/zone-js/testing.mocha.ts index f91c4168b..f8ec59c8a 100644 --- a/nativescript-angular-package/zone-js/testing.mocha.ts +++ b/nativescript-angular-package/zone-js/testing.mocha.ts @@ -1,2 +1,2 @@ import "@nativescript/angular/platform"; -import "@nativescript/angular/dist/zone-nativescript.mocha.js"; +import "@nativescript/angular/zone-js/dist/zone-nativescript.mocha.js"; diff --git a/tests/app/tests/renderer-tests.ts b/tests/app/tests/renderer-tests.ts index 49c59ff2a..2f74a07a5 100644 --- a/tests/app/tests/renderer-tests.ts +++ b/tests/app/tests/renderer-tests.ts @@ -82,7 +82,7 @@ export class StyledLabelCmp { styles: [ `Label { color: red; }`, ` - StackLayout { color: brick; } + StackLayout { color: brown; } TextField { color: red; background-color: lime; } `, ], From fdad1c911aa3d05f6b7e6b0fdb538f6ddc3db968 Mon Sep 17 00:00:00 2001 From: Teodor Bozhikov Date: Thu, 10 Oct 2019 19:29:09 +0300 Subject: [PATCH 10/35] chore: first bits of a pack script for non-scoped dependency --- build/pack-script/index.ts | 6 +++++ build/pack-script/package.json | 15 ++++++++++++ build/pack-script/tsconfig.json | 29 +++++++++++++++++++++++ nativescript-angular-package/package.json | 6 ++++- 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 build/pack-script/index.ts create mode 100644 build/pack-script/package.json create mode 100644 build/pack-script/tsconfig.json diff --git a/build/pack-script/index.ts b/build/pack-script/index.ts new file mode 100644 index 000000000..77d46da46 --- /dev/null +++ b/build/pack-script/index.ts @@ -0,0 +1,6 @@ +console.log("Hi!"); +console.log(process.argv); + +var myArgs = process.argv.slice(2); + +console.log(`Packing with @nativescript/angular: ${myArgs}`); diff --git a/build/pack-script/package.json b/build/pack-script/package.json new file mode 100644 index 000000000..f35d1167f --- /dev/null +++ b/build/pack-script/package.json @@ -0,0 +1,15 @@ +{ + "name": "build", + "version": "1.0.0", + "description": "", + "main": "prepublish-next.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "devDependencies": { + "@types/node": "^12.7.12", + "ts-node": "^8.4.1" + } +} diff --git a/build/pack-script/tsconfig.json b/build/pack-script/tsconfig.json new file mode 100644 index 000000000..f5118e5d6 --- /dev/null +++ b/build/pack-script/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "noEmitHelpers": true, + "noEmitOnError": true, + "lib": [ + "es6", + "dom", + "es2015.iterable" + ], + "baseUrl": ".", + "paths": { + "*": [ + "./node_modules/*" + ] + }, + "types": [ + "node" + ], + "typeRoots": [ + // add path to @types + "node_modules/@types" + ], + "strict": false + } +} \ No newline at end of file diff --git a/nativescript-angular-package/package.json b/nativescript-angular-package/package.json index 237ecf9a5..450d2b85e 100644 --- a/nativescript-angular-package/package.json +++ b/nativescript-angular-package/package.json @@ -32,5 +32,9 @@ }, "dependencies": { "@nativescript/angular": "file:../nativescript-angular" + }, + "scripts": { + "pack": "cd ../build && npm pack ../nativescript-angular-package", + "pack-with-scoped-version": "cd ../build/pack-script && npx ts-node index.ts" } -} +} \ No newline at end of file From 1cb22db6db6344aa5bbbdb84aee748f12378d19d Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Fri, 11 Oct 2019 17:08:58 +0300 Subject: [PATCH 11/35] chore: pack script for compat package --- .gitignore | 2 + build/pack-script/index.ts | 6 -- build/pack-scripts/pack-compat.ts | 28 +++++++ build/pack-scripts/pack-scoped.ts | 28 +++++++ .../package.json | 5 +- .../tsconfig.json | 20 ++--- nativescript-angular-package/package.json | 76 +++++++++---------- 7 files changed, 108 insertions(+), 57 deletions(-) delete mode 100644 build/pack-script/index.ts create mode 100644 build/pack-scripts/pack-compat.ts create mode 100644 build/pack-scripts/pack-scoped.ts rename build/{pack-script => pack-scripts}/package.json (72%) rename build/{pack-script => pack-scripts}/tsconfig.json (59%) diff --git a/.gitignore b/.gitignore index 9399b9cd3..e68d89f93 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules platforms hooks tags +dist **/*.js.map **/*.metadata.json @@ -46,3 +47,4 @@ tsconfig.tns.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json + diff --git a/build/pack-script/index.ts b/build/pack-script/index.ts deleted file mode 100644 index 77d46da46..000000000 --- a/build/pack-script/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -console.log("Hi!"); -console.log(process.argv); - -var myArgs = process.argv.slice(2); - -console.log(`Packing with @nativescript/angular: ${myArgs}`); diff --git a/build/pack-scripts/pack-compat.ts b/build/pack-scripts/pack-compat.ts new file mode 100644 index 000000000..e59836f32 --- /dev/null +++ b/build/pack-scripts/pack-compat.ts @@ -0,0 +1,28 @@ +import * as path from "path"; +import * as fs from "fs-extra"; +import { execSync } from "child_process"; + +// var myArgs = process.argv.slice(2); +var scopedVersion = process.argv[2]; +console.log(`Packing nativescript-angular package with @nativescript/angular: ${scopedVersion}`); + +const distFolderPath = path.resolve("../../dist"); +const nsAngularPackagePath = path.resolve("../../nativescript-angular-package"); +const packageJsonPath = path.resolve(`${nsAngularPackagePath}/package.json`); +console.log("Getting package.json from", packageJsonPath); + +// rewrite dependency in package.json +const packageJsonObject = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: "utf8" })); +packageJsonObject.dependencies["@nativescript/angular"] = scopedVersion; +fs.writeFileSync(packageJsonPath, JSON.stringify(packageJsonObject, null, 4)); + +// create .tgz in dist folder +execSync(`npm install`, { + cwd: nsAngularPackagePath +}); +// ensures empty ../dist folder +fs.emptyDirSync(distFolderPath); +// cd to dist folder +execSync(`npm pack ${nsAngularPackagePath}`, { + cwd: distFolderPath +}); \ No newline at end of file diff --git a/build/pack-scripts/pack-scoped.ts b/build/pack-scripts/pack-scoped.ts new file mode 100644 index 000000000..e59836f32 --- /dev/null +++ b/build/pack-scripts/pack-scoped.ts @@ -0,0 +1,28 @@ +import * as path from "path"; +import * as fs from "fs-extra"; +import { execSync } from "child_process"; + +// var myArgs = process.argv.slice(2); +var scopedVersion = process.argv[2]; +console.log(`Packing nativescript-angular package with @nativescript/angular: ${scopedVersion}`); + +const distFolderPath = path.resolve("../../dist"); +const nsAngularPackagePath = path.resolve("../../nativescript-angular-package"); +const packageJsonPath = path.resolve(`${nsAngularPackagePath}/package.json`); +console.log("Getting package.json from", packageJsonPath); + +// rewrite dependency in package.json +const packageJsonObject = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: "utf8" })); +packageJsonObject.dependencies["@nativescript/angular"] = scopedVersion; +fs.writeFileSync(packageJsonPath, JSON.stringify(packageJsonObject, null, 4)); + +// create .tgz in dist folder +execSync(`npm install`, { + cwd: nsAngularPackagePath +}); +// ensures empty ../dist folder +fs.emptyDirSync(distFolderPath); +// cd to dist folder +execSync(`npm pack ${nsAngularPackagePath}`, { + cwd: distFolderPath +}); \ No newline at end of file diff --git a/build/pack-script/package.json b/build/pack-scripts/package.json similarity index 72% rename from build/pack-script/package.json rename to build/pack-scripts/package.json index f35d1167f..93c081421 100644 --- a/build/pack-script/package.json +++ b/build/pack-scripts/package.json @@ -10,6 +10,9 @@ "license": "ISC", "devDependencies": { "@types/node": "^12.7.12", - "ts-node": "^8.4.1" + "fs-extra": "^8.1.0", + "rimraf": "^3.0.0", + "ts-node": "^8.4.1", + "typescript": "^3.6.4" } } diff --git a/build/pack-script/tsconfig.json b/build/pack-scripts/tsconfig.json similarity index 59% rename from build/pack-script/tsconfig.json rename to build/pack-scripts/tsconfig.json index f5118e5d6..a250c1c15 100644 --- a/build/pack-script/tsconfig.json +++ b/build/pack-scripts/tsconfig.json @@ -11,19 +11,15 @@ "dom", "es2015.iterable" ], - "baseUrl": ".", - "paths": { - "*": [ - "./node_modules/*" - ] - }, "types": [ "node" ], - "typeRoots": [ - // add path to @types - "node_modules/@types" - ], - "strict": false - } + "typeRoots": [ "./node_modules/@types" ] + }, + "include": [ + "./**/*.ts" + ], + "exclude": [ + "node_modules" + ] } \ No newline at end of file diff --git a/nativescript-angular-package/package.json b/nativescript-angular-package/package.json index 450d2b85e..bd7944ca6 100644 --- a/nativescript-angular-package/package.json +++ b/nativescript-angular-package/package.json @@ -1,40 +1,40 @@ { - "name": "nativescript-angular", - "version": "8.3.0", - "description": "An Angular renderer that lets you build mobile apps with NativeScript.", - "homepage": "https://www.nativescript.org/", - "bugs": "https://github.com/NativeScript/nativescript-angular/issues", - "author": { - "name": "NativeScript Team" - }, - "contributors": [ - "Hristo Deshev ", - "Alexander Vakrilov ", - "Stanimira Vlaeva " - ], - "nativescript": { - "platforms": { - "android": "6.0.0", - "ios": "6.0.0" + "name": "nativescript-angular", + "version": "8.3.0", + "description": "An Angular renderer that lets you build mobile apps with NativeScript.", + "homepage": "https://www.nativescript.org/", + "bugs": "https://github.com/NativeScript/nativescript-angular/issues", + "author": { + "name": "NativeScript Team" + }, + "contributors": [ + "Hristo Deshev ", + "Alexander Vakrilov ", + "Stanimira Vlaeva " + ], + "nativescript": { + "platforms": { + "android": "6.0.0", + "ios": "6.0.0" + } + }, + "keywords": [ + "NativeScript", + "Angular" + ], + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "https://github.com/NativeScript/nativescript-angular.git" + }, + "bin": { + "update-app-ng-deps": "node_modules/@nativescript/angular/bin/update-app-ng-deps" + }, + "dependencies": { + "@nativescript/angular": "file:../nativescript-angular" + }, + "scripts": { + "pack": "cd ../build && npm pack ../nativescript-angular-package", + "pack-with-scoped-version": "cd ../build/pack-scripts && npm i && npx ts-node pack-compat.ts" } - }, - "keywords": [ - "NativeScript", - "Angular" - ], - "license": "Apache-2.0", - "repository": { - "type": "git", - "url": "https://github.com/NativeScript/nativescript-angular.git" - }, - "bin": { - "update-app-ng-deps": "node_modules/@nativescript/angular/bin/update-app-ng-deps" - }, - "dependencies": { - "@nativescript/angular": "file:../nativescript-angular" - }, - "scripts": { - "pack": "cd ../build && npm pack ../nativescript-angular-package", - "pack-with-scoped-version": "cd ../build/pack-script && npx ts-node index.ts" - } -} \ No newline at end of file +} From d9752012aed184a7596a95c60675fc61783bd08f Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Fri, 11 Oct 2019 17:57:55 +0300 Subject: [PATCH 12/35] chore: rename out tgz file to nativescript-angular-compat.tgz --- build/pack-scripts/pack-compat.ts | 7 ++++- build/pack-scripts/pack-scoped.ts | 51 ++++++++++++++++--------------- 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/build/pack-scripts/pack-compat.ts b/build/pack-scripts/pack-compat.ts index e59836f32..212e1d0ec 100644 --- a/build/pack-scripts/pack-compat.ts +++ b/build/pack-scripts/pack-compat.ts @@ -25,4 +25,9 @@ fs.emptyDirSync(distFolderPath); // cd to dist folder execSync(`npm pack ${nsAngularPackagePath}`, { cwd: distFolderPath -}); \ No newline at end of file +}); + +const fileName = fs.readdirSync(distFolderPath)[0]; +const newName = "nativescript-angular-compat.tgz"; +// rename file +fs.moveSync(`${distFolderPath}/${fileName}`, `${distFolderPath}/${newName}`); diff --git a/build/pack-scripts/pack-scoped.ts b/build/pack-scripts/pack-scoped.ts index e59836f32..cdec977d1 100644 --- a/build/pack-scripts/pack-scoped.ts +++ b/build/pack-scripts/pack-scoped.ts @@ -1,28 +1,31 @@ -import * as path from "path"; -import * as fs from "fs-extra"; -import { execSync } from "child_process"; +// import * as path from "path"; +// import * as fs from "fs-extra"; +// import { execSync } from "child_process"; -// var myArgs = process.argv.slice(2); -var scopedVersion = process.argv[2]; -console.log(`Packing nativescript-angular package with @nativescript/angular: ${scopedVersion}`); +// // var myArgs = process.argv.slice(2); +// var scopedVersion = process.argv[2]; +// console.log(`Packing nativescript-angular package with @nativescript/angular: ${scopedVersion}`); -const distFolderPath = path.resolve("../../dist"); -const nsAngularPackagePath = path.resolve("../../nativescript-angular-package"); -const packageJsonPath = path.resolve(`${nsAngularPackagePath}/package.json`); -console.log("Getting package.json from", packageJsonPath); +// const distFolderPath = path.resolve("../../dist"); +// const nsAngularPackagePath = path.resolve("../../nativescript-angular-package"); +// const packageJsonPath = path.resolve(`${nsAngularPackagePath}/package.json`); +// console.log("Getting package.json from", packageJsonPath); -// rewrite dependency in package.json -const packageJsonObject = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: "utf8" })); -packageJsonObject.dependencies["@nativescript/angular"] = scopedVersion; -fs.writeFileSync(packageJsonPath, JSON.stringify(packageJsonObject, null, 4)); +// // rewrite dependency in package.json +// const packageJsonObject = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: "utf8" })); +// packageJsonObject.dependencies["@nativescript/angular"] = scopedVersion; +// fs.writeFileSync(packageJsonPath, JSON.stringify(packageJsonObject, null, 4)); -// create .tgz in dist folder -execSync(`npm install`, { - cwd: nsAngularPackagePath -}); -// ensures empty ../dist folder -fs.emptyDirSync(distFolderPath); -// cd to dist folder -execSync(`npm pack ${nsAngularPackagePath}`, { - cwd: distFolderPath -}); \ No newline at end of file +// // create .tgz in dist folder +// execSync(`npm install`, { +// cwd: nsAngularPackagePath +// }); +// // ensures empty ../dist folder +// fs.emptyDirSync(distFolderPath); +// // cd to dist folder +// execSync(`npm pack ${nsAngularPackagePath}`, { +// cwd: distFolderPath +// }); + +// console.log("######" + distFolderPath); +// fs.copySync(distFolderPath + "/nativescript-angular-8.3.0.tgz", distFolderPath + "/nativescript-angular-8.3.0.1.tgz") From 1ca8279de17d699a8d2cc9b0177b4657f9e3d25d Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Fri, 11 Oct 2019 18:00:15 +0300 Subject: [PATCH 13/35] fix: comments --- build/pack-scripts/pack-compat.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/build/pack-scripts/pack-compat.ts b/build/pack-scripts/pack-compat.ts index 212e1d0ec..6a60fe1a0 100644 --- a/build/pack-scripts/pack-compat.ts +++ b/build/pack-scripts/pack-compat.ts @@ -7,6 +7,8 @@ var scopedVersion = process.argv[2]; console.log(`Packing nativescript-angular package with @nativescript/angular: ${scopedVersion}`); const distFolderPath = path.resolve("../../dist"); +const outFileName = "nativescript-angular-compat.tgz"; + const nsAngularPackagePath = path.resolve("../../nativescript-angular-package"); const packageJsonPath = path.resolve(`${nsAngularPackagePath}/package.json`); console.log("Getting package.json from", packageJsonPath); @@ -16,18 +18,18 @@ const packageJsonObject = JSON.parse(fs.readFileSync(packageJsonPath, { encoding packageJsonObject.dependencies["@nativescript/angular"] = scopedVersion; fs.writeFileSync(packageJsonPath, JSON.stringify(packageJsonObject, null, 4)); -// create .tgz in dist folder execSync(`npm install`, { cwd: nsAngularPackagePath }); -// ensures empty ../dist folder + +// ensure empty dist folder fs.emptyDirSync(distFolderPath); -// cd to dist folder + +// create .tgz execSync(`npm pack ${nsAngularPackagePath}`, { cwd: distFolderPath }); -const fileName = fs.readdirSync(distFolderPath)[0]; -const newName = "nativescript-angular-compat.tgz"; +const currentFileName = fs.readdirSync(distFolderPath)[0]; // rename file -fs.moveSync(`${distFolderPath}/${fileName}`, `${distFolderPath}/${newName}`); +fs.moveSync(`${distFolderPath}/${currentFileName}`, `${distFolderPath}/${outFileName}`); From 398fbe05883b3bc151cd1a599dd24ff734bf42a8 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Mon, 14 Oct 2019 11:30:37 +0300 Subject: [PATCH 14/35] chore: remove unused npm script --- nativescript-angular-package/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/nativescript-angular-package/package.json b/nativescript-angular-package/package.json index bd7944ca6..d1c2dfe98 100644 --- a/nativescript-angular-package/package.json +++ b/nativescript-angular-package/package.json @@ -34,7 +34,6 @@ "@nativescript/angular": "file:../nativescript-angular" }, "scripts": { - "pack": "cd ../build && npm pack ../nativescript-angular-package", "pack-with-scoped-version": "cd ../build/pack-scripts && npm i && npx ts-node pack-compat.ts" } } From 25954562d0c721bf45a3621d0a3f660fbb0a8c13 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Mon, 14 Oct 2019 12:49:44 +0300 Subject: [PATCH 15/35] chore: add pack script in scoped pckg --- build/pack-scripts/pack-compat.ts | 2 +- nativescript-angular/package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/pack-scripts/pack-compat.ts b/build/pack-scripts/pack-compat.ts index 6a60fe1a0..0bc46eafe 100644 --- a/build/pack-scripts/pack-compat.ts +++ b/build/pack-scripts/pack-compat.ts @@ -18,7 +18,7 @@ const packageJsonObject = JSON.parse(fs.readFileSync(packageJsonPath, { encoding packageJsonObject.dependencies["@nativescript/angular"] = scopedVersion; fs.writeFileSync(packageJsonPath, JSON.stringify(packageJsonObject, null, 4)); -execSync(`npm install`, { +execSync(`npm install --save-exact`, { cwd: nsAngularPackagePath }); diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index 4d5472187..47db98b1b 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -34,6 +34,7 @@ "tsc-w": "tsc -p tsconfig.json -w", "ngc": "ngc -p tsconfig.json", "prepare": "npm run ngc", + "pack": "cd ../dist && npm pack ../nativescript-angular", "version": "rm -rf package-lock.json && conventional-changelog -p angular -i ../CHANGELOG.md -s && git add ../CHANGELOG.md", "typedoc": "typedoc --tsconfig \"./tsconfig.typedoc.json\" --out ./bin/dist/ng-api-reference --includeDeclarations --name \"NativeScript Angular\" --theme ./node_modules/nativescript-typedoc-theme --excludeExternals --externalPattern \"**/+(tns-core-modules|module|declarations).d.ts\"" }, From 5c7f25f6cbb3e3263675784b7c86857956c096b6 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Mon, 14 Oct 2019 13:02:20 +0300 Subject: [PATCH 16/35] fix: ensure dist --- nativescript-angular/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index 47db98b1b..c653f4b1d 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -34,7 +34,7 @@ "tsc-w": "tsc -p tsconfig.json -w", "ngc": "ngc -p tsconfig.json", "prepare": "npm run ngc", - "pack": "cd ../dist && npm pack ../nativescript-angular", + "pack": "mkdir -p ../dist && cd ../dist && npm pack ../nativescript-angular", "version": "rm -rf package-lock.json && conventional-changelog -p angular -i ../CHANGELOG.md -s && git add ../CHANGELOG.md", "typedoc": "typedoc --tsconfig \"./tsconfig.typedoc.json\" --out ./bin/dist/ng-api-reference --includeDeclarations --name \"NativeScript Angular\" --theme ./node_modules/nativescript-typedoc-theme --excludeExternals --externalPattern \"**/+(tns-core-modules|module|declarations).d.ts\"" }, From a49202370b01b14da64db86449b8642c142825a7 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Mon, 14 Oct 2019 13:22:24 +0300 Subject: [PATCH 17/35] chore: build scoped package through nodejs script --- build/pack-scripts/pack-compat.ts | 17 ++++++--- build/pack-scripts/pack-scoped.ts | 62 +++++++++++++++---------------- nativescript-angular/package.json | 2 +- 3 files changed, 43 insertions(+), 38 deletions(-) diff --git a/build/pack-scripts/pack-compat.ts b/build/pack-scripts/pack-compat.ts index 0bc46eafe..9323394d8 100644 --- a/build/pack-scripts/pack-compat.ts +++ b/build/pack-scripts/pack-compat.ts @@ -7,6 +7,7 @@ var scopedVersion = process.argv[2]; console.log(`Packing nativescript-angular package with @nativescript/angular: ${scopedVersion}`); const distFolderPath = path.resolve("../../dist"); +const tempFolderPath = path.resolve("./temp-compat"); const outFileName = "nativescript-angular-compat.tgz"; const nsAngularPackagePath = path.resolve("../../nativescript-angular-package"); @@ -22,14 +23,18 @@ execSync(`npm install --save-exact`, { cwd: nsAngularPackagePath }); -// ensure empty dist folder +// ensure empty temp and dist folders +fs.emptyDirSync(tempFolderPath); fs.emptyDirSync(distFolderPath); -// create .tgz +// create .tgz in temp folder execSync(`npm pack ${nsAngularPackagePath}`, { - cwd: distFolderPath + cwd: tempFolderPath }); -const currentFileName = fs.readdirSync(distFolderPath)[0]; -// rename file -fs.moveSync(`${distFolderPath}/${currentFileName}`, `${distFolderPath}/${outFileName}`); +// assume we have a single file built in temp folder, take its name +const currentFileName = fs.readdirSync(tempFolderPath)[0]; + +// move built file and remove temp folder +fs.moveSync(`${tempFolderPath}/${currentFileName}`, `${distFolderPath}/${outFileName}`); +fs.removeSync(`${tempFolderPath}`); diff --git a/build/pack-scripts/pack-scoped.ts b/build/pack-scripts/pack-scoped.ts index cdec977d1..18f270374 100644 --- a/build/pack-scripts/pack-scoped.ts +++ b/build/pack-scripts/pack-scoped.ts @@ -1,31 +1,31 @@ -// import * as path from "path"; -// import * as fs from "fs-extra"; -// import { execSync } from "child_process"; - -// // var myArgs = process.argv.slice(2); -// var scopedVersion = process.argv[2]; -// console.log(`Packing nativescript-angular package with @nativescript/angular: ${scopedVersion}`); - -// const distFolderPath = path.resolve("../../dist"); -// const nsAngularPackagePath = path.resolve("../../nativescript-angular-package"); -// const packageJsonPath = path.resolve(`${nsAngularPackagePath}/package.json`); -// console.log("Getting package.json from", packageJsonPath); - -// // rewrite dependency in package.json -// const packageJsonObject = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: "utf8" })); -// packageJsonObject.dependencies["@nativescript/angular"] = scopedVersion; -// fs.writeFileSync(packageJsonPath, JSON.stringify(packageJsonObject, null, 4)); - -// // create .tgz in dist folder -// execSync(`npm install`, { -// cwd: nsAngularPackagePath -// }); -// // ensures empty ../dist folder -// fs.emptyDirSync(distFolderPath); -// // cd to dist folder -// execSync(`npm pack ${nsAngularPackagePath}`, { -// cwd: distFolderPath -// }); - -// console.log("######" + distFolderPath); -// fs.copySync(distFolderPath + "/nativescript-angular-8.3.0.tgz", distFolderPath + "/nativescript-angular-8.3.0.1.tgz") +import * as path from "path"; +import * as fs from "fs-extra"; +import { execSync } from "child_process"; + +console.log(`Packing @nativescript/angular package`); + +const distFolderPath = path.resolve("../../dist"); +const tempFolderPath = path.resolve("./temp-scoped"); +const outFileName = "nativescript-angular-scoped.tgz"; + +const nsAngularPackagePath = path.resolve("../../nativescript-angular"); + +execSync(`npm install --save-exact`, { + cwd: nsAngularPackagePath +}); + +// ensure empty temp and dist folders +fs.emptyDirSync(tempFolderPath); +fs.emptyDirSync(distFolderPath); + +// create .tgz in temp folder +execSync(`npm pack ${nsAngularPackagePath}`, { + cwd: tempFolderPath +}); + +// assume we have a single file built in temp folder, take its name +const currentFileName = fs.readdirSync(tempFolderPath)[0]; + +// move built file and remove temp folder +fs.moveSync(`${tempFolderPath}/${currentFileName}`, `${distFolderPath}/${outFileName}`); +fs.removeSync(`${tempFolderPath}`); diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index c653f4b1d..18d4fb659 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -34,7 +34,7 @@ "tsc-w": "tsc -p tsconfig.json -w", "ngc": "ngc -p tsconfig.json", "prepare": "npm run ngc", - "pack": "mkdir -p ../dist && cd ../dist && npm pack ../nativescript-angular", + "pack": "cd ../build/pack-scripts && npm i && npx ts-node pack-scoped.ts", "version": "rm -rf package-lock.json && conventional-changelog -p angular -i ../CHANGELOG.md -s && git add ../CHANGELOG.md", "typedoc": "typedoc --tsconfig \"./tsconfig.typedoc.json\" --out ./bin/dist/ng-api-reference --includeDeclarations --name \"NativeScript Angular\" --theme ./node_modules/nativescript-typedoc-theme --excludeExternals --externalPattern \"**/+(tns-core-modules|module|declarations).d.ts\"" }, From e9e93279e3c87b1c4996ed163f1c9e265255e3bb Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Tue, 15 Oct 2019 10:11:46 +0300 Subject: [PATCH 18/35] chore: update build scripts, fix jenkins build --- .gitignore | 9 +++++++++ build/pack-scripts/pack-compat.ts | 6 +++--- build/pack-scripts/pack-scoped.ts | 4 ++-- e2e/renderer/tsconfig.json | 3 +-- nativescript-angular-package/.npmignore | 12 ++++++++++++ nativescript-angular-package/common.ts | 1 - nativescript-angular-package/common/index.ts | 1 + nativescript-angular-package/index.d.ts | 8 ++++++++ nativescript-angular-package/package.json | 15 ++++++++++++++- nativescript-angular-package/router/index.ts | 2 +- .../router/router.module.ts | 1 + nativescript-angular-package/tsconfig.json | 3 +++ nativescript-angular/package.json | 2 +- 13 files changed, 56 insertions(+), 11 deletions(-) create mode 100644 nativescript-angular-package/.npmignore delete mode 100644 nativescript-angular-package/common.ts create mode 100644 nativescript-angular-package/common/index.ts create mode 100644 nativescript-angular-package/router/router.module.ts diff --git a/.gitignore b/.gitignore index e68d89f93..ca4ea8626 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,15 @@ dist !/nativescript-angular/gulpfile.js !/nativescript-angular/zone-js/dist/*.js +/nativescript-angular-package/**/*.d.ts +/nativescript-angular-package/**/*.js + +!/nativescript-angular-package/global.d.ts +!/nativescript-angular-package/postinstall.js +!/nativescript-angular-package/hooks/**/*.js +!/nativescript-angular-package/gulpfile.js +!/nativescript-angular-package/zone-js/dist/*.js + .tscache .nvm .vscode diff --git a/build/pack-scripts/pack-compat.ts b/build/pack-scripts/pack-compat.ts index 9323394d8..8aef38951 100644 --- a/build/pack-scripts/pack-compat.ts +++ b/build/pack-scripts/pack-compat.ts @@ -23,9 +23,9 @@ execSync(`npm install --save-exact`, { cwd: nsAngularPackagePath }); -// ensure empty temp and dist folders +// ensure empty temp and existing dist folders fs.emptyDirSync(tempFolderPath); -fs.emptyDirSync(distFolderPath); +fs.ensureDirSync(distFolderPath); // create .tgz in temp folder execSync(`npm pack ${nsAngularPackagePath}`, { @@ -36,5 +36,5 @@ execSync(`npm pack ${nsAngularPackagePath}`, { const currentFileName = fs.readdirSync(tempFolderPath)[0]; // move built file and remove temp folder -fs.moveSync(`${tempFolderPath}/${currentFileName}`, `${distFolderPath}/${outFileName}`); +fs.moveSync(`${tempFolderPath}/${currentFileName}`, `${distFolderPath}/${outFileName}`, { overwrite: true }); fs.removeSync(`${tempFolderPath}`); diff --git a/build/pack-scripts/pack-scoped.ts b/build/pack-scripts/pack-scoped.ts index 18f270374..fe72a16a4 100644 --- a/build/pack-scripts/pack-scoped.ts +++ b/build/pack-scripts/pack-scoped.ts @@ -16,7 +16,7 @@ execSync(`npm install --save-exact`, { // ensure empty temp and dist folders fs.emptyDirSync(tempFolderPath); -fs.emptyDirSync(distFolderPath); +fs.ensureDirSync(distFolderPath); // create .tgz in temp folder execSync(`npm pack ${nsAngularPackagePath}`, { @@ -27,5 +27,5 @@ execSync(`npm pack ${nsAngularPackagePath}`, { const currentFileName = fs.readdirSync(tempFolderPath)[0]; // move built file and remove temp folder -fs.moveSync(`${tempFolderPath}/${currentFileName}`, `${distFolderPath}/${outFileName}`); +fs.moveSync(`${tempFolderPath}/${currentFileName}`, `${distFolderPath}/${outFileName}`, { overwrite: true }); fs.removeSync(`${tempFolderPath}`); diff --git a/e2e/renderer/tsconfig.json b/e2e/renderer/tsconfig.json index 65295d0f2..ee608ce77 100644 --- a/e2e/renderer/tsconfig.json +++ b/e2e/renderer/tsconfig.json @@ -23,8 +23,7 @@ } }, "include": [ - "../../nativescript-angular-package", - "../../nativescript-angular", + "./node_modules/nativescript-angular", "**/*" ], "exclude": [ diff --git a/nativescript-angular-package/.npmignore b/nativescript-angular-package/.npmignore new file mode 100644 index 000000000..cfeb641a3 --- /dev/null +++ b/nativescript-angular-package/.npmignore @@ -0,0 +1,12 @@ +*.tgz + +*.ts +!*.d.ts + +*.js.map + +tsconfig.json +global.d.ts +.npmignore +gulpfile.js +tslint.json diff --git a/nativescript-angular-package/common.ts b/nativescript-angular-package/common.ts deleted file mode 100644 index 8734f5c94..000000000 --- a/nativescript-angular-package/common.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/common"; \ No newline at end of file diff --git a/nativescript-angular-package/common/index.ts b/nativescript-angular-package/common/index.ts new file mode 100644 index 000000000..c78d3aac7 --- /dev/null +++ b/nativescript-angular-package/common/index.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/common"; diff --git a/nativescript-angular-package/index.d.ts b/nativescript-angular-package/index.d.ts index 053585d6a..03145e814 100644 --- a/nativescript-angular-package/index.d.ts +++ b/nativescript-angular-package/index.d.ts @@ -1 +1,9 @@ export * from "@nativescript/angular"; +export * from "@nativescript/angular/forms"; +export * from "@nativescript/angular/router"; +export * from "@nativescript/angular/file-system/ns-file-system"; +export * from "@nativescript/angular/modal-dialog"; +export * from "@nativescript/angular/forms/value-accessors/base-value-accessor"; +export * from "@nativescript/angular/trace"; +export * from "@nativescript/angular/renderer"; +export * from "@nativescript/angular/view-util"; diff --git a/nativescript-angular-package/package.json b/nativescript-angular-package/package.json index d1c2dfe98..3857e8ab5 100644 --- a/nativescript-angular-package/package.json +++ b/nativescript-angular-package/package.json @@ -33,7 +33,20 @@ "dependencies": { "@nativescript/angular": "file:../nativescript-angular" }, + "devDependencies": { + "@angular/animations": "~8.2.0", + "@angular/common": "~8.2.0", + "@angular/compiler": "~8.2.0", + "@angular/compiler-cli": "~8.2.0", + "@angular/core": "~8.2.0", + "@angular/forms": "~8.2.0", + "@angular/platform-browser": "~8.2.0", + "@angular/platform-browser-dynamic": "~8.2.0", + "@angular/router": "~8.2.0", + "rxjs": "^6.4.0", + "tns-core-modules": "next" + }, "scripts": { - "pack-with-scoped-version": "cd ../build/pack-scripts && npm i && npx ts-node pack-compat.ts" + "pack-with-scoped-version": "npm i && tsc && cd ../build/pack-scripts && npm i && npx ts-node pack-compat.ts" } } diff --git a/nativescript-angular-package/router/index.ts b/nativescript-angular-package/router/index.ts index 77b052733..0959f3730 100644 --- a/nativescript-angular-package/router/index.ts +++ b/nativescript-angular-package/router/index.ts @@ -1 +1 @@ -export * from "@nativescript/angular/router"; +export * from "@nativescript/angular/router"; \ No newline at end of file diff --git a/nativescript-angular-package/router/router.module.ts b/nativescript-angular-package/router/router.module.ts new file mode 100644 index 000000000..69bd311cc --- /dev/null +++ b/nativescript-angular-package/router/router.module.ts @@ -0,0 +1 @@ +export { LocationState } from "@nativescript/angular/router/ns-location-strategy"; \ No newline at end of file diff --git a/nativescript-angular-package/tsconfig.json b/nativescript-angular-package/tsconfig.json index 903f75e65..b128b871a 100644 --- a/nativescript-angular-package/tsconfig.json +++ b/nativescript-angular-package/tsconfig.json @@ -27,5 +27,8 @@ }, "include": [ "**/*.ts" + ], + "exclude":[ + "node_modules/*" ] } diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index 18d4fb659..4da044568 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -34,7 +34,7 @@ "tsc-w": "tsc -p tsconfig.json -w", "ngc": "ngc -p tsconfig.json", "prepare": "npm run ngc", - "pack": "cd ../build/pack-scripts && npm i && npx ts-node pack-scoped.ts", + "pack": "npm i && tsc && cd ../build/pack-scripts && npm i && npx ts-node pack-scoped.ts", "version": "rm -rf package-lock.json && conventional-changelog -p angular -i ../CHANGELOG.md -s && git add ../CHANGELOG.md", "typedoc": "typedoc --tsconfig \"./tsconfig.typedoc.json\" --out ./bin/dist/ng-api-reference --includeDeclarations --name \"NativeScript Angular\" --theme ./node_modules/nativescript-typedoc-theme --excludeExternals --externalPattern \"**/+(tns-core-modules|module|declarations).d.ts\"" }, From 63872d8944cb56c3e71b15259eea326859637e71 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Tue, 15 Oct 2019 16:40:31 +0300 Subject: [PATCH 19/35] fix: try to fix error in jenkins --- nativescript-angular-package/package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nativescript-angular-package/package.json b/nativescript-angular-package/package.json index 3857e8ab5..028cb0d41 100644 --- a/nativescript-angular-package/package.json +++ b/nativescript-angular-package/package.json @@ -44,9 +44,11 @@ "@angular/platform-browser-dynamic": "~8.2.0", "@angular/router": "~8.2.0", "rxjs": "^6.4.0", - "tns-core-modules": "next" + "tns-core-modules": "next", + "typescript": "~3.5.3" }, "scripts": { - "pack-with-scoped-version": "npm i && tsc && cd ../build/pack-scripts && npm i && npx ts-node pack-compat.ts" + "ngc": "ngc -p tsconfig.json", + "pack-with-scoped-version": "npm i && tsc && npm run ngc && cd ../build/pack-scripts && npm i && npx ts-node pack-compat.ts" } } From faede8a76a291291530e4f9efa9b08069cb52e98 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Thu, 17 Oct 2019 11:34:51 +0300 Subject: [PATCH 20/35] fix: remove bin prop from compat so that npm flattens scoped deps in node_modules --- nativescript-angular-package/package.json | 3 -- nativescript-angular/hooks/before-livesync.js | 3 -- nativescript-angular/hooks/hook-helper.js | 33 ------------------- nativescript-angular/package.json | 1 - nativescript-angular/postinstall.js | 17 ---------- 5 files changed, 57 deletions(-) delete mode 100644 nativescript-angular/hooks/before-livesync.js delete mode 100644 nativescript-angular/hooks/hook-helper.js delete mode 100644 nativescript-angular/postinstall.js diff --git a/nativescript-angular-package/package.json b/nativescript-angular-package/package.json index 028cb0d41..55e8139d2 100644 --- a/nativescript-angular-package/package.json +++ b/nativescript-angular-package/package.json @@ -27,9 +27,6 @@ "type": "git", "url": "https://github.com/NativeScript/nativescript-angular.git" }, - "bin": { - "update-app-ng-deps": "node_modules/@nativescript/angular/bin/update-app-ng-deps" - }, "dependencies": { "@nativescript/angular": "file:../nativescript-angular" }, diff --git a/nativescript-angular/hooks/before-livesync.js b/nativescript-angular/hooks/before-livesync.js deleted file mode 100644 index 9642f1c12..000000000 --- a/nativescript-angular/hooks/before-livesync.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function ($usbLiveSyncService) { - $usbLiveSyncService.forceExecuteFullSync = false; -}; diff --git a/nativescript-angular/hooks/hook-helper.js b/nativescript-angular/hooks/hook-helper.js deleted file mode 100644 index 3a23ae688..000000000 --- a/nativescript-angular/hooks/hook-helper.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -var fs = require("fs"); -var path = require("path"); - -exports.findProjectDir = function findProjectDir() { - var candidateDir = path.join(__dirname, ".."); - while (true) { - var oldCandidateDir = candidateDir; - candidateDir = path.dirname(candidateDir); - if (path.basename(candidateDir) === 'node_modules') { - continue; - } - var packageJsonFile = path.join(candidateDir, 'package.json'); - if (fs.existsSync(packageJsonFile)) { - return candidateDir; - } - if (oldCandidateDir === candidateDir) { - return; - } - } -}; - -exports.getHooksDir = function getHooksDir() { - return path.join(exports.findProjectDir(), 'hooks'); -}; - -exports.getBeforeLivesyncHookDir = function getBeforeLivesyncHookDir() { - return path.join(exports.getHooksDir(), "before-livesync"); -}; - -exports.getHookFilePath = function getHookFilePath() { - return path.join(exports.getBeforeLivesyncHookDir(), "nativescript-angular-sync.js"); -}; diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index 4da044568..ccbec7234 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -29,7 +29,6 @@ }, "scripts": { "tslint": "tslint --project tsconfig.json --config tslint.json", - "postinstall": "node postinstall.js", "tsc": "tsc -p tsconfig.json", "tsc-w": "tsc -p tsconfig.json -w", "ngc": "ngc -p tsconfig.json", diff --git a/nativescript-angular/postinstall.js b/nativescript-angular/postinstall.js deleted file mode 100644 index c0eb367da..000000000 --- a/nativescript-angular/postinstall.js +++ /dev/null @@ -1,17 +0,0 @@ -var fs = require("fs"); -var os = require("os"); -var hookHelper = require("./hooks/hook-helper"); -var projectDir = hookHelper.findProjectDir(); - -if (projectDir) { - var hooksDir = hookHelper.getHooksDir(), - beforeLivesyncHookDir = hookHelper.getBeforeLivesyncHookDir(), - content = 'module.exports = require("nativescript-angular/hooks/before-livesync");'; - if (!fs.existsSync(hooksDir)) { - fs.mkdirSync(hooksDir); - } - if (!fs.existsSync(beforeLivesyncHookDir)) { - fs.mkdirSync(beforeLivesyncHookDir); - } - fs.writeFileSync(hookHelper.getHookFilePath(), content + os.EOL); -} From ddefe0e5d00722fdc7dd715f8a2a91df5122bff9 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Thu, 17 Oct 2019 14:30:32 +0300 Subject: [PATCH 21/35] cleanup: wrongly committed files --- nativescript-angular-package/animations/index.d.ts | 1 - nativescript-angular-package/animations/index.js | 6 ------ nativescript-angular-package/directives/index.d.ts | 1 - nativescript-angular-package/directives/index.js | 6 ------ .../file-system/ns-file-system.d.ts | 1 - .../file-system/ns-file-system.js | 6 ------ nativescript-angular-package/forms/index.d.ts | 1 - nativescript-angular-package/forms/index.js | 6 ------ .../forms/value-accessors/index.d.ts | 1 - .../forms/value-accessors/index.js | 6 ------ nativescript-angular-package/http-client/index.d.ts | 1 - nativescript-angular-package/http-client/index.js | 6 ------ nativescript-angular-package/index.d.ts | 9 --------- nativescript-angular-package/index.js | 6 ------ nativescript-angular-package/nativescript.module.d.ts | 1 - nativescript-angular-package/nativescript.module.js | 6 ------ nativescript-angular-package/platform-static.d.ts | 1 - nativescript-angular-package/platform-static.js | 6 ------ nativescript-angular-package/platform.d.ts | 1 - nativescript-angular-package/platform.js | 6 ------ nativescript-angular-package/router/index.d.ts | 1 - nativescript-angular-package/router/index.js | 6 ------ .../router/ns-location-strategy.d.ts | 1 - .../router/ns-location-strategy.js | 6 ------ nativescript-angular-package/testing/index.d.ts | 1 - nativescript-angular-package/testing/index.js | 6 ------ .../src/nativescript_test_component_renderer.d.ts | 1 - .../testing/src/nativescript_test_component_renderer.js | 6 ------ nativescript-angular-package/testing/src/util.d.ts | 1 - nativescript-angular-package/testing/src/util.js | 6 ------ nativescript-angular-package/trace.d.ts | 1 - nativescript-angular-package/trace.js | 6 ------ .../value-accessors/base-value-accessor.d.ts | 1 - .../value-accessors/base-value-accessor.js | 8 -------- .../zone-js/testing.jasmine.d.ts | 2 -- nativescript-angular-package/zone-js/testing.jasmine.js | 5 ----- nativescript-angular-package/zone-js/testing.mocha.d.ts | 2 -- nativescript-angular-package/zone-js/testing.mocha.js | 4 ---- 38 files changed, 142 deletions(-) delete mode 100644 nativescript-angular-package/animations/index.d.ts delete mode 100644 nativescript-angular-package/animations/index.js delete mode 100644 nativescript-angular-package/directives/index.d.ts delete mode 100644 nativescript-angular-package/directives/index.js delete mode 100644 nativescript-angular-package/file-system/ns-file-system.d.ts delete mode 100644 nativescript-angular-package/file-system/ns-file-system.js delete mode 100644 nativescript-angular-package/forms/index.d.ts delete mode 100644 nativescript-angular-package/forms/index.js delete mode 100644 nativescript-angular-package/forms/value-accessors/index.d.ts delete mode 100644 nativescript-angular-package/forms/value-accessors/index.js delete mode 100644 nativescript-angular-package/http-client/index.d.ts delete mode 100644 nativescript-angular-package/http-client/index.js delete mode 100644 nativescript-angular-package/index.d.ts delete mode 100644 nativescript-angular-package/index.js delete mode 100644 nativescript-angular-package/nativescript.module.d.ts delete mode 100644 nativescript-angular-package/nativescript.module.js delete mode 100644 nativescript-angular-package/platform-static.d.ts delete mode 100644 nativescript-angular-package/platform-static.js delete mode 100644 nativescript-angular-package/platform.d.ts delete mode 100644 nativescript-angular-package/platform.js delete mode 100644 nativescript-angular-package/router/index.d.ts delete mode 100644 nativescript-angular-package/router/index.js delete mode 100644 nativescript-angular-package/router/ns-location-strategy.d.ts delete mode 100644 nativescript-angular-package/router/ns-location-strategy.js delete mode 100644 nativescript-angular-package/testing/index.d.ts delete mode 100644 nativescript-angular-package/testing/index.js delete mode 100644 nativescript-angular-package/testing/src/nativescript_test_component_renderer.d.ts delete mode 100644 nativescript-angular-package/testing/src/nativescript_test_component_renderer.js delete mode 100644 nativescript-angular-package/testing/src/util.d.ts delete mode 100644 nativescript-angular-package/testing/src/util.js delete mode 100644 nativescript-angular-package/trace.d.ts delete mode 100644 nativescript-angular-package/trace.js delete mode 100644 nativescript-angular-package/value-accessors/base-value-accessor.d.ts delete mode 100644 nativescript-angular-package/value-accessors/base-value-accessor.js delete mode 100644 nativescript-angular-package/zone-js/testing.jasmine.d.ts delete mode 100644 nativescript-angular-package/zone-js/testing.jasmine.js delete mode 100644 nativescript-angular-package/zone-js/testing.mocha.d.ts delete mode 100644 nativescript-angular-package/zone-js/testing.mocha.js diff --git a/nativescript-angular-package/animations/index.d.ts b/nativescript-angular-package/animations/index.d.ts deleted file mode 100644 index 22c163ab5..000000000 --- a/nativescript-angular-package/animations/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/animations"; diff --git a/nativescript-angular-package/animations/index.js b/nativescript-angular-package/animations/index.js deleted file mode 100644 index 88c23833a..000000000 --- a/nativescript-angular-package/animations/index.js +++ /dev/null @@ -1,6 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("@nativescript/angular/animations")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/directives/index.d.ts b/nativescript-angular-package/directives/index.d.ts deleted file mode 100644 index 11ddf0fbc..000000000 --- a/nativescript-angular-package/directives/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/directives"; diff --git a/nativescript-angular-package/directives/index.js b/nativescript-angular-package/directives/index.js deleted file mode 100644 index 53c96fb1a..000000000 --- a/nativescript-angular-package/directives/index.js +++ /dev/null @@ -1,6 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("@nativescript/angular/directives")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/file-system/ns-file-system.d.ts b/nativescript-angular-package/file-system/ns-file-system.d.ts deleted file mode 100644 index 72ca4fd50..000000000 --- a/nativescript-angular-package/file-system/ns-file-system.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/file-system/ns-file-system"; diff --git a/nativescript-angular-package/file-system/ns-file-system.js b/nativescript-angular-package/file-system/ns-file-system.js deleted file mode 100644 index d76860636..000000000 --- a/nativescript-angular-package/file-system/ns-file-system.js +++ /dev/null @@ -1,6 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("@nativescript/angular/file-system/ns-file-system")); -//# sourceMappingURL=ns-file-system.js.map \ No newline at end of file diff --git a/nativescript-angular-package/forms/index.d.ts b/nativescript-angular-package/forms/index.d.ts deleted file mode 100644 index eb2a2e738..000000000 --- a/nativescript-angular-package/forms/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/forms"; diff --git a/nativescript-angular-package/forms/index.js b/nativescript-angular-package/forms/index.js deleted file mode 100644 index d2e7e160d..000000000 --- a/nativescript-angular-package/forms/index.js +++ /dev/null @@ -1,6 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("@nativescript/angular/forms")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/forms/value-accessors/index.d.ts b/nativescript-angular-package/forms/value-accessors/index.d.ts deleted file mode 100644 index 6c194379f..000000000 --- a/nativescript-angular-package/forms/value-accessors/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/forms/value-accessors"; diff --git a/nativescript-angular-package/forms/value-accessors/index.js b/nativescript-angular-package/forms/value-accessors/index.js deleted file mode 100644 index f069f68a1..000000000 --- a/nativescript-angular-package/forms/value-accessors/index.js +++ /dev/null @@ -1,6 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("@nativescript/angular/forms/value-accessors")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/http-client/index.d.ts b/nativescript-angular-package/http-client/index.d.ts deleted file mode 100644 index fdc589afb..000000000 --- a/nativescript-angular-package/http-client/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/http-client"; diff --git a/nativescript-angular-package/http-client/index.js b/nativescript-angular-package/http-client/index.js deleted file mode 100644 index 643a1c99c..000000000 --- a/nativescript-angular-package/http-client/index.js +++ /dev/null @@ -1,6 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("@nativescript/angular/http-client")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/index.d.ts b/nativescript-angular-package/index.d.ts deleted file mode 100644 index 03145e814..000000000 --- a/nativescript-angular-package/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * from "@nativescript/angular"; -export * from "@nativescript/angular/forms"; -export * from "@nativescript/angular/router"; -export * from "@nativescript/angular/file-system/ns-file-system"; -export * from "@nativescript/angular/modal-dialog"; -export * from "@nativescript/angular/forms/value-accessors/base-value-accessor"; -export * from "@nativescript/angular/trace"; -export * from "@nativescript/angular/renderer"; -export * from "@nativescript/angular/view-util"; diff --git a/nativescript-angular-package/index.js b/nativescript-angular-package/index.js deleted file mode 100644 index 213789b35..000000000 --- a/nativescript-angular-package/index.js +++ /dev/null @@ -1,6 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("@nativescript/angular")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/nativescript.module.d.ts b/nativescript-angular-package/nativescript.module.d.ts deleted file mode 100644 index 14f180d77..000000000 --- a/nativescript-angular-package/nativescript.module.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/nativescript.module"; diff --git a/nativescript-angular-package/nativescript.module.js b/nativescript-angular-package/nativescript.module.js deleted file mode 100644 index c7fd7e7c9..000000000 --- a/nativescript-angular-package/nativescript.module.js +++ /dev/null @@ -1,6 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("@nativescript/angular/nativescript.module")); -//# sourceMappingURL=nativescript.module.js.map \ No newline at end of file diff --git a/nativescript-angular-package/platform-static.d.ts b/nativescript-angular-package/platform-static.d.ts deleted file mode 100644 index 2f00f47df..000000000 --- a/nativescript-angular-package/platform-static.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/platform-static"; diff --git a/nativescript-angular-package/platform-static.js b/nativescript-angular-package/platform-static.js deleted file mode 100644 index d964e5e48..000000000 --- a/nativescript-angular-package/platform-static.js +++ /dev/null @@ -1,6 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("@nativescript/angular/platform-static")); -//# sourceMappingURL=platform-static.js.map \ No newline at end of file diff --git a/nativescript-angular-package/platform.d.ts b/nativescript-angular-package/platform.d.ts deleted file mode 100644 index 9dc2cb01d..000000000 --- a/nativescript-angular-package/platform.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/platform"; diff --git a/nativescript-angular-package/platform.js b/nativescript-angular-package/platform.js deleted file mode 100644 index fd8886184..000000000 --- a/nativescript-angular-package/platform.js +++ /dev/null @@ -1,6 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("@nativescript/angular/platform")); -//# sourceMappingURL=platform.js.map \ No newline at end of file diff --git a/nativescript-angular-package/router/index.d.ts b/nativescript-angular-package/router/index.d.ts deleted file mode 100644 index 77b052733..000000000 --- a/nativescript-angular-package/router/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/router"; diff --git a/nativescript-angular-package/router/index.js b/nativescript-angular-package/router/index.js deleted file mode 100644 index e89617aa4..000000000 --- a/nativescript-angular-package/router/index.js +++ /dev/null @@ -1,6 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("@nativescript/angular/router")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/router/ns-location-strategy.d.ts b/nativescript-angular-package/router/ns-location-strategy.d.ts deleted file mode 100644 index 24a9e237b..000000000 --- a/nativescript-angular-package/router/ns-location-strategy.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/router/ns-location-strategy"; diff --git a/nativescript-angular-package/router/ns-location-strategy.js b/nativescript-angular-package/router/ns-location-strategy.js deleted file mode 100644 index a5b0855e1..000000000 --- a/nativescript-angular-package/router/ns-location-strategy.js +++ /dev/null @@ -1,6 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("@nativescript/angular/router/ns-location-strategy")); -//# sourceMappingURL=ns-location-strategy.js.map \ No newline at end of file diff --git a/nativescript-angular-package/testing/index.d.ts b/nativescript-angular-package/testing/index.d.ts deleted file mode 100644 index 081f86727..000000000 --- a/nativescript-angular-package/testing/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/testing"; diff --git a/nativescript-angular-package/testing/index.js b/nativescript-angular-package/testing/index.js deleted file mode 100644 index 8cc533f24..000000000 --- a/nativescript-angular-package/testing/index.js +++ /dev/null @@ -1,6 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("@nativescript/angular/testing")); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/nativescript-angular-package/testing/src/nativescript_test_component_renderer.d.ts b/nativescript-angular-package/testing/src/nativescript_test_component_renderer.d.ts deleted file mode 100644 index 3693f4083..000000000 --- a/nativescript-angular-package/testing/src/nativescript_test_component_renderer.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/testing/src/nativescript_test_component_renderer"; diff --git a/nativescript-angular-package/testing/src/nativescript_test_component_renderer.js b/nativescript-angular-package/testing/src/nativescript_test_component_renderer.js deleted file mode 100644 index be0b3e9c5..000000000 --- a/nativescript-angular-package/testing/src/nativescript_test_component_renderer.js +++ /dev/null @@ -1,6 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("@nativescript/angular/testing/src/nativescript_test_component_renderer")); -//# sourceMappingURL=nativescript_test_component_renderer.js.map \ No newline at end of file diff --git a/nativescript-angular-package/testing/src/util.d.ts b/nativescript-angular-package/testing/src/util.d.ts deleted file mode 100644 index 42234d6e5..000000000 --- a/nativescript-angular-package/testing/src/util.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/testing/src/util"; diff --git a/nativescript-angular-package/testing/src/util.js b/nativescript-angular-package/testing/src/util.js deleted file mode 100644 index 6b092e87f..000000000 --- a/nativescript-angular-package/testing/src/util.js +++ /dev/null @@ -1,6 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("@nativescript/angular/testing/src/util")); -//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/nativescript-angular-package/trace.d.ts b/nativescript-angular-package/trace.d.ts deleted file mode 100644 index b84be0630..000000000 --- a/nativescript-angular-package/trace.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/trace"; diff --git a/nativescript-angular-package/trace.js b/nativescript-angular-package/trace.js deleted file mode 100644 index a3a33b970..000000000 --- a/nativescript-angular-package/trace.js +++ /dev/null @@ -1,6 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("@nativescript/angular/trace")); -//# sourceMappingURL=trace.js.map \ No newline at end of file diff --git a/nativescript-angular-package/value-accessors/base-value-accessor.d.ts b/nativescript-angular-package/value-accessors/base-value-accessor.d.ts deleted file mode 100644 index 70e0fa328..000000000 --- a/nativescript-angular-package/value-accessors/base-value-accessor.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "@nativescript/angular/forms/value-accessors/base-value-accessor"; diff --git a/nativescript-angular-package/value-accessors/base-value-accessor.js b/nativescript-angular-package/value-accessors/base-value-accessor.js deleted file mode 100644 index aec3a0abb..000000000 --- a/nativescript-angular-package/value-accessors/base-value-accessor.js +++ /dev/null @@ -1,8 +0,0 @@ -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -// This file is only for compatibility with pre 4.4.0 releases. -// Please use "nativescript-angular/forms/value-accessors/base-value-accessor" -__export(require("@nativescript/angular/forms/value-accessors/base-value-accessor")); -//# sourceMappingURL=base-value-accessor.js.map \ No newline at end of file diff --git a/nativescript-angular-package/zone-js/testing.jasmine.d.ts b/nativescript-angular-package/zone-js/testing.jasmine.d.ts deleted file mode 100644 index 80c58274d..000000000 --- a/nativescript-angular-package/zone-js/testing.jasmine.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import "@nativescript/angular/platform"; -import "@nativescript/angular/dist/zone-nativescript.jasmine.js"; diff --git a/nativescript-angular-package/zone-js/testing.jasmine.js b/nativescript-angular-package/zone-js/testing.jasmine.js deleted file mode 100644 index e280ced3c..000000000 --- a/nativescript-angular-package/zone-js/testing.jasmine.js +++ /dev/null @@ -1,5 +0,0 @@ -Object.defineProperty(exports, "__esModule", { value: true }); -// Bootstrap helper module for jasmine spec tests -require("@nativescript/angular/platform"); -require("@nativescript/angular/dist/zone-nativescript.jasmine.js"); -//# sourceMappingURL=testing.jasmine.js.map \ No newline at end of file diff --git a/nativescript-angular-package/zone-js/testing.mocha.d.ts b/nativescript-angular-package/zone-js/testing.mocha.d.ts deleted file mode 100644 index f91c4168b..000000000 --- a/nativescript-angular-package/zone-js/testing.mocha.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import "@nativescript/angular/platform"; -import "@nativescript/angular/dist/zone-nativescript.mocha.js"; diff --git a/nativescript-angular-package/zone-js/testing.mocha.js b/nativescript-angular-package/zone-js/testing.mocha.js deleted file mode 100644 index 07554f862..000000000 --- a/nativescript-angular-package/zone-js/testing.mocha.js +++ /dev/null @@ -1,4 +0,0 @@ -Object.defineProperty(exports, "__esModule", { value: true }); -require("@nativescript/angular/platform"); -require("@nativescript/angular/dist/zone-nativescript.mocha.js"); -//# sourceMappingURL=testing.mocha.js.map \ No newline at end of file From 8174558730835f5908176bdcb3ea1015bc555016 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Thu, 17 Oct 2019 14:42:14 +0300 Subject: [PATCH 22/35] fix: revert tns-ios and tns-android versions in package jsons --- e2e/animation-examples/package.json | 2 +- e2e/nested-router-tab-view/package.json | 5 +---- e2e/renderer/package.json | 5 +---- e2e/routable-animations/package.json | 5 +---- e2e/router-tab-view/package.json | 5 +---- e2e/router/package.json | 5 +---- e2e/single-page/package.json | 5 +---- ng-sample/package.json | 5 +---- tests/package.json | 8 +------- 9 files changed, 9 insertions(+), 36 deletions(-) diff --git a/e2e/animation-examples/package.json b/e2e/animation-examples/package.json index 1406a75c5..126f35fa3 100644 --- a/e2e/animation-examples/package.json +++ b/e2e/animation-examples/package.json @@ -6,7 +6,7 @@ "nativescript": { "id": "org.nativescript.ng4animations", "tns-ios": { - "version": "6.1.1" + "version": "latest" }, "tns-android": { "version": "latest" diff --git a/e2e/nested-router-tab-view/package.json b/e2e/nested-router-tab-view/package.json index 4dadc8300..6e78669c1 100644 --- a/e2e/nested-router-tab-view/package.json +++ b/e2e/nested-router-tab-view/package.json @@ -4,10 +4,7 @@ "readme": "NativeScript Application", "repository": "", "nativescript": { - "id": "org.nativescript.nestedroutertabview", - "tns-ios": { - "version": "6.1.1" - } + "id": "org.nativescript.nestedroutertabview" }, "dependencies": { "@angular/animations": "~8.2.0", diff --git a/e2e/renderer/package.json b/e2e/renderer/package.json index dbb60c328..4b03e0682 100644 --- a/e2e/renderer/package.json +++ b/e2e/renderer/package.json @@ -4,10 +4,7 @@ "readme": "NativeScript Application", "repository": "", "nativescript": { - "id": "org.nativescript.renderer", - "tns-ios": { - "version": "6.1.1" - } + "id": "org.nativescript.renderer" }, "dependencies": { "@angular/animations": "~8.2.0", diff --git a/e2e/routable-animations/package.json b/e2e/routable-animations/package.json index f5ee83e44..381f54d74 100644 --- a/e2e/routable-animations/package.json +++ b/e2e/routable-animations/package.json @@ -4,10 +4,7 @@ "readme": "NativeScript Application", "repository": "", "nativescript": { - "id": "org.nativescript.nsroanimations", - "tns-ios": { - "version": "6.1.1" - } + "id": "org.nativescript.nsroanimations" }, "dependencies": { "@angular/animations": "~8.2.0", diff --git a/e2e/router-tab-view/package.json b/e2e/router-tab-view/package.json index 3dd3759ca..4d6ffa494 100644 --- a/e2e/router-tab-view/package.json +++ b/e2e/router-tab-view/package.json @@ -4,10 +4,7 @@ "readme": "NativeScript Application", "repository": "", "nativescript": { - "id": "org.nativescript.routertabview", - "tns-ios": { - "version": "6.1.1" - } + "id": "org.nativescript.routertabview" }, "dependencies": { "@angular/animations": "~8.2.0", diff --git a/e2e/router/package.json b/e2e/router/package.json index 0e9615bca..e4e5126aa 100644 --- a/e2e/router/package.json +++ b/e2e/router/package.json @@ -4,10 +4,7 @@ "readme": "NativeScript Application", "repository": "", "nativescript": { - "id": "org.nativescript.router", - "tns-ios": { - "version": "6.1.1" - } + "id": "org.nativescript.router" }, "dependencies": { "@angular/animations": "~8.2.0", diff --git a/e2e/single-page/package.json b/e2e/single-page/package.json index 55719ded9..a1de11d9a 100644 --- a/e2e/single-page/package.json +++ b/e2e/single-page/package.json @@ -4,10 +4,7 @@ "readme": "NativeScript Application", "repository": "", "nativescript": { - "id": "org.nativescript.singlepage", - "tns-ios": { - "version": "6.1.1" - } + "id": "org.nativescript.singlepage" }, "dependencies": { "@angular/animations": "~8.2.0", diff --git a/ng-sample/package.json b/ng-sample/package.json index 3ee18ca2e..8dbf3d5ae 100644 --- a/ng-sample/package.json +++ b/ng-sample/package.json @@ -1,9 +1,6 @@ { "nativescript": { - "id": "org.nativescript.ngsample", - "tns-ios": { - "version": "6.1.1" - } + "id": "org.nativescript.ngsample" }, "name": "tns-template-hello-world", "main": "app.js", diff --git a/tests/package.json b/tests/package.json index 416795986..38882a76f 100644 --- a/tests/package.json +++ b/tests/package.json @@ -1,12 +1,6 @@ { "nativescript": { - "id": "org.nativescript.ngtests", - "tns-ios": { - "version": "6.1.1" - }, - "tns-android": { - "version": "6.1.2" - } + "id": "org.nativescript.ngtests" }, "name": "ngtests", "version": "1.0.0", From 0a25c40d0ddc9d424983f60f1e27c897fed8b32a Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Thu, 17 Oct 2019 15:42:20 +0300 Subject: [PATCH 23/35] chore: export most types from root scope of the scoped package --- e2e/router-tab-view/package.json | 11 +++++------ nativescript-angular/file-system/index.ts | 1 + nativescript-angular/index.ts | 5 +++++ 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 nativescript-angular/file-system/index.ts diff --git a/e2e/router-tab-view/package.json b/e2e/router-tab-view/package.json index 4d6ffa494..fc1120b74 100644 --- a/e2e/router-tab-view/package.json +++ b/e2e/router-tab-view/package.json @@ -23,8 +23,6 @@ "zone.js": "^0.9.1" }, "devDependencies": { - "@angular/compiler-cli": "8.2.0", - "@ngtools/webpack": "8.2.0", "@types/chai": "~4.1.7", "@types/mocha": "~5.2.5", "@types/node": "~10.12.18", @@ -35,12 +33,13 @@ "mocha": "~5.2.0", "mochawesome": "~3.1.2", "nativescript-dev-appium": "^6.0.0", - "nativescript-dev-webpack": "^1.3.0-next-2019-10-02-144239-03", - "typescript": "~3.5.3" + "nativescript-dev-webpack": "next", + "typescript": "~3.5.3", + "@angular/compiler-cli": "~8.2.0", + "@ngtools/webpack": "~8.2.0" }, "scripts": { "e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json", - "compile-tests": "tsc -p e2e --watch", - "update-app-ng-deps": "update-app-ng-deps" + "compile-tests": "tsc -p e2e --watch" } } diff --git a/nativescript-angular/file-system/index.ts b/nativescript-angular/file-system/index.ts new file mode 100644 index 000000000..e0e3dc687 --- /dev/null +++ b/nativescript-angular/file-system/index.ts @@ -0,0 +1 @@ +export * from "./ns-file-system"; diff --git a/nativescript-angular/index.ts b/nativescript-angular/index.ts index e217aa056..a9b23ecfd 100644 --- a/nativescript-angular/index.ts +++ b/nativescript-angular/index.ts @@ -9,6 +9,11 @@ export * from "./resource-loader"; export * from "./nativescript.module"; export * from "./common"; +export * from "./router"; +export * from "./file-system"; +export * from "./http-client"; +export * from "./forms"; + export { ViewClass, ViewClassMeta, From 916bc85e5659bd48f32eb00919af7f9dafdfc8da Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Thu, 17 Oct 2019 17:49:04 +0300 Subject: [PATCH 24/35] chore: add platform common exports in compat, clean ups --- e2e/renderer/tsconfig.json | 3 ++- nativescript-angular-package/platform-common.ts | 1 + nativescript-angular/http-client/http-client.module.ts | 4 ---- ng-sample/package.json | 2 +- ng-sample/tsconfig.json | 3 +++ 5 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 nativescript-angular-package/platform-common.ts diff --git a/e2e/renderer/tsconfig.json b/e2e/renderer/tsconfig.json index ee608ce77..65295d0f2 100644 --- a/e2e/renderer/tsconfig.json +++ b/e2e/renderer/tsconfig.json @@ -23,7 +23,8 @@ } }, "include": [ - "./node_modules/nativescript-angular", + "../../nativescript-angular-package", + "../../nativescript-angular", "**/*" ], "exclude": [ diff --git a/nativescript-angular-package/platform-common.ts b/nativescript-angular-package/platform-common.ts new file mode 100644 index 000000000..6d8ac7743 --- /dev/null +++ b/nativescript-angular-package/platform-common.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/platform-common"; \ No newline at end of file diff --git a/nativescript-angular/http-client/http-client.module.ts b/nativescript-angular/http-client/http-client.module.ts index ea6623d5b..59d55a05a 100644 --- a/nativescript-angular/http-client/http-client.module.ts +++ b/nativescript-angular/http-client/http-client.module.ts @@ -1,10 +1,6 @@ import { NgModule } from "@angular/core"; -// IMPORTant: Importing "@angular/common/http" for the first time overwrites the -// global.__extends function. -const cachedExtends = global.__extends; import { HttpClientModule, HttpBackend } from "@angular/common/http"; -global.__extends = cachedExtends; import { NSFileSystem } from "../file-system/ns-file-system"; import { NsHttpBackEnd } from "./ns-http-backend"; diff --git a/ng-sample/package.json b/ng-sample/package.json index 8dbf3d5ae..1b0326ecc 100644 --- a/ng-sample/package.json +++ b/ng-sample/package.json @@ -34,7 +34,7 @@ "@angular/platform-browser": "~8.2.0", "@angular/platform-browser-dynamic": "~8.2.0", "@angular/router": "~8.2.0", - "nativescript-angular": "file:../nativescript-angular", + "nativescript-angular": "file:../nativescript-angular-package", "rxjs": "^6.4.0", "tns-core-modules": "next", "tns-platform-declarations": "next", diff --git a/ng-sample/tsconfig.json b/ng-sample/tsconfig.json index b73d56d49..4f7b6304b 100644 --- a/ng-sample/tsconfig.json +++ b/ng-sample/tsconfig.json @@ -28,10 +28,13 @@ }, "include": [ "../nativescript-angular", + "../nativescript-angular-package", "**/*" ], "exclude": [ + "../nativescript-angular-package/node_modules", "../nativescript-angular/node_modules", + "../nativescript-angular-package/**/*.d.ts", "../nativescript-angular/**/*.d.ts", "node_modules", "platforms" From cb0292f320c3742147a49d65b79606c65e0f7596 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Mon, 21 Oct 2019 13:51:33 +0300 Subject: [PATCH 25/35] fix: update compat build script to work correctly with save-exact --- build/pack-scripts/pack-compat.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/build/pack-scripts/pack-compat.ts b/build/pack-scripts/pack-compat.ts index 8aef38951..0667e0e05 100644 --- a/build/pack-scripts/pack-compat.ts +++ b/build/pack-scripts/pack-compat.ts @@ -14,12 +14,17 @@ const nsAngularPackagePath = path.resolve("../../nativescript-angular-package"); const packageJsonPath = path.resolve(`${nsAngularPackagePath}/package.json`); console.log("Getting package.json from", packageJsonPath); -// rewrite dependency in package.json -const packageJsonObject = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: "utf8" })); -packageJsonObject.dependencies["@nativescript/angular"] = scopedVersion; -fs.writeFileSync(packageJsonPath, JSON.stringify(packageJsonObject, null, 4)); - -execSync(`npm install --save-exact`, { +let npmInstallParams = ""; +if (scopedVersion.indexOf(".tgz") > 0) { + // rewrite dependency in package.json + const packageJsonObject = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: "utf8" })); + packageJsonObject.dependencies["@nativescript/angular"] = scopedVersion; + fs.writeFileSync(packageJsonPath, JSON.stringify(packageJsonObject, null, 4)); +} else { + npmInstallParams = `@nativescript/angular@${scopedVersion}`; +} + +execSync(`npm install --save-exact ${npmInstallParams}`, { cwd: nsAngularPackagePath }); From f82e9aa3cc46f815f1a678e9b829ce116166b84d Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Mon, 21 Oct 2019 15:31:46 +0300 Subject: [PATCH 26/35] fix: potential breaking change --- nativescript-angular-package/router/router.module.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nativescript-angular-package/router/router.module.ts b/nativescript-angular-package/router/router.module.ts index 69bd311cc..1c7b8ed2b 100644 --- a/nativescript-angular-package/router/router.module.ts +++ b/nativescript-angular-package/router/router.module.ts @@ -1 +1,2 @@ -export { LocationState } from "@nativescript/angular/router/ns-location-strategy"; \ No newline at end of file +export { LocationState } from "@nativescript/angular/router/ns-location-strategy"; +export * from "@nativescript/angular/router/router.module"; \ No newline at end of file From 2df562cc3f4a98cc2bc7cc9b28974fc148d140b0 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Mon, 21 Oct 2019 16:43:35 +0300 Subject: [PATCH 27/35] chore: bump next version --- nativescript-angular-package/package.json | 2 +- nativescript-angular/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nativescript-angular-package/package.json b/nativescript-angular-package/package.json index 55e8139d2..9dbef3146 100644 --- a/nativescript-angular-package/package.json +++ b/nativescript-angular-package/package.json @@ -1,6 +1,6 @@ { "name": "nativescript-angular", - "version": "8.3.0", + "version": "8.30.0", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index ccbec7234..b7f91a703 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/angular", - "version": "8.3.0", + "version": "8.30.0", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", From c382682b2d6ef90cc3010bf7f4c3b67f9c40a510 Mon Sep 17 00:00:00 2001 From: Vladimir Amiorkov Date: Tue, 22 Oct 2019 13:26:17 +0300 Subject: [PATCH 28/35] fix(animations): resolve issue with "query animations" on iOS 13 (#2022) * fix(animations): resolve issue with "query animations" on iOS 13 * chore: add note for exsisting issue * chore: refator fix --- .../animations/animation-player.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nativescript-angular/animations/animation-player.ts b/nativescript-angular/animations/animation-player.ts index fa38f6782..d63ef066e 100644 --- a/nativescript-angular/animations/animation-player.ts +++ b/nativescript-angular/animations/animation-player.ts @@ -1,6 +1,7 @@ import { AnimationPlayer } from "@angular/animations"; import { KeyframeAnimation } from "tns-core-modules/ui/animation/keyframe-animation"; +import { View, EventData } from "tns-core-modules/ui/core/view"; import { Keyframe, createKeyframeAnimation } from "./utils"; import { NgView } from "../element-registry"; @@ -55,6 +56,21 @@ export class NativeScriptAnimationPlayer implements AnimationPlayer { this._startSubscriptions = []; } + // When this issue https://github.com/NativeScript/NativeScript/issues/7984 is fixes in @nativescript/core + // we can change this fix and apply the one that is recommended in that issue. + if (this.target.isLoaded) { + this.playAnimation(); + } else { + this.target.on(View.loadedEvent, this.onTargetLoaded.bind(this)); + } + } + + private onTargetLoaded(args: EventData) { + this.target.off(View.loadedEvent, this.onTargetLoaded); + this.playAnimation(); + } + + private playAnimation() { this.animation.play(this.target) .then(() => this.onFinish()) .catch((_e) => {}); From bab42781faeefa83f8b20b6bd80ecbdea7f650da Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Tue, 22 Oct 2019 12:52:29 +0300 Subject: [PATCH 29/35] fix: use cwd() as backup for getting path --- nativescript-angular/bin/update-app-ng-deps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nativescript-angular/bin/update-app-ng-deps b/nativescript-angular/bin/update-app-ng-deps index 1b4c46aca..a98704be3 100755 --- a/nativescript-angular/bin/update-app-ng-deps +++ b/nativescript-angular/bin/update-app-ng-deps @@ -56,7 +56,7 @@ function updateDeps(deps, devDeps, newDeps) { } const pluginDeps = pluginPackageJson.peerDependencies; -const projectPath = process.env.INIT_CWD || path.dirname(path.dirname(pluginPath)); +const projectPath = process.env.INIT_CWD || process.cwd() || path.dirname(path.dirname(pluginPath)); const appPackageJsonPath = path.join(projectPath, "package.json"); const appPackageJson = JSON.parse(fs.readFileSync(appPackageJsonPath, "utf8")); From 09bf9baabe2b4734880f54141ac1a954174380e7 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Tue, 22 Oct 2019 15:08:10 +0300 Subject: [PATCH 30/35] fix: local development workflow errors --- e2e/animation-examples/tsconfig.json | 3 ++- e2e/modal-navigation-ng/tsconfig.json | 3 ++- e2e/nested-router-tab-view/app/app.module.ts | 2 +- .../app/modal-second/modal-second.component.html | 2 +- e2e/nested-router-tab-view/tsconfig.json | 3 ++- e2e/renderer/tsconfig.json | 3 ++- e2e/routable-animations/tsconfig.json | 3 ++- e2e/router-tab-view/app/app.module.ts | 2 +- e2e/router-tab-view/tsconfig.json | 3 ++- e2e/router/tsconfig.json | 3 ++- e2e/single-page/tsconfig.json | 3 ++- e2e/tests-app-ng/tsconfig.json | 3 ++- ng-sample/app/app.ts | 2 +- 13 files changed, 22 insertions(+), 13 deletions(-) diff --git a/e2e/animation-examples/tsconfig.json b/e2e/animation-examples/tsconfig.json index 65295d0f2..eee1eca47 100644 --- a/e2e/animation-examples/tsconfig.json +++ b/e2e/animation-examples/tsconfig.json @@ -15,7 +15,8 @@ "paths": { "*": [ "./node_modules/tns-core-modules/*", - "./node_modules/*" + "./node_modules/*", + "./node_modules/nativescript-angular/node_modules/*" ], "~/*": [ "app/*" diff --git a/e2e/modal-navigation-ng/tsconfig.json b/e2e/modal-navigation-ng/tsconfig.json index 65295d0f2..eee1eca47 100644 --- a/e2e/modal-navigation-ng/tsconfig.json +++ b/e2e/modal-navigation-ng/tsconfig.json @@ -15,7 +15,8 @@ "paths": { "*": [ "./node_modules/tns-core-modules/*", - "./node_modules/*" + "./node_modules/*", + "./node_modules/nativescript-angular/node_modules/*" ], "~/*": [ "app/*" diff --git a/e2e/nested-router-tab-view/app/app.module.ts b/e2e/nested-router-tab-view/app/app.module.ts index 2be80e9fd..1c406632a 100644 --- a/e2e/nested-router-tab-view/app/app.module.ts +++ b/e2e/nested-router-tab-view/app/app.module.ts @@ -13,7 +13,7 @@ import { routerTraceCategory } from "nativescript-angular/trace"; // addCategories(routerTraceCategory); traceEnable(); -class MyErrorHandler implements ErrorHandler { +export class MyErrorHandler implements ErrorHandler { handleError(error) { console.log("### ErrorHandler Error: " + error.toString()); console.log("### ErrorHandler Stack: " + error.stack); diff --git a/e2e/nested-router-tab-view/app/modal-second/modal-second.component.html b/e2e/nested-router-tab-view/app/modal-second/modal-second.component.html index 9c6b4052e..27a997c2f 100644 --- a/e2e/nested-router-tab-view/app/modal-second/modal-second.component.html +++ b/e2e/nested-router-tab-view/app/modal-second/modal-second.component.html @@ -3,7 +3,7 @@ - + \ No newline at end of file diff --git a/e2e/nested-router-tab-view/tsconfig.json b/e2e/nested-router-tab-view/tsconfig.json index 65295d0f2..eee1eca47 100644 --- a/e2e/nested-router-tab-view/tsconfig.json +++ b/e2e/nested-router-tab-view/tsconfig.json @@ -15,7 +15,8 @@ "paths": { "*": [ "./node_modules/tns-core-modules/*", - "./node_modules/*" + "./node_modules/*", + "./node_modules/nativescript-angular/node_modules/*" ], "~/*": [ "app/*" diff --git a/e2e/renderer/tsconfig.json b/e2e/renderer/tsconfig.json index 65295d0f2..eee1eca47 100644 --- a/e2e/renderer/tsconfig.json +++ b/e2e/renderer/tsconfig.json @@ -15,7 +15,8 @@ "paths": { "*": [ "./node_modules/tns-core-modules/*", - "./node_modules/*" + "./node_modules/*", + "./node_modules/nativescript-angular/node_modules/*" ], "~/*": [ "app/*" diff --git a/e2e/routable-animations/tsconfig.json b/e2e/routable-animations/tsconfig.json index 65295d0f2..eee1eca47 100644 --- a/e2e/routable-animations/tsconfig.json +++ b/e2e/routable-animations/tsconfig.json @@ -15,7 +15,8 @@ "paths": { "*": [ "./node_modules/tns-core-modules/*", - "./node_modules/*" + "./node_modules/*", + "./node_modules/nativescript-angular/node_modules/*" ], "~/*": [ "app/*" diff --git a/e2e/router-tab-view/app/app.module.ts b/e2e/router-tab-view/app/app.module.ts index 532eb125e..632cdf76b 100644 --- a/e2e/router-tab-view/app/app.module.ts +++ b/e2e/router-tab-view/app/app.module.ts @@ -10,7 +10,7 @@ import { enable as traceEnable } from "tns-core-modules/trace"; // addCategories(routerTraceCategory); traceEnable(); -class MyErrorHandler implements ErrorHandler { +export class MyErrorHandler implements ErrorHandler { handleError(error) { console.log("### ErrorHandler Error: " + error.toString()); console.log("### ErrorHandler Stack: " + error.stack); diff --git a/e2e/router-tab-view/tsconfig.json b/e2e/router-tab-view/tsconfig.json index 65295d0f2..eee1eca47 100644 --- a/e2e/router-tab-view/tsconfig.json +++ b/e2e/router-tab-view/tsconfig.json @@ -15,7 +15,8 @@ "paths": { "*": [ "./node_modules/tns-core-modules/*", - "./node_modules/*" + "./node_modules/*", + "./node_modules/nativescript-angular/node_modules/*" ], "~/*": [ "app/*" diff --git a/e2e/router/tsconfig.json b/e2e/router/tsconfig.json index 65295d0f2..eee1eca47 100644 --- a/e2e/router/tsconfig.json +++ b/e2e/router/tsconfig.json @@ -15,7 +15,8 @@ "paths": { "*": [ "./node_modules/tns-core-modules/*", - "./node_modules/*" + "./node_modules/*", + "./node_modules/nativescript-angular/node_modules/*" ], "~/*": [ "app/*" diff --git a/e2e/single-page/tsconfig.json b/e2e/single-page/tsconfig.json index 65295d0f2..eee1eca47 100644 --- a/e2e/single-page/tsconfig.json +++ b/e2e/single-page/tsconfig.json @@ -15,7 +15,8 @@ "paths": { "*": [ "./node_modules/tns-core-modules/*", - "./node_modules/*" + "./node_modules/*", + "./node_modules/nativescript-angular/node_modules/*" ], "~/*": [ "app/*" diff --git a/e2e/tests-app-ng/tsconfig.json b/e2e/tests-app-ng/tsconfig.json index d93d819b4..943dcd002 100644 --- a/e2e/tests-app-ng/tsconfig.json +++ b/e2e/tests-app-ng/tsconfig.json @@ -15,7 +15,8 @@ "paths": { "*": [ "./node_modules/tns-core-modules/*", - "./node_modules/*" + "./node_modules/*", + "./node_modules/nativescript-angular/node_modules/*" ], "~/*": [ "app/*" diff --git a/ng-sample/app/app.ts b/ng-sample/app/app.ts index 86b2aaad2..b3a6ccad9 100644 --- a/ng-sample/app/app.ts +++ b/ng-sample/app/app.ts @@ -126,7 +126,7 @@ const customPageFactoryProvider = { }, }; -class MyErrorHandler implements ErrorHandler { +export class MyErrorHandler implements ErrorHandler { handleError(error) { console.log("### ErrorHandler Error: " + error.toString()); console.log("### ErrorHandler Stack: " + error.stack); From d7c6f907449122a2e3fdefaf6e860918d9209fe8 Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Tue, 22 Oct 2019 17:15:59 +0300 Subject: [PATCH 31/35] fix: expose missing export for TemplatedItemsComponent --- nativescript-angular/directives/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nativescript-angular/directives/index.ts b/nativescript-angular/directives/index.ts index 57efac10f..4fd2966f5 100644 --- a/nativescript-angular/directives/index.ts +++ b/nativescript-angular/directives/index.ts @@ -1,5 +1,5 @@ import { ListViewComponent } from "./list-view-comp"; -import { TemplateKeyDirective, SetupItemViewArgs } from "./templated-items-comp"; +import { TemplateKeyDirective, SetupItemViewArgs, TemplatedItemsComponent } from "./templated-items-comp"; import { TabViewDirective, TabViewItemDirective } from "./tab-view"; import { ActionBarComponent, @@ -27,6 +27,7 @@ export { ListViewComponent, TemplateKeyDirective, SetupItemViewArgs, + TemplatedItemsComponent, TabViewDirective, TabViewItemDirective, ActionBarComponent, From bb378eb90b821a7ddc52fd301a55a82e5091ff8f Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Tue, 22 Oct 2019 17:39:26 +0300 Subject: [PATCH 32/35] fix: add additional path for export of templated-items-comp --- nativescript-angular-package/directives/templated-items-comp.ts | 1 + 1 file changed, 1 insertion(+) create mode 100644 nativescript-angular-package/directives/templated-items-comp.ts diff --git a/nativescript-angular-package/directives/templated-items-comp.ts b/nativescript-angular-package/directives/templated-items-comp.ts new file mode 100644 index 000000000..cdb635ff4 --- /dev/null +++ b/nativescript-angular-package/directives/templated-items-comp.ts @@ -0,0 +1 @@ +export * from "@nativescript/angular/directives/templated-items-comp"; \ No newline at end of file From f9c61e31889f6bdb695044824d853fc012e7970b Mon Sep 17 00:00:00 2001 From: Manol Donev Date: Tue, 22 Oct 2019 18:34:18 +0300 Subject: [PATCH 33/35] refactor: deprecated topmost() usage --- nativescript-angular/directives/dialogs.ts | 4 ++-- nativescript-angular/platform-providers.ts | 8 ++++---- nativescript-angular/router/ns-location-strategy.ts | 2 +- nativescript-angular/testing/src/util.ts | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/nativescript-angular/directives/dialogs.ts b/nativescript-angular/directives/dialogs.ts index 13dde66d6..14463c533 100644 --- a/nativescript-angular/directives/dialogs.ts +++ b/nativescript-angular/directives/dialogs.ts @@ -17,7 +17,7 @@ import { AppHostView } from "../app-host-view"; import { DetachedLoader } from "../common/detached-loader"; import { PageFactory, PAGE_FACTORY } from "../platform-providers"; import { once } from "../common/utils"; -import { topmost, Frame } from "tns-core-modules/ui/frame"; +import { Frame } from "tns-core-modules/ui/frame"; import { ShowModalOptions } from "tns-core-modules/ui/core/view"; export type BaseShowModalOptions = Pick>; @@ -86,7 +86,7 @@ export class ModalDialogService { let frame = parentView; if (!(parentView instanceof Frame)) { - frame = (parentView.page && parentView.page.frame) || topmost(); + frame = (parentView.page && parentView.page.frame) || Frame.topmost(); } this.location._beginModalNavigation(frame); diff --git a/nativescript-angular/platform-providers.ts b/nativescript-angular/platform-providers.ts index 0a3cf45c4..ebe16e8a8 100644 --- a/nativescript-angular/platform-providers.ts +++ b/nativescript-angular/platform-providers.ts @@ -1,6 +1,6 @@ import { InjectionToken, Injectable } from "@angular/core"; -import { topmost, Frame } from "tns-core-modules/ui/frame"; +import { Frame } from "tns-core-modules/ui/frame"; import { View } from "tns-core-modules/ui/core/view"; import { Page } from "tns-core-modules/ui/page"; import { device, Device } from "tns-core-modules/platform"; @@ -26,7 +26,7 @@ export function getDefaultPage(): Page { return rootPage; } - const frame = topmost(); + const frame = Frame.topmost(); if (frame && frame.currentPage) { return frame.currentPage; } @@ -38,7 +38,7 @@ export const defaultPageProvider = { provide: Page, useFactory: getDefaultPage } // Use an exported function to make the AoT compiler happy. export function getDefaultFrame(): Frame { - return topmost(); + return Frame.topmost(); } export const defaultFrameProvider = { provide: Frame, useFactory: getDefaultFrame }; @@ -67,7 +67,7 @@ export const defaultPageFactoryProvider = { provide: PAGE_FACTORY, useValue: def export class FrameService { // TODO: Add any methods that are needed to handle frame/page navigation getFrame(): Frame { - let topmostFrame = topmost(); + let topmostFrame = Frame.topmost(); return topmostFrame; } } diff --git a/nativescript-angular/router/ns-location-strategy.ts b/nativescript-angular/router/ns-location-strategy.ts index 58d4962d2..92da486e7 100644 --- a/nativescript-angular/router/ns-location-strategy.ts +++ b/nativescript-angular/router/ns-location-strategy.ts @@ -411,7 +411,7 @@ export class NSLocationStrategy extends LocationStrategy { this._modalNavigationDepth--; } - // currentOutlet should be the one that corresponds to the topmost() frame + // currentOutlet should be the one that corresponds to the topmost frame const topmostOutlet = this.getOutletByFrame(this.frameService.getFrame()); const outlet = this.findOutletByModal(this._modalNavigationDepth, isShowingModal) || topmostOutlet; diff --git a/nativescript-angular/testing/src/util.ts b/nativescript-angular/testing/src/util.ts index 5f2e514b8..a4f57b05d 100644 --- a/nativescript-angular/testing/src/util.ts +++ b/nativescript-angular/testing/src/util.ts @@ -1,6 +1,6 @@ import { View } from "tns-core-modules/ui/core/view"; -import { topmost } from "tns-core-modules/ui/frame"; +import { Frame } from "tns-core-modules/ui/frame"; import { LayoutBase } from "tns-core-modules/ui/layouts/layout-base"; import { ComponentFixture, TestBed } from "@angular/core/testing"; import { NgModule, Type } from "@angular/core"; @@ -17,7 +17,7 @@ const TESTING_ROOT_ID = "__testing_container"; * Get a reference to the fixtures container. */ export function testingRootView(): LayoutBase { - const rootPageLayout = topmost().currentPage.content as LayoutBase; + const rootPageLayout = Frame.topmost().currentPage.content as LayoutBase; let testingRoot: LayoutBase; rootPageLayout.eachChild(child => { From 77d2f53c78e9d1dcff2c0b1fbdec5d262415558e Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Wed, 23 Oct 2019 10:24:26 +0300 Subject: [PATCH 34/35] fix: update-app-ng-deps --- nativescript-angular/bin/update-app-ng-deps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nativescript-angular/bin/update-app-ng-deps b/nativescript-angular/bin/update-app-ng-deps index a98704be3..043e57edf 100755 --- a/nativescript-angular/bin/update-app-ng-deps +++ b/nativescript-angular/bin/update-app-ng-deps @@ -56,7 +56,7 @@ function updateDeps(deps, devDeps, newDeps) { } const pluginDeps = pluginPackageJson.peerDependencies; -const projectPath = process.env.INIT_CWD || process.cwd() || path.dirname(path.dirname(pluginPath)); +const projectPath = process.env.INIT_CWD || path.dirname(path.dirname(path.dirname(pluginPath))); const appPackageJsonPath = path.join(projectPath, "package.json"); const appPackageJson = JSON.parse(fs.readFileSync(appPackageJsonPath, "utf8")); From 8ada54abd0aafcbb6897d77df3e6dd07c4ed70ae Mon Sep 17 00:00:00 2001 From: tbozhikov Date: Wed, 23 Oct 2019 15:27:19 +0300 Subject: [PATCH 35/35] release: cut the 8.20.0 release --- CHANGELOG.md | 10 ++++++++++ CONTRIBUTING.md | 3 ++- nativescript-angular-package/package.json | 2 +- nativescript-angular/package.json | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a90181768..b0a33425d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ + +# [8.20.0](https://github.com/NativeScript/nativescript-angular/compare/8.2.2...8.20.0) (2019-10-23) + +### Features +* add scoped package @nativescript/angular ([#2014](https://github.com/NativeScript/nativescript-angular/pull/2014)) + +### Bug Fixes + +* **animations:** resolve issue with "query animations" on iOS 13 ([#2022](https://github.com/NativeScript/nativescript-angular/issues/2022)) ([c382682](https://github.com/NativeScript/nativescript-angular/commit/c382682)) + ## [8.2.2](https://github.com/NativeScript/nativescript-angular/compare/8.2.1...8.2.2) (2019-10-16) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b42d49f3b..80bff2ab2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -101,8 +101,9 @@ In this case the commits should be merge firstly from release in master branch a 2. Execute `npm i` to install dependencies: ``` cd nativescript-angular && npm i +cd nativescript-angular-package && npm i ``` -3. Execute [`npm version`](https://docs.npmjs.com/cli/version) to bump the version: +3. Execute [`npm version`](https://docs.npmjs.com/cli/version) to bump the version in both `nativescript-angular` and `nativescript-angular-package` folders: ``` npm --no-git-tag-version version [patch|minor|major] -m "release: cut the %s release" ``` diff --git a/nativescript-angular-package/package.json b/nativescript-angular-package/package.json index 9dbef3146..21eec9436 100644 --- a/nativescript-angular-package/package.json +++ b/nativescript-angular-package/package.json @@ -1,6 +1,6 @@ { "name": "nativescript-angular", - "version": "8.30.0", + "version": "8.20.0", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index b7f91a703..4137e19b2 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/angular", - "version": "8.30.0", + "version": "8.20.0", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues",