@barefootjs/cli 0.28.1 → 0.29.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 (2) hide show
  1. package/dist/index.js +18 -5
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -13947,7 +13947,7 @@ function emitTemplateCloneLines(template, indent) {
13947
13947
  ];
13948
13948
  }
13949
13949
  function emitLoopItemElementSetup(lines, opts) {
13950
- const { template, bodyIsMultiRoot, indent, singleRootLayout } = opts;
13950
+ const { template, bodyIsMultiRoot, indent, singleRootLayout, mountRow } = opts;
13951
13951
  const innerIndent = indent + " ";
13952
13952
  if (bodyIsMultiRoot) {
13953
13953
  lines.push(`${indent}let __el, __extras`);
@@ -13958,17 +13958,19 @@ function emitLoopItemElementSetup(lines, opts) {
13958
13958
  lines.push(ln);
13959
13959
  }
13960
13960
  lines.push(`${innerIndent}__el.__bfExtras = __extras`);
13961
+ if (mountRow) lines.push(`${innerIndent}mountRowRoot(__el)`);
13961
13962
  lines.push(`${indent}}`);
13962
13963
  return;
13963
13964
  }
13964
13965
  if (singleRootLayout === "inline") {
13965
13966
  const cloneExpr = emitTemplateCloneInline(template);
13966
- lines.push(`${indent}const __el = __existing ?? (() => { ${cloneExpr} })()`);
13967
+ const clone2 = `__existing ?? (() => { ${cloneExpr} })()`;
13968
+ lines.push(`${indent}const __el = ${mountRow ? `__existing ?? mountRowRoot((() => { ${cloneExpr} })())` : clone2}`);
13967
13969
  return;
13968
13970
  }
13969
- lines.push(`${indent}const __el = __existing ?? (() => {`);
13971
+ lines.push(`${indent}const __el = __existing ?? ${mountRow ? "mountRowRoot(" : ""}(() => {`);
13970
13972
  for (const ln of emitTemplateCloneLines(template, innerIndent)) lines.push(ln);
13971
- lines.push(`${indent}})()`);
13973
+ lines.push(`${indent}})()${mountRow ? ")" : ""}`);
13972
13974
  }
13973
13975
  function emitMultiRootTemplateCloneLines(template, indent, varEl, varExtras) {
13974
13976
  const isSvg = multiRootTemplateNeedsSvgWrap(template);
@@ -15293,6 +15295,8 @@ function isValueReferenceIdentifier(id2) {
15293
15295
  if ((ts13.isMethodDeclaration(parent2) || ts13.isGetAccessorDeclaration(parent2) || ts13.isSetAccessorDeclaration(parent2)) && parent2.name === id2) {
15294
15296
  return false;
15295
15297
  }
15298
+ if (ts13.isPropertyDeclaration(parent2) && parent2.name === id2) return false;
15299
+ if (ts13.isMetaProperty(parent2) && parent2.name === id2) return false;
15296
15300
  if (ts13.isVariableDeclaration(parent2) && parent2.name === id2) return false;
15297
15301
  if (ts13.isFunctionDeclaration(parent2) && parent2.name === id2) return false;
15298
15302
  if (ts13.isFunctionExpression(parent2) && parent2.name === id2) return false;
@@ -15466,6 +15470,11 @@ var init_imports = __esm({
15466
15470
  "registerTemplate",
15467
15471
  "initChild",
15468
15472
  "upsertChild",
15473
+ // Connects a template-clone loop row before the body's tail runs, so a child
15474
+ // that inits inside it resolves context against real ancestors rather than
15475
+ // falling through to the global store. The clone-root counterpart of the
15476
+ // mount point `createComponent` consumes for component-root rows.
15477
+ "mountRowRoot",
15469
15478
  "createPortal",
15470
15479
  "provideContext",
15471
15480
  "createContext",
@@ -20463,7 +20472,11 @@ function stringifyCompositeLoop(lines, plan) {
20463
20472
  template,
20464
20473
  bodyIsMultiRoot,
20465
20474
  indent: bodyIndent,
20466
- singleRootLayout: "multiline"
20475
+ singleRootLayout: "multiline",
20476
+ // Composite is exactly the variant that initialises something inside the
20477
+ // row — nested components, inner loops, or both — so it is exactly the
20478
+ // variant whose tail needs the row already connected.
20479
+ mountRow: true
20467
20480
  });
20468
20481
  emitComponentAndEventSetup(lines, bodyIndent, "__el", compsArr, eventsArr, loopParam, loopParamBindings, bodyIsMultiRoot);
20469
20482
  if (innerLoops.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barefootjs/cli",
3
- "version": "0.28.1",
3
+ "version": "0.29.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.28.1",
33
- "@barefootjs/shared": "0.28.1"
32
+ "@barefootjs/client": "0.29.0",
33
+ "@barefootjs/shared": "0.29.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@barefootjs/jsx": "0.28.1",
36
+ "@barefootjs/jsx": "0.29.0",
37
37
  "@types/node": "^22.0.0",
38
38
  "@happy-dom/global-registrator": "^20.0.11",
39
39
  "happy-dom": "^20.0.11"