miqro 6.2.2 → 6.2.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.
@@ -20,7 +20,7 @@ export async function setupLogConfig(logger: Logger, servicePath: string, servic
20
20
  logConfigMap[service] = logConfig;
21
21
 
22
22
  if (inflateDir) {
23
- const inflatePath = resolve(inflateDir, service, "log.js");
23
+ const inflatePath = resolve(inflateDir, service, "log.cjs");
24
24
  mkdirSync(dirname(inflatePath), {
25
25
  recursive: true
26
26
  });
@@ -29,6 +29,7 @@ export async function setupLogConfig(logger: Logger, servicePath: string, servic
29
29
  embemedJSX: false,
30
30
  minify: false,
31
31
  useExport: true,
32
+ platform: "node",
32
33
  logger
33
34
  }));
34
35
  }
@@ -19,7 +19,7 @@ export async function setupMiddleware(logger: Logger, servicePath: string, servi
19
19
  }
20
20
  }
21
21
  if (inflateDir && inflateSea) {
22
- const inflatePath = resolve(inflateDir, service, "middleware.js");
22
+ const inflatePath = resolve(inflateDir, service, "middleware.cjs");
23
23
  mkdirSync(dirname(inflatePath), {
24
24
  recursive: true
25
25
  });
@@ -27,6 +27,7 @@ export async function setupMiddleware(logger: Logger, servicePath: string, servi
27
27
  writeFileSync(inflatePath, await inflateJSX(middlewarePath, {
28
28
  embemedJSX: false,
29
29
  minify: false,
30
+ platform: "node",
30
31
  useExport: true,
31
32
  logger
32
33
  }));
@@ -23,7 +23,7 @@ export async function setupServerConfig(logger: Logger, servicePath: string, ser
23
23
 
24
24
 
25
25
  if (inflateDir) {
26
- const inflatePath = resolve(inflateDir, service, "server.js");
26
+ const inflatePath = resolve(inflateDir, service, "server.cjs");
27
27
  mkdirSync(dirname(inflatePath), {
28
28
  recursive: true
29
29
  });
@@ -31,6 +31,7 @@ export async function setupServerConfig(logger: Logger, servicePath: string, ser
31
31
  writeFileSync(inflatePath, await inflateJSX(serverPath, {
32
32
  embemedJSX: false,
33
33
  minify: false,
34
+ platform: "node",
34
35
  useExport: true,
35
36
  logger
36
37
  }));
@@ -23,7 +23,7 @@ export async function inflateWSConfig(logger: Logger, servicePath: string, servi
23
23
  }
24
24
 
25
25
  if (inflateDir) {
26
- const inflatePath = resolve(inflateDir, service, "ws.js");
26
+ const inflatePath = resolve(inflateDir, service, "ws.cjs");
27
27
  mkdirSync(dirname(inflatePath), {
28
28
  recursive: true
29
29
  });
@@ -31,6 +31,7 @@ export async function inflateWSConfig(logger: Logger, servicePath: string, servi
31
31
  writeFileSync(inflatePath, await inflateJSX(wsPath, {
32
32
  embemedJSX: false,
33
33
  minify: false,
34
+ platform: "node",
34
35
  useExport: true,
35
36
  logger
36
37
  }));
@@ -366,6 +366,7 @@ export class Miqro {
366
366
  services: this.options.services,
367
367
  serverInterface: this.serverInterface,
368
368
  //dbManager: this.dbManager,
369
+ port: this.options.port,
369
370
  inflateDir: options?.inflateDir,
370
371
  inflateSea: options?.inflateSea ? true : false,
371
372
  //inflateTests: options?.inflateTests ? true : false,
@@ -456,7 +457,7 @@ export class Miqro {
456
457
  await notifiyServerConfig(this.logger, this.serverInterface, this.adminInterface, this.inflated.serverConfigMap, "load");
457
458
 
458
459
  if (this.logger && (cluster.isPrimary || process.env["CLUSTER_NODE_NUMBER"] === "0")) {
459
- this.logger?.debug("\t\t==http routes==");
460
+ /*this.logger?.debug("\t\t==http routes==");
460
461
  this.server.logPaths({
461
462
  debug: this.logger.debug.bind(this.logger),
462
463
  error: this.logger.error.bind(this.logger),
@@ -464,7 +465,9 @@ export class Miqro {
464
465
  log: this.logger.debug.bind(this.logger),
465
466
  trace: this.logger.trace.bind(this.logger),
466
467
  warn: this.logger.warn.bind(this.logger)
467
- });
468
+ });*/
469
+ this.logger?.info("\t\t==http routes==");
470
+ this.server.logPaths(this.logger);
468
471
  }
469
472
 
470
473
  this.logger?.trace("calling listen on [%s]", this.options.port);
@@ -599,15 +602,16 @@ export class Miqro {
599
602
  await notifiyServerConfig(this.logger, this.serverInterface, this.adminInterface, this.inflated.serverConfigMap, "load");
600
603
 
601
604
  if (this.logger && (cluster.isPrimary || process.env["CLUSTER_NODE_NUMBER"] === "0")) {
602
- this.logger?.debug("\t\t==http routes==");
603
- this.server.logPaths({
605
+ this.logger?.info("\t\t==http routes==");
606
+ this.server.logPaths(this.logger);
607
+ /*this.server.logPaths({
604
608
  debug: this.logger.debug.bind(this.logger),
605
609
  error: this.logger.error.bind(this.logger),
606
610
  info: this.logger.debug.bind(this.logger),
607
611
  log: this.logger.debug.bind(this.logger),
608
612
  trace: this.logger.trace.bind(this.logger),
609
613
  warn: this.logger.warn.bind(this.logger)
610
- });
614
+ });*/
611
615
  }
612
616
 
613
617
  //this.logger?.log("=====================");
@@ -19,7 +19,7 @@ export async function runMigrations(logger: Logger | undefined, db: Database | n
19
19
 
20
20
  if (inflateDir) {
21
21
  for (const migration of serviceMigrations) {
22
- const inflatePath = resolve(inflateDir, service, "migration", migration.substring(0, migration.length - extname(migration).length) + ".js");
22
+ const inflatePath = resolve(inflateDir, service, "migration", migration.substring(0, migration.length - extname(migration).length) + ".cjs");
23
23
  mkdirSync(dirname(inflatePath), {
24
24
  recursive: true
25
25
  });
@@ -28,6 +28,7 @@ export async function runMigrations(logger: Logger | undefined, db: Database | n
28
28
  embemedJSX: false,
29
29
  minify: false,
30
30
  useExport: true,
31
+ platform: "node",
31
32
  logger
32
33
  }));
33
34
  }
@@ -48,13 +49,14 @@ export async function runMigrationsDown(logger: Logger | Console | undefined, db
48
49
 
49
50
  if (inflateDir) {
50
51
  for (const migration of serviceMigrations) {
51
- const inflatePath = resolve(inflateDir, service, "migration", migration.substring(0, migration.length - extname(migration).length) + ".js");
52
+ const inflatePath = resolve(inflateDir, service, "migration", migration.substring(0, migration.length - extname(migration).length) + ".cjs");
52
53
  mkdirSync(dirname(inflatePath), {
53
54
  recursive: true
54
55
  });
55
56
  logger?.log("writing [%s]", relative(cwd(), inflatePath));
56
57
  writeFileSync(inflatePath, await inflateJSX(resolve(migrationsFolderPath, migration), {
57
58
  embemedJSX: false,
59
+ platform: "node",
58
60
  minify: false,
59
61
  useExport: true,
60
62
  logger