@uxfront/site-checks 0.1.0 → 0.1.1

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 CHANGED
@@ -21,10 +21,10 @@ Write a config next to your site's `package.json`. Its default export holds the
21
21
  import { defineConfig } from "@uxfront/site-checks";
22
22
 
23
23
  export default defineConfig({
24
- site: "https://inkline.io",
25
- rules: {
26
- "sitemap-pages": { paths: "lookup" },
27
- },
24
+ site: "https://inkline.io",
25
+ rules: {
26
+ "sitemap-pages": { paths: "lookup" },
27
+ },
28
28
  });
29
29
  ```
30
30
 
@@ -32,9 +32,9 @@ Then run the check on the build:
32
32
 
33
33
  ```json
34
34
  {
35
- "scripts": {
36
- "check:seo": "site-checks seo .output/public"
37
- }
35
+ "scripts": {
36
+ "check:seo": "site-checks seo .output/public"
37
+ }
38
38
  }
39
39
  ```
40
40
 
@@ -192,17 +192,17 @@ A check only one site needs can live in its config, and runs on the same parsed
192
192
  ```js
193
193
  // site-checks.config.mjs
194
194
  export default {
195
- site: "https://opencomponents.dev",
196
- extraRules: [
197
- {
198
- id: "schema-cors",
199
- check({ site, headersFor, report }) {
200
- const url = `${site}/schemas/contract.json`;
201
- const cors = headersFor(url).find(([name]) => name === "access-control-allow-origin");
202
- if (cors?.[1] !== "*") report(url, "no Access-Control-Allow-Origin: *");
203
- },
204
- },
205
- ],
195
+ site: "https://opencomponents.dev",
196
+ extraRules: [
197
+ {
198
+ id: "schema-cors",
199
+ check({ site, headersFor, report }) {
200
+ const url = `${site}/schemas/contract.json`;
201
+ const cors = headersFor(url).find(([name]) => name === "access-control-allow-origin");
202
+ if (cors?.[1] !== "*") report(url, "no Access-Control-Allow-Origin: *");
203
+ },
204
+ },
205
+ ],
206
206
  };
207
207
  ```
208
208
 
@@ -227,7 +227,7 @@ export default {
227
227
  import { lighthouseConfig } from "@uxfront/site-checks/lighthouse";
228
228
 
229
229
  export default lighthouseConfig({
230
- collect: { staticDistDir: "dist", url: ["http://localhost/"] },
230
+ collect: { staticDistDir: "dist", url: ["http://localhost/"] },
231
231
  });
232
232
  ```
233
233
 
@@ -2,7 +2,7 @@
2
2
  import { main } from "../lib/cli.js";
3
3
 
4
4
  process.exitCode = await main(process.argv.slice(2), {
5
- out: (text) => process.stdout.write(text),
6
- err: (text) => process.stderr.write(text),
7
- cwd: process.cwd(),
5
+ out: (text) => process.stdout.write(text),
6
+ err: (text) => process.stderr.write(text),
7
+ cwd: process.cwd(),
8
8
  });