Move define extension functions to shared and expose them through extension-sdk (#6880)

* Move defineInterface to shared

* Split up utils into node and browser utils

* Move defineDisplay to shared

* Move defineLayout to shared

* Move defineModule to shared

* Add defineEndpoint and defineHook to define-extensions

* Expose define extension functions through extension-sdk

* Make route type of defineEndpoint more specific

* Simplify define extension functions

* Deduplicate types and local types definition

* Do not allow functional components in display handler

* Make interface options nullable

* Deduplicate extension types definition

* Fix utils/node exports
This commit is contained in:
Nicola Krumschmidt
2021-07-22 17:02:29 +02:00
committed by GitHub
parent 3a9475fba5
commit 32972f4c01
195 changed files with 515 additions and 497 deletions

View File

@@ -1,5 +1,5 @@
import api from '@/api';
import { Role } from '@/types';
import { Role } from '@directus/shared/types';
import { ref, Ref } from 'vue';
let roles: Ref<Role[] | null> | null = null;

View File

@@ -1,4 +1,4 @@
import { defineModule } from '@/modules/define';
import { defineModule } from '@directus/shared/utils/browser';
import Collection from './routes/collection.vue';
import Item from './routes/item.vue';

View File

@@ -140,7 +140,7 @@ import { useUserStore, usePermissionsStore } from '@/stores';
import useNavigation from '../composables/use-navigation';
import { useLayout } from '@/composables/use-layout';
import DrawerBatch from '@/views/private/components/drawer-batch';
import { Role } from '@/types';
import { Role } from '@directus/shared/types';
type Item = {
[field: string]: any;

View File

@@ -186,7 +186,7 @@ import SaveOptions from '@/views/private/components/save-options';
import api from '@/api';
import { useFieldsStore, useCollectionsStore } from '@/stores/';
import useFormFields from '@/composables/use-form-fields';
import { Field } from '@/types';
import { Field } from '@directus/shared/types';
import UserInfoSidebarDetail from '../components/user-info-sidebar-detail.vue';
import { getRootPath } from '@/utils/get-root-path';
import useShortcut from '@/composables/use-shortcut';