Skip to content

Commit 7eeb9a4

Browse files
committed
chore: move chip-wasm build commands into root Justfile
1 parent d395fea commit 7eeb9a4

File tree

4 files changed

+25
-27
lines changed

4 files changed

+25
-27
lines changed

Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ app-build app:
99
cd apps/{{app}} && (npm install && npm run build)
1010

1111
build-wasm:
12-
cd crates/chip-wasm && just build
12+
cd crates/chip-wasm && wasm-pack build --target web --release
1313

1414
# Inspectify
1515

apps/chip/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/chip/wasm-pack-plugin.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@ import childProcess from 'child_process';
33
import * as path from 'path';
44

55
type WasmPackConfig = {
6-
crates: string[];
6+
crates: string[];
77
};
88
export default function wasmPack(config: WasmPackConfig): Plugin {
9-
const jobs: (() => void)[] = [];
9+
const jobs: (() => void)[] = [];
1010

11-
return {
12-
name: 'wasm-pack',
13-
buildStart() {
14-
for (const crate of config.crates) {
15-
const lib = path.resolve(normalizePath(crate));
16-
const job = childProcess.spawn('cargo', ['watch', '--postpone', '-s', 'just build'], {
17-
cwd: lib,
18-
env: { ...process.env, RUST_LOG: 'none' },
19-
stdio: 'inherit'
20-
});
21-
jobs.push(() => {
22-
job.kill();
23-
});
24-
}
25-
},
26-
buildEnd: () => {
27-
for (const job of jobs) {
28-
job();
29-
}
30-
}
31-
};
11+
return {
12+
name: 'wasm-pack',
13+
buildStart() {
14+
for (const crate of config.crates) {
15+
const lib = path.resolve(normalizePath(crate));
16+
const job = childProcess.spawn('cargo', ['watch', '--postpone', '-s', 'just build-wasm'], {
17+
cwd: lib,
18+
env: { ...process.env, RUST_LOG: 'none' },
19+
stdio: 'inherit',
20+
});
21+
jobs.push(() => {
22+
job.kill();
23+
});
24+
}
25+
},
26+
buildEnd: () => {
27+
for (const job of jobs) {
28+
job();
29+
}
30+
},
31+
};
3232
}

crates/chip-wasm/Justfile

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)