Skip to content

Commit 2d9f872

Browse files
Merge pull request #26 from Ruby-Network/bare
Add bare support
2 parents f2bd3e9 + 6c07e66 commit 2d9f872

File tree

17 files changed

+670
-41
lines changed

17 files changed

+670
-41
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "epoxytransport"]
22
path = epoxytransport
33
url = https://github.com/mercuryworkshop/epoxytransport
4+
[submodule "bare-as-module3"]
5+
path = bare-as-module3
6+
url = https://github.com/motortruck1221/bare-as-module3

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SHELL := bash
2+
3+
bare-module:
4+
@echo "Building bare as module 3"
5+
@cd bare-as-module3 && pnpm run build
6+
@cp bare-as-module3/dist/bare.cjs src/public/js/bareTransport/bareMod.js

bare-as-module3

Submodule bare-as-module3 added at 36759f8

docker/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ RUN gem install bundler
99
# Installing pnpm
1010
RUN npm install -g pnpm
1111
RUN pnpm install
12+
RUN make bare-module
1213
# Setup a basic configuration
1314
RUN cp config/settings.example.yml config/settings.yml
1415
# Mount config/settings.yml as a volume

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121
"@fastify/caching": "^8.3.0",
2222
"@fastify/http-proxy": "^9.4.0",
2323
"@fastify/middie": "^8.3.0",
24-
"@mercuryworkshop/bare-mux": "^1.0.4",
24+
"@mercuryworkshop/bare-mux": "^1.0.5",
2525
"@mercuryworkshop/epoxy-transport": "workspace:*",
26-
"@mercuryworkshop/libcurl-transport": "^1.2.0",
26+
"@mercuryworkshop/libcurl-transport": "^1.2.1",
2727
"@nebula-services/dynamic": "0.7.2-patch.2",
2828
"@titaniumnetwork-dev/ultraviolet": "^3.0.0",
29+
"@tomphttp/bare-client": "workspace:*",
2930
"@tomphttp/bare-server-node": "^2.0.3",
3031
"chalk": "^5.3.0",
3132
"fastify": "^4.26.2",

src/public/css/style.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/public/js/bare.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ function bareChange(value) {
2020
description : 'Ruby Config for things in sw'
2121
});
2222
localforage.setItem('bare', value).then(function (value) {
23-
if (!value.endsWith('/')) { value += '/'; localforage.setItem('bare', value); localStorage.setItem('bare', value); }
23+
if (value === "") { value = window.location.origin + '/bare/'; localforage.setItem('bare', value); localStorage.setItem('bare', value); }
24+
if (!value.endsWith('/')) { value += '/'; localforage.setItem('bare', value); localStorage.setItem('bare', value);}
2425
if (!value.startsWith('http://') && !value.startsWith('https://') && value !== '/bare/' && value !== '/bare') { value = 'https://' + value; localforage.setItem('bare', value); localStorage.setItem('bare', value); }
2526
if (value === '/bare/' || value === '/bare') { value = window.location.origin + value; localforage.setItem('bare', value); localStorage.setItem('bare', value); }
27+
setBareTransport(localStorage.getItem('bare'));
28+
setItems();
2629
}).catch(function(err) {
2730
console.log(err);
2831
});
29-
uninstallAllSW()
32+
//uninstallAllSW()
3033
}
3134

3235
function uninstallAllSW() {

0 commit comments

Comments
 (0)