@codepress/design-kit 0.7.0 → 0.9.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.
@@ -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 gh, 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."
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`), and uploads
28
- the `design-kit` artifact (kept 90 days; older kits are deleted). A day when
29
- none of the config's `watch` paths changed skips and uploads nothing, yet
30
- still succeeds, so look up the newest artifact rather than the newest run,
31
- then download it once per kit commit:
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
- REPO=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
35
- BRANCH=$(gh repo view --json defaultBranchRef --jq .defaultBranchRef.name)
36
- read -r RUN SHA < <(gh api "repos/$REPO/actions/artifacts?name=design-kit&per_page=100" \
37
- --jq "[.artifacts[] | select((.expired | not) and .workflow_run.head_branch == \"$BRANCH\")]
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