Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Sep 9, 2024
1 parent 7855a87 commit 8983781
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 27 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 0.1.5

## 0.1.4

### Changed
Expand Down
40 changes: 21 additions & 19 deletions Source/Function/Build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,34 @@ export default (async (...[File, Option]: Parameters<Interface>) => {

Pipe.reverse();

console.log(Pipe);

let Configuration: BuildOptions = Merge(
(await import("../Variable/ESBuild.js")).default,
{
entryPoints: Object.fromEntries(
Pipe.map((File) => [
File.replace("Source/", "")
.replace("src/", "")
.split(".")
.slice(0, -1.0)
.join("."),
`${dirname(File)}/${basename(File, extname(File))}`.replace(
normalize(File).split(sep).at(0) ?? "",
"",
),
File,
]),
),
},
);


Configuration = Merge(Option?.ESBuild
? Merge(
Configuration,
await (
await import("@Function/File.js")
).default(Option.ESBuild),
)
: Configuration, {
tsconfig: Option?.TypeScript ?? "tsconfig.json",
});
Configuration = Merge(
Option?.ESBuild
? Merge(
Configuration,
await (
await import("@Function/File.js")
).default(Option.ESBuild),
)
: Configuration,
{
tsconfig: Option?.TypeScript ?? "tsconfig.json",
},
);

Configuration.plugins?.push({
name: "TypeScript",
Expand Down Expand Up @@ -82,6 +81,9 @@ export const { default: Merge } = await import("../Function/Merge.js");

export const Pipe: string[] = [];

export const { extname, basename, relative, dirname, normalize, sep } =
await import("path");

export const Current = (await import("url")).fileURLToPath(
(await import("path")).dirname(import.meta.url),
dirname(import.meta.url),
);
8 changes: 5 additions & 3 deletions Source/Variable/ESBuild.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { BuildOptions } from "esbuild";

/**
* @module ESBuild
*
Expand All @@ -20,7 +22,9 @@ export default {
onStart(async () => {
try {
outdir
? await (await import("fs/promises")).rm(outdir, {
? await (
await import("fs/promises")
).rm(outdir, {
recursive: true,
})
: {};
Expand All @@ -41,5 +45,3 @@ export default {
}'`,
},
} satisfies BuildOptions as BuildOptions;

import type { BuildOptions } from "esbuild";
1 change: 1 addition & 0 deletions Target/Function/Build.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ export declare const Merge: <Ts extends readonly unknown[]>(...objects: Ts) => i
parents: ReadonlyArray<Readonly<Record<PropertyKey, unknown>>>;
}>>;
export declare const Pipe: string[];
export declare const extname: (path: string) => string, basename: (path: string, suffix?: string) => string, relative: (from: string, to: string) => string, dirname: (path: string) => string, normalize: (path: string) => string, sep: "\\" | "/";
export declare const Current: string;
2 changes: 1 addition & 1 deletion Target/Function/Build.js

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

2 changes: 1 addition & 1 deletion Target/Variable/ESBuild.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { BuildOptions } from "esbuild";
/**
* @module ESBuild
*
*/
declare const _default: BuildOptions;
export default _default;
import type { BuildOptions } from "esbuild";
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@playform/build",
"version": "0.1.4",
"version": "0.1.5",
"private": false,
"description": "🌀 Build —",
"keywords": [
Expand Down Expand Up @@ -30,8 +30,8 @@
"Build": "Target/Class/Build.js"
},
"scripts": {
"Run": "node --no-warnings --loader ts-node/esm Source/Class/Build.ts 'Source/**/*.ts' --Watch",
"prepublishOnly": "node --no-warnings --loader ts-node/esm Source/Class/Build.ts 'Source/**/*.ts'"
"Run": "node --no-warnings --loader ts-node/esm Source/Class/Build.ts 'Source/**/*.{ts,css}' --Watch",
"prepublishOnly": "node --no-warnings --loader ts-node/esm Source/Class/Build.ts 'Source/**/*.{ts,css}'"
},
"dependencies": {
"@types/node": "22.5.4",
Expand Down

0 comments on commit 8983781

Please sign in to comment.