@base44-preview/cli 0.1.1-pr.555.d5bd4a4 → 0.1.1-pr.556.40ca32e

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/README.md CHANGED
@@ -119,6 +119,16 @@ base44 <command> --help
119
119
  base44 --version
120
120
  ```
121
121
 
122
+ ## Telemetry
123
+
124
+ When a command fails unexpectedly, the CLI sends an error report so we can find and fix bugs. A one-time notice is shown on first run. Reports include the command name, CLI version, OS and Node.js info, the error message and stack trace, and your account email when logged in. Secret values (e.g. from `base44 secrets set`) are redacted before anything is sent.
125
+
126
+ To opt out, set the environment variable:
127
+
128
+ ```bash
129
+ BASE44_DISABLE_TELEMETRY=1
130
+ ```
131
+
122
132
  ## Beta
123
133
 
124
134
  The CLI and Base44 backend service are currently in beta. We're actively improving them based on user feedback. Share your thoughts and feature requests on our [GitHub Discussions](https://github.com/orgs/base44/discussions).
package/bin/run.js CHANGED
@@ -1,5 +1,31 @@
1
1
  #!/usr/bin/env node
2
- import { runCLI } from "../dist/cli/index.js";
2
+ // Keep this file free of syntax newer than Node 12 can parse (no top-level
3
+ // await, no static import of the bundle), so users on unsupported Node
4
+ // versions get the clear version error below instead of a SyntaxError.
5
+ import { readFileSync } from "fs";
6
+
7
+ const packageJson = JSON.parse(
8
+ readFileSync(new URL("../package.json", import.meta.url), "utf-8"),
9
+ );
10
+ const requiredVersion = packageJson.engines.node.replace(/[^\d.]/g, "");
11
+
12
+ function versionAtLeast(current, required) {
13
+ const cur = current.split(".").map(Number);
14
+ const req = required.split(".").map(Number);
15
+ for (let i = 0; i < req.length; i++) {
16
+ if ((cur[i] || 0) > (req[i] || 0)) return true;
17
+ if ((cur[i] || 0) < (req[i] || 0)) return false;
18
+ }
19
+ return true;
20
+ }
21
+
22
+ if (!versionAtLeast(process.versions.node, requiredVersion)) {
23
+ process.stderr.write(
24
+ `base44 requires Node.js >= ${requiredVersion}, but you are running Node.js ${process.versions.node}.\n` +
25
+ "Upgrade Node.js to use the Base44 CLI: https://nodejs.org/\n",
26
+ );
27
+ process.exit(1);
28
+ }
3
29
 
4
30
  // Disable Clack spinners and animations in non-interactive environments.
5
31
  // Clack only checks the CI env var, so we set it when stdin/stdout aren't TTYs.
@@ -7,4 +33,9 @@ if (!process.stdin.isTTY || !process.stdout.isTTY) {
7
33
  process.env.CI = "true";
8
34
  }
9
35
 
10
- await runCLI();
36
+ import("../dist/cli/index.js")
37
+ .then(({ runCLI }) => runCLI())
38
+ .catch((error) => {
39
+ process.stderr.write(`${error && error.stack ? error.stack : error}\n`);
40
+ process.exitCode = 1;
41
+ });