diff --git a/.travis.yml b/.travis.yml index 2c0a3c368..7f437f40b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,5 +4,5 @@ node_js: script: - cd nativescript-angular - npm install - - npm run tslint + - npm run format-check - npm pack diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d8ef7995..93c7d06b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,23 @@ # [9.0.0](https://github.com/NativeScript/nativescript-angular/compare/8.20.4...9.0.0) (2020-06-03) + +### Bug Fixes + +* **bindable:** parent referenced expression-values now load properly using an update call ([#8670](https://github.com/NativeScript/NativeScript/issues/8670)) ([6b0028a](https://github.com/NativeScript/NativeScript/commit/6b0028afd7b554914b039cdf371e8e30f6e02dac)), closes [#8666](https://github.com/NativeScript/NativeScript/issues/8666) [#6981](https://github.com/NativeScript/NativeScript/issues/6981) [#5054](https://github.com/NativeScript/NativeScript/issues/5054) +* **scroll-view:** android 'isScrollEnabled' will apply if changed while gesture is underway ([#8695](https://github.com/NativeScript/NativeScript/issues/8695)) ([02ec7f1](https://github.com/NativeScript/NativeScript/commit/02ec7f104d327df53df687ddd1b8ac5b1cdc04ba)) +* **snapshots:** android is not defined ([#8691](https://github.com/NativeScript/NativeScript/issues/8691)) ([a8bbd7c](https://github.com/NativeScript/NativeScript/commit/a8bbd7c1e580e77e7ad5ddc7be6845e3d8fb02de)) +* **text-view:** only reload text if hint is showing on ios ([#8662](https://github.com/NativeScript/NativeScript/issues/8662)) ([ec17727](https://github.com/NativeScript/NativeScript/commit/ec17727e91f7a3209ada2c7de0bcf59c98c4e62a)) + + +### Features + +* **connectivity:** getActiveNetworkInfo and NetworkInfo modern compliance [#8580](https://github.com/NativeScript/NativeScript/issues/8580) ([#8652](https://github.com/NativeScript/NativeScript/issues/8652)) ([635f31f](https://github.com/NativeScript/NativeScript/commit/635f31f81f7826112142c707aff2a66c2b480b0e)) +* **dialog:** ios destructive style from options ([#8676](https://github.com/NativeScript/NativeScript/issues/8676)) ([bb531ce](https://github.com/NativeScript/NativeScript/commit/bb531ce71028f9c4fd4d753df16c82104f158e35)) +* **ImageSource:** resize method ([#8678](https://github.com/NativeScript/NativeScript/issues/8678)) ([bd12baf](https://github.com/NativeScript/NativeScript/commit/bd12bafb4aae8f1c523be4c7e04fa73722092304)) +* **text-view:** allow easy subclassing on ios ([#8663](https://github.com/NativeScript/NativeScript/issues/8663)) ([7d36447](https://github.com/NativeScript/NativeScript/commit/7d364474c23e17acf7696f159d3945d8a73d63e6)) + + ### Features * angular 9 ivy ([fbe2450](https://github.com/NativeScript/nativescript-angular/commit/fbe2450)) diff --git a/build/pack-scripts/pack-scoped.ts b/build/pack-scripts/pack-scoped.ts index fe72a16a4..8d5605b84 100644 --- a/build/pack-scripts/pack-scoped.ts +++ b/build/pack-scripts/pack-scoped.ts @@ -5,27 +5,29 @@ 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"); +const nsAngularPackageDistPath = path.resolve(nsAngularPackagePath + "/dist"); -execSync(`npm install --save-exact`, { - cwd: nsAngularPackagePath -}); +function getFilesFromPath(path, extension) { + let files = fs.readdirSync( path ); + return files.filter(file => file.match(new RegExp(`.*\.(${extension})`, 'ig'))); +} + +// execSync(`npm install --save-exact`, { +// cwd: nsAngularPackagePath +// }); // ensure empty temp and dist folders -fs.emptyDirSync(tempFolderPath); fs.ensureDirSync(distFolderPath); // create .tgz in temp folder -execSync(`npm pack ${nsAngularPackagePath}`, { - cwd: tempFolderPath -}); +execSync(`cd ${nsAngularPackagePath} && npm run build.pack`); // assume we have a single file built in temp folder, take its name -const currentFileName = fs.readdirSync(tempFolderPath)[0]; +const currentFileName = getFilesFromPath(nsAngularPackageDistPath, ".tgz")[0]; +console.log('currentFileName:', currentFileName); // move built file and remove temp folder -fs.moveSync(`${tempFolderPath}/${currentFileName}`, `${distFolderPath}/${outFileName}`, { overwrite: true }); -fs.removeSync(`${tempFolderPath}`); +fs.moveSync(`${nsAngularPackageDistPath}/${currentFileName}`, `${distFolderPath}/${outFileName}`, { overwrite: true }); diff --git a/build/pack-scripts/tsconfig.json b/build/pack-scripts/tsconfig.json index deb92c7ef..0bda36752 100644 --- a/build/pack-scripts/tsconfig.json +++ b/build/pack-scripts/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "target": "es5", + "target": "es2015", "experimentalDecorators": true, "emitDecoratorMetadata": true, "noEmitHelpers": true, diff --git a/doc/upgrading-zonejs.md b/doc/upgrading-zonejs.md index d99dc2083..6ea5d173f 100644 --- a/doc/upgrading-zonejs.md +++ b/doc/upgrading-zonejs.md @@ -2,7 +2,7 @@ `nativescript-angular` uses a fork of the `zone.js` package in order to work around incompatibilities between node, browser, and mobile implementations. -The fork resides at https://github.com/NativeScript/zone.js in the `zone-nativescript` branch. It adds a separate `lib/nativescript/nativescript.ts` entry point that is used to generate a new bundle: `dist/zone-nativescript.js`. +The fork resides at https://github.com/NativeScript/zone.js in the `zone-nativescript` branch. It adds a separate `lib/nativescript/nativescript.ts` entry point that is used to generate a new bundle: `zone-nativescript.js`. To upgrade to a newer release of `zone.js`: @@ -11,5 +11,5 @@ To upgrade to a newer release of `zone.js`: 3. Rebuild: `gulp build` 4. Run the node-based smoke tests: `gulp test/nativescript` 5. Run the browser tests: `node_modules/.bin/karma start karma.conf.js --single-run` (You need to run node `test/ws-server.js` in a separate console first) -6. Commit `dist/zone-nativescript.js`, drop the previous `dist/zone-nativescript.js` commit from the branch. Force push the new `zone-nativescript` branch to GitHub. +6. Commit `zone-nativescript.js`, drop the previous `zone-nativescript.js` commit from the branch. Force push the new `zone-nativescript` branch to GitHub. 7. Update your copy of `nativescript-angular/zone.js/dist/zone-nativescript.js` with the bundle you just built. diff --git a/e2e/animation-examples/app/App_Resources/iOS/build.xcconfig b/e2e/animation-examples/app/App_Resources/iOS/build.xcconfig index 4b0118490..e77e78db9 100644 --- a/e2e/animation-examples/app/App_Resources/iOS/build.xcconfig +++ b/e2e/animation-examples/app/App_Resources/iOS/build.xcconfig @@ -4,4 +4,3 @@ // To build for device with Xcode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html // DEVELOPMENT_TEAM = YOUR_TEAM_ID; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; -ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; diff --git a/e2e/animation-examples/app/animation-builder.component.scss b/e2e/animation-examples/app/animation-builder.component.scss new file mode 100644 index 000000000..ca3407610 --- /dev/null +++ b/e2e/animation-examples/app/animation-builder.component.scss @@ -0,0 +1,3 @@ +.btn-primary { + background-color: pink; +} \ No newline at end of file diff --git a/e2e/animation-examples/app/animation-builder.component.ts b/e2e/animation-examples/app/animation-builder.component.ts index 0ea5a1bee..3713242c8 100644 --- a/e2e/animation-examples/app/animation-builder.component.ts +++ b/e2e/animation-examples/app/animation-builder.component.ts @@ -4,7 +4,8 @@ import { Component, ViewChild } from '@angular/core'; @Component({ template: ` - ` + `, + styleUrls: ['./animation-builder.component.scss'] }) export class AnimationBuilderComponent { @ViewChild('button', { static: false }) button; diff --git a/e2e/animation-examples/app/app.module.ts b/e2e/animation-examples/app/app.module.ts index 38de237d5..4a729f4b2 100644 --- a/e2e/animation-examples/app/app.module.ts +++ b/e2e/animation-examples/app/app.module.ts @@ -24,7 +24,7 @@ export function asyncBoot(): Function { return (): Promise => new Promise(resolve => { setTimeout(() => { resolve(); - }, 2000); + }, 5000); }) } diff --git a/e2e/animation-examples/app/app.routing.ts b/e2e/animation-examples/app/app.routing.ts index df70ca363..305e244e9 100644 --- a/e2e/animation-examples/app/app.routing.ts +++ b/e2e/animation-examples/app/app.routing.ts @@ -1,6 +1,6 @@ import { NgModule } from "@angular/core"; import { Routes } from "@angular/router"; -import { NativeScriptRouterModule } from "@nativescript/angular/router"; +import { NativeScriptRouterModule } from "@nativescript/angular"; import { AnimationsListComponent } from "./animations-list.component"; import { AnimationBuilderComponent } from "./animation-builder.component"; diff --git a/e2e/animation-examples/app/hero/hero-routing.module.ts b/e2e/animation-examples/app/hero/hero-routing.module.ts index 57426f197..6f65be89b 100644 --- a/e2e/animation-examples/app/hero/hero-routing.module.ts +++ b/e2e/animation-examples/app/hero/hero-routing.module.ts @@ -1,6 +1,6 @@ import { NgModule } from "@angular/core"; import { Routes } from "@angular/router"; -import { NativeScriptRouterModule } from "@nativescript/angular/router"; +import { NativeScriptRouterModule } from "@nativescript/angular"; import { HeroTeamBuilderComponent } from './hero-team-builder.component'; diff --git a/e2e/animation-examples/app/hero/hero.module.ts b/e2e/animation-examples/app/hero/hero.module.ts index 139da6013..938ec409c 100644 --- a/e2e/animation-examples/app/hero/hero.module.ts +++ b/e2e/animation-examples/app/hero/hero.module.ts @@ -1,5 +1,5 @@ import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core"; -import { NativeScriptCommonModule } from "@nativescript/angular/common"; +import { NativeScriptCommonModule } from "@nativescript/angular"; import { HeroRoutingModule, routedComponents } from "./hero-routing.module"; diff --git a/e2e/animation-examples/app/main.aot.ts b/e2e/animation-examples/app/main.aot.ts deleted file mode 100644 index 015f6e008..000000000 --- a/e2e/animation-examples/app/main.aot.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { platformNativeScript } from "@nativescript/angular/platform-static"; -import { AppModuleNgFactory } from "./app.module.ngfactory"; - -platformNativeScript().bootstrapModuleFactory(AppModuleNgFactory); diff --git a/e2e/animation-examples/app/main.ts b/e2e/animation-examples/app/main.ts index 6d0342a02..92fc7dbca 100644 --- a/e2e/animation-examples/app/main.ts +++ b/e2e/animation-examples/app/main.ts @@ -1,103 +1,74 @@ -import { platformNativeScriptDynamic } from "@nativescript/angular/platform"; -import { animationsTraceCategory } from "@nativescript/angular/trace"; -import { setCategories, enable } from "@nativescript/core/trace"; -import { - GridLayout, - ItemSpec, - GridUnitType, -} from '@nativescript/core/ui/layouts/grid-layout'; -import { - HorizontalAlignment, - VerticalAlignment, -} from '@nativescript/core/ui/enums/enums'; +import { platformNativeScriptDynamic, NativeScriptDebug, AppLaunchView } from "@nativescript/angular"; +import { Trace, GridLayout, GridUnitType, ItemSpec, Application } from "@nativescript/core"; import { AppModule } from "./app.module"; -setCategories(animationsTraceCategory); -enable(); +Trace.setCategories(NativeScriptDebug.animationsTraceCategory); +Trace.enable(); -class LaunchAnimation extends GridLayout { +class LaunchAnimation extends GridLayout implements AppLaunchView { circle: GridLayout; - animatedContainer: GridLayout; finished = false; + complete: () => void; constructor() { super(); + this.backgroundColor = "#4caef7"; + this.className = "w-full h-full"; - // setup container to house launch animation - this.animatedContainer = new GridLayout(); - this.animatedContainer.style.zIndex = 100; - this.animatedContainer.backgroundColor = '#4caef7'; - this.animatedContainer.className = 'w-full h-full'; - - // any creative animation can be put inside + // construct any creative animation this.circle = new GridLayout(); this.circle.width = 30; this.circle.height = 30; this.circle.borderRadius = 15; - this.circle.horizontalAlignment = HorizontalAlignment.center; - this.circle.verticalAlignment = VerticalAlignment.center; - this.circle.backgroundColor = '#fff'; - this.animatedContainer.addRow(new ItemSpec(1, GridUnitType.STAR)); - this.animatedContainer.addRow(new ItemSpec(1, GridUnitType.AUTO)); - this.animatedContainer.addRow(new ItemSpec(1, GridUnitType.STAR)); - GridLayout.setRow(this.circle, 1); - this.animatedContainer.addChild(this.circle); + this.circle.horizontalAlignment = "center"; + this.circle.verticalAlignment = "middle"; + this.circle.backgroundColor = "#fff"; - // add animation to top row since booted app will insert into bottom row - GridLayout.setRow(this.animatedContainer, 1); - this.addChild(this.animatedContainer); + this.addChild(this.circle); } - startAnimation() { - this.circle - .animate({ - scale: { x: 2, y: 2 }, - duration: 800, - }) - .then(() => { - this.circle - .animate({ - scale: { x: 1, y: 1 }, - duration: 800, - }) - .then(() => { - if (this.finished) { - this.circle - .animate({ - scale: { x: 30, y: 30 }, - duration: 400, - }) - .then(() => { - this.fadeOut(); - }); - } else { - // keep looping - this.startAnimation(); - } - }); + async startAnimation() { + await this.circle.animate({ + scale: { x: 2, y: 2 }, + duration: 800, + }); + + await this.circle.animate({ + scale: { x: 1, y: 1 }, + duration: 800, + }); + + if (this.finished) { + await this.circle.animate({ + scale: { x: 30, y: 30 }, + duration: 400, }); + this.fadeOut(); + } else { + // keep looping + this.startAnimation(); + } } cleanup() { - this.finished = true; + return new Promise((resolve) => { + this.complete = resolve; + this.finished = true; + }); } - fadeOut() { - this.animatedContainer - .animate({ - opacity: 0, - duration: 400, - }) - .then(() => { - this._removeView(this.animatedContainer); - this.animatedContainer = null; - this.circle = null; - }); + async fadeOut() { + await this.animate({ + opacity: 0, + duration: 400, + }); + this.complete(); } } platformNativeScriptDynamic({ launchView: new LaunchAnimation(), - // backgroundColor: 'purple' + // backgroundColor: 'purple', + // async: true }).bootstrapModule(AppModule); diff --git a/e2e/animation-examples/app/vendor.ts b/e2e/animation-examples/app/vendor.ts deleted file mode 100644 index 3dceebdfa..000000000 --- a/e2e/animation-examples/app/vendor.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Snapshot the ~/app.css and the theme -const application = require("application"); -require("ui/styling/style-scope"); -const appCssContext = require.context("~/", false, /^\.\/app\.(css|scss|less|sass)$/); -global.registerWebpackModules(appCssContext); -application.loadAppCss(); - -require("reflect-metadata"); -require("@angular/platform-browser"); -require("@angular/core"); -require("@angular/common"); -require("@angular/forms"); -require("@angular/router"); - -require("nativescript-angular/platform-static"); -require("nativescript-angular/forms"); -require("nativescript-angular/router"); diff --git a/e2e/animation-examples/ngcc.config.js b/e2e/animation-examples/ngcc.config.js deleted file mode 100644 index 2d2413164..000000000 --- a/e2e/animation-examples/ngcc.config.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = { - packages: { - "@nativescript/angular": { - entryPoints: { - ".": { - override: { - main: "./index.js", - typings: "./index.d.ts", - }, - ignoreMissingDependencies: true, - } - }, - ignorableDeepImportMatchers: [ - /tns-core-modules\//, - /@nativescript\/core\//, - ] - } - } -}; \ No newline at end of file diff --git a/e2e/animation-examples/package.json b/e2e/animation-examples/package.json index 7b511f01f..d000ce3e0 100644 --- a/e2e/animation-examples/package.json +++ b/e2e/animation-examples/package.json @@ -6,58 +6,57 @@ "nativescript": { "id": "org.nativescript.ng4animations", "tns-ios": { - "version": "6.5.1" + "version": "6.5.2" }, "tns-android": { "version": "latest" } }, "dependencies": { - "@angular/animations": "~9.1.0", - "@angular/common": "~9.1.0", - "@angular/compiler": "~9.1.0", - "@angular/core": "~9.1.0", - "@angular/forms": "~9.1.0", - "@angular/platform-browser": "~9.1.0", - "@angular/platform-browser-dynamic": "~9.1.0", - "@angular/router": "~9.1.0", + "@angular/animations": "~10.0.0", + "@angular/common": "~10.0.0", + "@angular/compiler": "~10.0.0", + "@angular/core": "~10.0.0", + "@angular/forms": "~10.0.0", + "@angular/platform-browser": "~10.0.0", + "@angular/platform-browser-dynamic": "~10.0.0", + "@angular/router": "~10.0.0", "@nativescript/angular": "file:../../dist/nativescript-angular-scoped.tgz", "nativescript-theme-core": "~1.0.2", "reflect-metadata": "~0.1.8", "rxjs": "~6.5.5", - "@nativescript/core": "next", + "@nativescript/core": "rc", "zone.js": "^0.10.3" }, "devDependencies": { - "@angular/compiler-cli": "~9.1.0", - "@ngtools/webpack": "~9.1.0", - "@types/chai": "~4.1.7", - "@types/mocha": "~5.2.5", - "@types/node": "~10.12.18", - "babel-traverse": "6.25.0", - "babel-types": "6.25.0", - "babylon": "6.17.4", + "@angular/compiler-cli": "~10.0.0", + "@ngtools/webpack": "~10.0.0", + "@types/chai": "~4.2.0", + "@types/mocha": "~7.0.0", + "@types/node": "~14.0.0", + "babel-traverse": "~6.26.0", + "babel-types": "~6.26.0", + "babylon": "~6.18.0", "chai": "^4.2.0", - "lazy": "1.0.11", - "mocha": "~5.2.0", - "mochawesome": "~3.1.2", + "lazy": "~1.0.11", + "mocha": "~8.0.1", + "mochawesome": "~6.1.1", + "node-sass": "~4.14.1", "nativescript-css-loader": "~0.26.0", - "nativescript-dev-appium": "^6.0.0", - "nativescript-dev-webpack": "next", - "typescript": "~3.8.3" + "@nativescript/webpack": "rc", + "typescript": "~3.9.0" }, "scripts": { "clean": "npx rimraf hooks node_modules platforms package-lock.json", - "setup": "cd ../../nativescript-angular && npm run pack && cd ../e2e/animation-examples && npm run clean", + "setup": "cd ../../nativescript-angular && npm run prep.apps && cd ../e2e/animation-examples && npm run clean", + "ngcc": "ngcc --properties es2015 module main --first-only", + "postinstall": "npm run ngcc", "u": "update-ns-webpack", "e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json", "e2e-watch": "tsc -p e2e --watch", - "update-app-ng-deps": "update-app-ng-deps", "ns-verify-bundle": "ns-verify-bundle", "update-ns-webpack": "update-ns-webpack", - "ngcc": "ngcc --properties es2015 module main --first-only", - "postinstall": "npm run ngcc", - "ios": "tns debug ios --env.aot --emulator --no-hmr", - "android": "tns debug android --env.aot --emulator --no-hmr" + "ios": "tns debug ios --emulator --no-hmr", + "android": "tns debug android --emulator --no-hmr" } } diff --git a/e2e/animation-examples/tsconfig.json b/e2e/animation-examples/tsconfig.json index 1dbfa0f5b..ff6adb22e 100644 --- a/e2e/animation-examples/tsconfig.json +++ b/e2e/animation-examples/tsconfig.json @@ -1,7 +1,8 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es5", + "module": "ESNext", + "target": "es2015", + "moduleResolution": "node", "experimentalDecorators": true, "emitDecoratorMetadata": true, "noEmitHelpers": true, @@ -16,9 +17,6 @@ "paths": { "~/*": [ "app/*" - ], - "*": [ - "./node_modules/*" ] } }, diff --git a/e2e/modal-navigation-ng/app/home/home.component.ts b/e2e/modal-navigation-ng/app/home/home.component.ts index e14bc5111..49c26d63d 100644 --- a/e2e/modal-navigation-ng/app/home/home.component.ts +++ b/e2e/modal-navigation-ng/app/home/home.component.ts @@ -9,7 +9,6 @@ import { ModalViewComponent } from "../modal-shared/modal-view.component"; import { confirm } from "@nativescript/core/ui/dialogs"; import { AppModule } from "../app.module"; -import { PageService } from "@nativescript/angular"; @Component({ moduleId: module.id, @@ -21,9 +20,8 @@ export class HomeComponent { private modal: ModalDialogService, private vcRef: ViewContainerRef, private viewContainerRefService: ViewContainerRefService, - private pageService: PageService, private routerExtension: RouterExtensions) { - this.pageService.inPage$.subscribe((inPage) => console.log("HomeComponent - inPage", inPage)); + } onNavigateSecond() { diff --git a/e2e/modal-navigation-ng/app/main.aot.ts b/e2e/modal-navigation-ng/app/main.aot.ts deleted file mode 100644 index bd0970ba9..000000000 --- a/e2e/modal-navigation-ng/app/main.aot.ts +++ /dev/null @@ -1,9 +0,0 @@ -// 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 { AppModule } from "./app.module"; -import { NativeScriptPlatformRef } from "@nativescript/angular"; -// "./app.module.ngfactory" is a dynamically generated module when compiled with AoT. -import { AppModuleNgFactory } from "./app.module.ngfactory"; - -AppModule.platformRef = platformNativeScript(); -AppModule.platformRef.bootstrapModuleFactory(AppModuleNgFactory); diff --git a/e2e/modal-navigation-ng/package.json b/e2e/modal-navigation-ng/package.json index 8288caf02..0ad335400 100644 --- a/e2e/modal-navigation-ng/package.json +++ b/e2e/modal-navigation-ng/package.json @@ -50,7 +50,7 @@ "e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json", "e2e-watch": "tsc -p e2e --watch", "clean": "npx rimraf hooks node_modules platforms package-lock.json", - "setup": "cd ../../nativescript-angular && npm run pack && cd ../e2e/modal-navigation-ng && npm run clean", + "setup": "cd ../../nativescript-angular && npm run prep.apps && cd ../e2e/modal-navigation-ng && npm run clean", "ngcc": "ngcc --properties es2015 module main --first-only", "postinstall": "npm run ngcc", "ios": "tns debug ios --env.aot --emulator --no-hmr", diff --git a/e2e/nested-router-tab-view/app/main.aot.ts b/e2e/nested-router-tab-view/app/main.aot.ts deleted file mode 100644 index 97a9312ed..000000000 --- a/e2e/nested-router-tab-view/app/main.aot.ts +++ /dev/null @@ -1,7 +0,0 @@ -// this import should be first in order to load some required settings (like globals and reflect-metadata) -import { platformNativeScript } from "@nativescript/angular/platform-static"; - -// "./app.module.ngfactory" is a dynamically generated module when compiled with AoT. -import { AppModuleNgFactory } from "./app.module.ngfactory"; - -platformNativeScript().bootstrapModuleFactory(AppModuleNgFactory); diff --git a/e2e/nested-router-tab-view/package.json b/e2e/nested-router-tab-view/package.json index 2739c99d4..791cbc65f 100644 --- a/e2e/nested-router-tab-view/package.json +++ b/e2e/nested-router-tab-view/package.json @@ -47,7 +47,7 @@ "e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json", "e2e-watch": "tsc -p e2e --watch", "clean": "npx rimraf hooks node_modules platforms package-lock.json", - "setup": "cd ../../nativescript-angular && npm run pack && cd ../e2e/nested-router-tab-view && npm run clean", + "setup": "cd ../../nativescript-angular && npm run prep.apps && cd ../e2e/nested-router-tab-view && npm run clean", "ngcc": "ngcc --properties es2015 module main --first-only", "postinstall": "npm run ngcc" } diff --git a/e2e/renderer/app/main.aot.ts b/e2e/renderer/app/main.aot.ts deleted file mode 100644 index 015f6e008..000000000 --- a/e2e/renderer/app/main.aot.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { platformNativeScript } from "@nativescript/angular/platform-static"; -import { AppModuleNgFactory } from "./app.module.ngfactory"; - -platformNativeScript().bootstrapModuleFactory(AppModuleNgFactory); diff --git a/e2e/renderer/package.json b/e2e/renderer/package.json index f6fe8e90d..3126f8f2e 100644 --- a/e2e/renderer/package.json +++ b/e2e/renderer/package.json @@ -41,7 +41,6 @@ }, "scripts": { "e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json", - "compile-tests-w": "tsc -p e2e --watch", - "update-app-ng-deps": "update-app-ng-deps" + "compile-tests-w": "tsc -p e2e --watch" } } diff --git a/e2e/routable-animations/app/app.module.ts b/e2e/routable-animations/app/app.module.ts index d0a7e9a6d..a20ebebb1 100644 --- a/e2e/routable-animations/app/app.module.ts +++ b/e2e/routable-animations/app/app.module.ts @@ -7,9 +7,9 @@ import { AppRoutingModule } from './app-routing.module'; import { HomeComponent } from './home/home.component'; import { SupportComponent } from './support/support.component'; -import { animationsTraceCategory } from "@nativescript/angular/trace"; +import { NativeScriptDebug } from "@nativescript/angular/trace"; import { setCategories, enable } from "@nativescript/core/trace"; -setCategories(animationsTraceCategory); +setCategories(NativeScriptDebug.animationsTraceCategory); enable(); @NgModule({ diff --git a/e2e/routable-animations/app/main.aot.ts b/e2e/routable-animations/app/main.aot.ts deleted file mode 100644 index 015f6e008..000000000 --- a/e2e/routable-animations/app/main.aot.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { platformNativeScript } from "@nativescript/angular/platform-static"; -import { AppModuleNgFactory } from "./app.module.ngfactory"; - -platformNativeScript().bootstrapModuleFactory(AppModuleNgFactory); diff --git a/e2e/routable-animations/package.json b/e2e/routable-animations/package.json index 103d69852..fb02e7d67 100644 --- a/e2e/routable-animations/package.json +++ b/e2e/routable-animations/package.json @@ -45,7 +45,6 @@ "ns-bundle": "ns-bundle", "e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json", "e2e-watch": "tsc -p e2e --watch", - "update-app-ng-deps": "update-app-ng-deps", "ns-verify-bundle": "ns-verify-bundle", "update-ns-webpack": "update-ns-webpack" } diff --git a/e2e/router-tab-view/app/main.aot.ts b/e2e/router-tab-view/app/main.aot.ts deleted file mode 100644 index 97a9312ed..000000000 --- a/e2e/router-tab-view/app/main.aot.ts +++ /dev/null @@ -1,7 +0,0 @@ -// this import should be first in order to load some required settings (like globals and reflect-metadata) -import { platformNativeScript } from "@nativescript/angular/platform-static"; - -// "./app.module.ngfactory" is a dynamically generated module when compiled with AoT. -import { AppModuleNgFactory } from "./app.module.ngfactory"; - -platformNativeScript().bootstrapModuleFactory(AppModuleNgFactory); diff --git a/e2e/router/package.json b/e2e/router/package.json index 01537d520..b25f2ad6e 100644 --- a/e2e/router/package.json +++ b/e2e/router/package.json @@ -19,7 +19,6 @@ "@angular/platform-browser-dynamic": "~9.1.0", "@angular/router": "~9.1.0", "@nativescript/angular": "file:../../dist/nativescript-angular-scoped.tgz", - "nativescript-intl": "^3.0.0", "reflect-metadata": "~0.1.8", "rxjs": "~6.5.5", "@nativescript/core": "next", @@ -49,8 +48,7 @@ "e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json", "e2e-watch": "tsc -p e2e --watch", "compile-tests-w": "tsc -p e2e --watch", - "update-app-ng-deps": "update-app-ng-deps", - "setup": "cd ../../nativescript-angular && npm run pack && cd ../e2e/router && npm run clean", + "setup": "cd ../../nativescript-angular && npm run prep.apps && cd ../e2e/router && npm run clean", "u": "update-ns-webpack", "ns-verify-bundle": "ns-verify-bundle", "update-ns-webpack": "update-ns-webpack", diff --git a/e2e/single-page/app/main.aot.ts b/e2e/single-page/app/main.aot.ts deleted file mode 100644 index d0302e23e..000000000 --- a/e2e/single-page/app/main.aot.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { platformNativeScript } from "@nativescript/angular/platform-static"; -import { AppModuleNgFactory } from "./app.module.ngfactory"; - -platformNativeScript({ createFrameOnBootstrap: true }).bootstrapModuleFactory(AppModuleNgFactory); diff --git a/e2e/single-page/package.json b/e2e/single-page/package.json index 493cac330..e03922757 100644 --- a/e2e/single-page/package.json +++ b/e2e/single-page/package.json @@ -16,7 +16,6 @@ "@angular/platform-browser-dynamic": "~9.1.0", "@angular/router": "~9.1.0", "@nativescript/angular": "file:../../dist/nativescript-angular-scoped.tgz", - "nativescript-intl": "^3.0.0", "reflect-metadata": "~0.1.8", "rxjs": "~6.5.5", "@nativescript/core": "next", @@ -43,7 +42,6 @@ }, "scripts": { "e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json", - "compile-tests-w": "tsc -p e2e --watch", - "update-app-ng-deps": "update-app-ng-deps" + "compile-tests-w": "tsc -p e2e --watch" } } diff --git a/e2e/tests-app-ng/app/lazy/lazy.component.ts b/e2e/tests-app-ng/app/lazy/lazy.component.ts index 6bba0b05e..bb8d0e01c 100644 --- a/e2e/tests-app-ng/app/lazy/lazy.component.ts +++ b/e2e/tests-app-ng/app/lazy/lazy.component.ts @@ -1,7 +1,6 @@ import { Component } from "@angular/core"; -import { RouterExtensions } from "@nativescript/angular/router"; -import { ModalDialogParams } from "@nativescript/angular/directives/dialogs"; +import { RouterExtensions, ModalDialogParams } from "@nativescript/angular"; @Component({ selector: "ns-lazy", diff --git a/e2e/tests-app-ng/app/lazy/lazy.module.ts b/e2e/tests-app-ng/app/lazy/lazy.module.ts index 46bff152f..eea1ca005 100644 --- a/e2e/tests-app-ng/app/lazy/lazy.module.ts +++ b/e2e/tests-app-ng/app/lazy/lazy.module.ts @@ -1,6 +1,4 @@ -import { NativeScriptCommonModule } from "@nativescript/angular/common"; -import { NativeScriptRouterModule } from "@nativescript/angular/router"; -import { ModalDialogParams } from "@nativescript/angular/directives/dialogs"; +import { NativeScriptCommonModule, NativeScriptRouterModule, ModalDialogParams } from "@nativescript/angular"; import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core"; import { Routes } from "@angular/router"; diff --git a/e2e/tests-app-ng/app/list-view/list-view-nested-segmented-bar-page.component.ts b/e2e/tests-app-ng/app/list-view/list-view-nested-segmented-bar-page.component.ts index ec0d9d963..74e161d7b 100644 --- a/e2e/tests-app-ng/app/list-view/list-view-nested-segmented-bar-page.component.ts +++ b/e2e/tests-app-ng/app/list-view/list-view-nested-segmented-bar-page.component.ts @@ -1,7 +1,5 @@ import { Component, ViewChild, ElementRef, OnInit } from "@angular/core"; -import { SegmentedBarItem, SegmentedBar } from "tns-core-modules/ui/segmented-bar/segmented-bar"; -import { ListView } from "tns-core-modules/ui/list-view/list-view"; -import { EventData } from "tns-core-modules/ui/page/page"; +import { SegmentedBarItem, SegmentedBar, ListView, EventData } from "@nativescript/core"; interface DataItem { id: number; diff --git a/e2e/tests-app-ng/app/main.ts b/e2e/tests-app-ng/app/main.ts index 35bebd4d8..60b027e0c 100644 --- a/e2e/tests-app-ng/app/main.ts +++ b/e2e/tests-app-ng/app/main.ts @@ -1,8 +1,8 @@ -import { platformNativeScriptDynamic } from "@nativescript/angular/platform"; +import { platformNativeScriptDynamic } from "@nativescript/angular"; import { AppModule } from "./app.module"; -import { enable } from "@nativescript/core/trace"; +import { Trace } from "@nativescript/core"; -enable(); +Trace.enable(); platformNativeScriptDynamic().bootstrapModule(AppModule); diff --git a/e2e/tests-app-ng/app/main/main-page-router-outlet.ts b/e2e/tests-app-ng/app/main/main-page-router-outlet.ts index 7c30b1062..cf2d31525 100644 --- a/e2e/tests-app-ng/app/main/main-page-router-outlet.ts +++ b/e2e/tests-app-ng/app/main/main-page-router-outlet.ts @@ -58,6 +58,6 @@ export class MainComponent { @Component({ selector: "navigation-main", - template: `` + template: `` }) export class NavigationMainPageRouterComponent { } diff --git a/e2e/tests-app-ng/app/modal/lazy/lazy-load-modal.component.ts b/e2e/tests-app-ng/app/modal/lazy/lazy-load-modal.component.ts index 3e36efd68..3571090ab 100644 --- a/e2e/tests-app-ng/app/modal/lazy/lazy-load-modal.component.ts +++ b/e2e/tests-app-ng/app/modal/lazy/lazy-load-modal.component.ts @@ -6,8 +6,7 @@ import { ViewContainerRef, } from "@angular/core"; -import { NSModuleFactoryLoader } from "@nativescript/angular/router"; -import { ModalDialogService } from "@nativescript/angular/directives/dialogs"; +import { NSModuleFactoryLoader, ModalDialogService } from "@nativescript/angular"; import { LazyComponent } from "../../lazy/lazy.component"; diff --git a/e2e/tests-app-ng/app/modal/modal-dialogs/modal-dialog.component.ts b/e2e/tests-app-ng/app/modal/modal-dialogs/modal-dialog.component.ts index a83fe6864..1c069021b 100644 --- a/e2e/tests-app-ng/app/modal/modal-dialogs/modal-dialog.component.ts +++ b/e2e/tests-app-ng/app/modal/modal-dialogs/modal-dialog.component.ts @@ -8,7 +8,7 @@ import { ModalDialogService, ModalDialogOptions, ModalDialogParams -} from "@nativescript/angular/directives/dialogs"; +} from "@nativescript/angular"; @Component({ selector: "modal-content", diff --git a/e2e/tests-app-ng/app/navigation-options/navigation-options.component.ts b/e2e/tests-app-ng/app/navigation-options/navigation-options.component.ts index 869173661..06bdc3368 100644 --- a/e2e/tests-app-ng/app/navigation-options/navigation-options.component.ts +++ b/e2e/tests-app-ng/app/navigation-options/navigation-options.component.ts @@ -1,5 +1,5 @@ import { Component } from "@angular/core"; -import { RouterExtensions } from "@nativescript/angular/router"; +import { RouterExtensions } from "@nativescript/angular"; @Component({ selector: "nav-options", diff --git a/e2e/tests-app-ng/ngcc.config.js b/e2e/tests-app-ng/ngcc.config.js deleted file mode 100644 index ec433d6f3..000000000 --- a/e2e/tests-app-ng/ngcc.config.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - packages: { - "@nativescript/angular": { - entryPoints: { - ".": { - override: { - main: "./index.js", - typings: "./index.d.ts", - }, - ignoreMissingDependencies: true, - } - }, - ignorableDeepImportMatchers: [ - /zone.js\//, - /tns-core-modules\//, - /@nativescript\/core\//, - ] - } - } -}; \ No newline at end of file diff --git a/e2e/tests-app-ng/package.json b/e2e/tests-app-ng/package.json index 85782a0c2..3e222dcd2 100644 --- a/e2e/tests-app-ng/package.json +++ b/e2e/tests-app-ng/package.json @@ -6,55 +6,51 @@ "nativescript": { "id": "org.nativescript.testsappng", "tns-ios": { - "version": "6.5.0" + "version": "6.5.2" }, "tns-android": { "version": "6.5.0" } }, "dependencies": { - "@angular/animations": "~9.1.0", - "@angular/common": "~9.1.0", - "@angular/compiler": "~9.1.0", - "@angular/core": "~9.1.0", - "@angular/forms": "~9.1.0", - "@angular/platform-browser": "~9.1.0", - "@angular/platform-browser-dynamic": "~9.1.0", - "@angular/router": "~9.1.0", + "@angular/animations": "~10.0.0", + "@angular/common": "~10.0.0", + "@angular/compiler": "~10.0.0", + "@angular/core": "~10.0.0", + "@angular/forms": "~10.0.0", + "@angular/platform-browser": "~10.0.0", + "@angular/platform-browser-dynamic": "~10.0.0", + "@angular/router": "~10.0.0", "@nativescript/angular": "file:../../dist/nativescript-angular-scoped.tgz", - "nativescript-intl": "~3.0.0", "nativescript-theme-core": "^1.0.4", "reflect-metadata": "~0.1.8", "rxjs": "~6.5.5", - "@nativescript/core": "next", + "@nativescript/core": "rc", "zone.js": "^0.10.3" }, "devDependencies": { - "@angular/compiler-cli": "~9.1.0", - "@ngtools/webpack": "~9.1.0", + "@angular/compiler-cli": "~10.0.0", + "@ngtools/webpack": "~10.0.0", "babel-traverse": "6.24.1", "babel-types": "6.24.1", "babylon": "6.17.0", "codelyzer": "^5.1.0", "filewalker": "^0.1.3", "lazy": "1.0.11", - "nativescript-dev-webpack": "next", - "tslint": "^5.4.3", - "typescript": "~3.8.3" + "@nativescript/webpack": "rc", + "typescript": "~3.9.0" }, "scripts": { - "tslint": "tslint --config tslint.json 'app/**/*.ts'", "clean": "npx rimraf hooks node_modules platforms package-lock.json", - "setup": "cd ../../nativescript-angular && npm run pack && cd ../e2e/tests-app-ng && npm run clean", + "setup": "cd ../../nativescript-angular && npm run prep.apps && cd ../e2e/tests-app-ng && npm run clean", + "ngcc": "ngcc --properties es2015 module main --first-only", + "postinstall": "npm run ngcc", "u": "update-ns-webpack", "e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json", "e2e-watch": "tsc -p e2e --watch", - "update-app-ng-deps": "update-app-ng-deps", "ns-verify-bundle": "ns-verify-bundle", "update-ns-webpack": "update-ns-webpack", - "ngcc": "ngcc --properties es2015 module main --first-only", - "postinstall": "npm run ngcc", - "ios": "tns debug ios --env.aot --emulator --no-hmr", - "android": "tns debug android --env.aot --emulator --no-hmr" + "ios": "tns debug ios --emulator --no-hmr", + "android": "tns debug android --emulator --no-hmr" } } diff --git a/e2e/tests-app-ng/tsconfig.json b/e2e/tests-app-ng/tsconfig.json index 576a402fa..3b4231662 100644 --- a/e2e/tests-app-ng/tsconfig.json +++ b/e2e/tests-app-ng/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "module": "commonjs", - "target": "es5", + "module": "esnext", + "target": "es2015", "experimentalDecorators": true, "emitDecoratorMetadata": true, "noEmitHelpers": true, @@ -16,9 +16,6 @@ "paths": { "~/*": [ "app/*" - ], - "*": [ - "./node_modules/*" ] } }, diff --git a/e2e/tests-app-ng/tslint.json b/e2e/tests-app-ng/tslint.json deleted file mode 100644 index 4f96f5c0b..000000000 --- a/e2e/tests-app-ng/tslint.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "rulesDirectory": [ - "node_modules/codelyzer" - ], - "rules":{ - "use-input-property-decorator": true, - "use-output-property-decorator": true, - "use-host-property-decorator": true, - "no-attribute-parameter-decorator": true, - "no-input-rename": true, - "no-output-rename": true, - "use-life-cycle-interface": true, - "use-pipe-transform-interface": true, - "pipe-naming": [true, "camelCase"], - "component-class-suffix": true, - "directive-class-suffix": true, - "import-destructuring-spacing": true, - "member-access": false, - "no-any": false, - "no-inferrable-types": false, - "no-internal-module": true, - "no-var-requires": false, - "typedef": false, - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - }, - { - "call-signature": "space", - "index-signature": "space", - "parameter": "space", - "property-declaration": "space", - "variable-declaration": "space" - } - ], - - "ban": false, - "curly": true, - "no-arg": true, - "no-bitwise": true, - "no-conditional-assignment": true, - "no-console": [ - true, - "debug", - "info", - "time", - "timeEnd", - "trace" - ], - "no-construct": true, - "no-debugger": true, - "no-duplicate-variable": true, - "no-empty": false, - "no-eval": true, - "no-null-keyword": false, - "no-shadowed-variable": true, - "no-string-literal": false, - "no-switch-case-fall-through": true, - "no-unused-expression": true, - "no-var-keyword": true, - "radix": false, - "switch-default": true, - "triple-equals": [ - true, - "allow-null-check" - ], - "eofline": true, - "indent": [ - true, - "spaces" - ], - "max-line-length": [ - true, - 120 - ], - "no-require-imports": false, - "no-trailing-whitespace": true, - "object-literal-sort-keys": false, - "trailing-comma": [ - true, - { - "multiline": false, - "singleline": "never" - } - ], - - "align": false, - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "interface-name": false, - "jsdoc-format": true, - "no-consecutive-blank-lines": [ - true, 2 - ], - "one-line": [ - true, - "check-open-brace", - "check-catch", - "check-else", - "check-finally", - "check-whitespace" - ], - "quotemark": [ - true, - "double", - "avoid-escape" - ], - "semicolon": [true, "always"], - "variable-name": [ - true, - "check-format", - "allow-leading-underscore", - "ban-keywords" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - } -} diff --git a/nativescript-angular-package/.npmignore b/nativescript-angular-package/.npmignore index cfeb641a3..728e2a64d 100644 --- a/nativescript-angular-package/.npmignore +++ b/nativescript-angular-package/.npmignore @@ -1,4 +1,5 @@ *.tgz +dist *.ts !*.d.ts diff --git a/nativescript-angular-package/app-host-view.ts b/nativescript-angular-package/app-host-view.ts index 2afcaf55e..2d2419d19 100644 --- a/nativescript-angular-package/app-host-view.ts +++ b/nativescript-angular-package/app-host-view.ts @@ -1 +1 @@ -export * from "@nativescript/angular/app-host-view"; \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/common.ts b/nativescript-angular-package/common.ts index 8734f5c94..2d2419d19 100644 --- a/nativescript-angular-package/common.ts +++ b/nativescript-angular-package/common.ts @@ -1 +1 @@ -export * from "@nativescript/angular/common"; \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/dom-adapter.ts b/nativescript-angular-package/dom-adapter.ts index 46373fefc..2d2419d19 100644 --- a/nativescript-angular-package/dom-adapter.ts +++ b/nativescript-angular-package/dom-adapter.ts @@ -1 +1 @@ -export * from "@nativescript/angular/dom-adapter"; \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/element-registry.ts b/nativescript-angular-package/element-registry.ts index 46a37d420..2d2419d19 100644 --- a/nativescript-angular-package/element-registry.ts +++ b/nativescript-angular-package/element-registry.ts @@ -1 +1 @@ -export * from "@nativescript/angular/element-registry"; \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/forms/index.ts b/nativescript-angular-package/forms/index.ts index 4c8c3c933..2d2419d19 100644 --- a/nativescript-angular-package/forms/index.ts +++ b/nativescript-angular-package/forms/index.ts @@ -1 +1 @@ -export * from "@nativescript/angular/forms" \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/http-client/index.ts b/nativescript-angular-package/http-client/index.ts index 939d93e6d..2d2419d19 100644 --- a/nativescript-angular-package/http-client/index.ts +++ b/nativescript-angular-package/http-client/index.ts @@ -1 +1 @@ -export * from "@nativescript/angular/http-client" \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/index.ts b/nativescript-angular-package/index.ts index 03145e814..053585d6a 100644 --- a/nativescript-angular-package/index.ts +++ b/nativescript-angular-package/index.ts @@ -1,9 +1 @@ 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/lang-facade.ts b/nativescript-angular-package/lang-facade.ts index 994364fba..2d2419d19 100644 --- a/nativescript-angular-package/lang-facade.ts +++ b/nativescript-angular-package/lang-facade.ts @@ -1 +1 @@ -export * from "@nativescript/angular/lang-facade"; \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/modal-dialog.ts b/nativescript-angular-package/modal-dialog.ts index 9dad19c5e..2d2419d19 100644 --- a/nativescript-angular-package/modal-dialog.ts +++ b/nativescript-angular-package/modal-dialog.ts @@ -1 +1 @@ -export * from "@nativescript/angular/modal-dialog" \ No newline at end of file +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 index fc5956f1c..2d2419d19 100644 --- a/nativescript-angular-package/nativescript.module.ts +++ b/nativescript-angular-package/nativescript.module.ts @@ -1 +1 @@ -export * from "@nativescript/angular/nativescript.module"; \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/package.json b/nativescript-angular-package/package.json index 210549b7a..0a75675e8 100644 --- a/nativescript-angular-package/package.json +++ b/nativescript-angular-package/package.json @@ -1,7 +1,7 @@ { "name": "nativescript-angular", - "version": "9.0.0", - "description": "An Angular renderer that lets you build mobile apps with NativeScript.", + "version": "10.0.0", + "description": "Compatibility with old style nativescript-angular imports.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", "author": { @@ -22,24 +22,38 @@ "type": "git", "url": "https://github.com/NativeScript/nativescript-angular.git" }, - "dependencies": { - "@nativescript/angular": "file:../nativescript-angular" + "ngPackage": { + "lib": { + "entryFile": "index.ts", + "umdModuleIds": { + "@nativescript/core": "ns-core", + "@nativescript/angular": "ns-angular" + } + }, + "whitelistedNonPeerDependencies": [ + "." + ] }, "devDependencies": { - "@angular/animations": "~9.1.0", - "@angular/common": "~9.1.0", - "@angular/compiler": "~9.1.0", - "@angular/compiler-cli": "~9.1.0", - "@angular/core": "~9.1.0", - "@angular/forms": "~9.1.0", - "@angular/platform-browser": "~9.1.0", - "@angular/platform-browser-dynamic": "~9.1.0", - "@angular/router": "~9.1.0", + "@angular/animations": "~10.0.0", + "@angular/common": "~10.0.0", + "@angular/compiler": "~10.0.0", + "@angular/compiler-cli": "~10.0.0", + "@angular/core": "~10.0.0", + "@angular/forms": "~10.0.0", + "@angular/platform-browser": "~10.0.0", + "@angular/platform-browser-dynamic": "~10.0.0", + "@angular/router": "~10.0.0", + "@nativescript/angular": "~10.0.0", + "@nativescript/core": "rc", + "ng-packagr": "^10.0.1", "rxjs": "~6.5.5", - "@nativescript/core": "next", - "typescript": "~3.8.3" + "typescript": "~3.9.0" }, "scripts": { + "setup": "npx rimraf hooks node_modules package-lock.json && npm i", + "build": "ng-packagr -p package.json", + "build.pack": "npm run tsc && npm run build && cd dist && npm pack", "ngc": "ngc -p tsconfig.json", "tsc": "tsc", "pack-with-scoped-version": "cd ../build/pack-scripts && npm i && npx ts-node pack-compat.ts" diff --git a/nativescript-angular-package/platform-common.ts b/nativescript-angular-package/platform-common.ts index 6d8ac7743..2d2419d19 100644 --- a/nativescript-angular-package/platform-common.ts +++ b/nativescript-angular-package/platform-common.ts @@ -1 +1 @@ -export * from "@nativescript/angular/platform-common"; \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/platform-providers.ts b/nativescript-angular-package/platform-providers.ts index dcc447e8d..2d2419d19 100644 --- a/nativescript-angular-package/platform-providers.ts +++ b/nativescript-angular-package/platform-providers.ts @@ -1 +1 @@ -export * from "@nativescript/angular/platform-providers"; \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/platform-static.ts b/nativescript-angular-package/platform-static.ts deleted file mode 100644 index e63c475ec..000000000 --- a/nativescript-angular-package/platform-static.ts +++ /dev/null @@ -1 +0,0 @@ -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 index 7e8e49eee..2d2419d19 100644 --- a/nativescript-angular-package/platform.ts +++ b/nativescript-angular-package/platform.ts @@ -1 +1 @@ -export * from "@nativescript/angular/platform"; \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/renderer.ts b/nativescript-angular-package/renderer.ts index 6dd053d7a..2d2419d19 100644 --- a/nativescript-angular-package/renderer.ts +++ b/nativescript-angular-package/renderer.ts @@ -1 +1 @@ -export * from "@nativescript/angular/renderer"; \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/resource-loader.ts b/nativescript-angular-package/resource-loader.ts index e9e2794a8..2d2419d19 100644 --- a/nativescript-angular-package/resource-loader.ts +++ b/nativescript-angular-package/resource-loader.ts @@ -1 +1 @@ -export * from "@nativescript/angular/resource-loader"; \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/router/index.ts b/nativescript-angular-package/router/index.ts index 0959f3730..2d2419d19 100644 --- a/nativescript-angular-package/router/index.ts +++ b/nativescript-angular-package/router/index.ts @@ -1 +1 @@ -export * from "@nativescript/angular/router"; \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/router/router.module.ts b/nativescript-angular-package/router/router.module.ts index 1c7b8ed2b..50344ad36 100644 --- a/nativescript-angular-package/router/router.module.ts +++ b/nativescript-angular-package/router/router.module.ts @@ -1,2 +1 @@ -export { LocationState } from "@nativescript/angular/router/ns-location-strategy"; export * from "@nativescript/angular/router/router.module"; \ No newline at end of file diff --git a/nativescript-angular-package/schema-registry.ts b/nativescript-angular-package/schema-registry.ts index 1b76567a7..2d2419d19 100644 --- a/nativescript-angular-package/schema-registry.ts +++ b/nativescript-angular-package/schema-registry.ts @@ -1 +1 @@ -export * from "@nativescript/angular/schema-registry"; \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/testing/index.ts b/nativescript-angular-package/testing/index.ts index 3939f9dd3..af69144d0 100644 --- a/nativescript-angular-package/testing/index.ts +++ b/nativescript-angular-package/testing/index.ts @@ -1 +1 @@ -export * from "@nativescript/angular/testing" \ No newline at end of file +export * from "@nativescript/angular/testing"; \ 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 f06c592a4..af69144d0 100644 --- a/nativescript-angular-package/testing/src/nativescript_test_component_renderer.ts +++ b/nativescript-angular-package/testing/src/nativescript_test_component_renderer.ts @@ -1 +1 @@ -export * from "@nativescript/angular/testing/src/nativescript_test_component_renderer"; \ No newline at end of file +export * from "@nativescript/angular/testing"; \ 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 42234d6e5..af69144d0 100644 --- a/nativescript-angular-package/testing/src/util.ts +++ b/nativescript-angular-package/testing/src/util.ts @@ -1 +1 @@ -export * from "@nativescript/angular/testing/src/util"; +export * from "@nativescript/angular/testing"; \ No newline at end of file diff --git a/nativescript-angular-package/trace.ts b/nativescript-angular-package/trace.ts index 87044475c..2d2419d19 100644 --- a/nativescript-angular-package/trace.ts +++ b/nativescript-angular-package/trace.ts @@ -1 +1 @@ -export * from "@nativescript/angular/trace"; \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/tsconfig.json b/nativescript-angular-package/tsconfig.json index 96c60bde6..85c737c2b 100644 --- a/nativescript-angular-package/tsconfig.json +++ b/nativescript-angular-package/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "target": "es5", - "module": "commonjs", + "target": "es2017", + "module": "esnext", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, @@ -9,9 +9,10 @@ "noImplicitUseStrict": true, "noEmitHelpers": true, "declaration": true, - "removeComments": false, + "removeComments": true, "noEmitOnError": true, "skipLibCheck": true, + "skipDefaultLibCheck": true, "noImplicitAny": false, "lib": [ "es2017", @@ -24,12 +25,14 @@ "genDir": ".", "skipMetadataEmit": false, "skipTemplateCodegen": true, - "strictMetadataEmit": true + "strictMetadataEmit": true, + "enableIvy": true }, "include": [ "**/*.ts" ], - "exclude":[ - "node_modules/*" + "exclude": [ + "node_modules", + "dist" ] -} +} \ No newline at end of file diff --git a/nativescript-angular-package/value-accessors/base-value-accessor.ts b/nativescript-angular-package/value-accessors/base-value-accessor.ts index 7c5fd2186..aa3cfbdb5 100644 --- a/nativescript-angular-package/value-accessors/base-value-accessor.ts +++ b/nativescript-angular-package/value-accessors/base-value-accessor.ts @@ -1,3 +1,2 @@ // 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"; +export * from "@nativescript/angular"; diff --git a/nativescript-angular-package/view-util.ts b/nativescript-angular-package/view-util.ts index 53ecbb10e..2d2419d19 100644 --- a/nativescript-angular-package/view-util.ts +++ b/nativescript-angular-package/view-util.ts @@ -1 +1 @@ -export * from "@nativescript/angular/view-util"; \ No newline at end of file +export * from "@nativescript/angular"; \ No newline at end of file diff --git a/nativescript-angular-package/zone-js/testing.jasmine.ts b/nativescript-angular-package/zone-js/testing.jasmine.ts index 06c6899df..b52f2e881 100644 --- a/nativescript-angular-package/zone-js/testing.jasmine.ts +++ b/nativescript-angular-package/zone-js/testing.jasmine.ts @@ -1,3 +1,4 @@ // Bootstrap helper module for jasmine spec tests import "@nativescript/angular/platform"; -import "@nativescript/angular/zone-js/dist/zone-nativescript.jasmine.js"; +// import "@nativescript/angular/zone-js/dist/zone-nativescript.jasmine.js"; +import '@nativescript/zone-js'; diff --git a/nativescript-angular-package/zone-js/testing.mocha.ts b/nativescript-angular-package/zone-js/testing.mocha.ts index f8ec59c8a..ce59f0e7b 100644 --- a/nativescript-angular-package/zone-js/testing.mocha.ts +++ b/nativescript-angular-package/zone-js/testing.mocha.ts @@ -1,2 +1,3 @@ import "@nativescript/angular/platform"; -import "@nativescript/angular/zone-js/dist/zone-nativescript.mocha.js"; +// import "@nativescript/angular/zone-js/dist/zone-nativescript.mocha.js"; +import '@nativescript/zone-js'; diff --git a/nativescript-angular/.npmignore b/nativescript-angular/.npmignore index 9e43d16dc..6f87c2653 100644 --- a/nativescript-angular/.npmignore +++ b/nativescript-angular/.npmignore @@ -1,4 +1,5 @@ *.tgz +dist *.ts !*.d.ts diff --git a/nativescript-angular/.prettierignore b/nativescript-angular/.prettierignore new file mode 100644 index 000000000..3cd5b3e47 --- /dev/null +++ b/nativescript-angular/.prettierignore @@ -0,0 +1,14 @@ +.github +*.yml +.vscode +build +dist +doc +e2e +tests +coverage +platforms +temp +*.md +*.json +*.js \ No newline at end of file diff --git a/nativescript-angular/.prettierrc.json b/nativescript-angular/.prettierrc.json new file mode 100644 index 000000000..098f6bab3 --- /dev/null +++ b/nativescript-angular/.prettierrc.json @@ -0,0 +1,6 @@ +{ + "useTabs": true, + "printWidth": 600, + "tabWidth": 2, + "singleQuote": true +} \ No newline at end of file diff --git a/nativescript-angular/README.md b/nativescript-angular/README.md index 8f87f938c..b6d86f1a1 100644 --- a/nativescript-angular/README.md +++ b/nativescript-angular/README.md @@ -1 +1,45 @@ -[Get started with Angular and NativeScript.](http://docs.nativescript.org/angular/start/introduction.html) +# NativeScript Angular +[![Build Status](https://travis-ci.org/NativeScript/nativescript-angular.svg?branch=master)](https://travis-ci.org/NativeScript/nativescript-angular) + +This repository contains the code for integration of NativeScript with Angular. + +[NativeScript](https://www.nativescript.org/) is a framework which enables developers to write truly native mobile applications for Android and iOS using JavaScript and CSS. [Angular](https://angular.io/) is one of the most popular open source JavaScript frameworks for application development. We [worked closely with developers at Google](http://angularjs.blogspot.bg/2015/12/building-mobile-apps-with-angular-2-and.html) to make Angular in NativeScript a reality. The result is a software architecture that allows you to build mobile apps using the same framework—and in some cases the same code—that you use to build Angular web apps, with the performance you’d expect from native code. [Read more about building truly native mobile apps with NativeScript and Angular](https://docs.nativescript.org/tutorial/ng-chapter-0). + + + + +- [NativeScript Angular](#nativescript-angular) + - [Watch the video explaining Angular and NativeScript](#watch-the-video-explaining-angular-and-nativescript) + - [Explore the examples](#explore-the-examples) + - [Contribute](#contribute) + - [Known issues](#known-issues) + - [Get Help](#get-help) + + + + +## Watch the video explaining Angular and NativeScript +[NativeScript session on AngularConnect conference](https://www.youtube.com/watch?v=4SbiiyRSIwo) + +## Explore the examples + +The `e2e` apps are meant for testing stuff. You can take a look at these additional sample apps that use the published builds from npm: + +* [Hello world starter](https://github.com/NativeScript/nativescript-app-templates/tree/master/packages/template-hello-world-ng) +* [Master-detail template](https://github.com/NativeScript/nativescript-app-templates/tree/master/packages/template-master-detail-ng) +* [Drawer navigation template](https://github.com/NativeScript/nativescript-app-templates/tree/master/packages/template-drawer-navigation-ng) +* [TabView navigation template](https://github.com/NativeScript/nativescript-app-templates/tree/master/packages/template-tab-navigation-ng) +* [NativeScript Angular SDK examples](https://github.com/NativeScript/nativescript-sdk-examples-ng) + +## Contribute +We love PRs! Check out the [contributing guidelines](CONTRIBUTING.md) and [development workflow for local setup](DevelopmentWorkflow.md). If you want to contribute, but you are not sure where to start - look for [issues labeled `help wanted`](https://github.com/NativeScript/nativescript-angular/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). + +## Known issues + +1. There are certain issues with the Parse5DomAdapter and we'll likely need to provide our own later on: + * Self-closing elements (`