Skip to content

[codex] fix dependency audit issues#2028

Open
elibosley wants to merge 2 commits into
mainfrom
codex/fix-dependency-audit-issues
Open

[codex] fix dependency audit issues#2028
elibosley wants to merge 2 commits into
mainfrom
codex/fix-dependency-audit-issues

Conversation

@elibosley

@elibosley elibosley commented Jun 14, 2026

Copy link
Copy Markdown
Member

Summary

  • Upgrade vulnerable dependency ranges across the workspace and refresh pnpm-lock.yaml.
  • Add a repo audit wrapper that filters ignored CVEs and pnpm's stale actions for ignored advisories/workspace importer false positives.
  • Keep existing dependencies in place rather than removing them, including ip and lodash-es.
  • Fix the Unraid plugins missing-directory test so it uses an isolated temp path.

Validation

  • pnpm run --silent audit --prod
  • pnpm --filter ./api type-check
  • pnpm --filter ./api test

Notes

  • The unpatched ip advisory is ignored through repo audit policy because npm reports no patched version.
  • Native pnpm audit --prod still leaves a stale action for that ignored advisory; use the repo audit script for CI/user checks.

Summary by CodeRabbit

  • Chores

    • Updated project dependencies and tooling across the stack to newer stable releases.
    • Added an audit script that rewrites/filters vulnerability output, including configurable ignores.
  • Tests

    • Improved reliability via stronger filesystem isolation and better environment mocking.
    • Updated sanitization and fetch-related tests, along with updated expectations for callback encryption key behavior.
  • New Features

    • Expanded available network metrics data in the GraphQL schema (including network interface/address details).

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Dependency versions are bumped across all monorepo workspaces (api, shared packages, unraid-ui, web, plugin), promoting @nuxt/ui from 4.0.0-alpha.0 to stable 4.8.2. A new scripts/pnpm-audit.mjs Node.js script post-processes pnpm audit output with CVE/GHSA ignore rules and workspace-importer filtering. DOMPurify is migrated from isomorphic-dompurify, frontend test setup is overhauled with real Response mocks and in-memory storage, type safety improves across composables, Vue components fix event types and client detection, and GraphQL schema extends network interface and metrics types.

Changes

Dependency management and pnpm audit tooling

Layer / File(s) Summary
Root and api/package.json: dependency upgrades and audit config
package.json, api/package.json
Adds scripts.audit pointing to pnpm-audit.mjs, expands pnpm.overrides including @graphql-tools/utils, sets auditConfig.ignoreCves for CVE-2024-29415. Upgrades api @apollo/server 4.x → 5.5.1, NestJS packages to 11.1.26/13.4.2, and runtime/dev deps including casbin, class-validator, fastify, glob, pm2, systeminformation, undici, uuid, ws, vite, vitest, zx.
Shared packages: NestJS and dep alignment
packages/unraid-api-plugin-connect/package.json, packages/unraid-api-plugin-generator/package.json, packages/unraid-api-plugin-health/package.json, packages/unraid-shared/package.json
Aligns NestJS (@nestjs/apollo, @nestjs/common, @nestjs/core, @nestjs/graphql), class-validator, lodash-es, undici, vitest, ws across all shared workspace packages to match api versions.
Frontend workspaces: Nuxt UI, dev tooling, and lib upgrades
unraid-ui/package.json, web/package.json, plugin/package.json
Bumps unraid-ui: dompurify 3.2.6 → 3.4.10, shadcn-vue 2.2.0 → 2.7.4, vue-sonner, and dev tooling. Web: promotes @nuxt/ui 4.0.0-alpha.0 → 4.8.2, bumps ajv, glob, happy-dom, lodash-es, vite, vitest. Plugin: bumps glob, vitest, zx.
pnpm-audit.mjs: audit post-processor with ignore rules
scripts/pnpm-audit.mjs
New CLI script that runs pnpm audit --json, strips workspace-importer actions, applies ignoreCves/ignoreGhsas from pnpm.auditConfig, removes matching advisories, prunes actions with no resolves, recomputes vulnerability metadata, and exits 0 only when no advisories remain.
Test: isolated temp directory for missing-plugin-directory case
api/src/unraid-api/graph/resolvers/unraid-plugins/unraid-plugins.service.spec.ts
Replaces hardcoded /tmp path with mkdtemp-created unique temp directory cleaned up in a finally block.

