@trendify/cli 0.1.12 → 0.1.13

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 (2) hide show
  1. package/dist/cli.entry.js +18 -3
  2. package/package.json +1 -1
package/dist/cli.entry.js CHANGED
@@ -49,12 +49,27 @@ if (!supportsInteractiveInkInput()) {
49
49
  printNonInteractiveFallback();
50
50
  process.exit(1);
51
51
  }
52
- console.clear();
53
52
  let appInstance;
53
+ function resetTerminalScreen() {
54
+ if (!process.stdout.isTTY) {
55
+ return;
56
+ }
57
+ process.stdout.write('\u001b[2J\u001b[3J\u001b[H');
58
+ }
59
+ async function unmountApp() {
60
+ if (!appInstance) {
61
+ return;
62
+ }
63
+ const currentInstance = appInstance;
64
+ currentInstance.unmount();
65
+ await currentInstance.waitUntilExit().catch(() => undefined);
66
+ currentInstance.cleanup();
67
+ }
54
68
  function mountApp(feedback = null) {
69
+ resetTerminalScreen();
55
70
  appInstance = render(_jsx(App, { appVersion: APP_VERSION, initialInput: initialInput, initialNotification: feedback?.message ?? null, initialNotificationTone: feedback?.tone ?? 'success', onSelfUpdate: async (update) => {
56
- appInstance.unmount();
57
- console.clear();
71
+ await unmountApp();
72
+ resetTerminalScreen();
58
73
  process.stdout.write([
59
74
  `Atualizando o CLI de v${update.currentVersion} para v${update.latestVersion}.`,
60
75
  `Pacote npm: ${update.packageName}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trendify/cli",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "CLI do Trendify para descoberta de temas e fluxos de conta.",
5
5
  "type": "module",
6
6
  "main": "dist/cli.entry.js",