@object-ui/cli 0.5.0 → 3.0.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/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('初始化新的Object UI应用 / 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 app.json in cwd\n // TODO: Load app.json if exists\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 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 // @ts-expect-error - lucidePath is dynamically resolved\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 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 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 if (existsSync(tailwindConfigPath)) {\n console.log(chalk.green('✓ tailwind.config.js found'));\n // TODO: Check content configuration\n } else {\n console.log(chalk.yellow('⚠️ tailwind.config.js not found'));\n issues++;\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 { serve } from './serve.js';\n\nexport async function studio() {\n console.log(chalk.bold('Starting Object UI Studio...'));\n \n // Logic to start designer server\n // This might reuse 'serve' but with a special mode or different root\n \n console.log(chalk.yellow('Studio mode is experimental.'));\n \n // For now, we can just point to the designer URL if it was hosted, \n // or start the local dev server with a flag.\n // Assuming designer is a static app that connects to the local API.\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 JSON.parse(readFileSync(join(cwd, file), 'utf-8'));\n }\n // TODO: Schema validation logic\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';\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 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\n const errors = result.error.errors;\n errors.forEach((error, index) => {\n console.error(chalk.red(`\\n${index + 1}. ${error.message}`));\n if (error.path && error.path.length > 0) {\n console.error(chalk.gray(` Path: ${error.path.join(' → ')}`));\n }\n if (error.code) {\n console.error(chalk.gray(` Code: ${error.code}`));\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\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,UAAM,oBAAoB,KAAK,SAAS,OAAO;AAE/C,QAAI,WAAW,iBAAiB,GAAG;AACjC,cAAQ,IAAI,MAAM,KAAK,2CAAoC,OAAO,EAAE,CAAC;AACrE,qBAAe;AACf,oBAAc;AACd,iBAAW;AAGX,UAAI;AACF,o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,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","chalk","readFileSync","join","chalk","readFileSync","existsSync","resolve","chalk","resolve","dirname","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/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('初始化新的Object UI应用 / 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 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 // @ts-expect-error - lucidePath is dynamically resolved\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 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 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';\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 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\n const errors = result.error.errors;\n errors.forEach((error, index) => {\n console.error(chalk.red(`\\n${index + 1}. ${error.message}`));\n if (error.path && error.path.length > 0) {\n console.error(chalk.gray(` Path: ${error.path.join(' → ')}`));\n }\n if (error.code) {\n console.error(chalk.gray(` Code: ${error.code}`));\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\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,kBAA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AAqB,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","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-O3QIU2WQ.js";
4
+ } from "./chunk-LWXDPPSW.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": "0.5.0",
3
+ "version": "3.0.0",
4
4
  "description": "CLI tool for Object UI - Build applications from JSON schemas",
5
5
  "type": "module",
6
6
  "homepage": "https://www.objectui.org",
@@ -36,23 +36,23 @@
36
36
  "license": "MIT",
37
37
  "dependencies": {
38
38
  "@types/glob": "^9.0.0",
39
- "@vitejs/plugin-react": "^5.1.3",
40
- "chalk": "^5.4.1",
39
+ "@vitejs/plugin-react": "^5.1.4",
40
+ "chalk": "^5.6.2",
41
41
  "commander": "^14.0.3",
42
- "express": "^4.21.2",
42
+ "express": "^4.22.1",
43
43
  "express-rate-limit": "^8.2.1",
44
- "glob": "^13.0.0",
45
- "js-yaml": "^4.1.0",
44
+ "glob": "^13.0.3",
45
+ "js-yaml": "^4.1.1",
46
46
  "vite": "^7.3.1",
47
- "@object-ui/components": "0.5.0",
48
- "@object-ui/react": "0.5.0",
49
- "@object-ui/types": "0.5.0"
47
+ "@object-ui/components": "3.0.0",
48
+ "@object-ui/react": "3.0.0",
49
+ "@object-ui/types": "3.0.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@types/express": "^4.17.21",
52
+ "@types/express": "^4.17.25",
53
53
  "@types/js-yaml": "^4.0.9",
54
- "@types/node": "^25.0.10",
55
- "tsup": "^8.0.0",
54
+ "@types/node": "^25.2.3",
55
+ "tsup": "^8.5.1",
56
56
  "typescript": "^5.9.3"
57
57
  },
58
58
  "scripts": {