@baclet/cli 0.1.0 → 0.1.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.
package/README.md CHANGED
@@ -85,6 +85,6 @@ Pushes are additive: new tables, columns, constraints, and indexes are applied i
85
85
 
86
86
  | Variable | Default | Purpose |
87
87
  | --- | --- | --- |
88
- | `BACLET_API_URL` | `https://api.baclet.com` | API host. |
89
- | `BACLET_DASHBOARD_URL` | `https://app.baclet.com` | Fallback activation link host. |
88
+ | `BACLET_API_URL` | `https://api.baclet.app` | API host. |
89
+ | `BACLET_DASHBOARD_URL` | `https://baclet.app` | Fallback activation link host. |
90
90
  | `XDG_CONFIG_HOME` | `~/.config` | Parent directory for credentials. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baclet/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "BACLET command line tool for authentication and schema pushes",
5
5
  "type": "module",
6
6
  "bin": {
package/src/http.js CHANGED
@@ -8,11 +8,11 @@ export class APIError extends Error {
8
8
  }
9
9
 
10
10
  export function apiUrl() {
11
- return (process.env.BACLET_API_URL || "https://api.baclet.com").replace(/\/$/, "");
11
+ return (process.env.BACLET_API_URL || "https://api.baclet.app").replace(/\/$/, "");
12
12
  }
13
13
 
14
14
  export function dashboardUrl() {
15
- return (process.env.BACLET_DASHBOARD_URL || "https://app.baclet.com").replace(/\/$/, "");
15
+ return (process.env.BACLET_DASHBOARD_URL || "https://baclet.app").replace(/\/$/, "");
16
16
  }
17
17
 
18
18
  export async function request({ method = "GET", path, body, token } = {}) {
@@ -0,0 +1,19 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+ import { apiUrl, dashboardUrl } from "./http.js";
4
+
5
+ test("defaults point at baclet.app", () => {
6
+ const previousApi = process.env.BACLET_API_URL;
7
+ const previousDashboard = process.env.BACLET_DASHBOARD_URL;
8
+ delete process.env.BACLET_API_URL;
9
+ delete process.env.BACLET_DASHBOARD_URL;
10
+ try {
11
+ assert.equal(apiUrl(), "https://api.baclet.app");
12
+ assert.equal(dashboardUrl(), "https://baclet.app");
13
+ } finally {
14
+ if (previousApi === undefined) delete process.env.BACLET_API_URL;
15
+ else process.env.BACLET_API_URL = previousApi;
16
+ if (previousDashboard === undefined) delete process.env.BACLET_DASHBOARD_URL;
17
+ else process.env.BACLET_DASHBOARD_URL = previousDashboard;
18
+ }
19
+ });
package/src/index.js CHANGED
@@ -16,8 +16,8 @@ Usage:
16
16
  baclet --help Show this message
17
17
 
18
18
  Environment:
19
- BACLET_API_URL API base URL (default https://api.baclet.com)
20
- BACLET_DASHBOARD_URL Dashboard URL (default https://app.baclet.com)
19
+ BACLET_API_URL API base URL (default https://api.baclet.app)
20
+ BACLET_DASHBOARD_URL Dashboard URL (default https://baclet.app)
21
21
  `;
22
22
 
23
23
  async function main() {