Skip to content

Commit

Permalink
squash!
Browse files Browse the repository at this point in the history
Signed-off-by: Nikola Hristov <Nikola@PlayForm.Cloud>
  • Loading branch information
NikolaRHristov committed Jun 25, 2024
1 parent 1569029 commit 615dc1f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 23 deletions.
12 changes: 7 additions & 5 deletions Source/Function/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default (async (...[File]: Parameters<Interface>) => {
try {
return (
await readFile(
resolve(`${(await import("process")).cwd()}/${File}`),
resolve(`${(await import("node:process")).cwd()}/${File}`),
"utf-8",
)
).toString();
Expand All @@ -15,9 +15,11 @@ export default (async (...[File]: Parameters<Interface>) => {
await readFile(
resolve(
`${(
await import("path")
await import("node:path")
).dirname(
(await import("url")).fileURLToPath(import.meta.url),
(
await import("node:url")
).fileURLToPath(import.meta.url),
)}/../../${File}`,
),
"utf-8",
Expand All @@ -28,6 +30,6 @@ export default (async (...[File]: Parameters<Interface>) => {

import type Interface from "../Interface/Configuration.js";

export const { readFile } = await import("fs/promises");
export const { readFile } = await import("node:fs/promises");

export const { resolve } = await import("path");
export const { resolve } = await import("node:path");
2 changes: 1 addition & 1 deletion Source/Function/Integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default ((...[_Option = {}]: Parameters<Interface>) => {
Wrote: async (On) => {
try {
return _Biome.formatContent(On.Buffer.toString(), {
filePath: (await import("path")).resolve(
filePath: (await import("node:path")).resolve(
On.Input,
),
}).content;
Expand Down
32 changes: 17 additions & 15 deletions Source/Variable/Option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
* @module Option
*
*/
export default (
await import("@Function/Merge.js")
).default((await import("@playform/pipe/Target/Variable/Option.js")).default, {
Biome: (await import("@Variable/Biome.js")).default,
Action: {
Failed: async (On) => `Error: Cannot format file ${On.Input}!`,
Accomplished: async (On) => `Formatted ${On.Input} in ${On.Output}.`,
Fulfilled: async ({ File }) =>
File > 0
? `Successfully formatted a total of ${File} JavaScript and TypeScript ${
File === 1 ? "file" : "files"
}.`
: false,
},
} satisfies Interface);
export default (await import("@Function/Merge.js")).default(
(await import("@playform/pipe/Target/Variable/Option.js")).default,
{
Biome: (await import("@Variable/Biome.js")).default,
Action: {
Failed: async (On) => `Error: Cannot format file ${On.Input}!`,
Accomplished: async (On) =>
`Formatted ${On.Input} in ${On.Output}.`,
Fulfilled: async ({ File }) =>
File > 0
? `Successfully formatted a total of ${File} JavaScript and TypeScript ${
File === 1 ? "file" : "files"
}.`
: false,
},
} satisfies Interface,
);

import type Interface from "../Interface/Option.js";
6 changes: 4 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"**/Target/**/*",
"**/Documentation/**/*",
"**/dist/**/*",
"**/*.astro"
"**/*.astro",
"package.json"
],
"maxSize": 10000000
},
Expand Down Expand Up @@ -62,7 +63,8 @@
},
"correctness": {
"all": true,
"noUnusedVariables": "off"
"noUnusedVariables": "off",
"noNodejsModules": "off"
},
"nursery": {
"all": true,
Expand Down

0 comments on commit 615dc1f

Please sign in to comment.