@foundry-rs/chisel 1.4.4-nightly.20251104.804ad9f → 1.4.4-nightly.20251111.25196fa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +49 -1
  2. package/bin.mjs +27 -8
  3. package/package.json +14 -6
package/README.md CHANGED
@@ -1,4 +1,52 @@
1
- # Chisel
1
+ # [Chisel](https://getfoundry.sh/chisel)
2
2
 
3
3
  Chisel is a fast, utilitarian, and verbose Solidity REPL.
4
4
  The chisel binary can be used both within and outside of a Foundry project.
5
+
6
+ ## Usage
7
+
8
+ ### One-off commands
9
+
10
+ Example
11
+
12
+ ```sh
13
+ npx --yes @foundry-rs/chisel@nightly
14
+ ```
15
+
16
+ More generally
17
+
18
+ ```sh
19
+ npx --yes @foundry-rs/chisel@<version|nightly> [args...]
20
+ ```
21
+
22
+ ### Install then use
23
+
24
+ locally to your project
25
+
26
+ ```sh
27
+ npm add @foundry-rs/chisel@nightly
28
+ npx chisel [args...]
29
+ ```
30
+
31
+ globally
32
+
33
+ ```sh
34
+ npm add --global @foundry-rs/chisel@nightly
35
+ chisel [args...]
36
+ ```
37
+
38
+ ---
39
+
40
+ Also works with `deno`, `bun`, and `pnpm`:
41
+
42
+ ```sh
43
+ deno run --quiet --allow-all npm:@foundry-rs/chisel@nightly [args...]
44
+ ```
45
+
46
+ ```sh
47
+ bun x @foundry-rs/chisel@nightly [args...]
48
+ ```
49
+
50
+ ```sh
51
+ pnpm dlx --silent @foundry-rs/chisel@nightly [args...]
52
+ ```
package/bin.mjs CHANGED
@@ -29,13 +29,21 @@ if (!platformPackage) {
29
29
  }
30
30
 
31
31
  const child = NodeChildProcess.spawn(
32
- selectBinaryPath(),
33
- process.argv.slice(2),
34
- { stdio: 'inherit' }
32
+ selectBinaryPath(),
33
+ process.argv.slice(2),
34
+ { stdio: 'inherit' }
35
35
  )
36
36
 
37
- process.on('SIGINT', killChild)
38
- process.on('SIGTERM', killChild)
37
+ /**
38
+ * @type {Record<'SIGINT' | 'SIGTERM', () => void>}
39
+ */
40
+ const signalHandlers = {
41
+ SIGINT: () => forwardSignal('SIGINT'),
42
+ SIGTERM: () => forwardSignal('SIGTERM')
43
+ }
44
+
45
+ for (const [signal, handler] of Object.entries(signalHandlers))
46
+ process.on(signal, handler)
39
47
 
40
48
  /**
41
49
  * Determines which tool wrapper is executing.
@@ -126,8 +134,19 @@ function selectBinaryPath() {
126
134
  }
127
135
 
128
136
  /**
129
- * Kills the child process.
137
+ * Forwards a received signal to the child process, then re-emits it locally to
138
+ * preserve Node.js default exit semantics.
139
+ * @param {'SIGINT' | 'SIGTERM'} signal
130
140
  */
131
- function killChild() {
132
- child.kill()
141
+ function forwardSignal(signal) {
142
+ try {
143
+ if (!child.killed)
144
+ child.kill(signal)
145
+ } catch (error) {
146
+ if (!error || (typeof error === 'object' && 'code' in error && error.code !== 'ESRCH'))
147
+ throw error
148
+ }
149
+
150
+ process.off(signal, signalHandlers[signal])
151
+ process.kill(process.pid, signal)
133
152
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foundry-rs/chisel",
3
- "version": "1.4.4-nightly.20251104.804ad9f",
3
+ "version": "1.4.4-nightly.20251111.25196fa",
4
4
  "type": "module",
5
5
  "homepage": "https://getfoundry.sh/chisel",
6
6
  "description": "Chisel is a fast, utilitarian, and verbose Solidity REPL",
@@ -16,17 +16,25 @@
16
16
  "postinstall": "TARGET_TOOL=chisel node ./postinstall.mjs"
17
17
  },
18
18
  "optionalDependencies": {
19
- "@foundry-rs/chisel-darwin-arm64": "1.4.4-nightly.20251104.804ad9f",
20
- "@foundry-rs/chisel-darwin-amd64": "1.4.4-nightly.20251104.804ad9f",
21
- "@foundry-rs/chisel-linux-arm64": "1.4.4-nightly.20251104.804ad9f",
22
- "@foundry-rs/chisel-linux-amd64": "1.4.4-nightly.20251104.804ad9f",
23
- "@foundry-rs/chisel-win32-amd64": "1.4.4-nightly.20251104.804ad9f"
19
+ "@foundry-rs/chisel-darwin-arm64": "1.4.4-nightly.20251111.25196fa",
20
+ "@foundry-rs/chisel-darwin-amd64": "1.4.4-nightly.20251111.25196fa",
21
+ "@foundry-rs/chisel-linux-arm64": "1.4.4-nightly.20251111.25196fa",
22
+ "@foundry-rs/chisel-linux-amd64": "1.4.4-nightly.20251111.25196fa",
23
+ "@foundry-rs/chisel-win32-amd64": "1.4.4-nightly.20251111.25196fa"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public",
27
27
  "provenance": true,
28
28
  "registry": "https://registry.npmjs.org"
29
29
  },
30
+ "keywords": [
31
+ "foundry",
32
+ "testing",
33
+ "ethereum",
34
+ "solidity",
35
+ "blockchain",
36
+ "smart-contracts"
37
+ ],
30
38
  "license": "MIT OR Apache-2.0",
31
39
  "repository": {
32
40
  "directory": "npm",