@byline/cli 3.21.0 → 4.1.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 +29 -3
- package/dist/cli.js +5 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +1 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +10 -14
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/setup-checks.d.ts +9 -0
- package/dist/commands/setup-checks.d.ts.map +1 -1
- package/dist/commands/setup-checks.js +43 -18
- package/dist/commands/setup-checks.js.map +1 -1
- package/dist/commands/setup.js +1 -1
- package/dist/commands/setup.js.map +1 -1
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +6 -0
- package/dist/context.js.map +1 -1
- package/dist/lib/dependency-version.d.ts +12 -0
- package/dist/lib/dependency-version.d.ts.map +1 -0
- package/dist/lib/dependency-version.js +101 -0
- package/dist/lib/dependency-version.js.map +1 -0
- package/dist/lib/planned-writes.d.ts +8 -0
- package/dist/lib/planned-writes.d.ts.map +1 -0
- package/dist/lib/planned-writes.js +177 -0
- package/dist/lib/planned-writes.js.map +1 -0
- package/dist/lib/planned-writes.test.d.ts +2 -0
- package/dist/lib/planned-writes.test.d.ts.map +1 -0
- package/dist/lib/planned-writes.test.js +113 -0
- package/dist/lib/planned-writes.test.js.map +1 -0
- package/dist/lib/release-policy.d.ts +12 -0
- package/dist/lib/release-policy.d.ts.map +1 -0
- package/dist/lib/release-policy.js +20 -0
- package/dist/lib/release-policy.js.map +1 -0
- package/dist/lib/release-policy.test.d.ts +2 -0
- package/dist/lib/release-policy.test.d.ts.map +1 -0
- package/dist/lib/release-policy.test.js +36 -0
- package/dist/lib/release-policy.test.js.map +1 -0
- package/dist/lib/route-config.d.ts +40 -0
- package/dist/lib/route-config.d.ts.map +1 -0
- package/dist/lib/route-config.js +322 -0
- package/dist/lib/route-config.js.map +1 -0
- package/dist/lib/static-config.d.ts +20 -0
- package/dist/lib/static-config.d.ts.map +1 -0
- package/dist/lib/static-config.js +444 -0
- package/dist/lib/static-config.js.map +1 -0
- package/dist/lib/static-config.test.d.ts +2 -0
- package/dist/lib/static-config.test.d.ts.map +1 -0
- package/dist/lib/static-config.test.js +105 -0
- package/dist/lib/static-config.test.js.map +1 -0
- package/dist/lib/template-hook-boundary.test.node.d.ts +2 -0
- package/dist/lib/template-hook-boundary.test.node.d.ts.map +1 -0
- package/dist/lib/template-hook-boundary.test.node.js +30 -0
- package/dist/lib/template-hook-boundary.test.node.js.map +1 -0
- package/dist/lib/template-path.d.ts +5 -0
- package/dist/lib/template-path.d.ts.map +1 -0
- package/dist/lib/template-path.js +9 -0
- package/dist/lib/template-path.js.map +1 -0
- package/dist/lib/workspace-root.d.ts +28 -0
- package/dist/lib/workspace-root.d.ts.map +1 -0
- package/dist/lib/workspace-root.js +205 -0
- package/dist/lib/workspace-root.js.map +1 -0
- package/dist/manifest/deps.d.ts +1 -1
- package/dist/manifest/deps.d.ts.map +1 -1
- package/dist/manifest/deps.js +24 -8
- package/dist/manifest/deps.js.map +1 -1
- package/dist/phases/deps.d.ts +14 -1
- package/dist/phases/deps.d.ts.map +1 -1
- package/dist/phases/deps.js +312 -137
- package/dist/phases/deps.js.map +1 -1
- package/dist/phases/deps.test.d.ts +2 -0
- package/dist/phases/deps.test.d.ts.map +1 -0
- package/dist/phases/deps.test.js +343 -0
- package/dist/phases/deps.test.js.map +1 -0
- package/dist/phases/preflight.d.ts.map +1 -1
- package/dist/phases/preflight.js +59 -11
- package/dist/phases/preflight.js.map +1 -1
- package/dist/phases/prompts.d.ts +2 -0
- package/dist/phases/prompts.d.ts.map +1 -1
- package/dist/phases/prompts.js +51 -2
- package/dist/phases/prompts.js.map +1 -1
- package/dist/phases/routes-ui.test.d.ts +2 -0
- package/dist/phases/routes-ui.test.d.ts.map +1 -0
- package/dist/phases/routes-ui.test.js +766 -0
- package/dist/phases/routes-ui.test.js.map +1 -0
- package/dist/phases/routes.d.ts +4 -1
- package/dist/phases/routes.d.ts.map +1 -1
- package/dist/phases/routes.js +610 -122
- package/dist/phases/routes.js.map +1 -1
- package/dist/phases/scaffold-smoke.test.d.ts +2 -0
- package/dist/phases/scaffold-smoke.test.d.ts.map +1 -0
- package/dist/phases/scaffold-smoke.test.js +175 -0
- package/dist/phases/scaffold-smoke.test.js.map +1 -0
- package/dist/phases/scaffold.d.ts +3 -2
- package/dist/phases/scaffold.d.ts.map +1 -1
- package/dist/phases/scaffold.js +268 -91
- package/dist/phases/scaffold.js.map +1 -1
- package/dist/phases/scaffold.test.js +171 -22
- package/dist/phases/scaffold.test.js.map +1 -1
- package/dist/phases/ui.d.ts +4 -1
- package/dist/phases/ui.d.ts.map +1 -1
- package/dist/phases/ui.js +51 -59
- package/dist/phases/ui.js.map +1 -1
- package/dist/phases/wire/index.d.ts.map +1 -1
- package/dist/phases/wire/index.js +10 -6
- package/dist/phases/wire/index.js.map +1 -1
- package/dist/phases/wire/shared.d.ts +4 -1
- package/dist/phases/wire/shared.d.ts.map +1 -1
- package/dist/phases/wire/vite-config.d.ts.map +1 -1
- package/dist/phases/wire/vite-config.js +69 -20
- package/dist/phases/wire/vite-config.js.map +1 -1
- package/dist/phases/wire/vite-config.test.d.ts +2 -0
- package/dist/phases/wire/vite-config.test.d.ts.map +1 -0
- package/dist/phases/wire/vite-config.test.js +97 -0
- package/dist/phases/wire/vite-config.test.js.map +1 -0
- package/dist/prompts.d.ts +1 -0
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +7 -2
- package/dist/prompts.js.map +1 -1
- package/dist/runner.js +1 -1
- package/dist/runner.js.map +1 -1
- package/dist/templates/byline/collection-types.contract.ts +26 -1
- package/dist/templates/byline/collections/index.ts +1 -1
- package/dist/templates/byline/collections/server-hooks.ts +7 -0
- package/dist/templates/byline/generated/collection-types.ts +14 -6
- package/dist/templates/byline/routes.ts +7 -6
- package/dist/templates/byline/server.config.ts +10 -1
- package/dist/templates/byline-examples/admin.config.ts +7 -12
- package/dist/templates/byline-examples/blocks/photo-block.ts +3 -2
- package/dist/templates/byline-examples/collection-types.contract.ts +26 -1
- package/dist/templates/byline-examples/collections/docs/hooks.ts +23 -13
- package/dist/templates/byline-examples/collections/docs/schema.ts +2 -11
- package/dist/templates/byline-examples/collections/index.ts +1 -1
- package/dist/templates/byline-examples/collections/media/components/media-list-view.tsx +11 -6
- package/dist/templates/byline-examples/collections/media/schema.ts +3 -0
- package/dist/templates/byline-examples/collections/news/schema.ts +4 -3
- package/dist/templates/byline-examples/collections/server-hooks.ts +8 -0
- 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 +3 -3
- package/dist/templates/byline-examples/generated/collection-types.ts +138 -130
- package/dist/templates/byline-examples/routes.ts +7 -6
- package/dist/templates/byline-examples/scripts/backfill-version-locales.ts +1 -1
- package/dist/templates/byline-examples/scripts/import-docs.ts +10 -11
- package/dist/templates/byline-examples/scripts/lib/mdast-to-lexical.test.node.ts +93 -233
- package/dist/templates/byline-examples/scripts/lib/mdast-to-lexical.ts +2 -2
- package/dist/templates/byline-examples/scripts/lib/strip-leading-h1.test.node.ts +0 -4
- package/dist/templates/byline-examples/scripts/re-anchor.ts +3 -3
- package/dist/templates/byline-examples/scripts/regenerate-media-operation.ts +112 -0
- package/dist/templates/byline-examples/scripts/regenerate-media.ts +129 -92
- package/dist/templates/byline-examples/server.config.ts +14 -6
- package/dist/templates/host/vite.config.ts +2 -0
- package/dist/templates/routes/_byline/route.lazy.tsx +1 -2
- package/dist/templates/routes/_byline/route.tsx +1 -1
- package/dist/templates/ui-byline/blocks/photo-block/index.tsx +18 -22
- package/dist/templates/ui-byline/blocks/richtext-block/index.tsx +1 -1
- package/dist/templates/ui-byline/components/admonition/index.tsx +11 -8
- package/dist/templates/ui-byline/components/code/code.tsx +6 -4
- package/dist/templates/ui-byline/components/link/lang-link.tsx +4 -8
- package/dist/templates/ui-byline/components/link/link-field.tsx +3 -2
- package/dist/templates/ui-byline/components/link/link-lexical.tsx +9 -8
- package/dist/templates/ui-byline/render-blocks.tsx +38 -34
- package/dist/templates/ui-byline/types/content.ts +25 -0
- package/dist/templates/ui-byline/types/i18n.ts +4 -8
- package/dist/test-helpers.d.ts +5 -0
- package/dist/test-helpers.d.ts.map +1 -0
- package/dist/test-helpers.js +52 -0
- package/dist/test-helpers.js.map +1 -0
- package/dist/types.d.ts +21 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/ui-template-contract.test.d.ts +2 -0
- package/dist/ui-template-contract.test.d.ts.map +1 -0
- package/dist/ui-template-contract.test.js +150 -0
- package/dist/ui-template-contract.test.js.map +1 -0
- package/dist/workspace-root.test.d.ts +2 -0
- package/dist/workspace-root.test.d.ts.map +1 -0
- package/dist/workspace-root.test.js +311 -0
- package/dist/workspace-root.test.js.map +1 -0
- package/package.json +9 -1
- package/dist/templates/byline/client.server.ts +0 -32
- package/dist/templates/byline-examples/client.server.ts +0 -32
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by @byline/core/codegen
|
|
2
|
-
// Format version:
|
|
3
|
-
// Hash:
|
|
2
|
+
// Format version: 2
|
|
3
|
+
// Hash: 7c42f9892f94559081c07b01952f1149e7c4cc112569bbed5861c0a32d735448
|
|
4
4
|
|
|
5
5
|
import type {
|
|
6
6
|
JsonValue,
|
|
@@ -8,132 +8,140 @@ import type {
|
|
|
8
8
|
StoredFileValue,
|
|
9
9
|
} from '@byline/core'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
declare module '@byline/generated-types' {
|
|
12
|
+
export type PhotoBlockData = {
|
|
13
|
+
_id: string
|
|
14
|
+
_type: 'photoBlock'
|
|
15
|
+
display?: 'default' | 'wide' | 'full_width' | undefined
|
|
16
|
+
photo?: RelatedDocumentValue | undefined
|
|
17
|
+
alt: string
|
|
18
|
+
caption?: JsonValue | undefined
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type PhotoBlockDataAllLocales = {
|
|
22
|
+
_id: string
|
|
23
|
+
_type: 'photoBlock'
|
|
24
|
+
display?: 'default' | 'wide' | 'full_width' | undefined
|
|
25
|
+
photo?: RelatedDocumentValue | undefined
|
|
26
|
+
alt: string
|
|
27
|
+
caption?: { [locale: string]: JsonValue } | undefined
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type RichTextBlockData = {
|
|
31
|
+
_id: string
|
|
32
|
+
_type: 'richTextBlock'
|
|
33
|
+
richText: JsonValue
|
|
34
|
+
constrainedWidth?: boolean | undefined
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type RichTextBlockDataAllLocales = {
|
|
38
|
+
_id: string
|
|
39
|
+
_type: 'richTextBlock'
|
|
40
|
+
richText: { [locale: string]: JsonValue }
|
|
41
|
+
constrainedWidth?: boolean | undefined
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type DocsFields = {
|
|
45
|
+
title: string
|
|
46
|
+
summary: string
|
|
47
|
+
featureImage?: RelatedDocumentValue | undefined
|
|
48
|
+
publishedOn: Date
|
|
49
|
+
content?: Array<RichTextBlockData | PhotoBlockData> | undefined
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type DocsFieldsAllLocales = {
|
|
53
|
+
title: { [locale: string]: string }
|
|
54
|
+
summary: { [locale: string]: string }
|
|
55
|
+
featureImage?: RelatedDocumentValue | undefined
|
|
56
|
+
publishedOn: Date
|
|
57
|
+
content?: Array<RichTextBlockDataAllLocales | PhotoBlockDataAllLocales> | undefined
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type MediaFields = {
|
|
61
|
+
image: StoredFileValue
|
|
62
|
+
title: string
|
|
63
|
+
altText: string
|
|
64
|
+
caption?: string | undefined
|
|
65
|
+
credit?: string | undefined
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type MediaFieldsAllLocales = {
|
|
69
|
+
image: StoredFileValue
|
|
70
|
+
title: string
|
|
71
|
+
altText: string
|
|
72
|
+
caption?: string | undefined
|
|
73
|
+
credit?: string | undefined
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export type NewsCategoriesFields = {
|
|
77
|
+
name: string
|
|
78
|
+
description: string
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type NewsCategoriesFieldsAllLocales = {
|
|
82
|
+
name: { [locale: string]: string }
|
|
83
|
+
description: { [locale: string]: string }
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export type NewsFields = {
|
|
87
|
+
title: string
|
|
88
|
+
summary: string
|
|
89
|
+
category: RelatedDocumentValue
|
|
90
|
+
featureImage?: RelatedDocumentValue | undefined
|
|
91
|
+
featured?: boolean | undefined
|
|
92
|
+
content: JsonValue
|
|
93
|
+
publishedOn: Date
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type NewsFieldsAllLocales = {
|
|
97
|
+
title: { [locale: string]: string }
|
|
98
|
+
summary: { [locale: string]: string }
|
|
99
|
+
category: RelatedDocumentValue
|
|
100
|
+
featureImage?: RelatedDocumentValue | undefined
|
|
101
|
+
featured?: boolean | undefined
|
|
102
|
+
content: { [locale: string]: JsonValue }
|
|
103
|
+
publishedOn: Date
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export type PagesFields = {
|
|
107
|
+
title: string
|
|
108
|
+
summary: string
|
|
109
|
+
featureImage?: RelatedDocumentValue | undefined
|
|
110
|
+
area: 'root' | 'about' | 'legal'
|
|
111
|
+
content?: Array<RichTextBlockData | PhotoBlockData> | undefined
|
|
112
|
+
publishedOn: Date
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export type PagesFieldsAllLocales = {
|
|
116
|
+
title: { [locale: string]: string }
|
|
117
|
+
summary: { [locale: string]: string }
|
|
118
|
+
featureImage?: RelatedDocumentValue | undefined
|
|
119
|
+
area: 'root' | 'about' | 'legal'
|
|
120
|
+
content?: Array<RichTextBlockDataAllLocales | PhotoBlockDataAllLocales> | undefined
|
|
121
|
+
publishedOn: Date
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export type CollectionFieldsByPath = {
|
|
125
|
+
docs: DocsFields
|
|
126
|
+
media: MediaFields
|
|
127
|
+
news: NewsFields
|
|
128
|
+
'news-categories': NewsCategoriesFields
|
|
129
|
+
pages: PagesFields
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export type CollectionFieldsAllLocalesByPath = {
|
|
133
|
+
docs: DocsFieldsAllLocales
|
|
134
|
+
media: MediaFieldsAllLocales
|
|
135
|
+
news: NewsFieldsAllLocales
|
|
136
|
+
'news-categories': NewsCategoriesFieldsAllLocales
|
|
137
|
+
pages: PagesFieldsAllLocales
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export type CollectionPath = keyof CollectionFieldsByPath
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
declare module '@byline/client' {
|
|
144
|
+
interface Register {
|
|
145
|
+
collections: import('@byline/generated-types').CollectionFieldsByPath
|
|
146
|
+
}
|
|
18
147
|
}
|
|
19
|
-
|
|
20
|
-
export type PhotoBlockDataAllLocales = {
|
|
21
|
-
_id: string
|
|
22
|
-
_type: 'photoBlock'
|
|
23
|
-
display?: 'default' | 'wide' | 'full_width' | undefined
|
|
24
|
-
photo?: RelatedDocumentValue | undefined
|
|
25
|
-
alt: string
|
|
26
|
-
caption?: { [locale: string]: JsonValue } | undefined
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export type RichTextBlockData = {
|
|
30
|
-
_id: string
|
|
31
|
-
_type: 'richTextBlock'
|
|
32
|
-
richText: JsonValue
|
|
33
|
-
constrainedWidth?: boolean | undefined
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export type RichTextBlockDataAllLocales = {
|
|
37
|
-
_id: string
|
|
38
|
-
_type: 'richTextBlock'
|
|
39
|
-
richText: { [locale: string]: JsonValue }
|
|
40
|
-
constrainedWidth?: boolean | undefined
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type DocsFields = {
|
|
44
|
-
title: string
|
|
45
|
-
summary: string
|
|
46
|
-
featureImage?: RelatedDocumentValue | undefined
|
|
47
|
-
publishedOn: Date
|
|
48
|
-
content?: Array<RichTextBlockData | PhotoBlockData> | undefined
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export type DocsFieldsAllLocales = {
|
|
52
|
-
title: { [locale: string]: string }
|
|
53
|
-
summary: { [locale: string]: string }
|
|
54
|
-
featureImage?: RelatedDocumentValue | undefined
|
|
55
|
-
publishedOn: Date
|
|
56
|
-
content?: Array<RichTextBlockDataAllLocales | PhotoBlockDataAllLocales> | undefined
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export type MediaFields = {
|
|
60
|
-
image: StoredFileValue
|
|
61
|
-
title: string
|
|
62
|
-
altText: string
|
|
63
|
-
caption?: string | undefined
|
|
64
|
-
credit?: string | undefined
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export type MediaFieldsAllLocales = {
|
|
68
|
-
image: StoredFileValue
|
|
69
|
-
title: string
|
|
70
|
-
altText: string
|
|
71
|
-
caption?: string | undefined
|
|
72
|
-
credit?: string | undefined
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export type NewsCategoriesFields = {
|
|
76
|
-
name: string
|
|
77
|
-
description: string
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export type NewsCategoriesFieldsAllLocales = {
|
|
81
|
-
name: { [locale: string]: string }
|
|
82
|
-
description: { [locale: string]: string }
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export type NewsFields = {
|
|
86
|
-
title: string
|
|
87
|
-
summary: string
|
|
88
|
-
category: RelatedDocumentValue
|
|
89
|
-
featureImage?: RelatedDocumentValue | undefined
|
|
90
|
-
featured?: boolean | undefined
|
|
91
|
-
content: JsonValue
|
|
92
|
-
publishedOn: Date
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export type NewsFieldsAllLocales = {
|
|
96
|
-
title: { [locale: string]: string }
|
|
97
|
-
summary: { [locale: string]: string }
|
|
98
|
-
category: RelatedDocumentValue
|
|
99
|
-
featureImage?: RelatedDocumentValue | undefined
|
|
100
|
-
featured?: boolean | undefined
|
|
101
|
-
content: { [locale: string]: JsonValue }
|
|
102
|
-
publishedOn: Date
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export type PagesFields = {
|
|
106
|
-
title: string
|
|
107
|
-
summary: string
|
|
108
|
-
featureImage?: RelatedDocumentValue | undefined
|
|
109
|
-
area: 'root' | 'about' | 'legal'
|
|
110
|
-
content?: Array<RichTextBlockData | PhotoBlockData> | undefined
|
|
111
|
-
publishedOn: Date
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export type PagesFieldsAllLocales = {
|
|
115
|
-
title: { [locale: string]: string }
|
|
116
|
-
summary: { [locale: string]: string }
|
|
117
|
-
featureImage?: RelatedDocumentValue | undefined
|
|
118
|
-
area: 'root' | 'about' | 'legal'
|
|
119
|
-
content?: Array<RichTextBlockDataAllLocales | PhotoBlockDataAllLocales> | undefined
|
|
120
|
-
publishedOn: Date
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export type CollectionFieldsByPath = {
|
|
124
|
-
docs: DocsFields
|
|
125
|
-
media: MediaFields
|
|
126
|
-
news: NewsFields
|
|
127
|
-
'news-categories': NewsCategoriesFields
|
|
128
|
-
pages: PagesFields
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export type CollectionFieldsAllLocalesByPath = {
|
|
132
|
-
docs: DocsFieldsAllLocales
|
|
133
|
-
media: MediaFieldsAllLocales
|
|
134
|
-
news: NewsFieldsAllLocales
|
|
135
|
-
'news-categories': NewsCategoriesFieldsAllLocales
|
|
136
|
-
pages: PagesFieldsAllLocales
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export type CollectionPath = keyof CollectionFieldsByPath
|
|
@@ -7,17 +7,18 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* URL
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Client-safe URL paths for admin, sign-in, and the future public API.
|
|
11
|
+
* Resolve once at this client-safe configuration boundary so consumers only
|
|
12
|
+
* read canonical paths.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import
|
|
15
|
+
import { resolveRoutes } from '@byline/core'
|
|
16
16
|
|
|
17
|
-
export const routes
|
|
17
|
+
export const routes = resolveRoutes({
|
|
18
18
|
admin: '/admin',
|
|
19
19
|
api: '/api',
|
|
20
|
-
|
|
20
|
+
signIn: '/sign-in',
|
|
21
|
+
})
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Fallback used by both server and admin entry points when no
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* Idempotent — safe to re-run. Uses the installation's configured default
|
|
17
17
|
* content locale (resolved from byline/i18n.ts via the server config).
|
|
18
18
|
*
|
|
19
|
-
*
|
|
19
|
+
* pnpm tsx byline/scripts/backfill-version-locales.ts
|
|
20
20
|
*
|
|
21
21
|
* See docs/07-internationalization/index.md.
|
|
22
22
|
*/
|
|
@@ -12,11 +12,6 @@
|
|
|
12
12
|
// pnpm tsx byline/scripts/import-docs.ts ../../docs/**/*.md --verbose
|
|
13
13
|
// pnpm tsx byline/scripts/import-docs.ts '../../docs/*.md' --dry-run --verbose
|
|
14
14
|
// pnpm tsx byline/scripts/import-docs.ts ../../docs/**/*.md
|
|
15
|
-
//
|
|
16
|
-
// Run tests...
|
|
17
|
-
//
|
|
18
|
-
// pnpm vitest run --mode=node byline/scripts/lib/
|
|
19
|
-
|
|
20
15
|
/**
|
|
21
16
|
* Import markdown files into the `docs` collection.
|
|
22
17
|
*
|
|
@@ -59,7 +54,7 @@ import { glob } from 'node:fs/promises'
|
|
|
59
54
|
import { basename, dirname, join, resolve } from 'node:path'
|
|
60
55
|
|
|
61
56
|
import { createSuperAdminContext } from '@byline/auth'
|
|
62
|
-
import { type CollectionHandle, createBylineClient } from '@byline/client'
|
|
57
|
+
import { type BylineClient, type CollectionHandle, createBylineClient } from '@byline/client'
|
|
63
58
|
import { getCollectionDefinition, getServerConfig, slugify } from '@byline/core'
|
|
64
59
|
|
|
65
60
|
import { type DocFrontmatter, parseDocFile } from './lib/frontmatter.js'
|
|
@@ -67,12 +62,16 @@ import { type MdastToLexicalWarning, mdastToLexical } from './lib/mdast-to-lexic
|
|
|
67
62
|
import { parseBodyToMdast } from './lib/parse-markdown.js'
|
|
68
63
|
import { type DocLinkRewriteWarning, rewriteDocLinks } from './lib/rewrite-doc-links.js'
|
|
69
64
|
import { stripLeadingH1IfMatches } from './lib/strip-leading-h1.js'
|
|
65
|
+
import type { DocsFields } from '@byline/generated-types'
|
|
70
66
|
|
|
71
67
|
const DOCS_COLLECTION = 'docs'
|
|
72
68
|
const MEDIA_COLLECTION = 'media'
|
|
73
69
|
const DOCS_URL_PREFIX = '/docs'
|
|
74
70
|
const DEFAULT_IMPORT_STATUS = 'published'
|
|
75
71
|
|
|
72
|
+
type AppBylineClient = BylineClient
|
|
73
|
+
type DocsHandle = CollectionHandle<DocsFields>
|
|
74
|
+
|
|
76
75
|
interface Flags {
|
|
77
76
|
dryRun: boolean
|
|
78
77
|
verbose: boolean
|
|
@@ -135,7 +134,7 @@ interface ResolvedFeatureImage {
|
|
|
135
134
|
}
|
|
136
135
|
|
|
137
136
|
async function resolveFeatureImage(
|
|
138
|
-
client:
|
|
137
|
+
client: AppBylineClient,
|
|
139
138
|
path: string
|
|
140
139
|
): Promise<ResolvedFeatureImage | null> {
|
|
141
140
|
const mediaCollectionId = await client.resolveCollectionId(MEDIA_COLLECTION)
|
|
@@ -186,7 +185,7 @@ function derivePath(frontmatter: DocFrontmatter, locale: string): string {
|
|
|
186
185
|
* workflow doesn't include the target or when already at/past it.
|
|
187
186
|
*/
|
|
188
187
|
async function walkToStatus(
|
|
189
|
-
handle:
|
|
188
|
+
handle: DocsHandle,
|
|
190
189
|
documentId: string,
|
|
191
190
|
workflowStatuses: readonly { name: string }[],
|
|
192
191
|
currentStatus: string,
|
|
@@ -230,8 +229,8 @@ function buildSourcePathMap(files: string[], defaultLocale: string): Map<string,
|
|
|
230
229
|
|
|
231
230
|
async function processFile(
|
|
232
231
|
filePath: string,
|
|
233
|
-
client:
|
|
234
|
-
handle:
|
|
232
|
+
client: AppBylineClient,
|
|
233
|
+
handle: DocsHandle,
|
|
235
234
|
flags: Flags,
|
|
236
235
|
pathMap: Map<string, string>
|
|
237
236
|
): Promise<ProcessResult> {
|
|
@@ -340,7 +339,7 @@ function parentIndexFile(filePath: string): string {
|
|
|
340
339
|
* processed in sorted order, so prefix order carries straight through.
|
|
341
340
|
*/
|
|
342
341
|
async function placeTreeFromDirectories(
|
|
343
|
-
handle:
|
|
342
|
+
handle: DocsHandle,
|
|
344
343
|
results: ProcessResult[]
|
|
345
344
|
): Promise<void> {
|
|
346
345
|
const placeable = results.filter(
|