Frontend refactoring: Nuxt UI 4.8.2, DOMPurify, types, and components

Layer / File(s) Summary
Nuxt UI 4.8.2 upgrade: auto-imports, components, and vite config
web/auto-imports.d.ts, web/components.d.ts, unraid-ui/vite.config.ts
Regenerates global declarations for Nuxt UI composables and components to reference @nuxt/ui 4.8.2 paths. Updates vite-plugin-dts to use outDirs: ['dist'] and bundleTypes: { bundledPackages: [] }.
DOMPurify migration and test setup overhaul
web/src/composables/useContentHighlighting.ts, web/src/helpers/markdown.ts, web/__test__/components/Logs/SingleLogViewer.test.ts, web/__test__/setup.ts, web/__test__/components/SsoButton.test.ts, web/__test__/helpers/markdown.test.ts, web/__test__/store/callbackActions.test.ts, web/vitest.config.ts, web/vitest.setup.ts
Switches DOMPurify from isomorphic-dompurify to dompurify. Overhauls test setup with real Response('{}') fetch mock, preconnect function, in-memory MemoryStorage for localStorage/sessionStorage, and jsdom-backed dompurify instance. Adds happyDOM.url config, fixes SsoButton mock cleanup, and updates markdown sanitization assertions.
Type system: ContextMenuOptions and dropdown item alignment
web/src/composables/useContextMenu.ts, web/src/composables/useDockerRowActions.ts
useContextMenu types items as DropdownMenuItem[][] instead of unknown[][]. useDockerRowActions replaces custom ActionDropdownItem shape with DropdownMenuItem alias from @nuxt/ui.
Vue components: event types, client detection, and emit handling
unraid-ui/src/components/common/accordion/Accordion.vue, web/src/components/Common/ResizableSlideover.vue, web/src/components/Docker/DockerContainerManagement.vue, web/src/components/Onboarding/components/InternalBootConfirmDialog.vue, web/src/store/callbackActions.ts
Accordion.vue allows undefined in update:modelValue event type. ResizableSlideover.vue introduces isClient guard for document.body style mutations. DockerContainerManagement.vue simplifies USkeleton props. InternalBootConfirmDialog.vue extracts handleOpenChange helper. callbackActions.ts derives callbackEncryptionKey constant with empty-string default.
GraphQL schema: network interface and metrics types
web/src/composables/gql/graphql.ts
Expands InfoNetworkInterface with interface attributes and new ipv4Addresses/ipv6Addresses collections. Introduces InfoNetworkIpv4Address, InfoNetworkIpv6Address, and NetworkMetrics types. Adds network: Array<NetworkMetrics> to Metrics. Extends Query with networkInterfaces and Subscription with systemMetricsNetwork.

Miscellaneous

