Skip to content

Commit f980349

Browse files
rename methods, run formatter
1 parent 2d7283e commit f980349

File tree

9 files changed

+680
-688
lines changed

9 files changed

+680
-688
lines changed

bun.lock

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,29 @@
1111
"typescript": "^5",
1212
},
1313
},
14-
"packages/@pglt/backend-jsonrpc": {
15-
"name": "@pglt/backend-jsonrpc",
14+
"packages/@postgrestools/backend-jsonrpc": {
15+
"name": "@postgrestools/backend-jsonrpc",
1616
"optionalDependencies": {
17-
"@pglt/cli-darwin-arm64": "<placeholder>",
18-
"@pglt/cli-darwin-x64": "<placeholder>",
19-
"@pglt/cli-linux-arm64": "<placeholder>",
20-
"@pglt/cli-linux-arm64-musl": "<placeholder>",
21-
"@pglt/cli-linux-x64": "<placeholder>",
22-
"@pglt/cli-linux-x64-musl": "<placeholder>",
23-
"@pglt/cli-win32-arm64": "<placeholder>",
24-
"@pglt/cli-win32-x64": "<placeholder>",
17+
"@postgrestools/cli-darwin-arm64": "<placeholder>",
18+
"@postgrestools/cli-darwin-x64": "<placeholder>",
19+
"@postgrestools/cli-linux-arm64": "<placeholder>",
20+
"@postgrestools/cli-linux-x64": "<placeholder>",
21+
"@postgrestools/cli-win32-arm64": "<placeholder>",
22+
"@postgrestools/cli-win32-x64": "<placeholder>",
2523
},
2624
},
27-
"packages/@pglt/pglt": {
28-
"name": "pglt",
25+
"packages/@postgrestools/postgrestools": {
26+
"name": "postgrestools",
2927
"bin": {
30-
"pglt": "bin/pglt",
28+
"postgrestools": "bin/postgrestools",
3129
},
3230
"optionalDependencies": {
33-
"pglt-aarch64-apple-darwin": "<placeholder>",
34-
"pglt-aarch64-linux-gnu": "<placeholder>",
35-
"pglt-aarch64-windows-msvc": "<placeholder>",
36-
"pglt-x86_64-apple-darwin": "<placeholder>",
37-
"pglt-x86_64-linux-gnu": "<placeholder>",
38-
"pglt-x86_64-windows-msvc": "<placeholder>",
31+
"postgrestools-aarch64-apple-darwin": "<placeholder>",
32+
"postgrestools-aarch64-linux-gnu": "<placeholder>",
33+
"postgrestools-aarch64-windows-msvc": "<placeholder>",
34+
"postgrestools-x86_64-apple-darwin": "<placeholder>",
35+
"postgrestools-x86_64-linux-gnu": "<placeholder>",
36+
"postgrestools-x86_64-windows-msvc": "<placeholder>",
3937
},
4038
},
4139
},
@@ -58,7 +56,7 @@
5856

5957
"@biomejs/cli-win32-x64": ["@biomejs/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA=="],
6058

61-
"@pglt/backend-jsonrpc": ["@pglt/backend-jsonrpc@workspace:packages/@pglt/backend-jsonrpc"],
59+
"@postgrestools/backend-jsonrpc": ["@postgrestools/backend-jsonrpc@workspace:packages/@postgrestools/backend-jsonrpc"],
6260

6361
"@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.2.5" } }, "sha512-w2OZTzrZTVtbnJew1pdFmgV99H0/L+Pvw+z1P67HaR18MHOzYnTYOi6qzErhK8HyT+DB782ADVPPE92Xu2/Opg=="],
6462

@@ -68,7 +66,7 @@
6866

6967
"bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*", "@types/ws": "~8.5.10" } }, "sha512-3oO6LVGGRRKI4kHINx5PIdIgnLRb7l/SprhzqXapmoYkFl5m4j6EvALvbDVuuBFaamB46Ap6HCUxIXNLCGy+tg=="],
7068

71-
"pglt": ["pglt@workspace:packages/@pglt/pglt"],
69+
"postgrestools": ["postgrestools@workspace:packages/@postgrestools/postgrestools"],
7270

