-
Notifications
You must be signed in to change notification settings - Fork 0
Add dev, build, start, lint, and test commands to CLI #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
|
看看还需要其他哪些命令,比如说test lint @copilot |
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
已添加 新增命令 / New Commands:
完整的开发工作流程 / Complete Development Workflow: objectui init my-app # 初始化项目
cd my-app
objectui dev # 开发服务器
objectui lint # 代码检查
objectui test # 运行测试
objectui build --clean # 生产构建
objectui start # 预览生产版本现在 CLI 支持 7 个命令,与 Next.js/Vite 等主流框架保持一致。 Commit: 5f82b1c |
|
@copilot 继续fix and test |
📦 Bundle Size Report
Size Limits
|
|
✅ All checks passed!
|
|
@copilot fix codeql Missing rate limiting // SPA fallback - serve index.html for all routes // Start server |
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
|
@copilot 继续 |
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
已完成 CodeQL 安全问题修复! (CodeQL security issue fixed!) 修复内容 / Fixed:
代码更改 / Changes: // Configure rate limiting to prevent abuse
const limiter = rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 1000, // Limit each IP to 1000 requests per windowMs
message: 'Too many requests from this IP, please try again later.',
standardHeaders: true,
legacyHeaders: false,
});
// Apply rate limiting to all routes
app.use(limiter);✅ Build passing |
📦 Bundle Size Report
Size Limits
|
|
✅ All checks passed!
|
Enhance CLI with Complete Development Workflow Commands
Based on the requirement to support mainstream development framework patterns, add the following commands to the Object UI CLI:
Plan
devcommand - Start development server with hot reloadbuildcommand - Build application for productionstartcommand - Serve production buildlintcommand - Lint the generated application codetestcommand - Run tests for the applicationChanges Made
/packages/cli/src/commands/dev.ts- Development server command/packages/cli/src/commands/build.ts- Production build command/packages/cli/src/commands/start.ts- Production server command with rate limiting/packages/cli/src/commands/lint.ts- Linting command with ESLint/packages/cli/src/commands/test.ts- Testing command with Vitest/packages/cli/src/utils/app-generator.ts- Shared utilities for app generation/packages/cli/src/commands/serve.ts- Refactored to use shared utilities/packages/cli/src/cli.ts- Added new command definitions/packages/cli/README.md- Documented all commands/packages/cli/package.json- Added express-rate-limit dependencyAll Available Commands
objectui init- Initialize a new projectobjectui dev- Development server with HMRobjectui build- Production buildobjectui start- Serve production build (with rate limiting for security)objectui lint- Lint code with ESLintobjectui test- Run tests with Vitestobjectui serve- Legacy development server (backward compatible)Security
startcommand to prevent DoS attacks (1000 requests per IP per 15 minutes)express-rate-limitmiddleware with standard headersTesting
All commands have been tested and verified to work correctly:
objectui init- Creates new projects successfullyobjectui dev- Starts development server with hot reloadobjectui build- Builds for productionobjectui start- Serves production build with rate limiting protectionobjectui lint- Lints generated application codeobjectui test- Runs tests with multiple options (watch, coverage, UI)objectui serve- Legacy command still worksThe CLI now follows mainstream framework patterns similar to Next.js, Vite, and other modern development tools, with enterprise-grade security features.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.