tailwind-typescript-plugin 1.4.0-beta.12 → 1.4.0-beta.15

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +212 -143
  3. package/lib/core/interfaces.d.ts +17 -12
  4. package/lib/core/interfaces.d.ts.map +1 -1
  5. package/lib/core/types.d.ts +81 -0
  6. package/lib/core/types.d.ts.map +1 -1
  7. package/lib/extractors/SvelteAttributeExtractor.d.ts +17 -0
  8. package/lib/extractors/SvelteAttributeExtractor.d.ts.map +1 -0
  9. package/lib/extractors/SvelteAttributeExtractor.js +27 -0
  10. package/lib/extractors/SvelteAttributeExtractor.js.map +1 -0
  11. package/lib/extractors/VueAttributeExtractor.d.ts +18 -0
  12. package/lib/extractors/VueAttributeExtractor.d.ts.map +1 -0
  13. package/lib/extractors/VueAttributeExtractor.js +28 -0
  14. package/lib/extractors/VueAttributeExtractor.js.map +1 -0
  15. package/lib/infrastructure/TailwindValidator.css-vars.spec.js +1 -11
  16. package/lib/infrastructure/TailwindValidator.css-vars.spec.js.map +1 -1
  17. package/lib/infrastructure/TailwindValidator.d.ts +1 -3
  18. package/lib/infrastructure/TailwindValidator.d.ts.map +1 -1
  19. package/lib/infrastructure/TailwindValidator.js +6 -26
  20. package/lib/infrastructure/TailwindValidator.js.map +1 -1
  21. package/lib/infrastructure/TailwindValidator.spec.js +7 -17
  22. package/lib/infrastructure/TailwindValidator.spec.js.map +1 -1
  23. package/lib/plugin/TailwindTypescriptPlugin.d.ts +4 -1
  24. package/lib/plugin/TailwindTypescriptPlugin.d.ts.map +1 -1
  25. package/lib/plugin/TailwindTypescriptPlugin.js +52 -62
  26. package/lib/plugin/TailwindTypescriptPlugin.js.map +1 -1
  27. package/lib/services/ClassNameExtractionService.d.ts +19 -3
  28. package/lib/services/ClassNameExtractionService.d.ts.map +1 -1
  29. package/lib/services/ClassNameExtractionService.js +74 -13
  30. package/lib/services/ClassNameExtractionService.js.map +1 -1
  31. package/lib/services/ClassNameExtractionService.spec.d.ts +2 -0
  32. package/lib/services/ClassNameExtractionService.spec.d.ts.map +1 -0
  33. package/lib/services/ClassNameExtractionService.spec.js +160 -0
  34. package/lib/services/ClassNameExtractionService.spec.js.map +1 -0
  35. package/lib/services/CodeActionService.spec.js +1 -2
  36. package/lib/services/CodeActionService.spec.js.map +1 -1
  37. package/lib/services/CompletionService.d.ts +11 -3
  38. package/lib/services/CompletionService.d.ts.map +1 -1
  39. package/lib/services/CompletionService.js +97 -12
  40. package/lib/services/CompletionService.js.map +1 -1
  41. package/lib/services/CompletionService.spec.js +155 -12
  42. package/lib/services/CompletionService.spec.js.map +1 -1
  43. package/lib/services/ConflictClassDetection.spec.js +5 -5
  44. package/lib/services/ConflictClassDetection.spec.js.map +1 -1
  45. package/lib/services/DiagnosticService.d.ts +8 -8
  46. package/lib/services/DiagnosticService.d.ts.map +1 -1
  47. package/lib/services/DiagnosticService.js +29 -13
  48. package/lib/services/DiagnosticService.js.map +1 -1
  49. package/lib/services/DuplicateClassDetection.spec.js +20 -21
  50. package/lib/services/DuplicateClassDetection.spec.js.map +1 -1
  51. package/lib/services/PluginConfigService.d.ts +38 -15
  52. package/lib/services/PluginConfigService.d.ts.map +1 -1
  53. package/lib/services/PluginConfigService.js +182 -82
  54. package/lib/services/PluginConfigService.js.map +1 -1
  55. package/lib/services/ValidationService.d.ts +5 -4
  56. package/lib/services/ValidationService.d.ts.map +1 -1
  57. package/lib/services/ValidationService.js +39 -42
  58. package/lib/services/ValidationService.js.map +1 -1
  59. package/lib/utils/FrameworkDetector.d.ts +24 -0
  60. package/lib/utils/FrameworkDetector.d.ts.map +1 -0
  61. package/lib/utils/FrameworkDetector.js +52 -0
  62. package/lib/utils/FrameworkDetector.js.map +1 -0
  63. package/lib/utils/FrameworkDetector.spec.d.ts +2 -0
  64. package/lib/utils/FrameworkDetector.spec.d.ts.map +1 -0
  65. package/lib/utils/FrameworkDetector.spec.js +75 -0
  66. package/lib/utils/FrameworkDetector.spec.js.map +1 -0
  67. package/package.json +1 -1
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const FrameworkDetector_1 = require("./FrameworkDetector");
4
+ describe('FrameworkDetector', () => {
5
+ describe('detectFramework', () => {
6
+ it('should detect JSX framework for .tsx files', () => {
7
+ expect((0, FrameworkDetector_1.detectFramework)('App.tsx')).toBe(FrameworkDetector_1.Framework.JSX);
8
+ expect((0, FrameworkDetector_1.detectFramework)('/src/components/Button.tsx')).toBe(FrameworkDetector_1.Framework.JSX);
9
+ });
10
+ it('should detect JSX framework for .jsx files', () => {
11
+ expect((0, FrameworkDetector_1.detectFramework)('App.jsx')).toBe(FrameworkDetector_1.Framework.JSX);
12
+ expect((0, FrameworkDetector_1.detectFramework)('/src/components/Button.jsx')).toBe(FrameworkDetector_1.Framework.JSX);
13
+ });
14
+ it('should detect JSX framework for .ts files', () => {
15
+ expect((0, FrameworkDetector_1.detectFramework)('utils.ts')).toBe(FrameworkDetector_1.Framework.JSX);
16
+ expect((0, FrameworkDetector_1.detectFramework)('/src/lib/helpers.ts')).toBe(FrameworkDetector_1.Framework.JSX);
17
+ });
18
+ it('should detect JSX framework for .js files', () => {
19
+ expect((0, FrameworkDetector_1.detectFramework)('utils.js')).toBe(FrameworkDetector_1.Framework.JSX);
20
+ expect((0, FrameworkDetector_1.detectFramework)('/src/lib/helpers.js')).toBe(FrameworkDetector_1.Framework.JSX);
21
+ });
22
+ it('should detect Vue framework for .vue files', () => {
23
+ expect((0, FrameworkDetector_1.detectFramework)('App.vue')).toBe(FrameworkDetector_1.Framework.VUE);
24
+ expect((0, FrameworkDetector_1.detectFramework)('/src/components/Button.vue')).toBe(FrameworkDetector_1.Framework.VUE);
25
+ });
26
+ it('should detect Svelte framework for .svelte files', () => {
27
+ expect((0, FrameworkDetector_1.detectFramework)('App.svelte')).toBe(FrameworkDetector_1.Framework.SVELTE);
28
+ expect((0, FrameworkDetector_1.detectFramework)('/src/components/Button.svelte')).toBe(FrameworkDetector_1.Framework.SVELTE);
29
+ });
30
+ it('should return null for unsupported file types', () => {
31
+ expect((0, FrameworkDetector_1.detectFramework)('styles.css')).toBeNull();
32
+ expect((0, FrameworkDetector_1.detectFramework)('index.html')).toBeNull();
33
+ expect((0, FrameworkDetector_1.detectFramework)('config.json')).toBeNull();
34
+ expect((0, FrameworkDetector_1.detectFramework)('README.md')).toBeNull();
35
+ });
36
+ it('should handle files with multiple dots in name', () => {
37
+ expect((0, FrameworkDetector_1.detectFramework)('Button.test.tsx')).toBe(FrameworkDetector_1.Framework.JSX);
38
+ expect((0, FrameworkDetector_1.detectFramework)('App.stories.tsx')).toBe(FrameworkDetector_1.Framework.JSX);
39
+ expect((0, FrameworkDetector_1.detectFramework)('Component.spec.vue')).toBe(FrameworkDetector_1.Framework.VUE);
40
+ });
41
+ it('should handle absolute paths', () => {
42
+ expect((0, FrameworkDetector_1.detectFramework)('/Users/dev/project/src/App.tsx')).toBe(FrameworkDetector_1.Framework.JSX);
43
+ expect((0, FrameworkDetector_1.detectFramework)('/Users/dev/project/src/App.vue')).toBe(FrameworkDetector_1.Framework.VUE);
44
+ expect((0, FrameworkDetector_1.detectFramework)('/Users/dev/project/src/App.svelte')).toBe(FrameworkDetector_1.Framework.SVELTE);
45
+ });
46
+ it('should handle Windows paths', () => {
47
+ expect((0, FrameworkDetector_1.detectFramework)('C:\\Users\\dev\\project\\src\\App.tsx')).toBe(FrameworkDetector_1.Framework.JSX);
48
+ expect((0, FrameworkDetector_1.detectFramework)('C:\\Users\\dev\\project\\src\\App.vue')).toBe(FrameworkDetector_1.Framework.VUE);
49
+ });
50
+ });
51
+ describe('isSupportedFile', () => {
52
+ it('should return true for JSX files', () => {
53
+ expect((0, FrameworkDetector_1.isSupportedFile)('App.tsx')).toBe(true);
54
+ expect((0, FrameworkDetector_1.isSupportedFile)('App.jsx')).toBe(true);
55
+ expect((0, FrameworkDetector_1.isSupportedFile)('utils.ts')).toBe(true);
56
+ expect((0, FrameworkDetector_1.isSupportedFile)('utils.js')).toBe(true);
57
+ });
58
+ it('should return true for Vue files', () => {
59
+ expect((0, FrameworkDetector_1.isSupportedFile)('App.vue')).toBe(true);
60
+ expect((0, FrameworkDetector_1.isSupportedFile)('/src/components/Button.vue')).toBe(true);
61
+ });
62
+ it('should return true for Svelte files', () => {
63
+ expect((0, FrameworkDetector_1.isSupportedFile)('App.svelte')).toBe(true);
64
+ expect((0, FrameworkDetector_1.isSupportedFile)('/src/components/Button.svelte')).toBe(true);
65
+ });
66
+ it('should return false for unsupported files', () => {
67
+ expect((0, FrameworkDetector_1.isSupportedFile)('styles.css')).toBe(false);
68
+ expect((0, FrameworkDetector_1.isSupportedFile)('index.html')).toBe(false);
69
+ expect((0, FrameworkDetector_1.isSupportedFile)('config.json')).toBe(false);
70
+ expect((0, FrameworkDetector_1.isSupportedFile)('README.md')).toBe(false);
71
+ expect((0, FrameworkDetector_1.isSupportedFile)('image.png')).toBe(false);
72
+ });
73
+ });
74
+ });
75
+ //# sourceMappingURL=FrameworkDetector.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FrameworkDetector.spec.js","sourceRoot":"","sources":["../../src/utils/FrameworkDetector.spec.ts"],"names":[],"mappings":";;AAAA,2DAAkF;AAElF,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAClC,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;QAChC,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;YACrD,MAAM,CAAC,IAAA,mCAAe,EAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,6BAAS,CAAC,GAAG,CAAC,CAAC;YACvD,MAAM,CAAC,IAAA,mCAAe,EAAC,4BAA4B,CAAC,CAAC,CAAC,IAAI,CAAC,6BAAS,CAAC,GAAG,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG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AC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjD,MAAM,CAAC,IAAA,mCAAe,EAAC,+BAA+B,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;YACpD,MAAM,CAAC,IAAA,mCAAe,EAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAClD,MAAM,CAAC,IAAA,mCAAe,EAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAClD,MAAM,CAAC,IAAA,mCAAe,EAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACnD,MAAM,CAAC,IAAA,mCAAe,EAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACjD,MAAM,CAAC,IAAA,mCAAe,EAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwind-typescript-plugin",
3
- "version": "1.4.0-beta.12",
3
+ "version": "1.4.0-beta.15",
4
4
  "description": "TypeScript Language Service plugin that validates Tailwind CSS class names in JSX/TSX files. Catches typos and invalid classes in real-time with support for tailwind-variants and class-variance-authority.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",