Skip to content

Commit a9bf39e

Browse files
committed
tests app first import
1 parent 582ce09 commit a9bf39e

Some content is hidden

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

46 files changed

+221
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ src/nativescript-angular/**/*.js
99
nativescript-angular*.tgz
1010
angular2-*.tgz
1111

12+
tests/app/**/*.js
13+
tests/app/nativescript-angular
14+
tests/app/global.d.ts
15+
tests/platforms
16+
tests/lib
17+
tests/node_modules
1218

1319
ng-sample/app/**/*.js
1420
ng-sample/app/nativescript-angular

tests/.ctags-exclude

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
bin
3+
platforms
4+
app/*.js
5+
built
6+
7+
deps/NativeScript/node_modules
8+
deps/NativeScript/bin

tests/.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
node_modules
2+
built
3+
tags
4+
typings
5+
.baseDir.ts
6+
.tscache
7+
8+
app/**/*.js
9+
app/**/*.map
10+
platforms
11+
lib

tests/README.md

Lines changed: 34 additions & 0 deletions
62.2 KB
187 KB
59.5 KB
182 KB
20.3 KB
61.4 KB
30.7 KB
36.3 KB
28.9 KB
31.4 KB
323 Bytes
258 Bytes
29.8 KB
33.8 KB
31.8 KB
38.6 KB
32.9 KB
41.2 KB
33.4 KB
43.3 KB

tests/app/App_Resources/iOS/icon.png

31.5 KB
37.7 KB

tests/app/LICENSE

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Copyright (c) 2015, Telerik AD
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
7+
1. Redistributions of source code must retain the above copyright notice, this
8+
list of conditions and the following disclaimer.
9+
10+
2. Redistributions in binary form must reproduce the above copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
14+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
18+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

tests/app/app.component.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import {Component} from "angular2/core";
2+
3+
@Component({
4+
selector: "my-app",
5+
template: `
6+
<StackLayout orientation="vertical">
7+
<Label [text]="message" class="title" (tap)="message = 'OHAI'"></Label>
8+
</StackLayout>
9+
`,
10+
})
11+
export class AppComponent {
12+
public message: string = "Hello, Angular!";
13+
}

tests/app/app.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.title {
2+
font-size: 30;
3+
horizontal-align: center;
4+
margin:20;
5+
}

tests/app/main.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// this import should be first in order to load some required settings (like globals and reflect-metadata)
2+
import {nativeScriptBootstrap} from "./nativescript-angular/application";
3+
import {AppComponent} from "./app.component";
4+
5+
nativeScriptBootstrap(AppComponent);

tests/app/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"main": "main.js"
3+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
var path = require('path');
2+
var shelljs = require('shelljs');
3+
4+
module.exports = function() {
5+
shelljs.cp('-Rf', '../src/nativescript-angular', 'app');
6+
shelljs.cp('-Rf', '../src/global.d.ts', 'app');
7+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var path = require('path');
2+
var shelljs = require('shelljs');
3+
4+
module.exports = function ($logger, $projectData, $usbLiveSyncService) {
5+
if (!$usbLiveSyncService.isInitialized) {
6+
var zoneDts = path.join('node_modules', 'angular2', 'typings', 'zone', 'zone.d.ts');
7+
shelljs.sed('-i', /.*reference.*path.*es6-shim.*\n/g, '', zoneDts);
8+
9+
var globalsEs6Dts = path.join('node_modules', 'angular2', 'manual_typings', 'globals-es6.d.ts');
10+
shelljs.sed('-i', /.*reference.*path.*node\.d\.ts.*\n/g, '', globalsEs6Dts);
11+
}
12+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("nativescript-dev-typescript/lib/before-prepare.js");
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var path = require('path');
2+
var shelljs = require('shelljs');
3+
4+
module.exports = function ($logger, $projectData, $usbLiveSyncService) {
5+
if (!$usbLiveSyncService.isInitialized) {
6+
// Delete stale widgets.jar brought by old Android platforms.
7+
// TODO: Remove this after version 1.6.0 of the Android runtime gets released
8+
var jars = shelljs.find('platforms/android').filter(function(fileName){
9+
return fileName.match(/widgets.jar$/);
10+
});
11+
jars.forEach(function(jarFile) {
12+
console.log('Deleting stale jar file: ' + jarFile);
13+
shelljs.rm(jarFile);
14+
});
15+
}
16+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("nativescript-dev-typescript/lib/watch.js");

tests/package.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"nativescript": {
3+
"id": "org.nativescript.helloworldng",
4+
"tns-ios": {
5+
"version": "1.5.2"
6+
},
7+
"tns-android": {
8+
"version": "1.5.1"
9+
}
10+
},
11+
"name": "nativescript-hello-world-ng",
12+
"main": "app.js",
13+
"version": "1.0.0",
14+
"author": "Telerik <[email protected]>",
15+
"description": "Nativescript Angular Hello World template",
16+
"license": "BSD",
17+
"keywords": [
18+
"telerik",
19+
"mobile",
20+
"angular",
21+
"nativescript",
22+
"{N}",
23+
"tns",
24+
"appbuilder",
25+
"template"
26+
],
27+
"repository": {
28+
"type": "git",
29+
"url": "git://github.com/NativeScript/template-hello-world-ng"
30+
},
31+
"homepage": "http://nativescript.org",
32+
"dependencies": {
33+
"tns-core-modules": "1.6.0-angular-2",
34+
"angular2": "2.0.0-beta.2",
35+
"parse5": "1.4.2",
36+
"punycode": "1.3.2",
37+
"querystring": "0.2.0",
38+
"url": "0.10.3",
39+
"reflect-metadata": "0.1.2",
40+
"rxjs": "5.0.0-beta.0",
41+
"zone.js": "0.5.10"
42+
},
43+
"devDependencies": {
44+
"nativescript-dev-typescript": "^0.2.2",
45+
"shelljs": "^0.5.3",
46+
"typescript": "^1.7.5"
47+
}
48+
}

tests/references.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference path="./node_modules/tns-core-modules/tns-core-modules.d.ts" /> Needed for autocompletion and compilation.

tests/tsconfig.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"compilerOptions": {
3+
"outDir": "app",
4+
"rootDir": "app",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"inlineSourceMap": true,
8+
"experimentalDecorators": true,
9+
"removeComments": false,
10+
"emitDecoratorMetadata": true,
11+
"noEmitOnError": true
12+
},
13+
"files": [
14+
"app/main.ts",
15+
"app/global.d.ts",
16+
"app/app.component.ts",
17+
"node_modules/tns-core-modules/tns-core-modules.d.ts"
18+
],
19+
"filesGlob": [
20+
"node_modules/tns-core-modules/tns-core-modules.d.ts",
21+
"app/**/*.ts"
22+
],
23+
"exclude": [
24+
"node_modules",
25+
"platforms"
26+
]
27+
}

0 commit comments

Comments
 (0)