@object-ui/cli 17.2.0 → 17.5.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/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cli.ts","../src/commands/dev.ts","../src/commands/build.ts","../src/commands/start.ts","../src/commands/lint.ts","../src/commands/test.ts","../src/commands/generate.ts","../src/commands/doctor.ts","../src/commands/add.ts","../src/commands/studio.ts","../src/commands/check.ts","../src/commands/validate.ts","../src/utils/spec-vocabulary-hint.ts","../src/commands/create-plugin.ts","../src/commands/analyze.ts"],"sourcesContent":["#!/usr/bin/env node\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 */\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport { serve } from './commands/serve.js';\nimport { init } from './commands/init.js';\nimport { dev } from './commands/dev.js';\nimport { buildApp } from './commands/build.js';\nimport { start } from './commands/start.js';\nimport { lint } from './commands/lint.js';\nimport { test } from './commands/test.js';\nimport { generate } from './commands/generate.js';\nimport { doctor } from './commands/doctor.js';\nimport { add } from './commands/add.js';\nimport { studio } from './commands/studio.js';\nimport { check } from './commands/check.js';\nimport { validate } from './commands/validate.js';\nimport { createPlugin } from './commands/create-plugin.js';\nimport { analyze } from './commands/analyze.js';\nimport { readFileSync } from 'fs';\nimport { fileURLToPath } from 'url';\nimport { dirname, join } from 'path';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Read package.json for version\nconst packageJson = JSON.parse(\n readFileSync(join(__dirname, '../package.json'), 'utf-8')\n);\n\nconst program = new Command();\n\nprogram\n .name('objectui')\n .description('CLI tool for Object UI - Build applications from JSON schemas')\n .version(packageJson.version);\n\nprogram\n .command('serve')\n .description('Start a development server with your JSON/YAML schema')\n .argument('[schema]', 'Path to JSON/YAML schema file', 'app.json')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', 'localhost')\n .action(async (schema, options) => {\n try {\n await serve(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('dev')\n .description('Start development server (alias for serve)')\n .argument('[schema]', 'Path to JSON/YAML schema file', 'app.json')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', 'localhost')\n .option('--no-open', 'Do not open browser automatically')\n .action(async (schema, options) => {\n try {\n await dev(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('build')\n .description('Build application for production')\n .argument('[schema]', 'Path to JSON/YAML schema file', 'app.json')\n .option('-o, --out-dir <dir>', 'Output directory', 'dist')\n .option('--clean', 'Clean output directory before build', false)\n .action(async (schema, options) => {\n try {\n await buildApp(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('start')\n .description('Start production server')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', '0.0.0.0')\n .option('-d, --dir <dir>', 'Directory to serve', 'dist')\n .action(async (options) => {\n try {\n await start(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('init')\n .description('Initialize a new Object UI application with sample schema')\n .argument('[name]', 'Application name', 'my-app')\n .option('-t, --template <template>', 'Template to use (dashboard, form, simple)', 'dashboard')\n .action(async (name, options) => {\n try {\n await init(name, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('lint')\n .description('Lint the generated application code')\n .option('--fix', 'Automatically fix linting issues')\n .action(async (options) => {\n try {\n await lint(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('test')\n .description('Run tests for the application')\n .option('-w, --watch', 'Run tests in watch mode')\n .option('-c, --coverage', 'Generate test coverage report')\n .option('--ui', 'Run tests with Vitest UI')\n .action(async (options) => {\n try {\n await test(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('generate')\n .alias('g')\n .description('Generate new resources (objects, pages, plugins)')\n .argument('<type>', 'Type of resource to generate (resource/object, page, plugin)')\n .argument('<name>', 'Name of the resource')\n .option('--from <source>', 'Generate schema from external source (openapi.yaml, prisma.schema)')\n .option('--output <dir>', 'Output directory for generated schemas', 'schemas/')\n .action(async (type, name, options) => {\n try {\n // Handle schema generation from external sources\n if (options.from) {\n console.log(chalk.yellow('\\n⚠ Schema generation from external sources (OpenAPI/Prisma) is not yet implemented.'));\n console.log(chalk.gray('This feature will be available in a future release.\\n'));\n process.exit(0);\n }\n \n await generate(type, name);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('doctor')\n .description('Diagnose and fix common issues')\n .action(async () => {\n try {\n await doctor();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('add')\n .description('Add a new component renderer to your project')\n .argument('<component>', 'Component name (e.g. Input, Grid)')\n .action(async (component) => {\n try {\n await add(component);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('studio')\n .description('Start the visual designer')\n .action(async () => {\n try {\n await studio();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('check')\n .description('Validate schema files')\n .action(async () => {\n try {\n await check();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('validate')\n .description('Validate a schema file against ObjectUI specifications')\n .argument('[schema]', 'Path to schema file (JSON or YAML)', 'app.json')\n .action(async (schema) => {\n try {\n await validate(schema);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('create')\n .description('Create new resources')\n .argument('<type>', 'Type of resource to create (plugin)')\n .argument('<name>', 'Name of the resource')\n .action(async (type, name) => {\n try {\n if (type === 'plugin') {\n await createPlugin(name);\n } else {\n console.error(chalk.red(`Unknown resource type: ${type}`));\n console.log(chalk.gray('Available types: plugin'));\n process.exit(1);\n }\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('analyze')\n .description('Analyze application performance')\n .option('--bundle-size', 'Analyze bundle size')\n .option('--render-performance', 'Analyze render performance')\n .action(async (options) => {\n try {\n await analyze(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\n\nprogram.parse();\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 { createServer } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport { existsSync, mkdirSync, unlinkSync, statSync } from 'fs';\nimport { join, resolve, dirname } from 'path';\nimport chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport { createRequire } from 'module';\nimport { scanPagesDirectory, createTempAppWithRouting, createTempApp, parseSchemaFile, type RouteInfo } from '../utils/app-generator.js';\n\ninterface DevOptions {\n port: string;\n host: string;\n open?: boolean;\n}\n\nexport async function dev(schemaPath: string, options: DevOptions) {\n const cwd = process.cwd();\n \n // Resolve the actual project root and schema file\n let _projectRoot = cwd;\n const targetSchemaPath = schemaPath;\n let hasPagesDir = false;\n let pagesDir = '';\n let appConfig: unknown = null;\n\n // 1. Determine Project Root & Mode\n const absoluteSchemaPath = resolve(cwd, schemaPath);\n \n if (existsSync(absoluteSchemaPath) && statSync(absoluteSchemaPath).isFile()) {\n // If input is a file (e.g. examples/showcase/app.json)\n const fileDir = dirname(absoluteSchemaPath);\n const potentialPagesDir = join(fileDir, 'pages');\n\n if (existsSync(potentialPagesDir)) {\n console.log(chalk.blue(`📂 Detected project structure at ${fileDir}`));\n _projectRoot = fileDir;\n hasPagesDir = true;\n pagesDir = potentialPagesDir;\n \n // Try to load app.json as config\n try {\n appConfig = parseSchemaFile(absoluteSchemaPath);\n console.log(chalk.blue('⚙️ Loaded App Config from app.json'));\n } catch (_e) {\n console.warn('Failed to parse app config');\n }\n }\n } \n \n // Fallback: Check detect pages dir in current cwd if not found above\n if (!hasPagesDir) {\n const localPagesDir = join(cwd, 'pages');\n if (existsSync(localPagesDir)) {\n hasPagesDir = true;\n pagesDir = localPagesDir;\n // Try to find and load app.json in cwd\n const appJsonPath = join(cwd, 'app.json');\n if (existsSync(appJsonPath)) {\n try {\n appConfig = parseSchemaFile(appJsonPath);\n console.log(chalk.blue('⚙️ Loaded App Config from app.json'));\n } catch (_e) {\n console.warn('Failed to parse app.json config');\n }\n }\n }\n }\n\n const require = createRequire(join(cwd, 'package.json'));\n \n let routes: RouteInfo[] = [];\n let schema: unknown = null;\n let useFileSystemRouting = false;\n\n if (hasPagesDir) {\n // File-system based routing\n console.log(chalk.blue(`📁 Using file-system routing from ${pagesDir}`));\n routes = scanPagesDirectory(pagesDir);\n useFileSystemRouting = true;\n \n if (routes.length === 0) {\n throw new Error(`No schema files found in ${pagesDir}`);\n }\n \n console.log(chalk.green(`✓ Found ${routes.length} route(s)`));\n routes.forEach(route => {\n console.log(chalk.dim(` ${route.path} → ${route.filePath.replace(cwd, '.')}`));\n });\n } else {\n // Single schema file mode\n const fullSchemaPath = resolve(cwd, schemaPath);\n // ... (rest of the logic)\n if (!existsSync(fullSchemaPath)) {\n throw new Error(`Schema file not found: ${schemaPath}\\nRun 'objectui init' to create a sample schema.`);\n }\n console.log(chalk.blue('📋 Loading schema:'), chalk.cyan(schemaPath));\n try {\n schema = parseSchemaFile(fullSchemaPath);\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\n // Create temporary app directory (always in cwd to keep node_modules access)\n const tmpDir = join(cwd, '.objectui-tmp');\n mkdirSync(tmpDir, { recursive: true });\n\n // Create temporary app files\n if (useFileSystemRouting) {\n createTempAppWithRouting(tmpDir, routes, appConfig);\n } else {\n createTempApp(tmpDir, schema);\n }\n\n\n // Install dependencies\n const isMonorepo = existsSync(join(cwd, 'pnpm-workspace.yaml'));\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 // Create Vite config\n const viteConfig: any = {\n root: tmpDir,\n server: {\n port: parseInt(options.port),\n host: options.host,\n open: options.open !== false,\n fs: {\n // Allow serving files from workspace root\n allow: [cwd],\n }\n },\n resolve: {\n alias: {}\n },\n plugins: [react()],\n };\n\n if (isMonorepo) {\n console.log(chalk.blue('📦 Detected monorepo - configuring workspace aliases'));\n \n // Remove postcss.config.js to prevent interference with programmatic config\n const postcssPath = join(tmpDir, 'postcss.config.js');\n if (existsSync(postcssPath)) {\n unlinkSync(postcssPath);\n }\n\n // Add aliases for workspace packages\n viteConfig.resolve.alias = {\n '@object-ui/react': join(cwd, 'packages/react/src/index.ts'),\n '@object-ui/components': join(cwd, 'packages/components/src/index.ts'),\n '@object-ui/core': join(cwd, 'packages/core/src/index.ts'),\n '@object-ui/types': join(cwd, 'packages/types/src/index.ts'),\n '@object-ui/plugin-charts': join(cwd, 'packages/plugin-charts/src/index.tsx'),\n '@object-ui/plugin-editor': join(cwd, 'packages/plugin-editor/src/index.tsx'),\n '@object-ui/plugin-kanban': join(cwd, 'packages/plugin-kanban/src/index.tsx'),\n '@object-ui/plugin-markdown': join(cwd, 'packages/plugin-markdown/src/index.tsx'),\n '@object-ui/plugin-form': join(cwd, 'packages/plugin-form/src/index.tsx'),\n '@object-ui/plugin-grid': join(cwd, 'packages/plugin-grid/src/index.tsx'),\n '@object-ui/plugin-view': join(cwd, 'packages/plugin-view/src/index.tsx'),\n };\n\n // Fix: Resolve lucide-react from components package to avoid \"dependency not found\" in temp app\n try {\n // Trying to find lucide-react in the components' node_modules or hoist\n // checking specifically in packages/components context\n const lucidePath = require.resolve('lucide-react', { paths: [join(cwd, 'packages/components')] });\n // We might get the cjs entry, but for aliasing usually fine. \n // Better yet, if we can find the package root, but require.resolve gives file.\n // Let's just use what require.resolve gives.\n viteConfig.resolve.alias['lucide-react'] = lucidePath;\n } catch (e) {\n console.warn('⚠️ Could not resolve lucide-react automatically:', e);\n }\n \n // Debug aliases\n // console.log('Aliases:', viteConfig.resolve.alias);\n\n // Configure PostCSS programmatically reusing root dependencies\n try {\n const tailwindcss = require('tailwindcss');\n const autoprefixer = require('autoprefixer');\n \n viteConfig.css = {\n postcss: {\n plugins: [\n tailwindcss(join(tmpDir, 'tailwind.config.js')),\n autoprefixer(),\n ],\n },\n };\n } catch (_e) {\n console.warn(chalk.yellow('⚠️ Failed to load PostCSS plugins from root node_modules. Styles might not work correctly.'));\n }\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('✓ Development 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 { build as viteBuild } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport { existsSync, mkdirSync, cpSync, rmSync } from 'fs';\nimport { join, resolve } from 'path';\nimport chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport { scanPagesDirectory, createTempAppWithRouting, createTempApp, parseSchemaFile, type RouteInfo } from '../utils/app-generator.js';\n\ninterface BuildOptions {\n outDir?: string;\n clean?: boolean;\n}\n\nexport async function buildApp(schemaPath: string, options: BuildOptions) {\n const cwd = process.cwd();\n const outDir = options.outDir || 'dist';\n const outputPath = resolve(cwd, outDir);\n \n console.log(chalk.blue('🔨 Building application for production...'));\n console.log();\n \n // Check if pages directory exists for file-system routing\n const pagesDir = join(cwd, 'pages');\n const hasPagesDir = existsSync(pagesDir);\n \n let routes: RouteInfo[] = [];\n let schema: unknown = null;\n let useFileSystemRouting = false;\n\n if (hasPagesDir) {\n // File-system based routing\n console.log(chalk.blue('📁 Using file-system routing'));\n routes = scanPagesDirectory(pagesDir);\n useFileSystemRouting = true;\n \n if (routes.length === 0) {\n throw new Error('No schema files found in pages/ directory');\n }\n \n console.log(chalk.green(`✓ Found ${routes.length} route(s)`));\n } else {\n // Single schema file mode\n const fullSchemaPath = resolve(cwd, schemaPath);\n\n // Check if schema file exists\n if (!existsSync(fullSchemaPath)) {\n throw new Error(`Schema file not found: ${schemaPath}\\nRun 'objectui init' to create a sample schema.`);\n }\n\n console.log(chalk.blue('📋 Loading schema:'), chalk.cyan(schemaPath));\n\n // Read and validate schema\n try {\n schema = parseSchemaFile(fullSchemaPath);\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\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 (useFileSystemRouting) {\n createTempAppWithRouting(tmpDir, routes);\n } else {\n createTempApp(tmpDir, schema);\n }\n\n // Install dependencies\n console.log(chalk.blue('📦 Installing dependencies...'));\n try {\n execSync('npm install --silent --prefer-offline', { \n cwd: tmpDir, \n stdio: 'pipe',\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 console.log(chalk.blue('⚙️ Building with Vite...'));\n console.log();\n\n // Clean output directory if requested\n if (options.clean && existsSync(outputPath)) {\n console.log(chalk.dim(` Cleaning ${outDir}/ directory...`));\n rmSync(outputPath, { recursive: true, force: true });\n }\n\n // Build with Vite\n try {\n await viteBuild({\n root: tmpDir,\n build: {\n outDir: join(tmpDir, 'dist'),\n emptyOutDir: true,\n reportCompressedSize: true,\n },\n plugins: [react()],\n logLevel: 'info',\n });\n\n // Copy built files to output directory\n mkdirSync(outputPath, { recursive: true });\n cpSync(join(tmpDir, 'dist'), outputPath, { recursive: true });\n\n console.log();\n console.log(chalk.green('✓ Build completed successfully!'));\n console.log();\n console.log(chalk.bold(' Output: ') + chalk.cyan(outDir + '/'));\n console.log();\n console.log(chalk.dim(' To serve the production build, run:'));\n console.log(chalk.cyan(` objectui start --dir ${outDir}`));\n console.log();\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(`Build failed: ${error instanceof Error ? error.message : error}`);\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 express from 'express';\nimport rateLimit from 'express-rate-limit';\nimport { existsSync } from 'fs';\nimport { join, resolve } from 'path';\nimport chalk from 'chalk';\n\ninterface StartOptions {\n port: string;\n host: string;\n dir?: string;\n}\n\nexport async function start(options: StartOptions) {\n const cwd = process.cwd();\n const distDir = options.dir || 'dist';\n const distPath = resolve(cwd, distDir);\n\n // Check if dist directory exists\n if (!existsSync(distPath)) {\n throw new Error(\n `Build directory not found: ${distDir}\\n` +\n `Run 'objectui build' first to create a production build.`\n );\n }\n\n // Check if index.html exists\n const indexPath = join(distPath, 'index.html');\n if (!existsSync(indexPath)) {\n throw new Error(\n `index.html not found in ${distDir}/\\n` +\n `Make sure you have a valid production build.`\n );\n }\n\n console.log(chalk.blue('🚀 Starting production server...\\n'));\n\n const app = express();\n const port = parseInt(options.port);\n const host = options.host;\n\n // Configure rate limiting to prevent abuse\n const limiter = rateLimit({\n windowMs: 15 * 60 * 1000, // 15 minutes\n max: 1000, // Limit each IP to 1000 requests per windowMs\n message: 'Too many requests from this IP, please try again later.',\n standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers\n legacyHeaders: false, // Disable the `X-RateLimit-*` headers\n });\n\n // Apply rate limiting to all routes\n app.use(limiter);\n\n // Serve static files from dist directory\n app.use(express.static(distPath));\n\n // SPA fallback - serve index.html for all routes\n app.get('*', (_req, res) => {\n res.sendFile(indexPath);\n });\n\n // Start server\n app.listen(port, host, () => {\n const protocol = 'http';\n const displayHost = host === '0.0.0.0' ? 'localhost' : host;\n\n console.log(chalk.green('✓ Production server started successfully!'));\n console.log();\n console.log(chalk.bold(' Local: ') + chalk.cyan(`${protocol}://${displayHost}:${port}`));\n console.log(chalk.bold(' Serving: ') + chalk.dim(distDir + '/'));\n console.log();\n console.log(chalk.dim(' Press Ctrl+C to stop the server'));\n console.log();\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 { execSync } from 'child_process';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\nimport chalk from 'chalk';\n\ninterface LintOptions {\n fix?: boolean;\n}\n\nexport async function lint(options: LintOptions) {\n const cwd = process.cwd();\n \n console.log(chalk.blue('🔍 Running linter...\\n'));\n\n // Check if the generated temp app exists\n const tmpDir = join(cwd, '.objectui-tmp');\n const hasTempApp = existsSync(tmpDir);\n\n if (!hasTempApp) {\n throw new Error(\n 'No Object UI application found. Run \\'objectui dev\\' first to generate the application.'\n );\n }\n\n // Check if package.json and node_modules exist\n const packageJsonPath = join(tmpDir, 'package.json');\n const nodeModulesPath = join(tmpDir, 'node_modules');\n \n if (!existsSync(packageJsonPath) || !existsSync(nodeModulesPath)) {\n throw new Error(\n 'Dependencies not installed. Run \\'objectui dev\\' first to set up the application.'\n );\n }\n\n try {\n const fixFlag = options.fix ? '--fix' : '';\n const command = `npx eslint \"src/**/*.{js,jsx,ts,tsx}\" ${fixFlag}`.trim();\n \n console.log(chalk.dim(` Running: ${command}\\n`));\n \n execSync(command, {\n cwd: tmpDir,\n stdio: 'inherit',\n });\n\n console.log();\n console.log(chalk.green('✓ Linting completed successfully!'));\n console.log();\n } catch {\n // ESLint returns non-zero exit code when there are linting errors\n console.log();\n console.log(chalk.yellow('⚠ Linting found issues.'));\n if (!options.fix) {\n console.log(chalk.dim(' Run \\'objectui lint --fix\\' to automatically fix some issues.'));\n }\n console.log();\n process.exit(1);\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 { execSync } from 'child_process';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\nimport chalk from 'chalk';\n\ninterface TestOptions {\n watch?: boolean;\n coverage?: boolean;\n ui?: boolean;\n}\n\nexport async function test(options: TestOptions) {\n const cwd = process.cwd();\n \n console.log(chalk.blue('🧪 Running tests...\\n'));\n\n // Check if the generated temp app exists\n const tmpDir = join(cwd, '.objectui-tmp');\n const hasTempApp = existsSync(tmpDir);\n\n if (!hasTempApp) {\n throw new Error(\n 'No Object UI application found. Run \\'objectui dev\\' first to generate the application.'\n );\n }\n\n // Check if package.json and node_modules exist\n const packageJsonPath = join(tmpDir, 'package.json');\n const nodeModulesPath = join(tmpDir, 'node_modules');\n \n if (!existsSync(packageJsonPath) || !existsSync(nodeModulesPath)) {\n throw new Error(\n 'Dependencies not installed. Run \\'objectui dev\\' first to set up the application.'\n );\n }\n\n try {\n let command = 'npx vitest';\n \n if (options.watch) {\n command += ' --watch';\n } else if (options.ui) {\n command += ' --ui';\n } else {\n command += ' run';\n }\n\n if (options.coverage) {\n command += ' --coverage';\n }\n\n console.log(chalk.dim(` Running: ${command}\\n`));\n \n execSync(command, {\n cwd: tmpDir,\n stdio: 'inherit',\n });\n\n if (!options.watch && !options.ui) {\n console.log();\n console.log(chalk.green('✓ Tests completed successfully!'));\n console.log();\n }\n } catch {\n // Vitest returns non-zero exit code when tests fail\n console.log();\n console.log(chalk.red('✗ Some tests failed.'));\n console.log();\n process.exit(1);\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 chalk from 'chalk';\nimport { existsSync, mkdirSync, writeFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function generate(type: string, name: string) {\n const cwd = process.cwd();\n\n switch (type) {\n case 'resource':\n case 'object':\n generateResource(cwd, name);\n break;\n case 'page':\n generatePage(cwd, name);\n break;\n case 'plugin':\n generatePlugin(cwd, name);\n break;\n default:\n console.log(chalk.red(`Unknown type: ${type}`));\n console.log(`Available types: resource, page, plugin`);\n process.exit(1);\n }\n}\n\nfunction generateResource(cwd: string, name: string) {\n const dir = join(cwd, 'objects');\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n\n const fileName = `${name.toLowerCase()}.json`;\n const filePath = join(dir, fileName);\n\n if (existsSync(filePath)) {\n console.log(chalk.yellow(`Object ${name} already exists at ${filePath}`));\n return;\n }\n\n const content = {\n name: name,\n fields: {\n name: { type: 'text', label: 'Name', required: true }\n }\n };\n\n writeFileSync(filePath, JSON.stringify(content, null, 2));\n console.log(chalk.green(`✓ Generated resource schema: ${filePath}`));\n}\n\nfunction generatePage(cwd: string, name: string) {\n const dir = join(cwd, 'pages');\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n\n const fileName = `${name.toLowerCase()}.json`;\n const filePath = join(dir, fileName);\n\n if (existsSync(filePath)) {\n console.log(chalk.yellow(`Page ${name} already exists at ${filePath}`));\n return;\n }\n\n const content = {\n type: \"page\",\n title: name,\n body: [\n {\n type: \"markdown\",\n content: `# Welcome to ${name}`\n }\n ]\n };\n\n writeFileSync(filePath, JSON.stringify(content, null, 2));\n console.log(chalk.green(`✓ Generated page schema: ${filePath}`));\n}\n\nfunction generatePlugin(cwd: string, name: string) {\n const dir = join(cwd, 'plugins', name);\n if (existsSync(dir)) {\n console.log(chalk.yellow(`Plugin ${name} already exists`));\n return;\n }\n mkdirSync(dir, { recursive: true });\n\n const content = `\nexport const ${name}Plugin = {\n name: '${name}',\n install(app) {\n console.log('${name} plugin installed');\n }\n};\n`;\n\n writeFileSync(join(dir, 'index.ts'), content.trim());\n console.log(chalk.green(`✓ Generated plugin: ${dir}`));\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 chalk from 'chalk';\nimport { existsSync, readFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function doctor() {\n console.log(chalk.bold('Object UI Doctor'));\n console.log('Diagnosis in progress...\\n');\n \n const cwd = process.cwd();\n let issues = 0;\n\n // 1. Check package.json\n const pkgPath = join(cwd, 'package.json');\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n \n // Check React version\n const reactVer = pkg.dependencies?.react || pkg.devDependencies?.react;\n if (reactVer) {\n console.log(chalk.green('✓ React installed'));\n } else {\n console.log(chalk.yellow('⚠️ React not found in dependencies'));\n issues++;\n }\n\n // Check Tailwind\n const tailwindVer = pkg.dependencies?.tailwindcss || pkg.devDependencies?.tailwindcss;\n if (tailwindVer) {\n console.log(chalk.green('✓ Tailwind CSS installed'));\n } else {\n console.log(chalk.yellow('⚠️ Tailwind CSS not found'));\n issues++;\n }\n } catch (e) {\n console.log(chalk.red('x Failed to read package.json'));\n issues++;\n }\n } else {\n console.log(chalk.red('x package.json not found'));\n issues++;\n }\n\n // 2. Check tailwind.config.js\n const tailwindConfigPath = join(cwd, 'tailwind.config.js');\n const tailwindTsPath = join(cwd, 'tailwind.config.ts');\n if (existsSync(tailwindConfigPath) || existsSync(tailwindTsPath)) {\n const configFile = existsSync(tailwindConfigPath) ? 'tailwind.config.js' : 'tailwind.config.ts';\n const configPath = existsSync(tailwindConfigPath) ? tailwindConfigPath : tailwindTsPath;\n console.log(chalk.green(`✓ ${configFile} found`));\n // Check content configuration\n try {\n const configContent = readFileSync(configPath, 'utf-8');\n if (configContent.includes('content') && (configContent.includes('./src') || configContent.includes('./app') || configContent.includes('./pages'))) {\n console.log(chalk.green('✓ Tailwind content paths configured'));\n } else {\n console.log(chalk.yellow('⚠️ Tailwind content paths may not be configured. Ensure your content array includes source directories.'));\n issues++;\n }\n } catch (_e) {\n // File exists but can't be read - not critical\n }\n } else {\n console.log(chalk.yellow('⚠️ tailwind.config.js not found'));\n issues++;\n }\n\n // 3. Check TypeScript version\n const tsConfigPath = join(cwd, 'tsconfig.json');\n if (existsSync(tsConfigPath)) {\n console.log(chalk.green('✓ tsconfig.json found'));\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n const tsVer = pkg.devDependencies?.typescript || pkg.dependencies?.typescript;\n if (tsVer) {\n const majorVer = parseInt(tsVer.replace(/[^0-9.]/g, '').split('.')[0], 10);\n if (majorVer >= 5) {\n console.log(chalk.green(`✓ TypeScript ${tsVer} (5.0+ required)`));\n } else {\n console.log(chalk.yellow(`⚠️ TypeScript ${tsVer} detected — version 5.0+ recommended`));\n issues++;\n }\n }\n } catch (_e) {\n // Already checked package.json above\n }\n } else {\n console.log(chalk.yellow('⚠️ tsconfig.json not found'));\n issues++;\n }\n\n // 4. Check peer dependencies\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };\n \n // Check for common peer dependency issues\n if (allDeps['@object-ui/react'] && !allDeps['react']) {\n console.log(chalk.yellow('⚠️ @object-ui/react requires react as a peer dependency'));\n issues++;\n }\n if (allDeps['@object-ui/components'] && !allDeps['tailwindcss']) {\n console.log(chalk.yellow('⚠️ @object-ui/components requires tailwindcss as a peer dependency'));\n issues++;\n }\n } catch (_e) {\n // Already handled\n }\n }\n\n // Summary\n console.log('\\nResult:');\n if (issues === 0) {\n console.log(chalk.green('Everything looks good! ✨'));\n } else {\n console.log(chalk.yellow(`Found ${issues} issue(s).`));\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 chalk from 'chalk';\nimport { existsSync, mkdirSync, writeFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function add(component: string) {\n console.log(chalk.bold(`Object UI Add: ${component}`));\n console.log(chalk.yellow('Feature not implemented yet.'));\n console.log(`This command will download the source code for ${component}Renderer to your project.`);\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 chalk from 'chalk';\nimport { spawn } from 'child_process';\nimport { existsSync } from 'fs';\nimport { join, resolve, dirname } from 'path';\nimport { fileURLToPath } from 'url';\n\nexport async function studio() {\n console.log(chalk.bold('\\n🎨 Starting ObjectUI Studio...\\n'));\n\n const cwd = process.cwd();\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = dirname(__filename);\n\n // Resolve the console app directory\n // 1. Check monorepo structure (apps/console)\n // 2. Check relative path (../../apps/console from packages/cli)\n const candidates = [\n join(cwd, 'apps/console'),\n resolve(__dirname, '../../apps/console'),\n resolve(__dirname, '../../../apps/console'),\n ];\n\n let consolePath: string | null = null;\n for (const candidate of candidates) {\n if (existsSync(join(candidate, 'package.json'))) {\n consolePath = candidate;\n break;\n }\n }\n\n if (!consolePath) {\n console.log(chalk.yellow('⚠ Console app not found in workspace.'));\n console.log(chalk.dim(' Hint: Run this command from the monorepo root.'));\n console.log(chalk.dim(' Expected: apps/console/package.json\\n'));\n process.exit(1);\n }\n\n console.log(chalk.dim(` Console: ${consolePath}`));\n console.log(chalk.dim(' Mode: MSW (in-browser mock server)\\n'));\n\n // Delegate to the console's dev script which starts Vite + MSW\n const child = spawn('pnpm', ['run', 'dev'], {\n cwd: consolePath,\n stdio: 'inherit',\n env: { ...process.env, NODE_ENV: 'development' },\n shell: true,\n });\n\n child.on('error', (err) => {\n console.error(chalk.red(`\\n ✗ Failed to start studio: ${err.message}`));\n process.exit(1);\n });\n\n child.on('exit', (code) => process.exit(code ?? 0));\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 chalk from 'chalk';\nimport { globSync } from 'glob';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function check() {\n console.log(chalk.bold('Object UI Schema Check'));\n const cwd = process.cwd();\n \n // 1. Find all JSON/YAML files\n const files = globSync('**/*.{json,yaml,yml}', { \n cwd, \n ignore: ['node_modules/**', 'dist/**', '.git/**'] \n });\n \n console.log(`Analyzing ${files.length} files...`);\n \n let errors = 0;\n \n for (const file of files) {\n try {\n // Basic JSON parsing check\n if (file.endsWith('.json')) {\n const content = JSON.parse(readFileSync(join(cwd, file), 'utf-8'));\n // Schema validation: check for ObjectUI schema patterns\n if (content && typeof content === 'object' && content.type) {\n const knownTypes = [\n 'page', 'form', 'grid', 'crud', 'kanban', 'calendar', 'dashboard',\n 'chart', 'detail', 'list', 'timeline', 'gantt', 'map', 'gallery',\n 'object-view', 'detail-view', 'object-chart',\n ];\n if (typeof content.type === 'string' && !knownTypes.includes(content.type)) {\n console.log(chalk.yellow(`⚠️ Unknown schema type \"${content.type}\" in ${file}`));\n }\n }\n }\n } catch (e) {\n console.log(chalk.red(`x Invalid JSON in ${file}: ${(e as Error).message}`));\n errors++;\n }\n }\n \n if (errors === 0) {\n console.log(chalk.green('✓ All checks passed'));\n } else {\n console.log(chalk.red(`Found ${errors} errors`));\n process.exit(1);\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 chalk from 'chalk';\nimport { readFileSync, existsSync } from 'fs';\nimport { resolve } from 'path';\nimport { load as loadYaml } from 'js-yaml';\nimport { safeValidateSchema } from '@object-ui/types/zod';\nimport { findSpecVocabularyFormFields } from '../utils/spec-vocabulary-hint.js';\n\n/**\n * Validate a schema file\n * \n * @param schemaPath - Path to the schema file (JSON or YAML)\n */\nexport async function validate(schemaPath: string) {\n console.log(chalk.blue('🔍 ObjectUI Schema Validator\\n'));\n\n // Resolve the schema path\n const resolvedPath = resolve(process.cwd(), schemaPath);\n\n // Check if file exists\n if (!existsSync(resolvedPath)) {\n console.error(chalk.red(`✗ Error: Schema file not found: ${schemaPath}`));\n process.exit(1);\n }\n\n try {\n // Read the file\n const fileContent = readFileSync(resolvedPath, 'utf-8');\n let schema: unknown;\n\n // Parse based on file extension\n if (schemaPath.endsWith('.yaml') || schemaPath.endsWith('.yml')) {\n console.log(chalk.gray(`Reading YAML schema from: ${schemaPath}`));\n schema = loadYaml(fileContent);\n } else if (schemaPath.endsWith('.json')) {\n console.log(chalk.gray(`Reading JSON schema from: ${schemaPath}`));\n schema = JSON.parse(fileContent);\n } else {\n // Try JSON first, then YAML\n try {\n schema = JSON.parse(fileContent);\n console.log(chalk.gray(`Reading schema from: ${schemaPath} (detected as JSON)`));\n } catch {\n schema = loadYaml(fileContent);\n console.log(chalk.gray(`Reading schema from: ${schemaPath} (detected as YAML)`));\n }\n }\n\n // Validate the schema\n console.log(chalk.gray('Validating schema...\\n'));\n const result = safeValidateSchema(schema);\n\n if (result.success) {\n console.log(chalk.green('✓ Schema is valid!\\n'));\n \n // Show some info about the schema\n const data = result.data;\n console.log(chalk.bold('Schema Information:'));\n console.log(chalk.gray(' Type:'), data.type || 'unknown');\n \n if (data.id) {\n console.log(chalk.gray(' ID:'), data.id);\n }\n \n if (data.label || data.title) {\n console.log(chalk.gray(' Label:'), data.label || data.title);\n }\n \n // Count children if present\n if (data.children && Array.isArray(data.children)) {\n console.log(chalk.gray(' Children:'), data.children.length);\n }\n\n // Mixed-vocabulary entries validate (the runtime `name` satisfies the\n // schema) but the spec `field` key is dead weight: the renderer ignores\n // it and strip-mode validation drops it. Valid ≠ clean — say so (#3090).\n const mixed = findSpecVocabularyFormFields(schema).filter((f) => f.mixedName);\n if (mixed.length > 0) {\n console.log(chalk.yellow('\\nWarnings:'));\n for (const m of mixed) {\n console.log(chalk.yellow(\n ` ${m.path}: '${m.mixedName}' also carries { field: '${m.field}' } — mixed form-field ` +\n `vocabularies. The renderer ignores \\`field\\` here; drop one of the two.`,\n ));\n }\n }\n\n console.log('');\n process.exit(0);\n } else {\n console.error(chalk.red('✗ Schema validation failed!\\n'));\n console.error(chalk.bold('Validation Errors:'));\n \n // Format Zod errors nicely. `.issues` is the only accessor on a Zod 4\n // ZodError — the `.errors` alias was removed, so reading it yielded\n // undefined and this loop threw a TypeError that the catch below\n // reported as \"Error reading or parsing schema file\", hiding the very\n // errors this command exists to print.\n result.error.issues.forEach((issue, index) => {\n console.error(chalk.red(`\\n${index + 1}. ${issue.message}`));\n if (issue.path && issue.path.length > 0) {\n console.error(chalk.gray(` Path: ${issue.path.join(' → ')}`));\n }\n if (issue.code) {\n console.error(chalk.gray(` Code: ${issue.code}`));\n }\n });\n\n // \"name: expected string, received undefined\" on a `{ field: … }` entry\n // reads as an instruction to bolt a `name` on — which converts the\n // metadata WRONGLY (the spec shape stands for an object-schema merge\n // that a bare rename throws away). When the input matches that\n // signature, name the actual boundary and the real fixes (#3090).\n const specShaped = findSpecVocabularyFormFields(schema).filter((f) => !f.mixedName);\n if (specShaped.length > 0) {\n console.error(chalk.bold('\\nLikely cause — spec form-view vocabulary in a standalone form:'));\n for (const s of specShaped) {\n console.error(chalk.yellow(\n ` ${s.path}: { field: '${s.field}' } is the spec form-VIEW shape (an object-field reference).`,\n ));\n }\n console.error(chalk.yellow(\n ` A standalone \\`type: 'form'\\` component uses { name: … } (the form data path).\\n` +\n ` Fix: author the field with \\`name\\` and its own type/label — or, to reference object fields\\n` +\n ` with the spec shape, use an object-bound form (\\`type: 'object-form'\\` with objectName +\\n` +\n ` sections), whose section fields are translated by the renderer.`,\n ));\n }\n\n console.error('');\n process.exit(1);\n }\n } catch (error) {\n console.error(chalk.red('\\n✗ Error reading or parsing schema file:'));\n console.error(chalk.red((error as Error).message));\n console.error('');\n process.exit(1);\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 * Spec-vocabulary detector for `objectui validate` (#3090).\n *\n * `{ field: 'x' }` inside a standalone `type: 'form'` component is the spec\n * form-VIEW vocabulary (an object-field reference) — a different layer from\n * the runtime vocabulary this CLI validates (`name` = form data path). The\n * zod error for it (\"name: expected string, received undefined\") reads as an\n * instruction to bolt a `name` on, which converts the metadata WRONGLY: an\n * agent following it loses the object-schema merge the spec shape stands for.\n * This detector lets the CLI say what actually happened and what the real fix\n * is. The error message is the prompt the next agent executes — it has to\n * point at the boundary, not at the symptom.\n *\n * Scope is deliberately exact: only `fields` arrays hanging DIRECTLY off a\n * `type: 'form'` node. Section fields (`type: 'object-form'` → `sections[]`)\n * legitimately accept the spec shape — `normalizeSectionField` translates\n * them — and a runtime FormField's `field` key legitimately holds the\n * resolved metadata OBJECT, so only a STRING `field` marks the spec shape.\n */\n\nexport interface SpecVocabularyFinding {\n /** JSON-ish path to the entry, e.g. `children[0].fields[2]`. */\n path: string;\n /** The spec `field` value (the referenced object field). */\n field: string;\n /** Set when the entry ALSO carries a runtime `name` (mixed vocabularies). */\n mixedName?: string;\n}\n\nexport function findSpecVocabularyFormFields(\n node: unknown,\n path = '',\n): SpecVocabularyFinding[] {\n if (Array.isArray(node)) {\n return node.flatMap((child, i) => findSpecVocabularyFormFields(child, `${path}[${i}]`));\n }\n if (node === null || typeof node !== 'object') return [];\n\n const record = node as Record<string, unknown>;\n const findings: SpecVocabularyFinding[] = [];\n\n if (record.type === 'form' && Array.isArray(record.fields)) {\n record.fields.forEach((f, i) => {\n if (f && typeof f === 'object' && typeof (f as any).field === 'string') {\n const name = (f as any).name;\n findings.push({\n path: `${path ? `${path}.` : ''}fields[${i}]`,\n field: (f as any).field,\n ...(typeof name === 'string' ? { mixedName: name } : {}),\n });\n }\n });\n }\n\n for (const [key, value] of Object.entries(record)) {\n // The entries themselves were just inspected; don't re-walk them as\n // generic children or each finding would double-report.\n if (record.type === 'form' && key === 'fields') continue;\n findings.push(\n ...findSpecVocabularyFormFields(value, path ? `${path}.${key}` : key),\n );\n }\n return findings;\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 chalk from 'chalk';\nimport { spawn } from 'child_process';\nimport { resolve, dirname } from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Create a new plugin using the @object-ui/create-plugin package\n * \n * @param pluginName - Name of the plugin to create\n */\nexport async function createPlugin(pluginName: string) {\n console.log(chalk.blue('🚀 Creating ObjectUI plugin...\\n'));\n\n // Resolve the create-plugin script path\n const createPluginScript = resolve(\n __dirname,\n '../../../create-plugin/dist/index.js'\n );\n\n return new Promise<void>((resolve, reject) => {\n // Spawn the create-plugin command\n const child = spawn('node', [createPluginScript, pluginName], {\n stdio: 'inherit',\n shell: true,\n });\n\n child.on('error', (error) => {\n console.error(chalk.red('Failed to create plugin:'), error);\n reject(error);\n });\n\n child.on('exit', (code) => {\n if (code === 0) {\n resolve();\n } else {\n reject(new Error(`create-plugin exited with code ${code}`));\n }\n });\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 chalk from 'chalk';\nimport { existsSync, statSync, readdirSync } from 'fs';\nimport { resolve, join, extname } from 'path';\n\ninterface AnalyzeOptions {\n bundleSize?: boolean;\n renderPerformance?: boolean;\n}\n\n/**\n * Analyze bundle size by scanning dist directory\n */\nasync function analyzeBundleSize() {\n console.log(chalk.bold('\\n📦 Bundle Size Analysis\\n'));\n\n const distDir = resolve(process.cwd(), 'dist');\n \n if (!existsSync(distDir)) {\n console.log(chalk.yellow('⚠ No dist directory found. Run build first.'));\n return;\n }\n\n const files: Array<{ path: string; size: number }> = [];\n \n function scanDirectory(dir: string) {\n const items = readdirSync(dir);\n \n for (const item of items) {\n const fullPath = join(dir, item);\n const stat = statSync(fullPath);\n \n if (stat.isDirectory()) {\n scanDirectory(fullPath);\n } else {\n files.push({\n path: fullPath.replace(distDir + '/', ''),\n size: stat.size,\n });\n }\n }\n }\n \n scanDirectory(distDir);\n \n // Sort by size (largest first)\n files.sort((a, b) => b.size - a.size);\n \n // Calculate totals\n const totalSize = files.reduce((sum, file) => sum + file.size, 0);\n const jsFiles = files.filter(f => extname(f.path) === '.js');\n const cssFiles = files.filter(f => extname(f.path) === '.css');\n \n const jsSize = jsFiles.reduce((sum, file) => sum + file.size, 0);\n const cssSize = cssFiles.reduce((sum, file) => sum + file.size, 0);\n \n console.log(chalk.bold('Summary:'));\n console.log(chalk.gray(' Total Size:'), formatBytes(totalSize));\n console.log(chalk.gray(' JavaScript:'), formatBytes(jsSize), chalk.dim(`(${jsFiles.length} files)`));\n console.log(chalk.gray(' CSS: '), formatBytes(cssSize), chalk.dim(`(${cssFiles.length} files)`));\n console.log(chalk.gray(' Other: '), formatBytes(totalSize - jsSize - cssSize));\n \n console.log(chalk.bold('\\nLargest Files:'));\n files.slice(0, 10).forEach((file) => {\n const sizeStr = formatBytes(file.size).padStart(10);\n console.log(chalk.gray(` ${sizeStr}`), file.path);\n });\n \n // Bundle size recommendations\n console.log(chalk.bold('\\n💡 Recommendations:'));\n \n if (totalSize > 1024 * 1024) {\n console.log(chalk.yellow(' ⚠ Total bundle size is large (> 1MB)'));\n console.log(chalk.gray(' Consider code splitting or lazy loading'));\n }\n \n if (jsSize > 500 * 1024) {\n console.log(chalk.yellow(' ⚠ JavaScript bundle is large (> 500KB)'));\n console.log(chalk.gray(' Consider:'));\n console.log(chalk.gray(' - Tree shaking unused code'));\n console.log(chalk.gray(' - Lazy loading components'));\n console.log(chalk.gray(' - Using dynamic imports'));\n }\n \n if (files.length > 100) {\n console.log(chalk.yellow(` ⚠ Large number of files (${files.length})`));\n console.log(chalk.gray(' Consider bundling or combining files'));\n }\n \n console.log('');\n}\n\n/**\n * Analyze render performance (placeholder for now)\n */\nasync function analyzeRenderPerformance() {\n console.log(chalk.bold('\\n⚡ Render Performance Analysis\\n'));\n \n console.log(chalk.gray('Performance analysis features:'));\n console.log(chalk.gray(' ✓ Expression caching enabled'));\n console.log(chalk.gray(' ✓ Component memoization available'));\n console.log(chalk.gray(' ✓ Virtual scrolling support for large lists'));\n \n console.log(chalk.bold('\\n💡 Performance Tips:'));\n console.log(chalk.gray(' • Use virtual scrolling for lists > 100 items'));\n console.log(chalk.gray(' • Cache frequently evaluated expressions'));\n console.log(chalk.gray(' • Use React.memo for expensive components'));\n console.log(chalk.gray(' • Implement pagination for large datasets'));\n console.log(chalk.gray(' • Use code splitting for large apps'));\n \n console.log('');\n}\n\n/**\n * Format bytes to human-readable string\n */\nfunction formatBytes(bytes: number): string {\n if (bytes === 0) return '0 B';\n \n const k = 1024;\n const sizes = ['B', 'KB', 'MB', 'GB'];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n \n return `${(bytes / Math.pow(k, i)).toFixed(2)} ${sizes[i]}`;\n}\n\n/**\n * Analyze application performance\n * \n * @param options - Analysis options\n */\nexport async function analyze(options: AnalyzeOptions = {}) {\n console.log(chalk.blue('🔍 ObjectUI Performance Analyzer\\n'));\n\n const runAll = !options.bundleSize && !options.renderPerformance;\n \n if (options.bundleSize || runAll) {\n await analyzeBundleSize();\n }\n \n if (options.renderPerformance || runAll) {\n await analyzeRenderPerformance();\n }\n \n console.log(chalk.green('✓ Analysis complete!\\n'));\n}\n"],"mappings":";;;;;;;;;;;AAQA,SAAS,eAAe;AACxB,OAAOA,aAAW;;;ACDlB,SAAS,oBAAoB;AAC7B,OAAO,WAAW;AAClB,SAAS,YAAY,WAAW,YAAY,gBAAgB;AAC5D,SAAS,MAAM,SAAS,eAAe;AACvC,OAAO,WAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAS9B,eAAsB,IAAI,YAAoB,SAAqB;AACjE,QAAM,MAAM,QAAQ,IAAI;AAGxB,MAAI,eAAe;AACnB,QAAM,mBAAmB;AACzB,MAAI,cAAc;AAClB,MAAI,WAAW;AACf,MAAI,YAAqB;AAGzB,QAAM,qBAAqB,QAAQ,KAAK,UAAU;AAElD,MAAI,WAAW,kBAAkB,KAAK,SAAS,kBAAkB,EAAE,OAAO,GAAG;AAE3E,UAAM,UAAU,QAAQ,kBAAkB;AAC1C,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cAAQ,IAAIA,QAAM,KAAK,yBAAyB,CAAC;AACjD,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,SAAS,OAAO;AACd,YAAQ,MAAMA,QAAM,IAAI,QAAQ,GAAG,iBAAiB,QAAQ,MAAM,UAAU,KAAK;AACjF,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAEH,QACG,QAAQ,SAAS,EACjB,YAAY,iCAAiC,EAC7C,OAAO,iBAAiB,qBAAqB,EAC7C,OAAO,wBAAwB,4BAA4B,EAC3D,OAAO,OAAO,YAAY;AACzB,MAAI;AACF,UAAM,QAAQ,OAAO;AAAA,EACvB,SAAS,OAAO;AACd,YAAQ,MAAMA,QAAM,IAAI,QAAQ,GAAG,iBAAiB,QAAQ,MAAM,UAAU,KAAK;AACjF,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAGH,QAAQ,MAAM;","names":["chalk","require","react","existsSync","mkdirSync","join","resolve","chalk","execSync","resolve","chalk","join","existsSync","mkdirSync","execSync","react","existsSync","join","resolve","chalk","execSync","existsSync","join","chalk","execSync","existsSync","join","chalk","chalk","existsSync","mkdirSync","join","chalk","existsSync","join","chalk","chalk","existsSync","join","resolve","dirname","__filename","__dirname","chalk","readFileSync","join","chalk","readFileSync","existsSync","resolve","chalk","resolve","existsSync","readFileSync","chalk","spawn","resolve","dirname","fileURLToPath","chalk","existsSync","statSync","resolve","join","readFileSync","fileURLToPath","dirname","join","__filename","__dirname","chalk"]}
1
+ {"version":3,"sources":["../src/cli.ts","../src/commands/dev.ts","../src/commands/build.ts","../src/commands/start.ts","../src/commands/lint.ts","../src/commands/test.ts","../src/commands/generate.ts","../src/commands/doctor.ts","../src/commands/add.ts","../src/commands/studio.ts","../src/commands/check.ts","../src/commands/validate.ts","../src/utils/spec-vocabulary-hint.ts","../src/commands/create-plugin.ts","../src/commands/analyze.ts"],"sourcesContent":["#!/usr/bin/env node\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 */\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport { serve } from './commands/serve.js';\nimport { init } from './commands/init.js';\nimport { dev } from './commands/dev.js';\nimport { buildApp } from './commands/build.js';\nimport { start } from './commands/start.js';\nimport { lint } from './commands/lint.js';\nimport { test } from './commands/test.js';\nimport { generate } from './commands/generate.js';\nimport { doctor } from './commands/doctor.js';\nimport { add } from './commands/add.js';\nimport { studio } from './commands/studio.js';\nimport { check } from './commands/check.js';\nimport { validate } from './commands/validate.js';\nimport { createPlugin } from './commands/create-plugin.js';\nimport { analyze } from './commands/analyze.js';\nimport { readFileSync } from 'fs';\nimport { fileURLToPath } from 'url';\nimport { dirname, join } from 'path';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Read package.json for version\nconst packageJson = JSON.parse(\n readFileSync(join(__dirname, '../package.json'), 'utf-8')\n);\n\nconst program = new Command();\n\nprogram\n .name('objectui')\n .description('CLI tool for Object UI - Build applications from JSON schemas')\n .version(packageJson.version);\n\nprogram\n .command('serve')\n .description('Start a development server with your JSON/YAML schema')\n .argument('[schema]', 'Path to JSON/YAML schema file', 'app.json')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', 'localhost')\n .action(async (schema, options) => {\n try {\n await serve(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('dev')\n .description('Start development server (alias for serve)')\n .argument('[schema]', 'Path to JSON/YAML schema file', 'app.json')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', 'localhost')\n .option('--no-open', 'Do not open browser automatically')\n .action(async (schema, options) => {\n try {\n await dev(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('build')\n .description('Build application for production')\n .argument('[schema]', 'Path to JSON/YAML schema file', 'app.json')\n .option('-o, --out-dir <dir>', 'Output directory', 'dist')\n .option('--clean', 'Clean output directory before build', false)\n .action(async (schema, options) => {\n try {\n await buildApp(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('start')\n .description('Start production server')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', '0.0.0.0')\n .option('-d, --dir <dir>', 'Directory to serve', 'dist')\n .action(async (options) => {\n try {\n await start(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('init')\n .description('Initialize a new Object UI application with sample schema')\n .argument('[name]', 'Application name', 'my-app')\n .option('-t, --template <template>', 'Template to use (dashboard, form, simple)', 'dashboard')\n .action(async (name, options) => {\n try {\n await init(name, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('lint')\n .description('Lint the generated application code')\n .option('--fix', 'Automatically fix linting issues')\n .action(async (options) => {\n try {\n await lint(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('test')\n .description('Run tests for the application')\n .option('-w, --watch', 'Run tests in watch mode')\n .option('-c, --coverage', 'Generate test coverage report')\n .option('--ui', 'Run tests with Vitest UI')\n .action(async (options) => {\n try {\n await test(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('generate')\n .alias('g')\n .description('Generate new resources (objects, pages, plugins)')\n .argument('<type>', 'Type of resource to generate (resource/object, page, plugin)')\n .argument('<name>', 'Name of the resource')\n .option('--from <source>', 'Generate schema from external source (openapi.yaml, prisma.schema)')\n .option('--output <dir>', 'Output directory for generated schemas', 'schemas/')\n .action(async (type, name, options) => {\n try {\n // Handle schema generation from external sources\n if (options.from) {\n console.log(chalk.yellow('\\n⚠ Schema generation from external sources (OpenAPI/Prisma) is not yet implemented.'));\n console.log(chalk.gray('This feature will be available in a future release.\\n'));\n process.exit(0);\n }\n \n await generate(type, name);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('doctor')\n .description('Diagnose and fix common issues')\n .action(async () => {\n try {\n await doctor();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('add')\n .description('Add a new component renderer to your project')\n .argument('<component>', 'Component name (e.g. Input, Grid)')\n .action(async (component) => {\n try {\n await add(component);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('studio')\n .description('Start the visual designer')\n .action(async () => {\n try {\n await studio();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('check')\n .description('Validate schema files')\n .action(async () => {\n try {\n await check();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('validate')\n .description('Validate a schema file against ObjectUI specifications')\n .argument('[schema]', 'Path to schema file (JSON or YAML)', 'app.json')\n .action(async (schema) => {\n try {\n await validate(schema);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('create')\n .description('Create new resources')\n .argument('<type>', 'Type of resource to create (plugin)')\n .argument('<name>', 'Name of the resource')\n .action(async (type, name) => {\n try {\n if (type === 'plugin') {\n await createPlugin(name);\n } else {\n console.error(chalk.red(`Unknown resource type: ${type}`));\n console.log(chalk.gray('Available types: plugin'));\n process.exit(1);\n }\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('analyze')\n .description('Analyze application performance')\n .option('--bundle-size', 'Analyze bundle size')\n .option('--render-performance', 'Analyze render performance')\n .action(async (options) => {\n try {\n await analyze(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\n\nprogram.parse();\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 { createServer } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport { existsSync, mkdirSync, unlinkSync, statSync } from 'fs';\nimport { join, resolve, dirname } from 'path';\nimport chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport { createRequire } from 'module';\nimport { scanPagesDirectory, createTempAppWithRouting, createTempApp, parseSchemaFile, type RouteInfo } from '../utils/app-generator.js';\n\ninterface DevOptions {\n port: string;\n host: string;\n open?: boolean;\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 */\nasync 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\nexport async function dev(schemaPath: string, options: DevOptions) {\n const cwd = process.cwd();\n \n // Resolve the actual project root and schema file\n let _projectRoot = cwd;\n const targetSchemaPath = schemaPath;\n let hasPagesDir = false;\n let pagesDir = '';\n let appConfig: unknown = null;\n\n // 1. Determine Project Root & Mode\n const absoluteSchemaPath = resolve(cwd, schemaPath);\n \n if (existsSync(absoluteSchemaPath) && statSync(absoluteSchemaPath).isFile()) {\n // If input is a file (e.g. examples/showcase/app.json)\n const fileDir = dirname(absoluteSchemaPath);\n const potentialPagesDir = join(fileDir, 'pages');\n\n if (existsSync(potentialPagesDir)) {\n console.log(chalk.blue(`📂 Detected project structure at ${fileDir}`));\n _projectRoot = fileDir;\n hasPagesDir = true;\n pagesDir = potentialPagesDir;\n \n // Try to load app.json as config\n try {\n appConfig = parseSchemaFile(absoluteSchemaPath);\n console.log(chalk.blue('⚙️ Loaded App Config from app.json'));\n } catch (_e) {\n console.warn('Failed to parse app config');\n }\n }\n } \n \n // Fallback: Check detect pages dir in current cwd if not found above\n if (!hasPagesDir) {\n const localPagesDir = join(cwd, 'pages');\n if (existsSync(localPagesDir)) {\n hasPagesDir = true;\n pagesDir = localPagesDir;\n // Try to find and load app.json in cwd\n const appJsonPath = join(cwd, 'app.json');\n if (existsSync(appJsonPath)) {\n try {\n appConfig = parseSchemaFile(appJsonPath);\n console.log(chalk.blue('⚙️ Loaded App Config from app.json'));\n } catch (_e) {\n console.warn('Failed to parse app.json config');\n }\n }\n }\n }\n\n const require = createRequire(join(cwd, 'package.json'));\n \n let routes: RouteInfo[] = [];\n let schema: unknown = null;\n let useFileSystemRouting = false;\n\n if (hasPagesDir) {\n // File-system based routing\n console.log(chalk.blue(`📁 Using file-system routing from ${pagesDir}`));\n routes = scanPagesDirectory(pagesDir);\n useFileSystemRouting = true;\n \n if (routes.length === 0) {\n throw new Error(`No schema files found in ${pagesDir}`);\n }\n \n console.log(chalk.green(`✓ Found ${routes.length} route(s)`));\n routes.forEach(route => {\n console.log(chalk.dim(` ${route.path} → ${route.filePath.replace(cwd, '.')}`));\n });\n } else {\n // Single schema file mode\n const fullSchemaPath = resolve(cwd, schemaPath);\n // ... (rest of the logic)\n if (!existsSync(fullSchemaPath)) {\n throw new Error(`Schema file not found: ${schemaPath}\\nRun 'objectui init' to create a sample schema.`);\n }\n console.log(chalk.blue('📋 Loading schema:'), chalk.cyan(schemaPath));\n try {\n schema = parseSchemaFile(fullSchemaPath);\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\n // Create temporary app directory (always in cwd to keep node_modules access)\n const tmpDir = join(cwd, '.objectui-tmp');\n mkdirSync(tmpDir, { recursive: true });\n\n // Create temporary app files\n if (useFileSystemRouting) {\n createTempAppWithRouting(tmpDir, routes, appConfig);\n } else {\n createTempApp(tmpDir, schema);\n }\n\n\n // Install dependencies\n const isMonorepo = existsSync(join(cwd, 'pnpm-workspace.yaml'));\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 // Create Vite config\n const viteConfig: any = {\n root: tmpDir,\n server: {\n port: parseInt(options.port),\n host: options.host,\n open: options.open !== false,\n fs: {\n // Allow serving files from workspace root\n allow: [cwd],\n }\n },\n resolve: {\n alias: {}\n },\n plugins: [react()],\n };\n\n if (isMonorepo) {\n console.log(chalk.blue('📦 Detected monorepo - configuring workspace aliases'));\n \n // Remove postcss.config.js: the programmatic `css.postcss` below takes over\n // (an inline config makes Vite skip config-file discovery entirely), and the\n // generated file names `@tailwindcss/postcss` — a package the temp app never\n // installs inside a workspace, and one this repo's root does not declare\n // either, so leaving the file for a later Vite pass to find would only\n // reintroduce an unresolvable plugin.\n const postcssPath = join(tmpDir, 'postcss.config.js');\n if (existsSync(postcssPath)) {\n unlinkSync(postcssPath);\n }\n\n // Add aliases for workspace packages\n viteConfig.resolve.alias = {\n '@object-ui/react': join(cwd, 'packages/react/src/index.ts'),\n '@object-ui/components': join(cwd, 'packages/components/src/index.ts'),\n '@object-ui/core': join(cwd, 'packages/core/src/index.ts'),\n '@object-ui/types': join(cwd, 'packages/types/src/index.ts'),\n '@object-ui/plugin-charts': join(cwd, 'packages/plugin-charts/src/index.tsx'),\n '@object-ui/plugin-editor': join(cwd, 'packages/plugin-editor/src/index.tsx'),\n '@object-ui/plugin-kanban': join(cwd, 'packages/plugin-kanban/src/index.tsx'),\n '@object-ui/plugin-markdown': join(cwd, 'packages/plugin-markdown/src/index.tsx'),\n '@object-ui/plugin-form': join(cwd, 'packages/plugin-form/src/index.tsx'),\n '@object-ui/plugin-grid': join(cwd, 'packages/plugin-grid/src/index.tsx'),\n '@object-ui/plugin-view': join(cwd, 'packages/plugin-view/src/index.tsx'),\n };\n\n // Fix: Resolve lucide-react from components package to avoid \"dependency not found\" in temp app\n try {\n // Trying to find lucide-react in the components' node_modules or hoist\n // checking specifically in packages/components context\n const lucidePath = require.resolve('lucide-react', { paths: [join(cwd, 'packages/components')] });\n // We might get the cjs entry, but for aliasing usually fine. \n // Better yet, if we can find the package root, but require.resolve gives file.\n // Let's just use what require.resolve gives.\n viteConfig.resolve.alias['lucide-react'] = lucidePath;\n } catch (e) {\n console.warn('⚠️ Could not resolve lucide-react automatically:', e);\n }\n \n // Debug aliases\n // console.log('Aliases:', viteConfig.resolve.alias);\n\n // Configure PostCSS programmatically — see `loadTempAppPostcssPlugins`.\n viteConfig.css = { postcss: { plugins: await loadTempAppPostcssPlugins() } };\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('✓ Development 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 { build as viteBuild } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport { existsSync, mkdirSync, cpSync, rmSync } from 'fs';\nimport { join, resolve } from 'path';\nimport chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport { scanPagesDirectory, createTempAppWithRouting, createTempApp, parseSchemaFile, type RouteInfo } from '../utils/app-generator.js';\n\ninterface BuildOptions {\n outDir?: string;\n clean?: boolean;\n}\n\nexport async function buildApp(schemaPath: string, options: BuildOptions) {\n const cwd = process.cwd();\n const outDir = options.outDir || 'dist';\n const outputPath = resolve(cwd, outDir);\n \n console.log(chalk.blue('🔨 Building application for production...'));\n console.log();\n \n // Check if pages directory exists for file-system routing\n const pagesDir = join(cwd, 'pages');\n const hasPagesDir = existsSync(pagesDir);\n \n let routes: RouteInfo[] = [];\n let schema: unknown = null;\n let useFileSystemRouting = false;\n\n if (hasPagesDir) {\n // File-system based routing\n console.log(chalk.blue('📁 Using file-system routing'));\n routes = scanPagesDirectory(pagesDir);\n useFileSystemRouting = true;\n \n if (routes.length === 0) {\n throw new Error('No schema files found in pages/ directory');\n }\n \n console.log(chalk.green(`✓ Found ${routes.length} route(s)`));\n } else {\n // Single schema file mode\n const fullSchemaPath = resolve(cwd, schemaPath);\n\n // Check if schema file exists\n if (!existsSync(fullSchemaPath)) {\n throw new Error(`Schema file not found: ${schemaPath}\\nRun 'objectui init' to create a sample schema.`);\n }\n\n console.log(chalk.blue('📋 Loading schema:'), chalk.cyan(schemaPath));\n\n // Read and validate schema\n try {\n schema = parseSchemaFile(fullSchemaPath);\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\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 (useFileSystemRouting) {\n createTempAppWithRouting(tmpDir, routes);\n } else {\n createTempApp(tmpDir, schema);\n }\n\n // Install dependencies\n console.log(chalk.blue('📦 Installing dependencies...'));\n try {\n execSync('npm install --silent --prefer-offline', { \n cwd: tmpDir, \n stdio: 'pipe',\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 console.log(chalk.blue('⚙️ Building with Vite...'));\n console.log();\n\n // Clean output directory if requested\n if (options.clean && existsSync(outputPath)) {\n console.log(chalk.dim(` Cleaning ${outDir}/ directory...`));\n rmSync(outputPath, { recursive: true, force: true });\n }\n\n // Build with Vite\n try {\n await viteBuild({\n root: tmpDir,\n build: {\n outDir: join(tmpDir, 'dist'),\n emptyOutDir: true,\n reportCompressedSize: true,\n },\n plugins: [react()],\n logLevel: 'info',\n });\n\n // Copy built files to output directory\n mkdirSync(outputPath, { recursive: true });\n cpSync(join(tmpDir, 'dist'), outputPath, { recursive: true });\n\n console.log();\n console.log(chalk.green('✓ Build completed successfully!'));\n console.log();\n console.log(chalk.bold(' Output: ') + chalk.cyan(outDir + '/'));\n console.log();\n console.log(chalk.dim(' To serve the production build, run:'));\n console.log(chalk.cyan(` objectui start --dir ${outDir}`));\n console.log();\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(`Build failed: ${error instanceof Error ? error.message : error}`);\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 express from 'express';\nimport rateLimit from 'express-rate-limit';\nimport { existsSync } from 'fs';\nimport { join, resolve } from 'path';\nimport chalk from 'chalk';\n\ninterface StartOptions {\n port: string;\n host: string;\n dir?: string;\n}\n\nexport async function start(options: StartOptions) {\n const cwd = process.cwd();\n const distDir = options.dir || 'dist';\n const distPath = resolve(cwd, distDir);\n\n // Check if dist directory exists\n if (!existsSync(distPath)) {\n throw new Error(\n `Build directory not found: ${distDir}\\n` +\n `Run 'objectui build' first to create a production build.`\n );\n }\n\n // Check if index.html exists\n const indexPath = join(distPath, 'index.html');\n if (!existsSync(indexPath)) {\n throw new Error(\n `index.html not found in ${distDir}/\\n` +\n `Make sure you have a valid production build.`\n );\n }\n\n console.log(chalk.blue('🚀 Starting production server...\\n'));\n\n const app = express();\n const port = parseInt(options.port);\n const host = options.host;\n\n // Configure rate limiting to prevent abuse\n const limiter = rateLimit({\n windowMs: 15 * 60 * 1000, // 15 minutes\n max: 1000, // Limit each IP to 1000 requests per windowMs\n message: 'Too many requests from this IP, please try again later.',\n standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers\n legacyHeaders: false, // Disable the `X-RateLimit-*` headers\n });\n\n // Apply rate limiting to all routes\n app.use(limiter);\n\n // Serve static files from dist directory\n app.use(express.static(distPath));\n\n // SPA fallback - serve index.html for all routes\n app.get('*', (_req, res) => {\n res.sendFile(indexPath);\n });\n\n // Start server\n app.listen(port, host, () => {\n const protocol = 'http';\n const displayHost = host === '0.0.0.0' ? 'localhost' : host;\n\n console.log(chalk.green('✓ Production server started successfully!'));\n console.log();\n console.log(chalk.bold(' Local: ') + chalk.cyan(`${protocol}://${displayHost}:${port}`));\n console.log(chalk.bold(' Serving: ') + chalk.dim(distDir + '/'));\n console.log();\n console.log(chalk.dim(' Press Ctrl+C to stop the server'));\n console.log();\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 { execSync } from 'child_process';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\nimport chalk from 'chalk';\n\ninterface LintOptions {\n fix?: boolean;\n}\n\nexport async function lint(options: LintOptions) {\n const cwd = process.cwd();\n \n console.log(chalk.blue('🔍 Running linter...\\n'));\n\n // Check if the generated temp app exists\n const tmpDir = join(cwd, '.objectui-tmp');\n const hasTempApp = existsSync(tmpDir);\n\n if (!hasTempApp) {\n throw new Error(\n 'No Object UI application found. Run \\'objectui dev\\' first to generate the application.'\n );\n }\n\n // Check if package.json and node_modules exist\n const packageJsonPath = join(tmpDir, 'package.json');\n const nodeModulesPath = join(tmpDir, 'node_modules');\n \n if (!existsSync(packageJsonPath) || !existsSync(nodeModulesPath)) {\n throw new Error(\n 'Dependencies not installed. Run \\'objectui dev\\' first to set up the application.'\n );\n }\n\n try {\n const fixFlag = options.fix ? '--fix' : '';\n const command = `npx eslint \"src/**/*.{js,jsx,ts,tsx}\" ${fixFlag}`.trim();\n \n console.log(chalk.dim(` Running: ${command}\\n`));\n \n execSync(command, {\n cwd: tmpDir,\n stdio: 'inherit',\n });\n\n console.log();\n console.log(chalk.green('✓ Linting completed successfully!'));\n console.log();\n } catch {\n // ESLint returns non-zero exit code when there are linting errors\n console.log();\n console.log(chalk.yellow('⚠ Linting found issues.'));\n if (!options.fix) {\n console.log(chalk.dim(' Run \\'objectui lint --fix\\' to automatically fix some issues.'));\n }\n console.log();\n process.exit(1);\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 { execSync } from 'child_process';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\nimport chalk from 'chalk';\n\ninterface TestOptions {\n watch?: boolean;\n coverage?: boolean;\n ui?: boolean;\n}\n\nexport async function test(options: TestOptions) {\n const cwd = process.cwd();\n \n console.log(chalk.blue('🧪 Running tests...\\n'));\n\n // Check if the generated temp app exists\n const tmpDir = join(cwd, '.objectui-tmp');\n const hasTempApp = existsSync(tmpDir);\n\n if (!hasTempApp) {\n throw new Error(\n 'No Object UI application found. Run \\'objectui dev\\' first to generate the application.'\n );\n }\n\n // Check if package.json and node_modules exist\n const packageJsonPath = join(tmpDir, 'package.json');\n const nodeModulesPath = join(tmpDir, 'node_modules');\n \n if (!existsSync(packageJsonPath) || !existsSync(nodeModulesPath)) {\n throw new Error(\n 'Dependencies not installed. Run \\'objectui dev\\' first to set up the application.'\n );\n }\n\n try {\n let command = 'npx vitest';\n \n if (options.watch) {\n command += ' --watch';\n } else if (options.ui) {\n command += ' --ui';\n } else {\n command += ' run';\n }\n\n if (options.coverage) {\n command += ' --coverage';\n }\n\n console.log(chalk.dim(` Running: ${command}\\n`));\n \n execSync(command, {\n cwd: tmpDir,\n stdio: 'inherit',\n });\n\n if (!options.watch && !options.ui) {\n console.log();\n console.log(chalk.green('✓ Tests completed successfully!'));\n console.log();\n }\n } catch {\n // Vitest returns non-zero exit code when tests fail\n console.log();\n console.log(chalk.red('✗ Some tests failed.'));\n console.log();\n process.exit(1);\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 chalk from 'chalk';\nimport { existsSync, mkdirSync, writeFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function generate(type: string, name: string) {\n const cwd = process.cwd();\n\n switch (type) {\n case 'resource':\n case 'object':\n generateResource(cwd, name);\n break;\n case 'page':\n generatePage(cwd, name);\n break;\n case 'plugin':\n generatePlugin(cwd, name);\n break;\n default:\n console.log(chalk.red(`Unknown type: ${type}`));\n console.log(`Available types: resource, page, plugin`);\n process.exit(1);\n }\n}\n\nfunction generateResource(cwd: string, name: string) {\n const dir = join(cwd, 'objects');\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n\n const fileName = `${name.toLowerCase()}.json`;\n const filePath = join(dir, fileName);\n\n if (existsSync(filePath)) {\n console.log(chalk.yellow(`Object ${name} already exists at ${filePath}`));\n return;\n }\n\n const content = {\n name: name,\n fields: {\n name: { type: 'text', label: 'Name', required: true }\n }\n };\n\n writeFileSync(filePath, JSON.stringify(content, null, 2));\n console.log(chalk.green(`✓ Generated resource schema: ${filePath}`));\n}\n\nfunction generatePage(cwd: string, name: string) {\n const dir = join(cwd, 'pages');\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n\n const fileName = `${name.toLowerCase()}.json`;\n const filePath = join(dir, fileName);\n\n if (existsSync(filePath)) {\n console.log(chalk.yellow(`Page ${name} already exists at ${filePath}`));\n return;\n }\n\n const content = {\n type: \"page\",\n title: name,\n body: [\n {\n type: \"markdown\",\n content: `# Welcome to ${name}`\n }\n ]\n };\n\n writeFileSync(filePath, JSON.stringify(content, null, 2));\n console.log(chalk.green(`✓ Generated page schema: ${filePath}`));\n}\n\nfunction generatePlugin(cwd: string, name: string) {\n const dir = join(cwd, 'plugins', name);\n if (existsSync(dir)) {\n console.log(chalk.yellow(`Plugin ${name} already exists`));\n return;\n }\n mkdirSync(dir, { recursive: true });\n\n const content = `\nexport const ${name}Plugin = {\n name: '${name}',\n install(app) {\n console.log('${name} plugin installed');\n }\n};\n`;\n\n writeFileSync(join(dir, 'index.ts'), content.trim());\n console.log(chalk.green(`✓ Generated plugin: ${dir}`));\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 * `objectui doctor` — project health diagnosis.\n *\n * ## Tailwind: v4-only, because this repo is v4-only (objectui#3891)\n *\n * The Tailwind section used to be written against Tailwind 3 and got every\n * question backwards on a v4 project:\n *\n * - It counted a **missing `tailwind.config.js` as an issue**. In v4 that file\n * is not part of the setup at all — the engine reads CSS-first configuration\n * (`@import 'tailwindcss'`, `@theme`, `@source`) and only looks at a JS\n * config when a stylesheet explicitly opts in with `@config`. So the advice\n * pushed readers toward creating a file Tailwind would never read. Running\n * `objectui doctor` at this repo's own root reproduced it: there is no root\n * `tailwind.config.*`, and doctor reported a problem that did not exist.\n * - It then graded that file on its **`content` array**, the v3 key that\n * `@source` replaced. The two `tailwind.config.*` files still tracked in this\n * repo (`apps/console`, `examples/byo-backend-console`) are exactly this\n * trap: both declare `content: ['./src/**\\/*.{ts,tsx}', …]`, no stylesheet\n * anywhere in the repo contains `@config`, so both files are inert — and the\n * old check answered \"✓ Tailwind content paths configured\" for them. A false\n * green on a dead file is worse than silence.\n * - It **never checked `@tailwindcss/postcss`**, which is the one dependency a\n * v4 project genuinely cannot build without. v4 moved the PostCSS plugin out\n * of `tailwindcss` into that separate package; naming the old `tailwindcss`\n * key in a PostCSS config resolves to a shim whose only job is to throw. That\n * is the failure form objectui#3852 measured on the generated app, and doctor\n * happily printed \"✓ Tailwind CSS installed\" through it.\n *\n * So the checks below are the v4 contract, matching what `objectui init`\n * scaffolds (see `utils/app-generator.ts`): `@tailwindcss/postcss` available, a\n * PostCSS config that names it rather than the v3 `tailwindcss` key, and a CSS\n * entry that runs `@import 'tailwindcss'`. A missing `tailwind.config.*` is\n * **not** reported; a *present* one is reported only when nothing opts into it\n * via `@config`, which is the case where it silently does nothing.\n *\n * A v3-tolerant dual path (branching on the declared `tailwindcss` major and\n * running two sets of checks) was considered and deliberately not built — it\n * widens the product surface past this repo's v4-only posture. v3 spellings are\n * therefore diagnosed as *migration debt*, not supported as a second mode.\n *\n * ## Structure\n *\n * `runDiagnostics(cwd)` is the whole diagnosis and returns structured results;\n * `doctor()` only renders them and counts. Splitting the two is what makes the\n * matrix above testable against real fixture directories instead of scraped\n * console output.\n */\n\nimport chalk from 'chalk';\nimport { existsSync, readFileSync } from 'fs';\nimport { dirname, join, resolve as resolvePath } from 'path';\n\n/** `ok` never counts toward the issue total; `warn` and `error` both do. */\nexport type DiagnosticLevel = 'ok' | 'warn' | 'error';\n\nexport interface Diagnostic {\n level: DiagnosticLevel;\n /** The single line rendered for this finding. */\n message: string;\n /**\n * Stable identifier for the finding, so tests (and any future machine\n * readable output) pin the *verdict* rather than prose wording.\n */\n id: string;\n}\n\n/**\n * CSS entrypoint candidates, in the order doctor prefers them. `src/index.css`\n * is first because that is what `objectui init` generates; the rest cover the\n * common Vite / Next.js / plain layouts. Every candidate that exists is read —\n * the Tailwind verdicts below ask \"does *any* entry do this\", so a project with\n * several stylesheets is not judged on whichever one happens to sort first.\n */\nconst CSS_ENTRY_CANDIDATES = [\n 'src/index.css',\n 'src/main.css',\n 'src/styles.css',\n 'src/style.css',\n 'src/app.css',\n 'src/global.css',\n 'src/globals.css',\n 'app/globals.css',\n 'app/global.css',\n 'styles/globals.css',\n 'index.css',\n 'styles.css',\n];\n\nconst TAILWIND_CONFIG_CANDIDATES = [\n 'tailwind.config.js',\n 'tailwind.config.cjs',\n 'tailwind.config.mjs',\n 'tailwind.config.ts',\n];\n\nconst POSTCSS_CONFIG_CANDIDATES = [\n 'postcss.config.js',\n 'postcss.config.cjs',\n 'postcss.config.mjs',\n 'postcss.config.ts',\n];\n\n/** `@import 'tailwindcss'` — the v4 entrypoint, with or without a `layer()`. */\nconst V4_CSS_IMPORT = /@import\\s+[\"']tailwindcss[\"']/;\n/** `@tailwind base;` / `components` / `utilities` — the v3 directives. */\nconst V3_CSS_DIRECTIVE = /@tailwind\\s+(?:base|components|utilities|screens|variants)\\b/;\nconst CSS_SOURCE_DIRECTIVE = /@source\\s+[\"']/;\nconst CSS_CONFIG_DIRECTIVE = /@config\\s+[\"']/;\n\n/**\n * The v4 PostCSS plugin, in either object (`'@tailwindcss/postcss': {}`) or\n * array (`require('@tailwindcss/postcss')`) form.\n */\nconst V4_POSTCSS_PLUGIN = /@tailwindcss\\/postcss/;\n/**\n * The v3 spelling: `tailwindcss` named as a plugin itself, in either the\n * quoted (`'tailwindcss': {}`, `require('tailwindcss')`) or the bare-key\n * (`tailwindcss: {}`) form.\n *\n * Neither alternative can match inside `'@tailwindcss/postcss'`: the quoted one\n * needs a quote immediately before `tailwindcss` and finds `@`, and the bare\n * one needs a key boundary before it and a `:` after it, where the scoped name\n * has `@` and `/`. That non-match is pinned by a test — it is the difference\n * between diagnosing a v3 config and having every healthy v4 project\n * self-report.\n */\nconst V3_POSTCSS_PLUGIN = /[\"']tailwindcss[\"']|(?:^|[{,\\s])tailwindcss\\s*:/m;\n\nfunction readIfExists(path: string): string | null {\n try {\n return existsSync(path) ? readFileSync(path, 'utf-8') : null;\n } catch {\n return null;\n }\n}\n\n/** First existing path from `candidates`, relative to `cwd`. */\nfunction findFile(cwd: string, candidates: readonly string[]): string | null {\n for (const rel of candidates) {\n const abs = join(cwd, rel);\n if (existsSync(abs)) return abs;\n }\n return null;\n}\n\n/**\n * Leading major of a dependency range. Returns `null` for anything without a\n * usable number — `workspace:*`, `catalog:`, a git URL, `latest` — because\n * \"cannot tell\" must not be reported as \"wrong version\".\n */\nfunction majorOf(range: string): number | null {\n const match = /(\\d+)/.exec(range);\n if (!match) return null;\n const major = Number.parseInt(match[1], 10);\n return Number.isNaN(major) ? null : major;\n}\n\n/**\n * Is `specifier` installed for this project — i.e. present in a `node_modules`\n * at `cwd` or any ancestor?\n *\n * Declaration in `package.json` is the primary signal, but it is not the only\n * valid setup: inside a workspace the plugin is frequently installed by a\n * parent while the leaf `package.json` stays silent. Checking the tree is what\n * keeps this from replacing objectui#3891's false positive with a new one on\n * every workspace package.\n *\n * Deliberately a manual walk rather than `createRequire(…).resolve()`, even\n * though the latter looks more authoritative. Node's resolver also consults\n * `NODE_PATH` and the global folders, and `NODE_PATH` is not hypothetical\n * here: vitest sets it to pnpm's virtual store (`node_modules/.pnpm/…`), so\n * under test *every* package in the monorepo resolves from *any* directory —\n * including a fresh `os.tmpdir()` fixture with an empty `package.json`. That\n * made the \"plugin is missing\" branch unreachable in tests and would have\n * shipped it unverified. The walk below answers the question a bundler\n * actually asks and depends on nothing but the filesystem.\n */\nfunction isInstalledFrom(cwd: string, specifier: string): boolean {\n let dir = resolvePath(cwd);\n for (;;) {\n if (existsSync(join(dir, 'node_modules', ...specifier.split('/')))) return true;\n const parent = dirname(dir);\n if (parent === dir) return false;\n dir = parent;\n }\n}\n\n/**\n * Run every diagnostic against `cwd` and return the findings in render order.\n * Pure with respect to stdout — see the module docblock.\n */\nexport function runDiagnostics(cwd: string): Diagnostic[] {\n const results: Diagnostic[] = [];\n const ok = (id: string, message: string): void => {\n results.push({ id, level: 'ok', message });\n };\n const warn = (id: string, message: string): void => {\n results.push({ id, level: 'warn', message });\n };\n const error = (id: string, message: string): void => {\n results.push({ id, level: 'error', message });\n };\n\n // ---------------------------------------------------------------- package.json\n const pkgPath = join(cwd, 'package.json');\n const pkgRaw = readIfExists(pkgPath);\n let pkg: Record<string, Record<string, string> | undefined> | null = null;\n\n if (pkgRaw === null) {\n error('package-json-missing', 'package.json not found');\n } else {\n try {\n pkg = JSON.parse(pkgRaw);\n } catch {\n error('package-json-unreadable', 'Failed to parse package.json');\n }\n }\n\n const deps: Record<string, string> = pkg\n ? { ...(pkg.dependencies ?? {}), ...(pkg.devDependencies ?? {}) }\n : {};\n\n if (pkg) {\n if (deps.react) {\n ok('react-installed', 'React installed');\n } else {\n warn('react-missing', 'React not found in dependencies');\n }\n }\n\n // -------------------------------------------------------------------- Tailwind\n //\n // Everything below is gated on the project declaring `tailwindcss` at all. A\n // directory that does not use Tailwind must not collect Tailwind findings —\n // the \"not found\" line above already says the one thing worth saying.\n const tailwindRange = pkg ? deps.tailwindcss : undefined;\n\n if (pkg && !tailwindRange) {\n warn('tailwind-missing', 'Tailwind CSS not found in dependencies');\n }\n\n if (tailwindRange) {\n const major = majorOf(tailwindRange);\n if (major !== null && major < 4) {\n warn(\n 'tailwind-major-legacy',\n `Tailwind CSS ${tailwindRange} detected — ObjectUI targets Tailwind 4. ` +\n 'Upgrade with `npx @tailwindcss/upgrade`, then move configuration into ' +\n \"your CSS entry (`@import 'tailwindcss'`, `@theme`, `@source`).\",\n );\n } else {\n ok('tailwind-installed', `Tailwind CSS ${tailwindRange} installed`);\n }\n\n // 1. The v4 PostCSS plugin — the dependency a v4 build actually fails without.\n if (deps['@tailwindcss/postcss']) {\n ok('tailwind-postcss-declared', '@tailwindcss/postcss declared');\n } else if (isInstalledFrom(cwd, '@tailwindcss/postcss')) {\n ok(\n 'tailwind-postcss-installed',\n '@tailwindcss/postcss installed (provided by the workspace)',\n );\n } else {\n error(\n 'tailwind-postcss-missing',\n 'Tailwind CSS 4 needs @tailwindcss/postcss, which is neither declared ' +\n 'nor installed here. v4 moved the PostCSS plugin out of `tailwindcss` ' +\n 'into its own package; without it PostCSS fails to load and no ' +\n 'styles are emitted. Install it: `npm i -D @tailwindcss/postcss`.',\n );\n }\n\n // 2. The PostCSS config, when there is one, must name the v4 plugin.\n const postcssConfigPath = findFile(cwd, POSTCSS_CONFIG_CANDIDATES);\n if (postcssConfigPath) {\n const postcssConfig = readIfExists(postcssConfigPath) ?? '';\n const hasV4Plugin = V4_POSTCSS_PLUGIN.test(postcssConfig);\n // Evaluated independently of `hasV4Plugin`, not as its `else` branch: a\n // half-finished migration that lists both entries still throws on the\n // v3 one, and that is the state worth naming.\n const hasV3Plugin = V3_POSTCSS_PLUGIN.test(postcssConfig);\n\n if (hasV3Plugin) {\n error(\n 'postcss-plugin-v3',\n 'PostCSS config names `tailwindcss` as a plugin — the Tailwind 3 ' +\n 'spelling. In v4 that entry resolves to a shim whose only job is ' +\n \"to throw. Replace it with `'@tailwindcss/postcss': {}`.\",\n );\n } else if (hasV4Plugin) {\n ok('postcss-plugin-v4', 'PostCSS config uses @tailwindcss/postcss');\n } else {\n warn(\n 'postcss-plugin-absent',\n 'PostCSS config does not register a Tailwind plugin. Add ' +\n \"`'@tailwindcss/postcss': {}` so Tailwind runs during the build.\",\n );\n }\n }\n\n // 3. The CSS entry must start the v4 engine. Read every candidate that\n // exists and ask whether *any* of them does — see CSS_ENTRY_CANDIDATES.\n const cssEntries = CSS_ENTRY_CANDIDATES.map((rel) => ({\n rel,\n content: readIfExists(join(cwd, rel)),\n })).filter((entry): entry is { rel: string; content: string } => entry.content !== null);\n\n const importsTailwind = cssEntries.some((entry) => V4_CSS_IMPORT.test(entry.content));\n const usesV3Directives = cssEntries.some((entry) => V3_CSS_DIRECTIVE.test(entry.content));\n const declaresSource = cssEntries.some((entry) => CSS_SOURCE_DIRECTIVE.test(entry.content));\n const optsIntoJsConfig = cssEntries.some((entry) => CSS_CONFIG_DIRECTIVE.test(entry.content));\n\n if (cssEntries.length === 0) {\n // No recognised entrypoint — say nothing. A monorepo root or an app with\n // a bespoke CSS layout is not evidence of a misconfiguration, and\n // objectui#3891 is precisely about doctor asserting things it cannot see.\n } else if (importsTailwind) {\n ok('css-entry-v4-import', \"CSS entry runs `@import 'tailwindcss'`\");\n if (declaresSource) {\n ok('css-entry-source', 'CSS entry declares `@source` scanning paths');\n }\n } else if (usesV3Directives) {\n error(\n 'css-entry-v3-directives',\n 'CSS entry still uses the Tailwind 3 `@tailwind base/components/' +\n \"utilities` directives. Tailwind 4 replaces all three with a single \" +\n \"`@import 'tailwindcss';`.\",\n );\n } else {\n warn(\n 'css-entry-no-tailwind',\n \"No CSS entry runs `@import 'tailwindcss'`, so Tailwind never starts. \" +\n `Checked: ${cssEntries.map((entry) => entry.rel).join(', ')}.`,\n );\n }\n\n // 4. `tailwind.config.*` — absence is correct in v4 and reported as nothing\n // at all. Presence is reported only when it is inert.\n const tailwindConfigPath = findFile(cwd, TAILWIND_CONFIG_CANDIDATES);\n if (tailwindConfigPath && !optsIntoJsConfig) {\n const rel = tailwindConfigPath.slice(cwd.length + 1);\n warn(\n 'tailwind-config-inert',\n `${rel} exists but nothing opts into it — Tailwind 4 ignores a JS ` +\n 'config unless a stylesheet declares `@config`. Anything it sets ' +\n '(theme, content/@source paths, plugins) has no effect today. ' +\n 'Either delete it and move the settings into your CSS entry, or add ' +\n `\\`@config '${rel}';\\` there.`,\n );\n } else if (tailwindConfigPath) {\n ok('tailwind-config-active', 'JS Tailwind config is loaded via `@config`');\n }\n }\n\n // ------------------------------------------------------------------ TypeScript\n if (existsSync(join(cwd, 'tsconfig.json'))) {\n ok('tsconfig-found', 'tsconfig.json found');\n const tsRange = deps.typescript;\n if (tsRange) {\n const major = majorOf(tsRange);\n if (major !== null && major < 5) {\n warn('typescript-legacy', `TypeScript ${tsRange} detected — version 5.0+ recommended`);\n } else {\n ok('typescript-version', `TypeScript ${tsRange} (5.0+ required)`);\n }\n }\n } else {\n warn('tsconfig-missing', 'tsconfig.json not found');\n }\n\n // -------------------------------------------------------------- Peer contracts\n if (pkg) {\n if (deps['@object-ui/react'] && !deps.react) {\n warn('peer-react', '@object-ui/react requires react as a peer dependency');\n }\n if (deps['@object-ui/components'] && !deps.tailwindcss) {\n warn('peer-tailwind', '@object-ui/components requires tailwindcss as a peer dependency');\n }\n }\n\n return results;\n}\n\n/** Number of findings that count as problems. `ok` findings never do. */\nexport function countIssues(results: readonly Diagnostic[]): number {\n return results.filter((result) => result.level !== 'ok').length;\n}\n\nexport async function doctor() {\n console.log(chalk.bold('Object UI Doctor'));\n console.log('Diagnosis in progress...\\n');\n\n const results = runDiagnostics(process.cwd());\n\n for (const result of results) {\n if (result.level === 'ok') {\n console.log(chalk.green(`✓ ${result.message}`));\n } else if (result.level === 'warn') {\n console.log(chalk.yellow(`⚠️ ${result.message}`));\n } else {\n console.log(chalk.red(`x ${result.message}`));\n }\n }\n\n const issues = countIssues(results);\n console.log('\\nResult:');\n if (issues === 0) {\n console.log(chalk.green('Everything looks good! ✨'));\n } else {\n console.log(chalk.yellow(`Found ${issues} issue(s).`));\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 chalk from 'chalk';\nimport { existsSync, mkdirSync, writeFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function add(component: string) {\n console.log(chalk.bold(`Object UI Add: ${component}`));\n console.log(chalk.yellow('Feature not implemented yet.'));\n console.log(`This command will download the source code for ${component}Renderer to your project.`);\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 chalk from 'chalk';\nimport { spawn } from 'child_process';\nimport { existsSync } from 'fs';\nimport { join, resolve, dirname } from 'path';\nimport { fileURLToPath } from 'url';\n\nexport async function studio() {\n console.log(chalk.bold('\\n🎨 Starting ObjectUI Studio...\\n'));\n\n const cwd = process.cwd();\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = dirname(__filename);\n\n // Resolve the console app directory\n // 1. Check monorepo structure (apps/console)\n // 2. Check relative path (../../apps/console from packages/cli)\n const candidates = [\n join(cwd, 'apps/console'),\n resolve(__dirname, '../../apps/console'),\n resolve(__dirname, '../../../apps/console'),\n ];\n\n let consolePath: string | null = null;\n for (const candidate of candidates) {\n if (existsSync(join(candidate, 'package.json'))) {\n consolePath = candidate;\n break;\n }\n }\n\n if (!consolePath) {\n console.log(chalk.yellow('⚠ Console app not found in workspace.'));\n console.log(chalk.dim(' Hint: Run this command from the monorepo root.'));\n console.log(chalk.dim(' Expected: apps/console/package.json\\n'));\n process.exit(1);\n }\n\n console.log(chalk.dim(` Console: ${consolePath}`));\n console.log(chalk.dim(' Mode: MSW (in-browser mock server)\\n'));\n\n // Delegate to the console's dev script which starts Vite + MSW\n const child = spawn('pnpm', ['run', 'dev'], {\n cwd: consolePath,\n stdio: 'inherit',\n env: { ...process.env, NODE_ENV: 'development' },\n shell: true,\n });\n\n child.on('error', (err) => {\n console.error(chalk.red(`\\n ✗ Failed to start studio: ${err.message}`));\n process.exit(1);\n });\n\n child.on('exit', (code) => process.exit(code ?? 0));\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 chalk from 'chalk';\nimport { globSync } from 'glob';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function check() {\n console.log(chalk.bold('Object UI Schema Check'));\n const cwd = process.cwd();\n \n // 1. Find all JSON/YAML files\n const files = globSync('**/*.{json,yaml,yml}', { \n cwd, \n ignore: ['node_modules/**', 'dist/**', '.git/**'] \n });\n \n console.log(`Analyzing ${files.length} files...`);\n \n let errors = 0;\n \n for (const file of files) {\n try {\n // Basic JSON parsing check\n if (file.endsWith('.json')) {\n const content = JSON.parse(readFileSync(join(cwd, file), 'utf-8'));\n // Schema validation: check for ObjectUI schema patterns\n if (content && typeof content === 'object' && content.type) {\n const knownTypes = [\n 'page', 'form', 'grid', 'crud', 'kanban', 'calendar', 'dashboard',\n 'chart', 'detail', 'list', 'timeline', 'gantt', 'map', 'gallery',\n 'object-view', 'detail-view', 'object-chart',\n ];\n if (typeof content.type === 'string' && !knownTypes.includes(content.type)) {\n console.log(chalk.yellow(`⚠️ Unknown schema type \"${content.type}\" in ${file}`));\n }\n }\n }\n } catch (e) {\n console.log(chalk.red(`x Invalid JSON in ${file}: ${(e as Error).message}`));\n errors++;\n }\n }\n \n if (errors === 0) {\n console.log(chalk.green('✓ All checks passed'));\n } else {\n console.log(chalk.red(`Found ${errors} errors`));\n process.exit(1);\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 chalk from 'chalk';\nimport { readFileSync, existsSync } from 'fs';\nimport { resolve } from 'path';\nimport { load as loadYaml } from 'js-yaml';\nimport { safeValidateSchema } from '@object-ui/types/zod';\nimport { findSpecVocabularyFormFields } from '../utils/spec-vocabulary-hint.js';\n\n/**\n * Validate a schema file\n * \n * @param schemaPath - Path to the schema file (JSON or YAML)\n */\nexport async function validate(schemaPath: string) {\n console.log(chalk.blue('🔍 ObjectUI Schema Validator\\n'));\n\n // Resolve the schema path\n const resolvedPath = resolve(process.cwd(), schemaPath);\n\n // Check if file exists\n if (!existsSync(resolvedPath)) {\n console.error(chalk.red(`✗ Error: Schema file not found: ${schemaPath}`));\n process.exit(1);\n }\n\n try {\n // Read the file\n const fileContent = readFileSync(resolvedPath, 'utf-8');\n let schema: unknown;\n\n // Parse based on file extension\n if (schemaPath.endsWith('.yaml') || schemaPath.endsWith('.yml')) {\n console.log(chalk.gray(`Reading YAML schema from: ${schemaPath}`));\n schema = loadYaml(fileContent);\n } else if (schemaPath.endsWith('.json')) {\n console.log(chalk.gray(`Reading JSON schema from: ${schemaPath}`));\n schema = JSON.parse(fileContent);\n } else {\n // Try JSON first, then YAML\n try {\n schema = JSON.parse(fileContent);\n console.log(chalk.gray(`Reading schema from: ${schemaPath} (detected as JSON)`));\n } catch {\n schema = loadYaml(fileContent);\n console.log(chalk.gray(`Reading schema from: ${schemaPath} (detected as YAML)`));\n }\n }\n\n // Validate the schema\n console.log(chalk.gray('Validating schema...\\n'));\n const result = safeValidateSchema(schema);\n\n if (result.success) {\n console.log(chalk.green('✓ Schema is valid!\\n'));\n \n // Show some info about the schema\n const data = result.data;\n console.log(chalk.bold('Schema Information:'));\n console.log(chalk.gray(' Type:'), data.type || 'unknown');\n \n if (data.id) {\n console.log(chalk.gray(' ID:'), data.id);\n }\n \n if (data.label || data.title) {\n console.log(chalk.gray(' Label:'), data.label || data.title);\n }\n \n // Count children if present\n if (data.children && Array.isArray(data.children)) {\n console.log(chalk.gray(' Children:'), data.children.length);\n }\n\n // Mixed-vocabulary entries validate (the runtime `name` satisfies the\n // schema) but the spec `field` key is dead weight: the renderer ignores\n // it and strip-mode validation drops it. Valid ≠ clean — say so (#3090).\n const mixed = findSpecVocabularyFormFields(schema).filter((f) => f.mixedName);\n if (mixed.length > 0) {\n console.log(chalk.yellow('\\nWarnings:'));\n for (const m of mixed) {\n console.log(chalk.yellow(\n ` ${m.path}: '${m.mixedName}' also carries { field: '${m.field}' } — mixed form-field ` +\n `vocabularies. The renderer ignores \\`field\\` here; drop one of the two.`,\n ));\n }\n }\n\n console.log('');\n process.exit(0);\n } else {\n console.error(chalk.red('✗ Schema validation failed!\\n'));\n console.error(chalk.bold('Validation Errors:'));\n \n // Format Zod errors nicely. `.issues` is the only accessor on a Zod 4\n // ZodError — the `.errors` alias was removed, so reading it yielded\n // undefined and this loop threw a TypeError that the catch below\n // reported as \"Error reading or parsing schema file\", hiding the very\n // errors this command exists to print.\n result.error.issues.forEach((issue, index) => {\n console.error(chalk.red(`\\n${index + 1}. ${issue.message}`));\n if (issue.path && issue.path.length > 0) {\n console.error(chalk.gray(` Path: ${issue.path.join(' → ')}`));\n }\n if (issue.code) {\n console.error(chalk.gray(` Code: ${issue.code}`));\n }\n });\n\n // \"name: expected string, received undefined\" on a `{ field: … }` entry\n // reads as an instruction to bolt a `name` on — which converts the\n // metadata WRONGLY (the spec shape stands for an object-schema merge\n // that a bare rename throws away). When the input matches that\n // signature, name the actual boundary and the real fixes (#3090).\n const specShaped = findSpecVocabularyFormFields(schema).filter((f) => !f.mixedName);\n if (specShaped.length > 0) {\n console.error(chalk.bold('\\nLikely cause — spec form-view vocabulary in a standalone form:'));\n for (const s of specShaped) {\n console.error(chalk.yellow(\n ` ${s.path}: { field: '${s.field}' } is the spec form-VIEW shape (an object-field reference).`,\n ));\n }\n console.error(chalk.yellow(\n ` A standalone \\`type: 'form'\\` component uses { name: … } (the form data path).\\n` +\n ` Fix: author the field with \\`name\\` and its own type/label — or, to reference object fields\\n` +\n ` with the spec shape, use an object-bound form (\\`type: 'object-form'\\` with objectName +\\n` +\n ` sections), whose section fields are translated by the renderer.`,\n ));\n }\n\n console.error('');\n process.exit(1);\n }\n } catch (error) {\n console.error(chalk.red('\\n✗ Error reading or parsing schema file:'));\n console.error(chalk.red((error as Error).message));\n console.error('');\n process.exit(1);\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 * Spec-vocabulary detector for `objectui validate` (#3090).\n *\n * `{ field: 'x' }` inside a standalone `type: 'form'` component is the spec\n * form-VIEW vocabulary (an object-field reference) — a different layer from\n * the runtime vocabulary this CLI validates (`name` = form data path). The\n * zod error for it (\"name: expected string, received undefined\") reads as an\n * instruction to bolt a `name` on, which converts the metadata WRONGLY: an\n * agent following it loses the object-schema merge the spec shape stands for.\n * This detector lets the CLI say what actually happened and what the real fix\n * is. The error message is the prompt the next agent executes — it has to\n * point at the boundary, not at the symptom.\n *\n * Scope is deliberately exact: only `fields` arrays hanging DIRECTLY off a\n * `type: 'form'` node. Section fields (`type: 'object-form'` → `sections[]`)\n * legitimately accept the spec shape — `normalizeSectionField` translates\n * them — and a runtime FormField's `field` key legitimately holds the\n * resolved metadata OBJECT, so only a STRING `field` marks the spec shape.\n */\n\nexport interface SpecVocabularyFinding {\n /** JSON-ish path to the entry, e.g. `children[0].fields[2]`. */\n path: string;\n /** The spec `field` value (the referenced object field). */\n field: string;\n /** Set when the entry ALSO carries a runtime `name` (mixed vocabularies). */\n mixedName?: string;\n}\n\nexport function findSpecVocabularyFormFields(\n node: unknown,\n path = '',\n): SpecVocabularyFinding[] {\n if (Array.isArray(node)) {\n return node.flatMap((child, i) => findSpecVocabularyFormFields(child, `${path}[${i}]`));\n }\n if (node === null || typeof node !== 'object') return [];\n\n const record = node as Record<string, unknown>;\n const findings: SpecVocabularyFinding[] = [];\n\n if (record.type === 'form' && Array.isArray(record.fields)) {\n record.fields.forEach((f, i) => {\n if (f && typeof f === 'object' && typeof (f as any).field === 'string') {\n const name = (f as any).name;\n findings.push({\n path: `${path ? `${path}.` : ''}fields[${i}]`,\n field: (f as any).field,\n ...(typeof name === 'string' ? { mixedName: name } : {}),\n });\n }\n });\n }\n\n for (const [key, value] of Object.entries(record)) {\n // The entries themselves were just inspected; don't re-walk them as\n // generic children or each finding would double-report.\n if (record.type === 'form' && key === 'fields') continue;\n findings.push(\n ...findSpecVocabularyFormFields(value, path ? `${path}.${key}` : key),\n );\n }\n return findings;\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 chalk from 'chalk';\nimport { spawn } from 'child_process';\nimport { resolve, dirname } from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Create a new plugin using the @object-ui/create-plugin package\n * \n * @param pluginName - Name of the plugin to create\n */\nexport async function createPlugin(pluginName: string) {\n console.log(chalk.blue('🚀 Creating ObjectUI plugin...\\n'));\n\n // Resolve the create-plugin script path\n const createPluginScript = resolve(\n __dirname,\n '../../../create-plugin/dist/index.js'\n );\n\n return new Promise<void>((resolve, reject) => {\n // Spawn the create-plugin command\n const child = spawn('node', [createPluginScript, pluginName], {\n stdio: 'inherit',\n shell: true,\n });\n\n child.on('error', (error) => {\n console.error(chalk.red('Failed to create plugin:'), error);\n reject(error);\n });\n\n child.on('exit', (code) => {\n if (code === 0) {\n resolve();\n } else {\n reject(new Error(`create-plugin exited with code ${code}`));\n }\n });\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 chalk from 'chalk';\nimport { existsSync, statSync, readdirSync } from 'fs';\nimport { resolve, join, extname } from 'path';\n\ninterface AnalyzeOptions {\n bundleSize?: boolean;\n renderPerformance?: boolean;\n}\n\n/**\n * Analyze bundle size by scanning dist directory\n */\nasync function analyzeBundleSize() {\n console.log(chalk.bold('\\n📦 Bundle Size Analysis\\n'));\n\n const distDir = resolve(process.cwd(), 'dist');\n \n if (!existsSync(distDir)) {\n console.log(chalk.yellow('⚠ No dist directory found. Run build first.'));\n return;\n }\n\n const files: Array<{ path: string; size: number }> = [];\n \n function scanDirectory(dir: string) {\n const items = readdirSync(dir);\n \n for (const item of items) {\n const fullPath = join(dir, item);\n const stat = statSync(fullPath);\n \n if (stat.isDirectory()) {\n scanDirectory(fullPath);\n } else {\n files.push({\n path: fullPath.replace(distDir + '/', ''),\n size: stat.size,\n });\n }\n }\n }\n \n scanDirectory(distDir);\n \n // Sort by size (largest first)\n files.sort((a, b) => b.size - a.size);\n \n // Calculate totals\n const totalSize = files.reduce((sum, file) => sum + file.size, 0);\n const jsFiles = files.filter(f => extname(f.path) === '.js');\n const cssFiles = files.filter(f => extname(f.path) === '.css');\n \n const jsSize = jsFiles.reduce((sum, file) => sum + file.size, 0);\n const cssSize = cssFiles.reduce((sum, file) => sum + file.size, 0);\n \n console.log(chalk.bold('Summary:'));\n console.log(chalk.gray(' Total Size:'), formatBytes(totalSize));\n console.log(chalk.gray(' JavaScript:'), formatBytes(jsSize), chalk.dim(`(${jsFiles.length} files)`));\n console.log(chalk.gray(' CSS: '), formatBytes(cssSize), chalk.dim(`(${cssFiles.length} files)`));\n console.log(chalk.gray(' Other: '), formatBytes(totalSize - jsSize - cssSize));\n \n console.log(chalk.bold('\\nLargest Files:'));\n files.slice(0, 10).forEach((file) => {\n const sizeStr = formatBytes(file.size).padStart(10);\n console.log(chalk.gray(` ${sizeStr}`), file.path);\n });\n \n // Bundle size recommendations\n console.log(chalk.bold('\\n💡 Recommendations:'));\n \n if (totalSize > 1024 * 1024) {\n console.log(chalk.yellow(' ⚠ Total bundle size is large (> 1MB)'));\n console.log(chalk.gray(' Consider code splitting or lazy loading'));\n }\n \n if (jsSize > 500 * 1024) {\n console.log(chalk.yellow(' ⚠ JavaScript bundle is large (> 500KB)'));\n console.log(chalk.gray(' Consider:'));\n console.log(chalk.gray(' - Tree shaking unused code'));\n console.log(chalk.gray(' - Lazy loading components'));\n console.log(chalk.gray(' - Using dynamic imports'));\n }\n \n if (files.length > 100) {\n console.log(chalk.yellow(` ⚠ Large number of files (${files.length})`));\n console.log(chalk.gray(' Consider bundling or combining files'));\n }\n \n console.log('');\n}\n\n/**\n * Analyze render performance (placeholder for now)\n */\nasync function analyzeRenderPerformance() {\n console.log(chalk.bold('\\n⚡ Render Performance Analysis\\n'));\n \n console.log(chalk.gray('Performance analysis features:'));\n console.log(chalk.gray(' ✓ Expression caching enabled'));\n console.log(chalk.gray(' ✓ Component memoization available'));\n console.log(chalk.gray(' ✓ Virtual scrolling support for large lists'));\n \n console.log(chalk.bold('\\n💡 Performance Tips:'));\n console.log(chalk.gray(' • Use virtual scrolling for lists > 100 items'));\n console.log(chalk.gray(' • Cache frequently evaluated expressions'));\n console.log(chalk.gray(' • Use React.memo for expensive components'));\n console.log(chalk.gray(' • Implement pagination for large datasets'));\n console.log(chalk.gray(' • Use code splitting for large apps'));\n \n console.log('');\n}\n\n/**\n * Format bytes to human-readable string\n */\nfunction formatBytes(bytes: number): string {\n if (bytes === 0) return '0 B';\n \n const k = 1024;\n const sizes = ['B', 'KB', 'MB', 'GB'];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n \n return `${(bytes / Math.pow(k, i)).toFixed(2)} ${sizes[i]}`;\n}\n\n/**\n * Analyze application performance\n * \n * @param options - Analysis options\n */\nexport async function analyze(options: AnalyzeOptions = {}) {\n console.log(chalk.blue('🔍 ObjectUI Performance Analyzer\\n'));\n\n const runAll = !options.bundleSize && !options.renderPerformance;\n \n if (options.bundleSize || runAll) {\n await analyzeBundleSize();\n }\n \n if (options.renderPerformance || runAll) {\n await analyzeRenderPerformance();\n }\n \n console.log(chalk.green('✓ Analysis complete!\\n'));\n}\n"],"mappings":";;;;;;;;;;;AAQA,SAAS,eAAe;AACxB,OAAOA,aAAW;;;ACDlB,SAAS,oBAAoB;AAC7B,OAAO,WAAW;AAClB,SAAS,YAAY,WAAW,YAAY,gBAAgB;AAC5D,SAAS,MAAM,SAAS,eAAe;AACvC,OAAO,WAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAiC9B,eAAe,4BAAgD;AAC7D,MAAI;AACF,UAAM,CAAC,iBAAiB,YAAY,IAAI,MAAM,QAAQ,IAAI;AAAA,MACxD,OAAO,sBAAsB;AAAA,MAC7B,OAAO,cAAc;AAAA,IACvB,CAAC;AACD,WAAO,CAAC,gBAAgB,QAAQ,GAAG,aAAa,QAAQ,CAAC;AAAA,EAC3D,SAAS,OAAO;AAKd,UAAM,IAAI;AAAA,MACR,qDAAqD,iBAAiB,QAAQ,MAAM,UAAU,KAAK;AAAA;AAAA;AAAA;AAAA,IAIrG;AAAA,EACF;AACF;AAEA,eAAsB,IAAI,YAAoB,SAAqB;AACjE,QAAM,MAAM,QAAQ,IAAI;AAGxB,MAAI,eAAe;AACnB,QAAM,mBAAmB;AACzB,MAAI,cAAc;AAClB,MAAI,WAAW;AACf,MAA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U;AACrB,YAAM,aAAa,IAAI;AAAA,IACzB,OAAO;AACL,cAAQ,MAAMA,QAAM,IAAI,0BAA0B,IAAI,EAAE,CAAC;AACzD,cAAQ,IAAIA,QAAM,KAAK,yBAAyB,CAAC;AACjD,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,SAAS,OAAO;AACd,YAAQ,MAAMA,QAAM,IAAI,QAAQ,GAAG,iBAAiB,QAAQ,MAAM,UAAU,KAAK;AACjF,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAEH,QACG,QAAQ,SAAS,EACjB,YAAY,iCAAiC,EAC7C,OAAO,iBAAiB,qBAAqB,EAC7C,OAAO,wBAAwB,4BAA4B,EAC3D,OAAO,OAAO,YAAY;AACzB,MAAI;AACF,UAAM,QAAQ,OAAO;AAAA,EACvB,SAAS,OAAO;AACd,YAAQ,MAAMA,QAAM,IAAI,QAAQ,GAAG,iBAAiB,QAAQ,MAAM,UAAU,KAAK;AACjF,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAGH,QAAQ,MAAM;","names":["chalk","require","react","existsSync","mkdirSync","join","resolve","chalk","execSync","resolve","chalk","join","existsSync","mkdirSync","execSync","react","existsSync","join","resolve","chalk","execSync","existsSync","join","chalk","execSync","existsSync","join","chalk","chalk","existsSync","mkdirSync","join","chalk","existsSync","dirname","join","chalk","chalk","existsSync","join","resolve","dirname","__filename","__dirname","chalk","readFileSync","join","chalk","readFileSync","existsSync","resolve","chalk","resolve","existsSync","readFileSync","chalk","spawn","resolve","dirname","fileURLToPath","chalk","existsSync","statSync","resolve","join","readFileSync","fileURLToPath","dirname","join","__filename","__dirname","chalk"]}
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  init,
3
3
  serve
