浏览代码

fix: improve defineConfig types (#4454)

Vben 1 年之前
父节点
当前提交
d34f1fbf2f
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2 2
      internal/vite-config/src/typing.ts
  2. 1 1
      packages/@core/ui-kit/form-ui/__tests__/form-api.test.ts

+ 2 - 2
internal/vite-config/src/typing.ts

@@ -137,12 +137,12 @@ type ApplicationOptions = ApplicationPluginOptions;
 
 type LibraryOptions = LibraryPluginOptions;
 
-type DefineApplicationOptions = (config?: ConfigEnv) => Promise<{
+type DefineApplicationOptions = (config: ConfigEnv) => Promise<{
   application?: ApplicationOptions;
   vite?: UserConfig;
 }>;
 
-type DefineLibraryOptions = (config?: ConfigEnv) => Promise<{
+type DefineLibraryOptions = (config: ConfigEnv) => Promise<{
   library?: LibraryOptions;
   vite?: UserConfig;
 }>;

+ 1 - 1
packages/@core/ui-kit/form-ui/__tests__/form-api.test.ts

@@ -183,7 +183,7 @@ describe('updateSchema', () => {
     instance.updateSchema(newSchema);
 
     expect(consoleErrorSpy).toHaveBeenCalledWith(
-      'All children of the form Schema array that need to be updated must contain the `field` field',
+      'All items in the schema array must have a valid `fieldName` property to be updated',
     );
   });