@ranx729/ducktape-assets 1.2.0 → 1.3.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/AGENTS.md +2 -2
- package/README.md +1 -1
- package/catalog.json +1676 -1676
- package/index.json +10 -10
- package/package.json +3 -3
- package/sets/illuminated-acanthus.json +6 -6
- package/sets/medieval-cutouts.json +6 -6
- package/sets/walters-w102.json +10 -6
- package/src/generate.mjs +2 -2
- package/src/resolver.mjs +5 -0
package/AGENTS.md
CHANGED
|
@@ -11,7 +11,7 @@ Generated. Use these rules; do not edit this file by hand.
|
|
|
11
11
|
|
|
12
12
|
1. **Paste a URL.** Any HTML, CSS or Markdown references one file on jsDelivr, for example `https://cdn.jsdelivr.net/npm/@ranx729/ducktape-assets-walters-w102@1.2.0/webp/rabbit-church-bells-512.webp`. Only that file is transferred. `catalog.json` lists the exact URL of every width and format, so nothing has to be guessed.
|
|
13
13
|
2. **Pick and copy.** Keep a small `ducktape.json` listing the asset ids you want, with optional widths, formats and `masters: true`. `npx @ranx729/ducktape-assets copy` fetches exactly those files into the project (default `src/assets/ducktape/`), verifies every SHA-256 against the manifest, and writes `ducktape.manifest.json` beside them with type, dimensions (native and of the capped master), transparency, render geometry (tile axis, frame slice), thumbhash, licence and attribution per asset. `masters: true` alone copies only the lossless master (for apps that encode their own images); add `formats`, `widths` or `max` to copy ladder files as well. Re-running is idempotent.
|
|
14
|
-
3. **Resolve in code.** `npm i @ranx729/ducktape-assets` installs metadata and a resolver, zero images. `assets.image(id, { width })` returns `src`, `srcset`, `sizes`, width, height, thumbhash, licence, `
|
|
14
|
+
3. **Resolve in code.** `npm i @ranx729/ducktape-assets` installs metadata and a resolver, zero images. `assets.image(id, { width })` returns `src`, `srcset`, `sizes`, width, height, thumbhash, `license`, `attribution` (the bare credit, licence kept separate), `set` / `package` / `version` (where the bytes come from), and `file` / `files` (path, bytes and sha256 of every referenced rung, for scripts that record or verify what they use). Bytes come from the CDN at request time, or from flow 2 when `base` points at the copied directory.
|
|
15
15
|
|
|
16
16
|
Build-time recipe in Node, offline, no network:
|
|
17
17
|
|
|
@@ -47,7 +47,7 @@ Exact-version URLs are immutable and cached for a year. Large sets are split int
|
|
|
47
47
|
|
|
48
48
|
## Rules
|
|
49
49
|
|
|
50
|
-
- Honour the licence block: show the `attribution`
|
|
50
|
+
- Honour the licence block: show the `attribution` credit together with `license` (SPDX id) when the licence requires it; `attribution` is the institution and object for historical sets, or the author for authored and imported ones, and never contains the licence.
|
|
51
51
|
- Never use `@latest` or range URLs; always an exact version from `index.json` or `catalog.json`.
|
|
52
52
|
- Never put a master on a page. Masters are for re-encoding in a build.
|
|
53
53
|
- Images are decorative by default (`alt=""`); use `description` when the image carries meaning.
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Find an asset here, use it in under a minute. This package is metadata and a bui
|
|
|
6
6
|
|
|
7
7
|
1. **Paste a URL.** Any HTML, CSS or Markdown references one file on jsDelivr, for example `https://cdn.jsdelivr.net/npm/@ranx729/ducktape-assets-walters-w102@1.2.0/webp/rabbit-church-bells-512.webp`. Only that file is transferred. `catalog.json` lists the exact URL of every width and format, so nothing has to be guessed.
|
|
8
8
|
2. **Pick and copy.** Keep a small `ducktape.json` listing the asset ids you want, with optional widths, formats and `masters: true`. `npx @ranx729/ducktape-assets copy` fetches exactly those files into the project (default `src/assets/ducktape/`), verifies every SHA-256 against the manifest, and writes `ducktape.manifest.json` beside them with type, dimensions (native and of the capped master), transparency, render geometry (tile axis, frame slice), thumbhash, licence and attribution per asset. `masters: true` alone copies only the lossless master (for apps that encode their own images); add `formats`, `widths` or `max` to copy ladder files as well. Re-running is idempotent.
|
|
9
|
-
3. **Resolve in code.** `npm i @ranx729/ducktape-assets` installs metadata and a resolver, zero images. `assets.image(id, { width })` returns `src`, `srcset`, `sizes`, width, height, thumbhash, licence, `
|
|
9
|
+
3. **Resolve in code.** `npm i @ranx729/ducktape-assets` installs metadata and a resolver, zero images. `assets.image(id, { width })` returns `src`, `srcset`, `sizes`, width, height, thumbhash, `license`, `attribution` (the bare credit, licence kept separate), `set` / `package` / `version` (where the bytes come from), and `file` / `files` (path, bytes and sha256 of every referenced rung, for scripts that record or verify what they use). Bytes come from the CDN at request time, or from flow 2 when `base` points at the copied directory.
|
|
10
10
|
|
|
11
11
|
Build-time recipe in Node, offline, no network:
|
|
12
12
|
|