@domandigital/create-site 0.1.0 → 0.3.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.
@@ -1,20 +1,20 @@
1
- // Every page and every dynamic route has a policy entry, and every money page
2
- // has a keyword target. Fails the moment a page is added without one. Written by
3
- // @domandigital/create-site: the data lives in site.routes.ts.
4
-
5
- import { describe, expect, test } from "vitest";
6
- import { findKeywordCannibalization, validateCoverage } from "@domandigital/seo";
7
- import { moneyRoutes, policy, targets } from "~site/routes";
8
- import { dynamicRoutesOnDisk, routesOnDisk } from "~site/routes-on-disk";
9
-
10
- describe("route coverage", () => {
11
- test("every page and dynamic route on disk has a policy entry, and every money page has a target", () => {
12
- expect(
13
- validateCoverage({ routesOnDisk: routesOnDisk(), dynamicRoutesOnDisk: dynamicRoutesOnDisk(), policy, moneyRoutes, targets }),
14
- ).toEqual([]);
15
- });
16
-
17
- test("no two pages chase the same keyword", () => {
18
- expect(findKeywordCannibalization(targets)).toEqual([]);
19
- });
20
- });
1
+ // Every page and every dynamic route has a policy entry, and every money page
2
+ // has a keyword target. Fails the moment a page is added without one. Written by
3
+ // @domandigital/create-site: the data lives in site.routes.ts.
4
+
5
+ import { describe, expect, test } from "vitest";
6
+ import { findKeywordCannibalization, validateCoverage } from "@domandigital/seo";
7
+ import { moneyRoutes, policy, targets } from "~site/routes";
8
+ import { dynamicRoutesOnDisk, routesOnDisk } from "~site/routes-on-disk";
9
+
10
+ describe("route coverage", () => {
11
+ test("every page and dynamic route on disk has a policy entry, and every money page has a target", () => {
12
+ expect(
13
+ validateCoverage({ routesOnDisk: routesOnDisk(), dynamicRoutesOnDisk: dynamicRoutesOnDisk(), policy, moneyRoutes, targets }),
14
+ ).toEqual([]);
15
+ });
16
+
17
+ test("no two pages chase the same keyword", () => {
18
+ expect(findKeywordCannibalization(targets)).toEqual([]);
19
+ });
20
+ });
@@ -1,16 +1,16 @@
1
- // Every indexable page's JSON-LD is one connected graph: no dangling @id
2
- // references, no duplicate ids. Written by @domandigital/create-site.
3
-
4
- import { describe, expect, test } from "vitest";
5
- import { findGraphIssues } from "@domandigital/graph";
6
- import { buildPageGraph } from "~site/page-graph";
7
- import { policy } from "~site/routes";
8
-
9
- describe("JSON-LD", () => {
10
- test("every indexable page builds a graph with no unresolved or duplicate @id", () => {
11
- const issues = policy
12
- .filter((entry) => entry.indexable && !entry.isDynamicPattern)
13
- .flatMap((entry) => findGraphIssues(buildPageGraph({ path: entry.path, name: entry.path })).map((i) => `${entry.path}: ${i}`));
14
- expect(issues).toEqual([]);
15
- });
16
- });
1
+ // Every indexable page's JSON-LD is one connected graph: no dangling @id
2
+ // references, no duplicate ids. Written by @domandigital/create-site.
3
+
4
+ import { describe, expect, test } from "vitest";
5
+ import { findGraphIssues } from "@domandigital/graph";
6
+ import { buildPageGraph } from "~site/page-graph";
7
+ import { policy } from "~site/routes";
8
+
9
+ describe("JSON-LD", () => {
10
+ test("every indexable page builds a graph with no unresolved or duplicate @id", () => {
11
+ const issues = policy
12
+ .filter((entry) => entry.indexable && !entry.isDynamicPattern)
13
+ .flatMap((entry) => findGraphIssues(buildPageGraph({ path: entry.path, name: entry.path })).map((i) => `${entry.path}: ${i}`));
14
+ expect(issues).toEqual([]);
15
+ });
16
+ });
@@ -1,25 +1,25 @@
1
- // The migration gate: every URL another site links to still lands on a page,
2
- // in one hop. Record earned links in links.json and moved URLs in
3
- // redirects.json. Written by @domandigital/create-site.
4
-
5
- import { describe, expect, test } from "vitest";
6
- import { liveLinkedUrls, validateRedirects } from "@domandigital/seo";
7
- import type { BacklinkRegister, RedirectsFile } from "@domandigital/seo";
8
- import { facts } from "~site/facts";
9
- import links from "~site/links.json";
10
- import redirectsFile from "~site/redirects.json";
11
- import { policy } from "~site/routes";
12
- import { routesOnDisk } from "~site/routes-on-disk";
13
-
14
- describe("redirects", () => {
15
- test("every linked URL resolves, with no chains, loops or dead targets", () => {
16
- const issues = validateRedirects({
17
- linkedUrls: liveLinkedUrls(links as BacklinkRegister),
18
- routesOnDisk: routesOnDisk(),
19
- redirects: (redirectsFile as RedirectsFile).redirects,
20
- policy,
21
- hosts: [new URL(facts.url).hostname, ...facts.previousHosts],
22
- });
23
- expect(issues).toEqual([]);
24
- });
25
- });
1
+ // The migration gate: every URL another site links to still lands on a page,
2
+ // in one hop. Record earned links in links.json and moved URLs in
3
+ // redirects.json. Written by @domandigital/create-site.
4
+
5
+ import { describe, expect, test } from "vitest";
6
+ import { liveLinkedUrls, validateRedirects } from "@domandigital/seo";
7
+ import type { BacklinkRegister, RedirectsFile } from "@domandigital/seo";
8
+ import { facts } from "~site/facts";
9
+ import links from "~site/links.json";
10
+ import redirectsFile from "~site/redirects.json";
11
+ import { policy } from "~site/routes";
12
+ import { routesOnDisk } from "~site/routes-on-disk";
13
+
14
+ describe("redirects", () => {
15
+ test("every linked URL resolves, with no chains, loops or dead targets", () => {
16
+ const issues = validateRedirects({
17
+ linkedUrls: liveLinkedUrls(links as BacklinkRegister),
18
+ routesOnDisk: routesOnDisk(),
19
+ redirects: (redirectsFile as RedirectsFile).redirects,
20
+ policy,
21
+ hosts: [new URL(facts.url).hostname, ...facts.previousHosts],
22
+ });
23
+ expect(issues).toEqual([]);
24
+ });
25
+ });