@bamboocss/parser 1.29.0 → 1.30.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
@@ -963,8 +963,8 @@ var ParserResult = class {
963
963
  if (unresolved.length) this.unresolved.push(...unresolved);
964
964
  }
965
965
  /**
966
- * `kind` separates the variable reference — `token()` and its `token.var()` alias — from
967
- * `token.value()`, the resolved literal. They share this set deliberately: everything that
966
+ * `kind` separates the variable reference — `token()` — from `token.value()`, the resolved
967
+ * literal. They share this set deliberately: everything that
968
968
  * reads a result for the token *path* — `collectTokenReferences`, keeping a declaration
969
969
  * alive through pruning — wants both, and only the fold cares which half was asked for.
970
970
  */
@@ -1171,14 +1171,13 @@ function createParser(context) {
1171
1171
  });
1172
1172
  return;
1173
1173
  }
1174
- const tokenMethod = file.tokenMethod(alias);
1175
- if (tokenMethod) {
1174
+ if (file.isTokenValueFn(alias)) {
1176
1175
  result.queryList.forEach((query) => {
1177
1176
  if (query.kind === "call-expression") parserResult.setToken({
1178
- name: `token.${tokenMethod}`,
1177
+ name: "token.value",
1179
1178
  box: query.box.value[0] ?? _bamboocss_extractor.box.fallback(query.box),
1180
1179
  data: combineResult((0, _bamboocss_extractor.unbox)(query.box.value[0]))
1181
- }, tokenMethod === "value" ? "tokenValue" : "token");
1180
+ }, "tokenValue");
1182
1181
  });
1183
1182
  return;
1184
1183
  }
package/dist/index.d.cts CHANGED
@@ -240,8 +240,8 @@ declare class ParserResult implements ParserResultInterface {
240
240
  */
241
241
  private reportUnresolvedRecipe;
242
242
  /**
243
- * `kind` separates the variable reference — `token()` and its `token.var()` alias — from
244
- * `token.value()`, the resolved literal. They share this set deliberately: everything that
243
+ * `kind` separates the variable reference — `token()` — from `token.value()`, the resolved
244
+ * literal. They share this set deliberately: everything that
245
245
  * reads a result for the token *path* — `collectTokenReferences`, keeping a declaration
246
246
  * alive through pruning — wants both, and only the fold cares which half was asked for.
247
247
  */
package/dist/index.d.mts CHANGED
@@ -240,8 +240,8 @@ declare class ParserResult implements ParserResultInterface {
240
240
  */
241
241
  private reportUnresolvedRecipe;
242
242
  /**
243
- * `kind` separates the variable reference — `token()` and its `token.var()` alias — from
244
- * `token.value()`, the resolved literal. They share this set deliberately: everything that
243
+ * `kind` separates the variable reference — `token()` — from `token.value()`, the resolved
244
+ * literal. They share this set deliberately: everything that
245
245
  * reads a result for the token *path* — `collectTokenReferences`, keeping a declaration
246
246
  * alive through pruning — wants both, and only the fold cares which half was asked for.
247
247
  */
package/dist/index.mjs CHANGED
@@ -962,8 +962,8 @@ var ParserResult = class {
962
962
  if (unresolved.length) this.unresolved.push(...unresolved);
963
963
  }
964
964
  /**
965
- * `kind` separates the variable reference — `token()` and its `token.var()` alias — from
966
- * `token.value()`, the resolved literal. They share this set deliberately: everything that
965
+ * `kind` separates the variable reference — `token()` — from `token.value()`, the resolved
966
+ * literal. They share this set deliberately: everything that
967
967
  * reads a result for the token *path* — `collectTokenReferences`, keeping a declaration
968
968
  * alive through pruning — wants both, and only the fold cares which half was asked for.
969
969
  */
@@ -1170,14 +1170,13 @@ function createParser(context) {
1170
1170
  });
1171
1171
  return;
1172
1172
  }
1173
- const tokenMethod = file.tokenMethod(alias);
1174
- if (tokenMethod) {
1173
+ if (file.isTokenValueFn(alias)) {
1175
1174
  result.queryList.forEach((query) => {
1176
1175
  if (query.kind === "call-expression") parserResult.setToken({
1177
- name: `token.${tokenMethod}`,
1176
+ name: "token.value",
1178
1177
  box: query.box.value[0] ?? box.fallback(query.box),
1179
1178
  data: combineResult(unbox(query.box.value[0]))
1180
- }, tokenMethod === "value" ? "tokenValue" : "token");
1179
+ }, "tokenValue");
1181
1180
  });
1182
1181
  return;
1183
1182
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/parser",
3
- "version": "1.29.0",
3
+ "version": "1.30.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.29.0",
38
- "@bamboocss/extractor": "1.29.0",
39
- "@bamboocss/logger": "1.29.0",
40
- "@bamboocss/shared": "1.29.0",
41
- "@bamboocss/core": "^1.29.0",
42
- "@bamboocss/types": "1.29.0"
37
+ "@bamboocss/config": "^1.30.0",
38
+ "@bamboocss/core": "^1.30.0",
39
+ "@bamboocss/extractor": "1.30.0",
40
+ "@bamboocss/logger": "1.30.0",
41
+ "@bamboocss/shared": "1.30.0",
42
+ "@bamboocss/types": "1.30.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@bamboocss/generator": "1.29.0",
46
- "@bamboocss/plugin-svelte": "1.29.0",
47
- "@bamboocss/plugin-vue": "1.29.0"
45
+ "@bamboocss/generator": "1.30.0",
46
+ "@bamboocss/plugin-svelte": "1.30.0",
47
+ "@bamboocss/plugin-vue": "1.30.0"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "tsdown src/index.ts --format=esm,cjs --dts",