@dpuse/dpuse-development 0.3.783 → 0.3.788

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,9 +5,6 @@
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)
6
6
  [![DPUse version](https://img.shields.io/github/v/release/dpuse/dpuse-development?color=f6821f&label=DPUse)](https://github.com/dpuse/dpuse-development/releases/latest)
7
7
  [![CI](https://github.com/dpuse/dpuse-development/actions/workflows/ci.yml/badge.svg)](https://github.com/dpuse/dpuse-development/actions/workflows/ci.yml)
8
- [![CodeQL](https://github.com/dpuse/dpuse-development/actions/workflows/codeql.yml/badge.svg)](https://github.com/dpuse/dpuse-development/actions/workflows/codeql.yml)
9
- [![Fallow code health](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fdpuse%2Fdpuse-development%2Fmain%2Fcode-health-reports%2Ffallow%2Fbadge.json)](./code-health-reports/fallow/index.md)
10
- [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dpuse_dpuse-development&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=dpuse_dpuse-development)
11
8
 
12
9
  [DPUse](https://www.dpuse.app) · [Report a Vulnerability](https://github.com/dpuse/dpuse-development/security/advisories/new) · [Open an Issue](https://github.com/dpuse/dpuse-development/issues)
13
10
 
@@ -54,7 +51,7 @@ npm install
54
51
 
55
52
  _Requires [Node.js](https://nodejs.org/) 24 or later, [npm](https://www.npmjs.com/) 12 or later, and [TypeScript](https://www.typescriptlang.org/) 6.0.3 or later._
56
53
 
57
- This repository manages itself using the actions it implements.
54
+ This repository manages itself using the actions it implements. See the `scripts` block in [package.json](https://github.com/dpuse/dpuse-development/blob/main/package.json) for details.
58
55
 
59
56
  <!-- USAGE_END -->
60
57
 
@@ -81,39 +78,42 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
81
78
 
82
79
  | Chunk/Module/File | Composition |
83
80
  | :----------------------------------------------------------------------------------------------- | :--------------------------- |
84
- | dist/dpuse-development.es.js | 331.3 kB · gzip 85.2 kB |
85
- | &nbsp;&nbsp;&nbsp;&nbsp;acorn → dist/acorn.mjs | `████████░░░░░░░░░░░░` 39.5% |
86
- | &nbsp;&nbsp;&nbsp;&nbsp;acorn-typescript → lib/index.mjs | `███████░░░░░░░░░░░░░` 34.6% |
87
- | &nbsp;&nbsp;&nbsp;&nbsp;src | `███░░░░░░░░░░░░░░░░░` 15.7% |
88
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentQualitySecurity.ts | `░░░░░░░░░░░░░░░░░░░░` 2.5% |
89
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;index.ts | `░░░░░░░░░░░░░░░░░░░░` 2.4% |
90
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentApiReference.ts | `░░░░░░░░░░░░░░░░░░░░` 2.3% |
91
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentDependencies.ts | `░░░░░░░░░░░░░░░░░░░░` 1.7% |
92
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentBundleSizes.ts | `░░░░░░░░░░░░░░░░░░░░` 1.3% |
93
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;checkConfigFiles.ts | `░░░░░░░░░░░░░░░░░░░░` 1.1% |
94
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentUsage.ts | `░░░░░░░░░░░░░░░░░░░░` 0.8% |
95
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentActions.ts | `░░░░░░░░░░░░░░░░░░░░` 0.5% |
96
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentOpening.ts | `░░░░░░░░░░░░░░░░░░░░` 0.5% |
97
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cloudflare.ts | `░░░░░░░░░░░░░░░░░░░░` 0.5% |
98
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;checkDependencies.ts | `░░░░░░░░░░░░░░░░░░░░` 0.5% |
99
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentContributingLicense.ts | `░░░░░░░░░░░░░░░░░░░░` 0.4% |
100
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;releaseProject.ts | `░░░░░░░░░░░░░░░░░░░░` 0.3% |
101
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;testProject.ts | `░░░░░░░░░░░░░░░░░░░░` 0.2% |
102
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;publishProject.ts | `░░░░░░░░░░░░░░░░░░░░` 0.2% |
103
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentProject.ts | `░░░░░░░░░░░░░░░░░░░░` 0.2% |
104
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;syncProjectWithGitHub.ts | `░░░░░░░░░░░░░░░░░░░░` 0.2% |
105
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;formatCode.ts | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
106
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;auditDependencies.ts | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
107
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buildProject.ts | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
108
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lintCode.ts | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
109
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;checkProject.ts | `░░░░░░░░░░░░░░░░░░░░` 0.0% |
110
- | &nbsp;&nbsp;&nbsp;&nbsp;(bundler output, whitespace & JSON) | `█░░░░░░░░░░░░░░░░░░░` 6.7% |
111
- | &nbsp;&nbsp;&nbsp;&nbsp;@dpuse/dpuse-shared | `█░░░░░░░░░░░░░░░░░░░` 3.4% |
112
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dist/componentConfig.schema-DT3mO5rS.js | `█░░░░░░░░░░░░░░░░░░░` 2.6% |
113
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dist/dpuse-shared-componentModuleConnector.es.js | `░░░░░░░░░░░░░░░░░░░░` 0.7% |
114
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dist/moduleConfig.schema-aYmFWSrn.js | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
115
- | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dist/dpuse-shared-componentModulePresenter.es.js | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
116
- | &nbsp;&nbsp;&nbsp;&nbsp;valibot → dist/index.mjs | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
81
+ | dist/dpuse-development.es.js | 44.7 kB · gzip 14.4 kB |
82
+ | &nbsp;&nbsp;&nbsp;&nbsp;src | `██████████░░░░░░░░░░` 52.0% |
83
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentQualitySecurity.ts | `███░░░░░░░░░░░░░░░░░` 13.1% |
84
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentDependencies.ts | `██░░░░░░░░░░░░░░░░░░` 8.1% |
85
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentBundleSizes.ts | `█░░░░░░░░░░░░░░░░░░░` 5.9% |
86
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;checkConfigFiles.ts | `█░░░░░░░░░░░░░░░░░░░` 4.9% |
87
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentUsage.ts | `█░░░░░░░░░░░░░░░░░░░` 3.6% |
88
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentActions.ts | `░░░░░░░░░░░░░░░░░░░░` 2.3% |
89
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cloudflare.ts | `░░░░░░░░░░░░░░░░░░░░` 2.1% |
90
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;checkDependencies.ts | `░░░░░░░░░░░░░░░░░░░░` 2.0% |
91
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentOpening.ts | `░░░░░░░░░░░░░░░░░░░░` 1.7% |
92
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentContributingLicense.ts | `░░░░░░░░░░░░░░░░░░░░` 1.6% |
93
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;releaseProject.ts | `░░░░░░░░░░░░░░░░░░░░` 1.3% |
94
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;testProject.ts | `░░░░░░░░░░░░░░░░░░░░` 1.0% |
95
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;publishProject.ts | `░░░░░░░░░░░░░░░░░░░░` 1.0% |
96
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentProject.ts | `░░░░░░░░░░░░░░░░░░░░` 0.9% |
97
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;syncProjectWithGitHub.ts | `░░░░░░░░░░░░░░░░░░░░` 0.8% |
98
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;formatCode.ts | `░░░░░░░░░░░░░░░░░░░░` 0.4% |
99
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentApiReference.ts | `░░░░░░░░░░░░░░░░░░░░` 0.4% |
100
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;auditDependencies.ts | `░░░░░░░░░░░░░░░░░░░░` 0.3% |
101
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buildProject.ts | `░░░░░░░░░░░░░░░░░░░░` 0.3% |
102
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lintCode.ts | `░░░░░░░░░░░░░░░░░░░░` 0.2% |
103
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;checkProject.ts | `░░░░░░░░░░░░░░░░░░░░` 0.1% |
104
+ | &nbsp;&nbsp;&nbsp;&nbsp;(bundler output, whitespace & JSON) | `██░░░░░░░░░░░░░░░░░░` 8.0% |
105
+ | dist/utilities-CPg6O2rR.js | 22.1 kB · gzip 6.1 kB |
106
+ | &nbsp;&nbsp;&nbsp;&nbsp;@dpuse/dpuse-shared | `███░░░░░░░░░░░░░░░░░` 15.0% |
107
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dist/componentConfig.schema-DT3mO5rS.js | `██░░░░░░░░░░░░░░░░░░` 11.3% |
108
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dist/dpuse-shared-componentModuleConnector.es.js | `█░░░░░░░░░░░░░░░░░░░` 3.1% |
109
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dist/moduleConfig.schema-aYmFWSrn.js | `░░░░░░░░░░░░░░░░░░░░` 0.4% |
110
+ | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dist/dpuse-shared-componentModulePresenter.es.js | `░░░░░░░░░░░░░░░░░░░░` 0.3% |
111
+ | &nbsp;&nbsp;&nbsp;&nbsp;src → index.ts | `██░░░░░░░░░░░░░░░░░░` 10.2% |
112
+ | &nbsp;&nbsp;&nbsp;&nbsp;(bundler output, whitespace & JSON) | `█░░░░░░░░░░░░░░░░░░░` 3.9% |
113
+ | &nbsp;&nbsp;&nbsp;&nbsp;valibot → dist/index.mjs | `░░░░░░░░░░░░░░░░░░░░` 0.5% |
114
+ | dist/apiReference-CDT825AK.js | 7.7 kB · gzip 2.8 kB |
115
+ | &nbsp;&nbsp;&nbsp;&nbsp;src → apiReference.ts | `██░░░░░░░░░░░░░░░░░░` 9.8% |
116
+ | &nbsp;&nbsp;&nbsp;&nbsp;(bundler output, whitespace & JSON) | `░░░░░░░░░░░░░░░░░░░░` 0.5% |
117
117
 
118
118
  (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.
119
119
 
@@ -123,40 +123,41 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
123
123
 
124
124
  ## Quality & Security
125
125
 
126
- This section is updated each time `npm run document` is run. Settings come from the repository's workflow files and GitHub, and test coverage and the Fallow score are measured at the same time.
126
+ This section is updated each time `npm run document` is run. Settings come from the repository's workflow files and GitHub. Test coverage and the Fallow score are measured at the same time.
127
127
 
128
128
  ### Testing
129
129
 
130
- | Check or setting | Status | What it does |
131
- | :------------------- | :---------------- | :------------------------------------------------------------------------------------- |
132
- | Unit tests | ✅ On | Run in CI on every push to `main`. |
133
- | Property-based tests | ✅ fast-check | Fuzz testing: many random inputs per test to find edge cases, run with the unit tests. |
134
- | Test coverage | ✅ 99.7% of lines | Share of source lines the unit tests run. The target is 80%. |
130
+ | Check | Status | What it does |
131
+ | :------------------- | :----- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
132
+ | Unit tests | ✅ On | [Vitest](https://vitest.dev) runs the unit tests. Part of the [CI workflow](https://github.com/dpuse/dpuse-development/actions/workflows/ci.yml) on every push to `main`. |
133
+ | Property-based tests | ✅ On | [fast-check](https://fast-check.dev) runs many random inputs per test to find edge cases, alongside the unit tests. Part of the [CI workflow](https://github.com/dpuse/dpuse-development/actions/workflows/ci.yml) on every push to `main`. |
134
+ | Test coverage | ✅ On | ![Coverage](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fdpuse%2Fdpuse-development%2Fmain%2Fcode-health-reports%2Fvitest%2Fbadge.json) [Vitest's V8 coverage](https://vitest.dev/guide/coverage) measures the share of source lines the unit tests run. The target is 80%. |
135
135
 
136
136
  ### Code Quality
137
137
 
138
- | Check or setting | Status | What it does |
139
- | :------------------------------------------------------------------------------ | :-------- | :--------------------------------------------------------------------------------------- |
140
- | [Fallow](./code-health-reports/fallow/index.md) | ✅ A (85) | Unused code, duplication, complexity and dependency hygiene. |
141
- | [SonarCloud](https://sonarcloud.io/summary/new_code?id=dpuse_dpuse-development) | ✅ On | Code quality and security analysis on every push: bugs, code smells and vulnerabilities. |
138
+ | Check | Status | What it does |
139
+ | :------------ | :----- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
140
+ | Code health | ✅ On | [![Fallow code health](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fdpuse%2Fdpuse-development%2Fmain%2Fcode-health-reports%2Ffallow%2Fbadge.json)](./code-health-reports/fallow/index.md) [Fallow](https://github.com/fallow-rs/fallow) finds unused code, duplication, complexity and dependency problems. |
141
+ | Code analysis | ✅ On | [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dpuse_dpuse-development&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=dpuse_dpuse-development) [SonarCloud](https://sonarcloud.io) checks every push for bugs, code smells and vulnerabilities. |
142
+ | Linting | ✅ On | [ESLint](https://eslint.org) checks the code for errors and style problems. Part of the [CI workflow](https://github.com/dpuse/dpuse-development/actions/workflows/ci.yml) on every push to `main`. |
142
143
 
143
144
  ### Security Analysis
144
145
 
145
- | Check or setting | Status | What it does |
146
- | :-------------------------------------------------------------------------- | :--------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- |
147
- | [CodeQL](https://github.com/dpuse/dpuse-development/security/code-scanning) | ✅ GitHub Actions, JavaScript/TypeScript | Static analysis for security vulnerabilities, using the extended security queries, on every push and pull request to `main` and weekly. |
148
- | Secret scanning | ✅ On | Detects credentials, such as API keys and tokens, committed to the repository. |
149
- | Push protection | ✅ On | Blocks pushes that contain credentials. |
146
+ | Check | Status | What it does |
147
+ | :-------------- | :----- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
148
+ | Push protection | ✅ On | [GitHub push protection](https://docs.github.com/en/code-security/secret-scanning/push-protection-for-repositories-and-organizations) blocks pushes that contain credentials. |
149
+ | Static analysis | ✅ On | [![CodeQL](https://github.com/dpuse/dpuse-development/actions/workflows/codeql.yml/badge.svg)](https://github.com/dpuse/dpuse-development/security/code-scanning) [CodeQL](https://codeql.github.com) scans GitHub Actions and JavaScript/TypeScript for security vulnerabilities, using the extended security queries, on every push and pull request to `main` and weekly. |
150
+ | Secret scanning | ✅ On | [GitHub secret scanning](https://docs.github.com/en/code-security/secret-scanning) detects credentials, such as API keys and tokens, committed to the repository. |
150
151
 
151
152
  ### Dependencies
152
153
 
153
- | Check or setting | Status | What it does |
154
- | :------------------------------- | :----- | :------------------------------------------------------------------------------------------------------------------------------- |
155
- | npm audit | ✅ On | Fails CI when any dependency has a known vulnerability. |
156
- | [Socket.dev](https://socket.dev) | ✅ On | Flags supply chain risk in dependencies: malicious packages, typosquatting and suspicious behaviour that may not yet have a CVE. |
157
- | Dependabot alerts | ✅ On | Alerts when a dependency has a known vulnerability, using the GitHub Advisory Database. |
158
- | Dependabot security updates | ❌ Off | Opens pull requests that update vulnerable dependencies. |
159
- | Dependabot version updates | ❌ Off | Opens pull requests for new dependency versions. |
154
+ | Check | Status | What it does |
155
+ | :------------------ | :----- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
156
+ | Vulnerability audit | ✅ On | [npm audit](https://docs.npmjs.com/cli/commands/npm-audit) fails when any dependency has a known vulnerability. Part of the [CI workflow](https://github.com/dpuse/dpuse-development/actions/workflows/ci.yml) on every push to `main`. |
157
+ | Supply chain risk | ✅ On | [Socket](https://socket.dev) flags malicious packages, typosquatting and suspicious behaviour that may not yet have a CVE. |
158
+ | Security alerts | ✅ On | [Dependabot](https://docs.github.com/en/code-security/dependabot) alerts when a dependency has a known vulnerability, using the GitHub Advisory Database. |
159
+ | Security updates | ❌ Off | [Dependabot](https://docs.github.com/en/code-security/dependabot) opens pull requests that update vulnerable dependencies. These are handled manually. |
160
+ | Version updates | ❌ Off | [Dependabot](https://docs.github.com/en/code-security/dependabot) opens pull requests for new dependency versions. These are handled manually. |
160
161
 
161
162
  ### OpenSSF 🚧
162
163
 
@@ -0,0 +1,197 @@
1
+ import { D as e, _ as t, y as n } from "./utilities-CPg6O2rR.js";
2
+ import r from "typescript";
3
+ //#region src/utilities/apiReference.ts
4
+ var i = [
5
+ "Functions",
6
+ "Classes",
7
+ "Constants",
8
+ "Schemas",
9
+ "Types"
10
+ ], a = "Every export, grouped by import path. This file is updated each time `npm run document` is run, and with each release.";
11
+ async function o(i, o) {
12
+ t(`${i} Write '${o}'`);
13
+ let u = s(await n("package.json"));
14
+ if (u.length === 0) throw Error("package.json 'exports' must name at least one import path with types to document the API reference.");
15
+ let d = r.createProgram(u.map(({ sourcePath: e }) => e), c()), f = d.getTypeChecker(), p = h(d, f), m = u.map(({ importPath: e, sourcePath: t }) => {
16
+ let n = d.getSourceFile(t);
17
+ if (n === void 0) throw Error(`Unable to read '${t}', the source of '${e}'.`);
18
+ return D(e, l(f, n, p));
19
+ });
20
+ await e(o, `# API Reference\n\n${a}\n\n${m.join("\n\n")}\n`);
21
+ }
22
+ function s(e) {
23
+ let t = e.name ?? "", n = e.exports;
24
+ return (typeof n == "object" && n && !Array.isArray(n) ? Object.entries(n) : []).flatMap(([e, n]) => {
25
+ let r = typeof n == "object" && n && !Array.isArray(n) ? n.types : void 0;
26
+ return typeof r == "string" ? [{
27
+ importPath: e === "." ? t : `${t}${e.slice(1)}`,
28
+ sourcePath: r.replace(/^\.\/dist\/types\//, "").replace(/\.d\.ts$/, ".ts")
29
+ }] : [];
30
+ });
31
+ }
32
+ function c() {
33
+ let e = r.findConfigFile(process.cwd(), (e) => r.sys.fileExists(e));
34
+ if (e === void 0) return {
35
+ module: r.ModuleKind.ESNext,
36
+ moduleResolution: r.ModuleResolutionKind.Bundler,
37
+ target: r.ScriptTarget.ESNext
38
+ };
39
+ let { config: t } = r.readConfigFile(e, (e) => r.sys.readFile(e));
40
+ return r.parseJsonConfigFileContent(t, r.sys, process.cwd()).options;
41
+ }
42
+ function l(e, t, n) {
43
+ let r = new Map(i.map((e) => [e, []])), a = e.getSymbolAtLocation(t), o = a === void 0 ? [] : e.getExportsOfModule(a);
44
+ for (let t of o) {
45
+ let i = S(e, t), a = u(e, C(t, i), i, n);
46
+ a !== void 0 && r.get(a.kind)?.push({
47
+ ...a,
48
+ description: d(e, i)
49
+ });
50
+ }
51
+ for (let e of r.values()) e.sort((e, t) => e.name.localeCompare(t.name));
52
+ return r;
53
+ }
54
+ function u(e, t, n, i) {
55
+ let [a] = (n.flags & (r.SymbolFlags.Function | r.SymbolFlags.Variable)) === 0 ? [] : e.getSignaturesOfType(e.getTypeOfSymbol(n), r.SignatureKind.Call), o = t.endsWith("Schema");
56
+ return a !== void 0 && !o ? {
57
+ detail: `(${a.parameters.map((t) => w(e, t)).join(", ")})`,
58
+ kind: "Functions",
59
+ name: t,
60
+ origin: ""
61
+ } : (n.flags & r.SymbolFlags.Class) === 0 ? o && (n.flags & r.SymbolFlags.Variable) !== 0 ? {
62
+ detail: "",
63
+ kind: "Schemas",
64
+ name: t,
65
+ origin: ""
66
+ } : (n.flags & r.SymbolFlags.Variable) === 0 ? (n.flags & (r.SymbolFlags.Enum | r.SymbolFlags.Interface | r.SymbolFlags.TypeAlias)) === 0 ? void 0 : {
67
+ detail: "",
68
+ kind: "Types",
69
+ name: t,
70
+ origin: p(e, n, i)
71
+ } : {
72
+ detail: `: ${f(e, n)}`,
73
+ kind: "Constants",
74
+ name: t,
75
+ origin: ""
76
+ } : {
77
+ detail: "",
78
+ kind: "Classes",
79
+ name: t,
80
+ origin: p(e, n, i)
81
+ };
82
+ }
83
+ function d(e, t) {
84
+ let n = r.displayPartsToString(t.getDocumentationComment(e)).replaceAll(/\s+/g, " ").trim();
85
+ return n === "" ? void 0 : n;
86
+ }
87
+ function f(e, t) {
88
+ let n = t.valueDeclaration, i = n !== void 0 && r.isVariableDeclaration(n) ? n : void 0, a = i?.initializer, o = a !== void 0 && r.isAsExpression(a) && !r.isConstTypeReference(a.type), s = i?.type ?? (o ? a.type : void 0);
89
+ return s === void 0 ? e.typeToString(e.getBaseTypeOfLiteralType(e.getTypeOfSymbol(t)), n) : E(s);
90
+ }
91
+ function p(e, t, n) {
92
+ let i = (t.declarations ?? []).flatMap((e) => r.isClassDeclaration(e) || r.isInterfaceDeclaration(e) ? [...e.heritageClauses ?? []] : []).map((e) => `${e.token === r.SyntaxKind.ExtendsKeyword ? "extends" : "implements"} ${e.types.map((e) => k(E(e))).join(", ")}`), a = t.declarations?.find((e) => r.isTypeAliasDeclaration(e)), o = a === void 0 ? void 0 : _(a);
93
+ if (a !== void 0 && o !== void 0) {
94
+ i.push(`inferred from ${k(o.getText())}`);
95
+ let t = v(e, a), r = t === void 0 ? [] : m(e, t, a.name.text, n);
96
+ r.length > 0 && i.push(`extends ${r.map((e) => k(e)).join(", ")}`);
97
+ }
98
+ return i.length === 0 ? "" : ` (${i.join(", ")})`;
99
+ }
100
+ function m(e, t, n, i) {
101
+ return t.properties.flatMap((t) => {
102
+ let a = r.isSpreadAssignment(t) ? b(e, t.expression) : void 0;
103
+ if (a === void 0) return [];
104
+ let o = i.get(a);
105
+ return o === n ? m(e, a, n, i) : o === void 0 ? [] : [o];
106
+ });
107
+ }
108
+ function h(e, t) {
109
+ let n = /* @__PURE__ */ new Map(), i = e.getSourceFiles().filter((t) => !t.isDeclarationFile && !e.isSourceFileFromExternalLibrary(t)).flatMap((e) => e.statements.filter((e) => r.isTypeAliasDeclaration(e)));
110
+ for (let e of i) for (let { addedFieldCount: r, group: i } of g(t, e)) n.set(i, [...n.get(i) ?? [], {
111
+ addedFieldCount: r,
112
+ typeName: e.name.text
113
+ }]);
114
+ let a = /* @__PURE__ */ new Map();
115
+ for (let [e, t] of n) {
116
+ let n = Math.min(...t.map(({ addedFieldCount: e }) => e)), [r, ...i] = t.filter(({ addedFieldCount: e }) => e === n);
117
+ r !== void 0 && i.length === 0 && a.set(e, r.typeName);
118
+ }
119
+ return a;
120
+ }
121
+ function g(e, t) {
122
+ let n = v(e, t);
123
+ if (n === void 0) return [];
124
+ let i = r.isVariableDeclaration(n.parent) ? [{
125
+ addedFieldCount: 0,
126
+ group: n
127
+ }] : [], a = n.properties.flatMap((t) => {
128
+ let i = r.isSpreadAssignment(t) ? b(e, t.expression) : void 0;
129
+ return i === void 0 ? [] : [{
130
+ addedFieldCount: n.properties.length - 1,
131
+ group: i
132
+ }];
133
+ });
134
+ return [...i, ...a];
135
+ }
136
+ function _(e) {
137
+ let [t] = y(e.type, "InferOutput") ? e.type.typeArguments ?? [] : [];
138
+ if (t === void 0) return;
139
+ if (r.isTypeQueryNode(t)) return t.exprName;
140
+ let [n] = y(t, "ReturnType") ? t.typeArguments ?? [] : [], [i] = n !== void 0 && r.isTypeQueryNode(n) ? n.typeArguments ?? [] : [];
141
+ return i !== void 0 && r.isTypeQueryNode(i) ? i.exprName : void 0;
142
+ }
143
+ function v(e, t) {
144
+ let n = _(t), i = n === void 0 ? void 0 : x(e, n);
145
+ if (i === void 0) return;
146
+ if (r.isObjectLiteralExpression(i)) return i;
147
+ let [a] = r.isCallExpression(i) ? i.arguments : [];
148
+ return a === void 0 ? void 0 : b(e, a);
149
+ }
150
+ function y(e, t) {
151
+ return r.isTypeReferenceNode(e) ? (r.isQualifiedName(e.typeName) ? e.typeName.right : e.typeName).text === t : !1;
152
+ }
153
+ function b(e, t) {
154
+ if (r.isObjectLiteralExpression(t)) return t;
155
+ let n = x(e, t);
156
+ return n !== void 0 && r.isObjectLiteralExpression(n) ? n : void 0;
157
+ }
158
+ function x(e, t) {
159
+ let n = e.getSymbolAtLocation(t), i = n === void 0 ? void 0 : S(e, n).valueDeclaration;
160
+ return i !== void 0 && r.isVariableDeclaration(i) ? i.initializer : void 0;
161
+ }
162
+ function S(e, t) {
163
+ return (t.flags & r.SymbolFlags.Alias) === 0 ? t : e.getAliasedSymbol(t);
164
+ }
165
+ function C(e, t) {
166
+ if (e.name !== "default") return e.name;
167
+ let n = t.declarations?.map((e) => r.getNameOfDeclaration(e)?.getText()).find((e) => e !== void 0);
168
+ return n === void 0 || n === "default" ? "default" : `default (${n})`;
169
+ }
170
+ function w(e, t) {
171
+ let n = t.valueDeclaration, i = n !== void 0 && r.isParameter(n) ? n : void 0, a = i?.questionToken !== void 0 || i?.initializer !== void 0, o = i?.type === void 0 ? e.typeToString(e.getTypeOfSymbol(t), n) : E(i.type);
172
+ return `${i === void 0 ? t.name : T(i.name)}${a ? "?" : ""}: ${o}`;
173
+ }
174
+ function T(e) {
175
+ if (r.isIdentifier(e)) return e.text;
176
+ let t = e.elements.flatMap((e) => r.isBindingElement(e) ? [(e.dotDotDotToken === void 0 ? "" : "...") + T(e.name)] : []);
177
+ return r.isObjectBindingPattern(e) ? `{ ${t.join(", ")} }` : `[${t.join(", ")}]`;
178
+ }
179
+ function E(e) {
180
+ return e.getText().replaceAll(/\s+/g, " ");
181
+ }
182
+ function D(e, t) {
183
+ let n = i.flatMap((e) => {
184
+ let n = t.get(e) ?? [], r = n.map((e) => O(e));
185
+ return n.length === 0 ? [] : [`### ${e}\n\n${r.join("\n")}`];
186
+ });
187
+ return [`## ${e}`, ...n].join("\n\n");
188
+ }
189
+ function O({ description: e, detail: t, name: n, origin: r }) {
190
+ let i = t === "" ? "" : k(t), a = `- **${k(n)}**${i}${r}`;
191
+ return e === void 0 ? a : `${a}\n > ${e}`;
192
+ }
193
+ function k(e) {
194
+ return `\`${e}\``;
195
+ }
196
+ //#endregion
197
+ export { o as writeAPIReference };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiReference-CDT825AK.js","names":[],"sources":["../src/utilities/apiReference.ts"],"sourcesContent":["// ── External Dependencies & Registrations\nimport type { PackageJson } from 'type-fest';\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}\n\ntype ExportKind = 'Classes' | 'Constants' | 'Functions' | 'Schemas' | 'Types';\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\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 const program = ts.createProgram(\n entryPoints.map(({ sourcePath }) => 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(sourcePath);\n if (sourceFile === undefined) throw new Error(`Unable to read '${sourcePath}', the source of '${importPath}'.`);\n return buildSection(importPath, groupExports(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 groupExports(checker: ts.TypeChecker, sourceFile: ts.SourceFile, fieldGroupOwners: Map<ts.ObjectLiteralExpression, string>): Map<ExportKind, ExportEntry[]> {\n const groups = new Map<ExportKind, ExportEntry[]>(EXPORT_KINDS.map((kind) => [kind, []]));\n const moduleSymbol = checker.getSymbolAtLocation(sourceFile);\n const exportedSymbols = moduleSymbol === undefined ? [] : checker.getExportsOfModule(moduleSymbol);\n\n for (const exportedSymbol of exportedSymbols) {\n const symbol = resolveAlias(checker, exportedSymbol);\n const entry = describeExport(checker, formatExportName(exportedSymbol, symbol), symbol, fieldGroupOwners);\n if (entry !== undefined) groups.get(entry.kind)?.push({ ...entry, description: readDescription(checker, symbol) });\n }\n\n for (const entries of groups.values()) entries.sort((a, b) => a.name.localeCompare(b.name));\n return groups;\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'> | 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, groups: Map<ExportKind, ExportEntry[]>): string {\n const lists = EXPORT_KINDS.flatMap((kind) => {\n const entries = groups.get(kind) ?? [];\n const items = entries.map((entry) => formatEntry(entry));\n return entries.length === 0 ? [] : [`### ${kind}\\n\\n${items.join('\\n')}`];\n });\n return [`## ${importPath}`, ...lists].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":";;;AAsBA,IAAM,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;CAEnJ,IAAM,IAAU,EAAG,cACf,EAAY,KAAK,EAAE,oBAAiB,CAAU,GAC9C,EAAoB,CACxB,GACM,IAAU,EAAQ,eAAe,GACjC,IAAmB,EAAoB,GAAS,CAAO,GAEvD,IAAW,EAAY,KAAK,EAAE,eAAY,oBAAiB;EAC7D,IAAM,I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