@lastbrain/app 0.1.4 → 0.1.6
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-app.d.ts","sourceRoot":"","sources":["../../src/scripts/init-app.ts"],"names":[],"mappings":"AAWA,UAAU,cAAc;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"init-app.d.ts","sourceRoot":"","sources":["../../src/scripts/init-app.ts"],"names":[],"mappings":"AAWA,UAAU,cAAc;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,cAAc,iBAsJpD"}
|
package/dist/scripts/init-app.js
CHANGED
|
@@ -83,6 +83,12 @@ export async function initApp(options) {
|
|
|
83
83
|
const url = `http://127.0.0.1:${port}`;
|
|
84
84
|
console.log(chalk.yellow("🚀 Lancement du serveur de développement...\n"));
|
|
85
85
|
console.log(chalk.cyan(`📱 Ouvrez votre navigateur sur : ${url}\n`));
|
|
86
|
+
console.log(chalk.blue("\n📋 Prochaines étapes après le démarrage :"));
|
|
87
|
+
console.log(chalk.white(" 1. Cliquez sur 'Get Started' sur la page d'accueil"));
|
|
88
|
+
console.log(chalk.white(" 2. Lancez Docker Desktop"));
|
|
89
|
+
console.log(chalk.white(" 3. Installez Supabase CLI si nécessaire : brew install supabase/tap/supabase"));
|
|
90
|
+
console.log(chalk.white(" 4. Exécutez : pnpm db:init"));
|
|
91
|
+
console.log(chalk.white(" 5. Rechargez la page\n"));
|
|
86
92
|
// Ouvrir le navigateur
|
|
87
93
|
const openCommand = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
88
94
|
setTimeout(() => {
|
|
@@ -106,12 +112,17 @@ export async function initApp(options) {
|
|
|
106
112
|
}
|
|
107
113
|
}
|
|
108
114
|
else {
|
|
109
|
-
console.log(chalk.cyan("\
|
|
115
|
+
console.log(chalk.cyan("\n📋 Prochaines étapes:"));
|
|
110
116
|
console.log(chalk.white(" 1. cd " + relativePath));
|
|
111
117
|
console.log(chalk.white(" 2. pnpm install"));
|
|
112
|
-
console.log(chalk.white(" 3. pnpm
|
|
113
|
-
console.log(chalk.white(" 4. pnpm
|
|
114
|
-
console.log(chalk.white("
|
|
118
|
+
console.log(chalk.white(" 3. pnpm build:modules (générer les routes des modules)"));
|
|
119
|
+
console.log(chalk.white(" 4. pnpm dev (démarrer le serveur de développement)"));
|
|
120
|
+
console.log(chalk.white("\n Puis sur la page d'accueil :"));
|
|
121
|
+
console.log(chalk.white(" 5. Cliquez sur 'Get Started'"));
|
|
122
|
+
console.log(chalk.white(" 6. Lancez Docker Desktop"));
|
|
123
|
+
console.log(chalk.white(" 7. Installez Supabase CLI : brew install supabase/tap/supabase"));
|
|
124
|
+
console.log(chalk.white(" 8. Exécutez : pnpm db:init"));
|
|
125
|
+
console.log(chalk.white(" 9. Rechargez la page\n"));
|
|
115
126
|
// Afficher la commande cd pour faciliter la copie
|
|
116
127
|
console.log(chalk.gray("Pour vous déplacer dans le projet :"));
|
|
117
128
|
console.log(chalk.cyan(` cd ${relativePath}\n`));
|
|
@@ -231,6 +242,7 @@ async function addDependencies(targetDir, useHeroUI, withAuth, selectedModules =
|
|
|
231
242
|
const requiredDevDeps = {
|
|
232
243
|
"@tailwindcss/postcss": "^4.0.0",
|
|
233
244
|
tailwindcss: "^4.0.0",
|
|
245
|
+
autoprefixer: "^10.4.20",
|
|
234
246
|
typescript: "^5.4.0",
|
|
235
247
|
"@types/node": "^20.0.0",
|
|
236
248
|
"@types/react": "^18.3.0",
|
|
@@ -706,6 +718,31 @@ export default config;
|
|
|
706
718
|
await fs.writeJson(tsconfigPath, tsconfig, { spaces: 2 });
|
|
707
719
|
console.log(chalk.green("✓ tsconfig.json créé"));
|
|
708
720
|
}
|
|
721
|
+
// config/menu.ts
|
|
722
|
+
const configDir = path.join(targetDir, "config");
|
|
723
|
+
await fs.ensureDir(configDir);
|
|
724
|
+
const menuConfigPath = path.join(configDir, "menu.ts");
|
|
725
|
+
if (!fs.existsSync(menuConfigPath) || force) {
|
|
726
|
+
const menuConfig = `import type { MenuConfig } from "@lastbrain/ui";
|
|
727
|
+
|
|
728
|
+
export const menuConfig: MenuConfig = {
|
|
729
|
+
public: [
|
|
730
|
+
{ label: "Accueil", href: "/" },
|
|
731
|
+
{ label: "Documentation", href: "/docs" },
|
|
732
|
+
],
|
|
733
|
+
auth: [
|
|
734
|
+
{ label: "Dashboard", href: "/auth/dashboard" },
|
|
735
|
+
{ label: "Profil", href: "/auth/profile" },
|
|
736
|
+
],
|
|
737
|
+
admin: [
|
|
738
|
+
{ label: "Admin", href: "/admin" },
|
|
739
|
+
{ label: "Utilisateurs", href: "/admin/users" },
|
|
740
|
+
],
|
|
741
|
+
};
|
|
742
|
+
`;
|
|
743
|
+
await fs.writeFile(menuConfigPath, menuConfig);
|
|
744
|
+
console.log(chalk.green("✓ config/menu.ts créé"));
|
|
745
|
+
}
|
|
709
746
|
}
|
|
710
747
|
async function createGitIgnore(targetDir, force) {
|
|
711
748
|
const gitignorePath = path.join(targetDir, ".gitignore");
|
|
@@ -814,16 +851,34 @@ async function addScriptsToPackageJson(targetDir) {
|
|
|
814
851
|
console.log(chalk.yellow("\n🔧 Ajout des scripts NPM..."));
|
|
815
852
|
const pkgPath = path.join(targetDir, "package.json");
|
|
816
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
|
+
}
|
|
817
862
|
const scripts = {
|
|
818
863
|
dev: "next dev",
|
|
819
864
|
build: "next build",
|
|
820
865
|
start: "next start",
|
|
821
866
|
lint: "next lint",
|
|
822
|
-
lastbrain:
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
"
|
|
826
|
-
|
|
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",
|
|
827
882
|
};
|
|
828
883
|
pkg.scripts = { ...pkg.scripts, ...scripts };
|
|
829
884
|
await fs.writeJson(pkgPath, pkg, { spaces: 2 });
|