diff --git a/docs/.templates/code-highlight/code-highlight.ejs b/docs/.templates/code-highlight/code-highlight.ejs new file mode 100644 index 00000000000..de070a91005 --- /dev/null +++ b/docs/.templates/code-highlight/code-highlight.ejs @@ -0,0 +1,3 @@ +```ts +<%- code %> +``` diff --git a/docs/.templates/code-highlight/code-highlight.js b/docs/.templates/code-highlight/code-highlight.js new file mode 100644 index 00000000000..ad50086dd69 --- /dev/null +++ b/docs/.templates/code-highlight/code-highlight.js @@ -0,0 +1,11 @@ +import {stripsComments} from "@tsed/ts-doc/src/utils/strips.js"; + +export default { + name: "codeHighlight", + trim: false, + method(overview, symbolName, deprecated) { + return {code: stripsComments(overview + .replace(/( )+#private;\n/gi, "")) + .replace(/\n( )+\n/gi, '\n'), deprecated}; + } +}; diff --git a/docs/.templates/page/page.ejs b/docs/.templates/page/page.ejs new file mode 100644 index 00000000000..ee8c8e10808 --- /dev/null +++ b/docs/.templates/page/page.ejs @@ -0,0 +1,30 @@ +--- +meta: + - name: keywords + description: api typescript node.js documentation <%- symbol.symbolName %> <%- symbol.symbolType %> +--- +# <%- symbol.symbolLabel %> <%- symbol.symbolName %> + +<%- components.symbolSummary(symbol) %> +<% if(symbol.overview) { %> + +## Overview + +<%- components.codeHighlight(symbol.overview, symbol.symbolName) %> +<% } + +if (hasParams) { %> +<%- components.symbolParams(params, symbol.overview) %> +<% } + +if (description) { %> + +## Description + +<%- description %> +<% } + +if (symbol.members.length) { %> + +<%- components.symbolMembers(symbol) %> +<% } %> diff --git a/docs/.templates/page/page.js b/docs/.templates/page/page.js new file mode 100644 index 00000000000..8d23626ca01 --- /dev/null +++ b/docs/.templates/page/page.js @@ -0,0 +1,21 @@ +export default { + name: "page", + trim: false, + method(symbol) { + let params = [], + hasParams = false; + let description = symbol.description || ""; + + if (symbol.symbolType === "function" || symbol.symbolType === "decorator") { + params = symbol.getParams(); + hasParams = params.length && symbol.overview.match(/\((.*)\):/); + } + + return { + params, + hasParams, + symbol, + description + }; + } +}; diff --git a/docs/.templates/page/page.old b/docs/.templates/page/page.old new file mode 100644 index 00000000000..db5a37cf511 --- /dev/null +++ b/docs/.templates/page/page.old @@ -0,0 +1,25 @@ +<%- components.symbolHeader(symbol) %> + +<%- components.symbolSummary(symbol) %> + +<% if(symbol.overview) { %> + +### Overview + +<%- components.codeHighlight(symbol.overview, symbol.symbolName) %> +<% } %> + +<% if (hasParams) { %> +<%- components.symbolParams(params, symbol.overview) %> +<% } %> + +<% if (description) { %> + +### Description + +<%- description %> +<% } %> + +<% if (symbol.members.length) { %> +<%- components.symbolMembers(symbol) %> +<% } %> \ No newline at end of file diff --git a/docs/.templates/symbol-header/symbol-header.ejs b/docs/.templates/symbol-header/symbol-header.ejs new file mode 100644 index 00000000000..8e6d3a3fde1 --- /dev/null +++ b/docs/.templates/symbol-header/symbol-header.ejs @@ -0,0 +1 @@ + <%- labels.map((label) => components.symbolLabel(label)).join(' ') %> \ No newline at end of file diff --git a/docs/.templates/symbol-header/symbol-header.js b/docs/.templates/symbol-header/symbol-header.js new file mode 100644 index 00000000000..3ec0a807e04 --- /dev/null +++ b/docs/.templates/symbol-header/symbol-header.js @@ -0,0 +1,28 @@ +export default { + name: "symbolHeader", + trim: true, + method(symbol) { + const ignoreLabels = ["type", "returns", "decorator", "param", "constructor"]; + const id = symbol.symbolName.replace(/ /gi, "").toLowerCase(); + let isPrivateAdded; + + const labels = (symbol.labels || []) + .filter((label) => ignoreLabels.indexOf(label.key) === -1) + .filter((label) => { + if (label.key === "private" && !isPrivateAdded) { + isPrivateAdded = true; + return true; + } + if (label.key === "private") { + return !isPrivateAdded; + } + return true; + }); + + return { + id, + symbol, + labels + }; + } +}; diff --git a/docs/.templates/symbol-label/symbol-label.ejs b/docs/.templates/symbol-label/symbol-label.ejs new file mode 100644 index 00000000000..3fe2d312026 --- /dev/null +++ b/docs/.templates/symbol-label/symbol-label.ejs @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/.templates/symbol-label/symbol-label.js b/docs/.templates/symbol-label/symbol-label.js new file mode 100644 index 00000000000..a768b799ff1 --- /dev/null +++ b/docs/.templates/symbol-label/symbol-label.js @@ -0,0 +1,7 @@ +export default { + name: "symbolLabel", + trim: true, + method(label) { + return {label}; + } +}; diff --git a/docs/.templates/symbol-member/symbol-member.ejs b/docs/.templates/symbol-member/symbol-member.ejs new file mode 100644 index 00000000000..7561886fbf9 --- /dev/null +++ b/docs/.templates/symbol-member/symbol-member.ejs @@ -0,0 +1,9 @@ +## <%- title %> + +<%- components.codeHighlight(member.overview.trim(), undefined) %> +<% if (hasParams) { %> +<%- components.symbolParams(member.params, member.overview) %> +<% } %> +<% if (member.description) { %> +<%- member.description %> +<% } %> diff --git a/docs/.templates/symbol-member/symbol-member.js b/docs/.templates/symbol-member/symbol-member.js new file mode 100644 index 00000000000..680b2fff9f0 --- /dev/null +++ b/docs/.templates/symbol-member/symbol-member.js @@ -0,0 +1,25 @@ +export default { + name: "symbolMember", + method(member) { + let deprecated = false; + const hasParams = member.params.length && member.overview.match(/\((.*)\):/); + + if (member.labels) { + if (member.labels.find((k) => k.key === "deprecated")) { + deprecated = true; + } + } + + const title = member.overview.match(/(.*)(\(|\?|=|:)+/) + + return { + title: title ? title[1] + .split("(")[0] + .split("<")[0] + .trim() : "", + member, + deprecated, + hasParams + }; + } +}; diff --git a/docs/.templates/symbol-members/symbol-members.ejs b/docs/.templates/symbol-members/symbol-members.ejs new file mode 100644 index 00000000000..cc30ebf7686 --- /dev/null +++ b/docs/.templates/symbol-members/symbol-members.ejs @@ -0,0 +1,19 @@ +<%# Constructor %> +<% if (hasConstructor) { %> + +## Constructor + +<% if (hasConstructorOverview) { %> +<%- components.codeHighlight(construct.overview) %> +<% } %> + +<% if (construct.description) { %> +<%- construct.description %> +<% } %> + +<% } %> +<% if (members.length) { %> +<% members.forEach((member, index, map) => { %> +<%- components.symbolMember(member) %> +<% }) %> +<% } %> diff --git a/docs/.templates/symbol-members/symbol-members.js b/docs/.templates/symbol-members/symbol-members.js new file mode 100644 index 00000000000..4f9c2f088e6 --- /dev/null +++ b/docs/.templates/symbol-members/symbol-members.js @@ -0,0 +1,20 @@ +export default { + name: "symbolMembers", + trim: false, + method(symbol) { + const flattenMembers = symbol.getMembers(); + const construct = flattenMembers.filter((member) => member.overview.match("constructor"))[0]; + const hasConstructor = construct && (construct.description || !construct.overview.match("constructor()")); + let hasConstructorOverview = hasConstructor && construct.overview.match("constructor()"); + const members = flattenMembers + .filter((member) => !member.overview.includes("#private")) + .filter((member) => !member.overview.match("constructor")); + + return { + hasConstructor, + hasConstructorOverview, + members, + construct + }; + } +}; diff --git a/docs/.templates/symbol-params/symbol-params.ejs b/docs/.templates/symbol-params/symbol-params.ejs new file mode 100644 index 00000000000..a88559c8f4f --- /dev/null +++ b/docs/.templates/symbol-params/symbol-params.ejs @@ -0,0 +1,6 @@ + +<% params.forEach(param => { %> + +- **<%- param.paramKey %>** (<%- param.type %>): <%- param.description %> + +<% }) %> diff --git a/docs/.templates/symbol-params/symbol-params.js b/docs/.templates/symbol-params/symbol-params.js new file mode 100644 index 00000000000..fdfaa1ad273 --- /dev/null +++ b/docs/.templates/symbol-params/symbol-params.js @@ -0,0 +1,39 @@ + +export default { + name: "symbolParams", + trim: false, + method(params, overview) { + const signatureMatch = overview.match(/\((.*)\):/); + const signature = signatureMatch[1] + ","; + + params = params.map((param) => { + const matched = signature.match(new RegExp(`${param.paramKey}(\\?)?:?(.[^,]+),`)); + const type = (param.type || matched[2] ? matched[2].trim() : "") + .split("|") + .map((type) => { + // type = bindSymbols(type.trim(), ""); + + // if (type.startsWith("<") && type.endsWith(">")) { + // return type; + // } + + return `\`${type.trim()}\``.trim(); + }) + .join(" | "); + + const description = (matched[1] ? "Optional. " : "") + param.description.replace(/Optional\.?/gi, "").trim(); + + return { + param, + signature, + paramKey: param.paramKey, + type: type, + description + }; + }); + + return { + params + }; + } +}; diff --git a/docs/.templates/symbol-summary/symbol-summary.ejs b/docs/.templates/symbol-summary/symbol-summary.ejs new file mode 100644 index 00000000000..c1facf53dbe --- /dev/null +++ b/docs/.templates/symbol-summary/symbol-summary.ejs @@ -0,0 +1,7 @@ +## Usage + +```typescript +import { <%- symbol.symbolName %> } from "<%- symbol.importFrom %>"; +``` + +> See [<%- symbol.relativePath %>](<%- symbol.githubUrl %>). diff --git a/docs/.templates/symbol-summary/symbol-summary.js b/docs/.templates/symbol-summary/symbol-summary.js new file mode 100644 index 00000000000..b8b971c927a --- /dev/null +++ b/docs/.templates/symbol-summary/symbol-summary.js @@ -0,0 +1,9 @@ +export default { + name: "symbolSummary", + trim: false, + method(symbol) { + return { + symbol + }; + } +}; diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 6efd39dd830..fa460c96120 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -15,10 +15,8 @@ export default defineConfig({ // ['link', { rel: 'icon', type: 'image/svg+xml', href: '/tsed.svg' }], ["link", {rel: "icon", type: "image/png", href: "/tsed-og.png"}], ["link", {rel: "shortcut icon", href: "/favicon.ico", type: "image/x-icon"}], - ["link", {rel: "icon", href: "/favicon.ico", type: "apple-touch-icon"}], - ["link", {rel: "icon", href: "/apple-touch-icon.png", type: "image/x-icon", sizes: "180x180"}], - ["link", {rel: "icon", href: "/favicon-32x32.png", type: "image/png", sizes: "32x32"}], - ["link", {rel: "icon", href: "/favicon-16x16.png", type: "image/png", sizes: "16x16"}], + ["link", {rel: "icon", href: "/icon512_maskable.png", type: "apple-touch-icon"}], + ["link", {rel: "icon", href: "/icon512_maskable.png", type: "image/x-icon", sizes: "512x512"}], ["meta", {name: "theme-color", content: "#5f67ee"}], ["meta", {property: "og:type", content: "website"}], ["meta", {property: "og:locale", content: "en"}], @@ -31,8 +29,8 @@ export default defineConfig({ themeConfig: { logo: "/tsed.svg", siteTitle: false, - apiUrl: "https://tsed.io/api.json", - apiRedirectUrl: "https://api-docs.tsed.io", + apiUrl: "http://localhost:5173/api.json", + apiRedirectUrl: "", repo: "tsedio/tsed", githubProxyUrl: "https://api.tsed.io/rest/github/tsedio/tsed", editLink: { @@ -163,7 +161,8 @@ export default defineConfig({ link: `/docs/testing` }, {text: "Upload files", link: "/docs/upload-files"}, - {text: "Customize 404", link: "/docs/not-found-page"} + {text: "Customize 404", link: "/docs/not-found-page"}, + {text: "Api references", link: "/api"}, ] }, { @@ -433,6 +432,10 @@ export default defineConfig({ { text: "Customize 404", link: "/docs/not-found-page" + }, + { + text: "Api references", + link: "/api" } ] } diff --git a/docs/api.data.ts b/docs/api.data.ts new file mode 100644 index 00000000000..1f1887641e7 --- /dev/null +++ b/docs/api.data.ts @@ -0,0 +1,21 @@ +import {defineLoader} from "vitepress"; +import * as fs from "node:fs/promises"; +import {mapApiReferences} from "@tsed/vitepress-theme/composables/api/mappers/mapApiReferences"; +import type {ApiResponse} from "@tsed/vitepress-theme/composables/api/interfaces/Api"; + +export interface Data extends ApiResponse { + // data type +} + +declare const data: Data; +export {data}; + +export default defineLoader({ + watch: ["./public/api.json"], + async load(watchedFiles) { + // fetch remote data + const response = JSON.parse(await fs.readFile(watchedFiles[0], {encoding: "utf-8"})); + + return mapApiReferences(response); + } +}); diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 00000000000..57d29bf12ec --- /dev/null +++ b/docs/api.md @@ -0,0 +1,14 @@ +--- +layout: page +meta: + - name: description + content: Api Reference of Ts.ED. Use decorator to build your model and map data. + - name: keywords + content: api reference model decorators ts.ed express typescript node.js javascript jsonschema json mapper serialization deserialization +--- + + + + diff --git a/docs/package.json b/docs/package.json index 01bf0910140..5b0fb2a2179 100644 --- a/docs/package.json +++ b/docs/package.json @@ -8,7 +8,7 @@ "docs:preview": "vitepress preview ." }, "dependencies": { - "@tsed/vitepress-theme": "1.0.8", + "@tsed/vitepress-theme": "1.2.2", "@vueuse/core": "10.11.0", "axios": "1.7.7", "lodash": "4.17.21", diff --git a/docs/public/apple-touch-icon.png b/docs/public/apple-touch-icon.png deleted file mode 100644 index 7b3ccc8ee82..00000000000 Binary files a/docs/public/apple-touch-icon.png and /dev/null differ diff --git a/docs/public/icon512_maskable.png b/docs/public/icon512_maskable.png new file mode 100644 index 00000000000..99216bbc294 Binary files /dev/null and b/docs/public/icon512_maskable.png differ diff --git a/docs/public/tsed.png b/docs/public/tsed.png new file mode 100644 index 00000000000..ccff1e837a1 Binary files /dev/null and b/docs/public/tsed.png differ diff --git a/docs/yarn.lock b/docs/yarn.lock index 22381041d26..a13b7f8e469 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -734,7 +734,7 @@ __metadata: version: 0.0.0-use.local resolution: "@tsed/docs-new@workspace:." dependencies: - "@tsed/vitepress-theme": "npm:1.0.8" + "@tsed/vitepress-theme": "npm:1.2.0" "@vueuse/core": "npm:10.11.0" autoprefixer: "npm:^10.4.19" axios: "npm:1.7.7" @@ -746,14 +746,14 @@ __metadata: languageName: unknown linkType: soft -"@tsed/vitepress-theme@npm:1.0.8": - version: 1.0.8 - resolution: "@tsed/vitepress-theme@npm:1.0.8" +"@tsed/vitepress-theme@npm:1.2.0": + version: 1.2.0 + resolution: "@tsed/vitepress-theme@npm:1.2.0" dependencies: "@vueuse/core": "npm:10.11.0" axios: "npm:1.7.7" lucide-vue-next: "npm:^0.436.0" - checksum: 10/b20cba3e438419347298dc76ad8460eec78e04a3021f466943b04fc70b032fbdc139a82b4a46c313411ab32b2800a839436ac822f14e79466e3ed1d9d7ecf376 + checksum: 10/acac9f8f7f0ef8a17311e6fd0991cb6f3c5fdb45bd17d065b78836eaedec674f2d68c6accca756baab01f5c413d92992eff19cb0fa64a26005fa1aa84fbe95c3 languageName: node linkType: hard diff --git a/package.json b/package.json index 07ee41e443c..7cc82304679 100644 --- a/package.json +++ b/package.json @@ -45,17 +45,14 @@ "build:references": "node ./tools/typescript", "build:eslint": "node ./tools/eslint", "sync:packages": "monorepo sync packages", - "api:build": "lerna run build && tsdoc", - "docs:install": "sh ./scripts/docs/install.sh", + "api:build": "lerna run build --concurrency=4 && tsdoc", + "api:build:dev": "npx -p chokidar-cli chokidar \"docs/.templates/**/*.{js,ejs}\" -c \"tsdoc\"", + "docs:install": "cd docs && yarn install && cd ..", "docs:serve": "yarn api:build && yarn vitepress:docs:serve", "docs:build": "yarn api:build && yarn vitepress:build", "docs:publish": "CI=1 monorepo publish ghpages", - "//vitepress:build": "yarn vitepress:docs:build && yarn vitepress:ref:build", - "vitepress:build": "yarn vitepress:docs:build", - "vitepress:docs:build": "rm -rf ./docs/api && cd ./docs && yarn docs:build", - "vitepress:ref:build": "cd ./docs-references && yarn vitepress:build", + "vitepress:build": "rm -rf ./docs/api && cd ./docs && yarn docs:build", "vitepress:docs:serve": "yarn docs:install && cd docs && yarn docs:serve -p 8080", - "vitepress:ref:serve": "yarn docs:install && cd docs-references && yarn docs:serve -p 8081", "prettier": "prettier '**/*.{ts,js,json,md,yml,yaml}' --write", "release": "semantic-release", "release:dryRun": "semantic-release --dry-run", @@ -118,7 +115,7 @@ "@swc/core": "1.7.28", "@swc/helpers": "0.5.13", "@tsed/monorepo-utils": "2.3.9", - "@tsed/ts-doc": "4.1.0", + "@tsed/ts-doc": "5.0.0", "@types/axios": "0.14.0", "@types/globby": "9.1.0", "@types/node": "22.7.4", @@ -203,13 +200,6 @@ "cname": "tsed.dev", "if": "production" }, - { - "dir": "./docs-references/.vuepress/dist", - "url": "https://github.com/tsedio/api-docs.tsed.io.git", - "branch": "main", - "cname": "api-docs.tsed.dev", - "if": "production" - }, { "dir": "./docs/.vuepress/dist", "url": "https://github.com/tsedio/rc.tsed.dev.git", diff --git a/packages/core/src/domain/Store.ts b/packages/core/src/domain/Store.ts index 021c0f6131f..dd3abac19ef 100644 --- a/packages/core/src/domain/Store.ts +++ b/packages/core/src/domain/Store.ts @@ -72,7 +72,7 @@ function defineStore(args: any[]): Store { export class Store { private _entries = new Map(); /** - * Create or get a Store from args {target + methodName + descriptor} + * Create or get a Store from given args (target, property, descriptor). * @param args * @returns {Store} */ diff --git a/packages/orm/mikro-orm/src/MikroOrmModule.ts b/packages/orm/mikro-orm/src/MikroOrmModule.ts index 4e4b62c64af..5bd15734ee2 100644 --- a/packages/orm/mikro-orm/src/MikroOrmModule.ts +++ b/packages/orm/mikro-orm/src/MikroOrmModule.ts @@ -1,4 +1,4 @@ -import "./services/MikroOrmFactory"; +import "./services/MikroOrmFactory.js"; import {EventSubscriber, Options} from "@mikro-orm/core"; import {classOf, isFunction, Store} from "@tsed/core"; diff --git a/packages/platform/platform-http/src/common/decorators/multer/multerFileSize.ts b/packages/platform/platform-http/src/common/decorators/multer/multerFileSize.ts index c784f281874..7f2a8419e02 100644 --- a/packages/platform/platform-http/src/common/decorators/multer/multerFileSize.ts +++ b/packages/platform/platform-http/src/common/decorators/multer/multerFileSize.ts @@ -21,7 +21,7 @@ import {MulterOptions} from "./multerOptions.js"; * } * ``` * - * > See the tutorial on the [multer configuration](/tutorials/multer.md). + * > See the tutorial on the [multer configuration](/docs/upload-files.md). * @param fileSize * @returns {(target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} * @decorator diff --git a/packages/platform/platform-http/src/common/decorators/multer/multerOptions.ts b/packages/platform/platform-http/src/common/decorators/multer/multerOptions.ts index 16d46c6c673..e13346e07b0 100644 --- a/packages/platform/platform-http/src/common/decorators/multer/multerOptions.ts +++ b/packages/platform/platform-http/src/common/decorators/multer/multerOptions.ts @@ -37,7 +37,7 @@ import {PlatformMulterMiddleware} from "../../middlewares/PlatformMulterMiddlewa * } * ``` * - * See the tutorial on the [multer configuration](/tutorials/multer.md). + * See the tutorial on the [multer configuration](/docs/upload-files.md). * * @param {multer.Options} options * @returns {(target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} diff --git a/packages/platform/platform-http/src/common/decorators/multer/multipartFile.ts b/packages/platform/platform-http/src/common/decorators/multer/multipartFile.ts index a3b33b956dc..2cbf416d4ff 100644 --- a/packages/platform/platform-http/src/common/decorators/multer/multipartFile.ts +++ b/packages/platform/platform-http/src/common/decorators/multer/multipartFile.ts @@ -53,7 +53,7 @@ function mapOptions(name: string, maxCount: number | undefined): MulterInputOpti * } * ``` * - * > See the tutorial on the [multer configuration](/tutorials/multer.md). + * > See the tutorial on the [multer configuration](/docs/upload-files.md). * * @param name * @param maxCount diff --git a/packages/specs/schema/src/decorators/common/format.ts b/packages/specs/schema/src/decorators/common/format.ts index e3617ff3586..641c20e9116 100644 --- a/packages/specs/schema/src/decorators/common/format.ts +++ b/packages/specs/schema/src/decorators/common/format.ts @@ -142,7 +142,6 @@ export const Format = withErrorMsg("format", (format: JsonFormatTypes | ValueOf< * } * ``` * - * > See [Format](api/common/jsonschema/schema) decorator. * @returns {Function} * @decorator * @validation @@ -209,7 +208,6 @@ export const Email = withErrorMsg("format", () => { * } * ``` * - * > See [Format](api/common/jsonschema/schema) decorator. * @returns {Function} * @decorator * @validation @@ -277,7 +275,6 @@ export const DateTime = withErrorMsg("format", () => { * } * ``` * - * > See [Format](api/common/jsonschema/schema) decorator. * @returns {Function} * @decorator * @validation @@ -344,7 +341,6 @@ export const DateFormat = withErrorMsg("format", () => { * } * ``` * - * > See [Format](api/common/jsonschema/schema) decorator. * @returns {Function} * @decorator * @validation @@ -411,7 +407,6 @@ export const TimeFormat = withErrorMsg("format", () => { * } * ``` * - * > See [Format](api/common/jsonschema/schema) decorator. * @returns {Function} * @decorator * @validation @@ -478,7 +473,6 @@ export const Uri = withErrorMsg("format", () => { * } * ``` * - * > See [Format](api/common/jsonschema/schema) decorator. * @returns {Function} * @decorator * @validation diff --git a/packages/third-parties/event-emitter/src/EventEmitterModule.ts b/packages/third-parties/event-emitter/src/EventEmitterModule.ts index fe0aefddf7a..2d494aaa18e 100644 --- a/packages/third-parties/event-emitter/src/EventEmitterModule.ts +++ b/packages/third-parties/event-emitter/src/EventEmitterModule.ts @@ -1,5 +1,5 @@ import {Constant, Inject, InjectorService, LOGGER, Module, Provider} from "@tsed/di"; -import {ListenerFn} from "eventemitter2"; +import type {ListenerFn} from "eventemitter2"; import {EventEmitterStore} from "./interfaces/EventEmitterStore.js"; import {EventEmitterService} from "./services/EventEmitterFactory.js"; diff --git a/packages/third-parties/event-emitter/src/interfaces/EventEmitterStore.ts b/packages/third-parties/event-emitter/src/interfaces/EventEmitterStore.ts index 31b799809e4..7072702c158 100644 --- a/packages/third-parties/event-emitter/src/interfaces/EventEmitterStore.ts +++ b/packages/third-parties/event-emitter/src/interfaces/EventEmitterStore.ts @@ -1,4 +1,4 @@ -import {event, eventNS, OnOptions} from "eventemitter2"; +import type {event, eventNS, OnOptions} from "eventemitter2"; export interface EventEmitterStore { onEvent?: {[propertyKey: string]: {event: event | eventNS; options?: boolean | OnOptions}}; diff --git a/packages/third-parties/event-emitter/src/services/EventEmitterFactory.ts b/packages/third-parties/event-emitter/src/services/EventEmitterFactory.ts index 785ca51f069..186b415370c 100644 --- a/packages/third-parties/event-emitter/src/services/EventEmitterFactory.ts +++ b/packages/third-parties/event-emitter/src/services/EventEmitterFactory.ts @@ -1,15 +1,15 @@ import {Configuration, registerProvider} from "@tsed/di"; import type {ConstructorOptions} from "eventemitter2"; -import {EventEmitter2} from "eventemitter2"; +import eventEmitter2 from "eventemitter2"; -export const EventEmitterService = EventEmitter2; -export type EventEmitterService = EventEmitter2; +export const EventEmitterService = eventEmitter2.EventEmitter2; +export type EventEmitterService = eventEmitter2.EventEmitter2; registerProvider({ - provide: EventEmitter2, + provide: eventEmitter2.EventEmitter2, deps: [Configuration], useFactory(settings: Configuration) { const opts = settings.get("eventEmitter", {enabled: false}); - return opts.enabled ? new EventEmitter2(opts) : {}; + return opts.enabled ? new eventEmitter2.EventEmitter2(opts) : {}; } }); diff --git a/scripts/docs/install.sh b/scripts/docs/install.sh index 7727034d867..7d38351f9c7 100644 --- a/scripts/docs/install.sh +++ b/scripts/docs/install.sh @@ -1,36 +1 @@ cd docs && yarn install && cd .. - -# clean -rm -rf "$PWD/docs-references/package.json" -rm -rf "$PWD/docs-references/.vitepress/scripts" -rm -rf "$PWD/docs-references/.vitepress/components" -rm -rf "$PWD/docs-references/.vitepress/styles" -rm -rf "$PWD/docs-references/.vitepress/public" -rm -rf "$PWD/docs-references/assets" -rm -rf "$PWD/docs-references/.vuepress/enhanceApp.js" -rm -rf "$PWD/docs-references/.vuepress/config.base.js" -rm -rf "$PWD/docs-references/node_modules" -rm -rf "$PWD/docs-references/docs/getting-started/" -rm -rf "$PWD/docs-references/docs/snippets/" -rm -rf "$PWD/docs-references/tutorials/snippets/" - -# install -cp -f "$PWD/docs/package.json" "$PWD/docs-references" -cp -R -f "$PWD/docs/assets" "$PWD/docs-references/assets" -cp -R -f "$PWD/docs/.vuepress/scripts" "$PWD/docs-references/.vuepress/scripts" -cp -R -f "$PWD/docs/.vuepress/components" "$PWD/docs-references/.vuepress/components" -cp -R -f "$PWD/docs/.vuepress/styles" "$PWD/docs-references/.vuepress/styles" -cp -R -f "$PWD/docs/.vuepress/public" "$PWD/docs-references/.vuepress/public" -cp -f "$PWD/docs/.vuepress/enhanceApp.js" "$PWD/docs-references/.vuepress" -cp -f "$PWD/docs/.vuepress/config.base.js" "$PWD/docs-references/.vuepress" -cp -f "$PWD/docs/.vuepress/window-boot.js" "$PWD/docs-references/.vuepress" - -mkdir "$PWD/docs-references/docs/" -mkdir "$PWD/docs-references/docs/getting-started/" -mkdir "$PWD/docs-references/tutorials/" - -cp -R -f "$PWD/docs/snippets" "$PWD/docs-references/docs/snippets" -cp -R -f "$PWD/docs/getting-started/snippets" "$PWD/docs-references/docs/getting-started/snippets" -cp -R -f "$PWD/docs/tutorials/snippets" "$PWD/docs-references/tutorials/snippets" - -ln -s "$PWD/docs/node_modules" "$PWD/docs-references/node_modules" diff --git a/tsdoc.config.js b/tsdoc.config.js index d53967b9c2c..84aac9034bc 100644 --- a/tsdoc.config.js +++ b/tsdoc.config.js @@ -43,9 +43,10 @@ module.exports = { "!/packages/platform/platform-test-sdk", "!**/node_modules" ], - outputDir: "/docs-references/api", + outputDir: "/docs/api", baseUrl: "/api", jsonOutputDir: "/docs/public", + templatesDir: "/docs/.templates", scope: "@tsed", modules: {} }; diff --git a/yarn.lock b/yarn.lock index d63a08311d7..9dcb511f3c3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8043,7 +8043,7 @@ __metadata: "@swc/helpers": "npm:0.5.13" "@tsed/logger": "npm:^6.7.8" "@tsed/monorepo-utils": "npm:2.3.9" - "@tsed/ts-doc": "npm:4.1.0" + "@tsed/ts-doc": "npm:5.0.0" "@types/axios": "npm:0.14.0" "@types/globby": "npm:9.1.0" "@types/node": "npm:22.7.4" @@ -8417,9 +8417,9 @@ __metadata: languageName: unknown linkType: soft -"@tsed/ts-doc@npm:4.1.0": - version: 4.1.0 - resolution: "@tsed/ts-doc@npm:4.1.0" +"@tsed/ts-doc@npm:5.0.0": + version: 5.0.0 + resolution: "@tsed/ts-doc@npm:5.0.0" dependencies: chalk: "npm:3.0.0" ejs: "npm:2.7.1" @@ -8428,11 +8428,12 @@ __metadata: glob: "npm:7.1.6" globby: "npm:8.0.2" listr: "npm:^0.14.3" + lodash: "npm:^4.17.21" normalize-path: "npm:3.0.0" read-pkg-up: "npm:7.0.0" bin: tsdoc: bin/tsdoc.js - checksum: 10/c51352c32265a086e7f09ef202952234353481d2429d8eec3902e0c7b3c47d80b271c4126a450a538037be0c05fe8ee0b93e9ed4dd938205dd71e20418aa50d7 + checksum: 10/0e726341daae5fcc1e6cf86e9be23b384e9348c1b1d5591b1185f3f26afb39c2e163855a05b123179aa82a91698d6fc1e1dc6ad6808d39641e4f7d08d817118a languageName: node linkType: hard