refactor(editor): Delete some barrel files and reduce circular dependencies (no-changelog) (#7838)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-11-28 12:15:08 +01:00
committed by GitHub
parent 3ab3ec9da8
commit 753cbc1e96
229 changed files with 539 additions and 507 deletions

View File

@@ -4,7 +4,7 @@ import { setupServer } from '@/__tests__/server';
import { useEnvironmentsStore } from '@/stores/environments.ee.store';
import type { EnvironmentVariable } from '@/Interface';
describe('store', () => {
describe('environments.store', () => {
let server: ReturnType<typeof setupServer>;
const seedRecordsCount = 3;

View File

@@ -1,6 +1,7 @@
import { createPinia, setActivePinia } from 'pinia';
import { useUIStore } from '@/stores/ui.store';
import { useSettingsStore, useUsersStore } from '@/stores/settings.store';
import { useSettingsStore } from '@/stores/settings.store';
import { useUsersStore } from '@/stores/users.store';
import { merge } from 'lodash-es';
import { SETTINGS_STORE_DEFAULT_STATE } from '@/__tests__/utils';
import { useRootStore } from '@/stores/n8nRoot.store';

View File

@@ -1,10 +1,10 @@
import { setActivePinia, createPinia } from 'pinia';
import { useWorkflowsStore } from '@/stores/workflows.store';
import type { IWorkflowDataUpdate } from '@/Interface';
import { makeRestApiRequest } from '@/utils';
import { makeRestApiRequest } from '@/utils/apiUtils';
import { useRootStore } from '../n8nRoot.store';
vi.mock('@/utils', () => ({
vi.mock('@/utils/apiUtils', () => ({
makeRestApiRequest: vi.fn(),
}));

View File

@@ -1,5 +1,5 @@
import { createTestingPinia } from '@pinia/testing';
import { useWorkflowsStore } from '@/stores';
import { useWorkflowsStore } from '@/stores/workflows.store';
let pinia: ReturnType<typeof createTestingPinia>;
beforeAll(() => {

View File

@@ -1,7 +1,7 @@
import { computed } from 'vue';
import { defineStore } from 'pinia';
import { EnterpriseEditionFeature } from '@/constants';
import { useSettingsStore } from '@/stores';
import { useSettingsStore } from '@/stores/settings.store';
export const useAuditLogsStore = defineStore('auditLogs', () => {
const settingsStore = useSettingsStore();

View File

@@ -1,13 +1,7 @@
import { computed, ref, watch } from 'vue';
import { defineStore } from 'pinia';
import { v4 as uuid } from 'uuid';
import {
useWorkflowsStore,
useNodeTypesStore,
useUIStore,
useHistoryStore,
useSourceControlStore,
} from '@/stores';
import type { INodeUi, XYPosition } from '@/Interface';
import {
applyScale,
@@ -16,7 +10,7 @@ import {
scaleBigger,
scaleReset,
scaleSmaller,
} from '@/utils';
} from '@/utils/canvasUtils';
import { START_NODE_TYPE } from '@/constants';
import type {
BeforeStartEventParams,
@@ -43,6 +37,12 @@ import {
} from '@/utils/nodeViewUtils';
import type { PointXY } from '@jsplumb/util';
import { useWorkflowsStore } from './workflows.store';
import { useNodeTypesStore } from './nodeTypes.store';
import { useUIStore } from './ui.store';
import { useHistoryStore } from './history.store';
import { useSourceControlStore } from './sourceControl.store';
export const useCanvasStore = defineStore('canvas', () => {
const workflowStore = useWorkflowsStore();
const nodeTypesStore = useNodeTypesStore();

View File

@@ -6,7 +6,7 @@ import type {
ICredentialsResponse,
ICredentialsState,
ICredentialTypeMap,
} from '../Interface';
} from '@/Interface';
import {
createNewCredential,
deleteCredential,

View File

@@ -1,31 +0,0 @@
export * from './canvas.store';
export * from './communityNodes.store';
export * from './credentials.store';
export * from './environments.ee.store';
export * from './externalSecrets.ee.store';
export * from './history.store';
export * from './logStreaming.store';
export * from './n8nRoot.store';
export * from './ndv.store';
export * from './nodeCreator.store';
export * from './nodeTypes.store';
export * from './posthog.store';
export * from './segment.store';
export * from './settings.store';
export * from './tags.store';
export * from './telemetry.store';
export * from './templates.store';
export * from './ui.store';
export * from './usage.store';
export * from './users.store';
export * from './versions.store';
export * from './webhooks.store';
export * from './workflows.ee.store';
export * from './workflows.store';
export * from './cloudPlan.store';
export * from './sourceControl.store';
export * from './sso.store';
export * from './auditLogs.store';
export * from './rbac.store';
export * from './collaboration.store';
export * from './pushConnection.store';

View File

@@ -14,7 +14,7 @@ import {
} from '@/constants';
import type { INodeTypesState, DynamicNodeParameters } from '@/Interface';
import { addHeaders, addNodeTranslation } from '@/plugins/i18n';
import { omit } from '@/utils';
import { omit } from '@/utils/typesUtils';
import type {
ConnectionTypes,
INode,

View File

@@ -25,14 +25,15 @@ import type {
ITelemetrySettings,
WorkflowSettings,
} from 'n8n-workflow';
import { ExpressionEvaluatorProxy } from 'n8n-workflow';
import { defineStore } from 'pinia';
import { useRootStore } from './n8nRoot.store';
import { useUIStore } from './ui.store';
import { useUsersStore } from './users.store';
import { useVersionsStore } from './versions.store';
import { makeRestApiRequest } from '@/utils';
import { useTitleChange, useToast } from '@/composables';
import { ExpressionEvaluatorProxy } from 'n8n-workflow';
import { makeRestApiRequest } from '@/utils/apiUtils';
import { useTitleChange } from '@/composables/useTitleChange';
import { useToast } from '@/composables/useToast';
import { i18n } from '@/plugins/i18n';
export const useSettingsStore = defineStore(STORES.SETTINGS, {
@@ -392,5 +393,3 @@ export const useSettingsStore = defineStore(STORES.SETTINGS, {
},
},
});
export { useUsersStore };

View File

@@ -57,9 +57,10 @@ import type {
import { defineStore } from 'pinia';
import { useRootStore } from '@/stores/n8nRoot.store';
import { getCurlToJson } from '@/api/curlHelper';
import { useWorkflowsStore } from '@/stores/workflows.store';
import { useSettingsStore, useUsersStore } from '@/stores/settings.store';
import { useCloudPlanStore } from '@/stores/cloudPlan.store';
import { useWorkflowsStore } from '@/stores/workflows.store';
import { useSettingsStore } from '@/stores/settings.store';
import { useUsersStore } from '@/stores/users.store';
import { useTelemetryStore } from '@/stores/telemetry.store';
import { dismissBannerPermanently } from '@/api/ui';
import type { BannerName } from 'n8n-workflow';

View File

@@ -30,7 +30,7 @@ import type {
CurrentUserResponse,
} from '@/Interface';
import { getCredentialPermissions } from '@/permissions';
import { getPersonalizedNodeTypes, ROLE } from '@/utils';
import { getPersonalizedNodeTypes, ROLE } from '@/utils/userUtils';
import { defineStore } from 'pinia';
import { useRootStore } from './n8nRoot.store';
import { usePostHog } from './posthog.store';

View File

@@ -72,15 +72,10 @@ import {
} from '@/api/workflows';
import { useUIStore } from '@/stores/ui.store';
import { dataPinningEventBus } from '@/event-bus';
import {
isJsonKeyObject,
getPairedItemsMapping,
stringSizeInBytes,
isObject,
isEmpty,
makeRestApiRequest,
unflattenExecutionData,
} from '@/utils';
import { isObject } from '@/utils/objectUtils';
import { getPairedItemsMapping } from '@/utils/pairedItemUtils';
import { isJsonKeyObject, isEmpty, stringSizeInBytes } from '@/utils/typesUtils';
import { makeRestApiRequest, unflattenExecutionData } from '@/utils/apiUtils';
import { useNDVStore } from '@/stores/ndv.store';
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
import { useUsersStore } from '@/stores/users.store';