@visual-check/cli 0.2.1 → 0.2.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.
Files changed (60) hide show
  1. package/dist/capture/capture-session.d.ts +26 -2
  2. package/dist/capture/capture-session.d.ts.map +1 -1
  3. package/dist/capture/capture-session.js +22 -5
  4. package/dist/capture/capture-session.js.map +1 -1
  5. package/dist/capture/clock-and-random.d.ts +39 -0
  6. package/dist/capture/clock-and-random.d.ts.map +1 -0
  7. package/dist/capture/clock-and-random.js +74 -0
  8. package/dist/capture/clock-and-random.js.map +1 -0
  9. package/dist/capture/driver/cdp/cdp-page.d.ts +5 -0
  10. package/dist/capture/driver/cdp/cdp-page.d.ts.map +1 -1
  11. package/dist/capture/driver/cdp/cdp-page.js +107 -17
  12. package/dist/capture/driver/cdp/cdp-page.js.map +1 -1
  13. package/dist/commands/capture-settings.d.ts +1 -1
  14. package/dist/commands/capture-settings.d.ts.map +1 -1
  15. package/dist/commands/capture-settings.js +2 -0
  16. package/dist/commands/capture-settings.js.map +1 -1
  17. package/dist/commands/network-warning.d.ts.map +1 -1
  18. package/dist/commands/network-warning.js +2 -1
  19. package/dist/commands/network-warning.js.map +1 -1
  20. package/dist/commands/run-cli.d.ts +3 -3
  21. package/dist/commands/run-cli.d.ts.map +1 -1
  22. package/dist/commands/run-cli.js +2 -2
  23. package/dist/commands/run-cli.js.map +1 -1
  24. package/dist/commands/snapshot-result.d.ts +3 -3
  25. package/dist/commands/snapshot-result.d.ts.map +1 -1
  26. package/dist/commands/snapshot-result.js +6 -4
  27. package/dist/commands/snapshot-result.js.map +1 -1
  28. package/dist/config/checks.d.ts +11 -0
  29. package/dist/config/checks.d.ts.map +1 -1
  30. package/dist/config/checks.js +24 -0
  31. package/dist/config/checks.js.map +1 -1
  32. package/dist/config/define-config.d.ts +12 -0
  33. package/dist/config/define-config.d.ts.map +1 -1
  34. package/dist/config/define-config.js.map +1 -1
  35. package/dist/config/resolve-config.d.ts +8 -0
  36. package/dist/config/resolve-config.d.ts.map +1 -1
  37. package/dist/config/resolve-config.js +16 -3
  38. package/dist/config/resolve-config.js.map +1 -1
  39. package/dist/config/story-options.d.ts +10 -0
  40. package/dist/config/story-options.d.ts.map +1 -1
  41. package/dist/config/story-options.js +3 -1
  42. package/dist/config/story-options.js.map +1 -1
  43. package/dist/config/validate-config.d.ts.map +1 -1
  44. package/dist/config/validate-config.js +3 -1
  45. package/dist/config/validate-config.js.map +1 -1
  46. package/dist/init/run-init.d.ts +5 -5
  47. package/dist/init/run-init.d.ts.map +1 -1
  48. package/dist/init/run-init.js +11 -11
  49. package/dist/init/run-init.js.map +1 -1
  50. package/dist/init/unfollowed-imports.d.ts +91 -0
  51. package/dist/init/unfollowed-imports.d.ts.map +1 -0
  52. package/dist/init/unfollowed-imports.js +223 -0
  53. package/dist/init/unfollowed-imports.js.map +1 -0
  54. package/dist/report/report-document.d.ts +3 -3
  55. package/package.json +3 -3
  56. package/skill/SKILL.md +1 -1
  57. package/dist/init/unlisted-dependencies.d.ts +0 -75
  58. package/dist/init/unlisted-dependencies.d.ts.map +0 -1
  59. package/dist/init/unlisted-dependencies.js +0 -142
  60. package/dist/init/unlisted-dependencies.js.map +0 -1
