@nordcraft/search 1.0.38 → 1.0.39
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/dist/fixProject.js +32 -0
- package/dist/fixProject.js.map +1 -0
- package/dist/problems.worker.js +45 -8
- package/dist/problems.worker.js.map +1 -1
- package/dist/rules/components/noReferenceComponentRule.js +31 -17
- package/dist/rules/components/noReferenceComponentRule.js.map +1 -1
- package/dist/rules/components/noReferenceComponentRule.test.js +86 -1
- package/dist/rules/components/noReferenceComponentRule.test.js.map +1 -1
- package/dist/rules/formulas/legacyFormulaRule.js +620 -6
- package/dist/rules/formulas/legacyFormulaRule.js.map +1 -1
- package/dist/rules/formulas/legacyFormulaRule.test.js +232 -1
- package/dist/rules/formulas/legacyFormulaRule.test.js.map +1 -1
- package/dist/searchProject.js +338 -217
- package/dist/searchProject.js.map +1 -1
- package/dist/util/helpers.js +18 -2
- package/dist/util/helpers.js.map +1 -1
- package/dist/util/helpers.test.js +58 -0
- package/dist/util/helpers.test.js.map +1 -0
- package/package.json +3 -2
- package/src/fixProject.ts +47 -0
- package/src/problems.worker.ts +90 -12
- package/src/rules/components/noReferenceComponentRule.test.ts +87 -1
- package/src/rules/components/noReferenceComponentRule.ts +38 -23
- package/src/rules/formulas/legacyFormulaRule.test.ts +242 -1
- package/src/rules/formulas/legacyFormulaRule.ts +719 -10
- package/src/searchProject.ts +217 -98
- package/src/types.d.ts +14 -3
- package/src/util/helpers.test.ts +80 -0
- package/src/util/helpers.ts +33 -5
package/dist/searchProject.js
CHANGED
|
@@ -4,16 +4,8 @@ import { isToddleFormula } from '@nordcraft/core/dist/formula/formulaTypes';
|
|
|
4
4
|
import { ToddleFormula } from '@nordcraft/core/dist/formula/ToddleFormula';
|
|
5
5
|
import { ToddleApiService } from '@nordcraft/ssr/dist/ToddleApiService';
|
|
6
6
|
import { ToddleRoute } from '@nordcraft/ssr/dist/ToddleRoute';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
* Search a project by applying rules to all nodes in the project and returning reported results.
|
|
10
|
-
*
|
|
11
|
-
* @param files All files to check against
|
|
12
|
-
* @param rules All rules to check against
|
|
13
|
-
* @param pathsToVisit Only visit specific paths. All subpaths are visited as well. For example, ['components', 'test'] would visit everything under the test component. Defaults is `[]` which means all paths are visited.
|
|
14
|
-
* @returns A generator that yields results as they are found
|
|
15
|
-
*/
|
|
16
|
-
export function* searchProject({ files, rules, pathsToVisit = [], state, }) {
|
|
7
|
+
import { shouldSearchExactPath, shouldVisitTree } from './util/helpers';
|
|
8
|
+
export function* searchProject({ files, rules, pathsToVisit = [], useExactPaths = false, state, fixOptions, }) {
|
|
17
9
|
const memos = new Map();
|
|
18
10
|
const memo = (key, fn) => {
|
|
19
11
|
const stringKey = Array.isArray(key) ? key.join('/') : key;
|
|
@@ -28,108 +20,163 @@ export function* searchProject({ files, rules, pathsToVisit = [], state, }) {
|
|
|
28
20
|
const component = files.components[key];
|
|
29
21
|
if (component) {
|
|
30
22
|
yield* visitNode({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
args: {
|
|
24
|
+
nodeType: 'component',
|
|
25
|
+
value: component,
|
|
26
|
+
path: ['components', key],
|
|
27
|
+
rules,
|
|
28
|
+
files,
|
|
29
|
+
pathsToVisit,
|
|
30
|
+
useExactPaths,
|
|
31
|
+
memo,
|
|
32
|
+
},
|
|
33
|
+
state,
|
|
34
|
+
fixOptions: fixOptions,
|
|
35
|
+
});
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
38
|
for (const key in files.formulas) {
|
|
42
39
|
yield* visitNode({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
args: {
|
|
41
|
+
nodeType: 'project-formula',
|
|
42
|
+
value: files.formulas[key],
|
|
43
|
+
path: ['formulas', key],
|
|
44
|
+
rules,
|
|
45
|
+
files,
|
|
46
|
+
pathsToVisit,
|
|
47
|
+
useExactPaths,
|
|
48
|
+
memo,
|
|
49
|
+
},
|
|
50
|
+
state,
|
|
51
|
+
fixOptions: fixOptions,
|
|
52
|
+
});
|
|
51
53
|
}
|
|
52
54
|
for (const key in files.actions) {
|
|
53
55
|
yield* visitNode({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
args: {
|
|
57
|
+
nodeType: 'project-action',
|
|
58
|
+
value: files.actions[key],
|
|
59
|
+
path: ['actions', key],
|
|
60
|
+
rules,
|
|
61
|
+
files,
|
|
62
|
+
pathsToVisit,
|
|
63
|
+
useExactPaths,
|
|
64
|
+
memo,
|
|
65
|
+
},
|
|
66
|
+
state,
|
|
67
|
+
fixOptions: fixOptions,
|
|
68
|
+
});
|
|
62
69
|
}
|
|
63
70
|
for (const key in files.themes) {
|
|
64
71
|
yield* visitNode({
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
files,
|
|
70
|
-
pathsToVisit,
|
|
71
|
-
memo,
|
|
72
|
-
}, state);
|
|
73
|
-
}
|
|
74
|
-
if (files.services) {
|
|
75
|
-
for (const key in files.services) {
|
|
76
|
-
yield* visitNode({
|
|
77
|
-
nodeType: 'api-service',
|
|
78
|
-
value: files.services[key],
|
|
79
|
-
path: ['services', key],
|
|
72
|
+
args: {
|
|
73
|
+
nodeType: 'project-theme',
|
|
74
|
+
value: files.themes[key],
|
|
75
|
+
path: ['themes', key],
|
|
80
76
|
rules,
|
|
81
77
|
files,
|
|
82
78
|
pathsToVisit,
|
|
79
|
+
useExactPaths,
|
|
83
80
|
memo,
|
|
84
|
-
},
|
|
81
|
+
},
|
|
82
|
+
state,
|
|
83
|
+
fixOptions: fixOptions,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (files.services) {
|
|
87
|
+
for (const key in files.services) {
|
|
88
|
+
yield* visitNode({
|
|
89
|
+
args: {
|
|
90
|
+
nodeType: 'api-service',
|
|
91
|
+
value: files.services[key],
|
|
92
|
+
path: ['services', key],
|
|
93
|
+
rules,
|
|
94
|
+
files,
|
|
95
|
+
pathsToVisit,
|
|
96
|
+
useExactPaths,
|
|
97
|
+
memo,
|
|
98
|
+
},
|
|
99
|
+
state,
|
|
100
|
+
fixOptions: fixOptions,
|
|
101
|
+
});
|
|
85
102
|
}
|
|
86
103
|
}
|
|
87
104
|
if (files.routes) {
|
|
88
105
|
for (const key in files.routes) {
|
|
89
106
|
yield* visitNode({
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
107
|
+
args: {
|
|
108
|
+
nodeType: 'project-route',
|
|
109
|
+
value: files.routes[key],
|
|
110
|
+
routeName: key,
|
|
111
|
+
path: ['routes', key],
|
|
112
|
+
rules,
|
|
113
|
+
files,
|
|
114
|
+
pathsToVisit,
|
|
115
|
+
useExactPaths,
|
|
116
|
+
memo,
|
|
117
|
+
},
|
|
118
|
+
state,
|
|
119
|
+
fixOptions: fixOptions,
|
|
120
|
+
});
|
|
99
121
|
}
|
|
100
122
|
}
|
|
101
123
|
yield* visitNode({
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
124
|
+
args: {
|
|
125
|
+
nodeType: 'project-config',
|
|
126
|
+
value: files.config,
|
|
127
|
+
path: ['config'],
|
|
128
|
+
rules,
|
|
129
|
+
files,
|
|
130
|
+
pathsToVisit,
|
|
131
|
+
useExactPaths,
|
|
132
|
+
memo,
|
|
133
|
+
},
|
|
134
|
+
state,
|
|
135
|
+
fixOptions: fixOptions,
|
|
136
|
+
});
|
|
110
137
|
}
|
|
111
|
-
function* visitNode(args, state) {
|
|
112
|
-
|
|
113
|
-
const { rules, pathsToVisit, ...data } = args;
|
|
138
|
+
function* visitNode({ args, state, fixOptions, }) {
|
|
139
|
+
const { rules, pathsToVisit, useExactPaths, ...data } = args;
|
|
114
140
|
const { files, value, path, memo, nodeType } = data;
|
|
115
|
-
if (!
|
|
141
|
+
if (!shouldVisitTree({
|
|
142
|
+
path: data.path,
|
|
143
|
+
pathsToVisit,
|
|
144
|
+
})) {
|
|
145
|
+
// We don't need to search this path or any of its subpaths
|
|
116
146
|
return;
|
|
117
147
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
148
|
+
if (!useExactPaths ||
|
|
149
|
+
shouldSearchExactPath({ path: data.path, pathsToVisit })) {
|
|
150
|
+
if (fixOptions) {
|
|
151
|
+
// We're fixing issues
|
|
152
|
+
for (const rule of rules) {
|
|
153
|
+
const fixedFiles = rule.fixes?.[fixOptions.fixType]?.(data, state);
|
|
154
|
+
if (fixedFiles) {
|
|
155
|
+
yield fixedFiles;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
// We're looking for issues
|
|
161
|
+
const results = [];
|
|
162
|
+
for (const rule of rules) {
|
|
163
|
+
// eslint-disable-next-line no-console
|
|
164
|
+
console.timeStamp(`Visiting rule ${rule.code}`);
|
|
165
|
+
rule.visit((path, details, fixes) => {
|
|
166
|
+
results.push({
|
|
167
|
+
code: rule.code,
|
|
168
|
+
category: rule.category,
|
|
169
|
+
level: rule.level,
|
|
170
|
+
path,
|
|
171
|
+
details,
|
|
172
|
+
fixes,
|
|
173
|
+
});
|
|
174
|
+
}, data, state);
|
|
175
|
+
}
|
|
176
|
+
for (const result of results) {
|
|
177
|
+
yield result;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
133
180
|
}
|
|
134
181
|
switch (nodeType) {
|
|
135
182
|
case 'component': {
|
|
@@ -144,140 +191,195 @@ function* visitNode(args, state) {
|
|
|
144
191
|
});
|
|
145
192
|
for (const key in value.attributes) {
|
|
146
193
|
yield* visitNode({
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
194
|
+
args: {
|
|
195
|
+
nodeType: 'component-attribute',
|
|
196
|
+
value: value.attributes[key],
|
|
197
|
+
path: [...path, 'attributes', key],
|
|
198
|
+
rules,
|
|
199
|
+
files,
|
|
200
|
+
pathsToVisit,
|
|
201
|
+
useExactPaths,
|
|
202
|
+
memo,
|
|
203
|
+
component,
|
|
204
|
+
},
|
|
205
|
+
state,
|
|
206
|
+
fixOptions: fixOptions,
|
|
207
|
+
});
|
|
156
208
|
}
|
|
157
209
|
for (const key in value.variables) {
|
|
158
210
|
yield* visitNode({
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
211
|
+
args: {
|
|
212
|
+
nodeType: 'component-variable',
|
|
213
|
+
value: value.variables[key],
|
|
214
|
+
path: [...path, 'variables', key],
|
|
215
|
+
rules,
|
|
216
|
+
files,
|
|
217
|
+
pathsToVisit,
|
|
218
|
+
useExactPaths,
|
|
219
|
+
memo,
|
|
220
|
+
component,
|
|
221
|
+
},
|
|
222
|
+
state,
|
|
223
|
+
fixOptions: fixOptions,
|
|
224
|
+
});
|
|
168
225
|
}
|
|
169
226
|
for (const key in value.apis) {
|
|
170
227
|
const api = value.apis[key];
|
|
171
228
|
yield* visitNode({
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
229
|
+
args: {
|
|
230
|
+
nodeType: 'component-api',
|
|
231
|
+
value: api,
|
|
232
|
+
component,
|
|
233
|
+
path: [...path, 'apis', key],
|
|
234
|
+
rules,
|
|
235
|
+
files,
|
|
236
|
+
pathsToVisit,
|
|
237
|
+
useExactPaths,
|
|
238
|
+
memo,
|
|
239
|
+
},
|
|
240
|
+
state,
|
|
241
|
+
fixOptions: fixOptions,
|
|
242
|
+
});
|
|
181
243
|
if (!isLegacyApi(api)) {
|
|
182
244
|
for (const [inputKey, input] of Object.entries(api.inputs)) {
|
|
183
245
|
yield* visitNode({
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
246
|
+
args: {
|
|
247
|
+
nodeType: 'component-api-input',
|
|
248
|
+
value: input,
|
|
249
|
+
api,
|
|
250
|
+
component,
|
|
251
|
+
path: [...path, 'apis', key, 'inputs', inputKey],
|
|
252
|
+
rules,
|
|
253
|
+
files,
|
|
254
|
+
pathsToVisit,
|
|
255
|
+
useExactPaths,
|
|
256
|
+
memo,
|
|
257
|
+
},
|
|
258
|
+
state,
|
|
259
|
+
fixOptions: fixOptions,
|
|
260
|
+
});
|
|
194
261
|
}
|
|
195
262
|
}
|
|
196
263
|
}
|
|
197
264
|
for (const key in value.formulas) {
|
|
198
265
|
yield* visitNode({
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
266
|
+
args: {
|
|
267
|
+
nodeType: 'component-formula',
|
|
268
|
+
value: value.formulas[key],
|
|
269
|
+
path: [...path, 'formulas', key],
|
|
270
|
+
rules,
|
|
271
|
+
files,
|
|
272
|
+
pathsToVisit,
|
|
273
|
+
useExactPaths,
|
|
274
|
+
memo,
|
|
275
|
+
component,
|
|
276
|
+
},
|
|
277
|
+
state,
|
|
278
|
+
fixOptions: fixOptions,
|
|
279
|
+
});
|
|
208
280
|
}
|
|
209
281
|
for (const key in value.workflows) {
|
|
210
282
|
yield* visitNode({
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
283
|
+
args: {
|
|
284
|
+
nodeType: 'component-workflow',
|
|
285
|
+
value: value.workflows[key],
|
|
286
|
+
path: [...path, 'workflows', key],
|
|
287
|
+
rules,
|
|
288
|
+
files,
|
|
289
|
+
pathsToVisit,
|
|
290
|
+
useExactPaths,
|
|
291
|
+
memo,
|
|
292
|
+
component,
|
|
293
|
+
},
|
|
294
|
+
state,
|
|
295
|
+
fixOptions: fixOptions,
|
|
296
|
+
});
|
|
220
297
|
}
|
|
221
298
|
for (let i = 0; i < (value.events ?? []).length; i++) {
|
|
222
299
|
const event = value.events?.[i];
|
|
223
300
|
if (event) {
|
|
224
301
|
yield* visitNode({
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
302
|
+
args: {
|
|
303
|
+
nodeType: 'component-event',
|
|
304
|
+
path: [...path, 'events', i],
|
|
305
|
+
rules,
|
|
306
|
+
files,
|
|
307
|
+
pathsToVisit,
|
|
308
|
+
useExactPaths,
|
|
309
|
+
memo,
|
|
310
|
+
value: { component, event },
|
|
311
|
+
},
|
|
312
|
+
state,
|
|
313
|
+
fixOptions: fixOptions,
|
|
314
|
+
});
|
|
233
315
|
}
|
|
234
316
|
}
|
|
235
317
|
for (const key in value.contexts) {
|
|
236
318
|
yield* visitNode({
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
319
|
+
args: {
|
|
320
|
+
nodeType: 'component-context',
|
|
321
|
+
value: value.contexts[key],
|
|
322
|
+
path: [...path, 'contexts', key],
|
|
323
|
+
rules,
|
|
324
|
+
files,
|
|
325
|
+
pathsToVisit,
|
|
326
|
+
useExactPaths,
|
|
327
|
+
memo,
|
|
328
|
+
},
|
|
329
|
+
state,
|
|
330
|
+
fixOptions: fixOptions,
|
|
331
|
+
});
|
|
245
332
|
}
|
|
246
333
|
for (const key in value.nodes) {
|
|
247
334
|
yield* visitNode({
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
335
|
+
args: {
|
|
336
|
+
nodeType: 'component-node',
|
|
337
|
+
value: value.nodes[key],
|
|
338
|
+
path: [...path, 'nodes', key],
|
|
339
|
+
rules,
|
|
340
|
+
files,
|
|
341
|
+
pathsToVisit,
|
|
342
|
+
useExactPaths,
|
|
343
|
+
memo,
|
|
344
|
+
component,
|
|
345
|
+
},
|
|
346
|
+
state,
|
|
347
|
+
fixOptions: fixOptions,
|
|
348
|
+
});
|
|
257
349
|
}
|
|
258
350
|
for (const { path: formulaPath, formula, } of component.formulasInComponent()) {
|
|
259
351
|
yield* visitNode({
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
352
|
+
args: {
|
|
353
|
+
nodeType: 'formula',
|
|
354
|
+
value: formula,
|
|
355
|
+
path: [...path, ...formulaPath],
|
|
356
|
+
rules,
|
|
357
|
+
files,
|
|
358
|
+
pathsToVisit,
|
|
359
|
+
useExactPaths,
|
|
360
|
+
memo,
|
|
361
|
+
component,
|
|
362
|
+
},
|
|
363
|
+
state,
|
|
364
|
+
fixOptions: fixOptions,
|
|
365
|
+
});
|
|
269
366
|
}
|
|
270
367
|
for (const [actionPath, action] of component.actionModelsInComponent()) {
|
|
271
368
|
yield* visitNode({
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
369
|
+
args: {
|
|
370
|
+
nodeType: 'action-model',
|
|
371
|
+
value: action,
|
|
372
|
+
path: [...path, ...actionPath],
|
|
373
|
+
rules,
|
|
374
|
+
files,
|
|
375
|
+
pathsToVisit,
|
|
376
|
+
useExactPaths,
|
|
377
|
+
memo,
|
|
378
|
+
component,
|
|
379
|
+
},
|
|
380
|
+
state,
|
|
381
|
+
fixOptions: fixOptions,
|
|
382
|
+
});
|
|
281
383
|
}
|
|
282
384
|
break;
|
|
283
385
|
}
|
|
@@ -290,17 +392,21 @@ function* visitNode(args, state) {
|
|
|
290
392
|
packages: files.packages,
|
|
291
393
|
},
|
|
292
394
|
});
|
|
293
|
-
formula.formulasInFormula();
|
|
294
395
|
for (const { path: formulaPath, formula: f, } of formula.formulasInFormula()) {
|
|
295
396
|
yield* visitNode({
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
397
|
+
args: {
|
|
398
|
+
nodeType: 'formula',
|
|
399
|
+
value: f,
|
|
400
|
+
path: [...path, 'formula', ...formulaPath],
|
|
401
|
+
rules,
|
|
402
|
+
files,
|
|
403
|
+
pathsToVisit,
|
|
404
|
+
useExactPaths,
|
|
405
|
+
memo,
|
|
406
|
+
},
|
|
407
|
+
state,
|
|
408
|
+
fixOptions: fixOptions,
|
|
409
|
+
});
|
|
304
410
|
}
|
|
305
411
|
}
|
|
306
412
|
break;
|
|
@@ -311,14 +417,19 @@ function* visitNode(args, state) {
|
|
|
311
417
|
for (let i = 0; i < variants.length; i++) {
|
|
312
418
|
const variant = variants[i];
|
|
313
419
|
yield* visitNode({
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
420
|
+
args: {
|
|
421
|
+
nodeType: 'style-variant',
|
|
422
|
+
value: { variant, element: value },
|
|
423
|
+
path: [...path, 'variants', i],
|
|
424
|
+
rules,
|
|
425
|
+
files,
|
|
426
|
+
pathsToVisit,
|
|
427
|
+
useExactPaths,
|
|
428
|
+
memo,
|
|
429
|
+
},
|
|
430
|
+
state,
|
|
431
|
+
fixOptions: fixOptions,
|
|
432
|
+
});
|
|
322
433
|
}
|
|
323
434
|
}
|
|
324
435
|
}
|
|
@@ -333,14 +444,19 @@ function* visitNode(args, state) {
|
|
|
333
444
|
});
|
|
334
445
|
for (const { path: formulaPath, formula, } of apiService.formulasInService()) {
|
|
335
446
|
yield* visitNode({
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
447
|
+
args: {
|
|
448
|
+
nodeType: 'formula',
|
|
449
|
+
value: formula,
|
|
450
|
+
path: [...path, ...formulaPath],
|
|
451
|
+
rules,
|
|
452
|
+
files,
|
|
453
|
+
pathsToVisit,
|
|
454
|
+
useExactPaths,
|
|
455
|
+
memo,
|
|
456
|
+
},
|
|
457
|
+
state,
|
|
458
|
+
fixOptions: fixOptions,
|
|
459
|
+
});
|
|
344
460
|
}
|
|
345
461
|
break;
|
|
346
462
|
}
|
|
@@ -354,14 +470,19 @@ function* visitNode(args, state) {
|
|
|
354
470
|
});
|
|
355
471
|
for (const { path: formulaPath, formula, } of projectRoute.formulasInRoute()) {
|
|
356
472
|
yield* visitNode({
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
473
|
+
args: {
|
|
474
|
+
nodeType: 'formula',
|
|
475
|
+
value: formula,
|
|
476
|
+
path: [...path, 'formula', ...formulaPath],
|
|
477
|
+
rules,
|
|
478
|
+
files,
|
|
479
|
+
pathsToVisit,
|
|
480
|
+
useExactPaths,
|
|
481
|
+
memo,
|
|
482
|
+
},
|
|
483
|
+
state,
|
|
484
|
+
fixOptions: fixOptions,
|
|
485
|
+
});
|
|
365
486
|
}
|
|
366
487
|
break;
|
|
367
488
|
}
|