styleproof 4.4.13 → 4.4.15

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,22 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [4.4.15] - 2026-07-13
11
+
12
+ ### Fixed
13
+
14
+ - **Failed map-store uploads now retain every Git transport error.** The
15
+ workflow-token credential retry is no longer hidden by a later fallback, so
16
+ hosted CI reports the authenticated failure needed to repair publication.
17
+
18
+ ## [4.4.14] - 2026-07-13
19
+
20
+ ### Fixed
21
+
22
+ - **Workflow-token publication now uses Git's credential protocol for the final retry.**
23
+ The token stays out of remote URLs and process arguments, while real Git credential
24
+ lookup is covered directly instead of relying on an executable askpass script.
25
+
10
26
  ## [4.4.13] - 2026-07-13
11
27
 
12
28
  ### Fixed
@@ -47,6 +47,7 @@ export interface CachedCaptureDirs {
47
47
  compatibilityKey: string;
48
48
  tmpRoot: string;
49
49
  }
50
+ export declare function workflowTokenCredentialArguments(): string[];
50
51
  /** Record the real browser build into the capture dir. Called from a capture run, where a
51
52
  * Playwright browser handle is in scope. Write-or-CLEAR semantics: an undefined version
52
53
  * REMOVES any existing sidecar rather than leaving it, so a reused capture dir (e.g. the
package/dist/map-store.js CHANGED
@@ -52,6 +52,10 @@ function gitProcessEnvironment() {
52
52
  function runGit(cwd, args, maxBuffer = 1 << 28) {
53
53
  return spawnSync('git', args, { cwd, encoding: 'utf8', maxBuffer, env: gitProcessEnvironment() });
54
54
  }
55
+ const WORKFLOW_TOKEN_CREDENTIAL_HELPER = '!f() { if [ "$1" = get ]; then printf \'%s\\n\' username=x-access-token "password=$STYLEPROOF_MAP_STORE_TOKEN"; fi; }; f';
56
+ export function workflowTokenCredentialArguments() {
57
+ return ['-c', 'credential.helper=', '-c', `credential.helper=${WORKFLOW_TOKEN_CREDENTIAL_HELPER}`];
58
+ }
55
59
  function parseGitHttpExtraHeaders(configuredHeaders) {
56
60
  return configuredHeaders
57
61
  .split('\n')
@@ -481,44 +485,57 @@ function checkoutMapStore(cwd, remote, branch, sparseSegment) {
481
485
  return tmp;
482
486
  }
483
487
  function pushMapStoreCommit(cwd, temporaryCheckout, remote, branch, authenticationArguments) {
488
+ const pushFailures = [];
484
489
  const isolatedPush = runGit(temporaryCheckout, [...authenticationArguments, 'push', '-q', 'origin', `HEAD:${branch}`], 1 << 20);
485
490
  if (isolatedPush.status === 0)
486
491
  return isolatedPush;
492
+ pushFailures.push(`isolated map-store push: ${isolatedPush.stderr.trim() || `git exited ${isolatedPush.status}`}`);
487
493
  const mapStoreToken = process.env.STYLEPROOF_MAP_STORE_TOKEN;
488
494
  if (mapStoreToken) {
489
- const askpassDirectory = fs.mkdtempSync(path.join(os.tmpdir(), 'styleproof-map-store-askpass-'));
490
- const askpassScript = path.join(askpassDirectory, 'askpass.sh');
491
- fs.writeFileSync(askpassScript, '#!/bin/sh\ncase "$1" in *Username*) printf "%s\\n" x-access-token ;; *) printf "%s\\n" "$STYLEPROOF_MAP_STORE_TOKEN" ;; esac\n', { mode: 0o700 });
492
- try {
493
- const askpassPush = spawnSync('git', [
494
- '-c',
495
- `${['http.https:', '', 'github.com', '.extraheader'].join('/')}=`,
496
- 'push',
497
- '-q',
498
- 'origin',
499
- `HEAD:${branch}`,
500
- ], {
501
- cwd: temporaryCheckout,
502
- encoding: 'utf8',
503
- maxBuffer: 1 << 20,
504
- env: {
505
- ...gitProcessEnvironment(),
506
- GIT_ASKPASS: askpassScript,
507
- GIT_TERMINAL_PROMPT: '0',
508
- },
509
- });
510
- if (askpassPush.status === 0)
511
- return askpassPush;
512
- }
513
- finally {
514
- fs.rmSync(askpassDirectory, { recursive: true, force: true });
515
- }
495
+ const githubExtraHeaderKey = ['http.https:', '', 'github.com', '.extraheader'].join('/');
496
+ runGit(temporaryCheckout, ['config', '--local', '--unset-all', githubExtraHeaderKey], 1 << 20);
497
+ const credentialPush = spawnSync('git', [
498
+ '-c',
499
+ `${githubExtraHeaderKey}=`,
500
+ ...workflowTokenCredentialArguments(),
501
+ 'push',
502
+ '-q',
503
+ 'origin',
504
+ `HEAD:${branch}`,
505
+ ], {
506
+ cwd: temporaryCheckout,
507
+ encoding: 'utf8',
508
+ maxBuffer: 1 << 20,
509
+ env: {
510
+ ...gitProcessEnvironment(),
511
+ GIT_TERMINAL_PROMPT: '0',
512
+ },
513
+ });
514
+ if (credentialPush.status === 0)
515
+ return credentialPush;
516
+ pushFailures.push(`workflow-token credential push: ${credentialPush.stderr.trim() || `git exited ${credentialPush.status}`}`);
516
517
  }
517
518
  const mapStoreCommit = gitOutput(temporaryCheckout, ['rev-parse', 'HEAD']);
518
519
  const importCommit = runGit(cwd, ['fetch', '-q', '--no-write-fetch-head', temporaryCheckout, mapStoreCommit], 1 << 20);
519
- if (importCommit.status !== 0)
520
- return isolatedPush;
521
- return runGit(cwd, ['push', '-q', remote, `${mapStoreCommit}:${branch}`], 1 << 20);
520
+ if (importCommit.status !== 0) {
521
+ return {
522
+ ...isolatedPush,
523
+ stderr: [
524
+ ...pushFailures,
525
+ `consumer checkout import: ${importCommit.stderr.trim() || `git exited ${importCommit.status}`}`,
526
+ ].join('\n'),
527
+ };
528
+ }
529
+ const consumerCheckoutPush = runGit(cwd, ['push', '-q', remote, `${mapStoreCommit}:${branch}`], 1 << 20);
530
+ if (consumerCheckoutPush.status === 0)
531
+ return consumerCheckoutPush;
532
+ return {
533
+ ...consumerCheckoutPush,
534
+ stderr: [
535
+ ...pushFailures,
536
+ `consumer checkout push: ${consumerCheckoutPush.stderr.trim() || `git exited ${consumerCheckoutPush.status}`}`,
537
+ ].join('\n'),
538
+ };
522
539
  }
523
540
  export function publishMapBundle(options) {
524
541
  const cwd = options.cwd ?? process.cwd();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "styleproof",
3
- "version": "4.4.13",
3
+ "version": "4.4.15",
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",