@hasna/microservices 0.0.29 → 0.0.31

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/bin/index.js CHANGED
@@ -3067,7 +3067,7 @@ var {
3067
3067
  } = import__.default;
3068
3068
 
3069
3069
  // src/lib/installer.ts
3070
- import { execFileSync, execSync } from "child_process";
3070
+ import { execFileSync } from "child_process";
3071
3071
  import { accessSync, constants } from "fs";
3072
3072
  import { join as join2 } from "path";
3073
3073
 
@@ -3551,7 +3551,7 @@ function installMicroservice(name, options = {}) {
3551
3551
  return { microservice: name, success: true, version: version ?? undefined };
3552
3552
  }
3553
3553
  try {
3554
- execSync(`bun install -g ${meta.package}`, { stdio: "pipe" });
3554
+ execFileSync("bun", ["install", "-g", meta.package], { stdio: "pipe" });
3555
3555
  const version = getMicroserviceVersion(name);
3556
3556
  return { microservice: name, success: true, version: version ?? undefined };
3557
3557
  } catch (error) {
@@ -3570,7 +3570,7 @@ function removeMicroservice(name) {
3570
3570
  if (!meta)
3571
3571
  return false;
3572
3572
  try {
3573
- execSync(`bun remove -g ${meta.package}`, { stdio: "pipe" });
3573
+ execFileSync("bun", ["remove", "-g", meta.package], { stdio: "pipe" });
3574
3574
  return true;
3575
3575
  } catch {
3576
3576
  return false;
package/bin/mcp.js CHANGED
@@ -19477,7 +19477,7 @@ class StdioServerTransport {
19477
19477
  }
19478
19478
 
19479
19479
  // src/lib/installer.ts
19480
- import { execFileSync, execSync } from "child_process";
19480
+ import { execFileSync } from "child_process";
19481
19481
  import { accessSync, constants } from "fs";
19482
19482
  import { join } from "path";
19483
19483
 
@@ -19961,7 +19961,7 @@ function installMicroservice(name, options = {}) {
19961
19961
  return { microservice: name, success: true, version: version2 ?? undefined };
19962
19962
  }
19963
19963
  try {
19964
- execSync(`bun install -g ${meta.package}`, { stdio: "pipe" });
19964
+ execFileSync("bun", ["install", "-g", meta.package], { stdio: "pipe" });
19965
19965
  const version2 = getMicroserviceVersion(name);
19966
19966
  return { microservice: name, success: true, version: version2 ?? undefined };
19967
19967
  } catch (error2) {
@@ -19977,7 +19977,7 @@ function removeMicroservice(name) {
19977
19977
  if (!meta)
19978
19978
  return false;
19979
19979
  try {
19980
- execSync(`bun remove -g ${meta.package}`, { stdio: "pipe" });
19980
+ execFileSync("bun", ["remove", "-g", meta.package], { stdio: "pipe" });
19981
19981
  return true;
19982
19982
  } catch {
19983
19983
  return false;
@@ -21304,7 +21304,7 @@ Microservices MCP server (stdio transport by default)
21304
21304
 
21305
21305
  Options:
21306
21306
  --http Serve MCP over Streamable HTTP (127.0.0.1)
21307
- --port <number> HTTP port (default: 8825, env: MCP_HTTP_PORT)
21307
+ --port <number> HTTP port (default: ${DEFAULT_MCP_HTTP_PORT}, env: MCP_HTTP_PORT)
21308
21308
  -h, --help Show help
21309
21309
  -V, --version Show version
21310
21310
  `);
@@ -21735,7 +21735,12 @@ async function main() {
21735
21735
  handle.close().finally(() => process.exit(0));
21736
21736
  });
21737
21737
  }
21738
- main().catch(console.error);
21738
+ if (import.meta.main) {
21739
+ main().catch((error2) => {
21740
+ console.error(error2);
21741
+ process.exitCode = 1;
21742
+ });
21743
+ }
21739
21744
  export {
21740
21745
  buildServer
21741
21746
  };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @bun
2
2
  // src/lib/installer.ts
3
- import { execFileSync, execSync } from "child_process";
3
+ import { execFileSync } from "child_process";
4
4
  import { accessSync, constants } from "fs";
5
5
  import { join } from "path";
6
6
 
@@ -498,7 +498,7 @@ function installMicroservice(name, options = {}) {
498
498
  return { microservice: name, success: true, version: version ?? undefined };
499
499
  }
500
500
  try {
501
- execSync(`bun install -g ${meta.package}`, { stdio: "pipe" });
501
+ execFileSync("bun", ["install", "-g", meta.package], { stdio: "pipe" });
502
502
  const version = getMicroserviceVersion(name);
503
503
  return { microservice: name, success: true, version: version ?? undefined };
504
504
  } catch (error) {
@@ -520,7 +520,7 @@ function removeMicroservice(name) {
520
520
  if (!meta)
521
521
  return false;
522
522
  try {
523
- execSync(`bun remove -g ${meta.package}`, { stdio: "pipe" });
523
+ execFileSync("bun", ["remove", "-g", meta.package], { stdio: "pipe" });
524
524
  return true;
525
525
  } catch {
526
526
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/microservices",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "description": "21 production-grade microservice building blocks for AI-native SaaS — auth, billing, LLM gateway, agent registry, RAG, guardrails, tracing, and more. Each with PostgreSQL, HTTP API, MCP server, and CLI.",
5
5
  "type": "module",
6
6
  "bin": {