@kdrgny/justjson 1.2.0 → 1.6.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
@@ -39,19 +39,26 @@ Design your schema, enter content, upload images. Everything is written to `cont
39
39
  | **Searchable content table** | Entries listed by title, slug and date. Search and edit instantly — content, not a pile of slugs. |
40
40
  | **Rich-text editor** | Headings, bold, lists, quotes — WYSIWYG, saved to disk as clean, diffable Markdown. |
41
41
  | **Image uploads** | Drop an image; it's resized to WebP in the browser and written under `content/media/`. |
42
- | **Type-safe output** | Generates `types.ts` from your schema, so your content is fully typed in your project. |
42
+ | **Type-safe output** | Generates `types.ts` **and** a zero-dependency `content.ts` loader — `loadPosts()`, `loadSettings()` — so your content is typed in your build. |
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
+ | **Draft / published** | Toggle an entry's status; the generated loader returns published entries by default. |
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. |
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
+ | **English or Turkish** | The editor ships in English; switch to Turkish from the project menu any time. |
43
49
  | **Export any time** | One click downloads schema + content + types as a ZIP. Nothing is ever locked in. |
44
50
  | **The endpoint is yours** | Wherever you put the JSON becomes your API — repo raw, jsDelivr, your build. |
45
51
 
46
- Field types: `text` · `richtext` · `number` · `boolean` · `date` · `select` · `relation` (multi) · `image`.
52
+ Field types: `text` · `richtext` · `number` · `boolean` · `date` · `select` · `relation` (multi) · `image` · `url` · `email` · `list` · `color` · `group` (nested).
47
53
 
48
54
  ## Commands
49
55
 
50
56
  | Command | What it does |
51
57
  |---|---|
52
58
  | `npx @kdrgny/justjson` (or `serve`) | Starts the local editor and opens it in your browser |
53
- | `npx @kdrgny/justjson init [template]` | Scaffolds a schema from a template (`blog`, `cv`, `portfolio`, `docs`, `changelog`) |
54
- | `npx @kdrgny/justjson types` | Generates `types.ts` from your schema |
59
+ | `npx @kdrgny/justjson init [template]` | Scaffolds a schema from a template. `--astro` also generates a working site |
60
+ | `npx @kdrgny/justjson types` | Generates `types.ts` + a typed `content.ts` loader from your schema |
61
+ | `npx @kdrgny/justjson validate` | Checks content against the schema (`--json`, `--strict`) — great for CI |
55
62
  | `npx @kdrgny/justjson export` | Exports a ZIP snapshot (schema + content + types) |
56
63
 
57
64
  ## How it works