@soapjs/cli 1.0.0 → 1.0.1

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 (54) hide show
  1. package/README.md +3 -0
  2. package/build/cli.js +2 -3
  3. package/build/commands/add/add.command.js +1 -2
  4. package/build/commands/add/command-plan.js +7 -8
  5. package/build/commands/add/entity-plan.js +1 -2
  6. package/build/commands/add/event-plan.js +1 -2
  7. package/build/commands/add/query-plan.js +6 -7
  8. package/build/commands/add/repository-plan.js +5 -6
  9. package/build/commands/add/resource-plan.js +16 -17
  10. package/build/commands/add/route-plan.js +7 -7
  11. package/build/commands/add/socket-plan.js +1 -2
  12. package/build/commands/add/use-case-plan.js +2 -3
  13. package/build/commands/check/check.command.js +1 -2
  14. package/build/commands/create/create.command.js +2 -3
  15. package/build/commands/create/project-plan.js +256 -216
  16. package/build/commands/doctor/doctor.command.js +1 -2
  17. package/build/commands/generate/bruno-analysis.js +4 -5
  18. package/build/commands/generate/bruno-plan.js +1 -2
  19. package/build/commands/generate/generate.command.js +1 -2
  20. package/build/commands/info/info.command.js +1 -2
  21. package/build/commands/remove/remove.command.js +1 -2
  22. package/build/commands/shared/common-options.js +3 -4
  23. package/build/commands/update/update.command.js +1 -2
  24. package/build/config/auth-policy.js +3 -4
  25. package/build/config/find-soap-root.js +1 -2
  26. package/build/config/load-soap-config.js +1 -2
  27. package/build/config/schemas/types.d.ts +1 -1
  28. package/build/config/schemas/validation.js +5 -6
  29. package/build/config/write-soap-config.js +1 -2
  30. package/build/core/command-context.js +2 -3
  31. package/build/core/errors.js +2 -2
  32. package/build/core/output.js +1 -2
  33. package/build/core/result.js +2 -3
  34. package/build/dependencies/dependency-resolver.js +5 -8
  35. package/build/dependencies/package-manager.js +3 -4
  36. package/build/io/conflict-policy.js +3 -4
  37. package/build/io/file-writer.js +1 -2
  38. package/build/io/format-file.js +1 -2
  39. package/build/presets/create-presets.js +3 -3
  40. package/build/prompts/add-resource.prompt.js +1 -2
  41. package/build/prompts/add-route.prompt.js +1 -2
  42. package/build/prompts/create-project.prompt.js +3 -2
  43. package/build/prompts/generate-bruno.prompt.js +1 -2
  44. package/build/prompts/inquirer-prompt-adapter.js +14 -5
  45. package/build/registry/registry.service.js +5 -6
  46. package/build/summary/create-summary.js +1 -2
  47. package/build/templates/naming.js +2 -3
  48. package/build/templates/template-engine.js +1 -2
  49. package/build/templates/template-resolver.js +2 -3
  50. package/build/terminal/terminal-capabilities.js +2 -3
  51. package/docs/cli/create.md +4 -1
  52. package/docs/guides/auth.md +9 -1
  53. package/docs/guides/index.md +1 -0
  54. package/package.json +3 -3
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.registerDoctorCommand = void 0;
6
+ exports.registerDoctorCommand = registerDoctorCommand;
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const command_context_1 = require("../../core/command-context");
@@ -35,4 +35,3 @@ function registerDoctorCommand(program) {
35
35
  }
36
36
  });
37
37
  }
38
- exports.registerDoctorCommand = registerDoctorCommand;
@@ -3,7 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.selectUnmodifiedBrunoFiles = exports.selectMissingBrunoFiles = exports.formatBrunoGenerationAnalysis = exports.analyzeBrunoFiles = void 0;
6
+ exports.analyzeBrunoFiles = analyzeBrunoFiles;
7
+ exports.formatBrunoGenerationAnalysis = formatBrunoGenerationAnalysis;
8
+ exports.selectMissingBrunoFiles = selectMissingBrunoFiles;
9
+ exports.selectUnmodifiedBrunoFiles = selectUnmodifiedBrunoFiles;
7
10
  const path_1 = __importDefault(require("path"));