7371
"typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ=="],
7472

package.json

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
{
2-
"name": "@pglt/monorepo",
3-
"version": "0.0.0",
4-
"private": true,
5-
"devDependencies": {
6-
"@biomejs/biome": "1.9.4",
7-
"@types/bun": "latest"
8-
},
9-
"peerDependencies": {
10-
"typescript": "^5"
11-
},
12-
"workspaces": ["packages/@pglt/pglt", "packages/@pglt/backend-jsonrpc"],
13-
"keywords": [],
14-
"author": "Supabase Community",
15-
"license": "MIT OR Apache-2.0",
16-
"packageManager": "bun@1"
2+
"name": "@postgrestools/monorepo",
3+
"version": "0.0.0",
4+
"private": true,
5+
"devDependencies": {
6+
"@biomejs/biome": "1.9.4",
7+
"@types/bun": "latest"
8+
},
9+
"peerDependencies": {
10+
"typescript": "^5"
11+
},
12+
"workspaces": [
13+
"packages/@postgrestools/postgrestools",
14+
"packages/@postgrestools/backend-jsonrpc"
15+
],
16+
"keywords": [],
17+
"author": "Supabase Community",
18+
"license": "MIT OR Apache-2.0",
19+
"packageManager": "bun@1"
1720
}
Lines changed: 30 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,32 @@
11
{
2-
"name": "@postgrestools/backend-jsonrpc",
3-
"version": "<placeholder>",
4-
"main": "dist/index.js",
5-
"scripts": {
6-
"test": "bun test",
7-
"test:ci": "bun build && bun test",
8-
"build": "bun build ./src/index.ts --outdir ./dist --target node"
9-
},
10-
"files": [
11-
"dist/",
12-
"README.md"
13-
],
14-
"repository": {
15-
"type": "git",
16-
"url": "git+https://github.com/supabase-community/postgres_lsp.git",
17-
"directory": "packages/@postgrestools/backend-jsonrpc"
18-
},
19-
"author": "Supabase Community",
20-
"bugs": "ttps://github.com/supabase-community/postgres_lsp/issues",
21-
"description": "Bindings to the JSON-RPC Workspace API of the Postgres Language Tools daemon",
22-
"keywords": [
23-
"TypeScript",
24-
"Postgres"
25-
],
26-
"license": "MIT",
27-
"publishConfig": {
28-
"provenance": true
29-
},
30-
"optionalDependencies": {
31-
"@postgrestools/cli-win32-x64": "<placeholder>",
32-
"@postgrestools/cli-win32-arm64": "<placeholder>",
33-
"@postgrestools/cli-darwin-x64": "<placeholder>",
34-
"@postgrestools/cli-darwin-arm64": "<placeholder>",
35-
"@postgrestools/cli-linux-x64": "<placeholder>",
36-
"@postgrestools/cli-linux-arm64": "<placeholder>"
37-
}
2+
"name": "@postgrestools/backend-jsonrpc",
3+
"version": "<placeholder>",
4+
"main": "dist/index.js",
5+
"scripts": {
6+
"test": "bun test",
7+
"test:ci": "bun build && bun test",
8+
"build": "bun build ./src/index.ts --outdir ./dist --target node"
9+
},
10+
"files": ["dist/", "README.md"],
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/supabase-community/postgres_lsp.git",
14+
"directory": "packages/@postgrestools/backend-jsonrpc"
15+
},
16+
"author": "Supabase Community",
17+
"bugs": "ttps://github.com/supabase-community/postgres_lsp/issues",
18+
"description": "Bindings to the JSON-RPC Workspace API of the Postgres Language Tools daemon",
19+
"keywords": ["TypeScript", "Postgres"],
20+
"license": "MIT",
21+
"publishConfig": {
22+
"provenance": true
23+
},
24+
"optionalDependencies": {
25+
"@postgrestools/cli-win32-x64": "<placeholder>",
26+
"@postgrestools/cli-win32-arm64": "<placeholder>",
27+
"@postgrestools/cli-darwin-x64": "<placeholder>",
28+
"@postgrestools/cli-darwin-arm64": "<placeholder>",
29+
"@postgrestools/cli-linux-x64": "<placeholder>",
30+
"@postgrestools/cli-linux-arm64": "<placeholder>"
31+
}
3832
}

