@plumeria/codemod 18.2.17 → 18.2.18
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/README.md +122 -0
- package/dist/cli.js +73 -4
- package/dist/release.d.ts +22 -0
- package/dist/release.js +268 -0
- package/dist/transforms/from-plumeria.d.ts +37 -0
- package/dist/transforms/from-plumeria.js +436 -0
- package/dist/transforms/release-styles.d.ts +22 -0
- package/dist/transforms/release-styles.js +344 -0
- package/package.json +3 -2
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.__private = void 0;
|
|
4
|
+
exports.extractPlumeriaThemes = extractPlumeriaThemes;
|
|
5
|
+
exports.extractPlumeriaAnimations = extractPlumeriaAnimations;
|
|
6
|
+
exports.convertPlumeriaModule = convertPlumeriaModule;
|
|
7
|
+
const parser_1 = require("@typescript-eslint/parser");
|
|
8
|
+
const zss_engine_1 = require("zss-engine");
|
|
9
|
+
const propertyKey = (node) => {
|
|
10
|
+
if (!node)
|
|
11
|
+
return undefined;
|
|
12
|
+
if (node.type === 'Identifier')
|
|
13
|
+
return node.name;
|
|
14
|
+
return node.type === 'Literal' ? String(node.value) : undefined;
|
|
15
|
+
};
|
|
16
|
+
const memberPath = (node) => {
|
|
17
|
+
if (node?.type === 'Identifier')
|
|
18
|
+
return [node.name];
|
|
19
|
+
if (node?.type !== 'MemberExpression')
|
|
20
|
+
return undefined;
|
|
21
|
+
const parent = memberPath(node.object);
|
|
22
|
+
const key = node.computed
|
|
23
|
+
? propertyKey(node.property)
|
|
24
|
+
: node.property?.type === 'Identifier'
|
|
25
|
+
? node.property.name
|
|
26
|
+
: undefined;
|
|
27
|
+
return parent && key !== undefined ? [...parent, key] : undefined;
|
|
28
|
+
};
|
|
29
|
+
const lookup = (path, values) => {
|
|
30
|
+
let value = values.get(path[0]);
|
|
31
|
+
for (const key of path.slice(1)) {
|
|
32
|
+
if (!value || typeof value !== 'object')
|
|
33
|
+
return undefined;
|
|
34
|
+
value = value[key];
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
37
|
+
};
|
|
38
|
+
const evaluate = (node, values) => {
|
|
39
|
+
if (!node)
|
|
40
|
+
return undefined;
|
|
41
|
+
if (node.type === 'Literal')
|
|
42
|
+
return node.value;
|
|
43
|
+
if (node.type === 'Identifier')
|
|
44
|
+
return values.get(node.name);
|
|
45
|
+
if (node.type === 'MemberExpression') {
|
|
46
|
+
const path = memberPath(node);
|
|
47
|
+
return path ? lookup(path, values) : undefined;
|
|
48
|
+
}
|
|
49
|
+
if (node.type === 'TemplateLiteral') {
|
|
50
|
+
let result = '';
|
|
51
|
+
for (let index = 0; index < node.quasis.length; index++) {
|
|
52
|
+
result += node.quasis[index].value.cooked;
|
|
53
|
+
if (index < node.expressions.length) {
|
|
54
|
+
const value = evaluate(node.expressions[index], values);
|
|
55
|
+
if (value === undefined || typeof value === 'object')
|
|
56
|
+
return undefined;
|
|
57
|
+
result += String(value);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
if (node.type === 'ObjectExpression') {
|
|
63
|
+
const result = {};
|
|
64
|
+
for (const property of node.properties) {
|
|
65
|
+
if (property.type !== 'Property' || property.kind !== 'init')
|
|
66
|
+
return undefined;
|
|
67
|
+
const key = property.computed
|
|
68
|
+
? evaluate(property.key, values)
|
|
69
|
+
: propertyKey(property.key);
|
|
70
|
+
if (typeof key !== 'string')
|
|
71
|
+
return undefined;
|
|
72
|
+
const value = evaluate(property.value, values);
|
|
73
|
+
if (value === undefined)
|
|
74
|
+
return undefined;
|
|
75
|
+
result[key] = value;
|
|
76
|
+
}
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
return undefined;
|
|
80
|
+
};
|
|
81
|
+
exports.__private = { propertyKey, memberPath, evaluate };
|
|
82
|
+
const isCall = (node, method) => {
|
|
83
|
+
if (node?.type !== 'CallExpression')
|
|
84
|
+
return false;
|
|
85
|
+
const path = memberPath(node.callee);
|
|
86
|
+
return path?.length === 2 && path[1] === method;
|
|
87
|
+
};
|
|
88
|
+
const declarationOf = (statement) => statement.type === 'ExportNamedDeclaration'
|
|
89
|
+
? statement.declaration
|
|
90
|
+
: statement;
|
|
91
|
+
const readThemes = (ast) => {
|
|
92
|
+
const values = new Map();
|
|
93
|
+
const reports = [];
|
|
94
|
+
const globalRules = [];
|
|
95
|
+
const report = (node, kind, hint) => {
|
|
96
|
+
reports.push({
|
|
97
|
+
line: node.loc.start.line,
|
|
98
|
+
column: node.loc.start.column + 1,
|
|
99
|
+
kind,
|
|
100
|
+
hint,
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
for (const raw of ast.body) {
|
|
104
|
+
const statement = declarationOf(raw);
|
|
105
|
+
if (statement?.type !== 'VariableDeclaration')
|
|
106
|
+
continue;
|
|
107
|
+
for (const declaration of statement.declarations) {
|
|
108
|
+
if (declaration.id.type !== 'Identifier' ||
|
|
109
|
+
!isCall(declaration.init, 'createTheme'))
|
|
110
|
+
continue;
|
|
111
|
+
const selector = evaluate(declaration.init.arguments[0], new Map());
|
|
112
|
+
const theme = evaluate(declaration.init.arguments[1], new Map());
|
|
113
|
+
if (typeof selector !== 'string' || !theme || typeof theme !== 'object') {
|
|
114
|
+
report(declaration.init, 'dynamic-create-theme', '`createTheme` needs a static selector and static token values.');
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
const rootDeclarations = [];
|
|
118
|
+
const themeDeclarations = [];
|
|
119
|
+
const references = {};
|
|
120
|
+
let valid = true;
|
|
121
|
+
for (const [key, rawPair] of Object.entries(theme)) {
|
|
122
|
+
if (!rawPair || typeof rawPair !== 'object') {
|
|
123
|
+
valid = false;
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
const pair = rawPair;
|
|
127
|
+
if ((typeof pair.default !== 'string' &&
|
|
128
|
+
typeof pair.default !== 'number') ||
|
|
129
|
+
(typeof pair.theme !== 'string' && typeof pair.theme !== 'number')) {
|
|
130
|
+
valid = false;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
const hash = (0, zss_engine_1.genBase36Hash)({ [key]: pair }, 1, 8);
|
|
134
|
+
const variable = `--${hash}-${(0, zss_engine_1.camelToKebabCase)(key)}`;
|
|
135
|
+
rootDeclarations.push(` ${variable}: ${String(pair.default)};`);
|
|
136
|
+
themeDeclarations.push(` ${variable}: ${String(pair.theme)};`);
|
|
137
|
+
references[key] = `var(${variable})`;
|
|
138
|
+
}
|
|
139
|
+
if (!valid) {
|
|
140
|
+
report(declaration.init, 'dynamic-create-theme', 'Every theme token needs static `default` and `theme` values.');
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
values.set(declaration.id.name, references);
|
|
144
|
+
globalRules.push(`:where(:root) {\n${rootDeclarations.join('\n')}\n}`);
|
|
145
|
+
const target = selector.startsWith('@') ||
|
|
146
|
+
selector.startsWith('.') ||
|
|
147
|
+
selector.startsWith('#') ||
|
|
148
|
+
selector.startsWith(':') ||
|
|
149
|
+
selector.startsWith('[')
|
|
150
|
+
? selector
|
|
151
|
+
: `.${selector}`;
|
|
152
|
+
if ((0, zss_engine_1.isAtRule)(target)) {
|
|
153
|
+
globalRules.push(`${target} {\n :where(:root) {\n${themeDeclarations
|
|
154
|
+
.map((line) => ` ${line}`)
|
|
155
|
+
.join('\n')}\n }\n}`);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
globalRules.push(`${target} {\n${themeDeclarations.join('\n')}\n}`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
bindings: Object.fromEntries(values),
|
|
164
|
+
globalCss: globalRules.length > 0 ? `${globalRules.join('\n\n')}\n` : '',
|
|
165
|
+
reports,
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
function extractPlumeriaThemes(source) {
|
|
169
|
+
const ast = (0, parser_1.parse)(source, {
|
|
170
|
+
sourceType: 'module',
|
|
171
|
+
ecmaFeatures: { jsx: true },
|
|
172
|
+
loc: true,
|
|
173
|
+
range: true,
|
|
174
|
+
});
|
|
175
|
+
return readThemes(ast);
|
|
176
|
+
}
|
|
177
|
+
const emitGlobalObject = (selector, object) => {
|
|
178
|
+
const declarations = [];
|
|
179
|
+
const children = [];
|
|
180
|
+
for (const [key, value] of Object.entries(object)) {
|
|
181
|
+
if (value && typeof value === 'object') {
|
|
182
|
+
children.push(emitGlobalObject(key, value)
|
|
183
|
+
.split('\n')
|
|
184
|
+
.map((line) => ` ${line}`)
|
|
185
|
+
.join('\n'));
|
|
186
|
+
}
|
|
187
|
+
else if (typeof value === 'string' || typeof value === 'number') {
|
|
188
|
+
const property = (0, zss_engine_1.camelToKebabCase)(key);
|
|
189
|
+
declarations.push(` ${property}: ${(0, zss_engine_1.applyCssValue)(value, property)};`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const content = [...declarations, ...children].join('\n');
|
|
193
|
+
return `${selector} {\n${content}\n}`;
|
|
194
|
+
};
|
|
195
|
+
function extractPlumeriaAnimations(source, externalValues = {}) {
|
|
196
|
+
const ast = (0, parser_1.parse)(source, {
|
|
197
|
+
sourceType: 'module',
|
|
198
|
+
ecmaFeatures: { jsx: true },
|
|
199
|
+
loc: true,
|
|
200
|
+
range: true,
|
|
201
|
+
});
|
|
202
|
+
const values = new Map(Object.entries(externalValues));
|
|
203
|
+
const bindings = {};
|
|
204
|
+
const reports = [];
|
|
205
|
+
const rules = [];
|
|
206
|
+
const keyframes = [];
|
|
207
|
+
const viewTransitions = [];
|
|
208
|
+
const report = (node, kind, hint) => {
|
|
209
|
+
reports.push({
|
|
210
|
+
line: node.loc.start.line,
|
|
211
|
+
column: node.loc.start.column + 1,
|
|
212
|
+
kind,
|
|
213
|
+
hint,
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
const declarations = ast.body.flatMap((raw) => {
|
|
217
|
+
const statement = declarationOf(raw);
|
|
218
|
+
return statement?.type === 'VariableDeclaration'
|
|
219
|
+
? statement.declarations
|
|
220
|
+
: [];
|
|
221
|
+
});
|
|
222
|
+
for (const declaration of declarations) {
|
|
223
|
+
if (declaration.id.type !== 'Identifier' ||
|
|
224
|
+
!isCall(declaration.init, 'keyframes'))
|
|
225
|
+
continue;
|
|
226
|
+
const object = evaluate(declaration.init.arguments[0], values);
|
|
227
|
+
if (!object || typeof object !== 'object') {
|
|
228
|
+
report(declaration.init, 'dynamic-keyframes', '`keyframes` needs a statically resolvable object.');
|
|
229
|
+
continue;
|
|
230
|
+
}
|
|
231
|
+
const hash = (0, zss_engine_1.genBase36Hash)(object, 1, 8);
|
|
232
|
+
const name = `kf-${hash}`;
|
|
233
|
+
values.set(declaration.id.name, name);
|
|
234
|
+
bindings[declaration.id.name] = name;
|
|
235
|
+
keyframes.push(declaration.id.name);
|
|
236
|
+
rules.push(emitGlobalObject(`@keyframes ${name}`, object));
|
|
237
|
+
}
|
|
238
|
+
for (const declaration of declarations) {
|
|
239
|
+
if (declaration.id.type !== 'Identifier' ||
|
|
240
|
+
!isCall(declaration.init, 'viewTransition'))
|
|
241
|
+
continue;
|
|
242
|
+
const object = evaluate(declaration.init.arguments[0], values);
|
|
243
|
+
if (!object || typeof object !== 'object') {
|
|
244
|
+
report(declaration.init, 'dynamic-view-transition', '`viewTransition` needs a statically resolvable object.');
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
const hash = (0, zss_engine_1.genBase36Hash)(object, 1, 8);
|
|
248
|
+
const name = `vt-${hash}`;
|
|
249
|
+
values.set(declaration.id.name, name);
|
|
250
|
+
bindings[declaration.id.name] = name;
|
|
251
|
+
viewTransitions.push(declaration.id.name);
|
|
252
|
+
for (const part of ['group', 'imagePair', 'old', 'new']) {
|
|
253
|
+
const style = object[part];
|
|
254
|
+
if (style && typeof style === 'object') {
|
|
255
|
+
const pseudoPart = part === 'imagePair' ? 'image-pair' : part;
|
|
256
|
+
rules.push(emitGlobalObject(`::view-transition-${pseudoPart}(${name})`, style));
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return {
|
|
261
|
+
bindings,
|
|
262
|
+
keyframes,
|
|
263
|
+
viewTransitions,
|
|
264
|
+
globalCss: rules.length > 0 ? `${rules.join('\n\n')}\n` : '',
|
|
265
|
+
reports,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
function convertPlumeriaModule(source, externalValues = {}) {
|
|
269
|
+
const ast = (0, parser_1.parse)(source, {
|
|
270
|
+
sourceType: 'module',
|
|
271
|
+
ecmaFeatures: { jsx: true },
|
|
272
|
+
loc: true,
|
|
273
|
+
range: true,
|
|
274
|
+
});
|
|
275
|
+
const themes = readThemes(ast);
|
|
276
|
+
const animations = extractPlumeriaAnimations(source, {
|
|
277
|
+
...externalValues,
|
|
278
|
+
...themes.bindings,
|
|
279
|
+
});
|
|
280
|
+
const values = new Map([
|
|
281
|
+
...Object.entries(externalValues),
|
|
282
|
+
...Object.entries(themes.bindings),
|
|
283
|
+
...Object.entries(animations.bindings),
|
|
284
|
+
]);
|
|
285
|
+
const reports = [...themes.reports, ...animations.reports];
|
|
286
|
+
const creates = [];
|
|
287
|
+
const report = (node, kind, hint) => {
|
|
288
|
+
reports.push({
|
|
289
|
+
line: node.loc.start.line,
|
|
290
|
+
column: node.loc.start.column + 1,
|
|
291
|
+
kind,
|
|
292
|
+
hint,
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
for (const raw of ast.body) {
|
|
296
|
+
const statement = declarationOf(raw);
|
|
297
|
+
if (statement?.type !== 'VariableDeclaration')
|
|
298
|
+
continue;
|
|
299
|
+
for (const declaration of statement.declarations) {
|
|
300
|
+
if (declaration.id.type !== 'Identifier')
|
|
301
|
+
continue;
|
|
302
|
+
if (isCall(declaration.init, 'createStatic')) {
|
|
303
|
+
const value = evaluate(declaration.init.arguments[0], values);
|
|
304
|
+
if (value && typeof value === 'object') {
|
|
305
|
+
values.set(declaration.id.name, value);
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
report(declaration.init, 'dynamic-create-static', '`createStatic` must contain values that can be written into CSS.');
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
if (isCall(declaration.init, 'create')) {
|
|
312
|
+
const object = declaration.init.arguments[0];
|
|
313
|
+
if (object?.type === 'ObjectExpression') {
|
|
314
|
+
creates.push({ binding: declaration.id.name, object });
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
report(declaration.init, 'dynamic-create', '`css.create` must receive an object literal.');
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
if (creates.length === 0)
|
|
323
|
+
return null;
|
|
324
|
+
if (creates.length > 1) {
|
|
325
|
+
report(creates[1].object, 'multiple-create', 'Move each `css.create` call to its own module before exporting to CSS Modules.');
|
|
326
|
+
}
|
|
327
|
+
const { binding, object } = creates[0];
|
|
328
|
+
const rules = [];
|
|
329
|
+
const keys = [];
|
|
330
|
+
const functions = {};
|
|
331
|
+
const emit = (style, selector, wrappers = [], scope = values) => {
|
|
332
|
+
if (style?.type !== 'ObjectExpression') {
|
|
333
|
+
report(style, 'dynamic-style', 'Only static style objects are exported.');
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
const declarations = [];
|
|
337
|
+
const nested = [];
|
|
338
|
+
for (const property of style.properties) {
|
|
339
|
+
if (property.type !== 'Property' || property.kind !== 'init') {
|
|
340
|
+
report(property, 'spread-style', 'Spread styles must be expanded before exporting to CSS Modules.');
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
const rawKey = property.computed
|
|
344
|
+
? evaluate(property.key, scope)
|
|
345
|
+
: propertyKey(property.key);
|
|
346
|
+
if (typeof rawKey !== 'string') {
|
|
347
|
+
report(property.key, 'dynamic-key', 'Selector and property keys must be statically known.');
|
|
348
|
+
continue;
|
|
349
|
+
}
|
|
350
|
+
if (rawKey.startsWith(':') ||
|
|
351
|
+
rawKey.startsWith('[') ||
|
|
352
|
+
rawKey.startsWith('@')) {
|
|
353
|
+
nested.push({ key: rawKey, value: property.value });
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
356
|
+
const value = evaluate(property.value, scope);
|
|
357
|
+
if (typeof value !== 'string' && typeof value !== 'number') {
|
|
358
|
+
report(property.value, 'dynamic-value', `The value of \`${rawKey}\` cannot be represented statically.`);
|
|
359
|
+
continue;
|
|
360
|
+
}
|
|
361
|
+
const cssProperty = (0, zss_engine_1.camelToKebabCase)(rawKey);
|
|
362
|
+
declarations.push(` ${cssProperty}: ${(0, zss_engine_1.applyCssValue)(value, cssProperty)};`);
|
|
363
|
+
}
|
|
364
|
+
if (declarations.length > 0) {
|
|
365
|
+
let rule = `${selector} {\n${declarations.join('\n')}\n}`;
|
|
366
|
+
for (const wrapper of [...wrappers].reverse()) {
|
|
367
|
+
rule = `${wrapper} {\n${rule
|
|
368
|
+
.split('\n')
|
|
369
|
+
.map((line) => ` ${line}`)
|
|
370
|
+
.join('\n')}\n}`;
|
|
371
|
+
}
|
|
372
|
+
rules.push(rule);
|
|
373
|
+
}
|
|
374
|
+
for (const child of nested) {
|
|
375
|
+
if (child.key.startsWith('@')) {
|
|
376
|
+
emit(child.value, selector, [...wrappers, child.key], scope);
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
emit(child.value, `${selector}${child.key}`, wrappers, scope);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
for (const property of object.properties) {
|
|
384
|
+
if (property.type !== 'Property' || property.kind !== 'init') {
|
|
385
|
+
report(property, 'spread-create', 'Top-level spreads cannot name a CSS Module class.');
|
|
386
|
+
continue;
|
|
387
|
+
}
|
|
388
|
+
const key = property.computed
|
|
389
|
+
? evaluate(property.key, values)
|
|
390
|
+
: propertyKey(property.key);
|
|
391
|
+
if (typeof key !== 'string') {
|
|
392
|
+
report(property.key, 'dynamic-style-key', 'Style names must be statically known.');
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
395
|
+
if (property.value.type === 'ArrowFunctionExpression' ||
|
|
396
|
+
property.value.type === 'FunctionExpression') {
|
|
397
|
+
const params = [];
|
|
398
|
+
let valid = true;
|
|
399
|
+
for (const parameter of property.value.params) {
|
|
400
|
+
if (parameter.type !== 'Identifier') {
|
|
401
|
+
valid = false;
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
params.push(parameter.name);
|
|
405
|
+
}
|
|
406
|
+
let body = property.value.body;
|
|
407
|
+
if (body.type === 'BlockStatement') {
|
|
408
|
+
const returned = body.body.find((statement) => statement.type === 'ReturnStatement');
|
|
409
|
+
body = returned?.argument;
|
|
410
|
+
}
|
|
411
|
+
if (!valid || body?.type !== 'ObjectExpression') {
|
|
412
|
+
report(property.value, 'function-style', 'Function style keys need identifier parameters and an object return value.');
|
|
413
|
+
continue;
|
|
414
|
+
}
|
|
415
|
+
const variables = params.map((parameter) => `--${(0, zss_engine_1.camelToKebabCase)(binding)}-${(0, zss_engine_1.camelToKebabCase)(key)}-${(0, zss_engine_1.camelToKebabCase)(parameter)}`);
|
|
416
|
+
const scope = new Map(values);
|
|
417
|
+
params.forEach((parameter, index) => {
|
|
418
|
+
scope.set(parameter, `var(${variables[index]})`);
|
|
419
|
+
});
|
|
420
|
+
functions[key] = { params, variables };
|
|
421
|
+
keys.push(key);
|
|
422
|
+
emit(body, `.${key}`, [], scope);
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
keys.push(key);
|
|
426
|
+
emit(property.value, `.${key}`);
|
|
427
|
+
}
|
|
428
|
+
return {
|
|
429
|
+
binding,
|
|
430
|
+
css: rules.length > 0 ? `${rules.join('\n\n')}\n` : '',
|
|
431
|
+
globalCss: `${themes.globalCss}${animations.globalCss}`,
|
|
432
|
+
keys,
|
|
433
|
+
functions,
|
|
434
|
+
reports,
|
|
435
|
+
};
|
|
436
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
export interface ReleaseModule {
|
|
3
|
+
source: string;
|
|
4
|
+
binding: string;
|
|
5
|
+
functions?: Record<string, {
|
|
6
|
+
params: string[];
|
|
7
|
+
variables: string[];
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
export interface ReleaseStylesOptions {
|
|
11
|
+
modules: Record<string, ReleaseModule>;
|
|
12
|
+
themes?: Record<string, string[]>;
|
|
13
|
+
animations?: Record<string, string[]>;
|
|
14
|
+
styleProp?: string;
|
|
15
|
+
active?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const __private: {
|
|
18
|
+
memberPath: (node: any) => string[] | undefined;
|
|
19
|
+
isCreate: (node: any) => boolean;
|
|
20
|
+
needsFilter: (node: any) => boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare const releaseStyles: Rule.RuleModule;
|