{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "diff-apply-migration-demo",
  "type": "registry:block",
  "title": "Diff Apply: Codemod Upgrade",
  "description": "Animated Code Diff example, Codemod Upgrade: A framework upgrade rewrites a config file in four small changes. The box is capped with `maxHeight`, so it scrolls each change into view as it lands. A take on the code diff (code review). Fits features and changelog sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "features",
    "changelog",
    "code-diff",
    "code-block",
    "code",
    "developer",
    "ai"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/diff-apply#diff-apply-migration-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/diff-apply.json"
  ],
  "files": [
    {
      "path": "components/diff-apply-migration-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport { DiffApply } from \"@/components/ui/diff-apply\";\n\nconst before = `\nimport { defineConfig } from \"harbor/config\";\nimport tailwind from \"@harbor/tailwind\";\nimport { sentry } from \"@harbor/sentry\";\n\nexport default defineConfig({\n  name: \"field-and-fold\",\n  target: \"node16\",\n  experimental: {\n    edge: true,\n    turboBuild: true,\n  },\n  images: {\n    domains: [\"images.unsplash.com\", \"cdn.fieldandfold.co\"],\n  },\n  plugins: [\n    tailwind(),\n    sentry({ dsn: process.env.SENTRY_DSN }),\n  ],\n  headers: async () => [\n    { source: \"/(.*)\", headers: [{ key: \"X-Frame-Options\", value: \"DENY\" }] },\n  ],\n  legacyBrowsers: true,\n});\n`;\n\nconst after = `\nimport { defineConfig } from \"harbor\";\nimport tailwind from \"@harbor/tailwind\";\nimport { sentry } from \"@harbor/sentry\";\n\nexport default defineConfig({\n  name: \"field-and-fold\",\n  target: \"node20\",\n  runtime: \"edge\",\n  images: {\n    remotePatterns: [\n      { hostname: \"images.unsplash.com\" },\n      { hostname: \"cdn.fieldandfold.co\" },\n    ],\n  },\n  plugins: [\n    tailwind(),\n    sentry({ dsn: process.env.SENTRY_DSN }),\n  ],\n  headers: async () => [\n    { source: \"/(.*)\", headers: [{ key: \"X-Frame-Options\", value: \"DENY\" }] },\n  ],\n});\n`;\n\nexport function DiffApplyMigrationDemo() {\n  return (\n    <div className=\"flex w-full max-w-2xl flex-col overflow-hidden rounded-2xl border border-zinc-950/10 bg-zinc-950 shadow-sm dark:border-white/10\">\n      <div className=\"flex items-center gap-2 px-4 py-3 font-mono text-[12.5px] text-zinc-400\">\n        <span className=\"text-emerald-400\">$</span>\n        <span className=\"text-zinc-100\">npx harbor upgrade 4</span>\n        <span className=\"ml-auto hidden text-zinc-500 sm:inline\">2 files updated · 1 to review</span>\n      </div>\n      <div className=\"p-1.5 pt-0\">\n        <DiffApply\n          filename=\"harbor.config.ts\"\n          before={before}\n          after={after}\n          maxHeight=\"17rem\"\n          className=\"rounded-[0.85rem] border-white/10 shadow-none\"\n        />\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}