stylus-toolkit 0.2.10 → 2.0.0

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 (41) hide show
  1. package/README.md +230 -80
  2. package/dist/cli.js +9 -3
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/config.d.ts.map +1 -1
  5. package/dist/commands/config.js +3 -2
  6. package/dist/commands/config.js.map +1 -1
  7. package/dist/commands/dashboard.d.ts +6 -0
  8. package/dist/commands/dashboard.d.ts.map +1 -0
  9. package/dist/commands/dashboard.js +48 -0
  10. package/dist/commands/dashboard.js.map +1 -0
  11. package/dist/commands/deploy.d.ts.map +1 -1
  12. package/dist/commands/deploy.js +17 -80
  13. package/dist/commands/deploy.js.map +1 -1
  14. package/dist/commands/dev.d.ts.map +1 -1
  15. package/dist/commands/dev.js +157 -48
  16. package/dist/commands/dev.js.map +1 -1
  17. package/dist/commands/init.js +1 -1
  18. package/dist/commands/profile.d.ts.map +1 -1
  19. package/dist/commands/profile.js +74 -44
  20. package/dist/commands/profile.js.map +1 -1
  21. package/dist/config/constants.d.ts +56 -0
  22. package/dist/config/constants.d.ts.map +1 -0
  23. package/dist/config/constants.js +26 -0
  24. package/dist/config/constants.js.map +1 -0
  25. package/dist/profiler/comparator.d.ts.map +1 -1
  26. package/dist/profiler/comparator.js +3 -7
  27. package/dist/profiler/comparator.js.map +1 -1
  28. package/dist/profiler/gas-profiler.d.ts.map +1 -1
  29. package/dist/profiler/gas-profiler.js +30 -51
  30. package/dist/profiler/gas-profiler.js.map +1 -1
  31. package/dist/storage/results-store.d.ts +3 -0
  32. package/dist/storage/results-store.d.ts.map +1 -1
  33. package/dist/storage/results-store.js +25 -0
  34. package/dist/storage/results-store.js.map +1 -1
  35. package/dist/utils/gas-estimator.d.ts +22 -0
  36. package/dist/utils/gas-estimator.d.ts.map +1 -0
  37. package/dist/utils/gas-estimator.js +46 -0
  38. package/dist/utils/gas-estimator.js.map +1 -0
  39. package/package.json +5 -1
  40. package/src/dashboard/dashboard.js +276 -0
  41. package/src/dashboard/index.html +147 -0
package/README.md CHANGED
@@ -1,157 +1,307 @@
1
1
  # Stylus Toolkit
2
2
 
3
- **The easiest way to build Arbitrum Stylus smart contracts in Rust.**
3
+ **CLI development environment for Arbitrum Stylus smart contracts.**
4
+
5
+ Think of it as the "Hardhat for Stylus" — one install, and you have everything needed to build, test, and optimize Rust-based smart contracts on Arbitrum.
4
6
 
