Skip to content

Commit d245d5b

Browse files
committed
refactor: split format and lsp into separate packages
- Create @pleaseai/code-format package for formatter functionality - Create @pleaseai/code-lsp package for LSP client - Update @pleaseai/code to depend on format and lsp packages - Update @pleaseai/dora to depend on lsp package - Update release-please config for new packages
1 parent 2c1ba7d commit d245d5b

36 files changed

Lines changed: 148 additions & 1706 deletions

.release-please-manifest.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
".": "0.1.1",
33
"packages/code": "0.1.1",
4-
"packages/dora": "0.1.0"
4+
"packages/dora": "0.1.0",
5+
"packages/format": "0.1.0",
6+
"packages/lsp": "0.1.0"
57
}

bun.lock

Lines changed: 32 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/code/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
"typecheck": "tsc -p tsconfig.json --noEmit",
1414
"test": "bun test ./src"
1515
},
16+
"dependencies": {
17+
"@pleaseai/code-format": "workspace:*",
18+
"@pleaseai/code-lsp": "workspace:*"
19+
},
1620
"devDependencies": {
1721
"@types/bun": "latest",
1822
"typescript": "^5.7.0"

packages/code/src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* code lsp --stdin Read hook input from stdin
1313
*/
1414

15-
import { Format } from "./format"
15+
import { Format } from "@pleaseai/code-format"
1616
import { runLSPDiagnostics } from "./hooks/lsp"
1717
import pkg from "../package.json"
1818

packages/code/src/hooks/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* This module re-exports utilities for use in hooks.
1212
*/
1313

14-
export { Format, Formatter } from "../format"
14+
export { Format, Formatter } from "@pleaseai/code-format"
1515
export {
1616
runLSPDiagnostics,
1717
getDiagnostics,

packages/code/src/hooks/lsp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import path from "path"
9-
import { LSPManager, type Diagnostic } from "../lsp"
9+
import { LSPManager, type Diagnostic } from "@pleaseai/code-lsp"
1010

1111
const DIAGNOSTICS_MAX_DISPLAY = 5
1212
const DIAGNOSTICS_WAIT_MS = 1500

packages/code/src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
* Provides auto-formatting and LSP diagnostics for Claude Code hooks.
55
*/
66

7-
export { Format, Formatter } from "./format"
8-
export { LSPManager, formatDiagnostic } from "./lsp"
9-
export { loadConfig, type Config, type FormatterConfig } from "./config"
7+
export { Format, Formatter, loadConfig, type Config, type FormatterConfig } from "@pleaseai/code-format"
8+
export { LSPManager, formatDiagnostic } from "@pleaseai/code-lsp"

packages/code/src/providers/lsp/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { z } from "zod";
88
import path from "path";
99
import type { Provider, ToolDefinition, ToolResult } from "../provider";
10-
import { LSPManager, formatDiagnostic } from "../../lsp";
10+
import { LSPManager, formatDiagnostic } from "@pleaseai/code-lsp";
1111

1212
/**
1313
* LSP Provider configuration

packages/dora/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
},
1616
"dependencies": {
1717
"@modelcontextprotocol/sdk": "^1.12.0",
18-
"vscode-jsonrpc": "^8.2.1",
19-
"vscode-languageserver-types": "^3.17.5",
18+
"@pleaseai/code-lsp": "workspace:*",
2019
"zod": "^3.25.0"
2120
},
2221
"devDependencies": {

packages/dora/src/lsp/__tests__/client.test.ts

Lines changed: 0 additions & 199 deletions
This file was deleted.

0 commit comments

Comments
 (0)