UNPKG

initia-devaxis

Version:

CLI to create full-stack React projects with Next.js (REST) or RedwoodJS (GraphQL)

191 lines (139 loc) 4.74 kB
# 🚀 INITIA - CLI de Boilerplate Une CLI moderne pour créer des projets **Next.js** et **RedwoodJS** avec des configurations optimisées (ESLint, Prettier, TypeScript). ## ✨ Fonctionnalités -**Projets Next.js** avec App Router et optimisations - 🌲 **Projets RedwoodJS** full-stack complets - 🔍 **ESLint** configuré avec les meilleures pratiques - 💅 **Prettier** pour un formatage cohérent du code - 🔷 **TypeScript** supporté par défaut - 🎨 **Tailwind CSS** (optionnel pour Next.js) - 📖 **README personnalisés** avec documentation complète ## 🛠️ Installation ### Installation globale (recommandée) ```bash npm install -g initia ``` ### Utilisation avec npx (sans installation) ```bash npx initia ``` ## 🚀 Utilisation ### Créer un nouveau projet ```bash initia # ou initia init ``` ### Processus de création 1. **Configuration du projet** : - Nom du projet - Choix du framework (Next.js / RedwoodJS) - Options TypeScript, ESLint, Prettier - Tailwind CSS (pour Next.js) 2. **Génération automatique** du projet avec toutes les configurations ## 📋 Exemples de projets générés ### Next.js avec TypeScript + Tailwind ```bash mon-projet-next/ ├── src/ │ ├── app/ # App Router (Next.js 13+) │ ├── components/ # Composants réutilisables │ └── styles/ # Fichiers CSS ├── public/ # Assets statiques ├── .eslintrc.json # Configuration ESLint ├── .prettierrc.json # Configuration Prettier ├── tsconfig.json # Configuration TypeScript └── README.md # Documentation ``` **Scripts disponibles :** - `npm run dev` - Serveur de développement - `npm run build` - Build de production - `npm run lint` - Linting du code - `npm run format` - Formatage avec Prettier ### RedwoodJS avec TypeScript ```bash mon-projet-redwood/ ├── api/ # Backend (GraphQL, Services, DB) ├── web/ # Frontend (React, Pages, Composants) ├── scripts/ # Scripts utilitaires ├── .eslintrc.js # Configuration ESLint ├── .prettierrc.js # Configuration Prettier └── README.md # Documentation complète ``` **Scripts disponibles :** - `yarn rw dev` - Serveurs développement (frontend + backend) - `yarn rw build` - Build de production - `yarn rw lint` - Linting du code - `yarn format` - Formatage avec Prettier ## 🔧 Configuration ### Personnalisation Vous pouvez modifier la CLI pour : - Changer les configurations par défaut - Ajouter des templates personnalisés - Intégrer d'autres frameworks ## 🏗️ Développement ### Prérequis - Node.js 18+ - npm ou Yarn - TypeScript ### Installation en développement ```bash git clone <votre-repo> cd initia npm install npm run build npm link ``` ### Scripts de développement ```bash npm run dev # Compilation TypeScript en mode watch npm run build # Compilation TypeScript npm run start # Démarrage de la CLI compilée npm test # Tests (à implémenter) ``` ### Structure du projet ``` initia/ ├── src/ │ ├── commands/ # Commandes CLI │ │ └── init.ts # Commande d'initialisation │ ├── utils/ │ │ └── generators/ # Générateurs de projets │ │ ├── nextjs.ts # Générateur Next.js │ │ └── redwood.ts # Générateur RedwoodJS │ ├── types/ # Types TypeScript │ └── index.ts # Point d'entrée ├── package.json # Dépendances et scripts └── tsconfig.json # Configuration TypeScript ``` ## 📦 Publication ### NPM ```bash npm run build npm publish ``` ### Tests locaux ```bash npm link initia --help ``` ## 🛠️ Technologies utilisées - **Node.js** - Runtime JavaScript - **TypeScript** - Langage typé - **Commander.js** - Parser CLI - **Inquirer.js** - Prompts interactifs - **Chalk** - Couleurs dans le terminal - **Boxen** - Boxes formatées - **Figlet** - ASCII Art ## 🤝 Contribution Les contributions sont les bienvenues ! N'hésitez pas à : 1. Fork le projet 2. Créer une branche (`git checkout -b feature/amazing-feature`) 3. Commit vos changements (`git commit -m 'Add amazing feature'`) 4. Push sur la branche (`git push origin feature/amazing-feature`) 5. Ouvrir une Pull Request ## 📄 Licence Ce projet est sous licence MIT. Voir le fichier [LICENSE](LICENSE) pour plus de détails. ## 📞 Support - 🐛 Issues : [GitHub Issues](https://github.com/votre-username/initia/issues) - 💬 Discussions : [GitHub Discussions](https://github.com/votre-username/initia/discussions)