Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Oct 4, 2024
1 parent 09bdb09 commit d7f6dd3
Show file tree
Hide file tree
Showing 29 changed files with 73 additions and 71 deletions.
5 changes: 2 additions & 3 deletions Source/Function/Integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,11 @@ export default ((...[_Option = {}]: Parameters<Interface>) => {
}

for (const Path of Paths) {
(await import("@Function/Compress.js")).default(
(await import("@Function/Pipe.js")).default(
Cache,
Logger,
Path,
_Map,
Type,
_Map[Type] ?? "**/*",
Exclude,
_Action,
);
Expand Down
10 changes: 5 additions & 5 deletions Source/Function/Compress.ts → Source/Function/Pipe.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type Interface from "../Interface/Compress.js";
import type Interface from "../Interface/Pipe.js";

/**
* @module Compress
* @module Pipe
*
*/
export default (async (
...[Cache, Logger, Path, _Map, Type, Exclude, Action]: Parameters<Interface>
...[Cache, Logger, Path, FileBy, FileNot, Action]: Parameters<Interface>
) =>
await (
await (
Expand All @@ -14,6 +14,6 @@ export default (async (
Cache,
Logger,
).In(Path)
).By(_Map[Type] ?? "**/*")
).Not(Exclude)
).By(FileBy)
).Not(FileNot)
).Pipe(Action)) satisfies Interface as Interface;
20 changes: 0 additions & 20 deletions Source/Interface/Compress.ts

This file was deleted.

23 changes: 23 additions & 0 deletions Source/Interface/Pipe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type Pipe from "@playform/pipe/Target/Interface/Class.js";

import type Option from "./Option.js";

/**
* @module Pipe
*
*/
export default interface Interface {
(
Cache: Option["Cache"],

Logger: Option["Logger"],

Path: Parameters<Pipe["In"]>[0],

FileBy: Parameters<Pipe["By"]>[0],

FileNot: Parameters<Pipe["Not"]>[0],

Action: Exclude<Option["Action"], boolean>,
): Promise<Pipe>;
}
4 changes: 2 additions & 2 deletions Target/Function/CLI.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ export declare let System: string;
declare const _default: Interface;
export default _default;
export declare const Default: {
Path: string;
Cache: {
Search: string;
Folder: string;
};
Logger: 2;
Exclude: false;
Action: {
Failed: ({ Input }: import("@playform/pipe/Target/Interface/File.js").default) => Promise<string>;
Passed: ({ Before, Buffer }: import("@playform/pipe/Target/Interface/File.js").default) => Promise<boolean>;
Expand All @@ -23,8 +23,8 @@ export declare const Default: {
Wrote: ({ Buffer }: import("@playform/pipe/Target/Interface/File.js").default) => Promise<import("@playform/pipe/Target/Type/Buffer.js").Type>;
Fulfilled: ({ File }: import("@playform/pipe/Target/Interface/Plan.js").default) => Promise<string | false>;
};
Path: string;
File: string;
Exclude: false;
CSS: {
csso: import("../Interface/CSS/csso.js").default;
lightningcss: import("../Interface/CSS/lightningcss.js").default;
Expand Down
2 changes: 1 addition & 1 deletion Target/Function/Directory.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type Interface from "../Interface/Directory.js";
/**
* @module Directory
*
*/
declare const _default: Interface;
export default _default;
import type Interface from "../Interface/Directory.js";
2 changes: 1 addition & 1 deletion Target/Function/Image/Writesharp.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type Interface from "../../Interface/Image/Writesharp.js";
/**
* @module Image
*
*/
declare const _default: Interface;
export default _default;
import type Interface from "../../Interface/Image/Writesharp.js";
export declare const _Map: import("../../Interface/Map.js").default;
4 changes: 2 additions & 2 deletions Target/Function/Integration.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ export declare let System: string;
declare const _default: Interface;
export default _default;
export declare const Default: {
Path: string;
Cache: {
Search: string;
Folder: string;
};
Logger: 2;
Exclude: false;
Action: {
Failed: ({ Input }: import("@playform/pipe/Target/Interface/File.js").default) => Promise<string>;
Passed: ({ Before, Buffer }: import("@playform/pipe/Target/Interface/File.js").default) => Promise<boolean>;
Expand All @@ -23,8 +23,8 @@ export declare const Default: {
Wrote: ({ Buffer }: import("@playform/pipe/Target/Interface/File.js").default) => Promise<import("@playform/pipe/Target/Type/Buffer.js").Type>;
Fulfilled: ({ File }: import("@playform/pipe/Target/Interface/Plan.js").default) => Promise<string | false>;
};
Path: string;
File: string;
Exclude: false;
CSS: {
csso: import("../Interface/CSS/csso.js").default;
lightningcss: import("../Interface/CSS/lightningcss.js").default;
Expand Down
2 changes: 1 addition & 1 deletion Target/Function/Integration.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/Interface/CSS/csso.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { CompressOptions, MinifyOptions } from "csso";
/**
* @module CSS
*
Expand Down Expand Up @@ -29,4 +30,3 @@ export default interface Interface extends MinifyOptions, CompressOptions {
*/
restructure?: boolean;
}
import type { CompressOptions, MinifyOptions } from "csso";
2 changes: 1 addition & 1 deletion Target/Interface/CSS/lightningcss.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { CustomAtRules, TransformOptions } from "lightningcss";
/**
* @module CSS
*
Expand All @@ -18,4 +19,3 @@ export default interface Interface extends Omit<TransformOptions<CustomAtRules>,
*/
unusedSymbols?: string[] | boolean;
}
import type { CustomAtRules, TransformOptions } from "lightningcss";
2 changes: 1 addition & 1 deletion Target/Interface/Directory.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { ParsedPath } from "path";
/**
* @module Directory
*
*/
export default interface Interface {
(Path: string): Promise<ParsedPath["dir"]>;
}
import type { ParsedPath } from "path";
4 changes: 2 additions & 2 deletions Target/Interface/Image/Onsharp.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type File from "@playform/pipe/Target/Interface/File.js";
import type { Sharp } from "sharp";
/**
* @module Image
*
Expand All @@ -7,5 +9,3 @@ export default interface Interface extends Omit<File, "Buffer"> {
[key: string]: any;
} & Sharp;
}
import type File from "@playform/pipe/Target/Interface/File.js";
import type { Sharp } from "sharp";
4 changes: 2 additions & 2 deletions Target/Interface/Image/Writesharp.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type On from "../../Interface/Image/Onsharp.js";
import type Option from "../../Interface/Image/sharp.js";
/**
* @module Image
*
*/
export default interface Interface {
(Option: Option, On: On): Promise<any>;
}
import type On from "../../Interface/Image/Onsharp.js";
import type Option from "../../Interface/Image/sharp.js";
2 changes: 1 addition & 1 deletion Target/Interface/Image/sharp.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { AvifOptions, GifOptions, HeifOptions, JpegOptions, PngOptions, SharpOptions, TiffOptions, WebpOptions } from "sharp";
/**
* @module Image
*
Expand All @@ -13,4 +14,3 @@ export default interface Interface {
webp?: boolean | WebpOptions;
sharp?: boolean | SharpOptions;
}
import type { AvifOptions, GifOptions, HeifOptions, JpegOptions, PngOptions, SharpOptions, TiffOptions, WebpOptions } from "sharp";
4 changes: 2 additions & 2 deletions Target/Interface/Integration.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { AstroIntegration } from "astro";
import type Option from "../Interface/Option.js";
/**
* @module Integration
*
*/
export default interface Interface {
(Option?: Option): AstroIntegration;
}
import type { AstroIntegration } from "astro";
import type Option from "../Interface/Option.js";
18 changes: 9 additions & 9 deletions Target/Interface/Option.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
import type Option from "@playform/pipe/Target/Interface/Option.js";
import type csso from "../Interface/CSS/csso.js";
import type lightningcss from "../Interface/CSS/lightningcss.js";
import type sharp from "../Interface/Image/sharp.js";
import type _Map from "../Interface/Map.js";
import type Parser from "../Interface/Parser.js";
import type html_minifier_terser from "../Type/HTML/html-minifier-terser.js";
import type terser from "../Type/JavaScript/terser.js";
import type svgo from "../Type/SVG/svgo.js";
/**
* @module Option
*
Expand Down Expand Up @@ -50,12 +59,3 @@ export default interface Interface extends Option {
*/
Parser?: Parser;
}
import type csso from "../Interface/CSS/csso.js";
import type lightningcss from "../Interface/CSS/lightningcss.js";
import type sharp from "../Interface/Image/sharp.js";
import type html_minifier_terser from "../Type/HTML/html-minifier-terser.js";
import type terser from "../Type/JavaScript/terser.js";
import type svgo from "../Type/SVG/svgo.js";
import type _Map from "../Interface/Map.js";
import type Parser from "../Interface/Parser.js";
import type Option from "@playform/pipe/Target/Interface/Option.js";
10 changes: 5 additions & 5 deletions Target/Interface/Parser.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import type CSS from "../Type/Parser/CSS.js";
import type HTML from "../Type/Parser/HTML.js";
import type Image from "../Type/Parser/Image.js";
import type JavaScript from "../Type/Parser/JavaScript.js";
import type SVG from "../Type/Parser/SVG.js";
/**
* @module Parser
*
Expand All @@ -10,8 +15,3 @@ export default interface Interface {
JavaScript?: JavaScript | JavaScript[];
SVG?: SVG | SVG[];
}
import type CSS from "../Type/Parser/CSS.js";
import type HTML from "../Type/Parser/HTML.js";
import type Image from "../Type/Parser/Image.js";
import type JavaScript from "../Type/Parser/JavaScript.js";
import type SVG from "../Type/Parser/SVG.js";
2 changes: 1 addition & 1 deletion Target/Type/HTML/html-minifier-terser.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Options } from "html-minifier-terser";
/**
* @module HTML
*
*/
export type Type = Options;
export type { Type as default };
import type { Options } from "html-minifier-terser";
2 changes: 1 addition & 1 deletion Target/Type/JavaScript/terser.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { MinifyOptions } from "terser";
/**
* @module JavaScript
*
*/
export type Type = MinifyOptions;
export type { Type as default };
import type { MinifyOptions } from "terser";
2 changes: 1 addition & 1 deletion Target/Type/SVG/svgo.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Config } from "svgo";
/**
* @module SVG
*
*/
export type Type = Config;
export type { Type as default };
import type { Config } from "svgo";
2 changes: 1 addition & 1 deletion Target/Variable/CSS/csso.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type Interface from "../../Interface/CSS/csso.js";
/**
* @module CSS
*
*/
declare const _default: Interface;
export default _default;
import type Interface from "../../Interface/CSS/csso.js";
2 changes: 1 addition & 1 deletion Target/Variable/CSS/lightningcss.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type Interface from "../../Interface/CSS/lightningcss.js";
/**
* @module CSS
*
*/
declare const _default: Interface;
export default _default;
import type Interface from "../../Interface/CSS/lightningcss.js";
2 changes: 1 addition & 1 deletion Target/Variable/Image/Mapsharp.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type Interface from "../../Interface/Map.js";
/**
* @module Image
*
*/
declare const _default: Interface;
export default _default;
import type Interface from "../../Interface/Map.js";
2 changes: 1 addition & 1 deletion Target/Variable/Image/sharp.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type Interface from "../../Interface/Image/sharp.js";
/**
* @module Image
*
*/
declare const _default: Interface;
export default _default;
import type Interface from "../../Interface/Image/sharp.js";
2 changes: 1 addition & 1 deletion Target/Variable/Map.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type Interface from "../Interface/Map.js";
/**
* @module Map
*
*/
declare const _default: Interface;
export default _default;
import type Interface from "../Interface/Map.js";
4 changes: 2 additions & 2 deletions Target/Variable/Option.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
*
*/
declare const _default: {
Path: string;
Cache: {
Search: string;
Folder: string;
};
Logger: 2;
Exclude: false;
Action: {
Failed: ({ Input }: import("@playform/pipe/Target/Interface/File.js").default) => Promise<string>;
Passed: ({ Before, Buffer }: import("@playform/pipe/Target/Interface/File.js").default) => Promise<boolean>;
Expand All @@ -18,8 +18,8 @@ declare const _default: {
Wrote: ({ Buffer }: import("@playform/pipe/Target/Interface/File.js").default) => Promise<import("@playform/pipe/Target/Type/Buffer.js").Type>;
Fulfilled: ({ File }: import("@playform/pipe/Target/Interface/Plan.js").default) => Promise<string | false>;
};
Path: string;
File: string;
Exclude: false;
CSS: {
csso: import("../Interface/CSS/csso.js").default;
lightningcss: import("../Interface/CSS/lightningcss.js").default;
Expand Down
2 changes: 1 addition & 1 deletion Target/Variable/Parser.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type Interface from "../Interface/Parser.js";
/**
* @module Parser
*
*/
declare const _default: Interface;
export default _default;
import type Interface from "../Interface/Parser.js";
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"astro": "4.15.11",
"commander": "12.1.0",
"csso": "5.0.5",
"deepmerge-ts": "7.1.0",
"deepmerge-ts": "7.1.1",
"html-minifier-terser": "7.2.0",
"kleur": "4.1.5",
"lightningcss": "1.27.0",
Expand Down

0 comments on commit d7f6dd3

Please sign in to comment.