@@ -0,0 +1,223 @@
1
+ import { execFile } from 'node:child_process';
2
+ import { existsSync } from 'node:fs';
3
+ import { createRequire } from 'node:module';
4
+ import { dirname, join, resolve } from 'node:path';
5
+ import { promisify } from 'node:util';
6
+ import { listOf } from './list-of.js';
7
+ import { isJsonObject } from './package-manager.js';
8
+ /**
9
+ * `execFile` that returns a promise.
10
+ */
11
+ const execFileAsync = promisify(execFile);
12
+ /**
13
+ * The most output Fallow may write, in bytes.
14
+ */
15
+ const maxOutputBytes = 256 * 1024 * 1024;
16
+ /**
17
+ * The longest Fallow may run, in milliseconds.
18
+ */
19
+ const timeoutMs = 120_000;
20
+ /**
21
+ * Reads the files from a list of the places a finding is imported. A list that's empty or holds a place without a path
22
+ * throws.
23
+ */
24
+ function pathsOf(sites, finding) {
25
+ const paths = Array.isArray(sites) ? sites.map((site) => (isJsonObject(site) ? site.path : undefined)) : [];
26
+ if (paths.length === 0 || !paths.every((path) => typeof path === 'string')) {
27
+ throw new Error(`Fallow's output holds ${finding} without the files that import it.`);
28
+ }
29
+ return paths;
30
+ }
31
+ /**
32
+ * Reads one entry of Fallow's `unlisted_dependencies` array, keeping the files where the package isn't installed. An
33
+ * entry that isn't a package name with at least one importing file throws.
34
+ */
35
+ function unlistedDependencyOf(entry, isInstalled) {
36
+ if (!isJsonObject(entry) || typeof entry.package_name !== 'string') {
37
+ throw new Error("Fallow's output holds an unlisted dependency in a shape visual-check can't read.");
38
+ }
39
+ const name = entry.package_name;
40
+ const paths = pathsOf(entry.imported_from, 'an unlisted dependency').filter((path) => !isInstalled(name, path));
41
+ return { specifier: name, paths };
42
+ }
43
+ /**
44
+ * Reads one entry of Fallow's `unresolved_imports` array as the specifier and the file that imports it. An entry
45
+ * without both throws.
46
+ */
47
+ function unresolvedImportOf(entry) {
48
+ if (!isJsonObject(entry) || typeof entry.specifier !== 'string' || typeof entry.path !== 'string') {
49
+ throw new Error("Fallow's output holds an unresolved import in a shape visual-check can't read.");
50
+ }
51
+ return { specifier: entry.specifier, paths: [entry.path] };
52
+ }
53
+ /**
54
+ * Tells whether a specifier names a file by its path, such as `./a.js` or `/src/a.js`, rather than a package or an
55
+ * alias. A broken relative import is a typo the build reports, not a hole in the graph.
56
+ */
57
+ function isPathSpecifier(specifier) {
58
+ return specifier.startsWith('.') || specifier.startsWith('/');
59
+ }
60
+ /**
61
+ * Joins the imports that share a specifier into one, in the order each specifier first appears, and leaves out those
62
+ * no file imports.
63
+ */
64
+ function joinedImportsOf(imports) {
65
+ const paths = new Map();
66
+ for (const { specifier, paths: importing } of imports) {
67
+ const known = paths.get(specifier) ?? [];
68
+ paths.set(specifier, [...known, ...importing.filter((path) => !known.includes(path))]);
69
+ }
70
+ return [...paths]
71
+ .filter(([, importing]) => importing.length > 0)
72
+ .map(([specifier, importing]) => ({ specifier, paths: importing }));
73
+ }
74
+ /**
75
+ * Reads the imports the graph can't follow from the document `fallow dead-code --format json` prints: its unresolved
76
+ * imports that aren't paths, then its unlisted dependencies that aren't installed where they're imported. Fallow counts
77
+ * a package against the importing package's own `package.json`, so a package the workspace root lists and hoists, or a
78
+ * workspace package linked into `node_modules`, counts as unlisted although the graph follows it.
79
+ *
80
+ * @throws {Error} When the document has no `unresolved_imports` or `unlisted_dependencies` array, or an entry is
81
+ * malformed.
82
+ */
83
+ export function unfollowedImportsOf(document, isInstalled) {
84
+ if (!isJsonObject(document) ||
85
+ !Array.isArray(document.unresolved_imports) ||
86
+ !Array.isArray(document.unlisted_dependencies)) {
87
+ throw new Error("Fallow's output has no unresolved_imports or unlisted_dependencies list.");
88
+ }
89
+ const unresolved = document.unresolved_imports
90
+ .map(unresolvedImportOf)
91
+ .filter(({ specifier }) => !isPathSpecifier(specifier));
92
+ const unlisted = document.unlisted_dependencies.map((entry) => unlistedDependencyOf(entry, isInstalled));
93
+ return joinedImportsOf([...unresolved, ...unlisted]);
94
+ }
95
+ /**
96
+ * Tells whether the package `name` is installed for the file at `path`, relative to `root`: whether `node_modules`
97
+ * holds it in the file's folder or a folder above it, up to `root`. That's where Node looks, so it covers packages the
98
+ * workspace root hoists and workspace packages linked into `node_modules`. Under Yarn Plug'n'Play there's no
99
+ * `node_modules`, so it finds none.
100
+ */
101
+ export function isInstalledIn(root) {
102
+ const top = resolve(root);
103
+ return (name, path) => {
104
+ let folder = dirname(resolve(top, path));
105
+ while (!existsSync(join(folder, 'node_modules', name))) {
106
+ if (folder === top || dirname(folder) === folder) {
107
+ return false;
108
+ }
109
+ folder = dirname(folder);
110
+ }
111
+ return true;
112
+ };
113
+ }
114
+ /**
115
+ * Words why a failed run failed: the timeout, Fallow's first line of stderr, or its exit code.
116
+ */
117
+ export function fallowFailureOf({ stderr = '', code, killed, message }) {
118
+ if (killed === true) {
119
+ return `Fallow didn't finish within ${timeoutMs / 1000} s.`;
120
+ }
121
+ const firstLine = stderr.split('\n').find((line) => line.trim() !== '');
122
+ return firstLine?.trim() ?? (typeof code === 'number' ? `exit code ${code}` : (message ?? 'it failed'));
123
+ }
124
+ /**
125
+ * Runs Fallow's dead code check for unresolved imports and unlisted dependencies. Fallow exits 1 when it finds anything, so a failing exit
126
+ * still gives its output.
127
+ */
128
+ async function runFallow(root) {
129
+ const bin = createRequire(import.meta.url).resolve('fallow/bin/fallow');
130
+ const args = [
131
+ bin,
132
+ 'dead-code',
133
+ '--unresolved-imports',
134
+ '--unlisted-deps',
135
+ '--format',
136
+ 'json',
137
+ '--no-cache',
138
+ '--root',
139
+ root,
140
+ ];
141
+ try {
142
+ const { stdout } = await execFileAsync(process.execPath, args, {
143
+ cwd: root,
144
+ maxBuffer: maxOutputBytes,
145
+ timeout: timeoutMs,
146
+ windowsHide: true,
147
+ });
148
+ return { stdout, failure: undefined };
149
+ }
150
+ catch (error) {
151
+ const failure = error;
152
+ return { stdout: failure.stdout ?? '', failure: fallowFailureOf(failure) };
153
+ }
154
+ }
155
+ /**
156
+ * Parses what Fallow wrote to stdout.
157
+ *
158
+ * @throws {Error} With `failure` when the text isn't JSON, or with a generic message when Fallow gave no failure.
159
+ */
160
+ function documentOf(stdout, failure) {
161
+ try {
162
+ return JSON.parse(stdout);
163
+ }
164
+ catch {
165
+ throw new Error(failure ?? "Fallow's output isn't JSON.");
166
+ }
167
+ }
168
+ /**
169
+ * Asks Fallow for the imports in the project's code that the affected-stories graph can't follow. It runs with
170
+ * `--no-cache`, so Fallow writes no `.fallow/` folder into the project.
171
+ *
172
+ * @throws {Error} With Fallow's own error message when it prints one as JSON, else with its first line of stderr, its
173
+ * exit code or the timeout when its output isn't JSON.
174
+ *
175
+ * @public
176
+ */
177
+ export const findUnfollowedImports = async (root) => {
178
+ const { stdout, failure } = await runFallow(root);
179
+ const document = documentOf(stdout, failure);
180
+ if (isJsonObject(document) && document.error === true && typeof document.message === 'string') {
181
+ throw new Error(document.message);
182
+ }
183
+ return unfollowedImportsOf(document, isInstalledIn(root));
184
+ };
185
+ /**
186
+ * How many imports the warning names before it counts the rest.
187
+ */
188
+ const namedImportCount = 3;
189
+ /**
190
+ * Names the imports for the warning, each with the first file that imports it: up to three in full, `a in x.js and b
191
+ * in y.js`, and past three the first three and how many more, `a in x.js, b in y.js, c in z.js and 2 more`.
192
+ */
193
+ function importNamesOf(imports) {
194
+ const names = imports.map(({ specifier, paths }) => `${specifier} in ${paths[0]}`);
195
+ if (names.length <= namedImportCount) {
196
+ return listOf(names);
197
+ }
198
+ return `${names.slice(0, namedImportCount).join(', ')} and ${names.length - namedImportCount} more`;
199
+ }
200
+ /**
201
+ * Words the warning for imports the graph can't follow, or gives `undefined` when there are none. It names at most
202
+ * three imports, and counts the rest.
203
+ */
204
+ export function unfollowedImportsWarningOf(imports) {
205
+ if (imports.length === 0) {
206
+ return undefined;
207
+ }
208
+ const names = importNamesOf(imports);
209
+ if (imports.length === 1) {
210
+ return (`Warning: visual-check can't follow the import ${names}, so it can't tell which stories a change behind it ` +
211
+ "affects. If it's an alias, declare it in paths in tsconfig.json. If it's a package, install it.");
212
+ }
213
+ return (`Warning: visual-check can't follow the imports ${names}, so it can't tell which stories a change behind them ` +
214
+ "affects. If they're aliases, declare them in paths in tsconfig.json. If they're packages, install them.");
215
+ }
216
+ /**
217
+ * Words the warning for a Fallow that couldn't run.
218
+ */
219
+ export function fallowFailureWarningOf(error) {
220
+ const message = error instanceof Error ? error.message : String(error);
221
+ return `Warning: Fallow couldn't check the imports: ${message}`;
222
+ }
223
+ //# sourceMappingURL=unfollowed-imports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unfollowed-imports.js","sourceRoot":"","sources":["../../src/init/unfollowed-imports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,aAAa,E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AAA;AACjE,CAAC"}
@@ -397,9 +397,9 @@ export interface ReportEntryFields {
397
397
  */
398
398
  attempts: number;
399
399
  /**
400
- * How many pixels the first capture of a snapshot that differs or passed on a retry differs by and how many are
401
- * allowed, otherwise `null`. On a size difference `differ` counts the padding too and can be at most `allowed`,
402
- * since the size alone makes it differ.
400
+ * How many pixels the first capture differs by and how many are allowed: for a snapshot that differs, one that
401
+ * passed on a retry, and a baseline `update` wrote because it differed. Otherwise `null`. On a size difference
402
+ * `differ` counts the padding too and can be at most `allowed`, since the size alone makes it differ.
403
403
  */
404
404
  pixels: ReportPixels | null;
405
405
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visual-check/cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -45,7 +45,7 @@
45
45
  "yauzl": "^3.4.0"
46
46
  },
