styleproof 4.4.15 → 4.4.16

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,15 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [4.4.16] - 2026-07-13
11
+
12
+ ### Fixed
13
+
14
+ - **Map-store publication now retains failures that occur while preparing a retry.**
15
+ If an authenticated push fails and the next clone also fails, StyleProof reports
16
+ both errors with their attempt and phase instead of replacing the actionable push
17
+ failure with the later setup error.
18
+
10
19
  ## [4.4.15] - 2026-07-13
11
20
 
12
21
  ### Fixed
package/dist/map-store.js CHANGED
@@ -537,6 +537,37 @@ function pushMapStoreCommit(cwd, temporaryCheckout, remote, branch, authenticati
537
537
  ].join('\n'),
538
538
  };
539
539
  }
540
+ function removeTemporaryMapStoreCheckout(temporaryCheckout) {
541
+ if (temporaryCheckout)
542
+ fs.rmSync(temporaryCheckout, { recursive: true, force: true });
543
+ }
544
+ function errorMessage(error) {
545
+ return error instanceof Error ? error.message : String(error);
546
+ }
547
+ function publishMapStoreAttempt(options) {
548
+ let temporaryCheckout;
549
+ try {
550
+ temporaryCheckout = checkoutMapStore(options.cwd, options.remote, options.branch, options.sha);
551
+ runGit(temporaryCheckout, ['config', 'user.name', 'github-actions[bot]']);
552
+ runGit(temporaryCheckout, ['config', 'user.email', '41898282+github-actions[bot]@users.noreply.github.com']);
553
+ fs.writeFileSync(path.join(temporaryCheckout, 'README.md'), '# StyleProof maps\n\nMachine-generated reusable map bundles. Each folder is keyed by commit SHA and capture compatibility.\n');
554
+ fs.rmSync(path.join(temporaryCheckout, options.target), { recursive: true, force: true });
555
+ copyDir(options.dir, path.join(temporaryCheckout, options.target), options.includeHar);
556
+ if (!options.includeHar) {
557
+ fs.writeFileSync(path.join(temporaryCheckout, options.target, MAP_MANIFEST), JSON.stringify({ ...options.manifest, har: false }, null, 2));
558
+ }
559
+ runGit(temporaryCheckout, ['add', '-A', '--sparse', '--', 'README.md', options.target]);
560
+ runGit(temporaryCheckout, ['commit', '-q', '-m', `StyleProof map ${options.sha.slice(0, 12)} ${options.compatibilityKey}`], 1 << 20);
561
+ const push = pushMapStoreCommit(options.cwd, temporaryCheckout, options.remote, options.branch, options.authenticationArguments);
562
+ return { ok: push.status === 0, phase: 'publish', error: push.stderr.trim() || `git exited ${push.status}` };
563
+ }
564
+ catch (error) {
565
+ return { ok: false, phase: 'setup', error: errorMessage(error) };
566
+ }
567
+ finally {
568
+ removeTemporaryMapStoreCheckout(temporaryCheckout);
569
+ }
570
+ }
540
571
  export function publishMapBundle(options) {
541
572
  const cwd = options.cwd ?? process.cwd();
542
573
  const branch = options.branch ?? DEFAULT_MAP_STORE_BRANCH;
@@ -558,29 +589,26 @@ export function publishMapBundle(options) {
558
589
  ]);
559
590
  let ok = false;
560
591
  let lastError = '';
592
+ const attemptFailures = [];
561
593
  for (let attempt = 1; attempt <= 5; attempt++) {
562
- const tmp = checkoutMapStore(cwd, remote, branch, sha);
563
- try {
564
- runGit(tmp, ['config', 'user.name', 'github-actions[bot]']);
565
- runGit(tmp, ['config', 'user.email', '41898282+github-actions[bot]@users.noreply.github.com']);
566
- fs.writeFileSync(path.join(tmp, 'README.md'), '# StyleProof maps\n\nMachine-generated reusable map bundles. Each folder is keyed by commit SHA and capture compatibility.\n');
567
- fs.rmSync(path.join(tmp, target), { recursive: true, force: true });
568
- copyDir(options.dir, path.join(tmp, target), options.includeHar === true);
569
- if (!options.includeHar) {
570
- fs.writeFileSync(path.join(tmp, target, MAP_MANIFEST), JSON.stringify({ ...manifest, har: false }, null, 2));
571
- }
572
- runGit(tmp, ['add', '-A', '--sparse', '--', 'README.md', target]);
573
- runGit(tmp, ['commit', '-q', '-m', `StyleProof map ${sha.slice(0, 12)} ${compatibilityKey}`], 1 << 20);
574
- const push = pushMapStoreCommit(cwd, tmp, remote, branch, pushAuthenticationArguments);
575
- if (push.status === 0) {
576
- ok = true;
577
- break;
578
- }
579
- lastError = push.stderr.trim();
580
- }
581
- finally {
582
- fs.rmSync(tmp, { recursive: true, force: true });
594
+ const result = publishMapStoreAttempt({
595
+ cwd,
596
+ remote,
597
+ branch,
598
+ sha,
599
+ compatibilityKey,
600
+ target,
601
+ dir: options.dir,
602
+ includeHar: options.includeHar === true,
603
+ manifest,
604
+ authenticationArguments: pushAuthenticationArguments,
605
+ });
606
+ if (result.ok) {
607
+ ok = true;
608
+ break;
583
609
  }
610
+ attemptFailures.push(`attempt ${attempt} ${result.phase}:\n${result.error}`);
611
+ lastError = attemptFailures.join('\n');
584
612
  Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, attempt * 250);
585
613
  }
586
614
  if (!ok)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "styleproof",
3
- "version": "4.4.15",
3
+ "version": "4.4.16",
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",