@pandacss/parser 0.0.0-dev-20230418111125 → 0.0.0-dev-20230418111141
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.js +14 -1
- package/dist/index.mjs +14 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -232,6 +232,19 @@ function createParser(options) {
|
|
|
232
232
|
return true;
|
|
233
233
|
return Boolean(functions.get(fnName));
|
|
234
234
|
});
|
|
235
|
+
const matchFnProp = (0, import_shared2.memo)((fnName, propName) => {
|
|
236
|
+
if (propertiesMap.size === 0)
|
|
237
|
+
return true;
|
|
238
|
+
if (recipes.has(fnName) || patterns.has(fnName))
|
|
239
|
+
return true;
|
|
240
|
+
if (fnName === cvaAlias)
|
|
241
|
+
return true;
|
|
242
|
+
if (fnName.startsWith(jsxFactoryAlias))
|
|
243
|
+
return true;
|
|
244
|
+
if (fnName === cssAlias)
|
|
245
|
+
return Boolean(propertiesMap.get(propName) || propName === "selectors");
|
|
246
|
+
return Boolean(functions.get(fnName)?.get(propName));
|
|
247
|
+
});
|
|
235
248
|
const measure = import_logger.logger.time.debug(`Tokens extracted from ${filePath}`);
|
|
236
249
|
const extractResultByName = (0, import_extractor.extract)({
|
|
237
250
|
ast: sourceFile,
|
|
@@ -241,7 +254,7 @@ function createParser(options) {
|
|
|
241
254
|
},
|
|
242
255
|
functions: {
|
|
243
256
|
matchFn: (prop) => matchFn(prop.fnName),
|
|
244
|
-
matchProp: () =>
|
|
257
|
+
matchProp: (prop) => matchFnProp(prop.fnName, prop.propName),
|
|
245
258
|
matchArg: (prop) => {
|
|
246
259
|
if (prop.fnName === jsxFactoryAlias && prop.index === 1 && import_ts_morph.Node.isIdentifier(prop.argNode))
|
|
247
260
|
return false;
|
package/dist/index.mjs
CHANGED
|
@@ -206,6 +206,19 @@ function createParser(options) {
|
|
|
206
206
|
return true;
|
|
207
207
|
return Boolean(functions.get(fnName));
|
|
208
208
|
});
|
|
209
|
+
const matchFnProp = memo2((fnName, propName) => {
|
|
210
|
+
if (propertiesMap.size === 0)
|
|
211
|
+
return true;
|
|
212
|
+
if (recipes.has(fnName) || patterns.has(fnName))
|
|
213
|
+
return true;
|
|
214
|
+
if (fnName === cvaAlias)
|
|
215
|
+
return true;
|
|
216
|
+
if (fnName.startsWith(jsxFactoryAlias))
|
|
217
|
+
return true;
|
|
218
|
+
if (fnName === cssAlias)
|
|
219
|
+
return Boolean(propertiesMap.get(propName) || propName === "selectors");
|
|
220
|
+
return Boolean(functions.get(fnName)?.get(propName));
|
|
221
|
+
});
|
|
209
222
|
const measure = logger.time.debug(`Tokens extracted from ${filePath}`);
|
|
210
223
|
const extractResultByName = extract({
|
|
211
224
|
ast: sourceFile,
|
|
@@ -215,7 +228,7 @@ function createParser(options) {
|
|
|
215
228
|
},
|
|
216
229
|
functions: {
|
|
217
230
|
matchFn: (prop) => matchFn(prop.fnName),
|
|
218
|
-
matchProp: () =>
|
|
231
|
+
matchProp: (prop) => matchFnProp(prop.fnName, prop.propName),
|
|
219
232
|
matchArg: (prop) => {
|
|
220
233
|
if (prop.fnName === jsxFactoryAlias && prop.index === 1 && Node.isIdentifier(prop.argNode))
|
|
221
234
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/parser",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20230418111141",
|
|
4
4
|
"description": "The static parser for panda css",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"lil-fp": "1.4.5",
|
|
15
15
|
"ts-morph": "18.0.0",
|
|
16
16
|
"ts-pattern": "4.2.2",
|
|
17
|
-
"@pandacss/extractor": "0.0.0-dev-
|
|
18
|
-
"@pandacss/is-valid-prop": "0.0.0-dev-
|
|
19
|
-
"@pandacss/logger": "0.0.0-dev-
|
|
20
|
-
"@pandacss/shared": "0.0.0-dev-
|
|
21
|
-
"@pandacss/types": "0.0.0-dev-
|
|
17
|
+
"@pandacss/extractor": "0.0.0-dev-20230418111141",
|
|
18
|
+
"@pandacss/is-valid-prop": "0.0.0-dev-20230418111141",
|
|
19
|
+
"@pandacss/logger": "0.0.0-dev-20230418111141",
|
|
20
|
+
"@pandacss/shared": "0.0.0-dev-20230418111141",
|
|
21
|
+
"@pandacss/types": "0.0.0-dev-20230418111141"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@pandacss/fixture": "0.0.0-dev-
|
|
25
|
-
"@pandacss/generator": "0.0.0-dev-
|
|
24
|
+
"@pandacss/fixture": "0.0.0-dev-20230418111141",
|
|
25
|
+
"@pandacss/generator": "0.0.0-dev-20230418111141"
|
|
26
26
|
},
|
|
27
27
|
"files": [
|
|
28
28
|
"dist"
|