Skip to content

Add ESLint, compose-builder, YAML utils & tests#16

Merged
hhftechnology merged 8 commits into
mainfrom
dev-ui
May 11, 2026
Merged

Add ESLint, compose-builder, YAML utils & tests#16
hhftechnology merged 8 commits into
mainfrom
dev-ui

Conversation

@hhftechnology
Copy link
Copy Markdown
Owner

@hhftechnology hhftechnology commented May 11, 2026

Introduce a project-wide ESLint configuration with TypeScript/React rules (including a ban on direct useEffect and inline style object literals) and file-specific overrides. Update index.html to add theme-color meta tags and preload Google fonts. Expand package.json with new scripts (lint, typecheck, validate, extended test commands) and bump/add dev/dependencies for testing, linting, Radix UI, TanStack and tooling. Add many new components and tests (BrandMark, SetupSidebar, compose-builder UI and ServiceForm tabs, VPN tab, CodeMirror runtime, ThemeProvider, template UI and tests, icons), update existing components (CodeEditor, ConversionDialog, Header, Footer, MetaTags, SidebarUI) and hooks/routes. Add YAML generator and related utils, validation schemas, and numerous unit tests and fixtures. Misc: update tsconfig/vite config and styles.

Summary by CodeRabbit

  • New Features

    • Added Blueprint Builder for managing containerized application resources and configurations.
    • Enhanced theme system with improved light and dark mode support.
  • Improvements

    • Redesigned form validation with visual feedback across all builders.
    • Refreshed visual design with updated color tokens and typography.
    • Enhanced template store with better filtering and caching.
    • Improved sidebar navigation and responsive layout.

Review Change Stack

Introduce a project-wide ESLint configuration with TypeScript/React rules (including a ban on direct useEffect and inline style object literals) and file-specific overrides. Update index.html to add theme-color meta tags and preload Google fonts. Expand package.json with new scripts (lint, typecheck, validate, extended test commands) and bump/add dev/dependencies for testing, linting, Radix UI, TanStack and tooling. Add many new components and tests (BrandMark, SetupSidebar, compose-builder UI and ServiceForm tabs, VPN tab, CodeMirror runtime, ThemeProvider, template UI and tests, icons), update existing components (CodeEditor, ConversionDialog, Header, Footer, MetaTags, SidebarUI) and hooks/routes. Add YAML generator and related utils, validation schemas, and numerous unit tests and fixtures. Misc: update tsconfig/vite config and styles.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces significant structural changes, including a new ESLint configuration, a custom 'no-magic-css' enforcement script, and a refactor of the service form API to use React Context. It also updates several dependencies and adds new components for the UI. My review highlights critical issues with non-existent package versions in package.json that will cause installation failures. Additionally, I identified a violation of React's pure rendering principle in MetaTags.tsx due to direct DOM mutation, a potential memory leak in CodeEditor.tsx due to an unmanaged setTimeout, and a concern regarding the use of any types in the new service-form-api context.

Comment thread package.json
Comment on lines +82 to +85
"typescript": "^6.0.3",
"typescript-eslint": "^8.59.2",
"vite": "^8.0.11",
"vitest": "^4.1.5",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

Several dependency versions specified here (TypeScript ^6.0.3, Vite ^8.0.11, Vitest ^4.1.5) do not exist as stable releases. Using these hallucinated version numbers will cause installation failures. Please revert these to the latest stable versions.

Suggested change
"typescript": "^6.0.3",
"typescript-eslint": "^8.59.2",
"vite": "^8.0.11",
"vitest": "^4.1.5",
"typescript": "^5.7.2",
"typescript-eslint": "^8.24.0",
"vite": "^6.1.0",
"vitest": "^3.0.5",

Comment thread package.json
"@vitejs/plugin-react": "^6.0.1",
"@vitest/coverage-v8": "^4.1.5",
"@vitest/ui": "^4.1.5",
"eslint": "^10.3.0",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

ESLint version ^10.3.0 does not exist. The current stable version is 9.x.

Suggested change
"eslint": "^10.3.0",
"eslint": "^9.20.0",

Comment thread package.json
"clsx": "^2.1.1",
"js-yaml": "^4.1.0",
"lucide-react": "^0.556.0",
"lucide-react": "^1.14.0",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The version for lucide-react (^1.14.0) is incorrect; the current stable versioning is in the 0.x range.

Suggested change
"lucide-react": "^1.14.0",
"lucide-react": "^0.475.0",

Comment thread src/components/MetaTags.tsx Outdated
Comment on lines +36 to +38
if (typeof document !== "undefined") {
updateMetaTags(config);
}, [pathname, title, description, image, type]);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Mutating the document object directly during the render phase is a side effect that violates React's pure rendering principle. This can lead to inconsistent UI states, especially with Concurrent Mode or Strict Mode. Side effects should be handled in useEffect or a similar hook. Since direct useEffect is restricted in this project, consider using a custom hook that wraps it or a dedicated library for head management.

