create-dotcms-app cli library added in the core-web/libs
๐ Pull Request: Add create-dotcms-app Scaffolding CLI
๐ Overview
This pull request introduces a new CLI tool named create-dotcms-app, designed to scaffold front-end applications for DotCMS headless implementations.
It streamlines the setup process by allowing developers to quickly generate starter projects in popular frameworks such as Next.js, Angular, Vue and more.
This CLI improves developer onboarding, reduces manual setup steps, and ensures consistency across DotCMS headless integrations.
Closes: #34054
๐ง Key Features Added
โ 1. Interactive CLI Wizard
- Prompts users for:
- Preferred front-end framework
- Project name
- Output directory
- Supports non-interactive mode using flags.
โ 2. Framework Templates
- Includes scaffolding for:
- Next.js
- Vue
- Angular
- (More can be added in the future)
โ 3. DotCMS Integration
- Automatically configures:
- DotCMS demo site identifier retrieval
- UVE (Universal Visual Editor) configuration
- Token generation for API usage
- Provides clean helpers via the new
DotCMSApiclass.
โ 4. Error-Handled API Utilities
- Robust error handling using
ts-results(Ok,Err). - Safe network requests with Axios.
- Custom error classes for improved DX.
โ 5. NX Project Integration
- Added build, lint, and testing targets.
- Prettier formatting working
- Standardized project structure under NX workspace.
๐ New Files & Major Changes
๐ Newly Added
-
core-web/libs/create-app/*
๐ Updated
-
project.json(updated with build, test, and format targets) -
package.json(added required dependencies) - Added README explaining usage.
๐ฆ Dependencies Introduced
| Package | Purpose |
|---|---|
axios |
Network requests to DotCMS APIs |
chalk |
Colored terminal output for better UX |
commander |
CLI argument parsing & command handling |
execa |
Run shell commands (Docker, git, etc.) |
fs-extra |
File system helpers (copy, ensureDir, etc.) |
inquirer |
Interactive CLI prompts |
log-symbols |
Pretty success/error/warning icons |
ora |
Terminal spinners for loading states |
ts-results |
Functional-style result-based error handling |
๐งช Testing
- No testing performed right now although using jest for testing
๐ Documentation
A fully detailed README is included covering:
- Installation
- Usage
- CLI flags
- Framework support
- Environment setup
- Error handling
๐งฉ Motivation
This PR aims to:
- Simplify the developer onboarding experience.
- Provide a modern scaffolding tool similar to
create-next-appornpm init vue. - Improve adoption of DotCMS as a headless CMS.
- Reduce setup errors and improve usability.
โ๏ธ Checklist
- [x] Code compiles without errors
- [x] Documentation updated
- [x] Linting & formatting applied
- [x] Ready for review
๐ Request for Review
Please review the implementation, templates, and overall CLI flow.
Feedback on DX, naming, and template structure is especially appreciated.
Legal Risk
The following dependencies were released under a license that has been flagged by your organization for consideration.
Recommendation
While merging is not directly blocked, it's best to pause and consider what it means to use this license before continuing. If you are unsure, reach out to your security team or Semgrep admin to address this issue.
GPL-2.0