From de5f45c656af5d9de5fa74b5bc1c9e3d8bd2db7a Mon Sep 17 00:00:00 2001 From: userjia Date: Sun, 21 May 2023 23:37:18 +0800 Subject: [PATCH] Fix compile problem roughly(node v16.14.2) --- packages/gi-assets-advance/tsconfig.json | 1 - packages/gi-assets-algorithm/tsconfig.json | 1 - .../src/components/ContentContainer/Component.tsx | 5 +++++ packages/gi-assets-basic/tsconfig.json | 1 - packages/gi-assets-galaxybase/tsconfig.json | 1 - packages/gi-assets-graphscope/tsconfig.json | 1 - packages/gi-assets-hugegraph/tsconfig.json | 1 - packages/gi-assets-neo4j/src/components/Connect.tsx | 2 ++ packages/gi-assets-neo4j/tsconfig.json | 1 - packages/gi-assets-scene/tsconfig.json | 1 - packages/gi-assets-testing/tsconfig.json | 1 - packages/gi-assets-tugraph/tsconfig.json | 1 - packages/gi-cli/templates/tsconfig.json | 1 - packages/gi-cli/tsconfig.json | 1 - packages/gi-common-components/tsconfig.json | 1 - packages/gi-sdk/src/GISDK.tsx | 1 + packages/gi-sdk/tsconfig.json | 1 - packages/gi-site/package.json | 2 +- packages/gi-theme-antd/tsconfig.json | 1 - packages/my-custom-server/tsconfig.json | 1 - 20 files changed, 9 insertions(+), 17 deletions(-) diff --git a/packages/gi-assets-advance/tsconfig.json b/packages/gi-assets-advance/tsconfig.json index d95a0baae..03bfcd415 100644 --- a/packages/gi-assets-advance/tsconfig.json +++ b/packages/gi-assets-advance/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "allowJs": true, - "declaration": true, "target": "es2015", "moduleResolution": "node", "jsx": "react", diff --git a/packages/gi-assets-algorithm/tsconfig.json b/packages/gi-assets-algorithm/tsconfig.json index ca08f6595..f02b61789 100644 --- a/packages/gi-assets-algorithm/tsconfig.json +++ b/packages/gi-assets-algorithm/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "allowJs": true, - "declaration": true, "target": "es2015", "moduleResolution": "node", "jsx": "react", diff --git a/packages/gi-assets-basic/src/components/ContentContainer/Component.tsx b/packages/gi-assets-basic/src/components/ContentContainer/Component.tsx index 15db005d5..f0a1cdba5 100755 --- a/packages/gi-assets-basic/src/components/ContentContainer/Component.tsx +++ b/packages/gi-assets-basic/src/components/ContentContainer/Component.tsx @@ -13,6 +13,7 @@ const ContentContainer: React.FunctionComponent = props => { const sortedComponents = React.useMemo(() => { return Object.values(assets.components || {}).filter(item => { + // @ts-ignore return componentKeys.indexOf(item.info.id) !== -1; }); }, [assets.components, componentKeys]); @@ -20,9 +21,11 @@ const ContentContainer: React.FunctionComponent = props => { const configMap = React.useMemo(() => { return Object.values(config.components || {}) .filter(item => { + // @ts-ignore return componentKeys.indexOf(item.id) !== -1; }) .reduce((acc, curr) => { + // @ts-ignore acc[curr.id] = curr.props; return acc; }, {}); @@ -31,8 +34,10 @@ const ContentContainer: React.FunctionComponent = props => { return ( <> {sortedComponents.map(item => { + // @ts-ignore const { component: Component, info } = item; const { id } = info; + // @ts-ignore const itemProps = configMap[id]; // @ts-ignore return ; diff --git a/packages/gi-assets-basic/tsconfig.json b/packages/gi-assets-basic/tsconfig.json index d95a0baae..03bfcd415 100644 --- a/packages/gi-assets-basic/tsconfig.json +++ b/packages/gi-assets-basic/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "allowJs": true, - "declaration": true, "target": "es2015", "moduleResolution": "node", "jsx": "react", diff --git a/packages/gi-assets-galaxybase/tsconfig.json b/packages/gi-assets-galaxybase/tsconfig.json index d95a0baae..03bfcd415 100644 --- a/packages/gi-assets-galaxybase/tsconfig.json +++ b/packages/gi-assets-galaxybase/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "allowJs": true, - "declaration": true, "target": "es2015", "moduleResolution": "node", "jsx": "react", diff --git a/packages/gi-assets-graphscope/tsconfig.json b/packages/gi-assets-graphscope/tsconfig.json index d95a0baae..03bfcd415 100644 --- a/packages/gi-assets-graphscope/tsconfig.json +++ b/packages/gi-assets-graphscope/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "allowJs": true, - "declaration": true, "target": "es2015", "moduleResolution": "node", "jsx": "react", diff --git a/packages/gi-assets-hugegraph/tsconfig.json b/packages/gi-assets-hugegraph/tsconfig.json index d95a0baae..03bfcd415 100644 --- a/packages/gi-assets-hugegraph/tsconfig.json +++ b/packages/gi-assets-hugegraph/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "allowJs": true, - "declaration": true, "target": "es2015", "moduleResolution": "node", "jsx": "react", diff --git a/packages/gi-assets-neo4j/src/components/Connect.tsx b/packages/gi-assets-neo4j/src/components/Connect.tsx index 00bc8e668..5aac5f506 100644 --- a/packages/gi-assets-neo4j/src/components/Connect.tsx +++ b/packages/gi-assets-neo4j/src/components/Connect.tsx @@ -5,6 +5,7 @@ import { connectNeo4jService } from '../services/Neo4jService'; import CollapseCard from './CollapseCard'; import './index.less'; +import LoadGraph from "./LoadGraph"; export interface ConnectProps { updateToken: () => void; @@ -46,6 +47,7 @@ const ConnectNeo4j: React.FC = ({ updateToken, token }) => { description: '请继续进入分析', }); updateToken(); + } else { notification.error({ message: '连接 Neo4j 数据库失败', diff --git a/packages/gi-assets-neo4j/tsconfig.json b/packages/gi-assets-neo4j/tsconfig.json index d95a0baae..03bfcd415 100644 --- a/packages/gi-assets-neo4j/tsconfig.json +++ b/packages/gi-assets-neo4j/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "allowJs": true, - "declaration": true, "target": "es2015", "moduleResolution": "node", "jsx": "react", diff --git a/packages/gi-assets-scene/tsconfig.json b/packages/gi-assets-scene/tsconfig.json index d95a0baae..03bfcd415 100644 --- a/packages/gi-assets-scene/tsconfig.json +++ b/packages/gi-assets-scene/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "allowJs": true, - "declaration": true, "target": "es2015", "moduleResolution": "node", "jsx": "react", diff --git a/packages/gi-assets-testing/tsconfig.json b/packages/gi-assets-testing/tsconfig.json index d95a0baae..03bfcd415 100644 --- a/packages/gi-assets-testing/tsconfig.json +++ b/packages/gi-assets-testing/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "allowJs": true, - "declaration": true, "target": "es2015", "moduleResolution": "node", "jsx": "react", diff --git a/packages/gi-assets-tugraph/tsconfig.json b/packages/gi-assets-tugraph/tsconfig.json index d95a0baae..03bfcd415 100644 --- a/packages/gi-assets-tugraph/tsconfig.json +++ b/packages/gi-assets-tugraph/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "allowJs": true, - "declaration": true, "target": "es2015", "moduleResolution": "node", "jsx": "react", diff --git a/packages/gi-cli/templates/tsconfig.json b/packages/gi-cli/templates/tsconfig.json index d95a0baae..03bfcd415 100644 --- a/packages/gi-cli/templates/tsconfig.json +++ b/packages/gi-cli/templates/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "allowJs": true, - "declaration": true, "target": "es2015", "moduleResolution": "node", "jsx": "react", diff --git a/packages/gi-cli/tsconfig.json b/packages/gi-cli/tsconfig.json index c10487a26..404ed25a9 100644 --- a/packages/gi-cli/tsconfig.json +++ b/packages/gi-cli/tsconfig.json @@ -1,7 +1,6 @@ { "compilerOptions": { "strict": true, - "declaration": true, "skipLibCheck": true, "baseUrl": "./" } diff --git a/packages/gi-common-components/tsconfig.json b/packages/gi-common-components/tsconfig.json index d95a0baae..03bfcd415 100644 --- a/packages/gi-common-components/tsconfig.json +++ b/packages/gi-common-components/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "allowJs": true, - "declaration": true, "target": "es2015", "moduleResolution": "node", "jsx": "react", diff --git a/packages/gi-sdk/src/GISDK.tsx b/packages/gi-sdk/src/GISDK.tsx index 6a1f5a33a..70fcc316b 100644 --- a/packages/gi-sdk/src/GISDK.tsx +++ b/packages/gi-sdk/src/GISDK.tsx @@ -14,6 +14,7 @@ import type { Props, State } from './typing'; import { GIComponentConfig } from './typing'; import { createUuid } from './process/common'; +// @ts-ignore let updateHistoryTimer: NodeJS.Timer; /** export */ diff --git a/packages/gi-sdk/tsconfig.json b/packages/gi-sdk/tsconfig.json index e924b0678..e9ac1ec17 100644 --- a/packages/gi-sdk/tsconfig.json +++ b/packages/gi-sdk/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "allowJs": true, - "declaration": true, "target": "es2015", "moduleResolution": "node", "jsx": "react", diff --git a/packages/gi-site/package.json b/packages/gi-site/package.json index 67e728b32..83a8d84b0 100644 --- a/packages/gi-site/package.json +++ b/packages/gi-site/package.json @@ -14,7 +14,7 @@ "build": "node scripts/pre-build.mjs && NODE_OPTIONS=--max_old_space_size=4096 umi build", "build:docker": "cd ../../ && npm run build:all:umd && cd packages/gi-site/ && BUILD_MODE=docker node scripts/pre-build.mjs && node scripts/copy-assets.mjs && BUILD_MODE=docker NODE_OPTIONS=--max_old_space_size=4096 umi build", "deploy": "node ./scripts/deploy.js", - "start": "node scripts/pre-build.mjs && cross-env NODE_OPTIONS=--max_old_space_size=4096 cross-env PORT=8000 umi dev" + "start": "node --experimental-json-modules scripts/pre-build.mjs && cross-env NODE_OPTIONS=--max_old_space_size=4096 cross-env PORT=8000 umi dev" }, "dependencies": { "@ant-design/charts": "^1.0.21", diff --git a/packages/gi-theme-antd/tsconfig.json b/packages/gi-theme-antd/tsconfig.json index b5ed574e0..9f91bb6f1 100644 --- a/packages/gi-theme-antd/tsconfig.json +++ b/packages/gi-theme-antd/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "allowJs": true, - "declaration": true, "target": "es2015", "moduleResolution": "node", "jsx": "react", diff --git a/packages/my-custom-server/tsconfig.json b/packages/my-custom-server/tsconfig.json index d95a0baae..03bfcd415 100644 --- a/packages/my-custom-server/tsconfig.json +++ b/packages/my-custom-server/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "allowJs": true, - "declaration": true, "target": "es2015", "moduleResolution": "node", "jsx": "react",