packages/@postgrestools/backend-jsonrpc/src/command.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,33 @@
44
* @returns Filesystem path to the binary, or null if no prebuilt distribution exists for the current platform
55
*/
66
export function getCommand(): string | null {
7-
const { platform, arch } = process;
7+
const { platform, arch } = process;
88

9-
type PlatformPaths = {
10-
[P in NodeJS.Platform]?: {
11-
[A in NodeJS.Architecture]?: string;
12-
};
13-
};
9+
type PlatformPaths = {
10+
[P in NodeJS.Platform]?: {
11+
[A in NodeJS.Architecture]?: string;
12+
};
13+
};
1414

15-
const PLATFORMS: PlatformPaths = {
16-
win32: {
17-
x64: "@postgrestools/cli-win32-x64/postgrestools.exe",
18-
arm64: "@postgrestools/cli-win32-arm64/postgrestools.exe",
19-
},
20-
darwin: {
21-
x64: "@postgrestools/cli-darwin-x64/postgrestools",
22-
arm64: "@postgrestools/cli-darwin-arm64/postgrestools",
23-
},
24-
linux: {
25-
x64: "@postgrestools/cli-linux-x64/postgrestools",
26-
arm64: "@postgrestools/cli-linux-arm64/postgrestools",
27-
},
28-
};
15+
const PLATFORMS: PlatformPaths = {
16+
win32: {
17+
x64: "@postgrestools/cli-win32-x64/postgrestools.exe",
18+
arm64: "@postgrestools/cli-win32-arm64/postgrestools.exe",
19+
},
20+
darwin: {
21+
x64: "@postgrestools/cli-darwin-x64/postgrestools",
22+
arm64: "@postgrestools/cli-darwin-arm64/postgrestools",
23+
},
24+
linux: {
25+
x64: "@postgrestools/cli-linux-x64/postgrestools",
26+
arm64: "@postgrestools/cli-linux-arm64/postgrestools",
27+
},
28+
};
2929

30-
const binPath = PLATFORMS?.[platform]?.[arch];
31-
if (!binPath) {
32-
return null;
33-
}
30+
const binPath = PLATFORMS?.[platform]?.[arch];
31+
if (!binPath) {
32+
return null;
33+
}
3434

35-
return require.resolve(binPath);
35+
return require.resolve(binPath);
3636
}

packages/@postgrestools/backend-jsonrpc/src/index.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import { type Workspace, createWorkspace as wrapTransport } from "./workspace";
1010
* @returns A Workspace client, or null if the underlying platform is not supported
1111
*/
1212
export async function createWorkspace(): Promise<Workspace | null> {
13-
const command = getCommand();
14-
if (!command) {
15-
return null;
16-
}
13+
const command = getCommand();
14+
if (!command) {
15+
return null;
16+
}
1717

18-
return createWorkspaceWithBinary(command);
18+
return createWorkspaceWithBinary(command);
1919
}
2020

2121
/**
@@ -27,20 +27,20 @@ export async function createWorkspace(): Promise<Workspace | null> {
2727
* @returns A Workspace client, or null if the underlying platform is not supported
2828
*/
2929
export async function createWorkspaceWithBinary(
30-
command: string
30+
command: string,
3131
): Promise<Workspace> {
32-
const socket = await createSocket(command);
33-
const transport = new Transport(socket);
32+
const socket = await createSocket(command);
33+
const transport = new Transport(socket);
3434

35-
await transport.request("initialize", {
36-
capabilities: {},
37-
client_info: {
38-
name: "@postgrestools/backend-jsonrpc",
39-
version: "0.0.0",
40-
},
41-
});
35+
await transport.request("initialize", {
36+
capabilities: {},
37+
client_info: {
38+
name: "@postgrestools/backend-jsonrpc",
39+
version: "0.0.0",
40+
},
41+
});
4242

43-
return wrapTransport(transport);
43+
return wrapTransport(transport);
4444
}
4545

4646
export * from "./workspace";

0 commit comments

Comments
 (0)