diff --git a/.gitignore b/.gitignore index d4301c9280..71db8edb52 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ **/yarn.lock **/pnpm-lock.yaml .npmrc +.yarn # IDEs and editors .idea @@ -54,3 +55,4 @@ Thumbs.db # types ios-typings-prj +/packages/core/platforms/android/core.aar diff --git a/.husky/pre-commit b/.husky/pre-commit index a3cebf1ec5..56984d3cb0 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,8 @@ #!/bin/sh -. "$(dirname "$0")/_/husky.sh" +# . "$(dirname "$0")/_/husky.sh" + +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" diff --git a/.vscode/settings.json b/.vscode/settings.json index 3a51bc2980..98d76e4dde 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,6 @@ "**/*.js": true, "**/*.js.map": true }, - "tslint.configFile": "./build/tslint.json" + "tslint.configFile": "./build/tslint.json", + "git.enabled": false } \ No newline at end of file diff --git a/apps/automated/nativescript.config.ts b/apps/automated/nativescript.config.ts index 043f59c668..413b3e554e 100644 --- a/apps/automated/nativescript.config.ts +++ b/apps/automated/nativescript.config.ts @@ -7,7 +7,4 @@ export default { android: { v8Flags: '--expose_gc', }, - cli: { - packageManager: 'npm', - }, } as NativeScriptConfig; diff --git a/apps/automated/package.json b/apps/automated/package.json index fcdecff894..ef4ce0005e 100644 --- a/apps/automated/package.json +++ b/apps/automated/package.json @@ -13,7 +13,7 @@ "devDependencies": { "@nativescript/android": "~8.3.0", "@nativescript/ios": "~8.3.0", - "@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz", + "@nativescript/webpack": "5.0.7", "typescript": "4.7.3" }, "gitHead": "c06800e52ee1a184ea2dffd12a6702aaa43be4e3", diff --git a/apps/automated/src/pages/page11.ts b/apps/automated/src/pages/page11.ts index 624b57a266..63eeb754e8 100644 --- a/apps/automated/src/pages/page11.ts +++ b/apps/automated/src/pages/page11.ts @@ -51,7 +51,7 @@ export function createPage() { //page.content = GridLayout; page.content = StackLayout; var x = 1; - btn1.on(button.Button.tapEvent, function () { + btn1.on(button.tapEvent, function () { x++; var gravity; //btn1.android.setLayoutParams(new android.view.ViewGroup.LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT, android.view.ViewGroup.LayoutParams.FILL_PARENT)); diff --git a/apps/automated/src/pages/page7.ts b/apps/automated/src/pages/page7.ts index be65104d63..93d464ec15 100644 --- a/apps/automated/src/pages/page7.ts +++ b/apps/automated/src/pages/page7.ts @@ -13,7 +13,7 @@ export function createPage() { var vAligns: CoreTypes.VerticalAlignmentType[] = ['stretch', 'top', 'middle', 'bottom']; //var hAligns = ["stretch", "left", "center", "right"]; var count = 0; - btn.on(buttons.Button.tapEvent, function () { + btn.on(buttons.tapEvent, function () { //page.css = "button { vertical-align:" + vAligns[(count++) % 4] + " }"; btn.verticalAlignment = vAligns[count++ % 4]; }); diff --git a/apps/automated/src/pages/page8.ts b/apps/automated/src/pages/page8.ts index 8d8687d82c..94cce4df33 100644 --- a/apps/automated/src/pages/page8.ts +++ b/apps/automated/src/pages/page8.ts @@ -41,7 +41,7 @@ export function createPage() { var counter = 0; var btn = new btns.Button(); btn.text = 'tap'; - btn.on(btns.Button.tapEvent, function () { + btn.on(btns.tapEvent, function () { btn.text = 'hi: ' + counter++; }); btn.isEnabled = false; @@ -52,7 +52,7 @@ export function createPage() { var info = new btns.Button(); info.text = 'info'; info.className = 'info'; - info.on(btns.Button.tapEvent, function () { + info.on(btns.tapEvent, function () { info.text = 'hi: ' + counter++; btn.isEnabled = true; }); diff --git a/apps/automated/src/pages/property-bindings.ts b/apps/automated/src/pages/property-bindings.ts index 12a9ec9fcd..e57e6defc7 100644 --- a/apps/automated/src/pages/property-bindings.ts +++ b/apps/automated/src/pages/property-bindings.ts @@ -41,7 +41,7 @@ export function createPage() { var count = 0; var control = new btns.Button(); control.text = 'test control'; - control.on(btns.Button.tapEvent, (data) => { + control.on(btns.tapEvent, (data) => { control.text = 'count: ' + count++; }); grid.addChild(control); diff --git a/apps/automated/src/ui/animation/animation-tests.ts b/apps/automated/src/ui/animation/animation-tests.ts index ad75839ce4..49798955b5 100644 --- a/apps/automated/src/ui/animation/animation-tests.ts +++ b/apps/automated/src/ui/animation/animation-tests.ts @@ -267,15 +267,6 @@ export function test_AnimateOpacity(done) { }); } -export function test_AnimateOpacity_ShouldThrow_IfNotNumber() { - var label = new Label(); - helper.buildUIAndRunTest(label, (views: Array) => { - TKUnit.assertThrows(() => { - label.animate({ opacity: '0.75' }); - }, 'Setting opacity to a non number should throw.'); - }); -} - export function test_AnimateDelay_ShouldThrow_IfNotNumber() { var label = new Label(); helper.buildUIAndRunTest(label, (views: Array) => { @@ -303,15 +294,6 @@ export function test_AnimateIterations_ShouldThrow_IfNotNumber() { }); } -export function test_AnimateRotate_ShouldThrow_IfNotNumber() { - var label = new Label(); - helper.buildUIAndRunTest(label, (views: Array) => { - TKUnit.assertThrows(() => { - label.animate({ rotate: '1' }); - }, 'Setting rotate to a non number should throw.'); - }); -} - export function test_AnimateScale_ShouldThrow_IfNotPair() { var label = new Label(); helper.buildUIAndRunTest(label, (views: Array) => { diff --git a/apps/automated/src/ui/button/button-tests.ts b/apps/automated/src/ui/button/button-tests.ts index cc3dfd7036..3398916dfb 100644 --- a/apps/automated/src/ui/button/button-tests.ts +++ b/apps/automated/src/ui/button/button-tests.ts @@ -3,6 +3,7 @@ import * as helper from '../../ui-helper'; import { View, EventData, Button, Observable, Color, Page, FormattedString } from '@nativescript/core'; import * as buttonTestsNative from './button-tests-native'; import * as spanModule from '@nativescript/core/text/span'; +import { tapEvent } from '@nativescript/core/ui/button'; // >> button-require-others import { BindingOptions } from '@nativescript/core/ui/core/bindable'; @@ -100,7 +101,7 @@ var _testOnClick = function (views: Array) { var actualValue = false; // >> button-tap - button.on(Button.tapEvent, function (args: EventData) { + button.on(tapEvent, function (args: EventData) { // Do something // >> (hide) actualValue = true; diff --git a/apps/automated/src/ui/page/page-tests-common.ts b/apps/automated/src/ui/page/page-tests-common.ts index 00f5035d85..d33ca95dc7 100644 --- a/apps/automated/src/ui/page/page-tests-common.ts +++ b/apps/automated/src/ui/page/page-tests-common.ts @@ -181,7 +181,7 @@ function _test_PageNavigation_EventSequence(withTransition: boolean) { helper.navigateWithEntry(navigationEntry); helper.goBack(); - const expectedEventSequence = ['navigatingTo', 'loaded', 'navigatedTo', 'navigatingFrom', 'unloaded', 'navigatedFrom']; + const expectedEventSequence = ['navigatingTo', 'loaded', 'navigatedTo', 'navigatingFrom', 'navigatedFrom', 'unloaded']; TKUnit.arrayAssert(eventSequence, expectedEventSequence, 'Actual event sequence is not equal to expected. Actual: ' + eventSequence + '; Expected: ' + expectedEventSequence); } diff --git a/apps/automated/src/ui/root-view/mymodule/MyControl.ts b/apps/automated/src/ui/root-view/mymodule/MyControl.ts index dd0382909c..36df8b0695 100644 --- a/apps/automated/src/ui/root-view/mymodule/MyControl.ts +++ b/apps/automated/src/ui/root-view/mymodule/MyControl.ts @@ -13,7 +13,7 @@ export class MyControl extends stackLayoutModule.StackLayout { lbl.id = 'my-test-label'; var btn = new button.Button(); btn.text = 'Tap me!'; - btn.on(button.Button.tapEvent, (args: EventData) => { + btn.on(button.tapEvent, (args: EventData) => { lbl.text = 'Tap ' + counter++; }); diff --git a/apps/automated/src/ui/tab-view/tab-view-navigation-tests.ts b/apps/automated/src/ui/tab-view/tab-view-navigation-tests.ts index 225dac2892..33d1bf5f4b 100644 --- a/apps/automated/src/ui/tab-view/tab-view-navigation-tests.ts +++ b/apps/automated/src/ui/tab-view/tab-view-navigation-tests.ts @@ -7,7 +7,7 @@ import { Frame } from '@nativescript/core/ui/frame'; import { Page } from '@nativescript/core/ui/page'; import { ListView, ItemEventData } from '@nativescript/core/ui/list-view'; import { TabView, TabViewItem } from '@nativescript/core/ui/tab-view'; -import { Button } from '@nativescript/core/ui/button'; +import { Button, tapEvent } from '@nativescript/core/ui/button'; var ASYNC = 2; @@ -44,7 +44,7 @@ function _createListView(): ListView { var button =