svelte-vitals 0.32.0 → 0.33.0
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/dist/bin.js +14 -17
- package/package.json +5 -4
package/dist/bin.js
CHANGED
|
@@ -341,12 +341,6 @@ function isConfigTargetId(id) {
|
|
|
341
341
|
return CONFIG_TARGETS.some((t) => t.id === id);
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
// src/ci/action-pin-comment.ts
|
|
345
|
-
function actionPinComment(version) {
|
|
346
|
-
return `action-v${version}`;
|
|
347
|
-
}
|
|
348
|
-
var ACTION_PIN_COMMENT_RE = /#\s*(?:action-v|@svelte-vitals\/action@)(\S+)/;
|
|
349
|
-
|
|
350
344
|
// src/ci/workflow.ts
|
|
351
345
|
var WORKFLOW_PATH = ".github/workflows/svelte-vitals.yml";
|
|
352
346
|
var CHECKOUT_SHA = "9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0";
|
|
@@ -377,7 +371,7 @@ function buildWorkflowYaml(opts) {
|
|
|
377
371
|
` - uses: actions/checkout@${CHECKOUT_SHA} # ${CHECKOUT_VERSION}`,
|
|
378
372
|
" with:",
|
|
379
373
|
" fetch-depth: 0",
|
|
380
|
-
` - uses: oekazuma/svelte-vitals
|
|
374
|
+
` - uses: oekazuma/svelte-vitals-action@${actionSha} # v${actionVersion}`,
|
|
381
375
|
" with:",
|
|
382
376
|
" diff: origin/${{ github.base_ref }}",
|
|
383
377
|
" baseline: origin/${{ github.base_ref }}",
|
|
@@ -1004,8 +998,8 @@ function readInstalledViteVersion(io) {
|
|
|
1004
998
|
}
|
|
1005
999
|
|
|
1006
1000
|
// src/ci/action-pin.generated.ts
|
|
1007
|
-
var ACTION_SHA = "
|
|
1008
|
-
var ACTION_VERSION = "0.
|
|
1001
|
+
var ACTION_SHA = "67ec0af79398845d01e4371d4953d08f6f6a244f";
|
|
1002
|
+
var ACTION_VERSION = "0.4.0";
|
|
1009
1003
|
|
|
1010
1004
|
// src/install/index.ts
|
|
1011
1005
|
function detectPackageManagerNear(io, appDir) {
|
|
@@ -1577,8 +1571,12 @@ import { join as join5 } from "path";
|
|
|
1577
1571
|
import mri2 from "mri";
|
|
1578
1572
|
|
|
1579
1573
|
// src/ci/upgrade.ts
|
|
1580
|
-
var
|
|
1581
|
-
var
|
|
1574
|
+
var CANONICAL_PATH = "oekazuma/svelte-vitals-action";
|
|
1575
|
+
var ACTION_USES_LINE = /^(?<indent>\s*-\s*uses:\s*(?:&\S+\s+)?)(?<repoPath>oekazuma\/svelte-vitals(?:-action|\/packages\/action))@(?<ref>[^\s#]+)(?<comment>\s*#.*)?$/;
|
|
1576
|
+
var PIN_COMMENT_RE = /#\s*(?:v|action-v|@svelte-vitals\/action@)(\S+)/;
|
|
1577
|
+
function isCanonicalComment(comment, version) {
|
|
1578
|
+
return comment.trim() === `# v${version}`;
|
|
1579
|
+
}
|
|
1582
1580
|
function upgradeActionPin(content, sha, version) {
|
|
1583
1581
|
const lines = content.split("\n");
|
|
1584
1582
|
let replaced = 0;
|
|
@@ -1588,17 +1586,16 @@ function upgradeActionPin(content, sha, version) {
|
|
|
1588
1586
|
const bare = eol ? line.slice(0, -1) : line;
|
|
1589
1587
|
const match = ACTION_USES_LINE.exec(bare);
|
|
1590
1588
|
if (!match || !match.groups) return line;
|
|
1591
|
-
const { indent: indent2, ref } = match.groups;
|
|
1592
|
-
if (indent2 === void 0 || ref === void 0) return line;
|
|
1589
|
+
const { indent: indent2, repoPath, ref } = match.groups;
|
|
1590
|
+
if (indent2 === void 0 || repoPath === void 0 || ref === void 0) return line;
|
|
1593
1591
|
const comment = match.groups.comment ?? "";
|
|
1594
|
-
const commentMatch =
|
|
1595
|
-
|
|
1596
|
-
if (ref === sha && isCanonicalComment) return line;
|
|
1592
|
+
const commentMatch = PIN_COMMENT_RE.exec(comment);
|
|
1593
|
+
if (ref === sha && isCanonicalComment(comment, version) && repoPath === CANONICAL_PATH) return line;
|
|
1597
1594
|
if (from === void 0) {
|
|
1598
1595
|
from = commentMatch ? commentMatch[1] : ref.slice(0, 7);
|
|
1599
1596
|
}
|
|
1600
1597
|
replaced += 1;
|
|
1601
|
-
return `${indent2}${sha} # ${
|
|
1598
|
+
return `${indent2}${CANONICAL_PATH}@${sha} # v${version}${eol}`;
|
|
1602
1599
|
});
|
|
1603
1600
|
if (replaced === 0) {
|
|
1604
1601
|
const hasAnyReference = lines.some((line) => ACTION_USES_LINE.test(line.endsWith("\r") ? line.slice(0, -1) : line));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-vitals",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"description": "A SvelteKit SEO checker — not a runtime Web Vitals reporter. Static analysis of your routes' head metadata.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,8 +53,9 @@
|
|
|
53
53
|
"@types/node": "^24.13.3"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
|
-
"build": "
|
|
57
|
-
"typecheck": "
|
|
58
|
-
"test": "
|
|
56
|
+
"build": "tsup",
|
|
57
|
+
"typecheck": "tsc --noEmit",
|
|
58
|
+
"test": "vitest run",
|
|
59
|
+
"update-action-pin": "node scripts/gen-action-pin.mjs"
|
|
59
60
|
}
|
|
60
61
|
}
|