add standalone binary build step

This commit is contained in:
CoolElectronics 2023-08-16 21:10:37 -04:00
parent dda5302931
commit b06e0a85ab
No known key found for this signature in database
GPG key ID: F63593D168636C50
4 changed files with 18 additions and 8 deletions

View file

@ -1,8 +1,13 @@
# ADrift _surf_the_\_web_adrift\_
ADrift is a Decentralized proxy utilizing the WebRTC protocol.
# Adrift
Adrift is a Decentralized proxy utilizing the WebRTC protocol.
### Before everything.. ### Before everything..
install dependencies and build bare-client-custom install dependencies and build bare-client-custom
``` ```
pnpm install pnpm install
cd bare-client-custom cd bare-client-custom
@ -12,16 +17,19 @@ cd ..
``` ```
### Getting started ### Getting started
Currently, there aren't any middle nodes, only an exit node which is requires nodejs to run. Currently, there aren't any middle nodes, only an exit node which is requires nodejs to run.
### Getting started with the server ### Getting started with the server
inside the server/ directory, run `pnpm install`, followed by `pnpm dev` inside the server/ directory, run `pnpm install`, followed by `pnpm dev`
### Getting started with the client ### Getting started with the client
Inside the frontend/ directory, run `pnpm install` and then `VITE_ADRIFT_DEV=1 VITE_ADRIFT_SINGLEFILE= pnpm dev` Inside the frontend/ directory, run `pnpm install` and then `VITE_ADRIFT_DEV=1 VITE_ADRIFT_SINGLEFILE= pnpm dev`
### Quick server setup (linux) ### Quick server setup (linux)
``` ```
git submodule update --init --recursive git submodule update --init --recursive
pnpm install pnpm install
@ -35,6 +43,7 @@ pnpm dev
``` ```
### Quick client setup (linux) ### Quick client setup (linux)
``` ```
git submodule update --init --recursive git submodule update --init --recursive
pnpm install pnpm install

View file

@ -2,7 +2,7 @@ let makeAllPackagesExternalPlugin = {
name: 'make-all-packages-external', name: 'make-all-packages-external',
setup(build) { setup(build) {
let filter = /^[^.\/]|^\.[^.\/]|^\.\.[^\/]/ // Must not start with "/" or "./" or "../" 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)) build.onResolve({ filter }, args => (ignored.includes(args.path) ? { path: args.path, external: true } : null))
}, },
} }
@ -12,7 +12,7 @@ build({
platform: "node", platform: "node",
// format: "esm", // format: "esm",
bundle: true, bundle: true,
outfile: "dist/dist.js", outfile: "dist/main.js",
plugins: [ plugins: [
makeAllPackagesExternalPlugin makeAllPackagesExternalPlugin
], ],

View file

@ -5,7 +5,8 @@
"main": "src/main.ts", "main": "src/main.ts",
"scripts": { "scripts": {
"start": "tsx src/main.ts", "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": [], "keywords": [],
"author": "", "author": "",

View file

@ -1,7 +1,7 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "ES2017", "target": "ES2017",
"module": "ESNext", "module": "CommonJS",
"lib": ["dom", "es6", "es2017", "esnext.asynciterable"], "lib": ["dom", "es6", "es2017", "esnext.asynciterable"],
"skipLibCheck": true, "skipLibCheck": true,
"sourceMap": true, "sourceMap": true,