styleproof 4.4.5 → 4.4.7
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 +7 -1
- package/bin/styleproof-init.mjs +2 -0
- package/dist/map-store.js +32 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,10 +9,16 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
9
9
|
|
|
10
10
|
### Fixed
|
|
11
11
|
|
|
12
|
+
- **Generated CI authenticates map publication explicitly.** `styleproof-init`
|
|
13
|
+
passes the workflow's least-privilege `github.token` as
|
|
14
|
+
`STYLEPROOF_MAP_STORE_TOKEN`, so cold-cache uploads do not depend on private
|
|
15
|
+
`actions/checkout` credential-storage details. Local hooks continue to reuse
|
|
16
|
+
normal Git credentials without requiring this variable.
|
|
12
17
|
- **Map-store uploads now reuse credentials from `actions/checkout@v7`.**
|
|
13
18
|
Checkout v7 keeps its HTTP header in an included temporary config rather than
|
|
14
19
|
directly in `.git/config`; StyleProof now explicitly enables Git config includes
|
|
15
|
-
|
|
20
|
+
and falls back to its locally registered checkout config before carrying that
|
|
21
|
+
header into the isolated clone and push.
|
|
16
22
|
- **Map-store uploads now reuse the HTTP authentication persisted by
|
|
17
23
|
`actions/checkout`.** The isolated `styleproof-maps` clone carries the
|
|
18
24
|
checkout's URL-scoped extra header through clone and push, so cache-miss
|
package/bin/styleproof-init.mjs
CHANGED
package/dist/map-store.js
CHANGED
|
@@ -52,24 +52,45 @@ 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
|
|
56
|
-
|
|
57
|
-
if (configuredHeaders.status !== 0)
|
|
58
|
-
return [];
|
|
59
|
-
return configuredHeaders.stdout
|
|
55
|
+
function parseGitHttpExtraHeaders(configuredHeaders) {
|
|
56
|
+
return configuredHeaders
|
|
60
57
|
.split('\n')
|
|
61
58
|
.filter(Boolean)
|
|
62
59
|
.flatMap((configuredHeader) => {
|
|
63
60
|
const separatorIndex = configuredHeader.indexOf(' ');
|
|
64
61
|
if (separatorIndex === -1)
|
|
65
62
|
return [];
|
|
66
|
-
return [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
return [{ key: configuredHeader.slice(0, separatorIndex), value: configuredHeader.slice(separatorIndex + 1) }];
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function effectiveGitHttpExtraHeaders(cwd) {
|
|
67
|
+
const configuredHeaders = runGit(cwd, ['config', '--includes', '--get-regexp', '^http\\..*\\.extraheader$'], 1 << 20);
|
|
68
|
+
const effectiveHeaders = parseGitHttpExtraHeaders(configuredHeaders.stdout);
|
|
69
|
+
if (effectiveHeaders.length > 0)
|
|
70
|
+
return effectiveHeaders;
|
|
71
|
+
const registeredIncludes = runGit(cwd, ['config', '--local', '--get-regexp', '^includeIf\\..*\\.path$'], 1 << 20);
|
|
72
|
+
const includedHeaders = registeredIncludes.stdout
|
|
73
|
+
.split('\n')
|
|
74
|
+
.filter(Boolean)
|
|
75
|
+
.flatMap((registeredInclude) => {
|
|
76
|
+
const separatorIndex = registeredInclude.indexOf(' ');
|
|
77
|
+
if (separatorIndex === -1)
|
|
78
|
+
return [];
|
|
79
|
+
const includedConfigPath = registeredInclude.slice(separatorIndex + 1);
|
|
80
|
+
const includedHeaders = runGit(cwd, ['config', '--file', includedConfigPath, '--get-regexp', '^http\\..*\\.extraheader$'], 1 << 20);
|
|
81
|
+
return parseGitHttpExtraHeaders(includedHeaders.stdout);
|
|
72
82
|
});
|
|
83
|
+
if (includedHeaders.length > 0)
|
|
84
|
+
return includedHeaders;
|
|
85
|
+
const mapStoreToken = process.env.STYLEPROOF_MAP_STORE_TOKEN;
|
|
86
|
+
if (!mapStoreToken)
|
|
87
|
+
return [];
|
|
88
|
+
return [
|
|
89
|
+
{
|
|
90
|
+
key: ['http.https:', '', 'github.com', '.extraheader'].join('/'),
|
|
91
|
+
value: `AUTHORIZATION: basic ${Buffer.from(`x-access-token:${mapStoreToken}`).toString('base64')}`,
|
|
92
|
+
},
|
|
93
|
+
];
|
|
73
94
|
}
|
|
74
95
|
function gitOutput(cwd, args) {
|
|
75
96
|
const r = runGit(cwd, args);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "styleproof",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.7",
|
|
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",
|