bitwrench 2.0.32 → 2.1.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.
- package/README.md +210 -125
- package/dist/bitwrench-bccl.cjs.js +349 -188
- package/dist/bitwrench-bccl.cjs.min.js +2 -39
- package/dist/bitwrench-bccl.cjs.min.js.gz +0 -0
- package/dist/bitwrench-bccl.esm.js +349 -188
- package/dist/bitwrench-bccl.esm.min.js +2 -39
- package/dist/bitwrench-bccl.esm.min.js.gz +0 -0
- package/dist/bitwrench-bccl.umd.js +349 -188
- package/dist/bitwrench-bccl.umd.min.js +2 -39
- package/dist/bitwrench-bccl.umd.min.js.gz +0 -0
- package/dist/bitwrench-code-edit.cjs.js +17 -6
- package/dist/bitwrench-code-edit.cjs.min.js +2 -20
- package/dist/bitwrench-code-edit.es5.js +8 -3
- package/dist/bitwrench-code-edit.es5.min.js +2 -19
- package/dist/bitwrench-code-edit.esm.js +17 -6
- package/dist/bitwrench-code-edit.esm.min.js +2 -19
- package/dist/bitwrench-code-edit.umd.js +17 -6
- package/dist/bitwrench-code-edit.umd.min.js +2 -19
- package/dist/bitwrench-code-edit.umd.min.js.gz +0 -0
- package/dist/bitwrench-debug.js +1 -1
- package/dist/bitwrench-debug.min.js +1 -1
- package/dist/bitwrench-lean.cjs.js +2492 -1628
- package/dist/bitwrench-lean.cjs.min.js +2 -80
- package/dist/bitwrench-lean.cjs.min.js.gz +0 -0
- package/dist/bitwrench-lean.es5.js +2740 -1838
- package/dist/bitwrench-lean.es5.min.js +2 -49
- package/dist/bitwrench-lean.es5.min.js.gz +0 -0
- package/dist/bitwrench-lean.esm.js +2492 -1628
- package/dist/bitwrench-lean.esm.min.js +2 -80
- package/dist/bitwrench-lean.esm.min.js.gz +0 -0
- package/dist/bitwrench-lean.umd.js +2492 -1628
- package/dist/bitwrench-lean.umd.min.js +2 -80
- package/dist/bitwrench-lean.umd.min.js.gz +0 -0
- package/dist/bitwrench-util-color.cjs.js +251 -0
- package/dist/bitwrench-util-color.cjs.min.js +3 -0
- package/dist/bitwrench-util-color.es5.js +256 -0
- package/dist/bitwrench-util-color.es5.min.js +3 -0
- package/dist/bitwrench-util-color.esm.js +241 -0
- package/dist/bitwrench-util-color.esm.min.js +3 -0
- package/dist/bitwrench-util-color.umd.js +257 -0
- package/dist/bitwrench-util-color.umd.min.js +3 -0
- package/dist/bitwrench-util-css.cjs.js +2 -1
- package/dist/bitwrench-util-css.cjs.min.js +2 -21
- package/dist/bitwrench-util-css.es5.js +2 -1
- package/dist/bitwrench-util-css.es5.min.js +2 -20
- package/dist/bitwrench-util-css.esm.js +2 -1
- package/dist/bitwrench-util-css.esm.min.js +1 -19
- package/dist/bitwrench-util-css.umd.js +2 -1
- package/dist/bitwrench-util-css.umd.min.js +2 -20
- package/dist/bitwrench-util-css.umd.min.js.gz +0 -0
- package/dist/bitwrench.cjs.js +2826 -1801
- package/dist/bitwrench.cjs.min.js +2 -99
- package/dist/bitwrench.cjs.min.js.gz +0 -0
- package/dist/bitwrench.css +403 -479
- package/dist/bitwrench.d.ts +70 -73
- package/dist/bitwrench.es5.js +3106 -2020
- package/dist/bitwrench.es5.min.js +2 -67
- package/dist/bitwrench.es5.min.js.gz +0 -0
- package/dist/bitwrench.esm.js +2826 -1801
- package/dist/bitwrench.esm.min.js +2 -99
- package/dist/bitwrench.esm.min.js.gz +0 -0
- package/dist/bitwrench.min.css +1 -1
- package/dist/bitwrench.umd.js +2826 -1801
- package/dist/bitwrench.umd.min.js +2 -99
- package/dist/bitwrench.umd.min.js.gz +0 -0
- package/dist/builds.json +222 -134
- package/dist/bwserve.cjs.js +289 -282
- package/dist/bwserve.d.ts +157 -0
- package/dist/bwserve.esm.js +290 -283
- package/dist/sri.json +54 -46
- package/docs/README.md +6 -3
- package/docs/app-patterns.md +7 -6
- package/docs/bitwrench-for-wasm.md +53 -54
- package/docs/bitwrench-mcp.md +2 -2
- package/docs/bitwrench-northstar-principles.md +406 -0
- package/docs/bitwrench-taco-schema-discussion.md +2 -2
- package/docs/bitwrench_api.md +191 -106
- package/docs/bitwrench_typescript_usage.md +5 -5
- package/docs/bw-attach.md +29 -75
- package/docs/bwserve.md +200 -168
- package/docs/cli.md +36 -12
- package/docs/component-cheatsheet.md +2 -2
- package/docs/component-library.md +4 -4
- package/docs/component-lifecycle.md +234 -0
- package/docs/drift-lint.md +268 -0
- package/docs/framework-translation-table.md +4 -4
- package/docs/llm-bitwrench-guide.md +60 -50
- package/docs/routing.md +11 -13
- package/docs/state-management.md +110 -109
- package/docs/taco-format.md +13 -14
- package/docs/theming.md +13 -3
- package/docs/thinking-in-bitwrench.md +858 -983
- package/docs/tutorial-bwserve.md +37 -36
- package/docs/tutorial-embedded.md +10 -21
- package/docs/tutorial-website.md +2 -2
- package/package.json +38 -7
- package/readme.html +262 -160
- package/src/bitwrench-bccl-entry.js +2 -2
- package/src/bitwrench-bccl.js +346 -185
- package/src/bitwrench-code-edit.js +16 -5
- package/src/bitwrench-color-utils.js +117 -181
- package/src/bitwrench-file-ops.js +2 -2
- package/src/bitwrench-lean.js +4 -3
- package/src/bitwrench-router.js +5 -2
- package/src/bitwrench-styles.js +420 -504
- package/src/bitwrench-util-color.js +240 -0
- package/src/bitwrench-util-css.js +1 -0
- package/src/bitwrench-utils.js +4 -0
- package/src/bitwrench.d.ts +70 -73
- package/src/bitwrench.h +5 -0
- package/src/bitwrench.js +1939 -933
- package/src/bwserve/attach.js +0 -1
- package/src/bwserve/bwclient.js +172 -32
- package/src/bwserve/bwshell.js +0 -4
- package/src/bwserve/client.js +59 -220
- package/src/bwserve/index.js +59 -26
- package/src/bwserve.d.ts +157 -0
- package/src/bwserve.h +5 -0
- package/src/cli/attach.js +12 -75
- package/src/cli/convert.js +2 -2
- package/src/cli/serve.js +37 -35
- package/src/generate-css.js +1 -1
- package/src/mcp/knowledge.js +4 -4
- package/src/mcp/live.js +21 -13
- package/src/mcp/tools.js +0 -1
- package/src/version.js +3 -7
package/docs/tutorial-bwserve.md
CHANGED
|
@@ -25,7 +25,7 @@ import bwserve from 'bitwrench/bwserve';
|
|
|
25
25
|
var app = bwserve.create({ port: 7902, title: 'My Dashboard' });
|
|
26
26
|
|
|
27
27
|
app.page('/', function(client) {
|
|
28
|
-
client.
|
|
28
|
+
client.mount('#app', { t: 'h1', c: 'Hello from the server!' });
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
app.listen();
|
|
@@ -49,14 +49,14 @@ app.page('/', function(client) {
|
|
|
49
49
|
var count = 0;
|
|
50
50
|
|
|
51
51
|
// Render initial UI
|
|
52
|
-
client.
|
|
52
|
+
client.mount('#app', {
|
|
53
53
|
t: 'div', c: [
|
|
54
54
|
{ t: 'h1', c: 'Counter' },
|
|
55
55
|
{ t: 'div', a: { id: 'count', style: 'font-size: 3rem; text-align: center' }, c: '0' },
|
|
56
56
|
{ t: 'div', a: { style: 'text-align: center; margin-top: 1rem' }, c: [
|
|
57
|
-
{ t: 'button', a: {
|
|
58
|
-
{ t: 'button', a: {
|
|
59
|
-
{ t: 'button', a: {
|
|
57
|
+
{ t: 'button', a: { class: 'bw_act_decrement bw_bccl_btn bw_secondary' }, c: '-1' },
|
|
58
|
+
{ t: 'button', a: { class: 'bw_act_increment bw_bccl_btn bw_primary', style: 'margin-left: 0.5rem' }, c: '+1' },
|
|
59
|
+
{ t: 'button', a: { class: 'bw_act_reset bw_bccl_btn', style: 'margin-left: 0.5rem' }, c: 'Reset' }
|
|
60
60
|
]}
|
|
61
61
|
]
|
|
62
62
|
});
|
|
@@ -64,25 +64,25 @@ app.page('/', function(client) {
|
|
|
64
64
|
// Handle button clicks
|
|
65
65
|
client.on('increment', function() {
|
|
66
66
|
count++;
|
|
67
|
-
client.patch('count', String(count));
|
|
67
|
+
client.patch('count', { text: String(count) });
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
client.on('decrement', function() {
|
|
71
71
|
count--;
|
|
72
|
-
client.patch('count', String(count));
|
|
72
|
+
client.patch('count', { text: String(count) });
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
client.on('reset', function() {
|
|
76
76
|
count = 0;
|
|
77
|
-
client.patch('count', '0');
|
|
77
|
+
client.patch('count', { text: '0' });
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
Key concepts:
|
|
83
|
-
- `
|
|
83
|
+
- `class: 'bw_act_increment'` on the button tells the client to POST `{action: "increment"}` when clicked
|
|
84
84
|
- `client.on('increment', fn)` registers a server-side handler for that action
|
|
85
|
-
- `client.patch('count', '0')` sends an SSE message that updates the element with `id="count"`
|
|
85
|
+
- `client.patch('count', { text: '0' })` sends an SSE message that updates the element with `id="count"` using a discriminated fields object
|
|
86
86
|
|
|
87
87
|
## Step 3: Add live metrics
|
|
88
88
|
|
|
@@ -101,15 +101,15 @@ app.page('/', function(client) {
|
|
|
101
101
|
t: 'div', a: { style: 'margin-top: 2rem' }, c: [
|
|
102
102
|
{ t: 'h2', c: 'Live Metrics' },
|
|
103
103
|
{ t: 'div', a: { style: 'display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem' }, c: [
|
|
104
|
-
{ t: 'div', a: { class: '
|
|
104
|
+
{ t: 'div', a: { class: 'bw_bccl_card' }, c: [
|
|
105
105
|
{ t: 'div', a: { style: 'color: #666; font-size: 0.85rem' }, c: 'Uptime' },
|
|
106
106
|
{ t: 'div', a: { id: 'uptime', style: 'font-size: 1.5rem; font-weight: 700' }, c: '0s' }
|
|
107
107
|
]},
|
|
108
|
-
{ t: 'div', a: { class: '
|
|
108
|
+
{ t: 'div', a: { class: 'bw_bccl_card' }, c: [
|
|
109
109
|
{ t: 'div', a: { style: 'color: #666; font-size: 0.85rem' }, c: 'Memory' },
|
|
110
110
|
{ t: 'div', a: { id: 'memory', style: 'font-size: 1.5rem; font-weight: 700' }, c: '--' }
|
|
111
111
|
]},
|
|
112
|
-
{ t: 'div', a: { class: '
|
|
112
|
+
{ t: 'div', a: { class: 'bw_bccl_card' }, c: [
|
|
113
113
|
{ t: 'div', a: { style: 'color: #666; font-size: 0.85rem' }, c: 'Requests' },
|
|
114
114
|
{ t: 'div', a: { id: 'requests', style: 'font-size: 1.5rem; font-weight: 700' }, c: '0' }
|
|
115
115
|
]}
|
|
@@ -123,16 +123,16 @@ app.page('/', function(client) {
|
|
|
123
123
|
var mem = Math.round(process.memoryUsage().heapUsed / 1024 / 1024);
|
|
124
124
|
|
|
125
125
|
client.batch(
|
|
126
|
-
{ type: 'patch',
|
|
127
|
-
{ type: 'patch',
|
|
128
|
-
{ type: 'patch',
|
|
126
|
+
{ type: 'patch', ref: 'uptime', text: uptime + 's', v: 1 },
|
|
127
|
+
{ type: 'patch', ref: 'memory', text: mem + ' MB', v: 1 },
|
|
128
|
+
{ type: 'patch', ref: 'requests', text: String(requestCount), v: 1 }
|
|
129
129
|
);
|
|
130
130
|
}, 2000);
|
|
131
131
|
|
|
132
132
|
// Track actions as requests
|
|
133
|
-
client.on('increment', function() { count++; requestCount++; client.patch('count', String(count)); });
|
|
134
|
-
client.on('decrement', function() { count--; requestCount++; client.patch('count', String(count)); });
|
|
135
|
-
client.on('reset', function() { count = 0; requestCount++; client.patch('count', '0'); });
|
|
133
|
+
client.on('increment', function() { count++; requestCount++; client.patch('count', { text: String(count) }); });
|
|
134
|
+
client.on('decrement', function() { count--; requestCount++; client.patch('count', { text: String(count) }); });
|
|
135
|
+
client.on('reset', function() { count = 0; requestCount++; client.patch('count', { text: '0' }); });
|
|
136
136
|
|
|
137
137
|
// Clean up when client disconnects
|
|
138
138
|
client.on('disconnect', function() {
|
|
@@ -169,7 +169,7 @@ Append a scrolling log that records every action:
|
|
|
169
169
|
// In each handler:
|
|
170
170
|
client.on('increment', function() {
|
|
171
171
|
count++; requestCount++;
|
|
172
|
-
client.patch('count', String(count));
|
|
172
|
+
client.patch('count', { text: String(count) });
|
|
173
173
|
logEvent('increment → ' + count);
|
|
174
174
|
});
|
|
175
175
|
```
|
|
@@ -194,7 +194,7 @@ Add a second page:
|
|
|
194
194
|
|
|
195
195
|
```javascript
|
|
196
196
|
app.page('/settings', function(client) {
|
|
197
|
-
client.
|
|
197
|
+
client.mount('#app', {
|
|
198
198
|
t: 'div', c: [
|
|
199
199
|
{ t: 'h1', c: 'Settings' },
|
|
200
200
|
{ t: 'a', a: { href: '/' }, c: 'Back to Dashboard' },
|
|
@@ -215,37 +215,38 @@ Browser Server (Node.js)
|
|
|
215
215
|
| <── HTML shell (bitwrench + SSE) |
|
|
216
216
|
| |
|
|
217
217
|
| GET /events/:id (SSE) |
|
|
218
|
-
| <── {type:'
|
|
219
|
-
|
|
|
218
|
+
| <── {type:'mount', ref:'#app', |
|
|
219
|
+
| taco: {t:'div', c:[...]}, |
|
|
220
|
+
| v:1} |
|
|
220
221
|
| |
|
|
221
222
|
| User clicks [+1] button |
|
|
222
223
|
| POST /action/:id |
|
|
223
224
|
| {action:'increment', data:{}} ──> |
|
|
224
225
|
| | count++
|
|
225
226
|
| <── {type:'patch', |
|
|
226
|
-
|
|
|
227
|
-
|
|
|
227
|
+
| ref:'count', |
|
|
228
|
+
| text:'1', v:1} |
|
|
228
229
|
| |
|
|
229
230
|
| (every 2s) |
|
|
230
231
|
| <── {type:'batch', ops:[ |
|
|
231
|
-
| {type:'patch',
|
|
232
|
-
| {type:'patch',
|
|
233
|
-
| ]}
|
|
232
|
+
| {type:'patch',ref:'uptime'} |
|
|
233
|
+
| {type:'patch',ref:'memory'} |
|
|
234
|
+
| ], v:1} |
|
|
234
235
|
```
|
|
235
236
|
|
|
236
237
|
## Protocol messages
|
|
237
238
|
|
|
238
239
|
| Type | Method | What it does |
|
|
239
240
|
|------|--------|-------------|
|
|
240
|
-
| `
|
|
241
|
-
| `patch` | `client.patch(
|
|
242
|
-
| `append` | `client.append(
|
|
243
|
-
| `remove` | `client.remove(
|
|
241
|
+
| `mount` | `client.mount(ref, taco)` | Mount TACO tree into element |
|
|
242
|
+
| `patch` | `client.patch(ref, fields)` | Update element via discriminated fields (`text`, `attrs`, `css`, etc.) |
|
|
243
|
+
| `append` | `client.append(ref, taco)` | Add child element |
|
|
244
|
+
| `remove` | `client.remove(ref)` | Remove element from DOM |
|
|
244
245
|
| `batch` | `client.batch(op1, op2, ...)` | Multiple ops in one frame |
|
|
245
246
|
| `message` | `client.message(level, text)` | Show notification |
|
|
246
|
-
| `call` | `client.call(name, ...args)` | Invoke
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
| `call` | `client.call(name, ...args)` | Invoke built-in client-side function |
|
|
248
|
+
|
|
249
|
+
All messages are stamped `v: 1`.
|
|
249
250
|
|
|
250
251
|
### Screenshots
|
|
251
252
|
|
|
@@ -256,7 +257,7 @@ The server can capture what the browser is displaying:
|
|
|
256
257
|
var app = create({ port: 7902, allowScreenshot: true });
|
|
257
258
|
|
|
258
259
|
app.page('/', function(client) {
|
|
259
|
-
client.
|
|
260
|
+
client.mount('#app', myDashboard);
|
|
260
261
|
|
|
261
262
|
client.on('capture', async function() {
|
|
262
263
|
// Capture the full page as PNG
|
|
@@ -45,11 +45,11 @@ Copy the embedded C headers into your project:
|
|
|
45
45
|
```
|
|
46
46
|
my_project/
|
|
47
47
|
my_project.ino
|
|
48
|
-
bitwrench.h
|
|
49
|
-
bwserve.h
|
|
48
|
+
bitwrench.h <- from embedded_c/
|
|
49
|
+
bwserve.h <- from embedded_c/
|
|
50
50
|
data/
|
|
51
|
-
index.html
|
|
52
|
-
bitwrench.umd.min.js.gz
|
|
51
|
+
index.html <- the dashboard page
|
|
52
|
+
bitwrench.umd.min.js.gz <- gzip -k dist/bitwrench.umd.min.js
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
### With PlatformIO
|
|
@@ -64,7 +64,7 @@ data/
|
|
|
64
64
|
bitwrench.umd.min.js.gz
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
Store the gzipped file on flash (~
|
|
67
|
+
Store the gzipped file on flash (~45KB instead of ~169KB). ESPAsyncWebServer
|
|
68
68
|
serves `.gz` files transparently -- the browser decompresses automatically.
|
|
69
69
|
|
|
70
70
|
## Step 2: Write the Arduino sketch
|
|
@@ -206,20 +206,9 @@ Create `data/index.html`:
|
|
|
206
206
|
if (raw.charAt(0) === 'r') raw = raw.slice(1).replace(/'/g, '"');
|
|
207
207
|
try { var msg = JSON.parse(raw); } catch(x) { return; }
|
|
208
208
|
|
|
209
|
-
|
|
210
|
-
msg.ops.forEach(applyOp);
|
|
211
|
-
} else {
|
|
212
|
-
applyOp(msg);
|
|
213
|
-
}
|
|
209
|
+
bw.apply(msg);
|
|
214
210
|
};
|
|
215
211
|
|
|
216
|
-
function applyOp(op) {
|
|
217
|
-
if (op.type === 'patch') {
|
|
218
|
-
var el = document.getElementById(op.target);
|
|
219
|
-
if (el) el.textContent = op.content;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
212
|
function sendCmd(cmd) {
|
|
224
213
|
fetch('/api/command', {
|
|
225
214
|
method: 'POST',
|
|
@@ -232,7 +221,7 @@ Create `data/index.html`:
|
|
|
232
221
|
</html>
|
|
233
222
|
```
|
|
234
223
|
|
|
235
|
-
This page is ~2KB. With bitwrench.umd.min.js.gz (~
|
|
224
|
+
This page is ~2KB. With bitwrench.umd.min.js.gz (~45KB), the total SPIFFS usage is ~47KB out of 1.5MB available. ESPAsyncWebServer serves `.gz` files transparently -- the browser decompresses automatically.
|
|
236
225
|
|
|
237
226
|
## Step 4: Upload and test
|
|
238
227
|
|
|
@@ -261,8 +250,8 @@ Same protocol, same macros, simulated sensors. Copy the pattern to your real ske
|
|
|
261
250
|
| Item | Size |
|
|
262
251
|
|------|------|
|
|
263
252
|
| Dashboard HTML | ~2 KB |
|
|
264
|
-
| bitwrench.umd.min.js.gz | ~
|
|
265
|
-
| **Total SPIFFS** | **~
|
|
253
|
+
| bitwrench.umd.min.js.gz | ~45 KB |
|
|
254
|
+
| **Total SPIFFS** | **~47 KB** |
|
|
266
255
|
| ESP32 SPIFFS partition | 1.5 MB |
|
|
267
256
|
| Free heap (runtime) | ~240 KB |
|
|
268
257
|
| SSE frame per update | ~200 bytes |
|
|
@@ -274,7 +263,7 @@ serves `.gz` files transparently for the matching uncompressed filename.
|
|
|
274
263
|
|
|
275
264
|
The C macros produce strings like:
|
|
276
265
|
```
|
|
277
|
-
r{'type':'patch','
|
|
266
|
+
r{'v':1,'type':'patch','ref':'val-temp','text':'23.5 C'}
|
|
278
267
|
```
|
|
279
268
|
|
|
280
269
|
The `r` prefix tells the browser parser to convert single quotes to double quotes before `JSON.parse()`. This avoids escaping double quotes in C string literals — a major ergonomic win.
|
package/docs/tutorial-website.md
CHANGED
|
@@ -94,7 +94,7 @@ var features = bw.makeFeatureGrid({
|
|
|
94
94
|
features: [
|
|
95
95
|
{ icon: 'bolt', title: 'Fast', desc: 'No build step, no virtual DOM. Just objects and functions.' },
|
|
96
96
|
{ icon: 'shield', title: 'Reliable', desc: '100% test coverage. Works in IE11 through modern browsers.' },
|
|
97
|
-
{ icon: 'code', title: 'Simple', desc: 'One file, ~
|
|
97
|
+
{ icon: 'code', title: 'Simple', desc: 'One file, ~45KB gzipped. Zero dependencies. Learn in an afternoon.' }
|
|
98
98
|
]
|
|
99
99
|
});
|
|
100
100
|
```
|
|
@@ -219,7 +219,7 @@ Use `bw.css()` for page-specific styles:
|
|
|
219
219
|
|
|
220
220
|
```javascript
|
|
221
221
|
bw.injectCSS(bw.css({
|
|
222
|
-
'.brand .
|
|
222
|
+
'.brand .bw_bccl_hero': {
|
|
223
223
|
'text-align': 'center',
|
|
224
224
|
'background': 'linear-gradient(135deg, #2563eb 0%, #7c3aed 100%)',
|
|
225
225
|
'color': '#fff',
|
package/package.json
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bitwrench",
|
|
3
|
-
"version": "2.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "Zero-dependency JavaScript UI library. Describe UI as plain objects (TACO), render to DOM or HTML strings. Theming, components, pub/sub, server-driven UI (bwserve). No build step.",
|
|
5
5
|
"main": "./dist/bitwrench.umd.js",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/deftio/bitwrench.git"
|
|
9
9
|
},
|
|
10
10
|
"keywords": [
|
|
11
|
-
"javascript
|
|
11
|
+
"javascript",
|
|
12
|
+
"UI",
|
|
13
|
+
"DOM",
|
|
14
|
+
"utilities",
|
|
15
|
+
"components",
|
|
16
|
+
"theming",
|
|
17
|
+
"SSE",
|
|
18
|
+
"server-driven-ui",
|
|
19
|
+
"no-build",
|
|
20
|
+
"embedded"
|
|
12
21
|
],
|
|
13
22
|
"author": "manu a. chatterjee <deftio@deftio.com> (https://deftio.com/)",
|
|
14
23
|
"license": "BSD-2-Clause",
|
|
@@ -38,9 +47,24 @@
|
|
|
38
47
|
"default": "./dist/bitwrench-bccl.umd.js"
|
|
39
48
|
},
|
|
40
49
|
"./bwserve": {
|
|
50
|
+
"types": "./dist/bwserve.d.ts",
|
|
41
51
|
"import": "./dist/bwserve.esm.js",
|
|
42
52
|
"require": "./dist/bwserve.cjs.js"
|
|
43
53
|
},
|
|
54
|
+
"./util-css": {
|
|
55
|
+
"import": "./dist/bitwrench-util-css.esm.js",
|
|
56
|
+
"require": "./dist/bitwrench-util-css.cjs.js",
|
|
57
|
+
"default": "./dist/bitwrench-util-css.umd.js"
|
|
58
|
+
},
|
|
59
|
+
"./code-edit": {
|
|
60
|
+
"import": "./dist/bitwrench-code-edit.esm.js",
|
|
61
|
+
"require": "./dist/bitwrench-code-edit.cjs.js",
|
|
62
|
+
"default": "./dist/bitwrench-code-edit.umd.js"
|
|
63
|
+
},
|
|
64
|
+
"./debug": {
|
|
65
|
+
"require": "./dist/bitwrench-debug.js",
|
|
66
|
+
"default": "./dist/bitwrench-debug.js"
|
|
67
|
+
},
|
|
44
68
|
"./mcp": {
|
|
45
69
|
"import": "./src/mcp/server.js"
|
|
46
70
|
}
|
|
@@ -97,17 +121,20 @@
|
|
|
97
121
|
"uglifyjs": "^2.4.11"
|
|
98
122
|
},
|
|
99
123
|
"scripts": {
|
|
124
|
+
"prepare": "cp tools/hooks/pre-push .git/hooks/pre-push 2>/dev/null && chmod +x .git/hooks/pre-push 2>/dev/null || true",
|
|
100
125
|
"generate-version": "node tools/generate-version.cjs",
|
|
101
126
|
"prebuild": "npm run generate-version && npm run lint",
|
|
102
127
|
"build": "rollup --config && npm run build:css && npm run build:types && npm run build:metrics && npm run build:builds",
|
|
103
|
-
"build:types": "cp src/bitwrench.d.ts dist/bitwrench.d.ts",
|
|
128
|
+
"build:types": "cp src/bitwrench.d.ts dist/bitwrench.d.ts && cp src/bwserve.d.ts dist/bwserve.d.ts",
|
|
104
129
|
"build:css": "node src/generate-css.js",
|
|
105
130
|
"build:readme": "node tools/build-readme.js",
|
|
106
131
|
"build:watch": "rollup --config --watch",
|
|
107
132
|
"update_rm": "echo 'DEPRECATED: use build:index instead'",
|
|
108
133
|
"cleanbuild": "npm run clean && npm run build && npm run build:generated",
|
|
109
134
|
"oldtest": "./node_modules/mocha/bin/mocha test/bitwrench_test.js --reporter spec",
|
|
110
|
-
"test": "c8 --reporter=text --reporter=json-summary mocha ./test/bitwrench_ci.js ./test/bitwrench_test_coverage.js ./test/bitwrench_test_pubsub.js ./test/bitwrench_test_theme.js ./test/bitwrench_test_nodemap.js ./test/bitwrench_test_components.js ./test/bitwrench_test_coverage_gaps.js ./test/
|
|
135
|
+
"test": "c8 --reporter=text --reporter=json-summary mocha ./test/bitwrench_ci.js ./test/bitwrench_test_coverage.js ./test/bitwrench_test_pubsub.js ./test/bitwrench_test_theme.js ./test/bitwrench_test_nodemap.js ./test/bitwrench_test_components.js ./test/bitwrench_test_coverage_gaps.js ./test/bitwrench_test_code_edit.js ./test/bitwrench_test_html_page.js ./test/bitwrench_test_util_css.js ./test/bitwrench_test_handle.js ./test/bitwrench_test_debug.js ./test/bitwrench_test_router.js ./test/bitwrench_test_new_apis.js ./test/bitwrench_test_mcp_transport.js ./test/bitwrench_test_mcp_server.js ./test/bitwrench_test_mcp_tools.js ./test/bitwrench_test_mcp_knowledge.js ./test/bitwrench_test_mcp_live.js ./test/bitwrench_test_bwserve.js ./test/bitwrench_test_attach.js ./test/bitwrench_test_serve.js -r jsdom-global/register --exit && npm run test:bundles",
|
|
136
|
+
"posttest": "node tools/drift-lint.js",
|
|
137
|
+
"test:bundles": "mocha ./test/bitwrench_test_bundles.js -r jsdom-global/register --exit",
|
|
111
138
|
"test:bwserve": "mocha ./test/bitwrench_test_bwserve.js -r jsdom-global/register",
|
|
112
139
|
"test:attach": "mocha ./test/bitwrench_test_attach.js -r jsdom-global/register",
|
|
113
140
|
"test:serve": "mocha ./test/bitwrench_test_serve.js -r jsdom-global/register --exit",
|
|
@@ -117,7 +144,9 @@
|
|
|
117
144
|
"test:all-unit": "c8 --reporter=text mocha './test/bitwrench_test*.js' -r jsdom-global/",
|
|
118
145
|
"testkarma": "./node_modules/karma/bin/karma start karma.conf.js",
|
|
119
146
|
"clean": "rm -rf dist/* bitwrench*.tgz",
|
|
120
|
-
"lint": "./node_modules/.bin/eslint src/
|
|
147
|
+
"lint": "./node_modules/.bin/eslint src/",
|
|
148
|
+
"lint:drift": "node tools/drift-lint.js",
|
|
149
|
+
"postbuild": "npm run lint:drift",
|
|
121
150
|
"serve": "node server.js",
|
|
122
151
|
"dev": "npm run build && npm run serve",
|
|
123
152
|
"instrument-bw": "echo 'deprecated: use c8 instead'",
|
|
@@ -131,7 +160,9 @@
|
|
|
131
160
|
"test:html-page": "mocha ./test/bitwrench_test_html_page.js -r jsdom-global/register",
|
|
132
161
|
"test:mcp": "mocha ./test/bitwrench_test_mcp_transport.js ./test/bitwrench_test_mcp_server.js ./test/bitwrench_test_mcp_tools.js ./test/bitwrench_test_mcp_knowledge.js -r jsdom-global/register --exit",
|
|
133
162
|
"test:mcp:e2e": "mocha ./test/bitwrench_test_mcp_e2e.js --exit --timeout 15000",
|
|
163
|
+
"test:spec21": "mocha \"dev/test_v2.1/*.spec.js\" -r jsdom-global/register --exit",
|
|
134
164
|
"test:e2e": "playwright test",
|
|
165
|
+
"test:e2e:docker": "bash tools/e2e-docker.sh",
|
|
135
166
|
"test:e2e:headed": "playwright test --headed",
|
|
136
167
|
"test:e2e:debug": "playwright test --debug",
|
|
137
168
|
"test:examples": "playwright test tests/examples.spec.js",
|
|
@@ -145,7 +176,7 @@
|
|
|
145
176
|
"release": "node tools/release.js",
|
|
146
177
|
"start-release": "node tools/start-release.js"
|
|
147
178
|
},
|
|
148
|
-
"homepage": "https://deftio.github.
|
|
179
|
+
"homepage": "https://deftio.github.io/bitwrench/pages",
|
|
149
180
|
"overrides": {
|
|
150
181
|
"mocha": {
|
|
151
182
|
"serialize-javascript": "^7.0.3",
|