@powerlines/plugin-biome 0.2.590 → 0.2.591

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YA4BY,MAAA;IACR,KAAA,GAAQ,kBAAkB;EAAA;AAAA;;;;iBAOd,MAAA,CACd,OAAA,GAAS,kBAAA,GACR,MAAA,CAAO,kBAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":""}
@@ -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 { execute, executePackage } from \"@stryke/cli/execute\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { isPackageListed } from \"@stryke/fs/package-fns\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { Plugin } from \"powerlines\";\nimport { BiomePluginContext, BiomePluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n interface Config {\n biome?: BiomePluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in linting a project with Biome.\n */\nexport function plugin(\n options: BiomePluginOptions = {}\n): Plugin<BiomePluginContext> {\n return {\n name: \"biome\",\n async config() {\n this.debug(\n \"Providing default configuration for the Powerlines `biome` linting plugin.\"\n );\n\n let configFile = options.configFile;\n if (!configFile) {\n if (\n existsSync(\n joinPaths(this.config.cwd ?? \"./\", this.config.root, \"biome.json\")\n )\n ) {\n configFile = joinPaths(\n this.config.cwd ?? \"./\",\n this.config.root,\n \"biome.json\"\n );\n } else if (\n existsSync(\n joinPaths(this.config.cwd ?? \"./\", this.config.root, \"biome.jsonc\")\n )\n ) {\n configFile = joinPaths(\n this.config.cwd ?? \"./\",\n this.config.root,\n \"biome.jsonc\"\n );\n } else if (\n existsSync(joinPaths(this.config.cwd ?? \"./\", \"biome.json\"))\n ) {\n configFile = joinPaths(this.config.cwd ?? \"./\", \"biome.json\");\n } else if (\n existsSync(joinPaths(this.config.cwd ?? \"./\", \"biome.jsonc\"))\n ) {\n configFile = joinPaths(this.config.cwd ?? \"./\", \"biome.jsonc\");\n } else {\n throw new Error(\n `No Biome configuration file found. Please specify a valid config file path in the Biome plugin's \\`configFile\\` options.`\n );\n }\n }\n\n return {\n biome: {\n configFile,\n maxDiagnostics: 20,\n diagnosticLevel: \"info\",\n fix: true,\n logKind: \"pretty\",\n format: \"stylish\",\n vcsEnabled: true,\n vcsDefaultBranch: \"main\",\n ...options\n }\n };\n },\n async lint() {\n this.debug(`Linting project files with Biome.`);\n\n const args: string[] = [];\n\n if (this.config.biome.params) {\n args.push(...this.config.biome.params.split(\" \").filter(Boolean));\n }\n\n if (!args.includes(\"--log-level\")) {\n args.push(\n \"--log-level\",\n !this.config.logLevel ||\n this.config.logLevel === \"trace\" ||\n this.config.logLevel === \"debug\"\n ? \"info\"\n : this.config.logLevel\n );\n }\n\n if (\n !args.includes(\"--verbose\") &&\n (this.config.logLevel === \"trace\" ||\n this.config.logLevel === \"debug\" ||\n this.config.mode === \"development\")\n ) {\n args.push(\"--verbose\");\n }\n\n if (this.config.biome.fix !== false && !args.includes(\"--fix\")) {\n args.push(\"--fix\");\n if (this.config.biome.fix === \"unsafe\" && !args.includes(\"--unsafe\")) {\n args.push(\"--unsafe\");\n }\n }\n\n if (this.config.biome.configFile && !args.includes(\"--config-path\")) {\n args.push(\"--config-path\", this.config.biome.configFile);\n }\n\n if (this.config.biome.changed && !args.includes(\"--changed\")) {\n args.push(\"--changed\");\n }\n\n if (this.config.biome.staged && !args.includes(\"--staged\")) {\n args.push(\"--staged\");\n }\n\n if (this.config.biome.ignorePatterns && !args.includes(\"--ignore\")) {\n args.push(\n \"--ignore\",\n Array.isArray(this.config.biome.ignorePatterns)\n ? this.config.biome.ignorePatterns.join(\",\")\n : this.config.biome.ignorePatterns\n );\n }\n\n if (this.config.biome.suppress && !args.includes(\"--suppress\")) {\n args.push(\"--suppress\");\n }\n\n if (this.config.biome.only && !args.includes(\"--only\")) {\n args.push(\n \"--only\",\n Array.isArray(this.config.biome.only)\n ? this.config.biome.only.join(\",\")\n : this.config.biome.only\n );\n }\n\n if (this.config.biome.skip && !args.includes(\"--skip\")) {\n args.push(\n \"--skip\",\n Array.isArray(this.config.biome.skip)\n ? this.config.biome.skip.join(\",\")\n : this.config.biome.skip\n );\n }\n\n if (\n this.config.biome.stdinFilePath &&\n !args.includes(\"--stdin-file-path\")\n ) {\n args.push(\"--stdin-file-path\", this.config.biome.stdinFilePath);\n }\n\n if (\n this.config.biome.maxDiagnostics !== undefined &&\n !args.includes(\"--max-diagnostics\")\n ) {\n args.push(\n \"--max-diagnostics\",\n this.config.biome.maxDiagnostics.toString()\n );\n }\n\n if (\n this.config.biome.diagnosticLevel &&\n !args.includes(\"--diagnostic-level\")\n ) {\n args.push(\"--diagnostic-level\", this.config.biome.diagnosticLevel);\n }\n\n if (\n this.config.biome.errorOnWarnings &&\n !args.includes(\"--error-on-warnings\")\n ) {\n args.push(\"--error-on-warnings\");\n }\n\n if (\n this.config.biome.jsonParseAllowComments &&\n !args.includes(\"--json-parse-allow-comments\")\n ) {\n args.push(\"--json-parse-allow-comments\");\n }\n\n if (\n this.config.biome.jsonParseAllowTrailingCommas &&\n !args.includes(\"--json-parse-allow-trailing-commas\")\n ) {\n args.push(\"--json-parse-allow-trailing-commas\");\n }\n\n if (this.config.biome.reporter && !args.includes(\"--reporter\")) {\n args.push(\"--reporter\", this.config.biome.reporter);\n }\n\n if (this.config.biome.logKind && !args.includes(\"--log-kind\")) {\n args.push(\"--log-kind\", this.config.biome.logKind);\n }\n\n if (\n this.config.biome.filesMaxSize &&\n !args.includes(\"--files-max-size\")\n ) {\n args.push(\n \"--files-max-size\",\n this.config.biome.filesMaxSize.toString()\n );\n }\n\n if (\n this.config.biome.filesIgnoreUnknown &&\n !args.includes(\"--files-ignore-unknown\")\n ) {\n args.push(\"--files-ignore-unknown\");\n }\n\n if (this.config.biome.vcsEnabled && !args.includes(\"--vcs-enabled\")) {\n args.push(\"--vcs-enabled\");\n\n if (!args.includes(\"--vcs-root\")) {\n args.push(\"--vcs-root\", this.config.cwd);\n }\n\n if (\n this.config.biome.vcsClientKind &&\n !args.includes(\"--vcs-client-kind\")\n ) {\n args.push(\"--vcs-client-kind\", this.config.biome.vcsClientKind);\n }\n\n if (\n this.config.biome.vcsUseIgnoreFile &&\n !args.includes(\"--vcs-use-ignore-file\")\n ) {\n args.push(\"--vcs-use-ignore-file\");\n }\n\n if (\n this.config.biome.vcsDefaultBranch &&\n !args.includes(\"--vcs-default-branch\")\n ) {\n args.push(\"--vcs-default-branch\", this.config.biome.vcsDefaultBranch);\n }\n }\n\n if (!this.config.biome.biomePath) {\n const isBiomeListed = await isPackageListed(\n \"@biomejs/biome\",\n this.config.root\n );\n\n args.unshift(isBiomeListed ? \"./\" : joinPaths(this.config.root, \"src\"));\n\n const result = await executePackage(\n \"biome\",\n args,\n isBiomeListed\n ? joinPaths(this.config.cwd, this.config.root)\n : this.config.root\n );\n if (result.failed) {\n throw new Error(`Biome process exited with code ${result.exitCode}.`);\n }\n } else {\n args.unshift(\n this.config.biome.biomePath,\n joinPaths(this.config.root, \"src\")\n );\n\n const result = await execute(args.join(\" \"), this.config.cwd);\n if (result.failed) {\n throw new Error(`Biome process exited with code ${result.exitCode}.`);\n }\n }\n }\n };\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;AAoCA,SAAg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ClB,CAAC,KAAK,SAAS,mBAAmB,GAElC,KAAK,KAAK,qBAAqB,KAAK,OAAO,MAAM,aAAa;IAGhE,IACE,KAAK,OAAO,MAAM,oBAClB,CAAC,KAAK,SAAS,uBAAuB,GAEtC,KAAK,KAAK,uBAAuB;IAGnC,IACE,KAAK,OAAO,MAAM,oBAClB,CAAC,KAAK,SAAS,sBAAsB,GAErC,KAAK,KAAK,wBAAwB,KAAK,OAAO,MAAM,gBAAgB;GAExE;GAEA,IAAI,CAAC,KAAK,OAAO,MAAM,WAAW;IAChC,MAAM,gBAAgB,MAAM,gBAC1B,kBACA,KAAK,OAAO,IACd;IAEA,KAAK,QAAQ,gBAAgB,OAAO,UAAU,KAAK,OAAO,MAAM,KAAK,CAAC;IAEtE,MAAM,SAAS,MAAM,eACnB,SACA,MACA,gBACI,UAAU,KAAK,OAAO,KAAK,KAAK,OAAO,IAAI,IAC3C,KAAK,OAAO,IAClB;IACA,IAAI,OAAO,QACT,MAAM,IAAI,MAAM,kCAAkC,OAAO,SAAS,EAAE;GAExE,OAAO;IACL,KAAK,QACH,KAAK,OAAO,MAAM,WAClB,UAAU,KAAK,OAAO,MAAM,KAAK,CACnC;IAEA,MAAM,SAAS,MAAM,QAAQ,KAAK,KAAK,GAAG,GAAG,KAAK,OAAO,GAAG;IAC5D,IAAI,OAAO,QACT,MAAM,IAAI,MAAM,kCAAkC,OAAO,SAAS,EAAE;GAExE;EACF;CACF;AACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;UAoBiB,kBAAA;;AAAjB;;EAIE,cAAA;EAJiC;;;;;EAWjC,UAAA;EAsBA;;;;;EAfA,GAAA;EAiDA;;;EA5CA,uBAAA;EAgEA;;;EA3DA,iBAAA;EA2FA;;;EAtFA,YAAA;EA0GA;;;EArGA,kBAAA;EA6HA;;;EAxHA,MAAA;EAuIS;AAAA;AAGX;;;EAnIE,MAAA;EAmI6C;;;;AAInB;EAhI1B,cAAA;EAmIyC;;;EA9HzC,eAAA;EAkIA;;;EA7HA,mBAAA;EAgIU;;;EA3HV,eAAA;EA4HoD;;;EAvHpD,sBAAA;EAwHe;;;EAnHf,4BAAA;EAmHE;;;EA9GF,QAAA;;;;;;EAeA,OAAA;;;;;;EAOA,eAAA;;;;EAKA,QAAA;;;;EAKA,MAAA;;;;EAKA,IAAA;;;;EAKA,IAAA;;;;EAKA,aAAA;;;;EAKA,UAAA;;;;;;EAOA,aAAA;;;;EAKA,gBAAA;;;;;;EAOA,gBAAA;;;;EAKA,MAAA;;;;EAKA,OAAA;;;;EAKA,MAAA;;;;EAKA,SAAA;AAAA;AAAA,UAGe,qBAAA,SAA8B,UAAU;;;;EAIvD,KAAA,GAAQ,kBAAA;AAAA;AAAA,UAGO,yBAAA,SAAkC,cAAc;;;;EAI/D,KAAA,EAAO,kBAAA;AAAA;AAAA,KAGG,kBAAA,yBACc,yBAAA,GAA4B,yBAAA,IAClD,aAAA,CAAc,eAAA"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-biome",
3
- "version": "0.2.590",
3
+ "version": "0.2.591",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin for running Biome linting on the codebase.",
6
6
  "repository": {
@@ -88,20 +88,21 @@
88
88
  "peerDependencies": { "@biomejs/biome": ">=2.0.0" },
89
89
  "peerDependenciesMeta": { "@biomejs/biome": { "optional": false } },
90
90
  "dependencies": {
91
- "@storm-software/config-tools": "catalog:",
92
- "@stryke/cli": "catalog:",
93
- "@stryke/convert": "catalog:",
94
- "@stryke/fs": "catalog:",
95
- "@stryke/path": "catalog:",
96
- "defu": "catalog:",
97
- "powerlines": "workspace:*"
91
+ "@storm-software/config-tools": "^1.190.40",
92
+ "@stryke/cli": "^0.13.57",
93
+ "@stryke/convert": "^0.7.15",
94
+ "@stryke/fs": "^0.33.85",
95
+ "@stryke/path": "^0.29.11",
96
+ "defu": "^6.1.7",
97
+ "powerlines": "0.47.124"
98
98
  },
99
99
  "devDependencies": {
100
- "@powerlines/plugin-plugin": "workspace:*",
101
- "@types/node": "catalog:"
100
+ "@powerlines/plugin-plugin": "0.12.536",
101
+ "@types/node": "^25.9.1"
102
102
  },
103
103
  "publishConfig": { "access": "public" },
104
104
  "main": "./dist/index.cjs",
105
105
  "module": "./dist/index.mjs",
106
- "types": "./dist/index.d.cts"
106
+ "types": "./dist/index.d.cts",
107
+ "gitHead": "1530c8cbb090f1f728d112475074eb3a86070557"
107
108
  }