@domandigital/create-site 0.4.0 → 0.5.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/CHANGELOG.md +18 -0
- package/README.md +26 -3
- package/dist/cli.js +138 -30
- package/package.json +3 -3
- package/templates/astro/components/CookieBanner.astro +42 -0
- package/templates/astro/pages/accessibility.astro +65 -0
- package/templates/astro/pages/cookies.astro +72 -0
- package/templates/astro/pages/privacy.astro +90 -0
- package/templates/astro/pages/terms.astro +76 -0
- package/templates/next/app/accessibility/page.tsx +65 -0
- package/templates/next/app/cookies/page.tsx +74 -0
- package/templates/next/app/privacy/page.tsx +96 -0
- package/templates/next/app/terms/page.tsx +79 -0
- package/templates/next/components/CookieBanner.tsx +55 -0
- package/templates/shared/lib/consent.ts +45 -0
- package/templates/shared/lib/graph/site-adapter.ts +36 -0
- package/templates/shared/lib/legal.ts +33 -0
- package/templates/shared/tests/house.test.ts +16 -0
|
@@ -8,6 +8,7 @@ import { readdirSync, readFileSync } from "node:fs";
|
|
|
8
8
|
import { join, relative } from "node:path";
|
|
9
9
|
import { describe, expect, test } from "vitest";
|
|
10
10
|
import { facts } from "~site/facts";
|
|
11
|
+
import { legal } from "~site/legal";
|
|
11
12
|
|
|
12
13
|
const ROOT = process.cwd();
|
|
13
14
|
const SOURCE_DIRS = ["app", "src", "components", "lib", "content"];
|
|
@@ -53,6 +54,21 @@ describe.runIf(mode === "launch")("ready to launch", () => {
|
|
|
53
54
|
expect(placed).toBe(true);
|
|
54
55
|
});
|
|
55
56
|
|
|
57
|
+
test("the cookie banner is placed on the site", () => {
|
|
58
|
+
const placed = sourceFiles().some((file) => !/CookieBanner\.(tsx|astro)$/.test(file) && readFileSync(file, "utf8").includes("<CookieBanner"));
|
|
59
|
+
expect(placed).toBe(true);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test("the legal pages have what every site needs: retention, the processors, the governing law, a review date", () => {
|
|
63
|
+
const missing = [
|
|
64
|
+
legal.retention ? null : "legal.retention",
|
|
65
|
+
legal.processors.length > 0 ? null : "legal.processors (the host at least)",
|
|
66
|
+
legal.governingLaw ? null : "legal.governingLaw",
|
|
67
|
+
legal.reviewedOn ? null : "legal.reviewedOn",
|
|
68
|
+
].filter(Boolean);
|
|
69
|
+
expect(missing).toEqual([]);
|
|
70
|
+
});
|
|
71
|
+
|
|
56
72
|
test("phone and postcode are filled in", () => {
|
|
57
73
|
expect(facts.phone).not.toBeNull();
|
|
58
74
|
expect(facts.address?.postalCode ?? null).not.toBeNull();
|