Skip to content

Commit 97d5074

Browse files
authored
Merge pull request #441 from cloudflare/staging
Staging -> Main
2 parents a318f08 + 2509dfa commit 97d5074

119 files changed

Lines changed: 12758 additions & 55 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dev.vars.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@
1010
#CLOUDFLARE_API_TOKEN="" # API token with Account-level permissions (see README for required permissions)
1111
#CLOUDFLARE_ACCOUNT_ID="" # Your Cloudflare account ID
1212

13+
# Cloudflare Artifacts read-only "Repo" viewer.
14+
# The viewer proxies Cloudflare's Artifacts REST API, which requires a
15+
# Cloudflare API token with Artifacts *read* permission. By default the proxy
16+
# reuses CLOUDFLARE_API_TOKEN above; set ARTIFACTS_API_TOKEN to use a dedicated,
17+
# least-privilege token instead. (The ARTIFACTS binding's repo tokens are for
18+
# the git remote and are NOT accepted by the REST API.)
19+
#ARTIFACTS_API_TOKEN=""
20+
# ARTIFACTS_NAMESPACE is set as a plain var in wrangler.jsonc; override here for
21+
# local dev if needed.
22+
#ARTIFACTS_NAMESPACE="vibesdk-production"
23+
1324
# Essential Secrets:
1425
#CLOUDFLARE_AI_GATEWAY_TOKEN="" # If this has read and edit permissions, the AI Gateway will be created automatically. run is required at the least
1526

bun.lock

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"@noble/ciphers": "^1.3.0",
6060
"@octokit/rest": "^22.0.1",
6161
"@phosphor-icons/react": "^2.1.10",
62+
"@pierre/diffs": "^1.2.12",
6263
"@radix-ui/react-alert-dialog": "^1.1.15",
6364
"@radix-ui/react-avatar": "^1.1.11",
6465
"@radix-ui/react-checkbox": "^1.3.3",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Change intents
2+
3+
Run `pnpm change` for every change that affects the published package. Commit the generated Markdown file with the code change.
4+
5+
Documentation, tests, and changes limited to private workspace applications do not require an intent.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
artifacts-viewer@0.0.2:
2+
dir: packages/artifacts-viewer
3+
intents:
4+
- orange-pants-talk
5+
artifacts-viewer@0.0.3:
6+
dir: packages/artifacts-viewer
7+
intents:
8+
- cool-lands-watch
9+
- puny-olives-yell
10+
artifacts-viewer@0.0.4:
11+
dir: packages/artifacts-viewer
12+
intents:
13+
- happy-laws-peel
14+
artifacts-viewer@0.0.5:
15+
dir: packages/artifacts-viewer
16+
intents:
17+
- jolly-rules-stay
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# dotenv environment variable files
16+
.env
17+
.env.*
18+
!.env.example
19+
20+
# Editor directories and files
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/extensions.json
24+
.idea
25+
.DS_Store
26+
*.suo
27+
*.ntvs*
28+
*.njsproj
29+
*.sln
30+
*.sw?
31+
32+
# AI agent worktrees
33+
.claude/worktrees/
34+
!.vscode/
35+
!.vscode/settings.json
36+
!.vscode/extensions.json
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["VoidZero.vite-plus-extension-pack"]
3+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"npm.scriptRunner": "vp",
3+
"editor.defaultFormatter": "oxc.oxc-vscode",
4+
"[javascript]": {
5+
"editor.defaultFormatter": "oxc.oxc-vscode"
6+
},
7+
"[javascriptreact]": {
8+
"editor.defaultFormatter": "oxc.oxc-vscode"
9+
},
10+
"[typescript]": {
11+
"editor.defaultFormatter": "oxc.oxc-vscode"
12+
},
13+
"[typescriptreact]": {
14+
"editor.defaultFormatter": "oxc.oxc-vscode"
15+
},
16+
"oxc.fmt.configPath": "./vite.config.ts",
17+
"editor.formatOnSave": true,
18+
"editor.formatOnSaveMode": "file",
19+
"editor.codeActionsOnSave": {
20+
"source.fixAll.oxc": "explicit"
21+
}
22+
}

