@botim/botim-cli 0.0.5 → 0.0.6
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/cli.js +17 -2
- package/dist/cli.mjs +6 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
{
|
|
3
|
+
const origEmit = process.emit;
|
|
4
|
+
process.emit = function(name, data, ...args) {
|
|
5
|
+
if (name === "warning" && data && data.name === "DeprecationWarning") {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
return origEmit.call(process, name, data, ...args);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
2
11
|
import { Command } from "commander";
|
|
3
12
|
import { createReactApp, createVueApp, handleLogin, handleLogout, handleQRCode } from "./commands/index.js";
|
|
4
13
|
import { showMenuOrRequireAuth } from "./commands/auth/index.js";
|
|
5
14
|
import { displayExamples, displayQuickStart } from "./utils/help.js";
|
|
6
|
-
import { logger } from "./utils/logger.js";
|
|
15
|
+
import { logger, displayErrorSync } from "./utils/logger.js";
|
|
7
16
|
import { isLoggedIn, getCurrentEnvironment, setCurrentEnvironment, getAllEnvironmentStatus } from "./utils/config.js";
|
|
8
17
|
import { setRuntimeEnvironment, parseEnvironment, getEnvironmentDisplayName } from "./utils/environment.js";
|
|
9
18
|
import { executeWithAuthRetry } from "./utils/auth-handler.js";
|
|
10
19
|
import chalk from "chalk";
|
|
11
20
|
import fs from "fs-extra";
|
|
12
21
|
import path from "path";
|
|
13
|
-
const version = "0.0.
|
|
22
|
+
const version = "0.0.6";
|
|
14
23
|
const program = new Command();
|
|
15
24
|
program.name("botim-cli").description("CLI tool to generate boilerplate code for React and Vue applications").version(version, "-v, --version", "Output the current version").option("--env <environment>", "Target environment: prod, uat, or beta (overrides default)", (value) => {
|
|
16
25
|
const env = parseEnvironment(value);
|
|
@@ -201,6 +210,7 @@ Audience Options:
|
|
|
201
210
|
}
|
|
202
211
|
} catch (error) {
|
|
203
212
|
logger.error("create-mp-app command failed", error);
|
|
213
|
+
displayErrorSync(error, "Create MP App failed");
|
|
204
214
|
process.exit(1);
|
|
205
215
|
}
|
|
206
216
|
});
|
|
@@ -225,6 +235,7 @@ program.command("init-mp-app").description("Initialize MP app in current directo
|
|
|
225
235
|
}
|
|
226
236
|
} catch (error) {
|
|
227
237
|
logger.error("init-mp-app command failed", error);
|
|
238
|
+
displayErrorSync(error, "Init MP App failed");
|
|
228
239
|
process.exit(1);
|
|
229
240
|
}
|
|
230
241
|
});
|
|
@@ -249,6 +260,7 @@ program.command("deploy-mp-app").description("Deploy MP app to server (requires
|
|
|
249
260
|
}
|
|
250
261
|
} catch (error) {
|
|
251
262
|
logger.error("deploy-mp-app command failed", error);
|
|
263
|
+
displayErrorSync(error, "Deployment failed");
|
|
252
264
|
process.exit(1);
|
|
253
265
|
}
|
|
254
266
|
});
|
|
@@ -273,6 +285,7 @@ program.command("debug-mp-app").description("Debug MP app (requires authenticati
|
|
|
273
285
|
}
|
|
274
286
|
} catch (error) {
|
|
275
287
|
logger.error("debug-mp-app command failed", error);
|
|
288
|
+
displayErrorSync(error, "Debug MP App failed");
|
|
276
289
|
process.exit(1);
|
|
277
290
|
}
|
|
278
291
|
});
|
|
@@ -297,6 +310,7 @@ program.command("list-mp-permissions [app-id]").description("List permissions fo
|
|
|
297
310
|
}
|
|
298
311
|
} catch (error) {
|
|
299
312
|
logger.error("list-mp-permissions command failed", error);
|
|
313
|
+
displayErrorSync(error, "List MP Permissions failed");
|
|
300
314
|
process.exit(1);
|
|
301
315
|
}
|
|
302
316
|
});
|
|
@@ -586,6 +600,7 @@ async function showMainMenu() {
|
|
|
586
600
|
);
|
|
587
601
|
} catch (error) {
|
|
588
602
|
logger.error("Command execution failed", error);
|
|
603
|
+
displayErrorSync(error, "Command failed");
|
|
589
604
|
process.exit(1);
|
|
590
605
|
}
|
|
591
606
|
}
|