@bamboocss/parser 1.31.0 → 1.32.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/index.cjs CHANGED
@@ -912,7 +912,8 @@ var ParserResult = class {
912
912
  setCss(result) {
913
913
  this.css.add(this.append(Object.assign({ type: "css" }, result)));
914
914
  const encoder = this.encoder;
915
- const data = result.data.some(Array.isArray) ? result.data.flatMap((obj) => Array.isArray(obj) ? obj : [obj]) : result.data;
915
+ if (result.data.some(Array.isArray)) throw new _bamboocss_shared.BambooError("INVALID_STYLE_ARGUMENT", "An array is not a style argument.", { hint: "Spread it instead, e.g. css(...styles) rather than css(styles)." });
916
+ const data = result.data;
916
917
  const unresolved = findUnresolvedStyles(result, "atomic").filter((entry) => entry.reason === "unenumerable-keys");
917
918
  if (unresolved.length) this.unresolved.push(...unresolved);
918
919
  data.forEach((obj) => encoder.processAtomic(obj));
package/dist/index.mjs CHANGED
@@ -911,7 +911,8 @@ var ParserResult = class {
911
911
  setCss(result) {
912
912
  this.css.add(this.append(Object.assign({ type: "css" }, result)));
913
913
  const encoder = this.encoder;
914
- const data = result.data.some(Array.isArray) ? result.data.flatMap((obj) => Array.isArray(obj) ? obj : [obj]) : result.data;
914
+ if (result.data.some(Array.isArray)) throw new BambooError("INVALID_STYLE_ARGUMENT", "An array is not a style argument.", { hint: "Spread it instead, e.g. css(...styles) rather than css(styles)." });
915
+ const data = result.data;
915
916
  const unresolved = findUnresolvedStyles(result, "atomic").filter((entry) => entry.reason === "unenumerable-keys");
916
917
  if (unresolved.length) this.unresolved.push(...unresolved);
917
918
  data.forEach((obj) => encoder.processAtomic(obj));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/parser",
3
- "version": "1.31.0",
3
+ "version": "1.32.0",
4
4
  "description": "The static parser for bamboo css",
5
5
  "homepage": "https://bamboocss.com",
6
6
  "license": "MIT",
@@ -34,17 +34,17 @@
34
34
  "dependencies": {
35
35
  "ts-morph": "28.0.0",
36
36
  "ts-pattern": "5.9.0",
37
- "@bamboocss/config": "^1.31.0",
38
- "@bamboocss/core": "^1.31.0",
39
- "@bamboocss/extractor": "1.31.0",
40
- "@bamboocss/logger": "1.31.0",
41
- "@bamboocss/shared": "1.31.0",
42
- "@bamboocss/types": "1.31.0"
37
+ "@bamboocss/config": "^1.32.0",
38
+ "@bamboocss/core": "^1.32.0",
39
+ "@bamboocss/extractor": "1.32.0",
40
+ "@bamboocss/logger": "1.32.0",
41
+ "@bamboocss/shared": "1.32.0",
42
+ "@bamboocss/types": "1.32.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@bamboocss/generator": "1.31.0",
46
- "@bamboocss/plugin-svelte": "1.31.0",
47
- "@bamboocss/plugin-vue": "1.31.0"
45
+ "@bamboocss/generator": "1.32.0",
46
+ "@bamboocss/plugin-svelte": "1.32.0",
47
+ "@bamboocss/plugin-vue": "1.32.0"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "tsdown src/index.ts --format=esm,cjs --dts",