Skip to content

Commit d1e7202

Browse files
style(Worker): Format build configuration files
Apply consistent formatting to ESBuild configuration files in the Worker element. Reformat minified JavaScript in `Configuration/ESBuild/Target.js` and `Configuration/ESBuild/Worker.js` into readable multi-line structures. Update `Source/Configuration/ESBuild/Worker.js` to use explicit spacing and switch statements for clarity. This improves maintainability of the build system without altering logic or output behavior.
1 parent e19c0e1 commit d1e7202

3 files changed

Lines changed: 161 additions & 48 deletions

File tree

Configuration/ESBuild/Target.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
const i=(await import("./Worker.js")).On;var o=async t=>(await import("deepmerge-ts")).deepmerge((await import("./Worker.js")).default,{outdir:"Target",drop:i?[]:["debugger","console"],define:{__DEV__:i?"true":"false",__INCREMENT__:`"${`${i?"DEVELOPMENT":"PRODUCTION"}-${(await import("ulid")).ulid()}`}"`},treeShaking:!i,entryPoints:(await import("@playform/build/Target/Function/Entry.js")).default(t,["Source/Configuration/*"]),platform:"browser",outbase:"Source",logOverride:{"suspicious-logical-operator":"silent"}});export{i as On,o as default};
1+
const i = (await import("./Worker.js")).On;
2+
3+
var o = async (t) =>
4+
(await import("deepmerge-ts")).deepmerge(
5+
(await import("./Worker.js")).default,
6+
7+
{
8+
outdir: "Target",
9+
drop: i ? [] : ["debugger", "console"],
10+
define: {
11+
__DEV__: i ? "true" : "false",
12+
__INCREMENT__: `"${`${i ? "DEVELOPMENT" : "PRODUCTION"}-${(await import("ulid")).ulid()}`}"`,
13+
},
14+
treeShaking: !i,
15+
entryPoints: (
16+
await import("@playform/build/Target/Function/Entry.js")
17+
).default(t, ["Source/Configuration/*"]),
18+
platform: "browser",
19+
outbase: "Source",
20+
logOverride: { "suspicious-logical-operator": "silent" },
21+
},
22+
);
23+
export { i as On, o as default };

