Skip to content

Commit b7e5ebb

Browse files
committed
fix: substitute TypeScript template variables with actual library names
1 parent 663688e commit b7e5ebb

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

bench/libtiff.bench.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
2-
* ${LIB_TITLE} WASM Benchmarks
2+
* Libtiff WASM Benchmarks
33
*/
44

5-
import ${LIB_TITLE}WASM from "../src/lib/index.ts"
5+
import LibtiffWASM from "../src/lib/index.ts"
66

7-
Deno.bench("${LIB_NAME} initialization", {
7+
Deno.bench("libtiff initialization", {
88
baseline: true
99
}, async () => {
10-
const lib = new ${LIB_TITLE}WASM()
10+
const lib = new LibtiffWASM()
1111
await lib.initialize()
1212
})

src/lib/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* @module ${LIB_TITLE} WASM
3-
* TypeScript-first ${LIB_TITLE} library for WebAssembly
2+
* @module Libtiff WASM
3+
* TypeScript-first Libtiff library for WebAssembly
44
*/
55

6-
export default class ${LIB_TITLE}WASM {
6+
export default class LibtiffWASM {
77
private module: any = null
88
private initialized = false
99

@@ -18,8 +18,8 @@ export default class ${LIB_TITLE}WASM {
1818
private async loadWASM(): Promise<any> {
1919
// Try local build first
2020
const localPaths = [
21-
'./../../install/wasm/${LIB_NAME}-main.js',
22-
'./../../install/wasm/${LIB_NAME}-release.js',
21+
'./../../install/wasm/libtiff-main.js',
22+
'./../../install/wasm/libtiff-release.js',
2323
]
2424

2525
for (const path of localPaths) {
@@ -32,6 +32,6 @@ export default class ${LIB_TITLE}WASM {
3232
}
3333
}
3434

35-
throw new Error('Failed to load ${LIB_NAME}.wasm')
35+
throw new Error('Failed to load libtiff.wasm')
3636
}
3737
}

src/lib/types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/**
2-
* Type definitions for ${LIB_TITLE} WASM
2+
* Type definitions for Libtiff WASM
33
*/
44

5-
export interface ${LIB_UPPER}Module {
5+
export interface LIBTIFFModule {
66
_malloc: (size: number) => number
77
_free: (ptr: number) => void
88
HEAPU8: Uint8Array
99
setValue: (ptr: number, value: number, type: string) => void
1010
getValue: (ptr: number, type: string) => number
1111
}
1212

13-
export class ${LIB_UPPER}Error extends Error {
13+
export class LIBTIFFError extends Error {
1414
constructor(message: string) {
1515
super(message)
16-
this.name = '${LIB_UPPER}Error'
16+
this.name = 'LIBTIFFError'
1717
}
1818
}

tests/deno/basic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Deno.test("Deno runtime features", () => {
77

88
Deno.test("WASM file accessibility", async () => {
99
try {
10-
const wasmFile = await Deno.stat("./install/wasm/${LIB_NAME}-main.wasm")
10+
const wasmFile = await Deno.stat("./install/wasm/libtiff-main.wasm")
1111
assert(wasmFile.isFile, "WASM file should exist")
1212
assert(wasmFile.size > 0, "WASM file should not be empty")
1313
console.log(`✅ Found WASM file: ${wasmFile.size} bytes`)

0 commit comments

Comments
 (0)