@lastbrain/app 0.1.5 → 0.1.7
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 +2 -2
- package/dist/scripts/init-app.js +23 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -15,7 +15,7 @@ program
|
|
|
15
15
|
.command("init [directory]")
|
|
16
16
|
.description("Initialise une nouvelle application Next.js LastBrain")
|
|
17
17
|
.option("-f, --force", "Écrase les fichiers existants")
|
|
18
|
-
.option("--heroui", "
|
|
18
|
+
.option("--no-heroui", "Ne pas utiliser HeroUI (Tailwind CSS uniquement)")
|
|
19
19
|
.option("--with-auth", "Inclure le module d'authentification")
|
|
20
20
|
.option("--no-interactive", "Mode non-interactif (skip la sélection des modules)")
|
|
21
21
|
.action(async (directory, options) => {
|
|
@@ -27,7 +27,7 @@ program
|
|
|
27
27
|
force: options.force || false,
|
|
28
28
|
targetDir,
|
|
29
29
|
projectName: directory || path.basename(process.cwd()),
|
|
30
|
-
useHeroUI: options.heroui
|
|
30
|
+
useHeroUI: options.heroui !== false, // Par défaut true, false si --no-heroui
|
|
31
31
|
withAuth: options.withAuth || false,
|
|
32
32
|
interactive: options.interactive !== false,
|
|
33
33
|
});
|
package/dist/scripts/init-app.js
CHANGED
|
@@ -851,16 +851,34 @@ async function addScriptsToPackageJson(targetDir) {
|
|
|
851
851
|
console.log(chalk.yellow("\n🔧 Ajout des scripts NPM..."));
|
|
852
852
|
const pkgPath = path.join(targetDir, "package.json");
|
|
853
853
|
const pkg = await fs.readJson(pkgPath);
|
|
854
|
+
// Détecter si le projet cible est dans un workspace
|
|
855
|
+
const targetIsInMonorepo = fs.existsSync(path.join(targetDir, "../../../packages/core/package.json")) ||
|
|
856
|
+
fs.existsSync(path.join(targetDir, "../../packages/core/package.json"));
|
|
857
|
+
let scriptsPrefix = "node node_modules/@lastbrain/app/dist/scripts/";
|
|
858
|
+
if (targetIsInMonorepo) {
|
|
859
|
+
// Dans un monorepo, utiliser pnpm exec pour résoudre correctement les workspace packages
|
|
860
|
+
scriptsPrefix = "pnpm exec lastbrain ";
|
|
861
|
+
}
|
|
854
862
|
const scripts = {
|
|
855
863
|
dev: "next dev",
|
|
856
864
|
build: "next build",
|
|
857
865
|
start: "next start",
|
|
858
866
|
lint: "next lint",
|
|
859
|
-
lastbrain:
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
"
|
|
863
|
-
|
|
867
|
+
lastbrain: targetIsInMonorepo
|
|
868
|
+
? "pnpm exec lastbrain"
|
|
869
|
+
: "node node_modules/@lastbrain/app/dist/cli.js",
|
|
870
|
+
"build:modules": targetIsInMonorepo
|
|
871
|
+
? "pnpm exec lastbrain module:build"
|
|
872
|
+
: "node node_modules/@lastbrain/app/dist/scripts/module-build.js",
|
|
873
|
+
"db:migrations:sync": targetIsInMonorepo
|
|
874
|
+
? "pnpm exec lastbrain db:migrations:sync"
|
|
875
|
+
: "node node_modules/@lastbrain/app/dist/scripts/db-migrations-sync.js",
|
|
876
|
+
"db:init": targetIsInMonorepo
|
|
877
|
+
? "pnpm exec lastbrain db:init"
|
|
878
|
+
: "node node_modules/@lastbrain/app/dist/scripts/db-init.js",
|
|
879
|
+
"readme:create": targetIsInMonorepo
|
|
880
|
+
? "pnpm exec lastbrain readme:create"
|
|
881
|
+
: "node node_modules/@lastbrain/app/dist/scripts/readme-build.js",
|
|
864
882
|
};
|
|
865
883
|
pkg.scripts = { ...pkg.scripts, ...scripts };
|
|
866
884
|
await fs.writeJson(pkgPath, pkg, { spaces: 2 });
|