@barefootjs/cli 0.18.1 → 0.18.3

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 +23 -3
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -7929,6 +7929,9 @@ function resolveFreeRefsInternal(node, env, visited) {
7929
7929
  }
7930
7930
  return out;
7931
7931
  }
7932
+ function isNameBound(name2, env) {
7933
+ return buildBindingMap(env).has(name2);
7934
+ }
7932
7935
  function resolveFreeRefs(node, env) {
7933
7936
  return resolveFreeRefsInternal(node, env, /* @__PURE__ */ new Set());
7934
7937
  }
@@ -8338,7 +8341,7 @@ function clientBuiltinTags(ctx2) {
8338
8341
  ctx2._clientBuiltinTags = map;
8339
8342
  return map;
8340
8343
  }
8341
- function isNameBound(ctx2, name2) {
8344
+ function isNameBound2(ctx2, name2) {
8342
8345
  const a = ctx2.analyzer;
8343
8346
  if (a.ambientGlobals.has(name2)) return true;
8344
8347
  if (a.localFunctions.some((f) => f.name === name2)) return true;
@@ -8371,7 +8374,7 @@ function dispatchClientBuiltin(tagName2, ctx2, diagNode, transformAsync, transfo
8371
8374
  const builtin = clientBuiltinTags(ctx2).get(tagName2);
8372
8375
  if (builtin === "Async") return transformAsync();
8373
8376
  if (builtin === "Region") return transformRegion();
8374
- if (isClientBuiltinName(tagName2) && !isNameBound(ctx2, tagName2)) {
8377
+ if (isClientBuiltinName(tagName2) && !isNameBound2(ctx2, tagName2)) {
8375
8378
  reportBuiltinNotImported(ctx2, diagNode, tagName2);
8376
8379
  }
8377
8380
  return null;
@@ -8700,6 +8703,13 @@ function transformChildren(children2, ctx2) {
8700
8703
  }
8701
8704
  return result2;
8702
8705
  }
8706
+ function isRenderNothingLiteral(expr, ctx2) {
8707
+ let e = expr;
8708
+ while (ts11.isParenthesizedExpression(e) || ts11.isAsExpression(e) || ts11.isSatisfiesExpression(e) || ts11.isNonNullExpression(e)) {
8709
+ e = e.expression;
8710
+ }
8711
+ return e.kind === ts11.SyntaxKind.NullKeyword || e.kind === ts11.SyntaxKind.TrueKeyword || e.kind === ts11.SyntaxKind.FalseKeyword || ts11.isIdentifier(e) && e.text === "undefined" && !isNameBound("undefined", makeBindingEnv(ctx2));
8712
+ }
8703
8713
  function transformText(node, ctx2) {
8704
8714
  const text = node.text.replace(/\s+/g, " ");
8705
8715
  if (text.trim() === "") {
@@ -8719,6 +8729,9 @@ function transformExpression(node, ctx2) {
8719
8729
  }
8720
8730
  function transformExpressionInner(expr, ctx2, node, isClientOnly) {
8721
8731
  expr = tryDesugarInterleaveTaggedTemplate(expr, ctx2);
8732
+ if (isRenderNothingLiteral(expr, ctx2)) {
8733
+ return null;
8734
+ }
8722
8735
  checkBareSignalOrMemoIdentifier(expr, ctx2);
8723
8736
  if (ts11.isIdentifier(expr)) {
8724
8737
  const jsxNode = ctx2.analyzer.jsxConstants.get(expr.text);
@@ -28984,7 +28997,14 @@ export default createConfig({
28984
28997
  devDependencies: {
28985
28998
  ...UNOCSS_DEV_DEPENDENCIES,
28986
28999
  "@barefootjs/cli": "latest",
28987
- "@cloudflare/workers-types": "^4.20250101.0",
29000
+ // Must track wrangler's `peerOptional @cloudflare/workers-types`
29001
+ // MAJOR: wrangler 4.108.0 moved it to `^5.20260706.1`, and with the
29002
+ // v4 pin every fresh scaffold's `npm install` fails with ERESOLVE
29003
+ // (bun tolerates the mismatch; npm does not — CI's smoke-publish
29004
+ // caught it). v5 still ships a root `index.d.ts`, so the generated
29005
+ // tsconfig's `"types": ["@cloudflare/workers-types", ...]` entry
29006
+ // resolves unchanged.
29007
+ "@cloudflare/workers-types": "^5.20260706.1",
28988
29008
  // `@barefootjs/test` powers `renderToTest()` — the canonical
28989
29009
  // millisecond IR test the docs (and `bf gen test`) point new users
28990
29010
  // at. Without it the scaffold's `test` script is a no-op and any
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barefootjs/cli",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
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.18.1",
33
- "@barefootjs/shared": "0.18.1"
32
+ "@barefootjs/client": "0.18.3",
33
+ "@barefootjs/shared": "0.18.3"
34
34
  },
35
35
  "devDependencies": {
36
- "@barefootjs/jsx": "0.18.1",
36
+ "@barefootjs/jsx": "0.18.3",
37
37
  "@types/node": "^22.0.0",
38
38
  "@happy-dom/global-registrator": "^20.0.11",
39
39
  "happy-dom": "^20.0.11"