4
- } from "./chunk-EV2DCI7W.js";
4
+ } from "./chunk-2MZA766D.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.2.0",
3
+ "version": "17.5.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",
@@ -24,7 +24,6 @@
24
24
  },
25
25
  "files": [
26
26
  "dist",
27
- "templates",
28
27
  "README.md",
29
28
  "CHANGELOG.md",
30
29
  "LICENSE"
@@ -47,23 +46,25 @@
47
46
  "author": "ObjectStack Team",
48
47
  "license": "MIT",
49
48
  "dependencies": {
49
+ "@tailwindcss/postcss": "^4.3.3",
50
50
  "@types/glob": "^9.0.0",
51
- "@vitejs/plugin-react": "^6.0.4",
51
+ "@vitejs/plugin-react": "^6.0.5",
52
+ "autoprefixer": "^10.5.4",
52
53
  "chalk": "^6.0.0",
53
54
  "commander": "^15.0.0",
54
55
  "express": "^4.22.2",
55
- "express-rate-limit": "^8.6.1",
56
+ "express-rate-limit": "^8.6.2",
56
57
  "glob": "^13.0.6",
57
- "js-yaml": "^5.2.2",
58
- "vite": "^8.1.5",
59
- "@object-ui/components": "17.2.0",
60
- "@object-ui/react": "17.2.0",
61
- "@object-ui/types": "17.2.0"
58
+ "js-yaml": "^5.2.3",
59
+ "vite": "^8.2.1",
60
+ "@object-ui/components": "17.5.0",
61
+ "@object-ui/react": "17.5.0",
62
+ "@object-ui/types": "17.5.0"
62
63
  },
63
64
  "devDependencies": {
64
65
  "@types/express": "^4.17.25",
65
66
  "@types/js-yaml": "^4.0.9",
66
- "@types/node": "^26.1.1",
67
+ "@types/node": "^26.1.2",
67
68
  "tsup": "^8.5.1",
68
69
  "typescript": "^6.0.3",
69
70
  "vitest": "^4.1.10"