@lastbrain/app 0.1.3 → 0.1.5
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`));
|
|
@@ -142,8 +153,10 @@ async function addDependencies(targetDir, useHeroUI, withAuth, selectedModules =
|
|
|
142
153
|
const pkg = await fs.readJson(pkgPath);
|
|
143
154
|
console.log(chalk.yellow("\n📦 Configuration des dépendances..."));
|
|
144
155
|
// Détecter si on est dans le monorepo (développement local)
|
|
145
|
-
|
|
146
|
-
const
|
|
156
|
+
// Vérifier si le projet cible est à l'intérieur du monorepo
|
|
157
|
+
const targetIsInMonorepo = fs.existsSync(path.join(targetDir, "../../../packages/core/package.json")) ||
|
|
158
|
+
fs.existsSync(path.join(targetDir, "../../packages/core/package.json"));
|
|
159
|
+
const latestVersion = targetIsInMonorepo ? "workspace:*" : "latest";
|
|
147
160
|
// Dependencies
|
|
148
161
|
const requiredDeps = {
|
|
149
162
|
next: "^15.0.3",
|
|
@@ -229,6 +242,7 @@ async function addDependencies(targetDir, useHeroUI, withAuth, selectedModules =
|
|
|
229
242
|
const requiredDevDeps = {
|
|
230
243
|
"@tailwindcss/postcss": "^4.0.0",
|
|
231
244
|
tailwindcss: "^4.0.0",
|
|
245
|
+
autoprefixer: "^10.4.20",
|
|
232
246
|
typescript: "^5.4.0",
|
|
233
247
|
"@types/node": "^20.0.0",
|
|
234
248
|
"@types/react": "^18.3.0",
|
|
@@ -704,6 +718,31 @@ export default config;
|
|
|
704
718
|
await fs.writeJson(tsconfigPath, tsconfig, { spaces: 2 });
|
|
705
719
|
console.log(chalk.green("✓ tsconfig.json créé"));
|
|
706
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
|
+
}
|
|
707
746
|
}
|
|
708
747
|
async function createGitIgnore(targetDir, force) {
|
|
709
748
|
const gitignorePath = path.join(targetDir, ".gitignore");
|
|
@@ -818,10 +857,10 @@ async function addScriptsToPackageJson(targetDir) {
|
|
|
818
857
|
start: "next start",
|
|
819
858
|
lint: "next lint",
|
|
820
859
|
lastbrain: "node node_modules/@lastbrain/app/dist/cli.js",
|
|
821
|
-
"build:modules": "
|
|
822
|
-
"db:migrations:sync": "
|
|
823
|
-
"db:init": "
|
|
824
|
-
"readme:create": "
|
|
860
|
+
"build:modules": "node node_modules/@lastbrain/app/dist/scripts/module-build.js",
|
|
861
|
+
"db:migrations:sync": "node node_modules/@lastbrain/app/dist/scripts/db-migrations-sync.js",
|
|
862
|
+
"db:init": "node node_modules/@lastbrain/app/dist/scripts/db-init.js",
|
|
863
|
+
"readme:create": "node node_modules/@lastbrain/app/dist/scripts/readme-build.js",
|
|
825
864
|
};
|
|
826
865
|
pkg.scripts = { ...pkg.scripts, ...scripts };
|
|
827
866
|
await fs.writeJson(pkgPath, pkg, { spaces: 2 });
|