Skip to content

Commit 22605e1

Browse files
authored
feat: add an example worker (#63)
1 parent ad1fa66 commit 22605e1

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

.github/packager/index.js

+9
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ fs.readdir(
2525
console.log(`error copying readme file: ${err}`);
2626
}
2727

28+
// If the kit is a worker, copy the worker.wasm file to the output directory with the kit name
29+
if (metadata.type === 'worker') {
30+
try {
31+
fs.copyFileSync(`${KITS_DIR}/${d}/worker.wasm`, `${OUTPUT_DIR}/${d}.wasm`);
32+
} catch (err) {
33+
console.log(`error copying worker file: ${err}`);
34+
}
35+
}
36+
2837
result.push({ key: d, ...metadata });
2938
});
3039

kits/worker-example/metadata.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
title: Worker Example
2+
logo: https://txpipe.io/images/txpipe.svg
3+
description: A simple worker example that includes a say-hello method.
4+
repository: https://github.com/txpipe/awesome-starter-kits
5+
type: worker
6+
features:
7+
- worker
8+
wasm: https://github.com/txpipe/awesome-starter-kits/releases/latest/download/worker-example.wasm
9+
config:
10+
custom_hello: Hi
11+
author:
12+
name: TxPipe
13+
website: https://txpipe.io
14+
logo: https://txpipe.io/images/txpipe.svg
15+
social:
16+
twitter: txpipe_tools
17+
discord: eVc6HJrYmP

kits/worker-example/worker.wasm

26.2 MB
Binary file not shown.

0 commit comments

Comments
 (0)