@powerlines/plugin-biome 0.2.462 → 0.2.464

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/dist/index.cjs CHANGED
@@ -1 +1,84 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let e=require(`@stryke/cli/execute`),t=require(`@stryke/fs/exists`),n=require(`@stryke/fs/package-fns`),r=require(`@stryke/path/join`);function i(i={}){return{name:`biome`,async config(){this.debug("Providing default configuration for the Powerlines `biome` linting plugin.");let e=i.configFile;if(!e)if((0,t.existsSync)((0,r.joinPaths)(this.config.cwd??`./`,this.config.root,`biome.json`)))e=(0,r.joinPaths)(this.config.cwd??`./`,this.config.root,`biome.json`);else if((0,t.existsSync)((0,r.joinPaths)(this.config.cwd??`./`,this.config.root,`biome.jsonc`)))e=(0,r.joinPaths)(this.config.cwd??`./`,this.config.root,`biome.jsonc`);else if((0,t.existsSync)((0,r.joinPaths)(this.config.cwd??`./`,`biome.json`)))e=(0,r.joinPaths)(this.config.cwd??`./`,`biome.json`);else if((0,t.existsSync)((0,r.joinPaths)(this.config.cwd??`./`,`biome.jsonc`)))e=(0,r.joinPaths)(this.config.cwd??`./`,`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{biome:{configFile:e,maxDiagnostics:20,diagnosticLevel:`info`,fix:!0,logKind:`pretty`,format:`stylish`,vcsEnabled:!0,vcsDefaultBranch:`main`,...i}}},async lint(){this.debug(`Linting project files with Biome.`);let t=[];if(this.config.biome.params&&t.push(...this.config.biome.params.split(` `).filter(Boolean)),t.includes(`--log-level`)||t.push(`--log-level`,!this.config.logLevel||this.config.logLevel===`trace`||this.config.logLevel===`debug`?`info`:this.config.logLevel),!t.includes(`--verbose`)&&(this.config.logLevel===`trace`||this.config.logLevel===`debug`||this.config.mode===`development`)&&t.push(`--verbose`),this.config.biome.fix!==!1&&!t.includes(`--fix`)&&(t.push(`--fix`),this.config.biome.fix===`unsafe`&&!t.includes(`--unsafe`)&&t.push(`--unsafe`)),this.config.biome.configFile&&!t.includes(`--config-path`)&&t.push(`--config-path`,this.config.biome.configFile),this.config.biome.changed&&!t.includes(`--changed`)&&t.push(`--changed`),this.config.biome.staged&&!t.includes(`--staged`)&&t.push(`--staged`),this.config.biome.ignorePatterns&&!t.includes(`--ignore`)&&t.push(`--ignore`,Array.isArray(this.config.biome.ignorePatterns)?this.config.biome.ignorePatterns.join(`,`):this.config.biome.ignorePatterns),this.config.biome.suppress&&!t.includes(`--suppress`)&&t.push(`--suppress`),this.config.biome.only&&!t.includes(`--only`)&&t.push(`--only`,Array.isArray(this.config.biome.only)?this.config.biome.only.join(`,`):this.config.biome.only),this.config.biome.skip&&!t.includes(`--skip`)&&t.push(`--skip`,Array.isArray(this.config.biome.skip)?this.config.biome.skip.join(`,`):this.config.biome.skip),this.config.biome.stdinFilePath&&!t.includes(`--stdin-file-path`)&&t.push(`--stdin-file-path`,this.config.biome.stdinFilePath),this.config.biome.maxDiagnostics!==void 0&&!t.includes(`--max-diagnostics`)&&t.push(`--max-diagnostics`,this.config.biome.maxDiagnostics.toString()),this.config.biome.diagnosticLevel&&!t.includes(`--diagnostic-level`)&&t.push(`--diagnostic-level`,this.config.biome.diagnosticLevel),this.config.biome.errorOnWarnings&&!t.includes(`--error-on-warnings`)&&t.push(`--error-on-warnings`),this.config.biome.jsonParseAllowComments&&!t.includes(`--json-parse-allow-comments`)&&t.push(`--json-parse-allow-comments`),this.config.biome.jsonParseAllowTrailingCommas&&!t.includes(`--json-parse-allow-trailing-commas`)&&t.push(`--json-parse-allow-trailing-commas`),this.config.biome.reporter&&!t.includes(`--reporter`)&&t.push(`--reporter`,this.config.biome.reporter),this.config.biome.logKind&&!t.includes(`--log-kind`)&&t.push(`--log-kind`,this.config.biome.logKind),this.config.biome.filesMaxSize&&!t.includes(`--files-max-size`)&&t.push(`--files-max-size`,this.config.biome.filesMaxSize.toString()),this.config.biome.filesIgnoreUnknown&&!t.includes(`--files-ignore-unknown`)&&t.push(`--files-ignore-unknown`),this.config.biome.vcsEnabled&&!t.includes(`--vcs-enabled`)&&(t.push(`--vcs-enabled`),t.includes(`--vcs-root`)||t.push(`--vcs-root`,this.config.cwd),this.config.biome.vcsClientKind&&!t.includes(`--vcs-client-kind`)&&t.push(`--vcs-client-kind`,this.config.biome.vcsClientKind),this.config.biome.vcsUseIgnoreFile&&!t.includes(`--vcs-use-ignore-file`)&&t.push(`--vcs-use-ignore-file`),this.config.biome.vcsDefaultBranch&&!t.includes(`--vcs-default-branch`)&&t.push(`--vcs-default-branch`,this.config.biome.vcsDefaultBranch)),this.config.biome.biomePath){t.unshift(this.config.biome.biomePath,(0,r.joinPaths)(this.config.root,`src`));let n=await(0,e.execute)(t.join(` `),this.config.cwd);if(n.failed)throw Error(`Biome process exited with code ${n.exitCode}.`)}else{let i=await(0,n.isPackageListed)(`@biomejs/biome`,this.config.root);t.unshift(i?`./`:(0,r.joinPaths)(this.config.root,`src`));let a=await(0,e.executePackage)(`biome`,t,i?(0,r.joinPaths)(this.config.cwd,this.config.root):this.config.root);if(a.failed)throw Error(`Biome process exited with code ${a.exitCode}.`)}}}}exports.default=i,exports.plugin=i;
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ let _stryke_cli_execute = require("@stryke/cli/execute");
3
+ let _stryke_fs_exists = require("@stryke/fs/exists");
4
+ let _stryke_fs_package_fns = require("@stryke/fs/package-fns");
5
+ let _stryke_path_join = require("@stryke/path/join");
6
+
7
+ //#region src/index.ts
8
+ /**
9
+ * A Powerlines plugin to assist in linting a project with Biome.
10
+ */
11
+ function plugin(options = {}) {
12
+ return {
13
+ name: "biome",
14
+ async config() {
15
+ this.debug("Providing default configuration for the Powerlines `biome` linting plugin.");
16
+ let configFile = options.configFile;
17
+ if (!configFile) if ((0, _stryke_fs_exists.existsSync)((0, _stryke_path_join.joinPaths)(this.config.cwd ?? "./", this.config.root, "biome.json"))) configFile = (0, _stryke_path_join.joinPaths)(this.config.cwd ?? "./", this.config.root, "biome.json");
18
+ else if ((0, _stryke_fs_exists.existsSync)((0, _stryke_path_join.joinPaths)(this.config.cwd ?? "./", this.config.root, "biome.jsonc"))) configFile = (0, _stryke_path_join.joinPaths)(this.config.cwd ?? "./", this.config.root, "biome.jsonc");
19
+ else if ((0, _stryke_fs_exists.existsSync)((0, _stryke_path_join.joinPaths)(this.config.cwd ?? "./", "biome.json"))) configFile = (0, _stryke_path_join.joinPaths)(this.config.cwd ?? "./", "biome.json");
20
+ else if ((0, _stryke_fs_exists.existsSync)((0, _stryke_path_join.joinPaths)(this.config.cwd ?? "./", "biome.jsonc"))) configFile = (0, _stryke_path_join.joinPaths)(this.config.cwd ?? "./", "biome.jsonc");
21
+ else throw new Error(`No Biome configuration file found. Please specify a valid config file path in the Biome plugin's \`configFile\` options.`);
22
+ return { biome: {
23
+ configFile,
24
+ maxDiagnostics: 20,
25
+ diagnosticLevel: "info",
26
+ fix: true,
27
+ logKind: "pretty",
28
+ format: "stylish",
29
+ vcsEnabled: true,
30
+ vcsDefaultBranch: "main",
31
+ ...options
32
+ } };
33
+ },
34
+ async lint() {
35
+ this.debug(`Linting project files with Biome.`);
36
+ const args = [];
37
+ if (this.config.biome.params) args.push(...this.config.biome.params.split(" ").filter(Boolean));
38
+ if (!args.includes("--log-level")) args.push("--log-level", !this.config.logLevel || this.config.logLevel === "trace" || this.config.logLevel === "debug" ? "info" : this.config.logLevel);
39
+ if (!args.includes("--verbose") && (this.config.logLevel === "trace" || this.config.logLevel === "debug" || this.config.mode === "development")) args.push("--verbose");
40
+ if (this.config.biome.fix !== false && !args.includes("--fix")) {
41
+ args.push("--fix");
42
+ if (this.config.biome.fix === "unsafe" && !args.includes("--unsafe")) args.push("--unsafe");
43
+ }
44
+ if (this.config.biome.configFile && !args.includes("--config-path")) args.push("--config-path", this.config.biome.configFile);
45
+ if (this.config.biome.changed && !args.includes("--changed")) args.push("--changed");
46
+ if (this.config.biome.staged && !args.includes("--staged")) args.push("--staged");
47
+ if (this.config.biome.ignorePatterns && !args.includes("--ignore")) args.push("--ignore", Array.isArray(this.config.biome.ignorePatterns) ? this.config.biome.ignorePatterns.join(",") : this.config.biome.ignorePatterns);
48
+ if (this.config.biome.suppress && !args.includes("--suppress")) args.push("--suppress");
49
+ if (this.config.biome.only && !args.includes("--only")) args.push("--only", Array.isArray(this.config.biome.only) ? this.config.biome.only.join(",") : this.config.biome.only);
50
+ if (this.config.biome.skip && !args.includes("--skip")) args.push("--skip", Array.isArray(this.config.biome.skip) ? this.config.biome.skip.join(",") : this.config.biome.skip);
51
+ if (this.config.biome.stdinFilePath && !args.includes("--stdin-file-path")) args.push("--stdin-file-path", this.config.biome.stdinFilePath);
52
+ if (this.config.biome.maxDiagnostics !== void 0 && !args.includes("--max-diagnostics")) args.push("--max-diagnostics", this.config.biome.maxDiagnostics.toString());
53
+ if (this.config.biome.diagnosticLevel && !args.includes("--diagnostic-level")) args.push("--diagnostic-level", this.config.biome.diagnosticLevel);
54
+ if (this.config.biome.errorOnWarnings && !args.includes("--error-on-warnings")) args.push("--error-on-warnings");
55
+ if (this.config.biome.jsonParseAllowComments && !args.includes("--json-parse-allow-comments")) args.push("--json-parse-allow-comments");
56
+ if (this.config.biome.jsonParseAllowTrailingCommas && !args.includes("--json-parse-allow-trailing-commas")) args.push("--json-parse-allow-trailing-commas");
57
+ if (this.config.biome.reporter && !args.includes("--reporter")) args.push("--reporter", this.config.biome.reporter);
58
+ if (this.config.biome.logKind && !args.includes("--log-kind")) args.push("--log-kind", this.config.biome.logKind);
59
+ if (this.config.biome.filesMaxSize && !args.includes("--files-max-size")) args.push("--files-max-size", this.config.biome.filesMaxSize.toString());
60
+ if (this.config.biome.filesIgnoreUnknown && !args.includes("--files-ignore-unknown")) args.push("--files-ignore-unknown");
61
+ if (this.config.biome.vcsEnabled && !args.includes("--vcs-enabled")) {
62
+ args.push("--vcs-enabled");
63
+ if (!args.includes("--vcs-root")) args.push("--vcs-root", this.config.cwd);
64
+ if (this.config.biome.vcsClientKind && !args.includes("--vcs-client-kind")) args.push("--vcs-client-kind", this.config.biome.vcsClientKind);
65
+ if (this.config.biome.vcsUseIgnoreFile && !args.includes("--vcs-use-ignore-file")) args.push("--vcs-use-ignore-file");
66
+ if (this.config.biome.vcsDefaultBranch && !args.includes("--vcs-default-branch")) args.push("--vcs-default-branch", this.config.biome.vcsDefaultBranch);
67
+ }
68
+ if (!this.config.biome.biomePath) {
69
+ const isBiomeListed = await (0, _stryke_fs_package_fns.isPackageListed)("@biomejs/biome", this.config.root);
70
+ args.unshift(isBiomeListed ? "./" : (0, _stryke_path_join.joinPaths)(this.config.root, "src"));
71
+ const result = await (0, _stryke_cli_execute.executePackage)("biome", args, isBiomeListed ? (0, _stryke_path_join.joinPaths)(this.config.cwd, this.config.root) : this.config.root);
72
+ if (result.failed) throw new Error(`Biome process exited with code ${result.exitCode}.`);
73
+ } else {
74
+ args.unshift(this.config.biome.biomePath, (0, _stryke_path_join.joinPaths)(this.config.root, "src"));
75
+ const result = await (0, _stryke_cli_execute.execute)(args.join(" "), this.config.cwd);
76
+ if (result.failed) throw new Error(`Biome process exited with code ${result.exitCode}.`);
77
+ }
78
+ }
79
+ };
80
+ }
81
+
82
+ //#endregion
83
+ exports.default = plugin;
84
+ exports.plugin = plugin;
package/dist/index.mjs CHANGED
@@ -1,2 +1,83 @@
1
- import{execute as e,executePackage as t}from"@stryke/cli/execute";import{existsSync as n}from"@stryke/fs/exists";import{isPackageListed as r}from"@stryke/fs/package-fns";import{joinPaths as i}from"@stryke/path/join";function a(a={}){return{name:`biome`,async config(){this.debug("Providing default configuration for the Powerlines `biome` linting plugin.");let e=a.configFile;if(!e)if(n(i(this.config.cwd??`./`,this.config.root,`biome.json`)))e=i(this.config.cwd??`./`,this.config.root,`biome.json`);else if(n(i(this.config.cwd??`./`,this.config.root,`biome.jsonc`)))e=i(this.config.cwd??`./`,this.config.root,`biome.jsonc`);else if(n(i(this.config.cwd??`./`,`biome.json`)))e=i(this.config.cwd??`./`,`biome.json`);else if(n(i(this.config.cwd??`./`,`biome.jsonc`)))e=i(this.config.cwd??`./`,`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{biome:{configFile:e,maxDiagnostics:20,diagnosticLevel:`info`,fix:!0,logKind:`pretty`,format:`stylish`,vcsEnabled:!0,vcsDefaultBranch:`main`,...a}}},async lint(){this.debug(`Linting project files with Biome.`);let n=[];if(this.config.biome.params&&n.push(...this.config.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.biome.fix!==!1&&!n.includes(`--fix`)&&(n.push(`--fix`),this.config.biome.fix===`unsafe`&&!n.includes(`--unsafe`)&&n.push(`--unsafe`)),this.config.biome.configFile&&!n.includes(`--config-path`)&&n.push(`--config-path`,this.config.biome.configFile),this.config.biome.changed&&!n.includes(`--changed`)&&n.push(`--changed`),this.config.biome.staged&&!n.includes(`--staged`)&&n.push(`--staged`),this.config.biome.ignorePatterns&&!n.includes(`--ignore`)&&n.push(`--ignore`,Array.isArray(this.config.biome.ignorePatterns)?this.config.biome.ignorePatterns.join(`,`):this.config.biome.ignorePatterns),this.config.biome.suppress&&!n.includes(`--suppress`)&&n.push(`--suppress`),this.config.biome.only&&!n.includes(`--only`)&&n.push(`--only`,Array.isArray(this.config.biome.only)?this.config.biome.only.join(`,`):this.config.biome.only),this.config.biome.skip&&!n.includes(`--skip`)&&n.push(`--skip`,Array.isArray(this.config.biome.skip)?this.config.biome.skip.join(`,`):this.config.biome.skip),this.config.biome.stdinFilePath&&!n.includes(`--stdin-file-path`)&&n.push(`--stdin-file-path`,this.config.biome.stdinFilePath),this.config.biome.maxDiagnostics!==void 0&&!n.includes(`--max-diagnostics`)&&n.push(`--max-diagnostics`,this.config.biome.maxDiagnostics.toString()),this.config.biome.diagnosticLevel&&!n.includes(`--diagnostic-level`)&&n.push(`--diagnostic-level`,this.config.biome.diagnosticLevel),this.config.biome.errorOnWarnings&&!n.includes(`--error-on-warnings`)&&n.push(`--error-on-warnings`),this.config.biome.jsonParseAllowComments&&!n.includes(`--json-parse-allow-comments`)&&n.push(`--json-parse-allow-comments`),this.config.biome.jsonParseAllowTrailingCommas&&!n.includes(`--json-parse-allow-trailing-commas`)&&n.push(`--json-parse-allow-trailing-commas`),this.config.biome.reporter&&!n.includes(`--reporter`)&&n.push(`--reporter`,this.config.biome.reporter),this.config.biome.logKind&&!n.includes(`--log-kind`)&&n.push(`--log-kind`,this.config.biome.logKind),this.config.biome.filesMaxSize&&!n.includes(`--files-max-size`)&&n.push(`--files-max-size`,this.config.biome.filesMaxSize.toString()),this.config.biome.filesIgnoreUnknown&&!n.includes(`--files-ignore-unknown`)&&n.push(`--files-ignore-unknown`),this.config.biome.vcsEnabled&&!n.includes(`--vcs-enabled`)&&(n.push(`--vcs-enabled`),n.includes(`--vcs-root`)||n.push(`--vcs-root`,this.config.cwd),this.config.biome.vcsClientKind&&!n.includes(`--vcs-client-kind`)&&n.push(`--vcs-client-kind`,this.config.biome.vcsClientKind),this.config.biome.vcsUseIgnoreFile&&!n.includes(`--vcs-use-ignore-file`)&&n.push(`--vcs-use-ignore-file`),this.config.biome.vcsDefaultBranch&&!n.includes(`--vcs-default-branch`)&&n.push(`--vcs-default-branch`,this.config.biome.vcsDefaultBranch)),this.config.biome.biomePath){n.unshift(this.config.biome.biomePath,i(this.config.root,`src`));let t=await e(n.join(` `),this.config.cwd);if(t.failed)throw Error(`Biome process exited with code ${t.exitCode}.`)}else{let e=await r(`@biomejs/biome`,this.config.root);n.unshift(e?`./`:i(this.config.root,`src`));let a=await t(`biome`,n,e?i(this.config.cwd,this.config.root):this.config.root);if(a.failed)throw Error(`Biome process exited with code ${a.exitCode}.`)}}}}export{a as default,a as plugin};
1
+ import { execute, executePackage } from "@stryke/cli/execute";
2
+ import { existsSync } from "@stryke/fs/exists";
3
+ import { isPackageListed } from "@stryke/fs/package-fns";
4
+ import { joinPaths } from "@stryke/path/join";
5
+
6
+ //#region src/index.ts
7
+ /**
8
+ * A Powerlines plugin to assist in linting a project with Biome.
9
+ */
10
+ function plugin(options = {}) {
11
+ return {
12
+ name: "biome",
13
+ async config() {
14
+ this.debug("Providing default configuration for the Powerlines `biome` linting plugin.");
15
+ let configFile = options.configFile;
16
+ if (!configFile) if (existsSync(joinPaths(this.config.cwd ?? "./", this.config.root, "biome.json"))) configFile = joinPaths(this.config.cwd ?? "./", this.config.root, "biome.json");
17
+ else if (existsSync(joinPaths(this.config.cwd ?? "./", this.config.root, "biome.jsonc"))) configFile = joinPaths(this.config.cwd ?? "./", this.config.root, "biome.jsonc");
18
+ else if (existsSync(joinPaths(this.config.cwd ?? "./", "biome.json"))) configFile = joinPaths(this.config.cwd ?? "./", "biome.json");
19
+ else if (existsSync(joinPaths(this.config.cwd ?? "./", "biome.jsonc"))) configFile = joinPaths(this.config.cwd ?? "./", "biome.jsonc");
20
+ else throw new Error(`No Biome configuration file found. Please specify a valid config file path in the Biome plugin's \`configFile\` options.`);
21
+ return { biome: {
22
+ configFile,
23
+ maxDiagnostics: 20,
24
+ diagnosticLevel: "info",
25
+ fix: true,
26
+ logKind: "pretty",
27
+ format: "stylish",
28
+ vcsEnabled: true,
29
+ vcsDefaultBranch: "main",
30
+ ...options
31
+ } };
32
+ },
33
+ async lint() {
34
+ this.debug(`Linting project files with Biome.`);
35
+ const args = [];
36
+ if (this.config.biome.params) args.push(...this.config.biome.params.split(" ").filter(Boolean));
37
+ if (!args.includes("--log-level")) args.push("--log-level", !this.config.logLevel || this.config.logLevel === "trace" || this.config.logLevel === "debug" ? "info" : this.config.logLevel);
38
+ if (!args.includes("--verbose") && (this.config.logLevel === "trace" || this.config.logLevel === "debug" || this.config.mode === "development")) args.push("--verbose");
39
+ if (this.config.biome.fix !== false && !args.includes("--fix")) {
40
+ args.push("--fix");
41
+ if (this.config.biome.fix === "unsafe" && !args.includes("--unsafe")) args.push("--unsafe");
42
+ }
43
+ if (this.config.biome.configFile && !args.includes("--config-path")) args.push("--config-path", this.config.biome.configFile);
44
+ if (this.config.biome.changed && !args.includes("--changed")) args.push("--changed");
45
+ if (this.config.biome.staged && !args.includes("--staged")) args.push("--staged");
46
+ if (this.config.biome.ignorePatterns && !args.includes("--ignore")) args.push("--ignore", Array.isArray(this.config.biome.ignorePatterns) ? this.config.biome.ignorePatterns.join(",") : this.config.biome.ignorePatterns);
47
+ if (this.config.biome.suppress && !args.includes("--suppress")) args.push("--suppress");
48
+ if (this.config.biome.only && !args.includes("--only")) args.push("--only", Array.isArray(this.config.biome.only) ? this.config.biome.only.join(",") : this.config.biome.only);
49
+ if (this.config.biome.skip && !args.includes("--skip")) args.push("--skip", Array.isArray(this.config.biome.skip) ? this.config.biome.skip.join(",") : this.config.biome.skip);
50
+ if (this.config.biome.stdinFilePath && !args.includes("--stdin-file-path")) args.push("--stdin-file-path", this.config.biome.stdinFilePath);
51
+ if (this.config.biome.maxDiagnostics !== void 0 && !args.includes("--max-diagnostics")) args.push("--max-diagnostics", this.config.biome.maxDiagnostics.toString());
52
+ if (this.config.biome.diagnosticLevel && !args.includes("--diagnostic-level")) args.push("--diagnostic-level", this.config.biome.diagnosticLevel);
53
+ if (this.config.biome.errorOnWarnings && !args.includes("--error-on-warnings")) args.push("--error-on-warnings");
54
+ if (this.config.biome.jsonParseAllowComments && !args.includes("--json-parse-allow-comments")) args.push("--json-parse-allow-comments");
55
+ if (this.config.biome.jsonParseAllowTrailingCommas && !args.includes("--json-parse-allow-trailing-commas")) args.push("--json-parse-allow-trailing-commas");
56
+ if (this.config.biome.reporter && !args.includes("--reporter")) args.push("--reporter", this.config.biome.reporter);
57
+ if (this.config.biome.logKind && !args.includes("--log-kind")) args.push("--log-kind", this.config.biome.logKind);
58
+ if (this.config.biome.filesMaxSize && !args.includes("--files-max-size")) args.push("--files-max-size", this.config.biome.filesMaxSize.toString());
59
+ if (this.config.biome.filesIgnoreUnknown && !args.includes("--files-ignore-unknown")) args.push("--files-ignore-unknown");
60
+ if (this.config.biome.vcsEnabled && !args.includes("--vcs-enabled")) {
61
+ args.push("--vcs-enabled");
62
+ if (!args.includes("--vcs-root")) args.push("--vcs-root", this.config.cwd);
63
+ if (this.config.biome.vcsClientKind && !args.includes("--vcs-client-kind")) args.push("--vcs-client-kind", this.config.biome.vcsClientKind);
64
+ if (this.config.biome.vcsUseIgnoreFile && !args.includes("--vcs-use-ignore-file")) args.push("--vcs-use-ignore-file");
65
+ if (this.config.biome.vcsDefaultBranch && !args.includes("--vcs-default-branch")) args.push("--vcs-default-branch", this.config.biome.vcsDefaultBranch);
66
+ }
67
+ if (!this.config.biome.biomePath) {
68
+ const isBiomeListed = await isPackageListed("@biomejs/biome", this.config.root);
69
+ args.unshift(isBiomeListed ? "./" : joinPaths(this.config.root, "src"));
70
+ const result = await executePackage("biome", args, isBiomeListed ? joinPaths(this.config.cwd, this.config.root) : this.config.root);
71
+ if (result.failed) throw new Error(`Biome process exited with code ${result.exitCode}.`);
72
+ } else {
73
+ args.unshift(this.config.biome.biomePath, joinPaths(this.config.root, "src"));
74
+ const result = await execute(args.join(" "), this.config.cwd);
75
+ if (result.failed) throw new Error(`Biome process exited with code ${result.exitCode}.`);
76
+ }
77
+ }
78
+ };
79
+ }
80
+
81
+ //#endregion
82
+ export { plugin as default, plugin };
2
83
  //# sourceMappingURL=index.mjs.map
@@ -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":"wNAoCA,SAAgB,EACd,EAA8B,EAAE,CACJ,CAC5B,MAAO,CACL,KAAM,QACN,MAAM,QAAS,CACb,KAAK,MACH,6EACD,CAED,IAAI,EAAa,EAAQ,WACzB,GAAI,CAAC,EACH,GACE,EACE,EAAU,KAAK,OAAO,KAAO,KAAM,KAAK,OAAO,KAAM,aAAa,CACnE,CAED,EAAa,EACX,KAAK,OAAO,KAAO,KACnB,KAAK,OAAO,KACZ,aACD,SAED,EACE,EAAU,KAAK,OAAO,KAAO,KAAM,KAAK,OAAO,KAAM,cAAc,CACpE,CAED,EAAa,EACX,KAAK,OAAO,KAAO,KACnB,KAAK,OAAO,KACZ,cACD,SAED,EAAW,EAAU,KAAK,OAAO,KAAO,KAAM,aAAa,CAAC,CAE5D,EAAa,EAAU,KAAK,OAAO,KAAO,KAAM,aAAa,SAE7D,EAAW,EAAU,KAAK,OAAO,KAAO,KAAM,cAAc,CAAC,CAE7D,EAAa,EAAU,KAAK,OAAO,KAAO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,GAAI,EAAO,OACT,MAAU,MAAM,kCAAkC,EAAO,SAAS,GAAG,GAc5E"}
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,SAAgB,OACd,UAA8B,EAAE,EACJ;AAC5B,QAAO;EACL,MAAM;EACN,MAAM,SAAS;AACb,QAAK,MACH,6EACD;GAED,IAAI,aAAa,QAAQ;AACzB,OAAI,CAAC,WACH,KACE,WACE,UAAU,KAAK,OAAO,OAAO,MAAM,KAAK,OAAO,MAAM,aAAa,CACnE,CAED,cAAa,UACX,KAAK,OAAO,OAAO,MACnB,KAAK,OAAO,MACZ,aACD;YAED,WACE,UAAU,KAAK,OAAO,OAAO,MAAM,KA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,MAAM,WAAW;IAChC,MAAM,gBAAgB,MAAM,gBAC1B,kBACA,KAAK,OAAO,KACb;AAED,SAAK,QAAQ,gBAAgB,OAAO,UAAU,KAAK,OAAO,MAAM,MAAM,CAAC;IAEvE,MAAM,SAAS,MAAM,eACnB,SACA,MACA,gBACI,UAAU,KAAK,OAAO,KAAK,KAAK,OAAO,KAAK,GAC5C,KAAK,OAAO,KACjB;AACD,QAAI,OAAO,OACT,OAAM,IAAI,MAAM,kCAAkC,OAAO,SAAS,GAAG;UAElE;AACL,SAAK,QACH,KAAK,OAAO,MAAM,WAClB,UAAU,KAAK,OAAO,MAAM,MAAM,CACnC;IAED,MAAM,SAAS,MAAM,QAAQ,KAAK,KAAK,IAAI,EAAE,KAAK,OAAO,IAAI;AAC7D,QAAI,OAAO,OACT,OAAM,IAAI,MAAM,kCAAkC,OAAO,SAAS,GAAG;;;EAI5E"}
@@ -1 +1 @@
1
- export{};
1
+ export { };
@@ -1 +1 @@
1
- export{};
1
+ export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-biome",
3
- "version": "0.2.462",
3
+ "version": "0.2.464",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin for running Biome linting on the codebase.",
6
6
  "repository": {
@@ -94,15 +94,15 @@
94
94
  "@stryke/fs": "^0.33.70",
95
95
  "@stryke/path": "^0.28.2",
96
96
  "defu": "^6.1.7",
97
- "powerlines": "^0.46.3"
97
+ "powerlines": "^0.46.5"
98
98
  },
99
99
  "devDependencies": {
100
- "@powerlines/plugin-plugin": "^0.12.407",
100
+ "@powerlines/plugin-plugin": "^0.12.409",
101
101
  "@types/node": "^25.6.0"
102
102
  },
103
103
  "publishConfig": { "access": "public" },
104
104
  "main": "./dist/index.cjs",
105
105
  "module": "./dist/index.mjs",
106
106
  "types": "./dist/index.d.cts",
107
- "gitHead": "9a51041e0817e438c49db05bb757b3bdbaf497ef"
107
+ "gitHead": "9af888c54e58a82744cc334a6b80da52429fa0ac"
108
108
  }