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;
}

View File

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

View File

@@ -17,58 +17,58 @@
},
"dependencies": {
"@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-stage3": "^4.0.0",
"ansi-colors": "^4.1.3",
"babel-loader": "^8.0.0",
"babel-loader": "^10.0.0",
"cli-highlight": "^2.0.0",
"commander": "^8.0.0",
"copy-webpack-plugin": "^9.0.0",
"commander": "^14.0.0",
"copy-webpack-plugin": "^13.0.0",
"css": "^3.0.0",
"css-loader": "^6.0.0",
"dotenv-webpack": "^7.0.0",
"fork-ts-checker-webpack-plugin": "^7.0.0",
"css-loader": "^7.0.0",
"dotenv-webpack": "^8.0.0",
"fork-ts-checker-webpack-plugin": "^9.0.0",
"loader-utils": "^2.0.0 || ^3.0.0",
"lodash.get": "^4.0.0",
"micromatch": "^4.0.0",
"postcss": "^8.0.0",
"postcss-import": "^14.0.0",
"postcss-loader": "^7.0.0",
"postcss-import": "^16.0.0",
"postcss-loader": "^8.0.0",
"raw-loader": "^4.0.0",
"react-refresh": "~0.14.0",
"react-refresh": "~0.17.0",
"sass": "^1.0.0",
"sass-loader": "^13.0.0",
"sass-loader": "^16.0.0",
"sax": "^1.0.0",
"semver": "^7.0.0 || ^6.0.0",
"source-map": "^0.7.0",
"terser-webpack-plugin": "^5.0.0",
"ts-dedent": "^2.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-bundle-analyzer": "^4.0.0",
"webpack-chain": "^6.0.0",
"webpack-cli": "^4.0.0",
"webpack-merge": "^5.0.0",
"webpack-cli": "^6.0.0",
"webpack-merge": "^6.0.0",
"webpack-virtual-modules": "^0.4.0"
},
"devDependencies": {
"@angular/compiler-cli": "^19.0.0",
"@angular-devkit/build-angular": "^19.0.0",
"@types/css": "0.0.33",
"@angular/compiler-cli": "^20.0.0",
"@angular-devkit/build-angular": "^20.0.0",
"@types/css": "0.0.38",
"@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/loader-utils": "2.0.6",
"@types/lodash.get": "4.4.9",
"@types/micromatch": "4.0.9",
"@types/sax": "1.2.7",
"@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-matcher-utils": "~29.7.0",
"nativescript-vue-template-compiler": "2.9.3",
"ts-jest": "29.2.5",
"typescript": "~5.6.0"
"ts-jest": "29.4.0",
"typescript": "~5.8.0"
},
"peerDependencies": {
"nativescript-vue-template-compiler": "^2.8.1"