@jesscss/plugin-less-compat 2.0.0-alpha.1 → 2.0.0-alpha.11

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 (112) hide show
  1. package/README.md +50 -115
  2. package/lib/index.cjs +342 -0
  3. package/lib/index.d.ts +2 -2
  4. package/lib/index.js +332 -9
  5. package/lib/less-api-bridge.d.ts +85 -0
  6. package/lib/plugin.d.ts +21 -82
  7. package/package.json +14 -19
  8. package/lib/index.js.map +0 -1
  9. package/lib/less-compat-structures.d.ts +0 -108
  10. package/lib/less-compat-structures.js +0 -519
  11. package/lib/less-compat-structures.js.map +0 -1
  12. package/lib/nodes/at-rule.d.ts +0 -6
  13. package/lib/nodes/at-rule.js +0 -72
  14. package/lib/nodes/at-rule.js.map +0 -1
  15. package/lib/nodes/attribute-selector.d.ts +0 -6
  16. package/lib/nodes/attribute-selector.js +0 -54
  17. package/lib/nodes/attribute-selector.js.map +0 -1
  18. package/lib/nodes/call.d.ts +0 -6
  19. package/lib/nodes/call.js +0 -83
  20. package/lib/nodes/call.js.map +0 -1
  21. package/lib/nodes/color.d.ts +0 -6
  22. package/lib/nodes/color.js +0 -57
  23. package/lib/nodes/color.js.map +0 -1
  24. package/lib/nodes/combinator.d.ts +0 -6
  25. package/lib/nodes/combinator.js +0 -34
  26. package/lib/nodes/combinator.js.map +0 -1
  27. package/lib/nodes/comment.d.ts +0 -6
  28. package/lib/nodes/comment.js +0 -41
  29. package/lib/nodes/comment.js.map +0 -1
  30. package/lib/nodes/condition.d.ts +0 -6
  31. package/lib/nodes/condition.js +0 -60
  32. package/lib/nodes/condition.js.map +0 -1
  33. package/lib/nodes/declaration.d.ts +0 -6
  34. package/lib/nodes/declaration.js +0 -81
  35. package/lib/nodes/declaration.js.map +0 -1
  36. package/lib/nodes/dimension.d.ts +0 -6
  37. package/lib/nodes/dimension.js +0 -47
  38. package/lib/nodes/dimension.js.map +0 -1
  39. package/lib/nodes/expression.d.ts +0 -6
  40. package/lib/nodes/expression.js +0 -44
  41. package/lib/nodes/expression.js.map +0 -1
  42. package/lib/nodes/extend.d.ts +0 -6
  43. package/lib/nodes/extend.js +0 -57
  44. package/lib/nodes/extend.js.map +0 -1
  45. package/lib/nodes/import.d.ts +0 -6
  46. package/lib/nodes/import.js +0 -63
  47. package/lib/nodes/import.js.map +0 -1
  48. package/lib/nodes/index.d.ts +0 -45
  49. package/lib/nodes/index.js +0 -308
  50. package/lib/nodes/index.js.map +0 -1
  51. package/lib/nodes/keyword.d.ts +0 -6
  52. package/lib/nodes/keyword.js +0 -36
  53. package/lib/nodes/keyword.js.map +0 -1
  54. package/lib/nodes/list.d.ts +0 -6
  55. package/lib/nodes/list.js +0 -150
  56. package/lib/nodes/list.js.map +0 -1
  57. package/lib/nodes/mixin.d.ts +0 -6
  58. package/lib/nodes/mixin.js +0 -62
  59. package/lib/nodes/mixin.js.map +0 -1
  60. package/lib/nodes/negative.d.ts +0 -6
  61. package/lib/nodes/negative.js +0 -42
  62. package/lib/nodes/negative.js.map +0 -1
  63. package/lib/nodes/operation.d.ts +0 -6
  64. package/lib/nodes/operation.js +0 -63
  65. package/lib/nodes/operation.js.map +0 -1
  66. package/lib/nodes/paren.d.ts +0 -6
  67. package/lib/nodes/paren.js +0 -42
  68. package/lib/nodes/paren.js.map +0 -1
  69. package/lib/nodes/quoted.d.ts +0 -6
  70. package/lib/nodes/quoted.js +0 -57
  71. package/lib/nodes/quoted.js.map +0 -1
  72. package/lib/nodes/reference.d.ts +0 -9
  73. package/lib/nodes/reference.js +0 -80
  74. package/lib/nodes/reference.js.map +0 -1
  75. package/lib/nodes/ruleset.d.ts +0 -6
  76. package/lib/nodes/ruleset.js +0 -108
  77. package/lib/nodes/ruleset.js.map +0 -1
  78. package/lib/nodes/selector.d.ts +0 -8
  79. package/lib/nodes/selector.js +0 -226
  80. package/lib/nodes/selector.js.map +0 -1
  81. package/lib/nodes/sequence.d.ts +0 -9
  82. package/lib/nodes/sequence.js +0 -75
  83. package/lib/nodes/sequence.js.map +0 -1
  84. package/lib/nodes/url.d.ts +0 -6
  85. package/lib/nodes/url.js +0 -42
  86. package/lib/nodes/url.js.map +0 -1
  87. package/lib/nodes/var-declaration.d.ts +0 -6
  88. package/lib/nodes/var-declaration.js +0 -60
  89. package/lib/nodes/var-declaration.js.map +0 -1
  90. package/lib/plugin-utils.d.ts +0 -20
  91. package/lib/plugin-utils.js +0 -100
  92. package/lib/plugin-utils.js.map +0 -1
  93. package/lib/plugin.js +0 -1027
  94. package/lib/plugin.js.map +0 -1
  95. package/lib/transform/from-less.d.ts +0 -30
  96. package/lib/transform/from-less.js +0 -170
  97. package/lib/transform/from-less.js.map +0 -1
  98. package/lib/transform/index.d.ts +0 -7
  99. package/lib/transform/index.js +0 -8
  100. package/lib/transform/index.js.map +0 -1
  101. package/lib/transform/proxy.d.ts +0 -32
  102. package/lib/transform/proxy.js +0 -138
  103. package/lib/transform/proxy.js.map +0 -1
  104. package/lib/transform/to-less.d.ts +0 -17
  105. package/lib/transform/to-less.js +0 -128
  106. package/lib/transform/to-less.js.map +0 -1
  107. package/lib/transform/type-map.d.ts +0 -27
  108. package/lib/transform/type-map.js +0 -105
  109. package/lib/transform/type-map.js.map +0 -1
  110. package/lib/types.d.ts +0 -33
  111. package/lib/types.js +0 -5
  112. package/lib/types.js.map +0 -1
