@dpuse/dpuse-development 1.0.147 → 1.0.149
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 +20 -20
- package/dist/{apiReference-CdMhhAl1.js → apiReference-Bg5HYM1L.js} +2 -3
- package/dist/{apiReference-CdMhhAl1.js.map → apiReference-Bg5HYM1L.js.map} +1 -1
- package/dist/dpuse-development.es.js +25 -48
- package/dist/dpuse-development.es.js.map +1 -1
- package/dist/{utilities-D98znirs.js → utilities-DH1goyH8.js} +182 -188
- package/dist/utilities-DH1goyH8.js.map +1 -0
- package/dist/vite.es.js +1 -2
- package/package.json +6 -6
- package/vite.config.default.ts +1 -1
- package/vite.config.presenter.ts +1 -1
- package/vite.config.tool.ts +1 -1
- package/dist/utilities-D98znirs.js.map +0 -1
package/README.md
CHANGED
|
@@ -78,11 +78,11 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
|
|
|
78
78
|
|
|
79
79
|
| Chunk/Module/File | Composition |
|
|
80
80
|
| :------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------- |
|
|
81
|
-
| **dist/dpuse-development.es.js** |
|
|
82
|
-
| src → documentDependencies.ts + 22 more |
|
|
83
|
-
| ↳ documentDependencies.ts | `▒▒▒░░░░░░░░░░░░░░░░░` 17.
|
|
84
|
-
| ↳ documentQualitySecurity.ts | `▒▒▒░░░░░░░░░░░░░░░░░` 15.
|
|
85
|
-
| ↳ documentBundleSizes.ts | `▒▒▒░░░░░░░░░░░░░░░░░` 13.
|
|
81
|
+
| **dist/dpuse-development.es.js** | 65.9 kB · gzip 21.0 kB · 64.2% of the build |
|
|
82
|
+
| src → documentDependencies.ts + 22 more | `██████████████████░░` 87.6% · 57.7 kB |
|
|
83
|
+
| ↳ documentDependencies.ts | `▒▒▒░░░░░░░░░░░░░░░░░` 17.3% · 11.4 kB |
|
|
84
|
+
| ↳ documentQualitySecurity.ts | `▒▒▒░░░░░░░░░░░░░░░░░` 15.1% · 9.9 kB |
|
|
85
|
+
| ↳ documentBundleSizes.ts | `▒▒▒░░░░░░░░░░░░░░░░░` 13.7% · 9.0 kB |
|
|
86
86
|
| ↳ checkConfigFiles.ts | `▒░░░░░░░░░░░░░░░░░░░` 5.7% · 3.8 kB |
|
|
87
87
|
| ↳ rustCrates.ts | `▒░░░░░░░░░░░░░░░░░░░` 5.2% · 3.4 kB |
|
|
88
88
|
| ↳ documentUsage.ts | `▒░░░░░░░░░░░░░░░░░░░` 4.1% · 2.7 kB |
|
|
@@ -90,25 +90,25 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
|
|
|
90
90
|
| ↳ cloudflare.ts | `▒░░░░░░░░░░░░░░░░░░░` 3.4% · 2.2 kB |
|
|
91
91
|
| ↳ documentOpening.ts | `▒░░░░░░░░░░░░░░░░░░░` 3.1% · 2.0 kB |
|
|
92
92
|
| ↳ auditDependencies.ts | `▒░░░░░░░░░░░░░░░░░░░` 3.0% · 2.0 kB |
|
|
93
|
-
| ↳ documentActions.ts | `▒░░░░░░░░░░░░░░░░░░░` 2.
|
|
94
|
-
| ↳ documentContributingLicense.ts | `░░░░░░░░░░░░░░░░░░░░` 1.
|
|
95
|
-
| ↳ publishProject.ts | `░░░░░░░░░░░░░░░░░░░░` 1.
|
|
93
|
+
| ↳ documentActions.ts | `▒░░░░░░░░░░░░░░░░░░░` 2.7% · 1.8 kB |
|
|
94
|
+
| ↳ documentContributingLicense.ts | `░░░░░░░░░░░░░░░░░░░░` 1.9% · 1.2 kB |
|
|
95
|
+
| ↳ publishProject.ts | `░░░░░░░░░░░░░░░░░░░░` 1.7% · 1.1 kB |
|
|
96
96
|
| ↳ releaseProject.ts | `░░░░░░░░░░░░░░░░░░░░` 1.4% · 972 B |
|
|
97
97
|
| ↳ testProject.ts | `░░░░░░░░░░░░░░░░░░░░` 1.2% · 799 B |
|
|
98
|
-
| ↳ 8 smaller files | `▒░░░░░░░░░░░░░░░░░░░` 4.
|
|
98
|
+
| ↳ 8 smaller files | `▒░░░░░░░░░░░░░░░░░░░` 4.3% · 2.8 kB |
|
|
99
99
|
| (inlined worker) | `░░░░░░░░░░░░░░░░░░░░` 0.0% · 17 B |
|
|
100
|
-
| (bundler output, whitespace & JSON) |
|
|
101
|
-
| **dist/utilities-
|
|
102
|
-
| @dpuse/dpuse-shared → dist/dpuse-shared.es.js | `███████████░░░░░░░░░`
|
|
103
|
-
| src → index.ts | `███████░░░░░░░░░░░░░`
|
|
104
|
-
| valibot → dist/index.mjs | `░░░░░░░░░░░░░░░░░░░░` 1.
|
|
105
|
-
| (bundler output, whitespace & JSON) | `██░░░░░░░░░░░░░░░░░░` 11.
|
|
106
|
-
| **dist/apiReference-
|
|
107
|
-
| src → apiReference.ts | `███████████████████░` 95.
|
|
108
|
-
| (bundler output, whitespace & JSON) | `█░░░░░░░░░░░░░░░░░░░` 4.
|
|
100
|
+
| (bundler output, whitespace & JSON) | `██░░░░░░░░░░░░░░░░░░` 12.4% · 8.2 kB |
|
|
101
|
+
| **dist/utilities-DH1goyH8.js** | 25.8 kB · gzip 7.1 kB · 25.1% of the build |
|
|
102
|
+
| @dpuse/dpuse-shared → dist/dpuse-shared.es.js | `███████████░░░░░░░░░` 52.9% · 13.6 kB |
|
|
103
|
+
| src → index.ts | `███████░░░░░░░░░░░░░` 34.4% · 8.9 kB |
|
|
104
|
+
| valibot → dist/index.mjs | `░░░░░░░░░░░░░░░░░░░░` 1.6% · 413 B |
|
|
105
|
+
| (bundler output, whitespace & JSON) | `██░░░░░░░░░░░░░░░░░░` 11.1% · 2.9 kB |
|
|
106
|
+
| **dist/apiReference-Bg5HYM1L.js** | 8.4 kB · gzip 3.1 kB · 8.2% of the build |
|
|
107
|
+
| src → apiReference.ts | `███████████████████░` 95.3% · 8.0 kB |
|
|
108
|
+
| (bundler output, whitespace & JSON) | `█░░░░░░░░░░░░░░░░░░░` 4.7% · 407 B |
|
|
109
109
|
| **dist/vite.es.js** | 2.5 kB · gzip 1.1 kB · 2.4% of the build |
|
|
110
|
-
| src → vite.ts |
|
|
111
|
-
| (bundler output, whitespace & JSON) |
|
|
110
|
+
| src → vite.ts | `██████████████████░░` 87.7% · 2.2 kB |
|
|
111
|
+
| (bundler output, whitespace & JSON) | `██░░░░░░░░░░░░░░░░░░` 12.3% · 314 B |
|
|
112
112
|
|
|
113
113
|
Bars show each row's share of its output file. ↳ rows are part of the row above.
|
|
114
114
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { j as e, x as t, y as n } from "./utilities-
|
|
1
|
+
import { j as e, x as t, y as n } from "./utilities-DH1goyH8.js";
|
|
2
2
|
import r from "node:path";
|
|
3
3
|
import i from "typescript";
|
|
4
|
-
|
|
4
|
+
// src/utilities/apiReference.ts
|
|
5
5
|
var a = 3, o = "General", s = [
|
|
6
6
|
"Functions",
|
|
7
7
|
"Classes",
|
|
@@ -210,5 +210,4 @@ function P({ description: e, detail: t, name: n, origin: r }) {
|
|
|
210
210
|
function F(e) {
|
|
211
211
|
return `\`${e}\``;
|
|
212
212
|
}
|
|
213
|
-
//#endregion
|
|
214
213
|
export { l as writeAPIReference };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiReference-CdMhhAl1.js","names":["writeTextFile","readJSONFile","logStepHeader","path","ts","TOPIC_GROUPING_MINIMUM","GENERAL_TOPIC","EXPORT_KINDS","API_REFERENCE_INTRO","writeAPIReference","stepIcon","apiReferencePath","entryPoints","resolveEntryPoints","program","sourcePath","readCompilerOptions","checker","fieldGroupOwners","mapFieldGroupOwners","sections","sourceFile","importPath","buildSection","listExports","packageName","packageJSON","exportsField","exportEntries","subpath","target","typesPath","\"types\"","configPath","fileName","config","moduleSymbol","symbol","resolveAlias","exportedSymbol","entry","describeExport","formatExportName","readDescription","readTopic","a","b","resolvePath","unresolvedPath","folder","segment","letter","signature","isSchema","name","formatParameter","parameter","formatOrigin","formatConstantType","description","declaration","variableDeclaration","initializer","isWrittenAs","typeNode","formatTypeNode","clauses","clause","formatCode","type","typeAlias","schemaName","findSchemaName","fields","findSchemaFields","parents","findSchemaParents","parent","group","property","resolveObjectLiteral","owner","typeName","candidates","typeAliases","statement","listFieldGroups","owners","groupCandidates","fewestAdded","addedFieldCount","tied","ownGroup","spreadGroups","argument","isTypeReferenceNamed","returnTypeArgument","fieldsQuery","schema","resolveInitializer","node","declarationName","parameterDeclaration","isOptional","typeText","formatParameterName","names","element","topics","entries","compareTopics","buildKindLists","topicSections","topic","items","kind","formatEntry","headingLevel","detailCode","detail","firstLine","origin","text"],"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 const entryPoints: { importPath: string; sourcePath: string }[] = [];\n for (const [subpath, target] of exportEntries) {\n const typesPath = target != null && typeof target === 'object' && !Array.isArray(target) ? target['types'] : undefined;\n if (typeof typesPath !== 'string') continue;\n const importPath = subpath === '.' ? packageName : `${packageName}${subpath.slice(1)}`;\n const sourcePath = typesPath.replace(/^\\.\\/dist\\/types\\//, '').replace(/\\.d\\.ts$/, '.ts');\n entryPoints.push({ importPath, sourcePath });\n }\n return entryPoints;\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,IAAMK,IAAyB,GAGzBC,IAAgB,WAGhBC,IAA6B;CAAC;CAAa;CAAW;CAAa;CAAW;AAAO,GAErFC,IAAsB;AAO5B,eAAsBC,EAAkB,GAAkB,GAAyC;CAC/F,EAAc,GAAGC,EAAS,UAAUC,EAAiB,EAAE;CAGvD,IAAMC,IAAcC,EAAmB,MADbZ,EAA0B,cAAc,CAChB;CAClD,IAAIW,EAAY,WAAW,GAAG,MAAU,MAAM,qGAAqG;CAInJ,IAAME,IAAUV,EAAG,cACfQ,EAAY,KAAK,EAAE,oBAAiBT,EAAK,QAAQY,CAAU,CAAC,GAC5DC,EAAoB,CACxB,GACMC,IAAUH,EAAQ,eAAe,GACjCI,IAAmBC,EAAoBL,GAASG,CAAO,GAEvDG,IAAWR,EAAY,KAAK,EAAE,eAAY,oBAAiB;EAC7D,IAAMS,IAAaP,EAAQ,cAAcX,EAAK,QAAQY,CAAU,CAAC;EACjE,IAAIM,MAAe,KAAA,GAAW,MAAU,MAAM,mBAAmBN,EAAW,oBAAoBO,EAAW,GAAG;EAC9G,OAAOC,EAAaD,GAAYE,EAAYP,GAASI,GAAYH,CAAgB,CAAC;CACtF,CAAC;CAED,MAAMlB,EAAcW,GAAkB,sBAAsBH,EAAoB,MAAMY,EAAS,KAAK,MAAM,EAAE,GAAG;AACnH;AAMA,SAASP,EAAmB,GAAwE;CAChG,IAAMY,IAAcC,EAAY,QAAQ,IAClCC,IAAeD,EAAY,SAC3BE,IAAwC,OAAOD,KAAiB,YAAhDA,KAA4D,CAAC,MAAM,QAAQA,CAAY,IA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CAAa,IAAIuC,EAAE,cAAcC,CAAC;AAC1G;AAEA,SAASiE,EAAe,GAAwB,GAAgC;CAC5E,OAAOxG,EAAa,SAAS,MAAS;EAClC,IAAM2G,IAAQL,EAAQ,QAAQ,MAAUrE,EAAM,SAAS2E,CAAI,CAAC,CAAC,KAAK,MAAUC,EAAY5E,CAAK,CAAC;EAC9F,OAAO0E,EAAM,WAAW,IAAI,CAAC,IAAI,GAAGG,EAAa,GAAGF,EAAK,MAAMD,EAAM,KAAK,IAAI;CAClF,CAAC;AACL;AAKA,SAASE,EAAY,EAAE,gBAAa,WAAQ,SAAM,aAA+B;CAC7E,IAAME,IAAaC,MAAW,KAAK,KAAKnD,EAAWmD,CAAM,GACnDC,IAAY,OAAOpD,EAAWd,CAAI,EAAE,IAAIgE,IAAaG;CAC3D,OAAO9D,MAAgB,KAAA,IAAY6D,IAAY,GAAGA,EAAU,UAAU7D;AAC1E;AAEA,SAASS,EAAW,GAAsB;CACtC,OAAO,KAAKsD,EAAK;AACrB"}
|
|
1
|
+
{"version":3,"file":"apiReference-Bg5HYM1L.js","names":["writeTextFile","readJSONFile","logStepHeader","path","ts","TOPIC_GROUPING_MINIMUM","GENERAL_TOPIC","EXPORT_KINDS","API_REFERENCE_INTRO","writeAPIReference","stepIcon","apiReferencePath","entryPoints","resolveEntryPoints","program","sourcePath","readCompilerOptions","checker","fieldGroupOwners","mapFieldGroupOwners","sections","sourceFile","importPath","buildSection","listExports","packageName","packageJSON","exportsField","exportEntries","subpath","target","typesPath","\"types\"","configPath","fileName","config","moduleSymbol","symbol","resolveAlias","exportedSymbol","entry","describeExport","formatExportName","readDescription","readTopic","a","b","resolvePath","unresolvedPath","folder","segment","letter","signature","isSchema","name","formatParameter","parameter","formatOrigin","formatConstantType","description","declaration","variableDeclaration","initializer","isWrittenAs","typeNode","formatTypeNode","clauses","clause","formatCode","type","typeAlias","schemaName","findSchemaName","fields","findSchemaFields","parents","findSchemaParents","parent","group","property","resolveObjectLiteral","owner","typeName","candidates","typeAliases","statement","listFieldGroups","owners","groupCandidates","fewestAdded","addedFieldCount","tied","ownGroup","spreadGroups","argument","isTypeReferenceNamed","returnTypeArgument","fieldsQuery","schema","resolveInitializer","node","declarationName","parameterDeclaration","isOptional","typeText","formatParameterName","names","element","topics","entries","compareTopics","buildKindLists","topicSections","topic","items","kind","formatEntry","headingLevel","detailCode","detail","firstLine","origin","text"],"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 const entryPoints: { importPath: string; sourcePath: string }[] = [];\n for (const [subpath, target] of exportEntries) {\n const typesPath = target != null && typeof target === 'object' && !Array.isArray(target) ? target['types'] : undefined;\n if (typeof typesPath !== 'string') continue;\n const importPath = subpath === '.' ? packageName : `${packageName}${subpath.slice(1)}`;\n const sourcePath = typesPath.replace(/^\\.\\/dist\\/types\\//, '').replace(/\\.d\\.ts$/, '.ts');\n entryPoints.push({ importPath, sourcePath });\n }\n return entryPoints;\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,IAAMK,IAAyB,GAGzBC,IAAgB,WAGhBC,IAA6B;CAAC;CAAa;CAAW;CAAa;CAAW;AAAO,GAErFC,IAAsB;AAO5B,eAAsBC,EAAkB,GAAkB,GAAyC;CAC/F,EAAc,GAAGC,EAAS,UAAUC,EAAiB,EAAE;CAGvD,IAAMC,IAAcC,EAAmB,MADbZ,EAA0B,cAAc,CAChB;CAClD,IAAIW,EAAY,WAAW,GAAG,MAAU,MAAM,qGAAqG;CAInJ,IAAME,IAAUV,EAAG,cACfQ,EAAY,KAAK,EAAE,oBAAiBT,EAAK,QAAQY,CAAU,CAAC,GAC5DC,EAAoB,CACxB,GACMC,IAAUH,EAAQ,eAAe,GACjCI,IAAmBC,EAAoBL,GAASG,CAAO,GAEvDG,IAAWR,EAAY,KAAK,EAAE,eAAY,oBAAiB;EAC7D,IAAMS,IAAaP,EAAQ,cAAcX,EAAK,QAAQY,CAAU,CAAC;EACjE,IAAIM,MAAe,KAAA,GAAW,MAAU,MAAM,mBAAmBN,EAAW,oBAAoBO,EAAW,GAAG;EAC9G,OAAOC,EAAaD,GAAYE,EAAYP,GAASI,GAAYH,CAAgB,CAAC;CACtF,CAAC;CAED,MAAMlB,EAAcW,GAAkB,sBAAsBH,EAAoB,MAAMY,EAAS,KAAK,MAAM,EAAE,GAAG;AACnH;AAMA,SAASP,EAAmB,GAAwE;CAChG,IAAMY,IAAcC,EAAY,QAAQ,IAClCC,IAAeD,EAAY,SAC3BE,IAAwC,OAAOD,KAAiB,YAAhDA,KAA4D,CAAC,MAAM,QAAQA,CAAY,IAAI,OAAO,QAAQA,CAAY,IAAI,CAAC,GAE3If,IAA4D,CAAC;CACnE,KAAK,IAAM,CAACiB,GAASC,MAA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EAAa,SAAS,MAAS;EAClC,IAAM2G,IAAQL,EAAQ,QAAQ,MAAUrE,EAAM,SAAS2E,CAAI,CAAC,CAAC,KAAK,MAAUC,EAAY5E,CAAK,CAAC;EAC9F,OAAO0E,EAAM,WAAW,IAAI,CAAC,IAAI,GAAGG,EAAa,GAAGF,EAAK,MAAMD,EAAM,KAAK,IAAI;CAClF,CAAC;AACL;AAKA,SAASE,EAAY,EAAE,gBAAa,WAAQ,SAAM,aAA+B;CAC7E,IAAME,IAAaC,MAAW,KAAK,KAAKnD,EAAWmD,CAAM,GACnDC,IAAY,OAAOpD,EAAWd,CAAI,EAAE,IAAIgE,IAAaG;CAC3D,OAAO9D,MAAgB,KAAA,IAAY6D,IAAY,GAAGA,EAAU,UAAU7D;AAC1E;AAEA,SAASS,EAAW,GAAsB;CACtC,OAAO,KAAKsD,EAAK;AACrB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, C as t, D as n, E as r, M as i, N as a, O as o, S as s, T as c, _ as l, a as u, b as d, c as f, d as p, f as m, g as h, h as g, i as _, k as v, l as y, m as ee, n as te, o as ne, p as b, r as re, s as ie, t as ae, u as oe, v as x, w as S, x as C, y as w } from "./utilities-
|
|
1
|
+
import { A as e, C as t, D as n, E as r, M as i, N as a, O as o, S as s, T as c, _ as l, a as u, b as d, c as f, d as p, f as m, g as h, h as g, i as _, k as v, l as y, m as ee, n as te, o as ne, p as b, r as re, s as ie, t as ae, u as oe, v as x, w as S, x as C, y as w } from "./utilities-DH1goyH8.js";
|
|
2
2
|
import { SHIPPED_PACKAGES_FILE_NAME as se } from "./vite.es.js";
|
|
3
3
|
import { existsSync as ce, promises as T } from "node:fs";
|
|
4
4
|
import E from "node:path";
|
|
@@ -10,7 +10,7 @@ import { init as pe } from "license-checker-rseidelsohn";
|
|
|
10
10
|
import { setTimeout as me } from "node:timers/promises";
|
|
11
11
|
import he from "spdx-satisfies";
|
|
12
12
|
import ge from "node:os";
|
|
13
|
-
|
|
13
|
+
// src/actions/auditDependencies_.json
|
|
14
14
|
var _e = [
|
|
15
15
|
{
|
|
16
16
|
id: "GHSA-fx2h-pf6j-xcff",
|
|
@@ -93,8 +93,7 @@ function Ce(e) {
|
|
|
93
93
|
for (let e of n) for (let n of e.via) typeof n != "string" && t.set(n.url, n);
|
|
94
94
|
return t.values().toArray();
|
|
95
95
|
}
|
|
96
|
-
|
|
97
|
-
//#region src/actions/buildProject.ts
|
|
96
|
+
// src/actions/buildProject.ts
|
|
98
97
|
var we = "build:wasm";
|
|
99
98
|
async function Te() {
|
|
100
99
|
try {
|
|
@@ -106,8 +105,7 @@ async function Te() {
|
|
|
106
105
|
async function Ee(e, t) {
|
|
107
106
|
t.scripts?.[we] != null && await r(`${e} Build WebAssembly`, "npm", ["run", we]), await r(`${e} Bundle project`, "vite", ["build"]);
|
|
108
107
|
}
|
|
109
|
-
|
|
110
|
-
//#region src/actions/checkConfigFiles.ts
|
|
108
|
+
// src/actions/checkConfigFiles.ts
|
|
111
109
|
var D = "@dpuse/dpuse-development/prettierrc", De = "dpuse-development";
|
|
112
110
|
async function Oe() {
|
|
113
111
|
try {
|
|
@@ -207,8 +205,7 @@ async function O(e, t, n = [], r = (e) => e) {
|
|
|
207
205
|
console.info(`❌ File '${t}' is NOT the same`);
|
|
208
206
|
}
|
|
209
207
|
}
|
|
210
|
-
|
|
211
|
-
//#region src/actions/checkDependencies.ts
|
|
208
|
+
// src/actions/checkDependencies.ts
|
|
212
209
|
async function Le() {
|
|
213
210
|
try {
|
|
214
211
|
l("Check Dependencies"), await r("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0), w("2️⃣ Check using 'npm-check-updates'");
|
|
@@ -276,13 +273,11 @@ async function Be(e) {
|
|
|
276
273
|
});
|
|
277
274
|
s.length !== 0 && (n.allowScripts = Object.fromEntries(Object.entries(e).filter(([e]) => Object.hasOwn(r, e) || s.includes(e))), await v(t, n), w(`6️⃣ Restored install-script entries the lockfile still needs: ${s.join(", ")}`));
|
|
278
275
|
}
|
|
279
|
-
|
|
280
|
-
//#region src/actions/checkProject.ts
|
|
276
|
+
// src/actions/checkProject.ts
|
|
281
277
|
async function Ve() {
|
|
282
278
|
await Oe(), await Le();
|
|
283
279
|
}
|
|
284
|
-
|
|
285
|
-
//#region src/actions/documentActions.ts
|
|
280
|
+
// src/actions/documentActions.ts
|
|
286
281
|
var He = "<!-- SUPPORTED_ACTIONS_START -->", Ue = "<!-- SUPPORTED_ACTIONS_END -->", We = "Connectors conform to a unified interface contract by implementing a specific subset of standard actions. These standardised actions allow the DPUse application to interact with any underlying data source in the same way, enabling Connectors to be built independently and loaded dynamically at runtime.", Ge = {
|
|
287
282
|
source: "This connector is a Source connector that supports only read actions. Connectors can also function as a Destination (write-only) or Bidirectional (read/write), depending on the actions they support.",
|
|
288
283
|
destination: "This connector is a Destination connector that supports only write actions. Connectors can also function as a Source (read-only) or Bidirectional (read/write), depending on the actions they support.",
|
|
@@ -298,8 +293,7 @@ async function qe() {
|
|
|
298
293
|
console.error("❌ Error documenting actions", e), process.exit(1);
|
|
299
294
|
}
|
|
300
295
|
}
|
|
301
|
-
|
|
302
|
-
//#region src/actions/documentContributingLicense.ts
|
|
296
|
+
// src/actions/documentContributingLicense.ts
|
|
303
297
|
async function Je() {
|
|
304
298
|
try {
|
|
305
299
|
l("Document Contributing & License");
|
|
@@ -334,8 +328,7 @@ This project is licensed under the MIT License, permitting free use, modificatio
|
|
|
334
328
|
|
|
335
329
|
[MIT](./LICENSE) © ${r} ${n}`;
|
|
336
330
|
}
|
|
337
|
-
|
|
338
|
-
//#region src/utilities/rustCrates.ts
|
|
331
|
+
// src/utilities/rustCrates.ts
|
|
339
332
|
var k = "licenses/cargoMetadata.json", A = "licenses/cargoTree.txt", Qe = 1e3, $e = 1e4, et = "dpuse-development (https://github.com/dpuse/dpuse-development)", tt = /^(?:copying|licen[cs]e|unlicense)/i, nt = "wasm32-unknown-unknown";
|
|
340
333
|
async function rt(e, n) {
|
|
341
334
|
if (await t("rust/Cargo.toml") === null) return null;
|
|
@@ -457,8 +450,7 @@ async function lt(e, t) {
|
|
|
457
450
|
} catch {}
|
|
458
451
|
}
|
|
459
452
|
}
|
|
460
|
-
|
|
461
|
-
//#region src/actions/documentDependencies.ts
|
|
453
|
+
// src/actions/documentDependencies.ts
|
|
462
454
|
var j = "<!-- DEPENDENCY_LICENSES_START -->", M = "<!-- DEPENDENCY_LICENSES_END -->", N = "## Dependency Licenses", ut = `bundle-analysis-reports/${se}`, P = "licenses/licenseTree.json", dt = "Packages flagged ❗ have a newer version available; ⚠️ indicates a package that hasn't been updated in the last 6 months or longer. Neither flag necessarily indicates a problem: we let new releases stabilise before upgrading, and some packages are mature and stable (have limited or no dependencies), so they require no active development.", ft = `The dependency tree below lists every package in this project — direct and transitive — along with its installed version, release date, and update status. ${dt}`, pt = `The dependency tree below shows how each package in the table above is reached — direct and transitive — along with its installed version, release date, and update status. A package that does not ship itself, such as one whose parts are bundled separately, is left out and what ships beneath it is shown in its place. ${dt}`;
|
|
463
455
|
async function mt(e = "MIT") {
|
|
464
456
|
try {
|
|
@@ -726,8 +718,7 @@ function zt(e) {
|
|
|
726
718
|
let n = new Date(t), r = /* @__PURE__ */ new Date(), i = (r.getFullYear() - n.getFullYear()) * 12 + (r.getMonth() - n.getMonth());
|
|
727
719
|
return r.getDate() < n.getDate() && --i, i === 0 ? `this month: ${t}` : i === 1 ? `1 mth ago: ${t}` : i <= 6 ? `${String(i)} mths ago: ${t}` : `${String(i)} mths ago: ${t} ⚠️`;
|
|
728
720
|
}
|
|
729
|
-
|
|
730
|
-
//#region src/actions/documentOpening.ts
|
|
721
|
+
// src/actions/documentOpening.ts
|
|
731
722
|
var Bt = "<!-- OPENING_START -->", Vt = "<!-- OPENING_END -->";
|
|
732
723
|
async function Ht() {
|
|
733
724
|
try {
|
|
@@ -780,8 +771,7 @@ function qt(e, t, n, r) {
|
|
|
780
771
|
|
|
781
772
|
In addition, DPUse provides [Tools](https://www.dpuse.app) used by the application, and you can use them to construct connectors and presenters.${o === void 0 ? "" : `\n\n## Introduction\n\n${o}`}`;
|
|
782
773
|
}
|
|
783
|
-
|
|
784
|
-
//#region src/actions/documentQualitySecurity.ts
|
|
774
|
+
// src/actions/documentQualitySecurity.ts
|
|
785
775
|
var Jt = {
|
|
786
776
|
"Branch-Protection": 3,
|
|
787
777
|
"Code-Review": 0,
|
|
@@ -1029,8 +1019,7 @@ This project is working towards the [OpenSSF Best Practices](https://www.bestpra
|
|
|
1029
1019
|
|
|
1030
1020
|
Please do not open public GitHub issues for security vulnerabilities. ${u}`;
|
|
1031
1021
|
}
|
|
1032
|
-
|
|
1033
|
-
//#region src/actions/documentUsage.ts
|
|
1022
|
+
// src/actions/documentUsage.ts
|
|
1034
1023
|
var yn = "<!-- USAGE_START -->", bn = "<!-- USAGE_END -->", xn = /* @__PURE__ */ new Set([
|
|
1035
1024
|
"connector",
|
|
1036
1025
|
"cookbook",
|
|
@@ -1091,20 +1080,18 @@ _Requires [Node.js](https://nodejs.org/) ${r} or later, [npm](https://www.npmjs.
|
|
|
1091
1080
|
|
|
1092
1081
|
${o}`;
|
|
1093
1082
|
}
|
|
1094
|
-
|
|
1095
|
-
//#region src/actions/documentApiReference.ts
|
|
1083
|
+
// src/actions/documentApiReference.ts
|
|
1096
1084
|
var U = "API_REFERENCE.md";
|
|
1097
1085
|
async function jn() {
|
|
1098
1086
|
try {
|
|
1099
1087
|
l("Document API Reference");
|
|
1100
|
-
let { writeAPIReference: e } = await import("./apiReference-
|
|
1088
|
+
let { writeAPIReference: e } = await import("./apiReference-Bg5HYM1L.js");
|
|
1101
1089
|
await e("1️⃣ ", U), x("API reference documented");
|
|
1102
1090
|
} catch (e) {
|
|
1103
1091
|
console.error("❌ Error documenting API reference", e), process.exit(1);
|
|
1104
1092
|
}
|
|
1105
1093
|
}
|
|
1106
|
-
|
|
1107
|
-
//#region src/actions/documentBundleSizes.ts
|
|
1094
|
+
// src/actions/documentBundleSizes.ts
|
|
1108
1095
|
var Mn = "bundle-analysis-reports/sonda/index.json", Nn = "bundle-analysis-reports/sonda/worker.json", Pn = "<!-- BUNDLE_START -->", Fn = "<!-- BUNDLE_END -->", W = " ", G = 20, In = "█", Ln = "▒", Rn = 100 / G / 2, zn = 100 / G, Bn = 48, Vn = "This report is updated with each release, from the bundle the release builds, using [Sonda](https://sonda.dev/), which analyses final source maps to reveal the actual effects of tree-shaking and minification rather than relying on pre-build estimates.\n\n_Note: Sonda's Vite reports currently exclude CSS files, since Vite does not generate source maps for CSS._", Hn = "Bars show each row's share of its output file.", Un = "↳ rows are part of the row above.", Wn = "+ n more = the row also holds n more files from the same package or folder, each no larger than the one named. A package can appear under several output files, each holding different files, never the same file twice.", K = "(bundler output, whitespace & JSON)", q = "(inlined worker)", Gn = `${q} = a Web Worker built separately and embedded in its output file as text. Where the build records what it contains, its rows list that; any few bytes over are the escaping needed to embed it.`, J = "(Rust WebAssembly as base64", Kn = `${J}…) = the compiled Rust code, embedded as base64 text, about a third larger than the binary it decodes to, which is the size given.`, qn = `${K} = 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.`;
|
|
1109
1096
|
async function Jn(n) {
|
|
1110
1097
|
try {
|
|
@@ -1352,8 +1339,7 @@ function br(e, t) {
|
|
|
1352
1339
|
function $(e) {
|
|
1353
1340
|
return e < 1024 ? `${String(e)} B` : `${(e / 1024).toFixed(1)} kB`;
|
|
1354
1341
|
}
|
|
1355
|
-
|
|
1356
|
-
//#region src/actions/documentProject.ts
|
|
1342
|
+
// src/actions/documentProject.ts
|
|
1357
1343
|
async function xr(e = "MIT", n = !1) {
|
|
1358
1344
|
try {
|
|
1359
1345
|
let i = await C("config.json"), a = g(i.id).typeId === "connector";
|
|
@@ -1368,8 +1354,7 @@ async function xr(e = "MIT", n = !1) {
|
|
|
1368
1354
|
console.error("❌ Error documenting project", e), process.exit(1);
|
|
1369
1355
|
}
|
|
1370
1356
|
}
|
|
1371
|
-
|
|
1372
|
-
//#region src/actions/formatCode.ts
|
|
1357
|
+
// src/actions/formatCode.ts
|
|
1373
1358
|
async function Sr() {
|
|
1374
1359
|
try {
|
|
1375
1360
|
l("Format Code");
|
|
@@ -1389,8 +1374,7 @@ async function Sr() {
|
|
|
1389
1374
|
console.error("❌ Error formatting code", e), process.exit(1);
|
|
1390
1375
|
}
|
|
1391
1376
|
}
|
|
1392
|
-
|
|
1393
|
-
//#region src/actions/lintCode.ts
|
|
1377
|
+
// src/actions/lintCode.ts
|
|
1394
1378
|
async function Cr() {
|
|
1395
1379
|
try {
|
|
1396
1380
|
l("Lint Code"), await r("1️⃣ Lint", "eslint", ["."]), x("Code linted");
|
|
@@ -1398,8 +1382,7 @@ async function Cr() {
|
|
|
1398
1382
|
console.error("❌ Error linting code", e), process.exit(1);
|
|
1399
1383
|
}
|
|
1400
1384
|
}
|
|
1401
|
-
|
|
1402
|
-
//#region src/utilities/cloudflare.ts
|
|
1385
|
+
// src/utilities/cloudflare.ts
|
|
1403
1386
|
var wr = {
|
|
1404
1387
|
".css": "text/css",
|
|
1405
1388
|
".js": "application/javascript",
|
|
@@ -1492,8 +1475,7 @@ async function Mr(e, t) {
|
|
|
1492
1475
|
}
|
|
1493
1476
|
return r;
|
|
1494
1477
|
}
|
|
1495
|
-
|
|
1496
|
-
//#region src/actions/publishProject.ts
|
|
1478
|
+
// src/actions/publishProject.ts
|
|
1497
1479
|
async function Nr() {
|
|
1498
1480
|
try {
|
|
1499
1481
|
l("Publish Project");
|
|
@@ -1519,8 +1501,7 @@ async function Pr(e, t, n, r) {
|
|
|
1519
1501
|
await Ar(t, `dpuse-engine-eu/${r.uploadGroupName}/${i}`), await kr(n);
|
|
1520
1502
|
}
|
|
1521
1503
|
}
|
|
1522
|
-
|
|
1523
|
-
//#region src/actions/releaseProject.ts
|
|
1504
|
+
// src/actions/releaseProject.ts
|
|
1524
1505
|
async function Fr(e = "MIT", t = !1) {
|
|
1525
1506
|
try {
|
|
1526
1507
|
l("Release Project");
|
|
@@ -1552,8 +1533,7 @@ async function Fr(e = "MIT", t = !1) {
|
|
|
1552
1533
|
console.error("❌ Error releasing project", e), process.exit(1);
|
|
1553
1534
|
}
|
|
1554
1535
|
}
|
|
1555
|
-
|
|
1556
|
-
//#region src/actions/syncProjectWithGitHub.ts
|
|
1536
|
+
// src/actions/syncProjectWithGitHub.ts
|
|
1557
1537
|
async function Ir() {
|
|
1558
1538
|
try {
|
|
1559
1539
|
l("Synchronise Project with GitHub");
|
|
@@ -1571,8 +1551,7 @@ async function Ir() {
|
|
|
1571
1551
|
console.error("❌ Error synchronising project with GitHub", e), process.exit(1);
|
|
1572
1552
|
}
|
|
1573
1553
|
}
|
|
1574
|
-
|
|
1575
|
-
//#region src/actions/testProject.ts
|
|
1554
|
+
// src/actions/testProject.ts
|
|
1576
1555
|
var Lr = [
|
|
1577
1556
|
"1️⃣ ",
|
|
1578
1557
|
"2️⃣ ",
|
|
@@ -1609,8 +1588,7 @@ async function zr(e = ["unit"]) {
|
|
|
1609
1588
|
console.error("❌ Error testing project", e), process.exit(1);
|
|
1610
1589
|
}
|
|
1611
1590
|
}
|
|
1612
|
-
|
|
1613
|
-
//#region src/actions/triggerGitHubRelease.ts
|
|
1591
|
+
// src/actions/triggerGitHubRelease.ts
|
|
1614
1592
|
async function Br() {
|
|
1615
1593
|
try {
|
|
1616
1594
|
l("Trigger GitHub Release");
|
|
@@ -1628,5 +1606,4 @@ async function Br() {
|
|
|
1628
1606
|
console.error("❌ Error triggering GitHub release", e), process.exit(1);
|
|
1629
1607
|
}
|
|
1630
1608
|
}
|
|
1631
|
-
//#endregion
|
|
1632
1609
|
export { ye as auditDependencies, Te as buildProject, Ve as checkProject, xr as documentProject, Sr as formatCode, Cr as lintCode, Nr as publishProject, Fr as releaseProject, c as resolveSampleDataContentType, Ir as syncProjectWithGitHub, zr as testProject, Br as triggerGitHubRelease, Dr as uploadDirectoryToR2 };
|