@object-ui/cli 17.6.0 → 17.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  init,
3
3
  serve
4
- } from "./chunk-AP2INOE7.js";
4
+ } from "./chunk-VMMIGYU3.js";
5
5
  export {
6
6
  init,
7
7
  serve
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/cli",
3
- "version": "17.6.0",
3
+ "version": "17.7.0",
4
4
  "description": "Standalone CLI for Object UI — scaffold, develop, build and validate JSON/YAML schema-driven applications.",
5
5
  "type": "module",
6
6
  "homepage": "https://www.objectui.org/docs/utilities/cli",
@@ -46,6 +46,7 @@
46
46
  "author": "ObjectStack Team",
47
47
  "license": "MIT",
48
48
  "dependencies": {
49
+ "@objectstack/spec": "^17.1.0",
49
50
  "@tailwindcss/postcss": "^4.3.3",
50
51
  "@types/glob": "^9.0.0",
51
52
  "@vitejs/plugin-react": "^6.0.5",
@@ -55,12 +56,12 @@
55
56
  "express": "^4.22.2",
56
57
  "express-rate-limit": "^8.6.2",
57
58
  "glob": "^13.0.6",
58
- "js-yaml": "^5.2.3",
59
+ "js-yaml": "^5.4.1",
59
60
  "jsonc-parser": "^3.3.1",
60
61
  "vite": "^8.2.1",
61
- "@object-ui/components": "17.6.0",
62
- "@object-ui/react": "17.6.0",
63
- "@object-ui/types": "17.6.0"
62
+ "@object-ui/components": "17.7.0",
63
+ "@object-ui/react": "17.7.0",
64
+ "@object-ui/types": "17.7.0"
64
65
  },
65
66
  "devDependencies": {
66
67
  "@types/express": "^4.17.25",
@@ -77,7 +78,7 @@
77
78
  "build": "tsup",
78
79
  "dev": "tsup --watch",
79
80
  "lint": "eslint src",
80
- "test": "vitest run",
81
+ "test": "vitest run --root ../.. packages/cli/",
81
82
  "type-check": "tsc --noEmit"
82
83
  }
83
84
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/commands/serve.ts","../src/utils/app-generator.ts","../src/utils/scaffold-dependencies.ts","../src/utils/project-source.ts","../src/utils/workspace-vite.ts","../src/commands/init.ts"],"sourcesContent":["/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { createServer, createLogger, type Logger } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport { mkdirSync } from 'fs';\nimport { join } from 'path';\nimport chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport { createTempAppWithRouting, createTempApp } from '../utils/app-generator.js';\nimport { reportProjectSource, resolveProjectSource } from '../utils/project-source.js';\nimport { isWorkspaceRoot, prepareWorkspaceTempApp } from '../utils/workspace-vite.js';\n\ninterface ServeOptions {\n port: string;\n host: string;\n open?: boolean;\n}\n\n/**\n * Mirrors `dev`'s existing `open: options.open !== false` (commander's\n * `--no-open` sets `options.open` to `false`; every other case — the flag\n * omitted, or `true` — must keep opening a browser, which is the default\n * `serve` has always had and must not change) — pulled out so it can be\n * unit-tested without booting a real Vite server (objectui#4924).\n */\nexport function resolveServeOpenOption(open?: boolean): boolean {\n return open !== false;\n}\n\n/**\n * Vite's own browser-open step (`startBrowserProcess` in\n * `src/node/server/openBrowser.ts`) already catches a failed `open(url)` —\n * but it reports it as `logger.error(err.stack || err.message)` with no\n * `{ timestamp: true }`, so the default logger prints the bare Node stack\n * with no `[vite]` prefix and no context. That promise chain is\n * fire-and-forget from `server.listen()`, so the message lands on a later\n * tick — after our own success banner — reading like a crash even though\n * the server is fine. There's nothing to try/catch: the error never leaves\n * Vite. `customLogger` is the supported interception point, so this wraps\n * Vite's default logger and replaces exactly that message with a short,\n * contextual line; every other log call passes through unchanged\n * (objectui#4924, reproduced live: `Error: spawn xdg-open ENOENT` after\n * \"✓ Server started successfully!\" with `BROWSER` pointed at a missing\n * binary).\n */\nconst BROWSER_OPEN_SPAWN_ENOENT = /^Error: spawn (\\S+) ENOENT/;\n\nexport function createServeLogger(base: Logger): Logger {\n return {\n info: (msg, opts) => base.info(msg, opts),\n warn: (msg, opts) => base.warn(msg, opts),\n warnOnce: (msg, opts) => base.warnOnce(msg, opts),\n error(msg, opts) {\n const match = BROWSER_OPEN_SPAWN_ENOENT.exec(msg);\n if (match) {\n const [, command] = match;\n console.log(\n chalk.dim(\n ` (could not open the browser automatically — '${command}' is not available in this environment; open the URL above manually)`\n )\n );\n return;\n }\n base.error(msg, opts);\n },\n clearScreen: (type) => base.clearScreen(type),\n hasErrorLogged: (error) => base.hasErrorLogged(error),\n get hasWarned() {\n return base.hasWarned;\n },\n };\n}\n\nexport async function serve(schemaPath: string, options: ServeOptions) {\n const cwd = process.cwd();\n\n // What this invocation names — the project root, the routes, the app config —\n // resolved by the helper all three commands share. This command used to look\n // for a pages/ directory under cwd and nowhere else, so the same invocation\n // `dev` served as a routed project fell through to single-schema mode here\n // (objectui#4923; the history is in `utils/project-source.ts`).\n const source = resolveProjectSource(cwd, schemaPath);\n reportProjectSource(source, cwd);\n\n // Create temporary app directory\n const tmpDir = join(cwd, '.objectui-tmp');\n mkdirSync(tmpDir, { recursive: true });\n\n // Create temporary app files\n if (source.mode === 'routes') {\n createTempAppWithRouting(tmpDir, source.routes, source.appConfig);\n } else {\n createTempApp(tmpDir, source.schema);\n }\n\n // Install dependencies\n const isMonorepo = isWorkspaceRoot(cwd);\n\n if (isMonorepo) {\n console.log(chalk.blue('📦 Detected monorepo - using root node_modules'));\n } else {\n console.log(chalk.blue('📦 Installing dependencies...'));\n console.log(chalk.dim(' This may take a moment on first run...'));\n try {\n execSync('npm install --silent --prefer-offline', {\n cwd: tmpDir,\n stdio: 'inherit',\n });\n console.log(chalk.green('✓ Dependencies installed'));\n } catch {\n throw new Error('Failed to install dependencies. Please check your internet connection and try again.');\n }\n }\n\n console.log(chalk.green('✓ Schema loaded successfully'));\n console.log(chalk.blue('🚀 Starting development server...\\n'));\n\n // Everything the temp app needs to resolve platform packages from workspace\n // source — the alias table, and the PostCSS pipeline that replaces the\n // generated config file. Shared with `dev` and `build` so the three cannot\n // drift apart (objectui#3890); see `utils/workspace-vite.ts`.\n if (isMonorepo) {\n console.log(chalk.blue('📦 Detected monorepo - configuring workspace aliases'));\n }\n const workspaceConfig = isMonorepo ? await prepareWorkspaceTempApp(cwd, tmpDir) : {};\n\n // Create Vite config\n const viteConfig = {\n root: tmpDir,\n server: {\n port: parseInt(options.port),\n host: options.host,\n open: resolveServeOpenOption(options.open),\n fs: {\n // Allow serving the workspace sources the aliases point at\n allow: [cwd],\n },\n },\n plugins: [react()],\n customLogger: createServeLogger(createLogger()),\n ...workspaceConfig,\n };\n\n // Create Vite server\n const server = await createServer(viteConfig);\n\n await server.listen();\n\n const { port, host } = server.config.server;\n const protocol = server.config.server.https ? 'https' : 'http';\n const displayHost = host === '0.0.0.0' ? 'localhost' : host;\n\n console.log();\n console.log(chalk.green('✓ Server started successfully!'));\n console.log();\n console.log(chalk.bold(' Local: ') + chalk.cyan(`${protocol}://${displayHost}:${port}`));\n console.log();\n console.log(chalk.dim(' Press Ctrl+C to stop the server'));\n console.log();\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { readFileSync, writeFileSync, mkdirSync, readdirSync, statSync, existsSync } from 'fs';\nimport { dirname, join } from 'path';\nimport chalk from 'chalk';\nimport * as yaml from 'js-yaml';\n\nimport {\n platformPackageRange,\n REACT_RANGE,\n SCAFFOLD_DEV_DEPENDENCIES\n} from './scaffold-dependencies.js';\n\nexport interface RouteInfo {\n path: string;\n filePath: string;\n schema: unknown;\n isDynamic: boolean;\n paramName?: string;\n}\n\n// Helper function to check if a file is a supported schema file\nexport function isSupportedSchemaFile(filename: string): boolean {\n return filename.endsWith('.json') || \n filename.endsWith('.yml') ||\n filename.endsWith('.yaml');\n}\n\n// Helper function to extract the base filename without extension\nexport function getBaseFileName(filename: string): string {\n // Remove supported extensions\n return filename\n .replace(/\\.(json|yml|yaml)$/, '');\n}\n\n// Helper function to parse schema file (JSON or YAML)\nexport function parseSchemaFile(filePath: string): unknown {\n const content = readFileSync(filePath, 'utf-8');\n \n if (filePath.endsWith('.json')) {\n return JSON.parse(content);\n } else if (filePath.endsWith('.yml') || filePath.endsWith('.yaml')) {\n return yaml.load(content);\n }\n \n throw new Error(`Unsupported file format: ${filePath}`);\n}\n\nexport function scanPagesDirectory(pagesDir: string): RouteInfo[] {\n const routes: RouteInfo[] = [];\n \n const scanDir = (dir: string, routePrefix: string = '') => {\n const entries = readdirSync(dir);\n \n for (const entry of entries) {\n const fullPath = join(dir, entry);\n const stat = statSync(fullPath);\n \n if (stat.isDirectory()) {\n // Recursively scan subdirectories\n const newPrefix = routePrefix + '/' + entry;\n scanDir(fullPath, newPrefix);\n } else if (isSupportedSchemaFile(entry)) {\n // Process schema file\n const fileName = getBaseFileName(entry);\n let routePath: string;\n let isDynamic = false;\n let paramName: string | undefined;\n \n if (fileName === 'index') {\n // index.schema.json or index.page.json maps to the directory path\n routePath = routePrefix || '/';\n } else if (fileName.startsWith('[') && fileName.endsWith(']')) {\n // Dynamic route: [id].schema.json -> /:id\n paramName = fileName.slice(1, -1);\n routePath = routePrefix + '/:' + paramName;\n isDynamic = true;\n } else {\n // Regular file: about.schema.json -> /about\n routePath = routePrefix + '/' + fileName;\n }\n \n // Read and parse schema\n try {\n const schema = parseSchemaFile(fullPath);\n \n routes.push({\n path: routePath,\n filePath: fullPath,\n schema,\n isDynamic,\n paramName,\n });\n } catch (error) {\n console.warn(chalk.yellow(`⚠ Warning: Failed to parse ${fullPath}: ${error instanceof Error ? error.message : error}`));\n }\n }\n }\n };\n \n scanDir(pagesDir);\n \n // Sort routes: exact routes first, then dynamic routes\n routes.sort((a, b) => {\n if (a.isDynamic && !b.isDynamic) return 1;\n if (!a.isDynamic && b.isDynamic) return -1;\n return a.path.localeCompare(b.path);\n });\n \n return routes;\n}\n\n/**\n * `@object-ui/*` packages the generated apps IMPORT, and therefore must declare.\n *\n * Every entry is imported by a generated `src/App.tsx` — the two platform\n * packages by name, the seven plugins as side-effect imports that register\n * their components with the registry. Until objectui#3827 only the first two\n * were declared, so a generated app asked npm for nine packages having named\n * two of them; the seven plugins resolved in this workspace purely because the\n * temp app is created under `<cwd>` and hoisting reached the root\n * `node_modules`.\n *\n * `@object-ui/core` and `@object-ui/types` are deliberately absent: the\n * generated sources never import them (only `commands/dev.ts` aliases them for\n * Vite), and declaring a versioned dependency nothing imports is the defect\n * objectui#3755 removed from the sibling generator. `app-generator.test.ts`\n * gates both directions.\n */\nconst PLATFORM_RUNTIME_PACKAGES = [\n '@object-ui/react',\n '@object-ui/components',\n '@object-ui/plugin-charts',\n '@object-ui/plugin-editor',\n '@object-ui/plugin-kanban',\n '@object-ui/plugin-markdown',\n '@object-ui/plugin-form',\n '@object-ui/plugin-grid',\n '@object-ui/plugin-view'\n] as const;\n\n/**\n * `dependencies` for an app generated WITHOUT routing (`createTempApp`).\n *\n * Exactly the packages `src/main.tsx` and `src/App.tsx` import. No\n * `react-router-dom` and no `lucide-react`: this variant generates neither a\n * router nor a layout.\n */\nfunction buildAppDependencies(): Record<string, string> {\n const range = platformPackageRange();\n return {\n react: REACT_RANGE,\n 'react-dom': REACT_RANGE,\n ...Object.fromEntries(PLATFORM_RUNTIME_PACKAGES.map((name) => [name, range]))\n };\n}\n\n/**\n * `dependencies` for a routed app (`createTempAppWithRouting`).\n *\n * Adds the two packages the routed variant's own sources import and the plain\n * one's do not: `react-router-dom` (router in `src/App.tsx`) and `lucide-react`\n * (icons in `src/Layout.tsx`).\n *\n * `lucide-react` was imported and never declared until objectui#3827 — twice\n * over, `import * as LucideIcons` plus a named `{ Moon, Sun }`, both live in\n * the generated layout. `commands/dev.ts` had been papering over it in the\n * consumer, aliasing `lucide-react` to a path resolved out of\n * `packages/components` with the comment \"avoid dependency not found in temp\n * app\"; that alias only runs in monorepo mode, so every other path was left\n * with an unsatisfiable import. Declaring it at the producer is the fix — the\n * alias becomes a workspace convenience rather than the only thing holding the\n * import up.\n *\n * Both ranges here are QUOTED from this repo, per the objectui#3742 /\n * objectui#3754 anchoring discipline: `react-router-dom` from the root\n * manifest, `lucide-react` from the sibling manifests that declare it (the root\n * does not). `app-generator.test.ts`'s `DEPENDENCY_ANCHORS` names the anchor for\n * each and fails when a bump on either side leaves this file behind — which is\n * the whole reason the values are allowed to be literals at all.\n *\n * That gate is not decoration; it has fired. objectui#4968: a dependabot bump\n * moved `lucide-react` across all 22 sibling manifests and this literal stayed\n * a minor behind, so the pin went red on every open PR's merge ref until the\n * literal caught up. Deriving the value instead was considered and rejected in\n * that PR — 9 of the 13 anchored ranges quote the repo ROOT manifest, which is\n * not published with this CLI, so there is no one derivation the whole table\n * could share and a bespoke one for this single name would buy nothing. The\n * durable cure is upstream of this file: the shards carrying the gate have to\n * finish before a dependency PR can merge.\n */\nfunction buildRoutedAppDependencies(): Record<string, string> {\n const range = platformPackageRange();\n return {\n react: REACT_RANGE,\n 'react-dom': REACT_RANGE,\n 'react-router-dom': '^7.18.2',\n 'lucide-react': '^1.31.0',\n ...Object.fromEntries(PLATFORM_RUNTIME_PACKAGES.map((name) => [name, range]))\n };\n}\n\n\n/**\n * The generated `src/vite-env.d.ts`, identical for both generators.\n *\n * Both entries do `import './index.css'`, and TypeScript has no idea what a\n * `.css` module is: without this the entry file fails its own `tsconfig.json`\n * with \"Cannot find module or type declarations for side-effect import of\n * './index.css'\". `vite/client` is where the `declare module '*.css'` ambient\n * declarations live, `vite` is already in the generated `devDependencies`, and\n * this is the file `create-vite`'s own React+TS template writes for the same\n * reason — so the fix is the ecosystem's spelling of it rather than a local\n * invention (objectui#3853).\n *\n * It is the one generated `src/**` file that is deliberately unreachable from\n * `src/main.tsx`: an ambient declaration is pulled in by the tsconfig's\n * `include`, never by the module graph. `app-generator.test.ts`'s reachability\n * gate exempts `.d.ts` for exactly that reason and pins the exemption's width.\n */\nconst APP_VITE_ENV_D_TS = `/// <reference types=\"vite/client\" />\\n`;\n\n/** The generated `tsconfig.json`, identical for both generators. */\nconst APP_TSCONFIG = {\n compilerOptions: {\n target: 'ES2020',\n useDefineForClassFields: true,\n lib: ['ES2020', 'DOM', 'DOM.Iterable'],\n module: 'ESNext',\n skipLibCheck: true,\n moduleResolution: 'bundler',\n allowImportingTsExtensions: true,\n resolveJsonModule: true,\n isolatedModules: true,\n noEmit: true,\n jsx: 'react-jsx',\n strict: true,\n noUnusedLocals: true,\n noUnusedParameters: true,\n noFallthroughCasesInSwitch: true\n },\n include: ['src']\n};\n\n/**\n * The generated `postcss.config.js`, identical for both generators.\n *\n * Tailwind 4 moved the PostCSS plugin out of `tailwindcss` into\n * `@tailwindcss/postcss`; naming the old `tailwindcss` key resolves to a shim\n * whose only job is to throw (\"It looks like you're trying to use `tailwindcss`\n * directly as a PostCSS plugin\"). Spelled exactly like\n * `packages/components/postcss.config.js` — objectui#3852.\n */\nconst APP_POSTCSS_CONFIG = `export default {\n plugins: {\n '@tailwindcss/postcss': {},\n autoprefixer: {},\n },\n};`;\n\n/**\n * Where the generator is running, as far as the generated files are concerned.\n *\n * Passed in rather than read from `process.cwd()` inside the builders so the\n * file map is a pure function of its inputs and can be asserted over directly.\n */\nexport interface AppGeneratorContext {\n /** The directory `objectui` was invoked from. */\n cwd: string;\n /** Whether `cwd` is a pnpm workspace root (root `node_modules` is reachable). */\n isMonorepo: boolean;\n}\n\n/** The context the CLI commands themselves generate under. */\nfunction currentContext(): AppGeneratorContext {\n const cwd = process.cwd();\n return { cwd, isMonorepo: existsSync(join(cwd, 'pnpm-workspace.yaml')) };\n}\n\n/**\n * The generated `package.json` for an app without routing.\n *\n * In a monorepo both maps are written EMPTY, which is pre-existing behaviour:\n * the temp app lives under `<cwd>` and resolves everything by hoisting, and\n * `commands/dev.ts` skips `npm install` entirely there. The consequence worth\n * naming is that the ranges below are never the ranges exercised in this repo\n * (objectui#3742's second cost), which is exactly why the tests anchor them to\n * in-repo manifests instead of trusting a green command.\n */\nexport function buildAppPackageJson(context: Pick<AppGeneratorContext, 'isMonorepo'>): Record<string, unknown> {\n return {\n name: 'objectui-temp-app',\n private: true,\n type: 'module',\n // In monorepo, we use root node_modules, so we don't need dependencies here\n dependencies: context.isMonorepo ? {} : buildAppDependencies(),\n devDependencies: context.isMonorepo ? {} : { ...SCAFFOLD_DEV_DEPENDENCIES }\n };\n}\n\n/**\n * The generated `package.json` for a routed app.\n *\n * Unlike the variant above this one has no monorepo branch — it always writes\n * the full manifest, so a missing declaration here is missing everywhere and\n * cannot be explained away by hoisting.\n */\nexport function buildRoutedAppPackageJson(): Record<string, unknown> {\n return {\n name: 'objectui-temp-app',\n private: true,\n type: 'module',\n dependencies: buildRoutedAppDependencies(),\n devDependencies: { ...SCAFFOLD_DEV_DEPENDENCIES }\n };\n}\n\n/**\n * The `@source` directives the generated `src/index.css` registers.\n *\n * Tailwind 4's replacement for v3's `content` globs, and a 1:1 translation of\n * the ones the generated `tailwind.config.js` carried until objectui#3852:\n * the app's own `index.html` and `src/**`, widened inside a workspace to the\n * component library and every `plugin-*` package (the two absolute globs the v3\n * config built from `cwd`, semantics unchanged).\n *\n * Two things are load-bearing and were measured rather than assumed:\n *\n * 1. Relative `@source` paths resolve against the directory of the CSS file\n * that declares them, NOT the app root — this file is written to\n * `src/index.css`, so the app's own sources are `../src/**`, spelled exactly\n * as `packages/components/src/index.css` spells its own.\n * 2. Outside a workspace the platform packages are installed rather than\n * aliased, and their classes live in built JS. v4 does not auto-scan\n * `node_modules` (it is gitignored), so an explicit `@source` over the\n * installed `dist` is the only thing that compiles the library's utilities —\n * the gap the v3 `content` list also had, in the form v4 gives us to close\n * it.\n */\nfunction buildAppSourceDirectives(context: AppGeneratorContext): string[] {\n const sources = [`@source '../index.html';`, `@source '../src/**/*.{js,ts,jsx,tsx,json}';`];\n if (context.isMonorepo) {\n sources.push(`@source '${join(context.cwd, 'packages/components/src/**/*.{ts,tsx}')}';`);\n sources.push(`@source '${join(context.cwd, 'packages/plugin-*/src/**/*.{ts,tsx}')}';`);\n } else {\n sources.push(`@source '../node_modules/@object-ui/*/dist/**/*.js';`);\n }\n return sources;\n}\n\n/**\n * The generated `@theme` block: v4's replacement for v3's `theme.extend`.\n *\n * Token-for-token the set `packages/components/src/index.css` declares, because\n * the generated app owns the single Tailwind entrypoint for everything it\n * renders — the component library deliberately does NOT inject its own sheet\n * (see the note at the top of `packages/components/src/index.ts`), so a token\n * the library's classes need and this block omits simply does not compile. The\n * v3 config's `theme.extend.colors` omitted the eight `sidebar-*` tokens that\n * the generated `src/Layout.tsx` itself uses (`bg-sidebar-primary`,\n * `data-[state=open]:bg-sidebar-accent`, …); `app-generator.test.ts` pins the\n * two sets equal so the omission cannot come back.\n */\nconst APP_THEME_TOKENS = `@theme {\n /* Border radius tokens */\n --radius-lg: var(--radius);\n --radius-md: calc(var(--radius) - 2px);\n --radius-sm: calc(var(--radius) - 4px);\n\n /* Color tokens mapped to the CSS variables declared below */\n --color-border: hsl(var(--border));\n --color-input: hsl(var(--input));\n --color-ring: hsl(var(--ring));\n --color-background: hsl(var(--background));\n --color-foreground: hsl(var(--foreground));\n --color-primary: hsl(var(--primary));\n --color-primary-foreground: hsl(var(--primary-foreground));\n --color-secondary: hsl(var(--secondary));\n --color-secondary-foreground: hsl(var(--secondary-foreground));\n --color-destructive: hsl(var(--destructive));\n --color-destructive-foreground: hsl(var(--destructive-foreground));\n --color-muted: hsl(var(--muted));\n --color-muted-foreground: hsl(var(--muted-foreground));\n --color-accent: hsl(var(--accent));\n --color-accent-foreground: hsl(var(--accent-foreground));\n --color-popover: hsl(var(--popover));\n --color-popover-foreground: hsl(var(--popover-foreground));\n --color-card: hsl(var(--card));\n --color-card-foreground: hsl(var(--card-foreground));\n --color-sidebar: hsl(var(--sidebar));\n --color-sidebar-foreground: hsl(var(--sidebar-foreground));\n --color-sidebar-primary: hsl(var(--sidebar-primary));\n --color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground));\n --color-sidebar-accent: hsl(var(--sidebar-accent));\n --color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));\n --color-sidebar-border: hsl(var(--sidebar-border));\n --color-sidebar-ring: hsl(var(--sidebar-ring));\n\n /* Chart colors */\n --color-chart-1: hsl(var(--chart-1));\n --color-chart-2: hsl(var(--chart-2));\n --color-chart-3: hsl(var(--chart-3));\n --color-chart-4: hsl(var(--chart-4));\n --color-chart-5: hsl(var(--chart-5));\n}`;\n\n/**\n * The light/dark custom properties every token above resolves through.\n *\n * Plain CSS at the top level rather than inside `@layer base`, matching\n * `packages/components/src/index.css`: `@theme` already emits into `:root`, and\n * `.dark` only has to override the values. Every `var(--x)` named by\n * `APP_THEME_TOKENS` is declared here — pinned by a test, since a token that\n * resolves to nothing is a class that silently renders unstyled.\n */\nconst APP_THEME_VARIABLES = `:root {\n color-scheme: light;\n\n --background: 0 0% 100%;\n --foreground: 222.2 84% 4.9%;\n --card: 0 0% 100%;\n --card-foreground: 222.2 84% 4.9%;\n --popover: 0 0% 100%;\n --popover-foreground: 222.2 84% 4.9%;\n --primary: 222.2 47.4% 11.2%;\n --primary-foreground: 210 40% 98%;\n --secondary: 210 40% 96.1%;\n --secondary-foreground: 222.2 47.4% 11.2%;\n --muted: 210 40% 96.1%;\n --muted-foreground: 215.4 16.3% 46.9%;\n --accent: 210 40% 96.1%;\n --accent-foreground: 222.2 47.4% 11.2%;\n --destructive: 0 84.2% 60.2%;\n --destructive-foreground: 210 40% 98%;\n --border: 214.3 31.8% 91.4%;\n --input: 214.3 31.8% 91.4%;\n --ring: 222.2 84% 4.9%;\n --radius: 0.5rem;\n --chart-1: 12 76% 61%;\n --chart-2: 173 58% 39%;\n --chart-3: 197 37% 24%;\n --chart-4: 43 74% 66%;\n --chart-5: 27 87% 67%;\n\n /* Sidebar colors */\n --sidebar: 0 0% 98%;\n --sidebar-foreground: 240 5.3% 26.1%;\n --sidebar-primary: 240 5.9% 10%;\n --sidebar-primary-foreground: 0 0% 98%;\n --sidebar-accent: 240 4.8% 95.9%;\n --sidebar-accent-foreground: 240 5.9% 10%;\n --sidebar-border: 220 13% 91%;\n --sidebar-ring: 217.2 91.2% 59.8%;\n}\n\n.dark {\n color-scheme: dark;\n\n --background: 222.2 84% 4.9%;\n --foreground: 210 40% 98%;\n --card: 222.2 84% 4.9%;\n --card-foreground: 210 40% 98%;\n --popover: 222.2 84% 4.9%;\n --popover-foreground: 210 40% 98%;\n --primary: 210 40% 98%;\n --primary-foreground: 222.2 47.4% 11.2%;\n --secondary: 217.2 32.6% 17.5%;\n --secondary-foreground: 210 40% 98%;\n --muted: 217.2 32.6% 17.5%;\n --muted-foreground: 215 20.2% 65.1%;\n --accent: 217.2 32.6% 17.5%;\n --accent-foreground: 210 40% 98%;\n --destructive: 0 62.8% 30.6%;\n --destructive-foreground: 210 40% 98%;\n --border: 217.2 32.6% 17.5%;\n --input: 217.2 32.6% 17.5%;\n --ring: 212.7 26.8% 83.9%;\n --chart-1: 220 70% 50%;\n --chart-2: 160 60% 45%;\n --chart-3: 30 80% 55%;\n --chart-4: 280 65% 60%;\n --chart-5: 340 75% 55%;\n\n /* Sidebar colors for dark mode */\n --sidebar: 240 5.9% 10%;\n --sidebar-foreground: 240 4.8% 95.9%;\n --sidebar-primary: 224.3 76.3% 48%;\n --sidebar-primary-foreground: 0 0% 100%;\n --sidebar-accent: 240 3.7% 15.9%;\n --sidebar-accent-foreground: 240 4.8% 95.9%;\n --sidebar-border: 240 3.7% 15.9%;\n --sidebar-ring: 217.2 91.2% 59.8%;\n}`;\n\n/**\n * The generated `src/index.css` — one Tailwind 4 entrypoint, both generators.\n *\n * Replaces the v3 trio (`@tailwind base/components/utilities` directives, a\n * `tailwind.config.js`, and a `tailwindcss`-keyed PostCSS config) with the\n * CSS-first form this repo uses everywhere: `@import 'tailwindcss'`,\n * `@custom-variant dark`, `@source`, `@theme`. No `tailwind.config.js` is\n * written at all — in v4 a config file is inert unless a stylesheet points\n * `@config` at it, and every source of truth it used to hold now lives here\n * (objectui#3852; the repo itself has carried zero `tailwind.config.*` files\n * since its own v4 migration).\n *\n * The two generators emitted byte-identical CSS apart from three utilities on\n * `body`, so they now share this one builder; the `body` rules below are the\n * routed variant's (`font-sans antialiased min-h-screen`), written as the plain\n * CSS that `packages/components/src/index.css` uses instead of `@apply`.\n */\nfunction buildAppIndexCss(context: AppGeneratorContext): string {\n return `@import 'tailwindcss';\n\n/* Class-based dark variant: follow \\`.dark\\` on <html> — the routed app's\n \\`src/theme-provider.tsx\\` toggles exactly that class — instead of the OS\n \\`prefers-color-scheme\\`. Same spelling as packages/components/src/index.css. */\n@custom-variant dark (&:where(.dark, .dark *));\n\n/* Sources to scan for utility classes (v4's replacement for v3 \\`content\\`) */\n${buildAppSourceDirectives(context).join('\\n')}\n\n${APP_THEME_TOKENS}\n\n${APP_THEME_VARIABLES}\n\n* {\n border-color: hsl(var(--border));\n}\n\nbody {\n background-color: hsl(var(--background));\n color: hsl(var(--foreground));\n font-family: var(--font-sans);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n min-height: 100vh;\n}`;\n}\n\n/** Writes a generated file map onto `tmpDir`, creating nested directories. */\nfunction writeGeneratedFiles(tmpDir: string, files: Record<string, string>): void {\n for (const [relativePath, contents] of Object.entries(files)) {\n const target = join(tmpDir, relativePath);\n mkdirSync(dirname(target), { recursive: true });\n writeFileSync(target, contents);\n }\n}\n\nexport function createTempApp(tmpDir: string, schema: unknown) {\n writeGeneratedFiles(tmpDir, buildAppFiles(schema, currentContext()));\n}\n\n/**\n * Every file `createTempApp` writes, as `relative path -> contents`.\n *\n * Exported so the tests assert over the SAME artifact the CLI writes rather\n * than over this file's source text — the shape objectui#3733/#3826 settled on\n * for the sibling generator, and the only way a structural gate (imports vs\n * declarations, entry reachability) can be written at all.\n */\nexport function buildAppFiles(schema: unknown, context: AppGeneratorContext): Record<string, string> {\n // Create index.html\n const html = `<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>Object UI App</title>\n </head>\n <body>\n <div id=\"root\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n </body>\n</html>`;\n\n // Create main.tsx\n const mainTsx = `import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport App from './App';\nimport './index.css';\n\nReactDOM.createRoot(document.getElementById('root')!).render(\n <React.StrictMode>\n <App />\n </React.StrictMode>\n);`;\n\n // Create App.tsx\n const appTsx = `import { SchemaRenderer } from '@object-ui/react';\nimport '@object-ui/components';\nimport '@object-ui/plugin-charts';\nimport '@object-ui/plugin-editor';\nimport '@object-ui/plugin-kanban';\nimport '@object-ui/plugin-markdown';\nimport '@object-ui/plugin-form';\nimport '@object-ui/plugin-grid';\nimport '@object-ui/plugin-view';\n\nconst schema = ${JSON.stringify(schema, null, 2)};\n\nfunction App() {\n return <SchemaRenderer schema={schema} />;\n}\n\nexport default App;`;\n\n return {\n 'index.html': html,\n 'src/main.tsx': mainTsx,\n 'src/App.tsx': appTsx,\n 'src/vite-env.d.ts': APP_VITE_ENV_D_TS,\n 'src/index.css': buildAppIndexCss(context),\n 'postcss.config.js': APP_POSTCSS_CONFIG,\n 'package.json': JSON.stringify(buildAppPackageJson(context), null, 2),\n 'tsconfig.json': JSON.stringify(APP_TSCONFIG, null, 2)\n };\n}\n\nexport function createTempAppWithRouting(tmpDir: string, routes: RouteInfo[], appConfig?: unknown) {\n writeGeneratedFiles(tmpDir, buildRoutedAppFiles(routes, appConfig, currentContext()));\n}\n\n/**\n * Every file `createTempAppWithRouting` writes, as `relative path -> contents`.\n *\n * `src/main.tsx` is the entry — `index.html` loads exactly that one module — so\n * every other generated `src/**` module has to be reachable from it, which is\n * the reachability gate objectui#3826 established for the sibling generator and\n * `app-generator.test.ts` ports here. `src/Layout.tsx` is written only when\n * `appConfig` is present, precisely because that is the only case in which\n * `src/App.tsx` imports it.\n */\nexport function buildRoutedAppFiles(\n routes: RouteInfo[],\n appConfig: unknown,\n context: AppGeneratorContext\n): Record<string, string> {\n const files: Record<string, string> = {};\n\n // Create index.html\n const html = `<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>${(appConfig as any)?.title || 'Object UI App'}</title>\n </head>\n <body>\n <div id=\"root\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n </body>\n</html>`;\n\n files['index.html'] = html;\n\n const schemaImports: string[] = [];\n const routeComponents: string[] = [];\n\n routes.forEach((route, index) => {\n const schemaVarName = `schema${index}`;\n const schemaFileName = `page${index}.json`;\n\n // Add schema to the schemas directory\n files[`src/schemas/${schemaFileName}`] = JSON.stringify(route.schema, null, 2);\n\n // Add import statement\n schemaImports.push(`import ${schemaVarName} from './schemas/${schemaFileName}';`);\n\n // Add route component\n routeComponents.push(` <Route path=\"${route.path}\" element={<SchemaRenderer schema={${schemaVarName}} />} />`);\n });\n\n // Create theme-provider.tsx\n const themeProviderTsx = `import { createContext, useContext, useEffect, useState } from \"react\"\n\ntype Theme = \"dark\" | \"light\" | \"system\"\n\ntype ThemeProviderProps = {\n children: React.ReactNode\n defaultTheme?: Theme\n storageKey?: string\n}\n\ntype ThemeProviderState = {\n theme: Theme\n setTheme: (theme: Theme) => void\n}\n\nconst initialState: ThemeProviderState = {\n theme: \"system\",\n setTheme: () => null,\n}\n\nconst ThemeProviderContext = createContext<ThemeProviderState>(initialState)\n\nexport function ThemeProvider({\n children,\n defaultTheme = \"system\",\n storageKey = \"vite-ui-theme\",\n ...props\n}: ThemeProviderProps) {\n const [theme, setTheme] = useState<Theme>(\n () => (localStorage.getItem(storageKey) as Theme) || defaultTheme\n )\n\n useEffect(() => {\n const root = window.document.documentElement\n\n root.classList.remove(\"light\", \"dark\")\n\n if (theme === \"system\") {\n const systemTheme = window.matchMedia(\"(prefers-color-scheme: dark)\")\n .matches\n ? \"dark\"\n : \"light\"\n\n root.classList.add(systemTheme)\n return\n }\n\n root.classList.add(theme)\n }, [theme])\n\n const value = {\n theme,\n setTheme: (theme: Theme) => {\n localStorage.setItem(storageKey, theme)\n setTheme(theme)\n },\n }\n\n return (\n <ThemeProviderContext.Provider {...props} value={value}>\n {children}\n </ThemeProviderContext.Provider>\n )\n}\n\nexport const useTheme = () => {\n const context = useContext(ThemeProviderContext)\n\n if (context === undefined)\n throw new Error(\"useTheme must be used within a ThemeProvider\")\n\n return context\n}`;\n files['src/theme-provider.tsx'] = themeProviderTsx;\n\n // Create main.tsx\n const mainTsx = `import React from 'react';\nimport ReactDOM from 'react-dom/client';\nimport App from './App';\nimport './index.css';\nimport { ThemeProvider } from \"./theme-provider\"\n\nReactDOM.createRoot(document.getElementById('root')!).render(\n <React.StrictMode>\n <ThemeProvider defaultTheme=\"dark\" storageKey=\"vite-ui-theme\">\n <App />\n </ThemeProvider>\n </React.StrictMode>\n);`;\n\n files['src/main.tsx'] = mainTsx;\n\n // Generate Layout Code if appConfig is present\n let layoutImport = '';\n let layoutWrapperStart = '';\n let layoutWrapperEnd = '';\n \n if (appConfig) {\n // Very basic Layout implementation for now\n // Logic: If appConfig is present, current version assumes it's just a config object, \n // but we need a Layout component that renders navigation.\n // Since we don't have a Layout component in @object-ui/components yet, we generate a simple one.\n\n const layoutCode = `\nimport type { ComponentType, ReactNode } from 'react';\nimport { Link, useLocation } from 'react-router-dom';\nimport * as LucideIcons from 'lucide-react';\nimport { Moon, Sun } from \"lucide-react\"\nimport { useTheme } from \"./theme-provider\"\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n SidebarProvider,\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarHeader,\n SidebarRail,\n SidebarGroup,\n SidebarMenu,\n SidebarMenuItem,\n SidebarMenuButton,\n SidebarMenuSub,\n SidebarMenuSubItem,\n SidebarMenuSubButton,\n SidebarInset,\n SidebarTrigger,\n Separator,\n Collapsible,\n CollapsibleTrigger,\n CollapsibleContent\n} from '@object-ui/components';\n\n/** One entry of \\`app.json\\`'s \\`menu\\`, as this layout reads it. */\ntype MenuItem = {\n label?: string;\n path?: string;\n icon?: string;\n children?: MenuItem[];\n};\n\n/** The \\`app.json\\` fields this layout renders. */\ntype AppConfig = {\n title?: string;\n logo?: string;\n menu?: MenuItem[];\n};\n\n// Lucide publishes every icon as a named export, and a menu entry names one as\n// a string — so the lookup is a runtime index into the namespace object, which\n// has no index signature. Narrowing it to the component-by-name shape this file\n// actually uses keeps that honest without an \\`any\\` or a \\`@ts-expect-error\\`; the\n// \\`undefined\\` arm is real, since the namespace also exports helpers that are not\n// components and a schema may name an icon that does not exist.\nconst lucideIcons = LucideIcons as unknown as Record<\n string,\n ComponentType<{ className?: string }> | undefined\n>;\n\nconst DynamicIcon = ({ name, className }: { name: string; className?: string }) => {\n const Icon = lucideIcons[name];\n if (!Icon) return null;\n return <Icon className={className} />;\n};\n\nexport function ModeToggle() {\n const { setTheme } = useTheme()\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <SidebarMenuButton size=\"lg\" className=\"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground\">\n <div className=\"flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground\">\n <Sun className=\"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0\" />\n <Moon className=\"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100\" />\n </div>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-semibold\">Switch Theme</span>\n <span className=\"truncate text-xs\">Light / Dark</span>\n </div>\n <LucideIcons.ChevronsUpDown className=\"ml-auto size-4\" />\n </SidebarMenuButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent className=\"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg\" side=\"bottom\" align=\"end\" sideOffset={4}>\n <DropdownMenuItem onClick={() => setTheme(\"light\")}>\n <LucideIcons.Sun className=\"mr-2 size-4\" />\n Light\n </DropdownMenuItem>\n <DropdownMenuItem onClick={() => setTheme(\"dark\")}>\n <LucideIcons.Moon className=\"mr-2 size-4\" />\n Dark\n </DropdownMenuItem>\n <DropdownMenuItem onClick={() => setTheme(\"system\")}>\n <LucideIcons.Monitor className=\"mr-2 size-4\" />\n System\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n\nconst AppLayout = ({ app, children }: { app: AppConfig; children: ReactNode }) => {\n const location = useLocation();\n const menu = app.menu || [];\n \n return (\n <SidebarProvider>\n <Sidebar collapsible=\"icon\">\n <SidebarHeader>\n <div className=\"flex items-center gap-2 px-2 py-2\">\n <div className=\"flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground\">\n {app.logo && <DynamicIcon name={app.logo} className=\"size-4\" />}\n {!app.logo && <span className=\"text-xl font-bold\">O</span>}\n </div>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-semibold\">{app.title || \"Object UI\"}</span>\n <span className=\"truncate text-xs\">Showcase</span>\n </div>\n </div>\n </SidebarHeader>\n <SidebarContent>\n <SidebarGroup>\n <SidebarMenu>\n {menu.map((item, idx) => {\n // Collapsible Item (Children present)\n if (item.children && item.children.length > 0) {\n const isActive = item.children.some(child => child.path === location.pathname);\n return (\n <Collapsible key={idx} asChild defaultOpen={isActive} className=\"group/collapsible\">\n <SidebarMenuItem>\n <CollapsibleTrigger asChild>\n <SidebarMenuButton tooltip={item.label}>\n {item.icon && <DynamicIcon name={item.icon} />}\n <span>{item.label}</span>\n <DynamicIcon name=\"ChevronRight\" className=\"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90\" />\n </SidebarMenuButton>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarMenuSub>\n {item.children.map((child, cIdx) => (\n <SidebarMenuSubItem key={cIdx}>\n <SidebarMenuSubButton asChild isActive={location.pathname === child.path}>\n <Link to={child.path || '#'}>\n <span>{child.label}</span>\n </Link>\n </SidebarMenuSubButton>\n </SidebarMenuSubItem>\n ))}\n </SidebarMenuSub>\n </CollapsibleContent>\n </SidebarMenuItem>\n </Collapsible>\n );\n }\n\n // Single Item\n if (item.path) {\n return (\n <SidebarMenuItem key={idx}>\n <SidebarMenuButton asChild isActive={location.pathname === item.path} tooltip={item.label}>\n <Link to={item.path}>\n {item.icon && <DynamicIcon name={item.icon} />}\n <span>{item.label}</span>\n </Link>\n </SidebarMenuButton>\n </SidebarMenuItem>\n );\n }\n return null;\n })}\n </SidebarMenu>\n </SidebarGroup>\n </SidebarContent>\n <SidebarFooter>\n <SidebarMenu>\n <SidebarMenuItem>\n <ModeToggle />\n </SidebarMenuItem>\n </SidebarMenu>\n </SidebarFooter>\n <SidebarRail />\n </Sidebar>\n \n <SidebarInset>\n <header className=\"flex h-16 shrink-0 items-center gap-2 border-b bg-background px-4\">\n <SidebarTrigger className=\"-ml-1\" />\n <Separator orientation=\"vertical\" className=\"mr-2 h-4\" />\n <div className=\"flex flex-1 items-center justify-between\">\n <span className=\"font-medium\">{app.title}</span>\n </div>\n </header>\n <div className=\"flex-1 flex flex-col min-h-0 bg-muted/20 p-4\">\n <div className=\"mx-auto max-w-full w-full\">\n {children}\n </div>\n </div>\n </SidebarInset>\n </SidebarProvider>\n );\n};\n\nexport default AppLayout;\n`;\n files['src/Layout.tsx'] = layoutCode;\n \n layoutImport = `import AppLayout from './Layout';\\nconst appConfig = ${JSON.stringify(appConfig)};`;\n layoutWrapperStart = `<AppLayout app={appConfig}>`;\n layoutWrapperEnd = `</AppLayout>`;\n }\n\n // Create App.tsx with routing\n //\n // `Link` is deliberately absent from this import: the only `<Link>` in the\n // generated app is in `src/Layout.tsx`, which imports it itself. Naming it\n // here bought nothing and cost a TS6133 under the `noUnusedLocals` this\n // generator's own `tsconfig.json` declares (objectui#3853).\n const appTsx = `import { BrowserRouter, Routes, Route } from 'react-router-dom';\nimport { SchemaRenderer } from '@object-ui/react';\nimport '@object-ui/components';\nimport '@object-ui/plugin-charts';\nimport '@object-ui/plugin-editor';\nimport '@object-ui/plugin-kanban';\nimport '@object-ui/plugin-markdown';\nimport '@object-ui/plugin-form';\nimport '@object-ui/plugin-grid';\nimport '@object-ui/plugin-view';\n${schemaImports.join('\\n')}\n${layoutImport}\n\nfunction App() {\n return (\n <BrowserRouter>\n ${layoutWrapperStart}\n <Routes>\n${routeComponents.join('\\n')}\n </Routes>\n ${layoutWrapperEnd}\n </BrowserRouter>\n );\n}\n\nexport default App;`;\n\n files['src/App.tsx'] = appTsx;\n\n files['src/vite-env.d.ts'] = APP_VITE_ENV_D_TS;\n files['src/index.css'] = buildAppIndexCss(context);\n files['postcss.config.js'] = APP_POSTCSS_CONFIG;\n files['package.json'] = JSON.stringify(buildRoutedAppPackageJson(), null, 2);\n files['tsconfig.json'] = JSON.stringify(APP_TSCONFIG, null, 2);\n\n return files;\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * The one place a generated manifest's version ranges come from.\n *\n * This CLI writes a `package.json` from THREE generators, not two:\n * `utils/app-generator.ts` builds the plain and routed temp apps that\n * `objectui dev` runs, and `commands/init.ts` builds the project scaffold\n * `objectui init` hands to an external user. objectui#3742 / objectui#3754 /\n * objectui#3827 established the discipline for the first two — one range per\n * dependency, quoted from this repo rather than invented, derived from this\n * CLI's own version where the package ships in lockstep with it — and\n * `app-generator.test.ts`'s `DEPENDENCY_ANCHORS` gates it.\n *\n * The init scaffold sat outside all of it (objectui#3892). It asked for\n * `@object-ui/components`/`@object-ui/react` at `^2.0.0` while those packages\n * publish at 17.x, so the first command an external user runs produced a\n * project whose `npm install` resolved a major with nothing to do with the CLI\n * that wrote it — the same defect objectui#3827 fixed one generator over, where\n * the literal was `^0.1.0`. Its toolchain ranges had fossilised a major behind\n * the repo besides (vite `^7.3.1` vs `^8.2.0`, typescript `^5.9.3` vs `^6.0.3`).\n *\n * Both halves are cured by not having a literal to fossilise: this module owns\n * the values, all three generators read them, and the anchor table judges the\n * union. Copying a range into a fourth generator is still possible, but it now\n * fails the completeness gate instead of shipping.\n */\n\nimport { existsSync, readFileSync } from 'fs';\nimport { dirname, join } from 'path';\nimport { fileURLToPath } from 'url';\n\n/** This package's own name, used to locate its manifest for the platform range. */\nconst CLI_PACKAGE_NAME = '@object-ui/cli';\n\n/** Memoised so the manifest walk happens at most once per process. */\nlet cachedCliVersion: string | undefined;\n\n/**\n * This CLI's own version, read from its own `package.json`.\n *\n * Walks up from this module rather than joining a fixed `../package.json`,\n * because the same source sits at `src/utils/` in the repo and is bundled into\n * `dist/` when published — a relative depth that is correct in one is wrong in\n * the other.\n */\nexport function cliVersion(): string {\n if (cachedCliVersion !== undefined) return cachedCliVersion;\n\n let dir = dirname(fileURLToPath(import.meta.url));\n for (;;) {\n const candidate = join(dir, 'package.json');\n if (existsSync(candidate)) {\n const manifest = JSON.parse(readFileSync(candidate, 'utf-8')) as {\n name?: string;\n version?: string;\n };\n if (manifest.name === CLI_PACKAGE_NAME && typeof manifest.version === 'string') {\n cachedCliVersion = manifest.version;\n return cachedCliVersion;\n }\n }\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n\n throw new Error(\n `Could not locate the ${CLI_PACKAGE_NAME} manifest to version the generated app's ` +\n `platform dependencies against. Refusing to write a package.json with a guessed range.`\n );\n}\n\n/**\n * The range every generated manifest declares for every `@object-ui/*` package.\n *\n * Derived from this CLI's own version instead of being written out as a\n * literal, because `.changeset/config.json` puts `@object-ui/cli` in the SAME\n * `fixed` group as every platform package a generated app declares: they are\n * released together and always carry the identical version. So `^<own\n * version>` is both current and guaranteed to exist on the registry — whatever\n * CLI version a user is running was published alongside its siblings.\n *\n * The literals it replaces were `^0.1.0` in the app generators (objectui#3827)\n * and `^2.0.0` in the init scaffold (objectui#3892), for packages published at\n * 17.x. Neither resolved to anything the CLI had been tested against; `^0.1.0`\n * resolved to nothing published at all. A literal here is not merely a fossil\n * risk, it is a fossil generator: the fixed group re-versions on every release,\n * so any hard-coded range is stale the next day. Deriving it removes the class.\n */\nexport function platformPackageRange(): string {\n return `^${cliVersion()}`;\n}\n\n/**\n * React's range in every generated manifest.\n *\n * Quotes the repo root verbatim (an exact pin there) rather than the wider\n * `^18.0.0 || ^19.0.0` the platform packages accept as a peer. The peer range\n * says what CAN work; this says what is actually exercised — inside this\n * workspace the temp app resolves React by hoisting to the root, so the root's\n * version is the only one the generated code has ever run against. Declaring\n * `^18.3.1`, as the app generators did until objectui#3827, or `^19.2.0`, as\n * the init scaffold did until objectui#3892, names a version nothing here\n * tests: the second is not even wrong about the major, which is exactly how it\n * survived unnoticed.\n */\nexport const REACT_RANGE = '19.2.8';\n\n/**\n * `devDependencies` shared by every generated manifest (identical in all three).\n *\n * Every range is anchored to an in-repo manifest, and\n * `app-generator.test.ts`'s `DEPENDENCY_ANCHORS` names the anchor for each one\n * and fails on an unanchored addition. The Tailwind-side entries were held at\n * v3 as an explicit `TAILWIND_V3_DEFERRED` ledger by objectui#3827, because\n * bumping the range without rewriting the CSS pipeline beside it would produce\n * an app that installs and renders unstyled. objectui#3852 rewrote that\n * pipeline, so they are anchored to this repo's Tailwind 4 like everything\n * else — `tailwindcss` to the root, `@tailwindcss/postcss` (v4's PostCSS\n * plugin, a separate package) to the in-repo range every `postcss.config.*`\n * here already names.\n *\n * The init scaffold declared this exact key set at its own, older literals\n * until objectui#3892 — same nine packages, every range behind, two of them by\n * a major. Sharing the map rather than re-anchoring a second copy is what makes\n * a repo-side bump reach all three generators in one edit; a generator that\n * ever needs to differ can spread this and override the one key, which stays\n * visible to the anchor table.\n */\nexport const SCAFFOLD_DEV_DEPENDENCIES: Record<string, string> = {\n '@tailwindcss/postcss': '^4.3.3',\n '@types/react': '19.2.18',\n '@types/react-dom': '19.2.4',\n '@vitejs/plugin-react': '^6.0.5',\n autoprefixer: '^10.5.4',\n postcss: '^8.5.26',\n tailwindcss: '^4.3.3',\n typescript: '^6.0.3',\n vite: '^8.2.1'\n};\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * What `dev`, `serve` and `build` are asked to render — resolved once, for all\n * three (objectui#4923).\n *\n * ## The divergence this replaces\n *\n * Every one of the three commands answered \"what is this project?\" on its own.\n * `dev` anchored the answer on the SCHEMA ARGUMENT: `dirname(<schema>)` is the\n * project root, `pages/` beside the schema means file-system routing, and the\n * named file is the app config. `serve` and `build` looked only at\n * `join(cwd, 'pages')` and never at where the argument pointed, so from any\n * directory above the project the same invocation fell through to single-schema\n * mode — with the app config itself handed to the renderer as if it were a page.\n *\n * Measured on the commit that filed the card, fixture `<root>/app.json` +\n * `<root>/pages/index.json`, invoked from the directory above:\n *\n * - `objectui dev <root>/app.json` → project structure, 1 route.\n * - `objectui serve <root>/app.json` → `Loading schema: <root>/app.json`.\n * - `objectui build <root>/app.json` → same, and it EXITS 0: the emitted bundle\n * embeds the app config as the page schema and contains no page from\n * `pages/` at all. A wrong artifact, produced silently.\n *\n * So the defect is not that one of the two readings is wrong — it is that one\n * invocation has two answers, and the losing one fails without saying so. There\n * is no documented intent for `serve`/`build` to be single-schema commands; the\n * documentation states the opposite twice (`cli.ts` calls `dev` an \"alias for\n * serve\", `README.md` and `content/docs/utilities/cli.mdx` call `serve` a\n * \"legacy alias of `dev`\", and the docs' routing section says `dev` and `build`\n * switch to file-system routing when \"the project contains a `pages/`\n * directory\"). Hence the richer, argument-anchored reading wins and lives here,\n * where the three share it — the same anti-drift shape objectui#3890 gave the\n * module-resolution face in `workspace-vite.ts`.\n *\n * ## Single-schema mode is still a mode\n *\n * A lone schema file with no `pages/` next to it is legitimate input and keeps\n * behaving exactly as before: the file is parsed and rendered on its own. It is\n * the fallback, not the casualty.\n */\n\nimport { existsSync, statSync } from 'fs';\nimport { basename, dirname, join, relative, resolve } from 'path';\n\nimport chalk from 'chalk';\n\nimport { parseSchemaFile, scanPagesDirectory, type RouteInfo } from './app-generator.js';\n\n/**\n * Where the `pages/` directory that won was found.\n *\n * - `schema-dir` — beside the schema FILE the argument named.\n * - `argument-dir` — the argument was itself a directory (objectui#5037).\n * - `cwd` — the working-directory fallback.\n */\nexport type PagesDirOrigin = 'schema-dir' | 'argument-dir' | 'cwd';\n\n/** File-system routing: a `pages/` directory decides the routes. */\nexport interface RoutedProjectSource {\n mode: 'routes';\n /** The directory treated as the project root. */\n projectRoot: string;\n /** Absolute path of the `pages/` directory being scanned. */\n pagesDir: string;\n /** Which of the candidate locations `pagesDir` came from. */\n pagesDirOrigin: PagesDirOrigin;\n routes: RouteInfo[];\n /** Parsed app config, when one was found and readable. */\n appConfig: unknown;\n /** Absolute path the app config was read from, if any. */\n appConfigPath: string | null;\n /** Non-fatal problems for the caller to report. */\n warnings: string[];\n}\n\n/** Single schema file mode: no `pages/` anywhere, render the named file. */\nexport interface SingleSchemaSource {\n mode: 'schema';\n /** The directory treated as the project root. */\n projectRoot: string;\n /** Absolute path of the schema file that was parsed. */\n schemaFile: string;\n schema: unknown;\n warnings: string[];\n}\n\nexport type ProjectSource = RoutedProjectSource | SingleSchemaSource;\n\n/**\n * Parse a file as an app config, degrading to a warning.\n *\n * A malformed app config is not fatal — the routes are still renderable without\n * a layout — so it warns and continues, which is what `dev` has always done.\n */\nfunction readAppConfig(path: string, warnings: string[]): unknown {\n try {\n return parseSchemaFile(path);\n } catch (error) {\n warnings.push(\n `Failed to parse app config ${path}: ${error instanceof Error ? error.message : error}`\n );\n return null;\n }\n}\n\n/**\n * Resolve what to render from an invocation, identically for all three commands.\n *\n * Pure apart from reading the filesystem: nothing is logged and nothing is\n * written, so the three commands' reporting stays in `reportProjectSource` and\n * this can be exercised directly.\n *\n * Resolution order — first match wins:\n *\n * 1. `<schemaArg>` names an existing file and `pages/` sits beside it → routing\n * from there, with the named file as the app config. This is the limb\n * `serve`/`build` never had. `<schemaArg>` names an existing DIRECTORY that\n * either IS a `pages` directory or contains one → routing from it, with\n * `<projectRoot>/app.json` as the app config when it exists (objectui#5037).\n * 2. `<cwd>/pages` exists → routing from there, with `<cwd>/app.json` as the app\n * config when it exists. Invoking inside the project keeps working, including\n * with the default `app.json` argument.\n * 3. Otherwise → single schema file mode.\n *\n * Throws when the resolved input cannot be rendered at all: a missing schema\n * file, an unparsable one, a `pages/` directory holding no schema, or a\n * directory argument that is no project.\n */\nexport function resolveProjectSource(cwd: string, schemaArg: string): ProjectSource {\n const warnings: string[] = [];\n const absoluteSchemaPath = resolve(cwd, schemaArg);\n\n // 1. Anchored on the argument, whether it names a file or a directory.\n if (existsSync(absoluteSchemaPath)) {\n const argumentStats = statSync(absoluteSchemaPath);\n\n if (argumentStats.isFile()) {\n const projectRoot = dirname(absoluteSchemaPath);\n const pagesDir = join(projectRoot, 'pages');\n\n if (existsSync(pagesDir)) {\n return {\n mode: 'routes',\n projectRoot,\n pagesDir,\n pagesDirOrigin: 'schema-dir',\n routes: scanRoutes(pagesDir),\n appConfig: readAppConfig(absoluteSchemaPath, warnings),\n appConfigPath: absoluteSchemaPath,\n warnings\n };\n }\n } else if (argumentStats.isDirectory()) {\n const fromDirectory = resolveDirectoryArgument(absoluteSchemaPath, warnings);\n if (fromDirectory) return fromDirectory;\n }\n }\n\n // 2. Anchored on the working directory.\n const localPagesDir = join(cwd, 'pages');\n if (existsSync(localPagesDir)) {\n const localAppConfigPath = join(cwd, 'app.json');\n const hasLocalAppConfig = existsSync(localAppConfigPath);\n\n return {\n mode: 'routes',\n projectRoot: cwd,\n pagesDir: localPagesDir,\n pagesDirOrigin: 'cwd',\n routes: scanRoutes(localPagesDir),\n appConfig: hasLocalAppConfig ? readAppConfig(localAppConfigPath, warnings) : null,\n appConfigPath: hasLocalAppConfig ? localAppConfigPath : null,\n warnings\n };\n }\n\n // 3. Single schema file mode.\n if (!existsSync(absoluteSchemaPath)) {\n throw new Error(\n `Schema file not found: ${schemaArg}\\nRun 'objectui init' to create a sample schema.`\n );\n }\n\n // A directory can never be a schema file. Before objectui#5037 this fell into\n // `parseSchemaFile` and surfaced the raw `EISDIR: illegal operation on a\n // directory, read` from `readFileSync` — an error that names neither the\n // argument's shape nor what would have been accepted instead.\n if (statSync(absoluteSchemaPath).isDirectory()) {\n throw new Error(\n `Not a project directory: ${schemaArg}\\n` +\n `A directory argument must be a 'pages' directory, or contain one, for file-system ` +\n `routing — ${absoluteSchemaPath} is neither.\\n` +\n `Pass a JSON/YAML schema file instead, or run 'objectui init' to create a project.`\n );\n }\n\n let schema: unknown;\n try {\n schema = parseSchemaFile(absoluteSchemaPath);\n } catch (error) {\n // The caught error's message is inlined below. We can't pass it as the\n // `Error` `cause` option because this package targets ES2020, whose lib\n // types the 1-arg `Error` constructor only; hence the scoped disable.\n // eslint-disable-next-line preserve-caught-error\n throw new Error(`Invalid schema file: ${error instanceof Error ? error.message : error}`);\n }\n\n return {\n mode: 'schema',\n projectRoot: dirname(absoluteSchemaPath),\n schemaFile: absoluteSchemaPath,\n schema,\n warnings\n };\n}\n\n/**\n * Resolve a DIRECTORY argument to a routed project, or `null` when it is no\n * project (objectui#5037).\n *\n * Two shapes are accepted, in this order: the directory IS the `pages`\n * directory (`objectui dev my-app/pages`, the form the docs print), or it\n * CONTAINS one (`objectui dev my-app`). Both produce the same answer as naming\n * the app config beside them would — which is what \"the three commands answer\n * one invocation the same way\" has to mean for the documented directory form\n * too, and the reason this lives in step ① rather than in each command.\n *\n * Returning `null` rather than throwing keeps the working-directory fallback\n * ahead of the refusal: an argument that resolves to nothing is answered by\n * `<cwd>/pages` exactly as any other unresolved argument is, and only reaches\n * the diagnosis in step ③ when there is no such fallback either.\n */\nfunction resolveDirectoryArgument(argumentDir: string, warnings: string[]): RoutedProjectSource | null {\n const isPagesDir = basename(argumentDir) === 'pages';\n const pagesDir = isPagesDir ? argumentDir : join(argumentDir, 'pages');\n\n if (!isPagesDir && !(existsSync(pagesDir) && statSync(pagesDir).isDirectory())) {\n return null;\n }\n\n const projectRoot = isPagesDir ? dirname(argumentDir) : argumentDir;\n const appConfigPath = join(projectRoot, 'app.json');\n const hasAppConfig = existsSync(appConfigPath) && statSync(appConfigPath).isFile();\n\n return {\n mode: 'routes',\n projectRoot,\n pagesDir,\n pagesDirOrigin: 'argument-dir',\n routes: scanRoutes(pagesDir),\n appConfig: hasAppConfig ? readAppConfig(appConfigPath, warnings) : null,\n appConfigPath: hasAppConfig ? appConfigPath : null,\n warnings\n };\n}\n\n/** Scan a `pages/` directory, refusing an empty one. */\nfunction scanRoutes(pagesDir: string): RouteInfo[] {\n const routes = scanPagesDirectory(pagesDir);\n if (routes.length === 0) {\n throw new Error(`No schema files found in ${pagesDir}`);\n }\n return routes;\n}\n\n/**\n * Print the detection result.\n *\n * Split from the resolution so the three commands report identically by\n * construction: the divergence the card describes was visible in exactly these\n * lines, and a reader comparing two commands' output is comparing this function\n * with itself.\n */\nexport function reportProjectSource(source: ProjectSource, cwd: string): void {\n for (const warning of source.warnings) {\n console.warn(chalk.yellow(`⚠ ${warning}`));\n }\n\n if (source.mode === 'schema') {\n console.log(chalk.blue('📋 Loading schema:'), chalk.cyan(relative(cwd, source.schemaFile) || source.schemaFile));\n return;\n }\n\n console.log(chalk.blue(`📂 Detected project structure at ${source.projectRoot}`));\n if (source.appConfigPath && source.appConfig) {\n console.log(chalk.blue(`⚙️ Loaded App Config from ${relative(cwd, source.appConfigPath) || source.appConfigPath}`));\n }\n console.log(chalk.blue(`📁 Using file-system routing from ${source.pagesDir}`));\n console.log(chalk.green(`✓ Found ${source.routes.length} route(s)`));\n for (const route of source.routes) {\n console.log(chalk.dim(` ${route.path} → ${relative(cwd, route.filePath)}`));\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * How the generated temp app resolves its imports when it runs INSIDE this\n * workspace — shared by `dev`, `serve` and `build` (objectui#3890).\n *\n * Outside a workspace the generated `package.json` declares every platform\n * package and the command installs it; inside one, both dependency maps are\n * written empty on purpose and nothing is installed, because the app is created\n * under `<cwd>/.objectui-tmp` and resolves by hoisting (objectui#3742 /\n * objectui#3827). The repo root hoists React and the toolchain, but it declares\n * no `@object-ui/*` at all — `node_modules/@object-ui/` does not exist here — so\n * the ONLY thing that resolves a platform package in a workspace is the alias\n * table below.\n *\n * ## Why the table is derived rather than written out\n *\n * It used to be a hand-kept list of eleven packages in `commands/dev.ts`. A\n * hand-kept list is not a list of what the app imports — it is a list of what\n * the app imports TRANSITIVELY, which is the import graph of every source file\n * of every package already in it. Nothing enforced that, so it drifted, and the\n * drift is silent until a browser opens the page: every module whose transform\n * hits an unlisted specifier answers 500, and the page renders blank.\n *\n * Measured on the commit that filed objectui#3890: the app's own entry names\n * nine packages, whose transitive value-imports close over 21, of which the\n * table held 11. Vite's dependency scan reported only 4 of the 10 missing ones,\n * because a scan stops at the first layer it cannot resolve — which is exactly\n * why backfilling \"the missing four\" would have left six more behind and the\n * page still blank. Deriving the table from the workspace removes the class:\n * a cross-package import added tomorrow is already covered.\n *\n * ## Completeness is the safe direction\n *\n * The table names every workspace package rather than the reachable subset,\n * because the two errors are not symmetric: an alias for a package nothing\n * imports is inert (an alias only applies to an import that matches it), while\n * a missing alias for a package something imports is a 500. So the rule errs\n * toward listing too much, and the test beside it reconciles the table against\n * `pnpm-workspace.yaml` so a new package cannot be missing from it.\n */\n\nimport { existsSync, readFileSync, statSync, unlinkSync } from 'fs';\nimport { createRequire } from 'module';\nimport { dirname, join } from 'path';\n\nimport { globSync } from 'glob';\nimport { load as loadYaml } from 'js-yaml';\n\n/** The scope whose packages the generated app resolves from workspace source. */\nconst PLATFORM_SCOPE = '@object-ui/';\n\n/**\n * Extensions probed for a package's source barrel, in Vite's own\n * `resolve.extensions` order.\n *\n * The order matters for the same reason `scripts/__tests__/side-effects-\n * declaration-consistency.test.ts` says it does: barrels in this repo are\n * spelled both `.ts` and `.tsx` (`@object-ui/core` vs `@object-ui/fields`), and\n * assuming either one is what made the entry-inference rule look like a cost of\n * deriving the table. Probing in the resolver's order is not a guess — it is\n * the answer the resolver itself would give.\n */\nconst BARREL_EXTENSIONS = ['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx'];\n\n/** Whether `cwd` is a pnpm workspace root, i.e. whether aliasing applies. */\nexport function isWorkspaceRoot(cwd: string): boolean {\n return existsSync(join(cwd, 'pnpm-workspace.yaml'));\n}\n\n/** The `packages:` patterns declared by `pnpm-workspace.yaml`, verbatim. */\nfunction workspacePatterns(cwd: string): string[] {\n const manifestPath = join(cwd, 'pnpm-workspace.yaml');\n if (!existsSync(manifestPath)) return [];\n const parsed = loadYaml(readFileSync(manifestPath, 'utf-8')) as { packages?: unknown } | null;\n const patterns = parsed?.packages;\n if (!Array.isArray(patterns)) return [];\n return patterns.filter((p): p is string => typeof p === 'string');\n}\n\n/**\n * Every directory the workspace manifest's patterns match that holds a manifest.\n *\n * Expanded with `glob` rather than a hand-rolled `endsWith('/*')` walk so a\n * workspace spelled with `**` or with a `!` exclusion — both legal pnpm, neither\n * used by this repo today — resolves correctly instead of throwing at a user\n * whose only mistake was a different workspace layout.\n */\nexport function workspacePackageDirs(cwd: string): string[] {\n const patterns = workspacePatterns(cwd);\n const include = patterns.filter((p) => !p.startsWith('!'));\n const exclude = patterns.filter((p) => p.startsWith('!')).map((p) => p.slice(1));\n if (include.length === 0) return [];\n\n const matches = globSync(include, {\n cwd,\n absolute: true,\n ignore: ['**/node_modules/**', ...exclude]\n });\n\n return matches\n .filter((dir) => existsSync(join(dir, 'package.json')) && statSync(dir).isDirectory())\n .sort();\n}\n\n/** The source barrel inside `srcDir`, or `undefined` when it has none. */\nfunction findSourceBarrel(srcDir: string): string | undefined {\n for (const ext of BARREL_EXTENSIONS) {\n const candidate = join(srcDir, `index${ext}`);\n if (existsSync(candidate)) return candidate;\n }\n return undefined;\n}\n\n/**\n * The `@object-ui/*` alias table, derived from the workspace manifest.\n *\n * Targets the package's `src` DIRECTORY, not the barrel file inside it —\n * matching how every checked-in bundler config in this repo aliases the same\n * packages. A directory target is also the only one that survives a subpath\n * import: an alias replaces the matched prefix, so a file target rewrites\n * `<scope>/<pkg>/<subpath>` into `<barrel-file>/<subpath>`, a path that cannot\n * exist. With a directory the same rewrite lands in the source tree, and Vite\n * resolves the bare specifier through the directory's barrel by itself.\n *\n * A package is included when it exposes a barrel, which is the property that\n * makes it consumable from source at all — `@object-ui/runner` has a `src/` and\n * no barrel, and an alias pointing at it would only turn one resolver error\n * into another.\n */\nexport function workspaceSourceAliases(cwd: string): Record<string, string> {\n const aliases: Record<string, string> = {};\n\n for (const dir of workspacePackageDirs(cwd)) {\n let name: unknown;\n try {\n name = (JSON.parse(readFileSync(join(dir, 'package.json'), 'utf-8')) as { name?: unknown }).name;\n } catch {\n continue;\n }\n if (typeof name !== 'string' || !name.startsWith(PLATFORM_SCOPE)) continue;\n\n const srcDir = join(dir, 'src');\n if (!existsSync(srcDir) || !findSourceBarrel(srcDir)) continue;\n\n aliases[name] = srcDir;\n }\n\n return aliases;\n}\n\n/**\n * Where `lucide-react` is resolved from for the temp app.\n *\n * The generated sources import it directly, and inside a workspace the temp app\n * has no `node_modules` of its own while the repo root declares no icon library\n * either — so it is resolved out of `@object-ui/components`, which does declare\n * it.\n *\n * Returns the package ROOT, not the entry file `require.resolve` reports. The\n * entry-file spelling this replaces made the alias hijack every subpath import\n * in the workspace and rewrite it into `<entry-file>/<subpath>`: with the\n * platform packages aliased and their sources finally reachable,\n * `packages/components/src/lib/lazy-icon.tsx` answered 500 for exactly that\n * reason (it imports the library's dynamic-icon subpath). Aliasing the root\n * makes bare and subpath specifiers land on the same directory the importer\n * would have reached without an alias, and lets Vite pick the entry the\n * package's own `exports` names rather than pinning the app to whichever build\n * CommonJS resolution happens to report.\n */\nexport function resolveLucideAlias(cwd: string): string | undefined {\n const require = createRequire(join(cwd, 'package.json'));\n try {\n return dirname(require.resolve('lucide-react/package.json', { paths: [join(cwd, 'packages/components')] }));\n } catch {\n return undefined;\n }\n}\n\n/**\n * The PostCSS plugins the workspace-local temp app is served with.\n *\n * Inside a workspace the generated app installs nothing (it resolves everything\n * by hoisting) and its own `postcss.config.js` is removed, so this is the only\n * thing that compiles its stylesheet. Two things about it are deliberate:\n *\n * 1. **`@tailwindcss/postcss`, not `tailwindcss`.** Tailwind 4 moved the PostCSS\n * plugin into its own package; calling `tailwindcss()` as a plugin — which\n * this did until objectui#3852, passing it the generated\n * `tailwind.config.js` — hits a shim whose only job is to throw (\"It looks\n * like you're trying to use `tailwindcss` directly as a PostCSS plugin\"). The\n * config-file argument goes away with it: v4 is CSS-first and the generated\n * `src/index.css` carries its own `@source`/`@theme` (see `app-generator.ts`).\n * 2. **Resolved from this CLI, and loud when it cannot be.** Both plugins are\n * declared by `@object-ui/cli` itself, so a bare `import` finds them wherever\n * the CLI is installed — rather than depending on what the invoking project\n * happens to hoist (this repo's root declares `tailwindcss` but NOT\n * `@tailwindcss/postcss`, so resolving from the cwd cannot work here at all).\n * A failure throws with the reason attached: the previous `catch` warned one\n * yellow line and served the app with no stylesheet, which is exactly how a\n * dead CSS pipeline stayed unnoticed long enough to be filed as\n * objectui#3852.\n */\nexport async function loadTempAppPostcssPlugins(): Promise<unknown[]> {\n try {\n const [tailwindPostcss, autoprefixer] = await Promise.all([\n import('@tailwindcss/postcss'),\n import('autoprefixer')\n ]);\n return [tailwindPostcss.default(), autoprefixer.default()];\n } catch (error) {\n // The caught error's message is inlined below. We can't pass it as the\n // `Error` `cause` option because this package targets ES2020, whose lib\n // types the 1-arg `Error` constructor only; hence the scoped disable.\n // eslint-disable-next-line preserve-caught-error\n throw new Error(\n `Failed to load the Tailwind CSS PostCSS pipeline: ${error instanceof Error ? error.message : error}\\n` +\n ` Both '@tailwindcss/postcss' and 'autoprefixer' are dependencies of @object-ui/cli — a\\n` +\n ` broken install of the CLI is the likeliest cause; reinstall it and try again.\\n` +\n ` (Refusing to start unstyled: that failure is silent in the browser.)`\n );\n }\n}\n\n/** The Vite settings a temp app needs to run from workspace source. */\nexport interface WorkspaceViteConfig {\n resolve: { alias: Record<string, string> };\n css: { postcss: { plugins: unknown[] } };\n}\n\n/**\n * Everything `dev`, `serve` and `build` must add to their Vite config when the\n * temp app is generated inside a workspace, plus the one file they must remove.\n *\n * Kept as a single call the three commands spread into their config so they\n * cannot drift apart again: `serve` and `build` had no workspace branch at all\n * (objectui#3890), so both were incapable of resolving a platform package here\n * — a defect no amount of correctness in `dev` could cover.\n *\n * The removal is of the generated `postcss.config.js`: the programmatic\n * `css.postcss` returned here takes over (an inline config makes Vite skip\n * config-file discovery entirely), and the generated file names a plugin the\n * temp app never installs inside a workspace, so leaving it for a later Vite\n * pass to find would only reintroduce an unresolvable plugin.\n */\nexport async function prepareWorkspaceTempApp(cwd: string, tmpDir: string): Promise<WorkspaceViteConfig> {\n const postcssPath = join(tmpDir, 'postcss.config.js');\n if (existsSync(postcssPath)) {\n unlinkSync(postcssPath);\n }\n\n const alias: Record<string, string> = { ...workspaceSourceAliases(cwd) };\n const lucide = resolveLucideAlias(cwd);\n if (lucide) {\n alias['lucide-react'] = lucide;\n }\n\n return {\n resolve: { alias },\n css: { postcss: { plugins: await loadTempAppPostcssPlugins() } }\n };\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { existsSync, writeFileSync, mkdirSync } from 'fs';\nimport { dirname, join } from 'path';\nimport chalk from 'chalk';\n\nimport {\n platformPackageRange,\n REACT_RANGE,\n SCAFFOLD_DEV_DEPENDENCIES\n} from '../utils/scaffold-dependencies.js';\n\ninterface InitOptions {\n template: string;\n}\n\nconst templates = {\n simple: {\n type: 'div',\n className: 'min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 to-indigo-100',\n body: {\n type: 'card',\n className: 'w-full max-w-md shadow-lg',\n title: 'Welcome to Object UI',\n description: 'Start building your application with JSON schemas',\n body: {\n type: 'div',\n className: 'p-6 space-y-4',\n body: [\n {\n type: 'text',\n content: 'This is a simple example. Edit app.json to customize your application.',\n className: 'text-sm text-muted-foreground',\n },\n {\n type: 'button',\n label: 'Get Started',\n className: 'w-full',\n },\n ],\n },\n },\n },\n form: {\n type: 'div',\n className: 'min-h-screen flex items-center justify-center bg-gradient-to-br from-purple-50 to-pink-100 p-4',\n body: {\n type: 'card',\n className: 'w-full max-w-2xl shadow-xl',\n title: 'Contact Form',\n description: 'Fill out the form below to get in touch',\n body: {\n type: 'div',\n className: 'p-6 space-y-6',\n body: [\n {\n type: 'div',\n className: 'grid grid-cols-2 gap-4',\n body: [\n {\n type: 'input',\n label: 'First Name',\n placeholder: 'John',\n required: true,\n },\n {\n type: 'input',\n label: 'Last Name',\n placeholder: 'Doe',\n required: true,\n },\n ],\n },\n {\n type: 'input',\n label: 'Email Address',\n inputType: 'email',\n placeholder: 'john.doe@example.com',\n required: true,\n },\n {\n type: 'input',\n label: 'Phone Number',\n inputType: 'tel',\n placeholder: '+1 (555) 000-0000',\n },\n {\n type: 'textarea',\n label: 'Message',\n placeholder: 'Tell us what you need...',\n rows: 4,\n },\n {\n type: 'div',\n className: 'flex gap-3',\n body: [\n {\n type: 'button',\n label: 'Submit',\n className: 'flex-1',\n },\n {\n type: 'button',\n label: 'Reset',\n variant: 'outline',\n className: 'flex-1',\n },\n ],\n },\n ],\n },\n },\n },\n dashboard: {\n type: 'div',\n className: 'min-h-screen bg-muted/10',\n body: [\n {\n type: 'div',\n className: 'border-b bg-background',\n body: {\n type: 'div',\n className: 'container mx-auto px-6 py-4',\n body: {\n type: 'div',\n className: 'flex items-center justify-between',\n body: [\n {\n type: 'div',\n className: 'text-2xl font-bold',\n body: { type: 'text', content: 'Dashboard' },\n },\n {\n type: 'button',\n label: 'New Item',\n size: 'sm',\n },\n ],\n },\n },\n },\n {\n type: 'div',\n className: 'container mx-auto p-6 space-y-6',\n body: [\n {\n type: 'div',\n className: 'grid gap-4 md:grid-cols-2 lg:grid-cols-4',\n body: [\n {\n type: 'card',\n className: 'shadow-sm',\n body: [\n {\n type: 'div',\n className: 'p-6 pb-2',\n body: {\n type: 'div',\n className: 'text-sm font-medium text-muted-foreground',\n body: { type: 'text', content: 'Total Revenue' },\n },\n },\n {\n type: 'div',\n className: 'p-6 pt-0',\n body: [\n {\n type: 'div',\n className: 'text-2xl font-bold',\n body: { type: 'text', content: '$45,231.89' },\n },\n {\n type: 'div',\n className: 'text-xs text-muted-foreground mt-1',\n body: { type: 'text', content: '+20.1% from last month' },\n },\n ],\n },\n ],\n },\n {\n type: 'card',\n className: 'shadow-sm',\n body: [\n {\n type: 'div',\n className: 'p-6 pb-2',\n body: {\n type: 'div',\n className: 'text-sm font-medium text-muted-foreground',\n body: { type: 'text', content: 'Active Users' },\n },\n },\n {\n type: 'div',\n className: 'p-6 pt-0',\n body: [\n {\n type: 'div',\n className: 'text-2xl font-bold',\n body: { type: 'text', content: '+2,350' },\n },\n {\n type: 'div',\n className: 'text-xs text-muted-foreground mt-1',\n body: { type: 'text', content: '+180.1% from last month' },\n },\n ],\n },\n ],\n },\n {\n type: 'card',\n className: 'shadow-sm',\n body: [\n {\n type: 'div',\n className: 'p-6 pb-2',\n body: {\n type: 'div',\n className: 'text-sm font-medium text-muted-foreground',\n body: { type: 'text', content: 'Sales' },\n },\n },\n {\n type: 'div',\n className: 'p-6 pt-0',\n body: [\n {\n type: 'div',\n className: 'text-2xl font-bold',\n body: { type: 'text', content: '+12,234' },\n },\n {\n type: 'div',\n className: 'text-xs text-muted-foreground mt-1',\n body: { type: 'text', content: '+19% from last month' },\n },\n ],\n },\n ],\n },\n {\n type: 'card',\n className: 'shadow-sm',\n body: [\n {\n type: 'div',\n className: 'p-6 pb-2',\n body: {\n type: 'div',\n className: 'text-sm font-medium text-muted-foreground',\n body: { type: 'text', content: 'Active Now' },\n },\n },\n {\n type: 'div',\n className: 'p-6 pt-0',\n body: [\n {\n type: 'div',\n className: 'text-2xl font-bold',\n body: { type: 'text', content: '+573' },\n },\n {\n type: 'div',\n className: 'text-xs text-muted-foreground mt-1',\n body: { type: 'text', content: '+201 since last hour' },\n },\n ],\n },\n ],\n },\n ],\n },\n {\n type: 'card',\n className: 'shadow-sm',\n title: 'Recent Activity',\n description: 'Your latest updates and notifications',\n body: {\n type: 'div',\n className: 'p-6 pt-0 space-y-4',\n body: [\n {\n type: 'div',\n className: 'flex items-center gap-4 border-b pb-4',\n body: [\n {\n type: 'div',\n className: 'flex-1',\n body: [\n {\n type: 'div',\n className: 'font-medium',\n body: { type: 'text', content: 'New user registration' },\n },\n {\n type: 'div',\n className: 'text-sm text-muted-foreground',\n body: { type: 'text', content: '2 minutes ago' },\n },\n ],\n },\n ],\n },\n {\n type: 'div',\n className: 'flex items-center gap-4 border-b pb-4',\n body: [\n {\n type: 'div',\n className: 'flex-1',\n body: [\n {\n type: 'div',\n className: 'font-medium',\n body: { type: 'text', content: 'Payment received' },\n },\n {\n type: 'div',\n className: 'text-sm text-muted-foreground',\n body: { type: 'text', content: '15 minutes ago' },\n },\n ],\n },\n ],\n },\n {\n type: 'div',\n className: 'flex items-center gap-4',\n body: [\n {\n type: 'div',\n className: 'flex-1',\n body: [\n {\n type: 'div',\n className: 'font-medium',\n body: { type: 'text', content: 'New order placed' },\n },\n {\n type: 'div',\n className: 'text-sm text-muted-foreground',\n body: { type: 'text', content: '1 hour ago' },\n },\n ],\n },\n ],\n },\n ],\n },\n },\n ],\n },\n ],\n },\n};\n\n/**\n * The `package.json` `objectui init` writes into a new user project.\n *\n * Split out of `init()` so it can be judged without running the command:\n * `app-generator.test.ts`'s `DEPENDENCY_ANCHORS` now covers this manifest\n * alongside the two temp-app generators, which is the gate it had none of\n * before (objectui#3892 — the literals live in `.ts` source, so objectui#3711's\n * version-claims scan never saw them either).\n *\n * Not one range is written here. Every value comes from\n * `utils/scaffold-dependencies.ts`, which is also what the app generators read;\n * see that module for why the `@object-ui/*` range is derived from the CLI's\n * own version rather than declared.\n */\nexport function buildInitPackageJson(name: string): Record<string, unknown> {\n const platformRange = platformPackageRange();\n return {\n name,\n version: '0.1.0',\n private: true,\n type: 'module',\n scripts: {\n dev: 'vite',\n build: 'tsc && vite build',\n preview: 'vite preview',\n },\n dependencies: {\n '@object-ui/components': platformRange,\n '@object-ui/react': platformRange,\n react: REACT_RANGE,\n 'react-dom': REACT_RANGE,\n },\n devDependencies: { ...SCAFFOLD_DEV_DEPENDENCIES },\n };\n}\n\n/**\n * Every file `objectui init` writes, as `relative path -> contents`.\n *\n * Split out of `init()` for the same reason `buildInitPackageJson` was\n * (objectui#3892): the command writes with `fs` directly, so until the map is a\n * value there is nothing for a structural gate to judge. `app-generator.ts`\n * exports `buildAppFiles` / `buildRoutedAppFiles` for exactly this, and the two\n * gates `app-generator.test.ts` runs over those maps — every import declared,\n * every versioned declaration imported — are what objectui#4061 and\n * objectui#4062 were both invisible to. This scaffold is the third generator and\n * had never been under either.\n *\n * `init()` below writes this map and nothing else, and a test pins that\n * equivalence through the real bin, so the map cannot drift from the artifact.\n */\nexport function buildInitFiles(name: string, templateName: string): Record<string, string> {\n const template = templates[templateName as keyof typeof templates];\n if (!template) {\n throw new Error(\n `Unknown template: ${templateName}\\nAvailable templates: ${Object.keys(templates).join(', ')}`\n );\n }\n\n const readme = `# ${name}\n\nAn Object UI application built from JSON schemas.\n\n## Getting Started\n\n1. Install dependencies:\n \\`\\`\\`bash\n npm install\n \\`\\`\\`\n\n2. Start the development server:\n \\`\\`\\`bash\n npm run dev\n \\`\\`\\`\n\n3. Open your browser and visit http://localhost:3000\n\n## Customize Your App\n\nEdit \\`app.json\\` to customize your application. The dev server will automatically reload when you save changes.\n\n## Available Templates\n\n- **simple**: A minimal getting started template\n- **form**: A contact form example\n- **dashboard**: A full dashboard with metrics and activity feed\n\n## Learn More\n\n- [Object UI Documentation](https://www.objectui.org)\n- [Schema Reference](https://www.objectui.org/docs/protocol/overview)\n- [Component Library](https://www.objectui.org/docs/api/components)\n\n## Commands\n\n- \\`npm run dev\\` - Start development server\n- \\`npm run build\\` - Build for production\n- \\`npm run preview\\` - Preview production build\n\nBuilt with ❤️ using [Object UI](https://www.objectui.org)\n`;\n\n const gitignore = `.objectui-tmp\nnode_modules\ndist\n.DS_Store\n*.log\n`;\n\n const viteConfig = `import { defineConfig } from 'vite';\nimport react from '@vitejs/plugin-react';\n\nexport default defineConfig({\n plugins: [react()],\n server: {\n port: 3000,\n },\n});\n`;\n\n // No tailwind.config.js is written: this scaffold's CSS pipeline is Tailwind 4\n // (`postcss.config.js` names `@tailwindcss/postcss`, `src/index.css` does\n // `@import 'tailwindcss'`), and v4 reads a JS config only when a stylesheet\n // points `@config` at one — none does. The file this used to write was\n // therefore inert: an authoritative-looking `content` list that nothing\n // consumed, while v4's own source detection already covers `index.html` and\n // `src/**` from the project root. objectui#3852 removed the same dead file\n // from the temp-app generators; objectui#3892 removes it here.\n\n const postcssConfig = `export default {\n plugins: {\n '@tailwindcss/postcss': {},\n autoprefixer: {},\n },\n};\n`;\n\n const indexHtml = `<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>${name}</title>\n </head>\n <body>\n <div id=\"root\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n </body>\n</html>\n`;\n\n // The component library's PREBUILT stylesheet, not a `@source` scan of it.\n //\n // The theme utilities these templates lean on (`text-muted-foreground` and\n // `bg-muted/10` in `simple`/`dashboard`, `shadow-sm` on every `card`) resolve\n // through tokens declared in a `@theme` block that lives in\n // `packages/components/src/index.css` — a file `files` does not publish, so an\n // installed consumer cannot compile it and cannot obtain those tokens by\n // scanning `node_modules` either. objectui#3884 measured both halves against a\n // real install: the full class surface a `node_modules` glob reaches is 1331\n // rules, all of them already inside the published `dist/index.css`'s 1410 — the\n // prebuilt sheet is a strict superset, and the `@source` lines are the\n // redundant ~100 kB. `@object-ui/components` exports it as `./style.css`\n // (objectui#4062).\n //\n // Components only. `@object-ui/fields` publishes a `style.css` too and\n // quick-start names it, but `@object-ui/fields@17.3.0` ships ZERO css\n // (measured on the published tarball, objectui#4059) and this scaffold does not\n // depend on it — importing it would be a declaration in the wrong direction\n // (objectui#3755) pointing at an empty file.\n const indexCss = `@import 'tailwindcss';\n@import '@object-ui/components/style.css';\n`;\n\n const mainTsx = `import { StrictMode } from 'react';\nimport { createRoot } from 'react-dom/client';\nimport App from './App';\nimport './index.css';\n\ncreateRoot(document.getElementById('root')!).render(\n <StrictMode>\n <App />\n </StrictMode>,\n);\n`;\n\n // `import '@object-ui/components'` is what fills the component registry, and\n // nothing else does it.\n //\n // `SchemaRenderer` resolves each node through `ComponentRegistry.get(type)`\n // and renders `Unknown component type: <type>` on a miss; registration happens\n // as a side effect of importing `@object-ui/components`, which\n // `@object-ui/react` does not depend on. Without this line every node of all\n // three templates — `div`, `card`, `text`, `button`, `input`, `textarea` — took\n // the miss path, so the scaffold's entire visible output was error boxes\n // (objectui#4061).\n //\n // Components alone, no `@object-ui/plugin-*`: all six types above are\n // registered by this one package (measured), and none of the three templates\n // names a plugin type. The temp-app generator imports nine packages because it\n // renders arbitrary user schemas; adding nine dependencies to a minimal\n // scaffold that uses none of them is the declared-but-unused direction\n // objectui#3755 removed.\n const appTsx = `import { SchemaRenderer } from '@object-ui/react';\n// Registers the component renderers SchemaRenderer looks up. Side-effect\n// import — removing it makes every node render \"Unknown component type\".\nimport '@object-ui/components';\nimport schema from '../app.json';\n\nexport default function App() {\n return <SchemaRenderer schema={schema} />;\n}\n`;\n\n // The ambient declaration that makes `src/main.tsx`'s `import './index.css'`\n // compile under the `tsconfig` written below.\n //\n // TypeScript has no built-in notion of a `.css` module, so without this the\n // entry fails that config with \"Cannot find module or type declarations for\n // side-effect import of './index.css'\" (TS2882) — and unlike the two temp-app\n // generators objectui#3853 fixed, the error is LIVE here: the `package.json`\n // this scaffold writes declares `build: \"tsc && vite build\"`, so `objectui\n // init` followed by the `npm run build` the generated README names fails on a\n // file the tool itself produced, before Vite is ever reached (objectui#4111).\n //\n // `vite/client` is where the `declare module '*.css'` declarations live,\n // `vite` is already in `SCAFFOLD_DEV_DEPENDENCIES`, and this is the file\n // `create-vite`'s own React+TS template writes for the same reason — the\n // ecosystem's spelling of the fix rather than a local invention.\n //\n // Byte-identical to `APP_VITE_ENV_D_TS` in `utils/app-generator.ts`;\n // `app-generator.test.ts` pins all three generators to the one string rather\n // than trusting them not to drift. It is also the one generated `src/**` file\n // deliberately unreachable from `src/main.tsx`: an ambient declaration enters\n // the program through the tsconfig's `include`, never through the module\n // graph, which is why that suite's reachability gate exempts `.d.ts`.\n const viteEnvDts = `/// <reference types=\"vite/client\" />\\n`;\n\n const tsconfig = {\n compilerOptions: {\n target: 'ES2020',\n useDefineForClassFields: true,\n lib: ['ES2020', 'DOM', 'DOM.Iterable'],\n module: 'ESNext',\n skipLibCheck: true,\n moduleResolution: 'bundler',\n allowImportingTsExtensions: true,\n isolatedModules: true,\n moduleDetection: 'force',\n noEmit: true,\n jsx: 'react-jsx',\n strict: true,\n noUnusedLocals: true,\n noUnusedParameters: true,\n noFallthroughCasesInSwitch: true,\n resolveJsonModule: true,\n },\n include: ['src'],\n };\n\n // Insertion order is the order `init()` writes and logs them.\n return {\n 'app.json': JSON.stringify(template, null, 2),\n 'README.md': readme,\n '.gitignore': gitignore,\n 'package.json': JSON.stringify(buildInitPackageJson(name), null, 2),\n 'vite.config.ts': viteConfig,\n 'postcss.config.js': postcssConfig,\n 'index.html': indexHtml,\n 'src/index.css': indexCss,\n 'src/main.tsx': mainTsx,\n 'src/App.tsx': appTsx,\n 'src/vite-env.d.ts': viteEnvDts,\n 'tsconfig.json': JSON.stringify(tsconfig, null, 2),\n };\n}\n\nexport async function init(name: string, options: InitOptions) {\n const cwd = process.cwd();\n const projectDir = join(cwd, name);\n\n // Check if directory already exists\n if (existsSync(projectDir) && name !== '.') {\n throw new Error(`Directory \"${name}\" already exists. Please choose a different name.`);\n }\n\n const targetDir = name === '.' ? cwd : projectDir;\n\n // Create project directory if needed\n if (name !== '.') {\n mkdirSync(projectDir, { recursive: true });\n }\n\n console.log(chalk.blue('🎨 Creating Object UI application...'));\n console.log(chalk.dim(` Template: ${options.template}`));\n console.log();\n\n // Writes the file map and nothing else — see `buildInitFiles`. Unknown\n // templates still throw here, before the first write.\n for (const [relativePath, contents] of Object.entries(\n buildInitFiles(name, options.template)\n )) {\n const target = join(targetDir, relativePath);\n mkdirSync(dirname(target), { recursive: true });\n writeFileSync(target, contents);\n console.log(chalk.green(`✓ Created ${relativePath}`));\n }\n\n console.log();\n console.log(chalk.green('✨ Application created successfully!'));\n console.log();\n console.log(chalk.bold('Next steps:'));\n console.log();\n if (name !== '.') {\n console.log(chalk.cyan(` cd ${name}`));\n }\n console.log(chalk.cyan(' npm install'));\n console.log(chalk.cyan(' npm run dev'));\n console.log();\n console.log(chalk.dim(' The development server will start on http://localhost:3000'));\n console.log();\n}\n"],"mappings":";AAQA,SAAS,cAAc,oBAAiC;AACxD,OAAO,WAAW;AAClB,SAAS,aAAAA,kBAAiB;AAC1B,SAAS,QAAAC,aAAY;AACrB,OAAOC,YAAW;AAClB,SAAS,gBAAgB;;;ACLzB,SAAS,gBAAAC,eAAc,eAAe,WAAW,aAAa,UAAU,cAAAC,mBAAkB;AAC1F,SAAS,WAAAC,UAAS,QAAAC,aAAY;AAC9B,OAAO,WAAW;AAClB,YAAY,UAAU;;;ACuBtB,SAAS,YAAY,oBAAoB;AACzC,SAAS,SAAS,YAAY;AAC9B,SAAS,qBAAqB;AAG9B,IAAM,mBAAmB;AAGzB,IAAI;AAUG,SAAS,aAAqB;AACnC,MAAI,qBAAqB,OAAW,QAAO;AAE3C,MAAI,MAAM,QAAQ,cAAc,YAAY,GAAG,CAAC;AAChD,aAAS;AACP,UAAM,YAAY,KAAK,KAAK,cAAc;AAC1C,QAAI,WAAW,SAAS,GAAG;AACzB,YA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IAAI;AACZ,UAAQ,IAAIA,OAAM,MAAM,0CAAqC,CAAC;AAC9D,UAAQ,IAAI;AACZ,UAAQ,IAAIA,OAAM,KAAK,aAAa,CAAC;AACrC,UAAQ,IAAI;AACZ,MAAI,SAAS,KAAK;AAChB,YAAQ,IAAIA,OAAM,KAAK,QAAQ,IAAI,EAAE,CAAC;AAAA,EACxC;AACA,UAAQ,IAAIA,OAAM,KAAK,eAAe,CAAC;AACvC,UAAQ,IAAIA,OAAM,KAAK,eAAe,CAAC;AACvC,UAAQ,IAAI;AACZ,UAAQ,IAAIA,OAAM,IAAI,8DAA8D,CAAC;AACrF,UAAQ,IAAI;AACd;","names":["mkdirSync","join","chalk","readFileSync","existsSync","dirname","join","readFileSync","join","existsSync","dirname","existsSync","statSync","dirname","join","chalk","existsSync","statSync","dirname","join","chalk","existsSync","readFileSync","statSync","dirname","join","require","chalk","join","mkdirSync","existsSync","writeFileSync","mkdirSync","dirname","join","chalk","join","existsSync","mkdirSync","chalk","dirname","writeFileSync"]}