@botpress/cli 0.0.10 → 0.0.11

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/config.js CHANGED
@@ -6,8 +6,8 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __export = (target, all) => {
9
- for (var name2 in all)
10
- __defProp(target, name2, { get: all[name2], enumerable: true });
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
11
  };
12
12
  var __copyProps = (to, from, except, desc) => {
13
13
  if (from && typeof from === "object" || typeof from === "function") {
@@ -24,86 +24,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
25
  var config_exports = {};
26
26
  __export(config_exports, {
27
- addSchema: () => addSchema,
28
- botRef: () => botRef,
29
- buildSchema: () => buildSchema,
30
- bundleSchema: () => bundleSchema,
31
- createBotSchema: () => createBotSchema,
32
- deleteBotSchema: () => deleteBotSchema,
33
- deleteIntegrationSchema: () => deleteIntegrationSchema,
34
- deploySchema: () => deploySchema,
35
- devSchema: () => devSchema,
36
- generateSchema: () => generateSchema,
37
- globalSchema: () => globalSchema,
38
- initSchema: () => initSchema,
39
- integrationRef: () => integrationRef,
40
- listBotsSchema: () => listBotsSchema,
41
- listIntegrationsSchema: () => listIntegrationsSchema,
42
- loggedInSchema: () => loggedInSchema,
43
- loginSchema: () => loginSchema,
44
- logoutSchema: () => logoutSchema,
45
- projectSchema: () => projectSchema,
46
- readBotSchema: () => readBotSchema,
47
- readIntegrationSchema: () => readIntegrationSchema,
48
- serveSchema: () => serveSchema
27
+ schemas: () => schemas
49
28
  });
50
29
  module.exports = __toCommonJS(config_exports);
51
30
  var consts = __toESM(require("./consts"));
52
- const botpressHome = {
53
- type: "string",
54
- description: "The path to the Botpress home directory",
55
- default: consts.defaultBotpressHome
56
- };
57
- const verbose = {
58
- type: "boolean",
59
- description: "Enable verbose logging",
60
- alias: "v",
61
- default: false
62
- };
63
- const json = {
64
- type: "boolean",
65
- description: "Prevent logging anything else than raw json. Useful for piping output to other tools",
66
- alias: "j",
67
- default: false
68
- };
69
- const confirm = {
70
- type: "boolean",
71
- description: "Confirm all prompts",
72
- alias: "y",
73
- default: false
74
- };
75
31
  const port = {
76
32
  type: "number",
77
33
  description: "The port to use"
78
34
  };
79
- const entryPoint = {
80
- type: "string",
81
- description: "The entry point of the project",
82
- default: consts.defaultEntrypoint
83
- };
84
- const outDir = {
85
- type: "string",
86
- description: "The output directory",
87
- default: consts.defaultOutputFolder
88
- };
89
35
  const workDir = {
90
36
  type: "string",
91
37
  description: "The path to the project",
92
38
  default: process.cwd()
93
39
  };
94
- const botId = {
95
- type: "string",
96
- description: "The bot ID to deploy. Only used when deploying a bot"
97
- };
98
- const createNewBot = {
99
- type: "boolean",
100
- description: "Create a new bot when deploying. Only used when deploying a bot"
101
- };
102
- const url = {
103
- type: "string",
104
- description: "The publicly available URL of the bot or integration (often using ngrok)",
105
- demandOption: true
106
- };
107
40
  const noBuild = {
108
41
  type: "boolean",
109
42
  description: "Skip the build step",
@@ -121,37 +54,51 @@ const workspaceId = {
121
54
  type: "string",
122
55
  description: "The Workspace Id to deploy to"
123
56
  };
124
- const type = {
125
- type: "string",
126
- choices: ["bot", "integration"]
127
- };
128
- const name = {
129
- type: "string",
130
- description: "The name of the project"
131
- };
132
57
  const botRef = {
133
58
  type: "string",
134
59
  description: "The bot ID. Bot Name is not supported.",
135
- demandOption: true
60
+ demandOption: true,
61
+ positional: true,
62
+ idx: 0
136
63
  };
137
64
  const integrationRef = {
138
65
  type: "string",
139
66
  description: "The integration ID or name with optionnal version. Ex: teams or teams@0.2.0",
140
- demandOption: true
67
+ demandOption: true,
68
+ positional: true,
69
+ idx: 0
141
70
  };
142
71
  const globalSchema = {
143
- verbose,
144
- confirm,
145
- json,
146
- botpressHome
72
+ verbose: {
73
+ type: "boolean",
74
+ description: "Enable verbose logging",
75
+ alias: "v",
76
+ default: false
77
+ },
78
+ confirm: {
79
+ type: "boolean",
80
+ description: "Confirm all prompts",
81
+ alias: "y",
82
+ default: false
83
+ },
84
+ json: {
85
+ type: "boolean",
86
+ description: "Prevent logging anything else than raw json in stdout. Useful for piping output to other tools",
87
+ default: false
88
+ },
89
+ botpressHome: {
90
+ type: "string",
91
+ description: "The path to the Botpress home directory",
92
+ default: consts.defaultBotpressHome
93
+ }
147
94
  };
148
95
  const projectSchema = {
149
96
  ...globalSchema,
150
- entryPoint,
151
- outDir,
97
+ entryPoint: { type: "string", description: "The entry point of the project", default: consts.defaultEntrypoint },
98
+ outDir: { type: "string", description: "The output directory", default: consts.defaultOutputFolder },
152
99
  workDir
153
100
  };
154
- const loggedInSchema = {
101
+ const credentialsSchema = {
155
102
  host,
156
103
  workspaceId,
157
104
  token
@@ -171,21 +118,26 @@ const serveSchema = {
171
118
  };
172
119
  const deploySchema = {
173
120
  ...projectSchema,
174
- ...loggedInSchema,
175
- botId,
121
+ ...credentialsSchema,
122
+ botId: { type: "string", description: "The bot ID to deploy. Only used when deploying a bot" },
176
123
  noBuild,
177
- createNewBot
124
+ createNewBot: { type: "boolean", description: "Create a new bot when deploying. Only used when deploying a bot" }
178
125
  };
179
126
  const devSchema = {
180
127
  ...projectSchema,
181
- ...loggedInSchema,
182
- url,
128
+ ...credentialsSchema,
129
+ url: {
130
+ type: "string",
131
+ description: "The publicly available URL of the bot or integration (often using ngrok)",
132
+ demandOption: true
133
+ },
183
134
  port,
184
135
  noBuild
185
136
  };
186
137
  const addSchema = {
187
138
  ...projectSchema,
188
- ...loggedInSchema
139
+ ...credentialsSchema,
140
+ integrationRef
189
141
  };
190
142
  const loginSchema = {
191
143
  ...globalSchema,
@@ -198,63 +150,68 @@ const logoutSchema = {
198
150
  };
199
151
  const createBotSchema = {
200
152
  ...globalSchema,
201
- ...loggedInSchema,
153
+ ...credentialsSchema,
202
154
  name: { type: "string", description: "The name of the bot to create" }
203
155
  };
204
- const readBotSchema = {
156
+ const getBotSchema = {
205
157
  ...globalSchema,
206
- ...loggedInSchema
158
+ ...credentialsSchema,
159
+ botRef
207
160
  };
208
161
  const deleteBotSchema = {
209
162
  ...globalSchema,
210
- ...loggedInSchema
163
+ ...credentialsSchema,
164
+ botRef
211
165
  };
212
166
  const listBotsSchema = {
213
167
  ...globalSchema,
214
- ...loggedInSchema
168
+ ...credentialsSchema
215
169
  };
216
- const readIntegrationSchema = {
170
+ const getIntegrationSchema = {
217
171
  ...globalSchema,
218
- ...loggedInSchema
172
+ ...credentialsSchema,
173
+ integrationRef
219
174
  };
220
175
  const listIntegrationsSchema = {
221
176
  ...globalSchema,
222
- ...loggedInSchema,
177
+ ...credentialsSchema,
223
178
  name: { type: "string", description: "The name filter when listing integrations" },
224
179
  version: { type: "string", description: "The version filter when listing integrations" }
225
180
  };
226
181
  const deleteIntegrationSchema = {
227
182
  ...globalSchema,
228
- ...loggedInSchema
183
+ ...credentialsSchema,
184
+ integrationRef
229
185
  };
230
186
  const initSchema = {
231
187
  ...globalSchema,
232
188
  workDir,
233
- type,
234
- name
189
+ type: { type: "string", choices: ["bot", "integration"] },
190
+ name: { type: "string", description: "The name of the project" }
191
+ };
192
+ const schemas = {
193
+ global: globalSchema,
194
+ project: projectSchema,
195
+ credentials: credentialsSchema,
196
+ login: loginSchema,
197
+ logout: logoutSchema,
198
+ createBot: createBotSchema,
199
+ getBot: getBotSchema,
200
+ deleteBot: deleteBotSchema,
201
+ listBots: listBotsSchema,
202
+ getIntegration: getIntegrationSchema,
203
+ listIntegrations: listIntegrationsSchema,
204
+ deleteIntegration: deleteIntegrationSchema,
205
+ init: initSchema,
206
+ generate: generateSchema,
207
+ bundle: bundleSchema,
208
+ build: buildSchema,
209
+ serve: serveSchema,
210
+ deploy: deploySchema,
211
+ add: addSchema,
212
+ dev: devSchema
235
213
  };
236
214
  // Annotate the CommonJS export names for ESM import in node:
237
215
  0 && (module.exports = {
238
- addSchema,
239
- botRef,
240
- buildSchema,
241
- bundleSchema,
242
- createBotSchema,
243
- deleteBotSchema,
244
- deleteIntegrationSchema,
245
- deploySchema,
246
- devSchema,
247
- generateSchema,
248
- globalSchema,
249
- initSchema,
250
- integrationRef,
251
- listBotsSchema,
252
- listIntegrationsSchema,
253
- loggedInSchema,
254
- loginSchema,
255
- logoutSchema,
256
- projectSchema,
257
- readBotSchema,
258
- readIntegrationSchema,
259
- serveSchema
216
+ schemas
260
217
  });
package/dist/consts.js CHANGED
@@ -52,7 +52,7 @@ const fromCliRootDir = {
52
52
  emptyIntegrationTemplate: import_path.default.join("templates", emptyIntegrationName)
53
53
  };
54
54
  const fromHomeDir = {
55
- userCacheFile: "user.cache.json"
55
+ globalCacheFile: "global.cache.json"
56
56
  };
57
57
  const fromWorkDir = {
58
58
  definition: "integration.definition.ts"
package/dist/index.js CHANGED
@@ -18,273 +18,30 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
18
18
  mod
19
19
  ));
20
20
  var import_yargs_extra = __toESM(require("@bpinternal/yargs-extra"));
21
- var import_process = require("process");
22
- var app = __toESM(require("./app"));
23
- var config = __toESM(require("./config"));
21
+ var import_command_definitions = __toESM(require("./command-definitions"));
22
+ var import_command_implementations = __toESM(require("./command-implementations"));
23
+ var tree = __toESM(require("./command-tree"));
24
+ var errors = __toESM(require("./errors"));
24
25
  var import_logger = require("./logger");
25
- var pathutils = __toESM(require("./path-utils"));
26
- const CLI_ROOT_DIR = pathutils.join(__dirname, "..");
26
+ var import_register_yargs = require("./register-yargs");
27
+ var utils = __toESM(require("./utils"));
28
+ const CLI_ROOT_DIR = utils.path.join(__dirname, "..");
27
29
  const logError = (thrown) => {
28
- const error = app.errors.BotpressCLIError.map(thrown);
30
+ const error = errors.BotpressCLIError.map(thrown);
29
31
  new import_logger.Logger().error(error.message);
30
32
  };
31
33
  const onError = (thrown) => {
32
34
  logError(thrown);
33
- (0, import_process.exit)(1);
35
+ process.exit(1);
34
36
  };
35
37
  const yargsFail = (msg) => {
36
38
  logError(`${msg}
37
39
  `);
38
40
  import_yargs_extra.default.showHelp();
39
- (0, import_process.exit)(1);
41
+ process.exit(1);
40
42
  };
41
43
  process.on("uncaughtException", (thrown) => onError(thrown));
42
44
  process.on("unhandledRejection", (thrown) => onError(thrown));
43
- const parseArguments = (schema, argv) => {
44
- const yargsEnv = (0, import_yargs_extra.parseEnv)(schema, "BP");
45
- return (0, import_yargs_extra.cleanupConfig)(schema, { ...argv, ...yargsEnv });
46
- };
47
- import_yargs_extra.default.command(
48
- "login",
49
- "Login to Botpress Cloud",
50
- () => import_yargs_extra.default.options(config.loginSchema),
51
- async (argv) => {
52
- try {
53
- const parsed = parseArguments(config.loginSchema, argv);
54
- const commands = await app.forUser({ ...parsed, cliRootPath: CLI_ROOT_DIR });
55
- await commands.login(parsed);
56
- commands.teardown();
57
- } catch (e) {
58
- onError(e);
59
- }
60
- }
61
- ).command(
62
- "logout",
63
- "Logout of Botpress Cloud",
64
- () => import_yargs_extra.default.options(config.logoutSchema),
65
- async (argv) => {
66
- try {
67
- const parsed = parseArguments(config.logoutSchema, argv);
68
- const commands = await app.forUser({ ...parsed, cliRootPath: CLI_ROOT_DIR });
69
- await commands.logout();
70
- commands.teardown();
71
- } catch (e) {
72
- onError(e);
73
- }
74
- }
75
- ).command("bots", "bots related commands", (yargz) => {
76
- yargz.command(
77
- ["create", "new"],
78
- "Create new bot",
79
- () => yargz.options({ ...config.createBotSchema }),
80
- async (argv) => {
81
- try {
82
- const parsed = parseArguments(config.createBotSchema, argv);
83
- const commands = await app.forUser({ ...parsed, cliRootPath: CLI_ROOT_DIR });
84
- await commands.createBot(parsed);
85
- commands.teardown();
86
- } catch (e) {
87
- onError(e);
88
- }
89
- }
90
- ).command(
91
- ["list", "ls"],
92
- "List bots",
93
- () => yargz.options({ ...config.listBotsSchema }),
94
- async (argv) => {
95
- try {
96
- const parsed = parseArguments(config.listBotsSchema, argv);
97
- const commands = await app.forUser({ ...parsed, cliRootPath: CLI_ROOT_DIR });
98
- await commands.listBots(parsed);
99
- commands.teardown();
100
- } catch (e) {
101
- onError(e);
102
- }
103
- }
104
- ).command(
105
- "get <botRef>",
106
- "Get bot",
107
- () => yargz.positional("botRef", config.botRef).options({ ...config.readBotSchema }),
108
- async (argv) => {
109
- try {
110
- const parsed = parseArguments(config.readBotSchema, argv);
111
- const commands = await app.forUser({ ...parsed, cliRootPath: CLI_ROOT_DIR });
112
- await commands.getBot(argv.botRef, parsed);
113
- commands.teardown();
114
- } catch (e) {
115
- onError(e);
116
- }
117
- }
118
- ).command(
119
- ["delete <botRef>", "rm <botRef>"],
120
- "Delete bot",
121
- () => yargz.positional("botRef", config.botRef).options({ ...config.deleteBotSchema }),
122
- async (argv) => {
123
- try {
124
- const parsed = parseArguments(config.deleteBotSchema, argv);
125
- const commands = await app.forUser({ ...parsed, cliRootPath: CLI_ROOT_DIR });
126
- await commands.deleteBot(argv.botRef, parsed);
127
- commands.teardown();
128
- } catch (e) {
129
- onError(e);
130
- }
131
- }
132
- );
133
- }).command("integrations", "integrations related commands", (yargz) => {
134
- yargz.command(
135
- ["list", "ls"],
136
- "List integrations",
137
- () => yargz.options({ ...config.listIntegrationsSchema }),
138
- async (argv) => {
139
- try {
140
- const parsed = parseArguments(config.listIntegrationsSchema, argv);
141
- const commands = await app.forUser({ ...parsed, cliRootPath: CLI_ROOT_DIR });
142
- await commands.listIntegrations(parsed);
143
- commands.teardown();
144
- } catch (e) {
145
- onError(e);
146
- }
147
- }
148
- ).command(
149
- "get <integrationRef>",
150
- "Get integration",
151
- () => yargz.positional("integrationRef", config.integrationRef).options({ ...config.readIntegrationSchema }),
152
- async (argv) => {
153
- try {
154
- const parsed = parseArguments(config.readIntegrationSchema, argv);
155
- const commands = await app.forUser({ ...parsed, cliRootPath: CLI_ROOT_DIR });
156
- await commands.getIntegration(argv.integrationRef, parsed);
157
- commands.teardown();
158
- } catch (e) {
159
- onError(e);
160
- }
161
- }
162
- ).command(
163
- ["delete <integrationRef>", "rm <integrationRef>"],
164
- "Delete integration",
165
- () => yargz.positional("integrationRef", config.integrationRef).options({ ...config.deleteIntegrationSchema }),
166
- async (argv) => {
167
- try {
168
- const parsed = parseArguments(config.readIntegrationSchema, argv);
169
- const commands = await app.forUser({ ...parsed, cliRootPath: CLI_ROOT_DIR });
170
- await commands.deleteIntegration(argv.integrationRef, parsed);
171
- commands.teardown();
172
- } catch (e) {
173
- onError(e);
174
- }
175
- }
176
- );
177
- }).command(
178
- "init",
179
- "Initialize a new project",
180
- () => import_yargs_extra.default.options(config.initSchema),
181
- async (argv) => {
182
- try {
183
- const parsed = parseArguments(config.initSchema, argv);
184
- const commands = await app.forUser({ ...parsed, cliRootPath: CLI_ROOT_DIR });
185
- await commands.initProject(parsed);
186
- commands.teardown();
187
- } catch (e) {
188
- onError(e);
189
- }
190
- }
191
- ).command(
192
- "bundle",
193
- "Bundle a botpress project",
194
- () => import_yargs_extra.default.options(config.bundleSchema),
195
- async (argv) => {
196
- try {
197
- const parsed = parseArguments(config.bundleSchema, argv);
198
- const commands = await app.forProject({ ...parsed, cliRootPath: CLI_ROOT_DIR });
199
- await commands.bundleProject(parsed);
200
- commands.teardown();
201
- } catch (e) {
202
- onError(e);
203
- }
204
- }
205
- ).command(
206
- "gen",
207
- "Generate typings for intellisense during development",
208
- () => import_yargs_extra.default.options(config.generateSchema),
209
- async (argv) => {
210
- try {
211
- const parsed = parseArguments(config.generateSchema, argv);
212
- const commands = await app.forProject({ ...parsed, cliRootPath: CLI_ROOT_DIR });
213
- await commands.generateTypings(parsed);
214
- commands.teardown();
215
- } catch (e) {
216
- onError(e);
217
- }
218
- }
219
- ).command(
220
- "build",
221
- "Generate typings and bundle a botpress project",
222
- () => import_yargs_extra.default.options(config.buildSchema),
223
- async (argv) => {
224
- try {
225
- const parsed = parseArguments(config.buildSchema, argv);
226
- const commands = await app.forProject({ ...parsed, cliRootPath: CLI_ROOT_DIR });
227
- await commands.buildProject(parsed);
228
- commands.teardown();
229
- } catch (e) {
230
- onError(e);
231
- }
232
- }
233
- ).command(
234
- "serve",
235
- "Serve your project locally",
236
- () => import_yargs_extra.default.options(config.serveSchema),
237
- async (argv) => {
238
- try {
239
- const parsed = parseArguments(config.serveSchema, argv);
240
- const commands = await app.forProject({ ...parsed, cliRootPath: CLI_ROOT_DIR });
241
- await commands.serveProject(parsed);
242
- commands.teardown();
243
- } catch (e) {
244
- onError(e);
245
- }
246
- }
247
- ).command(
248
- "deploy",
249
- "Deploy your project",
250
- () => import_yargs_extra.default.options(config.deploySchema),
251
- async (argv) => {
252
- try {
253
- const parsed = parseArguments(config.deploySchema, argv);
254
- const commands = await app.forProject({ ...parsed, cliRootPath: CLI_ROOT_DIR });
255
- await commands.deployProject(parsed);
256
- commands.teardown();
257
- } catch (e) {
258
- onError(e);
259
- }
260
- }
261
- ).command(
262
- "dev",
263
- "Run your project in dev mode",
264
- () => import_yargs_extra.default.options(config.devSchema),
265
- async (argv) => {
266
- try {
267
- const parsed = parseArguments(config.devSchema, argv);
268
- const commands = await app.forProject({ ...parsed, cliRootPath: CLI_ROOT_DIR });
269
- await commands.devProject(parsed);
270
- commands.teardown();
271
- } catch (e) {
272
- onError(e);
273
- }
274
- }
275
- ).command(
276
- "add <integrationRef>",
277
- "Install an integration in your bot",
278
- (yargz) => yargz.positional("integrationRef", config.integrationRef).options(config.addSchema),
279
- async (argv) => {
280
- try {
281
- const parsed = parseArguments(config.addSchema, argv);
282
- const commands = await app.forProject({ ...parsed, cliRootPath: CLI_ROOT_DIR });
283
- await commands.installIntegration(argv.integrationRef, parsed);
284
- commands.teardown();
285
- } catch (e) {
286
- onError(e);
287
- }
288
- }
289
- );
45
+ const commands = tree.zipTree(import_command_definitions.default, import_command_implementations.default);
46
+ (0, import_register_yargs.registerYargs)(import_yargs_extra.default, commands, { cliRootDir: CLI_ROOT_DIR });
290
47
  void import_yargs_extra.default.version(false).scriptName("bp").demandCommand(1, "You didn't provide any command. Use the --help flag to see the list of available commands.").recommendCommands().strict().help().fail(yargsFail).parse();
@@ -89,7 +89,7 @@ class BaseLogger {
89
89
  this.opts = { ...DEFAULT_OPTIONS, ...opts };
90
90
  }
91
91
  log(message, props = {}) {
92
- if (this.opts.json) {
92
+ if (this.opts.json && !props.stderr) {
93
93
  return;
94
94
  }
95
95
  const prefix = this._resolvePrefix(props.prefix);
@@ -102,44 +102,29 @@ class BaseLogger {
102
102
  }
103
103
  const { depth } = opts;
104
104
  const msg = import_util.default.inspect(data, { colors: true, depth });
105
- this.print(msg);
105
+ this.log(msg);
106
106
  }
107
107
  debug(message, metadata) {
108
- if (!this.opts.verbose || this.opts.json) {
108
+ if (!this.opts.verbose) {
109
109
  return;
110
110
  }
111
111
  this.log(import_chalk.default.grey(message), { metadata, prefix: { symbol: "\u25CF", fg: "blue" } });
112
112
  }
113
113
  started(message, metadata) {
114
- if (this.opts.json) {
115
- return;
116
- }
117
114
  this.log(message, { metadata, prefix: { symbol: "\u25CB", fg: "purple" } });
118
115
  }
119
116
  success(message, metadata) {
120
- if (this.opts.json) {
121
- return;
122
- }
123
117
  this.log(message, { metadata, prefix: { symbol: "\u2713", fg: "green" } });
124
118
  }
125
119
  warn(message, metadata) {
126
- if (this.opts.json) {
127
- return;
128
- }
129
120
  this.log(message, { metadata, prefix: { symbol: "\u26A0", fg: "yellow" } });
130
121
  }
131
122
  error(message, metadata) {
132
- if (this.opts.json) {
133
- return;
134
- }
135
- this.log(message, { metadata, prefix: { symbol: "\xD7", fg: "red" } });
123
+ this.log(message, { metadata, prefix: { symbol: "\xD7", fg: "red" }, stderr: true });
136
124
  }
137
125
  box(message) {
138
- if (this.opts.json) {
139
- return;
140
- }
141
126
  const box = (0, import_boxen.default)(message, BOX_OPTIONS);
142
- this.print(box);
127
+ this.log(box);
143
128
  }
144
129
  _resolvePrefix(prefix) {
145
130
  if (!prefix) {
@@ -27,12 +27,13 @@ class Logger extends import_base_logger.BaseLogger {
27
27
  static _previousLine;
28
28
  print(message, props = {}) {
29
29
  this.cleanup();
30
+ const log = props.stderr ? console.error : console.info;
30
31
  const { metadata, prefix } = props;
31
32
  if (prefix) {
32
- console.log(prefix, message, metadata ?? "");
33
+ log(prefix, message, metadata ?? "");
33
34
  return;
34
35
  }
35
- console.log(message, metadata ?? "");
36
+ log(message, metadata ?? "");
36
37
  }
37
38
  line() {
38
39
  this.cleanup();
@@ -27,7 +27,7 @@ __export(child_entrypoint_exports, {
27
27
  ENTRY_POINT: () => ENTRY_POINT
28
28
  });
29
29
  module.exports = __toCommonJS(child_entrypoint_exports);
30
- var requireutils = __toESM(require("../require-utils"));
30
+ var utils = __toESM(require("../utils"));
31
31
  var import_config = require("./config");
32
32
  var import_is_child = require("./is-child");
33
33
  const ENTRY_POINT = __filename;
@@ -38,10 +38,10 @@ const childProcessEntrypoint = async (_props) => {
38
38
  }
39
39
  const config = import_config.configSchema.parse(JSON.parse(rawConfig));
40
40
  if (config.type === "code") {
41
- requireutils.requireJsCode(config.code);
41
+ utils.require.requireJsCode(config.code);
42
42
  }
43
43
  if (config.type === "file") {
44
- requireutils.requireJsFile(config.file);
44
+ utils.require.requireJsFile(config.file);
45
45
  }
46
46
  };
47
47
  if (import_is_child.processProps.type === "child") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botpress/cli",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "Botpress CLI",
5
5
  "scripts": {
6
6
  "build": "pnpm run type-check && pnpm run bundle && pnpm run template:gen && pnpm run template:type-check",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "main": "dist/index.js",
21
21
  "dependencies": {
22
- "@botpress/client": "0.0.10",
22
+ "@botpress/client": "0.0.11",
23
23
  "@bpinternal/yargs-extra": "^0.0.2",
24
24
  "@parcel/watcher": "^2.1.0",
25
25
  "@types/lodash": "^4.14.191",
@@ -45,7 +45,7 @@
45
45
  "zod-to-json-schema": "^3.20.1"
46
46
  },
47
47
  "devDependencies": {
48
- "@botpress/sdk": "0.0.8",
48
+ "@botpress/sdk": "0.0.9",
49
49
  "@types/bluebird": "^3.5.38",
50
50
  "@types/prompts": "^2.0.14",
51
51
  "@types/semver": "^7.3.11",
@@ -10,8 +10,8 @@
10
10
  "author": "",
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
- "@botpress/client": "0.0.10",
14
- "@botpress/sdk": "0.0.8",
13
+ "@botpress/client": "0.0.11",
14
+ "@botpress/sdk": "0.0.9",
15
15
  "zod": "^3.20.6"
16
16
  },
17
17
  "devDependencies": {
@@ -10,8 +10,8 @@
10
10
  "author": "",
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
- "@botpress/client": "0.0.10",
14
- "@botpress/sdk": "0.0.8",
13
+ "@botpress/client": "0.0.11",
14
+ "@botpress/sdk": "0.0.9",
15
15
  "zod": "^3.20.6"
16
16
  },
17
17
  "devDependencies": {