@byline/cli 3.20.4 → 4.0.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 (198) hide show
  1. package/README.md +42 -2
  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 +18 -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 +168 -0
  95. package/dist/phases/scaffold-smoke.test.js.map +1 -0
  96. package/dist/phases/scaffold.d.ts +4 -1
  97. package/dist/phases/scaffold.d.ts.map +1 -1
  98. package/dist/phases/scaffold.js +275 -72
  99. package/dist/phases/scaffold.js.map +1 -1
  100. package/dist/phases/scaffold.test.d.ts +2 -0
  101. package/dist/phases/scaffold.test.d.ts.map +1 -0
  102. package/dist/phases/scaffold.test.js +178 -0
  103. package/dist/phases/scaffold.test.js.map +1 -0
  104. package/dist/phases/ui.d.ts +4 -1
  105. package/dist/phases/ui.d.ts.map +1 -1
  106. package/dist/phases/ui.js +51 -59
  107. package/dist/phases/ui.js.map +1 -1
  108. package/dist/phases/wire/index.d.ts.map +1 -1
  109. package/dist/phases/wire/index.js +10 -6
  110. package/dist/phases/wire/index.js.map +1 -1
  111. package/dist/phases/wire/shared.d.ts +4 -1
  112. package/dist/phases/wire/shared.d.ts.map +1 -1
  113. package/dist/phases/wire/vite-config.d.ts.map +1 -1
  114. package/dist/phases/wire/vite-config.js +69 -20
  115. package/dist/phases/wire/vite-config.js.map +1 -1
  116. package/dist/phases/wire/vite-config.test.d.ts +2 -0
  117. package/dist/phases/wire/vite-config.test.d.ts.map +1 -0
  118. package/dist/phases/wire/vite-config.test.js +97 -0
  119. package/dist/phases/wire/vite-config.test.js.map +1 -0
  120. package/dist/prompts.d.ts +1 -0
  121. package/dist/prompts.d.ts.map +1 -1
  122. package/dist/prompts.js +7 -2
  123. package/dist/prompts.js.map +1 -1
  124. package/dist/runner.js +1 -1
  125. package/dist/runner.js.map +1 -1
  126. package/dist/templates/byline/admin.config.ts +8 -7
  127. package/dist/templates/byline/clients.server.ts +77 -0
  128. package/dist/templates/byline/collection-types.contract.ts +67 -0
  129. package/dist/templates/byline/collections/index.ts +17 -0
  130. package/dist/templates/byline/collections/server-hooks.ts +7 -0
  131. package/dist/templates/byline/generated/collection-types.ts +11 -0
  132. package/dist/templates/byline/i18n.ts +3 -3
  133. package/dist/templates/byline/locales.ts +9 -9
  134. package/dist/templates/byline/public.ts +12 -0
  135. package/dist/templates/byline/routes.ts +7 -6
  136. package/dist/templates/byline/scripts/generate-types.ts +81 -0
  137. package/dist/templates/byline/server.config.ts +5 -5
  138. package/dist/templates/byline-examples/admin.config.ts +18 -21
  139. package/dist/templates/byline-examples/blocks/photo-block.ts +3 -2
  140. package/dist/templates/byline-examples/clients.server.ts +77 -0
  141. package/dist/templates/byline-examples/collection-types.contract.ts +67 -0
  142. package/dist/templates/byline-examples/collections/docs/hooks.ts +30 -20
  143. package/dist/templates/byline-examples/collections/docs/schema.ts +18 -18
  144. package/dist/templates/byline-examples/collections/index.ts +22 -0
  145. package/dist/templates/byline-examples/collections/media/components/media-list-view.tsx +11 -6
  146. package/dist/templates/byline-examples/collections/media/schema.ts +16 -0
  147. package/dist/templates/byline-examples/collections/news/schema.ts +17 -3
  148. package/dist/templates/byline-examples/collections/news-categories/schema.ts +13 -0
  149. package/dist/templates/byline-examples/collections/pages/schema.ts +13 -0
  150. package/dist/templates/byline-examples/collections/server-hooks.ts +8 -0
  151. package/dist/templates/byline-examples/fields/ai-text.ts +1 -1
  152. package/dist/templates/byline-examples/fields/ai-textarea.ts +1 -1
  153. package/dist/templates/byline-examples/fields/lexical-richtext-ai.tsx +3 -3
  154. package/dist/templates/byline-examples/generated/collection-types.ts +139 -0
  155. package/dist/templates/byline-examples/i18n.ts +3 -3
  156. package/dist/templates/byline-examples/locales.ts +9 -9
  157. package/dist/templates/byline-examples/public.ts +12 -0
  158. package/dist/templates/byline-examples/routes.ts +7 -6
  159. package/dist/templates/byline-examples/scripts/backfill-version-locales.ts +1 -1
  160. package/dist/templates/byline-examples/scripts/generate-types.ts +81 -0
  161. package/dist/templates/byline-examples/scripts/import-docs.ts +11 -12
  162. package/dist/templates/byline-examples/scripts/lib/mdast-to-lexical.test.node.ts +93 -233
  163. package/dist/templates/byline-examples/scripts/lib/mdast-to-lexical.ts +2 -2
  164. package/dist/templates/byline-examples/scripts/lib/strip-leading-h1.test.node.ts +0 -4
  165. package/dist/templates/byline-examples/scripts/re-anchor.ts +3 -3
  166. package/dist/templates/byline-examples/scripts/regenerate-media.ts +6 -5
  167. package/dist/templates/byline-examples/server.config.ts +6 -15
  168. package/dist/templates/host/vite.config.ts +2 -0
  169. package/dist/templates/routes/_byline/admin/collections/$collection/$id/api.tsx +1 -6
  170. package/dist/templates/routes/_byline/admin/collections/$collection/$id/history.tsx +1 -7
  171. package/dist/templates/routes/_byline/admin/collections/$collection/$id/index.tsx +1 -6
  172. package/dist/templates/routes/_byline/route.lazy.tsx +1 -2
  173. package/dist/templates/routes/_byline/route.tsx +1 -1
  174. package/dist/templates/ui-byline/blocks/photo-block/index.tsx +18 -23
  175. package/dist/templates/ui-byline/blocks/richtext-block/index.tsx +1 -1
  176. package/dist/templates/ui-byline/components/admonition/index.tsx +11 -8
  177. package/dist/templates/ui-byline/components/code/code.tsx +6 -4
  178. package/dist/templates/ui-byline/components/link/lang-link.tsx +4 -8
  179. package/dist/templates/ui-byline/components/link/link-field.tsx +3 -2
  180. package/dist/templates/ui-byline/components/link/link-lexical.tsx +9 -8
  181. package/dist/templates/ui-byline/render-blocks.tsx +38 -38
  182. package/dist/templates/ui-byline/types/content.ts +25 -0
  183. package/dist/templates/ui-byline/types/i18n.ts +4 -8
  184. package/dist/test-helpers.d.ts +5 -0
  185. package/dist/test-helpers.d.ts.map +1 -0
  186. package/dist/test-helpers.js +52 -0
  187. package/dist/test-helpers.js.map +1 -0
  188. package/dist/types.d.ts +21 -1
  189. package/dist/types.d.ts.map +1 -1
  190. package/dist/ui-template-contract.test.d.ts +2 -0
  191. package/dist/ui-template-contract.test.d.ts.map +1 -0
  192. package/dist/ui-template-contract.test.js +130 -0
  193. package/dist/ui-template-contract.test.js.map +1 -0
  194. package/dist/workspace-root.test.d.ts +2 -0
  195. package/dist/workspace-root.test.d.ts.map +1 -0
  196. package/dist/workspace-root.test.js +307 -0
  197. package/dist/workspace-root.test.js.map +1 -0
  198. package/package.json +9 -1
