From 7c2938d2ac085834f7a475b31966977624b61638 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Sat, 9 Sep 2023 08:55:39 -0700 Subject: [PATCH] chore: TypeScript 5.2 with Nx 16.8.1 (#10380) --- .prettierignore | 1 + apps/automated/package.json | 2 +- apps/automated/src/color/color-tests.ios.ts | 4 +- apps/automated/src/pages/page5.ts | 34 +- .../src/ui/frame/frame-tests.android.ts | 1 - .../src/ui/web-view/test with spaces.html | 2 +- apps/automated/src/ui/web-view/test.html | 2 +- apps/automated/src/xml-declaration/tns.xsd | 848 +++++++++--------- apps/toolbox/package.json | 2 +- apps/ui/package.json | 2 +- apps/ui/src/flexbox/flexbox-page.ts | 15 +- apps/ui/src/web-view/query.html | 2 +- apps/ui/src/web-view/test.html | 2 +- migrations.json | 124 --- package.json | 46 +- packages/core/abortcontroller/index.ts | 72 +- .../core/application/application-shims.ts | 2 +- packages/core/css/CSS3Parser.ts | 3 +- packages/core/css/CSSNativeScript.ts | 2 +- .../debugger/InspectorBackendCommands.ios.ts | 24 +- .../core/debugger/webinspector-css.ios.ts | 12 +- packages/webpack5/.prettierrc.json | 8 +- packages/webpack5/package.json | 12 +- .../nativescript-worker-loader/index.ts | 12 +- packages/webpack5/tsconfig.build.json | 10 +- tools/scripts/tsconfig.json | 12 +- tools/scripts/tsdoc-metadata.json | 22 +- tools/scripts/tslint.json | 127 ++- 28 files changed, 612 insertions(+), 793 deletions(-) delete mode 100644 migrations.json diff --git a/.prettierignore b/.prettierignore index 7cc93b890..ef7542006 100644 --- a/.prettierignore +++ b/.prettierignore @@ -10,6 +10,7 @@ e2e js-libs platforms tests +apps/**/*.xml packages/types-android packages/types-ios packages/types-minimal diff --git a/apps/automated/package.json b/apps/automated/package.json index b1af4dcd2..f2d232f51 100644 --- a/apps/automated/package.json +++ b/apps/automated/package.json @@ -15,7 +15,7 @@ "@nativescript/ios": "~8.5.0", "@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz", "circular-dependency-plugin": "^5.2.2", - "typescript": "5.1.6" + "typescript": "~5.2.0" }, "gitHead": "c06800e52ee1a184ea2dffd12a6702aaa43be4e3", "readme": "NativeScript Application" diff --git a/apps/automated/src/color/color-tests.ios.ts b/apps/automated/src/color/color-tests.ios.ts index 228776da3..0acf4f767 100644 --- a/apps/automated/src/color/color-tests.ios.ts +++ b/apps/automated/src/color/color-tests.ios.ts @@ -6,7 +6,7 @@ import * as TKUnit from '../tk-unit'; export * from './color-tests-common'; -export function testFromIosColorWhite () { +export function testFromIosColorWhite() { // >> color-ios-white // Creates the white color const color = Color.fromIosColor(UIColor.whiteColor); @@ -17,4 +17,4 @@ export function testFromIosColorWhite () { TKUnit.assertEqual(color.b, 255, 'Color.b not properly parsed'); TKUnit.assertEqual(color.hex, '#FFFFFF', 'Color.hex not properly parsed'); TKUnit.assertEqual(color.argb, 0xffffffff, 'Color.argb not properly parsed'); -}; +} diff --git a/apps/automated/src/pages/page5.ts b/apps/automated/src/pages/page5.ts index 349e272a9..347a1ae1f 100644 --- a/apps/automated/src/pages/page5.ts +++ b/apps/automated/src/pages/page5.ts @@ -7,9 +7,7 @@ function printDeviceInfoAndroid() { console.log('android.os.Build.VERSION.SDK_INT = ' + android.os.Build.VERSION.SDK_INT); //android.os.Build.VERSION.SDK_INT = 19 console.log('android.os.Build.VERSION.CODENAME = ' + android.os.Build.VERSION.CODENAME); //android.os.Build.VERSION.CODENAME = REL console.log('android.os.Build.VERSION.RELEASE = ' + android.os.Build.VERSION.RELEASE); //android.os.Build.VERSION.RELEASE = 4.4.4 - var metrics: android.util.DisplayMetrics = Application.android.context - .getResources() - .getDisplayMetrics(); + var metrics: android.util.DisplayMetrics = Application.android.context.getResources().getDisplayMetrics(); console.log('metrics.density = ' + metrics.density); //metrics.density = 3 console.log('metrics.scaledDensity = ' + metrics.scaledDensity); //metrics.scaledDensity = 3 console.log('metrics.densityDpi = ' + metrics.densityDpi); //metrics.densityDpi = 480 @@ -22,12 +20,7 @@ function printDeviceInfoAndroid() { console.log('config.screenWidthDp = ' + config.screenWidthDp); console.log('config.screenHeightDp = ' + config.screenHeightDp); console.log('config.smallestScreenWidthDp = ' + config.smallestScreenWidthDp); - console.log( - 'config.orientation = ' + - (config.orientation === android.content.res.Configuration.ORIENTATION_PORTRAIT - ? 'portrait' - : 'ladscape') - ); + console.log('config.orientation = ' + (config.orientation === android.content.res.Configuration.ORIENTATION_PORTRAIT ? 'portrait' : 'ladscape')); } function printDeviceInfoIOS() { @@ -41,12 +34,7 @@ function printDeviceInfoIOS() { console.log('device.batteryLevel = ' + device.batteryLevel); //device.batteryLevel = -1 var screen = UIScreen.mainScreen; console.log('screen = ' + screen); - console.log( - 'screen.nativeBounds = ' + - screen.nativeBounds.size.width + - ', ' + - screen.nativeBounds.size.height - ); //screen.nativeBounds = 640, 1136 + console.log('screen.nativeBounds = ' + screen.nativeBounds.size.width + ', ' + screen.nativeBounds.size.height); //screen.nativeBounds = 640, 1136 console.log('screen.scale = ' + screen.scale); //screen.scale = 2 console.log('screen.nativeScale = ' + screen.nativeScale); //screen.nativeScale = 2 } @@ -58,19 +46,11 @@ function printTNSInfo() { console.log('platform.Device.sdkVersion = ' + platform.Device.sdkVersion); console.log('platform.Device.deviceType = ' + platform.Device.deviceType); - console.log( - 'platform.Screen.mainScreen.widthDIPs = ' + platform.Screen.mainScreen.widthDIPs - ); - console.log( - 'platform.Screen.mainScreen.heightDIPs = ' + platform.Screen.mainScreen.heightDIPs - ); + console.log('platform.Screen.mainScreen.widthDIPs = ' + platform.Screen.mainScreen.widthDIPs); + console.log('platform.Screen.mainScreen.heightDIPs = ' + platform.Screen.mainScreen.heightDIPs); console.log('platform.Screen.mainScreen.scale = ' + platform.Screen.mainScreen.scale); - console.log( - 'platform.Screen.mainScreen.widthPixels = ' + platform.Screen.mainScreen.widthPixels - ); - console.log( - 'platform.Screen.mainScreen.heightPixels = ' + platform.Screen.mainScreen.heightPixels - ); + console.log('platform.Screen.mainScreen.widthPixels = ' + platform.Screen.mainScreen.widthPixels); + console.log('platform.Screen.mainScreen.heightPixels = ' + platform.Screen.mainScreen.heightPixels); } function print() { diff --git a/apps/automated/src/ui/frame/frame-tests.android.ts b/apps/automated/src/ui/frame/frame-tests.android.ts index 27a049a89..f4df1d916 100644 --- a/apps/automated/src/ui/frame/frame-tests.android.ts +++ b/apps/automated/src/ui/frame/frame-tests.android.ts @@ -4,7 +4,6 @@ import { unsetValue } from '@nativescript/core/ui/core/view'; import { PercentLength } from '@nativescript/core/ui/styling/style-properties'; export * from './frame-tests-common'; - export function test_percent_width_and_height_set_to_page_support() { let topFrame = Frame.topmost(); let currentPage = topFrame.currentPage; diff --git a/apps/automated/src/ui/web-view/test with spaces.html b/apps/automated/src/ui/web-view/test with spaces.html index a0c89f59b..8d09c33a5 100644 --- a/apps/automated/src/ui/web-view/test with spaces.html +++ b/apps/automated/src/ui/web-view/test with spaces.html @@ -5,6 +5,6 @@ - TestÖ with Spaces + TestÖ with Spaces diff --git a/apps/automated/src/ui/web-view/test.html b/apps/automated/src/ui/web-view/test.html index d1539fac9..532ce5a81 100644 --- a/apps/automated/src/ui/web-view/test.html +++ b/apps/automated/src/ui/web-view/test.html @@ -6,6 +6,6 @@ - TestÖ + TestÖ diff --git a/apps/automated/src/xml-declaration/tns.xsd b/apps/automated/src/xml-declaration/tns.xsd index fa91c7690..fefbdebd2 100644 --- a/apps/automated/src/xml-declaration/tns.xsd +++ b/apps/automated/src/xml-declaration/tns.xsd @@ -1,11 +1,11 @@ - + - - - - + + + + @@ -14,318 +14,318 @@ - + - + - + - - - - + + + + - + - - + + - + - + - + - + - + - + - + - + - - - + + + - + - - + + - + - + - - + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - + - + - + - - - - - + + + + + - + - + - - - - - - - + + + + + + + - + - + - + - + - + - - - + + + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - - - - - + + + + + - + - - + + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - - - - - - - + + + + + + + @@ -333,24 +333,24 @@ - + - + - + - - - - - - - - + + + + + + + + @@ -359,43 +359,43 @@ - + - + - + - + - + - + - + - - + + - + - + - - + + @@ -403,56 +403,56 @@ - + - + - + - + - - - - - + + + + + - + - + - - - - - - + + + + + + - + - + - - - - + + + + @@ -463,46 +463,46 @@ - + - + - + - - - + + + - + - + - + - + - + - - - + + + @@ -518,11 +518,11 @@ - + - + @@ -531,97 +531,97 @@ - + - + - - - - + + + + - + - + - + - + - - + + - + - + - - + + - + - + - - - - - - + + + + + + - + - + - - + + - + - + - + @@ -629,149 +629,149 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -780,56 +780,56 @@ - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + diff --git a/apps/toolbox/package.json b/apps/toolbox/package.json index 54030bd7b..da0403632 100644 --- a/apps/toolbox/package.json +++ b/apps/toolbox/package.json @@ -15,6 +15,6 @@ "@nativescript/android": "~8.5.0", "@nativescript/ios": "~8.5.0", "@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz", - "typescript": "5.1.6" + "typescript": "~5.2.0" } } diff --git a/apps/ui/package.json b/apps/ui/package.json index 382ab29f0..1287ebbda 100644 --- a/apps/ui/package.json +++ b/apps/ui/package.json @@ -14,7 +14,7 @@ "@nativescript/android": "~8.5.0", "@nativescript/ios": "~8.5.0", "@nativescript/webpack": "file:../../dist/packages/nativescript-webpack.tgz", - "typescript": "5.1.6" + "typescript": "~5.2.0" }, "gitHead": "8ab7726d1ee9991706069c1359c552e67ee0d1a4", "readme": "NativeScript Application", diff --git a/apps/ui/src/flexbox/flexbox-page.ts b/apps/ui/src/flexbox/flexbox-page.ts index 2d73f2750..d6c181830 100644 --- a/apps/ui/src/flexbox/flexbox-page.ts +++ b/apps/ui/src/flexbox/flexbox-page.ts @@ -28,9 +28,18 @@ export function select(args) { let whenSelected = (handler) => (args) => lastSelection && handler(args); let setProperty = (setter) => (value) => setter(lastSelection, value); -let intHandler = (handler) => ({ object }) => handler(parseInt(object.text)); -let stringHandler = (handler) => ({ object }) => handler(object.text); -let booleanHandler = (handler) => ({ object }) => handler(object.text === 'true'); +let intHandler = + (handler) => + ({ object }) => + handler(parseInt(object.text)); +let stringHandler = + (handler) => + ({ object }) => + handler(object.text); +let booleanHandler = + (handler) => + ({ object }) => + handler(object.text === 'true'); export const order = whenSelected(intHandler(setProperty(FlexboxLayout.setOrder))); export const flexGrow = whenSelected(intHandler(setProperty(FlexboxLayout.setFlexGrow))); diff --git a/apps/ui/src/web-view/query.html b/apps/ui/src/web-view/query.html index 68cc0574c..5cab94a21 100644 --- a/apps/ui/src/web-view/query.html +++ b/apps/ui/src/web-view/query.html @@ -7,7 +7,7 @@

Result

-
No value yet
+
No value yet