@pandacss/parser 0.0.0-dev-20221126164420 → 0.0.0-dev-20221127075519

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.ts CHANGED
@@ -31,6 +31,7 @@ type ParserOptions = {
31
31
  factory: string;
32
32
  nodes: Array<{
33
33
  name: string;
34
+ type: 'pattern' | 'recipe';
34
35
  props?: string[];
35
36
  }>;
36
37
  isStyleProp: (prop: string) => boolean;
package/dist/index.js CHANGED
@@ -307,7 +307,8 @@ function createParser(options) {
307
307
  }
308
308
  });
309
309
  const jsxFactoryAlias = jsx ? imports.getAlias(jsx.factory) : "panda";
310
- const jsxPatternNodes = new RegExp(`(${jsx?.nodes.map((node) => node.name).join("|")})$`);
310
+ const jsxPatternNodes = new RegExp(`(${jsx?.nodes.map((node) => node.type === "pattern" && node.name).join("|")})$`);
311
+ const jsxRecipeNodes = new RegExp(`(${jsx?.nodes.map((node) => node.type === "recipe" && node.name).join("|")})$`);
311
312
  visitJsxElement(sourceFile, {
312
313
  match: {
313
314
  tag: (0, import_shared2.memo)((name) => {
@@ -320,10 +321,13 @@ function createParser(options) {
320
321
  },
321
322
  fn({ name, data }) {
322
323
  let type;
324
+ import_logger.logger.debug({ type: `ast:jsx:${name}`, fileName, result: data });
323
325
  if (jsx && name.startsWith(jsxFactoryAlias)) {
324
326
  type = "jsx-factory";
325
327
  } else if (jsxPatternNodes.test(name)) {
326
328
  type = "pattern";
329
+ } else if (jsxRecipeNodes.test(name)) {
330
+ type = "recipe";
327
331
  } else {
328
332
  type = "jsx";
329
333
  }
package/dist/index.mjs CHANGED
@@ -282,7 +282,8 @@ function createParser(options) {
282
282
  }
283
283
  });
284
284
  const jsxFactoryAlias = jsx ? imports.getAlias(jsx.factory) : "panda";
285
- const jsxPatternNodes = new RegExp(`(${jsx?.nodes.map((node) => node.name).join("|")})$`);
285
+ const jsxPatternNodes = new RegExp(`(${jsx?.nodes.map((node) => node.type === "pattern" && node.name).join("|")})$`);
286
+ const jsxRecipeNodes = new RegExp(`(${jsx?.nodes.map((node) => node.type === "recipe" && node.name).join("|")})$`);
286
287
  visitJsxElement(sourceFile, {
287
288
  match: {
288
289
  tag: memo2((name) => {
@@ -295,10 +296,13 @@ function createParser(options) {
295
296
  },
296
297
  fn({ name, data }) {
297
298
  let type;
299
+ logger.debug({ type: `ast:jsx:${name}`, fileName, result: data });
298
300
  if (jsx && name.startsWith(jsxFactoryAlias)) {
299
301
  type = "jsx-factory";
300
302
  } else if (jsxPatternNodes.test(name)) {
301
303
  type = "pattern";
304
+ } else if (jsxRecipeNodes.test(name)) {
305
+ type = "recipe";
302
306
  } else {
303
307
  type = "jsx";
304
308
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/parser",
3
- "version": "0.0.0-dev-20221126164420",
3
+ "version": "0.0.0-dev-20221127075519",
4
4
  "description": "The static parser for panda css",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -13,13 +13,13 @@
13
13
  "dependencies": {
14
14
  "ts-pattern": "4.0.6",
15
15
  "ts-morph": "17.0.1",
16
- "@pandacss/logger": "0.0.0-dev-20221126164420",
17
- "@pandacss/shared": "0.0.0-dev-20221126164420",
18
- "@pandacss/is-valid-prop": "0.0.0-dev-20221126164420",
19
- "@pandacss/types": "0.0.0-dev-20221126164420"
16
+ "@pandacss/logger": "0.0.0-dev-20221127075519",
17
+ "@pandacss/shared": "0.0.0-dev-20221127075519",
18
+ "@pandacss/is-valid-prop": "0.0.0-dev-20221127075519",
19
+ "@pandacss/types": "0.0.0-dev-20221127075519"
20
20
  },
21
21
  "devDependencies": {
22
- "@pandacss/fixture": "0.0.0-dev-20221126164420"
22
+ "@pandacss/fixture": "0.0.0-dev-20221127075519"
23
23
  },
24
24
  "files": [
25
25
  "dist"