@barefootjs/cli 0.19.1 → 0.20.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/dist/docs/core/advanced/error-codes.md +38 -0
- package/dist/index.js +325 -60
- package/package.json +4 -4
|
@@ -163,6 +163,44 @@ const byPrice = (a, b) => a.price - b.price
|
|
|
163
163
|
))}
|
|
164
164
|
```
|
|
165
165
|
|
|
166
|
+
#### Host rich-typed prop method calls (#2273)
|
|
167
|
+
|
|
168
|
+
**Trigger:** A method call on a prop provably typed as a built-in host rich
|
|
169
|
+
type — `Date`, `Map`, `Set`, `WeakMap`, `WeakSet`, `URL`, `URLSearchParams`,
|
|
170
|
+
`RegExp`, `Promise`, `Error`, `Symbol`, `BigInt`, `Function` — with no
|
|
171
|
+
catalogued lowering.
|
|
172
|
+
|
|
173
|
+
```tsx
|
|
174
|
+
// ❌ BF021 — Date.prototype.toISOString has no catalogued lowering
|
|
175
|
+
function Post({ createdAt }: { createdAt: Date }) {
|
|
176
|
+
return <div>{createdAt.toISOString()}</div>
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
The receiver's type must be provable from the component's declared props
|
|
181
|
+
(destructured prop, `props.x` member chain, loop item field, `Date | null`
|
|
182
|
+
union) — an untyped, generic, or call-result receiver (`d().toISOString()`
|
|
183
|
+
where `d` is a signal) has no evidence and is not flagged.
|
|
184
|
+
|
|
185
|
+
#### Workaround
|
|
186
|
+
|
|
187
|
+
```tsx
|
|
188
|
+
// ✅ Defer to the client
|
|
189
|
+
{/* @client */ createdAt.toISOString()}
|
|
190
|
+
|
|
191
|
+
// ✅ Or format in the backend and pass a string prop
|
|
192
|
+
function Post({ createdAt }: { createdAt: string }) {
|
|
193
|
+
return <div>{createdAt}</div>
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
The string-prop variant moves the formatting to where full language power
|
|
198
|
+
already exists — the backend that populates the template data (Go handler,
|
|
199
|
+
Rails controller, …) formats the `Date` and passes the finished string. Note
|
|
200
|
+
that a component-body local (`const iso = createdAt.toISOString()`) is NOT a
|
|
201
|
+
workaround: it lowers to a template variable whose value the template
|
|
202
|
+
backend cannot compute, and dies at render time the same way.
|
|
203
|
+
|
|
166
204
|
### BF023 — Missing Key in List
|
|
167
205
|
|
|
168
206
|
**Trigger:** `.map()` loop without `key` prop.
|
package/dist/index.js
CHANGED
|
@@ -7083,7 +7083,9 @@ function extractProps(param, ctx2) {
|
|
|
7083
7083
|
// the caller may omit the prop.
|
|
7084
7084
|
optional: !!member?.optional || !!element.initializer,
|
|
7085
7085
|
defaultValue: defaultValue2,
|
|
7086
|
-
defaultContainsArrow: defaultContainsArrow || void 0
|
|
7086
|
+
defaultContainsArrow: defaultContainsArrow || void 0,
|
|
7087
|
+
// Only aliased bindings carry the source key — see ParamInfo.sourceName.
|
|
7088
|
+
...sourcePropName !== localName2 && { sourceName: sourcePropName }
|
|
7087
7089
|
});
|
|
7088
7090
|
}
|
|
7089
7091
|
}
|
|
@@ -11843,7 +11845,8 @@ function collectLoopChildReactiveTexts(node, ctx2, loopParam, loopParamBindings)
|
|
|
11843
11845
|
if (!n.slotId) return;
|
|
11844
11846
|
const originFreeIds = freeIdsFromRefs(n.origin?.freeRefs);
|
|
11845
11847
|
const expanded = expandConstantForReactivity(n.expr, ctx2, originFreeIds);
|
|
11846
|
-
|
|
11848
|
+
const reactive = classifyReactivity(expanded.expr, ctx2, loopParam, loopParamBindings, expanded.freeIds).kind !== "none" || decideWrapFromAstFlags(n).wrap;
|
|
11849
|
+
if (!reactive) return;
|
|
11847
11850
|
texts.push({
|
|
11848
11851
|
slotId: n.slotId,
|
|
11849
11852
|
expression: expanded.expr,
|
|
@@ -18288,14 +18291,15 @@ function generateInitFunction(ir, ctx2, siblingComponents, localImportPrefixes)
|
|
|
18288
18291
|
const hydrateLine = emitRegistrationAndHydration(lines, ctx2, ir, graph, inlinability);
|
|
18289
18292
|
let generatedCode = rewritePropsObjectRef(lines.join("\n"), ctx2.propsObjectName);
|
|
18290
18293
|
generatedCode += "\n" + hydrateLine;
|
|
18291
|
-
const allImportLines = resolveFinalImports(generatedCode, ir, localImportPrefixes);
|
|
18292
18294
|
const moduleConstantsCode = emitModuleLevelDeclarations(
|
|
18293
18295
|
classification.moduleLevelConstants,
|
|
18294
18296
|
classification.moduleLevelFunctions,
|
|
18295
18297
|
classification.moduleLevelSignals,
|
|
18296
18298
|
classification.moduleLevelMemos
|
|
18297
18299
|
);
|
|
18298
|
-
|
|
18300
|
+
const codeWithModuleConstants = generatedCode.replace(MODULE_CONSTANTS_PLACEHOLDER, () => moduleConstantsCode);
|
|
18301
|
+
const allImportLines = resolveFinalImports(codeWithModuleConstants, ir, localImportPrefixes);
|
|
18302
|
+
return codeWithModuleConstants.replace(IMPORT_PLACEHOLDER, () => allImportLines);
|
|
18299
18303
|
}
|
|
18300
18304
|
var init_generate_init = __esm({
|
|
18301
18305
|
"../jsx/src/ir-to-client-js/generate-init.ts"() {
|
|
@@ -19843,6 +19847,273 @@ var init_ssr_seed_plan = __esm({
|
|
|
19843
19847
|
}
|
|
19844
19848
|
});
|
|
19845
19849
|
|
|
19850
|
+
// ../jsx/src/rich-type-evidence.ts
|
|
19851
|
+
function baseTypeName(raw) {
|
|
19852
|
+
const idx = raw.indexOf("<");
|
|
19853
|
+
return (idx === -1 ? raw : raw.slice(0, idx)).trim();
|
|
19854
|
+
}
|
|
19855
|
+
function isNullishArm(t) {
|
|
19856
|
+
if (t.kind === "primitive" && (t.primitive === "null" || t.primitive === "undefined")) return true;
|
|
19857
|
+
return t.kind === "unknown" && (t.raw === "null" || t.raw === "undefined");
|
|
19858
|
+
}
|
|
19859
|
+
function stripUnion(type2) {
|
|
19860
|
+
if (!type2 || type2.kind !== "union" || !type2.unionTypes) return type2;
|
|
19861
|
+
const nonNullish = type2.unionTypes.filter((t) => !isNullishArm(t));
|
|
19862
|
+
return nonNullish.length === 1 ? stripUnion(nonNullish[0]) : type2;
|
|
19863
|
+
}
|
|
19864
|
+
function derefNamedType(type2, meta) {
|
|
19865
|
+
if (type2.kind !== "interface") return type2;
|
|
19866
|
+
if (type2.properties && type2.properties.length > 0) return type2;
|
|
19867
|
+
const name2 = baseTypeName(type2.raw);
|
|
19868
|
+
const def = meta.typeDefinitions.find((d) => d.name === name2);
|
|
19869
|
+
if (!def?.properties) return type2;
|
|
19870
|
+
return { ...type2, properties: def.properties };
|
|
19871
|
+
}
|
|
19872
|
+
function lookupProperty(objType, propName, meta) {
|
|
19873
|
+
const stripped = stripUnion(objType);
|
|
19874
|
+
if (!stripped) return null;
|
|
19875
|
+
const deref = derefNamedType(stripped, meta);
|
|
19876
|
+
const prop = deref.properties?.find((p) => p.name === propName);
|
|
19877
|
+
return prop ? stripUnion(prop.type) : null;
|
|
19878
|
+
}
|
|
19879
|
+
function resolveReceiverType(expr, meta, bindings) {
|
|
19880
|
+
if (expr.kind === "identifier") {
|
|
19881
|
+
if (bindings.has(expr.name)) return stripUnion(bindings.get(expr.name) ?? null);
|
|
19882
|
+
if (meta.propsObjectName !== null) {
|
|
19883
|
+
return expr.name === meta.propsObjectName ? stripUnion(meta.propsType) : null;
|
|
19884
|
+
}
|
|
19885
|
+
const param = meta.propsParams.find((p) => p.name === expr.name && !p.isRest);
|
|
19886
|
+
if (!param) return null;
|
|
19887
|
+
return lookupProperty(meta.propsType, param.sourceName ?? param.name, meta);
|
|
19888
|
+
}
|
|
19889
|
+
if (expr.kind === "member" && !expr.computed) {
|
|
19890
|
+
const objType = resolveReceiverType(expr.object, meta, bindings);
|
|
19891
|
+
return lookupProperty(objType, expr.property, meta);
|
|
19892
|
+
}
|
|
19893
|
+
return null;
|
|
19894
|
+
}
|
|
19895
|
+
var HOST_RICH_TYPE_NAMES;
|
|
19896
|
+
var init_rich_type_evidence = __esm({
|
|
19897
|
+
"../jsx/src/rich-type-evidence.ts"() {
|
|
19898
|
+
"use strict";
|
|
19899
|
+
HOST_RICH_TYPE_NAMES = /* @__PURE__ */ new Set([
|
|
19900
|
+
"Date",
|
|
19901
|
+
"Map",
|
|
19902
|
+
"Set",
|
|
19903
|
+
"WeakMap",
|
|
19904
|
+
"WeakSet",
|
|
19905
|
+
"URL",
|
|
19906
|
+
"URLSearchParams",
|
|
19907
|
+
"RegExp",
|
|
19908
|
+
"Promise",
|
|
19909
|
+
"Error",
|
|
19910
|
+
"Symbol",
|
|
19911
|
+
"BigInt",
|
|
19912
|
+
"Function"
|
|
19913
|
+
]);
|
|
19914
|
+
}
|
|
19915
|
+
});
|
|
19916
|
+
|
|
19917
|
+
// ../jsx/src/rich-type-refusal.ts
|
|
19918
|
+
function checkRichTypeMethodCalls(root2, metadata, errors) {
|
|
19919
|
+
if (!metadata.propsType) return;
|
|
19920
|
+
const matchers = prepareLoweringMatchers(metadata);
|
|
19921
|
+
const seen = /* @__PURE__ */ new Set();
|
|
19922
|
+
walkNode(root2, metadata, EMPTY_BINDINGS, matchers, errors, seen);
|
|
19923
|
+
}
|
|
19924
|
+
function isLoweringClaimed(matchers, callee, args2) {
|
|
19925
|
+
return matchers.some((m) => m(callee, args2) !== null);
|
|
19926
|
+
}
|
|
19927
|
+
function describeReceiverPath(expr) {
|
|
19928
|
+
if (expr.kind === "identifier") return expr.name;
|
|
19929
|
+
if (expr.kind === "member" && !expr.computed) return `${describeReceiverPath(expr.object)}.${expr.property}`;
|
|
19930
|
+
return "<expression>";
|
|
19931
|
+
}
|
|
19932
|
+
function receiverRootIsProp(expr, bindings) {
|
|
19933
|
+
let root2 = expr;
|
|
19934
|
+
while (root2.kind === "member" && !root2.computed) root2 = root2.object;
|
|
19935
|
+
return root2.kind === "identifier" && !bindings.has(root2.name);
|
|
19936
|
+
}
|
|
19937
|
+
function pushDiagnostic(errors, seen, loc, method2, receiverPath, isProp, typeName) {
|
|
19938
|
+
const key = `${loc.start.line}:${loc.start.column}:${receiverPath}.${method2}`;
|
|
19939
|
+
if (seen.has(key)) return;
|
|
19940
|
+
seen.add(key);
|
|
19941
|
+
const receiver = isProp ? `prop '${receiverPath}'` : `'${receiverPath}'`;
|
|
19942
|
+
errors.push({
|
|
19943
|
+
code: ErrorCodes.UNSUPPORTED_JSX_PATTERN,
|
|
19944
|
+
severity: "error",
|
|
19945
|
+
message: `Expression cannot be compiled to marked template: method '.${method2}()' on ${receiver} of host type '${typeName}' has no catalogued lowering.`,
|
|
19946
|
+
loc,
|
|
19947
|
+
suggestion: {
|
|
19948
|
+
message: "Add /* @client */ to evaluate this expression on the client only, or pre-compute the value server-side."
|
|
19949
|
+
}
|
|
19950
|
+
});
|
|
19951
|
+
}
|
|
19952
|
+
function checkExpr(expr, loc, meta, bindings, matchers, errors, seen) {
|
|
19953
|
+
const recurse = (e, b = bindings) => checkExpr(e, loc, meta, b, matchers, errors, seen);
|
|
19954
|
+
switch (expr.kind) {
|
|
19955
|
+
case "call": {
|
|
19956
|
+
if (expr.callee.kind === "member") {
|
|
19957
|
+
const receiverType = resolveReceiverType(expr.callee.object, meta, bindings);
|
|
19958
|
+
if (receiverType && receiverType.kind === "interface") {
|
|
19959
|
+
const typeName = baseTypeName(receiverType.raw);
|
|
19960
|
+
const inFileShadow = meta.typeDefinitions.some((d) => d.name === typeName);
|
|
19961
|
+
if (HOST_RICH_TYPE_NAMES.has(typeName) && !inFileShadow && !isLoweringClaimed(matchers, expr.callee, expr.args)) {
|
|
19962
|
+
pushDiagnostic(
|
|
19963
|
+
errors,
|
|
19964
|
+
seen,
|
|
19965
|
+
loc,
|
|
19966
|
+
expr.callee.property,
|
|
19967
|
+
describeReceiverPath(expr.callee.object),
|
|
19968
|
+
receiverRootIsProp(expr.callee.object, bindings),
|
|
19969
|
+
typeName
|
|
19970
|
+
);
|
|
19971
|
+
}
|
|
19972
|
+
}
|
|
19973
|
+
}
|
|
19974
|
+
recurse(expr.callee);
|
|
19975
|
+
for (const arg of expr.args) recurse(arg);
|
|
19976
|
+
break;
|
|
19977
|
+
}
|
|
19978
|
+
case "member":
|
|
19979
|
+
recurse(expr.object);
|
|
19980
|
+
break;
|
|
19981
|
+
case "index-access":
|
|
19982
|
+
recurse(expr.object);
|
|
19983
|
+
recurse(expr.index);
|
|
19984
|
+
break;
|
|
19985
|
+
case "binary":
|
|
19986
|
+
recurse(expr.left);
|
|
19987
|
+
recurse(expr.right);
|
|
19988
|
+
break;
|
|
19989
|
+
case "unary":
|
|
19990
|
+
recurse(expr.argument);
|
|
19991
|
+
break;
|
|
19992
|
+
case "conditional":
|
|
19993
|
+
recurse(expr.test);
|
|
19994
|
+
recurse(expr.consequent);
|
|
19995
|
+
recurse(expr.alternate);
|
|
19996
|
+
break;
|
|
19997
|
+
case "logical":
|
|
19998
|
+
recurse(expr.left);
|
|
19999
|
+
recurse(expr.right);
|
|
20000
|
+
break;
|
|
20001
|
+
case "template-literal":
|
|
20002
|
+
for (const part of expr.parts) if (part.type === "expression") recurse(part.expr);
|
|
20003
|
+
break;
|
|
20004
|
+
case "arrow": {
|
|
20005
|
+
const shadowed = new Map(bindings);
|
|
20006
|
+
for (const param of expr.params) shadowed.set(param, null);
|
|
20007
|
+
recurse(expr.body, shadowed);
|
|
20008
|
+
break;
|
|
20009
|
+
}
|
|
20010
|
+
case "array-literal":
|
|
20011
|
+
for (const el of expr.elements) recurse(el);
|
|
20012
|
+
break;
|
|
20013
|
+
case "object-literal":
|
|
20014
|
+
for (const prop of expr.properties) recurse(prop.value);
|
|
20015
|
+
break;
|
|
20016
|
+
case "array-method":
|
|
20017
|
+
recurse(expr.object);
|
|
20018
|
+
for (const arg of expr.args) recurse(arg);
|
|
20019
|
+
break;
|
|
20020
|
+
case "identifier":
|
|
20021
|
+
case "literal":
|
|
20022
|
+
case "regex":
|
|
20023
|
+
case "unsupported":
|
|
20024
|
+
break;
|
|
20025
|
+
}
|
|
20026
|
+
}
|
|
20027
|
+
function walkTemplateParts(parts, loc, meta, bindings, matchers, errors, seen) {
|
|
20028
|
+
for (const part of parts) {
|
|
20029
|
+
if (part.type === "ternary") {
|
|
20030
|
+
const trimmed = part.condition.trim();
|
|
20031
|
+
if (trimmed) checkExpr(parseExpression(trimmed), loc, meta, bindings, matchers, errors, seen);
|
|
20032
|
+
} else if (part.type === "lookup") {
|
|
20033
|
+
const trimmed = part.key.trim();
|
|
20034
|
+
if (trimmed) checkExpr(parseExpression(trimmed), loc, meta, bindings, matchers, errors, seen);
|
|
20035
|
+
}
|
|
20036
|
+
}
|
|
20037
|
+
}
|
|
20038
|
+
function walkAttrValue(value2, clientOnly, loc, meta, bindings, matchers, errors, seen) {
|
|
20039
|
+
if (clientOnly) return;
|
|
20040
|
+
if (value2.kind === "expression") {
|
|
20041
|
+
if (value2.parsed) checkExpr(value2.parsed, loc, meta, bindings, matchers, errors, seen);
|
|
20042
|
+
if (value2.parts) walkTemplateParts(value2.parts, loc, meta, bindings, matchers, errors, seen);
|
|
20043
|
+
} else if (value2.kind === "spread") {
|
|
20044
|
+
if (value2.parsed) checkExpr(value2.parsed, loc, meta, bindings, matchers, errors, seen);
|
|
20045
|
+
} else if (value2.kind === "template") {
|
|
20046
|
+
walkTemplateParts(value2.parts, loc, meta, bindings, matchers, errors, seen);
|
|
20047
|
+
}
|
|
20048
|
+
}
|
|
20049
|
+
function walkNode(node, meta, bindings, matchers, errors, seen) {
|
|
20050
|
+
if (node.type === "expression") {
|
|
20051
|
+
if (!node.clientOnly && node.parsed) checkExpr(node.parsed, node.loc, meta, bindings, matchers, errors, seen);
|
|
20052
|
+
} else if (node.type === "conditional") {
|
|
20053
|
+
if (!node.clientOnly && node.parsedCondition) checkExpr(node.parsedCondition, node.loc, meta, bindings, matchers, errors, seen);
|
|
20054
|
+
} else if (node.type === "if-statement") {
|
|
20055
|
+
if (node.parsedCondition) checkExpr(node.parsedCondition, node.loc, meta, bindings, matchers, errors, seen);
|
|
20056
|
+
}
|
|
20057
|
+
if (node.type === "element") {
|
|
20058
|
+
for (const attr of node.attrs) walkAttrValue(attr.value, attr.clientOnly, attr.loc, meta, bindings, matchers, errors, seen);
|
|
20059
|
+
} else if (node.type === "component") {
|
|
20060
|
+
for (const prop of node.props) walkAttrValue(prop.value, prop.clientOnly, prop.loc, meta, bindings, matchers, errors, seen);
|
|
20061
|
+
} else if (node.type === "provider") {
|
|
20062
|
+
walkAttrValue(node.valueProp.value, node.valueProp.clientOnly, node.valueProp.loc, meta, bindings, matchers, errors, seen);
|
|
20063
|
+
}
|
|
20064
|
+
switch (node.type) {
|
|
20065
|
+
case "element":
|
|
20066
|
+
case "component":
|
|
20067
|
+
case "fragment":
|
|
20068
|
+
case "provider":
|
|
20069
|
+
for (const child of node.children) walkNode(child, meta, bindings, matchers, errors, seen);
|
|
20070
|
+
break;
|
|
20071
|
+
case "async":
|
|
20072
|
+
walkNode(node.fallback, meta, bindings, matchers, errors, seen);
|
|
20073
|
+
for (const child of node.children) walkNode(child, meta, bindings, matchers, errors, seen);
|
|
20074
|
+
break;
|
|
20075
|
+
case "loop": {
|
|
20076
|
+
if (node.clientOnly) break;
|
|
20077
|
+
if (node.arrayParsed) checkExpr(node.arrayParsed, node.loc, meta, bindings, matchers, errors, seen);
|
|
20078
|
+
const loopBindings = new Map(bindings);
|
|
20079
|
+
const arrayType = node.arrayParsed ? resolveReceiverType(node.arrayParsed, meta, bindings) : null;
|
|
20080
|
+
loopBindings.set(node.param, arrayType?.kind === "array" ? arrayType.elementType ?? null : null);
|
|
20081
|
+
if (node.index) loopBindings.set(node.index, null);
|
|
20082
|
+
for (const child of node.children) walkNode(child, meta, loopBindings, matchers, errors, seen);
|
|
20083
|
+
if (node.childComponent) {
|
|
20084
|
+
for (const child of node.childComponent.children) walkNode(child, meta, loopBindings, matchers, errors, seen);
|
|
20085
|
+
}
|
|
20086
|
+
for (const nested of node.nestedComponents ?? []) {
|
|
20087
|
+
for (const child of nested.children) walkNode(child, meta, loopBindings, matchers, errors, seen);
|
|
20088
|
+
}
|
|
20089
|
+
for (const frag of node.flatMapCallback?.fragments ?? []) {
|
|
20090
|
+
walkNode(frag.ir, meta, loopBindings, matchers, errors, seen);
|
|
20091
|
+
}
|
|
20092
|
+
break;
|
|
20093
|
+
}
|
|
20094
|
+
case "conditional":
|
|
20095
|
+
if (node.clientOnly) break;
|
|
20096
|
+
walkNode(node.whenTrue, meta, bindings, matchers, errors, seen);
|
|
20097
|
+
walkNode(node.whenFalse, meta, bindings, matchers, errors, seen);
|
|
20098
|
+
break;
|
|
20099
|
+
case "if-statement":
|
|
20100
|
+
walkNode(node.consequent, meta, bindings, matchers, errors, seen);
|
|
20101
|
+
if (node.alternate) walkNode(node.alternate, meta, bindings, matchers, errors, seen);
|
|
20102
|
+
break;
|
|
20103
|
+
}
|
|
20104
|
+
}
|
|
20105
|
+
var EMPTY_BINDINGS;
|
|
20106
|
+
var init_rich_type_refusal = __esm({
|
|
20107
|
+
"../jsx/src/rich-type-refusal.ts"() {
|
|
20108
|
+
"use strict";
|
|
20109
|
+
init_expression_parser();
|
|
20110
|
+
init_lowering_registry();
|
|
20111
|
+
init_errors();
|
|
20112
|
+
init_rich_type_evidence();
|
|
20113
|
+
EMPTY_BINDINGS = /* @__PURE__ */ new Map();
|
|
20114
|
+
}
|
|
20115
|
+
});
|
|
20116
|
+
|
|
19846
20117
|
// ../jsx/src/compiler.ts
|
|
19847
20118
|
function mergeTemplateImports(lines) {
|
|
19848
20119
|
const result2 = [];
|
|
@@ -19899,6 +20170,7 @@ function compileMultipleComponents(source, filePath, componentNames, options2) {
|
|
|
19899
20170
|
errors: []
|
|
19900
20171
|
};
|
|
19901
20172
|
componentIR.metadata.clientAnalysis = analyzeClientNeeds(componentIR);
|
|
20173
|
+
checkRichTypeMethodCalls(componentIR.root, componentIR.metadata, errors);
|
|
19902
20174
|
if (options2.cssLayerPrefix) {
|
|
19903
20175
|
applyCssLayerPrefix(componentIR, options2.cssLayerPrefix);
|
|
19904
20176
|
}
|
|
@@ -20235,6 +20507,7 @@ function compileJSX(source, filePath, options2) {
|
|
|
20235
20507
|
errors: []
|
|
20236
20508
|
};
|
|
20237
20509
|
componentIR.metadata.clientAnalysis = analyzeClientNeeds(componentIR);
|
|
20510
|
+
checkRichTypeMethodCalls(componentIR.root, componentIR.metadata, errors);
|
|
20238
20511
|
if (ctx2.importedClientSignalNames.size > 0) {
|
|
20239
20512
|
const sources = /* @__PURE__ */ new Set();
|
|
20240
20513
|
for (const imp of ctx2.imports) {
|
|
@@ -20364,6 +20637,7 @@ var init_compiler = __esm({
|
|
|
20364
20637
|
init_preprocess_inline_jsx_callbacks();
|
|
20365
20638
|
init_ssr_defaults();
|
|
20366
20639
|
init_ssr_seed_plan();
|
|
20640
|
+
init_rich_type_refusal();
|
|
20367
20641
|
}
|
|
20368
20642
|
});
|
|
20369
20643
|
|
|
@@ -85412,9 +85686,9 @@ var init_WebSocketReadyStateEnum = __esm({
|
|
|
85412
85686
|
}
|
|
85413
85687
|
});
|
|
85414
85688
|
|
|
85415
|
-
// ../../node_modules/.bun/ws@8.21.
|
|
85689
|
+
// ../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/constants.js
|
|
85416
85690
|
var require_constants = __commonJS({
|
|
85417
|
-
"../../node_modules/.bun/ws@8.21.
|
|
85691
|
+
"../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/constants.js"(exports, module) {
|
|
85418
85692
|
"use strict";
|
|
85419
85693
|
var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
|
|
85420
85694
|
var hasBlob = typeof Blob !== "undefined";
|
|
@@ -85435,9 +85709,9 @@ var require_constants = __commonJS({
|
|
|
85435
85709
|
}
|
|
85436
85710
|
});
|
|
85437
85711
|
|
|
85438
|
-
// ../../node_modules/.bun/ws@8.21.
|
|
85712
|
+
// ../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/buffer-util.js
|
|
85439
85713
|
var require_buffer_util = __commonJS({
|
|
85440
|
-
"../../node_modules/.bun/ws@8.21.
|
|
85714
|
+
"../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/buffer-util.js"(exports, module) {
|
|
85441
85715
|
"use strict";
|
|
85442
85716
|
var { EMPTY_BUFFER } = require_constants();
|
|
85443
85717
|
var FastBuffer = Buffer[Symbol.species];
|
|
@@ -85510,9 +85784,9 @@ var require_buffer_util = __commonJS({
|
|
|
85510
85784
|
}
|
|
85511
85785
|
});
|
|
85512
85786
|
|
|
85513
|
-
// ../../node_modules/.bun/ws@8.21.
|
|
85787
|
+
// ../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/limiter.js
|
|
85514
85788
|
var require_limiter = __commonJS({
|
|
85515
|
-
"../../node_modules/.bun/ws@8.21.
|
|
85789
|
+
"../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/limiter.js"(exports, module) {
|
|
85516
85790
|
"use strict";
|
|
85517
85791
|
var kDone = Symbol("kDone");
|
|
85518
85792
|
var kRun = Symbol("kRun");
|
|
@@ -85560,9 +85834,9 @@ var require_limiter = __commonJS({
|
|
|
85560
85834
|
}
|
|
85561
85835
|
});
|
|
85562
85836
|
|
|
85563
|
-
// ../../node_modules/.bun/ws@8.21.
|
|
85837
|
+
// ../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/permessage-deflate.js
|
|
85564
85838
|
var require_permessage_deflate = __commonJS({
|
|
85565
|
-
"../../node_modules/.bun/ws@8.21.
|
|
85839
|
+
"../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/permessage-deflate.js"(exports, module) {
|
|
85566
85840
|
"use strict";
|
|
85567
85841
|
var zlib = __require("node:zlib");
|
|
85568
85842
|
var bufferUtil = require_buffer_util();
|
|
@@ -85943,9 +86217,9 @@ var require_permessage_deflate = __commonJS({
|
|
|
85943
86217
|
}
|
|
85944
86218
|
});
|
|
85945
86219
|
|
|
85946
|
-
// ../../node_modules/.bun/ws@8.21.
|
|
86220
|
+
// ../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/validation.js
|
|
85947
86221
|
var require_validation = __commonJS({
|
|
85948
|
-
"../../node_modules/.bun/ws@8.21.
|
|
86222
|
+
"../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/validation.js"(exports, module) {
|
|
85949
86223
|
"use strict";
|
|
85950
86224
|
var { isUtf8 } = __require("node:buffer");
|
|
85951
86225
|
var { hasBlob } = require_constants();
|
|
@@ -86144,9 +86418,9 @@ var require_validation = __commonJS({
|
|
|
86144
86418
|
}
|
|
86145
86419
|
});
|
|
86146
86420
|
|
|
86147
|
-
// ../../node_modules/.bun/ws@8.21.
|
|
86421
|
+
// ../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/receiver.js
|
|
86148
86422
|
var require_receiver = __commonJS({
|
|
86149
|
-
"../../node_modules/.bun/ws@8.21.
|
|
86423
|
+
"../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/receiver.js"(exports, module) {
|
|
86150
86424
|
"use strict";
|
|
86151
86425
|
var { Writable } = __require("node:stream");
|
|
86152
86426
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
@@ -86209,6 +86483,7 @@ var require_receiver = __commonJS({
|
|
|
86209
86483
|
this._opcode = 0;
|
|
86210
86484
|
this._totalPayloadLength = 0;
|
|
86211
86485
|
this._messageLength = 0;
|
|
86486
|
+
this._numFragments = 0;
|
|
86212
86487
|
this._fragments = [];
|
|
86213
86488
|
this._errored = false;
|
|
86214
86489
|
this._loop = false;
|
|
@@ -86559,23 +86834,23 @@ var require_receiver = __commonJS({
|
|
|
86559
86834
|
this.controlMessage(data2, cb);
|
|
86560
86835
|
return;
|
|
86561
86836
|
}
|
|
86837
|
+
if (this._maxFragments > 0 && ++this._numFragments > this._maxFragments) {
|
|
86838
|
+
const error2 = this.createError(
|
|
86839
|
+
RangeError,
|
|
86840
|
+
"Too many message fragments",
|
|
86841
|
+
false,
|
|
86842
|
+
1008,
|
|
86843
|
+
"WS_ERR_TOO_MANY_BUFFERED_PARTS"
|
|
86844
|
+
);
|
|
86845
|
+
cb(error2);
|
|
86846
|
+
return;
|
|
86847
|
+
}
|
|
86562
86848
|
if (this._compressed) {
|
|
86563
86849
|
this._state = INFLATING;
|
|
86564
86850
|
this.decompress(data2, cb);
|
|
86565
86851
|
return;
|
|
86566
86852
|
}
|
|
86567
86853
|
if (data2.length) {
|
|
86568
|
-
if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
|
|
86569
|
-
const error2 = this.createError(
|
|
86570
|
-
RangeError,
|
|
86571
|
-
"Too many message fragments",
|
|
86572
|
-
false,
|
|
86573
|
-
1008,
|
|
86574
|
-
"WS_ERR_TOO_MANY_BUFFERED_PARTS"
|
|
86575
|
-
);
|
|
86576
|
-
cb(error2);
|
|
86577
|
-
return;
|
|
86578
|
-
}
|
|
86579
86854
|
this._messageLength = this._totalPayloadLength;
|
|
86580
86855
|
this._fragments.push(data2);
|
|
86581
86856
|
}
|
|
@@ -86605,17 +86880,6 @@ var require_receiver = __commonJS({
|
|
|
86605
86880
|
cb(error2);
|
|
86606
86881
|
return;
|
|
86607
86882
|
}
|
|
86608
|
-
if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
|
|
86609
|
-
const error2 = this.createError(
|
|
86610
|
-
RangeError,
|
|
86611
|
-
"Too many message fragments",
|
|
86612
|
-
false,
|
|
86613
|
-
1008,
|
|
86614
|
-
"WS_ERR_TOO_MANY_BUFFERED_PARTS"
|
|
86615
|
-
);
|
|
86616
|
-
cb(error2);
|
|
86617
|
-
return;
|
|
86618
|
-
}
|
|
86619
86883
|
this._fragments.push(buf);
|
|
86620
86884
|
}
|
|
86621
86885
|
this.dataMessage(cb);
|
|
@@ -86638,6 +86902,7 @@ var require_receiver = __commonJS({
|
|
|
86638
86902
|
this._totalPayloadLength = 0;
|
|
86639
86903
|
this._messageLength = 0;
|
|
86640
86904
|
this._fragmented = 0;
|
|
86905
|
+
this._numFragments = 0;
|
|
86641
86906
|
this._fragments = [];
|
|
86642
86907
|
if (this._opcode === 2) {
|
|
86643
86908
|
let data2;
|
|
@@ -86776,9 +87041,9 @@ var require_receiver = __commonJS({
|
|
|
86776
87041
|
}
|
|
86777
87042
|
});
|
|
86778
87043
|
|
|
86779
|
-
// ../../node_modules/.bun/ws@8.21.
|
|
87044
|
+
// ../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/sender.js
|
|
86780
87045
|
var require_sender = __commonJS({
|
|
86781
|
-
"../../node_modules/.bun/ws@8.21.
|
|
87046
|
+
"../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/sender.js"(exports, module) {
|
|
86782
87047
|
"use strict";
|
|
86783
87048
|
var { Duplex } = __require("node:stream");
|
|
86784
87049
|
var { randomFillSync } = __require("node:crypto");
|
|
@@ -87269,9 +87534,9 @@ var require_sender = __commonJS({
|
|
|
87269
87534
|
}
|
|
87270
87535
|
});
|
|
87271
87536
|
|
|
87272
|
-
// ../../node_modules/.bun/ws@8.21.
|
|
87537
|
+
// ../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/event-target.js
|
|
87273
87538
|
var require_event_target = __commonJS({
|
|
87274
|
-
"../../node_modules/.bun/ws@8.21.
|
|
87539
|
+
"../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/event-target.js"(exports, module) {
|
|
87275
87540
|
"use strict";
|
|
87276
87541
|
var { kForOnEventAttribute, kListener } = require_constants();
|
|
87277
87542
|
var kCode = Symbol("kCode");
|
|
@@ -87498,9 +87763,9 @@ var require_event_target = __commonJS({
|
|
|
87498
87763
|
}
|
|
87499
87764
|
});
|
|
87500
87765
|
|
|
87501
|
-
// ../../node_modules/.bun/ws@8.21.
|
|
87766
|
+
// ../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/extension.js
|
|
87502
87767
|
var require_extension = __commonJS({
|
|
87503
|
-
"../../node_modules/.bun/ws@8.21.
|
|
87768
|
+
"../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/extension.js"(exports, module) {
|
|
87504
87769
|
"use strict";
|
|
87505
87770
|
var { tokenChars } = require_validation();
|
|
87506
87771
|
function push(dest, name2, elem) {
|
|
@@ -87651,9 +87916,9 @@ var require_extension = __commonJS({
|
|
|
87651
87916
|
}
|
|
87652
87917
|
});
|
|
87653
87918
|
|
|
87654
|
-
// ../../node_modules/.bun/ws@8.21.
|
|
87919
|
+
// ../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/websocket.js
|
|
87655
87920
|
var require_websocket = __commonJS({
|
|
87656
|
-
"../../node_modules/.bun/ws@8.21.
|
|
87921
|
+
"../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/websocket.js"(exports, module) {
|
|
87657
87922
|
"use strict";
|
|
87658
87923
|
var EventEmitter = __require("node:events");
|
|
87659
87924
|
var https = __require("node:https");
|
|
@@ -88138,8 +88403,8 @@ var require_websocket = __commonJS({
|
|
|
88138
88403
|
autoPong: true,
|
|
88139
88404
|
closeTimeout: CLOSE_TIMEOUT,
|
|
88140
88405
|
protocolVersion: protocolVersions[1],
|
|
88141
|
-
maxBufferedChunks:
|
|
88142
|
-
maxFragments:
|
|
88406
|
+
maxBufferedChunks: 256 * 1024,
|
|
88407
|
+
maxFragments: 16 * 1024,
|
|
88143
88408
|
maxPayload: 100 * 1024 * 1024,
|
|
88144
88409
|
skipUTF8Validation: false,
|
|
88145
88410
|
perMessageDeflate: true,
|
|
@@ -88547,9 +88812,9 @@ var require_websocket = __commonJS({
|
|
|
88547
88812
|
}
|
|
88548
88813
|
});
|
|
88549
88814
|
|
|
88550
|
-
// ../../node_modules/.bun/ws@8.21.
|
|
88815
|
+
// ../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/stream.js
|
|
88551
88816
|
var require_stream = __commonJS({
|
|
88552
|
-
"../../node_modules/.bun/ws@8.21.
|
|
88817
|
+
"../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/stream.js"(exports, module) {
|
|
88553
88818
|
"use strict";
|
|
88554
88819
|
var WebSocket3 = require_websocket();
|
|
88555
88820
|
var { Duplex } = __require("node:stream");
|
|
@@ -88645,9 +88910,9 @@ var require_stream = __commonJS({
|
|
|
88645
88910
|
}
|
|
88646
88911
|
});
|
|
88647
88912
|
|
|
88648
|
-
// ../../node_modules/.bun/ws@8.21.
|
|
88913
|
+
// ../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/subprotocol.js
|
|
88649
88914
|
var require_subprotocol = __commonJS({
|
|
88650
|
-
"../../node_modules/.bun/ws@8.21.
|
|
88915
|
+
"../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/subprotocol.js"(exports, module) {
|
|
88651
88916
|
"use strict";
|
|
88652
88917
|
var { tokenChars } = require_validation();
|
|
88653
88918
|
function parse(header) {
|
|
@@ -88690,9 +88955,9 @@ var require_subprotocol = __commonJS({
|
|
|
88690
88955
|
}
|
|
88691
88956
|
});
|
|
88692
88957
|
|
|
88693
|
-
// ../../node_modules/.bun/ws@8.21.
|
|
88958
|
+
// ../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/websocket-server.js
|
|
88694
88959
|
var require_websocket_server = __commonJS({
|
|
88695
|
-
"../../node_modules/.bun/ws@8.21.
|
|
88960
|
+
"../../node_modules/.bun/ws@8.21.1/node_modules/ws/lib/websocket-server.js"(exports, module) {
|
|
88696
88961
|
"use strict";
|
|
88697
88962
|
var EventEmitter = __require("node:events");
|
|
88698
88963
|
var http = __require("node:http");
|
|
@@ -88726,9 +88991,9 @@ var require_websocket_server = __commonJS({
|
|
|
88726
88991
|
* called
|
|
88727
88992
|
* @param {Function} [options.handleProtocols] A hook to handle protocols
|
|
88728
88993
|
* @param {String} [options.host] The hostname where to bind the server
|
|
88729
|
-
* @param {Number} [options.maxBufferedChunks=
|
|
88994
|
+
* @param {Number} [options.maxBufferedChunks=262144] The maximum number of
|
|
88730
88995
|
* buffered data chunks
|
|
88731
|
-
* @param {Number} [options.maxFragments=
|
|
88996
|
+
* @param {Number} [options.maxFragments=16384] The maximum number of message
|
|
88732
88997
|
* fragments
|
|
88733
88998
|
* @param {Number} [options.maxPayload=104857600] The maximum allowed message
|
|
88734
88999
|
* size
|
|
@@ -88751,8 +89016,8 @@ var require_websocket_server = __commonJS({
|
|
|
88751
89016
|
options2 = {
|
|
88752
89017
|
allowSynchronousEvents: true,
|
|
88753
89018
|
autoPong: true,
|
|
88754
|
-
maxBufferedChunks:
|
|
88755
|
-
maxFragments:
|
|
89019
|
+
maxBufferedChunks: 256 * 1024,
|
|
89020
|
+
maxFragments: 16 * 1024,
|
|
88756
89021
|
maxPayload: 100 * 1024 * 1024,
|
|
88757
89022
|
skipUTF8Validation: false,
|
|
88758
89023
|
perMessageDeflate: false,
|
|
@@ -89091,10 +89356,10 @@ var require_websocket_server = __commonJS({
|
|
|
89091
89356
|
}
|
|
89092
89357
|
});
|
|
89093
89358
|
|
|
89094
|
-
// ../../node_modules/.bun/ws@8.21.
|
|
89359
|
+
// ../../node_modules/.bun/ws@8.21.1/node_modules/ws/wrapper.mjs
|
|
89095
89360
|
var import_stream3, import_extension, import_permessage_deflate, import_receiver, import_sender, import_subprotocol, import_websocket, import_websocket_server, wrapper_default;
|
|
89096
89361
|
var init_wrapper = __esm({
|
|
89097
|
-
"../../node_modules/.bun/ws@8.21.
|
|
89362
|
+
"../../node_modules/.bun/ws@8.21.1/node_modules/ws/wrapper.mjs"() {
|
|
89098
89363
|
import_stream3 = __toESM(require_stream(), 1);
|
|
89099
89364
|
import_extension = __toESM(require_extension(), 1);
|
|
89100
89365
|
import_permessage_deflate = __toESM(require_permessage_deflate(), 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "CLI for agent-driven UI component discovery and scaffolding",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"esbuild": "^0.25.0",
|
|
31
31
|
"typescript": "^5.0.0",
|
|
32
|
-
"@barefootjs/client": "0.
|
|
33
|
-
"@barefootjs/shared": "0.
|
|
32
|
+
"@barefootjs/client": "0.20.0",
|
|
33
|
+
"@barefootjs/shared": "0.20.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@barefootjs/jsx": "0.
|
|
36
|
+
"@barefootjs/jsx": "0.20.0",
|
|
37
37
|
"@types/node": "^22.0.0",
|
|
38
38
|
"@happy-dom/global-registrator": "^20.0.11",
|
|
39
39
|
"happy-dom": "^20.0.11"
|