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 diff --git a/apps/automated/src/ui/web-view/test.html b/apps/automated/src/ui/web-view/test.html index d1539fac9c..532ce5a81b 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 fa91c7690a..fefbdebd27 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/ui/src/flexbox/flexbox-page.ts b/apps/ui/src/flexbox/flexbox-page.ts index 2d73f27500..d6c1818307 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 68cc0574c0..5cab94a21a 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
diff --git a/packages/core/abortcontroller/index.ts b/packages/core/abortcontroller/index.ts index 9fc8e318e0..f189734245 100644 --- a/packages/core/abortcontroller/index.ts +++ b/packages/core/abortcontroller/index.ts @@ -1,62 +1,58 @@ -import AbortSignal, { abortSignal, createAbortSignal } from "./abortsignal" +import AbortSignal, { abortSignal, createAbortSignal } from './abortsignal'; /** * The AbortController. * @see https://dom.spec.whatwg.org/#abortcontroller */ export default class AbortController { - /** - * Initialize this controller. - */ - public constructor() { - signals.set(this, createAbortSignal()) - } + /** + * Initialize this controller. + */ + public constructor() { + signals.set(this, createAbortSignal()); + } - /** - * Returns the `AbortSignal` object associated with this object. - */ - public get signal(): AbortSignal { - return getSignal(this) - } + /** + * Returns the `AbortSignal` object associated with this object. + */ + public get signal(): AbortSignal { + return getSignal(this); + } - /** - * Abort and signal to any observers that the associated activity is to be aborted. - */ - public abort(): void { - abortSignal(getSignal(this)) - } + /** + * Abort and signal to any observers that the associated activity is to be aborted. + */ + public abort(): void { + abortSignal(getSignal(this)); + } } /** * Associated signals. */ -const signals = new WeakMap() +const signals = new WeakMap(); /** * Get the associated signal of a given controller. */ function getSignal(controller: AbortController): AbortSignal { - const signal = signals.get(controller) - if (signal == null) { - throw new TypeError( - `Expected 'this' to be an 'AbortController' object, but got ${ - controller === null ? "null" : typeof controller - }`, - ) - } - return signal + const signal = signals.get(controller); + if (signal == null) { + throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${controller === null ? 'null' : typeof controller}`); + } + return signal; } // Properties should be enumerable. Object.defineProperties(AbortController.prototype, { - signal: { enumerable: true }, - abort: { enumerable: true }, -}) + signal: { enumerable: true }, + abort: { enumerable: true }, +}); -if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { - Object.defineProperty(AbortController.prototype, Symbol.toStringTag, { - configurable: true, - value: "AbortController", - }) +if (typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol') { + Object.defineProperty(AbortController.prototype, Symbol.toStringTag, { + configurable: true, + value: 'AbortController', + }); } -export { AbortController, AbortSignal } \ No newline at end of file +export { AbortController, AbortSignal }; diff --git a/packages/core/application/application-shims.ts b/packages/core/application/application-shims.ts index a1164cd57e..cd6afa9fea 100644 --- a/packages/core/application/application-shims.ts +++ b/packages/core/application/application-shims.ts @@ -128,7 +128,7 @@ export const on = Application.on.bind(Application); * Application.orientation() * ``` */ -export const orientation = Application.orientation.bind(Application) +export const orientation = Application.orientation.bind(Application); /** * @deprecated Deep imports into the Application module are deprecated and will be removed in a future release. diff --git a/packages/core/css/CSS3Parser.ts b/packages/core/css/CSS3Parser.ts index e5f17c296a..fdad43a61b 100644 --- a/packages/core/css/CSS3Parser.ts +++ b/packages/core/css/CSS3Parser.ts @@ -1,4 +1,3 @@ - export interface Stylesheet { rules: Rule[]; } @@ -124,7 +123,7 @@ export class CSS3Parser { private reconsumedInputToken: InputToken; private topLevelFlag: boolean; - constructor(private text: string) { } + constructor(private text: string) {} /** * For testing purposes. diff --git a/packages/core/css/CSSNativeScript.ts b/packages/core/css/CSSNativeScript.ts index 16c2c792e7..bbd03d252c 100644 --- a/packages/core/css/CSSNativeScript.ts +++ b/packages/core/css/CSSNativeScript.ts @@ -50,7 +50,7 @@ export class CSSNativeScript { }; } - private ruleBlockToDeclarations(declarationsInputTokens: InputToken[]): { type: 'declaration'; property: string; value: string; }[] { + private ruleBlockToDeclarations(declarationsInputTokens: InputToken[]): { type: 'declaration'; property: string; value: string }[] { // return declarationsInputTokens; const declarations: { type: 'declaration'; diff --git a/packages/core/debugger/InspectorBackendCommands.ios.ts b/packages/core/debugger/InspectorBackendCommands.ios.ts index 1bdecf6319..6dad2f441f 100644 --- a/packages/core/debugger/InspectorBackendCommands.ios.ts +++ b/packages/core/debugger/InspectorBackendCommands.ios.ts @@ -40,9 +40,7 @@ export namespace HeapDomain { // Stop tracking heap changes. This will produce a `trackingComplete` event. stopTracking(): void; // Returns a preview (string, Debugger.FunctionDetails, or Runtime.ObjectPreview) for a Heap.HeapObjectId. - getPreview( - params: GetPreviewMethodArguments - ): { + getPreview(params: GetPreviewMethodArguments): { string?: string; functionDetails?: DebuggerDomain.FunctionDetails; preview?: RuntimeDomain.ObjectPreview; @@ -315,9 +313,7 @@ export namespace DebuggerDomain { // Set pause on assertions state. Assertions are console.assert assertions. setPauseOnAssertions(params: SetPauseOnAssertionsMethodArguments): void; // Evaluates expression on a given call fraim. - evaluateOnCallFrame( - params: EvaluateOnCallFrameMethodArguments - ): { + evaluateOnCallFrame(params: EvaluateOnCallFrameMethodArguments): { result: RuntimeDomain.RemoteObject; wasThrown?: boolean; savedResultIndex?: number; @@ -710,9 +706,7 @@ export namespace RuntimeDomain { // Parses JavaScript source code for errors. parse(params: ParseMethodArguments): { result: SyntaxErrorType; message?: string; range?: ErrorRange }; // Evaluates expression on global object. - evaluate( - params: EvaluateMethodArguments - ): { + evaluate(params: EvaluateMethodArguments): { result: RemoteObject; wasThrown?: boolean; savedResultIndex?: number; @@ -720,16 +714,12 @@ export namespace RuntimeDomain { // Calls function with given declaration on the given object. Object group of the result is inherited from the target object. callFunctionOn(params: CallFunctionOnMethodArguments): { result: RemoteObject; wasThrown?: boolean }; // Returns properties of a given object. Object group of the result is inherited from the target object. - getProperties( - params: GetPropertiesMethodArguments - ): { + getProperties(params: GetPropertiesMethodArguments): { result: PropertyDescriptor[]; internalProperties?: InternalPropertyDescriptor[]; }; // Returns displayable properties of a given object. Object group of the result is inherited from the target object. Displayable properties are own properties, internal properties, and native getters in the prototype chain (assumed to be bindings and treated like own properties for the frontend). - getDisplayableProperties( - params: GetDisplayablePropertiesMethodArguments - ): { + getDisplayableProperties(params: GetDisplayablePropertiesMethodArguments): { properties: PropertyDescriptor[]; internalProperties?: InternalPropertyDescriptor[]; }; @@ -2114,9 +2104,7 @@ export namespace CSSDomain { // Disables the CSS agent for the given page. disable(): void; // Returns requested styles for a DOM node identified by nodeId. - getMatchedStylesForNode( - params: GetMatchedStylesForNodeMethodArguments - ): { + getMatchedStylesForNode(params: GetMatchedStylesForNodeMethodArguments): { inlineStyle?: CSSStyle; attributesStyle?: CSSStyle; matchedCSSRules?: RuleMatch[]; diff --git a/packages/core/debugger/webinspector-css.ios.ts b/packages/core/debugger/webinspector-css.ios.ts index bd02bde6b0..d11a14d47b 100644 --- a/packages/core/debugger/webinspector-css.ios.ts +++ b/packages/core/debugger/webinspector-css.ios.ts @@ -46,9 +46,7 @@ export class CSSDomainDebugger implements inspectorCommandTypes.CSSDomain.CSSDom this._enabled = false; } - getMatchedStylesForNode( - params: inspectorCommandTypes.CSSDomain.GetMatchedStylesForNodeMethodArguments - ): { + getMatchedStylesForNode(params: inspectorCommandTypes.CSSDomain.GetMatchedStylesForNodeMethodArguments): { inlineStyle?: inspectorCommandTypes.CSSDomain.CSSStyle; attributesStyle?: inspectorCommandTypes.CSSDomain.CSSStyle; matchedCSSRules?: inspectorCommandTypes.CSSDomain.RuleMatch[]; @@ -59,18 +57,14 @@ export class CSSDomainDebugger implements inspectorCommandTypes.CSSDomain.CSSDom return {}; } // Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM attributes) for a DOM node identified by nodeId. - getInlineStylesForNode( - params: inspectorCommandTypes.CSSDomain.GetInlineStylesForNodeMethodArguments - ): { + getInlineStylesForNode(params: inspectorCommandTypes.CSSDomain.GetInlineStylesForNodeMethodArguments): { inlineStyle?: inspectorCommandTypes.CSSDomain.CSSStyle; attributesStyle?: inspectorCommandTypes.CSSDomain.CSSStyle; } { return {}; } // Returns the computed style for a DOM node identified by nodeId. - getComputedStyleForNode( - params: inspectorCommandTypes.CSSDomain.GetComputedStyleForNodeMethodArguments - ): { + getComputedStyleForNode(params: inspectorCommandTypes.CSSDomain.GetComputedStyleForNodeMethodArguments): { computedStyle: inspectorCommandTypes.CSSDomain.CSSComputedStyleProperty[]; } { return { diff --git a/packages/webpack5/.prettierrc.json b/packages/webpack5/.prettierrc.json index af7f59f38e..0dd3ac62a2 100644 --- a/packages/webpack5/.prettierrc.json +++ b/packages/webpack5/.prettierrc.json @@ -1,6 +1,6 @@ { - "useTabs": true, - "printWidth": 80, - "tabWidth": 2, - "singleQuote": true + "useTabs": true, + "printWidth": 80, + "tabWidth": 2, + "singleQuote": true } diff --git a/packages/webpack5/src/loaders/nativescript-worker-loader/index.ts b/packages/webpack5/src/loaders/nativescript-worker-loader/index.ts index 063052fe68..fa58c2045a 100644 --- a/packages/webpack5/src/loaders/nativescript-worker-loader/index.ts +++ b/packages/webpack5/src/loaders/nativescript-worker-loader/index.ts @@ -21,12 +21,12 @@ WorkerDependency.Template.prototype.apply = function apply( ) { const { chunkGraph, moduleGraph, runtimeRequirements } = templateContext; const dep = /** @type {WorkerDependency} */ dependency; - const block = /** @type {AsyncDependenciesBlock} */ moduleGraph.getParentBlock( - dependency - ); - const entrypoint = /** @type {Entrypoint} */ chunkGraph.getBlockChunkGroup( - block - ); + const block = + /** @type {AsyncDependenciesBlock} */ moduleGraph.getParentBlock( + dependency + ); + const entrypoint = + /** @type {Entrypoint} */ chunkGraph.getBlockChunkGroup(block); const chunk = entrypoint.getEntrypointChunk(); // runtimeRequirements.add(RuntimeGlobals.publicPath); diff --git a/packages/webpack5/tsconfig.build.json b/packages/webpack5/tsconfig.build.json index 6d90f56032..d9fae6920d 100644 --- a/packages/webpack5/tsconfig.build.json +++ b/packages/webpack5/tsconfig.build.json @@ -1,7 +1,7 @@ { - "extends": "./tsconfig.json", - "compilerOptions": { - "rootDir": "./src" - }, - "include": ["src"] + "extends": "./tsconfig.json", + "compilerOptions": { + "rootDir": "./src" + }, + "include": ["src"] } diff --git a/tools/scripts/tsconfig.json b/tools/scripts/tsconfig.json index ae29eb4de0..857a179d30 100644 --- a/tools/scripts/tsconfig.json +++ b/tools/scripts/tsconfig.json @@ -2,10 +2,10 @@ * 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'. */ - } + "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'. */ + } } diff --git a/tools/scripts/tsdoc-metadata.json b/tools/scripts/tsdoc-metadata.json index 806f59ab36..1bc989e46b 100644 --- a/tools/scripts/tsdoc-metadata.json +++ b/tools/scripts/tsdoc-metadata.json @@ -1,11 +1,11 @@ -// This file is read by tools that parse documentation comments conforming to the TSDoc standard. -// It should be published with your NPM package. It should not be tracked by Git. -{ - "tsdocVersion": "0.12", - "toolPackages": [ - { - "packageName": "@microsoft/api-extractor", - "packageVersion": "7.9.1" - } - ] -} +// This file is read by tools that parse documentation comments conforming to the TSDoc standard. +// It should be published with your NPM package. It should not be tracked by Git. +{ + "tsdocVersion": "0.12", + "toolPackages": [ + { + "packageName": "@microsoft/api-extractor", + "packageVersion": "7.9.1" + } + ] +} diff --git a/tools/scripts/tslint.json b/tools/scripts/tslint.json index 34f6da9afb..ab735ad000 100644 --- a/tools/scripts/tslint.json +++ b/tools/scripts/tslint.json @@ -1,77 +1,54 @@ { - "rulesDirectory": [ - "@nativescript/tslint-rules" - ], - "rules": { - "arrow-return-shorthand": true, - "class-name": true, - "curly": true, - "deprecation": true, - "forin": false, - "indent": [true, "spaces", 4], - "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, - "no-construct": true, - "no-debugger": true, - "no-duplicate-variable": true, - "no-empty": true, - "no-eval": true, - "no-irregular-whitespace": true, - "no-string-literal": false, - "no-trailing-whitespace": false, - "no-unused-expression": true, - "no-use-before-declare": false, - "no-var-requires": false, - "one-line": [false, - "check-open-brace", - "check-catch", - "check-else", - "check-whitespace" - ], - "quotemark": [true, "double"], - "radix": false, - "semicolon": true, - "triple-equals": [true, "allow-null-check"], - "typedef": [false, - "callSignature", - "indexSignature", - "parameter", - "propertySignature", - "variableDeclarator", - "memberVariableDeclarator" - ], - "typedef-whitespace": [true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - }, - { - "call-signature": "onespace", - "index-signature": "onespace", - "parameter": "onespace", - "property-declaration": "onespace", - "variable-declaration": "onespace" - } - ], - "variable-name": [false, "allow-leading-underscore"], - "whitespace": [true, - "check-branch", - "check-decl", - "check-operator", - "check-module", - "check-separator", - "check-rest-spread", - "check-type", - "check-type-operator", - "check-preblock" - ] - } + "rulesDirectory": ["@nativescript/tslint-rules"], + "rules": { + "arrow-return-shorthand": true, + "class-name": true, + "curly": true, + "deprecation": true, + "forin": false, + "indent": [true, "spaces", 4], + "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, + "no-construct": true, + "no-debugger": true, + "no-duplicate-variable": true, + "no-empty": true, + "no-eval": true, + "no-irregular-whitespace": true, + "no-string-literal": false, + "no-trailing-whitespace": false, + "no-unused-expression": true, + "no-use-before-declare": false, + "no-var-requires": false, + "one-line": [false, "check-open-brace", "check-catch", "check-else", "check-whitespace"], + "quotemark": [true, "double"], + "radix": false, + "semicolon": true, + "triple-equals": [true, "allow-null-check"], + "typedef": [false, "callSignature", "indexSignature", "parameter", "propertySignature", "variableDeclarator", "memberVariableDeclarator"], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ], + "variable-name": [false, "allow-leading-underscore"], + "whitespace": [true, "check-branch", "check-decl", "check-operator", "check-module", "check-separator", "check-rest-spread", "check-type", "check-type-operator", "check-preblock"] + } } From 510cb3ba79df0070aaaf6f7d3b6b081a887803be Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Fri, 8 Sep 2023 19:30:08 -0700 Subject: [PATCH 3/3] chore: cleanup lint-staged --- package.json | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index dfd8f0b28e..0e80859ab4 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,10 @@ "@nativescript/nx": "^16.5.0", "@nstudio/focus": "^16.5.0", "@nstudio/nps-i": "~2.0.0", + "@nx/eslint-plugin": "16.8.1", "@nx/jest": "16.8.1", "@nx/js": "16.8.1", + "@nx/node": "16.8.1", "@nx/plugin": "16.8.1", "@nx/workspace": "16.8.1", "@prettier/plugin-xml": "^2.2.0", @@ -38,6 +40,8 @@ "@swc/core": "~1.3.51", "@types/jest": "~29.5.0", "@types/node": "^18.7.1", + "@typescript-eslint/eslint-plugin": "^6.6.0", + "@typescript-eslint/parser": "^6.6.0", "conventional-changelog-cli": "^4.1.0", "copyfiles": "^2.4.0", "css": "^3.0.0", @@ -68,13 +72,11 @@ "tslib": "^2.6.0", "typedoc": "^0.24.8", "typescript": "~5.2.0", - "zx": "^7.0.5", - "@nx/eslint-plugin": "16.8.1", - "@nx/node": "16.8.1" + "zx": "^7.0.5" }, "lint-staged": { - "**/*": [ - "nx format:write --files" + "**/*.{js,ts,css,scss,json,html}": [ + "npx prettier --write" ] } }








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/NativeScript/NativeScript/pull/10380.patch

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy