@dpuse/dpuse-development 0.3.799 → 0.3.800

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.
@@ -0,0 +1,16 @@
1
+ # Version-update pull requests are switched off (limit 0): dependencies are updated with 'npm run check' and
2
+ # 'cargo update' instead. The file is kept because OpenSSF Scorecard looks for it when checking that a dependency update
3
+ # tool is used.
4
+ version: 2
5
+ updates:
6
+ - package-ecosystem: npm
7
+ directory: /
8
+ schedule:
9
+ interval: weekly
10
+ open-pull-requests-limit: 0
11
+
12
+ - package-ecosystem: cargo
13
+ directory: /rust
14
+ schedule:
15
+ interval: weekly
16
+ open-pull-requests-limit: 0
@@ -0,0 +1,22 @@
1
+ # Version-update pull requests are switched off (limit 0): dependencies are updated with 'npm run check' and
2
+ # 'cargo update' instead. The file is kept because OpenSSF Scorecard looks for it when checking that a dependency update
3
+ # tool is used.
4
+ version: 2
5
+ updates:
6
+ - package-ecosystem: npm
7
+ directory: /
8
+ schedule:
9
+ interval: weekly
10
+ open-pull-requests-limit: 0
11
+
12
+ - package-ecosystem: github-actions
13
+ directory: /
14
+ schedule:
15
+ interval: weekly
16
+ open-pull-requests-limit: 0
17
+
18
+ - package-ecosystem: cargo
19
+ directory: /rust
20
+ schedule:
21
+ interval: weekly
22
+ open-pull-requests-limit: 0
@@ -48,6 +48,18 @@ jobs:
48
48
  node-version: 24
49
49
  cache: npm
50
50
 
51
+ # Only in projects with Rust code. Unpacked from a download checked against a pinned hash, as npm is above. Rust
52
+ # itself needs no step: the runner's 'rustup' installs the version 'rust-toolchain.toml' names on the first build.
53
+ # When changing the version, update the URL and take the new hash from the release's list of files on GitHub.
54
+ - name: Setup wasm-pack
55
+ if: hashFiles('rust/Cargo.toml') != ''
56
+ run: |
57
+ curl --proto '=https' -fsSLo wasm-pack.tgz https://github.com/wasm-bindgen/wasm-pack/releases/download/v0.15.0/wasm-pack-v0.15.0-x86_64-unknown-linux-musl.tar.gz
58
+ echo "c09f971ecaed9a2efc80fdcea7a00ef6b53c7fadc8c57d1f61b53a6aa66b668a wasm-pack.tgz" | sha256sum -c -
59
+ tar -xzf wasm-pack.tgz -C "$HOME/.cargo/bin" --strip-components=1 wasm-pack-v0.15.0-x86_64-unknown-linux-musl/wasm-pack
60
+ wasm-pack --version
61
+ working-directory: ${{ runner.temp }}
62
+
51
63
  - name: Install dependencies
52
64
  run: npm ci --ignore-scripts
53
65
 
@@ -27,12 +27,17 @@ jobs:
27
27
  build-mode: none
28
28
  - language: javascript-typescript
29
29
  build-mode: none
30
+ - language: rust
31
+ build-mode: none
30
32
 
31
33
  steps:
32
34
  - name: Checkout repository
33
35
  uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
34
36
 
37
+ # CodeQL fails when asked to scan a language the project has no code in, so the Rust scan is skipped in projects
38
+ # without Rust. Its job still appears in those projects, but does nothing.
35
39
  - name: Initialize CodeQL
40
+ if: matrix.language != 'rust' || hashFiles('rust/Cargo.toml') != ''
36
41
  uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
37
42
  with:
38
43
  languages: ${{ matrix.language }}
@@ -42,6 +47,7 @@ jobs:
42
47
  queries: security-extended
43
48
 
44
49
  - name: Perform CodeQL Analysis
50
+ if: matrix.language != 'rust' || hashFiles('rust/Cargo.toml') != ''
45
51
  uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
46
52
  with:
47
53
  category: '/language:${{matrix.language}}'
@@ -10,7 +10,7 @@ permissions:
10
10
 
11
11
  jobs:
12
12
  publish:
13
- name: Publish to npm
13
+ name: Publish
14
14
  runs-on: ubuntu-latest
15
15
  steps:
16
16
  - name: Checkout
@@ -48,6 +48,18 @@ jobs:
48
48
  cache: npm
49
49
  registry-url: https://registry.npmjs.org
50
50
 
51
+ # Only in projects with Rust code. Unpacked from a download checked against a pinned hash, as npm is above. Rust
52
+ # itself needs no step: the runner's 'rustup' installs the version 'rust-toolchain.toml' names on the first build.
53
+ # When changing the version, update the URL and take the new hash from the release's list of files on GitHub.
54
+ - name: Setup wasm-pack
55
+ if: hashFiles('rust/Cargo.toml') != ''
56
+ run: |
57
+ curl --proto '=https' -fsSLo wasm-pack.tgz https://github.com/wasm-bindgen/wasm-pack/releases/download/v0.15.0/wasm-pack-v0.15.0-x86_64-unknown-linux-musl.tar.gz
58
+ echo "c09f971ecaed9a2efc80fdcea7a00ef6b53c7fadc8c57d1f61b53a6aa66b668a wasm-pack.tgz" | sha256sum -c -
59
+ tar -xzf wasm-pack.tgz -C "$HOME/.cargo/bin" --strip-components=1 wasm-pack-v0.15.0-x86_64-unknown-linux-musl/wasm-pack
60
+ wasm-pack --version
61
+ working-directory: ${{ runner.temp }}
62
+
51
63
  - name: Install dependencies
52
64
  run: npm ci --ignore-scripts
53
65
 
@@ -62,5 +74,11 @@ jobs:
62
74
  - name: Test
63
75
  run: npm test
64
76
 
77
+ # One step for every project: the action publishes to npm, uploads to DPUse, or both, as the module type requires.
78
+ # Called directly rather than through a package.json script, as a script named 'publish' would be run again by
79
+ # 'npm publish' itself.
65
80
  - name: Publish
66
- run: npm publish --provenance
81
+ run: node -e "import('@dpuse/dpuse-development').then(m => m.publishProject())"
82
+ env:
83
+ CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
84
+ CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
package/README.md CHANGED
@@ -79,37 +79,37 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
79
79
 
80
80
  | Chunk/Module/File | Composition |
81
81
  | :----------------------------------------------------------------------------- | :--------------------------- |
82
- | dist/dpuse-development.es.js | 45.6 kB · gzip 14.6 kB |
83
- |     src | `██████████░░░░░░░░░░` 51.8% |
82
+ | dist/dpuse-development.es.js | 46.0 kB · gzip 14.8 kB |
83
+ |     src | `██████████░░░░░░░░░░` 51.9% |
84
84
  |         documentQualitySecurity.ts | `███░░░░░░░░░░░░░░░░░` 12.9% |
85
85
  |         documentDependencies.ts | `██░░░░░░░░░░░░░░░░░░` 7.9% |
86
86
  |         documentBundleSizes.ts | `█░░░░░░░░░░░░░░░░░░░` 5.7% |
87
- |         checkConfigFiles.ts | `█░░░░░░░░░░░░░░░░░░░` 4.9% |
88
- |         documentUsage.ts | `█░░░░░░░░░░░░░░░░░░░` 3.6% |
87
+ |         checkConfigFiles.ts | `█░░░░░░░░░░░░░░░░░░░` 4.8% |
88
+ |         documentUsage.ts | `█░░░░░░░░░░░░░░░░░░░` 3.5% |
89
89
  |         documentActions.ts | `░░░░░░░░░░░░░░░░░░░░` 2.3% |