Layer / File(s) Summary
Documentation: remove server restart guidance
AGENTS.md
Removes instruction to never run or restart the API/web server.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 The versions all hop to the latest release,
From alpha to stable, the updates don't cease!
Apollo climbs high, NestJS leaps far,
DOMPurify shines like a bright evening star.
Network metrics flow through a GraphQL stream,
While audit scripts guard our dependency dream! 🌿✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[codex] fix dependency audit issues' clearly summarizes the main objective of the PR: addressing dependency audit vulnerabilities through upgrades and a new audit filtering script.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-dependency-audit-issues

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Storybook has been deployed to staging: https://unraid-ui-storybook-staging.unraid-workers.workers.dev

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@api/src/unraid-api/graph/resolvers/unraid-plugins/unraid-plugins.service.spec.ts`:
- Around line 170-175: Replace the mock ConfigService object creation that uses
the `as unknown as ConfigService` casting pattern with the `vi.spyOn()` approach
to maintain type safety and avoid unsafe casting. The current pattern at the
configService initialization violates type safety guidelines. Instead of
creating a mock object and casting it, use the spy approach demonstrated in the
existing test setup to properly mock the ConfigService without bypassing
TypeScript's type checking. Apply this fix consistently wherever this pattern
appears in the test file.

In `@scripts/pnpm-audit.mjs`:
- Around line 9-13: The spawnSync call for the pnpm audit command in the audit
function does not specify an explicit maxBuffer option, which defaults to 1 MB
and can be exceeded by large audit payloads, causing stdout truncation and
JSON.parse failures. Add a maxBuffer property to the options object passed to
spawnSync with a significantly larger value (such as 10 MB or higher) to
accommodate large audit output without truncation.

In `@unraid-ui/package.json`:
- Line 89: The devDependencies for ajv has been upgraded to 8.20.0, but the
peerDependencies.ajv is still pinned to 8.17.1, creating a version mismatch.
Update the peerDependencies.ajv version from 8.17.1 to 8.20.0 to align with the
upgraded devDependencies version and match what is being consumed in
web/package.json.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 869d8a80-ee9e-4352-9190-bb46f85b2e2b

📥 Commits

Reviewing files that changed from the base of the PR and between 6f94aa1 and 58b6f3b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • api/package.json
  • api/src/unraid-api/graph/resolvers/unraid-plugins/unraid-plugins.service.spec.ts
  • package.json
  • packages/unraid-api-plugin-connect/package.json
  • packages/unraid-api-plugin-generator/package.json
  • packages/unraid-api-plugin-health/package.json
  • packages/unraid-shared/package.json
  • plugin/package.json
  • scripts/pnpm-audit.mjs
  • unraid-ui/package.json
  • web/package.json

Comment on lines +170 to +175
const configService = {
get: vi.fn().mockReturnValue({
'dynamix-base': join(tempDir, 'missing', 'dynamix-base'),
}),
} as unknown as ConfigService;
const configuredService = new UnraidPluginsService(configService);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -nP "as\\s+unknown\\s+as\\s+ConfigService|\\bas\\s+any\\b" api/src/unraid-api/graph/resolvers/unraid-plugins/unraid-plugins.service.spec.ts

Repository: unraid/api

Length of output: 286


🏁 Script executed:

# Get the full context around lines 170-175 and examine surrounding test structure
sed -n '150,180p' api/src/unraid-api/graph/resolvers/unraid-plugins/unraid-plugins.service.spec.ts | cat -n

Repository: unraid/api

Length of output: 1650


🏁 Script executed:

# Check the imports and ConfigService definition in this test file
head -40 api/src/unraid-api/graph/resolvers/unraid-plugins/unraid-plugins.service.spec.ts | cat -n

Repository: unraid/api

Length of output: 1690


🏁 Script executed:

# Verify all instances of casting pattern and understand test structure
grep -n -B2 -A2 "as unknown as" api/src/unraid-api/graph/resolvers/unraid-plugins/unraid-plugins.service.spec.ts

Repository: unraid/api

Length of output: 1024


🏁 Script executed:

# Check ConfigService definition and whether it can be instantiated directly
fd -t f ConfigService.ts$ | head -5 | xargs cat -n 2>/dev/null | head -80

Repository: unraid/api

Length of output: 36


Remove unnecessary casting of mock ConfigService

The as unknown as ConfigService pattern bypasses type safety and violates the coding guideline to avoid casting. Use direct instantiation with vi.spyOn() instead, as demonstrated by the existing test setup at line 34.

This casting pattern appears at multiple locations in the test file (lines 157, 174, 193) and should be addressed consistently.

Example fix
-            const configService = {
-                get: vi.fn().mockReturnValue({
-                    'dynamix-base': join(tempDir, 'missing', 'dynamix-base'),
-                }),
-            } as unknown as ConfigService;
+            const configService = new ConfigService();
+            vi.spyOn(configService, 'get').mockReturnValue({
+                'dynamix-base': join(tempDir, 'missing', 'dynamix-base'),
+            });
             const configuredService = new UnraidPluginsService(configService);
📝 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.

Suggested change
const configService = {
get: vi.fn().mockReturnValue({
'dynamix-base': join(tempDir, 'missing', 'dynamix-base'),
}),
} as unknown as ConfigService;
const configuredService = new UnraidPluginsService(configService);
const configService: Partial<ConfigService> = {
get: vi.fn().mockReturnValue({
'dynamix-base': join(tempDir, 'missing', 'dynamix-base'),
}),
};
const configuredService = new UnraidPluginsService(configService as ConfigService);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@api/src/unraid-api/graph/resolvers/unraid-plugins/unraid-plugins.service.spec.ts`
around lines 170 - 175, Replace the mock ConfigService object creation that uses
the `as unknown as ConfigService` casting pattern with the `vi.spyOn()` approach
to maintain type safety and avoid unsafe casting. The current pattern at the
configService initialization violates type safety guidelines. Instead of
creating a mock object and casting it, use the spy approach demonstrated in the
existing test setup to properly mock the ConfigService without bypassing
TypeScript's type checking. Apply this fix consistently wherever this pattern
appears in the test file.

