diff --git a/bun.config.ts b/bun.config.ts index 88d32ab..3908c3e 100644 --- a/bun.config.ts +++ b/bun.config.ts @@ -2,3 +2,5 @@ import { buildWithBun } from '@kevisual/code-builder'; await buildWithBun({ naming: 'app', entry: 'src/index.ts', dts: true, clean: true }); +await buildWithBun({ naming: 'remote', entry: 'src/remote.ts', dts: true }); + diff --git a/package.json b/package.json index 973bff2..9bad2ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/project-search", - "version": "0.0.1", + "version": "0.0.2", "description": "", "main": "index.js", "scripts": { @@ -18,20 +18,21 @@ "devDependencies": { "@kevisual/code-builder": "^0.0.6", "@kevisual/context": "^0.0.8", + "@kevisual/dts": "^0.0.4", "@kevisual/remote-app": "^0.0.7", "@kevisual/router": "^0.1.1", "fast-glob": "^3.3.3", "meilisearch": "^0.55.0", - "zod": "^4.3.6" - }, - "dependencies": { + "zod": "^4.3.6", "@parcel/watcher": "^2.5.6", "es-toolkit": "^1.45.1", "eventemitter3": "^5.0.4" }, + "dependencies": {}, "exports": { ".": "./dist/app.js", - "./route": "./dist/app.js" + "./routes": "./dist/app.js", + "./remote": "./dist/remote.js" }, "publishConfig": { "access": "public" diff --git a/src/remote.ts b/src/remote.ts index b419107..63f9ed9 100644 --- a/src/remote.ts +++ b/src/remote.ts @@ -1,14 +1,17 @@ -import { app, manager } from './index' +import { app } from './index' import { RemoteApp } from '@kevisual/remote-app' app.createRouteList() -const remote = new RemoteApp({ - app, - id: 'project-search', - username: 'root' -}); -const isConnect = await remote.isConnect(); -if (isConnect) { - console.log('Remote app connected successfully', isConnect); - remote.listenProxy(); -} \ No newline at end of file + +export const run = async (username: string) => { + const remote = new RemoteApp({ + app, + id: 'project-search', + username: username, + }); + const isConnect = await remote.isConnect(); + if (isConnect) { + console.log('Remote app connected successfully', isConnect); + remote.listenProxy(); + } +} \ No newline at end of file