90
90
  |         checkDependencies.ts | `░░░░░░░░░░░░░░░░░░░░` 2.2% |
91
91
  |         documentOpening.ts | `░░░░░░░░░░░░░░░░░░░░` 2.0% |
92
92
  |         cloudflare.ts | `░░░░░░░░░░░░░░░░░░░░` 2.0% |
93
93
  |         documentContributingLicense.ts | `░░░░░░░░░░░░░░░░░░░░` 1.6% |
94
- |         releaseProject.ts | `░░░░░░░░░░░░░░░░░░░░` 1.3% |
94
+ |         releaseProject.ts | `░░░░░░░░░░░░░░░░░░░░` 1.2% |
95
+ |         publishProject.ts | `░░░░░░░░░░░░░░░░░░░░` 1.1% |
95
96
  |         testProject.ts | `░░░░░░░░░░░░░░░░░░░░` 1.0% |
96
- |         publishProject.ts | `░░░░░░░░░░░░░░░░░░░░` 0.9% |
97
97
  |         documentProject.ts | `░░░░░░░░░░░░░░░░░░░░` 0.8% |
98
98
  |         syncProjectWithGitHub.ts | `░░░░░░░░░░░░░░░░░░░░` 0.8% |
99
99
  |         auditDependencies.ts | `░░░░░░░░░░░░░░░░░░░░` 0.5% |
100
+ |         buildProject.ts | `░░░░░░░░░░░░░░░░░░░░` 0.5% |
100
101
  |         formatCode.ts | `░░░░░░░░░░░░░░░░░░░░` 0.4% |
101
102
  |         documentApiReference.ts | `░░░░░░░░░░░░░░░░░░░░` 0.4% |
102
- |         buildProject.ts | `░░░░░░░░░░░░░░░░░░░░` 0.3% |
103
103
  |         lintCode.ts | `░░░░░░░░░░░░░░░░░░░░` 0.2% |
104
104
  |         checkProject.ts | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
105
105
  |     (bundler output, whitespace & JSON) | `██░░░░░░░░░░░░░░░░░░` 7.9% |
106
- | dist/utilities-DxgaXApN.js | 22.4 kB · gzip 6.2 kB |
107
- |     @dpuse/dpuse-shared → dist/dpuse-shared.es.js | `███░░░░░░░░░░░░░░░░░` 15.4% |
106
+ | dist/utilities-Bo8LfncX.js | 22.4 kB · gzip 6.2 kB |
107
+ |     @dpuse/dpuse-shared → dist/dpuse-shared.es.js | `███░░░░░░░░░░░░░░░░░` 15.3% |
108
108
  |     src → index.ts | `██░░░░░░░░░░░░░░░░░░` 9.9% |
109
109
  |     (bundler output, whitespace & JSON) | `█░░░░░░░░░░░░░░░░░░░` 3.4% |
110
110
  |     valibot → dist/index.mjs | `░░░░░░░░░░░░░░░░░░░░` 0.5% |
111
- | dist/apiReference-DCzx5xFp.js | 8.4 kB · gzip 3.1 kB |
112
- |     src → apiReference.ts | `██░░░░░░░░░░░░░░░░░░` 10.5% |
111
+ | dist/apiReference-BazeHifT.js | 8.4 kB · gzip 3.1 kB |
112
+ |     src → apiReference.ts | `██░░░░░░░░░░░░░░░░░░` 10.4% |
113
113
  |     (bundler output, whitespace & JSON) | `░░░░░░░░░░░░░░░░░░░░` 0.5% |
114
114
 
115
115
  (bundler output, whitespace & JSON) = bytes Sonda can't trace to a source file: whitespace (indentation and line breaks), code the bundler generates (region comments, the combined import/export lines, its small runtime helper and wrappers), and imported JSON such as `config.json`, which the bundler doesn't map. The JSON and the generated code are real bytes that ship; the whitespace mostly disappears once compressed.
@@ -1,4 +1,4 @@
1
- import { D as e, _ as t, y as n } from "./utilities-DxgaXApN.js";
1
+ import { O as e, b as t, v as n } from "./utilities-Bo8LfncX.js";
2
2
  import r from "node:path";
3
3
  import i from "typescript";
4
4
  //#region src/utilities/apiReference.ts
@@ -10,8 +10,8 @@ var a = 3, o = "General", s = [
10
10
  "Types"
11
11
  ], c = "Every export, grouped by import path. This file is updated each time `npm run document` is run, and with each release.";
