playground build issues

This commit is contained in:
2026-02-25 21:42:31 -08:00
parent c6d6c8df7e
commit c4ff0c7c8c
3 changed files with 16 additions and 3 deletions

View File

@@ -1,8 +1,8 @@
#!/bin/sh #!/bin/bash
mkdir -p public mkdir -p public
echo copy newt echo copy newt
#cp ../lsp.js src/newt.js (cd .. && make lsp.js)
(cd .. && make lsp) cp ../lsp.js src/newt.js
echo build newt worker echo build newt worker
esbuild src/worker.ts --bundle --format=esm --platform=browser > public/worker.js esbuild src/worker.ts --bundle --format=esm --platform=browser > public/worker.js
esbuild src/frame.ts --bundle --format=esm --platform=browser > public/frame.js esbuild src/frame.ts --bundle --format=esm --platform=browser > public/frame.js

6
playground/src/fs.ts Normal file
View File

@@ -0,0 +1,6 @@
import {shim} from './emul';
// Shim was dumping stuff globally and we've shifted to imports, so I'm adapting it here for now.
export const {readFileSync, writeFileSync, writeFile, writeSync, readSync } = shim.fs;
export default {readFileSync, writeFileSync, writeFile, writeSync, readSync };

7
playground/src/newt.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
import { Diagnostic, HoverResult, CodeAction } from './ipc'
export function LSP_updateFile(name: string, content: string): any;
export function LSP_checkFile(name: string): Diagnostic[];
export function LSP_hoverInfo(name: string, row: number, col: number): HoverResult | boolean | null;
export function LSP_codeActionInfo(name: string, row: number, col: number): CodeAction[] | null;
export function LSP_compileJS(name: string): string;