@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.
Files changed (183) hide show
  1. package/README.md +29 -3
  2. package/dist/cli.js +5 -2
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/doctor.d.ts.map +1 -1
  5. package/dist/commands/doctor.js +1 -0
  6. package/dist/commands/doctor.js.map +1 -1
  7. package/dist/commands/init.d.ts +3 -0
  8. package/dist/commands/init.d.ts.map +1 -1
  9. package/dist/commands/init.js +10 -14
  10. package/dist/commands/init.js.map +1 -1
  11. package/dist/commands/setup-checks.d.ts +9 -0
  12. package/dist/commands/setup-checks.d.ts.map +1 -1
  13. package/dist/commands/setup-checks.js +43 -18
  14. package/dist/commands/setup-checks.js.map +1 -1
  15. package/dist/commands/setup.js +1 -1
  16. package/dist/commands/setup.js.map +1 -1
  17. package/dist/context.d.ts +2 -0
  18. package/dist/context.d.ts.map +1 -1
  19. package/dist/context.js +6 -0
  20. package/dist/context.js.map +1 -1
  21. package/dist/lib/dependency-version.d.ts +12 -0
  22. package/dist/lib/dependency-version.d.ts.map +1 -0
  23. package/dist/lib/dependency-version.js +101 -0
  24. package/dist/lib/dependency-version.js.map +1 -0
  25. package/dist/lib/planned-writes.d.ts +8 -0
  26. package/dist/lib/planned-writes.d.ts.map +1 -0
  27. package/dist/lib/planned-writes.js +177 -0
  28. package/dist/lib/planned-writes.js.map +1 -0
  29. package/dist/lib/planned-writes.test.d.ts +2 -0
  30. package/dist/lib/planned-writes.test.d.ts.map +1 -0
  31. package/dist/lib/planned-writes.test.js +113 -0
  32. package/dist/lib/planned-writes.test.js.map +1 -0
  33. package/dist/lib/release-policy.d.ts +12 -0
  34. package/dist/lib/release-policy.d.ts.map +1 -0
  35. package/dist/lib/release-policy.js +20 -0
  36. package/dist/lib/release-policy.js.map +1 -0
  37. package/dist/lib/release-policy.test.d.ts +2 -0
  38. package/dist/lib/release-policy.test.d.ts.map +1 -0
  39. package/dist/lib/release-policy.test.js +36 -0
  40. package/dist/lib/release-policy.test.js.map +1 -0
  41. package/dist/lib/route-config.d.ts +40 -0
  42. package/dist/lib/route-config.d.ts.map +1 -0
  43. package/dist/lib/route-config.js +322 -0
  44. package/dist/lib/route-config.js.map +1 -0
  45. package/dist/lib/static-config.d.ts +20 -0
  46. package/dist/lib/static-config.d.ts.map +1 -0
  47. package/dist/lib/static-config.js +444 -0
  48. package/dist/lib/static-config.js.map +1 -0
  49. package/dist/lib/static-config.test.d.ts +2 -0
  50. package/dist/lib/static-config.test.d.ts.map +1 -0
  51. package/dist/lib/static-config.test.js +105 -0
  52. package/dist/lib/static-config.test.js.map +1 -0
  53. package/dist/lib/template-hook-boundary.test.node.d.ts +2 -0
  54. package/dist/lib/template-hook-boundary.test.node.d.ts.map +1 -0
  55. package/dist/lib/template-hook-boundary.test.node.js +30 -0
  56. package/dist/lib/template-hook-boundary.test.node.js.map +1 -0
  57. package/dist/lib/template-path.d.ts +5 -0
  58. package/dist/lib/template-path.d.ts.map +1 -0
  59. package/dist/lib/template-path.js +9 -0
  60. package/dist/lib/template-path.js.map +1 -0
  61. package/dist/lib/workspace-root.d.ts +28 -0
  62. package/dist/lib/workspace-root.d.ts.map +1 -0
  63. package/dist/lib/workspace-root.js +205 -0
  64. package/dist/lib/workspace-root.js.map +1 -0
  65. package/dist/manifest/deps.d.ts +1 -1
  66. package/dist/manifest/deps.d.ts.map +1 -1
  67. package/dist/manifest/deps.js +24 -8
  68. package/dist/manifest/deps.js.map +1 -1
  69. package/dist/phases/deps.d.ts +14 -1
  70. package/dist/phases/deps.d.ts.map +1 -1
  71. package/dist/phases/deps.js +312 -137
  72. package/dist/phases/deps.js.map +1 -1
  73. package/dist/phases/deps.test.d.ts +2 -0
  74. package/dist/phases/deps.test.d.ts.map +1 -0
  75. package/dist/phases/deps.test.js +343 -0
  76. package/dist/phases/deps.test.js.map +1 -0
  77. package/dist/phases/preflight.d.ts.map +1 -1
  78. package/dist/phases/preflight.js +59 -11
  79. package/dist/phases/preflight.js.map +1 -1
  80. package/dist/phases/prompts.d.ts +2 -0
  81. package/dist/phases/prompts.d.ts.map +1 -1
  82. package/dist/phases/prompts.js +51 -2
  83. package/dist/phases/prompts.js.map +1 -1
  84. package/dist/phases/routes-ui.test.d.ts +2 -0
  85. package/dist/phases/routes-ui.test.d.ts.map +1 -0
  86. package/dist/phases/routes-ui.test.js +766 -0
  87. package/dist/phases/routes-ui.test.js.map +1 -0
  88. package/dist/phases/routes.d.ts +4 -1
  89. package/dist/phases/routes.d.ts.map +1 -1
  90. package/dist/phases/routes.js +610 -122
  91. package/dist/phases/routes.js.map +1 -1
  92. package/dist/phases/scaffold-smoke.test.d.ts +2 -0
  93. package/dist/phases/scaffold-smoke.test.d.ts.map +1 -0
  94. package/dist/phases/scaffold-smoke.test.js +175 -0
  95. package/dist/phases/scaffold-smoke.test.js.map +1 -0
  96. package/dist/phases/scaffold.d.ts +3 -2
  97. package/dist/phases/scaffold.d.ts.map +1 -1
  98. package/dist/phases/scaffold.js +268 -91
  99. package/dist/phases/scaffold.js.map +1 -1
  100. package/dist/phases/scaffold.test.js +171 -22
  101. package/dist/phases/scaffold.test.js.map +1 -1
  102. package/dist/phases/ui.d.ts +4 -1
  103. package/dist/phases/ui.d.ts.map +1 -1
  104. package/dist/phases/ui.js +51 -59
  105. package/dist/phases/ui.js.map +1 -1
  106. package/dist/phases/wire/index.d.ts.map +1 -1
  107. package/dist/phases/wire/index.js +10 -6
  108. package/dist/phases/wire/index.js.map +1 -1
  109. package/dist/phases/wire/shared.d.ts +4 -1
  110. package/dist/phases/wire/shared.d.ts.map +1 -1
  111. package/dist/phases/wire/vite-config.d.ts.map +1 -1
  112. package/dist/phases/wire/vite-config.js +69 -20
  113. package/dist/phases/wire/vite-config.js.map +1 -1
  114. package/dist/phases/wire/vite-config.test.d.ts +2 -0
  115. package/dist/phases/wire/vite-config.test.d.ts.map +1 -0
  116. package/dist/phases/wire/vite-config.test.js +97 -0
  117. package/dist/phases/wire/vite-config.test.js.map +1 -0
  118. package/dist/prompts.d.ts +1 -0
  119. package/dist/prompts.d.ts.map +1 -1
  120. package/dist/prompts.js +7 -2
  121. package/dist/prompts.js.map +1 -1
  122. package/dist/runner.js +1 -1
  123. package/dist/runner.js.map +1 -1
  124. package/dist/templates/byline/collection-types.contract.ts +26 -1
  125. package/dist/templates/byline/collections/index.ts +1 -1
  126. package/dist/templates/byline/collections/server-hooks.ts +7 -0
  127. package/dist/templates/byline/generated/collection-types.ts +14 -6
  128. package/dist/templates/byline/routes.ts +7 -6
  129. package/dist/templates/byline/server.config.ts +10 -1
  130. package/dist/templates/byline-examples/admin.config.ts +7 -12
  131. package/dist/templates/byline-examples/blocks/photo-block.ts +3 -2
  132. package/dist/templates/byline-examples/collection-types.contract.ts +26 -1
  133. package/dist/templates/byline-examples/collections/docs/hooks.ts +23 -13
  134. package/dist/templates/byline-examples/collections/docs/schema.ts +2 -11
  135. package/dist/templates/byline-examples/collections/index.ts +1 -1
  136. package/dist/templates/byline-examples/collections/media/components/media-list-view.tsx +11 -6
  137. package/dist/templates/byline-examples/collections/media/schema.ts +3 -0
  138. package/dist/templates/byline-examples/collections/news/schema.ts +4 -3
  139. package/dist/templates/byline-examples/collections/server-hooks.ts +8 -0
  140. package/dist/templates/byline-examples/fields/ai-text.ts +1 -1
  141. package/dist/templates/byline-examples/fields/ai-textarea.ts +1 -1
  142. package/dist/templates/byline-examples/fields/lexical-richtext-ai.tsx +3 -3
  143. package/dist/templates/byline-examples/generated/collection-types.ts +138 -130
  144. package/dist/templates/byline-examples/routes.ts +7 -6
  145. package/dist/templates/byline-examples/scripts/backfill-version-locales.ts +1 -1
  146. package/dist/templates/byline-examples/scripts/import-docs.ts +10 -11
  147. package/dist/templates/byline-examples/scripts/lib/mdast-to-lexical.test.node.ts +93 -233
  148. package/dist/templates/byline-examples/scripts/lib/mdast-to-lexical.ts +2 -2
  149. package/dist/templates/byline-examples/scripts/lib/strip-leading-h1.test.node.ts +0 -4
  150. package/dist/templates/byline-examples/scripts/re-anchor.ts +3 -3
  151. package/dist/templates/byline-examples/scripts/regenerate-media-operation.ts +112 -0
  152. package/dist/templates/byline-examples/scripts/regenerate-media.ts +129 -92
  153. package/dist/templates/byline-examples/server.config.ts +14 -6
  154. package/dist/templates/host/vite.config.ts +2 -0
  155. package/dist/templates/routes/_byline/route.lazy.tsx +1 -2
  156. package/dist/templates/routes/_byline/route.tsx +1 -1
  157. package/dist/templates/ui-byline/blocks/photo-block/index.tsx +18 -22
  158. package/dist/templates/ui-byline/blocks/richtext-block/index.tsx +1 -1
  159. package/dist/templates/ui-byline/components/admonition/index.tsx +11 -8
  160. package/dist/templates/ui-byline/components/code/code.tsx +6 -4
  161. package/dist/templates/ui-byline/components/link/lang-link.tsx +4 -8
  162. package/dist/templates/ui-byline/components/link/link-field.tsx +3 -2
  163. package/dist/templates/ui-byline/components/link/link-lexical.tsx +9 -8
  164. package/dist/templates/ui-byline/render-blocks.tsx +38 -34
  165. package/dist/templates/ui-byline/types/content.ts +25 -0
  166. package/dist/templates/ui-byline/types/i18n.ts +4 -8
  167. package/dist/test-helpers.d.ts +5 -0
  168. package/dist/test-helpers.d.ts.map +1 -0
  169. package/dist/test-helpers.js +52 -0
  170. package/dist/test-helpers.js.map +1 -0
  171. package/dist/types.d.ts +21 -1
  172. package/dist/types.d.ts.map +1 -1
  173. package/dist/ui-template-contract.test.d.ts +2 -0
  174. package/dist/ui-template-contract.test.d.ts.map +1 -0
  175. package/dist/ui-template-contract.test.js +150 -0
  176. package/dist/ui-template-contract.test.js.map +1 -0
  177. package/dist/workspace-root.test.d.ts +2 -0
  178. package/dist/workspace-root.test.d.ts.map +1 -0
  179. package/dist/workspace-root.test.js +311 -0
  180. package/dist/workspace-root.test.js.map +1 -0
  181. package/package.json +9 -1
  182. package/dist/templates/byline/client.server.ts +0 -32
  183. package/dist/templates/byline-examples/client.server.ts +0 -32