47
47
  "peerDependencies": {
48
- "@visual-check/chromium": "^157.0.0"
48
+ "@visual-check/chromium": "^157.0.0 || ^158.0.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/node": "22.20.5",
@@ -54,7 +54,7 @@
54
54
  "ink-testing-library": "4.0.0",
55
55
  "typescript": "7.0.2",
56
56
  "vitest": "5.1.0",
57
- "@visual-check/chromium": "157.0.0",
57
+ "@visual-check/chromium": "158.0.0",
58
58
  "@visual-check/typescript-config": "0.0.0"
59
59
  },
60
60
  "scripts": {
package/skill/SKILL.md CHANGED
@@ -74,7 +74,7 @@ While you troubleshoot a broken story, read its entry's console messages (`conso
74
74
  - a stale entry (`staleExpectedPageErrors`): the story no longer raises that page error. Remove the entry, or fix the story when it should still raise it.
75
75
  4. **A real network request** (an entry of `realRequests`), by its `host`: mock the request with MSW, or serve what it fetches from Storybook. A story that reaches the host on purpose sets `realRequests: 'warn'` or `'off'`, and a host every story may reach goes in the config's `silenceHosts`.
76
76
  5. **The remote-content hint** (a `hints` entry of kind `remote-content`), **or `update`'s remote-content warning:** serve the image from Storybook, then mock it with MSW, then mask it by host.
77
- 6. **A flaky snapshot, or a story that moves:** a mask by selector for timers, spinners and skeletons, or a `wait` hook.
77
+ 6. **A flaky snapshot, or a story that moves:** a fixed `clock` or `randomSeed` for today's date or random data, a mask by selector for timers, spinners and skeletons, or a `wait` hook.
78
78
 
79
79
  Options go in `parameters` through the `visualCheck` helper the project exports from `visual-check.ts` in each Storybook's config folder: on a story, on a stories file's meta, or in `preview` for every story.
80
80
 
@@ -1,75 +0,0 @@
1
- /**
2
- * A package that code imports and `package.json` doesn't list.
3
- */
4
- export interface UnlistedDependency {
5
- /**
6
- * The package's name.
7
- */
8
- name: string;
9
- /**
10
- * The files that import it, relative to the project root.
11
- */
12
- paths: string[];
13
- }
14
- /**
15
- * Finds the unlisted dependencies of the project at `root`. It throws when Fallow can't run.
16
- *
17
- * @public
18
- */
19
- export type FindUnlistedDependencies = (root: string) => Promise<UnlistedDependency[]>;
20
- /**
21
- * Reads the unlisted dependencies from the document `fallow dead-code --format json` prints.
22
- *
23
- * @throws {Error} When the document has no `unlisted_dependencies` array, or an entry is malformed.
24
- */
25
- export declare function unlistedDependenciesOf(document: unknown): UnlistedDependency[];
26
- /**
27
- * What `execFile` rejects with when the process exits with a code, is killed or can't start.
28
- */
29
- interface ExecFailure {
30
- /**
31
- * What the process wrote to stdout.
32
- */
33
- stdout?: string;
34
- /**
35
- * What the process wrote to stderr.
36
- */
37
- stderr?: string;
38
- /**
39
- * The exit code, or a code such as `ENOENT` when the process didn't start.
40
- */
41
- code?: number | string;
42
- /**
43
- * Whether the timeout killed the process.
44
- */
45
- killed?: boolean;
46
- /**
47
- * The failure's message.
48
- */
49
- message?: string;
50
- }
51
- /**
52
- * Words why a failed run failed: the timeout, Fallow's first line of stderr, or its exit code.
53
- */
54
- export declare function fallowFailureOf({ stderr, code, killed, message }: ExecFailure): string;
55
- /**
56
- * Asks Fallow for the packages the project's code imports that `package.json` doesn't list. It runs with `--no-cache`,
57
- * so Fallow writes no `.fallow/` folder into the project.
58
- *
59
- * @throws {Error} With Fallow's own error message when it prints one as JSON, else with its first line of stderr, its
60
- * exit code or the timeout when its output isn't JSON.
61
- *
62
- * @public
63
- */
64
- export declare const findUnlistedDependencies: FindUnlistedDependencies;
65
- /**
66
- * Words the warning for unlisted dependencies, or gives `undefined` when there are none. It names at most three
67
- * packages, and counts the rest.
68
- */
69
- export declare function unlistedDependenciesWarningOf(unlisted: readonly UnlistedDependency[]): string | undefined;
70
- /**
71
- * Words the warning for a Fallow that couldn't run.
72
- */
73
- export declare function fallowFailureWarningOf(error: unknown): string;
74
- export {};
75
- //# sourceMappingURL=unlisted-dependencies.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unlisted-dependencies.d.ts","sourceRoot":"","sources":["../../src/init/unlisted-dependencies.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAA;AAmCtF;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,kBAAkB,EAAE,CAM9E;AAED;;GAEG;AACH,UAAU,WAAW;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAgBD;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAAE,MAAW,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,WAAW,GAAG,MAAM,CAQ3F;AAuCD;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,EAAE,wBAStC,CAAA;AAmBD;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,GAAG,MAAM,GAAG,SAAS,CAoBzG;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAI7D"}
@@ -1,142 +0,0 @@
1
- import { execFile } from 'node:child_process';
2
- import { createRequire } from 'node:module';
3
- import { promisify } from 'node:util';
4
- import { listOf } from './list-of.js';
5
- import { isJsonObject } from './package-manager.js';
6
- /**
7
- * `execFile` that returns a promise.
8
- */
9
- const execFileAsync = promisify(execFile);
10
- /**
11
- * The most output Fallow may write, in bytes.
12
- */
13
- const maxOutputBytes = 256 * 1024 * 1024;
14
- /**
15
- * The longest Fallow may run, in milliseconds.
16
- */
17
- const timeoutMs = 120_000;
18
- /**
19
- * Reads one entry of Fallow's `unlisted_dependencies` array. An entry that isn't a package name with at least one
20
- * importing file throws.
21
- */
22
- function unlistedDependencyOf(entry) {
23
- if (!isJsonObject(entry) || typeof entry.package_name !== 'string' || !Array.isArray(entry.imported_from)) {
24
- throw new Error("Fallow's output holds an unlisted dependency in a shape visual-check can't read.");
25
- }
26
- const paths = entry.imported_from.map((site) => (isJsonObject(site) ? site.path : undefined));
27
- if (paths.length === 0 || !paths.every((path) => typeof path === 'string')) {
28
- throw new Error("Fallow's output holds an unlisted dependency without the files that import it.");
29
- }
30
- return { name: entry.package_name, paths };
31
- }
32
- /**
33
- * Reads the unlisted dependencies from the document `fallow dead-code --format json` prints.
34
- *
35
- * @throws {Error} When the document has no `unlisted_dependencies` array, or an entry is malformed.
36
- */
37
- export function unlistedDependenciesOf(document) {
38
- if (!isJsonObject(document) || !Array.isArray(document.unlisted_dependencies)) {
39
- throw new Error("Fallow's output has no unlisted_dependencies list.");
40
- }
41
- return document.unlisted_dependencies.map(unlistedDependencyOf);
42
- }
43
- /**
44
- * Words why a failed run failed: the timeout, Fallow's first line of stderr, or its exit code.
45
- */
46
- export function fallowFailureOf({ stderr = '', code, killed, message }) {
47
- if (killed === true) {
48
- return `Fallow didn't finish within ${timeoutMs / 1000} s.`;
49
- }
50
- const firstLine = stderr.split('\n').find((line) => line.trim() !== '');
51
- return firstLine?.trim() ?? (typeof code === 'number' ? `exit code ${code}` : (message ?? 'it failed'));
52
- }
53
- /**
54
- * Runs Fallow's dead code check for unlisted dependencies. Fallow exits 1 when it finds anything, so a failing exit
55
- * still gives its output.
56
- */
57
- async function runFallow(root) {
58
- const bin = createRequire(import.meta.url).resolve('fallow/bin/fallow');
59
- const args = [bin, 'dead-code', '--unlisted-deps', '--format', 'json', '--no-cache', '--root', root];
60
- try {
61
- const { stdout } = await execFileAsync(process.execPath, args, {
62
- cwd: root,
63
- maxBuffer: maxOutputBytes,
64
- timeout: timeoutMs,
65
- windowsHide: true,
66
- });
67
- return { stdout, failure: undefined };
68
- }
69
- catch (error) {
70
- const failure = error;
71
- return { stdout: failure.stdout ?? '', failure: fallowFailureOf(failure) };
72
- }
73
- }
74
- /**
75
- * Parses what Fallow wrote to stdout.
76
- *
77
- * @throws {Error} With `failure` when the text isn't JSON, or with a generic message when Fallow gave no failure.
78
- */
79
- function documentOf(stdout, failure) {
80
- try {
81
- return JSON.parse(stdout);
82
- }
83
- catch {
84
- throw new Error(failure ?? "Fallow's output isn't JSON.");
85
- }
86
- }
87
- /**
88
- * Asks Fallow for the packages the project's code imports that `package.json` doesn't list. It runs with `--no-cache`,
89
- * so Fallow writes no `.fallow/` folder into the project.
90
- *
91
- * @throws {Error} With Fallow's own error message when it prints one as JSON, else with its first line of stderr, its
92
- * exit code or the timeout when its output isn't JSON.
93
- *
94
- * @public
95
- */
96
- export const findUnlistedDependencies = async (root) => {
97
- const { stdout, failure } = await runFallow(root);
98
- const document = documentOf(stdout, failure);
99
- if (isJsonObject(document) && document.error === true && typeof document.message === 'string') {
100
- throw new Error(document.message);
101
- }
102
- return unlistedDependenciesOf(document);
103
- };
104
- /**
105
- * How many unlisted packages the warning names before it counts the rest.
106
- */
107
- const namedPackageCount = 3;
108
- /**
109
- * Names the packages for the warning: up to three in full, `a, b and c`, and past three the first three and how many
110
- * more, `a, b, c and 2 more`.
111
- */
112
- function packageNamesOf(names) {
113
- if (names.length <= namedPackageCount) {
114
- return listOf(names);
115
- }
116
- return `${names.slice(0, namedPackageCount).join(', ')} and ${names.length - namedPackageCount} more`;
117
- }
118
- /**
119
- * Words the warning for unlisted dependencies, or gives `undefined` when there are none. It names at most three
120
- * packages, and counts the rest.
121
- */
122
- export function unlistedDependenciesWarningOf(unlisted) {
123
- if (unlisted.length === 0) {
124
- return undefined;
125
- }
126
- const [first] = unlisted;
127
- if (unlisted.length === 1 && first !== undefined) {
128
- return (`Warning: package.json doesn't list ${first.name}, imported in ${first.paths[0]}. ` +
129
- "visual-check can't tell which stories it affects.");
130
- }
131
- const names = packageNamesOf(unlisted.map(({ name }) => name));
132
- return (`Warning: package.json doesn't list ${names}, which your code imports. ` +
133
- "visual-check can't tell which stories they affect.");
134
- }
135
- /**
136
- * Words the warning for a Fallow that couldn't run.
137
- */
138
- export function fallowFailureWarningOf(error) {
139
- const message = error instanceof Error ? error.message : String(error);
140
- return `Warning: Fallow couldn't check the imports: ${message}`;
141
- }
142
- //# sourceMappingURL=unlisted-dependencies.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unlisted-dependencies.js","sourceRoot":"","sources":["../../src/init/unlisted-dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,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