@stag-build/phonebook 0.1.2 → 0.1.4
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 +10 -1
- package/dist/cli.js +22 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/init.d.ts +21 -2
- package/dist/commands/init.js +33 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/engines/android.d.ts +54 -0
- package/dist/engines/android.js +152 -6
- package/dist/engines/android.js.map +1 -1
- package/dist/engines/ios.d.ts +53 -4
- package/dist/engines/ios.js +142 -27
- package/dist/engines/ios.js.map +1 -1
- package/dist/errors.js +12 -1
- package/dist/errors.js.map +1 -1
- package/dist/ios/snapshotTestClass.d.ts +44 -0
- package/dist/ios/snapshotTestClass.js +115 -0
- package/dist/ios/snapshotTestClass.js.map +1 -1
- package/dist/ios/unrendered.d.ts +38 -0
- package/dist/ios/unrendered.js +92 -0
- package/dist/ios/unrendered.js.map +1 -0
- package/dist/manifest.d.ts +23 -2
- package/dist/manifest.js +58 -0
- package/dist/manifest.js.map +1 -1
- package/dist/mcp/server.d.ts +28 -0
- package/dist/mcp/server.js +232 -11
- package/dist/mcp/server.js.map +1 -1
- package/dist/png.d.ts +18 -0
- package/dist/png.js +44 -0
- package/dist/png.js.map +1 -0
- package/dist/scan/android.js +142 -16
- package/dist/scan/android.js.map +1 -1
- package/dist/scan/gaps.d.ts +52 -0
- package/dist/scan/gaps.js +169 -0
- package/dist/scan/gaps.js.map +1 -0
- package/dist/scan/ios.d.ts +44 -0
- package/dist/scan/ios.js +445 -41
- package/dist/scan/ios.js.map +1 -1
- package/dist/scan/scope.d.ts +30 -0
- package/dist/scan/scope.js +208 -0
- package/dist/scan/scope.js.map +1 -0
- package/dist/scan/stats.d.ts +12 -0
- package/dist/scan/stats.js +24 -0
- package/dist/scan/stats.js.map +1 -0
- package/dist/scan/types.d.ts +87 -1
- package/dist/site/build.js +0 -0
- package/dist/site/build.js.map +1 -1
- package/package.json +1 -1
package/dist/scan/ios.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { readdir, readFile } from 'node:fs/promises';
|
|
2
2
|
import { join, relative } from 'node:path';
|
|
3
3
|
import { previewHints } from './hints.js';
|
|
4
|
+
import { componentGaps } from './gaps.js';
|
|
5
|
+
import { computeStats } from './stats.js';
|
|
4
6
|
/**
|
|
5
7
|
* Regex-based heuristic scanner for SwiftUI `View` structs and `#Preview`
|
|
6
8
|
* macros (plus legacy `PreviewProvider` structs). Walks the project tree and
|
|
@@ -10,34 +12,88 @@ export async function scanIos(projectDir) {
|
|
|
10
12
|
const components = [];
|
|
11
13
|
const orphanPreviews = [];
|
|
12
14
|
const files = await walkSwiftFiles(projectDir);
|
|
15
|
+
const extraLocales = await detectLocales(projectDir);
|
|
16
|
+
const enumTypes = new Set();
|
|
17
|
+
// Project-wide: a preview calls `withPreviewsEnv()` in one module and the
|
|
18
|
+
// function that says what that supplies lives in another, so this cannot be
|
|
19
|
+
// resolved a file at a time.
|
|
20
|
+
const envHelpers = new Map();
|
|
21
|
+
// Component bodies, kept only for the duration of the scan: which components
|
|
22
|
+
// a body renders cannot be answered until every component name is known, and
|
|
23
|
+
// the bodies themselves are far too large to put in a report.
|
|
24
|
+
const bodies = new Map();
|
|
13
25
|
for (const file of files) {
|
|
14
26
|
const relFile = relative(projectDir, file);
|
|
15
27
|
const content = await readFile(file, 'utf8');
|
|
16
|
-
const
|
|
28
|
+
for (const enumName of findEnums(content))
|
|
29
|
+
enumTypes.add(enumName);
|
|
30
|
+
for (const [name, provided] of findEnvironmentHelpers(content))
|
|
31
|
+
envHelpers.set(name, provided);
|
|
32
|
+
const fileComponents = findViewStructs(content, relFile, bodies);
|
|
17
33
|
const filePreviews = findPreviews(content, relFile);
|
|
18
34
|
for (const comp of fileComponents)
|
|
19
35
|
components.push(comp);
|
|
20
36
|
matchPreviewsToComponents(filePreviews, fileComponents, orphanPreviews);
|
|
21
37
|
}
|
|
38
|
+
const names = new Set(components.map((c) => c.name));
|
|
39
|
+
for (const component of components) {
|
|
40
|
+
const body = bodies.get(component.name);
|
|
41
|
+
if (body === undefined)
|
|
42
|
+
continue;
|
|
43
|
+
const uses = [...names].filter((n) => n !== component.name && rendersComponent(body, n));
|
|
44
|
+
if (uses.length > 0)
|
|
45
|
+
component.uses = uses;
|
|
46
|
+
// The body starts at the struct's opening brace, so its line 0 is the line
|
|
47
|
+
// the component was declared on and the offset carries the rest.
|
|
48
|
+
const guarded = uses.flatMap((name) => {
|
|
49
|
+
const at = onlyRendersConditionally(body, name);
|
|
50
|
+
return at === undefined ? [] : [{ name, guard: at.guard, line: component.line + at.line }];
|
|
51
|
+
});
|
|
52
|
+
if (guarded.length > 0)
|
|
53
|
+
component.conditionalUses = guarded;
|
|
54
|
+
}
|
|
22
55
|
components.sort((a, b) => a.file.localeCompare(b.file) || a.line - b.line);
|
|
23
56
|
orphanPreviews.sort((a, b) => a.file.localeCompare(b.file) || a.line - b.line);
|
|
57
|
+
for (const component of components) {
|
|
58
|
+
const gaps = componentGaps({
|
|
59
|
+
platform: 'ios',
|
|
60
|
+
component: component.name,
|
|
61
|
+
properties: component.properties ?? [],
|
|
62
|
+
previewNames: component.previews.map((p) => p.displayName ?? p.name),
|
|
63
|
+
hasDarkPreview: component.previews.some((p) => p.dark),
|
|
64
|
+
previewText: component.previews.map((p) => p.annotationText ?? '').join('\n'),
|
|
65
|
+
extraLocales,
|
|
66
|
+
enumTypes: [...enumTypes],
|
|
67
|
+
...(component.environmentTypes ? { environmentTypes: component.environmentTypes } : {}),
|
|
68
|
+
environmentProvided: environmentProvided(component.previews.map((p) => p.annotationText ?? '').join('\n'), envHelpers),
|
|
69
|
+
});
|
|
70
|
+
if (gaps.length > 0)
|
|
71
|
+
component.gaps = gaps;
|
|
72
|
+
}
|
|
24
73
|
return {
|
|
25
74
|
platform: 'ios',
|
|
26
75
|
components,
|
|
27
76
|
orphanPreviews,
|
|
77
|
+
extraLocales,
|
|
28
78
|
stats: computeStats(components, orphanPreviews),
|
|
29
79
|
};
|
|
30
80
|
}
|
|
31
|
-
function findViewStructs(content, relFile) {
|
|
81
|
+
function findViewStructs(content, relFile, bodies) {
|
|
32
82
|
const results = [];
|
|
33
83
|
const regex = /(?:struct|final class)\s+([A-Z]\w*)\s*:\s*[^{]*\bView\b/g;
|
|
34
84
|
let match;
|
|
35
85
|
while ((match = regex.exec(content)) !== null) {
|
|
86
|
+
const body = structBody(content, regex.lastIndex);
|
|
87
|
+
const properties = findStoredProperties(body);
|
|
88
|
+
const environmentTypes = findEnvironmentReads(body);
|
|
89
|
+
bodies.set(match[1], body);
|
|
36
90
|
results.push({
|
|
37
91
|
name: match[1],
|
|
38
92
|
file: relFile,
|
|
39
93
|
line: lineNumberAt(content, match.index),
|
|
40
94
|
previews: [],
|
|
95
|
+
...(properties.length > 0 ? { properties } : {}),
|
|
96
|
+
...(environmentTypes.length > 0 ? { environmentTypes } : {}),
|
|
41
97
|
});
|
|
42
98
|
}
|
|
43
99
|
return results;
|
|
@@ -52,8 +108,8 @@ function findPreviews(content, relFile) {
|
|
|
52
108
|
const nameMatch = argsText.match(/"([^"]*)"/);
|
|
53
109
|
const displayName = nameMatch ? nameMatch[1] : undefined;
|
|
54
110
|
const line = lineNumberAt(content, match.index);
|
|
55
|
-
const
|
|
56
|
-
const
|
|
111
|
+
const annotationText = previewSource(content, match.index, match.index + match[0].length);
|
|
112
|
+
const dark = isDarkPreview(annotationText, displayName);
|
|
57
113
|
const functionName = displayName ?? 'unnamed';
|
|
58
114
|
const hints = previewHints({
|
|
59
115
|
platform: 'ios',
|
|
@@ -74,35 +130,401 @@ function findPreviews(content, relFile) {
|
|
|
74
130
|
// Legacy: struct X_Previews: PreviewProvider
|
|
75
131
|
const legacyRegex = /struct\s+(\w+)_Previews\s*:\s*PreviewProvider/g;
|
|
76
132
|
while ((match = legacyRegex.exec(content)) !== null) {
|
|
133
|
+
// Read the struct, same as a #Preview body. Reporting nothing here made a
|
|
134
|
+
// legacy preview look like it declared nothing: never dark, and supplying
|
|
135
|
+
// no environment object it in fact supplies — two false alarms on the
|
|
136
|
+
// oldest previews in a project, which are the ones least likely to be wrong.
|
|
137
|
+
const source = `${match[0]} {${structBody(content, legacyRegex.lastIndex)}}`;
|
|
77
138
|
results.push({
|
|
78
139
|
name: `${match[1]}_Previews`,
|
|
79
140
|
file: relFile,
|
|
80
141
|
line: lineNumberAt(content, match.index),
|
|
81
|
-
dark:
|
|
142
|
+
dark: isDarkPreview(source, undefined),
|
|
143
|
+
annotationText: source,
|
|
82
144
|
});
|
|
83
145
|
}
|
|
84
146
|
return results;
|
|
85
147
|
}
|
|
86
|
-
/** True when
|
|
87
|
-
function isDarkPreview(
|
|
148
|
+
/** True when a preview declares a dark colour scheme, by name or by modifier. */
|
|
149
|
+
function isDarkPreview(source, displayName) {
|
|
88
150
|
if (displayName && displayName.endsWith('Dark'))
|
|
89
151
|
return true;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
*
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
152
|
+
return /\.preferredColorScheme\(\s*\.dark\s*\)/.test(source);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* The `#Preview(...)` declaration together with its body, from the macro to the
|
|
156
|
+
* brace that closes it.
|
|
157
|
+
*
|
|
158
|
+
* Reading a fixed number of lines instead — the 15-line window this replaces,
|
|
159
|
+
* and the 11-line one dark detection used — truncates exactly the previews
|
|
160
|
+
* worth reading. A long body pushes the modifiers that carry the configuration
|
|
161
|
+
* past the cap, so a preview that declares `.preferredColorScheme(.dark)` is
|
|
162
|
+
* reported as not declaring it. Seen on IceCubesApp: a 17-line preview flagged
|
|
163
|
+
* for a modifier written on its line 16, in a report that called that same
|
|
164
|
+
* preview dark — because the two checks read two different windows.
|
|
165
|
+
*
|
|
166
|
+
* Balancing braces has neither failure mode. It ends where the preview ends, so
|
|
167
|
+
* it can no more truncate a long body than bleed into the next declaration, and
|
|
168
|
+
* one reading now serves every check. `cap` is runaway protection for a file
|
|
169
|
+
* whose braces never balance — an unterminated string literal, most likely —
|
|
170
|
+
* not a window: a preview that reaches it is already unparseable.
|
|
171
|
+
*/
|
|
172
|
+
function previewSource(content, matchIndex, bodyFrom) {
|
|
173
|
+
const cap = Math.min(content.length, matchIndex + 8000);
|
|
174
|
+
const open = content.indexOf('{', bodyFrom);
|
|
175
|
+
if (open === -1 || open >= cap)
|
|
176
|
+
return content.slice(matchIndex, cap);
|
|
177
|
+
let depth = 0;
|
|
178
|
+
for (let i = open; i < cap; i++) {
|
|
179
|
+
if (content[i] === '{')
|
|
180
|
+
depth++;
|
|
181
|
+
else if (content[i] === '}') {
|
|
182
|
+
depth--;
|
|
183
|
+
if (depth === 0)
|
|
184
|
+
return content.slice(matchIndex, i + 1);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return content.slice(matchIndex, cap);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Stored properties of a struct, given its body.
|
|
191
|
+
*
|
|
192
|
+
* Only the declaration line matters, so this reads lines rather than parsing
|
|
193
|
+
* Swift: a stored property is `let`/`var name: Type`, optionally preceded by
|
|
194
|
+
* property wrappers and an access modifier. `var body: some View` is the one
|
|
195
|
+
* that always appears and never describes a state, and a `var` with a `{`
|
|
196
|
+
* before any `=` is computed, so both are skipped.
|
|
197
|
+
*/
|
|
198
|
+
function findStoredProperties(body) {
|
|
199
|
+
const properties = [];
|
|
200
|
+
const declaration = /^\s*(?:@\w+(?:\([^)]*\))?\s+)*(?:(?:private|fileprivate|internal|public|package)\s+)?(?:let|var)\s+(\w+)\s*:\s*([^={\n]+)/;
|
|
201
|
+
for (const line of body.split('\n')) {
|
|
202
|
+
const match = line.match(declaration);
|
|
203
|
+
if (!match)
|
|
204
|
+
continue;
|
|
205
|
+
const name = match[1];
|
|
206
|
+
const type = match[2].trim();
|
|
207
|
+
if (name === 'body')
|
|
208
|
+
continue;
|
|
209
|
+
// Computed: a brace opens before any assignment.
|
|
210
|
+
const rest = line.slice(line.indexOf(type) + type.length);
|
|
211
|
+
if (rest.includes('{') && !rest.includes('='))
|
|
212
|
+
continue;
|
|
213
|
+
properties.push({ name, type, kind: classifyType(type) });
|
|
214
|
+
}
|
|
215
|
+
return properties;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Types the struct reads out of the environment by type — `@Environment(X.self)`.
|
|
219
|
+
*
|
|
220
|
+
* The keypath form, `@Environment(\\.openURL)`, is deliberately not matched: it
|
|
221
|
+
* reads a value SwiftUI always provides, so it can never be the missing thing.
|
|
222
|
+
* Only an object looked up by its own type can be absent, and when it is, the
|
|
223
|
+
* read traps.
|
|
224
|
+
*/
|
|
225
|
+
function findEnvironmentReads(body) {
|
|
226
|
+
const found = new Set();
|
|
227
|
+
const regex = /@Environment\(\s*([A-Z]\w*)\.self\s*\)/g;
|
|
228
|
+
let match;
|
|
229
|
+
while ((match = regex.exec(body)) !== null)
|
|
230
|
+
found.add(match[1]);
|
|
231
|
+
return [...found];
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* What each `-> some View` helper in this file supplies to the environment,
|
|
235
|
+
* keyed by function name.
|
|
236
|
+
*
|
|
237
|
+
* A preview that calls `withPreviewsEnv()` supplies everything that function
|
|
238
|
+
* supplies, and the preview's own text names none of it. Without this the rule
|
|
239
|
+
* would flag every component in a project that has such a helper — which is
|
|
240
|
+
* every project that has more than a handful of previews.
|
|
241
|
+
*/
|
|
242
|
+
function findEnvironmentHelpers(content) {
|
|
243
|
+
const helpers = new Map();
|
|
244
|
+
const regex = /func\s+(\w+)\s*\([^)]*\)\s*->\s*some\s+View/g;
|
|
245
|
+
let match;
|
|
246
|
+
while ((match = regex.exec(content)) !== null) {
|
|
247
|
+
helpers.set(match[1], environmentArguments(structBody(content, regex.lastIndex)));
|
|
248
|
+
}
|
|
249
|
+
return helpers;
|
|
250
|
+
}
|
|
251
|
+
/** Everything the previews supply, directly or through a helper they call. */
|
|
252
|
+
function environmentProvided(previewText, helpers) {
|
|
253
|
+
const parts = [environmentArguments(previewText)];
|
|
254
|
+
for (const [name, provided] of helpers) {
|
|
255
|
+
if (new RegExp(`\\b${name}\\s*\\(`).test(previewText))
|
|
256
|
+
parts.push(provided);
|
|
257
|
+
}
|
|
258
|
+
return parts.join('\n');
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* The arguments of every `.environment(...)` call in some source, concatenated.
|
|
262
|
+
*
|
|
263
|
+
* Kept as text rather than resolved to type names because the value passed is
|
|
264
|
+
* rarely the type itself: `.environment(StatusDataControllerProvider.shared
|
|
265
|
+
* .dataController(for:client:))` supplies a StatusDataController and never
|
|
266
|
+
* writes that name as the head of the expression. Matching on the text covers
|
|
267
|
+
* both spellings, and its failure mode is silence rather than a false alarm.
|
|
268
|
+
*
|
|
269
|
+
* The leading dot is optional because a helper written as an extension on View
|
|
270
|
+
* calls the first one on itself — `environment(CurrentAccount.shared)` — and
|
|
271
|
+
* only chains the rest. Requiring the dot loses whatever the first call
|
|
272
|
+
* supplies, which is the one a project's preview helper opens with.
|
|
273
|
+
*/
|
|
274
|
+
function environmentArguments(source) {
|
|
275
|
+
const parts = [];
|
|
276
|
+
const regex = /\benvironment\(/g;
|
|
277
|
+
let match;
|
|
278
|
+
while ((match = regex.exec(source)) !== null) {
|
|
279
|
+
parts.push(balancedArgument(source, regex.lastIndex - 1));
|
|
280
|
+
}
|
|
281
|
+
return parts.join('\n');
|
|
282
|
+
}
|
|
283
|
+
/** The text inside the parenthesis opening at `openIndex`, to its match. */
|
|
284
|
+
function balancedArgument(source, openIndex) {
|
|
285
|
+
let depth = 0;
|
|
286
|
+
for (let i = openIndex; i < source.length; i++) {
|
|
287
|
+
if (source[i] === '(')
|
|
288
|
+
depth++;
|
|
289
|
+
else if (source[i] === ')') {
|
|
290
|
+
depth--;
|
|
291
|
+
if (depth === 0)
|
|
292
|
+
return source.slice(openIndex + 1, i);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
return source.slice(openIndex + 1);
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* True when `source` renders `component` — the name followed by an opening
|
|
299
|
+
* parenthesis, which is how a SwiftUI view is instantiated.
|
|
300
|
+
*
|
|
301
|
+
* A bare mention is not a render: `StatusRowView.Context` names the type
|
|
302
|
+
* without showing anything, and a comment saying "like AvatarView" shows even
|
|
303
|
+
* less. Requiring the parenthesis costs the zero-argument spelling nothing —
|
|
304
|
+
* `RowList()` still matches — and keeps the answer to something a reader
|
|
305
|
+
* would agree with.
|
|
306
|
+
*/
|
|
307
|
+
export function rendersComponent(source, component) {
|
|
308
|
+
return new RegExp(`\\b${component}\\s*\\(`).test(source);
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Where `source` renders `component` behind a condition, when every place it
|
|
312
|
+
* does is behind one — so whether it appears depends on state the caller sets.
|
|
313
|
+
*
|
|
314
|
+
* This is what separates a parent that shows a child from a parent that might.
|
|
315
|
+
* IceCubes' StatusRowView renders StatusRowDetailView only `if isFocused`, and
|
|
316
|
+
* its one preview builds a timeline row, where nothing is focused: the preview
|
|
317
|
+
* exists, and the detail view is not in it. Treating that as coverage is how a
|
|
318
|
+
* redesigned view reaches no screenshot and no one is told.
|
|
319
|
+
*
|
|
320
|
+
* The brace stack is the whole trick — a frame remembers the text that opened
|
|
321
|
+
* it, and that text is the condition when it reads as one. No Swift is
|
|
322
|
+
* evaluated and none needs to be: the question is whether a render is guarded
|
|
323
|
+
* and behind what, not which way the guard goes.
|
|
324
|
+
*
|
|
325
|
+
* Returns the innermost condition around the first guarded render. A component
|
|
326
|
+
* that renders the same child behind two different conditions is rare, and the
|
|
327
|
+
* answer to the first is the answer to both: nothing shows it.
|
|
328
|
+
*/
|
|
329
|
+
export function onlyRendersConditionally(source, component) {
|
|
330
|
+
const stack = [];
|
|
331
|
+
let segment = '';
|
|
332
|
+
let line = 0;
|
|
333
|
+
let guarded;
|
|
334
|
+
for (let i = 0; i < source.length; i++) {
|
|
335
|
+
const char = source[i];
|
|
336
|
+
if (char === '\n')
|
|
337
|
+
line++;
|
|
338
|
+
if (char === '{') {
|
|
339
|
+
stack.push(conditionOpening(segment));
|
|
340
|
+
segment = '';
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
if (char === '}') {
|
|
344
|
+
stack.pop();
|
|
345
|
+
segment = '';
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
segment += char;
|
|
349
|
+
// The name has just been completed by an opening parenthesis.
|
|
350
|
+
if (char === '(' && segment.trimEnd().endsWith(`${component}(`)) {
|
|
351
|
+
const name = segment.trimEnd().slice(0, -1);
|
|
352
|
+
if (name.endsWith(component) && !/\w/.test(name.slice(0, -component.length).slice(-1))) {
|
|
353
|
+
const condition = [...stack].reverse().find((c) => c !== undefined);
|
|
354
|
+
// One unguarded render settles it: the parent does show the child.
|
|
355
|
+
if (condition === undefined)
|
|
356
|
+
return undefined;
|
|
357
|
+
guarded ??= { guard: condition, line };
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return guarded;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* The condition in the text that opened a brace, or undefined when it opened
|
|
365
|
+
* something else.
|
|
366
|
+
*
|
|
367
|
+
* Takes the last condition keyword in the segment rather than the first: the
|
|
368
|
+
* text since the previous brace can carry a whole statement before the one that
|
|
369
|
+
* opens this frame.
|
|
370
|
+
*/
|
|
371
|
+
function conditionOpening(segment) {
|
|
372
|
+
const opener = /(^|[^\w.])(if|guard|switch)[\s(]/g;
|
|
373
|
+
let last = null;
|
|
374
|
+
let match;
|
|
375
|
+
while ((match = opener.exec(segment)) !== null)
|
|
376
|
+
last = match;
|
|
377
|
+
if (last === null)
|
|
378
|
+
return undefined;
|
|
379
|
+
return segment
|
|
380
|
+
.slice(last.index + last[1].length)
|
|
381
|
+
.replace(/\s+/g, ' ')
|
|
382
|
+
.trim();
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Which of `known` this source renders — the same rule as `rendersComponent`,
|
|
386
|
+
* asked once for the whole set.
|
|
387
|
+
*
|
|
388
|
+
* Reading the names out of the source and intersecting beats testing every
|
|
389
|
+
* known component against it: a project has hundreds of components and a scan
|
|
390
|
+
* asks this of every preview body, and the regex-per-name version is that
|
|
391
|
+
* product.
|
|
392
|
+
*/
|
|
393
|
+
export function componentsNamedIn(source, known) {
|
|
394
|
+
const named = new Set();
|
|
395
|
+
const regex = /\b([A-Z]\w*)\s*\(/g;
|
|
396
|
+
let match;
|
|
397
|
+
while ((match = regex.exec(source)) !== null) {
|
|
398
|
+
if (known.has(match[1]))
|
|
399
|
+
named.add(match[1]);
|
|
400
|
+
}
|
|
401
|
+
return [...named];
|
|
402
|
+
}
|
|
403
|
+
/** Enum type names declared in this file, including indirect and raw-value enums. */
|
|
404
|
+
function findEnums(content) {
|
|
405
|
+
const results = [];
|
|
406
|
+
const regex = /(?:^|\n)\s*(?:public\s+|internal\s+|private\s+|fileprivate\s+|package\s+)?(?:indirect\s+)?enum\s+([A-Z]\w*)/g;
|
|
407
|
+
let match;
|
|
408
|
+
while ((match = regex.exec(content)) !== null)
|
|
409
|
+
results.push(match[1]);
|
|
410
|
+
return results;
|
|
411
|
+
}
|
|
412
|
+
/** The text between the struct's opening brace and its matching close, capped. */
|
|
413
|
+
function structBody(content, from) {
|
|
414
|
+
const open = content.indexOf('{', from);
|
|
415
|
+
if (open === -1)
|
|
416
|
+
return '';
|
|
417
|
+
let depth = 0;
|
|
418
|
+
const cap = Math.min(content.length, open + 8000);
|
|
419
|
+
for (let i = open; i < cap; i++) {
|
|
420
|
+
if (content[i] === '{')
|
|
421
|
+
depth++;
|
|
422
|
+
else if (content[i] === '}') {
|
|
423
|
+
depth--;
|
|
424
|
+
if (depth === 0)
|
|
425
|
+
return content.slice(open + 1, i);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
return content.slice(open + 1, cap);
|
|
429
|
+
}
|
|
430
|
+
/** Types whose values are a spectrum rather than a set of states worth previewing. */
|
|
431
|
+
const SCALAR_TYPES = new Set([
|
|
432
|
+
'String', 'Int', 'Double', 'Float', 'CGFloat', 'Date', 'URL', 'UUID', 'Data',
|
|
433
|
+
'Color', 'Font', 'Image', 'Text', 'TimeInterval', 'Any', 'AnyView',
|
|
434
|
+
]);
|
|
435
|
+
function classifyType(type) {
|
|
436
|
+
const bare = type.replace(/\s+/g, '');
|
|
437
|
+
if (bare.endsWith('?') || bare.startsWith('Optional<'))
|
|
438
|
+
return 'optional';
|
|
439
|
+
if (bare.startsWith('[') || bare.startsWith('Set<') || bare.startsWith('Array<'))
|
|
440
|
+
return 'collection';
|
|
441
|
+
if (bare === 'Bool')
|
|
442
|
+
return 'bool';
|
|
443
|
+
if (SCALAR_TYPES.has(bare))
|
|
444
|
+
return 'other';
|
|
445
|
+
// A capitalized type of the project's own is the shape an enum takes; the
|
|
446
|
+
// agent reads it to find out whether it actually is one.
|
|
447
|
+
if (/^[A-Z]\w*$/.test(bare))
|
|
448
|
+
return 'enum-like';
|
|
449
|
+
return 'other';
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Locales the project ships beyond its development language, from `.lproj`
|
|
453
|
+
* directories and String Catalog localizations. "Base" is not a locale.
|
|
454
|
+
*/
|
|
455
|
+
async function detectLocales(projectDir) {
|
|
456
|
+
const found = new Set();
|
|
457
|
+
const developmentRegion = await readDevelopmentRegion(projectDir);
|
|
458
|
+
async function walk(dir, depth) {
|
|
459
|
+
if (depth > 6)
|
|
460
|
+
return;
|
|
461
|
+
let entries;
|
|
462
|
+
try {
|
|
463
|
+
entries = await readdir(dir, { withFileTypes: true });
|
|
464
|
+
}
|
|
465
|
+
catch {
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
for (const entry of entries) {
|
|
469
|
+
if (entry.isDirectory()) {
|
|
470
|
+
if (SKIP_DIRS.has(entry.name))
|
|
471
|
+
continue;
|
|
472
|
+
if (entry.name.endsWith('.lproj')) {
|
|
473
|
+
const code = entry.name.slice(0, -'.lproj'.length);
|
|
474
|
+
if (code !== 'Base')
|
|
475
|
+
found.add(code);
|
|
476
|
+
continue;
|
|
477
|
+
}
|
|
478
|
+
await walk(join(dir, entry.name), depth + 1);
|
|
479
|
+
}
|
|
480
|
+
else if (entry.isFile() && entry.name.endsWith('.xcstrings')) {
|
|
481
|
+
try {
|
|
482
|
+
const catalogue = JSON.parse(await readFile(join(dir, entry.name), 'utf8'));
|
|
483
|
+
const source = catalogue.sourceLanguage;
|
|
484
|
+
for (const entryValue of Object.values(catalogue.strings ?? {})) {
|
|
485
|
+
for (const code of Object.keys(entryValue.localizations ?? {})) {
|
|
486
|
+
if (code !== source)
|
|
487
|
+
found.add(code);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
catch {
|
|
492
|
+
// A catalogue we cannot read tells us nothing; it is not an error.
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
await walk(projectDir, 0);
|
|
498
|
+
if (developmentRegion)
|
|
499
|
+
found.delete(developmentRegion);
|
|
500
|
+
return [...found].sort();
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* The project's development language, which is not a localization of itself.
|
|
504
|
+
* Xcode records it as `developmentRegion` in the project file.
|
|
505
|
+
*/
|
|
506
|
+
async function readDevelopmentRegion(projectDir) {
|
|
507
|
+
let entries;
|
|
508
|
+
try {
|
|
509
|
+
entries = await readdir(projectDir, { withFileTypes: true });
|
|
510
|
+
}
|
|
511
|
+
catch {
|
|
512
|
+
return undefined;
|
|
513
|
+
}
|
|
514
|
+
for (const entry of entries) {
|
|
515
|
+
if (!entry.isDirectory() || !entry.name.endsWith('.xcodeproj'))
|
|
516
|
+
continue;
|
|
517
|
+
try {
|
|
518
|
+
const pbxproj = await readFile(join(projectDir, entry.name, 'project.pbxproj'), 'utf8');
|
|
519
|
+
const match = pbxproj.match(/developmentRegion\s*=\s*(\w+)/);
|
|
520
|
+
if (match)
|
|
521
|
+
return match[1];
|
|
522
|
+
}
|
|
523
|
+
catch {
|
|
524
|
+
// No readable project file: fall through and report every locale found.
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
return undefined;
|
|
106
528
|
}
|
|
107
529
|
function lineNumberAt(content, index) {
|
|
108
530
|
let line = 1;
|
|
@@ -154,24 +576,6 @@ function matchPreviewsToComponents(previews, components, orphanPreviews) {
|
|
|
154
576
|
function normalize(name) {
|
|
155
577
|
return name.replace(/\s+/g, '').toLowerCase();
|
|
156
578
|
}
|
|
157
|
-
function computeStats(components, orphanPreviews) {
|
|
158
|
-
const withPreview = components.filter((c) => c.previews.length > 0).length;
|
|
159
|
-
const withDarkPreview = components.filter((c) => c.previews.some((p) => p.dark)).length;
|
|
160
|
-
const totalPreviews = components.reduce((sum, c) => sum + c.previews.length, 0) + orphanPreviews.length;
|
|
161
|
-
const allPreviews = [...components.flatMap((c) => c.previews), ...orphanPreviews];
|
|
162
|
-
const hintCount = allPreviews.reduce((sum, p) => sum + (p.hints?.length ?? 0), 0);
|
|
163
|
-
// Unlike Android's @Preview (which annotates the composable itself), #Preview is
|
|
164
|
-
// always a separate top-level block, so a SwiftUI View struct can't be its own
|
|
165
|
-
// preview. No self-preview pattern exists here.
|
|
166
|
-
return {
|
|
167
|
-
components: components.length,
|
|
168
|
-
withPreview,
|
|
169
|
-
withDarkPreview,
|
|
170
|
-
totalPreviews,
|
|
171
|
-
hintCount,
|
|
172
|
-
selfPreviewed: 0,
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
579
|
const SKIP_DIRS = new Set(['build', '.build', 'DerivedData', 'Pods']);
|
|
176
580
|
async function walkSwiftFiles(dir) {
|
|
177
581
|
const results = [];
|
package/dist/scan/ios.js.map
CHANGED
|
@@ -1 +1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IACD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;gBAAE,SAAS;YACxC,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC;gBAAE,SAAS;YAChD,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAAE,SAAS;YAC1C,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACjE,CAAC;aAAM,IAAI,KAAK,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC3D,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CoverageReport } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Narrow a finished report to the components declared in `paths`.
|
|
4
|
+
*
|
|
5
|
+
* The scan itself is never narrowed, and that distinction is the whole design.
|
|
6
|
+
* Which types are enums, what a project's preview helper supplies, which
|
|
7
|
+
* locales ship — all of it is a fact about the project, not about one file, and
|
|
8
|
+
* a scan that walked only the changed files would get every one of them wrong.
|
|
9
|
+
* So the walk stays whole and the report is filtered afterwards, which costs a
|
|
10
|
+
* few hundred milliseconds and buys an answer that is still correct.
|
|
11
|
+
*
|
|
12
|
+
* What it saves is the reader. A run that touched five components was handed
|
|
13
|
+
* five hundred gaps, of which ten were its own; the rest are a backlog nobody
|
|
14
|
+
* asked it about, and an agent cannot tell which is which.
|
|
15
|
+
*/
|
|
16
|
+
export declare function scopeReport(report: CoverageReport, paths: string[]): CoverageReport;
|
|
17
|
+
/**
|
|
18
|
+
* Files with uncommitted changes, relative to the project directory.
|
|
19
|
+
*
|
|
20
|
+
* `git status --porcelain` reports staged, unstaged and untracked in one pass,
|
|
21
|
+
* which is what an agent's turn leaves behind: it edits and adds, it does not
|
|
22
|
+
* commit. Paths come back relative to the repository root, so they are rebased
|
|
23
|
+
* onto the project directory — the two differ whenever phonebook.config.json
|
|
24
|
+
* sits in a subdirectory of a larger repository.
|
|
25
|
+
*
|
|
26
|
+
* A directory that is not a repository, or a git that is not installed, is not
|
|
27
|
+
* an error here. It means the caller cannot scope by change and gets the whole
|
|
28
|
+
* project, which is the behaviour they had before asking.
|
|
29
|
+
*/
|
|
30
|
+
export declare function changedFiles(projectDir: string): Promise<string[]>;
|