create-ailk 0.29.1 → 0.31.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 +71 -3
- package/component-catalog.json +524 -8
- package/component-catalog.md +8 -5
- package/dist/add-route.js +1 -0
- package/dist/cli.js +114 -1
- package/dist/cutover.d.ts +109 -0
- package/dist/cutover.js +494 -0
- package/dist/design-presets.js +20 -4
- package/dist/export-content.d.ts +55 -0
- package/dist/export-content.js +303 -0
- package/dist/inventory.d.ts +216 -0
- package/dist/inventory.js +833 -0
- package/dist/language-import.d.ts +114 -0
- package/dist/language-import.js +435 -0
- package/dist/lib/env-catalog.js +2 -2
- package/dist/lib/import-mdx.d.ts +38 -0
- package/dist/lib/import-mdx.js +411 -64
- package/dist/lib/render-comparison.d.ts +200 -0
- package/dist/lib/render-comparison.js +374 -0
- package/dist/lib/scaffold-render-sweep.d.ts +1 -1
- package/dist/lib/scaffold-render-sweep.js +1 -1
- package/dist/migrate-content.d.ts +6 -2
- package/dist/migrate-content.js +60 -14
- package/dist/module-architecture.js +6 -1
- package/dist/provision-env.d.ts +28 -0
- package/dist/provision-env.js +210 -0
- package/dist/seed-workspace.d.ts +3 -1
- package/dist/seed-workspace.js +45 -16
- package/dist/surfaces.js +3 -0
- package/dist/topology.d.ts +12 -0
- package/dist/topology.js +28 -10
- package/package.json +3 -3
- package/templates/.claude/cloudparity-repo-hooks.json +5 -0
- package/templates/.claude/hooks/content-source-guard.sh +75 -0
- package/templates/.claude/settings.json +9 -0
- package/templates/.env.example +7 -0
- package/templates/.github/workflows/ci.yml +2 -0
- package/templates/CLAUDE.md +5 -0
- package/templates/apps/api/CLAUDE.md +6 -2
- package/templates/apps/mcp/.env.example +20 -0
- package/templates/apps/mcp/CLAUDE.md +46 -8
- package/templates/apps/web/.env.example +4 -2
- package/templates/apps/web/CLAUDE.md +39 -5
- package/templates/apps/web/app/.well-known/ai-plugin.json/route.ts +9 -1
- package/templates/apps/web/app/.well-known/mcp.json/build-manifest.ts +58 -0
- package/templates/apps/web/app/.well-known/mcp.json/route.ts +16 -0
- package/templates/apps/web/app/.well-known/oauth-authorization-server/route.ts +53 -0
- package/templates/apps/web/app/[locale]/(auth)/__tests__/password-reset.test.tsx +8 -1
- package/templates/apps/web/app/[locale]/(auth)/consent/__tests__/consent-actions.test.ts +56 -0
- package/templates/apps/web/app/[locale]/(auth)/consent/__tests__/page.test.tsx +164 -0
- package/templates/apps/web/app/[locale]/(auth)/consent/consent-form.tsx +132 -0
- package/templates/apps/web/app/[locale]/(auth)/consent/consent.actions.ts +51 -0
- package/templates/apps/web/app/[locale]/(auth)/consent/page.tsx +144 -0
- package/templates/apps/web/app/[locale]/[slug]/[detail]/__tests__/page.test.tsx +153 -4
- package/templates/apps/web/app/[locale]/[slug]/[detail]/page.tsx +45 -2
- package/templates/apps/web/app/[locale]/about/__tests__/about-routes.test.tsx +2 -2
- package/templates/apps/web/app/[locale]/contact/__tests__/site-contact-lines.test.ts +49 -0
- package/templates/apps/web/app/[locale]/contact/site-contact-lines.ts +6 -4
- package/templates/apps/web/app/[locale]/events/[slug]/page.tsx +13 -1
- package/templates/apps/web/app/[locale]/events/__tests__/program-event.test.tsx +120 -0
- package/templates/apps/web/app/[locale]/events/page.tsx +11 -0
- package/templates/apps/web/app/[locale]/flows/[slug]/FlowStepperClient.tsx +44 -5
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.thanks-by-tier.test.tsx +306 -0
- package/templates/apps/web/app/[locale]/layout.tsx +122 -27
- package/templates/apps/web/app/[locale]/thanks/[slug]/__tests__/page.test.tsx +21 -2
- package/templates/apps/web/app/[locale]/thanks/[slug]/page.tsx +1 -0
- package/templates/apps/web/app/api/auth/hub/continuation.ts +8 -3
- package/templates/apps/web/app/api/auth/mcp/__tests__/continuation.test.ts +92 -0
- package/templates/apps/web/app/api/auth/mcp/continuation.ts +89 -0
- package/templates/apps/web/app/api/auth/mcp/continue/[ref]/__tests__/route.test.ts +59 -0
- package/templates/apps/web/app/api/auth/mcp/continue/[ref]/route.ts +41 -0
- package/templates/apps/web/app/llms.txt/route.ts +26 -9
- package/templates/apps/web/app/openapi.json/__tests__/route.test.ts +40 -0
- package/templates/apps/web/app/openapi.json/route.ts +4 -0
- package/templates/apps/web/app/robots.txt/route.ts +18 -1
- package/templates/apps/web/app/sitemap.xml/route.ts +13 -0
- package/templates/apps/web/auth.ts +184 -7
- package/templates/apps/web/jest.config.cjs +46 -1
- package/templates/apps/web/lib/__tests__/auth-routes.test.ts +2 -1
- package/templates/apps/web/lib/__tests__/bot-check.test.ts +247 -4
- package/templates/apps/web/lib/__tests__/in-page-magnet-self-request.test.ts +92 -0
- package/templates/apps/web/lib/__tests__/page-chrome.test.ts +90 -0
- package/templates/apps/web/lib/__tests__/relay.test.ts +33 -8
- package/templates/apps/web/lib/__tests__/site-identity-feature-list.test.ts +196 -0
- package/templates/apps/web/lib/__tests__/structured-data.test.tsx +11 -1
- package/templates/apps/web/lib/auth-routes.ts +5 -3
- package/templates/apps/web/lib/bot-check.ts +113 -13
- package/templates/apps/web/lib/in-page-magnet.ts +4 -1
- package/templates/apps/web/lib/mcp-oauth.ts +702 -0
- package/templates/apps/web/lib/page-chrome.ts +65 -5
- package/templates/apps/web/lib/relay.ts +22 -3
- package/templates/apps/web/lib/site-identity.ts +75 -24
- package/templates/apps/web/messages/en.json +47 -14
- package/templates/apps/web/next.config.mjs +15 -1
- package/templates/apps/web/package.json +1 -1
- package/templates/apps/web/scripts/assert-content-bundled.ts +36 -8
- package/templates/apps/web/scripts/content-snapshot.ts +33 -0
- package/templates/database/seed.ts +6 -0
- package/templates/package.json +2 -1
- package/templates/tools/check-content-source.ts +108 -0
- package/versions.json +48 -48
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
/**
|
|
3
|
+
* Content-source check — fails when a site whose pages come from the
|
|
4
|
+
* database (`CONTENT_ADAPTER=database`) carries a page file under
|
|
5
|
+
* `content/en/`.
|
|
6
|
+
*
|
|
7
|
+
* On such a site the page that renders comes from the database, so a
|
|
8
|
+
* `content/en/**\/*.mdx` is a second copy the site never reads. The source is
|
|
9
|
+
* `database` when the environment says so, or when any of Next's eight env
|
|
10
|
+
* files under `apps/web/` (`.env`, `.env.local`, `.env.development`,
|
|
11
|
+
* `.env.development.local`, `.env.production`, `.env.production.local`,
|
|
12
|
+
* `.env.test`, `.env.test.local`) assigns it last in that file. The same rule
|
|
13
|
+
* and the same message as `.claude/hooks/content-source-guard.sh`, which
|
|
14
|
+
* refuses the write. A files site (`CONTENT_ADAPTER` unset or `mdx`) passes.
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* pnpm content-source:check # or: tsx tools/check-content-source.ts
|
|
18
|
+
*
|
|
19
|
+
* Exit codes:
|
|
20
|
+
* 0 — pages come from files, or from the database with no page file
|
|
21
|
+
* 1 — a page file under `content/en/` on a database-sourced site
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
25
|
+
import { dirname, join, resolve } from "node:path";
|
|
26
|
+
|
|
27
|
+
const ROOT = resolve(dirname(process.argv[1] ?? "."), "..");
|
|
28
|
+
|
|
29
|
+
const ENV_FILES = [
|
|
30
|
+
".env",
|
|
31
|
+
".env.local",
|
|
32
|
+
".env.development",
|
|
33
|
+
".env.development.local",
|
|
34
|
+
".env.production",
|
|
35
|
+
".env.production.local",
|
|
36
|
+
".env.test",
|
|
37
|
+
".env.test.local",
|
|
38
|
+
];
|
|
39
|
+
const ASSIGNMENT = /^[ \t]*(export[ \t]+)?CONTENT_ADAPTER[ \t]*=/;
|
|
40
|
+
|
|
41
|
+
/** The value of the file's last `CONTENT_ADAPTER` assignment, or undefined. */
|
|
42
|
+
function lastAssignment(text: string): string | undefined {
|
|
43
|
+
let last: string | undefined;
|
|
44
|
+
for (const line of text.split("\n")) {
|
|
45
|
+
if (!ASSIGNMENT.test(line)) continue;
|
|
46
|
+
let value = line.slice(line.indexOf("=") + 1);
|
|
47
|
+
let quote = "";
|
|
48
|
+
for (let i = 0; i < value.length; i++) {
|
|
49
|
+
const c = value[i]!;
|
|
50
|
+
if (quote !== "") {
|
|
51
|
+
if (c === quote) quote = "";
|
|
52
|
+
} else if (c === '"' || c === "'") {
|
|
53
|
+
quote = c;
|
|
54
|
+
} else if (c === "#" && i > 0 && /[ \t]/.test(value[i - 1]!)) {
|
|
55
|
+
value = value.slice(0, i);
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
value = value.replace(/^[ \t\r]+/, "").replace(/[ \t\r]+$/, "");
|
|
60
|
+
const first = value[0];
|
|
61
|
+
if (value.length >= 2 && (first === '"' || first === "'") && value.endsWith(first)) {
|
|
62
|
+
value = value.slice(1, -1);
|
|
63
|
+
}
|
|
64
|
+
last = value;
|
|
65
|
+
}
|
|
66
|
+
return last;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Where `CONTENT_ADAPTER=database` comes from, or undefined on a files site. */
|
|
70
|
+
function databaseSource(): string | undefined {
|
|
71
|
+
if (process.env.CONTENT_ADAPTER === "database") return "the environment";
|
|
72
|
+
for (const name of ENV_FILES) {
|
|
73
|
+
const file = join(ROOT, "apps", "web", name);
|
|
74
|
+
if (statSync(file, { throwIfNoEntry: false })?.isFile() !== true) continue;
|
|
75
|
+
if (lastAssignment(readFileSync(file, "utf8")) === "database") return `apps/web/${name}`;
|
|
76
|
+
}
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function pageFiles(dir: string, rel: string): string[] {
|
|
81
|
+
if (!existsSync(dir)) return [];
|
|
82
|
+
return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
|
|
83
|
+
const childRel = `${rel}/${entry.name}`;
|
|
84
|
+
if (entry.isDirectory()) return pageFiles(join(dir, entry.name), childRel);
|
|
85
|
+
return entry.isFile() && entry.name.endsWith(".mdx") ? [childRel] : [];
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const source = databaseSource();
|
|
90
|
+
if (source === undefined) {
|
|
91
|
+
console.log("content-source: pages come from files (CONTENT_ADAPTER is not database)");
|
|
92
|
+
process.exit(0);
|
|
93
|
+
}
|
|
94
|
+
const pages = pageFiles(join(ROOT, "content", "en"), "content/en").sort();
|
|
95
|
+
if (pages.length === 0) {
|
|
96
|
+
console.log(`content-source: pages come from the database (${source}); no page file under content/en/`);
|
|
97
|
+
process.exit(0);
|
|
98
|
+
}
|
|
99
|
+
for (const page of pages) {
|
|
100
|
+
console.error(
|
|
101
|
+
`content-source: ${page} is a page file, but this site's pages come from the database (CONTENT_ADAPTER=database in ${source}), so the site never reads it.`,
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
console.error(
|
|
105
|
+
"Change a page through the site's MCP tools instead: save_draft writes the draft and publish_draft publishes it; read_content returns the current page.",
|
|
106
|
+
);
|
|
107
|
+
console.error("Pages and layout: words live in the database, layout stays in code (CLAUDE.md § Content).");
|
|
108
|
+
process.exit(1);
|
package/versions.json
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
1
|
{
|
|
2
|
-
"@working-theory/admin-ui": "0.
|
|
3
|
-
"@working-theory/aeo": "0.
|
|
4
|
-
"@working-theory/agent-context": "0.
|
|
2
|
+
"@working-theory/admin-ui": "0.54.0",
|
|
3
|
+
"@working-theory/aeo": "0.54.0",
|
|
4
|
+
"@working-theory/agent-context": "0.54.0",
|
|
5
5
|
"@working-theory/agent-contract": "0.1.0",
|
|
6
6
|
"@working-theory/agent-memory": "0.0.0",
|
|
7
7
|
"@working-theory/ai": "0.1.0",
|
|
8
|
-
"@working-theory/analytics": "0.
|
|
9
|
-
"@working-theory/api": "0.
|
|
10
|
-
"@working-theory/api-client": "0.
|
|
8
|
+
"@working-theory/analytics": "0.54.0",
|
|
9
|
+
"@working-theory/api": "0.54.0",
|
|
10
|
+
"@working-theory/api-client": "0.54.0",
|
|
11
11
|
"@working-theory/cda-filesystem": "0.0.0",
|
|
12
|
-
"@working-theory/cli": "0.
|
|
13
|
-
"@working-theory/common": "0.
|
|
12
|
+
"@working-theory/cli": "0.54.0",
|
|
13
|
+
"@working-theory/common": "0.54.0",
|
|
14
14
|
"@working-theory/consent": "0.1.0",
|
|
15
|
-
"@working-theory/content-adapters": "0.
|
|
16
|
-
"@working-theory/content-projection": "0.
|
|
17
|
-
"@working-theory/email": "0.
|
|
15
|
+
"@working-theory/content-adapters": "0.54.0",
|
|
16
|
+
"@working-theory/content-projection": "0.54.0",
|
|
17
|
+
"@working-theory/email": "0.54.0",
|
|
18
18
|
"@working-theory/env": "0.0.0",
|
|
19
|
-
"@working-theory/eslint-config": "0.
|
|
20
|
-
"@working-theory/fumadocs-schema": "0.
|
|
21
|
-
"@working-theory/ids": "0.
|
|
22
|
-
"@working-theory/jsonld": "0.
|
|
23
|
-
"@working-theory/license": "0.
|
|
24
|
-
"@working-theory/mcp-server": "0.
|
|
25
|
-
"@working-theory/metadata": "0.
|
|
26
|
-
"@working-theory/observability": "0.
|
|
27
|
-
"@working-theory/page-renderer": "0.
|
|
19
|
+
"@working-theory/eslint-config": "0.54.0",
|
|
20
|
+
"@working-theory/fumadocs-schema": "0.54.0",
|
|
21
|
+
"@working-theory/ids": "0.19.0",
|
|
22
|
+
"@working-theory/jsonld": "0.54.0",
|
|
23
|
+
"@working-theory/license": "0.54.0",
|
|
24
|
+
"@working-theory/mcp-server": "0.54.0",
|
|
25
|
+
"@working-theory/metadata": "0.54.0",
|
|
26
|
+
"@working-theory/observability": "0.54.0",
|
|
27
|
+
"@working-theory/page-renderer": "0.54.0",
|
|
28
28
|
"@working-theory/plugin-mcp": "0.1.3",
|
|
29
|
-
"@working-theory/schema": "0.
|
|
30
|
-
"@working-theory/schema-pack-registry": "0.
|
|
31
|
-
"@working-theory/schema-validator": "0.
|
|
32
|
-
"@working-theory/sections-registry": "0.
|
|
33
|
-
"@working-theory/site-config": "0.
|
|
34
|
-
"@working-theory/spoke-checkout": "0.7.
|
|
35
|
-
"@working-theory/stripe-client": "0.
|
|
36
|
-
"@working-theory/templates": "0.
|
|
37
|
-
"@working-theory/theme": "0.
|
|
38
|
-
"@working-theory/ui": "0.
|
|
39
|
-
"@working-theory/validation": "0.
|
|
40
|
-
"@working-theory/web-i18n": "0.
|
|
41
|
-
"@working-theory/admin": "0.
|
|
42
|
-
"@working-theory/api-commerce": "0.1.
|
|
43
|
-
"@working-theory/api-content-write": "0.
|
|
44
|
-
"@working-theory/api-hub": "0.
|
|
45
|
-
"@working-theory/api-multi-tenant": "0.2.
|
|
46
|
-
"@working-theory/api-scheduling": "0.4.
|
|
47
|
-
"@working-theory/api-signal-collectors": "0.
|
|
48
|
-
"@working-theory/api-workspace": "0.
|
|
29
|
+
"@working-theory/schema": "0.54.0",
|
|
30
|
+
"@working-theory/schema-pack-registry": "0.54.0",
|
|
31
|
+
"@working-theory/schema-validator": "0.54.0",
|
|
32
|
+
"@working-theory/sections-registry": "0.54.0",
|
|
33
|
+
"@working-theory/site-config": "0.54.0",
|
|
34
|
+
"@working-theory/spoke-checkout": "0.7.10",
|
|
35
|
+
"@working-theory/stripe-client": "0.54.0",
|
|
36
|
+
"@working-theory/templates": "0.54.0",
|
|
37
|
+
"@working-theory/theme": "0.54.0",
|
|
38
|
+
"@working-theory/ui": "0.54.0",
|
|
39
|
+
"@working-theory/validation": "0.54.0",
|
|
40
|
+
"@working-theory/web-i18n": "0.54.0",
|
|
41
|
+
"@working-theory/admin": "0.10.0",
|
|
42
|
+
"@working-theory/api-commerce": "0.1.8",
|
|
43
|
+
"@working-theory/api-content-write": "0.5.0",
|
|
44
|
+
"@working-theory/api-hub": "0.4.0",
|
|
45
|
+
"@working-theory/api-multi-tenant": "0.2.3",
|
|
46
|
+
"@working-theory/api-scheduling": "0.4.5",
|
|
47
|
+
"@working-theory/api-signal-collectors": "0.3.1",
|
|
48
|
+
"@working-theory/api-workspace": "0.5.0",
|
|
49
49
|
"@working-theory/billing-client": "0.0.0",
|
|
50
50
|
"@working-theory/branding": "0.0.0",
|
|
51
51
|
"@working-theory/license-client": "0.0.0",
|
|
52
52
|
"@working-theory/license-manifest": "0.0.0",
|
|
53
|
-
"@working-theory/mcp-scheduling": "0.3.
|
|
54
|
-
"@working-theory/mcp-signal-collectors": "0.2.
|
|
55
|
-
"@working-theory/mcp-workspace": "0.
|
|
53
|
+
"@working-theory/mcp-scheduling": "0.3.7",
|
|
54
|
+
"@working-theory/mcp-signal-collectors": "0.2.8",
|
|
55
|
+
"@working-theory/mcp-workspace": "0.6.0",
|
|
56
56
|
"@working-theory/partner-session": "0.0.0",
|
|
57
57
|
"@working-theory/preview-protocol": "0.0.0",
|
|
58
|
-
"@working-theory/ui-commerce": "0.23.
|
|
59
|
-
"@working-theory/ui-docs-blog": "0.23.
|
|
60
|
-
"@working-theory/ui-scheduling": "0.25.
|
|
61
|
-
"@working-theory/ui-signal-collectors": "0.27.
|
|
58
|
+
"@working-theory/ui-commerce": "0.23.32",
|
|
59
|
+
"@working-theory/ui-docs-blog": "0.23.32",
|
|
60
|
+
"@working-theory/ui-scheduling": "0.25.6",
|
|
61
|
+
"@working-theory/ui-signal-collectors": "0.27.10",
|
|
62
62
|
"@working-theory/web": "0.0.0",
|
|
63
63
|
"@working-theory/app-api": "1.0.0",
|
|
64
64
|
"@working-theory/mcp": "0.0.0",
|
|
65
|
-
"@working-theory/database": "0.
|
|
65
|
+
"@working-theory/database": "0.54.0"
|
|
66
66
|
}
|