chore: TypeScript 5.8, nx migrate, dep updates - bundler resolution

This commit is contained in:
Nathan Walker
2025-07-05 10:48:10 -07:00
parent 32f2dd14e1
commit 48b02ffd1f
23 changed files with 2733 additions and 1396 deletions

2
.gitignore vendored
View File

@ -60,3 +60,5 @@ ios-typings-prj
.nx/workspace-data .nx/workspace-data
vite.config.*.timestamp* vite.config.*.timestamp*
vitest.config.*.timestamp* vitest.config.*.timestamp*
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md

View File

@ -11,12 +11,12 @@
"nativescript-theme-core": "file:../../node_modules/nativescript-theme-core" "nativescript-theme-core": "file:../../node_modules/nativescript-theme-core"
}, },
"devDependencies": { "devDependencies": {
"@nativescript/android": "~8.8.0", "@nativescript/android": "~8.9.0",
"@nativescript/ios": "~8.8.0", "@nativescript/ios": "~8.9.0",
"@nativescript/visionos": "~8.8.0", "@nativescript/visionos": "~8.9.0",
"@nativescript/webpack": "file:../../dist/packages/webpack5", "@nativescript/webpack": "file:../../dist/packages/webpack5",
"circular-dependency-plugin": "^5.2.2", "circular-dependency-plugin": "^5.2.2",
"typescript": "~5.6.0" "typescript": "~5.8.0"
}, },
"gitHead": "c06800e52ee1a184ea2dffd12a6702aaa43be4e3", "gitHead": "c06800e52ee1a184ea2dffd12a6702aaa43be4e3",
"readme": "NativeScript Application" "readme": "NativeScript Application"

View File

@ -12,10 +12,10 @@
"nativescript-theme-core": "file:../../node_modules/nativescript-theme-core" "nativescript-theme-core": "file:../../node_modules/nativescript-theme-core"
}, },
"devDependencies": { "devDependencies": {
"@nativescript/android": "~8.8.0", "@nativescript/android": "~8.9.0",
"@nativescript/ios": "~8.8.0", "@nativescript/ios": "~8.9.0",
"@nativescript/visionos": "~8.8.0", "@nativescript/visionos": "~8.9.0",
"@nativescript/webpack": "file:../../dist/packages/webpack5", "@nativescript/webpack": "file:../../dist/packages/webpack5",
"typescript": "~5.6.0" "typescript": "~5.8.0"
} }
} }

View File

@ -11,11 +11,11 @@
"nativescript-theme-core": "file:../../node_modules/nativescript-theme-core" "nativescript-theme-core": "file:../../node_modules/nativescript-theme-core"
}, },
"devDependencies": { "devDependencies": {
"@nativescript/android": "~8.8.0", "@nativescript/android": "~8.9.0",
"@nativescript/ios": "~8.8.0", "@nativescript/ios": "~8.9.0",
"@nativescript/visionos": "~8.8.0", "@nativescript/visionos": "~8.9.0",
"@nativescript/webpack": "file:../../dist/packages/webpack5", "@nativescript/webpack": "file:../../dist/packages/webpack5",
"typescript": "~5.6.0" "typescript": "~5.8.0"
}, },
"gitHead": "8ab7726d1ee9991706069c1359c552e67ee0d1a4", "gitHead": "8ab7726d1ee9991706069c1359c552e67ee0d1a4",
"readme": "NativeScript Application", "readme": "NativeScript Application",

View File

@ -1,7 +1,14 @@
{ {
"migrations": [ "migrations": [
{ "version": "20.0.0-beta.7", "description": "Migration for v20.0.0-beta.7", "implementation": "./src/migrations/update-20-0-0/move-use-daemon-process", "package": "nx", "name": "move-use-daemon-process" }, { "version": "21.0.0-beta.8", "description": "Removes the legacy cache configuration from nx.json", "implementation": "./src/migrations/update-21-0-0/remove-legacy-cache", "package": "nx", "name": "remove-legacy-cache" },
{ "version": "20.0.1", "description": "Set `useLegacyCache` to true for migrating workspaces", "implementation": "./src/migrations/update-20-0-1/use-legacy-cache", "x-repair-skip": true, "package": "nx", "name": "use-legacy-cache" }, { "version": "21.0.0-beta.8", "description": "Removes the legacy cache configuration from nx.json", "implementation": "./src/migrations/update-21-0-0/remove-custom-tasks-runner", "package": "nx", "name": "remove-custom-tasks-runner" },
{ "cli": "nx", "version": "20.0.0-beta.5", "description": "replace getJestProjects with getJestProjectsAsync", "implementation": "./src/migrations/update-20-0-0/replace-getJestProjects-with-getJestProjectsAsync", "package": "@nx/jest", "name": "replace-getJestProjects-with-getJestProjectsAsync" } { "version": "21.0.0-beta.11", "description": "Updates release version config based on the breaking changes in Nx v21", "implementation": "./src/migrations/update-21-0-0/release-version-config-changes", "package": "nx", "name": "release-version-config-changes" },
{ "version": "21.0.0-beta.11", "description": "Updates release changelog config based on the breaking changes in Nx v21", "implementation": "./src/migrations/update-21-0-0/release-changelog-config-changes", "package": "nx", "name": "release-changelog-config-changes" },
{ "version": "21.1.0-beta.2", "description": "Adds **/nx-rules.mdc and **/nx.instructions.md to .gitignore if not present", "implementation": "./src/migrations/update-21-1-0/add-gitignore-entry", "package": "nx", "name": "21-1-0-add-ignore-entries-for-nx-rule-files" },
{ "version": "20.5.0-beta.2", "description": "Install jiti as a devDependency to allow vite to parse TS postcss files.", "implementation": "./src/migrations/update-20-5-0/install-jiti", "package": "@nx/vite", "name": "update-20-5-0-install-jiti" },
{ "version": "20.5.0-beta.3", "description": "Update resolve.conditions to include defaults that are no longer provided by Vite.", "implementation": "./src/migrations/update-20-5-0/update-resolve-conditions", "package": "@nx/vite", "name": "update-20-5-0-update-resolve-conditions" },
{ "version": "20.5.0-beta.3", "description": "Add vite config temporary files to the ESLint configuration ignore patterns if ESLint is used.", "implementation": "./src/migrations/update-20-5-0/eslint-ignore-vite-temp-files", "package": "@nx/vite", "name": "eslint-ignore-vite-temp-files" },
{ "cli": "nx", "version": "21.0.0-beta.9", "description": "Replace usage of `getJestProjects` with `getJestProjectsAsync`.", "implementation": "./src/migrations/update-21-0-0/replace-getJestProjects-with-getJestProjectsAsync", "package": "@nx/jest", "name": "replace-getJestProjects-with-getJestProjectsAsync-v21" },
{ "version": "21.0.0-beta.10", "description": "Remove the previously deprecated and unused `tsConfig` option from the `@nx/jest:jest` executor.", "implementation": "./src/migrations/update-21-0-0/remove-tsconfig-option-from-jest-executor", "package": "@nx/jest", "name": "remove-tsconfig-option-from-jest-executor" }
] ]
} }

