all repos — underbbs @ 44bdad2e509c30962c79155a16e6d499bbaf3791

decentralized social media client

clean up frontend build config
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQT/foVVmI9pK13hPWFohAcXSWbK8wUCZorLRgAKCRBohAcXSWbK
8+a+AP4lLD2Zn6o5T+41eXskAd2wLGpdifk4xkm+UnziItdDLQEAqOAv1U3SIVSg
PxVnf1kvKP0/3gOczMvvGC3BaznhZgc=
=96OI
-----END PGP SIGNATURE-----
commit

44bdad2e509c30962c79155a16e6d499bbaf3791

parent

9dc27a4b9a016a92b6ab8f0041e3c5319e147913

M .gitignore.gitignore

@@ -1,4 +1,4 @@

node_modules/ -dist/*.js -src/ +frontend/dist/*.js +frontend/.js underbbs
M README.mdREADME.md

@@ -2,7 +2,19 @@ # underBBS

underBBS is a platform-agnostic messaging and social media client +## design + +`underbbs` supports multiple simultaneous account logins, mediating them for each user through a gateway server that handles all protocol-specific logic via `adapter`s and streaming content to the user through a single websocket connection with a singular data interface. + +each distinct `adapter` connection/configuration is represented in the frontend as a tab, and using the websocket's event-driven javascript interface with web components we can simply either store the data or tell the currently visible adapter that it might need to respond to the new data + +adapters receive commands via a quartzgun web API and send data back on their shared websocket connection + ## building -1. `npm install` -2. `npx tsc && npx webpack` (or run `./build.sh`, it does this for you) +requirements are + +- go 1.22 +- any recent nodejs that can do `typescript` and `webpack` 5 + +run `./build.sh` from the project root. you can supply 'front' or 'server' as an argument to build only one or the other; by default it builds both
M build.shbuild.sh

@@ -2,11 +2,15 @@ #!/bin/sh

case "$1" in client) - if [ ! -e ./src ]; then - mkdir ./src + if [ ! -e ./frontend/.js ]; then + mkdir ./frontend/.js fi buildlog=$(mktemp) - npx tsc 2>&1 | nobs | sed -e 's/\.ts\(/\.ts:/g' -e 's/,[0-9]+\)://g' > ${buildlog} + if [ ! -z $"{PLAN9}" ]; then + npx tsc 2>&1 | nobs | sed -e 's/\.ts\(/\.ts:/g' -e 's/,[0-9]+\)://g' > ${buildlog} + else + npx tsc 2>&1 > ${buildlog} + fi if [ -s ${buildlog} ]; then cat ${buildlog} | head rm ${buildlog}

@@ -18,11 +22,8 @@ server)

go mod tidy go build ;; - both) + *) $0 client $0 server ;; - *) - echo "USAGE: ${0} <client|server|both>" - ;; -esac+esac
M server/server.goserver/server.go

@@ -41,7 +41,7 @@ subscribers: make(map[*Subscriber][]adapter.Adapter),

} // frontend is here - srvr.serveMux.Handle("/app/", http.StripPrefix("/app/", renderer.Subtree("./dist"))) + srvr.serveMux.Handle("/app/", http.StripPrefix("/app/", renderer.Subtree("./frontend/dist"))) // api srvr.serveMux.Handle("/api/", http.StripPrefix("/api", srvr.apiMux()))
M tsconfig.jsontsconfig.json

@@ -10,7 +10,7 @@ "strict": true,

"removeComments": false, "preserveConstEnums": true, "sourceMap": false, - "outDir": "./src" + "outDir": "./frontend/.js" }, - "include": [ "./ts/*.ts"] + "include": [ "./frontend/ts/*.ts"] }
M webpack.config.jswebpack.config.js

@@ -1,9 +1,14 @@

const path = require('path'); module.exports = { - context: path.resolve(__dirname, 'src'), + mode: 'production', + context: path.resolve(__dirname, 'frontend', '.js'), entry: { main: './index.js', - serviceWorker: './serviceWorker.js' + serviceWorker: './serviceWorker.js', + }, + output: { + filename: '[name].js', + path: path.resolve(__dirname, 'frontend', 'dist'), } -}+}