@glw907/cairn-cms 0.57.1 → 0.59.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/CHANGELOG.md +66 -0
- package/dist/components/CairnMediaLibrary.svelte +2070 -26
- package/dist/components/CairnMediaLibrary.svelte.d.ts +10 -2
- package/dist/components/admin-icons.d.ts +5 -0
- package/dist/components/admin-icons.js +5 -0
- package/dist/components/cairn-admin.css +402 -3
- package/dist/content/media-rewrite.d.ts +65 -0
- package/dist/content/media-rewrite.js +442 -0
- package/dist/log/events.d.ts +1 -1
- package/dist/media/bulk-delete-plan.d.ts +24 -0
- package/dist/media/bulk-delete-plan.js +25 -0
- package/dist/media/orphan-scan.d.ts +37 -0
- package/dist/media/orphan-scan.js +42 -0
- package/dist/media/reconcile.d.ts +3 -0
- package/dist/media/reconcile.js +3 -2
- package/dist/media/rewrite-plan.d.ts +65 -0
- package/dist/media/rewrite-plan.js +61 -0
- package/dist/sveltekit/cairn-admin.d.ts +8 -0
- package/dist/sveltekit/cairn-admin.js +15 -0
- package/dist/sveltekit/content-routes.d.ts +118 -4
- package/dist/sveltekit/content-routes.js +572 -1
- package/dist/sveltekit/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/lib/components/CairnMediaLibrary.svelte +2070 -26
- package/src/lib/components/admin-icons.ts +5 -0
- package/src/lib/content/media-rewrite.ts +555 -0
- package/src/lib/log/events.ts +6 -1
- package/src/lib/media/bulk-delete-plan.ts +54 -0
- package/src/lib/media/orphan-scan.ts +74 -0
- package/src/lib/media/reconcile.ts +3 -2
- package/src/lib/media/rewrite-plan.ts +122 -0
- package/src/lib/sveltekit/cairn-admin.ts +15 -0
- package/src/lib/sveltekit/content-routes.ts +722 -5
- package/src/lib/sveltekit/index.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,72 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are recorded here, most recent first.
|
|
4
4
|
|
|
5
|
+
## 0.59.0
|
|
6
|
+
|
|
7
|
+
<!-- release-size: minor -->
|
|
8
|
+
|
|
9
|
+
The Media Library learns to clear out images in bulk and to collect the files nothing uses any more.
|
|
10
|
+
Two surfaces ship together, sharing one safety floor: a strict cross-branch usage index built fresh
|
|
11
|
+
per action, and a refusal that commits nothing when usage cannot be verified.
|
|
12
|
+
|
|
13
|
+
Multi-select lands in both the grid and the table. Tick the images you mean, a sticky bar shows the
|
|
14
|
+
count, and one Delete runs the single safe-delete gate across the whole selection. cairn deletes the
|
|
15
|
+
assets nothing references and skips any still in use, reporting them rather than force-deleting one.
|
|
16
|
+
The batch is one commit that removes the manifest rows before the R2 objects, so a bulk delete is
|
|
17
|
+
recoverable from git history the same way a single safe-delete is. The dialog is a plain confirm with
|
|
18
|
+
the count, since nothing in use can be removed this way.
|
|
19
|
+
|
|
20
|
+
Find orphaned files collects stored bytes that drifted loose from content. It pairs a storage
|
|
21
|
+
reconcile with a strict usage read and reports two populations. Orphaned files are stored R2 bytes
|
|
22
|
+
with no manifest row and no reference anywhere across `main` and every open branch; a branch-only
|
|
23
|
+
upload is excluded, because the branch that uploaded it still references it. Broken references are the
|
|
24
|
+
reverse, a manifest row whose bytes are gone, shown as a read-only data-integrity readout with no
|
|
25
|
+
delete. The scan fails closed at detection: a branch it cannot read produces no result and an offer
|
|
26
|
+
to check again, rather than a half-answer that might call an in-use file orphaned.
|
|
27
|
+
|
|
28
|
+
The byte purge is the one irreversible media action. Everything else in the Library edits git-tracked
|
|
29
|
+
state and can be walked back from history, but raw R2 bytes carry no git record, so a purge cannot be
|
|
30
|
+
undone. It gates on a typed-count confirm, and at action time it re-derives the orphan set and
|
|
31
|
+
re-checks the strict usage index, so a key claimed by a new manifest row or referenced on a branch
|
|
32
|
+
since the scan is skipped, never purged. The shipped "Unused" triage facet is renamed to "No
|
|
33
|
+
references found", with the raw-HTML caveat stated where an editor acts: absence of a found reference
|
|
34
|
+
is not proof of disuse, since cairn cannot see an image hidden in raw HTML or a URL hardcoded in a
|
|
35
|
+
template.
|
|
36
|
+
|
|
37
|
+
No consumer action is required. The whole surface is admin-side and additive, with no public surface
|
|
38
|
+
change and no content-format change. An editor walkthrough is in
|
|
39
|
+
[manage the media library](docs/guides/manage-the-media-library.md), and the design rationale is in
|
|
40
|
+
[media storage](docs/explanation/media-storage.md).
|
|
41
|
+
|
|
42
|
+
## 0.58.0
|
|
43
|
+
|
|
44
|
+
<!-- release-size: minor -->
|
|
45
|
+
|
|
46
|
+
The Media Library learns to fix an image everywhere it is used. Two new operations rewrite every
|
|
47
|
+
placement of one asset in a single commit to `main`, each behind a preview an editor confirms before
|
|
48
|
+
anything changes. Both read usage across `main` and every open edit branch, both report the held edits
|
|
49
|
+
they will not touch, and both fail closed when usage cannot be verified.
|
|
50
|
+
|
|
51
|
+
Replace swaps the file behind an image without revisiting the pages that use it. cairn is
|
|
52
|
+
content-addressed, so a corrected upload is a new object with a new content hash; replace repoints
|
|
53
|
+
every published reference from the old hash to the new one and keeps the slug, so `media:first-light.<old>`
|
|
54
|
+
becomes `media:first-light.<new>` and the name an author sees is unchanged. The old row and its R2 bytes
|
|
55
|
+
are kept, recoverable from git history, rather than erased. A typed-slug confirm gates the apply, since
|
|
56
|
+
it rewrites published content and can break a draft, and the preview names the open edit branches still
|
|
57
|
+
on the old file. Those branches keep the old file until they republish; they are never rewritten.
|
|
58
|
+
|
|
59
|
+
Push alt fills missing descriptions from one place. An image's default alt copies into every placement
|
|
60
|
+
that has none, in one atomic commit. An explicit opt-in, off by default, also overwrites placements
|
|
61
|
+
that already carry a custom alt, since that replaces an author's words. A frontmatter hero marked
|
|
62
|
+
decorative is skipped, because its empty alt is deliberate. The media manifest is not changed: the
|
|
63
|
+
default alt is read from the row, never rewritten there. Alt fill is reversible and frequent, so it
|
|
64
|
+
carries no typed-slug gate.
|
|
65
|
+
|
|
66
|
+
No consumer action is required. Both operations are admin-side and additive, with no public surface
|
|
67
|
+
change and no content-format change. An editor walkthrough is in
|
|
68
|
+
[manage the media library](docs/guides/manage-the-media-library.md), and the design rationale is in
|
|
69
|
+
[media storage](docs/explanation/media-storage.md).
|
|
70
|
+
|
|
5
71
|
## 0.57.1
|
|
6
72
|
|
|
7
73
|
Media polish and cutover DX, the first follow-on after the `0.57.0` media stack. The Media Library
|