49
nx.json
View File

@ -69,37 +69,17 @@
}, },
"$schema": "./node_modules/nx/schemas/nx-schema.json", "$schema": "./node_modules/nx/schemas/nx-schema.json",
"namedInputs": { "namedInputs": {
"default": [ "default": ["{projectRoot}/**/*", "sharedGlobals"],
"{projectRoot}/**/*", "sharedGlobals": ["{workspaceRoot}/workspace.json", "{workspaceRoot}/tsconfig.json", "{workspaceRoot}/nx.json"],
"sharedGlobals" "production": ["default", "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", "!{projectRoot}/tsconfig.spec.json", "!{projectRoot}/jest.config.[jt]s", "!{projectRoot}/src/test-setup.[jt]s"]
],
"sharedGlobals": [
"{workspaceRoot}/workspace.json",
"{workspaceRoot}/tsconfig.json",
"{workspaceRoot}/nx.json"
],
"production": [
"default",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/src/test-setup.[jt]s"
]
}, },
"targetDefaults": { "targetDefaults": {
"build": { "build": {
"inputs": [ "inputs": ["production", "^production"],
"production",
"^production"
],
"cache": true "cache": true
}, },
"test": { "test": {
"inputs": [ "inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"default",
"^production",
"{workspaceRoot}/jest.preset.js"
],
"cache": true "cache": true
}, },
"lint": { "lint": {
@ -115,11 +95,7 @@
"cache": true "cache": true
}, },
"@nx/jest:jest": { "@nx/jest:jest": {
"inputs": [ "inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"default",
"^production",
"{workspaceRoot}/jest.preset.js"
],
"cache": true, "cache": true,
"options": { "options": {
"passWithNoTests": true "passWithNoTests": true
@ -133,25 +109,16 @@
}, },
"@nx/vite:test": { "@nx/vite:test": {
"cache": true, "cache": true,
"inputs": [ "inputs": ["default", "^production"]
"default",
"^production"
]
} }
}, },
"useDaemonProcess": false, "useDaemonProcess": false,
"parallel": 1, "parallel": 1,
"useInferencePlugins": false, "useInferencePlugins": false,
"defaultBase": "master", "defaultBase": "master",
"useLegacyCache": true,
"release": { "release": {
"releaseTagPattern": "{version}-{projectName}", "releaseTagPattern": "{version}-{projectName}",
"projects": [ "projects": ["packages/*", "!packages/ui-mobile-base", "!packages/types-minimal", "!packages/winter-tc"],
"packages/*",
"!packages/ui-mobile-base",
"!packages/types-minimal",
"!packages/winter-tc"
],
"projectsRelationship": "independent", "projectsRelationship": "independent",
"changelog": { "changelog": {
"workspaceChangelog": false, "workspaceChangelog": false,

3685
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,109 +1,110 @@
{ {
"name": "nativescript", "name": "nativescript",
"version": "8.9.0", "version": "8.9.0",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"clean": "git clean -f -X -d --exclude=!.idea/ --exclude=!.vscode/* --exclude=!.npmrc", "clean": "git clean -f -X -d --exclude=!.idea/ --exclude=!.vscode/* --exclude=!.npmrc",
"clean.all": "npm run setup && nx run-many --target=clean --all", "clean.all": "npm run setup && nx run-many --target=clean --all",
"setup": "npm run clean && npm install", "setup": "npm run clean && npm install",
"setup:yarn": "yarn clean && yarn", "setup:yarn": "yarn clean && yarn",
"setup:pnpm": "pnpm run clean && pnpm install", "setup:pnpm": "pnpm run clean && pnpm install",
"postinstall": "ts-patch install && husky", "postinstall": "ts-patch install && husky",
"start": "nps" "start": "nps"
}, },
"private": true, "private": true,
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/NativeScript/NativeScript.git" "url": "https://github.com/NativeScript/NativeScript.git"
}, },
"dependencies": { "dependencies": {
"nativescript-theme-core": "^1.0.4" "nativescript-theme-core": "^1.0.4"
}, },
"devDependencies": { "devDependencies": {
"@csstools/css-calc": "~2.1.2", "@csstools/css-calc": "~2.1.2",
"@csstools/css-color-parser": "^3.0.8", "@csstools/css-color-parser": "^3.0.8",
"@csstools/css-parser-algorithms": "^3.0.4", "@csstools/css-parser-algorithms": "^3.0.4",
"@csstools/css-tokenizer": "^3.0.3", "@csstools/css-tokenizer": "^3.0.3",
"@nativescript/hook": "^2.0.0", "@nativescript/hook": "^2.0.0",
"@nativescript/nx": "^20.0.0", "@nativescript/nx": "^21.0.0",
"@nstudio/focus": "^20.0.2", "@nstudio/focus": "^20.0.2",
"@nstudio/nps-i": "~2.0.0", "@nstudio/nps-i": "~2.0.0",
"@nx/devkit": "20.3.0", "@nx/devkit": "21.2.1",
"@nx/eslint-plugin": "20.3.0", "@nx/eslint-plugin": "21.2.1",
"@nx/jest": "20.3.0", "@nx/jest": "21.2.1",
"@nx/js": "20.3.0", "@nx/js": "21.2.1",
"@nx/node": "20.3.0", "@nx/node": "21.2.1",
"@nx/plugin": "20.3.0", "@nx/plugin": "21.2.1",
"@nx/vite": "20.3.0", "@nx/vite": "21.2.1",
"@nx/web": "20.3.0", "@nx/web": "21.2.1",
"@nx/workspace": "20.3.0", "@nx/workspace": "21.2.1",
"@prettier/plugin-xml": "^3.4.1", "@prettier/plugin-xml": "^3.4.1",
"@swc-node/register": "~1.9.1", "@swc-node/register": "~1.10.1",
"@swc/core": "~1.5.7", "@swc/core": "~1.12.7",
"@swc/helpers": "~0.5.11", "@swc/helpers": "~0.5.17",
"@types/jest": "~29.5.0", "@types/jest": "~29.5.0",
"@types/node": "^20.0.0", "@types/node": "^20.0.0",
"@typescript-eslint/eslint-plugin": "^8.6.0", "@typescript-eslint/eslint-plugin": "^8.35.0",
"@typescript-eslint/parser": "^8.6.0", "@typescript-eslint/parser": "^8.35.0",
"@vitest/coverage-v8": "^1.0.4", "@vitest/coverage-v8": "^2.0.0",
"@vitest/ui": "^1.3.1", "@vitest/ui": "^2.0.0",
"acorn-stage3": "^4.0.0", "acorn": "^8.15.0",
"acorn": "^8.7.0", "acorn-stage3": "^4.0.0",
"copy-webpack-plugin": "^9.0.0", "copy-webpack-plugin": "^13.0.0",
"copyfiles": "^2.4.0", "copyfiles": "^2.4.0",
"css": "^3.0.0", "css": "^3.0.0",
"css-tree": "^1.1.2", "css-tree": "^1.1.2",
"css-what": "^6.1.0", "css-what": "^6.1.0",
"dotenv-webpack": "^7.0.0", "dotenv": "~16.4.0",
"dotenv": "~16.4.0", "dotenv-webpack": "^7.0.0",
"emoji-regex": "^10.3.0", "emoji-regex": "^10.3.0",
"enhanced-resolve": "^5.8.3", "enhanced-resolve": "^5.8.3",
"eslint": "~8.57.0", "eslint": "~8.57.0",
"eslint-config-prettier": "~9.1.0", "eslint-config-prettier": "^10.0.0",
"fork-ts-checker-webpack-plugin": "^7.0.0", "fork-ts-checker-webpack-plugin": "^7.0.0",
"gonzales": "^1.0.7", "gonzales": "^1.0.7",
"husky": "^9.0.0", "husky": "^9.0.0",
"jest": "~29.7.0", "jest": "~29.7.0",
"jest-environment-jsdom": "~29.7.0", "jest-environment-jsdom": "~29.7.0",
"jsdom": "~22.1.0", "jiti": "2.4.2",
"lint-staged": "^15.2.0", "jsdom": "~22.1.0",
"loader-utils": "^2.0.0 || ^3.0.0", "lint-staged": "^15.2.0",
"module-alias": "^2.2.2", "loader-utils": "^2.0.0 || ^3.0.0",
"nativescript": "~8.9.0", "module-alias": "^2.2.2",
"nativescript-typedoc-theme": "1.1.0", "nativescript": "~8.9.0",
"nx": "20.3.0", "nativescript-typedoc-theme": "1.1.0",
"parse-css": "git+https://github.com/tabatkins/parse-css.git", "nx": "21.2.1",
"parserlib": "^1.1.1", "parse-css": "git+https://github.com/tabatkins/parse-css.git",
"postcss": "^8.0.0", "parserlib": "^1.1.1",
"postcss-import": "^14.0.0", "postcss": "^8.0.0",
"postcss-loader": "^7.0.0", "postcss-import": "^16.0.0",
"prettier": "^3.2.5", "postcss-loader": "^8.0.0",
"sass": "^1.72.0", "prettier": "^3.2.5",
"shady-css-parser": "^0.1.0", "sass": "^1.72.0",
"terser-webpack-plugin": "^5.0.0", "shady-css-parser": "^0.1.0",
"tree-kill": "^1.2.2", "terser-webpack-plugin": "^5.0.0",
"ts-dedent": "^2.2.0", "tree-kill": "^1.2.2",
"ts-jest": "29.2.5", "ts-dedent": "^2.2.0",
"ts-loader": "^9.0.0", "ts-jest": "29.4.0",
"ts-node": "10.9.2", "ts-loader": "^9.0.0",
"ts-patch": "^3.0.0", "ts-node": "10.9.2",
"tslib": "^2.6.0", "ts-patch": "^3.0.0",
"typedoc": "^0.27.6", "tslib": "^2.6.0",
"typescript": "~5.6.0", "typedoc": "^0.28.6",
"vite": "^5.0.0", "typescript": "5.8.3",
"vitest": "^1.3.1", "vite": "^6.0.0",
"vue-loader": "^15.0.0 <= 15.9.8", "vitest": "^2.0.0",
"webpack-bundle-analyzer": "^4.0.0", "vue-loader": "^15.0.0 <= 15.9.8",
"webpack-chain": "^6.0.0", "webpack": "^5.30.0 <= 5.50.0 || ^5.51.2",
"webpack-cli": "^4.0.0", "webpack-bundle-analyzer": "^4.0.0",
"webpack-merge": "^5.0.0", "webpack-chain": "^6.0.0",
"webpack-virtual-modules": "^0.4.0", "webpack-cli": "^4.0.0",
"webpack": "^5.30.0 <= 5.50.0 || ^5.51.2", "webpack-merge": "^5.0.0",
"zx": "^8.3.0" "webpack-virtual-modules": "^0.4.0",
}, "zx": "^8.3.0"
"lint-staged": { },
"**/*.{js,ts,css,scss,json,html}": [ "lint-staged": {
"npx prettier --write" "**/*.{js,ts,css,scss,json,html}": [
] "npx prettier --write"
} ]
}
} }

View File

@ -1,7 +1,7 @@
{ {
"extends": "../../.eslintrc.json", "extends": "../../.eslintrc.json",
"rules": {}, "rules": {},
"ignorePatterns": ["!**/*", "**/global-types.d.ts", "**/node_modules/**/*", "**/__tests__/**/*"], "ignorePatterns": ["!**/*", "**/global-types.d.ts", "**/node_modules/**/*", "**/__tests__/**/*", "**/vite.config.*.timestamp*", "**/vitest.config.*.timestamp*"],
"overrides": [ "overrides": [
{ {
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],

View File

@ -25,7 +25,7 @@ export interface HttpRequestOptions {
/** /**
* Gets or sets the request body. * Gets or sets the request body.
*/ */
content?: string | FormData | ArrayBuffer; content?: string | FormData | ArrayBuffer | Uint8Array<ArrayBufferLike>;
/** /**
* Gets or sets the request timeout in milliseconds. * Gets or sets the request timeout in milliseconds.
@ -110,7 +110,7 @@ export function getString(arg: any): Promise<string> {
reject(e); reject(e);
} }
}, },
(e) => reject(e) (e) => reject(e),
); );
}); });
} }
@ -126,7 +126,7 @@ export function getJSON<T>(arg: any): Promise<T> {
reject(e); reject(e);
} }
}, },
(e) => reject(e) (e) => reject(e),
); );
}); });
} }
@ -143,7 +143,7 @@ export function getImage(arg: any): Promise<ImageSource> {
}, },
(err) => { (err) => {
reject(err); reject(err);
} },
); );
}); });
} }
@ -159,7 +159,7 @@ export function getFile(arg: any, destinationFilePath?: string): Promise<any> {
reject(e); reject(e);
} }
}, },
(e) => reject(e) (e) => reject(e),
); );
}); });
} }
@ -175,7 +175,7 @@ export function getBinary(arg: any): Promise<ArrayBuffer> {
reject(e); reject(e);
} }
}, },
(e) => reject(e) (e) => reject(e),
); );
}); });
} }

View File

@ -110,8 +110,7 @@ function countersProfileFunctionFactory<F extends Function>(fn: F, name: string,
} }
function timelineProfileFunctionFactory<F extends Function>(fn: F, name: string, type: MemberType = MemberType.Instance): F { function timelineProfileFunctionFactory<F extends Function>(fn: F, name: string, type: MemberType = MemberType.Instance): F {
return type === MemberType.Instance return type === MemberType.Instance ? <any>function () {
? <any>function () {
const start = time(); const start = time();
try { try {
return fn.apply(this, arguments); return fn.apply(this, arguments);
@ -119,8 +118,7 @@ function timelineProfileFunctionFactory<F extends Function>(fn: F, name: string,
const end = time(); const end = time();
console.log(`Timeline: Modules: ${name} ${this} (${start}ms. - ${end}ms.)`); console.log(`Timeline: Modules: ${name} ${this} (${start}ms. - ${end}ms.)`);
} }
} } : <any>function () {
: function () {
const start = time(); const start = time();
try { try {
return fn.apply(this, arguments); return fn.apply(this, arguments);

View File

@ -196,7 +196,7 @@ export class Property<T extends ViewBase, U> implements TypedPropertyDescriptor<
public readonly key: symbol; public readonly key: symbol;
public readonly getDefault: symbol; public readonly getDefault: symbol;
public readonly setNative: symbol; public readonly setNative: any;
public readonly defaultValueKey: symbol; public readonly defaultValueKey: symbol;
public readonly defaultValue: U; public readonly defaultValue: U;
@ -397,7 +397,7 @@ export class CoercibleProperty<T extends ViewBase, U> extends Property<T, U> imp
const propertyName = options.name; const propertyName = options.name;
const key = this.key; const key = this.key;
const getDefault: symbol = this.getDefault; const getDefault: symbol = this.getDefault;
const setNative: symbol = this.setNative; const setNative: any = this.setNative;
const defaultValueKey = this.defaultValueKey; const defaultValueKey = this.defaultValueKey;
const defaultValue: U = this.defaultValue; const defaultValue: U = this.defaultValue;
@ -598,7 +598,7 @@ export class InheritedProperty<T extends ViewBase, U> extends Property<T, U> imp
} }
} }
export class CssProperty<T extends Style, U> implements CssProperty<T, U> { export class CssProperty<T extends Style, U> {
private registered: boolean; private registered: boolean;
public readonly name: string; public readonly name: string;
@ -612,7 +612,7 @@ export class CssProperty<T extends Style, U> implements CssProperty<T, U> {
public readonly key: symbol; public readonly key: symbol;
public readonly getDefault: symbol; public readonly getDefault: symbol;
public readonly setNative: symbol; public readonly setNative: any;
public readonly sourceKey: symbol; public readonly sourceKey: symbol;
public readonly defaultValueKey: symbol; public readonly defaultValueKey: symbol;
public readonly defaultValue: U; public readonly defaultValue: U;
@ -879,7 +879,7 @@ export class CssAnimationProperty<T extends Style, U> implements CssAnimationPro
public readonly cssLocalName: string; public readonly cssLocalName: string;
public readonly getDefault: symbol; public readonly getDefault: symbol;
public readonly setNative: symbol; public readonly setNative: any;
public readonly register: (cls: { prototype }) => void; public readonly register: (cls: { prototype }) => void;

View File

@ -833,6 +833,7 @@ export class View extends ViewCommon {
this.setAccessibilityIdentifier(this.nativeViewProtected, value); this.setAccessibilityIdentifier(this.nativeViewProtected, value);
} }
// @ts-expect-error
[accessibilityRoleProperty.setNative](value: AccessibilityRole): void { [accessibilityRoleProperty.setNative](value: AccessibilityRole): void {
this.accessibilityRole = value; this.accessibilityRole = value;
updateAccessibilityProperties(this); updateAccessibilityProperties(this);
@ -865,6 +866,7 @@ export class View extends ViewCommon {
} }
} }
// @ts-expect-error
[accessibilityLiveRegionProperty.setNative](value: AccessibilityLiveRegion): void { [accessibilityLiveRegionProperty.setNative](value: AccessibilityLiveRegion): void {
switch (value) { switch (value) {
case AccessibilityLiveRegion.Assertive: { case AccessibilityLiveRegion.Assertive: {
@ -882,6 +884,7 @@ export class View extends ViewCommon {
} }
} }
// @ts-expect-error
[accessibilityStateProperty.setNative](value: AccessibilityState): void { [accessibilityStateProperty.setNative](value: AccessibilityState): void {
this.accessibilityState = value; this.accessibilityState = value;
updateAccessibilityProperties(this); updateAccessibilityProperties(this);
@ -974,6 +977,7 @@ export class View extends ViewCommon {
[horizontalAlignmentProperty.getDefault](): CoreTypes.HorizontalAlignmentType { [horizontalAlignmentProperty.getDefault](): CoreTypes.HorizontalAlignmentType {
return <CoreTypes.HorizontalAlignmentType>org.nativescript.widgets.ViewHelper.getHorizontalAlignment(this.nativeViewProtected); return <CoreTypes.HorizontalAlignmentType>org.nativescript.widgets.ViewHelper.getHorizontalAlignment(this.nativeViewProtected);
} }
// @ts-expect-error
[horizontalAlignmentProperty.setNative](value: CoreTypes.HorizontalAlignmentType) { [horizontalAlignmentProperty.setNative](value: CoreTypes.HorizontalAlignmentType) {
const nativeView = this.nativeViewProtected; const nativeView = this.nativeViewProtected;
const lp: any = nativeView.getLayoutParams() || new org.nativescript.widgets.CommonLayoutParams(); const lp: any = nativeView.getLayoutParams() || new org.nativescript.widgets.CommonLayoutParams();
@ -1014,6 +1018,7 @@ export class View extends ViewCommon {
[verticalAlignmentProperty.getDefault](): CoreTypes.VerticalAlignmentType { [verticalAlignmentProperty.getDefault](): CoreTypes.VerticalAlignmentType {
return <CoreTypes.VerticalAlignmentType>org.nativescript.widgets.ViewHelper.getVerticalAlignment(this.nativeViewProtected); return <CoreTypes.VerticalAlignmentType>org.nativescript.widgets.ViewHelper.getVerticalAlignment(this.nativeViewProtected);
} }
// @ts-expect-error
[verticalAlignmentProperty.setNative](value: CoreTypes.VerticalAlignmentType) { [verticalAlignmentProperty.setNative](value: CoreTypes.VerticalAlignmentType) {
const nativeView = this.nativeViewProtected; const nativeView = this.nativeViewProtected;
const lp: any = nativeView.getLayoutParams() || new org.nativescript.widgets.CommonLayoutParams(); const lp: any = nativeView.getLayoutParams() || new org.nativescript.widgets.CommonLayoutParams();

View File

@ -219,6 +219,7 @@ export class Image extends ImageBase {
} }
} }
// @ts-expect-error
[iosSymbolScaleProperty.setNative](value: iosSymbolScaleType) { [iosSymbolScaleProperty.setNative](value: iosSymbolScaleType) {
// reset src to configure scale // reset src to configure scale
this._setSrc(this.src); this._setSrc(this.src);

View File

@ -234,6 +234,7 @@ export class SearchBar extends SearchBarBase {
[textProperty.getDefault](): string { [textProperty.getDefault](): string {
return ''; return '';
} }
// @ts-expect-error
[textProperty.setNative](value: string) { [textProperty.setNative](value: string) {
const text = value === null || value === undefined ? '' : value.toString(); const text = value === null || value === undefined ? '' : value.toString();
this.nativeViewProtected.setQuery(text, false); this.nativeViewProtected.setQuery(text, false);
@ -241,6 +242,7 @@ export class SearchBar extends SearchBarBase {
[hintProperty.getDefault](): string { [hintProperty.getDefault](): string {
return null; return null;
} }
// @ts-expect-error
[hintProperty.setNative](value: string) { [hintProperty.setNative](value: string) {
if (value === null || value === undefined) { if (value === null || value === undefined) {
this.nativeViewProtected.setQueryHint(null); this.nativeViewProtected.setQueryHint(null);

View File

@ -3,12 +3,10 @@ import { SearchBarBase, textProperty, hintProperty, textFieldHintColorProperty,
import { isEnabledProperty } from '../core/view'; import { isEnabledProperty } from '../core/view';
import { Color } from '../../color'; import { Color } from '../../color';
import { colorProperty, backgroundColorProperty, backgroundInternalProperty, fontInternalProperty } from '../styling/style-properties'; import { colorProperty, backgroundColorProperty, backgroundInternalProperty, fontInternalProperty } from '../styling/style-properties';
import { iOSNativeHelper } from '../../utils'; import { SDK_VERSION } from '../../utils/constants';
export * from './search-bar-common'; export * from './search-bar-common';
const majorVersion = iOSNativeHelper.MajorVersion;
@NativeClass @NativeClass
class UISearchBarDelegateImpl extends NSObject implements UISearchBarDelegate { class UISearchBarDelegateImpl extends NSObject implements UISearchBarDelegate {
public static ObjCProtocols = [UISearchBarDelegate]; public static ObjCProtocols = [UISearchBarDelegate];
@ -62,7 +60,7 @@ class UISearchBarImpl extends UISearchBar {
sizeThatFits(size: CGSize): CGSize { sizeThatFits(size: CGSize): CGSize {
// iOS11 SDK does not support passing sizeThatFits(...) non-finite width value; // iOS11 SDK does not support passing sizeThatFits(...) non-finite width value;
// iOS layout system will take care to size the element properly when passed 0 // iOS layout system will take care to size the element properly when passed 0
if (majorVersion >= 11 && size.width === Number.POSITIVE_INFINITY) { if (SDK_VERSION >= 11 && size.width === Number.POSITIVE_INFINITY) {
size.width = 0; size.width = 0;
} }
@ -167,6 +165,7 @@ export class SearchBar extends SearchBarBase {
[textProperty.getDefault](): string { [textProperty.getDefault](): string {
return ''; return '';
} }
// @ts-expect-error
[textProperty.setNative](value: string) { [textProperty.setNative](value: string) {
const text = value === null || value === undefined ? '' : value.toString(); const text = value === null || value === undefined ? '' : value.toString();
this.ios.text = text; this.ios.text = text;
@ -175,6 +174,7 @@ export class SearchBar extends SearchBarBase {
[hintProperty.getDefault](): string { [hintProperty.getDefault](): string {
return ''; return '';
} }
// @ts-expect-error
[hintProperty.setNative](value: string) { [hintProperty.setNative](value: string) {
this._updateAttributedPlaceholder(); this._updateAttributedPlaceholder();
} }

View File

@ -1,4 +1,3 @@
import { Style as StyleDefinition } from '.';
import { Color } from '../../../color'; import { Color } from '../../../color';
import { Font, FontStyleType, FontWeightType, FontVariationSettingsType } from '../font'; import { Font, FontStyleType, FontWeightType, FontVariationSettingsType } from '../font';
import { Background } from '../background'; import { Background } from '../background';
@ -35,7 +34,7 @@ export interface CommonLayoutParams {
verticalAlignment: CoreTypes.VerticalAlignmentType; verticalAlignment: CoreTypes.VerticalAlignmentType;
} }
export class Style extends Observable implements StyleDefinition { export class Style extends Observable {
private unscopedCssVariables = new Map<string, string>(); private unscopedCssVariables = new Map<string, string>();
private scopedCssVariables = new Map<string, string>(); private scopedCssVariables = new Map<string, string>();

View File

@ -458,6 +458,7 @@ export class TextBase extends TextBaseCommon {
[paddingTopProperty.getDefault](): CoreTypes.LengthType { [paddingTopProperty.getDefault](): CoreTypes.LengthType {
return { value: this._defaultPaddingTop, unit: 'px' }; return { value: this._defaultPaddingTop, unit: 'px' };
} }
// @ts-expect-error
[paddingTopProperty.setNative](value: CoreTypes.LengthType) { [paddingTopProperty.setNative](value: CoreTypes.LengthType) {
org.nativescript.widgets.ViewHelper.setPaddingTop(this.nativeTextViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderTopWidth, 0)); org.nativescript.widgets.ViewHelper.setPaddingTop(this.nativeTextViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderTopWidth, 0));
} }
@ -465,6 +466,7 @@ export class TextBase extends TextBaseCommon {
[paddingRightProperty.getDefault](): CoreTypes.LengthType { [paddingRightProperty.getDefault](): CoreTypes.LengthType {
return { value: this._defaultPaddingRight, unit: 'px' }; return { value: this._defaultPaddingRight, unit: 'px' };
} }
// @ts-expect-error
[paddingRightProperty.setNative](value: CoreTypes.LengthType) { [paddingRightProperty.setNative](value: CoreTypes.LengthType) {
org.nativescript.widgets.ViewHelper.setPaddingRight(this.nativeTextViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderRightWidth, 0)); org.nativescript.widgets.ViewHelper.setPaddingRight(this.nativeTextViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderRightWidth, 0));
} }
@ -472,6 +474,7 @@ export class TextBase extends TextBaseCommon {
[paddingBottomProperty.getDefault](): CoreTypes.LengthType { [paddingBottomProperty.getDefault](): CoreTypes.LengthType {
return { value: this._defaultPaddingBottom, unit: 'px' }; return { value: this._defaultPaddingBottom, unit: 'px' };
} }
// @ts-expect-error
[paddingBottomProperty.setNative](value: CoreTypes.LengthType) { [paddingBottomProperty.setNative](value: CoreTypes.LengthType) {
org.nativescript.widgets.ViewHelper.setPaddingBottom(this.nativeTextViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderBottomWidth, 0)); org.nativescript.widgets.ViewHelper.setPaddingBottom(this.nativeTextViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderBottomWidth, 0));
} }
@ -479,6 +482,7 @@ export class TextBase extends TextBaseCommon {
[paddingLeftProperty.getDefault](): CoreTypes.LengthType { [paddingLeftProperty.getDefault](): CoreTypes.LengthType {
return { value: this._defaultPaddingLeft, unit: 'px' }; return { value: this._defaultPaddingLeft, unit: 'px' };
} }
// @ts-expect-error
[paddingLeftProperty.setNative](value: CoreTypes.LengthType) { [paddingLeftProperty.setNative](value: CoreTypes.LengthType) {
org.nativescript.widgets.ViewHelper.setPaddingLeft(this.nativeTextViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderLeftWidth, 0)); org.nativescript.widgets.ViewHelper.setPaddingLeft(this.nativeTextViewProtected, Length.toDevicePixels(value, 0) + Length.toDevicePixels(this.style.borderLeftWidth, 0));
} }

View File

@ -432,7 +432,7 @@ export class Blob {
} }
} }
public arrayBuffer(): Promise<ArrayBuffer> { public arrayBuffer() {
return Promise.resolve(this._buffer); return Promise.resolve(this._buffer);
} }
@ -497,7 +497,7 @@ export class FileReader {
public onprogress: (...args: any[]) => void; public onprogress: (...args: any[]) => void;
private _readyState: number; private _readyState: number;
private _result: string | ArrayBuffer | null; private _result: string | ArrayBuffer | SharedArrayBuffer | null;
private _listeners: Map<string, Array<Function>> = new Map<string, Array<Function>>(); private _listeners: Map<string, Array<Function>> = new Map<string, Array<Function>>();
@ -505,7 +505,7 @@ export class FileReader {
return this._readyState; return this._readyState;
} }
public get result(): string | ArrayBuffer | null { public get result(): string | ArrayBuffer | SharedArrayBuffer | null {
return this._result; return this._result;
} }

View File

@ -4,7 +4,7 @@
"baseUrl": ".", "baseUrl": ".",
"target": "ES2020", "target": "ES2020",
"module": "esnext", "module": "esnext",
"moduleResolution": "node", "moduleResolution": "bundler",
"outDir": "./dist", "outDir": "./dist",
"declaration": true, "declaration": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,

View File

@ -17,58 +17,58 @@
}, },
"dependencies": { "dependencies": {
"@babel/core": "^7.0.0", "@babel/core": "^7.0.0",
"@pmmmwh/react-refresh-webpack-plugin": "~0.5.7", "@pmmmwh/react-refresh-webpack-plugin": "~0.6.1",
"acorn": "^8.0.0", "acorn": "^8.0.0",
"acorn-stage3": "^4.0.0", "acorn-stage3": "^4.0.0",
"ansi-colors": "^4.1.3", "ansi-colors": "^4.1.3",
"babel-loader": "^8.0.0", "babel-loader": "^10.0.0",
"cli-highlight": "^2.0.0", "cli-highlight": "^2.0.0",
"commander": "^8.0.0", "commander": "^14.0.0",
"copy-webpack-plugin": "^9.0.0", "copy-webpack-plugin": "^13.0.0",
"css": "^3.0.0", "css": "^3.0.0",
"css-loader": "^6.0.0", "css-loader": "^7.0.0",
"dotenv-webpack": "^7.0.0", "dotenv-webpack": "^8.0.0",
"fork-ts-checker-webpack-plugin": "^7.0.0", "fork-ts-checker-webpack-plugin": "^9.0.0",
"loader-utils": "^2.0.0 || ^3.0.0", "loader-utils": "^2.0.0 || ^3.0.0",
"lodash.get": "^4.0.0", "lodash.get": "^4.0.0",
"micromatch": "^4.0.0", "micromatch": "^4.0.0",
"postcss": "^8.0.0", "postcss": "^8.0.0",
"postcss-import": "^14.0.0", "postcss-import": "^16.0.0",
"postcss-loader": "^7.0.0", "postcss-loader": "^8.0.0",
"raw-loader": "^4.0.0", "raw-loader": "^4.0.0",
"react-refresh": "~0.14.0", "react-refresh": "~0.17.0",
"sass": "^1.0.0", "sass": "^1.0.0",
"sass-loader": "^13.0.0", "sass-loader": "^16.0.0",
"sax": "^1.0.0", "sax": "^1.0.0",
"semver": "^7.0.0 || ^6.0.0", "semver": "^7.0.0 || ^6.0.0",
"source-map": "^0.7.0", "source-map": "^0.7.0",
"terser-webpack-plugin": "^5.0.0", "terser-webpack-plugin": "^5.0.0",
"ts-dedent": "^2.0.0", "ts-dedent": "^2.0.0",
"ts-loader": "^9.0.0", "ts-loader": "^9.0.0",
"vue-loader": "^15.0.0 <= 15.9.8", "vue-loader": "^17.0.0",
"webpack": "^5.30.0 <= 5.50.0 || ^5.51.2", "webpack": "^5.30.0 <= 5.50.0 || ^5.51.2",
"webpack-bundle-analyzer": "^4.0.0", "webpack-bundle-analyzer": "^4.0.0",
"webpack-chain": "^6.0.0", "webpack-chain": "^6.0.0",
"webpack-cli": "^4.0.0", "webpack-cli": "^6.0.0",
"webpack-merge": "^5.0.0", "webpack-merge": "^6.0.0",
"webpack-virtual-modules": "^0.4.0" "webpack-virtual-modules": "^0.4.0"
}, },
"devDependencies": { "devDependencies": {
"@angular/compiler-cli": "^19.0.0", "@angular/compiler-cli": "^20.0.0",
"@angular-devkit/build-angular": "^19.0.0", "@angular-devkit/build-angular": "^20.0.0",
"@types/css": "0.0.33", "@types/css": "0.0.38",
"@types/jest": "29.5.4", "@types/jest": "29.5.4",
"@types/loader-utils": "2.0.3", "@types/loader-utils": "2.0.6",
"@types/lodash.get": "4.4.7", "@types/lodash.get": "4.4.9",
"@types/micromatch": "4.0.2", "@types/micromatch": "4.0.9",
"@types/sax": "1.2.4", "@types/sax": "1.2.7",
"@types/terser-webpack-plugin": "5.2.0", "@types/terser-webpack-plugin": "5.2.0",
"@types/webpack-virtual-modules": "0.1.1", "@types/webpack-virtual-modules": "0.4.2",
"jest": "~29.7.0", "jest": "~29.7.0",
"jest-matcher-utils": "~29.7.0", "jest-matcher-utils": "~29.7.0",
"nativescript-vue-template-compiler": "2.9.3", "nativescript-vue-template-compiler": "2.9.3",
"ts-jest": "29.2.5", "ts-jest": "29.4.0",
"typescript": "~5.6.0" "typescript": "~5.8.0"
}, },
"peerDependencies": { "peerDependencies": {
"nativescript-vue-template-compiler": "^2.8.1" "nativescript-vue-template-compiler": "^2.8.1"

View File

@ -13,18 +13,18 @@ const packageJson = JSON.parse(fs.readFileSync(packagePath));
const npmPackageName = packageJson.name; const npmPackageName = packageJson.name;
console.log(`Building ${npmPackageName}...${publish ? 'and publishing.' : ''}`); console.log(`Building ${npmPackageName}...${publish ? 'and publishing.' : ''}`);
function cleanPackage() { // function cleanPackage() {
// helps remove unwanted properties which may be added by other tooling // // helps remove unwanted properties which may be added by other tooling
const packageJsonPath = path.resolve(rootDir, 'dist', 'packages', packageName, 'package.json'); // const packageJsonPath = path.resolve(rootDir, 'dist', 'packages', packageName, 'package.json');
let packageJson = fs.readFileSync(packageJsonPath, { encoding: 'utf-8' }); // let packageJson = fs.readFileSync(packageJsonPath, { encoding: 'utf-8' });
if (packageJson) { // if (packageJson) {
packageJson = parseJson(packageJson); // packageJson = parseJson(packageJson);
// we don't need module or type properties at the moment // // we don't need module or type properties at the moment
delete packageJson['module']; // delete packageJson['module'];
delete packageJson['type']; // delete packageJson['type'];
fs.writeFileSync(packageJsonPath, serializeJson(packageJson)); // fs.writeFileSync(packageJsonPath, serializeJson(packageJson));
} // }
} // }
cleanPackage(); // cleanPackage();
console.log(`${npmPackageName} ready to publish.`); console.log(`${npmPackageName} ready to publish.`);

View File

@ -6,7 +6,7 @@
"module": "esnext", "module": "esnext",
"sourceMap": true, "sourceMap": true,
"declaration": true, "declaration": true,
"moduleResolution": "node", "moduleResolution": "bundler",
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"noEmitOnError": true, "noEmitOnError": true,