tailwind-typescript-plugin 1.4.1-beta.2 → 1.4.1-beta.20
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/CHANGELOG.md +123 -0
- package/README.md +375 -77
- package/lib/core/interfaces.d.ts +23 -12
- package/lib/core/interfaces.d.ts.map +1 -1
- package/lib/core/types.d.ts +112 -1
- package/lib/core/types.d.ts.map +1 -1
- package/lib/extractors/BaseExtractor.d.ts +49 -2
- package/lib/extractors/BaseExtractor.d.ts.map +1 -1
- package/lib/extractors/BaseExtractor.js +184 -5
- package/lib/extractors/BaseExtractor.js.map +1 -1
- package/lib/extractors/CvaExtractor.js +1 -1
- package/lib/extractors/CvaExtractor.js.map +1 -1
- package/lib/extractors/ExpressionExtractor.d.ts.map +1 -1
- package/lib/extractors/ExpressionExtractor.js +35 -5
- package/lib/extractors/ExpressionExtractor.js.map +1 -1
- package/lib/extractors/JsxAttributeExtractor.d.ts +2 -1
- package/lib/extractors/JsxAttributeExtractor.d.ts.map +1 -1
- package/lib/extractors/JsxAttributeExtractor.js +15 -8
- package/lib/extractors/JsxAttributeExtractor.js.map +1 -1
- package/lib/extractors/SvelteAttributeExtractor.d.ts +17 -0
- package/lib/extractors/SvelteAttributeExtractor.d.ts.map +1 -0
- package/lib/extractors/SvelteAttributeExtractor.js +27 -0
- package/lib/extractors/SvelteAttributeExtractor.js.map +1 -0
- package/lib/extractors/TailwindVariantsExtractor.d.ts.map +1 -1
- package/lib/extractors/TailwindVariantsExtractor.js +1 -5
- package/lib/extractors/TailwindVariantsExtractor.js.map +1 -1
- package/lib/extractors/VariableReferenceExtractor.d.ts.map +1 -1
- package/lib/extractors/VariableReferenceExtractor.js +21 -0
- package/lib/extractors/VariableReferenceExtractor.js.map +1 -1
- package/lib/extractors/VueAttributeExtractor.d.ts +119 -0
- package/lib/extractors/VueAttributeExtractor.d.ts.map +1 -0
- package/lib/extractors/VueAttributeExtractor.js +911 -0
- package/lib/extractors/VueAttributeExtractor.js.map +1 -0
- package/lib/extractors/VueExpressionExtractor.d.ts +21 -0
- package/lib/extractors/VueExpressionExtractor.d.ts.map +1 -0
- package/lib/extractors/VueExpressionExtractor.js +51 -0
- package/lib/extractors/VueExpressionExtractor.js.map +1 -0
- package/lib/infrastructure/TailwindConflictDetector.d.ts +28 -18
- package/lib/infrastructure/TailwindConflictDetector.d.ts.map +1 -1
- package/lib/infrastructure/TailwindConflictDetector.js +216 -486
- package/lib/infrastructure/TailwindConflictDetector.js.map +1 -1
- package/lib/infrastructure/TailwindValidator.css-vars.spec.js +1 -11
- package/lib/infrastructure/TailwindValidator.css-vars.spec.js.map +1 -1
- package/lib/infrastructure/TailwindValidator.d.ts +16 -3
- package/lib/infrastructure/TailwindValidator.d.ts.map +1 -1
- package/lib/infrastructure/TailwindValidator.js +83 -24
- package/lib/infrastructure/TailwindValidator.js.map +1 -1
- package/lib/infrastructure/TailwindValidator.spec.js +50 -17
- package/lib/infrastructure/TailwindValidator.spec.js.map +1 -1
- package/lib/plugin/TailwindTypescriptPlugin.d.ts +18 -1
- package/lib/plugin/TailwindTypescriptPlugin.d.ts.map +1 -1
- package/lib/plugin/TailwindTypescriptPlugin.js +124 -55
- package/lib/plugin/TailwindTypescriptPlugin.js.map +1 -1
- package/lib/services/ClassNameExtractionService.d.ts +21 -5
- package/lib/services/ClassNameExtractionService.d.ts.map +1 -1
- package/lib/services/ClassNameExtractionService.js +76 -14
- package/lib/services/ClassNameExtractionService.js.map +1 -1
- package/lib/services/ClassNameExtractionService.spec.d.ts +2 -0
- package/lib/services/ClassNameExtractionService.spec.d.ts.map +1 -0
- package/lib/services/ClassNameExtractionService.spec.js +222 -0
- package/lib/services/ClassNameExtractionService.spec.js.map +1 -0
- package/lib/services/CodeActionService.spec.js +1 -2
- package/lib/services/CodeActionService.spec.js.map +1 -1
- package/lib/services/CompletionService.d.ts +121 -0
- package/lib/services/CompletionService.d.ts.map +1 -0
- package/lib/services/CompletionService.js +573 -0
- package/lib/services/CompletionService.js.map +1 -0
- package/lib/services/CompletionService.spec.d.ts +2 -0
- package/lib/services/CompletionService.spec.d.ts.map +1 -0
- package/lib/services/CompletionService.spec.js +1182 -0
- package/lib/services/CompletionService.spec.js.map +1 -0
- package/lib/services/ConflictClassDetection.spec.js +26 -21
- package/lib/services/ConflictClassDetection.spec.js.map +1 -1
- package/lib/services/DiagnosticService.d.ts +8 -8
- package/lib/services/DiagnosticService.d.ts.map +1 -1
- package/lib/services/DiagnosticService.js +29 -13
- package/lib/services/DiagnosticService.js.map +1 -1
- package/lib/services/DuplicateClassDetection.spec.js +61 -81
- package/lib/services/DuplicateClassDetection.spec.js.map +1 -1
- package/lib/services/PluginConfigService.d.ts +47 -15
- package/lib/services/PluginConfigService.d.ts.map +1 -1
- package/lib/services/PluginConfigService.js +203 -75
- package/lib/services/PluginConfigService.js.map +1 -1
- package/lib/services/PluginConfigService.spec.d.ts +2 -0
- package/lib/services/PluginConfigService.spec.d.ts.map +1 -0
- package/lib/services/PluginConfigService.spec.js +93 -0
- package/lib/services/PluginConfigService.spec.js.map +1 -0
- package/lib/services/ValidationService.d.ts +8 -5
- package/lib/services/ValidationService.d.ts.map +1 -1
- package/lib/services/ValidationService.js +49 -49
- package/lib/services/ValidationService.js.map +1 -1
- package/lib/utils/FrameworkDetector.d.ts +24 -0
- package/lib/utils/FrameworkDetector.d.ts.map +1 -0
- package/lib/utils/FrameworkDetector.js +52 -0
- package/lib/utils/FrameworkDetector.js.map +1 -0
- package/lib/utils/FrameworkDetector.spec.d.ts +2 -0
- package/lib/utils/FrameworkDetector.spec.d.ts.map +1 -0
- package/lib/utils/FrameworkDetector.spec.js +75 -0
- package/lib/utils/FrameworkDetector.spec.js.map +1 -0
- package/package.json +4 -2
- package/lib/extractors/StringLiteralExtractor.d.ts +0 -12
- package/lib/extractors/StringLiteralExtractor.d.ts.map +0 -1
- package/lib/extractors/StringLiteralExtractor.js +0 -21
- package/lib/extractors/StringLiteralExtractor.js.map +0 -1
- package/lib/services/ClassNameExtractionService.original.d.ts +0 -20
- package/lib/services/ClassNameExtractionService.original.d.ts.map +0 -1
- package/lib/services/ClassNameExtractionService.original.js +0 -48
- package/lib/services/ClassNameExtractionService.original.js.map +0 -1
|
@@ -2,101 +2,229 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PluginConfigService = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* Default
|
|
5
|
+
* Default utilities configuration
|
|
6
|
+
* Key is function name, value is import source ("*" = any source, "off" = disabled)
|
|
6
7
|
*/
|
|
7
|
-
const
|
|
8
|
-
'
|
|
9
|
-
'
|
|
10
|
-
'classnames',
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
'
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
const DEFAULT_UTILITIES = {
|
|
9
|
+
cn: '*', // Custom wrapper pattern (e.g., shadcn), any source
|
|
10
|
+
clsx: 'clsx',
|
|
11
|
+
classnames: 'classnames',
|
|
12
|
+
classNames: 'classnames',
|
|
13
|
+
cx: 'classnames',
|
|
14
|
+
twMerge: 'tailwind-merge'
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Default variants configuration
|
|
18
|
+
*/
|
|
19
|
+
const DEFAULT_VARIANTS = {
|
|
20
|
+
tailwindVariants: true,
|
|
21
|
+
classVarianceAuthority: true
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Default validation configuration
|
|
25
|
+
*/
|
|
26
|
+
const DEFAULT_VALIDATION = {
|
|
27
|
+
enabled: true,
|
|
28
|
+
severity: 'error',
|
|
29
|
+
allowedClasses: []
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Default lint configuration
|
|
33
|
+
*/
|
|
34
|
+
const DEFAULT_LINT = {
|
|
35
|
+
enabled: true,
|
|
36
|
+
conflictingClasses: {
|
|
37
|
+
enabled: true,
|
|
38
|
+
severity: 'warning'
|
|
39
|
+
},
|
|
40
|
+
repeatedClasses: {
|
|
41
|
+
enabled: true,
|
|
42
|
+
severity: 'warning'
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Default class attributes
|
|
47
|
+
* These are the JSX/HTML attributes that will be treated as class attributes
|
|
48
|
+
*/
|
|
49
|
+
const DEFAULT_CLASS_ATTRIBUTES = ['className', 'class', 'classList'];
|
|
17
50
|
/**
|
|
18
51
|
* Service responsible for managing plugin configuration
|
|
19
52
|
* Follows Single Responsibility Principle
|
|
20
53
|
*/
|
|
21
54
|
class PluginConfigService {
|
|
22
|
-
constructor(config
|
|
23
|
-
this.logger = logger;
|
|
24
|
-
this.loggingEnabled = config.enableLogging === true;
|
|
25
|
-
this.utilityFunctions = this.initializeUtilityFunctions(config);
|
|
55
|
+
constructor(config) {
|
|
26
56
|
this.cssFilePath = config.globalCss;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
this.tailwindVariantsEnabled = true;
|
|
42
|
-
this.classVarianceAuthorityEnabled = true;
|
|
43
|
-
}
|
|
44
|
-
this.logExtractorConfig();
|
|
45
|
-
}
|
|
46
|
-
initializeUtilityFunctions(config) {
|
|
47
|
-
if (config.utilityFunctions && Array.isArray(config.utilityFunctions)) {
|
|
48
|
-
// Merge user-provided functions with defaults (remove duplicates)
|
|
49
|
-
const merged = [...new Set([...DEFAULT_UTILITY_FUNCTIONS, ...config.utilityFunctions])];
|
|
50
|
-
this.logger.log(`Using utility functions (defaults + custom): ${merged.join(', ')}`);
|
|
51
|
-
return merged;
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
this.logger.log(`Using default utility functions: ${DEFAULT_UTILITY_FUNCTIONS.join(', ')}`);
|
|
55
|
-
return DEFAULT_UTILITY_FUNCTIONS;
|
|
57
|
+
// Initialize configuration with backwards compatibility
|
|
58
|
+
this.utilitiesConfig = this.initializeUtilities(config);
|
|
59
|
+
this.variantsConfig = this.initializeVariants(config);
|
|
60
|
+
this.validationConfig = this.initializeValidation(config);
|
|
61
|
+
this.lintConfig = this.initializeLint(config);
|
|
62
|
+
this.editorConfig = this.initializeEditor(config);
|
|
63
|
+
this.classAttributes = this.initializeClassAttributes(config);
|
|
64
|
+
// Convert to legacy format for extractors
|
|
65
|
+
this.utilityFunctionsLegacy = this.convertToLegacyFormat(this.utilitiesConfig);
|
|
66
|
+
}
|
|
67
|
+
initializeUtilities(config) {
|
|
68
|
+
if (config.libraries?.utilities) {
|
|
69
|
+
// Merge with defaults (user config overrides defaults)
|
|
70
|
+
return { ...DEFAULT_UTILITIES, ...config.libraries.utilities };
|
|
56
71
|
}
|
|
72
|
+
return { ...DEFAULT_UTILITIES };
|
|
57
73
|
}
|
|
58
|
-
|
|
59
|
-
if (config.
|
|
60
|
-
|
|
61
|
-
|
|
74
|
+
initializeVariants(config) {
|
|
75
|
+
if (config.libraries?.variants) {
|
|
76
|
+
const userVariants = config.libraries.variants;
|
|
77
|
+
const hasAnyConfig = userVariants.tailwindVariants !== undefined ||
|
|
78
|
+
userVariants.classVarianceAuthority !== undefined;
|
|
79
|
+
if (hasAnyConfig) {
|
|
80
|
+
// User specified at least one - only enable those explicitly set to true
|
|
81
|
+
return {
|
|
82
|
+
tailwindVariants: userVariants.tailwindVariants === true,
|
|
83
|
+
classVarianceAuthority: userVariants.classVarianceAuthority === true
|
|
84
|
+
};
|
|
85
|
+
}
|
|
62
86
|
}
|
|
63
|
-
|
|
64
|
-
|
|
87
|
+
return { ...DEFAULT_VARIANTS };
|
|
88
|
+
}
|
|
89
|
+
initializeValidation(config) {
|
|
90
|
+
const validation = config.validation || {};
|
|
91
|
+
return {
|
|
92
|
+
enabled: validation.enabled !== false, // default true
|
|
93
|
+
severity: validation.severity || DEFAULT_VALIDATION.severity,
|
|
94
|
+
allowedClasses: validation.allowedClasses || []
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
initializeLint(config) {
|
|
98
|
+
const lint = config.lint || {};
|
|
99
|
+
return {
|
|
100
|
+
enabled: lint.enabled !== false, // default true
|
|
101
|
+
conflictingClasses: {
|
|
102
|
+
enabled: lint.conflictingClasses?.enabled !== false, // default true
|
|
103
|
+
severity: lint.conflictingClasses?.severity || DEFAULT_LINT.conflictingClasses.severity
|
|
104
|
+
},
|
|
105
|
+
repeatedClasses: {
|
|
106
|
+
enabled: lint.repeatedClasses?.enabled !== false, // default true
|
|
107
|
+
severity: lint.repeatedClasses?.severity || DEFAULT_LINT.repeatedClasses.severity
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
initializeEditor(config) {
|
|
112
|
+
const editor = config.editor || {};
|
|
113
|
+
return {
|
|
114
|
+
enabled: editor.enabled !== false, // default true
|
|
115
|
+
autocomplete: {
|
|
116
|
+
enabled: editor.autocomplete?.enabled !== false // default true
|
|
117
|
+
},
|
|
118
|
+
hover: {
|
|
119
|
+
enabled: editor.hover?.enabled !== false // default true
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
initializeClassAttributes(config) {
|
|
124
|
+
const userAttributes = config.classAttributes || [];
|
|
125
|
+
// Merge default attributes with user-provided ones
|
|
126
|
+
// Use Set to avoid duplicates
|
|
127
|
+
return [...new Set([...DEFAULT_CLASS_ATTRIBUTES, ...userAttributes])];
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Convert new utilities config to legacy UtilityFunction[] format
|
|
131
|
+
* This is needed for backwards compatibility with extractors
|
|
132
|
+
*/
|
|
133
|
+
convertToLegacyFormat(utilities) {
|
|
134
|
+
const result = [];
|
|
135
|
+
for (const [name, source] of Object.entries(utilities)) {
|
|
136
|
+
if (source === 'off') {
|
|
137
|
+
continue; // Skip disabled utilities
|
|
138
|
+
}
|
|
139
|
+
if (source === '*') {
|
|
140
|
+
result.push(name); // Simple string = any source
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
result.push({ name, from: source });
|
|
144
|
+
}
|
|
65
145
|
}
|
|
146
|
+
return result;
|
|
66
147
|
}
|
|
67
|
-
|
|
68
|
-
|
|
148
|
+
// ---- Getters for utilities ----
|
|
149
|
+
getUtilitiesConfig() {
|
|
150
|
+
return this.utilitiesConfig;
|
|
69
151
|
}
|
|
70
|
-
|
|
71
|
-
|
|
152
|
+
/**
|
|
153
|
+
* Get utility functions in legacy format (for extractors)
|
|
154
|
+
*/
|
|
155
|
+
getUtilityFunctions() {
|
|
156
|
+
return this.utilityFunctionsLegacy;
|
|
72
157
|
}
|
|
73
|
-
|
|
74
|
-
|
|
158
|
+
// ---- Getters for variants ----
|
|
159
|
+
getVariantsConfig() {
|
|
160
|
+
return this.variantsConfig;
|
|
75
161
|
}
|
|
76
162
|
isTailwindVariantsEnabled() {
|
|
77
|
-
return this.
|
|
163
|
+
return this.variantsConfig.tailwindVariants === true;
|
|
78
164
|
}
|
|
79
165
|
isClassVarianceAuthorityEnabled() {
|
|
80
|
-
return this.
|
|
166
|
+
return this.variantsConfig.classVarianceAuthority === true;
|
|
167
|
+
}
|
|
168
|
+
// ---- Getters for validation ----
|
|
169
|
+
getValidationConfig() {
|
|
170
|
+
return this.validationConfig;
|
|
171
|
+
}
|
|
172
|
+
isValidationEnabled() {
|
|
173
|
+
return this.validationConfig.enabled;
|
|
174
|
+
}
|
|
175
|
+
getValidationSeverity() {
|
|
176
|
+
return this.validationConfig.severity;
|
|
81
177
|
}
|
|
82
178
|
getAllowedClasses() {
|
|
83
|
-
return this.allowedClasses;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
179
|
+
return this.validationConfig.allowedClasses;
|
|
180
|
+
}
|
|
181
|
+
// ---- Getters for lint ----
|
|
182
|
+
getLintConfig() {
|
|
183
|
+
return this.lintConfig;
|
|
184
|
+
}
|
|
185
|
+
isLintEnabled() {
|
|
186
|
+
return this.lintConfig.enabled !== false;
|
|
187
|
+
}
|
|
188
|
+
isConflictingClassesEnabled() {
|
|
189
|
+
return this.isLintEnabled() && this.lintConfig.conflictingClasses?.enabled !== false;
|
|
190
|
+
}
|
|
191
|
+
getConflictingClassesSeverity() {
|
|
192
|
+
return this.lintConfig.conflictingClasses?.severity || 'warning';
|
|
193
|
+
}
|
|
194
|
+
isRepeatedClassesEnabled() {
|
|
195
|
+
return this.isLintEnabled() && this.lintConfig.repeatedClasses?.enabled !== false;
|
|
196
|
+
}
|
|
197
|
+
getRepeatedClassesSeverity() {
|
|
198
|
+
return this.lintConfig.repeatedClasses?.severity || 'warning';
|
|
199
|
+
}
|
|
200
|
+
// ---- Getters for editor ----
|
|
201
|
+
getEditorConfig() {
|
|
202
|
+
return this.editorConfig;
|
|
203
|
+
}
|
|
204
|
+
isEditorEnabled() {
|
|
205
|
+
return this.editorConfig.enabled !== false;
|
|
206
|
+
}
|
|
207
|
+
isAutocompleteEnabled() {
|
|
208
|
+
return this.isEditorEnabled() && this.editorConfig.autocomplete?.enabled !== false;
|
|
209
|
+
}
|
|
210
|
+
isHoverEnabled() {
|
|
211
|
+
return this.isEditorEnabled() && this.editorConfig.hover?.enabled !== false;
|
|
212
|
+
}
|
|
213
|
+
// ---- Getters for global settings ----
|
|
214
|
+
getCssFilePath() {
|
|
215
|
+
return this.cssFilePath;
|
|
216
|
+
}
|
|
217
|
+
hasValidCssPath() {
|
|
218
|
+
return this.cssFilePath !== undefined && this.cssFilePath.length > 0;
|
|
219
|
+
}
|
|
220
|
+
// ---- Getters for class attributes ----
|
|
221
|
+
/**
|
|
222
|
+
* Get the configured class attributes
|
|
223
|
+
* Returns an array of attribute names that should be treated as class attributes
|
|
224
|
+
* Includes default attributes (className, class, classList) plus user-configured ones
|
|
225
|
+
*/
|
|
226
|
+
getClassAttributes() {
|
|
227
|
+
return this.classAttributes;
|
|
100
228
|
}
|
|
101
229
|
}
|
|
102
230
|
exports.PluginConfigService = PluginConfigService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginConfigService.js","sourceRoot":"","sources":["../../src/services/PluginConfigService.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"PluginConfigService.js","sourceRoot":"","sources":["../../src/services/PluginConfigService.ts"],"names":[],"mappings":";;;AAWA;;;GAGG;AACH,MAAM,iBAAiB,GAAoB;IAC1C,EAAE,EAAE,GAAG,EAAE,oDAAoD;IAC7D,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,EAAE,EAAE,YAAY;IAChB,OAAO,EAAE,gBAAgB;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,gBAAgB,GAAmB;IACxC,gBAAgB,EAAE,IAAI;IACtB,sBAAsB,EAAE,IAAI;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,kBAAkB,GAEpB;IACH,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,OAAO;IACjB,cAAc,EAAE,EAAE;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,YAAY,GAAe;IAChC,OAAO,EAAE,IAAI;IACb,kBAAkB,EAAE;QACnB,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,SAAS;KACnB;IACD,eAAe,EAAE;QAChB,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,SAAS;KACnB;CACD,CAAC;AAEF;;;GAGG;AACH,MAAM,wBAAwB,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AAErE;;;GAGG;AACH,MAAa,mBAAmB;IAc/B,YAAY,MAAqB;QAChC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC;QAEpC,w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OAAO,KAAK,KAAK,CAAC;IACpF,CAAC;IAED,cAAc;QACb,OAAO,IAAI,CAAC,eAAe,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,CAAC;IAC7E,CAAC;IAED,wCAAwC;IAExC,cAAc;QACb,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAED,eAAe;QACd,OAAO,IAAI,CAAC,WAAW,KAAK,SAAS,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC;IACtE,CAAC;IAED,yCAAyC;IAEzC;;;;OAIG;IACH,kBAAkB;QACjB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC7B,CAAC;CACD;AA/OD,kDA+OC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginConfigService.spec.d.ts","sourceRoot":"","sources":["../../src/services/PluginConfigService.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const PluginConfigService_1 = require("./PluginConfigService");
|
|
4
|
+
describe('PluginConfigService', () => {
|
|
5
|
+
describe('classAttributes', () => {
|
|
6
|
+
it('should return default class attributes when not configured', () => {
|
|
7
|
+
const service = new PluginConfigService_1.PluginConfigService({});
|
|
8
|
+
const classAttributes = service.getClassAttributes();
|
|
9
|
+
expect(classAttributes).toContain('className');
|
|
10
|
+
expect(classAttributes).toContain('class');
|
|
11
|
+
expect(classAttributes).toContain('classList');
|
|
12
|
+
expect(classAttributes).toHaveLength(3);
|
|
13
|
+
});
|
|
14
|
+
it('should merge user attributes with defaults', () => {
|
|
15
|
+
const service = new PluginConfigService_1.PluginConfigService({
|
|
16
|
+
classAttributes: ['colorStyles', 'textStyles']
|
|
17
|
+
});
|
|
18
|
+
const classAttributes = service.getClassAttributes();
|
|
19
|
+
expect(classAttributes).toContain('className');
|
|
20
|
+
expect(classAttributes).toContain('class');
|
|
21
|
+
expect(classAttributes).toContain('classList');
|
|
22
|
+
expect(classAttributes).toContain('colorStyles');
|
|
23
|
+
expect(classAttributes).toContain('textStyles');
|
|
24
|
+
expect(classAttributes).toHaveLength(5);
|
|
25
|
+
});
|
|
26
|
+
it('should deduplicate attributes when user provides defaults', () => {
|
|
27
|
+
const service = new PluginConfigService_1.PluginConfigService({
|
|
28
|
+
classAttributes: ['className', 'colorStyles', 'class']
|
|
29
|
+
});
|
|
30
|
+
const classAttributes = service.getClassAttributes();
|
|
31
|
+
// Should not have duplicates
|
|
32
|
+
const uniqueAttributes = [...new Set(classAttributes)];
|
|
33
|
+
expect(classAttributes).toHaveLength(uniqueAttributes.length);
|
|
34
|
+
// Should contain all expected attributes
|
|
35
|
+
expect(classAttributes).toContain('className');
|
|
36
|
+
expect(classAttributes).toContain('class');
|
|
37
|
+
expect(classAttributes).toContain('classList');
|
|
38
|
+
expect(classAttributes).toContain('colorStyles');
|
|
39
|
+
});
|
|
40
|
+
it('should handle empty user attributes array', () => {
|
|
41
|
+
const service = new PluginConfigService_1.PluginConfigService({
|
|
42
|
+
classAttributes: []
|
|
43
|
+
});
|
|
44
|
+
const classAttributes = service.getClassAttributes();
|
|
45
|
+
expect(classAttributes).toContain('className');
|
|
46
|
+
expect(classAttributes).toContain('class');
|
|
47
|
+
expect(classAttributes).toContain('classList');
|
|
48
|
+
expect(classAttributes).toHaveLength(3);
|
|
49
|
+
});
|
|
50
|
+
it('should preserve order with defaults first', () => {
|
|
51
|
+
const service = new PluginConfigService_1.PluginConfigService({
|
|
52
|
+
classAttributes: ['colorStyles']
|
|
53
|
+
});
|
|
54
|
+
const classAttributes = service.getClassAttributes();
|
|
55
|
+
// Default attributes should come first
|
|
56
|
+
expect(classAttributes[0]).toBe('className');
|
|
57
|
+
expect(classAttributes[1]).toBe('class');
|
|
58
|
+
expect(classAttributes[2]).toBe('classList');
|
|
59
|
+
expect(classAttributes[3]).toBe('colorStyles');
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
describe('other configurations', () => {
|
|
63
|
+
it('should initialize with default utilities', () => {
|
|
64
|
+
const service = new PluginConfigService_1.PluginConfigService({});
|
|
65
|
+
const utilities = service.getUtilityFunctions();
|
|
66
|
+
expect(utilities).toContainEqual('cn');
|
|
67
|
+
expect(utilities).toContainEqual({ name: 'clsx', from: 'clsx' });
|
|
68
|
+
});
|
|
69
|
+
it('should enable variants by default', () => {
|
|
70
|
+
const service = new PluginConfigService_1.PluginConfigService({});
|
|
71
|
+
expect(service.isTailwindVariantsEnabled()).toBe(true);
|
|
72
|
+
expect(service.isClassVarianceAuthorityEnabled()).toBe(true);
|
|
73
|
+
});
|
|
74
|
+
it('should enable validation by default', () => {
|
|
75
|
+
const service = new PluginConfigService_1.PluginConfigService({});
|
|
76
|
+
expect(service.isValidationEnabled()).toBe(true);
|
|
77
|
+
expect(service.getValidationSeverity()).toBe('error');
|
|
78
|
+
});
|
|
79
|
+
it('should enable lint by default', () => {
|
|
80
|
+
const service = new PluginConfigService_1.PluginConfigService({});
|
|
81
|
+
expect(service.isLintEnabled()).toBe(true);
|
|
82
|
+
expect(service.isConflictingClassesEnabled()).toBe(true);
|
|
83
|
+
expect(service.isRepeatedClassesEnabled()).toBe(true);
|
|
84
|
+
});
|
|
85
|
+
it('should enable editor features by default', () => {
|
|
86
|
+
const service = new PluginConfigService_1.PluginConfigService({});
|
|
87
|
+
expect(service.isEditorEnabled()).toBe(true);
|
|
88
|
+
expect(service.isAutocompleteEnabled()).toBe(true);
|
|
89
|
+
expect(service.isHoverEnabled()).toBe(true);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=PluginConfigService.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginConfigService.spec.js","sourceRoot":"","sources":["../../src/services/PluginConfigService.spec.ts"],"names":[],"mappings":";;AAAA,+DAA4D;AAE5D,QAAQ,CA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interfaces';
|
|
3
|
-
import {
|
|
3
|
+
import { UtilityFunction } from '../core/types';
|
|
4
|
+
import { ICssProvider } from '../infrastructure/TailwindConflictDetector';
|
|
4
5
|
import { ClassNameExtractionService } from './ClassNameExtractionService';
|
|
5
6
|
import { DiagnosticService } from './DiagnosticService';
|
|
7
|
+
import { PluginConfigService } from './PluginConfigService';
|
|
6
8
|
/**
|
|
7
9
|
* Service responsible for validating class names and creating diagnostics
|
|
8
10
|
* Orchestrates the validation workflow
|
|
@@ -11,21 +13,22 @@ export declare class ValidationService {
|
|
|
11
13
|
private readonly extractionService;
|
|
12
14
|
private readonly diagnosticService;
|
|
13
15
|
private readonly validator;
|
|
14
|
-
private readonly
|
|
16
|
+
private readonly configService;
|
|
15
17
|
private readonly conflictDetector;
|
|
16
|
-
constructor(extractionService: ClassNameExtractionService, diagnosticService: DiagnosticService, validator: IClassNameValidator,
|
|
18
|
+
constructor(extractionService: ClassNameExtractionService, diagnosticService: DiagnosticService, validator: IClassNameValidator, configService: PluginConfigService, cssProvider?: ICssProvider);
|
|
17
19
|
/**
|
|
18
20
|
* Validate a source file and return diagnostics
|
|
19
21
|
* PERFORMANCE OPTIMIZED: Minimal logging overhead
|
|
20
22
|
*/
|
|
21
|
-
validateFile(typescript: typeof ts, sourceFile: ts.SourceFile, utilityFunctions:
|
|
23
|
+
validateFile(typescript: typeof ts, sourceFile: ts.SourceFile, utilityFunctions: UtilityFunction[], typeChecker?: ts.TypeChecker): ts.Diagnostic[];
|
|
22
24
|
/**
|
|
23
25
|
* Filter out valid classes and return only invalid ones
|
|
24
26
|
* PERFORMANCE OPTIMIZED: No logging in hot path
|
|
25
27
|
*/
|
|
26
28
|
private filterInvalidClasses;
|
|
27
29
|
/**
|
|
28
|
-
*
|
|
30
|
+
* Find duplicate and extractable classes within the same attribute
|
|
31
|
+
* Returns true duplicates and extractable classes (same class in both ternary branches)
|
|
29
32
|
*/
|
|
30
33
|
private findDuplicateClasses;
|
|
31
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationService.d.ts","sourceRoot":"","sources":["../../src/services/ValidationService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ValidationService.d.ts","sourceRoot":"","sources":["../../src/services/ValidationService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAiB,eAAe,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,YAAY,EAA4B,MAAM,4CAA4C,CAAC;AACpG,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;GAGG;AACH,qBAAa,iBAAiB;IAI5B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAN/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA2B;gBAG1C,iBAAiB,EAAE,0BAA0B,EAC7C,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,mBAAmB,EAC9B,aAAa,EAAE,mBAAmB,EACnD,WAAW,CAAC,EAAE,YAAY;IAQ3B;;;OAGG;IACH,YAAY,CACX,UAAU,EAAE,OAAO,EAAE,EACrB,UAAU,EAAE,EAAE,CAAC,UAAU,EACzB,gBAAgB,EAAE,eAAe,EAAE,EACnC,WAAW,CAAC,EAAE,EAAE,CAAC,WAAW,GAC1B,EAAE,CAAC,UAAU,EAAE;IA6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