8
11
  const registry_service_1 = require("../../registry/registry.service");
9
12
  async function analyzeBrunoFiles(config, files) {
@@ -16,7 +19,6 @@ async function analyzeBrunoFiles(config, files) {
16
19
  modifiedCount: analyzedFiles.filter((entry) => entry.modified).length,
17
20
  };
18
21
  }
19
- exports.analyzeBrunoFiles = analyzeBrunoFiles;
20
22
  function formatBrunoGenerationAnalysis(analysis) {
21
23
  return [
22
24
  `Detected routes: ${analysis.routeCount}`,
@@ -25,19 +27,16 @@ function formatBrunoGenerationAnalysis(analysis) {
25
27
  `Modified generated Bruno files: ${analysis.modifiedCount}`,
26
28
  ].join("\n");
27
29
  }
28
- exports.formatBrunoGenerationAnalysis = formatBrunoGenerationAnalysis;
29
30
  function selectMissingBrunoFiles(analysis) {
30
31
  return analysis.files
31
32
  .filter((entry) => !entry.exists)
32
33
  .map((entry) => entry.file);
33
34
  }
34
- exports.selectMissingBrunoFiles = selectMissingBrunoFiles;
35
35
  function selectUnmodifiedBrunoFiles(analysis) {
36
36
  return analysis.files
37
37
  .filter((entry) => !entry.modified)
38
38
  .map((entry) => entry.file);
39
39
  }
40
- exports.selectUnmodifiedBrunoFiles = selectUnmodifiedBrunoFiles;
41
40
  async function analyzeBrunoFile(config, file) {
42
41
  const targetPath = path_1.default.join(config.root, file.path);
43
42
  const currentHash = await (0, registry_service_1.readFileHash)(targetPath);
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createBrunoFiles = void 0;
6
+ exports.createBrunoFiles = createBrunoFiles;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const naming_1 = require("../../templates/naming");
9
9
  function createBrunoFiles(config, options = {}) {
@@ -94,7 +94,6 @@ function createBrunoFiles(config, options = {}) {
94
94
  }
95
95
  return files;
96
96
  }
97
- exports.createBrunoFiles = createBrunoFiles;
98
97
  function compareRoutes(left, right) {
99
98
  const rank = new Map([
100
99
  ["list", 0],
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.registerGenerateCommand = void 0;
6
+ exports.registerGenerateCommand = registerGenerateCommand;
7
7
  const promises_1 = __importDefault(require("fs/promises"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const command_context_1 = require("../../core/command-context");
@@ -97,7 +97,6 @@ function registerGenerateCommand(program) {
97
97
  context.output.info(content);
98
98
  });
99
99
  }
100
- exports.registerGenerateCommand = registerGenerateCommand;
101
100
  function isCliOption(command, name) {
102
101
  return command.getOptionValueSource(name) === "cli";
103
102
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerInfoCommand = void 0;
3
+ exports.registerInfoCommand = registerInfoCommand;
4
4
  const command_context_1 = require("../../core/command-context");
5
5
  const load_soap_config_1 = require("../../config/load-soap-config");
6
6
  function registerInfoCommand(program) {
@@ -23,4 +23,3 @@ function registerInfoCommand(program) {
23
23
  context.output.info(`Generated files: ${config.registry.generatedFiles.length}`);
24
24
  });
25
25
  }
26
- exports.registerInfoCommand = registerInfoCommand;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.registerRemoveCommand = void 0;
6
+ exports.registerRemoveCommand = registerRemoveCommand;
7
7
  const promises_1 = __importDefault(require("fs/promises"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const load_soap_config_1 = require("../../config/load-soap-config");
@@ -112,7 +112,6 @@ function registerRemoveCommand(program) {
112
112
  reportRemoveResult(context, `Removed resource ${resource.name}`, removePlan);
113
113
  });
114
114
  }
115
- exports.registerRemoveCommand = registerRemoveCommand;
116
115
  function resolveResource(config, input) {
117
116
  const names = (0, naming_1.createNameVariants)(input);
118
117
  const candidates = new Set([input, names.kebabName, singularize(names.kebabName), names.pluralName]);
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.assertInteractiveTerminal = exports.addConflictOption = exports.addInteractiveOption = void 0;
3
+ exports.addInteractiveOption = addInteractiveOption;
4
+ exports.addConflictOption = addConflictOption;
5
+ exports.assertInteractiveTerminal = assertInteractiveTerminal;
4
6
  const errors_1 = require("../../core/errors");
5
7
  const conflict_policy_1 = require("../../io/conflict-policy");
6
8
  const terminal_capabilities_1 = require("../../terminal/terminal-capabilities");
7
9
  function addInteractiveOption(command) {
8
10
  return command.option("-i, --interactive", "run a guided interactive flow", false);
9
11
  }
10
- exports.addInteractiveOption = addInteractiveOption;
11
12
  function addConflictOption(command) {
12
13
  return command.option("--on-conflict <policy>", `file conflict policy: ${(0, conflict_policy_1.conflictPolicyHelp)()}`);
13
14
  }
14
- exports.addConflictOption = addConflictOption;
15
15
  function assertInteractiveTerminal(options) {
16
16
  if (!options.interactive) {
17
17
  return;
@@ -20,4 +20,3 @@ function assertInteractiveTerminal(options) {
20
20
  throw new errors_1.CliError("Interactive mode requires a TTY. Use explicit flags instead.");
21
21
  }
22
22
  }
23
- exports.assertInteractiveTerminal = assertInteractiveTerminal;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerUpdateCommand = void 0;
3
+ exports.registerUpdateCommand = registerUpdateCommand;
4
4
  const load_soap_config_1 = require("../../config/load-soap-config");
5
5
  const write_soap_config_1 = require("../../config/write-soap-config");
6
6
  const command_context_1 = require("../../core/command-context");
@@ -58,7 +58,6 @@ function registerUpdateCommand(program) {
58
58
  context.output.success(`Updated project capabilities: ${changes.join(", ")}.`);
59
59
  });
60
60
  }
61
- exports.registerUpdateCommand = registerUpdateCommand;
62
61
  function collect(value, previous) {
63
62
  previous.push(value);
64
63
  return previous;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createAuthPolicyArgument = exports.formatAuthPolicy = exports.parseAuthPolicy = void 0;
3
+ exports.parseAuthPolicy = parseAuthPolicy;
4
+ exports.formatAuthPolicy = formatAuthPolicy;
5
+ exports.createAuthPolicyArgument = createAuthPolicyArgument;
4
6
  const errors_1 = require("../core/errors");
5
7
  function parseAuthPolicy(value) {
6
8
  if (!value || value === "none") {
@@ -25,7 +27,6 @@ function parseAuthPolicy(value) {
25
27
  }
26
28
  throw new errors_1.CliError(`Invalid auth policy "${value}". Use admin, roles:a,b, custom:name, or none.`);
27
29
  }
28
- exports.parseAuthPolicy = parseAuthPolicy;
29
30
  function formatAuthPolicy(policy) {
30
31
  if (!policy) {
31
32
  return undefined;
@@ -38,7 +39,6 @@ function formatAuthPolicy(policy) {
38
39
  }
39
40
  return `custom:${policy.name}`;
40
41
  }
41
- exports.formatAuthPolicy = formatAuthPolicy;
42
42
  function createAuthPolicyArgument(policy) {
43
43
  if (!policy) {
44
44
  return undefined;
@@ -51,4 +51,3 @@ function createAuthPolicyArgument(policy) {
51
51
  }
52
52
  return `{ policy: '${policy.name}' }`;
53
53
  }
54
- exports.createAuthPolicyArgument = createAuthPolicyArgument;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.findSoapRoot = void 0;
6
+ exports.findSoapRoot = findSoapRoot;
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  function findSoapRoot(cwd) {
@@ -19,4 +19,3 @@ function findSoapRoot(cwd) {
19
19
  current = parent;
20
20
  }
21
21
  }
22
- exports.findSoapRoot = findSoapRoot;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.loadSoapConfig = void 0;
6
+ exports.loadSoapConfig = loadSoapConfig;
7
7
  const promises_1 = __importDefault(require("fs/promises"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const errors_1 = require("../core/errors");
@@ -27,4 +27,3 @@ async function loadSoapConfig(cwd) {
27
27
  registry: (0, validation_1.validateRegistryConfig)(await readJson(path_1.default.join(soapRoot, "registry.json"))),
28
28
  };
29
29
  }
30
- exports.loadSoapConfig = loadSoapConfig;
@@ -6,7 +6,7 @@ export type DatabaseCapability = "mongo" | "postgres" | "mysql" | "sqlite" | "re
6
6
  export type AuthCapability = "jwt" | "api-key" | "local";
7
7
  export type MessagingCapability = "in-memory" | "kafka";
8
8
  export type RealtimeCapability = "ws";
9
- export type TelemetryCapability = "logs" | "otel-noop";
9
+ export type TelemetryCapability = "logs" | "otel-noop" | "metrics" | "memory";
10
10
  export type ApiClientCapability = "bruno";
11
11
  export type DocsCapability = "openapi";
12
12
  export type ContractsCapability = "zod";
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateRegistryConfig = exports.validateApiConfig = exports.validateStructureConfig = exports.validateProjectConfig = void 0;
3
+ exports.validateProjectConfig = validateProjectConfig;
4
+ exports.validateStructureConfig = validateStructureConfig;
5
+ exports.validateApiConfig = validateApiConfig;
6
+ exports.validateRegistryConfig = validateRegistryConfig;
4
7
  const errors_1 = require("../../core/errors");
5
8
  const frameworks = ["express"];
6
9
  const architectures = ["regular", "cqrs"];
@@ -9,7 +12,7 @@ const databases = ["mongo", "postgres", "mysql", "sqlite", "redis"];
9
12
  const auth = ["jwt", "api-key", "local"];
10
13
  const messaging = ["in-memory", "kafka"];
11
14
  const realtime = ["ws"];
12
- const telemetry = ["logs", "otel-noop"];
15
+ const telemetry = ["logs", "otel-noop", "metrics", "memory"];
13
16
  const apiClients = ["bruno"];
14
17
  const docs = ["openapi"];
15
18
  const contracts = ["zod"];
@@ -65,7 +68,6 @@ function validateProjectConfig(value) {
65
68
  assertArrayOf(value.zones, "project.zones", zones);
66
69
  return value;
67
70
  }
68
- exports.validateProjectConfig = validateProjectConfig;
69
71
  function validateStructureConfig(value) {
70
72
  assertObject(value, ".soap/structure.json");
71
73
  assertString(value.featuresRoot, "structure.featuresRoot");
@@ -74,7 +76,6 @@ function validateStructureConfig(value) {
74
76
  assertObject(value.paths, "structure.paths");
75
77
  return value;
76
78
  }
77
- exports.validateStructureConfig = validateStructureConfig;
78
79
  function validateApiConfig(value) {
79
80
  assertObject(value, ".soap/api.json");
80
81
  assertString(value.baseUrl, "api.baseUrl");
@@ -83,7 +84,6 @@ function validateApiConfig(value) {
83
84
  assertObject(value.bruno, "api.bruno");
84
85
  return value;
85
86
  }
86
- exports.validateApiConfig = validateApiConfig;
87
87
  function validateRegistryConfig(value) {
88
88
  assertObject(value, ".soap/registry.json");
89
89
  if (!Array.isArray(value.resources) || !Array.isArray(value.routes) || !Array.isArray(value.generatedFiles)) {
@@ -107,7 +107,6 @@ function validateRegistryConfig(value) {
107
107
  }
108
108
  return value;
109
109
  }
110
- exports.validateRegistryConfig = validateRegistryConfig;
111
110
  function assertAuthPolicy(value, label) {
112
111
  if (value === undefined) {
113
112
  return;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.writeSoapConfig = void 0;
6
+ exports.writeSoapConfig = writeSoapConfig;
7
7
  const promises_1 = __importDefault(require("fs/promises"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  async function writeJson(filePath, value, context) {
@@ -22,4 +22,3 @@ async function writeSoapConfig(root, config, context) {
22
22
  await writeJson(path_1.default.join(soapRoot, "api.json"), config.api, context);
23
23
  await writeJson(path_1.default.join(soapRoot, "registry.json"), config.registry, context);
24
24
  }
25
- exports.writeSoapConfig = writeSoapConfig;
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getCommandContext = exports.createCommandContext = void 0;
6
+ exports.createCommandContext = createCommandContext;
7
+ exports.getCommandContext = getCommandContext;
7
8
  const path_1 = __importDefault(require("path"));
8
9
  const output_1 = require("./output");
9
10
  function createCommandContext(options = {}) {
@@ -19,7 +20,6 @@ function createCommandContext(options = {}) {
19
20
  output: (0, output_1.createOutput)({ verbose, silent }),
20
21
  };
21
22
  }
22
- exports.createCommandContext = createCommandContext;
23
23
  function getCommandContext(command) {
24
24
  const context = command.getOptionValue("_context");
25
25
  if (!context) {
@@ -27,4 +27,3 @@ function getCommandContext(command) {
27
27
  }
28
28
  return context;
29
29
  }
30
- exports.getCommandContext = getCommandContext;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handleCliError = exports.CliError = void 0;
3
+ exports.CliError = void 0;
4
+ exports.handleCliError = handleCliError;
4
5
  class CliError extends Error {
5
6
  exitCode;
6
7
  constructor(message, exitCode = 1) {
@@ -20,4 +21,3 @@ function handleCliError(error, context) {
20
21
  }
21
22
  context.output.error(String(error));
22
23
  }
23
- exports.handleCliError = handleCliError;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createOutput = void 0;
3
+ exports.createOutput = createOutput;
4
4
  function createOutput(options) {
5
5
  const write = (stream, message) => {
6
6
  stream.write(`${message}\n`);
@@ -27,4 +27,3 @@ function createOutput(options) {
27
27
  },
28
28
  };
29
29
  }
30
- exports.createOutput = createOutput;
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.err = exports.ok = void 0;
3
+ exports.ok = ok;
4
+ exports.err = err;
4
5
  function ok(value) {
5
6
  return { ok: true, value };
6
7
  }
7
- exports.ok = ok;
8
8
  function err(error) {
9
9
  return { ok: false, error };
10
10
  }
11
- exports.err = err;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveDependencies = void 0;
3
+ exports.resolveDependencies = resolveDependencies;
4
4
  function resolveDependencies(capabilities) {
5
5
  const dependencies = {
6
- "@soapjs/soap": "^0.12.1",
7
- "@soapjs/soap-express": "^0.5.1",
6
+ "@soapjs/soap": "^0.14.0",
7
+ "@soapjs/soap-express": "^0.6.0",
8
8
  dotenv: "^16.4.5",
9
9
  express: "^4.18.2",
10
10
  "reflect-metadata": "^0.2.2",
@@ -34,13 +34,11 @@ function resolveDependencies(capabilities) {
34
34
  devDependencies["@types/better-sqlite3"] = "^7.6.11";
35
35
  }
36
36
  if (capabilities.databases.includes("redis")) {
37
- dependencies["@soapjs/soap-node-redis"] = "^0.1.0";
37
+ dependencies["@soapjs/soap-node-redis"] = "^0.1.1";
38
38
  dependencies.redis = "^4.6.13";
39
39
  }
40
40
  if (capabilities.auth.length > 0) {
41
- dependencies["@soapjs/soap-auth"] = "^0.4.4";
42
- dependencies.jsonwebtoken = "^9.0.2";
43
- devDependencies["@types/jsonwebtoken"] = "^9.0.6";
41
+ dependencies["@soapjs/soap-auth"] = "^1.0.1";
44
42
  }
45
43
  if (capabilities.messaging.includes("kafka")) {
46
44
  dependencies["@soapjs/soap-node-kafka"] = "^0.1.3";
@@ -65,4 +63,3 @@ function resolveDependencies(capabilities) {
65
63
  }
66
64
  return { dependencies, devDependencies };
67
65
  }
68
- exports.resolveDependencies = resolveDependencies;
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.installCommandParts = exports.installCommand = exports.detectPackageManager = void 0;
6
+ exports.detectPackageManager = detectPackageManager;
7
+ exports.installCommand = installCommand;
8
+ exports.installCommandParts = installCommandParts;
7
9
  const fs_1 = __importDefault(require("fs"));
8
10
  const path_1 = __importDefault(require("path"));
9
11
  function detectPackageManager(root, override) {
@@ -23,7 +25,6 @@ function detectPackageManager(root, override) {
23
25
  }
24
26
  return "npm";
25
27
  }
26
- exports.detectPackageManager = detectPackageManager;
27
28
  function installCommand(packageManager) {
28
29
  switch (packageManager) {
29
30
  case "pnpm":
@@ -37,7 +38,6 @@ function installCommand(packageManager) {
37
38
  return "npm install";
38
39
  }
39
40
  }
40
- exports.installCommand = installCommand;
41
41
  function installCommandParts(packageManager) {
42
42
  switch (packageManager) {
43
43
  case "pnpm":
@@ -51,4 +51,3 @@ function installCommandParts(packageManager) {
51
51
  return { command: "npm", args: ["install"] };
52
52
  }
53
53
  }
54
- exports.installCommandParts = installCommandParts;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.conflictPolicyHelp = exports.resolveConflictPolicy = exports.parseConflictPolicy = void 0;
3
+ exports.parseConflictPolicy = parseConflictPolicy;
4
+ exports.resolveConflictPolicy = resolveConflictPolicy;
5
+ exports.conflictPolicyHelp = conflictPolicyHelp;
4
6
  const errors_1 = require("../core/errors");
5
7
  const conflictPolicies = ["ask", "skip", "overwrite", "new", "abort"];
6
8
  function parseConflictPolicy(value) {
@@ -9,7 +11,6 @@ function parseConflictPolicy(value) {
9
11
  }
10
12
  return value;
11
13
  }
12
- exports.parseConflictPolicy = parseConflictPolicy;
13
14
  function resolveConflictPolicy(options = {}) {
14
15
  if (options.onConflict) {
15
16
  return parseConflictPolicy(options.onConflict);
@@ -25,8 +26,6 @@ function resolveConflictPolicy(options = {}) {
25
26
  }
26
27
  return "abort";
27
28
  }
28
- exports.resolveConflictPolicy = resolveConflictPolicy;
29
29
  function conflictPolicyHelp() {
30
30
  return conflictPolicies.join(", ");
31
31
  }
32
- exports.conflictPolicyHelp = conflictPolicyHelp;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.writePlannedFiles = void 0;
6
+ exports.writePlannedFiles = writePlannedFiles;
7
7
  const promises_1 = __importDefault(require("fs/promises"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const registry_service_1 = require("../registry/registry.service");
@@ -62,4 +62,3 @@ async function writePlannedFiles(options, context) {
62
62
  }
63
63
  }
64
64
  }
65
- exports.writePlannedFiles = writePlannedFiles;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatFile = void 0;
3
+ exports.formatFile = formatFile;
4
4
  function formatFile(filePath, content) {
5
5
  if (filePath.endsWith(".json")) {
6
6
  return `${JSON.stringify(JSON.parse(content), null, 2)}\n`;
@@ -10,4 +10,3 @@ function formatFile(filePath, content) {
10
10
  }
11
11
  return content.endsWith("\n") ? content : `${content}\n`;
12
12
  }
13
- exports.formatFile = formatFile;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatCreatePresetNames = exports.resolveCreatePreset = exports.createPresets = void 0;
3
+ exports.createPresets = void 0;
4
+ exports.resolveCreatePreset = resolveCreatePreset;
5
+ exports.formatCreatePresetNames = formatCreatePresetNames;
4
6
  const errors_1 = require("../core/errors");
5
7
  exports.createPresets = [
6
8
  {
@@ -90,8 +92,6 @@ function resolveCreatePreset(name) {
90
92
  }
91
93
  return preset;
92
94
  }
93
- exports.resolveCreatePreset = resolveCreatePreset;
94
95
  function formatCreatePresetNames() {
95
96
  return exports.createPresets.map((preset) => preset.name).join(", ");
96
97
  }
97
- exports.formatCreatePresetNames = formatCreatePresetNames;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.promptAddResource = void 0;
3
+ exports.promptAddResource = promptAddResource;
4
4
  async function promptAddResource(prompt, options) {
5
5
  const answers = {};
6
6
  const config = options.config;
@@ -52,7 +52,6 @@ async function promptAddResource(prompt, options) {
52
52
  }
53
53
  return answers;
54
54
  }
55
- exports.promptAddResource = promptAddResource;
56
55
  function createDatabaseChoices(config) {
57
56
  return [
58
57
  { label: "None", value: "none" },
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.promptAddRoute = void 0;
3
+ exports.promptAddRoute = promptAddRoute;
4
4
  const route_plan_1 = require("../commands/add/route-plan");
5
5
  const naming_1 = require("../templates/naming");
6
6
  async function promptAddRoute(prompt, options) {
@@ -75,7 +75,6 @@ async function promptAddRoute(prompt, options) {
75
75
  }
76
76
  return answers;
77
77
  }
78
- exports.promptAddRoute = promptAddRoute;
79
78
  async function promptForResource(prompt, config, provided) {
80
79
  if (provided) {
81
80
  throw new Error("Resource was marked as provided but no resource entry was passed.");
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.promptCreateProject = void 0;
3
+ exports.promptCreateProject = promptCreateProject;
4
4
  async function promptCreateProject(prompt, options) {
5
5
  const answers = {};
6
6
  const preset = options.preset ?? {};
@@ -74,6 +74,8 @@ async function promptCreateProject(prompt, options) {
74
74
  choices: [
75
75
  { label: "Logs", value: "logs" },
76
76
  { label: "OTel noop", value: "otel-noop" },
77
+ { label: "Metrics endpoint", value: "metrics" },
78
+ { label: "Memory monitoring", value: "memory" },
77
79
  { label: "None", value: "none" },
78
80
  ],
79
81
  defaultValues: withDefault(preset.capabilities?.telemetry, ["logs"]),
@@ -147,7 +149,6 @@ async function promptCreateProject(prompt, options) {
147
149
  }
148
150
  return answers;
149
151
  }
150
- exports.promptCreateProject = promptCreateProject;
151
152
  function withNoneDefault(values) {
152
153
  return values && values.length > 0 ? values : [];
153
154
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.promptGenerateBruno = void 0;
3
+ exports.promptGenerateBruno = promptGenerateBruno;
4
4
  async function promptGenerateBruno(prompt, analysis) {
5
5
  const mode = await prompt.select({
6
6
  message: "Bruno generation mode",
@@ -18,4 +18,3 @@ async function promptGenerateBruno(prompt, analysis) {
18
18
  });
19
19
  return { mode };
20
20
  }
21
- exports.promptGenerateBruno = promptGenerateBruno;
@@ -1,30 +1,39 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InquirerPromptAdapter = void 0;
4
- const prompts_1 = require("@inquirer/prompts");
4
+ const importModule = new Function("specifier", "return import(specifier)");
5
+ let prompts;
6
+ function loadPrompts() {
7
+ prompts ??= importModule("@inquirer/prompts");
8
+ return prompts;
9
+ }
5
10
  class InquirerPromptAdapter {
6
11
  async input(question) {
7
- return (0, prompts_1.input)({
12
+ const { input } = await loadPrompts();
13
+ return input({
8
14
  message: question.message,
9
15
  default: question.defaultValue,
10
16
  validate: question.required ? (value) => value.trim().length > 0 || "Value is required." : undefined,
11
17
  });
12
18
  }
13
19
  async confirm(question) {
14
- return (0, prompts_1.confirm)({
20
+ const { confirm } = await loadPrompts();
21
+ return confirm({
15
22
  message: question.message,
16
23
  default: question.defaultValue,
17
24
  });
18
25
  }
19
26
  async select(question) {
20
- return (0, prompts_1.select)({
27
+ const { select } = await loadPrompts();
28
+ return select({
21
29
  message: question.message,
22
30
  choices: question.choices.map(toInquirerChoice),
23
31
  default: question.defaultValue,
24
32
  });
25
33
  }
26
34
  async multiSelect(question) {
27
- const selected = await (0, prompts_1.checkbox)({
35
+ const { checkbox } = await loadPrompts();
36
+ const selected = await checkbox({
28
37
  message: question.message,
29
38
  choices: question.choices.map((choice) => ({
30
39
  ...toInquirerChoice(choice),