@@ -1,41 +1,13 @@
1
1
  import { Section } from '@byline/ui/react'
2
2
 
3
- import type { PhotoBlockData, RichTextBlockData } from '~/generated/collection-types.js'
4
-
5
3
  import { PhotoBlock } from '@/ui/byline/blocks/photo-block'
6
4
  import { RichTextBlock } from '@/ui/byline/blocks/richtext-block'
7
- import { toKebabCase } from '@/ui/utils/to-kebab-case'
8
- import type { Locale } from '@/i18n/i18n-config'
9
-
10
- export type AnyBlock = PhotoBlockData | RichTextBlockData
11
-
12
- // Mapped type ensures every AnyBlock['_type'] has a registered component.
13
- // TypeScript errors here if AnyBlock gains a new type without a matching entry.
14
- type BlockRegistry = {
15
- [K in AnyBlock['_type']]: React.ComponentType<{
16
- id: string
17
- block: Extract<AnyBlock, { _type: K }>
18
- lng: Locale
19
- constrainedLayout?: boolean
20
- }>
21
- }
22
-
23
- const blockComponents: BlockRegistry = {
24
- photoBlock: PhotoBlock,
25
- richTextBlock: RichTextBlock,
26
- }
27
-
28
- // Loose alias for the call site — BlockRegistry enforces correctness at
29
- // definition time; TypeScript can't infer the correlation during the map loop.
30
- type AnyBlockComponent = React.ComponentType<{
31
- id: string
32
- block: AnyBlock
33
- lng: Locale
34
- constrainedLayout?: boolean
35
- }>
5
+ import { toKebabCase } from '@/ui/byline/utils/to-kebab-case'
6
+ import type { PopulatedContentBlock } from '@/ui/byline/types/content'
7
+ import type { Locale } from '@/ui/byline/types/i18n'
36
8
 
