@kdrgny/justjson 1.6.0 → 1.7.0

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
@@ -43,7 +43,7 @@ Design your schema, enter content, upload images. Everything is written to `cont
43
43
  | **Validate in CI** | `justjson validate` checks content against the schema — broken relations, duplicate slugs, missing media, type errors. Exits non-zero on failure. |
44
44
  | **Draft / published** | Toggle an entry's status; the generated loader returns published entries by default. |
45
45
  | **One-click site** | No site yet? `init --astro` (or a button in the editor) generates a working Astro site around your content. |
46
- | **Ship it** | Setup snippet for your framework, one-click content commit, push to GitHub — using the `git`/`gh` already on your machine. |
46
+ | **Ship it** | Setup snippet for your framework, one-click content commit, push to GitHub, then deploy links for Vercel and Netlify — using the `git`/`gh` already on your machine. No tokens stored. |
47
47
  | **Astro collections** | [`@kdrgny/justjson-astro`](https://www.npmjs.com/package/@kdrgny/justjson-astro) turns your content into typed Astro content collections in one line. |
48
48
  | **English or Turkish** | The editor ships in English; switch to Turkish from the project menu any time. |
49
49
  | **Export any time** | One click downloads schema + content + types as a ZIP. Nothing is ever locked in. |
package/dist/cli.js CHANGED
@@ -5602,7 +5602,7 @@ function formatJson(issues) {
5602
5602
  import { access, mkdir as mkdir2, writeFile as writeFile3 } from "fs/promises";
5603
5603
  import { dirname as dirname2, join as join4 } from "path";
5604
5604
  var ASTRO_VERSION = "^5.18.0";
5605
- var LOADER_VERSION = "^1.6.0";
5605
+ var LOADER_VERSION = "^1.7.0";
5606
5606
  var STYLE = ` <style is:global>
5607
5607
  :root { color-scheme: light dark; }
5608
5608
  body {
@@ -5809,6 +5809,14 @@ async function detectFramework(root2) {
5809
5809
  import { execFile } from "child_process";
5810
5810
  import { promisify } from "util";
5811
5811
  var run = promisify(execFile);
5812
+ function remoteWebUrl(remote) {
5813
+ if (!remote) return null;
5814
+ const ssh = remote.match(/^(?:ssh:\/\/)?git@([^:/]+)[:/](.+?)(?:\.git)?$/);
5815
+ if (ssh) return `https://${ssh[1]}/${ssh[2]}`;
5816
+ const https = remote.match(/^https?:\/\/(?:[^@]+@)?(.+?)(?:\.git)?$/);
5817
+ if (https) return `https://${https[1]}`;
5818
+ return null;
5819
+ }
5812
5820
  async function git(root2, args) {
5813
5821
  const { stdout } = await run("git", args, { cwd: root2 });
5814
5822
  return stdout.trim();
@@ -5836,6 +5844,7 @@ async function gitStatus(root2, contentDir) {
5836
5844
  branch: null,
5837
5845
  hasRemote: false,
5838
5846
  remoteUrl: null,
5847
+ remoteWebUrl: null,
5839
5848
  pendingFiles: 0,
5840
5849
  hasGh: await hasGh()
5841
5850
  };
@@ -5848,6 +5857,7 @@ async function gitStatus(root2, contentDir) {
5848
5857
  branch: branch || null,
5849
5858
  hasRemote: remoteUrl !== null,
5850
5859
  remoteUrl,
5860
+ remoteWebUrl: remoteWebUrl(remoteUrl),
5851
5861
  pendingFiles: porcelain ? porcelain.split("\n").filter(Boolean).length : 0,
5852
5862
  hasGh: await hasGh()
5853
5863
  };
@@ -6013,6 +6023,16 @@ async function createServer(root2) {
6013
6023
  return c.json({ error: e.message }, 400);
6014
6024
  }
6015
6025
  });
6026
+ app.post("/api/_ship/publish", async (c) => {
6027
+ const { message } = await c.req.json().catch(() => ({}));
6028
+ try {
6029
+ const commit = await commitContent(root2, contentDir, message?.trim() || "content: update");
6030
+ const { branch } = await pushContent(root2);
6031
+ return c.json({ committed: commit.committed, count: commit.count, branch });
6032
+ } catch (e) {
6033
+ return c.json({ error: e.message }, 400);
6034
+ }
6035
+ });
6016
6036
  app.post("/api/_ship/push", async (c) => {
6017
6037
  try {
6018
6038
  return c.json(await pushContent(root2));