Skip to content

Commit 0b2c644

Browse files
author
Nedyalko Nikolov
committed
Make nativescript-angular modules es6.
1 parent 9af7f3d commit 0b2c644

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+224
-172
lines changed

.gitignore

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ tags
66

77
/hooks
88

9-
nativescript-angular/**/*.d.ts
10-
!nativescript-angular/global.d.ts
11-
nativescript-angular/**/*.js
12-
!nativescript-angular/postinstall.js
13-
!nativescript-angular/hooks/**/*.js
14-
!nativescript-angular/gulpfile.js
9+
/nativescript-angular/**/*.d.ts
10+
/nativescript-angular/**/*.js
11+
12+
!/nativescript-angular/global.d.ts
13+
!/nativescript-angular/postinstall.js
14+
!/nativescript-angular/hooks/**/*.js
15+
!/nativescript-angular/gulpfile.js
16+
!/nativescript-angular/rollup.config.js
17+
!/nativescript-angular/rollup-entry.js
18+
!/nativescript-angular/zone-js/**/*.js
1519

1620
.tscache
1721
.nvm

nativescript-angular/animation-player.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { View } from "ui/core/view";
1010
import { AnimationCurve } from "ui/enums";
1111
import { ValueSource } from "ui/core/dependency-observable";
1212
import { isString } from "utils/types";
13-
import * as styleProperty from "ui/styling/style-property";
13+
import { getPropertyByCssName, KeyValuePair, Property } from "ui/styling/style-property";
1414

1515
export class NativeScriptAnimationPlayer implements AnimationPlayer {
1616

@@ -60,7 +60,7 @@ export class NativeScriptAnimationPlayer implements AnimationPlayer {
6060
for (let style of keyframe.styles.styles) {
6161
for (let substyle in style) {
6262
let value = style[substyle];
63-
let property = styleProperty.getPropertyByCssName(substyle);
63+
let property = getPropertyByCssName(substyle);
6464
if (property) {
6565
if (typeof value === "string" && property.valueConverter) {
6666
value = property.valueConverter(<string>value);
@@ -218,7 +218,7 @@ export class NativeScriptAnimationPlayer implements AnimationPlayer {
218218

219219
static parseTransform(value: string, animationInfo: KeyframeInfo) {
220220
let newTransform = NativeScriptAnimationPlayer.transformConverter(value);
221-
let array = new Array<styleProperty.KeyValuePair<styleProperty.Property, any>>();
221+
let array = new Array<KeyValuePair<Property, any>>();
222222
let values = undefined;
223223
for (let transform in newTransform) {
224224
switch (transform) {

nativescript-angular/common/detached-loader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import {
22
ComponentRef, ComponentFactory, ViewContainerRef,
33
Component, Type, ComponentFactoryResolver, ChangeDetectorRef
44
} from "@angular/core";
5-
import * as trace from "trace";
5+
import { write } from "trace";
66

77
export const CATEGORY = "detached-loader";
88
function log(message: string) {
9-
trace.write(message, CATEGORY);
9+
write(message, CATEGORY);
1010
}
1111

1212

nativescript-angular/directives/tab-view.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ElementRef, Directive, Input, TemplateRef, ViewContainerRef, OnInit, AfterViewInit } from "@angular/core";
22
import { TabView, TabViewItem } from "ui/tab-view";
3-
import * as utils from "../common/utils";
3+
import { convertToInt } from "../common/utils";
44
import { rendererLog } from "../trace";
55
import { isBlank } from "../lang-facade";
66

@@ -18,7 +18,7 @@ export class TabViewDirective implements AfterViewInit {
1818
}
1919

2020
set selectedIndex(value) {
21-
this._selectedIndex = utils.convertToInt(value);
21+
this._selectedIndex = convertToInt(value);
2222
if (this.viewInitialized) {
2323
this.tabView.selectedIndex = this._selectedIndex;
2424
}

nativescript-angular/global.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/// <reference path="./node_modules/tns-core-modules/tns-core-modules.d.ts" />
1+
/// <reference path="./node_modules/tns-core-modules/tns-core-modules.es6.d.ts" />

nativescript-angular/http.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { NSFileSystem } from "./file-system/ns-file-system";
77
import { NgModule } from "@angular/core";
88
import { HttpModule, XSRFStrategy } from "@angular/http";
99

10+
export { NSHttp } from "./http/ns-http";
11+
1012
export function nsHttpFactory(backend, options, nsFileSystem) {
1113
return new NSHttp(backend, options, nsFileSystem);
1214
};

nativescript-angular/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
import "application";
2+
3+
export * from "./platform-common";
14
export * from "./platform";
25
export * from "./platform-static";
36
export * from "./router";
47
export * from "./forms";
58
export * from "./http";
69
export * from "./directives";
710
export * from "./common/detached-loader";
11+
export * from "./trace";
12+
export * from "./platform-providers";
13+
export * from "./file-system/ns-file-system";
14+
export * from "./modal-dialog";
15+
export * from "./renderer";
16+
export * from "./view-util";
17+
export * from "./animation-driver";
18+
export * from "./resource-loader";
19+
export * from "./element-registry";
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// always import application at first place in order to fix some cycle dependency hell in ios.
2+
import "application";

nativescript-angular/nativescript.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import "globals";
2-
import "./zone.js/dist/zone-nativescript";
2+
import "./zone-js/dist/zone-nativescript";
33

44
import "reflect-metadata";
55
import "./polyfills/array";

nativescript-angular/package.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"private": true,
33
"name": "nativescript-angular",
44
"version": "1.3.0",
5+
"main": "bundle.all.js",
6+
"module": "index.js",
7+
"typings": "index.d.ts",
58
"description": "An Angular 2 renderer that lets you build mobile apps with NativeScript.",
69
"homepage": "http://www.telerik.com",
710
"bugs": "http://www.telerik.com",
@@ -18,10 +21,10 @@
1821
"postinstall": "node postinstall.js",
1922
"ngc": "ngc -p tsconfig.json",
2023
"tsc": "tsc -p tsconfig.json",
21-
"prepublish": "npm run tsc && npm run ngc"
24+
"prepublish": "npm run tsc && rollup -c && npm run ngc"
2225
},
2326
"dependencies": {
24-
"nativescript-intl": "~0.0.4",
27+
"nativescript-intl": "~0.0.5",
2528
"@angular/core": "~2.2.1",
2629
"@angular/common": "~2.2.1",
2730
"@angular/compiler": "~2.2.1",
@@ -35,15 +38,18 @@
3538
"parse5": "1.3.2",
3639
"punycode": "1.3.2",
3740
"querystring": "0.2.0",
41+
"rxjs": "5.0.0-beta.12",
3842
"url": "0.10.3"
3943
},
4044
"devDependencies": {
41-
"@angular/compiler-cli": "~2.2.1",
42-
"codelyzer": "^2.0.0-beta.1",
43-
"tns-core-modules": ">=2.4.0 || >=2.4.0-2016",
44-
"tslint": "~4.0.1",
45+
"tns-core-modules": ">=2.5.0 || >=2.5.0-2016",
46+
"zone.js": "^0.6.21",
4547
"typescript": "^2.0.2",
46-
"zone.js": "^0.6.21"
48+
"tslint": "~4.0.1",
49+
"codelyzer": "^2.0.0-beta.1",
50+
"@angular/compiler-cli": "~2.2.1",
51+
"rollup": "^0.36.3",
52+
"rollup-plugin-multi-entry": "^2.0.1"
4753
},
4854
"nativescript": {}
4955
}

0 commit comments

Comments
 (0)