create-ailk 0.43.0 → 0.44.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 +11 -10
- package/component-catalog.json +23 -0
- package/dist/lib/import-mdx.d.ts +12 -15
- package/dist/lib/import-mdx.js +168 -193
- package/dist/migrate-content.d.ts +9 -16
- package/dist/migrate-content.js +43 -81
- package/package.json +3 -3
- package/templates/apps/api/CLAUDE.md +11 -6
- package/templates/apps/mcp/CLAUDE.md +8 -2
- package/templates/apps/web/package.json +1 -1
- package/versions.json +50 -50
package/README.md
CHANGED
|
@@ -898,23 +898,24 @@ AILK_AGENT_KEY=<agent key> create-ailk migrate-content ./my-site --apply --api-u
|
|
|
898
898
|
- Pages land as drafts and nothing is published, so the live site keeps
|
|
899
899
|
serving its MDX files and does not change.
|
|
900
900
|
- The plan cannot see a write the API would refuse at `--apply` (a conflict
|
|
901
|
-
with an edit made in between,
|
|
902
|
-
|
|
903
|
-
|
|
901
|
+
with an edit made in between, a server error, or a page whose content fails
|
|
902
|
+
its page type): such a page is planned `create` or `update`. At `--apply`
|
|
903
|
+
the save refuses a page that fails its page type with `422 invalid` and
|
|
904
|
+
stores nothing (#11843); fix its file and re-run.
|
|
904
905
|
- The site's dependencies must be installed (`pnpm install`): the pages are
|
|
905
906
|
read through the site's own `@working-theory/content-adapters`.
|
|
906
|
-
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
any
|
|
907
|
+
- Each page is saved in one write (#11843): `save_page` for a page — its
|
|
908
|
+
sections as its words when its frontmatter carries them, else its body —
|
|
909
|
+
and `save_document` for a document. No page carries a live-source mark, so
|
|
910
|
+
a heading its page type's template asks for and the page lacks stops its
|
|
911
|
+
publish, as on any page. A dry run prints a line after each page —
|
|
911
912
|
`<path>: publish — publishable`, `publishable · advisory: missing "<heading>", …`
|
|
912
913
|
or `not publishable · <status> · <code>:<where> "<what>"` — and then
|
|
913
914
|
`publish: publishable <N> (<K> with advisory headings) · not publishable <M>`.
|
|
914
915
|
The verdict is the site's installed `@working-theory/validation`'s, not the
|
|
915
916
|
hub's: it sees no library-file finding, and no layout the hub repairs
|
|
916
|
-
differently. A site whose validation package
|
|
917
|
-
|
|
917
|
+
differently. A site whose validation package has no content check prints
|
|
918
|
+
one `publish: not checked` line instead.
|
|
918
919
|
- Exit 0 when no page failed, 1 when any did (in a dry run, when any would), 2
|
|
919
920
|
on a refusal (a missing key, workspace id or origin, no `content/`, the
|
|
920
921
|
adapter not installed), which sends nothing.
|
package/component-catalog.json
CHANGED
|
@@ -4766,6 +4766,29 @@
|
|
|
4766
4766
|
"kind",
|
|
4767
4767
|
"flow"
|
|
4768
4768
|
]
|
|
4769
|
+
},
|
|
4770
|
+
{
|
|
4771
|
+
"type": "object",
|
|
4772
|
+
"properties": {
|
|
4773
|
+
"kind": {
|
|
4774
|
+
"type": "string",
|
|
4775
|
+
"const": "magnet"
|
|
4776
|
+
},
|
|
4777
|
+
"slug": {
|
|
4778
|
+
"type": "string",
|
|
4779
|
+
"minLength": 1,
|
|
4780
|
+
"maxLength": 59,
|
|
4781
|
+
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
|
|
4782
|
+
},
|
|
4783
|
+
"href": {
|
|
4784
|
+
"type": "string",
|
|
4785
|
+
"minLength": 1
|
|
4786
|
+
}
|
|
4787
|
+
},
|
|
4788
|
+
"required": [
|
|
4789
|
+
"kind",
|
|
4790
|
+
"slug"
|
|
4791
|
+
]
|
|
4769
4792
|
}
|
|
4770
4793
|
]
|
|
4771
4794
|
},
|
package/dist/lib/import-mdx.d.ts
CHANGED
|
@@ -39,10 +39,10 @@ export interface MdxAdapterModule {
|
|
|
39
39
|
*/
|
|
40
40
|
siteFields?: SiteFieldRules;
|
|
41
41
|
/**
|
|
42
|
-
* The verdict the hub's publish gate will give a
|
|
43
|
-
*
|
|
44
|
-
* registry entry. Absent when the site's validation package
|
|
45
|
-
*
|
|
42
|
+
* The verdict the hub's publish gate will give a page (#10898 D6, #11843
|
|
43
|
+
* D7), from the site's own contract; `undefined` for a type with no
|
|
44
|
+
* registry entry. Absent when the site's validation package has no content
|
|
45
|
+
* check.
|
|
46
46
|
*/
|
|
47
47
|
publishCheck?: (type: string, content: Record<string, unknown>, layout: Layout | undefined) => PublishVerdict | undefined;
|
|
48
48
|
/**
|
|
@@ -64,7 +64,7 @@ export interface ContentIssueLike {
|
|
|
64
64
|
};
|
|
65
65
|
fixer: string;
|
|
66
66
|
}
|
|
67
|
-
/** Whether publish will take a
|
|
67
|
+
/** Whether publish will take a page, and what its report lists (#10898 D6). */
|
|
68
68
|
export type PublishVerdict = {
|
|
69
69
|
publishable: true;
|
|
70
70
|
advisory: ContentIssueLike[];
|
|
@@ -101,8 +101,6 @@ export interface ImportMdxOptions {
|
|
|
101
101
|
onLine?: (line: string) => void;
|
|
102
102
|
/** Set Live each written page that has no Live version (#10659 D2); off by default. */
|
|
103
103
|
publish?: boolean;
|
|
104
|
-
/** Send the live-source mark on each page (#10898 D5): migrate-content's import only. */
|
|
105
|
-
liveSource?: boolean;
|
|
106
104
|
}
|
|
107
105
|
/** The tree a page came from: `content/` or the site's `apps/web/content`. */
|
|
108
106
|
export type ImportMdxRoot = "content" | "editorial";
|
|
@@ -112,7 +110,7 @@ export type ImportMdxOutcome = {
|
|
|
112
110
|
result: "created" | "updated" | "unchanged";
|
|
113
111
|
type: string;
|
|
114
112
|
slug: string;
|
|
115
|
-
/** With `
|
|
113
|
+
/** With `publishCheck`: what the hub's publish gate will answer (#10898 D6, #11843 D7). */
|
|
116
114
|
publishVerdict?: PublishVerdict;
|
|
117
115
|
/** `updated` with the words already matching the hub: only the layout changed (#11749 D5). */
|
|
118
116
|
layoutOnly?: true;
|
|
@@ -191,7 +189,6 @@ export interface PublishCheckMembers {
|
|
|
191
189
|
slug: string;
|
|
192
190
|
body: string;
|
|
193
191
|
}, structure: unknown) => ContentReportLike;
|
|
194
|
-
liveSourceReport: (report: ContentReportLike) => ContentReportLike;
|
|
195
192
|
templates: Readonly<Record<string, {
|
|
196
193
|
kind: string;
|
|
197
194
|
}>>;
|
|
@@ -201,12 +198,12 @@ export interface PublishCheckMembers {
|
|
|
201
198
|
}[];
|
|
202
199
|
}
|
|
203
200
|
/**
|
|
204
|
-
* The hub's publish gate over a
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
* so only the rest block.
|
|
201
|
+
* The hub's publish gate over a page, as the site's contract reads it: the
|
|
202
|
+
* page's words checked against its type's template and the structure
|
|
203
|
+
* publish's repair would build — the layout when the page converts, an
|
|
204
|
+
* editorial template's frontmatter quartet, else none. No live-source split
|
|
205
|
+
* is applied: no save keeps the mark (#11843 D7). Publish repairs every
|
|
206
|
+
* `script` finding, so only the rest block.
|
|
210
207
|
*/
|
|
211
208
|
export declare function publishCheckOf(members: PublishCheckMembers): NonNullable<MdxAdapterModule["publishCheck"]>;
|
|
212
209
|
/**
|