Skip to content

Commit 7a5aa42

Browse files
committed
refactor(cli): rename LCP-Sub-Parts to LCP-Subparts to match main
1 parent fdb45d2 commit 7a5aa42

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

cli/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ npx webperf-snippets <url> [options]
2929

3030
### Examples
3131

32-
Run the default Core Web Vitals workflow (LCP + CLS, plus LCP-Sub-Parts if LCP > 2.5s):
32+
Run the default Core Web Vitals workflow (LCP + CLS, plus LCP-Subparts if LCP > 2.5s):
3333

3434
```bash
3535
npx webperf-snippets https://web.dev
@@ -44,7 +44,7 @@ npx webperf-snippets https://web.dev --json
4444
Single snippet:
4545

4646
```bash
47-
npx webperf-snippets https://example.com --snippet LCP-Sub-Parts
47+
npx webperf-snippets https://example.com --snippet LCP-Subparts
4848
```
4949

5050
CI gating:
@@ -117,7 +117,7 @@ The `NPM_TOKEN` secret must be set in the repository settings with publish acces
117117
- **No INP**: INP requires real user interactions. v0.2 will support synthetic interaction scripts.
118118
- **CLS in headless is conservative**: layout shifts that only happen on scroll are missed unless you script the scroll.
119119
- **First navigation only**: each `webperf-snippets` invocation runs one URL. SPAs need the post-route URL passed directly.
120-
- **Decision-tree follow-ups re-navigate**: when a follow-up snippet fires (e.g. LCP-Sub-Parts), the page is loaded again. v0.2 will share a single page session.
120+
- **Decision-tree follow-ups re-navigate**: when a follow-up snippet fires (e.g. LCP-Subparts), the page is loaded again. v0.2 will share a single page session.
121121

122122
## Roadmap
123123

cli/src/bin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const WORKFLOWS = {
1414
const SNIPPET_ALIASES = {
1515
LCP: "CoreWebVitals/LCP",
1616
CLS: "CoreWebVitals/CLS",
17-
"LCP-Sub-Parts": "CoreWebVitals/LCP-Sub-Parts",
17+
"LCP-Subparts": "CoreWebVitals/LCP-Subparts",
1818
fonts: "Loading/Fonts-Preloaded-Loaded-and-used-above-the-fold",
1919
"Fonts-Preloaded-Loaded-and-used-above-the-fold":
2020
"Loading/Fonts-Preloaded-Loaded-and-used-above-the-fold",
@@ -38,7 +38,7 @@ Options:
3838
Examples:
3939
npx webperf-snippets https://web.dev
4040
npx webperf-snippets https://example.com --json
41-
npx webperf-snippets https://example.com --snippet LCP-Sub-Parts
41+
npx webperf-snippets https://example.com --snippet LCP-Subparts
4242
npx webperf-snippets https://example.com --snippet fonts
4343
npx webperf-snippets https://example.com --budget-lcp 2500
4444
`;

cli/src/decision-tree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const RULES = [
44
{
55
when: (r) => r.id === "LCP" && r.status === "ok" && r.value > 2500,
6-
append: { id: "LCP-Sub-Parts", path: "CoreWebVitals/LCP-Sub-Parts" },
6+
append: { id: "LCP-Subparts", path: "CoreWebVitals/LCP-Subparts" },
77
reason: "LCP > 2.5s — drilling into sub-parts",
88
},
99
];

cli/tests/unit/decision-tree.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ describe("nextSteps", () => {
77
expect(nextSteps(results)).toEqual([]);
88
});
99

10-
it("appends LCP-Sub-Parts when LCP > 2500ms", () => {
10+
it("appends LCP-Subparts when LCP > 2500ms", () => {
1111
const results = [{ id: "LCP", status: "ok", value: 3000 }];
1212
const steps = nextSteps(results);
1313
expect(steps).toHaveLength(1);
14-
expect(steps[0].id).toBe("LCP-Sub-Parts");
15-
expect(steps[0].path).toBe("CoreWebVitals/LCP-Sub-Parts");
14+
expect(steps[0].id).toBe("LCP-Subparts");
15+
expect(steps[0].path).toBe("CoreWebVitals/LCP-Subparts");
1616
expect(steps[0].reason).toMatch(/LCP > 2\.5s/);
1717
});
1818

19-
it("does not append LCP-Sub-Parts when LCP === 2500ms (boundary)", () => {
19+
it("does not append LCP-Subparts when LCP === 2500ms (boundary)", () => {
2020
const results = [{ id: "LCP", status: "ok", value: 2500 }];
2121
expect(nextSteps(results)).toEqual([]);
2222
});
2323

24-
it("does not append LCP-Sub-Parts when LCP status is error", () => {
24+
it("does not append LCP-Subparts when LCP status is error", () => {
2525
const results = [{ id: "LCP", status: "error", value: 3000 }];
2626
expect(nextSteps(results)).toEqual([]);
2727
});

0 commit comments

Comments
 (0)