@powerlines/plugin-biome 0.2.52 → 0.2.54

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 CHANGED
@@ -3,7 +3,13 @@
3
3
  <!-- markdownlint-disable -->
4
4
 
5
5
 
6
- <div align="center"><img src="https://public.storm-cdn.com/storm-banner.gif" width="100%" alt="Powerlines" /></div>
6
+ <div align="center">
7
+ <picture>
8
+ <source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/powerlines/banner-1280x640-dark-optimized.gif">
9
+ <source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/powerlines/banner-1280x640-light-optimized.gif">
10
+ <img src="https://public.storm-cdn.com/powerlines/banner-1280x640-dark-optimized.gif" width="100%" alt="Powerlines" />
11
+ </picture>
12
+ </div>
7
13
  <br />
8
14
 
9
15
  <div align="center">
@@ -16,7 +22,7 @@
16
22
  </div>
17
23
 
18
24
  <br />
19
- This package is part of the ⚡<b>Powerlines</b> monorepo. Powerlines packages include CLI utility applications, tools, and various libraries used to create modern, scalable web applications.
25
+ This package is part of the 🔌 <b>Powerlines</b> monorepo. Powerlines packages include CLI utility applications, tools, and various libraries used to create modern, scalable web applications.
20
26
  <br />
21
27
 
