@lastbrain/app 0.1.1 → 0.1.3
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/scripts/init-app.js +16 -6
- package/package.json +2 -1
package/dist/scripts/init-app.js
CHANGED
|
@@ -43,7 +43,7 @@ export async function initApp(options) {
|
|
|
43
43
|
// 1. Vérifier/créer package.json
|
|
44
44
|
await ensurePackageJson(targetDir, projectName);
|
|
45
45
|
// 2. Installer les dépendances
|
|
46
|
-
await addDependencies(targetDir, useHeroUI, withAuth);
|
|
46
|
+
await addDependencies(targetDir, useHeroUI, withAuth, selectedModules);
|
|
47
47
|
// 3. Créer la structure Next.js
|
|
48
48
|
await createNextStructure(targetDir, force, useHeroUI, withAuth);
|
|
49
49
|
// 4. Créer les fichiers de configuration
|
|
@@ -137,23 +137,33 @@ async function ensurePackageJson(targetDir, projectName) {
|
|
|
137
137
|
console.log(chalk.green("✓ package.json existe"));
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
async function addDependencies(targetDir, useHeroUI, withAuth) {
|
|
140
|
+
async function addDependencies(targetDir, useHeroUI, withAuth, selectedModules = []) {
|
|
141
141
|
const pkgPath = path.join(targetDir, "package.json");
|
|
142
142
|
const pkg = await fs.readJson(pkgPath);
|
|
143
143
|
console.log(chalk.yellow("\n📦 Configuration des dépendances..."));
|
|
144
|
+
// Détecter si on est dans le monorepo (développement local)
|
|
145
|
+
const isMonorepo = fs.existsSync(path.join(__dirname, "../../../core/package.json"));
|
|
146
|
+
const latestVersion = isMonorepo ? "workspace:*" : "latest";
|
|
144
147
|
// Dependencies
|
|
145
148
|
const requiredDeps = {
|
|
146
149
|
next: "^15.0.3",
|
|
147
150
|
react: "^18.3.1",
|
|
148
151
|
"react-dom": "^18.3.1",
|
|
149
|
-
"@lastbrain/app":
|
|
150
|
-
"@lastbrain/core":
|
|
151
|
-
"@lastbrain/ui":
|
|
152
|
+
"@lastbrain/app": latestVersion,
|
|
153
|
+
"@lastbrain/core": latestVersion,
|
|
154
|
+
"@lastbrain/ui": latestVersion,
|
|
152
155
|
"next-themes": "^0.4.6",
|
|
153
156
|
};
|
|
154
157
|
// Ajouter module-auth si demandé
|
|
155
158
|
if (withAuth) {
|
|
156
|
-
requiredDeps["@lastbrain/module-auth"] =
|
|
159
|
+
requiredDeps["@lastbrain/module-auth"] = latestVersion;
|
|
160
|
+
}
|
|
161
|
+
// Ajouter les autres modules sélectionnés
|
|
162
|
+
for (const moduleName of selectedModules) {
|
|
163
|
+
const moduleInfo = AVAILABLE_MODULES.find(m => m.name === moduleName);
|
|
164
|
+
if (moduleInfo && moduleInfo.package !== "@lastbrain/module-auth") {
|
|
165
|
+
requiredDeps[moduleInfo.package] = latestVersion;
|
|
166
|
+
}
|
|
157
167
|
}
|
|
158
168
|
// Ajouter les dépendances HeroUI si nécessaire
|
|
159
169
|
if (useHeroUI) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lastbrain/app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Framework modulaire Next.js avec CLI et système de modules",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"chalk": "^5.3.0",
|
|
38
38
|
"commander": "^12.1.0",
|
|
39
39
|
"fs-extra": "^11.2.0",
|
|
40
|
+
"inquirer": "^9.2.12",
|
|
40
41
|
"lucide-react": "^0.554.0",
|
|
41
42
|
"next-themes": "^0.4.6",
|
|
42
43
|
"react": "^19.0.0",
|