@jesscss/css-parser 1.0.8-alpha.6 → 2.0.0-alpha.2
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/lib/advancedActionsParser.d.ts +60 -0
- package/lib/advancedActionsParser.js +203 -0
- package/lib/advancedActionsParser.js.map +1 -0
- package/lib/cssActionsParser.d.ts +155 -0
- package/lib/cssActionsParser.js +376 -0
- package/lib/cssActionsParser.js.map +1 -0
- package/lib/cssErrorMessageProvider.d.ts +14 -0
- package/lib/cssErrorMessageProvider.js +40 -0
- package/lib/cssErrorMessageProvider.js.map +1 -0
- package/lib/cssParser.d.ts +36 -103
- package/lib/cssParser.js +75 -58
- package/lib/cssParser.js.map +1 -0
- package/lib/cssTokens.d.ts +539 -5
- package/lib/cssTokens.js +488 -232
- package/lib/cssTokens.js.map +1 -0
- package/lib/index.d.ts +8 -16
- package/lib/index.js +9 -41
- package/lib/index.js.map +1 -0
- package/lib/productions.d.ts +273 -0
- package/lib/productions.js +3499 -0
- package/lib/productions.js.map +1 -0
- package/lib/test/ast-serialize.test.d.ts +1 -0
- package/lib/test/ast-serialize.test.js +157 -0
- package/lib/test/ast-serialize.test.js.map +1 -0
- package/lib/test/container.test.d.ts +1 -0
- package/lib/test/container.test.js +369 -0
- package/lib/test/container.test.js.map +1 -0
- package/lib/test/css-files.test.d.ts +1 -0
- package/lib/test/css-files.test.js +21 -0
- package/lib/test/css-files.test.js.map +1 -0
- package/lib/test/less-output.test.d.ts +1 -0
- package/lib/test/less-output.test.js +52 -0
- package/lib/test/less-output.test.js.map +1 -0
- package/lib/util/cst.d.ts +7 -2
- package/lib/util/cst.js +5 -9
- package/lib/util/cst.js.map +1 -0
- package/lib/util/index.d.ts +19 -13
- package/lib/util/index.js +98 -87
- package/lib/util/index.js.map +1 -0
- package/package.json +43 -20
- package/lib/productions/atRules.d.ts +0 -2
- package/lib/productions/atRules.js +0 -196
- package/lib/productions/blocks.d.ts +0 -2
- package/lib/productions/blocks.js +0 -181
- package/lib/productions/declarations.d.ts +0 -14
- package/lib/productions/declarations.js +0 -59
- package/lib/productions/root.d.ts +0 -2
- package/lib/productions/root.js +0 -49
- package/lib/productions/selectors.d.ts +0 -2
- package/lib/productions/selectors.js +0 -231
- package/lib/productions/values.d.ts +0 -2
- package/lib/productions/values.js +0 -114
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { describe, test, expect } from 'vitest';
|
|
2
|
+
import { CssParser } from '../src/index.js';
|
|
3
|
+
import { serializeTypes } from '@jesscss/core';
|
|
4
|
+
const cssParser = new CssParser();
|
|
5
|
+
describe('@container at-rule parsing and serialization', () => {
|
|
6
|
+
test('basic container query with width condition', () => {
|
|
7
|
+
const { tree, errors } = cssParser.parse('@container (width > 400px) { .card { font-size: 1.5rem; } }');
|
|
8
|
+
expect(errors.length).toBe(0);
|
|
9
|
+
const out = serializeTypes(tree);
|
|
10
|
+
expect(out).toContain('AtRule');
|
|
11
|
+
expect(out).toContain('@container');
|
|
12
|
+
expect(out).toContain('width');
|
|
13
|
+
});
|
|
14
|
+
test('container query with container name', () => {
|
|
15
|
+
const { tree, errors } = cssParser.parse('@container sidebar (width > 400px) { .card { font-size: 1.5rem; } }');
|
|
16
|
+
expect(errors.length).toBe(0);
|
|
17
|
+
const out = serializeTypes(tree);
|
|
18
|
+
expect(out).toContain('AtRule');
|
|
19
|
+
expect(out).toContain('@container');
|
|
20
|
+
expect(out).toContain('sidebar');
|
|
21
|
+
});
|
|
22
|
+
test('container query with min-width', () => {
|
|
23
|
+
const { tree, errors } = cssParser.parse('@container (min-width: 300px) { .card { padding: 1rem; } }');
|
|
24
|
+
expect(errors.length).toBe(0);
|
|
25
|
+
const out = serializeTypes(tree);
|
|
26
|
+
expect(out).toContain('AtRule');
|
|
27
|
+
expect(out).toContain('@container');
|
|
28
|
+
});
|
|
29
|
+
test('container query with max-width', () => {
|
|
30
|
+
const { tree, errors } = cssParser.parse('@container (max-width: 600px) { .card { padding: 0.5rem; } }');
|
|
31
|
+
expect(errors.length).toBe(0);
|
|
32
|
+
const out = serializeTypes(tree);
|
|
33
|
+
expect(out).toContain('AtRule');
|
|
34
|
+
expect(out).toContain('@container');
|
|
35
|
+
});
|
|
36
|
+
test('container query with height condition', () => {
|
|
37
|
+
const { tree, errors } = cssParser.parse('@container (height > 300px) { .card { display: flex; } }');
|
|
38
|
+
expect(errors.length).toBe(0);
|
|
39
|
+
const out = serializeTypes(tree);
|
|
40
|
+
expect(out).toContain('AtRule');
|
|
41
|
+
expect(out).toContain('@container');
|
|
42
|
+
});
|
|
43
|
+
test('container query with multiple conditions using AND', () => {
|
|
44
|
+
const { tree, errors } = cssParser.parse('@container (width > 400px) and (height > 300px) { .card { flex-direction: column; } }');
|
|
45
|
+
expect(errors.length).toBe(0);
|
|
46
|
+
const out = serializeTypes(tree);
|
|
47
|
+
expect(out).toContain('AtRule');
|
|
48
|
+
expect(out).toContain('@container');
|
|
49
|
+
expect(out).toContain('and');
|
|
50
|
+
});
|
|
51
|
+
test('container query with OR condition', () => {
|
|
52
|
+
const { tree, errors } = cssParser.parse('@container (width > 400px) or (height > 300px) { .card { display: grid; } }');
|
|
53
|
+
expect(errors.length).toBe(0);
|
|
54
|
+
const out = serializeTypes(tree);
|
|
55
|
+
expect(out).toContain('AtRule');
|
|
56
|
+
expect(out).toContain('@container');
|
|
57
|
+
});
|
|
58
|
+
test('container query with NOT condition', () => {
|
|
59
|
+
const { tree, errors } = cssParser.parse('@container not (width < 400px) { .card { font-size: 1.2rem; } }');
|
|
60
|
+
expect(errors.length).toBe(0);
|
|
61
|
+
const atRule = tree.value[0];
|
|
62
|
+
const prelude = atRule.value.prelude;
|
|
63
|
+
const queryNode = prelude.value ? prelude.value[0] : prelude;
|
|
64
|
+
expect(queryNode.type).toBe('QueryCondition');
|
|
65
|
+
expect(queryNode.value.length).toBe(2);
|
|
66
|
+
expect(queryNode.value[0].value).toBe('not');
|
|
67
|
+
expect(queryNode.value[1].type).toBe('Paren');
|
|
68
|
+
const out = serializeTypes(tree);
|
|
69
|
+
expect(out).toContain('AtRule');
|
|
70
|
+
expect(out).toContain('@container');
|
|
71
|
+
expect(out).toContain('QueryCondition');
|
|
72
|
+
});
|
|
73
|
+
test('container query with nested conditions', () => {
|
|
74
|
+
const { tree, errors } = cssParser.parse('@container ((width > 400px) and (height > 300px)) { .card { padding: 2rem; } }');
|
|
75
|
+
expect(errors.length).toBe(0);
|
|
76
|
+
const out = serializeTypes(tree);
|
|
77
|
+
expect(out).toContain('AtRule');
|
|
78
|
+
expect(out).toContain('@container');
|
|
79
|
+
});
|
|
80
|
+
test('container query with comma-separated queries', () => {
|
|
81
|
+
const { tree, errors } = cssParser.parse('@container (width > 400px), (height > 300px) { .card { margin: 1rem; } }');
|
|
82
|
+
expect(errors.length).toBe(0);
|
|
83
|
+
const out = serializeTypes(tree);
|
|
84
|
+
expect(out).toContain('AtRule');
|
|
85
|
+
expect(out).toContain('@container');
|
|
86
|
+
expect(out).toContain('List');
|
|
87
|
+
});
|
|
88
|
+
test('container query with container name and condition', () => {
|
|
89
|
+
const { tree, errors } = cssParser.parse('@container main (width > 500px) { .content { max-width: 1200px; } }');
|
|
90
|
+
expect(errors.length).toBe(0);
|
|
91
|
+
const out = serializeTypes(tree);
|
|
92
|
+
expect(out).toContain('AtRule');
|
|
93
|
+
expect(out).toContain('@container');
|
|
94
|
+
expect(out).toContain('main');
|
|
95
|
+
});
|
|
96
|
+
test('container query with aspect-ratio', () => {
|
|
97
|
+
const { tree, errors } = cssParser.parse('@container (aspect-ratio > 1) { .card { display: flex; } }');
|
|
98
|
+
expect(errors.length).toBe(0);
|
|
99
|
+
const out = serializeTypes(tree);
|
|
100
|
+
expect(out).toContain('AtRule');
|
|
101
|
+
expect(out).toContain('@container');
|
|
102
|
+
});
|
|
103
|
+
test('container query with orientation', () => {
|
|
104
|
+
const { tree, errors } = cssParser.parse('@container (orientation: landscape) { .card { flex-direction: row; } }');
|
|
105
|
+
expect(errors.length).toBe(0);
|
|
106
|
+
const out = serializeTypes(tree);
|
|
107
|
+
expect(out).toContain('AtRule');
|
|
108
|
+
expect(out).toContain('@container');
|
|
109
|
+
});
|
|
110
|
+
test('container query with inline-size', () => {
|
|
111
|
+
const { tree, errors } = cssParser.parse('@container (inline-size > 400px) { .card { width: 100%; } }');
|
|
112
|
+
expect(errors.length).toBe(0);
|
|
113
|
+
const out = serializeTypes(tree);
|
|
114
|
+
expect(out).toContain('AtRule');
|
|
115
|
+
expect(out).toContain('@container');
|
|
116
|
+
});
|
|
117
|
+
test('container query with block-size', () => {
|
|
118
|
+
const { tree, errors } = cssParser.parse('@container (block-size < 500px) { .card { height: auto; } }');
|
|
119
|
+
expect(errors.length).toBe(0);
|
|
120
|
+
const out = serializeTypes(tree);
|
|
121
|
+
expect(out).toContain('AtRule');
|
|
122
|
+
expect(out).toContain('@container');
|
|
123
|
+
});
|
|
124
|
+
test('container query with range syntax', () => {
|
|
125
|
+
const { tree, errors } = cssParser.parse('@container (400px < width < 800px) { .card { padding: 1rem; } }');
|
|
126
|
+
expect(errors.length).toBe(0);
|
|
127
|
+
const out = serializeTypes(tree);
|
|
128
|
+
expect(out).toContain('AtRule');
|
|
129
|
+
expect(out).toContain('@container');
|
|
130
|
+
});
|
|
131
|
+
test('nested container query', () => {
|
|
132
|
+
const { tree, errors } = cssParser.parse('@container (width > 400px) { @container (height > 300px) { .card { display: flex; } } }');
|
|
133
|
+
expect(errors.length).toBe(0);
|
|
134
|
+
const out = serializeTypes(tree);
|
|
135
|
+
expect(out).toContain('AtRule');
|
|
136
|
+
expect(out).toContain('@container');
|
|
137
|
+
});
|
|
138
|
+
test('simple container query parses as QueryCondition in Paren', () => {
|
|
139
|
+
const { tree, errors } = cssParser.parse('@container (width > 400px) { .card {} }');
|
|
140
|
+
expect(errors.length).toBe(0);
|
|
141
|
+
const atRule = tree.value[0];
|
|
142
|
+
const prelude = atRule.value.prelude;
|
|
143
|
+
const queryNode = prelude.value[0];
|
|
144
|
+
const out = serializeTypes(tree);
|
|
145
|
+
expect(queryNode.type).toBe('Paren');
|
|
146
|
+
expect(queryNode.value.type).toBe('QueryCondition');
|
|
147
|
+
expect(queryNode.value.value.length).toBe(3);
|
|
148
|
+
expect(out).toContain('QueryCondition');
|
|
149
|
+
expect(out).toContain('Paren');
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
describe('@media at-rule - QueryCondition parsing', () => {
|
|
153
|
+
test('simple media query parses as QueryCondition in Paren (no outer QueryCondition)', () => {
|
|
154
|
+
const { tree, errors } = cssParser.parse('@media (width > 400px) { .card {} }');
|
|
155
|
+
expect(errors.length).toBe(0);
|
|
156
|
+
const atRule = tree.value[0];
|
|
157
|
+
const prelude = atRule.value.prelude;
|
|
158
|
+
const queryNode = Array.isArray(prelude.value) ? prelude.value[0] : prelude;
|
|
159
|
+
const out = serializeTypes(tree);
|
|
160
|
+
if (queryNode) {
|
|
161
|
+
expect(queryNode.type).toBe('Paren');
|
|
162
|
+
expect(queryNode.value.type).toBe('QueryCondition');
|
|
163
|
+
expect(queryNode.value.value.length).toBe(3);
|
|
164
|
+
}
|
|
165
|
+
expect(out).toContain('QueryCondition');
|
|
166
|
+
expect(out).toContain('Paren');
|
|
167
|
+
});
|
|
168
|
+
test('media query with colon syntax parses as Declaration', () => {
|
|
169
|
+
const { tree, errors } = cssParser.parse('@media (min-width: 300px) { .card {} }');
|
|
170
|
+
expect(errors.length).toBe(0);
|
|
171
|
+
const out = serializeTypes(tree);
|
|
172
|
+
expect(out).toContain('Declaration');
|
|
173
|
+
expect(out).toContain('min-width');
|
|
174
|
+
});
|
|
175
|
+
test('simple comparison operator has role=operator', () => {
|
|
176
|
+
const { tree, errors } = cssParser.parse('@media (width > 400px) { .card {} }');
|
|
177
|
+
expect(errors.length).toBe(0);
|
|
178
|
+
const out = serializeTypes(tree);
|
|
179
|
+
expect(out).toContain('role=operator');
|
|
180
|
+
expect(out).toContain('>');
|
|
181
|
+
});
|
|
182
|
+
test('keywords and, or have role=keyword', () => {
|
|
183
|
+
const { tree, errors } = cssParser.parse('@media (width > 400px) and (height > 300px) { .card {} }');
|
|
184
|
+
expect(errors.length).toBe(0);
|
|
185
|
+
const out = serializeTypes(tree);
|
|
186
|
+
expect(out).toContain('role=keyword');
|
|
187
|
+
expect(out).toContain('and');
|
|
188
|
+
});
|
|
189
|
+
test('not keyword has role=keyword', () => {
|
|
190
|
+
const { tree, errors } = cssParser.parse('@media not (width > 400px) { .card {} }');
|
|
191
|
+
expect(errors.length).toBe(0);
|
|
192
|
+
const out = serializeTypes(tree);
|
|
193
|
+
expect(out).toContain('role=keyword');
|
|
194
|
+
expect(out).toContain('not');
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
describe('@container - container query type functions', () => {
|
|
198
|
+
test('scroll-state with QueryCondition argument', () => {
|
|
199
|
+
const { tree, errors } = cssParser.parse('@container scroll-state((stuck: top) and (stuck: left)) { .card {} }');
|
|
200
|
+
expect(errors.length).toBe(0);
|
|
201
|
+
const out = serializeTypes(tree);
|
|
202
|
+
expect(out).toContain('Call');
|
|
203
|
+
expect(out).toContain('scroll-state');
|
|
204
|
+
expect(out).toContain('QueryCondition');
|
|
205
|
+
expect(out).toContain('Paren');
|
|
206
|
+
expect(out).toContain('Declaration');
|
|
207
|
+
expect(out).toContain('stuck');
|
|
208
|
+
expect(out).toContain('and');
|
|
209
|
+
// Verify structure: Call -> List -> QueryCondition -> [Paren(Declaration), Any('and'), Paren(Declaration)]
|
|
210
|
+
const atRule = tree.value[0];
|
|
211
|
+
const prelude = atRule.value.prelude;
|
|
212
|
+
const queryNode = prelude.value[0];
|
|
213
|
+
expect(queryNode.type).toBe('QueryCondition');
|
|
214
|
+
expect(queryNode.value[0].type).toBe('Call');
|
|
215
|
+
expect(queryNode.value[0].value.name).toBe('scroll-state');
|
|
216
|
+
expect(queryNode.value[0].value.args.type).toBe('List');
|
|
217
|
+
const argList = queryNode.value[0].value.args.value;
|
|
218
|
+
expect(argList.length).toBe(1);
|
|
219
|
+
expect(argList[0].type).toBe('QueryCondition');
|
|
220
|
+
expect(argList[0].value.length).toBe(3); // Paren, Any('and'), Paren
|
|
221
|
+
expect(argList[0].value[0].type).toBe('Paren');
|
|
222
|
+
expect(argList[0].value[0].value.type).toBe('Declaration');
|
|
223
|
+
expect(argList[0].value[1].type).toBe('Any');
|
|
224
|
+
expect(argList[0].value[1].value).toBe('and');
|
|
225
|
+
expect(argList[0].value[2].type).toBe('Paren');
|
|
226
|
+
expect(argList[0].value[2].value.type).toBe('Declaration');
|
|
227
|
+
});
|
|
228
|
+
test('not scroll-state with declaration argument', () => {
|
|
229
|
+
const { tree, errors } = cssParser.parse('@container not scroll-state(stuck: none) { .card {} }');
|
|
230
|
+
expect(errors.length).toBe(0);
|
|
231
|
+
const out = serializeTypes(tree);
|
|
232
|
+
expect(out).toContain('Call');
|
|
233
|
+
expect(out).toContain('scroll-state');
|
|
234
|
+
expect(out).toContain('not');
|
|
235
|
+
expect(out).toContain('stuck');
|
|
236
|
+
// Verify structure: QueryCondition -> [Any('not'), QueryCondition -> [Call]]
|
|
237
|
+
const atRule = tree.value[0];
|
|
238
|
+
const prelude = atRule.value.prelude;
|
|
239
|
+
const queryNode = prelude.value[0];
|
|
240
|
+
expect(queryNode.type).toBe('QueryCondition');
|
|
241
|
+
expect(queryNode.value.length).toBe(2);
|
|
242
|
+
expect(queryNode.value[0].type).toBe('Any');
|
|
243
|
+
expect(queryNode.value[0].value).toBe('not');
|
|
244
|
+
expect(queryNode.value[1].type).toBe('QueryCondition');
|
|
245
|
+
expect(queryNode.value[1].value[0].type).toBe('Call');
|
|
246
|
+
expect(queryNode.value[1].value[0].value.name).toBe('scroll-state');
|
|
247
|
+
});
|
|
248
|
+
test('complex style() queries with commas, and/or/not', () => {
|
|
249
|
+
const { tree, errors } = cssParser.parse(`@container style(--themeBackground),
|
|
250
|
+
not style(background-color: red),
|
|
251
|
+
style(color: green) and style(background-color: transparent),
|
|
252
|
+
style(--themeColor: blue) or style(--themeColor: purple) { .card {} }`);
|
|
253
|
+
expect(errors.length).toBe(0);
|
|
254
|
+
const out = serializeTypes(tree);
|
|
255
|
+
expect(out).toContain('Call');
|
|
256
|
+
expect(out).toContain('style');
|
|
257
|
+
expect(out).toContain('not');
|
|
258
|
+
expect(out).toContain('and');
|
|
259
|
+
expect(out).toContain('or');
|
|
260
|
+
expect(out).toContain('List');
|
|
261
|
+
// Verify structure: List of queries, each can be QueryCondition
|
|
262
|
+
const atRule = tree.value[0];
|
|
263
|
+
const prelude = atRule.value.prelude;
|
|
264
|
+
const queryNode = prelude.value[0];
|
|
265
|
+
expect(queryNode.type).toBe('List');
|
|
266
|
+
expect(queryNode.value.length).toBe(4); // 4 comma-separated queries
|
|
267
|
+
});
|
|
268
|
+
// Examples from container.less
|
|
269
|
+
test('size() function from container.less', () => {
|
|
270
|
+
const { tree, errors } = cssParser.parse('@container size(min-width: 60ch) { .article--post header {} }');
|
|
271
|
+
expect(errors.length).toBe(0);
|
|
272
|
+
const out = serializeTypes(tree);
|
|
273
|
+
expect(out).toContain('Call');
|
|
274
|
+
expect(out).toContain('size');
|
|
275
|
+
expect(out).toContain('min-width');
|
|
276
|
+
});
|
|
277
|
+
test('style() function with custom property from container.less', () => {
|
|
278
|
+
const { tree, errors } = cssParser.parse('@container style(--responsive: true) { .card-content {} }');
|
|
279
|
+
expect(errors.length).toBe(0);
|
|
280
|
+
const out = serializeTypes(tree);
|
|
281
|
+
expect(out).toContain('Call');
|
|
282
|
+
expect(out).toContain('style');
|
|
283
|
+
expect(out).toContain('--responsive');
|
|
284
|
+
});
|
|
285
|
+
test('scroll-state with single declaration from container.less', () => {
|
|
286
|
+
const { tree, errors } = cssParser.parse('@container scroll-state(stuck: top) { .card {} }');
|
|
287
|
+
expect(errors.length).toBe(0);
|
|
288
|
+
const out = serializeTypes(tree);
|
|
289
|
+
expect(out).toContain('Call');
|
|
290
|
+
expect(out).toContain('scroll-state');
|
|
291
|
+
expect(out).toContain('stuck');
|
|
292
|
+
});
|
|
293
|
+
test('scroll-state with snapped from container.less', () => {
|
|
294
|
+
const { tree, errors } = cssParser.parse('@container scroll-state(snapped: x) { .card {} }');
|
|
295
|
+
expect(errors.length).toBe(0);
|
|
296
|
+
const out = serializeTypes(tree);
|
|
297
|
+
expect(out).toContain('Call');
|
|
298
|
+
expect(out).toContain('scroll-state');
|
|
299
|
+
expect(out).toContain('snapped');
|
|
300
|
+
});
|
|
301
|
+
test('scroll-state with scrollable from container.less', () => {
|
|
302
|
+
const { tree, errors } = cssParser.parse('@container scroll-state(scrollable: top) { .card {} }');
|
|
303
|
+
expect(errors.length).toBe(0);
|
|
304
|
+
const out = serializeTypes(tree);
|
|
305
|
+
expect(out).toContain('Call');
|
|
306
|
+
expect(out).toContain('scroll-state');
|
|
307
|
+
expect(out).toContain('scrollable');
|
|
308
|
+
});
|
|
309
|
+
// MDN-style examples
|
|
310
|
+
test('MDN example: basic container query with width', () => {
|
|
311
|
+
const { tree, errors } = cssParser.parse('@container (min-width: 700px) { .card h2 { font-size: 2em; } }');
|
|
312
|
+
expect(errors.length).toBe(0);
|
|
313
|
+
const out = serializeTypes(tree);
|
|
314
|
+
expect(out).toContain('AtRule');
|
|
315
|
+
expect(out).toContain('@container');
|
|
316
|
+
expect(out).toContain('min-width');
|
|
317
|
+
});
|
|
318
|
+
test('MDN example: container with name and query', () => {
|
|
319
|
+
const { tree, errors } = cssParser.parse('@container sidebar (min-width: 700px) { .card { font-size: 2em; } }');
|
|
320
|
+
expect(errors.length).toBe(0);
|
|
321
|
+
const out = serializeTypes(tree);
|
|
322
|
+
expect(out).toContain('AtRule');
|
|
323
|
+
expect(out).toContain('sidebar');
|
|
324
|
+
expect(out).toContain('min-width');
|
|
325
|
+
});
|
|
326
|
+
// Complex examples from container.less
|
|
327
|
+
test('container.less: width >= with and condition', () => {
|
|
328
|
+
const { tree, errors } = cssParser.parse('@container (width >= 500px) and (height >= 500px) { .card-content h2 {} }');
|
|
329
|
+
expect(errors.length).toBe(0);
|
|
330
|
+
const out = serializeTypes(tree);
|
|
331
|
+
expect(out).toContain('QueryCondition');
|
|
332
|
+
expect(out).toContain('and');
|
|
333
|
+
expect(out).toContain('>=');
|
|
334
|
+
});
|
|
335
|
+
test('container.less: width > with and not condition', () => {
|
|
336
|
+
const { tree, errors } = cssParser.parse('@container (width > 760px) and not (height > 670px) { .card-content h2 {} }');
|
|
337
|
+
expect(errors.length).toBe(0);
|
|
338
|
+
const out = serializeTypes(tree);
|
|
339
|
+
expect(out).toContain('QueryCondition');
|
|
340
|
+
expect(out).toContain('and');
|
|
341
|
+
expect(out).toContain('not');
|
|
342
|
+
});
|
|
343
|
+
test('container.less: not with <= condition', () => {
|
|
344
|
+
const { tree, errors } = cssParser.parse('@container not (height <= 1080px) { .card-content h2 {} }');
|
|
345
|
+
expect(errors.length).toBe(0);
|
|
346
|
+
const out = serializeTypes(tree);
|
|
347
|
+
expect(out).toContain('QueryCondition');
|
|
348
|
+
expect(out).toContain('not');
|
|
349
|
+
expect(out).toContain('<=');
|
|
350
|
+
});
|
|
351
|
+
test('container.less: or condition with <', () => {
|
|
352
|
+
const { tree, errors } = cssParser.parse('@container (width < 500px) or (height < 500px) { .card-content h2 {} }');
|
|
353
|
+
expect(errors.length).toBe(0);
|
|
354
|
+
const out = serializeTypes(tree);
|
|
355
|
+
expect(out).toContain('QueryCondition');
|
|
356
|
+
expect(out).toContain('or');
|
|
357
|
+
expect(out).toContain('<');
|
|
358
|
+
});
|
|
359
|
+
test('container.less: nested or with and', () => {
|
|
360
|
+
const { tree, errors } = cssParser.parse('@container ((width < 500px) or (height < 500px)) and (inline-size >= 0px) { .card-content p {} }');
|
|
361
|
+
expect(errors.length).toBe(0);
|
|
362
|
+
const out = serializeTypes(tree);
|
|
363
|
+
expect(out).toContain('QueryCondition');
|
|
364
|
+
expect(out).toContain('or');
|
|
365
|
+
expect(out).toContain('and');
|
|
366
|
+
expect(out).toContain('inline-size');
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
//# s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CAAC,kGAAkG,CAAC,CAAC;QAC7I,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,GAAG,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;QACjC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACxC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC5B,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7B,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as glob from 'glob';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
import { CssParser } from '../src/index.js';
|
|
5
|
+
const cssParser = new CssParser();
|
|
6
|
+
describe('regular CSS - local fixtures', () => {
|
|
7
|
+
const baseDir = path.join(__dirname, 'css');
|
|
8
|
+
glob.sync(path.join(baseDir, '**/*.css'))
|
|
9
|
+
.sort()
|
|
10
|
+
.forEach((file) => {
|
|
11
|
+
if (!file.includes('errors')) {
|
|
12
|
+
it(path.relative(baseDir, file), () => {
|
|
13
|
+
const contents = fs.readFileSync(file, 'utf8');
|
|
14
|
+
const { lexerResult, errors } = cssParser.parse(contents);
|
|
15
|
+
expect(lexerResult.errors.length).toBe(0);
|
|
16
|
+
expect(errors.length).toBe(0);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=css-files.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-files.test.js","sourceRoot":"","sources":["../../test/css-files.test.ts"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* as path from 'path';
|
|
4
|
+
import { CssParser } from '../src/index.js';
|
|
5
|
+
import { invalidCSSOutput, notSameSerialized } from '@jesscss/shared';
|
|
6
|
+
const testData = path.dirname(require.resolve('@less/test-data'));
|
|
7
|
+
const cssParser = new CssParser({ legacyMode: true });
|
|
8
|
+
describe('Less CSS output - valid cases', () => {
|
|
9
|
+
glob.sync(path.join(testData, 'tests-unit/*/permissive-parse.css'))
|
|
10
|
+
.map(value => path.relative(testData, value))
|
|
11
|
+
.filter(value => !invalidCSSOutput.includes(value))
|
|
12
|
+
.sort()
|
|
13
|
+
.forEach((file) => {
|
|
14
|
+
it(file, () => {
|
|
15
|
+
const contents = fs.readFileSync(path.join(testData, file), 'utf8');
|
|
16
|
+
const { tree, lexerResult, errors } = cssParser.parse(contents);
|
|
17
|
+
// Some Less outputs can contain minor parse notes; assert no hard errors
|
|
18
|
+
if (errors.length > 0) {
|
|
19
|
+
// Log details to debug regressions in a Vitest-compatible way
|
|
20
|
+
// Only log for the two files currently regressing to reduce noise
|
|
21
|
+
console.error('Parse errors for', file, errors.map(e => e.message));
|
|
22
|
+
const err = errors[0];
|
|
23
|
+
const off = err?.token?.startOffset ?? 0;
|
|
24
|
+
const start = Math.max(0, off - 60);
|
|
25
|
+
const end = Math.min(contents.length, off + 60);
|
|
26
|
+
const excerpt = contents.slice(start, end).replace(/\n/g, '\\n');
|
|
27
|
+
console.error('Near offset', off, '... ', excerpt);
|
|
28
|
+
}
|
|
29
|
+
expect(lexerResult.errors.length).toBe(0);
|
|
30
|
+
expect(errors.length).toBe(0);
|
|
31
|
+
if (!(['test/css/custom-properties.css'].includes(file)) && !(notSameSerialized.includes(file))) {
|
|
32
|
+
// Print a short diff-friendly message instead of throwing if contents missing
|
|
33
|
+
expect(`${tree}`).toBe(contents);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
describe('Less CSS output - invalid cases', () => {
|
|
39
|
+
glob.sync(path.join(testData, 'tests-unit/*/*.css'))
|
|
40
|
+
.map(value => path.relative(testData, value))
|
|
41
|
+
.filter(value => invalidCSSOutput.includes(value))
|
|
42
|
+
.sort()
|
|
43
|
+
.forEach((file) => {
|
|
44
|
+
it(file, () => {
|
|
45
|
+
const contents = fs.readFileSync(path.join(testData, file), 'utf8');
|
|
46
|
+
const { lexerResult, errors } = cssParser.parse(contents);
|
|
47
|
+
expect(lexerResult.errors.length).toBe(0);
|
|
48
|
+
expect(errors.length).toBeGreaterThan(0);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=less-output.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"less-output.test.js","sourceRoot":"","sources":["../../test/less-output.test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEtE,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAClE,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;AAEtD,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,mCAAmC,CAAC,CAAC;SAChE,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;SAC5C,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,gBAAgB,CAAC,QAAQ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,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/lib/util/cst.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { IToken } from 'chevrotain';
|
|
2
|
+
type AdvancedCstNode = {
|
|
3
|
+
name: string;
|
|
4
|
+
childrenStream: Array<AdvancedCstNode | IToken>;
|
|
5
|
+
};
|
|
6
|
+
export declare const stringify: (cst: AdvancedCstNode) => string;
|
|
7
|
+
export {};
|
package/lib/util/cst.js
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stringify = void 0;
|
|
4
|
-
const stringify = (cst) => {
|
|
1
|
+
export const stringify = (cst) => {
|
|
5
2
|
let output = '';
|
|
6
3
|
const recurseCst = (node) => {
|
|
7
4
|
if (!node) {
|
|
8
5
|
return;
|
|
9
6
|
}
|
|
10
7
|
if ('name' in node) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
node.children.forEach(child => recurseCst(child));
|
|
8
|
+
node.childrenStream.forEach((child) => {
|
|
9
|
+
recurseCst(child);
|
|
10
|
+
});
|
|
15
11
|
return;
|
|
16
12
|
}
|
|
17
13
|
output += node.image;
|
|
@@ -19,4 +15,4 @@ const stringify = (cst) => {
|
|
|
19
15
|
recurseCst(cst);
|
|
20
16
|
return output;
|
|
21
17
|
};
|
|
22
|
-
|
|
18
|
+
//# sourceMappingURL=cst.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cst.js","sourceRoot":"","sources":["../../src/util/cst.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAoB,EAAU,EAAE;IACxD,IAAI,MAAM,GAAG,EAAE,CAAC;IAEhB,MAAM,UAAU,GAAG,CAAC,IAA8B,EAAQ,EAAE;QAC1D,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;QACT,CAAC;QACD,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;YACnB,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;gBACpC,UAAU,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QACD,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC;IACvB,CAAC,CAAC;IACF,UAAU,CAAC,GAAG,CAAC,CAAC;IAEhB,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/lib/util/index.d.ts
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
|
-
import { ITokenConfig, TokenType, TokenPattern } from 'chevrotain';
|
|
2
|
-
export * from './cst';
|
|
1
|
+
import type { ITokenConfig, TokenType, IMultiModeLexerDefinition, TokenPattern } from 'chevrotain';
|
|
3
2
|
export declare enum LexerType {
|
|
4
3
|
NA = 0,
|
|
5
4
|
SKIPPED = 1
|
|
6
5
|
}
|
|
7
|
-
export interface
|
|
8
|
-
[
|
|
9
|
-
}
|
|
10
|
-
export interface rawTokenConfig extends Omit<ITokenConfig, 'longer_alt' | 'categories' | 'pattern' | 'group'> {
|
|
11
|
-
pattern: TokenPattern | LexerType | [string, Function];
|
|
6
|
+
export interface RawToken extends Omit<ITokenConfig, 'longer_alt' | 'categories' | 'pattern' | 'group' | 'start_chars_hint'> {
|
|
7
|
+
pattern: TokenPattern | LexerType | readonly [string, (this: RegExp, text: string, startOffset: number) => any];
|
|
12
8
|
group?: ITokenConfig['group'] | LexerType;
|
|
13
|
-
longer_alt?: string;
|
|
14
|
-
categories?: string[];
|
|
9
|
+
longer_alt?: string | readonly string[];
|
|
10
|
+
categories?: readonly string[];
|
|
11
|
+
start_chars_hint?: readonly string[];
|
|
15
12
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
export type RawTokenConfig = Readonly<RawToken[]>;
|
|
14
|
+
export type RawModeConfig = Readonly<{
|
|
15
|
+
modes: {
|
|
16
|
+
Default: ReadonlyArray<Readonly<RawToken>>;
|
|
17
|
+
[k: string]: ReadonlyArray<string | Readonly<RawToken>>;
|
|
18
|
+
};
|
|
19
|
+
defaultMode: 'Default';
|
|
20
|
+
}>;
|
|
21
|
+
export interface ILexer {
|
|
22
|
+
T: Record<string, TokenType>;
|
|
23
|
+
lexer: IMultiModeLexerDefinition;
|
|
19
24
|
}
|
|
25
|
+
export declare function buildFragments(rawFragments: ReadonlyArray<Readonly<[string, string]>>): Record<string, RegExp>;
|
|
20
26
|
/**
|
|
21
27
|
* Builds proper tokens from a raw token definition.
|
|
22
28
|
* This allows us to extend / modify tokens before creating them
|
|
23
29
|
*/
|
|
24
|
-
export declare
|
|
30
|
+
export declare function createLexerDefinition(rawFragments: ReadonlyArray<Readonly<[string, string]>>, _rawTokens: RawModeConfig): ILexer;
|