@pandacss/parser 1.10.0 → 1.11.1
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 +16 -3
- package/dist/index.mjs +18 -4
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -653,7 +653,12 @@ function createParser(context) {
|
|
|
653
653
|
matchTag: (prop) => {
|
|
654
654
|
if (options?.matchTag) {
|
|
655
655
|
const isPandaComponent = file.isPandaComponent(prop.tagName);
|
|
656
|
-
|
|
656
|
+
const matchTagMode = options.matchTagMode ?? "extend";
|
|
657
|
+
const isCustomMatch = options.matchTag(prop.tagName, isPandaComponent);
|
|
658
|
+
if (matchTagMode === "override") {
|
|
659
|
+
return isCustomMatch;
|
|
660
|
+
}
|
|
661
|
+
return isPandaComponent || isCustomMatch;
|
|
657
662
|
}
|
|
658
663
|
return !!file.matchTag(prop.tagName);
|
|
659
664
|
},
|
|
@@ -857,6 +862,11 @@ function createParser(context) {
|
|
|
857
862
|
}
|
|
858
863
|
|
|
859
864
|
// src/project.ts
|
|
865
|
+
var normalizeCompilerOptions = (raw) => {
|
|
866
|
+
if (!raw) return {};
|
|
867
|
+
const { options } = import_ts_morph2.ts.convertCompilerOptionsFromJson(raw, process.cwd());
|
|
868
|
+
return options;
|
|
869
|
+
};
|
|
860
870
|
var createTsProject = (options) => new import_ts_morph2.Project({
|
|
861
871
|
skipAddingFilesFromTsConfig: true,
|
|
862
872
|
skipFileDependencyResolution: true,
|
|
@@ -866,7 +876,7 @@ var createTsProject = (options) => new import_ts_morph2.Project({
|
|
|
866
876
|
allowJs: true,
|
|
867
877
|
strictNullChecks: false,
|
|
868
878
|
skipLibCheck: true,
|
|
869
|
-
...options.compilerOptions
|
|
879
|
+
...normalizeCompilerOptions(options.compilerOptions)
|
|
870
880
|
}
|
|
871
881
|
});
|
|
872
882
|
var Project = class {
|
|
@@ -950,10 +960,13 @@ var Project = class {
|
|
|
950
960
|
filePath,
|
|
951
961
|
content: original,
|
|
952
962
|
configure(opts) {
|
|
953
|
-
const { matchTag, matchTagProp } = opts;
|
|
963
|
+
const { matchTag, matchTagMode, matchTagProp } = opts;
|
|
954
964
|
if (matchTag) {
|
|
955
965
|
options.matchTag = matchTag;
|
|
956
966
|
}
|
|
967
|
+
if (matchTagMode) {
|
|
968
|
+
options.matchTagMode = matchTagMode;
|
|
969
|
+
}
|
|
957
970
|
if (matchTagProp) {
|
|
958
971
|
options.matchTagProp = matchTagProp;
|
|
959
972
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// src/project.ts
|
|
2
2
|
import {
|
|
3
3
|
ScriptKind,
|
|
4
|
-
Project as TsProject
|
|
4
|
+
Project as TsProject,
|
|
5
|
+
ts
|
|
5
6
|
} from "ts-morph";
|
|
6
7
|
|
|
7
8
|
// src/classify.ts
|
|
@@ -629,7 +630,12 @@ function createParser(context) {
|
|
|
629
630
|
matchTag: (prop) => {
|
|
630
631
|
if (options?.matchTag) {
|
|
631
632
|
const isPandaComponent = file.isPandaComponent(prop.tagName);
|
|
632
|
-
|
|
633
|
+
const matchTagMode = options.matchTagMode ?? "extend";
|
|
634
|
+
const isCustomMatch = options.matchTag(prop.tagName, isPandaComponent);
|
|
635
|
+
if (matchTagMode === "override") {
|
|
636
|
+
return isCustomMatch;
|
|
637
|
+
}
|
|
638
|
+
return isPandaComponent || isCustomMatch;
|
|
633
639
|
}
|
|
634
640
|
return !!file.matchTag(prop.tagName);
|
|
635
641
|
},
|
|
@@ -833,6 +839,11 @@ function createParser(context) {
|
|
|
833
839
|
}
|
|
834
840
|
|
|
835
841
|
// src/project.ts
|
|
842
|
+
var normalizeCompilerOptions = (raw) => {
|
|
843
|
+
if (!raw) return {};
|
|
844
|
+
const { options } = ts.convertCompilerOptionsFromJson(raw, process.cwd());
|
|
845
|
+
return options;
|
|
846
|
+
};
|
|
836
847
|
var createTsProject = (options) => new TsProject({
|
|
837
848
|
skipAddingFilesFromTsConfig: true,
|
|
838
849
|
skipFileDependencyResolution: true,
|
|
@@ -842,7 +853,7 @@ var createTsProject = (options) => new TsProject({
|
|
|
842
853
|
allowJs: true,
|
|
843
854
|
strictNullChecks: false,
|
|
844
855
|
skipLibCheck: true,
|
|
845
|
-
...options.compilerOptions
|
|
856
|
+
...normalizeCompilerOptions(options.compilerOptions)
|
|
846
857
|
}
|
|
847
858
|
});
|
|
848
859
|
var Project = class {
|
|
@@ -926,10 +937,13 @@ var Project = class {
|
|
|
926
937
|
filePath,
|
|
927
938
|
content: original,
|
|
928
939
|
configure(opts) {
|
|
929
|
-
const { matchTag, matchTagProp } = opts;
|
|
940
|
+
const { matchTag, matchTagMode, matchTagProp } = opts;
|
|
930
941
|
if (matchTag) {
|
|
931
942
|
options.matchTag = matchTag;
|
|
932
943
|
}
|
|
944
|
+
if (matchTagMode) {
|
|
945
|
+
options.matchTagMode = matchTagMode;
|
|
946
|
+
}
|
|
933
947
|
if (matchTagProp) {
|
|
934
948
|
options.matchTagProp = matchTagProp;
|
|
935
949
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/parser",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.1",
|
|
4
4
|
"description": "The static parser for panda css",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -31,17 +31,17 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"ts-morph": "28.0.0",
|
|
33
33
|
"ts-pattern": "5.9.0",
|
|
34
|
-
"@pandacss/
|
|
35
|
-
"@pandacss/
|
|
36
|
-
"@pandacss/
|
|
37
|
-
"@pandacss/logger": "1.
|
|
38
|
-
"@pandacss/shared": "1.
|
|
39
|
-
"@pandacss/types": "1.
|
|
34
|
+
"@pandacss/config": "^1.11.1",
|
|
35
|
+
"@pandacss/core": "^1.11.1",
|
|
36
|
+
"@pandacss/extractor": "1.11.1",
|
|
37
|
+
"@pandacss/logger": "1.11.1",
|
|
38
|
+
"@pandacss/shared": "1.11.1",
|
|
39
|
+
"@pandacss/types": "1.11.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@pandacss/generator": "1.
|
|
43
|
-
"@pandacss/plugin-svelte": "1.
|
|
44
|
-
"@pandacss/plugin-vue": "1.
|
|
42
|
+
"@pandacss/generator": "1.11.1",
|
|
43
|
+
"@pandacss/plugin-svelte": "1.11.1",
|
|
44
|
+
"@pandacss/plugin-vue": "1.11.1"
|
|
45
45
|
},
|
|
46
46
|
"files": [
|
|
47
47
|
"dist"
|