styleproof 4.4.16 → 4.4.18

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/CHANGELOG.md CHANGED
@@ -7,6 +7,26 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [4.4.18] - 2026-07-13
11
+
12
+ ### Fixed
13
+
14
+ - **Generated cold-cache workflows now publish from a clean tracked tree.** Yarn,
15
+ pnpm, and Bun restore only the package metadata changed by the temporary exact
16
+ StyleProof install while retaining that release in `node_modules` for capture.
17
+
18
+ ## [4.4.17] - 2026-07-13
19
+
20
+ ### Fixed
21
+
22
+ - **Generated cache-first CI now preserves the installed StyleProof release across
23
+ base checkouts.** Cold-cache capture installs the head's exact release into an
24
+ older base checkout and invokes the installed binary directly, preventing package
25
+ manager reconciliation from silently running the base's older capture logic.
26
+ - **Generated workflows now reuse checkout authentication for map publication.**
27
+ The redundant map-store token environment variable is omitted; the persisted
28
+ checkout credential supplies the existing least-privilege `contents: write` path.
29
+
10
30
  ## [4.4.16] - 2026-07-13
11
31
 
12
32
  ### Fixed
@@ -221,6 +221,8 @@ const PACKAGE_MANAGERS = {
221
221
  run: (script) => `npm run ${script}`,
222
222
  exec: (command) => `npx ${command}`,
223
223
  install: 'npm ci',
224
+ installExactStyleProof: 'npm install --no-save --package-lock=false "styleproof@$STYLEPROOF_VERSION"',
225
+ restorePackageMetadata: 'true # npm exact install leaves package metadata unchanged',
224
226
  setup: ` - uses: actions/setup-node@v4
225
227
  with:
226
228
  node-version: '20'
@@ -231,6 +233,8 @@ const PACKAGE_MANAGERS = {
231
233
  run: (script) => `npx -y yarn@1.22.22 ${script}`,
232
234
  exec: (command) => `npx -y yarn@1.22.22 ${command}`,
233
235
  install: 'npx -y yarn@1.22.22 install --frozen-lockfile --non-interactive',
236
+ installExactStyleProof: 'npx -y yarn@1.22.22 add --dev --exact "styleproof@$STYLEPROOF_VERSION"',
237
+ restorePackageMetadata: 'git checkout -- package.json yarn.lock',
234
238
  setup: ` - uses: actions/setup-node@v4
235
239
  with:
236
240
  node-version: '20'
@@ -242,6 +246,8 @@ const PACKAGE_MANAGERS = {
242
246
  run: (script) => `pnpm run ${script}`,
243
247
  exec: (command) => `pnpm exec ${command}`,
244
248
  install: 'pnpm install --frozen-lockfile',
249
+ installExactStyleProof: 'pnpm add --save-dev --save-exact "styleproof@$STYLEPROOF_VERSION"',
250
+ restorePackageMetadata: 'git checkout -- package.json pnpm-lock.yaml',
245
251
  setup: ` - uses: actions/setup-node@v4
246
252
  with:
247
253
  node-version: '20'
@@ -254,6 +260,13 @@ const PACKAGE_MANAGERS = {
254
260
  run: (script) => `bun run ${script}`,
255
261
  exec: (command) => `bunx ${command}`,
256
262
  install: 'bun install --frozen-lockfile',
263
+ installExactStyleProof: 'bun add --dev --exact "styleproof@$STYLEPROOF_VERSION"',
264
+ restorePackageMetadata: `git checkout -- package.json
265
+ for package_metadata_file in bun.lock bun.lockb; do
266
+ if git ls-files --error-unmatch "$package_metadata_file" >/dev/null 2>&1; then
267
+ git checkout -- "$package_metadata_file"
268
+ fi
269
+ done`,
257
270
  setup: ` - uses: actions/setup-node@v4
258
271
  with:
259
272
  node-version: '20'
@@ -388,8 +401,6 @@ jobs:
388
401
  # Report on open/update; the prune job below handles close.
389
402
  if: github.event.action != 'closed'
390
403
  runs-on: ubuntu-latest
391
- env:
392
- STYLEPROOF_MAP_STORE_TOKEN: \${{ github.token }}
393
404
  steps:
394
405
  - uses: actions/checkout@v4
395
406
  with:
@@ -405,9 +416,9 @@ ${PM.setup}
405
416
  MAP_ROOT="\${{ runner.temp }}/styleproof-maps"
406
417
  rm -rf "$MAP_ROOT"
407
418
  set +e
408
- ${PM.exec(`styleproof-map --restore --sha "$BASE_SHA" --dir base --base-dir "$MAP_ROOT" --spec ${specPath}`)}
419
+ PATH="$PWD/node_modules/.bin:$PATH" node node_modules/styleproof/bin/styleproof-map.mjs --restore --sha "$BASE_SHA" --dir base --base-dir "$MAP_ROOT" --spec ${specPath}
409
420
  base_code=$?
410
- ${PM.exec(`styleproof-map --restore --sha "$HEAD_SHA" --dir head --base-dir "$MAP_ROOT" --spec ${specPath}`)}
421
+ PATH="$PWD/node_modules/.bin:$PATH" node node_modules/styleproof/bin/styleproof-map.mjs --restore --sha "$HEAD_SHA" --dir head --base-dir "$MAP_ROOT" --spec ${specPath}
411
422
  head_code=$?
412
423
  set -e
413
424
  echo "base-hit=$([ "$base_code" -eq 0 ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
@@ -421,37 +432,47 @@ ${PM.setup}
421
432
  if: steps.maps.outputs.capture-needed == 'true'
422
433
  shell: bash
423
434
  run: |
435
+ set -euo pipefail
424
436
  BASE_SHA="\${{ github.event.pull_request.base.sha }}"
425
437
  HEAD_SHA="\${{ github.event.pull_request.head.sha }}"
426
438
  MAP_ROOT="\${{ runner.temp }}/styleproof-maps"
439
+ STYLEPROOF_VERSION="$(node -p "require('./node_modules/styleproof/package.json').version")"
427
440
 
428
441
  if [ "\${{ steps.maps.outputs.base-hit }}" != 'true' ]; then
429
442
  # Without a compatible base bundle, rebuild and publish the pair in
430
443
  # one pinned environment. This is the expensive cold path.
431
444
  rm -rf "$MAP_ROOT"
432
- git checkout "$BASE_SHA"
445
+ git checkout --force "$BASE_SHA"
433
446
  ${PM.install}
434
- ${PM.exec('playwright install --with-deps chromium')}
447
+ # The base may depend on an older StyleProof. Install the head's
448
+ # exact release, then invoke its binary directly so a later package
449
+ # manager command cannot silently reconcile node_modules backwards.
450
+ ${PM.installExactStyleProof}
451
+ # Package managers that record the temporary exact release dirty
452
+ # tracked metadata. Restore only those files: node_modules must
453
+ # retain the exact release for the clean-tree capture below.
454
+ ${PM.restorePackageMetadata}
455
+ PATH="$PWD/node_modules/.bin:$PATH" playwright install --with-deps chromium
435
456
  if [ -f "${specPath}" ]; then
436
- ${PM.exec(`styleproof-map --spec ${specPath} --dir base --base-dir "$MAP_ROOT" --keep-har --sha "$BASE_SHA" --upload`)}
457
+ PATH="$PWD/node_modules/.bin:$PATH" node node_modules/styleproof/bin/styleproof-map.mjs --spec ${specPath} --dir base --base-dir "$MAP_ROOT" --keep-har --sha "$BASE_SHA" --upload
437
458
  else
438
459
  mkdir -p "$MAP_ROOT/base"
439
460
  fi
440
461
 
441
- git checkout "$HEAD_SHA"
462
+ git checkout --force "$HEAD_SHA"
442
463
  ${PM.install}
443
- ${PM.exec('playwright install --with-deps chromium')}
464
+ PATH="$PWD/node_modules/.bin:$PATH" playwright install --with-deps chromium
444
465
  else
445
466
  # A compatible base hit proves the current head environment. Keep
446
467
  # that restored base and capture only the missing head.
447
468
  rm -rf "$MAP_ROOT/head"
448
- ${PM.exec('playwright install --with-deps chromium')}
469
+ PATH="$PWD/node_modules/.bin:$PATH" playwright install --with-deps chromium
449
470
  fi
450
471
 
451
472
  if find "$MAP_ROOT/base" -name '*.har' -print -quit | grep -q .; then
452
- STYLEPROOF_REPLAY_FROM="$MAP_ROOT/base" ${PM.exec(`styleproof-map --spec ${specPath} --dir head --base-dir "$MAP_ROOT" --sha "$HEAD_SHA" --upload`)}
473
+ PATH="$PWD/node_modules/.bin:$PATH" STYLEPROOF_REPLAY_FROM="$MAP_ROOT/base" node node_modules/styleproof/bin/styleproof-map.mjs --spec ${specPath} --dir head --base-dir "$MAP_ROOT" --sha "$HEAD_SHA" --upload
453
474
  else
454
- ${PM.exec(`styleproof-map --spec ${specPath} --dir head --base-dir "$MAP_ROOT" --sha "$HEAD_SHA" --upload`)}
475
+ PATH="$PWD/node_modules/.bin:$PATH" node node_modules/styleproof/bin/styleproof-map.mjs --spec ${specPath} --dir head --base-dir "$MAP_ROOT" --sha "$HEAD_SHA" --upload
455
476
  fi
456
477
  - uses: BenSheridanEdwards/StyleProof@v4
457
478
  with:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "styleproof",
3
- "version": "4.4.16",
3
+ "version": "4.4.18",
4
4
  "description": "Catch every CSS change before it ships — review PRs and certify refactors by the browser's computed styles, not pixels. Works with any styling system.",
5
5
  "keywords": [
6
6
  "playwright",