styleproof 4.4.2 → 4.4.4

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
@@ -9,6 +9,15 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
9
9
 
10
10
  ### Fixed
11
11
 
12
+ - **Map-store uploads now reuse credentials from `actions/checkout@v7`.**
13
+ Checkout v7 keeps its HTTP header in an included temporary config rather than
14
+ directly in `.git/config`; StyleProof now reads the effective Git config before
15
+ carrying that header into its isolated clone and push.
16
+ - **Map-store uploads now reuse the HTTP authentication persisted by
17
+ `actions/checkout`.** The isolated `styleproof-maps` clone carries the
18
+ checkout's URL-scoped extra header through clone and push, so cache-miss
19
+ captures publish successfully without every consumer wiring a token into the
20
+ CLI step.
12
21
  - **Map-store uploads from Git hooks no longer inherit the caller repository's
13
22
  Git location variables.** A cold `styleproof-maps` upload could otherwise run
14
23
  its temporary `git init` against the consumer repository, set
package/dist/map-store.js CHANGED
@@ -52,6 +52,25 @@ 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
+ function effectiveGitHttpExtraHeaders(cwd) {
56
+ const configuredHeaders = runGit(cwd, ['config', '--get-regexp', '^http\\..*\\.extraheader$'], 1 << 20);
57
+ if (configuredHeaders.status !== 0)
58
+ return [];
59
+ return configuredHeaders.stdout
60
+ .split('\n')
61
+ .filter(Boolean)
62
+ .flatMap((configuredHeader) => {
63
+ const separatorIndex = configuredHeader.indexOf(' ');
64
+ if (separatorIndex === -1)
65
+ return [];
66
+ return [
67
+ {
68
+ key: configuredHeader.slice(0, separatorIndex),
69
+ value: configuredHeader.slice(separatorIndex + 1),
70
+ },
71
+ ];
72
+ });
73
+ }
55
74
  function gitOutput(cwd, args) {
56
75
  const r = runGit(cwd, args);
57
76
  return r.status === 0 ? r.stdout.trim() : '';
@@ -399,9 +418,11 @@ function checkoutMapStore(cwd, remote, branch) {
399
418
  if (!remoteExists(remote, cwd))
400
419
  throw new MapStoreError(`git remote ${remote} was not found`);
401
420
  const remoteUrl = gitOutput(cwd, ['remote', 'get-url', remote]);
421
+ const httpExtraHeaders = effectiveGitHttpExtraHeaders(cwd);
422
+ const authenticationArguments = httpExtraHeaders.flatMap(({ key, value }) => ['-c', `${key}=${value}`]);
402
423
  const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'styleproof-map-store-'));
403
424
  if (runGit(cwd, ['ls-remote', '--exit-code', '--heads', remote, branch], 1 << 20).status === 0) {
404
- const clone = spawnSync('git', ['clone', '-q', '--depth', '1', '--branch', branch, remoteUrl, tmp], {
425
+ const clone = spawnSync('git', [...authenticationArguments, 'clone', '-q', '--depth', '1', '--branch', branch, remoteUrl, tmp], {
405
426
  encoding: 'utf8',
406
427
  maxBuffer: 1 << 20,
407
428
  env: gitProcessEnvironment(),
@@ -415,6 +436,8 @@ function checkoutMapStore(cwd, remote, branch) {
415
436
  runGit(tmp, ['init', '-q', '-b', branch]);
416
437
  runGit(tmp, ['remote', 'add', 'origin', remoteUrl]);
417
438
  }
439
+ for (const { key, value } of httpExtraHeaders)
440
+ runGit(tmp, ['config', '--local', key, value]);
418
441
  return tmp;
419
442
  }
420
443
  export function publishMapBundle(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "styleproof",
3
- "version": "4.4.2",
3
+ "version": "4.4.4",
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",