Comment thread src/components/CodeEditor.tsx Outdated
try {
await navigator.clipboard.writeText(content);
setCopied(true);
window.setTimeout(() => setCopied(false), 2000);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The window.setTimeout call here does not have a corresponding cleanup mechanism. If the component unmounts before the timeout fires, the callback will still execute and attempt to update the state of an unmounted component. It is recommended to store the timeout ID in a ref and clear it on unmount.

import type { ServiceConfig, Healthcheck } from "../../types/compose";

// eslint-disable-next-line @typescript-eslint/no-explicit-any
type Any = any;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Defining type Any = any and using it throughout the API effectively bypasses the @typescript-eslint/no-explicit-any rule. It is better to define proper interfaces for the service configuration and field values to leverage TypeScript's type safety, especially since this is a core part of the new builder logic.

Introduce a new Blueprint Builder feature and validation UI across the app. Adds a /blueprint-builder route and full builder UI (src/routes/blueprint-builder.tsx) plus blueprint types (src/types/blueprint.ts), generator/validator utils and tests (src/utils/blueprint/* and __tests__), and styles for the builder. Add a shadcn-compatible ValidatedShadField component and wire validated inputs (ValidatedShadField / ValidatedInput) into Network, Volume and VPN forms to provide inline validation and accessibility hints (aria-invalid/title). Template detail modal now pre-validates compose YAML and shows a validation banner and prevents import of invalid templates. Update header, sidebar and route tree to surface the new Blueprint nav item. Also add/adjust various validation helpers and small UX/accessibility tweaks (copy/download handlers, error titles).
@vercel
Copy link
Copy Markdown

vercel Bot commented May 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dock-dploy Ready Ready Preview, Comment May 11, 2026 11:16pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

Warning

Rate limit exceeded

@hhftechnology has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 35 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4f572095-c11e-43bd-a4c5-d36f18483ced

📥 Commits

Reviewing files that changed from the base of the PR and between 2b95bec and f81224a.

⛔ Files ignored due to path filters (3)
  • package-lock.json is excluded by !**/package-lock.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • src/utils/__tests__/__snapshots__/generators.golden.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (100)
  • .github/workflows/docker-build-push.yml
  • Dockerfile
  • eslint.config.js
  • index.html
  • package.json
  • scripts/check-no-magic-css.mjs
  • src/__tests__/fixtures.ts
  • src/__tests__/setup.ts
  • src/components/BrandMark.tsx
  • src/components/CodeEditor.tsx
  • src/components/CodeMirrorRuntime.tsx
  • src/components/ConversionDialog.tsx
  • src/components/Footer.tsx
  • src/components/Header.tsx
  • src/components/MetaTags.tsx
  • src/components/SetupSidebar.tsx
  • src/components/SidebarUI.tsx
  • src/components/ThemeProvider.tsx
  • src/components/__tests__/BrandMark.test.tsx
  • src/components/__tests__/ServicesTab.test.tsx
  • src/components/__tests__/SetupSidebar.test.tsx
  • src/components/compose-builder/CodePanel.tsx
  • src/components/compose-builder/ConfigColumn/NetworksTab.tsx
  • src/components/compose-builder/ConfigColumn/ServicesTab.tsx
  • src/components/compose-builder/ConfigColumn/VolumesTab.tsx
  • src/components/compose-builder/ConfigColumn/index.tsx
  • src/components/compose-builder/NetworkForm.tsx
  • src/components/compose-builder/ServiceForm.tsx
  • src/components/compose-builder/ServiceForm/BasicsTab.tsx
  • src/components/compose-builder/ServiceForm/EnvironmentTab.tsx
  • src/components/compose-builder/ServiceForm/Field.tsx
  • src/components/compose-builder/ServiceForm/HealthTab.tsx
  • src/components/compose-builder/ServiceForm/NetworkTab.tsx
  • src/components/compose-builder/ServiceForm/index.tsx
  • src/components/compose-builder/ServiceListSidebar.tsx
  • src/components/compose-builder/VolumeForm.tsx
  • src/components/compose-builder/VpnConfigSection.tsx
  • src/components/compose-builder/VpnTab/VpnFields.tsx
  • src/components/compose-builder/VpnTab/VpnProviderTiles.tsx
  • src/components/compose-builder/VpnTab/index.tsx
  • src/components/compose-builder/service-form-api.tsx
  • src/components/icons/BrandIcons.tsx
  • src/components/templates/TemplateCard.tsx
  • src/components/templates/TemplateDetailModal.tsx
  • src/components/templates/TemplateStoreModal.tsx
  • src/components/templates/__tests__/TemplateCard.test.tsx
  • src/components/templates/__tests__/TemplateStoreModal.test.tsx
  • src/components/ui/sidebar.tsx
  • src/components/ui/validated-field.tsx
  • src/hooks/__tests__/useConversionDialog.test.ts
  • src/hooks/__tests__/useMountEffect.test.tsx
  • src/hooks/__tests__/useSelectionState.test.ts
  • src/hooks/__tests__/useTemplateStore.test.ts
  • src/hooks/__tests__/useVpnConfig.test.ts
  • src/hooks/__tests__/useYamlValidation.test.ts
  • src/hooks/use-mobile.ts
  • src/hooks/use-search-params.ts
  • src/hooks/useConversionDialog.ts
  • src/hooks/useMountEffect.ts
  • src/hooks/useTemplateStore.ts
  • src/hooks/useVpnConfig.ts
  • src/hooks/useYamlValidation.ts
  • src/routeTree.gen.ts
  • src/routes/__root.tsx
  • src/routes/blueprint-builder.tsx
  • src/routes/config-builder.tsx
  • src/routes/docker/compose-builder.tsx
  • src/routes/index.tsx
  • src/routes/scheduler-builder.tsx
  • src/styles.css
  • src/types/blueprint.ts
  • src/types/vpn-configs.ts
  • src/utils/__tests__/generators.golden.test.ts
  • src/utils/__tests__/template-import.test.ts
  • src/utils/__tests__/validation.test.ts
  • src/utils/blueprint/__tests__/generator.test.ts
  • src/utils/blueprint/__tests__/golden.test.ts
  • src/utils/blueprint/__tests__/validator.test.ts
  • src/utils/blueprint/generator.ts
  • src/utils/blueprint/validator.ts
  • src/utils/converters.ts
  • src/utils/default-configs.ts
  • src/utils/template-import.ts
  • src/utils/validation.ts
  • src/utils/validation/__tests__/compose.test.ts
  • src/utils/validation/__tests__/vpn.test.ts
  • src/utils/validation/compose.ts
  • src/utils/validation/schemas.ts
  • src/utils/validation/vpn.ts
  • src/utils/vpn-generator.ts
  • src/utils/yaml-generator.ts
  • src/utils/yaml/command.ts
  • src/utils/yaml/index.ts
  • src/utils/yaml/network.ts
  • src/utils/yaml/service.ts
  • src/utils/yaml/stringify.ts
  • src/utils/yaml/volume.ts
  • src/utils/yaml/vpn.ts
  • tsconfig.json
  • vite.config.ts
📝 Walkthrough

Walkthrough

Adds blueprint builder and refactors compose/config/scheduler builders. Introduces YAML generation and Zod-based validation, updates hooks and UI components, overhauls styles with tokens, adds tooling (ESLint and CSS checker), updates index.html/package.json, and expands tests/fixtures.

Changes

End-to-end platform update

Layer / File(s) Summary
Unified functional review path
...
End-to-end changes across routes/components, YAML/validation, hooks, styles/tokens, tooling, and tests.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Poem

I twitch my whiskers at tokens that glow,
Blueprints bloom, and YAML streams flow.
Hooks hop neatly, validators chime,
Builders compose in elegant time.
With linted luck and tests in tow—
Ship it, my friend; let features grow! 🐇✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-ui

Header: navigate to /docker/compose-builder with state { openTemplates: true } instead of relying on a setTimeout-dispatched event. Compose builder: read router state on mount, open the templates modal if openTemplates is set, then replace navigation state to clear the flag; keep the existing event listener as well. CodeEditor: introduce timerRef and useMountEffect to clear the copy timeout on unmount and to avoid overlapping timers when the Copy button is pressed repeatedly.
@hhftechnology
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Introduce VPN validation and warning UI, plus related UX and wiring changes.

- Add validation logic and tests: src/utils/validation/vpn.ts and __tests__/vpn.test.ts implement VPN config validation and a compact warning helper (vpnConfigWarning).
- Integrate VPN validation into YAML pipeline (useYamlValidation.ts) so VPN errors are surfaced with other config checks.
- Expand VPN UI: VpnFields and VpnTab get new toggles, Tailscale "serve" controls (target service, ports, protocol, cert domain), network-attachment UI, and an inline configuration warning; styles for warning/serve grid added to styles.css.
- Pass named services/networks through VpnTab and wire up updateVpnNetworks; add Toggle helper component.
- Services UX and tests: hide the trash icon for unnamed/imageless placeholder rows in ServicesTab and add tests (ServicesTab.test.tsx) to cover behavior; adjust removeService in compose-builder to keep a default service row and update selection logic.
- Misc: ensure GHCR image/repo names are lowercased in the CI workflow (.github/workflows/docker-build-push.yml) and minor import/prop updates in compose-builder route.
Remove local view state from BlueprintBuilder and always render SetupSidebar with a fixed "blueprint" view. Update the BlueprintBuilder navigation handler to only perform route navigation (remove setView) and normalize conditionals. Add missing navigation targets to other builders so they can navigate back to /blueprint-builder (updated in config-builder, compose-builder, and scheduler-builder). This centralizes navigation behavior and prevents view-state drift in the sidebar.
Regenerate package-lock.json with multiple dependency bumps and additions (including TanStack router, Tailwind, Lucide, Radix packages, testing and ESLint tooling) and updated transitive packages. Lockfile now contains new devDependencies and updated node_modules metadata. Also apply corresponding small updates to src/components/Header.tsx, src/components/Footer.tsx and src/routes/index.tsx to accommodate dependency and routing/ui changes.
@hhftechnology hhftechnology merged commit b5c0f82 into main May 11, 2026
4 checks passed
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