Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/web.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Web

on:
push:
branches: ['master']
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Install dependencies
working-directory: ./www
run: bun install

- name: Test
working-directory: ./www
run: bun test

- name: Build
working-directory: ./www
run: bun run build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './www/dist'

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

needs: build

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 2 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ build-wasm:
--out-name val \
--out-dir ../../www/packages/val-wasm

rm -rf www/packages/val-wasm/.gitignore

uv run --with arrg tools/example-generator/main.py examples www/src/lib/examples.ts

[group: 'check']
Expand Down
14 changes: 14 additions & 0 deletions www/packages/val-wasm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "val-wasm",
"version": "0.0.0",
"files": [
"val_bg.wasm",
"val.js",
"val.d.ts"
],
"module": "val.js",
"types": "val.d.ts",
"sideEffects": [
"./snippets/*"
]
}
41 changes: 41 additions & 0 deletions www/packages/val-wasm/val.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/* tslint:disable */
/* eslint-disable */
export function start(): void;
export function parse(input: string): any;
export function evaluate(input: string): any;

export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;

export interface InitOutput {
readonly memory: WebAssembly.Memory;
readonly start: () => void;
readonly parse: (a: number, b: number) => [number, number, number];
readonly evaluate: (a: number, b: number) => [number, number, number];
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
readonly __wbindgen_malloc: (a: number, b: number) => number;
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
readonly __wbindgen_export_3: WebAssembly.Table;
readonly __externref_table_dealloc: (a: number) => void;
readonly __wbindgen_start: () => void;
}

export type SyncInitInput = BufferSource | WebAssembly.Module;
/**
* Instantiates the given `module`, which can either be bytes or
* a precompiled `WebAssembly.Module`.
*
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
*
* @returns {InitOutput}
*/
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;

/**
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
* for everything else, calls `WebAssembly.instantiate` directly.
*
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
*
* @returns {Promise<InitOutput>}
*/
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
Loading