diff --git a/CHANGELOG.md b/CHANGELOG.md index 41dddf86..b457d074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -234,7 +234,7 @@ ## 0.1.0 -- Custom esbuild file +- Custom ESBuild file ## 0.0.11 diff --git a/README.md b/README.md index 2561f537..47b143bc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 🌀 [TypeScriptESBuild] -Builds all your TypeScript files into JavaScript. +Build all your TypeScript files into JavaScript. ## Installation @@ -12,7 +12,13 @@ npm install -D -E typescript-esbuild ## Usage -`package.json` +Through a command line run: + +```sh +npx typescript-esbuild 'Source/**/*.ts' +``` + +or in a `package.json` file: ```json { @@ -24,7 +30,7 @@ npm install -D -E typescript-esbuild ### ESBuild Configuration -Or with a custom esbuild config file: +Or with a custom ESBuild config file: `package.json` @@ -53,6 +59,6 @@ See an example of a configuration file in } ``` -[esbuild]: https://npmjs.org/esbuild -[typedoc]: https://npmjs.org/typedoc +[ESBuild]: https://npmjs.org/esbuild +[TypeDoc]: https://npmjs.org/typedoc [TypeScriptESBuild]: https://npmjs.org/typescript-esbuild diff --git a/Source/Class/Theme.ts b/Source/Class/Theme.ts deleted file mode 100644 index 4067c773..00000000 --- a/Source/Class/Theme.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @module Theme - * - */ -export default class - extends (await import("typedoc")).DefaultTheme - implements Type -{ - public override buildUrls( - ...[Reflection, URLs]: Parameters - ) { - const { Directory } = this._Mapping(Reflection) ?? {}; - - if (Directory) { - if (!(Reflection.url && URL_PREFIX.test(Reflection.url))) { - const URL = [Directory, `${getUrl(Reflection)}.html`].join("/"); - - URLs.push( - new UrlMapping(URL, Reflection, this.reflectionTemplate), - ); - - Reflection.url = URL; - Reflection.hasOwnDocument = true; - } - - Reflection.traverse((Child) => { - if (Child instanceof DeclarationReflection) { - this.buildUrls(Child, URLs); - } else { - applyAnchorUrl(Child, Reflection); - } - - return true; - }); - } else if (Reflection.parent) { - applyAnchorUrl(Reflection, Reflection.parent); - } - - return URLs; - } - - _Mapping = (...[Reflection]: Parameters) => - this.Mapping.find((Mapping) => Reflection.kindOf(Mapping.Kind)); - - Mapping: Mapping[] = [ - { - Kind: [Class], - Directory: "Class", - }, - { - Kind: [Interface], - Directory: "Interface", - }, - { - Kind: [Enum], - Directory: "Enum", - }, - { - Kind: [Namespace, Module], - Directory: "Module", - }, - { - Kind: [TypeAlias], - Directory: "Type", - }, - { - Kind: [_Function], - Directory: "Function", - }, - { - Kind: [Variable], - Directory: "Variable", - }, - ]; -} - -import type Mapping from "../Interface/Mapping.js"; -import type Type from "../Interface/Theme.js"; - -export const { - DeclarationReflection, - DefaultTheme: { URL_PREFIX, getUrl, applyAnchorUrl }, - ReflectionKind: { - Interface, - Class, - Enum, - Namespace, - Module, - TypeAlias, - Function: _Function, - Variable, - }, - UrlMapping, -} = await import("typedoc"); diff --git a/Source/Class/TypeScriptESBuild.ts b/Source/Class/TypeScriptESBuild.ts index 13f798e6..894b5a72 100644 --- a/Source/Class/TypeScriptESBuild.ts +++ b/Source/Class/TypeScriptESBuild.ts @@ -7,9 +7,9 @@ export default new (await import("commander")).Command() .name("TypeScriptESBuild") .version(process.env["VERSION_PACKAGE"] ?? "0.0.1") - .description("Builds files") - .argument("", "Files to build") - .option("-es, --ESBuild ", "esbuild configuration file") - .option("-ts, --TypeScript ", "TypeScript configuration file") + .description("🌀 Build TypeScript") + .argument("", "Build File.") + .option("-es, --ESBuild ", "ESBuild Configuration.") + .option("-ts, --TypeScript ", "TypeScript Configuration.") .action((await import("../Function/Build.js")).default) .parse(); diff --git a/Source/Function/Build.ts b/Source/Function/Build.ts index be7b76d2..52074ebd 100644 --- a/Source/Function/Build.ts +++ b/Source/Function/Build.ts @@ -51,39 +51,6 @@ export default (async (...[File, Option]: Parameters) => { ); Exec(`tsc -p ${Option?.TypeScript ?? "tsconfig.json"}`); - - Exec( - [ - "typedoc", - "--commentStyle all", - "--gitRevision main", - `--customCss ${resolve(`${Current}/../Stylesheet/Theme.css`)}`, - "--includeVersion", - "--out ./Documentation", - `--plugin ${resolve(`${Current}/../../Target/Variable/Load.js`)}`, - "--plugin typedoc-plugin-remove-references", - "--plugin typedoc-plugin-rename-defaults", - "--plugin typedoc-plugin-mdn-links", - "--plugin typedoc-plugin-zod", - "--plugin typedoc-plugin-merge-modules", - "--plugin typedoc-plugin-keywords", - "--searchInComments", - `--keywords ${ - ( - await ( - await import("../Function/JSON.js") - ).default("package.json", process.cwd()) - )?.keywords?.join(" --keywords ") ?? " typescript-esbuild " - }`, - "--theme TypeScriptESBuild", - "--entryPointStrategy expand", - "--mergeModulesRenameDefaults", - "--mergeModulesMergeMode module", - `--entryPoints ${Object.values(Configuration.entryPoints).join( - " --entryPoints ", - )}`, - ].join(" "), - ); }) satisfies Type as Type; import type Type from "../Interface/Build.js"; diff --git a/Source/Stylesheet/Theme.css b/Source/Stylesheet/Theme.css deleted file mode 100644 index e3a44623..00000000 --- a/Source/Stylesheet/Theme.css +++ /dev/null @@ -1,49 +0,0 @@ -:root { - --dark-color-background: #000; - --dark-color-background-secondary: #000; - --dark-code-background: #040404; - --color-accent: #2463eb; - --dark-hl-0: #ffdd00; - --dark-hl-1: #ff66ff; - --dark-hl-2: #ff4444; - --dark-hl-3: #44ffff; - --dark-hl-4: #44ff44; -} - -body #tsd-search .field label { - left: 50%; - margin-left: -20px; - z-index: 1; - text-align: center; -} - -body #tsd-search.has-focus .field label { - display: none; -} - -body #tsd-search .field input { - z-index: 2; -} - -body pre, -body .tsd-page-toolbar, -body .tsd-generator { - border: none; -} - -body .tsd-navigation a, -body .tsd-navigation summary > span, -body .tsd-page-navigation a { - padding: 0.5rem; - border-radius: 8px; -} - -body .tsd-description .tsd-signatures .tsd-signature, -body .tsd-signature, -body .tsd-signatures .tsd-signature, -body .tsd-typography td, -body .tsd-typography th, -body code.tsd-tag { - border-radius: 12px; - border-width: 2px; -} diff --git a/Source/Variable/ESBuild.ts b/Source/Variable/ESBuild.ts index df1bb668..c09869ee 100644 --- a/Source/Variable/ESBuild.ts +++ b/Source/Variable/ESBuild.ts @@ -36,10 +36,6 @@ export default { from: "./Source/Notation/TypeScript.json", to: "./Notation/", }, - { - from: "./Source/Stylesheet/Theme.css", - to: "./Stylesheet/", - }, ], }), ], diff --git a/package.json b/package.json index 1ab3a6d7..684ddb6f 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,7 @@ "keywords": [ "javascript", "typescript", - "esbuild", - "typedoc" + "esbuild" ], "homepage": "https://github.com/Playform/TypeScriptESBuild#readme", "bugs": { @@ -19,9 +18,9 @@ }, "license": "SEE LICENSE IN LICENSE", "author": { - "name": "Nikola R. Hristov", - "email": "Nikola@Playform.Cloud", - "url": "https://nikolahristov.tech" + "name": "Playform", + "email": "Hello@Playform.Cloud", + "url": "https://playform.cloud" }, "type": "module", "main": "./Target/Class/TypeScriptESBuild.js",