Repository navigation
feat!: rename to @variablelab/theme-toggle 2.0.0 and move CI to withvariablelab - #8
Merged
Merged
Conversation
…e key - package name, repository/homepage/bugs URLs and changelog-github repo now point at @variablelab/theme-toggle and withvariablelab/theme-toggle - the localStorage key and the change event move to the @variablelab/theme-toggle.* namespace - on init, the inline script and useColorMode copy a value stored under the old @vlandoss/theme-toggle.colorMode key to the new key (only when the new key is absent) and remove the old key, so upgrading keeps the user's choice - README (including the unpkg URL and an upgrade section) and CHANGELOG heading renamed; major changeset describing the breaking change Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…an 24 h minimumReleaseAge needs pnpm >= 10.16. The setting lives in .npmrc rather than pnpm-workspace.yaml because @rrlab/cli (via @vlandoss/clibuddy) treats any pnpm-workspace.yaml as a monorepo marker, which breaks `rr tsc` in this single-package repo. Our own scopes (@variablelab/*, @rrlab/*) are exempt. The lockfile is unchanged: `pnpm install --frozen-lockfile` passes on 10.30.3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…b previews - every workflow declares its permissions (the org default token is read-only); checkouts use persist-credentials: false - release: drop NPM_TOKEN, publish through npm trusted publishing (OIDC); mint the vland-bot token with create-github-app-token v3 (client id, scoped to contents and pull-requests write) and pass it to changesets, so the bot opens the version PR and CI runs on it; derive the git identity from the app slug instead of hardcoding the bot user id - previews in two jobs: `preview` runs the PR code and publishes via OIDC (mode: publish, publish_mode: oidc-only), exposing only the package list; `preview-comment` calls the gh-actions reusable workflow, which never checks out PR code and is the only place the bot key is used - actions from withvariablelab/gh-actions (tracked at @main), every other action pinned by full SHA - CI audits the workflows with zizmor 1.30.1 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: a9eb3a2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
preview-comment.yml (withvariablelab/gh-actions, chore/two-job-previews) requires an `action` input naming the action that renders the comment; this repo publishes with preview-release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When pnpm is launched through npm (`npx pnpm`, `npm exec`, `npm run`), npm re-exports `minimum-release-age-exclude[]` as one `npm_config_minimum_release_age_exclude="@variablelab/*\n\n@rrlab/*"` string. pnpm 10.30.3 then exempts every package, so the 24 h cooldown has no effect. A single unrelated entry (`@foo/*`) does the same. When pnpm is run directly (mise, pnpm/action-setup, nested `pnpm run`), it parses the array correctly. Keep only `minimum-release-age=1440`, so own scopes wait 24 h too. Checked on pnpm 10.30.3 with the age raised to 2 years: `pnpm add typescript@5.9.2 --lockfile-only` fails with ERR_PNPM_NO_MATURE_MATCHING_VERSION both directly and via `npx pnpm`, and `--config.minimum-release-age=0` overrides it. `pnpm install --frozen-lockfile` still passes. The excludes come back once the setting can move to pnpm-workspace.yaml (withvariablelab/dx#249). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
preview-release core.ts treats any project .npmrc as token-only when publish_mode is auto, and this repo has no NPM_TOKEN. The explicit `oidc-only` must stay until .npmrc can be deleted (withvariablelab/dx#249). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
migrateLegacyColorMode() used to return early when both keys existed, so `@vlandoss/theme-toggle.colorMode` stayed in localStorage forever. D2 says the old key is copied and then deleted. Now, whenever the legacy key exists, its value is copied only if the new key is absent (a stored new value still wins), and the legacy key is then removed either way. The two "both present" tests now expect the legacy key to be gone. With the previous implementation both fail, and all 25 pass with this one. The changeset, README and JSDoc describe the new behavior. dist/initial.js stays at 756 B. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comments and docs now explain each policy on their own; the decision history lives in git. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MrWogBto4w6eFAaVEkczQf
rqbazan
marked this pull request as ready for review
October 13, 2026 00:44
Merged
@variablelab/theme-toggle 2.0.0 and move CI to withvariablelab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@vlandoss/theme-togglebecomes@variablelab/theme-toggle2.0.0, and CI moves to withvariablelab (npm OIDC, vland-bot viacreate-github-app-token@v3, two-job previews, zizmor).What to review
1. Key/event rename + automatic migration (
src/const.ts,src/migrate.ts,src/initial.ts,src/index.ts)@variablelab/theme-toggle.colorMode, event@variablelab/theme-toggle.colorModeChange.migrateLegacyColorMode()runs on init in both the inline script and theuseColorModeinitializer (apps that skip the inline script still migrate). If the new key is absent and@vlandoss/theme-toggle.colorModeexists, the value is copied and the old key removed.e986ef7), so no stale 1.x entry is left in localStorage.dist/initial.jsis 756 B (gzip 0.39 kB).2. Changeset
.changeset/renamed-to-variablelab.md(major): explains the rename, the new key/event, and the automatic migration. README gets the unpkg URL, the table, and an "Upgrading from 1.x" section. The CHANGELOG heading and its old links point to withvariablelab.3. Release-age cooldown: in
.npmrc, notpnpm-workspace.yaml, and without the exclude list.npmrcholds onlyminimum-release-age=1440. pnpm → 10.30.3 (packageManager+mise.toml). The lockfile is unchanged and--frozen-lockfilepasses..npmrc:@rrlab/cli1.3.0 (via@vlandoss/clibuddy0.7.1,Pkg.isMonorepo()) treats anypnpm-workspace.yamlas a monorepo.rr tscthen throwsInvalid workspace patterns, which breaksrr checkand the pre-commit hook. Withpackages: ["."]it silently skips the typecheck instead. Tracked in clibuddy: treat pnpm-workspace.yaml as a workspace only when it declares packages dx#249.4724d0c):minimum-release-age-exclude[]lines in.npmrcdisable the cooldown for every package when pnpm is launched through npm (npx pnpm,npm exec,npm run). npm re-exports the array as onenpm_config_minimum_release_age_exclude="@variablelab/*\n\n@rrlab/*"string, and pnpm 10.30.3 then exempts everything, even with a single unrelated@foo/*entry. When pnpm runs directly (I tested mise and a nestedpnpm run), the array was parsed and enforced correctly. CI'spnpm/action-setupalso runs pnpm directly, and CI installs use--frozen-lockfile, which doesn't re-resolve versions, so the cooldown matters mostly for localpnpm add/update. The setting still must not depend on how pnpm is launched.@variablelab/*and@rrlab/*wait 24 h too. To adopt a fresh own release right away:pnpm add <pkg> --config.minimum-release-age=0.1051200):pnpm add typescript@5.9.2 --lockfile-onlyfails withERR_PNPM_NO_MATURE_MATCHING_VERSIONboth directly and vianpx pnpm.@rrlab/ts-config@0.0.2is now rejected too, and--config.minimum-release-age=0overrides it. With the previous two exclude lines, thenpx pnpmrun succeeded (bypass reproduced)..npmrc: npm warnsUnknown project config "minimum-release-age"on every command, and pnpm 11 stops reading it: withminimum-release-age=1051200in.npmrc, pnpm 11.28.5 acceptstypescript@5.9.2. preview-release also treats any project.npmrcas token-only, sopublish_mode: oidc-onlymust stay explicit inrelease.yml; a comment there now says so (45512fe).@rrlab/cli, move the setting plusminimumReleaseAgeExclude: ["@variablelab/*", "@rrlab/*"]topnpm-workspace.yaml(honored there regardless of launcher, verified) and delete.npmrc.4.
release.ymlpermissions: {}at the top; each job grants only what it needs.release:id-token: write+contents: read. NoNPM_TOKEN: changesets/action v1.9.0 detects OIDC andchangeset publishuses trusted publishing, the same pattern as withvariablelab/env (its 0.5.0/0.5.1 showtrustedPublisheron npm).create-github-app-token@v3(SHA-pinned) withclient-id: vars.VLAND_BOT_CLIENT_ID,private-key: secrets.VLAND_BOT_PRIVATE_KEY,permission-contents: write,permission-pull-requests: write.app-slugplus the<slug>[bot]user id, passed throughenv:(not interpolated intorun:). The282456776is no longer hardcoded.app/vland-bot.persist-credentials: false: changesets/action writes~/.netrcwith itsGITHUB_TOKEN(the bot token) and pushes through it. Validated by reading the action's source, not by a CI run.preview(same trigger conditions):id-token: write+contents: read, checkout without persisted credentials,preview-releasewithmode: publish+publish_mode: oidc-only. It only exposesoutputs.packages.preview-comment:needs: preview,if: needs.preview.result == 'success',permissions: {}. It calls the reusablepreview-comment.yml@mainwithaction: preview-release,packagesandsecrets: VLAND_BOT_PRIVATE_KEY. It never checks out or runs PR code.workflow_callcontract on gh-actionschore/two-job-previewsat8113f3e. That commit was local and not yet pushed when I checked. actionlint ran on a scratch copy with the reusable workflow made local: inputs and secrets match, and a negative control confirmed it rejects a missingaction. If that branch changes the interface before merging, this block must follow.5.
ci.yml:contents: read, gh-actions → withvariablelab, SHA pins, plus a newzizmorjob (pipx run --spec zizmor==1.30.1, with a read-onlyGH_TOKENfor the online audits).zizmor: 0 findings locally (offline, default persona). The 5
@mainreferences to first-party gh-actions are ignored inline (tracked at@mainon purpose). gh-actions gets the same result with a.github/zizmor.ymlpolicy (withvariablelab/*: ref-pin) instead; switching to that is easy if you prefer it. The auditor persona also flagssecrets-outside-env(the bot key outside a GitHub environment). That is optional hardening: it needs a repo environment, so it is not done here. actionlint is clean too.Before merging (your side)
VLAND_BOT_CLIENT_IDand secretVLAND_BOT_PRIVATE_KEYavailable to this repoAfter merging, keeping 2.0.0 as the first version
The package version stays
1.0.0until changesets bumps it, so don't seed-publish from this branch: that would publish the breaking 2.0 code as@variablelab/theme-toggle@1.0.0. Suggested order:chore: update versions(2.0.0).pnpm rr pack && pnpm publish --access public --otp=<2FA>, thennpm trust github @variablelab/theme-toggle --repo withvariablelab/theme-toggle --file release.yml --allow-publish(npm refuses a trust config without a permission flag, and--allow-publishdefaults to false).changeset publishskips 2.0.0 because it is already published, so CI won't create the@variablelab/theme-toggle@2.0.0git tag or the GitHub release. If you want them, runpnpm changeset tag && git push origin --tagsfrom the mergedmain, then create the release by hand.previewlabel, or a patch changeset.NPM_TOKENif nothing else uses it;npm deprecate @vlandoss/theme-toggle "Moved to @variablelab/theme-toggle"; updatecontrol/apps/panel.Verified locally
pnpm install --frozen-lockfile(pnpm 10.30.3),pnpm rr check(biome + oxlint type-check),pnpm test(25/25, Chromium via Playwright),pnpm rr pack,zizmor1.30.1 (offline),actionlint1.7.12. All re-run one986ef7. zizmor: 0 findings (5 ignored, 5 suppressed).dist/initial.js: still 756 B.Not verified
Anything that only runs in CI: the OIDC publish, minting the app token, pushes through
.netrc, the preview → preview-comment handoff, and zizmor's online audits.🤖 Generated with Claude Code
https://claude.ai/code/session_01MrWogBto4w6eFAaVEkczQf