@powerlines/plugin-stylelint 0.1.345 → 0.1.347
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.
- package/README.md +14 -16
- package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -1
- package/dist/_virtual/_rolldown/runtime.mjs +3 -0
- package/dist/index.cjs +10 -11
- package/dist/index.d.cts +0 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -2
- package/dist/index.mjs.map +1 -1
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ This package is part of the <b>🔌 Powerlines</b> monorepo. Powerlines is the "
|
|
|
27
27
|
|
|
28
28
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
29
29
|
|
|
30
|
-
[](https://stormsoftware.com/projects/powerlines) [](http://commitizen.github.io/cz-cli/)  
|
|
31
31
|
|
|
32
32
|
<!-- prettier-ignore-start -->
|
|
33
33
|
<!-- markdownlint-disable -->
|
|
@@ -58,21 +58,19 @@ A package containing a Powerlines plugin that integrates [Stylelint](https://sty
|
|
|
58
58
|
|
|
59
59
|
## Table of Contents
|
|
60
60
|
|
|
61
|
-
- [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
- [
|
|
65
|
-
- [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
- [Contributing](#contributing)
|
|
75
|
-
- [Contributors](#contributors)
|
|
61
|
+
- [Installing](#installing)
|
|
62
|
+
- [Reduced Package Size](#reduced-package-size)
|
|
63
|
+
- [Development](#development)
|
|
64
|
+
- [Building](#building)
|
|
65
|
+
- [Running unit tests](#running-unit-tests)
|
|
66
|
+
- [Linting](#linting)
|
|
67
|
+
- [Storm Workspaces](#storm-workspaces)
|
|
68
|
+
- [Roadmap](#roadmap)
|
|
69
|
+
- [Support](#support)
|
|
70
|
+
- [License](#license)
|
|
71
|
+
- [Changelog](#changelog)
|
|
72
|
+
- [Contributing](#contributing)
|
|
73
|
+
- [Contributors](#contributors)
|
|
76
74
|
|
|
77
75
|
<!-- END doctoc -->
|
|
78
76
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
Object.
|
|
2
|
-
const
|
|
3
|
-
let
|
|
4
|
-
let
|
|
5
|
-
let
|
|
1
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _stryke_fs_get_parent_path = require("@stryke/fs/get-parent-path");
|
|
4
|
+
let _stryke_path_append = require("@stryke/path/append");
|
|
5
|
+
let _stryke_path_join = require("@stryke/path/join");
|
|
6
6
|
let defu = require("defu");
|
|
7
7
|
let stylelint = require("stylelint");
|
|
8
|
-
stylelint =
|
|
8
|
+
stylelint = require_runtime.__toESM(stylelint);
|
|
9
9
|
|
|
10
10
|
//#region src/index.ts
|
|
11
11
|
/**
|
|
@@ -17,7 +17,7 @@ function plugin(options = {}) {
|
|
|
17
17
|
async config() {
|
|
18
18
|
this.debug("Providing default configuration for the Powerlines `stylelint` build plugin.");
|
|
19
19
|
return { stylelint: (0, defu.defu)(options, {
|
|
20
|
-
configFile: (0,
|
|
20
|
+
configFile: (0, _stryke_fs_get_parent_path.getParentPath)([
|
|
21
21
|
"stylelint.config.js",
|
|
22
22
|
"stylelint.config.mjs",
|
|
23
23
|
"stylelint.config.cjs",
|
|
@@ -35,7 +35,7 @@ function plugin(options = {}) {
|
|
|
35
35
|
skipCwd: false,
|
|
36
36
|
includeNameInResults: true
|
|
37
37
|
}),
|
|
38
|
-
cwd: (0,
|
|
38
|
+
cwd: (0, _stryke_path_join.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.root),
|
|
39
39
|
silent: this.config.logLevel !== null,
|
|
40
40
|
fix: true
|
|
41
41
|
}) };
|
|
@@ -43,7 +43,7 @@ function plugin(options = {}) {
|
|
|
43
43
|
async lint() {
|
|
44
44
|
this.debug(`Linting project files with Stylelint.`);
|
|
45
45
|
const result = await stylelint.default.lint(options);
|
|
46
|
-
if (this.config.stylelint.outputFile) await this.fs.write((0,
|
|
46
|
+
if (this.config.stylelint.outputFile) await this.fs.write((0, _stryke_path_append.appendPath)(this.config.stylelint.outputFile, this.config.root), result.report);
|
|
47
47
|
if (!this.config.stylelint.silent) {
|
|
48
48
|
this.info(result.report);
|
|
49
49
|
const totalWarnings = result.results.map((res) => res.warnings.filter((warn) => warn.severity === "warning")).reduce((prev, res) => prev + res.length, 0);
|
|
@@ -54,8 +54,7 @@ function plugin(options = {}) {
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
var src_default = plugin;
|
|
58
57
|
|
|
59
58
|
//#endregion
|
|
60
|
-
exports.default =
|
|
59
|
+
exports.default = plugin;
|
|
61
60
|
exports.plugin = plugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { StylelintPluginContext, StylelintPluginOptions, StylelintPluginResolvedConfig, StylelintPluginUserConfig, __ΩStylelintPluginContext, __ΩStylelintPluginOptions, __ΩStylelintPluginResolvedConfig, __ΩStylelintPluginUserConfig } from "./types/plugin.cjs";
|
|
2
|
-
import "./types/index.cjs";
|
|
3
2
|
import { Plugin } from "powerlines";
|
|
4
3
|
|
|
5
4
|
//#region src/index.d.ts
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YAiCY,MAAA;IACR,SAAA,GAAY,sBAAA;EAAA;AAAA;;;;iBAOA,MAAA,CACd,OAAA,GAAS,sBAAA,GACR,MAAA,CAAO,sBAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { StylelintPluginContext, StylelintPluginOptions, StylelintPluginResolvedConfig, StylelintPluginUserConfig, __ΩStylelintPluginContext, __ΩStylelintPluginOptions, __ΩStylelintPluginResolvedConfig, __ΩStylelintPluginUserConfig } from "./types/plugin.mjs";
|
|
2
|
-
import "./types/index.mjs";
|
|
3
2
|
import { Plugin } from "powerlines";
|
|
4
3
|
|
|
5
4
|
//#region src/index.d.ts
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YAiCY,MAAA;IACR,SAAA,GAAY,sBAAA;EAAA;AAAA;;;;iBAOA,MAAA,CACd,OAAA,GAAS,sBAAA,GACR,MAAA,CAAO,sBAAA"}
|
package/dist/index.mjs
CHANGED
package/dist/index.mjs.map
CHANGED
|
@@ -1 +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 { 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\";\nimport stylelint from \"stylelint\";\nimport {\n StylelintPluginContext,\n StylelintPluginOptions,\n StylelintPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n stylelint?: StylelintPluginOptions;\n }\n}\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.debug(\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.root,\n {\n ignoreCase: true,\n skipCwd: false,\n includeNameInResults: true\n }\n );\n\n return {\n stylelint: defu(options, {\n configFile,\n cwd: joinPaths(this.workspaceConfig.workspaceRoot, this.config.root),\n silent: this.config.logLevel !== null,\n fix: true\n })\n } as Partial<StylelintPluginResolvedConfig>;\n },\n async lint() {\n this.debug(`Linting project files with Stylelint.`);\n\n const result = await stylelint.lint(options);\n\n if (this.config.stylelint.outputFile) {\n await this.fs.write(\n appendPath(this.config.stylelint.outputFile, this.config.root),\n result.report\n );\n }\n\n if (!this.config.stylelint.silent) {\n this.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.warn(\n `${totalWarnings} Stylelint linting warnings found in the listed files.`\n );\n } else if (result.errored) {\n this.error(\"Stylelint linting errors found in the listed files.\");\n } else {\n this.info(\"All files pass Stylelint linting.\");\n }\n }\n }\n };\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;AAyCA,SAAgB,OACd,UAAkC,EAAE,EACJ;AAChC,QAAO;EACL,MAAM;EACN,MAAM,SAAS;AACb,QAAK,MACH,+EACD;AAyBD,UAAO,EACL,WAAW,KAAK,SAAS;IACvB,YAzBe,cACjB;KACE;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD,EACD,KAAK,OAAO,MACZ;KACE,YAAY;KACZ,SAAS;KACT,sBAAsB;KACvB,CACF;IAKG,KAAK,UAAU,KAAK,gBAAgB,eAAe,KAAK,OAAO,KAAK;IACpE,QAAQ,KAAK,OAAO,aAAa;IACjC,KAAK;IACN,CAAC,EACH;;EAEH,MAAM,OAAO;AACX,QAAK,MAAM,wCAAwC;GAEnD,MAAM,SAAS,MAAM,UAAU,KAAK,QAAQ;AAE5C,OAAI,KAAK,OAAO,UAAU,WACxB,OAAM,KAAK,GAAG,MACZ,WAAW,KAAK,OAAO,UAAU,YAAY,KAAK,OAAO,KAAK,EAC9D,OAAO,OACR;AAGH,OAAI,CAAC,KAAK,OAAO,UAAU,QAAQ;AACjC,SAAK,KAAK,OAAO,OAAO;IAExB,MAAM,gBAAgB,OAAO,QAC1B,KAAI,QAAO,IAAI,SAAS,QAAO,SAAQ,KAAK,aAAa,UAAU,CAAC,CACpE,QAAQ,MAAM,QAAQ,OAAO,IAAI,QAAQ,EAAE;AAC9C,QAAI,gBAAgB,EAClB,MAAK,KACH,GAAG,cAAc,wDAClB;aACQ,OAAO,QAChB,MAAK,MAAM,sDAAsD;QAEjE,MAAK,KAAK,oCAAoC;;;EAIrD
|
|
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 { 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\";\nimport stylelint from \"stylelint\";\nimport {\n StylelintPluginContext,\n StylelintPluginOptions,\n StylelintPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n stylelint?: StylelintPluginOptions;\n }\n}\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.debug(\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.root,\n {\n ignoreCase: true,\n skipCwd: false,\n includeNameInResults: true\n }\n );\n\n return {\n stylelint: defu(options, {\n configFile,\n cwd: joinPaths(this.workspaceConfig.workspaceRoot, this.config.root),\n silent: this.config.logLevel !== null,\n fix: true\n })\n } as Partial<StylelintPluginResolvedConfig>;\n },\n async lint() {\n this.debug(`Linting project files with Stylelint.`);\n\n const result = await stylelint.lint(options);\n\n if (this.config.stylelint.outputFile) {\n await this.fs.write(\n appendPath(this.config.stylelint.outputFile, this.config.root),\n result.report\n );\n }\n\n if (!this.config.stylelint.silent) {\n this.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.warn(\n `${totalWarnings} Stylelint linting warnings found in the listed files.`\n );\n } else if (result.errored) {\n this.error(\"Stylelint linting errors found in the listed files.\");\n } else {\n this.info(\"All files pass Stylelint linting.\");\n }\n }\n }\n };\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;AAyCA,SAAgB,OACd,UAAkC,EAAE,EACJ;AAChC,QAAO;EACL,MAAM;EACN,MAAM,SAAS;AACb,QAAK,MACH,+EACD;AAyBD,UAAO,EACL,WAAW,KAAK,SAAS;IACvB,YAzBe,cACjB;KACE;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD,EACD,KAAK,OAAO,MACZ;KACE,YAAY;KACZ,SAAS;KACT,sBAAsB;KACvB,CACF;IAKG,KAAK,UAAU,KAAK,gBAAgB,eAAe,KAAK,OAAO,KAAK;IACpE,QAAQ,KAAK,OAAO,aAAa;IACjC,KAAK;IACN,CAAC,EACH;;EAEH,MAAM,OAAO;AACX,QAAK,MAAM,wCAAwC;GAEnD,MAAM,SAAS,MAAM,UAAU,KAAK,QAAQ;AAE5C,OAAI,KAAK,OAAO,UAAU,WACxB,OAAM,KAAK,GAAG,MACZ,WAAW,KAAK,OAAO,UAAU,YAAY,KAAK,OAAO,KAAK,EAC9D,OAAO,OACR;AAGH,OAAI,CAAC,KAAK,OAAO,UAAU,QAAQ;AACjC,SAAK,KAAK,OAAO,OAAO;IAExB,MAAM,gBAAgB,OAAO,QAC1B,KAAI,QAAO,IAAI,SAAS,QAAO,SAAQ,KAAK,aAAa,UAAU,CAAC,CACpE,QAAQ,MAAM,QAAQ,OAAO,IAAI,QAAQ,EAAE;AAC9C,QAAI,gBAAgB,EAClB,MAAK,KACH,GAAG,cAAc,wDAClB;aACQ,OAAO,QAChB,MAAK,MAAM,sDAAsD;QAEjE,MAAK,KAAK,oCAAoC;;;EAIrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;UAqBiB,sBAAA,SAA+B,OAAA,CAAQ,aAAA;;AAAxD;;EAIE,UAAA;EAJsD;;;EAStD,UAAA;EATqD;;;;;EAgBrD,MAAA;EAOA;;;;AAGF;EAHE,GAAA,aAAgB,OAAA;AAAA;AAAA,UAGD,yBAAA,SAAkC,UAAA;EAAA;;;EAIjD,SAAA,GAAY,sBAAA;AAAA;AAAA,UAGG,6BAAA,SAAsC,cAAA;EAAR;;;EAI7C,SAAA,EAAW,sBAAA;AAAA;AAAA,KAGD,sBAAA,yBACc,6BAAA,GACtB,6BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;UAqBiB,sBAAA,SAA+B,OAAA,CAAQ,aAAA;;AAAxD;;EAIE,UAAA;EAJsD;;;EAStD,UAAA;EATqD;;;;;EAgBrD,MAAA;EAOA;;;;AAGF;EAHE,GAAA,aAAgB,OAAA;AAAA;AAAA,UAGD,yBAAA,SAAkC,UAAA;EAAA;;;EAIjD,SAAA,GAAY,sBAAA;AAAA;AAAA,UAGG,6BAAA,SAAsC,cAAA;EAAR;;;EAI7C,SAAA,EAAW,sBAAA;AAAA;AAAA,KAGD,sBAAA,yBACc,6BAAA,GACtB,6BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-stylelint",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.347",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for running Stylelint on the codebase.",
|
|
6
6
|
"repository": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"default": "./dist/index.mjs"
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
"
|
|
56
|
+
"./package.json": "./package.json",
|
|
57
57
|
"./types": {
|
|
58
58
|
"require": {
|
|
59
59
|
"types": "./dist/types/index.d.cts",
|
|
@@ -91,20 +91,20 @@
|
|
|
91
91
|
"powerlines-plugin"
|
|
92
92
|
],
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"@storm-software/config-tools": "
|
|
94
|
+
"@storm-software/config-tools": "1.189.28",
|
|
95
95
|
"@stryke/fs": "^0.33.57",
|
|
96
96
|
"@stryke/path": "^0.26.19",
|
|
97
97
|
"defu": "^6.1.4",
|
|
98
|
-
"powerlines": "^0.41.
|
|
98
|
+
"powerlines": "^0.41.8",
|
|
99
99
|
"stylelint": "^16.26.1"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
102
|
+
"@powerlines/plugin-plugin": "^0.12.294",
|
|
103
103
|
"@types/node": "^25.4.0"
|
|
104
104
|
},
|
|
105
105
|
"publishConfig": { "access": "public" },
|
|
106
106
|
"main": "./dist/index.cjs",
|
|
107
107
|
"module": "./dist/index.mjs",
|
|
108
108
|
"types": "./dist/index.d.cts",
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "40d1f94407720be23c3801f9145fdad1fe27dfb2"
|
|
110
110
|
}
|