diff --git a/gruntfile.js b/gruntfile.js index 5201c953e..30bbcab8f 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -80,18 +80,9 @@ module.exports = function(grunt) { grunt.registerTask("cleanAll", [ 'clean:src', - 'fix-unsupported-typings', 'clean:package', ]); - grunt.registerTask("fix-unsupported-typings", function() { - var zoneDts = path.join('node_modules', 'angular2', 'typings', 'zone', 'zone.d.ts'); - shelljs.sed('-i', /.*reference.*path.*es6-shim.*\n/g, '', zoneDts); - - var globalsEs6Dts = path.join('node_modules', 'angular2', 'manual_typings', 'globals-es6.d.ts'); - shelljs.sed('-i', /.*reference.*path.*node\.d\.ts.*\n/g, '', globalsEs6Dts); - }); - grunt.registerTask("package", [ "clean:packageDefinitions", "copy:handCodedDefinitions", diff --git a/ng-sample/package.json b/ng-sample/package.json index dba54fb51..a3124138f 100644 --- a/ng-sample/package.json +++ b/ng-sample/package.json @@ -24,14 +24,14 @@ "homepage": "https://github.com/NativeScript/template-hello-world", "dependencies": { "tns-core-modules": "^1.6.0", - "angular2": "2.0.0-beta.3", + "angular2": "2.0.0-beta.6", "parse5": "1.4.2", "punycode": "1.3.2", "querystring": "0.2.0", "url": "0.10.3", "reflect-metadata": "0.1.2", "rxjs": "5.0.0-beta.0", - "zone.js": "0.5.11" + "zone.js": "0.5.14" }, "devDependencies": { "grunt": "0.4.5", diff --git a/ng-sample/references.d.ts b/ng-sample/references.d.ts new file mode 100644 index 000000000..a61deda16 --- /dev/null +++ b/ng-sample/references.d.ts @@ -0,0 +1,2 @@ + +/// Needed for autocompletion and compilation. \ No newline at end of file diff --git a/ng-sample/tsconfig.json b/ng-sample/tsconfig.json index 143ef9c85..871abe41b 100644 --- a/ng-sample/tsconfig.json +++ b/ng-sample/tsconfig.json @@ -14,4 +14,4 @@ "node_modules", "platforms" ] -} +} \ No newline at end of file diff --git a/package.json b/package.json index 7b5ec3b24..ad0cdd107 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nativescript-angular", - "version": "0.0.31", + "version": "0.0.32", "description": "", "homepage": "http://www.telerik.com", "bugs": "http://www.telerik.com", @@ -15,7 +15,7 @@ "scripts": {}, "dependencies": { "tns-core-modules": "^1.6.0", - "angular2": "2.0.0-beta.3", + "angular2": "2.0.0-beta.6", "es6-shim": "^0.33.3", "parse5": "1.4.2", "punycode": "1.3.2", @@ -23,7 +23,7 @@ "url": "0.10.3", "reflect-metadata": "0.1.2", "rxjs": "5.0.0-beta.0", - "zone.js": "0.5.11" + "zone.js": "0.5.14" }, "devDependencies": { "grunt": "0.4.5", diff --git a/src/global.d.ts b/src/global.d.ts index 57fdd6224..a36f402da 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -1,31 +1,9 @@ -/// -/// -/// -declare var assert: any; +/// interface Map { keys(): Array; values(): Array; } -declare type NativeScriptModule = NodeModule -declare type NativeScriptRequire = NodeRequire - -//declare type MapConstructor = typeof Map; -//declare type SetConstructor = typeof Set; - -interface NumberConstructor { - isInteger(number: number): boolean; -} - -interface Array { - fill(value: T, start?: number, end?: number): T[]; -} - -interface String { - endsWith(searchString: string, endPosition?: number): boolean; - startsWith(searchString: string, position?: number): boolean; -} - -interface Zone { -} +declare type MapConstructor = typeof Map; +declare type SetConstructor = typeof Set; diff --git a/tests/app/App_Resources/Android/AndroidManifest.xml b/tests/app/App_Resources/Android/AndroidManifest.xml new file mode 100644 index 000000000..8d827dc8d --- /dev/null +++ b/tests/app/App_Resources/Android/AndroidManifest.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/app/global.d.ts b/tests/app/global.d.ts index 2c173269e..a36f402da 100644 --- a/tests/app/global.d.ts +++ b/tests/app/global.d.ts @@ -1,5 +1,4 @@ /// -declare var assert: any; interface Map { keys(): Array; @@ -8,19 +7,3 @@ interface Map { declare type MapConstructor = typeof Map; declare type SetConstructor = typeof Set; - -interface NumberConstructor { - isInteger(number: number): boolean; -} - -interface Array { - fill(value: T, start?: number, end?: number): T[]; -} - -interface String { - endsWith(searchString: string, endPosition?: number): boolean; - startsWith(searchString: string, position?: number): boolean; -} - -interface Zone { -} diff --git a/tests/app/tests/bootstrap.ts b/tests/app/tests/bootstrap.ts index b88bb4199..48bf4dcf2 100644 --- a/tests/app/tests/bootstrap.ts +++ b/tests/app/tests/bootstrap.ts @@ -4,6 +4,8 @@ import "reflect-metadata"; import {bootstrap} from "../nativescript-angular/application"; import {Component} from "angular2/core"; global.assert = realAssert; +import * as chai from "chai" +declare var assert: typeof chai.assert; @Component({ template: "" diff --git a/tests/hooks/before-prepare/15-remove-unsupported-angular-typings.js b/tests/hooks/before-prepare/15-remove-unsupported-angular-typings.js deleted file mode 100644 index 691338216..000000000 --- a/tests/hooks/before-prepare/15-remove-unsupported-angular-typings.js +++ /dev/null @@ -1,14 +0,0 @@ -var path = require('path'); -var shelljs = require('shelljs'); - -module.exports = function ($logger, $projectData, $usbLiveSyncService) { - var projectDir = path.join(__dirname, '..', '..'); - var angularModuleDir = path.join(projectDir, 'node_modules', 'angular2'); - if (!$usbLiveSyncService.isInitialized) { - var zoneDts = path.join(angularModuleDir, 'typings', 'zone', 'zone.d.ts'); - shelljs.sed('-i', /.*reference.*path.*es6-shim.*\n/g, '', zoneDts); - - var globalsEs6Dts = path.join(angularModuleDir, 'manual_typings', 'globals-es6.d.ts'); - shelljs.sed('-i', /.*reference.*path.*node\.d\.ts.*\n/g, '', globalsEs6Dts); - } -} diff --git a/tests/hooks/before-prepare/30-remove-stale-widgets-jar.js b/tests/hooks/before-prepare/30-remove-stale-widgets-jar.js deleted file mode 100644 index c7e99e0ce..000000000 --- a/tests/hooks/before-prepare/30-remove-stale-widgets-jar.js +++ /dev/null @@ -1,18 +0,0 @@ -var path = require('path'); -var shelljs = require('shelljs'); - -module.exports = function ($logger, $projectData, $usbLiveSyncService) { - var projectDir = path.join(__dirname, '..', '..'); - if (!$usbLiveSyncService.isInitialized) { - // Delete stale widgets.jar brought by old Android platforms. - // TODO: Remove this after version 1.6.0 of the Android runtime gets released - var androidDir = path.join(projectDir, 'platforms/android'); - var jars = shelljs.find(androidDir).filter(function(fileName){ - return fileName.match(/widgets.jar$/); - }); - jars.forEach(function(jarFile) { - console.log('Deleting stale jar file: ' + jarFile); - shelljs.rm(jarFile); - }); - } -}; diff --git a/tests/hooks/before-prepare/20-nativescript-dev-typescript.js b/tests/hooks/before-prepare/nativescript-dev-typescript.js similarity index 100% rename from tests/hooks/before-prepare/20-nativescript-dev-typescript.js rename to tests/hooks/before-prepare/nativescript-dev-typescript.js diff --git a/tests/package.json b/tests/package.json index 2af444f98..3bc78ad40 100644 --- a/tests/package.json +++ b/tests/package.json @@ -1,52 +1,52 @@ { - "nativescript": { - "id": "org.nativescript.helloworldng", - "tns-android": { - "version": "1.6.0" - } - }, - "name": "nativescript-hello-world-ng", - "main": "app.js", - "version": "1.0.0", - "author": "Telerik ", - "description": "Nativescript Angular Hello World template", - "license": "BSD", - "keywords": [ - "telerik", - "mobile", - "angular", - "nativescript", - "{N}", - "tns", - "appbuilder", - "template" - ], - "repository": { - "type": "git", - "url": "git://github.com/NativeScript/template-hello-world-ng" - }, - "homepage": "http://nativescript.org", - "dependencies": { - "angular2": "2.0.0-beta.3", - "nativescript-unit-test-runner": "^0.2.8", - "parse5": "1.4.2", - "punycode": "1.3.2", - "querystring": "0.2.0", - "reflect-metadata": "0.1.2", - "rxjs": "5.0.0-beta.0", - "tns-core-modules": "1.6.0", - "url": "0.10.3", - "zone.js": "0.5.11" - }, - "devDependencies": { - "chai": "^3.5.0", - "karma": "^0.13.19", - "karma-chai": "^0.1.0", - "karma-mocha": "^0.2.1", - "karma-nativescript-launcher": "^0.3.1", - "mocha": "^2.4.5", - "nativescript-dev-typescript": "^0.2.2", - "shelljs": "^0.5.3", - "typescript": "^1.7.5" - } -} + "nativescript": { + "id": "org.nativescript.helloworldng", + "tns-android": { + "version": "1.6.0" + } + }, + "name": "nativescript-hello-world-ng", + "main": "app.js", + "version": "1.0.0", + "author": "Telerik ", + "description": "Nativescript Angular Hello World template", + "license": "BSD", + "keywords": [ + "telerik", + "mobile", + "angular", + "nativescript", + "{N}", + "tns", + "appbuilder", + "template" + ], + "repository": { + "type": "git", + "url": "git://github.com/NativeScript/template-hello-world-ng" + }, + "homepage": "http://nativescript.org", + "dependencies": { + "angular2": "2.0.0-beta.6", + "nativescript-unit-test-runner": "^0.2.8", + "parse5": "1.4.2", + "punycode": "1.3.2", + "querystring": "0.2.0", + "reflect-metadata": "0.1.2", + "rxjs": "5.0.0-beta.0", + "tns-core-modules": "1.6.0", + "url": "0.10.3", + "zone.js": "0.5.14" + }, + "devDependencies": { + "chai": "^3.5.0", + "karma": "^0.13.19", + "karma-chai": "^0.1.0", + "karma-mocha": "^0.2.1", + "karma-nativescript-launcher": "^0.3.1", + "mocha": "^2.4.5", + "nativescript-dev-typescript": "^0.2.2", + "shelljs": "^0.5.3", + "typescript": "^1.7.5" + } +} \ No newline at end of file diff --git a/tests/references.d.ts b/tests/references.d.ts index b14f3837d..8f857a9d3 100644 --- a/tests/references.d.ts +++ b/tests/references.d.ts @@ -1 +1 @@ -/// Needed for autocompletion and compilation. \ No newline at end of file +/// Needed for autocompletion and compilation. diff --git a/tests/tsconfig.json b/tests/tsconfig.json index b2b758895..0b675cf75 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -12,18 +12,6 @@ "noEmitHelpers": false, "noEmitOnError": true }, - "files": [ - "app/main.ts", - "app/global.d.ts", - "app/app.component.ts", - "app/tests/bootstrap.ts", - "typings/mocha.d.ts", - "node_modules/tns-core-modules/tns-core-modules.d.ts" - ], - "filesGlob": [ - "node_modules/tns-core-modules/tns-core-modules.d.ts", - "app/**/*.ts" - ], "exclude": [ "node_modules", "platforms"