@farthershore/cli 0.3.2 → 0.3.3
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/build-info.d.ts +1 -0
- package/dist/build-info.js +10 -0
- package/dist/config.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BUILD_API_URL = "https://core.farthershore.com";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Build-time constants baked into the CLI binary at publish time.
|
|
2
|
+
//
|
|
3
|
+
// To publish a staging variant:
|
|
4
|
+
// 1. Change BUILD_API_URL below to the staging URL
|
|
5
|
+
// 2. Change the npm package name/tag in package.json
|
|
6
|
+
// 3. Run `npm publish`
|
|
7
|
+
//
|
|
8
|
+
// The CLI uses this as the default API URL — users don't need to set
|
|
9
|
+
// FARTHERSHORE_API_URL or pass --api-url for their target environment.
|
|
10
|
+
export const BUILD_API_URL = "https://core.farthershore.com";
|
package/dist/config.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
+
import { BUILD_API_URL } from "./build-info.js";
|
|
5
6
|
const CONFIG_DIR = join(homedir(), ".farthershore");
|
|
6
7
|
const CONFIG_FILE = join(CONFIG_DIR, "config.json");
|
|
7
8
|
const CREDENTIALS_FILE = join(CONFIG_DIR, "credentials.json");
|
|
@@ -12,7 +13,7 @@ function ensureDir(dir) {
|
|
|
12
13
|
}
|
|
13
14
|
// --- Config ---
|
|
14
15
|
const DEFAULT_CONFIG = {
|
|
15
|
-
apiUrl:
|
|
16
|
+
apiUrl: BUILD_API_URL,
|
|
16
17
|
defaultFormat: "table",
|
|
17
18
|
};
|
|
18
19
|
export function loadConfig() {
|