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

View File

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

View File

@ -25,7 +25,7 @@ export interface HttpRequestOptions {
/**
* Gets or sets the request body.
*/
content?: string | FormData | ArrayBuffer;
content?: string | FormData | ArrayBuffer | Uint8Array<ArrayBufferLike>;
/**
* Gets or sets the request timeout in milliseconds.
@ -110,7 +110,7 @@ export function getString(arg: any): Promise<string> {
reject(e);
}
},
(e) => reject(e)
(e) => reject(e),
);
});
}
@ -126,7 +126,7 @@ export function getJSON<T>(arg: any): Promise<T> {
reject(e);
}
},
(e) => reject(e)
(e) => reject(e),
);
});
}
@ -143,7 +143,7 @@ export function getImage(arg: any): Promise<ImageSource> {
},
(err) => {
reject(err);
}
},
);
});
}
@ -159,7 +159,7 @@ export function getFile(arg: any, destinationFilePath?: string): Promise<any> {
reject(e);
}
},
(e) => reject(e)
(e) => reject(e),
);
});
}
@ -175,7 +175,7 @@ export function getBinary(arg: any): Promise<ArrayBuffer> {
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 {
return type === MemberType.Instance
? <any>function () {
return type === MemberType.Instance ? <any>function () {
const start = time();
try {
return fn.apply(this, arguments);
@ -119,8 +118,7 @@ function timelineProfileFunctionFactory<F extends Function>(fn: F, name: string,
const end = time();
console.log(`Timeline: Modules: ${name} ${this} (${start}ms. - ${end}ms.)`);
}
}
: function () {
} : <any>function () {
const start = time();
try {
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 getDefault: symbol;
public readonly setNative: symbol;
public readonly setNative: any;
public readonly defaultValueKey: symbol;
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 key = this.key;
const getDefault: symbol = this.getDefault;
const setNative: symbol = this.setNative;
const setNative: any = this.setNative;
const defaultValueKey = this.defaultValueKey;
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;
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 getDefault: symbol;
public readonly setNative: symbol;
public readonly setNative: any;
public readonly sourceKey: symbol;
public readonly defaultValueKey: symbol;
public readonly defaultValue: U;
@ -879,7 +879,7 @@ export class CssAnimationProperty<T extends Style, U> implements CssAnimationPro
public readonly cssLocalName: string;
public readonly getDefault: symbol;
public readonly setNative: symbol;
public readonly setNative: any;
public readonly register: (cls: { prototype }) => void;

View File

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

View File

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

View File

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

View File

@ -1,4 +1,3 @@
import { Style as StyleDefinition } from '.';
import { Color } from '../../../color';
import { Font, FontStyleType, FontWeightType, FontVariationSettingsType } from '../font';
import { Background } from '../background';
@ -35,7 +34,7 @@ export interface CommonLayoutParams {
verticalAlignment: CoreTypes.VerticalAlignmentType;
}
export class Style extends Observable implements StyleDefinition {
export class Style extends Observable {
private unscopedCssVariables = 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 {
return { value: this._defaultPaddingTop, unit: 'px' };
}
// @ts-expect-error
[paddingTopProperty.setNative](value: CoreTypes.LengthType) {
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 {
return { value: this._defaultPaddingRight, unit: 'px' };
}
// @ts-expect-error
[paddingRightProperty.setNative](value: CoreTypes.LengthType) {
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 {
return { value: this._defaultPaddingBottom, unit: 'px' };
}
// @ts-expect-error
[paddingBottomProperty.setNative](value: CoreTypes.LengthType) {
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 {
return { value: this._defaultPaddingLeft, unit: 'px' };
}
// @ts-expect-error
[paddingLeftProperty.setNative](value: CoreTypes.LengthType) {
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);
}
@ -497,7 +497,7 @@ export class FileReader {
public onprogress: (...args: any[]) => void;
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>>();
@ -505,7 +505,7 @@ export class FileReader {
return this._readyState;
}
public get result(): string | ArrayBuffer | null {
public get result(): string | ArrayBuffer | SharedArrayBuffer | null {
return this._result;
}