From 0d9a546d7479efcb6787062fe4e126c44b99e937 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Mon, 27 Nov 2023 01:07:21 +1100 Subject: [PATCH] feat(ui): organize migrations files --- .../nodes/types/{migration => }/v1/fieldTypeMap.ts | 2 +- .../nodes/types/{migration => }/v1/workflowV1.ts | 0 .../{types/migration => util/workflow}/migrations.ts | 12 ++++++------ .../features/nodes/util/workflow/validateWorkflow.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename invokeai/frontend/web/src/features/nodes/types/{migration => }/v1/fieldTypeMap.ts (99%) rename invokeai/frontend/web/src/features/nodes/types/{migration => }/v1/workflowV1.ts (100%) rename invokeai/frontend/web/src/features/nodes/{types/migration => util/workflow}/migrations.ts (84%) diff --git a/invokeai/frontend/web/src/features/nodes/types/migration/v1/fieldTypeMap.ts b/invokeai/frontend/web/src/features/nodes/types/v1/fieldTypeMap.ts similarity index 99% rename from invokeai/frontend/web/src/features/nodes/types/migration/v1/fieldTypeMap.ts rename to invokeai/frontend/web/src/features/nodes/types/v1/fieldTypeMap.ts index facf015b02..aace29d523 100644 --- a/invokeai/frontend/web/src/features/nodes/types/migration/v1/fieldTypeMap.ts +++ b/invokeai/frontend/web/src/features/nodes/types/v1/fieldTypeMap.ts @@ -1,4 +1,4 @@ -import { FieldType, StatefulFieldType } from '../../field'; +import { FieldType, StatefulFieldType } from '../field'; import { FieldTypeV1 } from './workflowV1'; /** diff --git a/invokeai/frontend/web/src/features/nodes/types/migration/v1/workflowV1.ts b/invokeai/frontend/web/src/features/nodes/types/v1/workflowV1.ts similarity index 100% rename from invokeai/frontend/web/src/features/nodes/types/migration/v1/workflowV1.ts rename to invokeai/frontend/web/src/features/nodes/types/v1/workflowV1.ts diff --git a/invokeai/frontend/web/src/features/nodes/types/migration/migrations.ts b/invokeai/frontend/web/src/features/nodes/util/workflow/migrations.ts similarity index 84% rename from invokeai/frontend/web/src/features/nodes/types/migration/migrations.ts rename to invokeai/frontend/web/src/features/nodes/util/workflow/migrations.ts index 45c3852493..5428ac9861 100644 --- a/invokeai/frontend/web/src/features/nodes/types/migration/migrations.ts +++ b/invokeai/frontend/web/src/features/nodes/util/workflow/migrations.ts @@ -1,11 +1,11 @@ +import { t } from 'i18next'; import { forEach, isString } from 'lodash-es'; import { z } from 'zod'; -import { WorkflowVersionError } from '../error'; -import { zSemVer } from '../semver'; -import { WorkflowV2, zWorkflowV2 } from '../workflow'; -import { FIELD_TYPE_V1_TO_FIELD_TYPE_V2_MAPPING } from './v1/fieldTypeMap'; -import { WorkflowV1, zWorkflowV1 } from './v1/workflowV1'; -import { t } from 'i18next'; +import { WorkflowVersionError } from '../../types/error'; +import { zSemVer } from '../../types/semver'; +import { FIELD_TYPE_V1_TO_FIELD_TYPE_V2_MAPPING } from '../../types/v1/fieldTypeMap'; +import { WorkflowV1, zWorkflowV1 } from '../../types/v1/workflowV1'; +import { WorkflowV2, zWorkflowV2 } from '../../types/workflow'; /** * Helper schema to extract the version from a workflow. diff --git a/invokeai/frontend/web/src/features/nodes/util/workflow/validateWorkflow.ts b/invokeai/frontend/web/src/features/nodes/util/workflow/validateWorkflow.ts index 08ff0c4daf..07b3cc5bfc 100644 --- a/invokeai/frontend/web/src/features/nodes/util/workflow/validateWorkflow.ts +++ b/invokeai/frontend/web/src/features/nodes/util/workflow/validateWorkflow.ts @@ -4,7 +4,7 @@ import { keyBy } from 'lodash-es'; import { JsonObject } from 'type-fest'; import { getNeedsUpdate } from '../node/nodeUpdate'; import { InvocationTemplate } from '../../types/invocation'; -import { parseAndMigrateWorkflow } from '../../types/migration/migrations'; +import { parseAndMigrateWorkflow } from './migrations'; import { WorkflowV2, isWorkflowInvocationNode } from '../../types/workflow'; type WorkflowWarning = {