From 894338f5a26cb982748c97997d90b3edff2ebf38 Mon Sep 17 00:00:00 2001 From: Hyan Mandian <5044101+hyanmandian@users.noreply.github.com> Date: Tue, 22 Sep 2026 01:37:16 -0300 Subject: [PATCH 1/2] fix(build): the document field templates stop breaking the package build The declaration build runs the type-checker over every file of the repository that the tsconfig takes in, and the templates the document field examples are generated from carry `@@placeholder@@` markers, so a file named `schema/zod.ts` does not parse as TypeScript. `docs` is excluded, which covers the templates where they sit, but the Tree-shaking job checks the base revision of a pull request out into `base/`, a second copy of the whole repository that the exclusion does not reach: since the templates landed on `main`, the "Build head" step fails on any pull request rebased onto it, with a TS1003 for every marker. A template is now named for what it is, `schema/zod.ts.tmpl`, keeping the extension of the file it fills in ahead of the suffix. Nothing that walks the repository for `.ts`/`.tsx` files sees a template any more, wherever the folder is checked out and whichever tool does the walking, and an editor stops reporting errors in one that is open. The second checkout is excluded as well, so the build here keeps compiling the head alone whatever the base revision holds. --- CONTRIBUTING.md | 4 +++- .../angular/{document-field.ts => document-field.ts.tmpl} | 0 .../_templates/angular/{field.ts => field.ts.tmpl} | 0 .../_templates/angular/{form.ts => form.ts.tmpl} | 0 .../_templates/angular/{mask.ts => mask.ts.tmpl} | 0 .../_templates/{mask-body.ts => mask-body.ts.tmpl} | 0 .../react/{document-field.tsx => document-field.tsx.tmpl} | 0 .../_templates/react/{field.tsx => field.tsx.tmpl} | 0 .../_templates/react/{form.tsx => form.tsx.tmpl} | 0 .../_templates/react/{mask.ts => mask.ts.tmpl} | 0 .../_templates/schema/{arktype.ts => arktype.ts.tmpl} | 0 .../_templates/schema/{standard.ts => standard.ts.tmpl} | 0 .../_templates/schema/{valibot.ts => valibot.ts.tmpl} | 0 .../_templates/schema/{zod.ts => zod.ts.tmpl} | 0 .../_templates/vanilla/{field.html => field.html.tmpl} | 0 .../vue/{document-field.vue => document-field.vue.tmpl} | 0 .../_templates/vue/{field.vue => field.vue.tmpl} | 0 .../_templates/vue/{form.vue => form.vue.tmpl} | 0 .../_templates/vue/{mask.ts => mask.ts.tmpl} | 0 scripts/examples.ts | 8 ++++++-- tsconfig.json | 8 +++++--- 21 files changed, 14 insertions(+), 6 deletions(-) rename docs/snippets/document-field/_templates/angular/{document-field.ts => document-field.ts.tmpl} (100%) rename docs/snippets/document-field/_templates/angular/{field.ts => field.ts.tmpl} (100%) rename docs/snippets/document-field/_templates/angular/{form.ts => form.ts.tmpl} (100%) rename docs/snippets/document-field/_templates/angular/{mask.ts => mask.ts.tmpl} (100%) rename docs/snippets/document-field/_templates/{mask-body.ts => mask-body.ts.tmpl} (100%) rename docs/snippets/document-field/_templates/react/{document-field.tsx => document-field.tsx.tmpl} (100%) rename docs/snippets/document-field/_templates/react/{field.tsx => field.tsx.tmpl} (100%) rename docs/snippets/document-field/_templates/react/{form.tsx => form.tsx.tmpl} (100%) rename docs/snippets/document-field/_templates/react/{mask.ts => mask.ts.tmpl} (100%) rename docs/snippets/document-field/_templates/schema/{arktype.ts => arktype.ts.tmpl} (100%) rename docs/snippets/document-field/_templates/schema/{standard.ts => standard.ts.tmpl} (100%) rename docs/snippets/document-field/_templates/schema/{valibot.ts => valibot.ts.tmpl} (100%) rename docs/snippets/document-field/_templates/schema/{zod.ts => zod.ts.tmpl} (100%) rename docs/snippets/document-field/_templates/vanilla/{field.html => field.html.tmpl} (100%) rename docs/snippets/document-field/_templates/vue/{document-field.vue => document-field.vue.tmpl} (100%) rename docs/snippets/document-field/_templates/vue/{field.vue => field.vue.tmpl} (100%) rename docs/snippets/document-field/_templates/vue/{form.vue => form.vue.tmpl} (100%) rename docs/snippets/document-field/_templates/vue/{mask.ts => mask.ts.tmpl} (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0d178c69..a01365ac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -389,7 +389,9 @@ browser, with `_sidebar.md`, `_navbar.md` and `_coverpage.md` as its navigation. - The examples of the document field page are generated: `npm run build:examples` (`scripts/examples.ts`) fills the templates of `docs/snippets/document-field/_templates` from a table of documents, so the shared mask is written once. Edit a template or the table: the files - under `generated/` are written by the build and are not in the repository. + under `generated/` are written by the build and are not in the repository. A template ends in + `.tmpl` (`schema/zod.ts.tmpl`) because its `@@placeholder@@` markers do not parse as the language + its name says: the suffix keeps it out of everything that walks the repository for source files. - `scripts/llms.ts` reads the title back out of the front matter, so `docs/llms.txt` and `docs/llms-full.txt` keep their headings. - Context7 indexes `docs/` as `/brazilian-utils/javascript`; `context7.json` says what it reads, diff --git a/docs/snippets/document-field/_templates/angular/document-field.ts b/docs/snippets/document-field/_templates/angular/document-field.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/angular/document-field.ts rename to docs/snippets/document-field/_templates/angular/document-field.ts.tmpl diff --git a/docs/snippets/document-field/_templates/angular/field.ts b/docs/snippets/document-field/_templates/angular/field.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/angular/field.ts rename to docs/snippets/document-field/_templates/angular/field.ts.tmpl diff --git a/docs/snippets/document-field/_templates/angular/form.ts b/docs/snippets/document-field/_templates/angular/form.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/angular/form.ts rename to docs/snippets/document-field/_templates/angular/form.ts.tmpl diff --git a/docs/snippets/document-field/_templates/angular/mask.ts b/docs/snippets/document-field/_templates/angular/mask.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/angular/mask.ts rename to docs/snippets/document-field/_templates/angular/mask.ts.tmpl diff --git a/docs/snippets/document-field/_templates/mask-body.ts b/docs/snippets/document-field/_templates/mask-body.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/mask-body.ts rename to docs/snippets/document-field/_templates/mask-body.ts.tmpl diff --git a/docs/snippets/document-field/_templates/react/document-field.tsx b/docs/snippets/document-field/_templates/react/document-field.tsx.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/react/document-field.tsx rename to docs/snippets/document-field/_templates/react/document-field.tsx.tmpl diff --git a/docs/snippets/document-field/_templates/react/field.tsx b/docs/snippets/document-field/_templates/react/field.tsx.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/react/field.tsx rename to docs/snippets/document-field/_templates/react/field.tsx.tmpl diff --git a/docs/snippets/document-field/_templates/react/form.tsx b/docs/snippets/document-field/_templates/react/form.tsx.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/react/form.tsx rename to docs/snippets/document-field/_templates/react/form.tsx.tmpl diff --git a/docs/snippets/document-field/_templates/react/mask.ts b/docs/snippets/document-field/_templates/react/mask.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/react/mask.ts rename to docs/snippets/document-field/_templates/react/mask.ts.tmpl diff --git a/docs/snippets/document-field/_templates/schema/arktype.ts b/docs/snippets/document-field/_templates/schema/arktype.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/schema/arktype.ts rename to docs/snippets/document-field/_templates/schema/arktype.ts.tmpl diff --git a/docs/snippets/document-field/_templates/schema/standard.ts b/docs/snippets/document-field/_templates/schema/standard.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/schema/standard.ts rename to docs/snippets/document-field/_templates/schema/standard.ts.tmpl diff --git a/docs/snippets/document-field/_templates/schema/valibot.ts b/docs/snippets/document-field/_templates/schema/valibot.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/schema/valibot.ts rename to docs/snippets/document-field/_templates/schema/valibot.ts.tmpl diff --git a/docs/snippets/document-field/_templates/schema/zod.ts b/docs/snippets/document-field/_templates/schema/zod.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/schema/zod.ts rename to docs/snippets/document-field/_templates/schema/zod.ts.tmpl diff --git a/docs/snippets/document-field/_templates/vanilla/field.html b/docs/snippets/document-field/_templates/vanilla/field.html.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/vanilla/field.html rename to docs/snippets/document-field/_templates/vanilla/field.html.tmpl diff --git a/docs/snippets/document-field/_templates/vue/document-field.vue b/docs/snippets/document-field/_templates/vue/document-field.vue.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/vue/document-field.vue rename to docs/snippets/document-field/_templates/vue/document-field.vue.tmpl diff --git a/docs/snippets/document-field/_templates/vue/field.vue b/docs/snippets/document-field/_templates/vue/field.vue.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/vue/field.vue rename to docs/snippets/document-field/_templates/vue/field.vue.tmpl diff --git a/docs/snippets/document-field/_templates/vue/form.vue b/docs/snippets/document-field/_templates/vue/form.vue.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/vue/form.vue rename to docs/snippets/document-field/_templates/vue/form.vue.tmpl diff --git a/docs/snippets/document-field/_templates/vue/mask.ts b/docs/snippets/document-field/_templates/vue/mask.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/vue/mask.ts rename to docs/snippets/document-field/_templates/vue/mask.ts.tmpl diff --git a/scripts/examples.ts b/scripts/examples.ts index b56568e4..317b271c 100644 --- a/scripts/examples.ts +++ b/scripts/examples.ts @@ -184,11 +184,15 @@ function values(document: Document): Record { } /** - * @param {string} name - A file of `docs/snippets/document-field/_templates`. + * A template carries `@@placeholder@@` markers, so it is not the language its name says it is: + * `schema/zod.ts` on its own does not parse as TypeScript. The extra `.tmpl` at the end keeps it + * out of every tool that walks the repository for `.ts`/`.tsx` files, the declaration build of the + * package included, while the extension before it still says what the filled in file will be. + * @param {string} name - A file of `docs/snippets/document-field/_templates`, without the `.tmpl`. * @returns {string} Its contents. */ function readTemplate(name: string): string { - return readFileSync(join(TEMPLATE_DIR, name), "utf8"); + return readFileSync(join(TEMPLATE_DIR, `${name}.tmpl`), "utf8"); } /** diff --git a/tsconfig.json b/tsconfig.json index dba30ea2..01499eb0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,9 @@ "noImplicitOverride": true }, // The documentation site is not part of the library: its examples are written for React, - // Angular and Vue, and the templates they are generated from are not valid TypeScript on their - // own. `npm run build:docs` and the type-check of each example live in the docs workflow. - "exclude": ["docs", "dist", "coverage", "reports", ".stryker-tmp"] + // Angular and Vue. `npm run build:docs` and the type-check of each example live in the docs + // workflow. `base` is the second checkout the Tree-shaking job of the build workflow writes + // there, a whole copy of the repository at the base revision of the pull request: the build + // running here compiles the head, never it. + "exclude": ["base", "docs", "dist", "coverage", "reports", ".stryker-tmp"] } From 090d73d68ae555188a1a7174dde6bb4f823015a7 Mon Sep 17 00:00:00 2001 From: Hyan Mandian <5044101+hyanmandian@users.noreply.github.com> Date: Tue, 22 Sep 2026 01:49:55 -0300 Subject: [PATCH 2/2] refactor(docs): the document field templates sit in a folder named for them The leading underscore of `_templates` said "not a page" next to the `_sidebar.md` and `_coverpage.md` docsify looks for, which the folder never was: nothing routes to it, the sitemap is built from the links of each `_sidebar.md` and `robots.txt` keeps crawlers out of `/snippets/` whatever sits under it. Now that a template is named `.tmpl`, the extension says what the file is and the folder can say where it belongs. The one walk over `docs/` that the folder name did reach is the Context7 index, which reads the folder list of `context7.json` rather than the site, so the templates are excluded there by name: an index of `@@placeholder@@` markers helps nobody. --- CONTRIBUTING.md | 2 +- context7.json | 2 +- .../angular/document-field.ts.tmpl | 0 .../{_templates => templates}/angular/field.ts.tmpl | 0 .../{_templates => templates}/angular/form.ts.tmpl | 0 .../{_templates => templates}/angular/mask.ts.tmpl | 0 .../{_templates => templates}/mask-body.ts.tmpl | 0 .../{_templates => templates}/react/document-field.tsx.tmpl | 0 .../{_templates => templates}/react/field.tsx.tmpl | 0 .../{_templates => templates}/react/form.tsx.tmpl | 0 .../{_templates => templates}/react/mask.ts.tmpl | 0 .../{_templates => templates}/schema/arktype.ts.tmpl | 0 .../{_templates => templates}/schema/standard.ts.tmpl | 0 .../{_templates => templates}/schema/valibot.ts.tmpl | 0 .../{_templates => templates}/schema/zod.ts.tmpl | 0 .../{_templates => templates}/vanilla/field.html.tmpl | 0 .../{_templates => templates}/vue/document-field.vue.tmpl | 0 .../{_templates => templates}/vue/field.vue.tmpl | 0 .../{_templates => templates}/vue/form.vue.tmpl | 0 .../{_templates => templates}/vue/mask.ts.tmpl | 0 scripts/examples.ts | 6 +++--- 21 files changed, 5 insertions(+), 5 deletions(-) rename docs/snippets/document-field/{_templates => templates}/angular/document-field.ts.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/angular/field.ts.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/angular/form.ts.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/angular/mask.ts.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/mask-body.ts.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/react/document-field.tsx.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/react/field.tsx.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/react/form.tsx.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/react/mask.ts.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/schema/arktype.ts.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/schema/standard.ts.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/schema/valibot.ts.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/schema/zod.ts.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/vanilla/field.html.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/vue/document-field.vue.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/vue/field.vue.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/vue/form.vue.tmpl (100%) rename docs/snippets/document-field/{_templates => templates}/vue/mask.ts.tmpl (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a01365ac..23444fa3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -387,7 +387,7 @@ browser, with `_sidebar.md`, `_navbar.md` and `_coverpage.md` as its navigation. the files to compile in its query string and `run.js` compiles them in the browser. The demos take their look from `docs/snippets/styles.css`. - The examples of the document field page are generated: `npm run build:examples` - (`scripts/examples.ts`) fills the templates of `docs/snippets/document-field/_templates` from a + (`scripts/examples.ts`) fills the templates of `docs/snippets/document-field/templates` from a table of documents, so the shared mask is written once. Edit a template or the table: the files under `generated/` are written by the build and are not in the repository. A template ends in `.tmpl` (`schema/zod.ts.tmpl`) because its `@@placeholder@@` markers do not parse as the language diff --git a/context7.json b/context7.json index 252f42c7..919ebd83 100644 --- a/context7.json +++ b/context7.json @@ -5,7 +5,7 @@ "projectTitle": "Brazilian Utils", "description": "Zero-dependency, tree-shakeable utilities for Brazilian data: validate, format, parse and generate CPF, CNPJ, CEP, boleto, Pix, holidays and more.", "folders": ["docs"], - "excludeFolders": ["docs/pt-br"], + "excludeFolders": ["docs/pt-br", "docs/snippets/document-field/templates"], "excludeFiles": [ "CHANGELOG.md", "CODE_OF_CONDUCT.md", diff --git a/docs/snippets/document-field/_templates/angular/document-field.ts.tmpl b/docs/snippets/document-field/templates/angular/document-field.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/angular/document-field.ts.tmpl rename to docs/snippets/document-field/templates/angular/document-field.ts.tmpl diff --git a/docs/snippets/document-field/_templates/angular/field.ts.tmpl b/docs/snippets/document-field/templates/angular/field.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/angular/field.ts.tmpl rename to docs/snippets/document-field/templates/angular/field.ts.tmpl diff --git a/docs/snippets/document-field/_templates/angular/form.ts.tmpl b/docs/snippets/document-field/templates/angular/form.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/angular/form.ts.tmpl rename to docs/snippets/document-field/templates/angular/form.ts.tmpl diff --git a/docs/snippets/document-field/_templates/angular/mask.ts.tmpl b/docs/snippets/document-field/templates/angular/mask.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/angular/mask.ts.tmpl rename to docs/snippets/document-field/templates/angular/mask.ts.tmpl diff --git a/docs/snippets/document-field/_templates/mask-body.ts.tmpl b/docs/snippets/document-field/templates/mask-body.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/mask-body.ts.tmpl rename to docs/snippets/document-field/templates/mask-body.ts.tmpl diff --git a/docs/snippets/document-field/_templates/react/document-field.tsx.tmpl b/docs/snippets/document-field/templates/react/document-field.tsx.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/react/document-field.tsx.tmpl rename to docs/snippets/document-field/templates/react/document-field.tsx.tmpl diff --git a/docs/snippets/document-field/_templates/react/field.tsx.tmpl b/docs/snippets/document-field/templates/react/field.tsx.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/react/field.tsx.tmpl rename to docs/snippets/document-field/templates/react/field.tsx.tmpl diff --git a/docs/snippets/document-field/_templates/react/form.tsx.tmpl b/docs/snippets/document-field/templates/react/form.tsx.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/react/form.tsx.tmpl rename to docs/snippets/document-field/templates/react/form.tsx.tmpl diff --git a/docs/snippets/document-field/_templates/react/mask.ts.tmpl b/docs/snippets/document-field/templates/react/mask.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/react/mask.ts.tmpl rename to docs/snippets/document-field/templates/react/mask.ts.tmpl diff --git a/docs/snippets/document-field/_templates/schema/arktype.ts.tmpl b/docs/snippets/document-field/templates/schema/arktype.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/schema/arktype.ts.tmpl rename to docs/snippets/document-field/templates/schema/arktype.ts.tmpl diff --git a/docs/snippets/document-field/_templates/schema/standard.ts.tmpl b/docs/snippets/document-field/templates/schema/standard.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/schema/standard.ts.tmpl rename to docs/snippets/document-field/templates/schema/standard.ts.tmpl diff --git a/docs/snippets/document-field/_templates/schema/valibot.ts.tmpl b/docs/snippets/document-field/templates/schema/valibot.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/schema/valibot.ts.tmpl rename to docs/snippets/document-field/templates/schema/valibot.ts.tmpl diff --git a/docs/snippets/document-field/_templates/schema/zod.ts.tmpl b/docs/snippets/document-field/templates/schema/zod.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/schema/zod.ts.tmpl rename to docs/snippets/document-field/templates/schema/zod.ts.tmpl diff --git a/docs/snippets/document-field/_templates/vanilla/field.html.tmpl b/docs/snippets/document-field/templates/vanilla/field.html.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/vanilla/field.html.tmpl rename to docs/snippets/document-field/templates/vanilla/field.html.tmpl diff --git a/docs/snippets/document-field/_templates/vue/document-field.vue.tmpl b/docs/snippets/document-field/templates/vue/document-field.vue.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/vue/document-field.vue.tmpl rename to docs/snippets/document-field/templates/vue/document-field.vue.tmpl diff --git a/docs/snippets/document-field/_templates/vue/field.vue.tmpl b/docs/snippets/document-field/templates/vue/field.vue.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/vue/field.vue.tmpl rename to docs/snippets/document-field/templates/vue/field.vue.tmpl diff --git a/docs/snippets/document-field/_templates/vue/form.vue.tmpl b/docs/snippets/document-field/templates/vue/form.vue.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/vue/form.vue.tmpl rename to docs/snippets/document-field/templates/vue/form.vue.tmpl diff --git a/docs/snippets/document-field/_templates/vue/mask.ts.tmpl b/docs/snippets/document-field/templates/vue/mask.ts.tmpl similarity index 100% rename from docs/snippets/document-field/_templates/vue/mask.ts.tmpl rename to docs/snippets/document-field/templates/vue/mask.ts.tmpl diff --git a/scripts/examples.ts b/scripts/examples.ts index 317b271c..2cdbb56b 100644 --- a/scripts/examples.ts +++ b/scripts/examples.ts @@ -4,7 +4,7 @@ * Writes the examples the document field guide shows (`docs/guides/document-field.md`): one * focused example per document and framework, so a reader copies the CPF field, not a generic one * that has to be narrowed down first. Every file comes from a template in - * `docs/snippets/document-field/_templates`, filled in from the table below, together with the + * `docs/snippets/document-field/templates`, filled in from the table below, together with the * `mask` function they share. One page runs them all in the browser, `docs/snippets/live`, told * which files to compile by its query string. The Check workflow fails when these are stale. * @@ -17,7 +17,7 @@ import { join } from "node:path"; const ROOT = join(import.meta.dirname, ".."); const EXAMPLE_DIR = join(ROOT, "docs", "snippets", "document-field"); -const TEMPLATE_DIR = join(EXAMPLE_DIR, "_templates"); +const TEMPLATE_DIR = join(EXAMPLE_DIR, "templates"); type Document = { /** The kebab-case name of the document, which names its folder and its files. */ @@ -188,7 +188,7 @@ function values(document: Document): Record { * `schema/zod.ts` on its own does not parse as TypeScript. The extra `.tmpl` at the end keeps it * out of every tool that walks the repository for `.ts`/`.tsx` files, the declaration build of the * package included, while the extension before it still says what the filled in file will be. - * @param {string} name - A file of `docs/snippets/document-field/_templates`, without the `.tmpl`. + * @param {string} name - A file of `docs/snippets/document-field/templates`, without the `.tmpl`. * @returns {string} Its contents. */ function readTemplate(name: string): string {