@@ -12,12 +12,12 @@
12
12
  * registry). `byline/i18n.ts` consumes these to assemble the
13
13
  * `defineServerConfig` / `defineClientConfig` payload.
14
14
  *
15
- * Kept separate from `byline/i18n.ts` so a public frontend (or a collection
16
- * schema file loaded outside Vite — e.g. when running seeds via tsx) can
17
- * import the locale arrays without dragging in the admin translation graph
18
- * (`@byline/i18n/admin`) that `i18n.ts` depends on. Importing `byline/i18n.ts`
19
- * would; importing this won't — which keeps the lazy admin/public bundle split
20
- * (`src/routes/_byline/route.lazy.tsx`) intact.
15
+ * Kept separate from `byline/i18n.ts` so `byline/public.ts` can expose the
16
+ * locale arrays to a public frontend (or a collection schema file loaded
17
+ * outside Vite — e.g. when running seeds via tsx) without dragging in the
18
+ * admin translation graph (`@byline/i18n/admin`) that `i18n.ts` depends on.
19
+ * Importing `byline/i18n.ts` would; importing this won't — which keeps the lazy
20
+ * admin/public bundle split (`src/routes/_byline/route.lazy.tsx`) intact.
21
21
  *
22
22
  * `interface` locales govern the CMS admin UI language; `content` locales