22
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 />
@@ -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'),execute=require('@stryke/cli/execute'),exists=require('@stryke/fs/exists'),packageFns=require('@stryke/fs/package-fns'),join=require('@stryke/path/join'),replace=require('@stryke/path/replace'),types=require('./types');/*****************************************
2
- *
3
- * ⚡ Built by Storm Software
4
- *
5
- *****************************************/
6
-
7
- var f=Object.defineProperty;var c=(n,i)=>f(n,"name",{value:i,configurable:true});function m(n={}){return {name:"biome",async config(){this.log(types$1.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `biome` linting plugin.");let i=n.configFile;if(!i)if(exists.existsSync(join.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot,"biome.json")))i=join.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot,"biome.json");else if(exists.existsSync(join.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot,"biome.jsonc")))i=join.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot,"biome.jsonc");else if(exists.existsSync(join.joinPaths(this.workspaceConfig.workspaceRoot,"biome.json")))i=join.joinPaths(this.workspaceConfig.workspaceRoot,"biome.json");else if(exists.existsSync(join.joinPaths(this.workspaceConfig.workspaceRoot,"biome.jsonc")))i=join.joinPaths(this.workspaceConfig.workspaceRoot,"biome.jsonc");else throw new Error("No Biome configuration file found. Please specify a valid config file path in the Biome plugin's `configFile` options.");return {lint:{biome:{configFile:i,maxDiagnostics:20,diagnosticLevel:"info",fix:true,logKind:"pretty",format:"stylish",vcsEnabled:true,vcsDefaultBranch:this.workspaceConfig.branch||"main",...n}}}},async lint(){this.log(types$1.LogLevelLabel.TRACE,"Linting project files with Biome.");const i=[];if(this.config.lint.biome.params&&i.push(...this.config.lint.biome.params.split(" ").filter(Boolean)),i.includes("--log-level")||i.push("--log-level",!this.config.logLevel||this.config.logLevel==="trace"||this.config.logLevel==="debug"?"info":this.config.logLevel),!i.includes("--verbose")&&(this.config.logLevel==="trace"||this.config.logLevel==="debug"||this.config.mode==="development")&&i.push("--verbose"),this.config.lint.biome.fix!==false&&!i.includes("--fix")&&(i.push("--fix"),this.config.lint.biome.fix==="unsafe"&&!i.includes("--unsafe")&&i.push("--unsafe")),this.config.lint.biome.configFile&&!i.includes("--config-path")&&i.push("--config-path",this.config.lint.biome.configFile),this.config.lint.biome.changed&&!i.includes("--changed")&&i.push("--changed"),this.config.lint.biome.staged&&!i.includes("--staged")&&i.push("--staged"),this.config.lint.biome.ignorePatterns&&!i.includes("--ignore")&&i.push("--ignore",Array.isArray(this.config.lint.biome.ignorePatterns)?this.config.lint.biome.ignorePatterns.join(","):this.config.lint.biome.ignorePatterns),this.config.lint.biome.suppress&&!i.includes("--suppress")&&i.push("--suppress"),this.config.lint.biome.only&&!i.includes("--only")&&i.push("--only",Array.isArray(this.config.lint.biome.only)?this.config.lint.biome.only.join(","):this.config.lint.biome.only),this.config.lint.biome.skip&&!i.includes("--skip")&&i.push("--skip",Array.isArray(this.config.lint.biome.skip)?this.config.lint.biome.skip.join(","):this.config.lint.biome.skip),this.config.lint.biome.stdinFilePath&&!i.includes("--stdin-file-path")&&i.push("--stdin-file-path",this.config.lint.biome.stdinFilePath),this.config.lint.biome.maxDiagnostics!==void 0&&!i.includes("--max-diagnostics")&&i.push("--max-diagnostics",this.config.lint.biome.maxDiagnostics.toString()),this.config.lint.biome.diagnosticLevel&&!i.includes("--diagnostic-level")&&i.push("--diagnostic-level",this.config.lint.biome.diagnosticLevel),this.config.lint.biome.errorOnWarnings&&!i.includes("--error-on-warnings")&&i.push("--error-on-warnings"),this.config.lint.biome.jsonParseAllowComments&&!i.includes("--json-parse-allow-comments")&&i.push("--json-parse-allow-comments"),this.config.lint.biome.jsonParseAllowTrailingCommas&&!i.includes("--json-parse-allow-trailing-commas")&&i.push("--json-parse-allow-trailing-commas"),this.config.lint.biome.reporter&&!i.includes("--reporter")&&i.push("--reporter",this.config.lint.biome.reporter),this.config.lint.biome.logKind&&!i.includes("--log-kind")&&i.push("--log-kind",this.config.lint.biome.logKind),this.config.lint.biome.filesMaxSize&&!i.includes("--files-max-size")&&i.push("--files-max-size",this.config.lint.biome.filesMaxSize.toString()),this.config.lint.biome.filesIgnoreUnknown&&!i.includes("--files-ignore-unknown")&&i.push("--files-ignore-unknown"),this.config.lint.biome.vcsEnabled&&!i.includes("--vcs-enabled")&&(i.push("--vcs-enabled"),i.includes("--vcs-root")||i.push("--vcs-root",this.workspaceConfig.workspaceRoot),this.config.lint.biome.vcsClientKind&&!i.includes("--vcs-client-kind")&&i.push("--vcs-client-kind",this.config.lint.biome.vcsClientKind),this.config.lint.biome.vcsUseIgnoreFile&&!i.includes("--vcs-use-ignore-file")&&i.push("--vcs-use-ignore-file"),this.config.lint.biome.vcsDefaultBranch&&!i.includes("--vcs-default-branch")&&i.push("--vcs-default-branch",this.config.lint.biome.vcsDefaultBranch)),this.config.lint.biome.biomePath){i.unshift(this.config.lint.biome.biomePath,this.config.sourceRoot);const e=await execute.execute(i.join(" "),this.workspaceConfig.workspaceRoot);if(e.failed)throw new Error(`Biome process exited with code ${e.exitCode}.`)}else {const e=await packageFns.isPackageListed("@biomejs/biome",this.config.projectRoot);i.unshift(e?replace.replacePath(this.config.sourceRoot,this.config.projectRoot):this.config.sourceRoot);const t=await execute.executePackage("biome",i,e?join.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot):this.config.projectRoot);if(t.failed)throw new Error(`Biome process exited with code ${t.exitCode}.`)}}}}c(m,"plugin");var L=m;exports.default=L;exports.plugin=m;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}),require(`./plugin-DHXHjv16.cjs`),require(`./types-DHkg7xmX.cjs`);let e=require(`@storm-software/config-tools/types`),t=require(`@stryke/cli/execute`),n=require(`@stryke/fs/exists`),r=require(`@stryke/fs/package-fns`),i=require(`@stryke/path/join`),a=require(`@stryke/path/replace`);function o(o={}){return{name:`biome`,async config(){this.log(e.LogLevelLabel.TRACE,"Providing default configuration for the Powerlines `biome` linting plugin.");let t=o.configFile;if(!t)if((0,n.existsSync)((0,i.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot,`biome.json`)))t=(0,i.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot,`biome.json`);else if((0,n.existsSync)((0,i.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot,`biome.jsonc`)))t=(0,i.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot,`biome.jsonc`);else if((0,n.existsSync)((0,i.joinPaths)(this.workspaceConfig.workspaceRoot,`biome.json`)))t=(0,i.joinPaths)(this.workspaceConfig.workspaceRoot,`biome.json`);else if((0,n.existsSync)((0,i.joinPaths)(this.workspaceConfig.workspaceRoot,`biome.jsonc`)))t=(0,i.joinPaths)(this.workspaceConfig.workspaceRoot,`biome.jsonc`);else throw Error("No Biome configuration file found. Please specify a valid config file path in the Biome plugin's `configFile` options.");return{lint:{biome:{configFile:t,maxDiagnostics:20,diagnosticLevel:`info`,fix:!0,logKind:`pretty`,format:`stylish`,vcsEnabled:!0,vcsDefaultBranch:this.workspaceConfig.branch||`main`,...o}}}},async lint(){this.log(e.LogLevelLabel.TRACE,`Linting project files with Biome.`);let n=[];if(this.config.lint.biome.params&&n.push(...this.config.lint.biome.params.split(` `).filter(Boolean)),n.includes(`--log-level`)||n.push(`--log-level`,!this.config.logLevel||this.config.logLevel===`trace`||this.config.logLevel===`debug`?`info`:this.config.logLevel),!n.includes(`--verbose`)&&(this.config.logLevel===`trace`||this.config.logLevel===`debug`||this.config.mode===`development`)&&n.push(`--verbose`),this.config.lint.biome.fix!==!1&&!n.includes(`--fix`)&&(n.push(`--fix`),this.config.lint.biome.fix===`unsafe`&&!n.includes(`--unsafe`)&&n.push(`--unsafe`)),this.config.lint.biome.configFile&&!n.includes(`--config-path`)&&n.push(`--config-path`,this.config.lint.biome.configFile),this.config.lint.biome.changed&&!n.includes(`--changed`)&&n.push(`--changed`),this.config.lint.biome.staged&&!n.includes(`--staged`)&&n.push(`--staged`),this.config.lint.biome.ignorePatterns&&!n.includes(`--ignore`)&&n.push(`--ignore`,Array.isArray(this.config.lint.biome.ignorePatterns)?this.config.lint.biome.ignorePatterns.join(`,`):this.config.lint.biome.ignorePatterns),this.config.lint.biome.suppress&&!n.includes(`--suppress`)&&n.push(`--suppress`),this.config.lint.biome.only&&!n.includes(`--only`)&&n.push(`--only`,Array.isArray(this.config.lint.biome.only)?this.config.lint.biome.only.join(`,`):this.config.lint.biome.only),this.config.lint.biome.skip&&!n.includes(`--skip`)&&n.push(`--skip`,Array.isArray(this.config.lint.biome.skip)?this.config.lint.biome.skip.join(`,`):this.config.lint.biome.skip),this.config.lint.biome.stdinFilePath&&!n.includes(`--stdin-file-path`)&&n.push(`--stdin-file-path`,this.config.lint.biome.stdinFilePath),this.config.lint.biome.maxDiagnostics!==void 0&&!n.includes(`--max-diagnostics`)&&n.push(`--max-diagnostics`,this.config.lint.biome.maxDiagnostics.toString()),this.config.lint.biome.diagnosticLevel&&!n.includes(`--diagnostic-level`)&&n.push(`--diagnostic-level`,this.config.lint.biome.diagnosticLevel),this.config.lint.biome.errorOnWarnings&&!n.includes(`--error-on-warnings`)&&n.push(`--error-on-warnings`),this.config.lint.biome.jsonParseAllowComments&&!n.includes(`--json-parse-allow-comments`)&&n.push(`--json-parse-allow-comments`),this.config.lint.biome.jsonParseAllowTrailingCommas&&!n.includes(`--json-parse-allow-trailing-commas`)&&n.push(`--json-parse-allow-trailing-commas`),this.config.lint.biome.reporter&&!n.includes(`--reporter`)&&n.push(`--reporter`,this.config.lint.biome.reporter),this.config.lint.biome.logKind&&!n.includes(`--log-kind`)&&n.push(`--log-kind`,this.config.lint.biome.logKind),this.config.lint.biome.filesMaxSize&&!n.includes(`--files-max-size`)&&n.push(`--files-max-size`,this.config.lint.biome.filesMaxSize.toString()),this.config.lint.biome.filesIgnoreUnknown&&!n.includes(`--files-ignore-unknown`)&&n.push(`--files-ignore-unknown`),this.config.lint.biome.vcsEnabled&&!n.includes(`--vcs-enabled`)&&(n.push(`--vcs-enabled`),n.includes(`--vcs-root`)||n.push(`--vcs-root`,this.workspaceConfig.workspaceRoot),this.config.lint.biome.vcsClientKind&&!n.includes(`--vcs-client-kind`)&&n.push(`--vcs-client-kind`,this.config.lint.biome.vcsClientKind),this.config.lint.biome.vcsUseIgnoreFile&&!n.includes(`--vcs-use-ignore-file`)&&n.push(`--vcs-use-ignore-file`),this.config.lint.biome.vcsDefaultBranch&&!n.includes(`--vcs-default-branch`)&&n.push(`--vcs-default-branch`,this.config.lint.biome.vcsDefaultBranch)),this.config.lint.biome.biomePath){n.unshift(this.config.lint.biome.biomePath,this.config.sourceRoot);let e=await(0,t.execute)(n.join(` `),this.workspaceConfig.workspaceRoot);if(e.failed)throw Error(`Biome process exited with code ${e.exitCode}.`)}else{let e=await(0,r.isPackageListed)(`@biomejs/biome`,this.config.projectRoot);n.unshift(e?(0,a.replacePath)(this.config.sourceRoot,this.config.projectRoot):this.config.sourceRoot);let o=await(0,t.executePackage)(`biome`,n,e?(0,i.joinPaths)(this.workspaceConfig.workspaceRoot,this.config.projectRoot):this.config.projectRoot);if(o.failed)throw Error(`Biome process exited with code ${o.exitCode}.`)}}}}var s=o;exports.default=s,exports.plugin=o;
package/dist/index.d.cts CHANGED
@@ -1,30 +1,12 @@
1
- import { B as BiomePluginOptions, P as Plugin, a as BiomePluginContext } from './index-Bhx-oNfX.cjs';
2
- export { c as BiomePluginResolvedConfig, b as BiomePluginUserConfig, f as __ΩBiomePluginContext, _ as __ΩBiomePluginOptions, e as __ΩBiomePluginResolvedConfig, d as __ΩBiomePluginUserConfig } from './index-Bhx-oNfX.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';
1
+ import { a as __ΩBiomePluginContext, c as __ΩBiomePluginUserConfig, i as BiomePluginUserConfig, l as Plugin, n as BiomePluginOptions, o as __ΩBiomePluginOptions, r as BiomePluginResolvedConfig, s as __ΩBiomePluginResolvedConfig, t as BiomePluginContext } from "./plugin-BxknlgSR.cjs";
2
+ import "./index-CEgs-Dz2.cjs";
3
+
4
+ //#region src/index.d.ts
24
5
 
25
6
  /**
26
7
  * A Powerlines plugin to assist in linting a project with Biome.
27
8
  */
28
9
  declare function plugin(options?: BiomePluginOptions): Plugin<BiomePluginContext>;
29
-
30
- export { BiomePluginContext, BiomePluginOptions, plugin as default, plugin };
10
+ //#endregion
11
+ export { BiomePluginContext, BiomePluginOptions, BiomePluginResolvedConfig, BiomePluginUserConfig, __ΩBiomePluginContext, __ΩBiomePluginOptions, __ΩBiomePluginResolvedConfig, __ΩBiomePluginUserConfig, 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,kBACD,CAAA,EAAP,MAAO,CAAA,kBAAA,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { a as __ΩBiomePluginContext, c as __ΩBiomePluginUserConfig, i as BiomePluginUserConfig, l as Plugin, n as BiomePluginOptions, o as __ΩBiomePluginOptions, r as BiomePluginResolvedConfig, s as __ΩBiomePluginResolvedConfig, t as BiomePluginContext } from "./plugin-DlFuHxy7.mjs";
2
+ import "./index-BgAdqTbb.mjs";
3
+
4
+ //#region src/index.d.ts
5
+
6
+ /**
7
+ * A Powerlines plugin to assist in linting a project with Biome.
8
+ */
9
+ declare function plugin(options?: BiomePluginOptions): Plugin<BiomePluginContext>;
10
+ //#endregion
11
+ export { BiomePluginContext, BiomePluginOptions, BiomePluginResolvedConfig, BiomePluginUserConfig, __ΩBiomePluginContext, __ΩBiomePluginOptions, __ΩBiomePluginResolvedConfig, __ΩBiomePluginUserConfig, 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,kBACD,CAAA,EAAP,MAAO,CAAA,kBAAA,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{execute as t,executePackage as n}from"@stryke/cli/execute";import{existsSync as r}from"@stryke/fs/exists";import{isPackageListed as i}from"@stryke/fs/package-fns";import{joinPaths as a}from"@stryke/path/join";import{replacePath as o}from"@stryke/path/replace";function s(s={}){return{name:`biome`,async config(){this.log(e.TRACE,"Providing default configuration for the Powerlines `biome` linting plugin.");let t=s.configFile;if(!t)if(r(a(this.workspaceConfig.workspaceRoot,this.config.projectRoot,`biome.json`)))t=a(this.workspaceConfig.workspaceRoot,this.config.projectRoot,`biome.json`);else if(r(a(this.workspaceConfig.workspaceRoot,this.config.projectRoot,`biome.jsonc`)))t=a(this.workspaceConfig.workspaceRoot,this.config.projectRoot,`biome.jsonc`);else if(r(a(this.workspaceConfig.workspaceRoot,`biome.json`)))t=a(this.workspaceConfig.workspaceRoot,`biome.json`);else if(r(a(this.workspaceConfig.workspaceRoot,`biome.jsonc`)))t=a(this.workspaceConfig.workspaceRoot,`biome.jsonc`);else throw Error("No Biome configuration file found. Please specify a valid config file path in the Biome plugin's `configFile` options.");return{lint:{biome:{configFile:t,maxDiagnostics:20,diagnosticLevel:`info`,fix:!0,logKind:`pretty`,format:`stylish`,vcsEnabled:!0,vcsDefaultBranch:this.workspaceConfig.branch||`main`,...s}}}},async lint(){this.log(e.TRACE,`Linting project files with Biome.`);let r=[];if(this.config.lint.biome.params&&r.push(...this.config.lint.biome.params.split(` `).filter(Boolean)),r.includes(`--log-level`)||r.push(`--log-level`,!this.config.logLevel||this.config.logLevel===`trace`||this.config.logLevel===`debug`?`info`:this.config.logLevel),!r.includes(`--verbose`)&&(this.config.logLevel===`trace`||this.config.logLevel===`debug`||this.config.mode===`development`)&&r.push(`--verbose`),this.config.lint.biome.fix!==!1&&!r.includes(`--fix`)&&(r.push(`--fix`),this.config.lint.biome.fix===`unsafe`&&!r.includes(`--unsafe`)&&r.push(`--unsafe`)),this.config.lint.biome.configFile&&!r.includes(`--config-path`)&&r.push(`--config-path`,this.config.lint.biome.configFile),this.config.lint.biome.changed&&!r.includes(`--changed`)&&r.push(`--changed`),this.config.lint.biome.staged&&!r.includes(`--staged`)&&r.push(`--staged`),this.config.lint.biome.ignorePatterns&&!r.includes(`--ignore`)&&r.push(`--ignore`,Array.isArray(this.config.lint.biome.ignorePatterns)?this.config.lint.biome.ignorePatterns.join(`,`):this.config.lint.biome.ignorePatterns),this.config.lint.biome.suppress&&!r.includes(`--suppress`)&&r.push(`--suppress`),this.config.lint.biome.only&&!r.includes(`--only`)&&r.push(`--only`,Array.isArray(this.config.lint.biome.only)?this.config.lint.biome.only.join(`,`):this.config.lint.biome.only),this.config.lint.biome.skip&&!r.includes(`--skip`)&&r.push(`--skip`,Array.isArray(this.config.lint.biome.skip)?this.config.lint.biome.skip.join(`,`):this.config.lint.biome.skip),this.config.lint.biome.stdinFilePath&&!r.includes(`--stdin-file-path`)&&r.push(`--stdin-file-path`,this.config.lint.biome.stdinFilePath),this.config.lint.biome.maxDiagnostics!==void 0&&!r.includes(`--max-diagnostics`)&&r.push(`--max-diagnostics`,this.config.lint.biome.maxDiagnostics.toString()),this.config.lint.biome.diagnosticLevel&&!r.includes(`--diagnostic-level`)&&r.push(`--diagnostic-level`,this.config.lint.biome.diagnosticLevel),this.config.lint.biome.errorOnWarnings&&!r.includes(`--error-on-warnings`)&&r.push(`--error-on-warnings`),this.config.lint.biome.jsonParseAllowComments&&!r.includes(`--json-parse-allow-comments`)&&r.push(`--json-parse-allow-comments`),this.config.lint.biome.jsonParseAllowTrailingCommas&&!r.includes(`--json-parse-allow-trailing-commas`)&&r.push(`--json-parse-allow-trailing-commas`),this.config.lint.biome.reporter&&!r.includes(`--reporter`)&&r.push(`--reporter`,this.config.lint.biome.reporter),this.config.lint.biome.logKind&&!r.includes(`--log-kind`)&&r.push(`--log-kind`,this.config.lint.biome.logKind),this.config.lint.biome.filesMaxSize&&!r.includes(`--files-max-size`)&&r.push(`--files-max-size`,this.config.lint.biome.filesMaxSize.toString()),this.config.lint.biome.filesIgnoreUnknown&&!r.includes(`--files-ignore-unknown`)&&r.push(`--files-ignore-unknown`),this.config.lint.biome.vcsEnabled&&!r.includes(`--vcs-enabled`)&&(r.push(`--vcs-enabled`),r.includes(`--vcs-root`)||r.push(`--vcs-root`,this.workspaceConfig.workspaceRoot),this.config.lint.biome.vcsClientKind&&!r.includes(`--vcs-client-kind`)&&r.push(`--vcs-client-kind`,this.config.lint.biome.vcsClientKind),this.config.lint.biome.vcsUseIgnoreFile&&!r.includes(`--vcs-use-ignore-file`)&&r.push(`--vcs-use-ignore-file`),this.config.lint.biome.vcsDefaultBranch&&!r.includes(`--vcs-default-branch`)&&r.push(`--vcs-default-branch`,this.config.lint.biome.vcsDefaultBranch)),this.config.lint.biome.biomePath){r.unshift(this.config.lint.biome.biomePath,this.config.sourceRoot);let e=await t(r.join(` `),this.workspaceConfig.workspaceRoot);if(e.failed)throw Error(`Biome process exited with code ${e.exitCode}.`)}else{let e=await i(`@biomejs/biome`,this.config.projectRoot);r.unshift(e?o(this.config.sourceRoot,this.config.projectRoot):this.config.sourceRoot);let t=await n(`biome`,r,e?a(this.workspaceConfig.workspaceRoot,this.config.projectRoot):this.config.projectRoot);if(t.failed)throw Error(`Biome process exited with code ${t.exitCode}.`)}}}}var c=s;export{c as default,s as plugin};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["args: string[]"],"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 { 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 { replacePath } from \"@stryke/path/replace\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport { BiomePluginContext, BiomePluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\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.log(\n LogLevelLabel.TRACE,\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(\n this.workspaceConfig.workspaceRoot,\n this.config.projectRoot,\n \"biome.json\"\n )\n )\n ) {\n configFile = joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.projectRoot,\n \"biome.json\"\n );\n } else if (\n existsSync(\n joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.projectRoot,\n \"biome.jsonc\"\n )\n )\n ) {\n configFile = joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.projectRoot,\n \"biome.jsonc\"\n );\n } else if (\n existsSync(\n joinPaths(this.workspaceConfig.workspaceRoot, \"biome.json\")\n )\n ) {\n configFile = joinPaths(\n this.workspaceConfig.workspaceRoot,\n \"biome.json\"\n );\n } else if (\n existsSync(\n joinPaths(this.workspaceConfig.workspaceRoot, \"biome.jsonc\")\n )\n ) {\n configFile = joinPaths(\n this.workspaceConfig.workspaceRoot,\n \"biome.jsonc\"\n );\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 lint: {\n biome: {\n configFile,\n maxDiagnostics: 20,\n diagnosticLevel: \"info\",\n fix: true,\n logKind: \"pretty\",\n format: \"stylish\",\n vcsEnabled: true,\n vcsDefaultBranch: this.workspaceConfig.branch || \"main\",\n ...options\n }\n }\n };\n },\n async lint() {\n this.log(LogLevelLabel.TRACE, `Linting project files with Biome.`);\n\n const args: string[] = [];\n\n if (this.config.lint.biome.params) {\n args.push(...this.config.lint.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.lint.biome.fix !== false && !args.includes(\"--fix\")) {\n args.push(\"--fix\");\n if (\n this.config.lint.biome.fix === \"unsafe\" &&\n !args.includes(\"--unsafe\")\n ) {\n args.push(\"--unsafe\");\n }\n }\n\n if (\n this.config.lint.biome.configFile &&\n !args.includes(\"--config-path\")\n ) {\n args.push(\"--config-path\", this.config.lint.biome.configFile);\n }\n\n if (this.config.lint.biome.changed && !args.includes(\"--changed\")) {\n args.push(\"--changed\");\n }\n\n if (this.config.lint.biome.staged && !args.includes(\"--staged\")) {\n args.push(\"--staged\");\n }\n\n if (this.config.lint.biome.ignorePatterns && !args.includes(\"--ignore\")) {\n args.push(\n \"--ignore\",\n Array.isArray(this.config.lint.biome.ignorePatterns)\n ? this.config.lint.biome.ignorePatterns.join(\",\")\n : this.config.lint.biome.ignorePatterns\n );\n }\n\n if (this.config.lint.biome.suppress && !args.includes(\"--suppress\")) {\n args.push(\"--suppress\");\n }\n\n if (this.config.lint.biome.only && !args.includes(\"--only\")) {\n args.push(\n \"--only\",\n Array.isArray(this.config.lint.biome.only)\n ? this.config.lint.biome.only.join(\",\")\n : this.config.lint.biome.only\n );\n }\n\n if (this.config.lint.biome.skip && !args.includes(\"--skip\")) {\n args.push(\n \"--skip\",\n Array.isArray(this.config.lint.biome.skip)\n ? this.config.lint.biome.skip.join(\",\")\n : this.config.lint.biome.skip\n );\n }\n\n if (\n this.config.lint.biome.stdinFilePath &&\n !args.includes(\"--stdin-file-path\")\n ) {\n args.push(\"--stdin-file-path\", this.config.lint.biome.stdinFilePath);\n }\n\n if (\n this.config.lint.biome.maxDiagnostics !== undefined &&\n !args.includes(\"--max-diagnostics\")\n ) {\n args.push(\n \"--max-diagnostics\",\n this.config.lint.biome.maxDiagnostics.toString()\n );\n }\n\n if (\n this.config.lint.biome.diagnosticLevel &&\n !args.includes(\"--diagnostic-level\")\n ) {\n args.push(\"--diagnostic-level\", this.config.lint.biome.diagnosticLevel);\n }\n\n if (\n this.config.lint.biome.errorOnWarnings &&\n !args.includes(\"--error-on-warnings\")\n ) {\n args.push(\"--error-on-warnings\");\n }\n\n if (\n this.config.lint.biome.jsonParseAllowComments &&\n !args.includes(\"--json-parse-allow-comments\")\n ) {\n args.push(\"--json-parse-allow-comments\");\n }\n\n if (\n this.config.lint.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.lint.biome.reporter && !args.includes(\"--reporter\")) {\n args.push(\"--reporter\", this.config.lint.biome.reporter);\n }\n\n if (this.config.lint.biome.logKind && !args.includes(\"--log-kind\")) {\n args.push(\"--log-kind\", this.config.lint.biome.logKind);\n }\n\n if (\n this.config.lint.biome.filesMaxSize &&\n !args.includes(\"--files-max-size\")\n ) {\n args.push(\n \"--files-max-size\",\n this.config.lint.biome.filesMaxSize.toString()\n );\n }\n\n if (\n this.config.lint.biome.filesIgnoreUnknown &&\n !args.includes(\"--files-ignore-unknown\")\n ) {\n args.push(\"--files-ignore-unknown\");\n }\n\n if (\n this.config.lint.biome.vcsEnabled &&\n !args.includes(\"--vcs-enabled\")\n ) {\n args.push(\"--vcs-enabled\");\n\n if (!args.includes(\"--vcs-root\")) {\n args.push(\"--vcs-root\", this.workspaceConfig.workspaceRoot);\n }\n\n if (\n this.config.lint.biome.vcsClientKind &&\n !args.includes(\"--vcs-client-kind\")\n ) {\n args.push(\"--vcs-client-kind\", this.config.lint.biome.vcsClientKind);\n }\n\n if (\n this.config.lint.biome.vcsUseIgnoreFile &&\n !args.includes(\"--vcs-use-ignore-file\")\n ) {\n args.push(\"--vcs-use-ignore-file\");\n }\n\n if (\n this.config.lint.biome.vcsDefaultBranch &&\n !args.includes(\"--vcs-default-branch\")\n ) {\n args.push(\n \"--vcs-default-branch\",\n this.config.lint.biome.vcsDefaultBranch\n );\n }\n }\n\n if (!this.config.lint.biome.biomePath) {\n const isBiomeListed = await isPackageListed(\n \"@biomejs/biome\",\n this.config.projectRoot\n );\n\n args.unshift(\n isBiomeListed\n ? replacePath(this.config.sourceRoot, this.config.projectRoot)\n : this.config.sourceRoot\n );\n\n const result = await executePackage(\n \"biome\",\n args,\n isBiomeListed\n ? joinPaths(\n this.workspaceConfig.workspaceRoot,\n this.config.projectRoot\n )\n : this.config.projectRoot\n );\n if (result.failed) {\n throw new Error(`Biome process exited with code ${result.exitCode}.`);\n }\n } else {\n args.unshift(this.config.lint.biome.biomePath, this.config.sourceRoot);\n\n const result = await execute(\n args.join(\" \"),\n this.workspaceConfig.workspaceRoot\n );\n if (result.failed) {\n throw new Error(`Biome process exited with code ${result.exitCode}.`);\n }\n }\n }\n };\n}\n\nexport default plug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