Skip to content

Commit 5ee3313

Browse files
csandmanclaude
andauthored
chore: Port consistency tweaks from main (#414)
* chore: Port consistency tweaks from main Bundle of small, mechanical changes already shipped on main that apply cleanly to v5: CI workflows: - Bump Node 22 → 24 on lint, pkg-pr, package-size-report jobs (publish was already on 24 for OIDC). - Name previously-anonymous workflow steps for clearer logs. - Drop quotes around `cache: pnpm` for consistency with other workflow inputs. - Rename zizmor-scan.yml → zizmor.yml. publish.yml hardening: - Quote shell variables ("$TAG_NAME", "$GITHUB_OUTPUT", "$TARBALL") against IFS / glob expansion surprises. - Move the `env:` block above `run:` to match the convention on other steps. Dep-script protection: - Drop .npmrc (`ignore-scripts=true`). pnpm's `allowBuilds` whitelist in pnpm-workspace.yaml already gates dependency install scripts with finer granularity; the publish workflow passes --ignore-scripts to `pnpm install` explicitly for the high-stakes path. Removing the blanket flag lets husky's `prepare` script run automatically on fresh installs. - Update CONTRIBUTING.md to reflect the model change. - Drop the now-obsolete `.npmrc` → `ini` files.associations entry from .vscode/settings.json; add `typescript.tsdk` so VS Code picks up the workspace TS version. Lint-staged: - Move config from package.json to .lintstagedrc.mjs. - Add an `*.mjs` override to .oxlintrc.json so the new config file doesn't trip nodejs-modules / unsafe-* rules. Docs: - Add SECURITY.md describing the support window and the GitHub Security Advisories reporting path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(publish): Pack tarball with --ignore-scripts Without .npmrc's ignore-scripts=true, `npm pack` runs the project's own `prepare` script (husky), which dumps lifecycle output to stdout. TARBALL=$(npm pack) captures that output alongside the tarball filename, producing a multi-line value that breaks $GITHUB_OUTPUT's key=value\n format and fails the build job. pnpm's `allowBuilds` whitelist only gates *dependency* install scripts; it doesn't suppress the project's own scripts during `npm pack`. Adding --ignore-scripts to the pack invocation restores clean stdout. Husky's `prepare` doesn't need to run during CI pack — git hooks aren't relevant in the ephemeral runner. Same fix as #416 on main; included here so the v5 publish flow doesn't regress when .npmrc is dropped. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(actions): Bump upload-artifact v4 → v7 for Node 24 v4.6.2 runs on Node 20, which GitHub deprecated in their September 2025 changelog. Workflow runs now emit a warning; Node 20 actions will be force-upgraded to Node 24 by default on 2026-06-02 and removed entirely on 2026-09-16. v7.0.1 runs on Node 24 and is otherwise drop-in for our usage (simple name + path inputs, no merging or advanced features). Same change as on main; included here so v5 doesn't carry the deprecation warning forward. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6440915 commit 5ee3313

12 files changed

Lines changed: 91 additions & 29 deletions

File tree

.github/workflows/lint.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,19 @@ jobs:
1414
contents: read
1515

1616
steps:
17-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17+
- name: Checkout
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1819
with:
1920
persist-credentials: false
2021

2122
- name: Install pnpm
2223
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
2324

24-
- name: Use Node.js 22
25+
- name: Use Node.js 24
2526
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
2627
with:
27-
node-version: 22
28-
cache: "pnpm"
28+
node-version: 24
29+
cache: pnpm
2930

3031
- name: Install Dependencies
3132
run: pnpm install

.github/workflows/package-size-report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
- name: Setup Node.js
2525
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
2626
with:
27-
node-version: 22
28-
cache: "pnpm"
27+
node-version: 24
28+
cache: pnpm
2929

3030
- name: Install dependencies
3131
run: pnpm install

.github/workflows/pkg-pr.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,17 @@ jobs:
2424
- name: Install pnpm
2525
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
2626

27-
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
27+
- name: Use Node.js 24
28+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
2829
with:
29-
node-version: 22
30-
cache: "pnpm"
30+
node-version: 24
31+
cache: pnpm
3132

3233
- name: Install dependencies
3334
run: pnpm install
3435

3536
- name: Build
3637
run: pnpm build
3738

38-
- run: pnpm dlx pkg-pr-new publish --compact --template './demo'
39+
- name: Publish preview release
40+
run: pnpm dlx pkg-pr-new publish --compact --template './demo'

.github/workflows/publish.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,18 @@ jobs:
7070
run: pnpm build
7171

7272
- name: Align package.json version with release tag
73-
run: npm version $TAG_NAME --git-tag-version=false --allow-same-version
7473
env:
7574
TAG_NAME: ${{ github.ref_name }}
75+
run: npm version "$TAG_NAME" --git-tag-version=false --allow-same-version
7676

7777
- name: Pack tarball
7878
id: pack
7979
run: |
80-
TARBALL=$(npm pack)
81-
echo "tarball=$TARBALL" >> $GITHUB_OUTPUT
80+
TARBALL=$(npm pack --ignore-scripts)
81+
echo "tarball=$TARBALL" >> "$GITHUB_OUTPUT"
8282
8383
- name: Upload tarball artifact
84-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
84+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
8585
with:
8686
name: tarball
8787
path: ${{ steps.pack.outputs.tarball }}
@@ -109,4 +109,4 @@ jobs:
109109
registry-url: "https://registry.npmjs.org"
110110

111111
- name: Publish to npm
112-
run: npm publish --provenance --access public --tag chakra2 $TARBALL
112+
run: npm publish --provenance --access public --tag chakra2 "$TARBALL"

.lintstagedrc.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const config = {
2+
"demo/**/*.{js,jsx,ts,tsx}":
3+
"oxlint -c demo/.oxlintrc.json --disable-nested-config --fix",
4+
"!(demo|codemod)/**/*.{js,jsx,ts,tsx}":
5+
"oxlint -c .oxlintrc.json --disable-nested-config --fix",
6+
"*": "oxfmt",
7+
};
8+
9+
export default config;

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.oxlintrc.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,15 @@
124124
"sort-keys": "off",
125125
"unicorn/no-null": "off"
126126
},
127-
"overrides": []
127+
"overrides": [
128+
{
129+
"files": ["*.mjs"],
130+
"rules": {
131+
"import/no-nodejs-modules": "off",
132+
"@typescript-eslint/no-unsafe-argument": "off",
133+
"@typescript-eslint/no-unsafe-call": "off",
134+
"@typescript-eslint/no-unsafe-return": "off"
135+
}
136+
}
137+
]
128138
}