37
9
  interface Props {
38
- blocks: AnyBlock[] | undefined | null
10
+ blocks: PopulatedContentBlock[] | undefined | null
39
11
  lng: Locale
40
12
  constrainedLayout?: boolean
41
13
  }
@@ -50,13 +22,45 @@ export function RenderBlocks({
50
22
  return (
51
23
  <>
52
24
  {blocks.map((block) => {
53
- const Block = blockComponents[block._type] as AnyBlockComponent
25
+ const content = renderBlock(block, lng, constrainedLayout)
26
+ if (content == null) return null
27
+
54
28
  return (
55
29
  <Section className={toKebabCase(block._type)} key={block._id}>
56
- <Block id={block._id} block={block} lng={lng} constrainedLayout={constrainedLayout} />
30
+ {content}
57
31
  </Section>
58
32
  )
59
33
  })}
60
34
  </>
61
35
  )
62
36
  }
37
+
38
+ function renderBlock(
39
+ block: PopulatedContentBlock,
40
+ lng: Locale,
41
+ constrainedLayout: boolean
42
+ ): React.JSX.Element | null {
43
+ switch (block._type) {
44
+ case 'photoBlock':
45
+ return (
46
+ <PhotoBlock id={block._id} block={block} lng={lng} constrainedLayout={constrainedLayout} />
47
+ )
48
+ case 'richTextBlock':
49
+ return (
50
+ <RichTextBlock
51
+ id={block._id}
52
+ block={block}
53
+ lng={lng}
54
+ constrainedLayout={constrainedLayout}
55
+ />
56
+ )
57
+ default:
58
+ return reportUnsupportedBlock(block)
59
+ }
60
+ }
61
+
62
+ function reportUnsupportedBlock(block: never): null {
63
+ const type = (block as { _type?: unknown })._type
64
+ console.error(`Unsupported content block type: "${String(type)}"`)
65
+ return null
66
+ }
@@ -0,0 +1,25 @@
1
+ import type { WithPopulated } from '@byline/client'
2
+
3
+ import type { DocsFields, MediaFields, PagesFields } from '@byline/generated-types'
4
+
5
+ type ContentBlockOf<Fields extends { content?: unknown }> =
6
+ NonNullable<Fields['content']> extends Array<infer Block> ? Block : never
7
+ type ContentBlock = ContentBlockOf<DocsFields> | ContentBlockOf<PagesFields>
8
+ type PhotoBlockData = Extract<ContentBlock, { _type: 'photoBlock' }>
9
+ type PopulatePhotoBlock<Block> = Block extends PhotoBlockData
10
+ ? WithPopulated<Block, 'photo', MediaFields>
11
+ : Block
12
+ type PopulatePhotoBlockContent<Content> =
13
+ Content extends Array<infer Block> ? Array<PopulatePhotoBlock<Block>> : Content
14
+
15
+ /** Photo block shape returned by reads that populate the `photo` relation. */
16
+ export type PopulatedPhotoBlockData = WithPopulated<PhotoBlockData, 'photo', MediaFields>
17
+
18
+ export type PopulatedContentBlock = PopulatePhotoBlock<ContentBlock>
19
+
20
+ /** Overlay populated photo blocks while preserving each consumer's content union. */
21
+ export type WithPopulatedPhotoBlockContent<Fields> = {
22
+ [Key in keyof Fields]: Key extends 'content'
23
+ ? PopulatePhotoBlockContent<Fields[Key]>
24
+ : Fields[Key]
25
+ }
@@ -1,14 +1,10 @@
1
1
  /**
2
2
  * `Locale` type used throughout the ui/byline tree as a `lng` prop type.
3
3
  *
4
- * The reference webapp ships its own `i18n-config.ts` that narrows this
5
- * to a literal union of supported locales (`'en' | 'fr' | ...`). This
6
- * stub keeps the type as `string` so the install builds without
7
- * requiring you to wire up an i18n config.
4
+ * This portable default stays `string` so the scaffold builds without an
5
+ * application-specific i18n module.
8
6
  *
9
- * If your app has its own i18n setup, replace this file with one that
10
- * re-exports your narrower `Locale` type, e.g.
11
- *
12
- * export type { Locale } from '@/i18n/i18n-config'
7
+ * If your app has its own i18n setup, replace this alias with its narrower
8
+ * locale union or re-export that setup's `Locale` type from this file.
13
9
  */
14
10
  export type Locale = string
@@ -0,0 +1,5 @@
1
+ import { Context } from './context.js';
2
+ import type { Answers } from './types.js';
3
+ export declare function createTestContext(answers?: Answers): Context;
4
+ export declare function createTestContextAt(cwd: string, answers?: Answers): Context;
5
+ //# sourceMappingURL=test-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-helpers.d.ts","sourceRoot":"","sources":["../src/test-helpers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AA6BzC,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,OAAY,GAAG,OAAO,CAGhE;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,OAAY,GAAG,OAAO,CAe/E"}
@@ -0,0 +1,52 @@
1
+ import { mkdtempSync } from 'node:fs';
2
+ import { tmpdir } from 'node:os';
3
+ import { join } from 'node:path';
4
+ import { Context } from './context.js';
5
+ import { StateStore } from './state.js';
6
+ const noop = () => { };
7
+ const logger = { info: noop, warn: noop, error: noop, success: noop, step: noop, raw: noop };
8
+ const prompter = {
9
+ async text({ defaultValue }) {
10
+ return defaultValue ?? '';
11
+ },
12
+ async password() {
13
+ return 'password';
14
+ },
15
+ async select({ options }) {
16
+ const first = options[0];
17
+ if (!first)
18
+ throw new Error('test prompt has no options');
19
+ return first.value;
20
+ },
21
+ async confirm({ defaultValue }) {
22
+ return defaultValue ?? true;
23
+ },
24
+ spinner: () => ({ start: noop, stop: noop }),
25
+ intro: noop,
26
+ outro: noop,
27
+ note: noop,
28
+ cancel(message) {
29
+ throw new Error(message);
30
+ },
31
+ };
32
+ export function createTestContext(answers = {}) {
33
+ const cwd = mkdtempSync(join(tmpdir(), 'byline-cli-test-'));
34
+ return createTestContextAt(cwd, answers);
35
+ }
36
+ export function createTestContextAt(cwd, answers = {}) {
37
+ const state = new StateStore(cwd);
38
+ state.patchAnswers(answers);
39
+ return new Context({
40
+ cwd,
41
+ apply: true,
42
+ dryRun: false,
43
+ yes: true,
44
+ reset: false,
45
+ resetConfirmed: false,
46
+ cliFlags: {},
47
+ logger,
48
+ prompter,
49
+ state,
50
+ });
51
+ }
52
+ //# sourceMappingURL=test-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-helpers.js","sourceRoot":"","sources":["../src/test-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAKvC,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;AACrB,MAAM,MAAM,GAAW,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE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MAAM,EAAE,KAAK;QACb,GAAG,EAAE,IAAI;QACT,KAAK,EAAE,KAAK;QACZ,cAAc,EAAE,KAAK;QACrB,QAAQ,EAAE,EAAE;QACZ,MAAM;QACN,QAAQ;QACR,KAAK;KACN,CAAC,CAAA;AACJ,CAAC"}
package/dist/types.d.ts CHANGED
@@ -6,7 +6,7 @@ export type DbStrategy = 'existing' | 'docker';
6
6
  export interface FileWrite {
7
7
  path: string;
8
8
  contents: string;
9
- mode?: 'create' | 'overwrite' | 'patch';
9
+ mode?: 'create' | 'overwrite' | 'patch' | 'delete';
10
10
  before?: string;
11
11
  }
12
12
  export interface ShellCommand {
@@ -18,7 +18,26 @@ export interface Plan {
18
18
  writes: FileWrite[];
19
19
  commands: ShellCommand[];
20
20
  notes: string[];
21
+ preconditions?: PlanPrecondition[];
21
22
  }
23
+ export interface TreeSnapshotEntry {
24
+ path: string;
25
+ type: 'directory' | 'file' | 'other';
26
+ contents?: string;
27
+ }
28
+ export type PlanPrecondition = {
29
+ type: 'file';
30
+ path: string;
31
+ contents: string | null;
32
+ } | {
33
+ type: 'tree';
34
+ path: string;
35
+ entries: TreeSnapshotEntry[];
36
+ } | {
37
+ type: 'value';
38
+ key: string;
39
+ value: string;
40
+ };
22
41
  export interface PhaseResult {
23
42
  state: PhaseState;
24
43
  notes?: string[];
@@ -38,6 +57,7 @@ export interface Answers {
38
57
  dbName?: string;
39
58
  dbUser?: string;
40
59
  adminPath?: string;
60
+ signInPath?: string;
41
61
  uiDir?: string;
42
62
  examples?: boolean;
43
63
  importDocs?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C,MAAM,MAAM,OAAO,GACf,WAAW,GACX,SAAS,GACT,MAAM,GACN,IAAI,GACJ,SAAS,GACT,KAAK,GACL,MAAM,GACN,UAAU,GACV,YAAY,GACZ,WA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AAG,OAAO,CAAC,UAAU,CAAC,CAAA;IACzC,IAAI,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACjC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;CACtD;AAED,MAAM,WAAW,OAAO;IACtB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,EAAE,CAAC,EAAE,cAAc,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,CAAC,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,OAAO,EAAE,CAAA;IAC1B,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC,CAAA;CACxE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ui-template-contract.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-template-contract.test.d.ts","sourceRoot":"","sources":["../src/ui-template-contract.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,150 @@
1
+ import { dirname, resolve } from 'node:path';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { ModuleKind, ModuleResolutionKind, Project, ScriptTarget, SyntaxKind } from 'ts-morph';
4
+ import { describe, expect, it } from 'vitest';
5
+ const templates = resolve(dirname(fileURLToPath(import.meta.url)), 'templates');
6
+ const project = new Project({ skipAddingFilesFromTsConfig: true });
7
+ const generated = project.addSourceFileAtPath(resolve(templates, 'byline-examples/generated/collection-types.ts'));
8
+ // Format 2 declares every type inside the `@byline/generated-types`
9
+ // declaration-merge block; alias lookups search the whole file.
10
+ function generatedTypeAliasOrThrow(name) {
11
+ const alias = generated
12
+ .getDescendantsOfKind(SyntaxKind.TypeAliasDeclaration)
13
+ .find((declaration) => declaration.getName() === name);
14
+ if (!alias)
15
+ throw new Error(`Expected to find type alias named '${name}'.`);
16
+ return alias;
17
+ }
18
+ // The plain-module body of the generated types, for in-memory typecheck
19
+ // fixtures: the augmentation block unwrapped to top-level declarations.
20
+ function generatedModuleBody() {
21
+ const match = generated
22
+ .getFullText()
23
+ .match(/declare module '@byline\/generated-types' \{\n([\s\S]*?)\n\}\n\ndeclare module/);
24
+ if (!match?.[1])
25
+ throw new Error('Expected a @byline/generated-types augmentation block.');
26
+ return match[1].replace(/^ {2}/gm, '');
27
+ }
28
+ const contentTypes = project.addSourceFileAtPath(resolve(templates, 'ui-byline/types/content.ts'));
29
+ const renderer = project.addSourceFileAtPath(resolve(templates, 'ui-byline/render-blocks.tsx'));
30
+ describe('public block renderer templates', () => {
31
+ it('covers every generated Docs and Pages block discriminant', () => {
32
+ const blockNames = new Set([
33
+ ...contentBlockNames('DocsFields'),
34
+ ...contentBlockNames('PagesFields'),
35
+ ]);
36
+ const expectedTypes = [...blockNames].map(blockDiscriminant).sort();
37
+ const switchStatement = renderer
38
+ .getDescendantsOfKind(SyntaxKind.SwitchStatement)
39
+ .find((node) => node.getExpression().getText() === 'block._type');
40
+ const renderedTypes = switchStatement
41
+ ?.getCaseBlock()
42
+ .getClauses()
43
+ .flatMap((clause) => {
44
+ if (!clause.isKind(SyntaxKind.CaseClause))
45
+ return [];
46
+ const expression = clause.getExpression();
47
+ return expression.isKind(SyntaxKind.StringLiteral) ? [expression.getLiteralValue()] : [];
48
+ })
49
+ .sort();
50
+ expect(renderedTypes).toEqual(expectedTypes);
51
+ });
52
+ it('combines both consumers and preserves consumer-specific content in the overlay', () => {
53
+ expect(contentTypes.getTypeAliasOrThrow('ContentBlock').getTypeNodeOrThrow().getText()).toBe('ContentBlockOf<DocsFields> | ContentBlockOf<PagesFields>');
54
+ expect(contentTypes.getTypeAlias('WithPopulatedPhotoBlockContent')).toBeDefined();
55
+ });
56
+ it('typechecks the populated union and consumer-specific overlay contract', () => {
57
+ const typeProject = new Project({
58
+ useInMemoryFileSystem: true,
59
+ compilerOptions: {
60
+ strict: true,
61
+ noEmit: true,
62
+ module: ModuleKind.ESNext,
63
+ moduleResolution: ModuleResolutionKind.Bundler,
64
+ target: ScriptTarget.ES2024,
65
+ },
66
+ });
67
+ typeProject.createSourceFile('/client.ts', `
68
+ export interface PopulatedRelation<T> { document?: T }
69
+ export type WithPopulated<F, K extends keyof F, Target> = {
70
+ [P in keyof F]: P extends K ? PopulatedRelation<Target> : F[P]
71
+ }
72
+ `);
73
+ typeProject.createSourceFile('/generated.ts', `type JsonValue = unknown
74
+ type RelatedDocumentValue = { documentId: string }
75
+ type StoredFileValue = { key: string }
76
+ ${generatedModuleBody()}`);
77
+ typeProject.createSourceFile('/content.ts', contentTypes
78
+ .getFullText()
79
+ .replace("from '@byline/client'", "from './client.js'")
80
+ .replace("from '@byline/generated-types'", "from './generated.js'"));
81
+ typeProject.createSourceFile('/contract.ts', `
82
+ import type { WithPopulated } from './client.js'
83
+ import type { DocsFields, MediaFields, PagesFields } from './generated.js'
84
+ import type {
85
+ PopulatedContentBlock,
86
+ WithPopulatedPhotoBlockContent,
87
+ } from './content.js'
88
+
89
+ type Equal<Left, Right> =
90
+ (<Value>() => Value extends Left ? 1 : 2) extends
91
+ (<Value>() => Value extends Right ? 1 : 2) ? true : false
92
+ type Assert<Value extends true> = Value
93
+ type ConsumerBlock =
94
+ | NonNullable<DocsFields['content']>[number]
95
+ | NonNullable<PagesFields['content']>[number]
96
+ type PhotoBlock = Extract<ConsumerBlock, { _type: 'photoBlock' }>
97
+ type ExpectedBlock =
98
+ | Exclude<ConsumerBlock, PhotoBlock>
99
+ | WithPopulated<PhotoBlock, 'photo', MediaFields>
100
+ type PagesOnlyBlock = { _id: string; _type: 'pagesOnlyBlock'; heading: string }
101
+ type ExtendedPages = Omit<PagesFields, 'content'> & {
102
+ content?: Array<NonNullable<PagesFields['content']>[number] | PagesOnlyBlock>
103
+ }
104
+ type PopulatedExtendedBlock = NonNullable<
105
+ WithPopulatedPhotoBlockContent<ExtendedPages>['content']
106
+ >[number]
107
+
108
+ type PopulatedUnionContract = Assert<Equal<PopulatedContentBlock, ExpectedBlock>>
109
+ type ConsumerOverlayContract = Assert<
110
+ Equal<Extract<PopulatedExtendedBlock, { _type: 'pagesOnlyBlock' }>, PagesOnlyBlock>
111
+ >
112
+ `);
113
+ expect(typeProject.getPreEmitDiagnostics().map((diagnostic) => diagnostic.getMessageText())).toEqual([]);
114
+ });
115
+ it('reports unsupported runtime blocks and returns null', () => {
116
+ const fallback = renderer.getFunctionOrThrow('reportUnsupportedBlock');
117
+ expect(fallback
118
+ .getDescendantsOfKind(SyntaxKind.CallExpression)
119
+ .some((call) => call.getExpression().getText() === 'console.error')).toBe(true);
120
+ expect(fallback
121
+ .getDescendantsOfKind(SyntaxKind.ReturnStatement)
122
+ .some((statement) => statement.getExpression()?.isKind(SyntaxKind.NullKeyword))).toBe(true);
123
+ });
124
+ });
125
+ function contentBlockNames(collection) {
126
+ const content = generatedTypeAliasOrThrow(collection)
127
+ .getDescendantsOfKind(SyntaxKind.PropertySignature)
128
+ .find((property) => property.getName() === 'content');
129
+ const matches = content
130
+ ?.getTypeNodeOrThrow()
131
+ .getText()
132
+ .matchAll(/\b([A-Z]\w*BlockData)\b/g);
133
+ return [...(matches ?? [])].map((match) => match[1]).filter((name) => name !== undefined);
134
+ }
135
+ function blockDiscriminant(blockName) {
136
+ const type = generatedTypeAliasOrThrow(blockName);
137
+ const discriminant = type
138
+ .getDescendantsOfKind(SyntaxKind.PropertySignature)
139
+ .find((property) => property.getName() === '_type')
140
+ ?.getTypeNodeOrThrow();
141
+ if (!discriminant?.isKind(SyntaxKind.LiteralType)) {
142
+ throw new Error(`Generated block ${blockName} has no literal _type`);
143
+ }
144
+ const literal = discriminant.getLiteral();
145
+ if (!literal.isKind(SyntaxKind.StringLiteral)) {
146
+ throw new Error(`Generated block ${blockName} has a non-string _type`);
147
+ }
148
+ return literal.getLiteralValue();
149
+ }
150
+ //# sourceMappingURL=ui-template-contract.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-template-contract.test.js","sourceRoot":"","sources":["../src/ui-template-contract.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAC9F,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,CAAA;AAC/E,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,EAAE,2BAA2B,EAAE,IAAI,EAAE,CAAC,CAAA;AAClE,MAAM,SAAS,GAAG,OAAO,CAAC,mBAAmB,CAC3C,OAAO,CAAC,SAAS,EAAE,+CAA+C,CAAC,CACpE,CAAA;AACD,oEAAoE;AACpE,gEAAgE;AAChE,SAAS,yBAAyB,CAAC,IAAY;IAC7C,MAAM,KAAK,GAAG,SAAS;SACpB,oBAAoB,CAAC,UAAU,CAAC,oBAAoB,CAAC;SACrD,IAAI,CAAC,CAAC,WAAW,E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2 @@
1
+ export {};
2
+ //# sourceMappingURL=workspace-root.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-root.test.d.ts","sourceRoot":"","sources":["../src/workspace-root.test.ts"],"names":[],"mappings":""}