From 0e23f47a043d864e153fab1f54d6c2fdebc65f10 Mon Sep 17 00:00:00 2001 From: Panayot Cankov Date: Mon, 26 Sep 2016 11:43:58 +0300 Subject: [PATCH] Update the .travis.yml to npm pack the tns-platform-declarations, add lib: [] config in the tsconfig.json --- .travis.yml | 3 +-- DevelopmentWorkflow.md | 4 ++-- package.json | 3 ++- tns-core-modules/tsconfig.json | 5 ++++- tns-platform-declarations/package.json | 2 +- tns-platform-declarations/references.d.ts | 1 - tns-platform-declarations/tsconfig.json | 7 +++++-- tsconfig.json | 18 +++++++++++++----- 8 files changed, 28 insertions(+), 15 deletions(-) delete mode 100644 tns-platform-declarations/references.d.ts diff --git a/.travis.yml b/.travis.yml index b8f25c038..656d798bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,6 @@ before_script: - nvm install $NODE_VERSION - npm install -g grunt-cli - npm install - - "(cd build/platform-declarations && npm install)" - echo no | android create avd --force -n $AVD_NAME -t android-$EMULATOR_API_VER --abi default/armeabi-v7a -c 12M - emulator -avd $AVD_NAME -no-audio -no-window & - android-wait-for-emulator @@ -41,7 +40,7 @@ script: - jdk_switcher use oraclejdk8 - grunt default --verbose && FULL_PACKAGE_VERSION=`node -e 'console.log(require("./bin/dist/tns-core-modules/package.json").version);'` && - (cd build/platform-declarations && grunt) && + (cd tns-platform-declarations && npm pack) && wget -O ./nativescript.tgz "https://s3.amazonaws.com/nativescript-ci/build_result/nativescript.tgz" && echo no | npm install -g nativescript.tgz --ignore-scripts > /dev/null && tns usage-reporting disable && tns error-reporting disable && grunt buildOnlyTestsApp --verbose --platform=Android --modulesPath=./bin/dist/$PACKAGE_NAME-$FULL_PACKAGE_VERSION.tgz --runtimeVersion=$RUNTIMEVERSION --emuPId=.*emulator.* --avd=$AVD_NAME --showEmu=false > /dev/null && diff --git a/DevelopmentWorkflow.md b/DevelopmentWorkflow.md index acf194c30..b316cd2eb 100644 --- a/DevelopmentWorkflow.md +++ b/DevelopmentWorkflow.md @@ -82,10 +82,10 @@ tns run android --path tests ``` ## Platform declarations -To update the platform declarations you can run: +To update the platform declarations (the ios.d.ts-es) you can run: ``` npm install npm run dev-declarations ``` This script will update the iOS declarations. Android tools are not integrated yet. -The declarations are generated from the test app and will include the native code from tns-core-modules-widgets. \ No newline at end of file +The declarations are generated from the test app and will include the native code from tns-core-modules-widgets. diff --git a/package.json b/package.json index 5a32dc1ef..dc7d7a116 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "test-android": "tns run android --path tests --justlaunch", "test-ios": "tns run ios --path tests --justlaunch", "test-watch-android": "npm run pretest && concurrently --kill-others \"npm run tsc-tiw\" \"tns livesync android --path tests --watch\"", - "test-watch-ios": "npm run pretest && concurrently --kill-others \"npm run tsc-tiw\" \"tns livesync ios --path tests --watch\"" + "test-watch-ios": "npm run pretest && concurrently --kill-others \"npm run tsc-tiw\" \"tns livesync ios --path tests --watch\"", + "prepublish": "echo \"If you are about to develop run:\nnpm run setup\nFor more information check DevelopmentWorkflow.md\"" } } diff --git a/tns-core-modules/tsconfig.json b/tns-core-modules/tsconfig.json index 47caa271f..eb14c97ed 100644 --- a/tns-core-modules/tsconfig.json +++ b/tns-core-modules/tsconfig.json @@ -8,6 +8,9 @@ "noImplicitAny": false, "noImplicitUseStrict": true, "experimentalDecorators": true, - "diagnostics": true + "diagnostics": true, + "lib": [ + "es2016" + ] } } diff --git a/tns-platform-declarations/package.json b/tns-platform-declarations/package.json index 1f4fa154a..6f90090fa 100644 --- a/tns-platform-declarations/package.json +++ b/tns-platform-declarations/package.json @@ -1,6 +1,6 @@ { "name": "tns-platform-declarations", - "version": "1.7.1", + "version": "2.4.0", "description": "Platform-specific TypeScript declarations for NativeScript for accessing native objects", "main": "", "scripts": { diff --git a/tns-platform-declarations/references.d.ts b/tns-platform-declarations/references.d.ts deleted file mode 100644 index fe301a512..000000000 --- a/tns-platform-declarations/references.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/tns-platform-declarations/tsconfig.json b/tns-platform-declarations/tsconfig.json index 1cb497bd3..f93073014 100644 --- a/tns-platform-declarations/tsconfig.json +++ b/tns-platform-declarations/tsconfig.json @@ -3,10 +3,13 @@ "module": "commonjs", "target": "es5", "experimentalDecorators": true, - "noLib": true + "lib": [ + "es2016" + ] }, "exclude": [ "ios/objc-x86_64", - "node_modules" + "node_modules", + "package" ] } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 40226494d..8a7dda42f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,22 +10,30 @@ "experimentalDecorators": true, "diagnostics": true, "sourceMap": true, - "noLib": true + "lib": [ + "es2016" + ] }, "exclude": [ - "node_modules", - "tns-platform-declarations/node_modules", - "tns-core-modules/node_modules", + "tns-platform-declarations/node_modules/", + "tns-platform-declarations/package/", + "tns-core-modules/node_modules/", + "tns-core-modules/package/", "tests/node_modules", + "tests/package/", "tests/platforms", "apps/node_modules", + "apps/package/", "apps/platforms", + "node_modules/", + "package/", "bin", "build", "Deploy", "out", "obj", - "**/references.d.ts", + "tns-platform-declarations/references.d.ts", + "tns-core-modules/references.d.ts", "tns-platform-declarations/ios/objc-x86_64/" ] }