@salesforce/storefront-next-dev 1.4.0 → 1.4.1-alpha.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/README.md +13 -2
- package/dist/assets.js +25 -0
- package/dist/audit/catalog/categories/best-practices/CATEGORY.md +21 -0
- package/dist/audit/catalog/categories/best-practices/rules/commerce-api-client.md +20 -0
- package/dist/audit/catalog/categories/best-practices/rules/error-boundaries.md +19 -0
- package/dist/audit/catalog/categories/best-practices/rules/production-integrations.md +20 -0
- package/dist/audit/catalog/categories/best-practices/rules/route-revalidation.md +19 -0
- package/dist/audit/catalog/categories/best-practices/rules/server-data-loading.md +19 -0
- package/dist/audit/catalog/categories/performance/CATEGORY.md +18 -0
- package/dist/audit/catalog/categories/performance/rules/app-config-size.js +15 -0
- package/dist/audit/catalog/categories/performance/rules/app-config-size.md +22 -0
- package/dist/audit/catalog/categories/performance/rules/cache-control.js +59 -0
- package/dist/audit/catalog/categories/performance/rules/cache-control.md +20 -0
- package/dist/audit/catalog/categories/performance/rules/cls-budget.js +13 -0
- package/dist/audit/catalog/categories/performance/rules/cls-budget.md +20 -0
- package/dist/audit/catalog/categories/performance/rules/content-encoding.js +35 -0
- package/dist/audit/catalog/categories/performance/rules/content-encoding.md +20 -0
- package/dist/audit/catalog/categories/performance/rules/dom-size.js +18 -0
- package/dist/audit/catalog/categories/performance/rules/dom-size.md +22 -0
- package/dist/audit/catalog/categories/performance/rules/html-document-size.js +15 -0
- package/dist/audit/catalog/categories/performance/rules/html-document-size.md +20 -0
- package/dist/audit/catalog/categories/performance/rules/image-dimensions.js +141 -0
- package/dist/audit/catalog/categories/performance/rules/image-dimensions.md +22 -0
- package/dist/audit/catalog/categories/performance/rules/image-transformation.js +117 -0
- package/dist/audit/catalog/categories/performance/rules/image-transformation.md +22 -0
- package/dist/audit/catalog/categories/performance/rules/javascript-size.js +126 -0
- package/dist/audit/catalog/categories/performance/rules/javascript-size.md +20 -0
- package/dist/audit/catalog/categories/performance/rules/large-images.js +187 -0
- package/dist/audit/catalog/categories/performance/rules/large-images.md +22 -0
- package/dist/audit/catalog/categories/performance/rules/lcp-budget.js +13 -0
- package/dist/audit/catalog/categories/performance/rules/lcp-budget.md +20 -0
- package/dist/audit/catalog/categories/performance/rules/lcp-image-priority.js +227 -0
- package/dist/audit/catalog/categories/performance/rules/lcp-image-priority.md +27 -0
- package/dist/audit/catalog/categories/performance/rules/page-data-size.js +15 -0
- package/dist/audit/catalog/categories/performance/rules/page-data-size.md +22 -0
- package/dist/audit/catalog/categories/performance/rules/reduce-javascript-on-load.js +97 -0
- package/dist/audit/catalog/categories/performance/rules/reduce-javascript-on-load.md +73 -0
- package/dist/audit/catalog/categories/performance/rules/render-blocking-font-size.js +201 -0
- package/dist/audit/catalog/categories/performance/rules/render-blocking-font-size.md +20 -0
- package/dist/audit/catalog/categories/performance/rules/server-request-waterfall.md +85 -0
- package/dist/audit/catalog/categories/performance/rules/tbt-budget.js +13 -0
- package/dist/audit/catalog/categories/performance/rules/tbt-budget.md +20 -0
- package/dist/audit/catalog/categories/performance/rules/third-party-fonts.js +265 -0
- package/dist/audit/catalog/categories/performance/rules/third-party-fonts.md +20 -0
- package/dist/audit/catalog/categories/performance/rules/ttfb-budget.js +17 -0
- package/dist/audit/catalog/categories/performance/rules/ttfb-budget.md +20 -0
- package/dist/audit/catalog/categories/security/CATEGORY.md +17 -0
- package/dist/audit/catalog/categories/security/rules/browser-hardening-headers.js +37 -0
- package/dist/audit/catalog/categories/security/rules/browser-hardening-headers.md +20 -0
- package/dist/audit/catalog/categories/security/rules/content-security-policy.js +40 -0
- package/dist/audit/catalog/categories/security/rules/content-security-policy.md +20 -0
- package/dist/audit/catalog/categories/security/rules/csp-runtime-compatibility.md +24 -0
- package/dist/audit/catalog/categories/security/rules/dependency-vulnerabilities.md +19 -0
- package/dist/audit/catalog/categories/security/rules/dynamic-code-execution.md +19 -0
- package/dist/audit/catalog/categories/security/rules/hardcoded-credentials.md +19 -0
- package/dist/audit/catalog/categories/security/rules/html-config-secrets.js +46 -0
- package/dist/audit/catalog/categories/security/rules/html-config-secrets.md +22 -0
- package/dist/audit/catalog/categories/security/rules/protected-route-authorization.md +19 -0
- package/dist/audit/catalog/categories/security/rules/public-client-secrets.md +20 -0
- package/dist/audit/catalog/categories/security/rules/raw-html-sinks.md +20 -0
- package/dist/audit/catalog/categories/security/rules/strict-transport-security.js +183 -0
- package/dist/audit/catalog/categories/security/rules/strict-transport-security.md +24 -0
- package/dist/audit/catalog/categories/seo/CATEGORY.md +17 -0
- package/dist/audit/catalog/categories/seo/rules/canonical-url.md +20 -0
- package/dist/audit/catalog/categories/seo/rules/locale-alternates.md +19 -0
- package/dist/audit/catalog/categories/seo/rules/meta-description.md +19 -0
- package/dist/audit/catalog/categories/seo/rules/page-title.md +19 -0
- package/dist/audit/catalog/categories/seo/rules/robots-indexing.md +20 -0
- package/dist/audit/catalog/categories/seo/rules/structured-data.md +19 -0
- package/dist/audit/instructions/evaluate-rule.md +42 -0
- package/dist/audit/schemas/audit-result.schema.json +1237 -0
- package/dist/audit/ui/assets/banner-brand-default-CDRB3_S0.png +0 -0
- package/dist/audit/ui/assets/banner-group-public-default-BGRJzVY8.png +0 -0
- package/dist/audit/ui/assets/banner-user-default-BW81Ba3z.png +0 -0
- package/dist/audit/ui/assets/bg-info@2x-CzpP0vaE.png +0 -0
- package/dist/audit/ui/assets/einstein-figure-B1xFOo8O.svg +1 -0
- package/dist/audit/ui/assets/group_avatar_160-CrxVHlYA.png +0 -0
- package/dist/audit/ui/assets/group_avatar_200-CSLS8I0r.png +0 -0
- package/dist/audit/ui/assets/index-BKCWlO9b.css +1 -0
- package/dist/audit/ui/assets/index-CUPt8e4A.js +44 -0
- package/dist/audit/ui/assets/profile_avatar_160-CtQTUBo0.png +0 -0
- package/dist/audit/ui/assets/profile_avatar_200-DAztxshF.png +0 -0
- package/dist/audit/ui/assets/symbols-BRmpfDbO.svg +1 -0
- package/dist/audit/ui/assets/symbols-D0Ne6690.svg +1 -0
- package/dist/audit/ui/einstein.png +0 -0
- package/dist/audit/ui/index.html +13 -0
- package/dist/audit.js +1896 -0
- package/dist/cartridge-services/index.d.ts +5 -0
- package/dist/cartridge-services/index.d.ts.map +1 -1
- package/dist/cartridge-services/index.js +94 -7
- package/dist/cartridge-services/index.js.map +1 -1
- package/dist/catalog.js +89 -0
- package/dist/commands/audit/catalog.js +27 -0
- package/dist/commands/audit/finalize.js +42 -0
- package/dist/commands/audit/prepare.js +84 -0
- package/dist/commands/audit/progress.js +51 -0
- package/dist/commands/audit/serve.js +63 -0
- package/dist/commands/config/aggregate-extensions.js +1 -0
- package/dist/commands/create-bundle.js +2 -1
- package/dist/commands/create-instructions.js +1 -0
- package/dist/commands/create-storefront.js +1 -0
- package/dist/commands/deploy-cartridge.js +11 -3
- package/dist/commands/dev.js +2 -0
- package/dist/commands/extensions/create.js +1 -0
- package/dist/commands/extensions/install.js +1 -0
- package/dist/commands/extensions/list.js +1 -0
- package/dist/commands/extensions/remove.js +1 -0
- package/dist/commands/generate-cartridge.js +49 -5
- package/dist/commands/locales/aggregate-extensions.js +1 -0
- package/dist/commands/prepare-local.js +1 -0
- package/dist/commands/preview.js +2 -0
- package/dist/commands/push.js +3 -1
- package/dist/commands/validate-cartridge.js +13 -4
- package/dist/config.js +13 -2
- package/dist/document-size.js +231 -0
- package/dist/events.js +688 -0
- package/dist/flags2.js +34 -0
- package/dist/generate-cartridge.js +41 -6
- package/dist/har.js +205 -0
- package/dist/images.js +146 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/live.js +277 -0
- package/dist/logger.js +1 -4
- package/dist/measured-run.js +91 -0
- package/dist/metric-budget.js +125 -0
- package/dist/mrt/ssr.mjs +19 -19
- package/dist/mrt/ssr.mjs.map +1 -1
- package/dist/mrt/streamingHandler.mjs +26 -26
- package/dist/mrt/streamingHandler.mjs.map +1 -1
- package/dist/package.js +5 -0
- package/dist/sanitize.js +185 -0
- package/dist/schema.js +121 -0
- package/dist/server.js +8 -60
- package/dist/server2.js +185 -0
- package/dist/ts-import.js +57 -0
- package/package.json +22 -5
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: seo/locale-alternates
|
|
3
|
+
title: Language and Region Links (hreflang)
|
|
4
|
+
severity: medium
|
|
5
|
+
appliesTo: [home, plp, pdp]
|
|
6
|
+
inputs: [playhouse.main-document, source.code]
|
|
7
|
+
---
|
|
8
|
+
## Intent
|
|
9
|
+
For sites with more than one locale, checks that each page links to its other-language versions with `hreflang` tags and that those versions link back. Search engines use these links to show shoppers the page in their language. Single-locale sites don't need them.
|
|
10
|
+
## Inspect
|
|
11
|
+
Determine locale scope, then verify reciprocal delivered hreflang URLs.
|
|
12
|
+
## Evaluate
|
|
13
|
+
Use not-applicable for single-locale sites; finding requires broken multi-locale output.
|
|
14
|
+
## Evidence
|
|
15
|
+
Cite locale config and delivered alternate pairs.
|
|
16
|
+
## Remediation
|
|
17
|
+
Emit reciprocal valid locale alternates.
|
|
18
|
+
## Examples
|
|
19
|
+
Compliant: reciprocal en/fr URLs. Problematic: hreflang points to 404. Ambiguous: locale scope unknown.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: seo/meta-description
|
|
3
|
+
title: Meta Description
|
|
4
|
+
severity: medium
|
|
5
|
+
appliesTo: [home, plp, pdp]
|
|
6
|
+
inputs: [playhouse.main-document, source.code]
|
|
7
|
+
---
|
|
8
|
+
## Intent
|
|
9
|
+
Checks that each page has a `<meta name="description">` that is specific to that page, not missing or copied across pages. Search engines often show it as the text under the result.
|
|
10
|
+
## Inspect
|
|
11
|
+
Compare delivered descriptions across captured pages and source generation.
|
|
12
|
+
## Evaluate
|
|
13
|
+
Finding requires missing, duplicate, or unsuitable delivered content.
|
|
14
|
+
## Evidence
|
|
15
|
+
Cite page, delivered value, and source.
|
|
16
|
+
## Remediation
|
|
17
|
+
Generate concise page-specific descriptions.
|
|
18
|
+
## Examples
|
|
19
|
+
Compliant: PDP description reflects product. Problematic: absent description. Ambiguous: helper exists only.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: seo/page-title
|
|
3
|
+
title: Page Title
|
|
4
|
+
severity: high
|
|
5
|
+
appliesTo: [home, plp, pdp]
|
|
6
|
+
inputs: [playhouse.main-document, source.code]
|
|
7
|
+
---
|
|
8
|
+
## Intent
|
|
9
|
+
Checks that each page has a `<title>` that is unique and describes that page. The title is the main text of a search result and the label of the browser tab.
|
|
10
|
+
## Inspect
|
|
11
|
+
Compare delivered titles across pages and trace route metadata.
|
|
12
|
+
## Evaluate
|
|
13
|
+
Finding requires missing, duplicate, or misleading delivered title.
|
|
14
|
+
## Evidence
|
|
15
|
+
Cite page, title value, comparison, and source.
|
|
16
|
+
## Remediation
|
|
17
|
+
Emit page-specific route metadata.
|
|
18
|
+
## Examples
|
|
19
|
+
Compliant: product-specific PDP title. Problematic: all pages share Home. Ambiguous: title helper only.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: seo/robots-indexing
|
|
3
|
+
title: Search Engines Can Index the Site
|
|
4
|
+
severity: critical
|
|
5
|
+
appliesTo: [home, plp, pdp]
|
|
6
|
+
inputs: [playhouse.main-document, source.code, deployment.config]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Intent
|
|
10
|
+
Checks the production site for anything that tells search engines not to index it: `noindex` in a robots meta tag or `X-Robots-Tag` header, `Disallow` rules in `robots.txt`, or environment settings that turn these on. A leftover staging setting can remove the whole store from search results; blocking a staging site is fine.
|
|
11
|
+
## Inspect
|
|
12
|
+
Inspect delivered robots metadata, robots.txt, response headers, and environment gating for noindex/disallow controls.
|
|
13
|
+
## Evaluate
|
|
14
|
+
Finding requires production-target evidence of unintended blocking; staging noindex can be not-applicable.
|
|
15
|
+
## Evidence
|
|
16
|
+
Cite deployed URL, directive/header/file, and environment evidence.
|
|
17
|
+
## Remediation
|
|
18
|
+
Remove or correctly environment-gate the blocking directive and verify the deployed response.
|
|
19
|
+
## Examples
|
|
20
|
+
Compliant: staging-only noindex. Problematic: production home emits noindex. Ambiguous: ungated-looking source without deployment context.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: seo/structured-data
|
|
3
|
+
title: Structured Data (JSON-LD)
|
|
4
|
+
severity: medium
|
|
5
|
+
appliesTo: [home, plp, pdp]
|
|
6
|
+
inputs: [playhouse.main-document, source.code]
|
|
7
|
+
---
|
|
8
|
+
## Intent
|
|
9
|
+
Checks that any JSON-LD structured data on the pages, such as `Product` or `BreadcrumbList`, is valid, suits the page type and matches what the page shows, for example the same price and availability. Search engines use it for rich results. Pages without structured data pass.
|
|
10
|
+
## Inspect
|
|
11
|
+
Parse delivered JSON-LD and compare types/values with visible content and generation source.
|
|
12
|
+
## Evaluate
|
|
13
|
+
Use finding for invalid or materially misleading data; absence alone is a pass.
|
|
14
|
+
## Evidence
|
|
15
|
+
Cite page, JSON-LD path/value, validation issue, and source.
|
|
16
|
+
## Remediation
|
|
17
|
+
Emit valid schema.org data from trusted page data.
|
|
18
|
+
## Examples
|
|
19
|
+
Compliant: accurate Product data. Problematic: wrong availability. Ambiguous: no business requirement established.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Evaluating a site audit rule
|
|
2
|
+
|
|
3
|
+
The contract for evaluating one AI-analyzed rule from a `sfnext audit prepare` run. `<run>` is the run folder holding `prepared.json`.
|
|
4
|
+
|
|
5
|
+
For each rule id, find its entry in `<run>/prepared.json` `rules`, then read:
|
|
6
|
+
|
|
7
|
+
- the rule `file` and its category's `CATEGORY.md` (`../CATEGORY.md` from the rule file), and follow the rule's `Intent`, `Inspect`, `Evaluate`, `Evidence` and `Remediation` sections;
|
|
8
|
+
- the entry's `data` file, if it has one (compact script output; start there);
|
|
9
|
+
- only the evidence the rule's `inputs` point to, using the table below. `pages` in `prepared.json` maps each page label to its URL and Playhouse `archiveDir` (relative to the run folder).
|
|
10
|
+
|
|
11
|
+
Don't read other rules, other `results/` files, earlier audit workspaces or the audit tool's source. The audited project is read-only.
|
|
12
|
+
|
|
13
|
+
| input | where to look |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `playhouse.main-document` | `curl -sL <page url>` (the archive keeps document metadata, not the HTML); cite what you saw as `manual` evidence |
|
|
16
|
+
| `playhouse.document` | `<archiveDir>/runs/mobile-cold-1/document.json` (status and response headers; any `runs/<cell>-<n>/` works) |
|
|
17
|
+
| `playhouse.network-har` | `<archiveDir>/network-mobile-cold.har` (standard HAR, a few MB; use `jq`). Rules that name a `harArtifact` in their data use that run's `runs/<run id>/network.har`, whose query values are redacted; cite the artifact the data names. |
|
|
18
|
+
| `playhouse.summary`, `playhouse.summary-*` | `<archiveDir>/summary*.json` |
|
|
19
|
+
| `playhouse.opportunities` | `<archiveDir>/opportunities.json` |
|
|
20
|
+
| `playhouse.diagnostics` | `<archiveDir>/diagnostics-mobile-cold.json` |
|
|
21
|
+
| `playhouse.scripts` | `<archiveDir>/scripts/index.json` lists every script each run loaded; inline scripts have the page URL as `url`, and their text is `<archiveDir>/scripts/<body.sha256>.js` |
|
|
22
|
+
| `playhouse.lighthouse` | `<archiveDir>/runs/mobile-cold-1/lhr.json` (the full Lighthouse result; use `jq` on `.audits["<audit id>"]`) |
|
|
23
|
+
| `source.*`, `project.config`, `deployment.config` | the project repo (`grep`, read files) |
|
|
24
|
+
| `manual.*`, `dependency.advisories` | not collected by the audit; decide from the rule's other inputs, or use `not-verified` when nothing else can settle it |
|
|
25
|
+
|
|
26
|
+
Write one file per rule at the entry's `output` path:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{ "ruleId": "seo/meta-description", "disposition": "finding", "severity": "low",
|
|
30
|
+
"summary": "The PDP has no meta description.", "remediation": "Render a product-specific description in the PDP route meta.",
|
|
31
|
+
"evidence": [{ "type": "source", "file": "src/routes/_app.product.$id.tsx", "line": 42 }] }
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
- `disposition`: reach a conclusion. Use `finding` when you can point to a concrete problem; when you are unsure how much it matters, lower the severity rather than holding back the finding. Use `pass` when you checked what the rule asks and it is met, and cite what you checked: a pass needs evidence just like a finding. Use `not-applicable` when the rule doesn't apply to this project (e.g. locale alternates on a single-locale site). Use `not-verified` only when the evidence the rule needs can't be collected at all (e.g. a real checkout); its `summary` must say what would verify it. Not-verified rules are listed for manual review and don't affect the launch guidance. A rule without a file is reported as `not-verified`.
|
|
35
|
+
- Give every `finding` a `severity` (`critical`, `high`, `medium`, `low` or `info`), normally the rule's frontmatter `severity`. That severity is a ceiling: you may lower it when the impact is smaller, but a higher or missing value is reported at the rule's severity. `remediation` is optional.
|
|
36
|
+
- Evidence types, one example each:
|
|
37
|
+
- `{ "type": "source", "file": "src/root.tsx", "line": 12, "excerpt": "…" }`, where `file` is project-relative;
|
|
38
|
+
- `{ "type": "playhouse", "page": "home", "artifact": "network-mobile-cold.har", "pointer": "/log/entries/3/response/headers", "value": "…" }`, where `artifact` is a path relative to that page's `archiveDir` (`diagnostics-mobile-cold.json`, not `playhouse/runs/…/diagnostics-mobile-cold.json`; never `main-document`) and `pointer` is an optional JSON pointer;
|
|
39
|
+
- `{ "type": "manual", "description": "Checkout was not exercised.", "location": "pdp" }`, also used for a `curl` result: `{ "type": "manual", "description": "curl -sL https://example.com/: <link rel=\"canonical\" href=\"https://example.com/\"/>", "location": "home" }`.
|
|
40
|
+
- Cite each fact once per page, from the mobile cold-cache artifact when the rule doesn't name one; don't repeat it for every form factor and cache state. Make a Playhouse `value` readable on its own (e.g. `max-age=15552000; includeSubDomains`); the dashboard shows the page, the artifact and that value, not the pointer.
|
|
41
|
+
- Some rules ask for an extra output field in their `Evidence` section (for example `waterfall` or `recommendations`); include it exactly as described there.
|
|
42
|
+
- Never include secrets, cookies, authorization headers or response bodies.
|