kerfjs 5.0.0-beta.4 → 5.0.0-beta.40
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/CHANGELOG.md +344 -116
- package/README.md +43 -23
- package/ai/cursorrules +87 -48
- package/ai/manifest.json +10 -7
- package/ai/skill.md +101 -67
- package/dist/actions.js +2 -2
- package/dist/actions.js.map +1 -1
- package/dist/array-signal.js +1 -1
- package/dist/async.js +22 -19
- package/dist/async.js.map +1 -1
- package/dist/attach.js +3 -1
- package/dist/attach.js.map +1 -1
- package/dist/{chunk-QIP723L4.js → chunk-5WRGJZV6.js} +3 -2
- package/dist/chunk-5WRGJZV6.js.map +1 -0
- package/dist/{chunk-GY4XV2UV.js → chunk-BDX3R4OM.js} +3 -2
- package/dist/chunk-BDX3R4OM.js.map +1 -0
- package/dist/{chunk-HW7KSM2Y.js → chunk-CEQMZYLR.js} +1 -1
- package/dist/{chunk-HW7KSM2Y.js.map → chunk-CEQMZYLR.js.map} +1 -1
- package/dist/{chunk-SVATPF5R.js → chunk-DLY444MN.js} +121 -49
- package/dist/chunk-DLY444MN.js.map +1 -0
- package/dist/{chunk-KPXIOG2C.js → chunk-E5R5GNKE.js} +14 -4
- package/dist/chunk-E5R5GNKE.js.map +1 -0
- package/dist/{chunk-LVH3GC6B.js → chunk-ELXVRKY2.js} +3 -3
- package/dist/chunk-ELXVRKY2.js.map +1 -0
- package/dist/{chunk-ZDCJZCNO.js → chunk-JRKE6XEK.js} +37 -16
- package/dist/chunk-JRKE6XEK.js.map +1 -0
- package/dist/{chunk-UZJ6I4T6.js → chunk-MK42GLPV.js} +1 -1
- package/dist/chunk-MK42GLPV.js.map +1 -0
- package/dist/{chunk-V46JKE44.js → chunk-WKIPLNVO.js} +1 -1
- package/dist/chunk-WKIPLNVO.js.map +1 -0
- package/dist/{chunk-U6FK33SG.js → chunk-Y2FOYPBV.js} +2 -2
- package/dist/{chunk-U6FK33SG.js.map → chunk-Y2FOYPBV.js.map} +1 -1
- package/dist/{chunk-KZJXHFIB.js → chunk-ZOIERTUW.js} +3 -3
- package/dist/chunk-ZOIERTUW.js.map +1 -0
- package/dist/dev.js +64 -17
- package/dist/dev.js.map +1 -1
- package/dist/html.js +5 -4
- package/dist/html.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +23 -14
- package/dist/index.js.map +1 -1
- package/dist/jsx-runtime.d.ts +12 -5
- package/dist/jsx-runtime.js +1 -1
- package/dist/list.js +43 -14
- package/dist/list.js.map +1 -1
- package/dist/overlay.js +99 -32
- package/dist/overlay.js.map +1 -1
- package/dist/remount.js +2 -2
- package/dist/router.js +33 -10
- package/dist/router.js.map +1 -1
- package/dist/scope.js +5 -4
- package/dist/scope.js.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/timing.js +1 -1
- package/dist/timing.js.map +1 -1
- package/llms.txt +6 -2
- package/package.json +32 -7
- package/setup/cli.mjs +90 -0
- package/setup/index.d.mts +37 -0
- package/setup/index.mjs +1347 -0
- package/setup/jsonc.mjs +201 -0
- package/setup/state.schema.json +56 -0
- package/dist/chunk-GY4XV2UV.js.map +0 -1
- package/dist/chunk-KPXIOG2C.js.map +0 -1
- package/dist/chunk-KZJXHFIB.js.map +0 -1
- package/dist/chunk-LVH3GC6B.js.map +0 -1
- package/dist/chunk-QIP723L4.js.map +0 -1
- package/dist/chunk-SVATPF5R.js.map +0 -1
- package/dist/chunk-UZJ6I4T6.js.map +0 -1
- package/dist/chunk-V46JKE44.js.map +0 -1
- package/dist/chunk-ZDCJZCNO.js.map +0 -1
package/dist/dev.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { truncateRowHtml } from './chunk-
|
|
2
|
-
import { LIST_MARKER_PREFIX } from './chunk-
|
|
3
|
-
import { installDevHooks } from './chunk-
|
|
4
|
-
export { clearDevHooks, devHooks, installDevHooks } from './chunk-
|
|
1
|
+
import { truncateRowHtml } from './chunk-WKIPLNVO.js';
|
|
2
|
+
import { LIST_MARKER_PREFIX } from './chunk-BDX3R4OM.js';
|
|
3
|
+
import { installDevHooks } from './chunk-CEQMZYLR.js';
|
|
4
|
+
export { clearDevHooks, devHooks, installDevHooks } from './chunk-CEQMZYLR.js';
|
|
5
5
|
import { signal, Signal } from '@preact/signals-core';
|
|
6
6
|
|
|
7
7
|
// src/dev-warn-config.ts
|
|
@@ -24,7 +24,10 @@ function applyWarningOptions(options) {
|
|
|
24
24
|
for (const [key, value] of Object.entries(options)) {
|
|
25
25
|
const envName = ENV_NAME[key];
|
|
26
26
|
if (envName === void 0 || value === void 0) continue;
|
|
27
|
-
overrides.set(
|
|
27
|
+
overrides.set(
|
|
28
|
+
envName,
|
|
29
|
+
value === false ? false : value === true ? "1" : value
|
|
30
|
+
);
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
function devFlag(envName) {
|
|
@@ -157,18 +160,38 @@ function findListInvariantViolations(rootEl, bindings, expectedCounts) {
|
|
|
157
160
|
const { marker, liveParent, items } = binding;
|
|
158
161
|
const expected = expectedCounts?.get(id);
|
|
159
162
|
if (expected !== void 0 && items.length !== expected) {
|
|
160
|
-
problems.push(
|
|
163
|
+
problems.push(
|
|
164
|
+
describe(
|
|
165
|
+
id,
|
|
166
|
+
`holds ${items.length} row(s) but its source has ${expected} \u2014 the reconcile dropped or duplicated rows`
|
|
167
|
+
)
|
|
168
|
+
);
|
|
161
169
|
}
|
|
162
170
|
if (!rootEl.contains(marker)) {
|
|
163
|
-
problems.push(
|
|
171
|
+
problems.push(
|
|
172
|
+
describe(
|
|
173
|
+
id,
|
|
174
|
+
"its marker comment is no longer inside the mount root, so every future reconcile would mutate a detached tree"
|
|
175
|
+
)
|
|
176
|
+
);
|
|
164
177
|
continue;
|
|
165
178
|
}
|
|
166
179
|
if (marker.data !== `${LIST_MARKER_PREFIX}${id}`) {
|
|
167
|
-
problems.push(
|
|
180
|
+
problems.push(
|
|
181
|
+
describe(
|
|
182
|
+
id,
|
|
183
|
+
`its marker reads '${marker.data}' \u2014 the id is carried by a different marker node, so this binding describes another list`
|
|
184
|
+
)
|
|
185
|
+
);
|
|
168
186
|
}
|
|
169
187
|
const markerIndex = indexIn(liveParent, marker);
|
|
170
188
|
if (markerIndex === -1) {
|
|
171
|
-
problems.push(
|
|
189
|
+
problems.push(
|
|
190
|
+
describe(
|
|
191
|
+
id,
|
|
192
|
+
"its marker is not a child of the parent the binding records"
|
|
193
|
+
)
|
|
194
|
+
);
|
|
172
195
|
continue;
|
|
173
196
|
}
|
|
174
197
|
let previousIndex = markerIndex;
|
|
@@ -177,28 +200,46 @@ function findListInvariantViolations(rootEl, bindings, expectedCounts) {
|
|
|
177
200
|
const node = items[i].node;
|
|
178
201
|
const index = indexIn(liveParent, node);
|
|
179
202
|
if (index === -1) {
|
|
180
|
-
problems.push(
|
|
203
|
+
problems.push(
|
|
204
|
+
describe(
|
|
205
|
+
id,
|
|
206
|
+
`bound row ${i} is not a child of the list's parent (<${liveParent.tagName.toLowerCase()}>)${node.isConnected ? " \u2014 it is attached elsewhere in the document" : " \u2014 it is detached"}`
|
|
207
|
+
)
|
|
208
|
+
);
|
|
181
209
|
continue;
|
|
182
210
|
}
|
|
183
211
|
if (index <= previousIndex) {
|
|
184
|
-
problems.push(
|
|
212
|
+
problems.push(
|
|
213
|
+
describe(
|
|
214
|
+
id,
|
|
215
|
+
`bound row ${i} appears at child position ${index}, which is not after the previous one (${previousIndex}) \u2014 the rows are out of order or have crossed the marker`
|
|
216
|
+
)
|
|
217
|
+
);
|
|
185
218
|
}
|
|
186
219
|
previousIndex = index;
|
|
187
220
|
if (first === -1) first = index;
|
|
188
221
|
const owner = owners.get(node);
|
|
189
222
|
if (owner !== void 0) {
|
|
190
|
-
problems.push(
|
|
223
|
+
problems.push(
|
|
224
|
+
describe(id, `bound row ${i} is also claimed by list '${owner}'`)
|
|
225
|
+
);
|
|
191
226
|
} else {
|
|
192
227
|
owners.set(node, id);
|
|
193
228
|
}
|
|
194
229
|
}
|
|
195
|
-
if (first !== -1)
|
|
230
|
+
if (first !== -1)
|
|
231
|
+
spans.push({ id, parent: liveParent, from: first, to: previousIndex });
|
|
196
232
|
}
|
|
197
233
|
for (let a = 0; a < spans.length; a++) {
|
|
198
234
|
for (let b = a + 1; b < spans.length; b++) {
|
|
199
235
|
if (spans[a].parent !== spans[b].parent) continue;
|
|
200
236
|
if (spans[a].from <= spans[b].to && spans[b].from <= spans[a].to) {
|
|
201
|
-
problems.push(
|
|
237
|
+
problems.push(
|
|
238
|
+
describe(
|
|
239
|
+
spans[a].id,
|
|
240
|
+
`its rows (child positions ${spans[a].from}-${spans[a].to}) overlap those of list '${spans[b].id}' (${spans[b].from}-${spans[b].to}) in the same parent`
|
|
241
|
+
)
|
|
242
|
+
);
|
|
202
243
|
}
|
|
203
244
|
}
|
|
204
245
|
}
|
|
@@ -207,7 +248,11 @@ function findListInvariantViolations(rootEl, bindings, expectedCounts) {
|
|
|
207
248
|
function maybeCheckListInvariants(rootEl, bindings, expectedCounts) {
|
|
208
249
|
const level = mode();
|
|
209
250
|
if (level === "off") return;
|
|
210
|
-
const problems = findListInvariantViolations(
|
|
251
|
+
const problems = findListInvariantViolations(
|
|
252
|
+
rootEl,
|
|
253
|
+
bindings,
|
|
254
|
+
expectedCounts
|
|
255
|
+
);
|
|
211
256
|
if (problems.length === 0) return;
|
|
212
257
|
const report = `${problems.join("\n")}
|
|
213
258
|
This is a kerf bug, not an application one \u2014 please report it with the markup that produced it. Set KERF_DEV_INVARIANTS=1 to warn instead of throw, or unset it to disable these checks.`;
|
|
@@ -277,12 +322,14 @@ function patchAddEventListenerOnce() {
|
|
|
277
322
|
};
|
|
278
323
|
}
|
|
279
324
|
function hasMarkedListener(el) {
|
|
280
|
-
if (el[LISTENER_MARKER] === true)
|
|
325
|
+
if (el[LISTENER_MARKER] === true)
|
|
326
|
+
return true;
|
|
281
327
|
const stack = [];
|
|
282
328
|
for (let i = 0; i < el.children.length; i++) stack.push(el.children[i]);
|
|
283
329
|
while (stack.length > 0) {
|
|
284
330
|
const cur = stack.pop();
|
|
285
|
-
if (cur[LISTENER_MARKER] === true)
|
|
331
|
+
if (cur[LISTENER_MARKER] === true)
|
|
332
|
+
return true;
|
|
286
333
|
for (let i = 0; i < cur.children.length; i++) stack.push(cur.children[i]);
|
|
287
334
|
}
|
|
288
335
|
return false;
|