@@ -1,27 +0,0 @@
1
- /**
2
- * Type mapping utilities for converting between Jess and Less node types
3
- */
4
- /**
5
- * Map Jess node types to Less node types
6
- *
7
- * @param jessType - The Jess node type
8
- * @returns The corresponding Less node type
9
- */
10
- export declare function mapJessTypeToLessType(jessType: string): string;
11
- /**
12
- * Map Less node types to Jess node types
13
- *
14
- * @param lessType - The Less node type
15
- * @returns The corresponding Jess node type
16
- */
17
- export declare function mapLessTypeToJessType(lessType: string): string;
18
- /**
19
- * Get Less typeIndex for a Jess node type
20
- *
21
- * Less.js uses typeIndex for visitor caching. This function
22
- * maps Jess types to their corresponding Less typeIndex values.
23
- *
24
- * @param jessType - The Jess node type
25
- * @returns The Less typeIndex, or undefined if not found
26
- */
27
- export declare function getLessTypeIndex(_jessType: string): number | undefined;
@@ -1,105 +0,0 @@
1
- /**
2
- * Type mapping utilities for converting between Jess and Less node types
3
- */
4
- /**
5
- * Map Jess node types to Less node types
6
- *
7
- * @param jessType - The Jess node type
8
- * @returns The corresponding Less node type
9
- */
10
- export function mapJessTypeToLessType(jessType) {
11
- const typeMap = {
12
- Ruleset: 'Ruleset',
13
- Declaration: 'Declaration',
14
- SelectorList: 'Selector',
15
- ComplexSelector: 'Selector',
16
- CompoundSelector: 'Selector',
17
- BasicSelector: 'Element', // Note: Less's Element includes combinator
18
- Combinator: 'Combinator',
19
- AttributeSelector: 'Attribute',
20
- Dimension: 'Dimension',
21
- Num: 'Dimension',
22
- Reference: 'Variable', // Default, but can be Variable/Property/VariableCall
23
- Mixin: 'MixinDefinition',
24
- Call: 'Call',
25
- Operation: 'Operation',
26
- Expression: 'Expression',
27
- Sequence: 'Expression',
28
- Quoted: 'Quoted',
29
- Url: 'URL',
30
- Color: 'Color',
31
- Comment: 'Comment',
32
- AtRule: 'AtRule',
33
- StyleImport: 'Import',
34
- Extend: 'Extend',
35
- Condition: 'Condition',
36
- Paren: 'Paren',
37
- Negative: 'Negative',
38
- List: 'Value',
39
- VarDeclaration: 'Assignment',
40
- Keyword: 'Keyword'
41
- };
42
- return typeMap[jessType] || jessType;
43
- }
44
- /**
45
- * Map Less node types to Jess node types
46
- *
47
- * @param lessType - The Less node type
48
- * @returns The corresponding Jess node type
49
- */
50
- export function mapLessTypeToJessType(lessType) {
51
- const typeMap = {
52
- Ruleset: 'Ruleset',
53
- Declaration: 'Declaration',
54
- Selector: 'SelectorList', // Less Selector → Jess SelectorList
55
- Element: 'BasicSelector', // Note: Less Element includes combinator
56
- Combinator: 'Combinator',
57
- Attribute: 'AttributeSelector',
58
- Dimension: 'Dimension',
59
- Variable: 'Reference',
60
- Property: 'Reference',
61
- VariableCall: 'Reference',
62
- MixinDefinition: 'Mixin',
63
- MixinCall: 'Call',
64
- Call: 'Call',
65
- Operation: 'Operation',
66
- Expression: 'Expression',
67
- Quoted: 'Quoted',
68
- URL: 'Url',
69
- Color: 'Color',
70
- Comment: 'Comment',
71
- AtRule: 'AtRule',
72
- // Less.js v2 used "Directive" - map to AtRule for compatibility
73
- Directive: 'AtRule',
74
- // Less.js v2 used "Rule" - map to Declaration for compatibility
75
- Rule: 'Declaration',
76
- Import: 'StyleImport',
77
- Extend: 'Extend',
78
- Condition: 'Condition',
79
- Paren: 'Paren',
80
- Negative: 'Negative',
81
- Value: 'List',
82
- Assignment: 'VarDeclaration',
83
- Keyword: 'Keyword'
84
- };
85
- return typeMap[lessType] || lessType;
86
- }
87
- /**
88
- * Get Less typeIndex for a Jess node type
89
- *
90
- * Less.js uses typeIndex for visitor caching. This function
91
- * maps Jess types to their corresponding Less typeIndex values.
92
- *
93
- * @param jessType - The Jess node type
94
- * @returns The Less typeIndex, or undefined if not found
95
- */
96
- export function getLessTypeIndex(_jessType) {
97
- // Less.js assigns typeIndex dynamically, so we'll need to
98
- // either:
99
- // 1. Import Less's tree module and access typeIndex
100
- // 2. Maintain our own mapping
101
- // 3. Set typeIndex dynamically when creating proxies
102
- // For now, return undefined - will be set during proxy creation
103
- return undefined;
104
- }
105
- //# sourceMappingURL=type-map.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"type-map.js","sourceRoot":"","sources":["../../src/transform/type-map.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgB;IACpD,MAAM,OAAO,GAA2B;QACtC,OAAO,EAAE,SAAS;QAClB,WAAW,EAAE,aAAa;QAC1B,YAAY,EAAE,UAAU;QACxB,eAAe,EAAE,UAAU;QAC3B,gBAAgB,EAAE,UAAU;QAC5B,aAAa,EAAE,SAAS,EAAE,2CAA2C;QACrE,UAAU,EAAE,YAAY;QACxB,iBAAiB,EAAE,WAAW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AS,EAAE,QAAQ;QACnB,gEAAgE;QAChE,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,QAAQ;QAChB,SAAS,EAAE,WAAW;QACtB,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,gBAAgB;QAC5B,OAAO,EAAE,SAAS;KACnB,CAAC;IAEF,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC;AACvC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IAChD,0DAA0D;IAC1D,UAAU;IACV,oDAAoD;IACpD,8BAA8B;IAC9B,qDAAqD;IAErD,gEAAgE;IAChE,OAAO,SAAS,CAAC;AACnB,CAAC"}
package/lib/types.d.ts DELETED
@@ -1,33 +0,0 @@
1
- /**
2
- * TypeScript type definitions for Less.js compatibility
3
- */
4
- export type LessNode = any;
5
- /**
6
- * @deprecated Less.js Visitor API - This is a compatibility type for Less.js visitors.
7
- * Use Jess's native Visitor interface instead when possible.
8
- */
9
- export type LessVisitor = any;
10
- export type LessRuleset = any;
11
- export type LessSelector = any;
12
- export type LessElement = any;
13
- export type LessDeclaration = any;
14
- export type LessVariable = any;
15
- export type LessProperty = any;
16
- export type LessVariableCall = any;
17
- export type LessMixinDefinition = any;
18
- export type LessMixinCall = any;
19
- export type LessDimension = any;
20
- export type LessColor = any;
21
- export type LessOperation = any;
22
- export type LessExpression = any;
23
- export type LessQuoted = any;
24
- export type LessURL = any;
25
- export type LessComment = any;
26
- export type LessAtRule = any;
27
- export type LessImport = any;
28
- export type LessExtend = any;
29
- export type LessCondition = any;
30
- export type LessParen = any;
31
- export type LessNegative = any;
32
- export type LessValue = any;
33
- export type LessAssignment = any;
package/lib/types.js DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * TypeScript type definitions for Less.js compatibility
3
- */
4
- export {};
5
- //# sourceMappingURL=types.js.map
package/lib/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}