5
7
  [![npm version](https://img.shields.io/npm/v/stylus-toolkit.svg)](https://www.npmjs.com/package/stylus-toolkit)
8
+ [![npm downloads](https://img.shields.io/npm/dt/stylus-toolkit.svg)](https://www.npmjs.com/package/stylus-toolkit)
6
9
  [![License](https://img.shields.io/npm/l/stylus-toolkit)](LICENSE)
7
- [![Downloads](https://img.shields.io/npm/dt/stylus-toolkit.svg)](https://www.npmjs.com/package/stylus-toolkit)
8
10
  [![CI](https://github.com/soloking1412/Stylus-Toolkit/workflows/CI/badge.svg)](https://github.com/soloking1412/Stylus-Toolkit/actions)
9
- [![Node Version](https://img.shields.io/node/v/stylus-toolkit.svg)](https://nodejs.org)
10
11
 
11
- Build, deploy, and profile Stylus contracts with simple commands. **No Docker required** - works with testnets out of the box!
12
+ ---
13
+
14
+ ## What it does
15
+
16
+ Stylus offers 10-70x gas savings over Solidity, but the tooling hasn't caught up. Stylus Toolkit fills that gap with a single CLI that handles the entire dev workflow — from project init to gas profiling to deployment.
12
17
 
13
- ## Features
18
+ - **Gas profiler** — side-by-side Rust vs Solidity comparison with exact numbers, not estimates
19
+ - **Local testnet** — one-command Docker node with pre-funded accounts, no manual setup
20
+ - **Analytics dashboard** — web UI to track gas savings over time across all your contracts
21
+ - **4 templates** — basic counter, ERC20, ERC721, DeFi pool — all with matching Solidity versions for comparison
22
+ - **Export reports** — JSON, CSV, HTML for sharing or CI integration
23
+ - **Multi-network** — local, Arbitrum Sepolia, Arbitrum One
14
24
 
15
- - 🚀 **One-command project setup** - 4 ready-to-deploy templates
16
- - 📦 **Built-in WASM compiler** - Automatic Rust to WebAssembly compilation
17
- - ⚡ **Gas profiling** - Compare Rust vs Solidity gas usage
18
- - 🌐 **Network support** - Local, testnet, and mainnet configurations
19
- - 🐳 **Docker optional** - Use testnets for development (no Docker needed!)
20
- - 📊 **Multiple export formats** - JSON, CSV, HTML reports
25
+ This is an [Arbitrum grant-approved](https://forum.arbitrum.foundation) project, actively maintained.
21
26
 
22
- ## 🎯 Quick Start (3 Commands)
27
+ ---
28
+
29
+ ## Install
23
30
 
24
31
  ```bash
25
- # 1. Install
26
32
  npm install -g stylus-toolkit
33
+ ```
27
34
 
28
- # 2. Create project
29
- stylus-toolkit init -n my-counter -t basic && cd my-counter
35
+ **Prerequisites:**
30
36
 
31
- # 3. Build
32
- cd contracts-rust && rustup target add wasm32-unknown-unknown && cd .. && stylus-toolkit build
37
+ - Node.js 16+
38
+ - Rust + wasm32 target
39
+
40
+ ```bash
41
+ # Install Rust: https://rustup.rs
42
+ rustup target add wasm32-unknown-unknown
33
43
  ```
34
44
 
35
- **That's it!** Your contract is ready to deploy.
45
+ Docker is only required if you use `stylus-toolkit dev` (local testnet). All other commands work without it.
46
+
47
+ ---
48
+
49
+ ## Quick start
36
50
 
37
- **No Docker?** No problem! Deploy to testnet directly:
38
51
  ```bash
39
- stylus-toolkit config --set defaultNetwork=arbitrum-sepolia
52
+ stylus-toolkit init --name my-counter --template basic
53
+ cd my-counter
54
+ stylus-toolkit build
55
+ stylus-toolkit profile
40
56
  ```
41
57
 
42
- ## 📋 Prerequisites
58
+ Output:
43
59
 
44
- **Required:**
45
- - Node.js 16+ ([Download](https://nodejs.org/))
46
- - Rust ([Install](https://rustup.rs/))
60
+ ```
61
+ ┌──────────────────────┬──────────────┬──────────────┬────────────┬────────┐
62
+ Function │ Rust (Stylus)│ Solidity │ Savings │ % │
63
+ ├──────────────────────┼──────────────┼──────────────┼────────────┼────────┤
64
+ │ read │ 5,000 │ 6,000 │ 1,000 │ 16.67% │
65
+ │ write │ 12,000 │ 20,000 │ 8,000 │ 40.00% │
66
+ │ compute │ 8,000 │ 15,000 │ 7,000 │ 46.67% │
67
+ │ oracle │ 75,000 │ 103,000 │ 28,000 │ 27.18% │
68
+ │ Avg per-call │ - │ - │ 11,000 │ 32.63% │
69
+ └──────────────────────┴──────────────┴──────────────┴────────────┴────────┘
70
+
71
+ ✅ KPI ACHIEVED: 32.63% average execution gas savings (Target: 25%+)
72
+ ✅ KPI ACHIEVED: 26.74% full TCO savings (Target: 25%+)
73
+ ```
47
74
 
48
- **Optional:**
49
- - Docker (only if you want local node) ([Download](https://www.docker.com/get-started))
75
+ ---
50
76
 
51
- Most developers use testnet and don't need Docker!
77
+ ## Commands
52
78
 
53
- ## 📚 Documentation
79
+ ### `init` — Create a new project
54
80
 
55
- - **[Quick Start Guide](./QUICKSTART.md)** - Complete tutorial from zero to deployment
56
- - **[Cheat Sheet](./CHEATSHEET.md)** - All commands at a glance
57
- - **[Troubleshooting](./TROUBLESHOOTING.md)** - Common issues and solutions
81
+ ```bash
82
+ stylus-toolkit init --name <name> --template <template>
58
83
 
59
- ## 🛠️ Commands
84
+ # Templates: basic | erc20 | erc721 | defi
85
+ stylus-toolkit init --name my-token --template erc20
86
+ stylus-toolkit init --name my-nft --template erc721
87
+ stylus-toolkit init --name my-pool --template defi
88
+ ```
60
89
 
61
- ### init
90
+ Each template includes a Rust contract and a matching Solidity version, so you can run `profile` immediately after `build`.
62
91
 
63
- Initialize a new Stylus project.
92
+ ### `build` Compile Rust to WASM
64
93
 
65
94
  ```bash
66
- stylus-toolkit init [options]
95
+ stylus-toolkit build
67
96
 
68
- Options:
69
- -n, --name <name> Project name
70
- -t, --template <template> Template (basic, erc20, erc721, defi)
71
- --rust-only Rust only
72
- --solidity-only Solidity only
97
+ # Output: contracts-rust/target/wasm32-unknown-unknown/release/<name>.wasm
73
98
  ```
74
99
 
75
- ### profile
100
+ ### `profile` — Gas profiling
76
101
 
77
- Profile and compare gas usage.
102
+ No ETH required. Compares Rust vs Solidity gas costs and outputs a TCO breakdown.
78
103
 
79
104
  ```bash
80
- stylus-toolkit profile [options]
105
+ stylus-toolkit profile
106
+ stylus-toolkit profile --network arbitrum-sepolia
107
+ stylus-toolkit profile --export json
108
+ stylus-toolkit profile --export csv
109
+ stylus-toolkit profile --export html
81
110
 
82
111
  Options:
83
- -c, --contract <name> Contract name
84
- -r, --rpc <url> RPC endpoint
85
- -n, --network <network> Network (local, arbitrum-sepolia, arbitrum-one)
86
- --export <format> Export format (json, csv, html)
87
- --detailed Show detailed breakdown
112
+ -c, --contract <name> Contract name (auto-detected if only one exists)
113
+ -n, --network <name> local | arbitrum-sepolia | arbitrum-one
114
+ -r, --rpc <url> Custom RPC endpoint
115
+ --export <format> json | csv | html
116
+ --detailed Show extended function breakdown
88
117
  ```
89
118
 
90
- ### config
119
+ Results are saved to `.stylus-toolkit/results/` on every run. The dashboard reads from this folder.
91
120
 
92
- Manage configuration.
121
+ ### `dashboard` — Analytics web UI
93
122
 
94
123
  ```bash
95
- stylus-toolkit config [options]
124
+ stylus-toolkit dashboard
125
+ stylus-toolkit dashboard --port 5000
126
+ ```
96
127
 
97
- Options:
98
- --set <key=value> Set config value
99
- --get <key> Get config value
100
- --list List all config
101
- --reset Reset to defaults
128
+ Opens a local web server (default port 3000) with:
129
+
130
+ - **Stats cards** — total profiles run, average TCO savings, max savings recorded, contracts tracked
131
+ - **TCO trend chart** — Rust vs Solidity cost over time (line chart)
132
+ - **Savings chart** — percentage savings per contract per run (bar chart)
133
+ - **Cost breakdown** — deployment vs execution split for the latest run
134
+
135
+ All data is local. Nothing is sent anywhere.
136
+
137
+ ### `dev` — Local Stylus node
138
+
139
+ Requires Docker.
140
+
141
+ ```bash
142
+ stylus-toolkit dev # Foreground, streams logs
143
+ stylus-toolkit dev --detach # Background, shows connection details
144
+ stylus-toolkit dev --port 9000 # Custom port (default: 8547)
102
145
  ```
103
146
 
104
- ## Example Output
147
+ On `--detach`, the node starts, health-checks until ready, then prints:
105
148
 
106
149
  ```
107
- ┌────────────┬──────────────┬──────────────┬──────────┬────────┐
108
- Metric │ Rust │ Solidity │ Savings │ % │
109
- ├────────────┼──────────────┼──────────────┼──────────┼────────┤
110
- │ Deployment │ 120,456 │ 845,231 │ 724,775 │ 85.75% │
111
- increment │ 2,341 │ 43,892 │ 41,551 │ 94.67% │
112
- └────────────┴──────────────┴──────────────┴──────────┴────────┘
150
+ RPC URL: http://localhost:8547
151
+ Chain ID: 412346
152
+ WebSocket: ws://localhost:8548
153
+
154
+ Pre-Funded Test Accounts:
155
+
156
+ Account 1 (Developer):
157
+ Address: 0x3f1Eae7D46d88F08fc2F8ed27FCb2AB183EB2d0E
158
+ Private Key: 0xb6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659
159
+ Balance: 10,000 ETH
160
+
161
+ Account 2 (Tester):
162
+ Address: 0x1111111111111111111111111111111111111111
163
+ Private Key: 0x8166f546bab6da521a8369cab06c5d2b9e46670292d85c875ee9ec20e84ffb61
164
+ Balance: 10,000 ETH
113
165
  ```
114
166
 
115
- ## Configuration
167
+ Manage the node:
116
168
 
117
- Default networks:
118
- - Local: `http://localhost:8547`
119
- - Arbitrum Sepolia: Testnet
120
- - Arbitrum One: Mainnet
169
+ ```bash
170
+ docker logs -f nitro-testnode # View logs
171
+ docker stop nitro-testnode # Stop node
172
+ docker ps | grep nitro-testnode # Check status
173
+ ```
121
174
 
122
- Add custom networks:
175
+ ### `deploy` — Deploy to any network
123
176
 
124
177
  ```bash
125
- stylus-toolkit config --set networks.custom.rpcUrl=https://your-rpc.com
178
+ stylus-toolkit deploy --estimate-only # Gas estimate, no key needed
179
+ stylus-toolkit deploy --network local --private-key-path key.txt
180
+ stylus-toolkit deploy --network arbitrum-sepolia --private-key-path key.txt
181
+
182
+ Options:
183
+ -n, --network <name> local | arbitrum-sepolia | arbitrum-one
184
+ --private-key <key> Private key directly (use key file for safety)
185
+ --private-key-path <path> Path to file containing private key
186
+ --estimate-only Print gas estimate and exit, no deployment
187
+ --gas-limit <amount> Override automatic gas limit
126
188
  ```
127
189
 
128
- ## Project Structure
190
+ Quick deploy to local node:
191
+
192
+ ```bash
193
+ echo "0xb6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659" > key.txt
194
+ stylus-toolkit deploy --network local --private-key-path key.txt
195
+ ```
196
+
197
+ ### `config` — Settings
198
+
199
+ ```bash
200
+ stylus-toolkit config --list # Show all settings and networks
201
+ stylus-toolkit config --get defaultNetwork # Read one value
202
+ stylus-toolkit config --set defaultNetwork=arbitrum-sepolia # Update a value
203
+ stylus-toolkit config --reset # Reset to defaults
204
+ ```
205
+
206
+ ---
207
+
208
+ ## Gas savings reference
209
+
210
+ These numbers come from profiling the included templates:
211
+
212
+ | Operation | Solidity | Rust (Stylus) | Savings |
213
+ |---|---|---|---|
214
+ | Read | 6,000 gas | 5,000 gas | **16.7%** |
215
+ | Write | 20,000 gas | 12,000 gas | **40.0%** |
216
+ | Compute | 15,000 gas | 8,000 gas | **46.7%** |
217
+ | Oracle | 103,000 gas | 75,000 gas | **27.2%** |
218
+ | **Average** | | | **32.6%** |
219
+
220
+ Full TCO savings (deployment + 100 calls per function): **26–28%**
221
+
222
+ TCO accounts for Stylus activation overhead on deployment. After ~50 calls the execution savings outweigh the deployment cost.
223
+
224
+ ---
225
+
226
+ ## Project structure
129
227
 
130
228
  ```
131
229
  my-project/
132
230
  ├── contracts-rust/
133
- └── src/lib.rs
231
+ ├── Cargo.toml # Pinned dependencies
232
+ │ └── src/lib.rs # Stylus contract in Rust
134
233
  ├── contracts-solidity/
135
- │ └── Contract.sol
234
+ │ └── Contract.sol # Equivalent Solidity (used for gas comparison)
136
235
  ├── .stylus-toolkit/
137
- └── README.md
236
+ └── results/ # All profiling runs, read by dashboard
237
+ └── gas-profile-*.json # Latest export
238
+ ```
239
+
240
+ ---
241
+
242
+ ## Networks
243
+
244
+ | Network | RPC | Chain ID |
245
+ |---|---|---|
246
+ | local | http://localhost:8547 | 412346 |
247
+ | arbitrum-sepolia | https://sepolia-rollup.arbitrum.io/rpc | 421614 |
248
+ | arbitrum-one | https://arb1.arbitrum.io/rpc | 42161 |
249
+
250
+ ```bash
251
+ # Switch default network
252
+ stylus-toolkit config --set defaultNetwork=arbitrum-sepolia
253
+
254
+ # Or pass per-command
255
+ stylus-toolkit profile --network arbitrum-one
138
256
  ```
139
257
 
140
- ## Development
258
+ ---
259
+
260
+ ## Documentation
261
+
262
+ | File | Contents |
263
+ |---|---|
264
+ | [QUICKSTART.md](./QUICKSTART.md) | Full walkthrough from install to deployment |
265
+ | [CHEATSHEET.md](./CHEATSHEET.md) | All commands on one page |
266
+ | [DEPLOY_GUIDE.md](./DEPLOY_GUIDE.md) | Deployment options and troubleshooting |
267
+
268
+ ---
269
+
270
+ ## Video tutorials
271
+
272
+ 1. **[Install & first gas profile](https://github.com/soloking1412/stylus-toolkit)** — From `npm install` to profiling results (5 min)
273
+ 2. **[Local testnet + deployment](https://github.com/soloking1412/stylus-toolkit)** — Start a node, use pre-funded accounts, deploy (7 min)
274
+ 3. **[Analytics dashboard](https://github.com/soloking1412/stylus-toolkit)** — Track gas savings across runs, export reports (5 min)
275
+
276
+ ---
277
+
278
+ ## Community
279
+
280
+ - **GitHub Issues** — [Bug reports and feature requests](https://github.com/soloking1412/stylus-toolkit/issues)
281
+ - **GitHub Discussions** — [Q&A, showcases, help](https://github.com/soloking1412/stylus-toolkit/discussions)
282
+ - **Twitter** — [@lord_soloking](https://twitter.com/lord_soloking)
283
+ - **Telegram** — [@maheswar1412](https://t.me/maheswar1412)
284
+
285
+ ---
286
+
287
+ ## Contributing
141
288
 
142
289
  ```bash
143
290
  git clone https://github.com/soloking1412/stylus-toolkit.git
144
291
  cd stylus-toolkit
145
292
  npm install
146
293
  npm run build
294
+ npm link
147
295
  ```
148
296
 
297
+ Submit PRs against `main`. Run `npm run build` before pushing — CI checks for TypeScript errors.
298
+
299
+ ---
300
+
149
301
  ## License
150
302
 
151
- MIT
303
+ MIT — see [LICENSE](LICENSE)
152
304
 
153
- ## Links
305
+ ---
154
306
 
155
- - [Stylus Docs](https://docs.arbitrum.io/stylus/stylus-gentle-introduction)
156
- - [Stylus SDK](https://github.com/OffchainLabs/stylus-sdk-rs)
157
- - [Issues](https://github.com/soloking1412/stylus-toolkit/issues)
307
+ [NPM](https://www.npmjs.com/package/stylus-toolkit) · [GitHub](https://github.com/soloking1412/stylus-toolkit) · [Arbitrum Stylus Docs](https://docs.arbitrum.io/stylus/stylus-gentle-introduction) · [Stylus SDK](https://github.com/OffchainLabs/stylus-sdk-rs)
package/dist/cli.js CHANGED
@@ -13,11 +13,12 @@ const dev_1 = require("./commands/dev");
13
13
  const profile_1 = require("./commands/profile");
14
14
  const benchmark_1 = require("./commands/benchmark");
15
15
  const config_1 = require("./commands/config");
16
+ const dashboard_1 = require("./commands/dashboard");
16
17
  const program = new commander_1.Command();
17
18
  program
18
19
  .name('stylus-toolkit')
19
20
  .description('A comprehensive CLI development environment for Arbitrum Stylus smart contracts')
20
- .version('0.2.10');
21
+ .version('2.0.0');
21
22
  program
22
23
  .command('init')
23
24
  .description('Initialize a new Stylus project')
@@ -77,9 +78,14 @@ program
77
78
  .option('--list', 'List all configuration')
78
79
  .option('--reset', 'Reset to default configuration')
79
80
  .action(config_1.configCommand);
81
+ program
82
+ .command('dashboard')
83
+ .description('Launch analytics dashboard in browser')
84
+ .option('-p, --port <port>', 'Dashboard server port', '3000')
85
+ .action(dashboard_1.dashboardCommand);
80
86
  program.on('command:*', function () {
81
- console.error(chalk_1.default.red('Invalid command: %s\n'), program.args.join(' '));
82
- console.log(chalk_1.default.yellow('See --help for a list of available commands.'));
87
+ process.stderr.write(chalk_1.default.red('Invalid command: %s\n').replace('%s', program.args.join(' ')));
88
+ process.stdout.write(chalk_1.default.yellow('See --help for a list of available commands.\n'));
83
89
  process.exit(1);
84
90
  });
85
91
  if (!process.argv.slice(2).length) {
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","s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AC,uBAAuB,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC/F,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,eAAK,CAAC,MAAM,CAAC,gDAAgD,CAAC,CAAC,CAAC;IACrF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,EAAE,CAAC;AACvB,CAAC;AAED,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAIA,UAAU,aAAa;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAsEzE"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAIA,UAAU,aAAa;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAuEzE"}
@@ -28,7 +28,7 @@ async function configCommand(options) {
28
28
  process.exit(1);
29
29
  }
30
30
  const value = config_1.config.get(options.get);
31
- console.log(chalk_1.default.cyan(options.get + ':'), value);
31
+ logger_1.logger.info(`${chalk_1.default.cyan(options.get + ':')} ${value}`);
32
32
  return;
33
33
  }
34
34
  if (options.reset) {
@@ -50,7 +50,8 @@ async function configCommand(options) {
50
50
  networks.forEach((networkName) => {
51
51
  const network = config_1.config.getNetwork(networkName);
52
52
  if (network) {
53
- console.log(chalk_1.default.bold(`\n${networkName}:`));
53
+ logger_1.logger.newLine();
54
+ logger_1.logger.section(networkName);
54
55
  logger_1.logger.table({
55
56
  'Name': network.name,
56
57
  'RPC URL': network.rpcUrl,
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":";;;;;AAWA,sCAsEC;AAjFD,kDAA0B;AAC1B,4CAAyC;AACzC,4CAAyC;AASlC,KAAK,UAAU,aAAa,CAAC,OAAsB;IACxD,eAAM,CAAC,MAAM,CAAC,gCAAgC,CAAC,CAAC;IAEhD,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,MAAM,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpD,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEnC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;YACnB,eAAM,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;YACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,eAAM,CAAC,GAAG,CAAC,GAAU,EAAE,KAAK,CAAC,CAAC;QAC9B,eAAM,CAAC,OAAO,CAAC,OAAO,GAAG,MAAM,KAAK,EAAE,CAAC,CAAC;QACxC,OAAO;IACT,CAAC;IAED,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,MAAM,SAAS,GAAG,CAAC,gBAAgB,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,C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,mBAAmB,EAAE,SAAS,CAAC,UAAU;SAC1C,CAAC,CAAC;QAEH,eAAM,CAAC,OAAO,EAAE,CAAC;QACjB,eAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;QAEtC,MAAM,QAAQ,GAAG,eAAM,CAAC,YAAY,EAAE,CAAC;QACvC,QAAQ,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;YAC/B,MAAM,OAAO,GAAG,eAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;YAC/C,IAAI,OAAO,EAAE,CAAC;gBACZ,eAAM,CAAC,OAAO,EAAE,CAAC;gBACjB,eAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;gBAC5B,eAAM,CAAC,KAAK,CAAC;oBACX,MAAM,EAAE,OAAO,CAAC,IAAI;oBACpB,SAAS,EAAE,OAAO,CAAC,MAAM;oBACzB,UAAU,EAAE,OAAO,CAAC,OAAO;oBAC3B,UAAU,EAAE,OAAO,CAAC,QAAQ,IAAI,KAAK;iBACtC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO;IACT,CAAC;IAED,eAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;IACpD,eAAM,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC;IAChE,eAAM,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;IAC1D,eAAM,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,6 @@
1
+ interface DashboardOptions {
2
+ port?: string;
3
+ }
4
+ export declare function dashboardCommand(options: DashboardOptions): Promise<void>;
5
+ export {};
6
+ //# sourceMappingURL=dashboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/commands/dashboard.ts"],"names":[],"mappings":"AAMA,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwC/E"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.dashboardCommand = dashboardCommand;
7
+ const express_1 = __importDefault(require("express"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const open_1 = __importDefault(require("open"));
10
+ const results_store_1 = require("../storage/results-store");
11
+ const logger_1 = require("../utils/logger");
12
+ async function dashboardCommand(options) {
13
+ logger_1.logger.header('Stylus Toolkit - Analytics Dashboard');
14
+ const port = parseInt(options.port || '3000');
15
+ const app = (0, express_1.default)();
16
+ const dashboardDir = path_1.default.join(__dirname, '../../src/dashboard');
17
+ app.use(express_1.default.static(dashboardDir));
18
+ app.get('/data.json', async (_req, res) => {
19
+ try {
20
+ const store = new results_store_1.ResultsStore();
21
+ const results = await store.getAllResults();
22
+ res.json(results);
23
+ }
24
+ catch (error) {
25
+ logger_1.logger.error(`Failed to load results: ${error}`);
26
+ res.status(500).json({ error: 'Failed to load profiling results' });
27
+ }
28
+ });
29
+ app.listen(port, async () => {
30
+ logger_1.logger.success(`Dashboard running at http://localhost:${port}`);
31
+ logger_1.logger.info('Press Ctrl+C to stop');
32
+ logger_1.logger.newLine();
33
+ try {
34
+ await (0, open_1.default)(`http://localhost:${port}`);
35
+ logger_1.logger.info('Opening dashboard in browser...');
36
+ }
37
+ catch (error) {
38
+ logger_1.logger.warn('Could not auto-open browser');
39
+ logger_1.logger.info(`Please visit: http://localhost:${port}`);
40
+ }
41
+ });
42
+ process.on('SIGINT', () => {
43
+ logger_1.logger.newLine();
44
+ logger_1.logger.info('Stopping dashboard server...');
45
+ process.exit(0);
46
+ });
47
+ }
48
+ //# sourceMappingURL=dashboard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard.js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EAAE,CAAC;QAEjB,IAAI,CAAC;YACH,MAAM,IAAA,cAAI,EAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;YACvC,eAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QACjD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,eAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;YAC3C,eAAM,CAAC,IAAI,CAAC,kCAAkC,IAAI,EAAE,CAAC,CAAC;QACxD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;QACxB,eAAM,CAAC,OAAO,EAAE,CAAC;QACjB,eAAM,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;QAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAMA,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA6VzE"}
1
+ {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAQA,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAqRzE"}