Skip to content

Commit 19a643c

Browse files
committed
ref: rename to layout.wasm and input.wasm
1 parent b7e4d04 commit 19a643c

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
@@ -41,8 +41,10 @@ jobs:
4141
with:
4242
name: clayterm-wasm
4343
path: |
44-
clayterm.wasm
45-
wasm.ts
44+
layout.wasm
45+
input.wasm
46+
layout.wasm.ts
47+
input.wasm.ts
4648
4749
test-alt-os:
4850
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
@@ -50,25 +50,25 @@ INPUT_LDFLAGS = $(LDFLAGS_COMMON) \
5050

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

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

57-
clayterm-layout.wasm: $(DEPS)
57+
layout.wasm: $(DEPS)
5858
$(CC) $(CFLAGS) $(LAYOUT_LDFLAGS) -o $@ src/module-layout.c
5959
$(WASM_OPT) -Oz --enable-bulk-memory -o $@ $@
6060

61-
clayterm-input.wasm: $(DEPS)
61+
input.wasm: $(DEPS)
6262
$(CC) $(filter-out -DCLAY_IMPLEMENTATION -DCLAY_WASM, $(CFLAGS)) $(INPUT_LDFLAGS) -o $@ src/module-input.c
6363
$(WASM_OPT) -Oz --enable-bulk-memory -o $@ $@
6464

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

68-
wasm-input.ts: clayterm-input.wasm
69-
deno run --allow-read --allow-write tasks/bundle-wasm.ts clayterm-input.wasm wasm-input.ts
68+
input.wasm.ts: input.wasm
69+
deno run --allow-read --allow-write tasks/bundle-wasm.ts input.wasm input.wasm.ts
7070

7171
clean:
72-
rm -f clayterm.wasm clayterm-layout.wasm clayterm-input.wasm wasm.ts wasm-layout.ts wasm-input.ts
72+
rm -f layout.wasm input.wasm layout.wasm.ts input.wasm.ts
7373

7474
.PHONY: all clean

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
"publish": {
2828
"include": ["*.ts"],
29-
"exclude": ["!wasm-layout.ts", "!wasm-input.ts"]
29+
"exclude": ["!layout.wasm.ts", "!input.wasm.ts"]
3030
},
3131
"compilerOptions": {
3232
"types": ["@types/node"]

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
@@ -25,7 +25,11 @@ function encodeZ85(data: Uint8Array): string {
2525
return out.join("");
2626
}
2727

28-
const [input = "clayterm.wasm", output = "wasm.ts"] = Deno.args;
28+
const [input, output] = Deno.args;
29+
if (!input || !output) {
30+
console.error("Usage: bundle-wasm.ts <input.wasm> <output.ts>");
31+
Deno.exit(1);
32+
}
2933

3034
const wasm = await Deno.readFile(input);
3135

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)