12
12
  async function l(a, o) {
13
- t(`${a} Write '${o}'`);
14
- let s = u(await n("package.json"));
13
+ n(`${a} Write '${o}'`);
14
+ let s = u(await t("package.json"));
15
15
  if (s.length === 0) throw Error("package.json 'exports' must name at least one import path with types to document the API reference.");
16
16
  let l = i.createProgram(s.map(({ sourcePath: e }) => r.resolve(e)), d()), p = l.getTypeChecker(), m = y(l, p), h = s.map(({ importPath: e, sourcePath: t }) => {
17
17
  let n = l.getSourceFile(r.resolve(t));
@@ -1 +1 @@
1
- {"version":3,"file":"apiReference-DCzx5xFp.js","names":[],"sources":["../src/utilities/apiReference.ts"],"sourcesContent":["// ── External Dependencies & Registrations\nimport type { PackageJson } from 'type-fest';\nimport path from 'node:path';\nimport ts from 'typescript';\n\n// ── Local Framework\nimport { logStepHeader, readJSONFile, writeTextFile } from '@/utilities';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\ninterface ExportEntry {\n description: string | undefined;\n detail: string; // What follows the name in code, such as a function's parameters or a constant's type.\n kind: ExportKind;\n name: string;\n origin: string;\n topic: string; // The folder the export is declared in, such as 'Component › Module › Connector'.\n}\n\ntype ExportKind = 'Classes' | 'Constants' | 'Functions' | 'Schemas' | 'Types';\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// An import path whose exports come from at least this many folders is listed by folder, so a package with one entry\n// point for everything still reads as topics rather than one long list.\nconst TOPIC_GROUPING_MINIMUM = 3;\n\n// Declared directly in the source folder, rather than in a topic folder within it.\nconst GENERAL_TOPIC = 'General';\n\n// In the order each import path's section lists them.\nconst EXPORT_KINDS: ExportKind[] = ['Functions', 'Classes', 'Constants', 'Schemas', 'Types'];\n\nconst API_REFERENCE_INTRO = 'Every export, grouped by import path. This file is updated each time `npm run document` is run, and with each release.';\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Lists the exports of each import path in package.json 'exports', read from the TypeScript source the path's types are\n// built from. Paths without types, such as a shared config file, are left out. This module is loaded only when the API\n// reference is written, as TypeScript is an optional peer.\nexport async function writeAPIReference(stepIcon: string, apiReferencePath: string): Promise<void> {\n logStepHeader(`${stepIcon} Write '${apiReferencePath}'`);\n\n const packageJSON = await readJSONFile<PackageJson>('package.json');\n const entryPoints = resolveEntryPoints(packageJSON);\n if (entryPoints.length === 0) throw new Error(\"package.json 'exports' must name at least one import path with types to document the API reference.\");\n\n // Absolute paths, as TypeScript keeps the working directory it first saw, so relative ones could resolve against a\n // folder the process has since left.\n const program = ts.createProgram(\n entryPoints.map(({ sourcePath }) => path.resolve(sourcePath)),\n readCompilerOptions()\n );\n const checker = program.getTypeChecker();\n const fieldGroupOwners = mapFieldGroupOwners(program, checker);\n\n const sections = entryPoints.map(({ importPath, sourcePath }) => {\n const sourceFile = program.getSourceFile(path.resolve(sourcePath));\n if (sourceFile === undefined) throw new Error(`Unable to read '${sourcePath}', the source of '${importPath}'.`);\n return buildSection(importPath, listExports(checker, sourceFile, fieldGroupOwners));\n });\n\n await writeTextFile(apiReferencePath, `# API Reference\\n\\n${API_REFERENCE_INTRO}\\n\\n${sections.join('\\n\\n')}\\n`);\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// The types path of each export, such as './dist/types/src/errors/index.d.ts', mirrors its source file\n// ('src/errors/index.ts'), so the source is found by stripping the output folder and swapping the extension.\nfunction resolveEntryPoints(packageJSON: PackageJson): { importPath: string; sourcePath: string }[] {\n const packageName = packageJSON.name ?? '';\n const exportsField = packageJSON.exports;\n const exportEntries = exportsField != null && typeof exportsField === 'object' && !Array.isArray(exportsField) ? Object.entries(exportsField) : [];\n\n return exportEntries.flatMap(([subpath, target]) => {\n const typesPath = target != null && typeof target === 'object' && !Array.isArray(target) ? target['types'] : undefined;\n if (typeof typesPath !== 'string') return [];\n const importPath = subpath === '.' ? packageName : `${packageName}${subpath.slice(1)}`;\n const sourcePath = typesPath.replace(/^\\.\\/dist\\/types\\//, '').replace(/\\.d\\.ts$/, '.ts');\n return [{ importPath, sourcePath }];\n });\n}\n\n// Uses the project's own tsconfig, so '@/' and other path aliases resolve as they do in the build.\nfunction readCompilerOptions(): ts.CompilerOptions {\n const configPath = ts.findConfigFile(process.cwd(), (fileName) => ts.sys.fileExists(fileName));\n if (configPath === undefined) return { module: ts.ModuleKind.ESNext, moduleResolution: ts.ModuleResolutionKind.Bundler, target: ts.ScriptTarget.ESNext };\n\n const { config } = ts.readConfigFile(configPath, (fileName) => ts.sys.readFile(fileName)) as { config: unknown };\n return ts.parseJsonConfigFileContent(config, ts.sys, process.cwd()).options;\n}\n\nfunction listExports(checker: ts.TypeChecker, sourceFile: ts.SourceFile, fieldGroupOwners: Map<ts.ObjectLiteralExpression, string>): ExportEntry[] {\n const moduleSymbol = checker.getSymbolAtLocation(sourceFile);\n const exportedSymbols = moduleSymbol === undefined ? [] : checker.getExportsOfModule(moduleSymbol);\n\n const entries = exportedSymbols.flatMap((exportedSymbol) => {\n const symbol = resolveAlias(checker, exportedSymbol);\n const entry = describeExport(checker, formatExportName(exportedSymbol, symbol), symbol, fieldGroupOwners);\n return entry === undefined ? [] : [{ ...entry, description: readDescription(checker, symbol), topic: readTopic(symbol) }];\n });\n return entries.toSorted((a, b) => a.name.localeCompare(b.name));\n}\n\n// Named from the folders between 'src' and the file declaring the export: 'component/module/connector' reads as\n// 'Component › Module › Connector', with camel-case names split into words.\nfunction readTopic(symbol: ts.Symbol): string {\n const fileName = symbol.declarations?.[0]?.getSourceFile().fileName;\n if (fileName === undefined) return GENERAL_TOPIC;\n\n // TypeScript reports files with symbolic links resolved (on macOS, '/var' is really '/private/var'), so the source\n // folder is resolved the same way before the two are compared.\n const resolvePath = (unresolvedPath: string): string => ts.sys.realpath?.(unresolvedPath) ?? unresolvedPath;\n const folder = path.relative(resolvePath(path.join(process.cwd(), 'src')), resolvePath(path.dirname(fileName)));\n return folder === '' || folder.startsWith('..')\n ? GENERAL_TOPIC\n : folder\n .split(path.sep)\n .map((segment) => segment.replaceAll(/([a-z])([A-Z])/g, '$1 $2').replace(/^./, (letter) => letter.toUpperCase()))\n .join(' › ');\n}\n\n// Functions include constants holding a function, as with arrow functions. Schemas are the constants named '…Schema'.\nfunction describeExport(\n checker: ts.TypeChecker,\n name: string,\n symbol: ts.Symbol,\n fieldGroupOwners: Map<ts.ObjectLiteralExpression, string>\n): Omit<ExportEntry, 'description' | 'topic'> | undefined {\n const isValue = (symbol.flags & (ts.SymbolFlags.Function | ts.SymbolFlags.Variable)) !== 0;\n const [signature] = isValue ? checker.getSignaturesOfType(checker.getTypeOfSymbol(symbol), ts.SignatureKind.Call) : [];\n const isSchema = name.endsWith('Schema');\n\n if (signature !== undefined && !isSchema) {\n const parameters = signature.parameters.map((parameter) => formatParameter(checker, parameter));\n return { detail: `(${parameters.join(', ')})`, kind: 'Functions', name, origin: '' };\n }\n if ((symbol.flags & ts.SymbolFlags.Class) !== 0) return { detail: '', kind: 'Classes', name, origin: formatOrigin(checker, symbol, fieldGroupOwners) };\n if (isSchema && (symbol.flags & ts.SymbolFlags.Variable) !== 0) return { detail: '', kind: 'Schemas', name, origin: '' };\n if ((symbol.flags & ts.SymbolFlags.Variable) !== 0) return { detail: `: ${formatConstantType(checker, symbol)}`, kind: 'Constants', name, origin: '' };\n const isType = (symbol.flags & (ts.SymbolFlags.Enum | ts.SymbolFlags.Interface | ts.SymbolFlags.TypeAlias)) !== 0;\n return isType ? { detail: '', kind: 'Types', name, origin: formatOrigin(checker, symbol, fieldGroupOwners) } : undefined;\n}\n\n// The summary of the '/** … */' comment above the item, on one line. Tags such as '@param' are left out, and '//'\n// comments, which are notes for maintainers, are never read.\nfunction readDescription(checker: ts.TypeChecker, symbol: ts.Symbol): string | undefined {\n const description = ts.displayPartsToString(symbol.getDocumentationComment(checker)).replaceAll(/\\s+/g, ' ').trim();\n return description === '' ? undefined : description;\n}\n\n// The type as written, on the declaration or in an 'as' on its value, which keeps the names it was written with. Where\n// none is written, the inferred type is widened, so 'MAX_COUNT = 3' reads as 'number' rather than '3'.\nfunction formatConstantType(checker: ts.TypeChecker, symbol: ts.Symbol): string {\n const declaration = symbol.valueDeclaration;\n const variableDeclaration = declaration !== undefined && ts.isVariableDeclaration(declaration) ? declaration : undefined;\n const initializer = variableDeclaration?.initializer;\n const isWrittenAs = initializer !== undefined && ts.isAsExpression(initializer) && !ts.isConstTypeReference(initializer.type); // 'as const' names no type.\n const typeNode = variableDeclaration?.type ?? (isWrittenAs ? initializer.type : undefined);\n return typeNode === undefined ? checker.typeToString(checker.getBaseTypeOfLiteralType(checker.getTypeOfSymbol(symbol)), declaration) : formatTypeNode(typeNode);\n}\n\n// What a type or class comes from: the schema it is inferred from, and what it extends or implements, such as\n// ' (extends DPUseError)'. A type inferred from a schema has no 'extends' clause, so its parent is found from the schema\n// instead. The parent is named even when it is not exported, as it is still what the type inherits from.\nfunction formatOrigin(checker: ts.TypeChecker, symbol: ts.Symbol, fieldGroupOwners: Map<ts.ObjectLiteralExpression, string>): string {\n const heritageClauses = (symbol.declarations ?? []).flatMap((declaration) =>\n ts.isClassDeclaration(declaration) || ts.isInterfaceDeclaration(declaration) ? [...(declaration.heritageClauses ?? [])] : []\n );\n const clauses = heritageClauses.map((clause) => {\n const keyword = clause.token === ts.SyntaxKind.ExtendsKeyword ? 'extends' : 'implements';\n return `${keyword} ${clause.types.map((type) => formatCode(formatTypeNode(type))).join(', ')}`;\n });\n\n const typeAlias = symbol.declarations?.find((declaration) => ts.isTypeAliasDeclaration(declaration));\n const schemaName = typeAlias === undefined ? undefined : findSchemaName(typeAlias);\n if (typeAlias !== undefined && schemaName !== undefined) {\n clauses.push(`inferred from ${formatCode(schemaName.getText())}`);\n const fields = findSchemaFields(checker, typeAlias);\n const parents = fields === undefined ? [] : findSchemaParents(checker, fields, typeAlias.name.text, fieldGroupOwners);\n if (parents.length > 0) clauses.push(`extends ${parents.map((parent) => formatCode(parent)).join(', ')}`);\n }\n return clauses.length === 0 ? '' : ` (${clauses.join(', ')})`;\n}\n\n// A schema inherits by spreading in a group of fields, as in 'strictObject({ ...moduleConfigCoreFields, … })'. Where\n// the type owns the group it spreads, as 'ModuleConfig' owns 'moduleConfigCoreFields', its parent is found in that\n// group's own spreads.\nfunction findSchemaParents(checker: ts.TypeChecker, fields: ts.ObjectLiteralExpression, typeName: string, fieldGroupOwners: Map<ts.ObjectLiteralExpression, string>): string[] {\n return fields.properties.flatMap((property) => {\n const group = ts.isSpreadAssignment(property) ? resolveObjectLiteral(checker, property.expression) : undefined;\n if (group === undefined) return [];\n const owner = fieldGroupOwners.get(group);\n if (owner === typeName) return findSchemaParents(checker, group, typeName, fieldGroupOwners);\n return owner === undefined ? [] : [owner];\n });\n}\n\n// A field group is not a type, so it is named by the type whose schema adds the fewest fields to it. Where two types\n// tie, the group is left unnamed rather than guessed at.\nfunction mapFieldGroupOwners(program: ts.Program, checker: ts.TypeChecker): Map<ts.ObjectLiteralExpression, string> {\n const candidates = new Map<ts.ObjectLiteralExpression, { addedFieldCount: number; typeName: string }[]>();\n const typeAliases = program\n .getSourceFiles()\n .filter((sourceFile) => !sourceFile.isDeclarationFile && !program.isSourceFileFromExternalLibrary(sourceFile))\n .flatMap((sourceFile) => sourceFile.statements.filter((statement) => ts.isTypeAliasDeclaration(statement)));\n\n for (const typeAlias of typeAliases) {\n for (const { addedFieldCount, group } of listFieldGroups(checker, typeAlias)) {\n candidates.set(group, [...(candidates.get(group) ?? []), { addedFieldCount, typeName: typeAlias.name.text }]);\n }\n }\n\n const owners = new Map<ts.ObjectLiteralExpression, string>();\n for (const [group, groupCandidates] of candidates) {\n const fewestAdded = Math.min(...groupCandidates.map(({ addedFieldCount }) => addedFieldCount));\n const [owner, ...tied] = groupCandidates.filter(({ addedFieldCount }) => addedFieldCount === fewestAdded);\n if (owner !== undefined && tied.length === 0) owners.set(group, owner.typeName);\n }\n return owners;\n}\n\n// Each field group a type's schema is built from, with the number of fields the schema adds to it.\nfunction listFieldGroups(checker: ts.TypeChecker, typeAlias: ts.TypeAliasDeclaration): { addedFieldCount: number; group: ts.ObjectLiteralExpression }[] {\n const fields = findSchemaFields(checker, typeAlias);\n if (fields === undefined) return [];\n\n // Fields declared under a name of their own, rather than written inside the schema, are a group themselves.\n const ownGroup = ts.isVariableDeclaration(fields.parent) ? [{ addedFieldCount: 0, group: fields }] : [];\n const spreadGroups = fields.properties.flatMap((property) => {\n const group = ts.isSpreadAssignment(property) ? resolveObjectLiteral(checker, property.expression) : undefined;\n return group === undefined ? [] : [{ addedFieldCount: fields.properties.length - 1, group }];\n });\n return [...ownGroup, ...spreadGroups];\n}\n\n// The schema a type is inferred from, written either as 'InferOutput<typeof schema>' or, where the schema is built in\n// place from a group of fields, as 'InferOutput<ReturnType<typeof strictObject<typeof fields>>>'.\nfunction findSchemaName(typeAlias: ts.TypeAliasDeclaration): ts.EntityName | undefined {\n const [argument] = isTypeReferenceNamed(typeAlias.type, 'InferOutput') ? (typeAlias.type.typeArguments ?? []) : [];\n if (argument === undefined) return undefined;\n if (ts.isTypeQueryNode(argument)) return argument.exprName;\n\n const [returnTypeArgument] = isTypeReferenceNamed(argument, 'ReturnType') ? (argument.typeArguments ?? []) : [];\n const [fieldsQuery] = returnTypeArgument !== undefined && ts.isTypeQueryNode(returnTypeArgument) ? (returnTypeArgument.typeArguments ?? []) : [];\n return fieldsQuery !== undefined && ts.isTypeQueryNode(fieldsQuery) ? fieldsQuery.exprName : undefined;\n}\n\n// The fields of the schema a type is inferred from: those passed to 'strictObject({ … })', or the group of fields itself.\nfunction findSchemaFields(checker: ts.TypeChecker, typeAlias: ts.TypeAliasDeclaration): ts.ObjectLiteralExpression | undefined {\n const schemaName = findSchemaName(typeAlias);\n const schema = schemaName === undefined ? undefined : resolveInitializer(checker, schemaName);\n if (schema === undefined) return undefined;\n if (ts.isObjectLiteralExpression(schema)) return schema;\n\n const [fields] = ts.isCallExpression(schema) ? schema.arguments : [];\n return fields === undefined ? undefined : resolveObjectLiteral(checker, fields);\n}\n\nfunction isTypeReferenceNamed(node: ts.TypeNode, name: string): node is ts.TypeReferenceNode {\n if (!ts.isTypeReferenceNode(node)) return false;\n const typeName = ts.isQualifiedName(node.typeName) ? node.typeName.right : node.typeName;\n return typeName.text === name;\n}\n\nfunction resolveObjectLiteral(checker: ts.TypeChecker, node: ts.Node): ts.ObjectLiteralExpression | undefined {\n if (ts.isObjectLiteralExpression(node)) return node;\n const initializer = resolveInitializer(checker, node);\n return initializer !== undefined && ts.isObjectLiteralExpression(initializer) ? initializer : undefined;\n}\n\n// The value a name was declared with, following imports back to the declaration.\nfunction resolveInitializer(checker: ts.TypeChecker, name: ts.Node): ts.Expression | undefined {\n const symbol = checker.getSymbolAtLocation(name);\n const declaration = symbol === undefined ? undefined : resolveAlias(checker, symbol).valueDeclaration;\n return declaration !== undefined && ts.isVariableDeclaration(declaration) ? declaration.initializer : undefined;\n}\n\nfunction resolveAlias(checker: ts.TypeChecker, symbol: ts.Symbol): ts.Symbol {\n return (symbol.flags & ts.SymbolFlags.Alias) === 0 ? symbol : checker.getAliasedSymbol(symbol);\n}\n\n// A default export is imported under any name, so the name it has where it is declared is shown alongside.\nfunction formatExportName(exportedSymbol: ts.Symbol, symbol: ts.Symbol): string {\n if (exportedSymbol.name !== 'default') return exportedSymbol.name;\n const declarationName = symbol.declarations?.map((declaration) => ts.getNameOfDeclaration(declaration)?.getText()).find((name) => name !== undefined);\n return declarationName === undefined || declarationName === 'default' ? 'default' : `default (${declarationName})`;\n}\n\n// A parameter that can be left out, being optional or having a default, is marked with '?'. Its type is as written, or\n// inferred where none is, as with a default value.\nfunction formatParameter(checker: ts.TypeChecker, parameter: ts.Symbol): string {\n const declaration = parameter.valueDeclaration;\n const parameterDeclaration = declaration !== undefined && ts.isParameter(declaration) ? declaration : undefined;\n const isOptional = parameterDeclaration?.questionToken !== undefined || parameterDeclaration?.initializer !== undefined;\n const typeText = parameterDeclaration?.type === undefined ? checker.typeToString(checker.getTypeOfSymbol(parameter), declaration) : formatTypeNode(parameterDeclaration.type);\n const name = parameterDeclaration === undefined ? parameter.name : formatParameterName(parameterDeclaration.name);\n return `${name}${isOptional ? '?' : ''}: ${typeText}`;\n}\n\n// A destructured parameter has no name of its own, so TypeScript calls it '__0'. It is shown by the names it unpacks\n// instead, as '{ allowedLicenses, moduleLevel }', leaving out their defaults.\nfunction formatParameterName(name: ts.BindingName): string {\n if (ts.isIdentifier(name)) return name.text;\n const names = name.elements.flatMap((element) =>\n ts.isBindingElement(element) ? [(element.dotDotDotToken === undefined ? '' : '...') + formatParameterName(element.name)] : []\n );\n return ts.isObjectBindingPattern(name) ? `{ ${names.join(', ')} }` : `[${names.join(', ')}]`;\n}\n\n// A type written across several lines is shown on one.\nfunction formatTypeNode(typeNode: ts.TypeNode): string {\n return typeNode.getText().replaceAll(/\\s+/g, ' ');\n}\n\nfunction buildSection(importPath: string, entries: ExportEntry[]): string {\n const topics = [...new Set(entries.map((entry) => entry.topic))].toSorted(compareTopics);\n if (topics.length < TOPIC_GROUPING_MINIMUM) return [`## ${importPath}`, ...buildKindLists(entries, '###')].join('\\n\\n');\n\n const topicSections = topics.map((topic) =>\n [\n `### ${topic}`,\n ...buildKindLists(\n entries.filter((entry) => entry.topic === topic),\n '####'\n )\n ].join('\\n\\n')\n );\n return [`## ${importPath}`, ...topicSections].join('\\n\\n');\n}\n\n// General comes first, as it holds what the whole package shares; the rest are alphabetical.\nfunction compareTopics(a: string, b: string): number {\n const isEitherGeneral = a === GENERAL_TOPIC || b === GENERAL_TOPIC;\n return isEitherGeneral ? Number(b === GENERAL_TOPIC) - Number(a === GENERAL_TOPIC) : a.localeCompare(b);\n}\n\nfunction buildKindLists(entries: ExportEntry[], headingLevel: string): string[] {\n return EXPORT_KINDS.flatMap((kind) => {\n const items = entries.filter((entry) => entry.kind === kind).map((entry) => formatEntry(entry));\n return items.length === 0 ? [] : [`${headingLevel} ${kind}\\n\\n${items.join('\\n')}`];\n });\n}\n\n// The name and what follows it are code, shown on a shaded background, with only the name bold so it stands out from\n// its parameters or type. The description is a quote nested in the item, which indents every line of it and shows it\n// in lighter text, so the names can be read straight down the left.\nfunction formatEntry({ description, detail, name, origin }: ExportEntry): string {\n const detailCode = detail === '' ? '' : formatCode(detail);\n const firstLine = `- **${formatCode(name)}**${detailCode}${origin}`;\n return description === undefined ? firstLine : `${firstLine}\\n > ${description}`;\n}\n\nfunction formatCode(text: string): string {\n return `\\`${text}\\``;\n}\n"],"mappings":";;;;AAyBA,IAAM,IAAyB,GAGzB,IAAgB,WAGhB,IAA6B;CAAC;CAAa;CAAW;CAAa;CAAW;AAAO,GAErF,IAAsB;AAO5B,eAAsB,EAAkB,GAAkB,GAAyC;CAC/F,EAAc,GAAG,EAAS,UAAU,EAAiB,EAAE;CAGvD,IAAM,IAAc,EAAmB,MADb,EAA0B,cAAc,CAChB;CAClD,IAAI,EAAY,WAAW,GAAG,MAAU,MAAM,qGAAqG;CAInJ,IAAM,IAAU,EAAG,cACf,EAAY,KAAK,EAAE,oBAAiB,EAAK,QAAQ,CAAU,CAAC,GAC5D,EAAoB,CACxB,GACM,IAAU,EAAQ,eAAe,GACjC,IAAmB,EAAoB,GAAS,CAAO,GAEvD,IAAW,EAAY,KAAK,EAAE,eAAY,oBAAiB;EAC7D,IAAM,IAAa,EAAQ,cAAc,EAAK,QAAQ,CAAU,CAAC;EACjE,IAAI,MAAe,KAAA,GAAW,MAAU,MAAM,mBAAmB,EAAW,oBAAoB,EAAW,GAAG;EAC9G,OAAO,EAAa,GAAY,EAAY,GAAS,GAAY,CAAgB,CAAC;CACtF,CAAC;CAED,MAAM,EAAc,GAAkB,sBAAsB,EAAoB,MAAM,EAAS,KAAK,MAAM,EAAE,GAAG;AACnH;AAMA,SAAS,EAAmB,GAAwE;CAChG,IAAM,IAAc,EAAY,QAAQ,IAClC,IAAe,EAAY;CAGjC,QAF8C,OAAO,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IAAS,CAAC,GAAG,IAAI,IAAI,EAAQ,KAAK,MAAU,EAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAa;CACvF,IAAI,EAAO,SAAS,GAAwB,OAAO,CAAC,MAAM,KAAc,GAAG,EAAe,GAAS,KAAK,CAAC,CAAC,CAAC,KAAK,MAAM;CAEtH,IAAM,IAAgB,EAAO,KAAK,MAC9B,CACI,OAAO,KACP,GAAG,EACC,EAAQ,QAAQ,MAAU,EAAM,UAAU,CAAK,GAC/C,MACJ,CACJ,CAAC,CAAC,KAAK,MAAM,CACjB;CACA,OAAO,CAAC,MAAM,KAAc,GAAG,CAAa,CAAC,CAAC,KAAK,MAAM;AAC7D;AAGA,SAAS,EAAc,GAAW,GAAmB;CAEjD,OADwB,MAAM,KAAiB,MAAM,IAC5B,OAAO,MAAM,CAAa,IAAI,OAAO,MAAM,CAAa,IAAI,EAAE,cAAc,CAAC;AAC1G;AAEA,SAAS,EAAe,GAAwB,GAAgC;CAC5E,OAAO,EAAa,SAAS,MAAS;EAClC,IAAM,IAAQ,EAAQ,QAAQ,MAAU,EAAM,SAAS,CAAI,CAAC,CAAC,KAAK,MAAU,EAAY,CAAK,CAAC;EAC9F,OAAO,EAAM,WAAW,IAAI,CAAC,IAAI,CAAC,GAAG,EAAa,GAAG,EAAK,MAAM,EAAM,KAAK,IAAI,GAAG;CACtF,CAAC;AACL;AAKA,SAAS,EAAY,EAAE,gBAAa,WAAQ,SAAM,aAA+B;CAC7E,IAAM,IAAa,MAAW,KAAK,KAAK,EAAW,CAAM,GACnD,IAAY,OAAO,EAAW,CAAI,EAAE,IAAI,IAAa;CAC3D,OAAO,MAAgB,KAAA,IAAY,IAAY,GAAG,EAAU,UAAU;AAC1E;AAEA,SAAS,EAAW,GAAsB;CACtC,OAAO,KAAK,EAAK;AACrB"}
1
+ {"version":3,"file":"apiReference-BazeHifT.js","names":[],"sources":["../src/utilities/apiReference.ts"],"sourcesContent":["// ── External Dependencies & Registrations\nimport type { PackageJson } from 'type-fest';\nimport path from 'node:path';\nimport ts from 'typescript';\n\n// ── Local Framework\nimport { logStepHeader, readJSONFile, writeTextFile } from '@/utilities';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\ninterface ExportEntry {\n description: string | undefined;\n detail: string; // What follows the name in code, such as a function's parameters or a constant's type.\n kind: ExportKind;\n name: string;\n origin: string;\n topic: string; // The folder the export is declared in, such as 'Component › Module › Connector'.\n}\n\ntype ExportKind = 'Classes' | 'Constants' | 'Functions' | 'Schemas' | 'Types';\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// An import path whose exports come from at least this many folders is listed by folder, so a package with one entry\n// point for everything still reads as topics rather than one long list.\nconst TOPIC_GROUPING_MINIMUM = 3;\n\n// Declared directly in the source folder, rather than in a topic folder within it.\nconst GENERAL_TOPIC = 'General';\n\n// In the order each import path's section lists them.\nconst EXPORT_KINDS: ExportKind[] = ['Functions', 'Classes', 'Constants', 'Schemas', 'Types'];\n\nconst API_REFERENCE_INTRO = 'Every export, grouped by import path. This file is updated each time `npm run document` is run, and with each release.';\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Lists the exports of each import path in package.json 'exports', read from the TypeScript source the path's types are\n// built from. Paths without types, such as a shared config file, are left out. This module is loaded only when the API\n// reference is written, as TypeScript is an optional peer.\nexport async function writeAPIReference(stepIcon: string, apiReferencePath: string): Promise<void> {\n logStepHeader(`${stepIcon} Write '${apiReferencePath}'`);\n\n const packageJSON = await readJSONFile<PackageJson>('package.json');\n const entryPoints = resolveEntryPoints(packageJSON);\n if (entryPoints.length === 0) throw new Error(\"package.json 'exports' must name at least one import path with types to document the API reference.\");\n\n // Absolute paths, as TypeScript keeps the working directory it first saw, so relative ones could resolve against a\n // folder the process has since left.\n const program = ts.createProgram(\n entryPoints.map(({ sourcePath }) => path.resolve(sourcePath)),\n readCompilerOptions()\n );\n const checker = program.getTypeChecker();\n const fieldGroupOwners = mapFieldGroupOwners(program, checker);\n\n const sections = entryPoints.map(({ importPath, sourcePath }) => {\n const sourceFile = program.getSourceFile(path.resolve(sourcePath));\n if (sourceFile === undefined) throw new Error(`Unable to read '${sourcePath}', the source of '${importPath}'.`);\n return buildSection(importPath, listExports(checker, sourceFile, fieldGroupOwners));\n });\n\n await writeTextFile(apiReferencePath, `# API Reference\\n\\n${API_REFERENCE_INTRO}\\n\\n${sections.join('\\n\\n')}\\n`);\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// The types path of each export, such as './dist/types/src/errors/index.d.ts', mirrors its source file\n// ('src/errors/index.ts'), so the source is found by stripping the output folder and swapping the extension.\nfunction resolveEntryPoints(packageJSON: PackageJson): { importPath: string; sourcePath: string }[] {\n const packageName = packageJSON.name ?? '';\n const exportsField = packageJSON.exports;\n const exportEntries = exportsField != null && typeof exportsField === 'object' && !Array.isArray(exportsField) ? Object.entries(exportsField) : [];\n\n return exportEntries.flatMap(([subpath, target]) => {\n const typesPath = target != null && typeof target === 'object' && !Array.isArray(target) ? target['types'] : undefined;\n if (typeof typesPath !== 'string') return [];\n const importPath = subpath === '.' ? packageName : `${packageName}${subpath.slice(1)}`;\n const sourcePath = typesPath.replace(/^\\.\\/dist\\/types\\//, '').replace(/\\.d\\.ts$/, '.ts');\n return [{ importPath, sourcePath }];\n });\n}\n\n// Uses the project's own tsconfig, so '@/' and other path aliases resolve as they do in the build.\nfunction readCompilerOptions(): ts.CompilerOptions {\n const configPath = ts.findConfigFile(process.cwd(), (fileName) => ts.sys.fileExists(fileName));\n if (configPath === undefined) return { module: ts.ModuleKind.ESNext, moduleResolution: ts.ModuleResolutionKind.Bundler, target: ts.ScriptTarget.ESNext };\n\n const { config } = ts.readConfigFile(configPath, (fileName) => ts.sys.readFile(fileName)) as { config: unknown };\n return ts.parseJsonConfigFileContent(config, ts.sys, process.cwd()).options;\n}\n\nfunction listExports(checker: ts.TypeChecker, sourceFile: ts.SourceFile, fieldGroupOwners: Map<ts.ObjectLiteralExpression, string>): ExportEntry[] {\n const moduleSymbol = checker.getSymbolAtLocation(sourceFile);\n const exportedSymbols = moduleSymbol === undefined ? [] : checker.getExportsOfModule(moduleSymbol);\n\n const entries = exportedSymbols.flatMap((exportedSymbol) => {\n const symbol = resolveAlias(checker, exportedSymbol);\n const entry = describeExport(checker, formatExportName(exportedSymbol, symbol), symbol, fieldGroupOwners);\n return entry === undefined ? [] : [{ ...entry, description: readDescription(checker, symbol), topic: readTopic(symbol) }];\n });\n return entries.toSorted((a, b) => a.name.localeCompare(b.name));\n}\n\n// Named from the folders between 'src' and the file declaring the export: 'component/module/connector' reads as\n// 'Component › Module › Connector', with camel-case names split into words.\nfunction readTopic(symbol: ts.Symbol): string {\n const fileName = symbol.declarations?.[0]?.getSourceFile().fileName;\n if (fileName === undefined) return GENERAL_TOPIC;\n\n // TypeScript reports files with symbolic links resolved (on macOS, '/var' is really '/private/var'), so the source\n // folder is resolved the same way before the two are compared.\n const resolvePath = (unresolvedPath: string): string => ts.sys.realpath?.(unresolvedPath) ?? unresolvedPath;\n const folder = path.relative(resolvePath(path.join(process.cwd(), 'src')), resolvePath(path.dirname(fileName)));\n return folder === '' || folder.startsWith('..')\n ? GENERAL_TOPIC\n : folder\n .split(path.sep)\n .map((segment) => segment.replaceAll(/([a-z])([A-Z])/g, '$1 $2').replace(/^./, (letter) => letter.toUpperCase()))\n .join(' › ');\n}\n\n// Functions include constants holding a function, as with arrow functions. Schemas are the constants named '…Schema'.\nfunction describeExport(\n checker: ts.TypeChecker,\n name: string,\n symbol: ts.Symbol,\n fieldGroupOwners: Map<ts.ObjectLiteralExpression, string>\n): Omit<ExportEntry, 'description' | 'topic'> | undefined {\n const isValue = (symbol.flags & (ts.SymbolFlags.Function | ts.SymbolFlags.Variable)) !== 0;\n const [signature] = isValue ? checker.getSignaturesOfType(checker.getTypeOfSymbol(symbol), ts.SignatureKind.Call) : [];\n const isSchema = name.endsWith('Schema');\n\n if (signature !== undefined && !isSchema) {\n const parameters = signature.parameters.map((parameter) => formatParameter(checker, parameter));\n return { detail: `(${parameters.join(', ')})`, kind: 'Functions', name, origin: '' };\n }\n if ((symbol.flags & ts.SymbolFlags.Class) !== 0) return { detail: '', kind: 'Classes', name, origin: formatOrigin(checker, symbol, fieldGroupOwners) };\n if (isSchema && (symbol.flags & ts.SymbolFlags.Variable) !== 0) return { detail: '', kind: 'Schemas', name, origin: '' };\n if ((symbol.flags & ts.SymbolFlags.Variable) !== 0) return { detail: `: ${formatConstantType(checker, symbol)}`, kind: 'Constants', name, origin: '' };\n const isType = (symbol.flags & (ts.SymbolFlags.Enum | ts.SymbolFlags.Interface | ts.SymbolFlags.TypeAlias)) !== 0;\n return isType ? { detail: '', kind: 'Types', name, origin: formatOrigin(checker, symbol, fieldGroupOwners) } : undefined;\n}\n\n// The summary of the '/** … */' comment above the item, on one line. Tags such as '@param' are left out, and '//'\n// comments, which are notes for maintainers, are never read.\nfunction readDescription(checker: ts.TypeChecker, symbol: ts.Symbol): string | undefined {\n const description = ts.displayPartsToString(symbol.getDocumentationComment(checker)).replaceAll(/\\s+/g, ' ').trim();\n return description === '' ? undefined : description;\n}\n\n// The type as written, on the declaration or in an 'as' on its value, which keeps the names it was written with. Where\n// none is written, the inferred type is widened, so 'MAX_COUNT = 3' reads as 'number' rather than '3'.\nfunction formatConstantType(checker: ts.TypeChecker, symbol: ts.Symbol): string {\n const declaration = symbol.valueDeclaration;\n const variableDeclaration = declaration !== undefined && ts.isVariableDeclaration(declaration) ? declaration : undefined;\n const initializer = variableDeclaration?.initializer;\n const isWrittenAs = initializer !== undefined && ts.isAsExpression(initializer) && !ts.isConstTypeReference(initializer.type); // 'as const' names no type.\n const typeNode = variableDeclaration?.type ?? (isWrittenAs ? initializer.type : undefined);\n return typeNode === undefined ? checker.typeToString(checker.getBaseTypeOfLiteralType(checker.getTypeOfSymbol(symbol)), declaration) : formatTypeNode(typeNode);\n}\n\n// What a type or class comes from: the schema it is inferred from, and what it extends or implements, such as\n// ' (extends DPUseError)'. A type inferred from a schema has no 'extends' clause, so its parent is found from the schema\n// instead. The parent is named even when it is not exported, as it is still what the type inherits from.\nfunction formatOrigin(checker: ts.TypeChecker, symbol: ts.Symbol, fieldGroupOwners: Map<ts.ObjectLiteralExpression, string>): string {\n const heritageClauses = (symbol.declarations ?? []).flatMap((declaration) =>\n ts.isClassDeclaration(declaration) || ts.isInterfaceDeclaration(declaration) ? [...(declaration.heritageClauses ?? [])] : []\n );\n const clauses = heritageClauses.map((clause) => {\n const keyword = clause.token === ts.SyntaxKind.ExtendsKeyword ? 'extends' : 'implements';\n return `${keyword} ${clause.types.map((type) => formatCode(formatTypeNode(type))).join(', ')}`;\n });\n\n const typeAlias = symbol.declarations?.find((declaration) => ts.isTypeAliasDeclaration(declaration));\n const schemaName = typeAlias === undefined ? undefined : findSchemaName(typeAlias);\n if (typeAlias !== undefined && schemaName !== undefined) {\n clauses.push(`inferred from ${formatCode(schemaName.getText())}`);\n const fields = findSchemaFields(checker, typeAlias);\n const parents = fields === undefined ? [] : findSchemaParents(checker, fields, typeAlias.name.text, fieldGroupOwners);\n if (parents.length > 0) clauses.push(`extends ${parents.map((parent) => formatCode(parent)).join(', ')}`);\n }\n return clauses.length === 0 ? '' : ` (${clauses.join(', ')})`;\n}\n\n// A schema inherits by spreading in a group of fields, as in 'strictObject({ ...moduleConfigCoreFields, … })'. Where\n// the type owns the group it spreads, as 'ModuleConfig' owns 'moduleConfigCoreFields', its parent is found in that\n// group's own spreads.\nfunction findSchemaParents(checker: ts.TypeChecker, fields: ts.ObjectLiteralExpression, typeName: string, fieldGroupOwners: Map<ts.ObjectLiteralExpression, string>): string[] {\n return fields.properties.flatMap((property) => {\n const group = ts.isSpreadAssignment(property) ? resolveObjectLiteral(checker, property.expression) : undefined;\n if (group === undefined) return [];\n const owner = fieldGroupOwners.get(group);\n if (owner === typeName) return findSchemaParents(checker, group, typeName, fieldGroupOwners);\n return owner === undefined ? [] : [owner];\n });\n}\n\n// A field group is not a type, so it is named by the type whose schema adds the fewest fields to it. Where two types\n// tie, the group is left unnamed rather than guessed at.\nfunction mapFieldGroupOwners(program: ts.Program, checker: ts.TypeChecker): Map<ts.ObjectLiteralExpression, string> {\n const candidates = new Map<ts.ObjectLiteralExpression, { addedFieldCount: number; typeName: string }[]>();\n const typeAliases = program\n .getSourceFiles()\n .filter((sourceFile) => !sourceFile.isDeclarationFile && !program.isSourceFileFromExternalLibrary(sourceFile))\n .flatMap((sourceFile) => sourceFile.statements.filter((statement) => ts.isTypeAliasDeclaration(statement)));\n\n for (const typeAlias of typeAliases) {\n for (const { addedFieldCount, group } of listFieldGroups(checker, typeAlias)) {\n candidates.set(group, [...(candidates.get(group) ?? []), { addedFieldCount, typeName: typeAlias.name.text }]);\n }\n }\n\n const owners = new Map<ts.ObjectLiteralExpression, string>();\n for (const [group, groupCandidates] of candidates) {\n const fewestAdded = Math.min(...groupCandidates.map(({ addedFieldCount }) => addedFieldCount));\n const [owner, ...tied] = groupCandidates.filter(({ addedFieldCount }) => addedFieldCount === fewestAdded);\n if (owner !== undefined && tied.length === 0) owners.set(group, owner.typeName);\n }\n return owners;\n}\n\n// Each field group a type's schema is built from, with the number of fields the schema adds to it.\nfunction listFieldGroups(checker: ts.TypeChecker, typeAlias: ts.TypeAliasDeclaration): { addedFieldCount: number; group: ts.ObjectLiteralExpression }[] {\n const fields = findSchemaFields(checker, typeAlias);\n if (fields === undefined) return [];\n\n // Fields declared under a name of their own, rather than written inside the schema, are a group themselves.\n const ownGroup = ts.isVariableDeclaration(fields.parent) ? [{ addedFieldCount: 0, group: fields }] : [];\n const spreadGroups = fields.properties.flatMap((property) => {\n const group = ts.isSpreadAssignment(property) ? resolveObjectLiteral(checker, property.expression) : undefined;\n return group === undefined ? [] : [{ addedFieldCount: fields.properties.length - 1, group }];\n });\n return [...ownGroup, ...spreadGroups];\n}\n\n// The schema a type is inferred from, written either as 'InferOutput<typeof schema>' or, where the schema is built in\n// place from a group of fields, as 'InferOutput<ReturnType<typeof strictObject<typeof fields>>>'.\nfunction findSchemaName(typeAlias: ts.TypeAliasDeclaration): ts.EntityName | undefined {\n const [argument] = isTypeReferenceNamed(typeAlias.type, 'InferOutput') ? (typeAlias.type.typeArguments ?? []) : [];\n if (argument === undefined) return undefined;\n if (ts.isTypeQueryNode(argument)) return argument.exprName;\n\n const [returnTypeArgument] = isTypeReferenceNamed(argument, 'ReturnType') ? (argument.typeArguments ?? []) : [];\n const [fieldsQuery] = returnTypeArgument !== undefined && ts.isTypeQueryNode(returnTypeArgument) ? (returnTypeArgument.typeArguments ?? []) : [];\n return fieldsQuery !== undefined && ts.isTypeQueryNode(fieldsQuery) ? fieldsQuery.exprName : undefined;\n}\n\n// The fields of the schema a type is inferred from: those passed to 'strictObject({ … })', or the group of fields itself.\nfunction findSchemaFields(checker: ts.TypeChecker, typeAlias: ts.TypeAliasDeclaration): ts.ObjectLiteralExpression | undefined {\n const schemaName = findSchemaName(typeAlias);\n const schema = schemaName === undefined ? undefined : resolveInitializer(checker, schemaName);\n if (schema === undefined) return undefined;\n if (ts.isObjectLiteralExpression(schema)) return schema;\n\n const [fields] = ts.isCallExpression(schema) ? schema.arguments : [];\n return fields === undefined ? undefined : resolveObjectLiteral(checker, fields);\n}\n\nfunction isTypeReferenceNamed(node: ts.TypeNode, name: string): node is ts.TypeReferenceNode {\n if (!ts.isTypeReferenceNode(node)) return false;\n const typeName = ts.isQualifiedName(node.typeName) ? node.typeName.right : node.typeName;\n return typeName.text === name;\n}\n\nfunction resolveObjectLiteral(checker: ts.TypeChecker, node: ts.Node): ts.ObjectLiteralExpression | undefined {\n if (ts.isObjectLiteralExpression(node)) return node;\n const initializer = resolveInitializer(checker, node);\n return initializer !== undefined && ts.isObjectLiteralExpression(initializer) ? initializer : undefined;\n}\n\n// The value a name was declared with, following imports back to the declaration.\nfunction resolveInitializer(checker: ts.TypeChecker, name: ts.Node): ts.Expression | undefined {\n const symbol = checker.getSymbolAtLocation(name);\n const declaration = symbol === undefined ? undefined : resolveAlias(checker, symbol).valueDeclaration;\n return declaration !== undefined && ts.isVariableDeclaration(declaration) ? declaration.initializer : undefined;\n}\n\nfunction resolveAlias(checker: ts.TypeChecker, symbol: ts.Symbol): ts.Symbol {\n return (symbol.flags & ts.SymbolFlags.Alias) === 0 ? symbol : checker.getAliasedSymbol(symbol);\n}\n\n// A default export is imported under any name, so the name it has where it is declared is shown alongside.\nfunction formatExportName(exportedSymbol: ts.Symbol, symbol: ts.Symbol): string {\n if (exportedSymbol.name !== 'default') return exportedSymbol.name;\n const declarationName = symbol.declarations?.map((declaration) => ts.getNameOfDeclaration(declaration)?.getText()).find((name) => name !== undefined);\n return declarationName === undefined || declarationName === 'default' ? 'default' : `default (${declarationName})`;\n}\n\n// A parameter that can be left out, being optional or having a default, is marked with '?'. Its type is as written, or\n// inferred where none is, as with a default value.\nfunction formatParameter(checker: ts.TypeChecker, parameter: ts.Symbol): string {\n const declaration = parameter.valueDeclaration;\n const parameterDeclaration = declaration !== undefined && ts.isParameter(declaration) ? declaration : undefined;\n const isOptional = parameterDeclaration?.questionToken !== undefined || parameterDeclaration?.initializer !== undefined;\n const typeText = parameterDeclaration?.type === undefined ? checker.typeToString(checker.getTypeOfSymbol(parameter), declaration) : formatTypeNode(parameterDeclaration.type);\n const name = parameterDeclaration === undefined ? parameter.name : formatParameterName(parameterDeclaration.name);\n return `${name}${isOptional ? '?' : ''}: ${typeText}`;\n}\n\n// A destructured parameter has no name of its own, so TypeScript calls it '__0'. It is shown by the names it unpacks\n// instead, as '{ allowedLicenses, moduleLevel }', leaving out their defaults.\nfunction formatParameterName(name: ts.BindingName): string {\n if (ts.isIdentifier(name)) return name.text;\n const names = name.elements.flatMap((element) =>\n ts.isBindingElement(element) ? [(element.dotDotDotToken === undefined ? '' : '...') + formatParameterName(element.name)] : []\n );\n return ts.isObjectBindingPattern(name) ? `{ ${names.join(', ')} }` : `[${names.join(', ')}]`;\n}\n\n// A type written across several lines is shown on one.\nfunction formatTypeNode(typeNode: ts.TypeNode): string {\n return typeNode.getText().replaceAll(/\\s+/g, ' ');\n}\n\nfunction buildSection(importPath: string, entries: ExportEntry[]): string {\n const topics = [...new Set(entries.map((entry) => entry.topic))].toSorted(compareTopics);\n if (topics.length < TOPIC_GROUPING_MINIMUM) return [`## ${importPath}`, ...buildKindLists(entries, '###')].join('\\n\\n');\n\n const topicSections = topics.map((topic) =>\n [\n `### ${topic}`,\n ...buildKindLists(\n entries.filter((entry) => entry.topic === topic),\n '####'\n )\n ].join('\\n\\n')\n );\n return [`## ${importPath}`, ...topicSections].join('\\n\\n');\n}\n\n// General comes first, as it holds what the whole package shares; the rest are alphabetical.\nfunction compareTopics(a: string, b: string): number {\n const isEitherGeneral = a === GENERAL_TOPIC || b === GENERAL_TOPIC;\n return isEitherGeneral ? Number(b === GENERAL_TOPIC) - Number(a === GENERAL_TOPIC) : a.localeCompare(b);\n}\n\nfunction buildKindLists(entries: ExportEntry[], headingLevel: string): string[] {\n return EXPORT_KINDS.flatMap((kind) => {\n const items = entries.filter((entry) => entry.kind === kind).map((entry) => formatEntry(entry));\n return items.length === 0 ? [] : [`${headingLevel} ${kind}\\n\\n${items.join('\\n')}`];\n });\n}\n\n// The name and what follows it are code, shown on a shaded background, with only the name bold so it stands out from\n// its parameters or type. The description is a quote nested in the item, which indents every line of it and shows it\n// in lighter text, so the names can be read straight down the left.\nfunction formatEntry({ description, detail, name, origin }: ExportEntry): string {\n const detailCode = detail === '' ? '' : formatCode(detail);\n const firstLine = `- **${formatCode(name)}**${detailCode}${origin}`;\n return description === undefined ? firstLine : `${firstLine}\\n > ${description}`;\n}\n\nfunction formatCode(text: string): string {\n return `\\`${text}\\``;\n}\n"],"mappings":";;;;AAyBA,IAAM,IAAyB,GAGzB,IAAgB,WAGhB,IAA6B;CAAC;CAAa;CAAW;CAAa;CAAW;AAAO,GAErF,IAAsB;AAO5B,eAAsB,EAAkB,GAAkB,GAAyC;CAC/F,EAAc,GAAG,EAAS,UAAU,EAAiB,EAAE;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