@meridianjs/framework 0.1.3 → 0.1.4

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/index.d.ts CHANGED
@@ -25,15 +25,14 @@ interface MeridianApp {
25
25
  * 1. Load meridian.config.ts
26
26
  * 2. Create global DI container
27
27
  * 3. Register core primitives (logger, config)
28
- * 4. Register infrastructure modules (event bus, scheduler)
29
- * 5. Load domain modules from config.modules[]
30
- * 6. Load plugins from config.plugins[]
31
- * 7. Load module links from src/links/
32
- * 8. Create Express server
33
- * 9. Apply middlewares from src/api/middlewares.ts
34
- * 10. Load file-based API routes from src/api/
35
- * 11. Load subscribers from src/subscribers/
36
- * 12. Load scheduled jobs from src/jobs/
28
+ * 4. Load modules from config.modules[]
29
+ * 5. Create Express server (registered before plugins so they can add routes)
30
+ * 6. Apply middlewares from src/api/middlewares.ts
31
+ * 7. Load plugins from config.plugins[]
32
+ * 8. Load module links from src/links/
33
+ * 9. Load file-based API routes from src/api/
34
+ * 10. Load subscribers from src/subscribers/
35
+ * 11. Load scheduled jobs from src/jobs/
37
36
  */
38
37
  declare function bootstrap(opts: BootstrapOptions): Promise<MeridianApp>;
39
38
 
package/dist/index.js CHANGED
@@ -241,6 +241,7 @@ async function loadSubscribers(container, subscribersDir) {
241
241
  const eventBus = container.resolve("eventBus");
242
242
  const files = await fs2.readdir(subscribersDir);
243
243
  for (const file of files) {
244
+ if (/\.d\.(ts|mts)$/.test(file)) continue;
244
245
  if (!/\.(ts|mts|js|mjs|cjs)$/.test(file)) continue;
245
246
  const fullPath = path4.join(subscribersDir, file);
246
247
  let mod;
@@ -292,6 +293,7 @@ async function loadJobs(container, jobsDir) {
292
293
  }
293
294
  const files = await fs3.readdir(jobsDir);
294
295
  for (const file of files) {
296
+ if (/\.d\.(ts|mts)$/.test(file)) continue;
295
297
  if (!/\.(ts|mts|js|mjs|cjs)$/.test(file)) continue;
296
298
  const fullPath = path5.join(jobsDir, file);
297
299
  let mod;
@@ -332,6 +334,7 @@ async function loadLinks(container, linksDir) {
332
334
  }
333
335
  const files = await fs4.readdir(linksDir);
334
336
  for (const file of files) {
337
+ if (/\.d\.(ts|mts)$/.test(file)) continue;
335
338
  if (!/\.(ts|mts|js|mjs|cjs)$/.test(file)) continue;
336
339
  const fullPath = path6.join(linksDir, file);
337
340
  let mod;
@@ -464,16 +467,17 @@ async function autoScanPlugin(scanRoot, container, logger) {
464
467
  const apiDir = path7.join(candidate, "api");
465
468
  try {
466
469
  await fs5.access(apiDir);
467
- await Promise.all([
468
- server ? loadRoutes(server, container, apiDir) : Promise.resolve(),
469
- loadSubscribers(container, path7.join(candidate, "subscribers")),
470
- loadJobs(container, path7.join(candidate, "jobs")),
471
- loadLinks(container, path7.join(candidate, "links"))
472
- ]);
473
- logger.debug(`Plugin auto-scanned from: ${candidate}`);
474
- return;
475
470
  } catch {
471
+ continue;
476
472
  }
473
+ await Promise.all([
474
+ server ? loadRoutes(server, container, apiDir) : Promise.resolve(),
475
+ loadSubscribers(container, path7.join(candidate, "subscribers")),
476
+ loadJobs(container, path7.join(candidate, "jobs")),
477
+ loadLinks(container, path7.join(candidate, "links"))
478
+ ]);
479
+ logger.debug(`Plugin auto-scanned from: ${candidate}`);
480
+ return;
477
481
  }
478
482
  logger.debug(`No api/ directory found for plugin scan root: ${scanRoot}`);
479
483
  }
@@ -622,11 +626,11 @@ async function bootstrap(opts) {
622
626
  };
623
627
  container.register({ eventBus });
624
628
  }
625
- await loadPlugins(container, config.plugins ?? [], rootDir);
626
- await loadLinks(container, path8.join(rootDir, "src", "links"));
627
629
  const server = createServer(container, config);
628
630
  container.register({ server });
629
631
  await loadMiddlewares(server, container, path8.join(rootDir, "src", "api"));
632
+ await loadPlugins(container, config.plugins ?? [], rootDir);
633
+ await loadLinks(container, path8.join(rootDir, "src", "links"));
630
634
  await loadRoutes(server, container, path8.join(rootDir, "src", "api"));
631
635
  await loadSubscribers(container, path8.join(rootDir, "src", "subscribers"));
632
636
  await loadJobs(container, path8.join(rootDir, "src", "jobs"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meridianjs/framework",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Core Meridian framework: bootstrap, DI container, module/route/subscriber/job loaders",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",