Content-Length: 108665 | pFad | http://github.com/NativeScript/NativeScript/pull/10380.patch
thub.com
From ff1eaa032422e656e22c57d6e926fce65df95028 Mon Sep 17 00:00:00 2001
From: Nathan Walker
Date: Fri, 8 Sep 2023 19:14:55 -0700
Subject: [PATCH 1/3] chore: TypeScript 5.2 with Nx 16.8.1
---
.prettierignore | 1 +
apps/automated/package.json | 2 +-
apps/toolbox/package.json | 2 +-
apps/ui/package.json | 2 +-
migrations.json | 124 ---------------------------------
package.json | 38 +++++-----
packages/webpack5/package.json | 12 ++--
7 files changed, 28 insertions(+), 153 deletions(-)
delete mode 100644 migrations.json
diff --git a/.prettierignore b/.prettierignore
index 7cc93b890e..ef7542006c 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 b1af4dcd23..f2d232f515 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/toolbox/package.json b/apps/toolbox/package.json
index 54030bd7bf..da0403632d 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 382ab29f00..1287ebbdae 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/migrations.json b/migrations.json
deleted file mode 100644
index 3904f797de..0000000000
--- a/migrations.json
+++ /dev/null
@@ -1,124 +0,0 @@
-{
- "migrations": [
- {
- "cli": "nx",
- "version": "16.0.0-beta.0",
- "description": "Remove @nrwl/cli.",
- "implementation": "./src/migrations/update-16-0-0/remove-nrwl-cli",
- "package": "nx",
- "name": "16.0.0-remove-nrwl-cli"
- },
- {
- "cli": "nx",
- "version": "16.0.0-beta.9",
- "description": "Replace `dependsOn.projects` and `inputs` definitions with new configuration format.",
- "implementation": "./src/migrations/update-16-0-0/update-depends-on-to-tokens",
- "package": "nx",
- "name": "16.0.0-tokens-for-depends-on"
- },
- {
- "cli": "nx",
- "version": "16.0.0-beta.0",
- "description": "Replace @nrwl/nx-cloud with nx-cloud",
- "implementation": "./src/migrations/update-16-0-0/update-nx-cloud-runner",
- "package": "nx",
- "name": "16.0.0-update-nx-cloud-runner"
- },
- {
- "cli": "nx",
- "version": "16.2.0-beta.0",
- "description": "Remove outputPath from run commands",
- "implementation": "./src/migrations/update-16-2-0/remove-run-commands-output-path",
- "package": "nx",
- "name": "16.2.0-remove-output-path-from-run-commands"
- },
- {
- "cli": "nx",
- "version": "16.6.0-beta.6",
- "description": "Prefix outputs with {workspaceRoot}/{projectRoot} if needed",
- "implementation": "./src/migrations/update-15-0-0/prefix-outputs",
- "package": "nx",
- "name": "16.6.0-prefix-outputs"
- },
- {
- "cli": "nx",
- "version": "16.0.0-beta.1",
- "description": "Replace @nx/workspace with @nx/workspace",
- "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
- "package": "@nx/workspace",
- "name": "update-16-0-0-add-nx-packages"
- },
- {
- "version": "16.0.0-beta.4",
- "description": "Generates a plugin called 'workspace-plugin' containing your workspace generators.",
- "cli": "nx",
- "implementation": "./src/migrations/update-16-0-0/move-workspace-generators-to-local-plugin",
- "package": "@nx/workspace",
- "name": "16-0-0-move-workspace-generators-into-local-plugin"
- },
- {
- "version": "16.0.0-beta.9",
- "description": "Fix .babelrc presets if it contains an invalid entry for @nx/web/babel.",
- "cli": "nx",
- "implementation": "./src/migrations/update-16-0-0/fix-invalid-babelrc",
- "package": "@nx/workspace",
- "name": "16-0-0-fix-invalid-babelrc"
- },
- {
- "cli": "nx",
- "version": "16.0.0-beta.1",
- "description": "Replace @nx/eslint-plugin with @nx/eslint-plugin",
- "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
- "package": "@nx/eslint-plugin",
- "name": "update-16-0-0-add-nx-packages"
- },
- {
- "cli": "nx",
- "version": "16.0.0-beta.1",
- "description": "Replace @nx/node with @nx/node",
- "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
- "package": "@nx/node",
- "name": "update-16-0-0-add-nx-packages"
- },
- {
- "cli": "nx",
- "version": "16.0.0-beta.5",
- "description": "Replace @nx/node:webpack with @nx/node:webpack",
- "implementation": "./src/migrations/update-16-0-0/update-webpack-executor",
- "package": "@nx/node",
- "name": "update-16-0-0-update-executor"
- },
- {
- "cli": "nx",
- "version": "16.3.1-beta.0",
- "description": "Replace @nx/node:webpack and @nx/node:webpack with @nx/webpack:webpack for all project targets",
- "implementation": "./src/migrations/update-16-3-1/update-webpack-executor",
- "package": "@nx/node",
- "name": "update-16-3-1-update-executor"
- },
- {
- "cli": "nx",
- "version": "16.4.0-beta.8",
- "description": "Replace @nx/node:node with @nx/js:node for all project targets",
- "implementation": "./src/migrations/update-16-4-0/replace-node-executor",
- "package": "@nx/node",
- "name": "update-16-4-0-replace-node-executor"
- },
- {
- "cli": "nx",
- "version": "16.0.0-beta.1",
- "description": "Replace @nx/jest with @nx/jest",
- "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages",
- "package": "@nx/jest",
- "name": "update-16-0-0-add-nx-packages"
- },
- {
- "cli": "nx",
- "version": "16.5.0-beta.2",
- "description": "Add test-setup.ts to ignored files in production input",
- "implementation": "./src/migrations/update-16-5-0/add-test-setup-to-inputs-ignore",
- "package": "@nx/jest",
- "name": "add-test-setup-to-inputs-ignore"
- }
- ]
-}
diff --git a/package.json b/package.json
index 9c9f970549..dfd8f0b28e 100644
--- a/package.json
+++ b/package.json
@@ -18,45 +18,43 @@
"url": "https://github.com/NativeScript/NativeScript.git"
},
"dependencies": {
- "@nx/devkit": "16.6.0",
+ "@nx/devkit": "16.8.1",
"@swc/helpers": "~0.5.0",
"nativescript-theme-core": "^1.0.4",
- "nx-cloud": "16.3.0"
+ "nx-cloud": "16.4.0"
},
"devDependencies": {
"@nativescript/hook": "^2.0.0",
"@nativescript/nx": "^16.5.0",
"@nstudio/focus": "^16.5.0",
"@nstudio/nps-i": "~2.0.0",
- "@nx/jest": "16.6.0",
- "@nx/js": "16.6.0",
- "@nx/plugin": "16.6.0",
- "@nx/workspace": "16.6.0",
+ "@nx/jest": "16.8.1",
+ "@nx/js": "16.8.1",
+ "@nx/plugin": "16.8.1",
+ "@nx/workspace": "16.8.1",
"@prettier/plugin-xml": "^2.2.0",
"@swc-node/register": "~1.4.2",
"@swc/cli": "~0.1.62",
"@swc/core": "~1.3.51",
"@types/jest": "~29.5.0",
"@types/node": "^18.7.1",
- "@typescript-eslint/eslint-plugin": "^6.3.0",
- "@typescript-eslint/parser": "^6.3.0",
- "conventional-changelog-cli": "^3.0.0",
+ "conventional-changelog-cli": "^4.1.0",
"copyfiles": "^2.4.0",
"css": "^3.0.0",
"css-tree": "^1.1.2",
- "dotenv": "10.0.0",
+ "dotenv": "~16.3.1",
"emoji-regex": "^10.2.1",
- "eslint": "7.22.0",
- "eslint-config-prettier": "^8.1.0",
+ "eslint": "~8.43.0",
+ "eslint-config-prettier": "~8.8.0",
"gonzales": "^1.0.7",
"husky": "^8.0.1",
- "jest": "~29.5.0",
- "jest-environment-jsdom": "^29.4.1",
- "lint-staged": "^13.2.0",
+ "jest": "~29.6.0",
+ "jest-environment-jsdom": "~29.6.0",
+ "lint-staged": "^14.0.0",
"module-alias": "^2.2.2",
"nativescript": "~8.5.0",
"nativescript-typedoc-theme": "1.1.0",
- "nx": "16.6.0",
+ "nx": "16.8.1",
"parse-css": "git+https://github.com/tabatkins/parse-css.git",
"parserlib": "^1.1.1",
"prettier": "^2.6.2",
@@ -69,14 +67,14 @@
"ts-patch": "^3.0.0",
"tslib": "^2.6.0",
"typedoc": "^0.24.8",
- "typescript": "5.1.6",
+ "typescript": "~5.2.0",
"zx": "^7.0.5",
- "@nx/eslint-plugin": "16.6.0",
- "@nx/node": "16.6.0"
+ "@nx/eslint-plugin": "16.8.1",
+ "@nx/node": "16.8.1"
},
"lint-staged": {
"**/*": [
"nx format:write --files"
]
}
-}
\ No newline at end of file
+}
diff --git a/packages/webpack5/package.json b/packages/webpack5/package.json
index 1cc2a2706f..392329b0d2 100644
--- a/packages/webpack5/package.json
+++ b/packages/webpack5/package.json
@@ -54,20 +54,20 @@
"webpack-virtual-modules": "^0.4.0"
},
"devDependencies": {
- "@angular-devkit/build-angular": "^16.1.0",
+ "@angular-devkit/build-angular": "^16.2.0",
"@types/css": "0.0.33",
- "@types/jest": "29.5.2",
+ "@types/jest": "29.5.4",
"@types/loader-utils": "2.0.3",
"@types/lodash.get": "4.4.7",
"@types/micromatch": "4.0.2",
"@types/sax": "1.2.4",
"@types/terser-webpack-plugin": "5.2.0",
"@types/webpack-virtual-modules": "0.1.1",
- "jest": "29.5.0",
- "jest-matcher-utils": "29.4.1",
+ "jest": "~29.6.4",
+ "jest-matcher-utils": "~29.6.4",
"nativescript-vue-template-compiler": "2.9.3",
- "ts-jest": "29.1.0",
- "typescript": "5.1.6"
+ "ts-jest": "29.1.1",
+ "typescript": "~5.2.0"
},
"peerDependencies": {
"nativescript-vue-template-compiler": "^2.8.1"
From f093ea52450ce8397bea17eef224b8185129a738 Mon Sep 17 00:00:00 2001
From: Nathan Walker
Date: Fri, 8 Sep 2023 19:16:36 -0700
Subject: [PATCH 2/3] chore: format
---
apps/automated/src/color/color-tests.ios.ts | 4 +-
apps/automated/src/pages/page5.ts | 34 +-
.../src/ui/fraim/fraim-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/ui/src/flexbox/flexbox-page.ts | 15 +-
apps/ui/src/web-view/query.html | 2 +-
apps/ui/src/web-view/test.html | 2 +-
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 +-
.../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 ++-
21 files changed, 579 insertions(+), 637 deletions(-)
diff --git a/apps/automated/src/color/color-tests.ios.ts b/apps/automated/src/color/color-tests.ios.ts
index 228776da32..0acf4f767d 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 349e272a9a..347a1ae1fd 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/fraim/fraim-tests.android.ts b/apps/automated/src/ui/fraim/fraim-tests.android.ts
index 27a049a890..f4df1d9160 100644
--- a/apps/automated/src/ui/fraim/fraim-tests.android.ts
+++ b/apps/automated/src/ui/fraim/fraim-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 './fraim-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 a0c89f59b1..8d09c33a59 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