Road to No explicit any: Group 8 (part 8) test files#8496
Conversation
…tterns - Use createTestingPinia and setActivePinia for proper store setup - Replace manual mock factories with store.() for state changes - Remove custom type casting and use proper Pinia patterns - Eliminate all 'as any' usage in favor of proper typing - All 13 original tests passing with improved implementation
- Fix constructor parameter shadowing in typeGuardUtil.test.ts - Use getter functions for dynamic mock values in useConflictDetection.test.ts
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 01/30/2026, 08:44:22 PM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Tests:
|
📝 WalkthroughWalkthroughThis PR improves TypeScript type-safety across utility functions and test files by introducing stricter type guards, replacing unsafe type casts with factory functions and satisfies operators, narrowing parameter types, and exporting previously internal types. Changes affect core utilities, test mock infrastructure, and manager composables. Changes
Possibly related PRs
Suggested reviewers
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 26 kB (baseline 26 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 974 kB (baseline 974 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 80.7 kB (baseline 80.7 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 9 added / 9 removed Panels & Settings — 471 kB (baseline 471 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 12 added / 12 removed User & Accounts — 3.94 kB (baseline 3.94 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 3 added / 3 removed Editors & Dialogs — 2.89 kB (baseline 2.89 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 2 added / 2 removed UI Components — 33.7 kB (baseline 33.7 kB) • ⚪ 0 BReusable component library chunks
Status: 4 added / 4 removed Data & Services — 2.71 MB (baseline 2.71 MB) • 🔴 +58 BStores, services, APIs, and repositories
Status: 8 added / 8 removed Utilities & Hooks — 25.3 kB (baseline 25.3 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 7 added / 7 removed Vendor & Third-Party — 10.7 MB (baseline 10.7 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 7.1 MB (baseline 7.1 MB) • ⚪ 0 BBundles that do not match a named category
Status: 34 added / 34 removed |
There was a problem hiding this comment.
over 30 instances of any here. needed an overhaul
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
src/workbench/extensions/manager/composables/nodePack/useMissingNodes.test.ts (1)
257-275:⚠️ Potential issue | 🟡 MinorReplace the unsafe double-cast with proper
WorkflowPackmapping.Line 274 uses
as unknown as WorkflowPack[], which hides a shape mismatch betweenmockWorkflowPacks(withnameandlatest_versionproperties) and theWorkflowPacktype (which only requiresidandversion). Build a properWorkflowPack[]from the mock data instead.🔧 Suggested fix
- workflowPacksRef.value = mockWorkflowPacks as unknown as WorkflowPack[] + workflowPacksRef.value = mockWorkflowPacks.map((pack) => ({ + id: pack.id, + version: pack.latest_version?.version + }))src/workbench/extensions/manager/composables/useConflictDetection.test.ts (1)
453-468:⚠️ Potential issue | 🟡 MinorAssert the composable output, not just the mock array.
The current assertions only validate the mock data, so the test won’t fail if
useConflictDetectionstops wiring state.🔧 Suggested fix
- useConflictDetection() - - // The hasConflicts computed should be true since we have a conflict - expect(mockConflictedPackages).toHaveLength(1) - expect(mockConflictedPackages[0].has_conflict).toBe(true) + const { hasConflicts, conflictedPackages } = useConflictDetection() + + expect(hasConflicts.value).toBe(true) + expect(conflictedPackages.value).toHaveLength(1) + expect(conflictedPackages.value[0].has_conflict).toBe(true)As per coding guidelines: Do not write tests that just test the mocks; ensure tests fail when code behaves unexpectedly.
src/workbench/extensions/manager/composables/useManagerState.test.ts (1)
70-435: 🧹 Nitpick | 🔵 TrivialReduce repeated systemStats fixtures with a small factory
These tests repeat the same base
systemStatsobject. A tiny helper lets each case focus on the argv differences and reduces maintenance.As per coding guidelines, When writing new code, ask if there is a simpler way to introduce the same functionality; choose the simpler course if it exists.♻️ Example refactor pattern (apply across the file)
describe('useManagerState', () => { + function buildSystemStats(argv: string[]) { + return { + system: { + os: 'Test OS', + python_version: '3.10', + embedded_python: false, + comfyui_version: '1.0.0', + pytorch_version: '2.0.0', + argv, + ram_total: 16000000000, + ram_free: 8000000000 + }, + devices: [] + } + } + let systemStatsStore: ReturnType<typeof useSystemStatsStore> @@ - systemStatsStore.$patch({ - systemStats: { - system: { - os: 'Test OS', - python_version: '3.10', - embedded_python: false, - comfyui_version: '1.0.0', - pytorch_version: '2.0.0', - argv: ['python', 'main.py'], // No --enable-manager flag - ram_total: 16000000000, - ram_free: 8000000000 - }, - devices: [] - }, - isInitialized: true - }) + systemStatsStore.$patch({ + systemStats: buildSystemStats(['python', 'main.py']), + isInitialized: true + })
🤖 Fix all issues with AI agents
In `@src/workbench/extensions/manager/composables/useManagerState.test.ts`:
- Around line 73-91: The test setup uses vi.resetAllMocks() in the beforeEach
block which clears mock implementations created by vi.mock() factories; replace
that call with vi.clearAllMocks() so factory implementations are preserved while
call history is cleared. In the beforeEach for useManagerState.test.ts (the
block that sets up setActivePinia, createTestingPinia, and initializes
systemStatsStore), change vi.resetAllMocks() to vi.clearAllMocks() and keep the
subsequent vi.mocked(...).mockReturnValue(...) calls (api.getClientFeatureFlags
and api.getServerFeature) as-is to ensure mocks are reset but factory
implementations remain intact.
In `@src/workbench/extensions/manager/utils/versionUtil.test.ts`:
- Around line 27-32: Tests are using non-idiomatic null! assertions when calling
checkVersionCompatibility; locate the test cases that call
checkVersionCompatibility with a null! argument (the cases asserting "should
return null when current version is null" and the other similar case) and
replace both null! occurrences with undefined so the calls pass an undefined
value (matching the function signature currentVersion?: string /
supportedVersion?: string) and avoid defeating TypeScript's type safety.
| beforeEach(() => { | ||
| vi.clearAllMocks() | ||
| // Create a fresh testing pinia and activate it for each test | ||
| setActivePinia( | ||
| createTestingPinia({ | ||
| stubActions: false, | ||
| createSpy: vi.fn | ||
| }) | ||
| ) | ||
|
|
||
| // Initialize stores | ||
| systemStatsStore = useSystemStatsStore() | ||
|
|
||
| // Reset all mocks | ||
| vi.resetAllMocks() | ||
|
|
||
| // Set default mock returns | ||
| vi.mocked(api.getClientFeatureFlags).mockReturnValue({}) | ||
| vi.mocked(api.getServerFeature).mockReturnValue(undefined) | ||
| }) |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Vitest vi.resetAllMocks vs vi.clearAllMocks difference mock factories
💡 Result:
vi.clearAllMocks() vs vi.resetAllMocks()
vi.clearAllMocks()calls.mockClear()on every spy/mock: it only clears call history (mock.calls,mock.results, etc.) and keeps the current mock implementation (including anything you set viamockReturnValue,mockImplementation, etc.). (vitest.dev)vi.resetAllMocks()calls.mockReset()on every spy/mock: it clears call history and resets each mock’s implementation back to the default “empty” mock (returnsundefined), also resetting any “once” implementations. (vitest.dev)
Practical rule:
- If you want “same stubs, fresh assertions” between tests →
clearAllMocks - If you want “wipe everything about the mocks (including stubs)” between tests →
resetAllMocks
What this means for vi.mock(..., factory) (mock factories)
Vitest runs a vi.mock factory only once and caches its result for subsequent imports, until you explicitly unmock it. (vitest.dev)
So:
- Neither
vi.clearAllMocks()norvi.resetAllMocks()re-runs the module mock factory. - They only operate on the mock functions/spies that already exist (often created inside the factory, e.g.
vi.fn()).
Common pitfall with factories:
- If your factory returns functions like
vi.fn().mockReturnValue('x'), then:clearAllMocks()keeps that return value (just clears call history).resetAllMocks()removes that configured behavior (back toundefined). (vitest.dev)
If your goal is to “start over” with a fresh factory result, you typically need module-level actions (not *AllMocks):
vi.resetModules()clears the module cache (so modules can be re-evaluated on re-import), but it does not clear the mocks registry. (vitest.dev)- To stop using a mocked module / clear it from the mocks registry, use
vi.unmock/vi.doUnmock(then re-import). (vitest.dev)
Citations:
- 1: https://vitest.dev/api/vi?utm_source=openai
- 2: https://vitest.dev/api/vi?utm_source=openai
- 3: https://vitest.dev/api/vi?utm_source=openai
- 4: https://vitest.dev/api/vi?utm_source=openai
- 5: https://vitest.dev/api/vi?utm_source=openai
- 6: https://vitest.dev/api/vi?utm_source=openai
🏁 Script executed:
# Find and examine the test file
fd "useManagerState.test.ts" --type fRepository: Comfy-Org/ComfyUI_frontend
Length of output: 138
🏁 Script executed:
# Examine the test file to understand the mock setup and what useManagerState does
cat -n src/workbench/extensions/manager/composables/useManagerState.test.tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 15838
🏁 Script executed:
# Check if useManagerState is a composable that might be called during setup
cat -n src/workbench/extensions/manager/composables/useManagerState.ts | head -50Repository: Comfy-Org/ComfyUI_frontend
Length of output: 2261
Prefer clearAllMocks() to preserve factory implementations
vi.resetAllMocks() removes mock implementations created in vi.mock() factories, resetting them to return undefined. Since tests explicitly set mock return values afterward, this works in the current code but is unnecessarily defensive. vi.clearAllMocks() preserves factory implementations while clearing call history—a safer pattern that protects against accidental regressions if test initialization order changes.
- vi.resetAllMocks()
+ vi.clearAllMocks()📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| beforeEach(() => { | |
| vi.clearAllMocks() | |
| // Create a fresh testing pinia and activate it for each test | |
| setActivePinia( | |
| createTestingPinia({ | |
| stubActions: false, | |
| createSpy: vi.fn | |
| }) | |
| ) | |
| // Initialize stores | |
| systemStatsStore = useSystemStatsStore() | |
| // Reset all mocks | |
| vi.resetAllMocks() | |
| // Set default mock returns | |
| vi.mocked(api.getClientFeatureFlags).mockReturnValue({}) | |
| vi.mocked(api.getServerFeature).mockReturnValue(undefined) | |
| }) | |
| beforeEach(() => { | |
| // Create a fresh testing pinia and activate it for each test | |
| setActivePinia( | |
| createTestingPinia({ | |
| stubActions: false, | |
| createSpy: vi.fn | |
| }) | |
| ) | |
| // Initialize stores | |
| systemStatsStore = useSystemStatsStore() | |
| // Reset all mocks | |
| vi.clearAllMocks() | |
| // Set default mock returns | |
| vi.mocked(api.getClientFeatureFlags).mockReturnValue({}) | |
| vi.mocked(api.getServerFeature).mockReturnValue(undefined) | |
| }) |
🤖 Prompt for AI Agents
In `@src/workbench/extensions/manager/composables/useManagerState.test.ts` around
lines 73 - 91, The test setup uses vi.resetAllMocks() in the beforeEach block
which clears mock implementations created by vi.mock() factories; replace that
call with vi.clearAllMocks() so factory implementations are preserved while call
history is cleared. In the beforeEach for useManagerState.test.ts (the block
that sets up setActivePinia, createTestingPinia, and initializes
systemStatsStore), change vi.resetAllMocks() to vi.clearAllMocks() and keep the
subsequent vi.mocked(...).mockReturnValue(...) calls (api.getClientFeatureFlags
and api.getServerFeature) as-is to ensure mocks are reset but factory
implementations remain intact.
| it('should return null when current version is null', () => { | ||
| const result = checkVersionCompatibility( | ||
| 'comfyui_version', | ||
| null as any, | ||
| null!, | ||
| '>=1.0.0' | ||
| ) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, find the test file and check the actual lines mentioned
fd -t f "versionUtil.test.ts" -x cat -n {} | head -60
# Also find the actual implementation file to see the function signature
fd -t f "versionUtil.ts" -g '!*.test.ts' -x cat -n {}
# Find all call sites of checkVersionCompatibility to understand usage
rg "checkVersionCompatibility" -n --type tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 8447
🏁 Script executed:
# Get the function signature from versionUtil.ts
cat -n src/workbench/extensions/manager/utils/versionUtil.ts | head -80
# Also check the non-test call sites to understand current usage
rg -A 5 "checkVersionCompatibility\(" src/workbench/extensions/manager/composables/useConflictDetection.ts | head -40Repository: Comfy-Org/ComfyUI_frontend
Length of output: 3636
Replace null! with undefined to align with function signature and codebase conventions.
The checkVersionCompatibility function signature accepts currentVersion?: string and supportedVersion?: string, meaning both parameters accept undefined or string values—not null. The null! assertions (lines 30, 54) defeat type safety without adding value; the equivalent tests using undefined (line 21) already pass without assertions.
Replace both instances:
- Line 30: use
undefinedinstead ofnull! - Line 54: use
undefinedinstead ofnull!
This removes unnecessary type-safety violations and aligns with the codebase preference for undefined over null.
🤖 Prompt for AI Agents
In `@src/workbench/extensions/manager/utils/versionUtil.test.ts` around lines 27 -
32, Tests are using non-idiomatic null! assertions when calling
checkVersionCompatibility; locate the test cases that call
checkVersionCompatibility with a null! argument (the cases asserting "should
return null when current version is null" and the other similar case) and
replace both null! occurrences with undefined so the calls pass an undefined
value (matching the function signature currentVersion?: string /
supportedVersion?: string) and avoid defeating TypeScript's type safety.
## Summary
This PR removes unsafe type assertions ("as unknown as Type") from test
files and improves type safety across the codebase.
### Key Changes
#### Type Safety Improvements
- Removed improper `as unknown as Type` patterns from test files in
Group 8 part 8
- Replaced with proper TypeScript patterns using Pinia store testing
patterns
- Fixed parameter shadowing issue in typeGuardUtil.test.ts (constructor
→ nodeConstructor)
- Fixed stale mock values in useConflictDetection.test.ts using getter
functions
- Refactored useManagerState tests to follow proper Pinia store testing
patterns with createTestingPinia
### Files Changed
Test files (Group 8 part 8 - utils and manager composables):
- src/utils/typeGuardUtil.test.ts - Fixed parameter shadowing
- src/utils/graphTraversalUtil.test.ts - Removed unsafe type assertions
- src/utils/litegraphUtil.test.ts - Improved type handling
- src/workbench/extensions/manager/composables/useManagerState.test.ts -
Complete rewrite using Pinia testing patterns
-
src/workbench/extensions/manager/composables/useConflictDetection.test.ts
- Fixed stale mock values with getters
- src/workbench/extensions/manager/composables/useManagerQueue.test.ts -
Type safety improvements
-
src/workbench/extensions/manager/composables/nodePack/useMissingNodes.test.ts
- Removed unsafe casts
-
src/workbench/extensions/manager/composables/nodePack/usePacksSelection.test.ts
- Type improvements
-
src/workbench/extensions/manager/composables/nodePack/usePacksStatus.test.ts
- Type improvements
- src/workbench/extensions/manager/utils/versionUtil.test.ts - Type
safety fixes
Source files (minor type fixes):
- src/utils/fuseUtil.ts - Type improvements
- src/utils/linkFixer.ts - Type safety fixes
- src/utils/syncUtil.ts - Type improvements
-
src/workbench/extensions/manager/composables/nodePack/useWorkflowPacks.ts
- Type fix
-
src/workbench/extensions/manager/composables/useConflictAcknowledgment.ts
- Type fix
### Testing
- All TypeScript type checking passes (`pnpm typecheck`)
- All affected test files pass (`pnpm test:unit`)
- Linting passes without errors (`pnpm lint`)
- Code formatting applied (`pnpm format`)
Part of the "Road to No Explicit Any" initiative, cleaning up type
casting issues from branch `fix/remove-any-types-part8`.
### Previous PRs in this series:
- Part 2: #7401
- Part 3: #7935
- Part 4: #7970
- Part 5: #8064
- Part 6: #8083
- Part 7: #8092
- Part 8 Group 1: #8253
- Part 8 Group 2: #8258
- Part 8 Group 3: #8304
- Part 8 Group 4: #8314
- Part 8 Group 5: #8329
- Part 8 Group 6: #8344
- Part 8 Group 7: #8459
- Part 8 Group 8: #8496 (this PR)
┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8496-Road-to-No-explicit-any-Group-8-part-8-test-files-2f86d73d365081f3afdcf8d01fba81e1)
by [Unito](https://www.unito.io)
---------
Co-authored-by: GitHub Action <action@github.com>
## Summary This PR removes `any` types from UI component files and replaces them with proper TypeScript types. ### Key Changes #### Type Safety Improvements - Replaced `any` with `unknown`, explicit types, or proper interfaces across UI components - Used `ComponentPublicInstance` with explicit method signatures for component refs - Used `Record<string, unknown>` for dynamic property access - Added generics for form components with flexible value types - Used `CSSProperties` for style objects ### Files Changed UI Components: - src/components/common/ComfyImage.vue - Used proper class prop type - src/components/common/DeviceInfo.vue - Used `string | number` for formatValue - src/components/common/FormItem.vue - Used `unknown` for model value - src/components/common/FormRadioGroup.vue - Added generic type parameter - src/components/common/TreeExplorer.vue - Used proper async function signature - src/components/custom/widget/WorkflowTemplateSelectorDialog.vue - Fixed duplicate import - src/components/graph/CanvasModeSelector.vue - Used `ComponentPublicInstance` for ref - src/components/node/NodePreview.vue - Changed `any` to `unknown` - src/components/queue/job/JobDetailsPopover.vue - Removed unnecessary casts - src/components/queue/job/JobFiltersBar.vue - Removed `as any` casts - src/platform/assets/components/MediaAssetContextMenu.vue - Added `ContextMenuInstance` type - src/renderer/extensions/minimap/MiniMapPanel.vue - Used `CSSProperties` - src/renderer/extensions/vueNodes/composables/useNodeTooltips.ts - Added `PrimeVueTooltipElement` interface - src/renderer/extensions/vueNodes/widgets/components/form/FormSelectButton.vue - Used `Record<string, unknown>` - src/workbench/extensions/manager/components/manager/infoPanel/tabs/DescriptionTabPanel.vue - Added `LicenseObject` interface ### Testing - All TypeScript type checking passes (`pnpm typecheck`) - Linting passes without errors (`pnpm lint`) Part of the "Road to No Explicit Any" initiative. ### Previous PRs in this series: - Part 2: #7401 - Part 3: #7935 - Part 4: #7970 - Part 5: #8064 - Part 6: #8083 - Part 7: #8092 - Part 8 Group 1: #8253 - Part 8 Group 2: #8258 - Part 8 Group 3: #8304 - Part 8 Group 4: #8314 - Part 8 Group 5: #8329 - Part 8 Group 6: #8344 - Part 8 Group 7: #8459 - Part 8 Group 8: #8496 - Part 9: #8498 - Part 10: #8499 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8499-Road-to-No-Explicit-Any-Part-10-2f86d73d365081aab129f165c7d02434) by [Unito](https://www.unito.io)
## Summary
This PR removes `any` types from core source files and replaces them
with proper TypeScript types.
### Key Changes
#### Type Safety Improvements
- Replaced `any` with `unknown`, explicit types, or proper interfaces
across core files
- Introduced new type definitions: `SceneConfig`, `Load3DNode`,
`ElectronWindow`
- Used `Object.assign` instead of `as any` for dynamic property
assignment
- Replaced `as any` casts with proper type assertions
### Files Changed
Source files:
- src/extensions/core/widgetInputs.ts - Removed unnecessary `as any`
cast
- src/platform/cloud/onboarding/auth.ts - Used `Record<string, unknown>`
and Sentry types
- src/platform/telemetry/providers/cloud/MixpanelTelemetryProvider.ts -
Used `AuditLog[]` type
- src/platform/workflow/management/stores/workflowStore.ts - Used
`typeof ComfyWorkflow` constructor type
- src/scripts/app.ts - Used `ResultItem[]` for Clipspace images
- src/services/colorPaletteService.ts - Used `Object.assign` instead of
`as any`
- src/services/customerEventsService.ts - Used `unknown` instead of
`any`
- src/services/load3dService.ts - Added proper interface types for
Load3D nodes
- src/types/litegraph-augmentation.d.ts - Used `TWidgetValue[]` type
- src/utils/envUtil.ts - Added ElectronWindow interface
- src/workbench/extensions/manager/stores/comfyManagerStore.ts - Typed
event as `CustomEvent<{ ui_id?: string }>`
### Testing
- All TypeScript type checking passes (`pnpm typecheck`)
- Linting passes without errors (`pnpm lint`)
- Code formatting applied (`pnpm format`)
Part of the "Road to No Explicit Any" initiative.
### Previous PRs in this series:
- Part 2: #7401
- Part 3: #7935
- Part 4: #7970
- Part 5: #8064
- Part 6: #8083
- Part 7: #8092
- Part 8 Group 1: #8253
- Part 8 Group 2: #8258
- Part 8 Group 3: #8304
- Part 8 Group 4: #8314
- Part 8 Group 5: #8329
- Part 8 Group 6: #8344
- Part 8 Group 7: #8459
- Part 8 Group 8: #8496
- Part 9: #8498 (this PR)
## Summary
This PR removes `any` types from widgets, services, stores, and test
files, replacing them with proper TypeScript types.
### Key Changes
#### Type Safety Improvements
- Replaced `any` with `unknown`, explicit types, or proper interfaces
across widgets and services
- Added proper type imports (TgpuRoot, Point, StyleValue, etc.)
- Created typed interfaces (NumericWidgetOptions, TestWindow,
ImportFailureDetail, etc.)
- Fixed function return types to be non-nullable where appropriate
- Added type guards and null checks instead of non-null assertions
- Used `ComponentProps` from vue-component-type-helpers for component
testing
#### Widget System
- Added index signature to IWidgetOptions for Record compatibility
- Centralized disabled logic in WidgetInputNumberInput
- Moved template type assertions to computed properties
- Fixed ComboWidget getOptionLabel type assertions
- Improved remote widget type handling with runtime checks
#### Services & Stores
- Fixed getOrCreateViewer to return non-nullable values
- Updated addNodeOnGraph to use specific options type `{ pos?: Point }`
- Added proper type assertions for settings store retrieval
- Fixed executionIdToCurrentId return type (string | undefined)
#### Test Infrastructure
- Exported GraphOrSubgraph from litegraph barrel to avoid circular
dependencies
- Updated test fixtures with proper TypeScript types (TestInfo,
LGraphNode)
- Replaced loose Record types with ComponentProps in tests
- Added proper error handling in WebSocket fixture
#### Code Organization
- Created shared i18n-types module for locale data types
- Made ImportFailureDetail non-exported (internal use only)
- Added @public JSDoc tag to ElectronWindow type
- Fixed console.log usage in scripts to use allowed methods
### Files Changed
**Widgets & Components:**
-
src/renderer/extensions/vueNodes/widgets/components/WidgetInputNumberInput.vue
-
src/renderer/extensions/vueNodes/widgets/components/WidgetSelectDefault.vue
-
src/renderer/extensions/vueNodes/widgets/components/WidgetSelectDropdown.vue
- src/renderer/extensions/vueNodes/widgets/components/WidgetTextarea.vue
-
src/renderer/extensions/vueNodes/widgets/composables/useRemoteWidget.ts
- src/lib/litegraph/src/widgets/ComboWidget.ts
- src/lib/litegraph/src/types/widgets.ts
- src/components/common/LazyImage.vue
- src/components/load3d/Load3dViewerContent.vue
**Services & Stores:**
- src/services/litegraphService.ts
- src/services/load3dService.ts
- src/services/colorPaletteService.ts
- src/stores/maskEditorStore.ts
- src/stores/nodeDefStore.ts
- src/platform/settings/settingStore.ts
- src/platform/workflow/management/stores/workflowStore.ts
**Composables & Utils:**
- src/composables/node/useWatchWidget.ts
- src/composables/useCanvasDrop.ts
- src/utils/widgetPropFilter.ts
- src/utils/queueDisplay.ts
- src/utils/envUtil.ts
**Test Files:**
- browser_tests/fixtures/ComfyPage.ts
- browser_tests/fixtures/ws.ts
- browser_tests/tests/actionbar.spec.ts
-
src/workbench/extensions/manager/components/manager/skeleton/PackCardGridSkeleton.test.ts
- src/lib/litegraph/src/subgraph/subgraphUtils.test.ts
- src/components/rightSidePanel/shared.test.ts
- src/platform/cloud/subscription/composables/useSubscription.test.ts
-
src/platform/workflow/persistence/composables/useWorkflowPersistence.test.ts
**Scripts & Types:**
- scripts/i18n-types.ts (new shared module)
- scripts/diff-i18n.ts
- scripts/check-unused-i18n-keys.ts
- src/workbench/extensions/manager/types/conflictDetectionTypes.ts
- src/types/algoliaTypes.ts
- src/types/simplifiedWidget.ts
**Infrastructure:**
- src/lib/litegraph/src/litegraph.ts (added GraphOrSubgraph export)
- src/lib/litegraph/src/infrastructure/CustomEventTarget.ts
- src/platform/assets/services/assetService.ts
**Stories:**
- apps/desktop-ui/src/views/InstallView.stories.ts
- src/components/queue/job/JobDetailsPopover.stories.ts
**Extension Manager:**
- src/workbench/extensions/manager/composables/useConflictDetection.ts
- src/workbench/extensions/manager/composables/useManagerQueue.ts
- src/workbench/extensions/manager/services/comfyManagerService.ts
- src/workbench/extensions/manager/utils/conflictMessageUtil.ts
### Testing
- [x] All TypeScript type checking passes (`pnpm typecheck`)
- [x] ESLint passes without errors (`pnpm lint`)
- [x] Format checks pass (`pnpm format:check`)
- [x] Knip (unused exports) passes (`pnpm knip`)
- [x] Pre-commit and pre-push hooks pass
Part of the "Road to No Explicit Any" initiative.
### Previous PRs in this series:
- Part 2: #7401
- Part 3: #7935
- Part 4: #7970
- Part 5: #8064
- Part 6: #8083
- Part 7: #8092
- Part 8 Group 1: #8253
- Part 8 Group 2: #8258
- Part 8 Group 3: #8304
- Part 8 Group 4: #8314
- Part 8 Group 5: #8329
- Part 8 Group 6: #8344
- Part 8 Group 7: #8459
- Part 8 Group 8: #8496
- Part 9: #8498
- Part 10: #8499
---------
Co-authored-by: Comfy Org PR Bot <snomiao+comfy-pr@gmail.com>
Co-authored-by: christian-byrne <72887196+christian-byrne@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Summary
This PR removes unsafe type assertions ("as unknown as Type") from test files and improves type safety across the codebase.
Key Changes
Type Safety Improvements
as unknown as Typepatterns from test files in Group 8 part 8Files Changed
Test files (Group 8 part 8 - utils and manager composables):
Source files (minor type fixes):
Testing
pnpm typecheck)pnpm test:unit)pnpm lint)pnpm format)Part of the "Road to No Explicit Any" initiative, cleaning up type casting issues from branch
fix/remove-any-types-part8.Previous PRs in this series:
┆Issue is synchronized with this Notion page by Unito