@bamboocss/node 1.59.0 → 1.60.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.d.cts CHANGED
@@ -45,9 +45,30 @@ interface FoldSelection {
45
45
  }
46
46
  interface FoldCxArgument {
47
47
  span: FoldSpan;
48
- kind: 'string' | 'ignored' | 'array' | 'expression' | 'spread';
48
+ /**
49
+ * `binding` is a module-scope `const` initialised with a `css()` or pattern call, here or in a
50
+ * module this one imports it from. `when` is `test && value`, `choose` is `test ? a : b`.
51
+ */
52
+ kind: 'string' | 'ignored' | 'array' | 'binding' | 'when' | 'choose' | 'expression' | 'spread';
49
53
  value?: string;
54
+ /** For `array`, its elements; for `when`, the value; for `choose`, the consequent then the alternate. */
50
55
  elements?: FoldCxArgument[];
56
+ /**
57
+ * For `when` and `choose`: the condition, as written. Never one reading a Bamboo binding or a
58
+ * recipe, since the fold copies it into what it writes.
59
+ */
60
+ test?: FoldSpan;
61
+ /** For a `binding` declared in this module: the style call it is initialised with. */
62
+ definition?: FoldSpan;
63
+ /** For a `binding` imported from another module: the local name `importedStyles` is keyed by. */
64
+ binding?: string;
65
+ /**
66
+ * For an argument of the call itself: its whole span, wrappers and parentheses included — what the
67
+ * fold copies when it leaves the argument to the runtime join. `span` is what the argument holds.
68
+ */
69
+ written?: FoldSpan;
70
+ /** For an argument of the call itself: it reads a Bamboo binding or a recipe, so it cannot be copied. */
71
+ readsBamboo: boolean;
51
72
  }
52
73
  interface FoldCall {
53
74
  name: string;
@@ -81,8 +102,9 @@ interface FoldCall {
81
102
  */
82
103
  guarded: boolean;
83
104
  /**
84
- * A `token.value()` call written first in an expression statement. What replaces it there cannot
85
- * open with `(` or `-`, which would continue the line before it where that line has no semicolon.
105
+ * A `token.value()` or `cx()` call written first in an expression statement. What replaces it there
106
+ * cannot open with `(` or `-`, which would continue the line before it where that line has no
107
+ * semicolon.
86
108
  */
87
109
  statementStart: boolean;
88
110
  }
@@ -154,6 +176,20 @@ interface FoldAnalysis {
154
176
  declaringImports: string[];
155
177
  dependencies: string[];
156
178
  }>;
179
+ /**
180
+ * Imports a `cx()` argument names that resolve to an exact `css()` or pattern call bound at module
181
+ * scope in another module: `kind` is `css` or `pattern`, `callee` the function called, `data` its
182
+ * evaluated arguments, `dependencies` every module a composition against it depends on.
183
+ */
184
+ importedStyles: Array<{
185
+ local: string;
186
+ filePath: string;
187
+ name: string;
188
+ kind: 'css' | 'pattern';
189
+ callee: string;
190
+ data: unknown[];
191
+ dependencies: string[];
192
+ }>;
157
193
  dependencies: string[];
158
194
  /**
159
195
  * Bamboo bindings a `<script setup>` compiled for a separate render function exposes to its
package/dist/index.d.mts CHANGED
@@ -45,9 +45,30 @@ interface FoldSelection {
45
45
  }
46
46
  interface FoldCxArgument {
47
47
  span: FoldSpan;
48
- kind: 'string' | 'ignored' | 'array' | 'expression' | 'spread';
48
+ /**
49
+ * `binding` is a module-scope `const` initialised with a `css()` or pattern call, here or in a
50
+ * module this one imports it from. `when` is `test && value`, `choose` is `test ? a : b`.
51
+ */
52
+ kind: 'string' | 'ignored' | 'array' | 'binding' | 'when' | 'choose' | 'expression' | 'spread';
49
53
  value?: string;
54
+ /** For `array`, its elements; for `when`, the value; for `choose`, the consequent then the alternate. */
50
55
  elements?: FoldCxArgument[];
56
+ /**
57
+ * For `when` and `choose`: the condition, as written. Never one reading a Bamboo binding or a
58
+ * recipe, since the fold copies it into what it writes.
59
+ */
60
+ test?: FoldSpan;
61
+ /** For a `binding` declared in this module: the style call it is initialised with. */
62
+ definition?: FoldSpan;
63
+ /** For a `binding` imported from another module: the local name `importedStyles` is keyed by. */
64
+ binding?: string;
65
+ /**
66
+ * For an argument of the call itself: its whole span, wrappers and parentheses included — what the
67
+ * fold copies when it leaves the argument to the runtime join. `span` is what the argument holds.
68
+ */
69
+ written?: FoldSpan;
70
+ /** For an argument of the call itself: it reads a Bamboo binding or a recipe, so it cannot be copied. */
71
+ readsBamboo: boolean;
51
72
  }
