Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Manuel Saelices
2020-03-09 01:08:34 +01:00
1921 changed files with 222001 additions and 17970 deletions

43
.gitignore vendored
View File

@ -1,18 +1,22 @@
# Folders
dist
hooks
ios-typings-prj
libs
node_modules
package
platforms
!tns-core-modules/platforms
!nativescript-core/platforms
reports
tags
temp
# Files
package-lock.json
.DS_Store
.nsbuildinfo
tsdoc-metadata.json
thumbs.db
# IDEs and editors
/.idea
@ -21,6 +25,8 @@ package-lock.json
.c9/
*.launch
.settings/
.atom
.ctags-exclude
# IDE - VSCode
.vscode/*
@ -30,8 +36,10 @@ package-lock.json
!.vscode/extensions.json
# Appium files
mochawesome-report
e2e/**/*.trace/
e2e/**/test-results.xml
e2e/**/e2e/resources/
# Webpack configuration files
webpack.config.js
@ -42,30 +50,25 @@ tsconfig.tns.json
*.map
*.tgz
.baseDir.ts
.sublime-grunt.cache
tscommand*.tmp.txt
.tscache
# Other
*.js
!tns-core-modules-package/**/*.js
# https://github.com/NativeScript/nativescript-dev-webpack/issues/932
!tns-core-modules/xml/xml.js
!nativescript-core/xml/xml.js
!tests/hooks/**/*.*
!gruntfile.js
!js-libs/**/*.*
!css/**/*.*
!css-value/**/*.*
!fetch/**/*.*
!apps/TelerikNEXT/lib/**/*.*
!build/**/*.*
!nativescript-core/js-libs/**/*.*
!nativescript-core/cli-hooks/**/*.*
!nativescript-core/css/**/*.*
nativescript-core/css/parser.js*
nativescript-core/css/system-classes.js*
!nativescript-core/css-value/**/*.*
!nativescript-core/fetch/**/*.*
!nativescript-core/build/**/*.*
#generated by api-extractor
nativescript-core/nativescript-core.d.ts
.vs/
.baseDir.ts
.ctags-exclude
TestRunResult.txt
.testsapprun
tns-core-modules.base.d.ts
tns-core-modules.d.ts
tns-core-modules.es6.d.ts

View File

@ -1,30 +1,17 @@
env:
global:
- DATE=$(date +%Y-%m-%d)
- PACKAGE_VERSION=$DATE-$TRAVIS_BUILD_NUMBER
language: objective-c
osx_image: xcode10.2
jdk:
- oraclejdk8
- openjdk8
language: node_js
node_js:
- "node"
script:
- export JAVA_HOME=$HOME/openjdk8
- $TRAVIS_BUILD_DIR/install-jdk.sh --install openjdk8 --target $JAVA_HOME
- # do stuff with open OpenJDK 11
- jdk_switcher use openjdk8
install:
# - brew update
# - brew cask install android-sdk
# Suppress output of sdkmanager to keep log under the 4MB limit of travis-ci
# - yes | sdkmanager "platforms;android-28" >/dev/null
# - yes | sdkmanager "build-tools;28.0.3" >/dev/null
# - yes | sdkmanager "extras;android;m2repository" >/dev/null
before_script:
# - export ANDROID_HOME=/usr/local/share/android-sdk
- npm install -g grunt-cli
- npm install
script:
# - npm run setup-widgets
- npm run setup
- npm run tsc
- npm install
- npm run tslint
- npm run setup
- npm run unit-test
# public API changes check
- npm run api-extractor-ci
# circular references check
- cd tests && npm i
- node_modules/.bin/webpack --env.android
- node_modules/.bin/webpack --env.ios

107
.vscode/launch.json vendored
View File

@ -7,7 +7,7 @@
{
"type": "node",
"request": "launch",
"name": "Unit Tests",
"name": "Launch mocha tests",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout",
@ -15,82 +15,67 @@
"--opts",
"unit-tests/mocha.opts"
],
"internalConsoleOptions": "openOnSessionStart",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"preLaunchTask": "tsc-unit-tests"
},
{
"name": "Launch on iOS",
"type": "nativescript",
"request": "launch",
"platform": "ios",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"watch": true
},
// {
// "name": "Test on iOS",
// "type": "nativescript",
// "request": "launch",
// "platform": "ios",
// "appRoot": "${workspaceRoot}",
// "sourceMaps": true,
// "watch": false,
// "stopOnEntry": true,
// "launchTests": true,
// "tnsArgs": [
// "--justlaunch"
// ]
// },
{
"name": "Attach on iOS",
"type": "nativescript",
"request": "attach",
"platform": "ios",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"watch": false
},
{
"name": "Launch on Android",
"type": "nativescript",
"request": "launch",
"platform": "android",
"appRoot": "${workspaceRoot}",
"sourceMaps": true,
"watch": true
},
{
"name": "Debug tests on Android",
"name": "Launch tests on Android",
"type": "nativescript",
"request": "launch",
"platform": "android",
"appRoot": "${workspaceRoot}/tests",
"sourceMaps": true,
"stopOnEntry": true,
"watch": true,
"watch": true
},
// {
// "name": "Test on Android",
// "type": "nativescript",
// "request": "launch",
// "platform": "android",
// "appRoot": "${workspaceRoot}",
// "sourceMaps": true,
// "watch": false,
// "stopOnEntry": true,
// "launchTests": true,
// "tnsArgs": [
// "--justlaunch"
// ]
// },
{
"name": "Attach on Android",
"name": "Launch tests on iOS",
"type": "nativescript",
"request": "launch",
"platform": "ios",
"appRoot": "${workspaceRoot}/tests",
"sourceMaps": true,
"stopOnEntry": true,
"watch": true
},
{
"name": "Attach ui tests on Android",
"type": "nativescript",
"request": "attach",
"platform": "android",
"appRoot": "${workspaceRoot}",
"appRoot": "${workspaceRoot}/e2e/ui-tests-app",
"sourceMaps": true,
"watch": false
},
{
"name": "Launch ui tests on Android",
"type": "nativescript",
"request": "launch",
"platform": "android",
"appRoot": "${workspaceRoot}/e2e/ui-tests-app",
"sourceMaps": true,
"stopOnEntry": true,
"watch": true
},
{
"name": "Attach ui tests on iOS",
"type": "nativescript",
"request": "attach",
"platform": "ios",
"appRoot": "${workspaceRoot}/e2e/ui-tests-app",
"sourceMaps": true,
"watch": false
},
{
"name": "Launch ui tests on iOS",
"type": "nativescript",
"request": "launch",
"platform": "ios",
"appRoot": "${workspaceRoot}/e2e/ui-tests-app",
"sourceMaps": true,
"stopOnEntry": true,
"watch": true
}
]
}

24
.vscode/tasks.json vendored
View File

@ -1,28 +1,14 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=733558
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "tsc",
"isShellCommand": true,
"args": ["-p", "."],
"showOutput": "always",
"problemMatcher": "$tsc",
"version": "2.0.0",
"tasks": [
{
"taskName": "tsc-unit-tests",
"label": "tsc-unit-tests",
"type": "shell",
"problemMatcher": "$tsc",
"command": "./node_modules/.bin/tsc",
"args": [ "-p", "tsconfig.unit-tests.json" ]
},
{
"taskName": "unit-tests",
"command": "npm",
"args": ["run", "unit-test"]
},
{
"taskName": "unit-tests-watch",
"command": "npm",
"args": ["run", "unit-test-watch"]
"args": [ "-p", "unit-tests/tsconfig.json" ],
}
]
}

View File

