@rrlab/oxc-plugin 1.1.0 → 1.1.1
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 +3 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +13 -14
- package/package.json +4 -4
- package/src/index.ts +10 -11
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ For `rr jsc` (lint + format together), the kernel composes oxlint + oxfmt automa
|
|
|
18
18
|
|---|---|---|
|
|
19
19
|
| `lint` | `rr lint`, `rr lint doctor` | `oxlint --check` / `--fix` |
|
|
20
20
|
| `format` | `rr format`, `rr format doctor` | `oxfmt --check` / `--fix` |
|
|
21
|
-
| `
|
|
21
|
+
| `typecheck` | `rr tsc`, `rr tsc doctor` | `oxlint --type-aware --type-check` (via `oxlint-tsgolint`) |
|
|
22
22
|
| `jsc` (composed) | `rr jsc` (synthesised lint + format) | |
|
|
23
23
|
|
|
24
24
|
## Picking only some capabilities
|
|
@@ -33,12 +33,12 @@ import { defineConfig } from "@rrlab/cli/config";
|
|
|
33
33
|
export default defineConfig({
|
|
34
34
|
plugins: [
|
|
35
35
|
biome({ only: ["lint", "format"] }),
|
|
36
|
-
oxc({ only: ["
|
|
36
|
+
oxc({ only: ["typecheck"] }),
|
|
37
37
|
],
|
|
38
38
|
});
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
The `only` array is typed against the kinds *this* plugin provides (`"lint" | "format" | "
|
|
41
|
+
The `only` array is typed against the kinds *this* plugin provides (`"lint" | "format" | "typecheck"` for oxc), so typos like `oxc({ only: ["pack"] })` are caught at compile time.
|
|
42
42
|
|
|
43
43
|
## Removal
|
|
44
44
|
|
package/dist/index.d.mts
CHANGED
|
@@ -30,7 +30,7 @@ declare class OxlintTypeCheckService extends ToolService implements TypeChecker
|
|
|
30
30
|
declare function install(_ctx: InstallContext): Promise<InstallResult>;
|
|
31
31
|
declare function uninstall(_ctx: UninstallContext): Promise<UninstallResult>;
|
|
32
32
|
declare const oxc: (options?: {
|
|
33
|
-
only?: readonly ("lint" | "format" | "
|
|
33
|
+
only?: readonly ("lint" | "format" | "typecheck")[] | undefined;
|
|
34
34
|
} | undefined) => import("@rrlab/cli/plugin").Plugin;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { OxfmtService, OxlintService, OxlintTypeCheckService, TOOL_VERSIONS, oxc as default, install, uninstall };
|
package/dist/index.mjs
CHANGED
|
@@ -9,14 +9,12 @@ const TOOL_VERSIONS = {
|
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/index.ts
|
|
11
11
|
const FROM = import.meta.url;
|
|
12
|
-
const
|
|
13
|
-
const UI_LINT = oxColor("oxlint");
|
|
14
|
-
const UI_FMT = oxColor("oxfmt");
|
|
12
|
+
const oxcColor = colorize("#32F3E9");
|
|
15
13
|
var OxlintService = class extends ToolService {
|
|
16
14
|
constructor(shellService) {
|
|
17
15
|
super({
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
bin: "oxlint",
|
|
17
|
+
color: oxcColor,
|
|
20
18
|
shellService,
|
|
21
19
|
from: FROM
|
|
22
20
|
});
|
|
@@ -28,8 +26,8 @@ var OxlintService = class extends ToolService {
|
|
|
28
26
|
var OxfmtService = class extends ToolService {
|
|
29
27
|
constructor(shellService) {
|
|
30
28
|
super({
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
bin: "oxfmt",
|
|
30
|
+
color: oxcColor,
|
|
33
31
|
shellService,
|
|
34
32
|
from: FROM
|
|
35
33
|
});
|
|
@@ -41,8 +39,8 @@ var OxfmtService = class extends ToolService {
|
|
|
41
39
|
var OxlintTypeCheckService = class extends ToolService {
|
|
42
40
|
constructor(shellService) {
|
|
43
41
|
super({
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
bin: "oxlint",
|
|
43
|
+
color: oxcColor,
|
|
46
44
|
shellService,
|
|
47
45
|
from: FROM
|
|
48
46
|
});
|
|
@@ -65,16 +63,17 @@ async function uninstall(_ctx) {
|
|
|
65
63
|
"oxlint-tsgolint"
|
|
66
64
|
] };
|
|
67
65
|
}
|
|
68
|
-
const oxc = definePlugin(
|
|
69
|
-
name: "oxc",
|
|
66
|
+
const oxc = definePlugin({
|
|
70
67
|
apiVersion: 1,
|
|
68
|
+
name: "oxc",
|
|
69
|
+
color: oxcColor,
|
|
71
70
|
install,
|
|
72
71
|
uninstall,
|
|
73
|
-
|
|
72
|
+
services: ({ shell }) => ({
|
|
74
73
|
lint: new OxlintService(shell),
|
|
75
74
|
format: new OxfmtService(shell),
|
|
76
|
-
|
|
75
|
+
typecheck: new OxlintTypeCheckService(shell)
|
|
77
76
|
})
|
|
78
|
-
})
|
|
77
|
+
});
|
|
79
78
|
//#endregion
|
|
80
79
|
export { OxfmtService, OxlintService, OxlintTypeCheckService, TOOL_VERSIONS, oxc as default, install, uninstall };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rrlab/oxc-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "oxc plugin for @rrlab/cli — provides lint (oxlint) and format (oxfmt) capabilities.",
|
|
5
5
|
"homepage": "https://github.com/variableland/dx/tree/main/run-run/oxc-plugin#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"node": ">=20.0.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@vlandoss/clibuddy": "0.7.
|
|
36
|
+
"@vlandoss/clibuddy": "0.7.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"oxfmt": ">=0.30.0",
|
|
40
40
|
"oxlint": ">=1.0.0",
|
|
41
41
|
"oxlint-tsgolint": ">=0.15.0",
|
|
42
|
-
"@rrlab/cli": "^1.
|
|
42
|
+
"@rrlab/cli": "^1.2.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"oxlint-tsgolint": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"oxlint": "1.66.0",
|
|
53
53
|
"oxlint-tsgolint": "0.23.0",
|
|
54
54
|
"semver": "^7.8.1",
|
|
55
|
-
"@rrlab/cli": "1.
|
|
55
|
+
"@rrlab/cli": "1.2.0",
|
|
56
56
|
"@rrlab/tsdown-config": "^0.1.0"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
package/src/index.ts
CHANGED
|
@@ -19,13 +19,11 @@ import { TOOL_VERSIONS } from "./tool-versions.ts";
|
|
|
19
19
|
export { TOOL_VERSIONS } from "./tool-versions.ts";
|
|
20
20
|
|
|
21
21
|
const FROM = import.meta.url;
|
|
22
|
-
const
|
|
23
|
-
const UI_LINT = oxColor("oxlint");
|
|
24
|
-
const UI_FMT = oxColor("oxfmt");
|
|
22
|
+
const oxcColor = colorize("#32F3E9");
|
|
25
23
|
|
|
26
24
|
export class OxlintService extends ToolService implements Linter {
|
|
27
25
|
constructor(shellService: ShellService) {
|
|
28
|
-
super({
|
|
26
|
+
super({ bin: "oxlint", color: oxcColor, shellService, from: FROM });
|
|
29
27
|
}
|
|
30
28
|
|
|
31
29
|
async lint(options: LintOptions): Promise<RunReport> {
|
|
@@ -35,7 +33,7 @@ export class OxlintService extends ToolService implements Linter {
|
|
|
35
33
|
|
|
36
34
|
export class OxfmtService extends ToolService implements Formatter {
|
|
37
35
|
constructor(shellService: ShellService) {
|
|
38
|
-
super({
|
|
36
|
+
super({ bin: "oxfmt", color: oxcColor, shellService, from: FROM });
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
async format(options: FormatOptions): Promise<RunReport> {
|
|
@@ -45,7 +43,7 @@ export class OxfmtService extends ToolService implements Formatter {
|
|
|
45
43
|
|
|
46
44
|
export class OxlintTypeCheckService extends ToolService implements TypeChecker {
|
|
47
45
|
constructor(shellService: ShellService) {
|
|
48
|
-
super({
|
|
46
|
+
super({ bin: "oxlint", color: oxcColor, shellService, from: FROM });
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
async check(options: TypeCheckOptions = {}): Promise<RunReport> {
|
|
@@ -67,16 +65,17 @@ export async function uninstall(_ctx: UninstallContext): Promise<UninstallResult
|
|
|
67
65
|
return { removeDependencies: ["oxlint", "oxfmt", "oxlint-tsgolint"] };
|
|
68
66
|
}
|
|
69
67
|
|
|
70
|
-
const oxc = definePlugin(
|
|
71
|
-
name: "oxc",
|
|
68
|
+
const oxc = definePlugin({
|
|
72
69
|
apiVersion: 1,
|
|
70
|
+
name: "oxc",
|
|
71
|
+
color: oxcColor,
|
|
73
72
|
install,
|
|
74
73
|
uninstall,
|
|
75
|
-
|
|
74
|
+
services: ({ shell }) => ({
|
|
76
75
|
lint: new OxlintService(shell),
|
|
77
76
|
format: new OxfmtService(shell),
|
|
78
|
-
|
|
77
|
+
typecheck: new OxlintTypeCheckService(shell),
|
|
79
78
|
}),
|
|
80
|
-
})
|
|
79
|
+
});
|
|
81
80
|
|
|
82
81
|
export default oxc;
|