Source: Coding guidelines

Comment thread scripts/pnpm-audit.mjs
Comment on lines +9 to +13
const audit = spawnSync('pnpm', ['audit', '--json', ...args], {
cwd,
encoding: 'utf8',
stdio: ['ignore', 'pipe', 'pipe'],
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

What is the default maxBuffer for Node.js child_process.spawnSync, and what happens when stdout/stderr exceed that limit?

💡 Result:

The default maxBuffer for child_process.spawnSync in Node.js is 1024 * 1024 bytes (1 MB) [1][2]. When the amount of data written to stdout or stderr exceeds this limit, the child process is terminated, and any accumulated output is truncated [1][3]. The method will return an object containing the process's exit information, and the error property will typically reflect that the buffer limit was exceeded (often resulting in an ENOBUFS error) [4].

Citations:


🏁 Script executed:

cat -n scripts/pnpm-audit.mjs | head -40

Repository: unraid/api

Length of output: 1379


🏁 Script executed:

cat -n scripts/pnpm-audit.mjs | tail -n +40

Repository: unraid/api

Length of output: 6133


Set an explicit maxBuffer for spawnSync audit output.

The default maxBuffer limit of 1 MB can be exceeded by large audit payloads, causing stdout to be truncated and JSON.parse to fail silently on line 22.

Suggested fix
 const audit = spawnSync('pnpm', ['audit', '--json', ...args], {
   cwd,
   encoding: 'utf8',
+  maxBuffer: 10 * 1024 * 1024,
   stdio: ['ignore', 'pipe', 'pipe'],
 });
📝 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.

Suggested change
const audit = spawnSync('pnpm', ['audit', '--json', ...args], {
cwd,
encoding: 'utf8',
stdio: ['ignore', 'pipe', 'pipe'],
});
const audit = spawnSync('pnpm', ['audit', '--json', ...args], {
cwd,
encoding: 'utf8',
maxBuffer: 10 * 1024 * 1024,
stdio: ['ignore', 'pipe', 'pipe'],
});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/pnpm-audit.mjs` around lines 9 - 13, The spawnSync call for the pnpm
audit command in the audit function does not specify an explicit maxBuffer
option, which defaults to 1 MB and can be exceeded by large audit payloads,
causing stdout truncation and JSON.parse failures. Add a maxBuffer property to
the options object passed to spawnSync with a significantly larger value (such
as 10 MB or higher) to accommodate large audit output without truncation.

Comment thread unraid-ui/package.json
"@vue/test-utils": "2.4.6",
"@vue/tsconfig": "0.8.1",
"ajv": "8.17.1",
"ajv": "8.20.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo -e "package\tpeerAjv\tdepAjv\tdevAjv"
jq -r '
  .name as $name
  | [
      $name,
      (.peerDependencies.ajv // "none"),
      (.dependencies.ajv // "none"),
      (.devDependencies.ajv // "none")
    ]
  | `@tsv`
' unraid-ui/package.json web/package.json

Repository: unraid/api

Length of output: 143


Align ajv peer dependency with the upgraded dev/consumer version.

Line 89 upgrades devDependencies.ajv to 8.20.0, but peerDependencies.ajv remains pinned to 8.17.1. The web/package.json package consumes ajv@8.20.0, creating a peer contract mismatch across workspaces.

Proposed fix
   "peerDependencies": {
-    "ajv": "8.17.1",
+    "ajv": "8.20.0",
     "tailwindcss": "4.1.12",
     "vue": "3.5.20"
   },
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@unraid-ui/package.json` at line 89, The devDependencies for ajv has been
upgraded to 8.20.0, but the peerDependencies.ajv is still pinned to 8.17.1,
creating a version mismatch. Update the peerDependencies.ajv version from 8.17.1
to 8.20.0 to align with the upgraded devDependencies version and match what is
being consumed in web/package.json.

@elibosley elibosley force-pushed the codex/fix-dependency-audit-issues branch from 58b6f3b to a421619 Compare June 14, 2026 14:09
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Storybook has been deployed to staging: https://unraid-ui-storybook-staging.unraid-workers.workers.dev

@elibosley elibosley force-pushed the codex/fix-dependency-audit-issues branch from a421619 to 0baec05 Compare June 14, 2026 14:19
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Storybook has been deployed to staging: https://unraid-ui-storybook-staging.unraid-workers.workers.dev

@codecov

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.64%. Comparing base (6f94aa1) to head (b7681c0).

Files with missing lines Patch % Lines
web/__test__/setup.ts 0.00% 5 Missing ⚠️
web/src/components/Common/ResizableSlideover.vue 0.00% 3 Missing ⚠️
...d-ui/src/components/common/accordion/Accordion.vue 0.00% 2 Missing ⚠️
...nboarding/components/InternalBootConfirmDialog.vue 50.00% 2 Missing ⚠️
...rc/components/Docker/DockerContainerManagement.vue 0.00% 1 Missing ⚠️
web/src/composables/useContextMenu.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2028      +/-   ##
==========================================
+ Coverage   52.63%   52.64%   +0.01%     
==========================================
  Files        1035     1035              
  Lines       72034    72038       +4     
  Branches     8248     8253       +5     
==========================================
+ Hits        37917    37927      +10     
+ Misses      33991    33985       -6     
  Partials      126      126              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL:

https://preview.dl.unraid.net/unraid-api/tag/PR2028/dynamix.unraid.net.plg

@elibosley elibosley marked this pull request as ready for review June 14, 2026 14:28

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0baec05c03

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/pnpm-audit.mjs
updateVulnerabilityMetadata(report);

process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
process.exitCode = Object.keys(report.advisories ?? {}).length === 0 ? 0 : (audit.status ?? 1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve audit failures for registry errors

When pnpm audit --json returns a JSON error object instead of an advisory list, this line treats the missing advisories object as empty and exits 0. I reproduced this with the current registry 403 response: node scripts/pnpm-audit.mjs printed ERR_PNPM_AUDIT_BAD_RESPONSE but returned success; pnpm audit --help documents --ignore-registry-errors as the option that should make registry errors exit 0, so without that flag CI will now pass even though the audit did not complete.

Useful? React with 👍 / 👎.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Storybook has been deployed to staging: https://unraid-ui-storybook-staging.unraid-workers.workers.dev

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@unraid-ui/src/components/common/accordion/Accordion.vue`:
- Around line 33-35: The watcher that handles `modelValue` changes currently
blocks `undefined` values with an `if (val !== undefined)` guard check,
preventing the parent from clearing or resetting the internal `openValue` state
in controlled mode. Remove or adjust the guard condition that skips `undefined`
values so that when `modelValue` is set to `undefined`, it properly propagates
to `openValue` to maintain controlled sync semantics. Apply the same fix to any
other watchers or handlers in the Accordion component that have similar guard
conditions blocking `undefined` (mentioned as also applying to the 52-55 range).

In `@unraid-ui/vite.config.ts`:
- Around line 33-36: Fix the vite-plugin-dts configuration in vite.config.ts to
match the v5.0.2 API. Change the property outDirs (which is an array) to the
singular property outDir with a string value of 'dist'. Additionally, replace
the bundleTypes object structure (containing the non-existent bundledPackages
property) with a boolean value of false, or remove the bundleTypes configuration
entirely since false is the default in this API version.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: bcb965b8-33c9-4b8a-98ba-201fdefdc943

📥 Commits

Reviewing files that changed from the base of the PR and between 58b6f3b and b7681c0.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • web/__test__/helpers/__snapshots__/markdown.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (32)
  • AGENTS.md
  • api/package.json
  • api/src/unraid-api/graph/resolvers/unraid-plugins/unraid-plugins.service.spec.ts
  • package.json
  • packages/unraid-api-plugin-connect/package.json
  • packages/unraid-api-plugin-generator/package.json
  • packages/unraid-api-plugin-health/package.json
  • packages/unraid-shared/package.json
  • plugin/package.json
  • scripts/pnpm-audit.mjs
  • unraid-ui/package.json
  • unraid-ui/src/components/common/accordion/Accordion.vue
  • unraid-ui/vite.config.ts
  • web/__test__/components/Logs/SingleLogViewer.test.ts
  • web/__test__/components/SsoButton.test.ts
  • web/__test__/helpers/markdown.test.ts
  • web/__test__/setup.ts
  • web/__test__/store/callbackActions.test.ts
  • web/auto-imports.d.ts
  • web/components.d.ts
  • web/package.json
  • web/src/components/Common/ResizableSlideover.vue
  • web/src/components/Docker/DockerContainerManagement.vue
  • web/src/components/Onboarding/components/InternalBootConfirmDialog.vue
  • web/src/composables/gql/graphql.ts
  • web/src/composables/useContentHighlighting.ts
  • web/src/composables/useContextMenu.ts
  • web/src/composables/useDockerRowActions.ts
  • web/src/helpers/markdown.ts
  • web/src/store/callbackActions.ts
  • web/vitest.config.ts
  • web/vitest.setup.ts
💤 Files with no reviewable changes (1)
  • AGENTS.md
✅ Files skipped from review due to trivial changes (8)
  • web/src/helpers/markdown.ts
  • web/src/components/Docker/DockerContainerManagement.vue
  • web/src/composables/useContentHighlighting.ts
  • web/test/store/callbackActions.test.ts
  • packages/unraid-api-plugin-generator/package.json
  • web/components.d.ts
  • web/src/composables/gql/graphql.ts
  • web/auto-imports.d.ts
🚧 Files skipped from review as they are similar to previous changes (10)
  • plugin/package.json
  • api/src/unraid-api/graph/resolvers/unraid-plugins/unraid-plugins.service.spec.ts
  • packages/unraid-api-plugin-health/package.json
  • packages/unraid-api-plugin-connect/package.json
  • package.json
  • packages/unraid-shared/package.json
  • unraid-ui/package.json
  • api/package.json
  • scripts/pnpm-audit.mjs
  • web/package.json

Comment on lines 33 to 35
const emit = defineEmits<{
'update:modelValue': [value: string | string[]];
'update:modelValue': [value: string | string[] | undefined];
}>();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

modelValue = undefined can no longer clear internal state in controlled mode

After widening update:modelValue to include undefined, the watcher still ignores undefined (if (val !== undefined) on Line 42), so a parent-driven clear/reset won’t propagate to openValue. This breaks controlled sync semantics.

Suggested fix
 watch(
   () => props.modelValue,
   (val) => {
-    if (val !== undefined) openValue.value = val;
+    openValue.value = val;
   }
 );

Also applies to: 52-55

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@unraid-ui/src/components/common/accordion/Accordion.vue` around lines 33 -
35, The watcher that handles `modelValue` changes currently blocks `undefined`
values with an `if (val !== undefined)` guard check, preventing the parent from
clearing or resetting the internal `openValue` state in controlled mode. Remove
or adjust the guard condition that skips `undefined` values so that when
`modelValue` is set to `undefined`, it properly propagates to `openValue` to
maintain controlled sync semantics. Apply the same fix to any other watchers or
handlers in the Accordion component that have similar guard conditions blocking
`undefined` (mentioned as also applying to the 52-55 range).

Comment thread unraid-ui/vite.config.ts
Comment on lines +33 to +36
outDirs: ['dist'],
bundleTypes: {
bundledPackages: [],
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check vite-plugin-dts version and verify API compatibility
cat unraid-ui/package.json | jq -r '.devDependencies["vite-plugin-dts"]'

# Search for other vite-plugin-dts usage patterns
rg -nC3 'vite-plugin-dts|from.*dts' unraid-ui/

Repository: unraid/api

Length of output: 863


🏁 Script executed:

cat -n unraid-ui/vite.config.ts | head -50

Repository: unraid/api

Length of output: 1921


🌐 Web query:

vite-plugin-dts 5.0.2 API configuration outDirs bundleTypes

💡 Result:

In vite-plugin-dts, there are no specific configuration options named outDirs or bundleTypes [1][2]. It appears these may be confused with other settings or older plugin versions: Regarding bundling types: The functionality to bundle all type declaration files into a single file is controlled by the rollupTypes option, not bundleTypes [1][2]. When set to true, the plugin uses @microsoft/api-extractor to perform the bundling [1][2]. Example usage: import dts from 'vite-plugin-dts'; export default defineConfig({ plugins: [dts({ rollupTypes: true })], }); Regarding output directories: The plugin does not provide an outDirs option. The output directory for declaration files is generally determined by your Vite build configuration (typically build.outDir) and the plugin's default behavior of following your source file structure [3][1]. If you need to restrict output, the plugin provides a strictOutput option (default: true), which ensures that generated declaration files remain within the configured outDir [2].

Citations:


🌐 Web query:

vite-plugin-dts 5.0.2 changelog release notes

💡 Result:

vite-plugin-dts version 5.0.2 was released on June 1, 2026 [1][2][3]. As of the 5.x major release, the project has evolved into unplugin-dts [4]. While vite-plugin-dts remains available as a package, it is now maintained within the unplugin-dts repository [1][4]. The 5.0.2 update includes the following key changes: Bug Fixes: - Re-emits declarations when non-type files change during watch mode [5][6]. - Fixes a getResolvedModule error that occurred when bundling dts files outside of the src directory [5][6]. - Adds a.js extension to synthetic entry imports to support nodenext module resolution [5][6]. Additional Changes: - Version 5.0.2 also includes an internal update to bump the minimum Node.js requirement to version 20 or higher [3]. For users migrating or seeking the most versatile version of the plugin, the author recommends transitioning to the unplugin-dts package, which supports Vite, Rollup, Rolldown, Webpack, Rspack, and Esbuild [4].

Citations:


🌐 Web query:

site:github.com vite-plugin-dts v5.0.2 API options

💡 Result:

In vite-plugin-dts version 5.x, the plugin core was migrated to unplugin-dts [1][2]. A primary breaking change in this version is the renaming of the rollupTypes option to bundleTypes [1]. Key API options for vite-plugin-dts v5.0.2 include: bundleTypes: A boolean (default: false) that enables type bundling. When set to true, it utilizes @microsoft/api-extractor to merge all declaration files into a single file [3]. tsconfigPath: A string used to specify the path to your tsconfig.json file. The plugin uses this to resolve include and exclude patterns [3][4]. outDir: Specifies the output directory for generated declaration files. This can be a string, an array of strings, or an object/array of objects to control module formats (e.g., { dir: 'dist', moduleFormat: 'esm' }) [4][5]. entryRoot: Overrides the root path of entry files, which is particularly useful in monorepo structures [4][5]. strictOutput: A boolean (default: true) that, when enabled, ignores generated declaration files that fall outside the specified outDir [4][5]. processor: Specifies the processing mode, accepting either 'ts' or 'vue' [4][5]. compilerOptions: Allows overriding TypeScript compilerOptions [4][5]. resolvers: An array for specifying custom resolvers [4][5]. For migration from version 4.x, note that the rollupTypes option has been removed in favor of bundleTypes [1]. Additionally, ensure that your project dependencies align with the updated requirements, as v5+ often requires peer dependencies like @microsoft/api-extractor and rollup [1].

Citations:


Fix vite-plugin-dts configuration for v5.0.2 API.

In vite-plugin-dts v5.0.2, bundleTypes is a boolean (not an object), and the option is outDir (singular, not outDirs). The current configuration is invalid:

  • outDirs: ['dist'] should be outDir: 'dist'
  • bundleTypes: { bundledPackages: [] } should be bundleTypes: false (or omitted, since false is the default)

The bundledPackages property does not exist in this API version.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@unraid-ui/vite.config.ts` around lines 33 - 36, Fix the vite-plugin-dts
configuration in vite.config.ts to match the v5.0.2 API. Change the property
outDirs (which is an array) to the singular property outDir with a string value
of 'dist'. Additionally, replace the bundleTypes object structure (containing
the non-existent bundledPackages property) with a boolean value of false, or
remove the bundleTypes configuration entirely since false is the default in this
API version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant