Skip to content

Commit 780dcda

Browse files
committed
fixes fixes fixes
1 parent 0253821 commit 780dcda

5 files changed

Lines changed: 10 additions & 564 deletions

File tree

.github/workflows/pages.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,20 @@ jobs:
3434
node-version: 22
3535
cache: pnpm
3636

37-
- name: Build WASM
37+
- name: Install TinyGo
3838
run: |
39-
GOOS=js GOARCH=wasm go build -ldflags="-s -w" -trimpath -o gnata.wasm ./wasm/
40-
cp "$(go env GOROOT)/lib/wasm/wasm_exec.js" wasm_exec.js
41-
# LSP WASM ships pre-built in @gnata-sqlite/react
42-
cp react/wasm/gnata-lsp.wasm gnata-lsp.wasm
43-
cp react/wasm/lsp-wasm_exec.js lsp-wasm_exec.js
39+
wget -q https://github.com/tinygo-org/tinygo/releases/download/v0.40.1/tinygo_0.40.1_amd64.deb -O /tmp/tinygo.deb
40+
sudo dpkg -i /tmp/tinygo.deb
41+
42+
- name: Build WASM
43+
run: make wasm
4444

4545
- name: Install dependencies
4646
run: pnpm install --frozen-lockfile
4747

48+
- name: Stage WASM into react package
49+
run: make stage-wasm-only
50+
4851
- name: Build React widget
4952
run: cd react && pnpm run build
5053

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,3 @@ node_modules/
1010
editor/codemirror/dist/
1111
lsp-wasm_exec.js
1212
wasm_exec.js
13-
14-
# Ship pre-built LSP WASM in the react package
15-
!react/wasm/gnata-lsp.wasm
16-
!react/wasm/lsp-wasm_exec.js

playground/src/RootLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function RootLayout() {
4747
const progressFadeTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
4848

4949
const location = useLocation();
50-
const mode = location.pathname === '/gnata' ? 'gnata' : 'sqlite';
50+
const mode = location.pathname.replace(/\/$/, '') === '/gnata' ? 'gnata' : 'sqlite';
5151

5252
useEffect(() => {
5353
document.documentElement.setAttribute('data-theme', theme);

react/wasm/gnata-lsp.wasm

-372 KB
Binary file not shown.

0 commit comments

Comments
 (0)