Skip to content

Commit 0bbf6d0

Browse files
committed
ref: rename to layout.wasm and input.wasm
1 parent 989a904 commit 0bbf6d0

8 files changed

Lines changed: 39 additions & 29 deletions

File tree

.github/workflows/verify.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ jobs:
3838
with:
3939
name: clayterm-wasm
4040
path: |
41-
clayterm.wasm
42-
wasm.ts
41+
layout.wasm
42+
input.wasm
43+
layout.wasm.ts
44+
input.wasm.ts
4345
4446
test-alt-os:
4547
needs: test

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/.agent-shell/
2-
/clayterm-layout.wasm
3-
/clayterm-input.wasm
4-
/wasm-layout.ts
5-
/wasm-input.ts
2+
/layout.wasm
3+
/input.wasm
4+
/layout.wasm.ts
5+
/input.wasm.ts
66
/build/
77
/node_modules/

BUILD.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ The local source build is driven by `make`.
1818

1919
It generates:
2020

21-
- `clayterm.wasm` — the compiled WebAssembly module built from the C sources
22-
- `wasm.ts` — a generated TypeScript file derived from `clayterm.wasm`
21+
- `layout.wasm` — the layout WebAssembly module built from the C sources
22+
- `input.wasm` — the input WebAssembly module built from the C sources
23+
- `layout.wasm.ts` — generated TypeScript derived from `layout.wasm`
24+
- `input.wasm.ts` — generated TypeScript derived from `input.wasm`
2325

24-
`wasm.ts` is generated output, not hand-maintained source.
26+
These `.ts` files are generated output, not hand-maintained source.
2527

2628
## Clone the repo with submodules
2729

@@ -182,8 +184,10 @@ make
182184

183185
This should produce:
184186

185-
- `clayterm.wasm`
186-
- `wasm.ts`
187+
- `layout.wasm`
188+
- `input.wasm`
189+
- `layout.wasm.ts`
190+
- `input.wasm.ts`
187191

188192
For a clean rebuild:
189193

@@ -197,7 +201,7 @@ Re-run `make` when:
197201

198202
- you change files under `src/`
199203
- you update the `clay` submodule
200-
- `clayterm.wasm` or `wasm.ts` is missing
204+
- `layout.wasm`, `input.wasm`, `layout.wasm.ts`, or `input.wasm.ts` is missing
201205
- generated outputs look stale after switching branches or pulling changes
202206

203207
When in doubt, use a clean rebuild:
@@ -247,7 +251,7 @@ make clean && make
247251
Symptoms may include:
248252

249253
- target-related `clang` errors mentioning `wasm32`
250-
- linker failures while producing `clayterm.wasm`
254+
- linker failures while producing the `.wasm` outputs
251255

252256
Recovery:
253257

@@ -267,8 +271,8 @@ If the smoke test fails, fix the toolchain first and only then rerun `make`.
267271

268272
Symptoms may include:
269273

270-
- `clayterm.wasm` is missing
271-
- `wasm.ts` is missing
274+
- `layout.wasm` or `input.wasm` is missing
275+
- `layout.wasm.ts` or `input.wasm.ts` is missing
272276
- you changed `src/` or updated `clay/`, but the generated outputs do not match
273277

274278
Recovery:

Makefile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,23 @@ INPUT_LDFLAGS = $(LDFLAGS_COMMON) \
4949

5050
DEPS = $(wildcard src/*.c src/*.h)
5151

52-
all: clayterm-layout.wasm clayterm-input.wasm wasm-layout.ts wasm-input.ts
53-
@echo "Built clayterm-layout.wasm ($$(wc -c < clayterm-layout.wasm) bytes raw, $$(gzip -c clayterm-layout.wasm | wc -c) bytes gzip)"
54-
@echo "Built clayterm-input.wasm ($$(wc -c < clayterm-input.wasm) bytes raw, $$(gzip -c clayterm-input.wasm | wc -c) bytes gzip)"
52+
all: layout.wasm input.wasm layout.wasm.ts input.wasm.ts
53+
@echo "Built layout.wasm ($$(wc -c < layout.wasm) bytes raw, $$(gzip -c layout.wasm | wc -c) bytes gzip)"
54+
@echo "Built input.wasm ($$(wc -c < input.wasm) bytes raw, $$(gzip -c input.wasm | wc -c) bytes gzip)"
5555

56-
clayterm-layout.wasm: $(DEPS)
56+
layout.wasm: $(DEPS)
5757
$(CC) $(CFLAGS) $(LAYOUT_LDFLAGS) -o $@ src/module-layout.c
5858

59-
clayterm-input.wasm: $(DEPS)
59+
input.wasm: $(DEPS)
6060
$(CC) $(filter-out -DCLAY_IMPLEMENTATION -DCLAY_WASM, $(CFLAGS)) $(INPUT_LDFLAGS) -o $@ src/module-input.c
6161

62-
wasm-layout.ts: clayterm-layout.wasm
63-
deno run --allow-read --allow-write tasks/bundle-wasm.ts clayterm-layout.wasm wasm-layout.ts
62+
layout.wasm.ts: layout.wasm
63+
deno run --allow-read --allow-write tasks/bundle-wasm.ts layout.wasm layout.wasm.ts
6464

65-
wasm-input.ts: clayterm-input.wasm
66-
deno run --allow-read --allow-write tasks/bundle-wasm.ts clayterm-input.wasm wasm-input.ts
65+
input.wasm.ts: input.wasm
66+
deno run --allow-read --allow-write tasks/bundle-wasm.ts input.wasm input.wasm.ts
6767

6868
clean:
69-
rm -f clayterm.wasm clayterm-layout.wasm clayterm-input.wasm wasm.ts wasm-layout.ts wasm-input.ts
69+
rm -f layout.wasm input.wasm layout.wasm.ts input.wasm.ts
7070

7171
.PHONY: all clean

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"publish": {
2727
"include": ["*.ts"],
28-
"exclude": ["!wasm-layout.ts", "!wasm-input.ts"]
28+
"exclude": ["!layout.wasm.ts", "!input.wasm.ts"]
2929
},
3030
"fmt": {
3131
"exclude": ["clay", "build"]

input-native.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export interface InputNative {
169169
delay(st: number): number;
170170
}
171171

172-
import { compiled } from "./wasm-input.ts";
172+
import { compiled } from "./input.wasm.ts";
173173

174174
export async function createInputNative(
175175
escLatency: number,

tasks/bundle-wasm.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { encodeBase64 } from "@std/encoding/base64";
22

3-
const [input = "clayterm.wasm", output = "wasm.ts"] = Deno.args;
3+
const [input, output] = Deno.args;
4+
if (!input || !output) {
5+
console.error("Usage: bundle-wasm.ts <input.wasm> <output.ts>");
6+
Deno.exit(1);
7+
}
48

59
const wasm = await Deno.readFile(input);
610
const base64 = encodeBase64(wasm);

term-native.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface Native {
3131
errorMessage(ct: number, index: number): string;
3232
}
3333

34-
import { compiled } from "./wasm-layout.ts";
34+
import { compiled } from "./layout.wasm.ts";
3535

3636
export async function createTermNative(
3737
w: number,

0 commit comments

Comments
 (0)