fix: build scripts error

This commit is contained in:
xiaohuoni 2024-01-30 15:49:21 +08:00
parent 7f4eae3127
commit a3f7709c90
6 changed files with 10 additions and 11 deletions

View File

@ -70,6 +70,7 @@
"jest": "^25.5.4", "jest": "^25.5.4",
"jest-environment-jsdom-sixteen": "^1.0.3", "jest-environment-jsdom-sixteen": "^1.0.3",
"lint-staged": "^15.2.0", "lint-staged": "^15.2.0",
"openinula": "workspace:*",
"prettier": "^3.1.1", "prettier": "^3.1.1",
"rollup": "^2.75.5", "rollup": "^2.75.5",
"rollup-plugin-execute": "^1.1.1", "rollup-plugin-execute": "^1.1.1",

View File

@ -7,7 +7,7 @@
"types": "build/@types/index.d.ts", "types": "build/@types/index.d.ts",
"scripts": { "scripts": {
"demo-serve": "webpack serve --mode=development", "demo-serve": "webpack serve --mode=development",
"rollup-build": "rollup --config rollup.config.js && npm run build-types", "build": "rollup --config rollup.config.js && npm run build-types",
"build-types": "tsc -p tsconfig.json && rollup -c build-type.js", "build-types": "tsc -p tsconfig.json && rollup -c build-type.js",
"test": "jest --config jest.config.js", "test": "jest --config jest.config.js",
"test-c": "jest --coverage" "test-c": "jest --coverage"

View File

@ -26,9 +26,7 @@ export const fetchRequest = (config: IrRequestConfig): Promise<IrResponse> => {
const { const {
method = 'GET', method = 'GET',
baseURL, baseURL,
url,
params = null, params = null,
data = null,
headers = {}, headers = {},
responseType, responseType,
timeout = 0, timeout = 0,
@ -37,8 +35,8 @@ export const fetchRequest = (config: IrRequestConfig): Promise<IrResponse> => {
withCredentials = false, withCredentials = false,
onUploadProgress = null, onUploadProgress = null,
onDownloadProgress = null, onDownloadProgress = null,
signal,
} = config; } = config;
let { data = null, url, signal } = config;
const controller = new AbortController(); const controller = new AbortController();
if (!signal) { if (!signal) {

View File

@ -24,7 +24,6 @@ export const ieFetchRequest = (config: IrRequestConfig): Promise<IrResponse> =>
const { const {
method = 'get', method = 'get',
baseURL, baseURL,
url,
params = null, params = null,
data = null, data = null,
headers = {}, headers = {},
@ -34,7 +33,7 @@ export const ieFetchRequest = (config: IrRequestConfig): Promise<IrResponse> =>
cancelToken = null, cancelToken = null,
withCredentials = false, withCredentials = false,
} = config; } = config;
let { url } = config;
let controller: any; let controller: any;
let signal; let signal;

View File

@ -11,7 +11,10 @@
"declaration": true, "declaration": true,
"moduleResolution": "node", "moduleResolution": "node",
"sourceMap": true, "sourceMap": true,
"downlevelIteration": true "downlevelIteration": true,
"paths": {
"openinula": ["../packages/inula"],
}
}, },
"include": [ "include": [
"./src/**/*", "./src/**/*",

View File

@ -60,9 +60,7 @@ function newVirtualNode(tag: VNodeTag, key?: null | string, vNodeProps?: any, re
return new VNode(tag, vNodeProps, key as null | string, realNode); return new VNode(tag, vNodeProps, key as null | string, realNode);
} }
type FunctionType = typeof Function; function isClassComponent(comp: (...arg: any) => any) {
function isClassComponent(comp: FunctionType) {
// 如果使用 getPrototypeOf 方法获取构造函数,不能兼容业务组组件继承组件的使用方式,会误认为是函数组件 // 如果使用 getPrototypeOf 方法获取构造函数,不能兼容业务组组件继承组件的使用方式,会误认为是函数组件
// 如果使用静态属性,部分函数高阶组件会将类组件的静态属性复制到自身,导致误判为类组件 // 如果使用静态属性,部分函数高阶组件会将类组件的静态属性复制到自身,导致误判为类组件
// 既然已经兼容使用了该标识符,那么继续使用 // 既然已经兼容使用了该标识符,那么继续使用
@ -77,7 +75,7 @@ export function getLazyVNodeTag(lazyComp: any): string {
} else if (lazyComp !== undefined && lazyComp !== null && typeLazyMap[lazyComp.vtype]) { } else if (lazyComp !== undefined && lazyComp !== null && typeLazyMap[lazyComp.vtype]) {
return typeLazyMap[lazyComp.vtype]; return typeLazyMap[lazyComp.vtype];
} }
throw Error('Inula can\'t resolve the content of lazy'); throw Error("Inula can't resolve the content of lazy");
} }
// 创建processing // 创建processing