peakurl 1.0.1 → 1.0.2

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/bin/peakurl.js CHANGED
@@ -37,7 +37,9 @@ function ensureCliError(error) {
37
37
  var CONFIG_FILENAME = "config.json";
38
38
  var STATE_FILENAME = "state.json";
39
39
  function getConfigPath() {
40
- return join(envPaths("peakurl", { suffix: "" }).config, CONFIG_FILENAME);
40
+ const paths = envPaths("peakurl", { suffix: "" });
41
+ const directory = process.platform === "darwin" ? paths.data : paths.config;
42
+ return join(directory, CONFIG_FILENAME);
41
43
  }
42
44
  function getStatePath() {
43
45
  return join(envPaths("peakurl", { suffix: "" }).config, STATE_FILENAME);
@@ -1798,14 +1800,17 @@ function userLabel(user) {
1798
1800
  function userValue(user) {
1799
1801
  return text4(user.username) || text4(user.email) || String(user.id ?? "");
1800
1802
  }
1801
- function userTable(user) {
1803
+ function userTable(user, apiBaseUrl) {
1802
1804
  const rows2 = [
1803
- ["Name", userLabel(user)],
1804
- ["Username", text4(user.username)],
1805
- ["Email", text4(user.email)],
1805
+ ["ID", user.id === void 0 ? void 0 : String(user.id)],
1806
1806
  ["Role", text4(user.role)],
1807
- ["ID", user.id === void 0 ? void 0 : String(user.id)]
1807
+ ["Username", text4(user.username)],
1808
+ ["Name", userLabel(user)],
1809
+ ["Email", text4(user.email)]
1808
1810
  ].filter((entry) => Boolean(entry[1]));
1811
+ if (apiBaseUrl) {
1812
+ rows2.push(["API URL", apiBaseUrl]);
1813
+ }
1809
1814
  if (rows2.length === 0) {
1810
1815
  return "No user fields returned.";
1811
1816
  }
@@ -2542,7 +2547,7 @@ async function whoami(options) {
2542
2547
  return;
2543
2548
  }
2544
2549
  writeStdout(successLine(response.message));
2545
- writeStdout(userTable(response.data));
2550
+ writeStdout(userTable(response.data, config.apiBaseUrl));
2546
2551
  }
2547
2552
 
2548
2553
  // src/index.ts
package/man/peakurl.1 CHANGED
@@ -305,7 +305,7 @@ This is primarily useful for testing.
305
305
  .Sh FILES
306
306
  .Bl -tag -width "Windows"
307
307
  .It macOS
308
- .Pa ~/Library/Preferences/peakurl/config.json
308
+ .Pa ~/Library/Application Support/peakurl/config.json
309
309
  .It Linux and other Unix systems
310
310
  .Pa ~/.config/peakurl/config.json
311
311
  .It Windows
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peakurl",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Official CLI for creating, listing, and managing PeakURL short links from the terminal",
5
5
  "homepage": "https://peakurl.org",
6
6
  "bugs": {
@@ -51,11 +51,11 @@
51
51
  "env-paths": "^4.0.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@types/node": "^25.9.1",
55
- "prettier": "^3.8.3",
54
+ "@types/node": "^26.1.2",
55
+ "prettier": "^3.9.6",
56
56
  "tsup": "^8.5.1",
57
- "tsx": "^4.22.4",
58
- "typescript": "^6.0.3"
57
+ "tsx": "^4.23.4",
58
+ "typescript": "^7.0.2"
59
59
  },
60
60
  "license": "MIT"
61
61
  }