23
23
  * govern the languages a document can be published in.
@@ -33,10 +33,10 @@ export interface LocaleDefinition {
33
33
  // (or a third-party plugin merged in via `mergeTranslations(...)`).
34
34
  // `adminTranslations({ locales })` in `byline/i18n.ts` throws at boot if a
35
35
  // requested code is not bundled — `@byline/i18n/admin` ships English and French.
36
- export const interfaceLocales: LocaleDefinition[] = [
36
+ export const interfaceLocales = [
37
37
  { code: 'en', label: 'English' },
38
38
  { code: 'fr', label: 'Français' },
39
- ]
39
+ ] as const satisfies readonly LocaleDefinition[]
40
40
 
41
41
  /** Locales a document can be published in. */
42
42
  export const contentLocales = [
@@ -44,4 +44,4 @@ export const contentLocales = [
44
44
  { code: 'fr', label: 'Français' },
45
45
  { code: 'es', label: 'Español' },
46
46
  { code: 'de', label: 'Deutsch' },
47
- ] as const
47
+ ] as const satisfies readonly LocaleDefinition[]
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This Source Code is subject to the terms of the Mozilla Public
3
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
+ *
6
+ * Copyright (c) Infonomic Company Limited
7
+ */
8
+
9
+ /** Client-safe public configuration. Keep this barrel free of admin and server imports. */
10
+ export { contentLocales, interfaceLocales } from './locales.js'
11
+ export { routes } from './routes.js'
12
+ export type { LocaleDefinition } from './locales.js'
@@ -7,17 +7,18 @@
7
7
  */
8
8
 
9
9
  /**
10
- * URL segments for admin and (future) public API routes. Defaults of
11
- * `/admin` and `/api` are applied automatically by `resolveRoutes()` —
12
- * keys only need to be set here when overriding either default.
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 type { RoutesConfig } from '@byline/core'
15
+ import { resolveRoutes } from '@byline/core'
16
16
 
17
- export const routes: Partial<RoutesConfig> = {
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
- * cd apps/webapp && pnpm tsx byline/scripts/backfill-version-locales.ts
19
+ * pnpm tsx byline/scripts/backfill-version-locales.ts
20
20
  *
21
21
  * See docs/07-internationalization/index.md.
22
22
  */
@@ -0,0 +1,81 @@
1
+ import { randomUUID } from 'node:crypto'
2
+ import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs'
3
+ import { dirname, resolve } from 'node:path'
4
+ import { fileURLToPath, pathToFileURL } from 'node:url'
5
+
6
+ import { emitCollectionTypes } from '@byline/core/codegen'
7
+
8
+ import { collections } from '../collections/index.js'
9
+
10
+ const defaultOutputPath = fileURLToPath(
11
+ new URL('../generated/collection-types.ts', import.meta.url)
12
+ )
13
+
14
+ export type GenerationStatus = 'current' | 'unchanged' | 'written'
15
+
16
+ export function writeCollectionTypes(
17
+ outputPath: string,
18
+ source: string,
19
+ check: boolean
20
+ ): GenerationStatus {
21
+ const existing = existsSync(outputPath) ? readFileSync(outputPath, 'utf8') : undefined
22
+
23
+ if (check) {
24
+ if (existing === undefined) {
25
+ throw new Error(
26
+ `generated collection types are missing: ${outputPath}. Run pnpm byline:generate`
27
+ )
28
+ }
29
+ if (existing !== source) {
30
+ throw new Error(
31
+ `generated collection types are stale: ${outputPath}. Run pnpm byline:generate`
32
+ )
33
+ }
34
+ return 'current'
35
+ }
36
+
37
+ if (existing === source) return 'unchanged'
38
+
39
+ mkdirSync(dirname(outputPath), { recursive: true })
40
+ const temporaryPath = `${outputPath}.${process.pid}.${randomUUID()}.tmp`
41
+ try {
42
+ writeFileSync(temporaryPath, source, 'utf8')
43
+ renameSync(temporaryPath, outputPath)
44
+ } finally {
45
+ rmSync(temporaryPath, { force: true })
46
+ }
47
+ return 'written'
48
+ }
49
+
50
+ function parseArgs(args: readonly string[]): { check: boolean } {
51
+ const unknown = args.filter((arg) => arg !== '--check')
52
+ if (unknown.length > 0) throw new Error(`unknown argument: ${unknown.join(', ')}`)
53
+ if (args.filter((arg) => arg === '--check').length > 1) {
54
+ throw new Error('duplicate argument: --check')
55
+ }
56
+ return { check: args.includes('--check') }
57
+ }
58
+
59
+ export function generateCollectionTypes(
60
+ outputPath = defaultOutputPath,
61
+ check = false
62
+ ): { hash: string; status: GenerationStatus } {
63
+ const { source, hash } = emitCollectionTypes(collections)
64
+ return { hash, status: writeCollectionTypes(outputPath, source, check) }
65
+ }
66
+
67
+ function main(): void {
68
+ const { check } = parseArgs(process.argv.slice(2))
69
+ const { hash, status } = generateCollectionTypes(defaultOutputPath, check)
70
+ console.log(`collection types: ${collections.length} collections ${hash.slice(0, 12)} ${status}`)
71
+ }
72
+
73
+ const entryPath = process.argv[1]
74
+ if (entryPath !== undefined && pathToFileURL(resolve(entryPath)).href === import.meta.url) {
75
+ try {
76
+ main()
77
+ } catch (error) {
78
+ console.error(`collection type generation failed: ${(error as Error).message}`)
79
+ process.exitCode = 1
80
+ }
81
+ }
@@ -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 { CollectionFieldsByPath, DocsFields } from '../generated/collection-types.js'
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<CollectionFieldsByPath>
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: ReturnType<typeof createBylineClient>,
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: CollectionHandle,
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: ReturnType<typeof createBylineClient>,
234
- handle: CollectionHandle,
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: CollectionHandle,
342
+ handle: DocsHandle,
344
343
  results: ProcessResult[]
345
344
  ): Promise<void> {
346
345
  const placeable = results.filter(
@@ -392,7 +391,7 @@ async function run(): Promise<void> {
392
391
 
393
392
  const config = getServerConfig()
394
393
  const requestContext = createSuperAdminContext({ id: 'import-docs-script' })
395
- const client = createBylineClient({ config, requestContext })
394
+ const client = createBylineClient<CollectionFieldsByPath>({ config, requestContext })
396
395
  const handle = client.collection(DOCS_COLLECTION)
397
396
 
398
397
  // Pre-pass: map each source file to the path its imported doc will