Configuration/ESBuild/Worker.js

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,66 @@
1-
const e=process.env.NODE_ENV==="development"||process.env.TAURI_ENV_DEBUG==="true",r=process.env.Clean==="true";var n={color:!0,format:"esm",logLevel:"debug",metafile:!0,minify:!e,outdir:"Configuration",platform:"node",target:"esnext",tsconfig:"tsconfig.json",write:!0,legalComments:e?"inline":"none",bundle:!1,assetNames:"Asset/[name]-[hash]",sourcemap:e,drop:e?[]:["debugger"],ignoreAnnotations:!e,keepNames:e,plugins:[{name:"Target",setup({onStart:o,initialOptions:{outdir:t}}){!0===(r===!0)&&o(async()=>{try{t&&await(await import("node:fs/promises")).rm(t,{recursive:!0})}catch(s){console.log(s)}})}}],outbase:"Source/Configuration"};const{sep:i,posix:a}=await import("node:path");export{r as Clean,e as On,n as default,a as posix,i as sep};
1+
const e =
2+
process.env.NODE_ENV === "development" ||
3+
process.env.TAURI_ENV_DEBUG === "true",
4+
r = process.env.Clean === "true";
5+
6+
var n = {
7+
color: !0,
8+
9+
format: "esm",
10+
11+
logLevel: "debug",
12+
13+
metafile: !0,
14+
15+
minify: !e,
16+
17+
outdir: "Configuration",
18+
19+
platform: "node",
20+
21+
target: "esnext",
22+
23+
tsconfig: "tsconfig.json",
24+
25+
write: !0,
26+
27+
legalComments: e ? "inline" : "none",
28+
29+
bundle: !1,
30+
31+
assetNames: "Asset/[name]-[hash]",
32+
33+
sourcemap: e,
34+
35+
drop: e ? [] : ["debugger"],
36+
37+
ignoreAnnotations: !e,
38+
39+
keepNames: e,
40+
41+
plugins: [
42+
{
43+
name: "Target",
44+
45+
setup({ onStart: o, initialOptions: { outdir: t } }) {
46+
!0 === (r === !0) &&
47+
o(async () => {
48+
try {
49+
t &&
50+
(await (
51+
await import("node:fs/promises")
52+
).rm(t, { recursive: !0 }));
53+
} catch (s) {
54+
console.log(s);
55+
}
56+
});
57+
},
58+
},
59+
],
60+
61+
outbase: "Source/Configuration",
62+
};
63+
64+
const { sep: i, posix: a } = await import("node:path");
65+
66+
export { r as Clean, e as On, n as default, a as posix, i as sep };
Lines changed: 72 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,80 @@
1-
export const On = process.env["NODE_ENV"] === "development" ||
2-
process.env["TAURI_ENV_DEBUG"] === "true";
1+
export const On =
2+
process.env["NODE_ENV"] === "development" ||
3+
process.env["TAURI_ENV_DEBUG"] === "true";
4+
35
export const Clean = process.env["Clean"] === "true";
6+
47
/**
58
* @module ESBuild
69
*
710
*/
811
export default {
9-
color: true,
10-
format: "esm",
11-
logLevel: "debug",
12-
metafile: true,
13-
minify: !On,
14-
outdir: "Configuration",
15-
platform: "node",
16-
target: "esnext",
17-
tsconfig: "tsconfig.json",
18-
write: true,
19-
legalComments: On ? "inline" : "none",
20-
bundle: false,
21-
assetNames: "Asset/[name]-[hash]",
22-
sourcemap: On,
23-
drop: On ? [] : ["debugger"],
24-
ignoreAnnotations: !On,
25-
keepNames: On,
26-
plugins: [
27-
{
28-
name: "Target",
29-
// @ts-ignore
30-
setup({ onStart, initialOptions: { outdir } }) {
31-
switch (true) {
32-
case Clean === true:
33-
onStart(async () => {
34-
try {
35-
outdir
36-
? await (await import("node:fs/promises")).rm(outdir, {
37-
recursive: true,
38-
})
39-
: {};
40-
}
41-
catch (_Error) {
42-
console.log(_Error);
43-
}
44-
});
45-
break;
46-
default:
47-
break;
48-
}
49-
},
50-
},
51-
],
52-
outbase: "Source/Configuration",
12+
color: true,
13+
14+
format: "esm",
15+
16+
logLevel: "debug",
17+
18+
metafile: true,
19+
20+
minify: !On,
21+
22+
outdir: "Configuration",
23+
24+
platform: "node",
25+
26+
target: "esnext",
27+
28+
tsconfig: "tsconfig.json",
29+
30+
write: true,
31+
32+
legalComments: On ? "inline" : "none",
33+
34+
bundle: false,
35+
36+
assetNames: "Asset/[name]-[hash]",
37+
38+
sourcemap: On,
39+
40+
drop: On ? [] : ["debugger"],
41+
42+
ignoreAnnotations: !On,
43+
44+
keepNames: On,
45+
46+
plugins: [
47+
{
48+
name: "Target",
49+
50+
// @ts-ignore
51+
setup({ onStart, initialOptions: { outdir } }) {
52+
switch (true) {
53+
case Clean === true:
54+
onStart(async () => {
55+
try {
56+
outdir
57+
? await (
58+
await import("node:fs/promises")
59+
).rm(outdir, {
60+
recursive: true,
61+
})
62+
: {};
63+
} catch (_Error) {
64+
console.log(_Error);
65+
}
66+
});
67+
68+
break;
69+
70+
default:
71+
break;
72+
}
73+
},
74+
},
75+
],
76+
77+
outbase: "Source/Configuration",
5378
};
79+
5480
export const { sep, posix } = await import("node:path");

0 commit comments

Comments
 (0)