Skip to content

Commit 05d4088

Browse files
committed
Initial import.
Doing nothing yet, but, hey, we can compile some of the code!
1 parent cd87fbf commit 05d4088

File tree

9 files changed

+437
-0
lines changed

9 files changed

+437
-0
lines changed

.ctags-exclude

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
bin
3+
build
4+
android17.d.ts
5+
ios.d.ts

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
bin/dist
2+
node_modules
3+
tags
4+
typings
5+
/src/*
6+
!/src/nativescript-angular/
7+
.baseDir.ts
8+
.tscache

DEVELOPERS.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# NativeScript - Angular 2 integration
2+
3+
## Running stuff locally
4+
5+
Clone the repo and cd to the local dir.
6+
7+
Fetch the git submodules:
8+
9+
```sh
10+
git submodule --init
11+
git submodule --update
12+
```
13+
14+
Install the npm requirements:
15+
16+
```sh
17+
npm install
18+
```
19+
20+
Install the angular npm requirements:
21+
22+
```sh
23+
cd angular
24+
npm install
25+
cd .. # back to the project root
26+
```
27+
28+
Install the angular typings:
29+
30+
```sh
31+
cd deps/angular/modules/angular2
32+
tsd reinstall
33+
cd ../../../../ # back to the project root
34+
```
35+
36+
Prepare the local angular2 & NativeScript codebases in src/*:
37+
38+
```sh
39+
grunt prepare
40+
```
41+
42+
Compile the project:
43+
44+
```sh
45+
grunt ts
46+
```

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Integrating NativeScript with Angular 2.

gruntfile.js

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
module.exports = function(grunt) {
2+
grunt.loadNpmTasks('grunt-ts');
3+
grunt.loadNpmTasks('grunt-shell');
4+
grunt.loadNpmTasks('grunt-contrib-copy');
5+
grunt.loadNpmTasks('grunt-contrib-clean');
6+
7+
var runEnv = JSON.parse(JSON.stringify(process.env));
8+
runEnv['NODE_PATH'] = 'bin/dist/modules';
9+
10+
grunt.initConfig({
11+
ts: {
12+
build: {
13+
src: [
14+
'src/**/*.ts',
15+
],
16+
outDir: 'bin/dist/modules',
17+
options: {
18+
fast: 'never',
19+
module: "commonjs",
20+
target: "es5",
21+
sourceMap: true,
22+
declaration: true,
23+
removeComments: false,
24+
compiler: "node_modules/typescript/bin/tsc",
25+
noEmitOnError: true
26+
},
27+
},
28+
},
29+
copy: {
30+
angularSource: {
31+
expand: true,
32+
rename: function(dest, src) {
33+
if (/\.js$/i.test(src)) {
34+
return dest + src.substring(0, src.length - 3) + '.ts';
35+
}
36+
if (/\.es6$/i.test(src)) {
37+
return dest + src.substring(0, src.length - 4) + '.ts';
38+
}
39+
return dest + src;
40+
},
41+
cwd: './deps/angular/modules',
42+
src: [
43+
'angular2/**/*',
44+
'!angular2/test/**/*',
45+
'!angular2/angular2_sfx*',
46+
'!angular2/router*',
47+
'!angular2/src/router/**/*',
48+
'!angular2/src/mock/**/*',
49+
'!angular2/docs/**/*',
50+
'!angular2/test*',
51+
'!angular2/src/test_lib/**/*',
52+
'!angular2/typings/angular-protractor/**/*',
53+
'!angular2/typings/node/**/*',
54+
//'!angular2/typings/es6-promise/**/*',
55+
'!angular2/typings/jasmine/**/*',
56+
//'!angular2/typings/hammerjs/**/*',
57+
'!angular2/typings/selenium-webdriver/**/*',
58+
],
59+
dest: 'src/'
60+
},
61+
reflect: {
62+
expand: true,
63+
cwd: './node_modules',
64+
src: [
65+
'reflect-metadata/reflect-metadata.d.ts',
66+
],
67+
dest: 'src/'
68+
},
69+
nativeScriptSource: {
70+
expand: true,
71+
cwd: './deps/NativeScript',
72+
src: [
73+
'**/*.ts',
74+
'!es6-promise.d.ts',
75+
'!es-collections.d.ts',
76+
'!node_modules/**/*',
77+
'!bin/**/*',
78+
],
79+
dest: 'src/'
80+
},
81+
},
82+
clean: {
83+
src: {
84+
expand: true,
85+
cwd: './src',
86+
src: [
87+
'*.ts',
88+
'angular2',
89+
'reflect-metadata',
90+
'bin',
91+
'node_modules',
92+
'image-source',
93+
'xml',
94+
'text',
95+
'data',
96+
'platform',
97+
'trace',
98+
'fps-meter',
99+
'color',
100+
'application-settings',
101+
'http',
102+
'camera',
103+
'console',
104+
'timer',
105+
'utils',
106+
'location',
107+
'build',
108+
'apps',
109+
'file-system',
110+
'application',
111+
'js-libs',
112+
'globals',
113+
'node-tests',
114+
'ui',
115+
]
116+
}
117+
},
118+
shell: {
119+
runApp: {
120+
command: 'node bin/dist/modules/app.js',
121+
options: {
122+
execOptions: {
123+
env: runEnv
124+
}
125+
}
126+
}
127+
},
128+
});
129+
130+
grunt.registerTask("run", ['ts', 'shell:runApp']);
131+
132+
grunt.registerTask("prepareAngular", [
133+
'clean:src',
134+
'copy:reflect',
135+
'copy:angularSource',
136+
]);
137+
138+
grunt.registerTask("prepare", ["prepareAngular", "copy:nativeScriptSource"]);
139+
}

package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "nativescript-angular",
3+
"version": "0.0.1",
4+
"description": "",
5+
"homepage": "http://www.telerik.com",
6+
"bugs": "http://www.telerik.com",
7+
"contributors": [
8+
"Hristo Deshev <hristo.deshev@telerik.com>"
9+
],
10+
"license": "Apache-2.0",
11+
"repository": {
12+
"type": "git",
13+
"url": "https://github.com/hdeshev/nativescript-angular.git"
14+
},
15+
"scripts": {
16+
},
17+
"dependencies": {
18+
"reflect-metadata": "0.1.0",
19+
"rtts_assert": "2.0.0-alpha.26",
20+
"zone.js": "0.5.0",
21+
"rx": "2.5.3"
22+
},
23+
"devDependencies": {
24+
"grunt": "0.4.5",
25+
"grunt-contrib-copy": "0.8.0",
26+
"grunt-contrib-clean": "0.6.0",
27+
"grunt-shell": "1.1.2",
28+
"grunt-file": "1.0.2",
29+
"grunt-ts": "4.1.0",
30+
"typescript": "1.5.0-beta"
31+
}
32+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('aaa');
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
interface TypedPropertyDescriptor<T> {
2+
enumerable?: boolean;
3+
configurable?: boolean;
4+
writable?: boolean;
5+
value?: T;
6+
get?: () => T;
7+
set?: (value: T) => void;
8+
}
9+
10+
declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
11+
declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
12+
declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
13+
declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;

0 commit comments

Comments
 (0)