diff --git a/Target/Function/Configuration.d.ts b/Target/Function/Configuration.d.ts new file mode 100644 index 0000000..ea01ff9 --- /dev/null +++ b/Target/Function/Configuration.d.ts @@ -0,0 +1,9 @@ +import type Interface from "../Interface/Configuration.js"; +/** + * @module Configuration + * + */ +declare const _default: Interface; +export default _default; +export declare const readFile: typeof import("fs/promises").readFile; +export declare const resolve: (...paths: string[]) => string; diff --git a/Target/Function/Configuration.js b/Target/Function/Configuration.js new file mode 100644 index 0000000..fc9e1c5 --- /dev/null +++ b/Target/Function/Configuration.js @@ -0,0 +1 @@ +var i=async(...[t])=>{try{return(await r(a(`${(await import("process")).cwd()}/${t}`),"utf-8")).toString()}catch{return(await r(a(`${(await import("path")).dirname((await import("url")).fileURLToPath(import.meta.url))}/../../${t}`),"utf-8")).toString()}};const{readFile:r}=await import("fs/promises"),{resolve:a}=await import("path");export{i as default,r as readFile,a as resolve}; diff --git a/Target/Function/Integration.d.ts b/Target/Function/Integration.d.ts new file mode 100644 index 0000000..97b4f0f --- /dev/null +++ b/Target/Function/Integration.d.ts @@ -0,0 +1,38 @@ +import type Interface from "../Interface/Integration.js"; +/** + * @module Integration + * + */ +declare const _default: Interface; +export default _default; +export declare const Default: { + File: string; + Cache: { + Search: string; + Folder: string; + }; + Path: string; + Logger: 2; + Action: { + Failed: (On: import("@playform/pipe/Target/Interface/File.js").default) => Promise; + Accomplished: (On: import("@playform/pipe/Target/Interface/File.js").default) => Promise; + Fulfilled: ({ File }: import("@playform/pipe/Target/Interface/Plan.js").default) => Promise; + Read: ({ Input }: import("@playform/pipe/Target/Interface/File.js").default) => Promise; + Wrote: ({ Buffer }: import("@playform/pipe/Target/Interface/File.js").default) => Promise; + Passed: (On: import("@playform/pipe/Target/Interface/File.js").default) => Promise; + Changed: (Plan: import("@playform/pipe/Target/Interface/Plan.js").default) => Promise; + }; + Exclude: false; + Biome: unknown; +}; +export declare const Merge: (...objects: Ts) => import("deepmerge-ts").DeepMergeHKT, Readonly<{ + key: PropertyKey; + parents: ReadonlyArray>>; +}>>; diff --git a/Target/Function/Integration.js b/Target/Function/Integration.js new file mode 100644 index 0000000..deef1a3 --- /dev/null +++ b/Target/Function/Integration.js @@ -0,0 +1 @@ +var h=(...[r={}])=>{Object.entries(r).forEach(([t,i])=>Object.defineProperty(r,t,{value:i===!0?f[t]:r[t]}));const{Path:e,Cache:c,Logger:p,Exclude:m,Action:y,Biome:n}=s(f,r),o=new Set;return typeof e<"u"&&((Array.isArray(e)||e instanceof Set)&&e.forEach(t=>o.add(t)),e instanceof Map&&o.add(e)),{name:"@playform/format",hooks:{"astro:build:done":async({dir:t})=>{o.size===0&&o.add(t);const i=await(await import("@biomejs/js-api")).Biome.create({distribution:(await import("@biomejs/js-api")).Distribution.NODE});try{n&&typeof n=="object"&&i.applyConfiguration(n)}catch(a){console.log(a)}const l=s(y,{Wrote:async({Buffer:a,Output:d})=>{try{return i.formatContent(a.toString(),{filePath:(await import("path")).resolve(d)}).content}catch(u){return console.log(u),a}}});for(const a of o)await(await(await(await new(await import("@playform/pipe")).default(c,p).In(a)).By("**/*.{js,mjs,cjs,ts,json}")).Not(m)).Pipe(l)}}}};const{default:f}=await import("../Variable/Option.js"),{default:s}=await import("./Merge.js");export{f as Default,s as Merge,h as default}; diff --git a/Target/Function/Merge.d.ts b/Target/Function/Merge.d.ts new file mode 100644 index 0000000..b03db58 --- /dev/null +++ b/Target/Function/Merge.d.ts @@ -0,0 +1,16 @@ +/** + * @module Merge + * + */ +declare const _default: (...objects: Ts) => import("deepmerge-ts").DeepMergeHKT, Readonly<{ + key: PropertyKey; + parents: ReadonlyArray>>; +}>>; +export default _default; diff --git a/Target/Function/Merge.js b/Target/Function/Merge.js new file mode 100644 index 0000000..e898449 --- /dev/null +++ b/Target/Function/Merge.js @@ -0,0 +1 @@ +var e=(await import("deepmerge-ts")).deepmergeCustom({mergeArrays:!1});export{e as default}; diff --git a/Target/Interface/Configuration.d.ts b/Target/Interface/Configuration.d.ts new file mode 100644 index 0000000..6f93fd5 --- /dev/null +++ b/Target/Interface/Configuration.d.ts @@ -0,0 +1,7 @@ +/** + * @module Configuration + * + */ +export default interface Interface { + (File: string): Promise; +} diff --git a/Target/Interface/Configuration.js b/Target/Interface/Configuration.js new file mode 100644 index 0000000..e69de29 diff --git a/Target/Interface/Integration.d.ts b/Target/Interface/Integration.d.ts new file mode 100644 index 0000000..88c1b86 --- /dev/null +++ b/Target/Interface/Integration.d.ts @@ -0,0 +1,9 @@ +import type { AstroIntegration } from "astro"; +import type Option from "../Interface/Option.js"; +/** + * @module Integration + * + */ +export default interface Interface { + (Option?: Option): AstroIntegration; +} diff --git a/Target/Interface/Integration.js b/Target/Interface/Integration.js new file mode 100644 index 0000000..e69de29 diff --git a/Target/Interface/Option.d.ts b/Target/Interface/Option.d.ts new file mode 100644 index 0000000..ba9a202 --- /dev/null +++ b/Target/Interface/Option.d.ts @@ -0,0 +1,9 @@ +import type Option from "@playform/pipe/Target/Interface/Option.js"; +import type Biome from "../Type/Biome.js"; +/** + * @module Option + * + */ +export default interface Interface extends Option { + Biome?: boolean | Biome; +} diff --git a/Target/Interface/Option.js b/Target/Interface/Option.js new file mode 100644 index 0000000..e69de29 diff --git a/Target/Type/Biome.d.ts b/Target/Type/Biome.d.ts new file mode 100644 index 0000000..e5de1cd --- /dev/null +++ b/Target/Type/Biome.d.ts @@ -0,0 +1,7 @@ +import type { Configuration } from "@biomejs/js-api"; +/** + * @module Biome + * + */ +export type Type = Omit; +export type { Type as default }; diff --git a/Target/Type/Biome.js b/Target/Type/Biome.js new file mode 100644 index 0000000..e69de29 diff --git a/Target/Variable/Biome.d.ts b/Target/Variable/Biome.d.ts new file mode 100644 index 0000000..433652f --- /dev/null +++ b/Target/Variable/Biome.d.ts @@ -0,0 +1,6 @@ +/** + * @module Biome + * + */ +declare const _default: any; +export default _default; diff --git a/Target/Variable/Biome.js b/Target/Variable/Biome.js new file mode 100644 index 0000000..14680ea --- /dev/null +++ b/Target/Variable/Biome.js @@ -0,0 +1 @@ +var e=JSON.parse(await(await import("../Function/Configuration.js")).default("biome.json"));export{e as default}; diff --git a/Target/Variable/Option.d.ts b/Target/Variable/Option.d.ts new file mode 100644 index 0000000..2f7724b --- /dev/null +++ b/Target/Variable/Option.d.ts @@ -0,0 +1,25 @@ +/** + * @module Option + * + */ +declare const _default: { + File: string; + Cache: { + Search: string; + Folder: string; + }; + Path: string; + Logger: 2; + Action: { + Failed: (On: import("@playform/pipe/Target/Interface/File.js").default) => Promise; + Accomplished: (On: import("@playform/pipe/Target/Interface/File.js").default) => Promise; + Fulfilled: ({ File }: import("@playform/pipe/Target/Interface/Plan.js").default) => Promise; + Read: ({ Input }: import("@playform/pipe/Target/Interface/File.js").default) => Promise; + Wrote: ({ Buffer }: import("@playform/pipe/Target/Interface/File.js").default) => Promise; + Passed: (On: import("@playform/pipe/Target/Interface/File.js").default) => Promise; + Changed: (Plan: import("@playform/pipe/Target/Interface/Plan.js").default) => Promise; + }; + Exclude: false; + Biome: unknown; +}; +export default _default; diff --git a/Target/Variable/Option.js b/Target/Variable/Option.js new file mode 100644 index 0000000..3dea5a2 --- /dev/null +++ b/Target/Variable/Option.js @@ -0,0 +1 @@ +var a=(await import("../Function/Merge.js")).default((await import("@playform/pipe/Target/Variable/Option.js")).default,{Biome:(await import("./Biome.js")).default,Action:{Failed:async t=>`Error: Cannot format file ${t.Input}!`,Accomplished:async t=>`Formatted ${t.Input} in ${t.Output}.`,Fulfilled:async({File:t})=>t>0?`Successfully formatted a total of ${t} JavaScript and TypeScript ${t===1?"file":"files"}.`:!1}});export{a as default};