From b06e0a85ab38bbec6e87312d279c60153618a0f3 Mon Sep 17 00:00:00 2001 From: CoolElectronics Date: Wed, 16 Aug 2023 21:10:37 -0400 Subject: [PATCH] add standalone binary build step --- README.md | 17 +++++++++++++---- server/esbuild.bundle.js | 4 ++-- server/package.json | 3 ++- server/tsconfig.json | 2 +- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3518bfd..b397fd0 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,13 @@ -# ADrift -ADrift is a Decentralized proxy utilizing the WebRTC protocol. +_surf_the_\_web_adrift\_ + +# Adrift + +Adrift is a Decentralized proxy utilizing the WebRTC protocol. ### Before everything.. + install dependencies and build bare-client-custom + ``` pnpm install cd bare-client-custom @@ -12,16 +17,19 @@ cd .. ``` ### Getting started + Currently, there aren't any middle nodes, only an exit node which is requires nodejs to run. ### Getting started with the server + inside the server/ directory, run `pnpm install`, followed by `pnpm dev` ### Getting started with the client + Inside the frontend/ directory, run `pnpm install` and then `VITE_ADRIFT_DEV=1 VITE_ADRIFT_SINGLEFILE= pnpm dev` - ### Quick server setup (linux) + ``` git submodule update --init --recursive pnpm install @@ -35,6 +43,7 @@ pnpm dev ``` ### Quick client setup (linux) + ``` git submodule update --init --recursive pnpm install @@ -45,4 +54,4 @@ cd .. cd frontend/ pnpm install VITE_ADRIFT_DEV=1 VITE_ADRIFT_SINGLEFILE= pnpm dev -``` \ No newline at end of file +``` diff --git a/server/esbuild.bundle.js b/server/esbuild.bundle.js index d763ce7..63dadd9 100644 --- a/server/esbuild.bundle.js +++ b/server/esbuild.bundle.js @@ -2,7 +2,7 @@ let makeAllPackagesExternalPlugin = { name: 'make-all-packages-external', setup(build) { let filter = /^[^.\/]|^\.[^.\/]|^\.\.[^\/]/ // Must not start with "/" or "./" or "../" - let ignored = [] + let ignored = ["wrtc"] build.onResolve({ filter }, args => (ignored.includes(args.path) ? { path: args.path, external: true } : null)) }, } @@ -12,7 +12,7 @@ build({ platform: "node", // format: "esm", bundle: true, - outfile: "dist/dist.js", + outfile: "dist/main.js", plugins: [ makeAllPackagesExternalPlugin ], diff --git a/server/package.json b/server/package.json index 4966d1b..9c642b2 100644 --- a/server/package.json +++ b/server/package.json @@ -5,7 +5,8 @@ "main": "src/main.ts", "scripts": { "start": "tsx src/main.ts", - "dev": "tsx src/dev.ts" + "dev": "tsx src/dev.ts", + "prod": "node esbuild.bundle.js && pkg src/main.js" }, "keywords": [], "author": "", diff --git a/server/tsconfig.json b/server/tsconfig.json index 70c0325..6b583da 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "ES2017", - "module": "ESNext", + "module": "CommonJS", "lib": ["dom", "es6", "es2017", "esnext.asynciterable"], "skipLibCheck": true, "sourceMap": true,