From ec19fcafb1d6f0eaae52747ced5f30e20bacdfb3 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Mon, 25 Sep 2023 10:45:38 +1000 Subject: [PATCH] fix(ui): fix circular dependency This is actually a platform-specific issue. `madge` is complaining about a circular dependency on a single file - `invokeai/frontend/web/src/features/queue/store/nanoStores.ts`. In that file, we import from the `nanostores` package. Very similar name to the file itself. The error only appears on Windows and macOS, I imagine because those systems both resolve `nanostores` to itself before resolving to the package. The solution is simple - rename `nanoStores.ts`. It's now `queueNanoStore.ts`. --- invokeai/frontend/web/src/app/components/InvokeAIUI.tsx | 5 ++++- .../queue/store/{nanoStores.ts => queueNanoStore.ts} | 0 invokeai/frontend/web/src/services/api/endpoints/queue.ts | 2 +- invokeai/frontend/web/src/services/api/thunks/session.ts | 2 +- .../web/src/services/events/util/setEventListeners.ts | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) rename invokeai/frontend/web/src/features/queue/store/{nanoStores.ts => queueNanoStore.ts} (100%) diff --git a/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx b/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx index 8c8c02ee85..02d682dfb4 100644 --- a/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx +++ b/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx @@ -17,7 +17,10 @@ import '../../i18n'; import AppDndContext from '../../features/dnd/components/AppDndContext'; import { $customStarUI, CustomStarUi } from 'app/store/nanostores/customStarUI'; import { $headerComponent } from 'app/store/nanostores/headerComponent'; -import { $queueId, DEFAULT_QUEUE_ID } from 'features/queue/store/nanoStores'; +import { + $queueId, + DEFAULT_QUEUE_ID, +} from 'features/queue/store/queueNanoStore'; const App = lazy(() => import('./App')); const ThemeLocaleProvider = lazy(() => import('./ThemeLocaleProvider')); diff --git a/invokeai/frontend/web/src/features/queue/store/nanoStores.ts b/invokeai/frontend/web/src/features/queue/store/queueNanoStore.ts similarity index 100% rename from invokeai/frontend/web/src/features/queue/store/nanoStores.ts rename to invokeai/frontend/web/src/features/queue/store/queueNanoStore.ts diff --git a/invokeai/frontend/web/src/services/api/endpoints/queue.ts b/invokeai/frontend/web/src/services/api/endpoints/queue.ts index 6d436b231f..4393ab7e81 100644 --- a/invokeai/frontend/web/src/services/api/endpoints/queue.ts +++ b/invokeai/frontend/web/src/services/api/endpoints/queue.ts @@ -4,7 +4,7 @@ import { ThunkDispatch, createEntityAdapter, } from '@reduxjs/toolkit'; -import { $queueId } from 'features/queue/store/nanoStores'; +import { $queueId } from 'features/queue/store/queueNanoStore'; import { listParamsReset } from 'features/queue/store/queueSlice'; import queryString from 'query-string'; import { ApiTagDescription, api } from '..'; diff --git a/invokeai/frontend/web/src/services/api/thunks/session.ts b/invokeai/frontend/web/src/services/api/thunks/session.ts index 2404329fac..837fd7a28e 100644 --- a/invokeai/frontend/web/src/services/api/thunks/session.ts +++ b/invokeai/frontend/web/src/services/api/thunks/session.ts @@ -1,5 +1,5 @@ import { createAsyncThunk, isAnyOf } from '@reduxjs/toolkit'; -import { $queueId } from 'features/queue/store/nanoStores'; +import { $queueId } from 'features/queue/store/queueNanoStore'; import { isObject } from 'lodash-es'; import { $client } from 'services/api/client'; import { paths } from 'services/api/schema'; diff --git a/invokeai/frontend/web/src/services/events/util/setEventListeners.ts b/invokeai/frontend/web/src/services/events/util/setEventListeners.ts index 0f4d21d2e1..89487070a6 100644 --- a/invokeai/frontend/web/src/services/events/util/setEventListeners.ts +++ b/invokeai/frontend/web/src/services/events/util/setEventListeners.ts @@ -1,7 +1,7 @@ import { MiddlewareAPI } from '@reduxjs/toolkit'; import { logger } from 'app/logging/logger'; import { AppDispatch, RootState } from 'app/store/store'; -import { $queueId } from 'features/queue/store/nanoStores'; +import { $queueId } from 'features/queue/store/queueNanoStore'; import { addToast } from 'features/system/store/systemSlice'; import { makeToast } from 'features/system/util/makeToast'; import { Socket } from 'socket.io-client';