diff --git a/.github/workflows/NPM.yml b/.github/workflows/NPM.yml index e3d823b5..f0d4bc95 100644 --- a/.github/workflows/NPM.yml +++ b/.github/workflows/NPM.yml @@ -70,6 +70,6 @@ jobs: continue-on-error: true working-directory: . run: | - npm publish --legacy-peer-deps --provenance --ignore-scripts --dry-run + npm publish --legacy-peer-deps --provenance --ignore-scripts env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 650459b3..b25fa4b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.1.4 + +### Fixed + +- Fixes missing `Pipe.js` + ## 0.1.2 ### Added diff --git a/Source/Interface/Pipe.ts b/Source/Interface/Pipe.ts deleted file mode 100644 index 9f601f76..00000000 --- a/Source/Interface/Pipe.ts +++ /dev/null @@ -1,23 +0,0 @@ -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[0], - - FileBy: Parameters[0], - - FileNot: Parameters[0], - - Action: Exclude, - ): Promise; -} diff --git a/Target/Function/CLI.d.ts b/Target/Function/CLI.d.ts deleted file mode 100644 index 6cd44065..00000000 --- a/Target/Function/CLI.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -import type Action from "@playform/pipe/Target/Interface/Action.js"; -import type Interface from "../Interface/CLI.js"; -/** - * @module CLI - * - */ -export declare let System: string; -declare const _default: Interface; -export default _default; -export declare const Default: { - Cache: { - Search: string; - Folder: string; - }; - Logger: 2; - Exclude: false; - Action: { - Failed: ({ Input }: import("@playform/pipe/Target/Interface/File.js").default) => Promise; - Passed: ({ Before, Buffer }: import("@playform/pipe/Target/Interface/File.js").default) => Promise; - Accomplished: ({ Input, Before, After }: import("@playform/pipe/Target/Interface/File.js").default) => Promise; - Changed: (Plan: 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; - Fulfilled: ({ File }: import("@playform/pipe/Target/Interface/Plan.js").default) => Promise; - }; - Path: string; - File: string; - CSS: { - csso: import("../Interface/CSS/csso.js").default; - lightningcss: import("../Interface/CSS/lightningcss.js").default; - }; - HTML: { - "html-minifier-terser": { - caseSensitive: true; - collapseInlineTagWhitespace: false; - collapseWhitespace: true; - continueOnParseError: true; - html5: true; - ignoreCustomComments: RegExp[]; - ignoreCustomFragments: never[]; - includeAutoGeneratedTags: true; - keepClosingSlash: true; - minifyCSS: true; - minifyJS: true; - minifyURLs: false; - noNewlinesBeforeTagClose: true; - preventAttributesEscaping: false; - processConditionalComments: false; - processScripts: string[]; - quoteCharacter: string; - removeAttributeQuotes: true; - removeComments: true; - removeScriptTypeAttributes: true; - removeStyleLinkTypeAttributes: true; - removeTagWhitespace: false; - sortAttributes: true; - sortClassName: true; - trimCustomFragments: true; - useShortDoctype: false; - }; - }; - Image: { - sharp: import("../Interface/Image/sharp.js").default; - }; - JavaScript: { - terser: { - ecma: 5; - enclose: false; - keep_classnames: false; - keep_fnames: false; - ie8: false; - module: false; - safari10: false; - toplevel: false; - format: { - comments: false; - }; - }; - }; - SVG: { - svgo: { - multipass: true; - js2svg: { - indent: number; - pretty: false; - }; - plugins: "preset-default"[]; - }; - }; - Map: import("../Interface/Map.js").default; - Parser: import("../Interface/Parser.js").default; -}; -export declare const Search: string; -export declare const Merge: (...objects: Ts) => import("deepmerge-ts").DeepMergeHKT, Readonly<{ - key: PropertyKey; - parents: ReadonlyArray>>; -}>>; -export declare let _Action: Action; diff --git a/Target/Function/CLI.js b/Target/Function/CLI.js deleted file mode 100644 index 8efd3240..00000000 --- a/Target/Function/CLI.js +++ /dev/null @@ -1 +0,0 @@ -let r;var a=async(...[t,e])=>{};const{default:o}=await import("../Variable/Option.js"),{default:{Cache:{Search:i}}}=await import("@playform/pipe/Target/Variable/Option.js"),{default:p}=await import("./Merge.js");let c;export{o as Default,p as Merge,i as Search,r as System,c as _Action,a as default}; diff --git a/Target/Function/Integration.d.ts b/Target/Function/Integration.d.ts index 2943feb5..f9688390 100644 --- a/Target/Function/Integration.d.ts +++ b/Target/Function/Integration.d.ts @@ -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; Passed: ({ Before, Buffer }: import("@playform/pipe/Target/Interface/File.js").default) => Promise; @@ -23,8 +23,8 @@ export declare const Default: { Wrote: ({ Buffer }: import("@playform/pipe/Target/Interface/File.js").default) => Promise; Fulfilled: ({ File }: import("@playform/pipe/Target/Interface/Plan.js").default) => Promise; }; - Path: string; File: string; + Exclude: false; CSS: { csso: import("../Interface/CSS/csso.js").default; lightningcss: import("../Interface/CSS/lightningcss.js").default; diff --git a/Target/Function/Integration.js b/Target/Function/Integration.js index 6dc8455a..c554727a 100644 --- a/Target/Function/Integration.js +++ b/Target/Function/Integration.js @@ -1 +1 @@ -let l;var E=(...[c={}])=>{Object.entries(c).forEach(([a,r])=>Object.defineProperty(c,a,{value:r===!0?w[a]:c[a]}));const{Path:f,Cache:p,Logger:S,Map:d,Exclude:j,Action:g,CSS:b,HTML:A,Image:n,JavaScript:I,SVG:P,Parser:h}=s(w,c),m=new Set;return typeof f<"u"&&(Array.isArray(f)||f instanceof Set)&&f.forEach(a=>m.add(a)),typeof h=="object"&&Object.entries(h).forEach(([a,r])=>Object.defineProperty(h,a,{value:Array.isArray(r)?r:[r]})),{name:"@playform/compress",hooks:{"astro:config:done":async({config:{outDir:{pathname:a}}})=>{l=(await import("path")).parse(a).dir.replace(/\\/g,"/"),l.startsWith("/")&&(l=l.substring(1))},"astro:build:done":async({dir:a})=>{if(typeof d=="object"){m.size===0&&m.add(a),typeof p=="object"&&p.Search===x&&(p.Search=a);for(const[r,o]of Object.entries({CSS:b,HTML:A,Image:n,JavaScript:I,SVG:P}))if(!(!(o&&d[r])||typeof o!="object")){y=s(g,s(g,{Wrote:async({Buffer:t,Input:i})=>{switch(r){case"CSS":{let e=t.toString();return o.lightningcss&&(e=(await import("lightningcss")).transform(s({code:(await import("buffer")).Buffer.from(e),filename:i},o.lightningcss)).code.toString()),o.csso&&(e=(await import("csso")).minify(e,o.csso).css),e}case"HTML":return await(await import("html-minifier-terser")).minify(t.toString(),o["html-minifier-terser"]);case"JavaScript":return(await(await import("terser")).minify(t.toString(),o.terser)).code??t;case"Image":try{return t instanceof(await import("sharp")).default?await(await import("./Image/Writesharp.js")).default(o.sharp,{Buffer:t,Input:i}):t}catch(e){return console.log(e),t}case"SVG":return(await import("svgo")).optimize(t.toString(),o.svgo).data??t;default:return t}},Fulfilled:async({File:t,Info:{Total:i}})=>t>0?`${(await import("kleur/colors")).green(`\u2713\u2001Successfully compressed a total of ${t} ${r} ${t===1?"file":"files"} for ${(await import("@playform/pipe/Target/Function/Bytes.js")).default(i)}.`)}`:!1})),r==="Image"&&(y=s(y,{Read:async({Input:t,Buffer:i})=>{try{(await import("sharp")).default.cache(!1);const{format:e}=await(await import("sharp")).default(t).metadata(),u={animated:e==="webp"||e==="gif"};return(await import("sharp")).default(t,typeof n=="object"&&typeof n.sharp=="object"&&typeof n.sharp.sharp=="object"?s(u,n.sharp?.sharp):u)}catch(e){return console.log(e),i}}}));for(const t of m)await(await import("./Pipe.js")).default(p,S,t,d[r]??"**/*",j,y)}}}}}};const{default:w}=await import("../Variable/Option.js"),{default:{Cache:{Search:x}}}=await import("@playform/pipe/Target/Variable/Option.js"),{default:s}=await import("./Merge.js");let y;export{w as Default,s as Merge,x as Search,l as System,y as _Action,E as default}; +let l;var E=(...[c={}])=>{Object.entries(c).forEach(([a,r])=>Object.defineProperty(c,a,{value:r===!0?u[a]:c[a]}));const{Path:f,Cache:p,Logger:S,Map:d,Exclude:j,Action:g,CSS:b,HTML:I,Image:n,JavaScript:A,SVG:P,Parser:h}=s(u,c),m=new Set;return typeof f<"u"&&(Array.isArray(f)||f instanceof Set)&&f.forEach(a=>m.add(a)),typeof h=="object"&&Object.entries(h).forEach(([a,r])=>Object.defineProperty(h,a,{value:Array.isArray(r)?r:[r]})),{name:"@playform/compress",hooks:{"astro:config:done":async({config:{outDir:{pathname:a}}})=>{l=(await import("path")).parse(a).dir.replace(/\\/g,"/"),l.startsWith("/")&&(l=l.substring(1))},"astro:build:done":async({dir:a})=>{if(typeof d=="object"){m.size===0&&m.add(a),typeof p=="object"&&p.Search===x&&(p.Search=a);for(const[r,i]of Object.entries({CSS:b,HTML:I,Image:n,JavaScript:A,SVG:P}))if(!(!(i&&d[r])||typeof i!="object")){y=s(g,s(g,{Wrote:async({Buffer:t,Input:o})=>{switch(r){case"CSS":{let e=t.toString();return i.lightningcss&&(e=(await import("lightningcss")).transform(s({code:(await import("buffer")).Buffer.from(e),filename:o},i.lightningcss)).code.toString()),i.csso&&(e=(await import("csso")).minify(e,i.csso).css),e}case"HTML":return await(await import("html-minifier-terser")).minify(t.toString(),i["html-minifier-terser"]);case"JavaScript":return(await(await import("terser")).minify(t.toString(),i.terser)).code??t;case"Image":try{return t instanceof(await import("sharp")).default?await(await import("./Image/Writesharp.js")).default(i.sharp,{Buffer:t,Input:o}):t}catch(e){return console.log(e),t}case"SVG":return(await import("svgo")).optimize(t.toString(),i.svgo).data??t;default:return t}},Fulfilled:async({File:t,Info:{Total:o}})=>t>0?`${(await import("kleur/colors")).green(`\u2713\u2001Successfully compressed a total of ${t} ${r} ${t===1?"file":"files"} for ${(await import("@playform/pipe/Target/Function/Bytes.js")).default(o)}.`)}`:!1})),r==="Image"&&(y=s(y,{Read:async({Input:t,Buffer:o})=>{try{(await import("sharp")).default.cache(!1);const{format:e}=await(await import("sharp")).default(t).metadata(),w={animated:e==="webp"||e==="gif"};return(await import("sharp")).default(t,typeof n=="object"&&typeof n.sharp=="object"&&typeof n.sharp.sharp=="object"?s(w,n.sharp?.sharp):w)}catch(e){return console.log(e),o}}}));for(const t of m)await(await(await(await new(await import("@playform/pipe")).default(p,S).In(t)).By(d[r]??"**/*")).Not(j)).Pipe(y)}}}}}};const{default:u}=await import("../Variable/Option.js"),{default:{Cache:{Search:x}}}=await import("@playform/pipe/Target/Variable/Option.js"),{default:s}=await import("./Merge.js");let y;export{u as Default,s as Merge,x as Search,l as System,y as _Action,E as default}; diff --git a/Target/Variable/Option.d.ts b/Target/Variable/Option.d.ts index 4eb01e8e..9f0e5f48 100644 --- a/Target/Variable/Option.d.ts +++ b/Target/Variable/Option.d.ts @@ -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; Passed: ({ Before, Buffer }: import("@playform/pipe/Target/Interface/File.js").default) => Promise; @@ -18,8 +18,8 @@ declare const _default: { Wrote: ({ Buffer }: import("@playform/pipe/Target/Interface/File.js").default) => Promise; Fulfilled: ({ File }: import("@playform/pipe/Target/Interface/Plan.js").default) => Promise; }; - Path: string; File: string; + Exclude: false; CSS: { csso: import("../Interface/CSS/csso.js").default; lightningcss: import("../Interface/CSS/lightningcss.js").default; diff --git a/package.json b/package.json index e6676759..9ba85009 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@playform/compress", - "version": "0.1.3", + "version": "0.1.4", "private": false, "description": "🗜️ Compress —", "keywords": [