@ -1,3 +1,404 @@
## 6.4.1 (2020-02-17)
### Bug Fixes
* flipLeft and flipRight on Android ([#8307](https://github.com/NativeScript/NativeScript/issues/8307)) ([c13b104](https://github.com/NativeScript/NativeScript/commit/c13b104))
* **andoid:** crash when setting font on tab-item with no image ([2dd3bb2](https://github.com/NativeScript/NativeScript/commit/2dd3bb2))
* **android:** tap-trip-item title disappearing ([cb8cea8](https://github.com/NativeScript/NativeScript/commit/cb8cea8))
* **build:** Add platforms/android to NPM package ([#8312](https://github.com/NativeScript/NativeScript/issues/8312)) ([a644e40](https://github.com/NativeScript/NativeScript/commit/a644e40))
# 6.4.0 (2020-01-31)
### Bug Fixes
* button textAlignment on IOS (UIButton) ([#8181](https://github.com/NativeScript/NativeScript/issues/8181)) ([05ef9b0](https://github.com/NativeScript/NativeScript/commit/05ef9b0))
* **android:** crash on setting elevation on API21 ([#8269](https://github.com/NativeScript/NativeScript/issues/8269)) ([02763ec](https://github.com/NativeScript/NativeScript/commit/02763ec))
* **android:** Request Timeout [#6523](https://github.com/NativeScript/NativeScript/issues/6523) ([#8194](https://github.com/NativeScript/NativeScript/issues/8194)) ([d65a2db](https://github.com/NativeScript/NativeScript/commit/d65a2db))
* invoke done callback in image cache unit test for API Level < 20 ([#8267](https://github.com/NativeScript/NativeScript/issues/8267)) ([f293398](https://github.com/NativeScript/NativeScript/commit/f293398))
* make integer type visible ([ea8a436](https://github.com/NativeScript/NativeScript/commit/ea8a436))
* remove the password for TextField as well ([#8290](https://github.com/NativeScript/NativeScript/issues/8290)) ([0b50f3e](https://github.com/NativeScript/NativeScript/commit/0b50f3e))
* return default tab background color when the background color is not explicitely set through css ([#8240](https://github.com/NativeScript/NativeScript/issues/8240)) ([8569b51](https://github.com/NativeScript/NativeScript/commit/8569b51))
* **ios:** ActionBar style wrong after cancelled swipe back navigation ([#8252](https://github.com/NativeScript/NativeScript/issues/8252)) ([6133d6b](https://github.com/NativeScript/NativeScript/commit/6133d6b))
* **ios/bottom-navigation:** move TabStrip items event emitting to selectedIndex changed handler ([#8160](https://github.com/NativeScript/NativeScript/issues/8160)) ([8550c32](https://github.com/NativeScript/NativeScript/commit/8550c32))
### Features
* **html-view:** Additional properties for HtmlView component ([#8207](https://github.com/NativeScript/NativeScript/issues/8207)) ([9217094](https://github.com/NativeScript/NativeScript/commit/9217094))
* **http:** better binary support & XHR support ([#7707](https://github.com/NativeScript/NativeScript/issues/7707)) ([e293367](https://github.com/NativeScript/NativeScript/commit/e293367))
* **ios:** set preferredStatusBarStyle in Page VCs ([#8241](https://github.com/NativeScript/NativeScript/issues/8241)) ([4e48e68](https://github.com/NativeScript/NativeScript/commit/4e48e68))
* add longPress state with UIGestureRecognizer (iOS) ([416f1c8](https://github.com/NativeScript/NativeScript/commit/416f1c8))
* **textview:** added maxLines property ([#7943](https://github.com/NativeScript/NativeScript/issues/7943)) ([3c79ded](https://github.com/NativeScript/NativeScript/commit/3c79ded))
* Add 3D rotation to view - takeover of PR# 5950 ([#8136](https://github.com/NativeScript/NativeScript/issues/8136)) ([e8f5ac8](https://github.com/NativeScript/NativeScript/commit/e8f5ac8)), closes [#8076](https://github.com/NativeScript/NativeScript/issues/8076) [#8041](https://github.com/NativeScript/NativeScript/issues/8041)
* Add Android APIs usage list ([#8286](https://github.com/NativeScript/NativeScript/issues/8286)) ([f031f6f](https://github.com/NativeScript/NativeScript/commit/f031f6f))
* add integer only keyboard type for text-field and for all editable text components ([954e1c6](https://github.com/NativeScript/NativeScript/commit/954e1c6))
* Add iOS APIs usage list ([#8291](https://github.com/NativeScript/NativeScript/issues/8291)) ([3bb8a40](https://github.com/NativeScript/NativeScript/commit/3bb8a40))
* Make css-tree the default parser ([ab4c389](https://github.com/NativeScript/NativeScript/commit/ab4c389))
## [6.3.2](https://github.com/NativeScript/NativeScript/compare/6.3.1...6.3.2) (2019-12-20)
### Bug Fixes
* check is disposed fragment is in the FragmentManager ([#8201](https://github.com/NativeScript/NativeScript/issues/8201)) ([4b00376](https://github.com/NativeScript/NativeScript/commit/4b00376))
* handle fake attach after FragMgr is destroyed ([#8200](https://github.com/NativeScript/NativeScript/issues/8200)) ([d1858f8](https://github.com/NativeScript/NativeScript/commit/d1858f8))
## [6.3.1](https://github.com/NativeScript/NativeScript/compare/6.3.0...6.3.1) (2019-12-16)
### Bug Fixes
* null reference exception in view.android.onUnloaded ([#8153](https://github.com/NativeScript/NativeScript/issues/8153)) ([da639f2](https://github.com/NativeScript/NativeScript/commit/da639f2))
# [6.3.0](https://github.com/NativeScript/NativeScript/compare/6.2.2...6.3.0) (2019-12-06)
### Bug Fixes
* **android:** Fatal Exception: java.lang.OutOfMemoryError ([#8061](https://github.com/NativeScript/NativeScript/issues/8061)) ([8d382a6](https://github.com/NativeScript/NativeScript/commit/8d382a6b2e722e9298becdcfb3b43a41352a9136))
* **grid-layout:** value parser will now accept strings or numbers ([#8042](https://github.com/NativeScript/NativeScript/issues/8042)) ([3199a39](https://github.com/NativeScript/NativeScript/commit/3199a392b45635606e06119845099965246395c3))
* **iOS:** Opening alert/confirm on top most of modal dialogs ([#7982](https://github.com/NativeScript/NativeScript/issues/7982)) ([60ac4e7](https://github.com/NativeScript/NativeScript/commit/60ac4e7a05c9e627eb9fc7a1bdf004c7fca99817)), closes [#6939](https://github.com/NativeScript/NativeScript/issues/6939)
* nested css-calc and css-variables with fallback ([#7987](https://github.com/NativeScript/NativeScript/issues/7987)) ([fc2a233](https://github.com/NativeScript/NativeScript/commit/fc2a233e9598def50969247c1516c32260b7e283))
### Features
* **css:** Added optional css-tree parser ([#8076](https://github.com/NativeScript/NativeScript/issues/8076)) ([49a7607](https://github.com/NativeScript/NativeScript/commit/49a7607f4e0f3d359820b5ae731f806966de2921))
* **dialogs:** Setting the size of popup dialog thru dialog options ([#8041](https://github.com/NativeScript/NativeScript/issues/8041)) ([cd5703a](https://github.com/NativeScript/NativeScript/commit/cd5703a6b79598031ef334a9cf3132e688422aba))
* support requestAnimationFrame ([#8112](https://github.com/NativeScript/NativeScript/issues/8112)) ([2aa6e9b](https://github.com/NativeScript/NativeScript/commit/2aa6e9bf922286f9ffd747f901dbc922cd9446b9))
* System css classes for modals ([#8155](https://github.com/NativeScript/NativeScript/issues/8155)) ([7b78f3b](https://github.com/NativeScript/NativeScript/commit/7b78f3b0c640d9d43026744b919a03996191f788))
* **modal-view-ios:** handle iOS 13 dismiss modal gesture ([#8024](https://github.com/NativeScript/NativeScript/issues/8024)) ([c5df258](https://github.com/NativeScript/NativeScript/commit/c5df2580439c24c57fb364cba91050a00e391c35))
## [6.2.2](https://github.com/NativeScript/NativeScript/compare/6.2.1...6.2.2) (2019-11-25)
### Bug Fixes
* **android:** Fatal Exception: java.lang.OutOfMemoryError ([#8061](https://github.com/NativeScript/NativeScript/issues/8061)) ([#8098](https://github.com/NativeScript/NativeScript/issues/8098)) ([bca1271](https://github.com/NativeScript/NativeScript/commit/bca1271))
* **frame:** nested frame wrong background after parent navigation ([#8095](https://github.com/NativeScript/NativeScript/issues/8095)) ([d983f79](https://github.com/NativeScript/NativeScript/commit/d983f79))
* tab navigations don't work with lowercase xml ([#8016](https://github.com/NativeScript/NativeScript/issues/8016)) ([800f5bc](https://github.com/NativeScript/NativeScript/commit/800f5bc))
* **frame:** push recreated frame back in frameStack when Don't Keep Activities enabled ([#8096](https://github.com/NativeScript/NativeScript/issues/8096)) ([47f4c25](https://github.com/NativeScript/NativeScript/commit/47f4c25))
* **iOS:** check for iOS 13 APIs ([#8093](https://github.com/NativeScript/NativeScript/issues/8093)) ([b069ff3](https://github.com/NativeScript/NativeScript/commit/b069ff3))
<a name="6.2.1"></a>
## [6.2.1](https://github.com/NativeScript/NativeScript/compare/6.2.0...6.2.1) (2019-11-12)
### Bug Fixes
* **dark-mode:** formatted string and html view text color ([#8031](https://github.com/NativeScript/NativeScript/issues/8031)) ([0c7f838](https://github.com/NativeScript/NativeScript/commit/0c7f838))
* ensure @CallSuper native methods call superFunc ([#8025](https://github.com/NativeScript/NativeScript/issues/8025)) ([7fa9978](https://github.com/NativeScript/NativeScript/commit/7fa9978))
* **dev-tools:** use app root in getDocument() ([#8071](https://github.com/NativeScript/NativeScript/issues/8071)) ([f686472](https://github.com/NativeScript/NativeScript/commit/f686472))
* **gradient:** import LinearGradient with alias ([#8063](https://github.com/NativeScript/NativeScript/issues/8063)) ([eb33ede](https://github.com/NativeScript/NativeScript/commit/eb33ede))
### Features
* **application:** add system appearance changed event to typings ([#8034](https://github.com/NativeScript/NativeScript/issues/8034)) ([2a34368](https://github.com/NativeScript/NativeScript/commit/2a34368))
<a name="6.2.0"></a>
# [6.2.0](https://github.com/NativeScript/NativeScript/compare/6.1.2...6.2.0) (2019-10-24)
### Bug Fixes
* **action-bar:** font icon support to NavigationButton ([#7842](https://github.com/NativeScript/NativeScript/issues/7842)) ([4991e6d](https://github.com/NativeScript/NativeScript/commit/4991e6d)) ([#7918](https://github.com/NativeScript/NativeScript/issues/7918)) ([bdb411f](https://github.com/NativeScript/NativeScript/commit/bdb411f))
* **action-bar-ios13:** action bar items population ([#7965](https://github.com/NativeScript/NativeScript/issues/7965)) ([ce96dad](https://github.com/NativeScript/NativeScript/commit/ce96dad))
* **application-settings-android:** possible uninitialized sharedPreferences variable usage ([#7813](https://github.com/NativeScript/NativeScript/issues/7813)) ([4f421ff](https://github.com/NativeScript/NativeScript/commit/4f421ff))
* **css:** parse css selectors with escape sequences ([#7689](https://github.com/NativeScript/NativeScript/issues/7689)) ([5520213](https://github.com/NativeScript/NativeScript/commit/5520213))
* xml parsing when input value is reported as object instead of string ([#7916](https://github.com/NativeScript/NativeScript/issues/7916)) ([a06a5f9](https://github.com/NativeScript/NativeScript/commit/a06a5f9))
* **css-android:** restore elements' native features if offending css is removed while the app is running ([#7789](https://github.com/NativeScript/NativeScript/issues/7789)) ([2beae5b](https://github.com/NativeScript/NativeScript/commit/2beae5b))
* **css-calc:** reduce_css_calc_1.default is not a function ([#7787](https://github.com/NativeScript/NativeScript/issues/7787)) ([03d1ff0](https://github.com/NativeScript/NativeScript/commit/03d1ff0))
* **bottom-navigation-ios:** incorrect layout on orientation change ([#7927](https://github.com/NativeScript/NativeScript/issues/7927)) ([c9bfec1](https://github.com/NativeScript/NativeScript/commit/c9bfec1))
### Features
* **action-bar-android:** add properties to control the titleView content insets ([#7805](https://github.com/NativeScript/NativeScript/issues/7805)) ([57a8605](https://github.com/NativeScript/NativeScript/commit/57a8605))
* **css:** add attribute scoped css without global refresh ([#7907](https://github.com/NativeScript/NativeScript/issues/7907)) ([f791a40](https://github.com/NativeScript/NativeScript/commit/f791a40))
* **css:** Add HSL/HSLA support ([#7730](https://github.com/NativeScript/NativeScript/issues/7730)) ([3cabdde](https://github.com/NativeScript/NativeScript/commit/3cabdde))
* **dark-mode:** add system appearance property, event and CSS classes ([#7887](https://github.com/NativeScript/NativeScript/issues/7887)) ([5c9a217](https://github.com/NativeScript/NativeScript/commit/5c9a217))
* **file-system:** async read/write ([#7671](https://github.com/NativeScript/NativeScript/issues/7671)) ([2146ac9](https://github.com/NativeScript/NativeScript/commit/2146ac9))
* **dark-mode-ios:** adapt dynamic system colors ([#7826](https://github.com/NativeScript/NativeScript/issues/7826)) ([f82cf08](https://github.com/NativeScript/NativeScript/commit/f82cf08))
* **platform-declarations:** add android29 typings ([#7923](https://github.com/NativeScript/NativeScript/issues/7923)) ([dc65402](https://github.com/NativeScript/NativeScript/commit/dc65402))
* **platform-declarations:** generate typings from iOS 13.0 SDK ([#7817](https://github.com/NativeScript/NativeScript/issues/7817)) ([3e8d635](https://github.com/NativeScript/NativeScript/commit/3e8d635))
* **segmented-bar-ios:** add support for the new selectedSegmentTintColor property ([#7880](https://github.com/NativeScript/NativeScript/issues/7880)) ([ca7c46d](https://github.com/NativeScript/NativeScript/commit/ca7c46d))
* overhaul and streamline Android page navigation transitions ([#7925](https://github.com/NativeScript/NativeScript/issues/7925)) ([08e23bc](https://github.com/NativeScript/NativeScript/commit/08e23bc))
* Scoped Packages ([#7911](https://github.com/NativeScript/NativeScript/issues/7911)) ([cc97a16](https://github.com/NativeScript/NativeScript/commit/cc97a16))
* update material components dependency to 92.3 ([#7936](https://github.com/NativeScript/NativeScript/issues/7936)) ([866c2b0](https://github.com/NativeScript/NativeScript/commit/866c2b0))
<a name="6.1.2"></a>
## [6.1.2](https://github.com/NativeScript/NativeScript/compare/6.1.1...6.1.2) (2019-10-15)
### Bug Fixes
* expose orientation to application module ([#7832](https://github.com/NativeScript/NativeScript/issues/7832)) ([4166e2d](https://github.com/NativeScript/NativeScript/commit/4166e2d))
* **frame-android:** IllegalStateException: The specified child already has a parent ([#7948](https://github.com/NativeScript/NativeScript/issues/7948)) ([ff30c48](https://github.com/NativeScript/NativeScript/commit/ff30c48))
* **tabs-ios9:** no view controller managing visible view error ([#7837](https://github.com/NativeScript/NativeScript/issues/7837)) ([7fe8d1c](https://github.com/NativeScript/NativeScript/commit/7fe8d1c))
### Features
* **css:** add attribute scoped css without global refresh ([#7907](https://github.com/NativeScript/NativeScript/issues/7907)) ([#7947](https://github.com/NativeScript/NativeScript/issues/7947)) ([b377eb6](https://github.com/NativeScript/NativeScript/commit/b377eb6))
## [6.1.1](https://github.com/NativeScript/NativeScript/compare/6.1.0...6.1.1) (2019-09-11)
### Bug Fixes
* **android-list-picker:** NoSuchFieldException on api29 ([#7790](https://github.com/NativeScript/NativeScript/issues/7790)) ([997d6de](https://github.com/NativeScript/NativeScript/commit/997d6de))
* **css-calc:** reduce_css_calc_1.default is not a function ([#7787](https://github.com/NativeScript/NativeScript/issues/7787)) ([#7801](https://github.com/NativeScript/NativeScript/issues/7801)) ([20c0773](https://github.com/NativeScript/NativeScript/commit/20c0773))
<a name="6.1.0"></a>
# [6.1.0](https://github.com/NativeScript/NativeScript/compare/6.0.7...6.1.0) (2019-09-02)
### Bug Fixes
* dots can now be used in module names ([#7655](https://github.com/NativeScript/NativeScript/issues/7655)) ([b6ff4d3](https://github.com/NativeScript/NativeScript/commit/b6ff4d3))
* **css:** parse css selectors with escape sequences ([#7689](https://github.com/NativeScript/NativeScript/issues/7689)) ([#7732](https://github.com/NativeScript/NativeScript/issues/7732)) ([e3ed028](https://github.com/NativeScript/NativeScript/commit/e3ed028))
* **ios-tabs:** handle tabs extended layout for ios 10 ([f7f0612](https://github.com/NativeScript/NativeScript/commit/f7f0612))
* **ios-tabs:** crash when add tabstrip in loaded event ([#7743](https://github.com/NativeScript/NativeScript/issues/7743)) ([a66f2f2](https://github.com/NativeScript/NativeScript/commit/a66f2f2))
* **ios-tabs:** handle nesting proxy view container ([#7755](https://github.com/NativeScript/NativeScript/issues/7755)) ([92c3338](https://github.com/NativeScript/NativeScript/commit/92c3338))
* handle empty folders in non-bundle-compat ([#7649](https://github.com/NativeScript/NativeScript/issues/7649)) ([5fd7913](https://github.com/NativeScript/NativeScript/commit/5fd7913))
### Features
* implement css-variables and css-calc ([#7553](https://github.com/NativeScript/NativeScript/issues/7553)) ([673c808](https://github.com/NativeScript/NativeScript/commit/673c808))
* add CSS classes to app/modal root views to target platform/device/orientation/type ([#7606](https://github.com/NativeScript/NativeScript/issues/7606)) ([3adba68](https://github.com/NativeScript/NativeScript/commit/3adba68))
* **GridLayout:** Add synonym property column[Span] for col[Span] in GridLayout ([#7641](https://github.com/NativeScript/NativeScript/issues/7641)) ([d3c39c1](https://github.com/NativeScript/NativeScript/commit/d3c39c1))
* apply styles when adding them to the application scope ([#7652](https://github.com/NativeScript/NativeScript/issues/7652)) ([1d12136](https://github.com/NativeScript/NativeScript/commit/1d12136))
* expose application orientation ([#7602](https://github.com/NativeScript/NativeScript/issues/7602)) ([e2c3c8c](https://github.com/NativeScript/NativeScript/commit/e2c3c8c))
* **ios-bottom-navigation:** add icon rendering mode ([#7738](https://github.com/NativeScript/NativeScript/issues/7738)) ([ff6d89f](https://github.com/NativeScript/NativeScript/commit/ff6d89f))
* **android-tabs/bottom-navigation:** fix tab resource icon size based on specification ([#7737](https://github.com/NativeScript/NativeScript/issues/7737)) ([f436b6f](https://github.com/NativeScript/NativeScript/commit/f436b6f))
* **tabs/bottom-navigation:** introduce TabStrip.isIconSizeFixed property ([#7691](https://github.com/NativeScript/NativeScript/issues/7691)) ([8039c2c](https://github.com/NativeScript/NativeScript/commit/8039c2c))
* **tabs/bottom-navigation:** add support for custom tabstrip ([#7580](https://github.com/NativeScript/NativeScript/issues/7580)) ([acc3436](https://github.com/NativeScript/NativeScript/commit/acc3436))
* **tabs/bottom-navigation:** inherit TabContentItem from ContentView ([#7629](https://github.com/NativeScript/NativeScript/issues/7629)) ([72ca461](https://github.com/NativeScript/NativeScript/commit/72ca461))
* **tabs/bottom-navigation:** flexible font icon usage ([#7672](https://github.com/NativeScript/NativeScript/issues/7672)) ([c0b8db4](https://github.com/NativeScript/NativeScript/commit/c0b8db4))
* **tabs:** emit tabStripItem tap event ([#7693](https://github.com/NativeScript/NativeScript/issues/7693)) ([b0d1c91](https://github.com/NativeScript/NativeScript/commit/b0d1c91))
* **tabs/bottom-navigation:** add TabStrip.itemTap event ([#7711](https://github.com/NativeScript/NativeScript/issues/7711)) ([55c9cc9](https://github.com/NativeScript/NativeScript/commit/55c9cc9))
<a name="6.0.7"></a>
## [6.0.7](https://github.com/NativeScript/NativeScript/compare/6.0.4...6.0.7) (2019-08-22)
### Bug Fixes
* **bottom-navigation:** codebehind creation ([#7624](https://github.com/NativeScript/NativeScript/issues/7624)) ([056d0bf](https://github.com/NativeScript/NativeScript/commit/056d0bf))
* prevent plugin podfile platform version clash ([#7626](https://github.com/NativeScript/NativeScript/issues/7626)) ([49b3571](https://github.com/NativeScript/NativeScript/commit/49b3571))
* **hmr:** close modal views during livesync [#7668](https://github.com/NativeScript/NativeScript/issues/7668) ([#7679](https://github.com/NativeScript/NativeScript/issues/7679)) ([9877b20](https://github.com/NativeScript/NativeScript/commit/9877b20))
* **tabs-android:** tabStripItem color not applied ([#7617](https://github.com/NativeScript/NativeScript/issues/7617)) ([2518655](https://github.com/NativeScript/NativeScript/commit/2518655))
<a name="6.0.6"></a>
## [6.0.6](https://github.com/NativeScript/NativeScript/compare/6.0.5...6.0.6) (2019-08-08)
### Bug Fixes
* **tns-core-modules-widgets:** use correct version (6.0.6).
## [6.0.5](https://github.com/NativeScript/NativeScript/compare/6.0.4...6.0.5) (2019-08-02)
### Bug Fixes
* **bottom-navigation:** codebehind creation ([#7624](https://github.com/NativeScript/NativeScript/issues/7624)) ([056d0bf](https://github.com/NativeScript/NativeScript/commit/056d0bf))
* **tabs-android:** tabStripItem color not applied ([#7617](https://github.com/NativeScript/NativeScript/issues/7617)) ([2518655](https://github.com/NativeScript/NativeScript/commit/2518655))
* prevent plugin podfile platform version clash ([#7626](https://github.com/NativeScript/NativeScript/issues/7626)) ([49b3571](https://github.com/NativeScript/NativeScript/commit/49b3571))
<a name="6.0.5"></a>
## [6.0.5](https://github.com/NativeScript/NativeScript/compare/6.0.4...6.0.5) (2019-08-02)
### Bug Fixes
* **observable-array:** splice to notify correct amount of added items ([#7426](https://github.com/NativeScript/NativeScript/issues/7426)) ([5e14de6](https://github.com/NativeScript/NativeScript/commit/5e14de6))
* added missing openFile method in ios utils ([#7431](https://github.com/NativeScript/NativeScript/issues/7431)) ([cb58cab](https://github.com/NativeScript/NativeScript/commit/cb58cab))
* full Unicode support in xml ([#7428](https://github.com/NativeScript/NativeScript/issues/7428)) ([b8659e6](https://github.com/NativeScript/NativeScript/commit/b8659e6))
* **timer:** setTimeout/setInterval support for boolean period ([#7569](https://github.com/NativeScript/NativeScript/issues/7569)) ([a569bb2](https://github.com/NativeScript/NativeScript/commit/a569bb2))
### Features
* **bottom-navigation-ios:** limit to 5 items ([5815246](https://github.com/NativeScript/NativeScript/commit/5815246))
* split globals to support smaller worker chunks ([0ee0b67](https://github.com/NativeScript/NativeScript/commit/0ee0b67))
<a name="6.0.4"></a>
## [6.0.4](https://github.com/NativeScript/NativeScript/compare/6.0.3...6.0.4) (2019-07-30)
### Bug Fixes
* **ios:** 'ui/tabs' not found for element 'Tabs'
<a name="6.0.3"></a>
## [6.0.3](https://github.com/NativeScript/NativeScript/compare/6.0.2...6.0.3) (2019-07-29)
### Bug Fixes
* **ios:** move material design dependency to podfile ([#7592](https://github.com/NativeScript/NativeScript/issues/7592)) ([291e3b4](https://github.com/NativeScript/NativeScript/commit/291e3b4))
<a name="6.0.2"></a>
## [6.0.2](https://github.com/NativeScript/NativeScript/compare/6.0.0...6.0.2) (2019-07-26)
### Bug Fixes
* **android:** remove wait for doubletap if no gesture recognizer ([#7584](https://github.com/NativeScript/NativeScript/issues/7584)) ([9fd5ddc](https://github.com/NativeScript/NativeScript/commit/9fd5ddc))
* **bottom-navigation:** crash when tab selected with no item ([#7527](https://github.com/NativeScript/NativeScript/issues/7527)) ([46c17ca](https://github.com/NativeScript/NativeScript/commit/46c17ca))
* **tabs:** tab bar not visible when nested in layout ([#7544](https://github.com/NativeScript/NativeScript/issues/7544)) ([f00b370](https://github.com/NativeScript/NativeScript/commit/f00b370))
* **tabs-android:** wrong tabStripItem selected ([#7522](https://github.com/NativeScript/NativeScript/issues/7522)) ([ca22ba9](https://github.com/NativeScript/NativeScript/commit/ca22ba9))
* **tabs-ios:** crash when setting tabStripItems through items property ([#7548](https://github.com/NativeScript/NativeScript/issues/7548)) ([4511c76](https://github.com/NativeScript/NativeScript/commit/4511c76))
* **tabs-ios:** unable to return to tab after tab with nested frame visited ([#7574](https://github.com/NativeScript/NativeScript/issues/7574)) ([490cab0](https://github.com/NativeScript/NativeScript/commit/490cab0))
<a name="6.0.0"></a>
# [6.0.0](https://github.com/NativeScript/NativeScript/compare/5.4.2...6.0.0) (2019-06-28)
### Bug Fixes
* **bundle:** support for file qualifiers with webpack ([#7386](https://github.com/NativeScript/NativeScript/issues/7386)) ([9fcc1dd](https://github.com/NativeScript/NativeScript/commit/9fcc1dd))
* **bundle:** code-only typescript custom components with webpack ([#7321](https://github.com/NativeScript/NativeScript/issues/7321)) ([9fcc1dd](https://github.com/NativeScript/NativeScript/commit/9fcc1dd))
* **bundle:** component builder support for codeFile / cssFile / import with webpack ([#7324](https://github.com/NativeScript/NativeScript/issues/7324)) ([9fcc1dd](https://github.com/NativeScript/NativeScript/commit/9fcc1dd))
* **bundle:** different event order ([NativeScript/nativescript-cli#4633](https://github.com/NativeScript/nativescript-cli/issues/4633)) ([8851835](https://github.com/NativeScript/NativeScript/commit/8851835))
* restore TextField.textChange and Switch.checkedChange event syntax in xml ([#7403](https://github.com/NativeScript/NativeScript/issues/7403)) ([76b5089](https://github.com/NativeScript/NativeScript/commit/76b5089))
* **android:** ignore gzip content-encoding for status code 204 ([#7417](https://github.com/NativeScript/NativeScript/issues/7417)) ([4437cd6](https://github.com/NativeScript/NativeScript/commit/4437cd6))
* **android-transition:** exit transition not executed after app suspend resume ([#7402](https://github.com/NativeScript/NativeScript/issues/7402)) ([f08b491](https://github.com/NativeScript/NativeScript/commit/f08b491))
* **css-state:** _appliedSelectorsVersion assignment ([#7405](https://github.com/NativeScript/NativeScript/issues/7405)) ([9ecf07f](https://github.com/NativeScript/NativeScript/commit/9ecf07f))
* **observable-array**: splice to notify correct amount of added items ([#7426](https://github.com/NativeScript/NativeScript/pull/7426)) ([5e14de6](https://github.com/NativeScript/NativeScript/commit/5e14de6))
* cancel contradictory gesture events ([#7296](https://github.com/NativeScript/NativeScript/issues/7296)) ([b8a82f2](https://github.com/NativeScript/NativeScript/commit/b8a82f2))
* allow span descendants in FormattedString ([#7369](https://github.com/NativeScript/NativeScript/issues/7369)) ([01c4b8c](https://github.com/NativeScript/NativeScript/commit/01c4b8c))
### Features
* **bundle:** bundle workflow support ([#7320](https://github.com/NativeScript/NativeScript/issues/7320)) ([ecd9fc3](https://github.com/NativeScript/NativeScript/commit/ecd9fc3))
* **android:** androidX support ([#7039](https://github.com/NativeScript/NativeScript/issues/7039)) ([c5db112](https://github.com/NativeScript/NativeScript/commit/c5db112))
* **BETA/EXPERIMENTAL:** bottom navigation and tabs components ([#6967](https://github.com/NativeScript/NativeScript/issues/6967)) ([0c2c1cc](https://github.com/NativeScript/NativeScript/commit/0c2c1cc))
* add support for :focus pseudo class in TextField / TextView ([#7396](https://github.com/NativeScript/NativeScript/pull/7396)) ([0bfddab](https://github.com/NativeScript/NativeScript/commit/0bfddab))
* **animation:** support animating width/height properties ([#5147](https://github.com/NativeScript/NativeScript/pull/5147)) ([e7c575](https://github.com/NativeScript/NativeScript/commit/e7c575))
### BREAKING CHANGES
* `AndroidApplication.currentContext` in `tns-core-modules/application` module is now removed.
Use `AndroidApplication.startActivity`, `AndroidApplication.foregroundActivity`, or `AndroidApplication.context` properties instead.
* `start(...)` method in `tns-core-modules/application` module is now removed.
Use `application.run(...)` method instead. Check the "Flexible Frame Composition" section in [this document](https://docs.google.com/document/d/1Iia0yEr5seq4H9qk4oMuJs4-M8dgmne98fymCO5IczA/edit) that explains the full migration path from `application.start(...)` to `application.run(...)` and the implications from this change
* `loadPage(...)` method in `tns-core-modules/ui/builder` module is now removed.
Use `createViewFromEntry(entry: NavigationEntry)` method in `tns-core-modules/ui/builder` module instead.
* `tns-core-modules/ui/core/dependency-observable` module is now removed.
Use `tns-core-modules/ui/core/properties` module instead.
* `ViewBase.showModal()`, `ViewBase.showModal(moduleName: string, context: any, closeCallback: Function, fullscreen?: boolean, animated?: boolean, stretched?: boolean): ViewBase`, and `ViewBase.showModal(view: ViewBase, context: any, closeCallback: Function, fullscreen?: boolean, animated?: boolean, stretched?: boolean): ViewBase` method overloads are now removed.
Use `ViewBase.showModal(moduleName: string, modalOptions: ShowModalOptions): ViewBase` or `ViewBase.showModal(view: ViewBase, modalOptions: ShowModalOptions): ViewBase` instead.
* `Frame.androidOptionSelectedEvent` and `AndroidOptionEventData` interfrace in `tns-core-modules/ui/frame` module are now removed.
Event not raised by NativeScript core framework anymore.
* `AndroidFrame.cachePagesOnNavigate` in `tns-core-modules/ui/frame` module is now removed.
Not used internally in NativeScript core framework anymore.
* `stack()` method in `tns-core-modules/ui/frame` module is now removed.
Use `getFrameById(...)` method if you want to retrieve a frame different than the topmost one instead.
* `AndroidActivityCallbacks.onCreate(activity: any, savedInstanceState: any, superFunc: Function)` method overload in `tns-core-modules/ui/frame` module is now removed.
Use `AndroidActivityCallbacks.onCreate(activity: any, savedInstanceState: any, intent: any, superFunc: Function)` instead.
* `WebView.url` property in `tns-core-modules/ui/web-view` module is now removed.
Use `WebView.src` property instead.
* `ios.getter(...)` function in `tns-core-modules/utils` module is now removed.
Use the respective native property directly instead.
* `View.observe(...)` method in `tns-core-modules/ui/core/view` module is now removed.
Use `View.on(...)` method instead.
* The addedCount variable from ObservableArray.splice(...) change event is always the amount of added items.
Migration steps:
The old addedCount can be obtained by `const addedCount = event.addedCount - event.removed.length`
* Fix to cancel contradictory gesture events (e.g. tap and double tap) introduces the following behavior breaking change
Before:
* **iOS / Android**:
* double tap: child tap -> parent tap -> child double tap -> parent double tap
* tap: child tap -> parent tap
After:
* **iOS**:
* double tap: child double tap
* tap: child tap
* **Android**:
* double tap: child double tap -> parent double tap
* tap: child tap -> parent tap
Migration steps:
Move event handlers accordingly.
## [5.4.3](https://github.com/NativeScript/NativeScript/compare/5.4.2...5.4.3) (2019-06-21)
@ -850,7 +1251,7 @@ A full list of breaking changes could be found [here](https://github.com/NativeS
- [(#2834)](https://github.com/NativeScript/NativeScript/issues/2834) Animations: scale() syntax does not support only one argument
- [(#2813)](https://github.com/NativeScript/NativeScript/issues/2813) The Camera module in Android doesn't handle pemissions for you
- [(#2813)](https://github.com/NativeScript/NativeScript/issues/2813) The Camera module in Android doesn't handle permissions for you
- [(#2789)](https://github.com/NativeScript/NativeScript/issues/2789) CSS border-width causes text to overflow TextView

View File

@ -7,6 +7,7 @@ Here are some guides on how to do that:
- [Reporting Bugs](#bugs)
- [Requesting New Features](#features)
- [Submitting a PR](#pr)
- [Check test report](#test-report)
- [Commit Message Guidelines](#commit-messages)
- [Releasing new versions](#release)
@ -69,6 +70,7 @@ git checkout -b <my-fix-branch> master
- Rebase your changes to the latest master: `git pull --rebase upstream master`.
- Ensure all unit test are green for Android and iOS. Check [running unit tests](DevelopmentWorkflow.md#running-unit-tests).
- Ensure your changes pass tslint validation. (run `npm run tslint` in the root of the repo).
- If you've made changes to a public API, make sure you update and add the `api-reports/NativeScript.api.md` file to the PR. (run `npm run api-extractor` to update the api-report and definitions).
6. Push your fork. If you have rebased you might have to use force-push your branch:
```
@ -81,6 +83,23 @@ It's our turn from there on! We will review the PR and discuss changes you might
>Note: Sometimes you will see someone from the contributors team writing strange comments like: `test` or `test branch_functional_tests#css-gradients-tests branch_widgets#vultix/css-gradients` - don't worry about it, these are just phrases that trigger the internal CI builds.
## <a name="test-report"></a> Check test report
The purpose of the test report view is to show the tests' results for the PRs for the external contributors. When a NativeScript team member triggers the tests, you can review the result by selecting the `Details` button next to the `ci/jenkins/core-modules-tests` task.
> Note: the `Details` button will be available when the execution of the test completes and there is at least one failing test.
When you click on the button, you will be redirected to the report page. On the left pane you can find a list of all failed jobs.
> Note: Each item name consists of the application name, type of device and platform version: `pr-e2e-tests-[application-name]-[device-type]-[platform-version]`. Usually, the test applications, that are executed for PRs are part of NativeScript repository.
Based on the executed suite, one of the following or all of the following files will be generated: `mochawesome.html` | `index.html` | `unit-tests.log`. Some of the reports also might include `*.png`, `*.logs` or `[page source].xml` files that can help in understanding where is the problem.
For example:
1. When you select the `index.html` page, an additional `TestNG Results` sidebar will be displayed. There you can find a list of all failures.
2. When you select one of them, you will see on the right side all tests, that have been executed. The problematic ones will be coloured in red.
3. If you click on one of them, detailed info or error log will be displayed. As we've mentioned above in some of the test reports, you will also find screenshots, that demonstrates the problem visually. Those images can be found below the info/ error log.
## <a name="commit-messages"></a> Commit Message Guidelines
Please follow the git commit message format described below when committing your changes or submitting a PR. That allows us to use the commit messages to generate a change log for every new release.
@ -124,7 +143,7 @@ If the commit reverts a previous commit, it should begin with `revert: `, follow
### Type
Must be one of the following:
* **build**: Changes that affect the build system or external dependencies (example scopes: npm, grunt)
* **build**: Changes that affect the build system or external dependencies (example scopes: npm)
* **ci**: Changes to our CI configuration files and scripts (example scopes: Travis, Jenkins)
* **docs**: Documentation only changes
* **feat**: A new feature
@ -244,7 +263,15 @@ cd ..
4. Execute [`npm version`](https://docs.npmjs.com/cli/version) to bump the version of `tns-core-modules`,
tag the release and update the CHANGELOG.md. Don't forget to check the auto-generated CHANGELOG.md
```
cd tns-core-modules
cd nativescript-core
npm --no-git-tag-version version [major|minor|patch] -m "release: cut the %s release"
cd ..
```
5. Execute [`npm version`](https://docs.npmjs.com/cli/version) to bump the version of `tns-core-modules`,
tag the release and update the CHANGELOG.md. Don't forget to check the auto-generated CHANGELOG.md
```
cd tns-core-modules-package
npm --no-git-tag-version version [major|minor|patch] -m "release: cut the %s release"
cd ..
```
@ -253,7 +280,7 @@ Usually tns-core-modules-widgets should already have been released and we need t
7. Create release-branch with change log
```
git checkout -b release-[release-version]
git checkout -b release-[version]
```
7. Add changes
@ -262,9 +289,9 @@ git add changed-files
git commit -m "release: cut the %s release"
git push
```
8. Create git tag
8. Create git tag as git tag 6.3.0 or use git UI
```
git tag release-version
git tag [release-version]
git push --tags
```
9. Create a pull request. Be careful to base your branch on the correct branch

View File

@ -4,110 +4,115 @@ Development Workflow
## Project Structure
The repository contains several packages and apps:
- `tns-core-modules` - The core NativeScript TypeScript modules used to develop NativeScript apps.
- `apps` - UI app used for manual testing and automation.
- `e2e` - applications and *e2e* tests.
- `tests` - Unit tests app for the `tns-core-modules`.
- `tns-platform-declarations` - TypeScript definitions for Android and iOS native APIs.
- `nativescript-core` - The core NativeScript TypeScript modules used to develop NativeScript apps. Produces `@nativescript/core` npm package
- `tns-core-modules-package` - Base for generating the `tns-core-modules` package (compatibility package for projects that still import code from `tns-core-modules`).
- `tns-core-modules-widgets` - The native widgets (Java and Objective-C) used by the core NativeScript modules. Produces `tns-core-modules-widgets` npm package
- `tns-platform-declarations` - TypeScript definitions for Android and iOS native APIs. Produces `tns-platform-declarations` npm package
- `tests` - Unit tests app for the `@nativescript/core` package. These test are executed as nativescript application on mobile device or emulator.
- `unit-test` - Node unit tests. These test validate parts of the framework that do not require the nativescript runtime and so can be executed in node environment
- `e2e` - applications and *e2e* tests
- `e2e/ui-tests-app` - UI app used for manual testing and automation
- `apps` - legacy apps for testing
- `build` - scripts used for building and infrastructure
- `dist` - construction site for packing npm modules
Working with the repo is organized with npm scripts,
go and read through the `scripts` section in the [package.json](./package.json).
Managing dependencies:
- `tns-core-modules-widgets` depends on:
- no deps
- `@nativescript/core` depends on:
- `tns-core-modules-widgets`
- (devDep)`tns-platform-declarations`
- `tns-core-modules` depends on:
- `tns-platform-declarations`
- `apps` depends on:
- `tns-platform-declarations`
- `tns-core-modules`
- `e2e` depends on:
- `tns-core-modules`
- `tests` depends on:
- `tns-platform-declarations`
- `tns-core-modules`
> NOTE: `tns-core-modules` depends on `tns-core-modules-widgets`,
this dependency contains native code and is rarely modified so for now it remains outside this repo.
- `@nativescript/core`
- (devDep)`tns-platform-declarations`
## Initial Setup
Clone (or fork/clone) the repo:
Clone (or fork/clone) the repo and run setup script:
```bash
``` bash
git clone https://github.com/NativeScript/NativeScript.git
cd NativeScript
npm run setup
```
Install devDependencies:
```bash
npm install
```
<!---
## TypeScript
The following commands are commonly used to compile the `tns-core-modules`:
```bash
# Full tsc with type checking ~22.2s.
tsc
# Fast tsc ~11.2s.
tsc --skipLibCheck
# Fast watcher, ~4s. on save
tsc --skipLibCheck -w
```
NOTE: transpile `tns-core-modules` only.
The modules have `typescript` as a devDependency so you should also be able to use the locally installed TypeScript compiler from node_modules:
```bash
./node_modules/.bin/tsc
```
You can compile the TypeScript files in the `tns-core-modules` and `tns-platform-declarations` at once at the root of the repo:
```bash
npm run tsc
```
--->
## Running Unit Tests
```
cd ./tests
tns run android| ios
```
## Running the Test App
The test app is an ordinary NativeScript app that logs the test results as it go.
## Running Unit Tests Application
After the [initial setup](#initial-setup) you can run the tests with:
``` bash
cd tests
tns run android | ios
```
# Make sure TypeScript is transpiled
tsc
You can do changes in the test app and `nativescript-core` and rely on HMR to re-run tests.
# Run the app
tns run ios --path apps
tns run android --path apps
## Running the `e2e` Test Apps
There are couple of application used for development and testing.
The `ui-test-app` is the more frequently used for development and validation. It is an ordinary NativeScript app that logs the test results on the go.
After the [initial setup](#initial-setup) run the e2e apps with:
``` bash
cd e2e/<app-name>
# Run the Android app
tns platform add android@next
tns run android
# Run the iOS app
tns platform add ios@next
tns run ios
```
>Note: NOTE: do not commit changes in the runtime versions to `e2e/<app-name>/package.json`
---
## Running Another App
The [initial setup](#initial-setup) will `npm-link` the `tns-core-modules` globally. You can use it in any local project:
```bash
# Run once: Link tns-core-modules in your project
npm link tns-core-modules
# Run the app
tns run ios
tns run android
### TypeScript Applications
Link both the `nativescript-core` folders and the generated compatibility package (`dist\tns-core-modules`):
``` bash
npm i <path-to-nativescript-repo>/nativescript-core --save
npm i <path-to-nativescript-repo>/dist/tns-core-modules --save
```
> Note: You still have to rebuild the TypeScript if you have made changes in the code of the core-modules.
You can do changes in the app code and `nativescript-core` and rely on HMR to refresh the app.
### JavaScript Applications
Use the same steps as with TS application. However, the configuration of JS application does not include loading and transpiling TS code. You need to transpile the TS code in `nativescript-core` yourself. The following npm script will run tsc in watch mode in `nativescript-core` (run it in a separate terminal so that you can do `tns run` in parallel):
``` bash
npm run tsc-core-watch
```
### Angular Applications
Linking `tns-core-modules` and `@nativescript/core` in **Angular applications** does not work at the moment. Check [#7905](https://github.com/NativeScript/NativeScript/issues/7905) for more details on the issue.
## Building `tns-core-modules-widgets`
You can the following npm script to build and link the `tns-core-modules-widgets` package.
``` bash
npm run setup-widgets
```
This script will build the `tns-core-modules-widgets` package and link it inside the `nativescript-core` so it will be used for running the tests and e2e apps.
>Note: NOTE: do not commit changes in the `tns-core-modules-widgets` dependency in the `nativescript-core/package.json`
## Running Node Unit Tests
Run node unit tests with:
```
npm run unit-test
```
or run tests in watch mode:
```
npm run unit-test-watch
```
## Platform declarations
To update the platform declarations (the ios.d.ts-es) you can run:

View File

@ -153,7 +153,7 @@ There are several type of Properties in modules 3.0:
### Events raised when property value change
One significant change is that properties before 3.0 were raising two events when a value is changed - `propertyChange` and propertyName + `Change` (like `textChange`). The second event was added at some point to make module compatible with Angular.
With 3.0 we removed `propertyChange` event and left only the second event. This was done in order to improve performance of our property system. This also leads to cleaner code (no need to listen for every `propertyChange` and then check the name of the poperty that raised the event).
With 3.0 we removed `propertyChange` event and left only the second event. This was done in order to improve performance of our property system. This also leads to cleaner code (no need to listen for every `propertyChange` and then check the name of the property that raised the event).
With 3.0 if you want to get notification when some property value change you have to specify the *`propertyName`Change* as eventName to `addEventListener` method (like `textField.addEventListener('textChange'`, handler...)).
@ -311,7 +311,7 @@ image.width = { value: 100, unit: "px" };
You have to be careful when getting the value - you might get a complex object instead of `number`.
### Enumerations
Enumeration from `ui/enums` modules are not used anymore. Most ot the properties that accepts specific strings are defined directly with the allowed values:
Enumeration from `ui/enums` modules are not used anymore. Most of the properties that accepts specific strings are defined directly with the allowed values:
`export type TextAlignment = "initial" | "left" | "center" | "right";`
TypeScript will warn in case you set invalid value.

View File

@ -4,7 +4,7 @@
[NativeScript](http://www.nativescript.org) is a framework for building native iOS and Android apps using JavaScript and CSS. NativeScript renders UIs with the native platforms rendering engine, no [WebViews](http://developer.telerik.com/featured/what-is-a-webview/), resulting in native-like performance and UX.
NativeScript provides a best-of-both-worlds development experience. Our cross-platform JavaScript modules give you the convenience of writing iOS and Android apps from a single JavaScript codebase, while our runtimes give you the power of accessing native APIs, SDKs, and frameworks when you need them—all without needing to open Xcode or Android Studio. NativeScript was created and is supported by [Telerik](http://www.telerik.com/).
NativeScript provides a best-of-both-worlds development experience. Our cross-platform JavaScript modules give you the convenience of writing iOS and Android apps from a single JavaScript codebase, while our runtimes give you the power of accessing native APIs, SDKs, and frameworks when you need all of them without having to open Xcode or Android Studio. NativeScript was created and is supported by [Telerik](http://www.telerik.com/).
Check out the links below to get started:
@ -19,7 +19,7 @@ Check out the links below to get started:
## For CTOs
Making the right technology choices is key to success. Our [CTOs guide to NativeScript](https://www.nativescript.org/ctos-guide) helps you understand why NativeScript is the right choice for your next mobile project.
Making the right technology choices is the key to success. Our [CTOs guide to NativeScript](https://www.nativescript.org/ctos-guide) helps you understand why NativeScript is the right choice for your next mobile project.
## Getting Started and Installation
@ -54,16 +54,16 @@ Below is a common NativeScript architecture diagram. In more detail, read the [H
The NativeScript framework consists of a number of components, all of which are open source and on GitHub. Here are the major ones:
- **[Cross-platform modules](//github.com/NativeScript/NativeScript/)**
[![npm](https://img.shields.io/npm/dm/tns-core-modules.svg)](https://www.npmjs.com/package/tns-core-modules) [![Waffle.io - NativeScript Modules and Angular](https://badge.waffle.io/NativeScript/NativeScript.svg?columns=In%20Progress)](https://waffle.io/NativeScript/NativeScript)
[![npm](https://img.shields.io/npm/dm/tns-core-modules.svg)](https://www.npmjs.com/package/tns-core-modules)
- This repo contains the [NativeScript cross-platform modules](http://docs.nativescript.org/core-concepts/modules), which abstract iOS and Android APIs into JavaScript APIs—e.g. `camera.takePicture()`. The modules are written in TypeScript.
- **[iOS runtime](//github.com/NativeScript/ios-runtime/)**
[![npm](https://img.shields.io/npm/dm/tns-ios.svg)](https://www.npmjs.com/package/tns-ios) [![Waffle.io - NativeScript iOS Runtime](https://badge.waffle.io/NativeScript/ios-runtime.svg?columns=In%20Progress)](https://waffle.io/NativeScript/ios-runtime)
[![npm](https://img.shields.io/npm/dm/tns-ios.svg)](https://www.npmjs.com/package/tns-ios)
- This repo contains the NativeScript iOS runtime—the code that hosts NativeScript iOS apps, and allows JavaScript code to be executed on iOS devices. The iOS runtime is written in a fun mix of C++, Objective-C, and more.
- **[Android runtime](//github.com/NativeScript/android-runtime)**
[![npm](https://img.shields.io/npm/dm/tns-android.svg)](https://www.npmjs.com/package/tns-android) [![Waffle.io - NativeScript Runtimes and CLI](https://badge.waffle.io/NativeScript/android-runtime.svg?columns=In%20Progress)](https://waffle.io/NativeScript/android-runtime)
[![npm](https://img.shields.io/npm/dm/tns-android.svg)](https://www.npmjs.com/package/tns-android)
- This repo contains the NativeScript Android—the code that hosts NativeScript Android apps, and allows JavaScript code to be executed on Android devices. The Android runtime is written in a fun mix of C++ and Java.
- **[CLI](//github.com/NativeScript/nativescript-cli)**
[![npm](https://img.shields.io/npm/dm/nativescript.svg)](https://www.npmjs.com/package/nativescript) [![Waffle.io - NativeScript CLI](https://badge.waffle.io/NativeScript/nativescript-cli.svg?columns=In%20Progress)](https://waffle.io/NativeScript/nativescript-cli)
[![npm](https://img.shields.io/npm/dm/nativescript.svg)](https://www.npmjs.com/package/nativescript)
- This repo contains the NativeScript command-line interface, which lets you create, build, and run apps using the NativeScript framework. The CLI is written in TypeScript.
- **[Docs](//github.com/NativeScript/docs)**
- This repo contains the NativeScript framework documentation, which is available at <http://docs.nativescript.org/>. The docs are written in Markdown.
@ -72,14 +72,14 @@ In addition to the code that makes up the NativeScript framework itself, we also
## Contributing
We love PRs, and accept them for all of our repositorieseven docs! Please follow our [contribution guide](https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md) if you want to become part of the project.
We love PRs, and accept them for all of our repositorieseven docs! Please follow our [contribution guide](https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md) if you want to become part of the project.
## Angular
We [worked together with the Google Angular team](http://angularjs.blogspot.com/2015/12/building-mobile-apps-with-angular-2-and.html) to make Angular 2+ work on top of NativeScript. To use Angular with NativeScript please follow the [getting started](http://docs.nativescript.org/angular/tutorial/ng-chapter-0) article.
We [worked together with the Google Angular team](https://angularjs.blogspot.com/2015/12/building-mobile-apps-with-angular-2-and.html) to make Angular 2+ work on top of NativeScript. To use Angular with NativeScript please follow the [getting started](http://docs.nativescript.org/angular/tutorial/ng-chapter-0) article.
## Get Help
Please, use [github issues](https://github.com/NativeScript/NativeScript/issues) strictly for [reporting a bugs](https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md#bugs) or [requesting features](https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md#features). For general NativeScript questions and support, check out [Stack Overflow](https://stackoverflow.com/questions/tagged/nativescript) or ask our experts in [NativeScript community Slack channel](http://developer.telerik.com/wp-login.php?action=slack-invitation).
Please, use [github issues](https://github.com/NativeScript/NativeScript/issues) strictly for [reporting a bugs](https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md#bugs) or [requesting features](https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md#features). For general NativeScript questions and support, check out [Stack Overflow](https://stackoverflow.com/questions/tagged/nativescript) or ask our experts in [NativeScript community Slack channel](https://www.nativescript.org/slack-invitation-form).
![](https://ga-beacon.appspot.com/UA-111455-24/nativescript/nativescript?pixel)

368
api-extractor.json Normal file
View File

@ -0,0 +1,368 @@
/**
* Config file for API Extractor. For more info, please visit: https://api-extractor.com
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
/**
* Optionally specifies another JSON config file that this file extends from. This provides a way for
* standard settings to be shared across multiple projects.
*
* If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains
* the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be
* resolved using NodeJS require().
*
* SUPPORTED TOKENS: none
* DEFAULT VALUE: ""
*/
// "extends": "./shared/api-extractor-base.json"
// "extends": "my-package/include/api-extractor-base.json"
/**
* Determines the "<projectFolder>" token that can be used with other config file settings. The project folder
* typically contains the tsconfig.json and package.json config files, but the path is user-defined.
*
* The path is resolved relative to the folder of the config file that contains the setting.
*
* The default value for "projectFolder" is the token "<lookup>", which means the folder is determined by traversing
* parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder
* that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error
* will be reported.
*
* SUPPORTED TOKENS: <lookup>
* DEFAULT VALUE: "<lookup>"
*/
"projectFolder": "nativescript-core",
/**
* (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor
* analyzes the symbols exported by this module.
*
* The file extension must be ".d.ts" and not ".ts".
*
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>".
*
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
*/
"mainEntryPointFilePath": "<projectFolder>/index.d.ts",
/**
* Determines how the TypeScript compiler engine will be invoked by API Extractor.
*/
"compiler": {
/**
* Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project.
*
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>".
*
* Note: This setting will be ignored if "overrideTsconfig" is used.
*
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "<projectFolder>/tsconfig.json"
*/
"tsconfigFilePath": "<projectFolder>/tsconfig.json",
/**
* Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk.
* The object must conform to the TypeScript tsconfig schema:
*
* http://json.schemastore.org/tsconfig
*
* If omitted, then the tsconfig.json file will be read from the "projectFolder".
*
* DEFAULT VALUE: no overrideTsconfig section
*/
// "overrideTsconfig": {
// . . .
// }
/**
* This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended
* and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when
* dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses
* for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck.
*
* DEFAULT VALUE: false
*/
// "skipLibCheck": true,
},
/**
* Configures how the API report file (*.api.md) will be generated.
*/
"apiReport": {
/**
* (REQUIRED) Whether to generate an API report.
*/
"enabled": true,
/**
* The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce
* a full file path.
*
* The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/".
*
* SUPPORTED TOKENS: <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "<unscopedPackageName>.api.md"
*/
"reportFileName": "<unscopedPackageName>.api.md",
/**
* Specifies the folder where the API report file is written. The file name portion is determined by
* the "reportFileName" setting.
*
* The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy,
* e.g. for an API review.
*
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>".
*
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "<projectFolder>/etc/"
*/
"reportFolder": "api-reports/",
/**
* Specifies the folder where the temporary report file is written. The file name portion is determined by
* the "reportFileName" setting.
*
* After the temporary file is written to disk, it is compared with the file in the "reportFolder".
* If they are different, a production build will fail.
*
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>".
*
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "<projectFolder>/temp/"
*/
// "reportTempFolder": "<projectFolder>/temp/"
},
/**
* Configures how the doc model file (*.api.json) will be generated.
*/
"docModel": {
/**
* (REQUIRED) Whether to generate a doc model file.
*/
"enabled": true,
/**
* The output path for the doc model file. The file extension should be ".api.json".
*
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>".
*
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "<projectFolder>/temp/<unscopedPackageName>.api.json"
*/
// "apiJsonFilePath": "<projectFolder>/temp/<unscopedPackageName>.api.json"
},
/**
* Configures how the .d.ts rollup file will be generated.
*/
"dtsRollup": {
/**
* (REQUIRED) Whether to generate the .d.ts rollup file.
*/
"enabled": true,
/**
* Specifies the output path for a .d.ts rollup file to be generated without any trimming.
* This file will include all declarations that are exported by the main entry point.
*
* If the path is an empty string, then this file will not be written.
*
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>".
*
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "<projectFolder>/dist/<unscopedPackageName>.d.ts"
*/
"untrimmedFilePath": "<projectFolder>/nativescript-core.d.ts",
/**
* Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release.
* This file will include only declarations that are marked as "@public" or "@beta".
*
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>".
*
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: ""
*/
// "betaTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-beta.d.ts",
/**
* Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release.
* This file will include only declarations that are marked as "@public".
*
* If the path is an empty string, then this file will not be written.
*
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>".
*
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: ""
*/
// "publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-public.d.ts",
/**
* When a declaration is trimmed, by default it will be replaced by a code comment such as
* "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the
* declaration completely.
*
* DEFAULT VALUE: false
*/
// "omitTrimmingComments": true
},
/**
* Configures how the tsdoc-metadata.json file will be generated.
*/
"tsdocMetadata": {
/**
* Whether to generate the tsdoc-metadata.json file.
*
* DEFAULT VALUE: true
*/
// "enabled": true,
/**
* Specifies where the TSDoc metadata file should be written.
*
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
* prepend a folder token such as "<projectFolder>".
*
* The default value is "<lookup>", which causes the path to be automatically inferred from the "tsdocMetadata",
* "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup
* falls back to "tsdoc-metadata.json" in the package folder.
*
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
* DEFAULT VALUE: "<lookup>"
*/
// "tsdocMetadataFilePath": "<projectFolder>/dist/tsdoc-metadata.json"
},
/**
* Configures how API Extractor reports error and warning messages produced during analysis.
*
* There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages.
*/
"messages": {
/**
* Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing
* the input .d.ts files.
*
* TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551"
*
* DEFAULT VALUE: A single "default" entry with logLevel=warning.
*/
"compilerMessageReporting": {
/**
* Configures the default routing for messages that don't match an explicit rule in this table.
*/
"default": {
/**
* Specifies whether the message should be written to the the tool's output log. Note that
* the "addToApiReportFile" property may supersede this option.
*
* Possible values: "error", "warning", "none"
*
* Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail
* and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes
* the "--local" option), the warning is displayed but the build will not fail.
*
* DEFAULT VALUE: "warning"
*/
"logLevel": "error", //"warning",
/**
* When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md),
* then the message will be written inside that file; otherwise, the message is instead logged according to
* the "logLevel" option.
*
* DEFAULT VALUE: false
*/
// "addToApiReportFile": false
},
// "TS2551": {
// "logLevel": "warning",
// "addToApiReportFile": true
// },
//
// . . .
},
/**
* Configures handling of messages reported by API Extractor during its analysis.
*
* API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag"
*
* DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings
*/
"extractorMessageReporting": {
"default": {
"logLevel": "warning",
// "addToApiReportFile": false
},
"ae-missing-release-tag": {
"logLevel": "none",
"addToApiReportFile": false
},
// "ae-extra-release-tag": {
// "logLevel": "warning",
// "addToApiReportFile": true
// },
//
// . . .
},
/**
* Configures handling of messages reported by the TSDoc parser when analyzing code comments.
*
* TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text"
*
* DEFAULT VALUE: A single "default" entry with logLevel=warning.
*/
"tsdocMessageReporting": {
"default": {
"logLevel": "warning",
// "addToApiReportFile": false
},
"tsdoc-param-tag-missing-hyphen": {
"logLevel": "none",
"addToApiReportFile": false
},
"tsdoc-undefined-tag": {
"logLevel": "none",
"addToApiReportFile": false
},
"tsdoc-unsupported-tag": {
"logLevel": "none",
"addToApiReportFile": false
},
"tsdoc-escape-greater-than": {
"logLevel": "none",
"addToApiReportFile": false
},
"tsdoc-malformed-html-name": {
"logLevel": "none",
"addToApiReportFile": false
},
// "tsdoc-link-tag-unescaped-text": {
// "logLevel": "warning",
// "addToApiReportFile": true
// },
//
// . . .
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -27,7 +27,7 @@ extract_snippets() {
npm install markdown-snippet-injector
for SNIPPET_DIR in {tests/app,apps/app,tns-core-modules} ; do
for SNIPPET_DIR in {tests/app,apps/app,nativescript-core} ; do
echo "Extracting snippets from: $SNIPPET_DIR"
node "$BIN" --root="$SNIPPET_DIR" --target="$TARGET_DIR" \
--sourceext=".js|.ts|.xml|.html|.css"
@ -36,16 +36,6 @@ extract_snippets() {
archive_dist_dir "snippets"
}
extract_cookbook() {
COOKBOOK_DIR="$DIST_DIR/cookbook"
rm -rf "$COOKBOOK_DIR"
npm_install
grunt articles
mv "$DIST_DIR/articles" "$COOKBOOK_DIR"
archive_dist_dir "cookbook"
}
extract_apiref() {
APIREF_DIR="$DIST_DIR/api-reference"
rm -rf "$APIREF_DIR"
@ -62,6 +52,5 @@ mkdir -p "$TARGET_DIR"
if [ "${BASH_SOURCE[0]}" == "$0" ] ; then
extract_snippets
extract_cookbook
extract_apiref
fi

20
build/build-compat.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
##
# Prepares and packs:
# - tns-core-modules
# inside dist folder
##
set -x
set -e
DIST=dist;
ROOT_DIR=$(cd `dirname $0` && pwd)/..;
cd "$ROOT_DIR"
## Prepare tns-core-modules
./build/prepare-compat.sh
./build/pack-compat.sh

18
build/build-core.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
##
# Prepares and packs:
# - tns-platform-declarations
# - @nativescript/core packages
# inside dist folder
##
set -x
set -e
DIST=dist;
ROOT_DIR=$(cd `dirname $0` && pwd)/..;
cd "$ROOT_DIR"
./build/prepare-core.sh
./build/pack-core.sh

View File

@ -0,0 +1,56 @@
import * as path from "path";
import * as fs from "fs";
import readdirp, { EntryInfo } from "readdirp";
const inputFolder = path.resolve(process.argv[2]);
console.log(`Clearing private definitions in ${inputFolder}`);
function filterTypeScriptFiles(content: string) {
var leadingPrivate = /^.*@private/ig;
if (leadingPrivate.test(content)) {
return { shouldDelete: true };
}
let blockCommentPrivate = /\/\*\*([^](?!\*\/))*@module([^](?!\*\/))*@private[^]*?\*\//g;
if (blockCommentPrivate.test(content)) {
return { shouldDelete: true };
}
let newContent = content;
newContent = newContent.replace(/\/\/[\/\s]*@private[^]*?\/\/[\/\s]*?@endprivate/gm, "");
if (newContent !== content) {
return { shouldReplace: true, newContent: newContent };
}
return { shouldReplace: false, shouldDelete: false };
}
readdirp(inputFolder, {
fileFilter: ["*.d.ts"],
directoryFilter: function (di) { return !di.path.includes("node_modules"); }
}).on("data", (entry: EntryInfo) => {
const { fullPath } = entry;
const content = fs.readFileSync(fullPath, "utf8");
const { shouldDelete, shouldReplace, newContent } = filterTypeScriptFiles(content);
if (shouldDelete) {
console.log("[Delete]", fullPath);
fs.unlinkSync(fullPath);
} else if (shouldReplace) {
console.log("[Cleared]", fullPath);
try {
fs.writeFileSync(fullPath, newContent, "utf8");
} catch (error) {
console.log("ERROR writing file: " + fullPath, error);
process.exit(1);
}
}
})
.on("warn", (error: Error) => console.error("non-fatal error", error))
.on("error", (error: Error) => {
console.error("fatal error", error);
process.exit(1);
})
.on("end", () => console.log("done"));

View File

@ -1,18 +0,0 @@
const { readFileSync } = require("fs");
const { resolve } = require("path");
const { createPR, argsParser, gitBranch } = require("./pr-helper");
const currentBranch = argsParser().currentBranch || gitBranch;
const modulesPackageVersion = argsParser().packageVersion || JSON.parse(readFileSync(resolve(process.cwd(), "tns-core-modules/package.json")).toString()).version;
const title = argsParser().title || `release: cut the ${modulesPackageVersion} release`;
const baseBranch = argsParser().base || "release";
const body = argsParser().body || "docs: update changelog";
const postQuery = {
"body": body,
"head": currentBranch,
"base": baseBranch,
"title": title
}
createPR(postQuery);

25
build/generate-barrel-dts.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
##
# Prepares and packs:
# - tns-core-modules
# inside dist folder
##
set -x
set -e
DIST=dist;
ROOT_DIR=$(cd `dirname $0` && pwd)/..;
cd "$ROOT_DIR"
# Aways execute npx tsc from repo root to use the local typescript
npx tsc -v
npx tsc -p nativescript-core/tsconfig.barrels.json
FROM="temp/dts-out"
TO="nativescript-core"
mv $FROM/index.d.ts $TO/index.d.ts
mv $FROM/ui/index.d.ts $TO/ui/index.d.ts
mv $FROM/ui/layouts/index.d.ts $TO/ui/layouts/index.d.ts

View File

@ -0,0 +1,183 @@
import * as path from "path";
import * as fs from "fs";
import readdirp, { EntryInfo } from "readdirp";
const inputFolder = path.resolve("dist/nativescript-core");
const outputFolder = path.resolve("dist/tns-core-modules");
const testImports: string[] = [];
// List of definition files that don't need to be exported.
const dtsBlacklist = [
"module.d.ts",
"nativescript-error.d.ts",
"references.d.ts",
"tns-core-modules.d.ts"
];
// List of modules that should be re-exported despite they are private
const privateModulesWhitelist = [
"ui/styling/style-scope" //Reason: nativescript-dev-webpack generates code that imports this module
]
// There are few module using the "export default" syntax
// They should be handled differently when re-exporting
const modulesWithDefaultExports = [
"utils/lazy"
];
function traverseInputDir(fileFilter: string[], callback: (entry: EntryInfo) => void) {
return new Promise((resolve, reject) => {
readdirp(inputFolder, {
fileFilter,
directoryFilter: (di: EntryInfo) => {
return !di.path.startsWith("node_modules") &&
!di.path.startsWith("platforms");
}
})
.on("data", callback)
.on("error", reject)
.on("end", resolve);
});
}
function processPackageJsonFile(entry: EntryInfo) {
const dirPath = path.dirname(entry.path);
const outputFilePath = path.join(outputFolder, entry.path);
ensureDirectoryExistence(outputFilePath);
const json = require(entry.fullPath);
if (json.main) {
(<any>fs).copyFileSync(entry.fullPath, outputFilePath);
logFileCreated(outputFilePath);
addTestImport(dirPath);
const mainFile = path.join(dirPath, json.main);
createReExportFile(mainFile, ".ts");
addTestImport(mainFile);
}
}
function processDefinitionFile(entry: EntryInfo) {
if (dtsBlacklist.includes(entry.path)) {
return;
}
const relativeFilePathNoExt = entry.path.replace(/\.d\.ts$/, "");
// Re-export everything from d.ts file
createReExportFile(relativeFilePathNoExt, ".d.ts");
// This might be only a definitions file.
// So check if there is ts/js files before creating TS file with re-exports
const baseFile = path.join(inputFolder, relativeFilePathNoExt);
if (fs.existsSync(baseFile + ".ts") ||
fs.existsSync(baseFile + ".js") ||
(fs.existsSync(baseFile + ".android.ts") && fs.existsSync(baseFile + ".ios.ts")) ||
(fs.existsSync(baseFile + ".android.js") && fs.existsSync(baseFile + ".ios.js"))) {
createReExportFile(relativeFilePathNoExt, ".ts");
addTestImport(relativeFilePathNoExt);
}
}
function processTypeScriptFile(entry: EntryInfo) {
const relativeFilePathNoExt = entry.path.replace(/\.ts$/, "");
createReExportFile(relativeFilePathNoExt, ".ts");
addTestImport(relativeFilePathNoExt);
}
function createReExportFile(pathNoExt: string, ext: ".ts" | ".d.ts") {
const outputFile = path.join(outputFolder, pathNoExt + ext);
if (!fs.existsSync(outputFile)) {
ensureDirectoryExistence(outputFile);
let content = `export * from "@nativescript/core/${pathNoExt}";`
if (modulesWithDefaultExports.includes(pathNoExt)) {
content = `import defExport from "@nativescript/core/${pathNoExt}";\n`;
content += `export default defExport;`
}
fs.writeFileSync(outputFile, content);
logFileCreated(outputFile);
}
}
function ensureDirectoryExistence(filePath: string) {
const dirname = path.dirname(filePath);
if (fs.existsSync(dirname)) {
return true;
}
ensureDirectoryExistence(dirname);
fs.mkdirSync(dirname);
}
function logFileCreated(file: string) {
console.log(`CREATED: ${file}`);
}
function addTestImport(moduleName: string) {
testImports.push(moduleName);
}
function generateTestFile() {
const uniqueImports = Array.from(new Set(testImports)).sort();
const output: string[] = [];
output.push(`/* tslint:disable */`);
output.push(`import { compare, report } from "./module-compare";\n\n`);
uniqueImports.forEach((name) => {
const moduleName = name.replace(/[\.\/\-]/g, "_");
const compatName = `module_${moduleName}_compat`;
const coreName = `module_${moduleName}_core`;
output.push(`import * as ${coreName} from "@nativescript/core/${name}";`);
output.push(`import * as ${compatName} from "tns-core-modules/${name}";`);
output.push(`compare("${name}", ${coreName}, ${compatName});\n`);
});
output.push(`\n`);
output.push(`report();`);
const testFilePath = path.resolve("dist/generated-tests/tests.ts");
ensureDirectoryExistence(testFilePath);
fs.writeFileSync(testFilePath, output.join("\n"), "utf8");
(<any>fs).copyFileSync(path.resolve("build/generated-compat-checks/module-compare.ts"), path.resolve("dist/generated-tests/module-compare.ts"));
console.log(`Compat tests generated: ${testFilePath}`);
}
function generateExportsForPrivateModules() {
privateModulesWhitelist.forEach(pathNoExt => {
createReExportFile(pathNoExt, ".ts");
addTestImport(pathNoExt);
})
}
(async () => {
console.log(" ------> GENERATING FILES FORM PACKAGE.JSON");
// Traverse all package.json files and create:
// * .ts file with re-exports for the package.json/main
// * .d.ts file with re-exports for the package.json/types
await traverseInputDir(["package.json"], processPackageJsonFile);
console.log(" ------> GENERATING FILES FORM DEFINITIONS");
// Traverse all d.ts files and create
// * .d.ts file with re-exports for definitions for the .d.ts
// * .ts file with re-exports for the corresponding ts/js file (is such exists)
await traverseInputDir(["*.d.ts"], processDefinitionFile);
console.log(" ------> GENERATING FILES FROM TYPESCRIPT");
// Traverse all ts files which are not platform specific and create
// * .ts file with re-exports for the corresponding ts file
await traverseInputDir(["*(?<!\.(d|android|ios)).ts"], processTypeScriptFile);
generateExportsForPrivateModules();
// Generate tests in
generateTestFile()
})().catch(e => {
console.log("Error generating tns-core-modules files: " + e);
});

View File

@ -0,0 +1,21 @@
const results = { errors: new Array<string>(), modules: 0, exports: 0 };
export function compare(name: string, core: any, compat: any) {
results.modules++;
for (const key in core) {
results.exports++;
if (core[key] !== compat[key]) {
results.errors.push(`ERROR: Diff in module: ${name} key: ${key}`);
}
}
}
export function report() {
console.log(`CHECKED COMPLETED. CHECKED MODULES: ${results.modules} EXPORTS: ${results.exports}`);
if (results.errors.length) {
console.log(`----- ${results.errors.length} CHECKS FAILED ----- `);
results.errors.forEach((err) => console.log(err));
} else {
console.log("----- ALL CHECKS SUCCESSFUL ----- ");
}
}

View File

@ -1,9 +0,0 @@
const { createPR, gitBranch } = require("./pr-helper");
const postQuery = {
"head": gitBranch,
"base": "master",
"title": "chore: merge release in master"
}
createPR(postQuery);

25
build/pack-compat.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
##
# Packs:
# - tns-core-modules
# inside dist folder
##
set -x
set -e
## Pack tns-core-modules
(
# Aways execute npx tsc from repo root to use the local typescript
echo 'TypeScript transpile...'
npx tsc -v
npx tsc -p "dist/tns-core-modules"
echo 'NPM packing ...'
cd "dist/tns-core-modules"
TGZ="$(npm pack)"
mv "$TGZ" "../$TGZ"
)

24
build/pack-core.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
##
# Prepares the tns-platform-declarations and @nativescript/core packages inside dist folder
##
set -x
set -e
DIST=dist;
ROOT_DIR=$(cd `dirname $0` && pwd)/..;
cd "$ROOT_DIR"
(
cd "$DIST/tns-platform-declarations"
TGZ="$(npm pack)"
mv "$TGZ" "../$TGZ"
)
(
cd "$DIST/nativescript-core"
TGZ="$(npm pack)"
mv "$TGZ" "../$TGZ"
)

View File

@ -1,39 +0,0 @@
const { execSync } = require('child_process');
const { writeFileSync, unlinkSync } = require("fs");
const { resolve } = require("path");
exports.gitBranch = execSync("git branch").toString()
.split("\n")
.filter(f => f.trim().startsWith("*"))[0]
.replace("*", "").trim();
exports.createPR = (postQuery) => {
if (!process.env.GIT_TOKEN) {
console.error("Missing env variable GIT_TOKEN");
process.exit(1);
}
const releaseDataJsonPath = resolve(process.cwd(), "git-helper.json");
writeFileSync(releaseDataJsonPath, JSON.stringify(postQuery));
const result = execSync(` curl -d "@${releaseDataJsonPath}" -X POST https://api.github.com/repos/NativeScript/NativeScript/pulls -H "Authorization: token ${process.env.GIT_TOKEN}" `);
console.log(result.toString());
unlinkSync(releaseDataJsonPath);
const requesResultJson = JSON.parse(result);
execSync(`open ${requesResultJson.html_url}`);
return requesResultJson;
}
exports.argsParser = () => {
args = {};
process.argv
.filter(a => a.startsWith("--"))
.map(el => {
el = el.split("=");
const prop = el[0].replace("--", "").replace("-", "").trim();
const value = el[1].trim();
args[prop] = value;
});
return args;
}

43
build/prepare-compat.sh Executable file
View File

@ -0,0 +1,43 @@
#!/bin/bash
##
# Prepares and packs:
# - tns-core-modules
# inside dist folder
##
set -x
set -e
DIST=dist;
ROOT_DIR=$(cd `dirname $0` && pwd)/..;
cd "$ROOT_DIR"
DEFAULT_NATIVESCRIPT_CORE_ARGS="../nativescript-core*.tgz --no-save"
NATIVESCRIPT_CORE_ARGS=${NATIVESCRIPT_CORE_ARGS:-$DEFAULT_NATIVESCRIPT_CORE_ARGS}
## Prepare tns-core-modules
(
PACKAGE_SOURCE=tns-core-modules-package;
PACKAGE=tns-core-modules;
echo "Clearing $DIST/$PACKAGE"
npx rimraf "$DIST/$PACKAGE"
npx rimraf "$DIST/$PACKAGE*.tgz"
echo "Generating compat package"
npx ts-node --project ./build/tsconfig.json ./build/generate-tns-compat
echo "Copying $PACKAGE_SOURCE $DIST/$PACKAGE..."
npx ncp "$PACKAGE_SOURCE" "$DIST/$PACKAGE"
echo "Copying README and LICENSE to $DIST/$PACKAGE"
npx ncp LICENSE "$DIST"/"$PACKAGE"/LICENSE
(
echo 'TypeScript transpile...'
cd "$DIST/$PACKAGE"
npm install ${NATIVESCRIPT_CORE_ARGS}
)
)

79
build/prepare-core.sh Executable file
View File

@ -0,0 +1,79 @@
#!/bin/bash
##
# Prepares the tns-platform-declarations and @nativescript/core packages inside dist folder
##
set -x
set -e
DIST=dist;
ROOT_DIR=$(cd `dirname $0` && pwd)/..;
cd "$ROOT_DIR"
mkdir -p "$DIST"
## NPM INSTALL
(
echo "NPM install in root of the repo"
cd "$ROOT_DIR"
npm install
)
## Prepare Platfrom Declarations
(
PACKAGE=tns-platform-declarations;
echo "Clearing $DIST/$PACKAGE"
npx rimraf "$DIST/$PACKAGE"
npx rimraf "$DIST/$PACKAGE*.tgz"
echo "Copying $PACKAGE $DIST/$PACKAGE..."
npx ncp "$PACKAGE" "$DIST/$PACKAGE"
echo "Copying README and LICENSE to $DIST/$PACKAGE"
npx ncp LICENSE "$DIST/$PACKAGE"/LICENSE
cd "$DIST/$PACKAGE"
echo 'Running npm install...'
npm install
echo 'Running npm test...'
npm test
)
## Prepare Core Modules
(
PACKAGE=nativescript-core;
echo "Clearing $DIST/$PACKAGE"
npx rimraf "$DIST/$PACKAGE"
npx rimraf "$DIST/$PACKAGE*.tgz"
npm run api-extractor-ci
echo "Copying $PACKAGE $DIST/$PACKAGE..."
npx ncp "$PACKAGE" "$DIST/$PACKAGE"
echo "Cleaning inner readme.md-s ..."
npx rimraf "$DIST/$PACKAGE/**/README.md"
npx rimraf "$DIST/$PACKAGE/**/Readme.md"
echo "Copying README and LICENSE to $DIST/$PACKAGE"
npx ncp LICENSE "$DIST"/"$PACKAGE"/LICENSE
npx ncp README.md "$DIST"/"$PACKAGE"/README.md
(
cd "$DIST/$PACKAGE"
npm install
)
# Aways execute npx tsc from repo root to use the local typescript
echo 'TypeScript transpile...'
npx tsc -v
npx tsc -p "$DIST/$PACKAGE"
echo "Clearing typescript definitions from private APIs..."
npx ts-node --project ./build/tsconfig.json build/clear-private-definitions "$DIST/$PACKAGE"
)

View File

@ -1,354 +0,0 @@
module.exports = {
run: function(grunt) {
var pathModule = require("path");
var modulesPackageConfig = grunt.file.readJSON('package.json');
//Construct and validate the arguments
var args = {
platform: grunt.option("platform"),
modulesPath: grunt.option("modulesPath"),
tnsPath: grunt.option("tnsPath"),
emulatorProcessIdentifier: grunt.option("emuPId"),
emuAvdName: grunt.option("avd"),
outFile: grunt.option("logFilePath"),
runtimePath: grunt.option("runtimePath"),
runtimeVersion: grunt.option("runtimeVersion"),
showEmu: grunt.option("showEmu"),
runAppOnly: grunt.option("runAppOnly"),
pathToApp: grunt.option("pathToApp")
};
(function validateInput(){
if (!(/^(Android|iOS)$/).test(args.platform)) {
throw new Error("Invalid target platform specified! Use --platform=Android|iOS");
}
if (args.platform === "Android") {
if (!args.emulatorProcessIdentifier) {
throw new Error("Please, specify an identifier of the emulator process so that it can be stopped (--emuPId=...). Too many emulators started might cause machine overload");
}
if (!args.emuAvdName) {
throw new Error("Please, specify the name of the AVD to start (--avd=...).");
}
}
if (args.runAppOnly && !args.pathToApp) {
throw new Error("runAppOnly called, but no path to application specified. Please, add the path via the (--pathToApp=...) parameter.");
}
}());
var localCfg = {
tnsPath: args.tnsPath || "tns",
emulatorProcessIdentifier: args.emulatorProcessIdentifier,
modulesPath: args.modulesPath || "./bin/dist/tns-core-modules-" + modulesPackageConfig.version + ".tgz",
emuAvdName: args.emuAvdName,
outFile: args.outFile || "./TestRunResult.txt",
frameworkArgument: args.runtimePath ? " --frameworkPath=" + args.runtimePath : "",
runtimeVersionArgument: args.runtimeVersion ? "@" + args.runtimeVersion : "",
showEmu: args.showEmu || false,
runAppOnly: args.runAppOnly || false,
workingDir:".testsapprun",
testsAppName:"TestsApp",
tnsCoreModulesSource: pathModule.resolve("./tns-core-modules"),
applicationDir: pathModule.join(".testsapprun", "TestsApp"),
appDir: pathModule.join(".testsapprun", "TestsApp", "app"),
pathToApk: "./platforms/android/build/outputs/apk/TestsApp-debug.apk",
pathToApp: "./platforms/ios/build/emulator/TestsApp.app",
deployedAppName:"org.nativescript.TestsApp",
mainActivityName:"com.tns.NativeScriptActivity",
pathToCompiledTests: "bin/dist/tests/app",
simulatorSysLog: pathModule.join(process.env.HOME, "Library/Logs/CoreSimulator", args.emuAvdName, "/system.log"),
platform: args.platform
}
if (localCfg.runAppOnly) {
localCfg.pathToApp = localCfg.pathToApk = args.pathToApp;
localCfg.applicationDir = "./";
}
grunt.initConfig({
clean: {
workingDir: {
src: localCfg.workingDir
},
originalAppDir: {
src: [
localCfg.appDir + "/*",
"!" + pathModule.join(localCfg.appDir, "App_Resources") + ""
]
},
modules: {
src: pathModule.join(localCfg.applicationDir, "node_modules", "tns-core-modules")
},
tempExtractedModules: {
src: pathModule.join(localCfg.applicationDir, "node_modules", "package")
},
simulatorLog: {
src: localCfg.simulatorSysLog,
options: {
force: true
}
}
},
mkdir: {
workingDir: {
options: {
create: [localCfg.workingDir],
mode: 0700
}
}
},
copy: {
testsAppToRunDir: {
src: "**/*.*",
dest: localCfg.appDir,
cwd: localCfg.pathToCompiledTests,
expand: true
},
modulesToDir: {
expand: true,
src: "**/*.*",
cwd: pathModule.join(localCfg.applicationDir, "node_modules", "package"),
dest: pathModule.join(localCfg.applicationDir, "node_modules", "tns-core-modules")
},
addAndroidPermissions: {
src: "AndroidManifest.xml",
dest: localCfg.applicationDir + "/app/App_Resources/Android/",
cwd: localCfg.applicationDir + "/app/App_Resources/Android",
expand: true,
options: {
process: function(content, srcPath) {
var newContent = content;
var internetPermissionFinder = /((\s*)<uses-permission[^>]*android\.permission\.INTERNET[^>]*>)/;
if (!/uses-permission[^>]*android\.permission\.ACCESS_NETWORK_STATE/.test(content)) {
newContent = newContent.replace(internetPermissionFinder, "$1$2<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>");
}
if (!/uses-permission[^>]*android\.permission\.ACCESS_FINE_LOCATION/.test(content)) {
newContent = newContent.replace(internetPermissionFinder, "$1$2<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>");
}
return newContent;
}
}
},
addiOSPermissions: {
src: localCfg.testsAppName + "-Info.plist",
dest: pathModule.join(localCfg.applicationDir,"/platforms/ios/", localCfg.testsAppName) + "/",
cwd: pathModule.join(localCfg.applicationDir,"/platforms/ios/", localCfg.testsAppName),
expand: true,
options: {
process: function(content, srcPath) {
var newContent = content;
var lastDictLocator = /(<\/dict>\s*<\/plist>)$/gm;
if (!/NSAppTransportSecurity/.test(content)) {
newContent = newContent.replace(lastDictLocator, "<key>NSAppTransportSecurity</key>\n$1");
}
if (!/NSAllowsArbitraryLoads/.test(content)) {
newContent = newContent.replace(lastDictLocator, "<dict>\n<key>NSAllowsArbitraryLoads</key>\n<true/>\n</dict>\n$1");
}
return newContent;
}
}
},
simulatorLog: {
src: localCfg.simulatorSysLog,
dest: localCfg.outFile
}
},
exec: {
killAndroidEmulator: {
cmd: "pkill '" + localCfg.emulatorProcessIdentifier + "'",
exitCode: [0, 1]
},
killiOSEmulator: {
cmd: "pkill Simulator",
exitCode: [0, 1]
},
createApp: {
cmd: localCfg.tnsPath + " create " + localCfg.testsAppName,
cwd: localCfg.workingDir
},
restartAdb: {
cmd: "adb kill-server && adb start-server"
},
uninstallExistingAndroidApp: {
cmd: "adb uninstall " + localCfg.deployedAppName
},
installNewAndroidApp: {
cmd: "adb install " + localCfg.pathToApk,
cwd: localCfg.applicationDir
},
startAndroidEmulator: {
cmd: "emulator -avd " + localCfg.emuAvdName + " -no-audio " + (args.showEmu ? "" : "-no-window") + "&"
},
startAndroidApp: {
cmd: "adb shell am start -n " + localCfg.deployedAppName + "/" + localCfg.mainActivityName
},
uninstallExistingiOSApp: {
cmd: "xcrun simctl uninstall " + localCfg.emuAvdName + " org.nativescript." + localCfg.testsAppName,
cwd: localCfg.applicationDir
},
installNewiOSApp: {
cmd: "xcrun simctl install " + localCfg.emuAvdName + " " + localCfg.pathToApp,
cwd: localCfg.applicationDir
},
startiOSApp: {
cmd: "xcrun simctl launch " + localCfg.emuAvdName + " org.nativescript." + localCfg.testsAppName
},
"npm-i-modules": {
cmd: "npm i " + pathModule.relative(localCfg.applicationDir, localCfg.modulesPath),
cwd: localCfg.applicationDir
},
"npm-i-widgets": {
cmd: "npm i tns-core-modules-widgets@next",
cwd: localCfg.applicationDir
}
},
shell: {
collectAndroidLog: {
command: "./expect.exp " + "'adb logcat *:D' " + localCfg.outFile,
options: {
execOptions: {
maxBuffer: Infinity
}
}
},
waitiOSLogCompletion: {
command: "./expect.exp " + "'tail -f " + localCfg.simulatorSysLog + "' " + localCfg.outFile,
options: {
execOptions: {
maxBuffer: Infinity
}
}
},
startiOSSimulator: {
command: "xcrun instruments -w " + localCfg.emuAvdName,
options: {
failOnError: false
},
},
buildApp: {
command: "tns build " + localCfg.platform.toLowerCase(),
options: {
execOptions: {
maxBuffer: Infinity,
cwd: localCfg.applicationDir
}
}
},
addPlatform: {
command: "tns platform add " + localCfg.platform.toLowerCase() + localCfg.runtimeVersionArgument + " " + localCfg.frameworkArgument,
options: {
execOptions: {
maxBuffer: Infinity,
cwd: localCfg.applicationDir
}
}
},
}
});
grunt.loadNpmTasks("grunt-shell");
grunt.loadNpmTasks("grunt-exec");
grunt.loadNpmTasks("grunt-mkdir");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-copy");
var getPlatformSpecificTask = function(templatedTaskName) {
return templatedTaskName.replace(/\{platform\}/, localCfg.platform);
}
grunt.registerTask("startEmulatorAndroid", [
getPlatformSpecificTask("exec:startAndroidEmulator"),
]);
grunt.registerTask("startEmulatoriOS", [
getPlatformSpecificTask("shell:startiOSSimulator"),
]);
grunt.registerTask("collectLogAndroid", [
"shell:collectAndroidLog"
]);
grunt.registerTask("collectLogiOS", [
"shell:waitiOSLogCompletion",
"copy:simulatorLog"
]);
grunt.registerTask("doPreUninstallAppAndroid", [
"exec:restartAdb"
]);
grunt.registerTask("doPreUninstallAppiOS", [
"clean:simulatorLog"
]);
grunt.registerTask("cleanup", [
// getPlatformSpecificTask("exec:kill{platform}Emulator"),
"clean:workingDir"
]);
grunt.registerTask("buildOnly", [
"exec:createApp",
"clean:originalAppDir",
"copy:testsAppToRunDir",
"clean:modules",
"exec:npm-i-modules",
"exec:npm-i-widgets",
"copy:modulesToDir",
"clean:tempExtractedModules",
"shell:addPlatform",
getPlatformSpecificTask("copy:add{platform}Permissions"),
"shell:buildApp",
]);
grunt.registerTask("buildTestsApp", [
"cleanup",
"mkdir:workingDir",
"buildOnly"
]);
grunt.registerTask("buildOnlyTestsApp", ["buildTestsApp"]);
grunt.registerTask("runOnly", [
// getPlatformSpecificTask("doPreUninstallApp{platform}"),
getPlatformSpecificTask("exec:uninstallExisting{platform}App"),
getPlatformSpecificTask("exec:installNew{platform}App"),
getPlatformSpecificTask("exec:start{platform}App"),
getPlatformSpecificTask("collectLog{platform}"),
]);
grunt.registerTask("runApp", [
// "cleanup",
// getPlatformSpecificTask("startEmulator{platform}"),
"runOnly",
"cleanup"
]);
grunt.registerTask("runOnlyTestsApp", ["runApp"]);
var tasksToExecute = ["runApp"];
if (!localCfg.runAppOnly) {
tasksToExecute = [
"cleanup",
"mkdir:workingDir",
getPlatformSpecificTask("startEmulator{platform}"),
"buildOnly",
"runOnly",
"cleanup"
];
}
grunt.registerTask("testsapp", tasksToExecute);
}
}

11
build/tsconfig.json Normal file
View File

@ -0,0 +1,11 @@
/**
* tsconfig file used for executing TS script in the build folder with ts-node
**/
{
"compilerOptions": {
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"strict": true, /* Enable all strict type-checking options. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
}
}

View File

@ -1,4 +1,7 @@
{
"rulesDirectory": [
"@nativescript/tslint-rules"
],
"rules": {
"arrow-return-shorthand": true,
"class-name": true,
@ -9,6 +12,7 @@
"jsdoc-format": false,
"max-line-length": [false, 120],
"newline-before-return": true,
"no-android-resources": true,
"no-arg": true,
"no-bitwise": false,
"no-consecutive-blank-lines": true,

View File

@ -1,35 +0,0 @@
mochawesome-report
# NativeScript
hooks/
node_modules/
platforms/
# NativeScript Template
*.js.map
*.js
!webpack.config.js
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# General
.DS_Store
.AppleDouble
.LSOverride
.idea
.cloud
.project
tmp/
typings/
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

View File

@ -1,14 +0,0 @@
Execute Tests
=============
Android:
```
npm run e2e -- --runType android23 # --devMode
```
iOS:
```
npm run e2e -- --runType sim.iPhoneX.iOS112 # --devMode
```

View File

@ -0,0 +1,40 @@
import { EventData, Page } from "tns-core-modules/ui/page";
import { View } from "tns-core-modules/ui/core/view";
import { Point3D } from "tns-core-modules/ui/animation/animation";
let view: View;
export function pageLoaded(args: EventData) {
const page = <Page>args.object;
view = page.getViewById<View>("view");
}
export function onAnimateX(args: EventData) {
rotate({ x: 360, y: 0, z: 0 });
}
export function onAnimateY(args: EventData) {
rotate({ x: 0, y: 360, z: 0 });
}
export function onAnimateZ(args: EventData) {
rotate({ x: 0, y: 0, z: 360 });
}
export function onAnimateXYZ(args: EventData) {
rotate({ x: 360, y: 360, z: 360 });
}
async function rotate(rotate: Point3D) {
await view.animate({
rotate,
duration: 1000
});
reset();
}
function reset() {
view.rotate = 0;
view.rotateX = 0;
view.rotateY = 0;
}

View File

@ -0,0 +1,24 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded">
<ActionBar title="Rotate" />
<GridLayout rows="auto auto auto auto *" columns="* * *">
<Image src="~/res/icon_100x100.png" width="30" height="30" col="0" row="0" rotateX="60"/>
<Image src="~/res/icon_100x100.png" width="30" height="30" col="1" row="0" rotateY="60"/>
<Image src="~/res/icon_100x100.png" width="30" height="30" col="2" row="0" rotate="60"/>
<Button text="X" tap="onAnimateX" col="0" row="1"/>
<Button text="Y" tap="onAnimateY" col="1" row="1"/>
<Button text="Z" tap="onAnimateZ" col="2" row="1"/>
<Image src="~/res/icon_100x100.png" width="60" height="60" horizontalAlignment="center"
colSpan="3" row="2" rotate="60" rotateX="60" rotateY="60"/>
<Button text="XYZ" tap="onAnimateXYZ" row="3" colSpan="3"/>
<AbsoluteLayout width="300" height="300" clipToBounds="true" backgroundColor="LightGray" row="4" colSpan="3">
<Image id="view" src="~/res/icon_100x100.png"
width="100" height="100"
left="100" top="100"/>
</AbsoluteLayout>
</GridLayout>
</Page>

View File

@ -0,0 +1,75 @@
.rotate-x {
rotateX: 60;
}
.rotate-y {
rotateY: 60;
}
.rotate-z {
rotate: 60;
}
.original {
transform: none;
}
.animate-x {
animation-name: rotateX;
animation-duration: 2s;
animation-fill-mode: forwards;
}
.animate-y {
animation-name: rotateY;
animation-duration: 2s;
animation-fill-mode: forwards;
}
.animate-z {
animation-name: rotateZ;
animation-duration: 2s;
animation-fill-mode: forwards;
}
.animate-xyz-3d {
animation-name: rotateXYZ3D;
animation-duration: 2s;
animation-fill-mode: forwards;
}
.animate-xyz {
animation-name: rotateXYZ;
animation-duration: 2s;
animation-fill-mode: forwards;
}
@keyframes rotateX {
from { transform: none; }
50% { transform: rotateX(60) }
to { transform: none; }
}
@keyframes rotateY {
from { transform: none; }
50% { transform: rotateY(60) }
to { transform: none; }
}
@keyframes rotateZ {
from { transform: none; }
50% { transform: rotate(60) }
to { transform: none; }
}
@keyframes rotateXYZ3D {
from { transform: none; }
50% { transform: rotate3d(60, 60, 60) }
to { transform: none; }
}
@keyframes rotateXYZ {
from { transform: none; }
50% { transform: rotateX(60) rotateY(60) rotate(60) }
to { transform: none; }
}

View File

@ -0,0 +1,35 @@
import { EventData, Page } from "tns-core-modules/ui/page";
import { View } from "tns-core-modules/ui/core/view";
import { Point3D } from "tns-core-modules/ui/animation/animation";
let view: View;
export function pageLoaded(args: EventData) {
const page = <Page>args.object;
view = page.getViewById<View>("view");
}
export function onAnimateX(args: EventData) {
view.className = "original";
view.className = "animate-x";
}
export function onAnimateY(args: EventData) {
view.className = "original";
view.className = "animate-y";
}
export function onAnimateZ(args: EventData) {
view.className = "original";
view.className = "animate-z";
}
export function onAnimateXYZ3D(args: EventData) {
view.className = "original";
view.className = "animate-xyz-3d";
}
export function onAnimateXYZ(args: EventData) {
view.className = "original";
view.className = "animate-xyz";
}

View File

@ -0,0 +1,22 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded">
<ActionBar title="Rotate" />
<GridLayout rows="auto auto auto *" columns="* * *">
<Image src="~/res/icon_100x100.png" width="30" height="30" col="0" row="0" class="rotate-x"/>
<Image src="~/res/icon_100x100.png" width="30" height="30" col="1" row="0" class="rotate-y"/>
<Image src="~/res/icon_100x100.png" width="30" height="30" col="2" row="0" class="rotate-z"/>
<Button text="X" tap="onAnimateX" col="0" row="1"/>
<Button text="Y" tap="onAnimateY" col="1" row="1"/>
<Button text="Z" tap="onAnimateZ" col="2" row="1"/>
<Button text="XYZ" tap="onAnimateXYZ" row="2" col="0"/>
<Button text="XYZ-3D" tap="onAnimateXYZ3D" row="2" col="1"/>
<AbsoluteLayout width="300" height="300" clipToBounds="true" backgroundColor="LightGray" row="3" colSpan="3">
<Image id="view" src="~/res/icon_100x100.png"
width="100" height="100"
left="100" top="100" />
</AbsoluteLayout>
</GridLayout>
</Page>

View File

@ -11,6 +11,6 @@ export function pageLoaded(args: EventData) {
export function onButtonTap(args: EventData) {
const clickedButton = <Button>args.object;
const destination = clickedButton.text + "/page";
const destination = "css-animations/" + clickedButton.text + "/page";
currentFrame.navigate(destination);
}

View File

@ -13,6 +13,7 @@
<Button text="settings" tap="onButtonTap"/>
<Button text="visual-states" tap="onButtonTap"/>
<Button text="initial-animation" tap="onButtonTap"/>
<Button text="3d-rotate" tap="onButtonTap"/>
</StackLayout>
</ScrollView>
</Page>

View File

@ -19,6 +19,7 @@
<Button text="infinite" tap="onButtonTap" />
<Button text="animation-curves" tap="onButtonTap" />
<Button text="css-animations" tap="onButtonTap" />
<Button text="3d-rotate" tap="onButtonTap" />
</StackLayout>
</ScrollView>

View File

@ -1,6 +1,7 @@
{
"android": {
"v8Flags": "--expose_gc"
"v8Flags": "--expose_gc",
"markingMode": "none"
},
"main": "app.js",
"name": "tns-template-hello-world-ts",

View File

@ -1,3 +0,0 @@
{
"useLegacyWorkflow": false
}

View File

@ -14,11 +14,13 @@
},
"dependencies": {
"nativescript-theme-core": "~1.0.6",
"tns-core-modules": "next"
"@nativescript/core": "file:../../nativescript-core",
"tns-core-modules": "file:../../dist/tns-core-modules"
},
"devDependencies": {
"@types/chai": "~4.1.7",
"@types/mocha": "~5.2.5",
"@types/node": "~10.12.18",
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",

View File

@ -6,24 +6,24 @@
"emitDecoratorMetadata": true,
"noEmitHelpers": true,
"noEmitOnError": true,
"skipLibCheck": true,
"lib": [
"es6",
"dom"
],
"baseUrl": ".",
"paths": {
"*": [
"./node_modules/tns-core-modules/*",
"./node_modules/*"
],
"~/*": [
"app/*"
],
"*": [
"./node_modules/*"
]
}
},
"exclude": [
"e2e",
"node_modules",
"platforms",
"e2e"
"platforms"
]
}

View File

@ -1,303 +0,0 @@
const { join, relative, resolve, sep } = require("path");
const webpack = require("webpack");
const nsWebpack = require("nativescript-dev-webpack");
const nativescriptTarget = require("nativescript-dev-webpack/nativescript-target");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const { NativeScriptWorkerPlugin } = require("nativescript-worker-loader/NativeScriptWorkerPlugin");
const TerserPlugin = require("terser-webpack-plugin");
const hashSalt = Date.now().toString();
module.exports = env => {
// Add your custom Activities, Services and other Android app components here.
const appComponents = [
"tns-core-modules/ui/frame",
"tns-core-modules/ui/frame/activity",
];
const platform = env && (env.android && "android" || env.ios && "ios");
if (!platform) {
throw new Error("You need to provide a target platform!");
}
const platforms = ["ios", "android"];
const projectRoot = __dirname;
// Default destination inside platforms/<platform>/...
const dist = resolve(projectRoot, nsWebpack.getAppPath(platform, projectRoot));
const appResourcesPlatformDir = platform === "android" ? "Android" : "iOS";
const {
// The 'appPath' and 'appResourcesPath' values are fetched from
// the nsconfig.json configuration file
// when bundling with `tns run android|ios --bundle`.
appPath = "app",
appResourcesPath = "app/App_Resources",
// You can provide the following flags when running 'tns run android|ios'
snapshot, // --env.snapshot
uglify, // --env.uglify
report, // --env.report
sourceMap, // --env.sourceMap
hiddenSourceMap, // --env.hiddenSourceMap
hmr, // --env.hmr,
unitTesting, // --env.unitTesting
} = env;
const isAnySourceMapEnabled = !!sourceMap || !!hiddenSourceMap;
const externals = nsWebpack.getConvertedExternals(env.externals);
const appFullPath = resolve(projectRoot, appPath);
const appResourcesFullPath = resolve(projectRoot, appResourcesPath);
const entryModule = nsWebpack.getEntryModule(appFullPath, platform);
const entryPath = `.${sep}${entryModule}.ts`;
const entries = { bundle: entryPath };
const tsConfigPath = resolve(projectRoot, "tsconfig.tns.json");
if (platform === "ios") {
entries["tns_modules/tns-core-modules/inspector_modules"] = "inspector_modules.js";
};
let sourceMapFilename = nsWebpack.getSourceMapFilename(hiddenSourceMap, __dirname, dist);
const config = {
mode: uglify ? "production" : "development",
context: appFullPath,
externals,
watchOptions: {
ignored: [
appResourcesFullPath,
// Don't watch hidden files
"**/.*",
]
},
target: nativescriptTarget,
entry: entries,
output: {
pathinfo: false,
path: dist,
sourceMapFilename,
libraryTarget: "commonjs2",
filename: "[name].js",
globalObject: "global",
hashSalt
},
resolve: {
extensions: [".ts", ".js", ".scss", ".css"],
// Resolve {N} system modules from tns-core-modules
modules: [
resolve(__dirname, "node_modules/tns-core-modules"),
resolve(__dirname, "node_modules"),
"node_modules/tns-core-modules",
"node_modules",
],
alias: {
'~': appFullPath
},
// resolve symlinks to symlinked modules
symlinks: true
},
resolveLoader: {
// don't resolve symlinks to symlinked loaders
symlinks: false
},
node: {
// Disable node shims that conflict with NativeScript
"http": false,
"timers": false,
"setImmediate": false,
"fs": "empty",
"__dirname": false,
},
devtool: hiddenSourceMap ? "hidden-source-map" : (sourceMap ? "inline-source-map" : "none"),
optimization: {
runtimeChunk: "single",
splitChunks: {
cacheGroups: {
vendor: {
name: "vendor",
chunks: "all",
test: (module, chunks) => {
const moduleName = module.nameForCondition ? module.nameForCondition() : '';
return /[\\/]node_modules[\\/]/.test(moduleName) ||
appComponents.some(comp => comp === moduleName);
},
enforce: true,
},
}
},
minimize: !!uglify,
minimizer: [
new TerserPlugin({
parallel: true,
cache: true,
sourceMap: isAnySourceMapEnabled,
terserOptions: {
output: {
comments: false,
semicolons: !isAnySourceMapEnabled
},
compress: {
// The Android SBG has problems parsing the output
// when these options are enabled
'collapse_vars': platform !== "android",
sequences: platform !== "android",
}
}
})
],
},
module: {
rules: [
{
test: nsWebpack.getEntryPathRegExp(appFullPath, entryPath),
use: [
// Require all Android app components
platform === "android" && {
loader: "nativescript-dev-webpack/android-app-components-loader",
options: { modules: appComponents }
},
{
loader: "nativescript-dev-webpack/bundle-config-loader",
options: {
loadCss: !snapshot, // load the application css if in debug mode
unitTesting,
appFullPath,
projectRoot,
registerModules: /(root|page\d*|Page\d*)\.(xml|css|js|ts|scss)$/ // NB: MODIFIED
}
},
].filter(loader => !!loader)
},
{
test: /-page\.ts$/,
use: "nativescript-dev-webpack/script-hot-loader"
},
{
test: /\.(css|scss)$/,
use: "nativescript-dev-webpack/style-hot-loader"
},
{
test: /\.(html|xml)$/,
use: "nativescript-dev-webpack/markup-hot-loader"
},
{ test: /\.(html|xml)$/, use: "nativescript-dev-webpack/xml-namespace-loader" },
{
test: /\.css$/,
use: { loader: "css-loader", options: { url: false } }
},
{
test: /\.scss$/,
use: [
{ loader: "css-loader", options: { url: false } },
"sass-loader"
]
},
{
test: /\.ts$/,
use: {
loader: "ts-loader",
options: {
configFile: tsConfigPath,
// https://github.com/TypeStrong/ts-loader/blob/ea2fcf925ec158d0a536d1e766adfec6567f5fb4/README.md#faster-builds
// https://github.com/TypeStrong/ts-loader/blob/ea2fcf925ec158d0a536d1e766adfec6567f5fb4/README.md#hot-module-replacement
transpileOnly: true,
allowTsInNodeModules: true,
compilerOptions: {
sourceMap: isAnySourceMapEnabled,
declaration: false
}
},
}
},
]
},
plugins: [
// Define useful constants like TNS_WEBPACK
new webpack.DefinePlugin({
"global.TNS_WEBPACK": "true",
"process": undefined,
}),
// Remove all files from the out dir.
new CleanWebpackPlugin([`${dist}/**/*`]),
// Copy assets to out dir. Add your own globs as needed.
new CopyWebpackPlugin([
{ from: { glob: "fonts/**" } },
{ from: { glob: "**/*.jpg" } },
{ from: { glob: "**/*.png" } },
], { ignore: [`${relative(appPath, appResourcesFullPath)}/**`] }),
new nsWebpack.GenerateNativeScriptEntryPointsPlugin("bundle"),
// For instructions on how to set up workers with webpack
// check out https://github.com/nativescript/worker-loader
new NativeScriptWorkerPlugin(),
new nsWebpack.PlatformFSPlugin({
platform,
platforms,
}),
// Does IPC communication with the {N} CLI to notify events when running in watch mode.
new nsWebpack.WatchStateLoggerPlugin(),
// https://github.com/TypeStrong/ts-loader/blob/ea2fcf925ec158d0a536d1e766adfec6567f5fb4/README.md#faster-builds
// https://github.com/TypeStrong/ts-loader/blob/ea2fcf925ec158d0a536d1e766adfec6567f5fb4/README.md#hot-module-replacement
new ForkTsCheckerWebpackPlugin({
tsconfig: tsConfigPath,
async: false,
useTypescriptIncrementalApi: true,
memoryLimit: 4096
})
],
};
// Copy the native app resources to the out dir
// only if doing a full build (tns run/build) and not previewing (tns preview)
if (!externals || externals.length === 0) {
config.plugins.push(new CopyWebpackPlugin([
{
from: `${appResourcesFullPath}/${appResourcesPlatformDir}`,
to: `${dist}/App_Resources/${appResourcesPlatformDir}`,
context: projectRoot
},
]));
}
if (report) {
// Generate report files for bundles content
config.plugins.push(new BundleAnalyzerPlugin({
analyzerMode: "static",
openAnalyzer: false,
generateStatsFile: true,
reportFilename: resolve(projectRoot, "report", `report.html`),
statsFilename: resolve(projectRoot, "report", `stats.json`),
}));
}
if (snapshot) {
config.plugins.push(new nsWebpack.NativeScriptSnapshotPlugin({
chunk: "vendor",
requireModules: [
"tns-core-modules/bundle-entry-points",
],
projectRoot,
webpackConfig: config,
}));
}
if (hmr) {
config.plugins.push(new webpack.HotModuleReplacementPlugin());
}
return config;
};

View File

@ -1,6 +1,7 @@
{
"main": "app-page.js",
"android": {
"v8Flags": "--expose_gc"
"v8Flags": "--expose_gc",
"markingMode": "none"
}
}

View File

@ -1,3 +0,0 @@
{
"useLegacyWorkflow": false
}

View File

@ -13,12 +13,12 @@
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"tns-core-modules": "next"
"@nativescript/core": "file:../../nativescript-core",
"tns-core-modules": "file:../../dist/tns-core-modules"
},
"devDependencies": {
"nativescript-dev-webpack": "next",
"tns-platform-declarations": "next",
"typescript": "3.4.1"
"typescript": "3.4.5"
},
"gitHead": "8c1a4866a66daab09bf5ef8e5a96472687192373",
"readme": "NativeScript Application"

View File

@ -6,6 +6,7 @@
"emitDecoratorMetadata": true,
"noEmitHelpers": true,
"noEmitOnError": true,
"skipLibCheck": true,
"lib": [
"es6",
"dom"
@ -14,6 +15,9 @@
"paths": {
"~/*": [
"app/*"
],
"*": [
"./node_modules/*"
]
}
},

View File

@ -1,35 +1 @@
mochawesome-report
# NativeScript
hooks/
node_modules/
platforms/
# NativeScript Template
*.js.map
*.js
!webpack.config.js
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# General
.DS_Store
.AppleDouble
.LSOverride
.idea
.cloud
.project
tmp/
typings/
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

View File

@ -1,4 +0,0 @@
Execute Tests
=============
TODO

View File

@ -2,13 +2,17 @@
// Uncomment to add recyclerview-v7 dependency
//dependencies {
// compile 'com.android.support:recyclerview-v7:+'
// implementation 'com.android.support:recyclerview-v7:+'
//}
// If you want to add something to be applied before applying plugins' include.gradle files
// e.g. project.ext.googlePlayServicesVersion = "15.0.1"
// create a file named before-plugins.gradle in the current directory and place it there
android {
defaultConfig {
minSdkVersion 17
generatedDensities = []
applicationId = "org.nativescript.animation"
}
aaptOptions {
additionalParameters "--no-version-vectors"

View File

@ -10,10 +10,6 @@
android:largeScreens="true"
android:xlargeScreens="true"/>
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="__APILEVEL__"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
@ -28,7 +24,7 @@
<activity
android:name="com.tns.NativeScriptActivity"
android:label="@string/title_activity_kimera"
android:configChanges="keyboardHidden|orientation|screenSize"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
android:theme="@style/LaunchScreenTheme">
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 915 B

View File

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

View File

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">FileQualifiers</string>
<string name="title_activity_kimera">FileQualifiers</string>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="external_files" path="."/>
</paths>

View File

@ -1,5 +1,6 @@
@import '~nativescript-theme-core/css/core.light.css';
.root-footer {
horizontal-align: middle;
color: black;
background-color: lightgreen
}

View File

@ -1,5 +1,7 @@
/* Currently app.land.css is never loaded */
@import '~nativescript-theme-core/css/lime.css';
.root-footer {
horizontal-align: middle;
color: black;
background-color: lightpink;
}

View File

@ -1,3 +1,7 @@
import * as application from "tns-core-modules/application";
import { setCategories, categories, enable } from "tns-core-modules/trace";
setCategories(categories.Livesync);
enable();
application.run({ moduleName: "app-root" });

View File

@ -0,0 +1,5 @@
.custom-component {
color: navy;
font-weight: bold;
font-size: 20;
}

View File

@ -0,0 +1,5 @@
.custom-component {
color: darkolivegreen;
font-weight: bold;
font-size: 20;
}

View File

@ -0,0 +1,3 @@
export function onLoaded() {
console.log("---> Custom component LANDSCAPE loaded");
}

View File

@ -0,0 +1,3 @@
<StackLayout class="p-20" loaded="onLoaded">
<Label text="CUSTOM COMPONENT - LANDSCAPE" class="custom-component" />
</StackLayout>

View File

@ -0,0 +1,3 @@
export function onLoaded() {
console.log("---> Custom component DEFAULT loaded");
}

Some files were not shown because too many files have changed in this diff Show More