.vscode/settings.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
2+
"typescript.tsdk": "node_modules/typescript/lib",
23
"editor.defaultFormatter": "oxc.oxc-vscode",
34
"editor.formatOnSave": true,
4-
"files.associations": {
5-
".npmrc": "ini"
6-
},
75
"[json]": {
86
"editor.defaultFormatter": "oxc.oxc-vscode"
97
},

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ welcome, from issue reports to PRs and documentation / write-ups.
55

66
Before you open a PR:
77

8-
- In development, run `pnpm install` to setup the dependencies for the
9-
core package and the demo. On a fresh clone, also run `pnpm prepare` once
10-
to install the git hooks (lifecycle scripts are disabled via `.npmrc` for
11-
supply-chain safety, so husky doesn't auto-install).
8+
- In development, run `pnpm install` to setup the dependencies for the core
9+
package and the demo. Dependency install scripts are gated by pnpm's
10+
[`allowBuilds`](./pnpm-workspace.yaml) whitelist for supply-chain safety;
11+
husky's `prepare` script runs automatically on install.
1212
- Run `pnpm dev` to build (and watch) the package source, as well as run the
1313
demo project which can be viewed at http://localhost:5152.
1414
- Please ensure all the examples work correctly after your change.

0 commit comments

Comments
 (0)