@mostajs/setup 2.1.17 → 2.1.18

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.
Files changed (2) hide show
  1. package/dist/lib/setup.js +14 -0
  2. package/package.json +1 -1
package/dist/lib/setup.js CHANGED
@@ -302,6 +302,20 @@ async function runNetInstall(installConfig, setupConfig) {
302
302
  seeded.push(seedDef.key);
303
303
  }
304
304
  }
305
+ // 6. Run code-based optionalSeeds (e.g. demoAccess: resolve slugs, create accesses)
306
+ if (setupConfig.optionalSeeds && installConfig.seed) {
307
+ for (const seedDef of setupConfig.optionalSeeds) {
308
+ if (installConfig.seed[seedDef.key]) {
309
+ try {
310
+ await seedDef.run({});
311
+ seeded.push(seedDef.key);
312
+ }
313
+ catch (e) {
314
+ console.error(`[Setup NET] optionalSeed "${seedDef.key}" failed:`, e);
315
+ }
316
+ }
317
+ }
318
+ }
305
319
  // Écrire .env.local en DERNIER (après tout le seed)
306
320
  // pour éviter le hot-reload Next.js pendant le seed
307
321
  await writeEnvLocal({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mostajs/setup",
3
- "version": "2.1.17",
3
+ "version": "2.1.18",
4
4
  "description": "Reusable setup wizard module — multi-dialect DB configuration, .env.local writer, seed runner",
5
5
  "author": "Dr Hamid MADANI <drmdh@msn.com>",
6
6
  "license": "MIT",