@byline/cli 3.15.2 → 3.16.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/dist/runner.d.ts +1 -2
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +1 -12
- package/dist/runner.js.map +1 -1
- package/dist/templates/byline-examples/collections/docs/schema.ts +5 -2
- package/dist/templates/byline-examples/collections/media/schema.ts +1 -1
- package/dist/templates/byline-examples/collections/news/schema.ts +1 -1
- package/dist/templates/byline-examples/collections/news-categories/schema.ts +2 -2
- package/dist/templates/byline-examples/collections/pages/schema.ts +1 -1
- package/dist/templates/byline-examples/fields/ai-text.ts +1 -1
- package/dist/templates/byline-examples/fields/ai-textarea.ts +1 -1
- package/dist/templates/byline-examples/fields/lexical-richtext-ai.tsx +1 -1
- package/dist/templates/byline-examples/fields/lexical-richtext-compact.ts +1 -1
- package/dist/templates/byline-examples/fields/published-on-field.ts +1 -1
- package/dist/templates/byline-examples/scripts/backfill-version-locales.ts +1 -1
- package/dist/templates/byline-examples/scripts/import-docs.ts +2 -2
- package/dist/templates/byline-examples/scripts/re-anchor.ts +1 -1
- package/dist/templates/byline-examples/server.config.ts +1 -1
- package/dist/templates/ui-byline/components/link/link-lexical.tsx +1 -1
- package/package.json +1 -1
package/dist/runner.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { Context } from './context.js';
|
|
2
|
-
import type { Phase, PhaseState
|
|
2
|
+
import type { Phase, PhaseState } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Returned phase state — caller decides whether to continue. `'blocked'`
|
|
5
5
|
* means the next phase should NOT run; `'partial'` is a soft warning
|
|
6
6
|
* (e.g. wire phase had a manual sub-edit) and the caller may continue.
|
|
7
7
|
*/
|
|
8
8
|
export declare function runPhase(phase: Phase, ctx: Context): Promise<PhaseState>;
|
|
9
|
-
export declare function executePlan(plan: Plan, ctx: Context): Promise<void>;
|
|
10
9
|
//# sourceMappingURL=runner.d.ts.map
|
package/dist/runner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAQ,MAAM,YAAY,CAAA;AAEzD;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CA+C9E"}
|
package/dist/runner.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { existsSync,
|
|
2
|
-
import { dirname } from 'node:path';
|
|
3
|
-
import { execa } from 'execa';
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
4
2
|
import { renderDiff } from './ui/diff.js';
|
|
5
3
|
/**
|
|
6
4
|
* Returned phase state — caller decides whether to continue. `'blocked'`
|
|
@@ -90,13 +88,4 @@ async function decideApply(phase, ctx) {
|
|
|
90
88
|
function readIfExists(path) {
|
|
91
89
|
return existsSync(path) ? readFileSync(path, 'utf8') : '';
|
|
92
90
|
}
|
|
93
|
-
export async function executePlan(plan, ctx) {
|
|
94
|
-
for (const w of plan.writes) {
|
|
95
|
-
mkdirSync(dirname(w.path), { recursive: true });
|
|
96
|
-
writeFileSync(w.path, w.contents, 'utf8');
|
|
97
|
-
}
|
|
98
|
-
for (const c of plan.commands) {
|
|
99
|
-
await execa(c.command, c.args, { cwd: c.cwd ?? ctx.cwd, stdio: 'inherit' });
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
91
|
//# sourceMappingURL=runner.js.map
|
package/dist/runner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","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CAAC,CAAA;IAChE,CAAC;IACD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;AACpB,CAAC;AAED,KAAK,UAAU,WAAW,CAAC,KAAY,EAAE,GAAY;IACnD,sEAAsE;IACtE,kEAAkE;IAClE,oEAAoE;IACpE,sEAAsE;IACtE,qEAAqE;IACrE,IAAI,KAAK,CAAC,WAAW,KAAK,MAAM;QAAE,OAAO,IAAI,CAAA;IAC7C,IAAI,GAAG,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAC1B,IAAI,GAAG,CAAC,GAAG;QAAE,OAAO,IAAI,CAAA;IACxB,OAAO,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC;QAC1B,OAAO,EAAE,SAAS,KAAK,CAAC,EAAE,WAAW;QACrC,YAAY,EAAE,IAAI;KACnB,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AAC3D,CAAC"}
|
|
@@ -33,7 +33,7 @@ export const Docs = defineCollection({
|
|
|
33
33
|
customStatuses: [{ name: 'needs_review', label: 'Needs Review', verb: 'Request Review' }],
|
|
34
34
|
}),
|
|
35
35
|
showStats: true,
|
|
36
|
-
// Document tree (docs/
|
|
36
|
+
// Document tree (docs/04-collections/03-document-trees.md): the docs collection is a
|
|
37
37
|
// single-parent ordered hierarchy. Mutually exclusive with `orderable` —
|
|
38
38
|
// the tree owns ordering (per-parent, on the edge), so `order_key` on
|
|
39
39
|
// `byline_documents` is inert here. Sibling order and nesting are edited via
|
|
@@ -48,7 +48,10 @@ export const Docs = defineCollection({
|
|
|
48
48
|
// `filters`, and `zones` round out the surface. Opting in here is what
|
|
49
49
|
// makes the lifecycle hooks in ./hooks.ts index this collection — and it
|
|
50
50
|
// requires a `search` provider registered in byline/server.config.ts.
|
|
51
|
-
|
|
51
|
+
// `content` is a container (blocks) field: naming it walks every text-bearing
|
|
52
|
+
// child (richtext body, image alt + caption) into the searchable body —
|
|
53
|
+
// omit it and document bodies are silently absent from the index.
|
|
54
|
+
search: { body: [{ field: 'title', boost: 2 }, 'summary', 'content'] },
|
|
52
55
|
useAsTitle: 'title',
|
|
53
56
|
useAsPath: 'title',
|
|
54
57
|
advertiseLocales: true, // Renders the available-locales sidebar widget.
|
|
@@ -30,7 +30,7 @@ export const News = defineCollection({
|
|
|
30
30
|
archived: { label: 'Archived', verb: 'Archive' },
|
|
31
31
|
}),
|
|
32
32
|
showStats: true,
|
|
33
|
-
search: {
|
|
33
|
+
search: { body: ['title'] },
|
|
34
34
|
useAsTitle: 'title',
|
|
35
35
|
useAsPath: 'title',
|
|
36
36
|
advertiseLocales: true, // Renders the available-locales sidebar widget.
|
|
@@ -21,13 +21,13 @@ export const NewsCategories = defineCollection({
|
|
|
21
21
|
// `published` and the form shows only Save / Close.
|
|
22
22
|
workflow: SINGLE_STATUS_WORKFLOW,
|
|
23
23
|
showStats: true,
|
|
24
|
-
search: {
|
|
24
|
+
search: { body: ['name'] },
|
|
25
25
|
useAsTitle: 'name',
|
|
26
26
|
useAsPath: 'name',
|
|
27
27
|
// Demonstration of `orderable: true` — short, finite, naturally ordered.
|
|
28
28
|
// Editors can drag rows in the list view to set a canonical order; the
|
|
29
29
|
// value persists on `byline_documents.order_key` without bumping the
|
|
30
|
-
// document version. See docs/
|
|
30
|
+
// document version. See docs/04-collections/index.md (Orderable collections).
|
|
31
31
|
orderable: true,
|
|
32
32
|
fields: [
|
|
33
33
|
{ name: 'name', label: 'Name', type: 'text', localized: true },
|
|
@@ -32,7 +32,7 @@ export const Pages = defineCollection({
|
|
|
32
32
|
archived: { label: 'Archived', verb: 'Archive' },
|
|
33
33
|
}),
|
|
34
34
|
showStats: true,
|
|
35
|
-
search: {
|
|
35
|
+
search: { body: ['title'] },
|
|
36
36
|
useAsTitle: 'title',
|
|
37
37
|
useAsPath: 'title',
|
|
38
38
|
advertiseLocales: true, // Renders the available-locales sidebar widget.
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* schema field's name. Pairs with a plain `{ type: 'text' }` entry on
|
|
13
13
|
* the schema side; this file owns the React (label icon + AI panel).
|
|
14
14
|
*
|
|
15
|
-
* See `docs/
|
|
15
|
+
* See `docs/04-collections/01-fields.md` for the schema-vs-admin model.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { FieldAdminConfig, FieldComponentSlots } from '@byline/core'
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* schema field's name. Pairs with a plain `{ type: 'textArea' }` entry
|
|
13
13
|
* on the schema side; this file owns the React (label icon + AI panel).
|
|
14
14
|
*
|
|
15
|
-
* See `docs/
|
|
15
|
+
* See `docs/04-collections/01-fields.md` for the schema-vs-admin model.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import type { FieldAdminConfig, FieldComponentSlots } from '@byline/core'
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* Pairs with a plain `{ type: 'richText' }` entry on the schema side —
|
|
23
23
|
* schema files must stay React-free and tsx-loadable.
|
|
24
24
|
*
|
|
25
|
-
* See `docs/
|
|
25
|
+
* See `docs/04-collections/01-fields.md` for the schema-vs-admin model.
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
import { AiLexicalExtension } from '@byline/ai/plugins/lexical'
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* To AI-enable the resulting field, pair this with `aiRichTextAdmin()`
|
|
24
24
|
* on the admin side — see `lexical-richtext-ai.tsx`.
|
|
25
25
|
*
|
|
26
|
-
* See `docs/
|
|
26
|
+
* See `docs/04-collections/01-fields.md` for the full schema-vs-admin model.
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
29
|
import type { RichTextField } from '@byline/core'
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* collection's `fields` array in `<collection>/schema.ts`. Pure data;
|
|
13
13
|
* safe to import from any schema file.
|
|
14
14
|
*
|
|
15
|
-
* See `docs/
|
|
15
|
+
* See `docs/04-collections/01-fields.md` for the schema-vs-admin model.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import { defineField, type FieldData } from '@byline/core'
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
* number directories/files with `NN-` prefixes to curate the
|
|
49
49
|
* TOC — prefixes never reach the slug (paths come from
|
|
50
50
|
* frontmatter). The `docs` collection must be `tree: true`.
|
|
51
|
-
* See docs/
|
|
51
|
+
* See docs/04-collections/03-document-trees.md.
|
|
52
52
|
*/
|
|
53
53
|
|
|
54
54
|
import '../load-env.js'
|
|
@@ -295,7 +295,7 @@ async function processFile(
|
|
|
295
295
|
// Advertise the imported locale (editorial available-locales set), merged
|
|
296
296
|
// with whatever is already advertised so a later-locale re-import doesn't
|
|
297
297
|
// clobber an earlier one. The public set is still gated by the version
|
|
298
|
-
// completeness ledger (intersection). See docs/
|
|
298
|
+
// completeness ledger (intersection). See docs/07-internationalization/index.md.
|
|
299
299
|
availableLocales: [...new Set([...(existing.availableLocales ?? []), locale])],
|
|
300
300
|
})
|
|
301
301
|
await walkToStatus(handle, result.documentId, workflowStatuses, defaultStatus, desiredStatus)
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* cd apps/webapp && pnpm tsx byline/scripts/re-anchor.ts --to fr --collection pages
|
|
21
21
|
* cd apps/webapp && pnpm tsx byline/scripts/re-anchor.ts --to fr --dry-run
|
|
22
22
|
*
|
|
23
|
-
* See docs/
|
|
23
|
+
* See docs/07-internationalization/index.md.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
import '../load-env.js'
|
|
@@ -198,7 +198,7 @@ async function buildBylineCore(): Promise<BylineCore<AdminStore>> {
|
|
|
198
198
|
// Server-side richtext adapter — refreshes embedded relation
|
|
199
199
|
// envelopes (link `{ title, path }`, inline-image `{ title, altText,
|
|
200
200
|
// image, sizes }`) on every read, gated per-field by
|
|
201
|
-
// `populateRelationsOnRead`. See docs/
|
|
201
|
+
// `populateRelationsOnRead`. See docs/04-collections/06-rich-text.md for the full design.
|
|
202
202
|
//
|
|
203
203
|
// `getClient` returns a `BylineClient` — the SDK over the storage
|
|
204
204
|
// primitives that the populate visitors use to batch-fetch target
|
|
@@ -100,7 +100,7 @@ function isLocalHref(href: string): boolean {
|
|
|
100
100
|
* usable href can be built — the serializer treats that as the signal
|
|
101
101
|
* to strip the `<a>` / `<LangLink>` wrapper and render children plain.
|
|
102
102
|
*
|
|
103
|
-
* Internal-link fallback chain (see docs/
|
|
103
|
+
* Internal-link fallback chain (see docs/04-collections/06-rich-text.md):
|
|
104
104
|
* 1. `document._resolved === false` → strip wrapper.
|
|
105
105
|
* 2. `document.path` starts with `/` → use as-is (canonicalised by
|
|
106
106
|
* the server-side embed walker via `buildDocumentPath`).
|