@bamboocss/vite 1.33.0 → 1.34.1

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/index.cjs CHANGED
@@ -2559,7 +2559,7 @@ const bamboocss = (options = {}) => {
2559
2559
  reason: entry.reason
2560
2560
  });
2561
2561
  }
2562
- if (result.code.includes("cssLeaf(")) survivors.push({
2562
+ if ((ctx.config.leafFallback ?? true) && result.code.includes("cssLeaf(")) survivors.push({
2563
2563
  file: filePath,
2564
2564
  line: lineAt(result.code, result.code.indexOf("cssLeaf(")),
2565
2565
  name: "cssLeaf",
@@ -2584,7 +2584,10 @@ const bamboocss = (options = {}) => {
2584
2584
  byFile.set(entry.file, list);
2585
2585
  }
2586
2586
  const named = (e) => e.reason === "runtime-binding" || e.reason === "fold-failed" ? e.name : `${e.name}()`;
2587
- const detail = Array.from(byFile.entries()).map(([file, entries]) => [` ${file}`, ...entries.map((e) => ` ${e.line}: ${named(e)} — ${e.reason}`)].join("\n")).join("\n");
2587
+ const detail = (0, _bamboocss_shared.truncateList)(Array.from(byFile.entries(), ([file, entries]) => [` ${file}`, ...entries.map((e) => ` ${e.line}: ${named(e)} — ${e.reason}`)].join("\n")), {
2588
+ unit: "file",
2589
+ separator: "\n"
2590
+ });
2588
2591
  const threw = survivors.some((entry) => entry.reason === "fold-failed");
2589
2592
  throw new Error(`bamboocss: ${survivors.length} call(s) could not be folded, and \`failOnUnfolded\` is on.\n\n${detail}\n\n` + (threw ? "`fold-failed` is a module the fold threw on — see the error logged for it above. Nothing was established about its calls either way, so it cannot support the guarantee this option makes.\n\n" : "") + "Each one keeps `styled-system/css` in the bundle, so the engine cannot be dropped however many other calls folded. Make the values static, move the variation into a `cva` variant, or generate them with `staticCss` — or set `failOnUnfolded: false` to accept the runtime.");
2590
2593
  }
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import MagicString from "magic-string";
6
6
  import { dirname, relative, resolve } from "node:path";
7
7
  import { Node, SyntaxKind, VariableDeclarationKind } from "ts-morph";
8
8
  import { Recipes, classFormatter } from "@bamboocss/core";
9
- import { compact, createCssUncached, createMergeCss, getRecipeClassNames, getRecipeIdentity, getSlotCompoundVariant, memo, withoutSpace } from "@bamboocss/shared";
9
+ import { compact, createCssUncached, createMergeCss, getRecipeClassNames, getRecipeIdentity, getSlotCompoundVariant, memo, truncateList, withoutSpace } from "@bamboocss/shared";
10
10
  //#region src/css.ts
11
11
  /**
12
12
  * What a project imports to get the stylesheet.
@@ -2532,7 +2532,7 @@ const bamboocss = (options = {}) => {
2532
2532
  reason: entry.reason
2533
2533
  });
2534
2534
  }
2535
- if (result.code.includes("cssLeaf(")) survivors.push({
2535
+ if ((ctx.config.leafFallback ?? true) && result.code.includes("cssLeaf(")) survivors.push({
2536
2536
  file: filePath,
2537
2537
  line: lineAt(result.code, result.code.indexOf("cssLeaf(")),
2538
2538
  name: "cssLeaf",
@@ -2557,7 +2557,10 @@ const bamboocss = (options = {}) => {
2557
2557
  byFile.set(entry.file, list);
2558
2558
  }
2559
2559
  const named = (e) => e.reason === "runtime-binding" || e.reason === "fold-failed" ? e.name : `${e.name}()`;
2560
- const detail = Array.from(byFile.entries()).map(([file, entries]) => [` ${file}`, ...entries.map((e) => ` ${e.line}: ${named(e)} — ${e.reason}`)].join("\n")).join("\n");
2560
+ const detail = truncateList(Array.from(byFile.entries(), ([file, entries]) => [` ${file}`, ...entries.map((e) => ` ${e.line}: ${named(e)} — ${e.reason}`)].join("\n")), {
2561
+ unit: "file",
2562
+ separator: "\n"
2563
+ });
2561
2564
  const threw = survivors.some((entry) => entry.reason === "fold-failed");
2562
2565
  throw new Error(`bamboocss: ${survivors.length} call(s) could not be folded, and \`failOnUnfolded\` is on.\n\n${detail}\n\n` + (threw ? "`fold-failed` is a module the fold threw on — see the error logged for it above. Nothing was established about its calls either way, so it cannot support the guarantee this option makes.\n\n" : "") + "Each one keeps `styled-system/css` in the bundle, so the engine cannot be dropped however many other calls folded. Make the values static, move the variation into a `cva` variant, or generate them with `staticCss` — or set `failOnUnfolded: false` to accept the runtime.");
2563
2566
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/vite",
3
- "version": "1.33.0",
3
+ "version": "1.34.1",
4
4
  "description": "Vite integration for Bamboo CSS",
5
5
  "homepage": "https://bamboocss.com",
6
6
  "license": "MIT",
@@ -37,18 +37,18 @@
37
37
  "dependencies": {
38
38
  "magic-string": "0.30.21",
39
39
  "ts-morph": "28.0.0",
40
- "@bamboocss/config": "1.33.0",
41
- "@bamboocss/core": "1.33.0",
42
- "@bamboocss/extractor": "1.33.0",
43
- "@bamboocss/shared": "1.33.0",
44
- "@bamboocss/logger": "1.33.0",
45
- "@bamboocss/node": "1.33.0",
46
- "@bamboocss/types": "1.33.0"
40
+ "@bamboocss/config": "1.34.1",
41
+ "@bamboocss/extractor": "1.34.1",
42
+ "@bamboocss/core": "1.34.1",
43
+ "@bamboocss/node": "1.34.1",
44
+ "@bamboocss/logger": "1.34.1",
45
+ "@bamboocss/types": "1.34.1",
46
+ "@bamboocss/shared": "1.34.1"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@jridgewell/trace-mapping": "^0.3.31",
50
50
  "vite": "7.2.6",
51
- "@bamboocss/fixture": "1.33.0"
51
+ "@bamboocss/fixture": "1.34.1"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "vite": ">=5"