-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: integrate nebula UI with worker-assets-gen
- Loading branch information
Showing
22 changed files
with
114 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -289,11 +289,7 @@ testnet-basic: setup-testnet | |
sh-testnet: mod-tidy | ||
CHAIN_ID="sonr-testnet-1" BLOCK_TIME="1000ms" CLEAN=true sh scripts/test_node.sh | ||
|
||
start-hway: hway | ||
@echo "(start-proxy) Starting proxy server" | ||
./build/hway start | ||
|
||
.PHONY: setup-testnet set-testnet-configs testnet testnet-basic sh-testnet start-hway | ||
.PHONY: setup-testnet set-testnet-configs testnet testnet-basic sh-testnet | ||
|
||
|
||
############################################################################### | ||
|
@@ -323,11 +319,13 @@ gen-pkl: | |
|
||
build-hway: gen-templ gen-pkl | ||
@echo "(motr) Building Highway gateway" | ||
go build -o ./build/hway ./cmd/hway | ||
go run github.com/syumai/workers/cmd/[email protected] -o ./web/build -mode go | ||
GOOS=js GOARCH=wasm go build -o ./web/build/app.wasm ./web/server.go | ||
|
||
|
||
build-motr: gen-templ gen-pkl | ||
@echo "(dwn) Building motr.wasm -> Service Worker IPFS Vault" | ||
GOOS=js GOARCH=wasm go build -o ./pkg/dwn/app.wasm ./cmd/motr/motr.go | ||
GOOS=js GOARCH=wasm go build -o ./pkg/dwn/app.wasm ./pkg/dwn/wasm/main.go | ||
|
||
build-nebula: | ||
@echo "(nebula) Building nebula" | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//go:build js && wasm | ||
|
||
package channel | ||
|
||
import ( | ||
"syscall/js" | ||
|
||
"github.com/labstack/echo/v4" | ||
) | ||
|
||
type BroadcastContext struct { | ||
echo.Context | ||
Channel js.Value | ||
} | ||
|
||
func (c *BroadcastContext) BroadcastMessage(message string) { | ||
c.Channel.Call("postMessage", message) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//go:build js && wasm | ||
|
||
package channel | ||
|
||
import ( | ||
"syscall/js" | ||
|
||
"github.com/labstack/echo/v4" | ||
) | ||
|
||
type JSHandler func(this js.Value, args []js.Value) interface{} | ||
|
||
func UseBroadcastChannel(channelName string, handler JSHandler) echo.MiddlewareFunc { | ||
var channel js.Value | ||
|
||
return func(next echo.HandlerFunc) echo.HandlerFunc { | ||
return func(c echo.Context) error { | ||
if channel.IsUndefined() { | ||
channel = js.Global().Get("BroadcastChannel").New(channelName) | ||
channel.Call("addEventListener", "message", handler) | ||
} | ||
|
||
cc := &BroadcastContext{ | ||
Context: c, | ||
Channel: channel, | ||
} | ||
return next(cc) | ||
} | ||
} | ||
} | ||
|
||
func PostBroadcastMessage(c echo.Context, message string) { | ||
cc := c.(*BroadcastContext) | ||
cc.BroadcastMessage(message) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package auth | ||
package swt | ||
|
||
import ( | ||
"fmt" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package auth | ||
package swt | ||
|
||
import ( | ||
"net/http" | ||
|
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "@onsonr/sonr.id", | ||
"version": "0.0.2", | ||
"scripts": { | ||
"fetch:deps": "bun run .deps.mjs", | ||
"build:css": "bunx tailwindcss -i ./global/styles/globals.css -o ./assets/css/styles.css", | ||
"build": "bun run fetch:deps && bun run build:css", | ||
"watch": "bunx tailwindcss -i ./global/styles/globals.css -o ./assets/css/styles.css --watch" | ||
}, | ||
"devDependencies": { | ||
"@tailwindcss/forms": "^0.5.7", | ||
"@tailwindcss/typography": "^0.5.15", | ||
"alpinejs": "^3.14.1", | ||
"htmx.org": "^1.9.12", | ||
"tailwindcss": "^3.3.0", | ||
"tailwindcss-motion": "^0.3.0-beta", | ||
"typescript": "^4.9.0" | ||
}, | ||
"dependencies": { | ||
"node-fetch": "^3.3.2", | ||
"sonr-es": "^0.5.3" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//go:build js && wasm | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/labstack/echo/v4" | ||
"github.com/onsonr/sonr/internal/session" | ||
"github.com/onsonr/sonr/pkg/nebula/routes" | ||
"github.com/syumai/workers" | ||
) | ||
|
||
func main() { | ||
s := echo.New() | ||
s.Use(session.UseSession) | ||
|
||
s.GET("/", routes.Home) | ||
s.GET("/login", routes.LoginStart) | ||
s.GET("/register", routes.RegisterStart) | ||
workers.Serve(s) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name = "sonr-id" | ||
main = "./build/worker.mjs" | ||
compatibility_date = "2024-10-07" | ||
|
||
[build] | ||
command = "devbox run build:hway" |