52
73
  interface FoldCall {
53
74
  name: string;
@@ -81,8 +102,9 @@ interface FoldCall {
81
102
  */
82
103
  guarded: boolean;
83
104
  /**
84
- * A `token.value()` call written first in an expression statement. What replaces it there cannot
85
- * open with `(` or `-`, which would continue the line before it where that line has no semicolon.
105
+ * A `token.value()` or `cx()` call written first in an expression statement. What replaces it there
106
+ * cannot open with `(` or `-`, which would continue the line before it where that line has no
107
+ * semicolon.
86
108
  */
87
109
  statementStart: boolean;
88
110
  }
@@ -154,6 +176,20 @@ interface FoldAnalysis {
154
176
  declaringImports: string[];
155
177
  dependencies: string[];
156
178
  }>;
179
+ /**
180
+ * Imports a `cx()` argument names that resolve to an exact `css()` or pattern call bound at module
181
+ * scope in another module: `kind` is `css` or `pattern`, `callee` the function called, `data` its
182
+ * evaluated arguments, `dependencies` every module a composition against it depends on.
183
+ */
184
+ importedStyles: Array<{
185
+ local: string;
186
+ filePath: string;
187
+ name: string;
188
+ kind: 'css' | 'pattern';
189
+ callee: string;
190
+ data: unknown[];
191
+ dependencies: string[];
192
+ }>;
157
193
  dependencies: string[];
158
194
  /**
159
195
  * Bamboo bindings a `<script setup>` compiled for a separate render function exposes to its
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/node",
3
- "version": "1.59.0",
3
+ "version": "1.60.0",
4
4
  "description": "The core css bamboo library",
5
5
  "homepage": "https://bamboocss.com",
6
6
  "license": "MIT",
@@ -60,16 +60,16 @@
60
60
  "pkg-types": "2.3.0",
61
61
  "pluralize": "8.0.0",
62
62
  "ts-pattern": "5.9.0",
63
- "@bamboocss/config": "1.59.0",
64
- "@bamboocss/core": "1.59.0",
65
- "@bamboocss/generator": "1.59.0",
66
- "@bamboocss/logger": "1.59.0",
67
- "@bamboocss/plugin-svelte": "1.59.0",
68
- "@bamboocss/plugin-vue": "1.59.0",
69
- "@bamboocss/reporter": "1.59.0",
70
- "@bamboocss/shared": "1.59.0",
71
- "@bamboocss/token-dictionary": "1.59.0",
72
- "@bamboocss/types": "1.59.0"
63
+ "@bamboocss/config": "1.60.0",
64
+ "@bamboocss/core": "1.60.0",
65
+ "@bamboocss/generator": "1.60.0",
66
+ "@bamboocss/logger": "1.60.0",
67
+ "@bamboocss/plugin-svelte": "1.60.0",
68
+ "@bamboocss/plugin-vue": "1.60.0",
69
+ "@bamboocss/reporter": "1.60.0",
70
+ "@bamboocss/shared": "1.60.0",
71
+ "@bamboocss/token-dictionary": "1.60.0",
72
+ "@bamboocss/types": "1.60.0"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@astrojs/compiler": "3.0.1",
@@ -77,7 +77,7 @@
77
77
  "@types/fs-extra": "11.0.4",
78
78
  "@types/picomatch": "4.0.2",
79
79
  "boxen": "8.0.1",
80
- "@bamboocss/native-extractor": "1.59.0"
80
+ "@bamboocss/native-extractor": "1.60.0"
81
81
  },
82
82
  "peerDependencies": {
83
83
  "@astrojs/compiler": ">=2",