Skip to content

Commit

Permalink
squash!
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Dec 17, 2023
1 parent 04660c9 commit fcf269d
Show file tree
Hide file tree
Showing 34 changed files with 2,772 additions and 179 deletions.
2,303 changes: 2,299 additions & 4 deletions Documentation/assets/main.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Documentation/assets/navigation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Documentation/assets/search.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Source/Class/Theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class
const URL = [Directory, `${getUrl(Reflection)}.html`].join("/");

URLs.push(
new UrlMapping(URL, Reflection, this.reflectionTemplate)
new UrlMapping(URL, Reflection, this.reflectionTemplate),
);

Reflection.url = URL;
Expand Down
32 changes: 15 additions & 17 deletions Source/Function/Build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* @module Build
*
*/
export default (async (...[File, Option]: Parameters<Type>) => {
export default ((async (...[File, Option]: Parameters<Type>) => {
for (const _File of File) {
for (const __File of await (
await import("fast-glob")
).default(_File.replaceAll("'", "").replaceAll('"', ""))) {
for (const __File of await (await import("fast-glob")).default(
_File.replaceAll("'", "").replaceAll('"', ""),
)) {
Pipe.push(__File);
}
}
Expand All @@ -23,15 +23,13 @@ export default (async (...[File, Option]: Parameters<Type>) => {
.slice(0, -1.0)
.join("."),
File,
])
]),
),
}
},
);

console.log(
await (
await import("esbuild")
).analyzeMetafile(
await (await import("esbuild")).analyzeMetafile(
(
await (
await import("esbuild")
Expand All @@ -41,15 +39,15 @@ export default (async (...[File, Option]: Parameters<Type>) => {
Configuration,
await (
await import("../Function/File.js")
).default(Option.ESBuild)
).default(Option.ESBuild),
)
: Configuration
: Configuration,
)
)?.metafile ?? "",
{
verbose: true,
}
)
},
),
);

Exec(`tsc -p ${Option?.TypeScript ?? "tsconfig.json"}`);
Expand Down Expand Up @@ -82,11 +80,11 @@ export default (async (...[File, Option]: Parameters<Type>) => {
"--mergeModulesRenameDefaults",
"--mergeModulesMergeMode module",
`--entryPoints ${Object.values(Configuration.entryPoints).join(
" --entryPoints "
" --entryPoints ",
)}`,
].join(" ")
].join(" "),
);
}) satisfies Type as Type;
}) satisfies Type as Type);

import type Type from "../Interface/Build.js";

Expand All @@ -99,5 +97,5 @@ export const { resolve } = await import("path");
export const Pipe: string[] = [];

export const Current = (await import("url")).fileURLToPath(
(await import("path")).dirname(import.meta.url)
(await import("path")).dirname(import.meta.url),
);
4 changes: 2 additions & 2 deletions Source/Function/Exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @module Exec
*
*/
export default (async (
export default ((async (
...[Command, Echo = (Return) => console.log(Return)]: Parameters<Type>
) => {
try {
Expand All @@ -12,6 +12,6 @@ export default (async (
stdout?.on("data", (Data) => Echo(Data));
}
} catch (_Error) {}
}) satisfies Type as Type;
}) satisfies Type as Type);

import type Type from "../Interface/Exec.js";
30 changes: 17 additions & 13 deletions Source/Function/File.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @module File
*
*/
export default (async (...[Path]: Parameters<Type>) => {
export default ((async (...[Path]: Parameters<Type>) => {
if (Path.split(".").pop() === "ts") {
const { options } = (
await import("typescript")
Expand All @@ -12,43 +12,47 @@ export default (async (...[Path]: Parameters<Type>) => {
await import("./JSON.js")
).default(
"../Notation/TypeScript.json",
(await import("path")).dirname(
(await import("url")).fileURLToPath(import.meta.url)
)
(
await import("path")
).dirname(
(await import("url")).fileURLToPath(import.meta.url),
),
)
)?.compilerOptions,
"."
".",
);

(await import("typescript")).default
.createProgram(
[Path],
options,
(await import("typescript")).default.createCompilerHost(options)
(await import("typescript")).default.createCompilerHost(
options,
),
)
.emit();

await (
await import("fs/promises")
).writeFile(
await (await import("fs/promises")).writeFile(
Path.replace(".ts", ".js"),
(await import("typescript")).default.transpile(
(
await (await import("fs/promises")).readFile(Path, "utf-8")
).toString(),
options
)
options,
),
);
}

return (
await import(
(await import("url"))
(
await import("url")
)
.pathToFileURL(Path)
.toString()
.replace(".ts", ".js")
)
).default;
}) satisfies Type as Type;
}) satisfies Type as Type);

import type Type from "../Interface/File.js";
6 changes: 3 additions & 3 deletions Source/Function/JSON.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
* @module JSON
*
*/
export default (async (...[File, From]: Parameters<Type>) =>
export default ((async (...[File, From]: Parameters<Type>) =>
JSON.parse(
(
await (
await import("fs/promises")
).readFile(`${From ?? "."}/${File}`, "utf-8")
).toString()
)) satisfies Type as Type;
).toString(),
)) satisfies Type as Type);

