docs: update typedoc, convert packages to esm, generate references (#10699)
This commit is contained in:
1 parent
0559d54c18
commit
870cb6e88c
1210 files changed
+746989
-813362
No files matched your search
@@ -8,6 +8,7 @@
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "yarn clean && tsc",
|
||||
"lint": "eslint --ext .ts src",
|
||||
@@ -15,7 +16,7 @@
|
||||
"watch": "tsc --watch"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typedoc": "0.26.x"
|
||||
"typedoc": "0.27.x"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.12.10",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DeclarationReflection, ReferenceType, ReflectionType } from "typedoc"
|
||||
import { DeclarationReflection, ReferenceType } from "typedoc"
|
||||
|
||||
export function isDmlEntity(reflection: DeclarationReflection) {
|
||||
if (reflection.type?.type !== "reference") {
|
||||
@@ -39,14 +39,31 @@ export function getDmlProperties(
|
||||
}
|
||||
if (
|
||||
!reflectionType.typeArguments?.length ||
|
||||
reflectionType.typeArguments[0].type !== "intersection"
|
||||
reflectionType.typeArguments[0].type !== "reference" ||
|
||||
reflectionType.typeArguments[0].name !== "DMLEntitySchemaBuilder" ||
|
||||
!reflectionType.typeArguments[0].typeArguments?.length ||
|
||||
(reflectionType.typeArguments[0].typeArguments[0].type !== "reflection" &&
|
||||
reflectionType.typeArguments[0].typeArguments[0].type !== "reference")
|
||||
) {
|
||||
return []
|
||||
}
|
||||
|
||||
const schemaType = reflectionType.typeArguments[0].types[0] as ReflectionType
|
||||
let schemaType: DeclarationReflection | undefined
|
||||
|
||||
return schemaType.declaration.children || []
|
||||
if (reflectionType.typeArguments[0].typeArguments[0].type === "reflection") {
|
||||
schemaType = reflectionType.typeArguments[0].typeArguments[0].declaration
|
||||
} else if (
|
||||
reflectionType.typeArguments[0].typeArguments[0].reflection instanceof
|
||||
DeclarationReflection &&
|
||||
reflectionType.typeArguments[0].typeArguments[0].reflection.type?.type ===
|
||||
"reflection"
|
||||
) {
|
||||
schemaType =
|
||||
reflectionType.typeArguments[0].typeArguments[0].reflection.type
|
||||
.declaration
|
||||
}
|
||||
|
||||
return schemaType?.children || []
|
||||
}
|
||||
|
||||
export function getDmlRelationProperties(
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import path from "path"
|
||||
import { fileURLToPath } from "url"
|
||||
|
||||
export const getDirname = (currentFile = import.meta.url) => {
|
||||
const __filename = fileURLToPath(currentFile)
|
||||
return path.dirname(__filename)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import ts from "typescript"
|
||||
import { getUniqueStrArray } from "./str-utils"
|
||||
import { camelToWords } from "./str-formatting"
|
||||
import { getUniqueStrArray } from "./str-utils.js"
|
||||
import { camelToWords } from "./str-formatting.js"
|
||||
|
||||
const RESOLVE_EXPRESSIONS = [`container.resolve`, `req.scope.resolve`]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable no-case-declarations */
|
||||
import { DeclarationReflection, ProjectReflection, SomeType } from "typedoc"
|
||||
import { getProjectChild } from "./get-project-child"
|
||||
import { getProjectChild } from "./get-project-child.js"
|
||||
|
||||
type GetTypeChildrenOptions = {
|
||||
reflectionType: SomeType
|
||||
|
||||
@@ -20,8 +20,8 @@ import {
|
||||
UnionType,
|
||||
UnknownType,
|
||||
} from "typedoc"
|
||||
import { escapeChars, getHTMLChar } from "./str-utils"
|
||||
import { getProjectChild } from "./get-project-child"
|
||||
import { escapeChars, getHTMLChar } from "./str-utils.js"
|
||||
import { getProjectChild } from "./get-project-child.js"
|
||||
|
||||
export type ReflectionParameterType =
|
||||
| ParameterReflection
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
export * from "./dml-utils"
|
||||
export * from "./get-type-children"
|
||||
export * from "./get-project-child"
|
||||
export * from "./get-resolved-resources"
|
||||
export * from "./get-type-str"
|
||||
export * from "./hooks-util"
|
||||
export * from "./step-utils"
|
||||
export * from "./str-formatting"
|
||||
export * from "./str-utils"
|
||||
export * from "./tag-utils"
|
||||
export * from "./workflow-utils"
|
||||
export * from "./dml-utils.js"
|
||||
export * from "./general-utils.js"
|
||||
export * from "./get-type-children.js"
|
||||
export * from "./get-project-child.js"
|
||||
export * from "./get-resolved-resources.js"
|
||||
export * from "./get-type-str.js"
|
||||
export * from "./hooks-util.js"
|
||||
export * from "./step-utils.js"
|
||||
export * from "./str-formatting.js"
|
||||
export * from "./str-utils.js"
|
||||
export * from "./tag-utils.js"
|
||||
export * from "./workflow-utils.js"
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Comment, CommentTag, DeclarationReflection, Reflection } from "typedoc"
|
||||
import { getUniqueStrArray } from "./str-utils"
|
||||
import { getUniqueStrArray } from "./str-utils.js"
|
||||
|
||||
export const getTagsAsArray = (
|
||||
tag: CommentTag,
|
||||
|
||||
Reference in new issue
Block a user