packages/artifacts-viewer/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 mdhruvil
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# Publishing `artifacts-viewer`
2+
3+
Versions and changelogs are managed by pnpm's native release tooling (`pnpm change` +
4+
`pnpm version -r`). Publishing to npm is done by GitHub Actions via OIDC trusted
5+
publishing — no token is ever held locally or in repository secrets.
6+
7+
Never hand-edit `version` in `packages/artifacts-viewer/package.json`, and never
8+
hand-write `CHANGELOG.md`. Both are generated.
9+
10+
---
11+
12+
## 1. Record a change intent (during development)
13+
14+
Every change that affects the published package needs an intent. Record it in the
15+
same commit as the code change:
16+
17+
```sh
18+
pnpm change
19+
```
20+
21+
This prompts for the affected packages, the bump type, and a summary that becomes the
22+
changelog entry. It writes a file such as `.changeset/calm-cats-resolve.md`.
23+
24+
Non-interactive equivalent:
25+
26+
```sh
27+
pnpm change --bump patch --summary "Fix raw path encoding for nested files" artifacts-viewer
28+
```
29+
30+
Bump types are `patch`, `minor`, `major`, or `none`. Use `none` to explicitly record
31+
that a change needs no release.
32+
33+
Changes limited to documentation, CI, or private workspace apps do not need an intent.
34+
35+
Commit the generated markdown file alongside the code:
36+
37+
```sh
38+
git add .changeset/ packages/
39+
git commit -m "fix: encode raw path segments individually"
40+
```
41+
42+
## 2. Preview the release plan
43+
44+
At any point, see what the pending intents would produce:
45+
46+
```sh
47+
pnpm change status
48+
pnpm version -r --dry-run
49+
```
50+
51+
`change status` lists the pending intent files and the resulting version bumps.
52+
`version -r --dry-run` prints the same plan without touching the working tree.
53+
54+
## 3. Apply the release
55+
56+
The working tree must be clean.
57+
58+
```sh
59+
pnpm version -r
60+
```
61+
62+
This consumes every pending intent and:
63+
64+
- bumps `version` in `packages/artifacts-viewer/package.json`
65+
- propagates bumps to any workspace dependents through `workspace:` ranges
66+
- writes `packages/artifacts-viewer/CHANGELOG.md` (we set
67+
`versioning.changelog.storage: repository` in `pnpm-workspace.yaml`)
68+
- records the consumed intents in `.changeset/ledger.yaml`
69+
70+
It deliberately does **not** create a git commit or tag. pnpm skips those in recursive
71+
mode because a workspace release can bump several packages to different versions.
72+
73+
Verify the workspace still passes before committing:
74+
75+
```sh
76+
vp run ready
77+
```
78+
79+
## 4. Commit and tag
80+
81+
Read the new version back out rather than typing it, so the tag can never disagree
82+
with the manifest:
83+
84+
```sh
85+
VERSION=$(node -p "require('./packages/artifacts-viewer/package.json').version")
86+
87+
git add .
88+
git commit -m "chore(release): artifacts-viewer@${VERSION}"
89+
git tag -a "v${VERSION}" -m "artifacts-viewer@${VERSION}"
90+
git push origin main --follow-tags
91+
```
92+
93+
The tag **must** be exactly `v<version>`. `publish.yml` compares the two and fails the
94+
release if they differ.
95+
96+
## 5. Create the GitHub release
97+
98+
```sh
99+
gh release create "v${VERSION}" --title "v${VERSION}" --generate-notes
100+
```
101+
102+
Publishing to npm triggers on the `release: published` event, so creating the release
103+
is what starts the publish.
104+
105+
## 6. Watch the publish
106+
107+
```sh
108+
gh run watch
109+
```
110+
111+
`.github/workflows/publish.yml` then:
112+
113+
1. runs `vp install --frozen-lockfile`
114+
2. validates that the release tag equals `v<package.json version>`, failing otherwise
115+
3. runs `vp run ready`
116+
4. runs `pnpm pack` then `npm publish <tarball>` from `packages/artifacts-viewer`
117+
(`pnpm pack` rewrites `catalog:` ranges; plain `npm publish` does not —
118+
that is how 0.0.3 shipped broken). pnpm is installed via `pnpm/action-setup`
119+
120+
Authentication is OIDC trusted publishing (`permissions: id-token: write`). There is no
121+
`NODE_AUTH_TOKEN`. npm generates an SLSA provenance attestation automatically.
122+
123+
Confirm the result. Run this **outside** the repository — the root manifest's
124+
`devEngines` requires pnpm, so npm commands fail with `EBADDEVENGINES` from inside it:
125+
126+
```sh
127+
(cd /tmp && npm view artifacts-viewer dist-tags)
128+
```
129+
130+
---
131+
132+
## Trusted publishing configuration
133+
134+
Configured on npmjs.com for the package:
135+
136+
| Field | Value |
137+
| ----------------- | ------------------ |
138+
| Organization | `mdhruvil` |
139+
| Repository | `artifacts-viewer` |
140+
| Workflow filename | `publish.yml` |
141+
| Environment | _(empty)_ |
142+
143+
The binding is to that workflow filename. Renaming `publish.yml`, or moving the
144+
`npm publish` step into a different workflow file, breaks publishing until the trusted
145+
publisher is reconfigured.
146+
147+
## Things that will bite you
148+
149+
- **Do not add `publishConfig.provenance: true`.** Provenance requires OIDC, so the flag
150+
would break any local publish. CI generates provenance automatically without it.
151+
- **Avoid publishing from your laptop.** `pnpm publish` rewrites the workspace root
152+
`package.json` and strips `"private": true`. If you ever must publish locally, check
153+
`git diff` afterwards and revert the root manifest.
154+
- **The first publish already happened.** `0.0.0` was a placeholder published by hand to
155+
bootstrap trusted publishing, and it permanently occupies the `placeholder` dist-tag.
156+
Every release from `0.0.1` onward goes through CI.
157+
- **Intents are consumed, not reused.** Once `pnpm version -r` runs, the intent files are
158+
deleted and recorded in `.changeset/ledger.yaml`. Do not restore them by hand.
159+
160+
## Quick reference
161+
162+
```sh
163+
# during development, per change
164+
pnpm change
165+
166+
# at release time
167+
pnpm version -r
168+
vp run ready
169+
VERSION=$(node -p "require('./packages/artifacts-viewer/package.json').version")
170+
git add . && git commit -m "chore(release): artifacts-viewer@${VERSION}"
171+
git tag -a "v${VERSION}" -m "artifacts-viewer@${VERSION}"
172+
git push origin main --follow-tags
173+
gh release create "v${VERSION}" --title "v${VERSION}" --generate-notes
174+
```

0 commit comments

Comments
 (0)