gistajs 0.1.7 → 0.1.8

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/bin.cjs CHANGED
@@ -1521,14 +1521,21 @@ async function readCliVersion() {
1521
1521
  if (false) {
1522
1522
  throw new Error("Could not resolve the installed gistajs version");
1523
1523
  }
1524
- return "0.1.7";
1524
+ return "0.1.8";
1525
1525
  }
1526
1526
  async function readDefaultProvisionRegion() {
1527
1527
  try {
1528
1528
  let response = await fetch("https://region.turso.io");
1529
1529
  if (!response.ok) return null;
1530
- let region = (await response.text()).trim().toLowerCase();
1531
- return region || null;
1530
+ let body = (await response.text()).trim();
1531
+ if (!body) return null;
1532
+ try {
1533
+ let parsed = JSON.parse(body);
1534
+ let region = parsed.server?.trim().toLowerCase();
1535
+ return region || null;
1536
+ } catch {
1537
+ return body.toLowerCase();
1538
+ }
1532
1539
  } catch {
1533
1540
  return null;
1534
1541
  }
package/dist/index.js CHANGED
@@ -1506,14 +1506,21 @@ async function readCliVersion() {
1506
1506
  if (false) {
1507
1507
  throw new Error("Could not resolve the installed gistajs version");
1508
1508
  }
1509
- return "0.1.7";
1509
+ return "0.1.8";
1510
1510
  }
1511
1511
  async function readDefaultProvisionRegion() {
1512
1512
  try {
1513
1513
  let response = await fetch("https://region.turso.io");
1514
1514
  if (!response.ok) return null;
1515
- let region = (await response.text()).trim().toLowerCase();
1516
- return region || null;
1515
+ let body = (await response.text()).trim();
1516
+ if (!body) return null;
1517
+ try {
1518
+ let parsed = JSON.parse(body);
1519
+ let region = parsed.server?.trim().toLowerCase();
1520
+ return region || null;
1521
+ } catch {
1522
+ return body.toLowerCase();
1523
+ }
1517
1524
  } catch {
1518
1525
  return null;
1519
1526
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gistajs",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Scaffold and manage Gista.js starter projects",
5
5
  "keywords": [
6
6
  "cli",