@rrlab/biome-plugin 1.0.0 → 1.0.1-git-e008b4d.0

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.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { FormatOptions, Formatter, InstallContext, InstallResult, LintOptions, Linter, StaticChecker, StaticCheckerOptions, ToolService, UninstallContext, UninstallResult } from "@rrlab/cli/plugin";
1
+ import { FormatOptions, Formatter, InstallContext, InstallResult, LintOptions, Linter, RunReport, StaticChecker, StaticCheckerOptions, ToolService, UninstallContext, UninstallResult } from "@rrlab/cli/plugin";
2
2
  import { ShellService } from "@vlandoss/clibuddy";
3
3
 
4
4
  //#region src/tool-versions.d.ts
@@ -11,9 +11,9 @@ declare const TOOL_VERSIONS: {
11
11
  //#region src/index.d.ts
12
12
  declare class BiomeService extends ToolService implements Formatter, Linter, StaticChecker {
13
13
  constructor(shellService: ShellService);
14
- format(options: FormatOptions): Promise<void>;
15
- lint(options: LintOptions): Promise<void>;
16
- check(options: StaticCheckerOptions): Promise<void>;
14
+ format(options: FormatOptions): Promise<RunReport>;
15
+ lint(options: LintOptions): Promise<RunReport>;
16
+ check(options: StaticCheckerOptions): Promise<RunReport>;
17
17
  }
18
18
  declare function install(ctx: InstallContext): Promise<InstallResult>;
19
19
  declare function uninstall(ctx: UninstallContext): Promise<UninstallResult>;
package/dist/index.mjs CHANGED
@@ -26,7 +26,7 @@ var BiomeService = class extends ToolService {
26
26
  async format(options) {
27
27
  const args = ["format", ...COMMON_FLAGS];
28
28
  if (options.fix) args.push("--fix");
29
- await this.exec(args);
29
+ return this.runReport(args);
30
30
  }
31
31
  async lint(options) {
32
32
  const args = [
@@ -35,21 +35,20 @@ var BiomeService = class extends ToolService {
35
35
  "--formatter-enabled=false"
36
36
  ];
37
37
  if (options.fix) args.push("--fix", "--unsafe");
38
- await this.exec(args);
38
+ return this.runReport(args);
39
39
  }
40
40
  async check(options) {
41
- if (options.fix) await this.exec([
41
+ const args = options.fix ? [
42
42
  "check",
43
43
  ...COMMON_FLAGS,
44
44
  "--fix"
45
- ]);
46
- else if (options.fixStaged) await this.exec([
45
+ ] : options.fixStaged ? [
47
46
  "check",
48
47
  ...COMMON_FLAGS,
49
48
  "--fix",
50
49
  "--staged"
51
- ]);
52
- else await this.exec([isCI ? "ci" : "check", ...COMMON_FLAGS]);
50
+ ] : [isCI ? "ci" : "check", ...COMMON_FLAGS];
51
+ return this.runReport(args);
53
52
  }
54
53
  };
55
54
  async function install(ctx) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rrlab/biome-plugin",
3
- "version": "1.0.0",
3
+ "version": "1.0.1-git-e008b4d.0",
4
4
  "description": "Biome plugin for @rrlab/cli — provides lint, format, and jsc capabilities.",
5
5
  "homepage": "https://github.com/variableland/dx/tree/main/run-run/biome-plugin#readme",
6
6
  "bugs": {
@@ -34,17 +34,17 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "comment-json": "4.2.5",
37
- "@vlandoss/clibuddy": "0.6.1"
37
+ "@vlandoss/clibuddy": "0.6.2-git-e008b4d.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@biomejs/biome": ">=2.0.0",
41
- "@rrlab/cli": "^1.0.0"
41
+ "@rrlab/cli": "^1.0.1-git-e008b4d.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@biomejs/biome": "2.4.15",
45
45
  "@types/semver": "^7.7.1",
46
46
  "semver": "^7.8.1",
47
- "@rrlab/cli": "1.0.0",
47
+ "@rrlab/cli": "1.0.1-git-e008b4d.0",
48
48
  "@rrlab/tsdown-config": "^0.1.0"
49
49
  },
50
50
  "scripts": {
package/src/index.ts CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  type InstallResult,
11
11
  type Linter,
12
12
  type LintOptions,
13
+ type RunReport,
13
14
  type StaticChecker,
14
15
  type StaticCheckerOptions,
15
16
  ToolService,
@@ -34,26 +35,25 @@ export class BiomeService extends ToolService implements Formatter, Linter, Stat
34
35
  super({ pkg: "@biomejs/biome", bin: "biome", ui: UI, shellService, from: FROM });
35
36
  }
36
37
 
37
- async format(options: FormatOptions) {
38
+ async format(options: FormatOptions): Promise<RunReport> {
38
39
  const args = ["format", ...COMMON_FLAGS];
39
40
  if (options.fix) args.push("--fix");
40
- await this.exec(args);
41
+ return this.runReport(args);
41
42
  }
42
43
 
43
- async lint(options: LintOptions) {
44
+ async lint(options: LintOptions): Promise<RunReport> {
44
45
  const args = ["check", ...COMMON_FLAGS, "--formatter-enabled=false"];
45
46
  if (options.fix) args.push("--fix", "--unsafe");
46
- await this.exec(args);
47
+ return this.runReport(args);
47
48
  }
48
49
 
49
- async check(options: StaticCheckerOptions): Promise<void> {
50
- if (options.fix) {
51
- await this.exec(["check", ...COMMON_FLAGS, "--fix"]);
52
- } else if (options.fixStaged) {
53
- await this.exec(["check", ...COMMON_FLAGS, "--fix", "--staged"]);
54
- } else {
55
- await this.exec([isCI ? "ci" : "check", ...COMMON_FLAGS]);
56
- }
50
+ async check(options: StaticCheckerOptions): Promise<RunReport> {
51
+ const args = options.fix
52
+ ? ["check", ...COMMON_FLAGS, "--fix"]
53
+ : options.fixStaged
54
+ ? ["check", ...COMMON_FLAGS, "--fix", "--staged"]
55
+ : [isCI ? "ci" : "check", ...COMMON_FLAGS];
56
+ return this.runReport(args);
57
57
  }
58
58
  }
59
59