@powerlines/plugin-stylelint 0.1.51 → 0.1.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
package/dist/index.cjs CHANGED
@@ -1,7 +1 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var types$1=require('@storm-software/config-tools/types'),getParentPath=require('@stryke/fs/get-parent-path'),append=require('@stryke/path/append'),join=require('@stryke/path/join'),defu=require('defu'),u=require('stylelint'),types=require('./types');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var u__default=/*#__PURE__*/_interopDefault(u);/*****************************************
2
- *
3
- * ⚡ Built by Storm Software
4
- *
5
- *****************************************/
6
-
7
- var r=Object.defineProperty;var s=(l,t)=>r(l,"name",{value:t,configurable:true});function a(l={}){return {name:"stylelint",async config(){this.log(types$1.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `stylelint` build plugin.");const t=getParentPath.getParentPath(["stylelint.config.js","stylelint.config.mjs","stylelint.config.cjs","stylelint.config.ts","stylelint.config.mts","stylelint.config.cts",".stylelintrc.js",".stylelintrc.cjs",".stylelintrc.yaml",".stylelintrc.yml",".stylelintrc.json",".stylelintrc"],this.config.projectRoot,{ignoreCase:true,skipCwd:false,includeNameInResults:true});return {lint:{stylelint:defu.defu(l,{configFile:t,cwd:join.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot),silent:this.config.logLevel!==null,fix:true})}}},async lint(){this.log(types$1.LogLevelLabel.TRACE,"Linting project files with Stylelint.");const t=await u__default.default.lint(l);if(this.config.lint.stylelint.outputFile&&await this.fs.write(append.appendPath(this.config.lint.stylelint.outputFile,this.config.projectRoot),t.report),!this.config.lint.stylelint.silent){this.log(types$1.LogLevelLabel.INFO,t.report);const o=t.results.map(n=>n.warnings.filter(e=>e.severity==="warning")).reduce((n,e)=>n+e.length,0);o>0?this.log(types$1.LogLevelLabel.WARN,`${o} Stylelint linting warnings found in the listed files.`):t.errored?this.log(types$1.LogLevelLabel.ERROR,"Stylelint linting errors found in the listed files."):this.log(types$1.LogLevelLabel.INFO,"All files pass Stylelint linting.");}}}}s(a,"plugin");var O=a;exports.default=O;exports.plugin=a;Object.keys(types).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return types[k]}})});
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));require(`./plugin-DHXHjv16.cjs`),require(`./types-DHkg7xmX.cjs`);let c=require(`@storm-software/config-tools/types`),l=require(`@stryke/fs/get-parent-path`),u=require(`@stryke/path/append`),d=require(`@stryke/path/join`),f=require(`defu`),p=require(`stylelint`);p=s(p);function m(e={}){return{name:`stylelint`,async config(){return this.log(c.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `stylelint` build plugin."),{lint:{stylelint:(0,f.defu)(e,{configFile:(0,l.getParentPath)([`stylelint.config.js`,`stylelint.config.mjs`,`stylelint.config.cjs`,`stylelint.config.ts`,`stylelint.config.mts`,`stylelint.config.cts`,`.stylelintrc.js`,`.stylelintrc.cjs`,`.stylelintrc.yaml`,`.stylelintrc.yml`,`.stylelintrc.json`,`.stylelintrc`],this.config.projectRoot,{ignoreCase:!0,skipCwd:!1,includeNameInResults:!0}),cwd:(0,d.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot),silent:this.config.logLevel!==null,fix:!0})}}},async lint(){this.log(c.LogLevelLabel.TRACE,`Linting project files with Stylelint.`);let t=await p.default.lint(e);if(this.config.lint.stylelint.outputFile&&await this.fs.write((0,u.appendPath)(this.config.lint.stylelint.outputFile,this.config.projectRoot),t.report),!this.config.lint.stylelint.silent){this.log(c.LogLevelLabel.INFO,t.report);let e=t.results.map(e=>e.warnings.filter(e=>e.severity===`warning`)).reduce((e,t)=>e+t.length,0);e>0?this.log(c.LogLevelLabel.WARN,`${e} Stylelint linting warnings found in the listed files.`):t.errored?this.log(c.LogLevelLabel.ERROR,`Stylelint linting errors found in the listed files.`):this.log(c.LogLevelLabel.INFO,`All files pass Stylelint linting.`)}}}}var h=m;exports.default=h,exports.plugin=m;
package/dist/index.d.cts CHANGED
@@ -1,31 +1,12 @@
1
- import { S as StylelintPluginOptions, P as Plugin, a as StylelintPluginContext } from './index-BnxhWwde.cjs';
2
- export { c as StylelintPluginResolvedConfig, b as StylelintPluginUserConfig, f as __ΩStylelintPluginContext, _ as __ΩStylelintPluginOptions, e as __ΩStylelintPluginResolvedConfig, d as __ΩStylelintPluginUserConfig } from './index-BnxhWwde.cjs';
3
- import '@storm-software/build-tools/types';
4
- import '@storm-software/config-tools/types';
5
- import '@storm-software/config/types';
6
- import '@stryke/types/base';
7
- import '@stryke/types/configuration';
8
- import '@stryke/types/file';
9
- import 'vite';
10
- import '@stryke/env/get-env-paths';
11
- import '@stryke/http/fetch';
12
- import '@stryke/types/package-json';
13
- import 'jiti';
14
- import 'magic-string';
15
- import 'oxc-parser';
16
- import 'semver';
17
- import 'ts-morph';
18
- import 'undici';
19
- import 'unplugin';
20
- import '@stryke/fs/resolve';
21
- import '@stryke/types/tsconfig';
22
- import 'typescript';
23
- import '@stryke/types/array';
24
- import 'stylelint';
1
+ import { a as __ΩStylelintPluginContext, c as __ΩStylelintPluginUserConfig, i as StylelintPluginUserConfig, l as Plugin, n as StylelintPluginOptions, o as __ΩStylelintPluginOptions, r as StylelintPluginResolvedConfig, s as __ΩStylelintPluginResolvedConfig, t as StylelintPluginContext } from "./plugin-DAtwDCyY.cjs";
2
+ import "./index-CEgs-Dz2.cjs";
3
+
4
+ //#region src/index.d.ts
25
5
 
26
6
  /**
27
7
  * A Powerlines plugin to assist in linting stylesheets with Stylelint.
28
8
  */
29
9
  declare function plugin(options?: StylelintPluginOptions): Plugin<StylelintPluginContext>;
30
-
31
- export { StylelintPluginContext, StylelintPluginOptions, plugin as default, plugin };
10
+ //#endregion
11
+ export { StylelintPluginContext, StylelintPluginOptions, StylelintPluginResolvedConfig, StylelintPluginUserConfig, __ΩStylelintPluginContext, __ΩStylelintPluginOptions, __ΩStylelintPluginResolvedConfig, __ΩStylelintPluginUserConfig, plugin as default, plugin };
12
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAgCA;;AAEU,iBAFM,MAAA,CAEN,OAAA,CAAA,EADC,sBACD,CAAA,EAAP,MAAO,CAAA,sBAAA,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { a as __ΩStylelintPluginContext, c as __ΩStylelintPluginUserConfig, i as StylelintPluginUserConfig, l as Plugin, n as StylelintPluginOptions, o as __ΩStylelintPluginOptions, r as StylelintPluginResolvedConfig, s as __ΩStylelintPluginResolvedConfig, t as StylelintPluginContext } from "./plugin-Bn42vlak.mjs";
2
+ import "./index-BgAdqTbb.mjs";
3
+
4
+ //#region src/index.d.ts
5
+
6
+ /**
7
+ * A Powerlines plugin to assist in linting stylesheets with Stylelint.
8
+ */
9
+ declare function plugin(options?: StylelintPluginOptions): Plugin<StylelintPluginContext>;
10
+ //#endregion
11
+ export { StylelintPluginContext, StylelintPluginOptions, StylelintPluginResolvedConfig, StylelintPluginUserConfig, __ΩStylelintPluginContext, __ΩStylelintPluginOptions, __ΩStylelintPluginResolvedConfig, __ΩStylelintPluginUserConfig, plugin as default, plugin };
12
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAgCA;;AAEU,iBAFM,MAAA,CAEN,OAAA,CAAA,EADC,sBACD,CAAA,EAAP,MAAO,CAAA,sBAAA,CAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import"./plugin-Bvn-he2n.mjs";import"./types-B7VYa_Pp.mjs";import{LogLevelLabel as e}from"@storm-software/config-tools/types";import{getParentPath as t}from"@stryke/fs/get-parent-path";import{appendPath as n}from"@stryke/path/append";import{joinPaths as r}from"@stryke/path/join";import{defu as i}from"defu";import a from"stylelint";function o(o={}){return{name:`stylelint`,async config(){return this.log(e.TRACE,"Providing default configuration for the Powerlines `stylelint` build plugin."),{lint:{stylelint:i(o,{configFile:t([`stylelint.config.js`,`stylelint.config.mjs`,`stylelint.config.cjs`,`stylelint.config.ts`,`stylelint.config.mts`,`stylelint.config.cts`,`.stylelintrc.js`,`.stylelintrc.cjs`,`.stylelintrc.yaml`,`.stylelintrc.yml`,`.stylelintrc.json`,`.stylelintrc`],this.config.projectRoot,{ignoreCase:!0,skipCwd:!1,includeNameInResults:!0}),cwd:r(this.workspaceConfig.workspaceRoot,this.config.projectRoot),silent:this.config.logLevel!==null,fix:!0})}}},async lint(){this.log(e.TRACE,`Linting project files with Stylelint.`);let t=await a.lint(o);if(this.config.lint.stylelint.outputFile&&await this.fs.write(n(this.config.lint.stylelint.outputFile,this.config.projectRoot),t.report),!this.config.lint.stylelint.silent){this.log(e.INFO,t.report);let n=t.results.map(e=>e.warnings.filter(e=>e.severity===`warning`)).reduce((e,t)=>e+t.length,0);n>0?this.log(e.WARN,`${n} Stylelint linting warnings found in the listed files.`):t.errored?this.log(e.ERROR,`Stylelint linting errors found in the listed files.`):this.log(e.INFO,`All files pass Stylelint linting.`)}}}}var s=o;export{s as default,o as plugin};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { LogLevelLabel } from \"@storm-software/config-tools/types\";\nimport { getParentPath } from \"@stryke/fs/get-parent-path\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { defu } from \"defu\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport stylelint from \"stylelint\";\nimport { StylelintPluginContext, StylelintPluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\n/**\n * A Powerlines plugin to assist in linting stylesheets with Stylelint.\n */\nexport function plugin(\n options: StylelintPluginOptions = {}\n): Plugin<StylelintPluginContext> {\n return {\n name: \"stylelint\",\n async config() {\n this.log(\n LogLevelLabel.TRACE,\n \"Providing default configuration for the Powerlines `stylelint` build plugin.\"\n );\n\n const configFile = getParentPath(\n [\n \"stylelint.config.js\",\n \"stylelint.config.mjs\",\n \"stylelint.config.cjs\",\n \"stylelint.config.ts\",\n \"stylelint.config.mts\",\n \"stylelint.config.cts\",\n \".stylelintrc.js\",\n \".stylelintrc.cjs\",\n \".stylelintrc.yaml\",\n \".stylelintrc.yml\",\n \".stylelintrc.json\",\n \".stylelintrc\"\n ],\n this.config.projectRoot,\n {\n ignoreCase: true,\n skipCwd: false,\n includeNameInResults: true\n }\n );\n\n return {\n lint: {\n stylelint: defu(options, {\n configFile,\n cwd: joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.projectRoot\n ),\n silent: this.config.logLevel !== null,\n fix: true\n })\n }\n };\n },\n async lint() {\n this.log(LogLevelLabel.TRACE, `Linting project files with Stylelint.`);\n\n const result = await stylelint.lint(options);\n\n if (this.config.lint.stylelint.outputFile) {\n await this.fs.write(\n appendPath(\n this.config.lint.stylelint.outputFile,\n this.config.projectRoot\n ),\n result.report\n );\n }\n\n if (!this.config.lint.stylelint.silent) {\n this.log(LogLevelLabel.INFO, result.report);\n\n const totalWarnings = result.results\n .map(res => res.warnings.filter(warn => warn.severity === \"warning\"))\n .reduce((prev, res) => prev + res.length, 0);\n if (totalWarnings > 0) {\n this.log(\n LogLevelLabel.WARN,\n `${totalWarnings} Stylelint linting warnings found in the listed files.`\n );\n } else if (result.errored) {\n this.log(\n LogLevelLabel.ERROR,\n \"Stylelint linting errors found in the listed files.\"\n );\n } else {\n this.log(LogLevelLabel.INFO, \"All files pass Stylelint linting.\");\n }\n }\n }\n };\n}\n\nexport default plugin;\n"],"mappings":"6UAgCA,SAAgB,EACd,EAAkC,EAAE,CACJ,CAChC,MAAO,CACL,KAAM,YACN,MAAM,QAAS,CA6Bb,OA5BA,KAAK,IACH,EAAc,MACd,+EACD,CAyBM,CACL,KAAM,CACJ,UAAW,EAAK,EAAS,CACvB,WA1Ba,EACjB,CACE,sBACA,uBACA,uBACA,sBACA,uBACA,uBACA,kBACA,mBACA,oBACA,mBACA,oBACA,eACD,CACD,KAAK,OAAO,YACZ,CACE,WAAY,GACZ,QAAS,GACT,qBAAsB,GACvB,CACF,CAMK,IAAK,EACH,KAAK,gBAAgB,cACrB,KAAK,OAAO,YACb,CACD,OAAQ,KAAK,OAAO,WAAa,KACjC,IAAK,GACN,CAAC,CACH,CACF,EAEH,MAAM,MAAO,CACX,KAAK,IAAI,EAAc,MAAO,wCAAwC,CAEtE,IAAM,EAAS,MAAM,EAAU,KAAK,EAAQ,CAY5C,GAVI,KAAK,OAAO,KAAK,UAAU,YAC7B,MAAM,KAAK,GAAG,MACZ,EACE,KAAK,OAAO,KAAK,UAAU,WAC3B,KAAK,OAAO,YACb,CACD,EAAO,OACR,CAGC,CAAC,KAAK,OAAO,KAAK,UAAU,OAAQ,CACtC,KAAK,IAAI,EAAc,KAAM,EAAO,OAAO,CAE3C,IAAM,EAAgB,EAAO,QAC1B,IAAI,GAAO,EAAI,SAAS,OAAO,GAAQ,EAAK,WAAa,UAAU,CAAC,CACpE,QAAQ,EAAM,IAAQ,EAAO,EAAI,OAAQ,EAAE,CAC1C,EAAgB,EAClB,KAAK,IACH,EAAc,KACd,GAAG,EAAc,wDAClB,CACQ,EAAO,QAChB,KAAK,IACH,EAAc,MACd,sDACD,CAED,KAAK,IAAI,EAAc,KAAM,oCAAoC,GAIxE,CAGH,IAAA,EAAe"}