@codepress/design-kit 0.8.0 → 0.10.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 +146 -7
- package/package.json +3 -2
- package/schema/design-kit.config.schema.json +54 -0
- package/src/capture-pages.mjs +1 -0
- package/src/ci.mjs +76 -113
- package/src/cli.mjs +37 -4
- package/src/config.mjs +40 -0
- package/src/init.mjs +263 -73
- package/src/kit.mjs +347 -25
- package/src/storage/bucket.mjs +237 -0
- package/src/storage/codepress.mjs +363 -0
- package/src/storage/common.mjs +125 -0
- package/src/storage/github.mjs +175 -0
- package/src/storage/index.mjs +149 -0
- package/src/storage/zip.mjs +249 -0
- package/src/templates/design-kit-skill.md +18 -18
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: design-kit
|
|
3
|
-
description: "Draw mockups of this app's screens from its design kit: real pages and Storybook stories captured every day as static HTML, composed into self-contained pages with only the new parts hand-drawn. Use for any mockup, design or screen page of this app. Covers fetching the newest kit with
|
|
3
|
+
description: "Draw mockups of this app's screens from its design kit: real pages and Storybook stories captured every day as static HTML, composed into self-contained pages with only the new parts hand-drawn. Use for any mockup, design or screen page of this app. Covers fetching the newest kit with design-kit fetch, kit find/show/compose, <kit-snippet> and data-kit-new, staleness, captions saying what is real and what is new, and what to do when no kit can be fetched."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Design kit
|
|
@@ -24,28 +24,28 @@ is missing from every kit until it gets one.
|
|
|
24
24
|
|
|
25
25
|
## 1. Fetch the newest kit
|
|
26
26
|
|
|
27
|
-
The workflow runs once a day and on demand (`workflow_dispatch`)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
The workflow runs once a day and on demand (`workflow_dispatch`) and
|
|
28
|
+
{{STORAGE_WHERE}}
|
|
29
|
+
|
|
30
|
+
A day when none of the config's `watch` paths changed skips and uploads
|
|
31
|
+
nothing, yet still succeeds, so ask for the newest kit rather than the
|
|
32
|
+
newest run. `design-kit fetch` downloads it once per kit
|
|
33
|
+
commit (cached under `$TMPDIR/design-kit-<sha>`) and prints `path=`, `sha=`
|
|
34
|
+
and `branch=`:
|
|
32
35
|
|
|
33
36
|
```bash
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
| sort_by(.created_at) | last // empty | \"\(.workflow_run.id) \(.workflow_run.head_sha)\"")
|
|
39
|
-
echo "run=$RUN sha=$SHA" # empty → go to "When there is no kit"
|
|
40
|
-
KIT="${TMPDIR:-/tmp}/design-kit-$SHA"
|
|
41
|
-
if [ -n "$RUN" ] && [ ! -f "$KIT/manifest.json" ]; then
|
|
42
|
-
rm -rf "$KIT.partial" &&
|
|
43
|
-
gh run download "$RUN" --repo "$REPO" -n design-kit -D "$KIT.partial" &&
|
|
44
|
-
mv "$KIT.partial" "$KIT"
|
|
45
|
-
fi
|
|
37
|
+
TOP=$(git rev-parse --show-toplevel)
|
|
38
|
+
OUT=$({{FETCH_CLI}} fetch --config "$TOP/{{CONFIG}}") # fails → "When there is no kit"
|
|
39
|
+
KIT=$(printf '%s\n' "$OUT" | sed -n 's/^path=//p')
|
|
40
|
+
BRANCH=$(printf '%s\n' "$OUT" | sed -n 's/^branch=//p')
|
|
46
41
|
node "$KIT/kit.mjs" info # manifest: sha, built_at, counts, sources
|
|
47
42
|
```
|
|
48
43
|
|
|
44
|
+
{{STORAGE_AUTH}}
|
|
45
|
+
|
|
46
|
+
`--branch <name>` fetches another branch's kit, and `design-kit latest`
|
|
47
|
+
prints the newest kit's `sha=` and `created=` without downloading it.
|
|
48
|
+
|
|
49
49
|
Reuse `$KIT` while the newest kit's SHA is unchanged. Keep the kit and your
|
|
50
50
|
working files in a scratch folder, never in the repository.
|
|
51
51
|
|