import type Type from "../Interface/JSON.js";
4 changes: 2 additions & 2 deletions Source/Function/Merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* @module Merge
*
*/
export default (await import("deepmerge-ts")).deepmergeCustom<Generic>({
export default ((await import("deepmerge-ts")).deepmergeCustom<Generic>({
mergeArrays: false,
}) satisfies Type<Generic> as Type<Generic>;
}) satisfies Type<Generic> as Type<Generic>);

import type Type from "../Interface/Merge.js";
import type { Generic } from "../Interface/Merge.js";
2 changes: 1 addition & 1 deletion Source/Interface/Build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default interface Type {
Option?: {
ESBuild?: string;
TypeScript?: string;
}
},
): Promise<void>;
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Interface/Exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export default interface Type {
(
Command: string,
// biome-ignore lint/suspicious/noExplicitAny:
Echo?: false | ((Return: any) => void)
Echo?: false | ((Return: any) => void),
): Promise<void>;
}
4 changes: 1 addition & 3 deletions Source/Interface/Merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ export default interface Type<
* @param ...Objects - An arbitrary number of objects to be merged.
*
*/
<Ts extends readonly unknown[]>(
...Objects: Ts
): DeepMergeHKT<
<Ts extends readonly unknown[]>(...Objects: Ts): DeepMergeHKT<
Ts,
GetDeepMergeMergeFunctionsURIs<PMF>,
DeepMergeBuiltInMetaData
Expand Down
2 changes: 1 addition & 1 deletion Source/Interface/Theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default interface Type extends DefaultTheme {
buildUrls: (
Reflection: DeclarationReflection,
// biome-ignore lint/suspicious/noExplicitAny:
URLs: UrlMapping<any>[]
URLs: UrlMapping<any>[],
// biome-ignore lint/suspicious/noExplicitAny:
) => UrlMapping<any>[];

Expand Down
18 changes: 10 additions & 8 deletions Source/Variable/ESBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @module ESBuild
*
*/
export default {
export default ({
color: true,
format: "esm",
metafile: true,
Expand All @@ -19,9 +19,7 @@ export default {
onStart(async () => {
try {
outdir
? await (
await import("fs/promises")
).rm(outdir, {
? await (await import("fs/promises")).rm(outdir, {
recursive: true,
})
: {};
Expand All @@ -44,10 +42,14 @@ export default {
}),
],
define: {
"process.env.VERSION_PACKAGE": `'${(
await (await import("../Function/JSON.js")).default("package.json")
)?.version}'`,
"process.env.VERSION_PACKAGE": `'${
(
await (
await import("../Function/JSON.js")
).default("package.json")
)?.version
}'`,
},
} satisfies BuildOptions as BuildOptions;
} satisfies BuildOptions as BuildOptions);

import type { BuildOptions } from "esbuild";
4 changes: 2 additions & 2 deletions Source/Variable/Load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
export const load = (...[Application]: Parameters<Type["load"]>) =>
Application.renderer.defineTheme("TypeScriptESBuild", Theme);

export default {
export default ({
load,
} satisfies Type as Type;
} satisfies Type as Type);

import type Type from "../Interface/Load.js";

Expand Down
Loading

0 comments on commit fcf269d

Please sign in to comment.