Skip to content

Commit

Permalink
move server protocol handler into lix sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelstroschein committed Nov 23, 2024
1 parent b056e80 commit 9790573
Show file tree
Hide file tree
Showing 18 changed files with 501 additions and 419 deletions.
3 changes: 0 additions & 3 deletions packages/lix-lixium/.prettierrc.json

This file was deleted.

28 changes: 0 additions & 28 deletions packages/lix-lixium/eslint.config.js

This file was deleted.

35 changes: 0 additions & 35 deletions packages/lix-lixium/package.json

This file was deleted.

18 changes: 0 additions & 18 deletions packages/lix-lixium/tsconfig.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@lix-js/lixium-example",
"name": "@lix-js/sdk-example-server-protocol-handler-hono",
"type": "module",
"version": "0.0.1",
"license": "Apache-2.0",
Expand All @@ -13,7 +13,7 @@
},
"dependencies": {
"@hono/node-server": "^1.13.7",
"@lix-js/lixium": "workspace:*",
"@lix-js/sdk": "workspace:*",
"hono": "^4.6.11"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { Hono } from "hono";
import { serve } from "@hono/node-server";
import { createInMemoryStorage, createLspHandler } from "@lix-js/lixium";
import {
createLspHandler,
createInMemoryLspHandlerStorage,
} from "@lix-js/sdk/server-protocol-handler";

const app = new Hono();

const lsp = await createLspHandler({
storage: createInMemoryStorage(),
storage: createInMemoryLspHandlerStorage(),
});

app.get("/", (c) => c.text("Hono!"));
Expand Down
File renamed without changes.
7 changes: 6 additions & 1 deletion packages/lix-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"version": "0.0.1",
"license": "Apache-2.0",
"exports": {
".": "./dist/index.js"
".": "./dist/index.js",
"./server-protocol-handler": "./dist/server-protocol-handler/index.js"
},
"scripts": {
"build": "tsc --build",
Expand All @@ -20,6 +21,9 @@
"engines": {
"node": ">=21"
},
"bundleDependencies": [
"@lix-js/server-protocol"
],
"dependencies": {
"dedent": "1.5.1",
"js-sha256": "^0.11.0",
Expand All @@ -28,6 +32,7 @@
"uuid": "^10.0.0"
},
"devDependencies": {
"@lix-js/server-protocol": "workspace:*",
"@eslint/js": "^9.12.0",
"@types/uuid": "^10.0.0",
"@vitest/coverage-v8": "^2.0.5",
Expand Down
2 changes: 2 additions & 0 deletions packages/lix-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ export * from "./file/index.js";
export * from "./lix/index.js";
export * from "./plugin/index.js";
export * from "./query-filter/index.js";
// protocol handler is exported via path in package.json
// export * from "./server-protocol-handler/index.js";
export * from "./snapshot/index.js";
export * from "./version/index.js";
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# Lixium
# Lix Server Protocol Handler

## What is Lixium?
Embed the lix server protocol in your own application.

Headless lix server protocol handler.

- embed the lix server protocol in your own application
- works in any JS runtime (node, browser, deno)
- no UI, bells or whistles, just handling the lix server protocol

## Usage

```ts
import { createHandler } from '@lix-js/lixium';
import { createLspHandler } from '@lix-js/sdk';

// or any other server framework (express, koa, hono, etc.)
const app = new Hono();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export {
createLspHandler,
type LixServerProtocolHandler,
} from "./create-lsp-handler.js";
export { createInMemoryStorage } from "./storage/create-in-memory-storage.js";
export { createInMemoryLspHandlerStorage } from "./storage/create-in-memory-storage.js";
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { Storage } from "./storage.js";
*
* Great for testing or quick prototyping.
*/
export const createInMemoryStorage = (): Storage => {
export const createInMemoryLspHandlerStorage = (): Storage => {
const store = new Map<string, Blob>();

return {
Expand Down
File renamed without changes.
Loading

0 comments on commit 9790573

Please sign in to comment.