@lastbrain/app 0.1.46 → 0.1.47
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":"AAcA,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;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"init-app.d.ts","sourceRoot":"","sources":["../../src/scripts/init-app.ts"],"names":[],"mappings":"AAcA,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;IACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,cAAc,iBA+QpD"}
|
package/dist/scripts/init-app.js
CHANGED
|
@@ -86,6 +86,7 @@ export async function initApp(options) {
|
|
|
86
86
|
await createGitIgnore(targetDir, force);
|
|
87
87
|
await createEnvExample(targetDir, force);
|
|
88
88
|
await createEnvLocal(targetDir, force, isMonorepoProject);
|
|
89
|
+
await createEnvProd(targetDir, force);
|
|
89
90
|
// 7. Créer la structure Supabase avec migrations (seulement pour projets indépendants)
|
|
90
91
|
if (!isMonorepoProject) {
|
|
91
92
|
console.log(chalk.blue("🗄️ Création de la structure Supabase locale...\n"));
|
|
@@ -177,7 +178,7 @@ export async function initApp(options) {
|
|
|
177
178
|
console.log(chalk.white(" pnpm build:modules"));
|
|
178
179
|
console.log(chalk.white(" pnpm db:migrations:sync"));
|
|
179
180
|
console.log(chalk.white(" pnpm db:init"));
|
|
180
|
-
console.log(chalk.white(" pnpm dev\n"));
|
|
181
|
+
console.log(chalk.white(" pnpm dev:local (ou pnpm dev:prod)\n"));
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
184
|
else {
|
|
@@ -187,7 +188,11 @@ export async function initApp(options) {
|
|
|
187
188
|
console.log(chalk.white(" 3. pnpm build:modules (générer les routes des modules)"));
|
|
188
189
|
console.log(chalk.white(" 4. pnpm db:migrations:sync (synchroniser les migrations)"));
|
|
189
190
|
console.log(chalk.white(" 5. pnpm db:init (initialiser la base de données)"));
|
|
190
|
-
console.log(chalk.white(" 6. pnpm dev (
|
|
191
|
+
console.log(chalk.white(" 6. pnpm dev:local (ou pnpm dev:prod)\n"));
|
|
192
|
+
console.log(chalk.cyan("\n💡 Scripts disponibles:"));
|
|
193
|
+
console.log(chalk.white(" • pnpm dev:local - Lance avec .env.local"));
|
|
194
|
+
console.log(chalk.white(" • pnpm dev:prod - Lance avec .env.prod"));
|
|
195
|
+
console.log(chalk.white(" • pnpm dev - Lance avec .env actuel\n"));
|
|
191
196
|
console.log(chalk.gray("Prérequis pour Supabase :"));
|
|
192
197
|
console.log(chalk.white(" - Docker Desktop installé et lancé"));
|
|
193
198
|
console.log(chalk.white(" - Supabase CLI : brew install supabase/tap/supabase\n"));
|
|
@@ -375,6 +380,7 @@ async function addDependencies(targetDir, useHeroUI, withAuth, selectedModules =
|
|
|
375
380
|
requiredDeps["lucide-react"] = "^0.554.0";
|
|
376
381
|
requiredDeps["framer-motion"] = "^11.18.2";
|
|
377
382
|
requiredDeps["clsx"] = "^2.1.1";
|
|
383
|
+
requiredDeps["env-cmd"] = "^11.0.0";
|
|
378
384
|
}
|
|
379
385
|
// DevDependencies
|
|
380
386
|
const requiredDevDeps = {
|
|
@@ -1286,16 +1292,7 @@ tmp/
|
|
|
1286
1292
|
coverage/
|
|
1287
1293
|
*.lcov
|
|
1288
1294
|
|
|
1289
|
-
# Generated by module-build
|
|
1290
|
-
app/navigation.generated.ts
|
|
1291
|
-
app/routes.generated.ts
|
|
1292
|
-
app/menu.generated.ts
|
|
1293
1295
|
|
|
1294
|
-
# Generated app-shell overrides
|
|
1295
|
-
app/(public)/
|
|
1296
|
-
app/(auth)/
|
|
1297
|
-
app/(admin)/
|
|
1298
|
-
app/layout.tsx
|
|
1299
1296
|
`;
|
|
1300
1297
|
await fs.writeFile(gitignorePath, gitignoreContent);
|
|
1301
1298
|
}
|
|
@@ -1357,6 +1354,27 @@ OPENAI_API_KEY=sk-fake-openai-key-for-development-replace-with-real-key
|
|
|
1357
1354
|
console.log(chalk.green("✓ .env.local créé"));
|
|
1358
1355
|
}
|
|
1359
1356
|
}
|
|
1357
|
+
async function createEnvProd(targetDir, force) {
|
|
1358
|
+
const envProdPath = path.join(targetDir, ".env.prod");
|
|
1359
|
+
if (!fs.existsSync(envProdPath) || force) {
|
|
1360
|
+
console.log(chalk.yellow("\n🔐 Création de .env.prod..."));
|
|
1361
|
+
const envContent = `# Production Environment Configuration
|
|
1362
|
+
# Copy your production values here
|
|
1363
|
+
|
|
1364
|
+
# Supabase Production
|
|
1365
|
+
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
|
|
1366
|
+
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-prod-anon-key
|
|
1367
|
+
SUPABASE_SERVICE_ROLE_KEY=your-prod-service-role-key
|
|
1368
|
+
|
|
1369
|
+
# OpenAI Production
|
|
1370
|
+
OPENAI_API_KEY=sk-proj-your-prod-api-key
|
|
1371
|
+
|
|
1372
|
+
# Note: Update these values with your actual production credentials
|
|
1373
|
+
`;
|
|
1374
|
+
await fs.writeFile(envProdPath, envContent);
|
|
1375
|
+
console.log(chalk.green("✓ .env.prod créé"));
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1360
1378
|
async function createSupabaseStructure(targetDir, force) {
|
|
1361
1379
|
console.log(chalk.yellow("\n🗄️ Création de la structure Supabase..."));
|
|
1362
1380
|
const supabaseDir = path.join(targetDir, "supabase");
|
|
@@ -1402,6 +1420,8 @@ async function addScriptsToPackageJson(targetDir) {
|
|
|
1402
1420
|
? "pnpm --filter @lastbrain/core build && pnpm --filter @lastbrain/ui build && pnpm --filter @lastbrain/module-auth build && pnpm --filter @lastbrain/module-ai build"
|
|
1403
1421
|
: "echo 'No prebuild needed outside monorepo'",
|
|
1404
1422
|
dev: "next dev",
|
|
1423
|
+
"dev:local": "env-cmd -f .env.local next dev",
|
|
1424
|
+
"dev:prod": "env-cmd -f .env.prod next dev",
|
|
1405
1425
|
build: "next build",
|
|
1406
1426
|
start: "next start",
|
|
1407
1427
|
lint: "next lint",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lastbrain/app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.47",
|
|
4
4
|
"description": "Framework modulaire Next.js avec CLI et système de modules",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"inquirer": "^13.0.1",
|
|
44
44
|
"lucide-react": "^0.554.0",
|
|
45
45
|
"next-themes": "^0.4.6",
|
|
46
|
-
"react": "^19.
|
|
47
|
-
"react-dom": "^19.
|
|
46
|
+
"react": "^19.2.1",
|
|
47
|
+
"react-dom": "^19.2.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"next": ">=15.0.0"
|
package/src/scripts/init-app.ts
CHANGED
|
@@ -131,6 +131,7 @@ export async function initApp(options: InitAppOptions) {
|
|
|
131
131
|
await createGitIgnore(targetDir, force);
|
|
132
132
|
await createEnvExample(targetDir, force);
|
|
133
133
|
await createEnvLocal(targetDir, force, isMonorepoProject);
|
|
134
|
+
await createEnvProd(targetDir, force);
|
|
134
135
|
|
|
135
136
|
// 7. Créer la structure Supabase avec migrations (seulement pour projets indépendants)
|
|
136
137
|
if (!isMonorepoProject) {
|
|
@@ -260,7 +261,7 @@ export async function initApp(options: InitAppOptions) {
|
|
|
260
261
|
console.log(chalk.white(" pnpm build:modules"));
|
|
261
262
|
console.log(chalk.white(" pnpm db:migrations:sync"));
|
|
262
263
|
console.log(chalk.white(" pnpm db:init"));
|
|
263
|
-
console.log(chalk.white(" pnpm dev\n"));
|
|
264
|
+
console.log(chalk.white(" pnpm dev:local (ou pnpm dev:prod)\n"));
|
|
264
265
|
}
|
|
265
266
|
} else {
|
|
266
267
|
console.log(chalk.cyan("\n📋 Prochaines étapes:"));
|
|
@@ -275,7 +276,12 @@ export async function initApp(options: InitAppOptions) {
|
|
|
275
276
|
console.log(
|
|
276
277
|
chalk.white(" 5. pnpm db:init (initialiser la base de données)")
|
|
277
278
|
);
|
|
278
|
-
console.log(chalk.white(" 6. pnpm dev (
|
|
279
|
+
console.log(chalk.white(" 6. pnpm dev:local (ou pnpm dev:prod)\n"));
|
|
280
|
+
|
|
281
|
+
console.log(chalk.cyan("\n💡 Scripts disponibles:"));
|
|
282
|
+
console.log(chalk.white(" • pnpm dev:local - Lance avec .env.local"));
|
|
283
|
+
console.log(chalk.white(" • pnpm dev:prod - Lance avec .env.prod"));
|
|
284
|
+
console.log(chalk.white(" • pnpm dev - Lance avec .env actuel\n"));
|
|
279
285
|
|
|
280
286
|
console.log(chalk.gray("Prérequis pour Supabase :"));
|
|
281
287
|
console.log(chalk.white(" - Docker Desktop installé et lancé"));
|
|
@@ -514,6 +520,7 @@ async function addDependencies(
|
|
|
514
520
|
requiredDeps["lucide-react"] = "^0.554.0";
|
|
515
521
|
requiredDeps["framer-motion"] = "^11.18.2";
|
|
516
522
|
requiredDeps["clsx"] = "^2.1.1";
|
|
523
|
+
requiredDeps["env-cmd"] = "^11.0.0";
|
|
517
524
|
}
|
|
518
525
|
|
|
519
526
|
// DevDependencies
|
|
@@ -1521,16 +1528,7 @@ tmp/
|
|
|
1521
1528
|
coverage/
|
|
1522
1529
|
*.lcov
|
|
1523
1530
|
|
|
1524
|
-
# Generated by module-build
|
|
1525
|
-
app/navigation.generated.ts
|
|
1526
|
-
app/routes.generated.ts
|
|
1527
|
-
app/menu.generated.ts
|
|
1528
1531
|
|
|
1529
|
-
# Generated app-shell overrides
|
|
1530
|
-
app/(public)/
|
|
1531
|
-
app/(auth)/
|
|
1532
|
-
app/(admin)/
|
|
1533
|
-
app/layout.tsx
|
|
1534
1532
|
`;
|
|
1535
1533
|
await fs.writeFile(gitignorePath, gitignoreContent);
|
|
1536
1534
|
}
|
|
@@ -1604,6 +1602,30 @@ OPENAI_API_KEY=sk-fake-openai-key-for-development-replace-with-real-key
|
|
|
1604
1602
|
}
|
|
1605
1603
|
}
|
|
1606
1604
|
|
|
1605
|
+
async function createEnvProd(targetDir: string, force: boolean) {
|
|
1606
|
+
const envProdPath = path.join(targetDir, ".env.prod");
|
|
1607
|
+
|
|
1608
|
+
if (!fs.existsSync(envProdPath) || force) {
|
|
1609
|
+
console.log(chalk.yellow("\n🔐 Création de .env.prod..."));
|
|
1610
|
+
|
|
1611
|
+
const envContent = `# Production Environment Configuration
|
|
1612
|
+
# Copy your production values here
|
|
1613
|
+
|
|
1614
|
+
# Supabase Production
|
|
1615
|
+
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
|
|
1616
|
+
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-prod-anon-key
|
|
1617
|
+
SUPABASE_SERVICE_ROLE_KEY=your-prod-service-role-key
|
|
1618
|
+
|
|
1619
|
+
# OpenAI Production
|
|
1620
|
+
OPENAI_API_KEY=sk-proj-your-prod-api-key
|
|
1621
|
+
|
|
1622
|
+
# Note: Update these values with your actual production credentials
|
|
1623
|
+
`;
|
|
1624
|
+
await fs.writeFile(envProdPath, envContent);
|
|
1625
|
+
console.log(chalk.green("✓ .env.prod créé"));
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1607
1629
|
async function createSupabaseStructure(targetDir: string, force: boolean) {
|
|
1608
1630
|
console.log(chalk.yellow("\n🗄️ Création de la structure Supabase..."));
|
|
1609
1631
|
|
|
@@ -1684,6 +1706,8 @@ async function addScriptsToPackageJson(targetDir: string) {
|
|
|
1684
1706
|
? "pnpm --filter @lastbrain/core build && pnpm --filter @lastbrain/ui build && pnpm --filter @lastbrain/module-auth build && pnpm --filter @lastbrain/module-ai build"
|
|
1685
1707
|
: "echo 'No prebuild needed outside monorepo'",
|
|
1686
1708
|
dev: "next dev",
|
|
1709
|
+
"dev:local": "env-cmd -f .env.local next dev",
|
|
1710
|
+
"dev:prod": "env-cmd -f .env.prod next dev",
|
|
1687
1711
|
build: "next build",
|
|
1688
1712
|
start: "next start",
|
|
1689
1713
|
lint: "next lint",
|