From 46725cb9f3166912c8f5b42f1e0b1177158c1ee3 Mon Sep 17 00:00:00 2001 From: akirakai Date: Tue, 22 Feb 2022 16:04:17 +0800 Subject: [PATCH] fix: fix tsconfig of material-parser --- modules/material-parser/package.json | 5 ++++- modules/material-parser/src/core/schema/types.ts | 14 +++++++------- modules/material-parser/tsconfig.json | 6 +++++- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/modules/material-parser/package.json b/modules/material-parser/package.json index fce170a69..4b3c4f160 100644 --- a/modules/material-parser/package.json +++ b/modules/material-parser/package.json @@ -1,6 +1,6 @@ { "name": "@alilc/lowcode-material-parser", - "version": "1.0.0", + "version": "1.0.1", "description": "material parser for Ali lowCode engine", "main": "lib/index.js", "files": [ @@ -61,5 +61,8 @@ "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" + }, + "engines": { + "node": ">=10.0.0" } } diff --git a/modules/material-parser/src/core/schema/types.ts b/modules/material-parser/src/core/schema/types.ts index 196032d2c..752cabc2f 100644 --- a/modules/material-parser/src/core/schema/types.ts +++ b/modules/material-parser/src/core/schema/types.ts @@ -41,13 +41,13 @@ export interface Npm { [k: string]: any; } export interface PropsSection { - props: { + props: Array<{ name: string; propType: PropType; description?: string; defaultValue?: any; [k: string]: any; - }[]; + }>; [k: string]: any; } export interface RequiredType { @@ -56,7 +56,7 @@ export interface RequiredType { } export interface OneOf { type: 'oneOf'; - value: (string | number | boolean)[]; + value: Array; isRequired?: boolean; [k: string]: any; } @@ -80,19 +80,19 @@ export interface ObjectOf { } export interface Shape { type: 'shape'; - value: { + value: Array<{ name?: string; propType?: PropType; - }[]; + }>; isRequired?: boolean; [k: string]: any; } export interface Exact { type: 'exact'; - value: { + value: Array<{ name?: string; propType?: PropType; - }[]; + }>; isRequired?: boolean; [k: string]: any; } diff --git a/modules/material-parser/tsconfig.json b/modules/material-parser/tsconfig.json index d47e50fd1..02b7c4847 100644 --- a/modules/material-parser/tsconfig.json +++ b/modules/material-parser/tsconfig.json @@ -8,7 +8,11 @@ // skip type checking of declaration files "skipLibCheck": true, "baseUrl": "./packages", - "allowJs": true + "allowJs": true, + "outDir": "lib", + "lib": ["es2018"], + "module": "commonjs", + "target": "es2018" }, "exclude": ["**/test", "**/lib", "**/dist", "**/es", "node_modules", "schemas"], "include": ["src/**/*"]