Explorar o código

chore: default module resolution to bundler (#808)

* chore: default module resolution to bundler

* fix: build
chenjiawei.inizio hai 4 meses
pai
achega
ac4d03c5f7

+ 8 - 2
config/ts-config/tsconfig.flow.base.json

@@ -6,7 +6,7 @@
     "strictPropertyInitialization": false,
     "strict": true,
     "esModuleInterop": true,
-    "moduleResolution": "node",
+    "moduleResolution": "bundler",
     "skipLibCheck": true,
     "noUnusedLocals": true,
     "noImplicitAny": true,
@@ -14,6 +14,12 @@
     "allowJs": true,
     "resolveJsonModule": true,
     "jsx": "preserve",
-    "lib": ["es6", "dom", "es2020", "es2019.Array", "dom.iterable"],
+    "lib": [
+      "es6",
+      "dom",
+      "es2020",
+      "es2019.Array",
+      "dom.iterable"
+    ],
   }
 }

+ 0 - 1
packages/materials/coze-editor/tsconfig.json

@@ -2,7 +2,6 @@
   "extends": "@flowgram.ai/ts-config/tsconfig.flow.path.json",
   "compilerOptions": {
     "jsx": "react",
-    "moduleResolution": "bundler",
     "rootDir": "./src",
     "outDir": "./dist/types",
   },

+ 0 - 1
packages/materials/form-materials/tsconfig.json

@@ -2,7 +2,6 @@
   "extends": "@flowgram.ai/ts-config/tsconfig.flow.path.json",
   "compilerOptions": {
     "jsx": "react",
-    "moduleResolution": "bundler",
     "isolatedModules": true,
     "baseUrl": ".",
     "types": [],

+ 1 - 1
packages/node-engine/node/src/hooks.ts

@@ -7,7 +7,7 @@ import { useEffect } from 'react';
 
 import { useRefresh } from '@flowgram.ai/utils';
 import { FlowNodeFormData } from '@flowgram.ai/form-core';
-import { Errors, Warnings } from '@flowgram.ai/form/src/types';
+import { Errors, Warnings } from '@flowgram.ai/form';
 import { FormState, useFormErrors, useFormState, useFormWarnings } from '@flowgram.ai/form';
 import { FlowNodeEntity } from '@flowgram.ai/document';
 

+ 1 - 1
packages/node-engine/node/src/types.ts

@@ -6,7 +6,7 @@
 import * as React from 'react';
 
 import { FormModel, IFormMeta, NodeContext } from '@flowgram.ai/form-core';
-import { FieldName, FieldValue } from '@flowgram.ai/form/src/types';
+import { FieldName, FieldValue } from '@flowgram.ai/form';
 import {
   FormRenderProps,
   IForm,

+ 2 - 2
packages/node-engine/node/src/utils.ts

@@ -5,7 +5,7 @@
 
 import { find, mergeWith } from 'lodash-es';
 import { FormFeedback, FormPathService } from '@flowgram.ai/form-core';
-import { FormValidateReturn } from '@flowgram.ai/form/src/types';
+import type { FieldError, FieldWarning, FormValidateReturn } from '@flowgram.ai/form';
 import { type FieldModel, FieldName } from '@flowgram.ai/form';
 
 import { DataEvent, EffectOptions, EffectReturn } from './types';
@@ -38,7 +38,7 @@ export function formFeedbacksToNodeCoreFormFeedbacks(
   formFeedbacks: FormValidateReturn
 ): FormFeedback[] {
   return formFeedbacks.map(
-    (f) =>
+    (f: FieldError | FieldWarning) =>
       ({
         feedbackStatus: f.level,
         feedbackText: f.message,

+ 1 - 1
packages/plugins/free-lines-plugin/src/types/arrow-renderer.ts

@@ -6,7 +6,7 @@
 import React from 'react';
 
 import { type IPoint } from '@flowgram.ai/utils';
-import { LinePointLocation } from '@flowgram.ai/free-layout-core/src';
+import { LinePointLocation } from '@flowgram.ai/free-layout-core';
 import { type WorkflowLineEntity } from '@flowgram.ai/free-layout-core';
 
 /**

+ 0 - 1
packages/runtime/nodejs/tsconfig.json

@@ -13,7 +13,6 @@
     "noEmit": true,
     "esModuleInterop": true,
     "module": "esnext",
-    "moduleResolution": "bundler",
     "resolveJsonModule": true,
     "isolatedModules": true,
     "jsx": "preserve",

+ 8 - 0
packages/variable-engine/variable-core/tsconfig.json

@@ -1,3 +1,11 @@
 {
   "extends": "@flowgram.ai/ts-config/tsconfig.flow.path.json",
+  "include": [
+    "./src"
+  ],
+  "compilerOptions": {
+    "types": [
+      "reflect-metadata"
+    ]
+  }
 }