ng-checkup 0.0.0-stage → 0.1.0

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 (66) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +107 -2
  3. package/dist/checks/change-detection.d.ts +22 -0
  4. package/dist/checks/change-detection.js +99 -0
  5. package/dist/checks/change-detection.js.map +1 -0
  6. package/dist/checks/circular-deps.d.ts +13 -0
  7. package/dist/checks/circular-deps.js +43 -0
  8. package/dist/checks/circular-deps.js.map +1 -0
  9. package/dist/checks/components.d.ts +19 -0
  10. package/dist/checks/components.js +97 -0
  11. package/dist/checks/components.js.map +1 -0
  12. package/dist/checks/context.d.ts +51 -0
  13. package/dist/checks/context.js +53 -0
  14. package/dist/checks/context.js.map +1 -0
  15. package/dist/checks/deprecated-apis.d.ts +14 -0
  16. package/dist/checks/deprecated-apis.js +141 -0
  17. package/dist/checks/deprecated-apis.js.map +1 -0
  18. package/dist/checks/state.d.ts +13 -0
  19. package/dist/checks/state.js +72 -0
  20. package/dist/checks/state.js.map +1 -0
  21. package/dist/checks/testing.d.ts +13 -0
  22. package/dist/checks/testing.js +98 -0
  23. package/dist/checks/testing.js.map +1 -0
  24. package/dist/checks/type-safety.d.ts +14 -0
  25. package/dist/checks/type-safety.js +105 -0
  26. package/dist/checks/type-safety.js.map +1 -0
  27. package/dist/checks/version.d.ts +12 -0
  28. package/dist/checks/version.js +107 -0
  29. package/dist/checks/version.js.map +1 -0
  30. package/dist/cli.d.ts +28 -0
  31. package/dist/cli.js +166 -0
  32. package/dist/cli.js.map +1 -0
  33. package/dist/deprecations.d.ts +30 -0
  34. package/dist/deprecations.js +279 -0
  35. package/dist/deprecations.js.map +1 -0
  36. package/dist/files.d.ts +29 -0
  37. package/dist/files.js +92 -0
  38. package/dist/files.js.map +1 -0
  39. package/dist/graph.d.ts +44 -0
  40. package/dist/graph.js +151 -0
  41. package/dist/graph.js.map +1 -0
  42. package/dist/index.d.ts +39 -0
  43. package/dist/index.js +126 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/report/html.d.ts +14 -0
  46. package/dist/report/html.js +210 -0
  47. package/dist/report/html.js.map +1 -0
  48. package/dist/report/markdown.d.ts +8 -0
  49. package/dist/report/markdown.js +55 -0
  50. package/dist/report/markdown.js.map +1 -0
  51. package/dist/report/summary.d.ts +45 -0
  52. package/dist/report/summary.js +65 -0
  53. package/dist/report/summary.js.map +1 -0
  54. package/dist/report/terminal.d.ts +17 -0
  55. package/dist/report/terminal.js +70 -0
  56. package/dist/report/terminal.js.map +1 -0
  57. package/dist/scan.d.ts +119 -0
  58. package/dist/scan.js +270 -0
  59. package/dist/scan.js.map +1 -0
  60. package/dist/types.d.ts +95 -0
  61. package/dist/types.js +9 -0
  62. package/dist/types.js.map +1 -0
  63. package/dist/workspace.d.ts +70 -0
  64. package/dist/workspace.js +155 -0
  65. package/dist/workspace.js.map +1 -0
  66. package/package.json +60 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecations.js","sourceRoot":"","sources":["../src/deprecations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAqBpD;;;;GAIG;AACH,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAE7C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,MAAM,KAAK,GAAqB,IAAI,GAAG,EAAE,CAAC;IAC1C,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE,CAAC;QACnC,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,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declaration files. */
4
+ typescript: string[];
5
+ /** `.html` files, which in an Angular repository are almost all component templates. */
6
+ html: string[];
7
+ /** Every `project.json`, which is how an Nx workspace describes its projects. */
8
+ projectJsons: string[];
9
+ }
10
+ /**
11
+ * Walks `root` once and sorts the files an analysis needs by kind.
12
+ *
13
+ * One walk serves the whole run, so a large monorepo is read from disk once.
14
+ * The result is sorted, which keeps report output stable between runs on the
15
+ * same tree. An unreadable directory is skipped rather than failing the run,
16
+ * since a permissions problem in one corner says nothing about the code.
17
+ */
18
+ export declare function collectFiles(root: string): CollectedFiles;
19
+ /**
20
+ * The form every report uses for a path: relative to the analysed root, with
21
+ * `/` separators on every platform, so a report generated on Windows reads the
22
+ * same as one generated on macOS.
23
+ */
24
+ export declare function toReportPath(root: string, absolute: string): string;
25
+ /**
26
+ * True for unit-test files. Angular CLI and Nx both name them `*.spec.ts`;
27
+ * `*.test.ts` covers Jest and Vitest setups that follow the other convention.
28
+ */
29
+ export declare function isSpecFile(path: string): boolean;
package/dist/files.js ADDED
@@ -0,0 +1,92 @@
1
+ import { readdirSync, statSync } from 'node:fs';
2
+ import { join, relative, sep } from 'node:path';
3
+ /**
4
+ * Directory names never descended into.
5
+ *
6
+ * Build output, caches and dependencies hold generated code that would swamp
7
+ * every count (one `dist` folder can double the `any` total), and none of it is
8
+ * code the team maintains. Hidden directories are skipped by a separate rule in
9
+ * `walk`, which is what keeps `.git`, `.angular`, `.nx` and editor folders out.
10
+ */
11
+ const SKIPPED_DIRECTORIES = new Set(['node_modules', 'dist', 'coverage', 'out-tsc', 'tmp', 'bazel-out']);
12
+ /**
13
+ * Files above this size are skipped as generated. A hand-written Angular source
14
+ * file is far below it, while a checked-in API client or a bundled vendor file
15
+ * is not, and parsing one can cost more than the rest of the repository.
16
+ */
17
+ const MAX_FILE_BYTES = 1_000_000;
18
+ /**
19
+ * Walks `root` once and sorts the files an analysis needs by kind.
20
+ *
21
+ * One walk serves the whole run, so a large monorepo is read from disk once.
22
+ * The result is sorted, which keeps report output stable between runs on the
23
+ * same tree. An unreadable directory is skipped rather than failing the run,
24
+ * since a permissions problem in one corner says nothing about the code.
25
+ */
26
+ export function collectFiles(root) {
27
+ const result = { typescript: [], html: [], projectJsons: [] };
28
+ walk(root, result);
29
+ result.typescript.sort();
30
+ result.html.sort();
31
+ result.projectJsons.sort();
32
+ return result;
33
+ }
34
+ /**
35
+ * The recursive half of `collectFiles`. Mutates `into`.
36
+ */
37
+ function walk(directory, into) {
38
+ let entries;
39
+ try {
40
+ entries = readdirSync(directory, { withFileTypes: true });
41
+ }
42
+ catch {
43
+ return;
44
+ }
45
+ for (const entry of entries) {
46
+ const path = join(directory, entry.name);
47
+ if (entry.isDirectory()) {
48
+ if (entry.name.startsWith('.') || SKIPPED_DIRECTORIES.has(entry.name))
49
+ continue;
50
+ walk(path, into);
51
+ continue;
52
+ }
53
+ if (!entry.isFile())
54
+ continue;
55
+ if (entry.name === 'project.json') {
56
+ into.projectJsons.push(path);
57
+ }
58
+ else if (entry.name.endsWith('.ts') && !entry.name.endsWith('.d.ts')) {
59
+ if (isWithinSizeLimit(path))
60
+ into.typescript.push(path);
61
+ }
62
+ else if (entry.name.endsWith('.html')) {
63
+ if (isWithinSizeLimit(path))
64
+ into.html.push(path);
65
+ }
66
+ }
67
+ }
68
+ /** False for files `MAX_FILE_BYTES` treats as generated, and for files that vanished mid-walk. */
69
+ function isWithinSizeLimit(path) {
70
+ try {
71
+ return statSync(path).size <= MAX_FILE_BYTES;
72
+ }
73
+ catch {
74
+ return false;
75
+ }
76
+ }
77
+ /**
78
+ * The form every report uses for a path: relative to the analysed root, with
79
+ * `/` separators on every platform, so a report generated on Windows reads the
80
+ * same as one generated on macOS.
81
+ */
82
+ export function toReportPath(root, absolute) {
83
+ return relative(root, absolute).split(sep).join('/');
84
+ }
85
+ /**
86
+ * True for unit-test files. Angular CLI and Nx both name them `*.spec.ts`;
87
+ * `*.test.ts` covers Jest and Vitest setups that follow the other convention.
88
+ */
89
+ export function isSpecFile(path) {
90
+ return /\.(spec|test)\.ts$/.test(path);
91
+ }
92
+ //# sourceMappingURL=files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.js","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;AAEzG;;;;GAIG;AACH,MAAM,cAAc,GAAG,SAAS,CAAC;AAYjC;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,MAAM,GAAmB,EAAE,UAAU,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IAC9E,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACnB,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;IACzB,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACnB,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IAC3B,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,SAAS,IAAI,CAAC,SAAiB,EAAE,IAAoB;IACnD,IAAI,OAAO,CAAC;IACZ,IAAI,CAAC;QACH,OAAO,GAAG,WAAW,CAAC,SAAS,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;IACT,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,C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,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC"}
@@ -0,0 +1,44 @@
1
+ import ts from 'typescript';
2
+ import type { SourceFileFacts } from './scan.js';
3
+ /** A group of files that import each other in a loop, directly or through others. */
4
+ export interface DependencyTangle {
5
+ /** Report paths of every file in the group, sorted. */
6
+ files: string[];
7
+ /**
8
+ * One concrete loop through the group, first file repeated at the end
9
+ * (`a.ts → b.ts → a.ts`), so a reader can see where to cut. A large group
10
+ * holds many loops; this is the shortest one through its first file.
11
+ */
12
+ example: string[];
13
+ }
14
+ /**
15
+ * Finds the import cycles among the analysed files.
16
+ *
17
+ * Counts groups (strongly connected components) rather than individual cycles.
18
+ * Two files that import each other plus a third that closes a second loop
19
+ * through them are one problem to untangle, while a cycle count would call it
20
+ * two or more and grows combinatorially with the size of the group, which is
21
+ * why tools that list every cycle report numbers nobody can act on.
22
+ *
23
+ * Only eager, value-level edges count: `import type` is erased at compile time
24
+ * and `import()` loads later, so neither can produce the initialisation-order
25
+ * crash a cycle is dangerous for. Spec files are left out because nothing
26
+ * imports them.
27
+ *
28
+ * @param compilerOptions The repository's compiler options, for `paths`
29
+ * aliases. Module resolution itself is forced to `bundler`, which is how the
30
+ * Angular CLI resolves and which needs no file extensions.
31
+ */
32
+ export declare function findTangles(files: SourceFileFacts[], compilerOptions: ts.CompilerOptions): DependencyTangle[];
33
+ /**
34
+ * Tarjan's algorithm, written iteratively. The recursive textbook version
35
+ * overflows the stack on a long import chain, and a 3 000-file app has those.
36
+ */
37
+ export declare function stronglyConnectedComponents(edges: Map<string, string[]>): string[][];
38
+ /**
39
+ * Compiler options from the repository's root tsconfig, `extends` included,
40
+ * which is where Nx and many CLI workspaces keep their `paths` aliases.
41
+ * Returns empty options when there is no tsconfig or it cannot be parsed; the
42
+ * graph then still resolves every relative import.
43
+ */
44
+ export declare function readCompilerOptions(tsconfigPath: string | undefined): ts.CompilerOptions;
package/dist/graph.js ADDED
@@ -0,0 +1,151 @@
1
+ import { dirname, resolve } from 'node:path';
2
+ import ts from 'typescript';
3
+ /**
4
+ * Finds the import cycles among the analysed files.
5
+ *
6
+ * Counts groups (strongly connected components) rather than individual cycles.
7
+ * Two files that import each other plus a third that closes a second loop
8
+ * through them are one problem to untangle, while a cycle count would call it
9
+ * two or more and grows combinatorially with the size of the group, which is
10
+ * why tools that list every cycle report numbers nobody can act on.
11
+ *
12
+ * Only eager, value-level edges count: `import type` is erased at compile time
13
+ * and `import()` loads later, so neither can produce the initialisation-order
14
+ * crash a cycle is dangerous for. Spec files are left out because nothing
15
+ * imports them.
16
+ *
17
+ * @param compilerOptions The repository's compiler options, for `paths`
18
+ * aliases. Module resolution itself is forced to `bundler`, which is how the
19
+ * Angular CLI resolves and which needs no file extensions.
20
+ */
21
+ export function findTangles(files, compilerOptions) {
22
+ const sources = files.filter((file) => !file.isSpec);
23
+ const byAbsolute = new Map(sources.map((file) => [resolve(file.absolutePath), file]));
24
+ const options = { ...compilerOptions, moduleResolution: ts.ModuleResolutionKind.Bundler, module: ts.ModuleKind.ESNext, allowJs: false };
25
+ const cache = ts.createModuleResolutionCache(process.cwd(), (name) => name, options);
26
+ const edges = new Map();
27
+ for (const file of sources) {
28
+ const targets = new Set();
29
+ for (const fact of file.imports) {
30
+ if (fact.typeOnly || fact.dynamic)
31
+ continue;
32
+ // Bare specifiers that are not path aliases resolve into node_modules and are dropped below;
33
+ // skipping the obvious ones first saves most of the resolution work.
34
+ if (!fact.specifier.startsWith('.') && !options.paths)
35
+ continue;
36
+ const resolved = ts.resolveModuleName(fact.specifier, file.absolutePath, options, ts.sys, cache).resolvedModule;
37
+ if (!resolved || resolved.isExternalLibraryImport)
38
+ continue;
39
+ const target = resolve(resolved.resolvedFileName);
40
+ if (byAbsolute.has(target))
41
+ targets.add(target);
42
+ }
43
+ edges.set(resolve(file.absolutePath), [...targets]);
44
+ }
45
+ return stronglyConnectedComponents(edges)
46
+ .filter((component) => component.length > 1 || (edges.get(component[0]) ?? []).includes(component[0]))
47
+ .map((component) => {
48
+ const members = new Set(component);
49
+ const sorted = component.map((path) => byAbsolute.get(path).path).sort();
50
+ const start = component.find((path) => byAbsolute.get(path).path === sorted[0]);
51
+ return { files: sorted, example: shortestLoop(start, edges, members).map((path) => byAbsolute.get(path).path) };
52
+ })
53
+ .sort((left, right) => right.files.length - left.files.length || left.files[0].localeCompare(right.files[0]));
54
+ }
55
+ /**
56
+ * Tarjan's algorithm, written iteratively. The recursive textbook version
57
+ * overflows the stack on a long import chain, and a 3 000-file app has those.
58
+ */
59
+ export function stronglyConnectedComponents(edges) {
60
+ let counter = 0;
61
+ const index = new Map();
62
+ const lowLink = new Map();
63
+ const onStack = new Set();
64
+ const stack = [];
65
+ const components = [];
66
+ for (const start of edges.keys()) {
67
+ if (index.has(start))
68
+ continue;
69
+ const work = [{ node: start, next: 0 }];
70
+ index.set(start, counter);
71
+ lowLink.set(start, counter++);
72
+ stack.push(start);
73
+ onStack.add(start);
74
+ while (work.length > 0) {
75
+ const frame = work[work.length - 1];
76
+ const successors = edges.get(frame.node) ?? [];
77
+ if (frame.next < successors.length) {
78
+ const successor = successors[frame.next++];
79
+ if (!index.has(successor)) {
80
+ index.set(successor, counter);
81
+ lowLink.set(successor, counter++);
82
+ stack.push(successor);
83
+ onStack.add(successor);
84
+ work.push({ node: successor, next: 0 });
85
+ }
86
+ else if (onStack.has(successor)) {
87
+ lowLink.set(frame.node, Math.min(lowLink.get(frame.node), index.get(successor)));
88
+ }
89
+ continue;
90
+ }
91
+ work.pop();
92
+ const parent = work[work.length - 1];
93
+ if (parent)
94
+ lowLink.set(parent.node, Math.min(lowLink.get(parent.node), lowLink.get(frame.node)));
95
+ if (lowLink.get(frame.node) === index.get(frame.node)) {
96
+ const component = [];
97
+ let member;
98
+ do {
99
+ member = stack.pop();
100
+ onStack.delete(member);
101
+ component.push(member);
102
+ } while (member !== frame.node);
103
+ components.push(component);
104
+ }
105
+ }
106
+ }
107
+ return components;
108
+ }
109
+ /**
110
+ * The shortest path from `start` back to itself inside one component, by
111
+ * breadth-first search. Always finds one, since every node of a strongly
112
+ * connected component lies on a loop.
113
+ */
114
+ function shortestLoop(start, edges, members) {
115
+ const previous = new Map();
116
+ const queue = [start];
117
+ for (let head = 0; head < queue.length; head++) {
118
+ const node = queue[head];
119
+ for (const successor of edges.get(node) ?? []) {
120
+ if (!members.has(successor))
121
+ continue;
122
+ if (successor === start) {
123
+ // Walk back from the node that closes the loop; a self-import leaves the chain empty.
124
+ const chain = [];
125
+ for (let step = node; step !== undefined && step !== start; step = previous.get(step))
126
+ chain.unshift(step);
127
+ return [start, ...chain, start];
128
+ }
129
+ if (!previous.has(successor) && successor !== start) {
130
+ previous.set(successor, node);
131
+ queue.push(successor);
132
+ }
133
+ }
134
+ }
135
+ return [start, start];
136
+ }
137
+ /**
138
+ * Compiler options from the repository's root tsconfig, `extends` included,
139
+ * which is where Nx and many CLI workspaces keep their `paths` aliases.
140
+ * Returns empty options when there is no tsconfig or it cannot be parsed; the
141
+ * graph then still resolves every relative import.
142
+ */
143
+ export function readCompilerOptions(tsconfigPath) {
144
+ if (!tsconfigPath)
145
+ return {};
146
+ const config = ts.readConfigFile(tsconfigPath, ts.sys.readFile);
147
+ if (config.error)
148
+ return {};
149
+ return ts.parseJsonConfigFileContent(config.config, ts.sys, dirname(tsconfigPath), undefined, tsconfigPath).options;
150
+ }
151
+ //# sourceMappingURL=graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.js","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,MAAM,YAAY,CAAC;AAe5B;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,WAAW,CAAC,K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AE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBAC/H,OAAO,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,KAAK,CAAC,CAAC;YAClC,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,SAAS,KAAK,KAAK,EAAE,CAAC;gBACpD,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;gBAC9B,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACxB,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACxB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,YAAgC;IAClE,IAAI,CAAC,YAAY;QAAE,OAAO,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC,YAAY,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAChE,IAAI,MAAM,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IAC5B,OAAO,EAAE,CAAC,0BAA0B,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,OAAO,CAAC;AACtH,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { AnalysisContext, Check } from './checks/context.js';
2
+ import type { CheckupOptions, Report } from './types.js';
3
+ export type * from './types.js';
4
+ /**
5
+ * The newest Angular major this release of the tool knows about. Used only
6
+ * when the registry cannot be reached or `--offline` is set, and the report
7
+ * says so next to the number, because it goes stale with every Angular release.
8
+ */
9
+ export declare const BUNDLED_LATEST_ANGULAR_MAJOR = 22;
10
+ /**
11
+ * The checks in report order: the upgrade blockers first (version,
12
+ * deprecations), then the modernisation areas, then the structural ones.
13
+ */
14
+ export declare const CHECKS: Check[];
15
+ /** This package's own name and version, read from its package.json at runtime so the two never drift. */
16
+ export declare const TOOL: {
17
+ name: string;
18
+ version: string;
19
+ };
20
+ /**
21
+ * Analyses the Angular codebase at `root` and returns the full report.
22
+ *
23
+ * Reads the disk and, unless `offline` is set, makes one request to the npm
24
+ * registry for the latest `@angular/core` version (three-second timeout,
25
+ * falling back to `BUNDLED_LATEST_ANGULAR_MAJOR`). Nothing else leaves the
26
+ * machine: no source, no file names, no telemetry. Never writes anything.
27
+ */
28
+ export declare function runCheckup(root: string, options?: CheckupOptions): Promise<Report>;
29
+ /** Gathers everything the checks read. Exported for tests that want to inspect the facts. */
30
+ export declare function buildContext(root: string, options: CheckupOptions): Promise<AnalysisContext>;
31
+ /**
32
+ * `angularCompilerOptions` of a tsconfig, merged along its `extends` chain
33
+ * with the child winning. TypeScript's own config parser resolves `extends`
34
+ * for `compilerOptions` only and drops this block, so it is merged by hand.
35
+ * Follows relative `extends` paths (strings or, since TS 5.0, arrays); a
36
+ * package-name `extends` is skipped, since no shared tsconfig package sets
37
+ * Angular's options.
38
+ */
39
+ export declare function readAngularCompilerOptions(tsconfigPath: string, depth?: number): Record<string, unknown>;
package/dist/index.js ADDED
@@ -0,0 +1,126 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { dirname, resolve } from 'node:path';
3
+ import { changeDetectionCheck } from './checks/change-detection.js';
4
+ import { circularDepsCheck } from './checks/circular-deps.js';
5
+ import { componentsCheck } from './checks/components.js';
6
+ import { deprecatedApisCheck } from './checks/deprecated-apis.js';
7
+ import { stateCheck } from './checks/state.js';
8
+ import { testingCheck } from './checks/testing.js';
9
+ import { typeSafetyCheck } from './checks/type-safety.js';
10
+ import { versionCheck } from './checks/version.js';
11
+ import { buildDeprecationIndex } from './deprecations.js';
12
+ import { collectFiles } from './files.js';
13
+ import { findTangles, readCompilerOptions } from './graph.js';
14
+ import { scanSourceFile, scanTemplateFile } from './scan.js';
15
+ import { asRecord, majorOf, readJson, readWorkspace } from './workspace.js';
16
+ /**
17
+ * The newest Angular major this release of the tool knows about. Used only
18
+ * when the registry cannot be reached or `--offline` is set, and the report
19
+ * says so next to the number, because it goes stale with every Angular release.
20
+ */
21
+ export const BUNDLED_LATEST_ANGULAR_MAJOR = 22;
22
+ /**
23
+ * The checks in report order: the upgrade blockers first (version,
24
+ * deprecations), then the modernisation areas, then the structural ones.
25
+ */
26
+ export const CHECKS = [versionCheck, deprecatedApisCheck, changeDetectionCheck, componentsCheck, stateCheck, testingCheck, typeSafetyCheck, circularDepsCheck];
27
+ /** This package's own name and version, read from its package.json at runtime so the two never drift. */
28
+ export const TOOL = readToolInfo();
29
+ /**
30
+ * Analyses the Angular codebase at `root` and returns the full report.
31
+ *
32
+ * Reads the disk and, unless `offline` is set, makes one request to the npm
33
+ * registry for the latest `@angular/core` version (three-second timeout,
34
+ * falling back to `BUNDLED_LATEST_ANGULAR_MAJOR`). Nothing else leaves the
35
+ * machine: no source, no file names, no telemetry. Never writes anything.
36
+ */
37
+ export async function runCheckup(root, options = {}) {
38
+ const started = Date.now();
39
+ const absoluteRoot = resolve(root);
40
+ const context = await buildContext(absoluteRoot, options);
41
+ const checks = CHECKS.map((check) => check(context));
42
+ const application = context.sources.filter((file) => !file.isSpec);
43
+ return {
44
+ tool: TOOL,
45
+ generatedAt: new Date().toISOString(),
46
+ root: absoluteRoot,
47
+ project: {
48
+ name: context.workspace.name,
49
+ kind: context.workspace.kind,
50
+ angularVersion: context.workspace.angular.installed ?? context.workspace.angular.declared,
51
+ sourceFiles: context.sources.length,
52
+ templateFiles: context.templates.filter((template) => !template.inline).length,
53
+ linesOfCode: application.reduce((sum, file) => sum + file.linesOfCode, 0),
54
+ },
55
+ checks,
56
+ durationMs: Date.now() - started,
57
+ };
58
+ }
59
+ /** Gathers everything the checks read. Exported for tests that want to inspect the facts. */
60
+ export async function buildContext(root, options) {
61
+ const files = collectFiles(root);
62
+ const workspace = readWorkspace(root, files.projectJsons);
63
+ const sources = files.typescript.map((path) => scanSourceFile(root, path));
64
+ const templates = [...files.html.map((path) => scanTemplateFile(root, path)), ...sources.flatMap((file) => file.inlineTemplates)];
65
+ const appCompilerOptions = readCompilerOptions(workspace.appTsconfig);
66
+ return {
67
+ workspace,
68
+ sources,
69
+ templates,
70
+ deprecations: buildDeprecationIndex(root),
71
+ tangles: findTangles(sources, readCompilerOptions(workspace.rootTsconfig)),
72
+ latestAngular: options.offline ? { major: BUNDLED_LATEST_ANGULAR_MAJOR, source: 'bundled' } : await fetchLatestAngularMajor(),
73
+ appCompilerOptions,
74
+ angularCompilerOptions: workspace.appTsconfig ? readAngularCompilerOptions(workspace.appTsconfig) : {},
75
+ maxExamples: options.maxExamples ?? 5,
76
+ };
77
+ }
78
+ /**
79
+ * The latest `@angular/core` major from the npm registry, or the bundled
80
+ * fallback when the request fails or takes longer than three seconds. A slow
81
+ * or offline network must never stall a run that is otherwise local.
82
+ */
83
+ async function fetchLatestAngularMajor() {
84
+ try {
85
+ const response = await fetch('https://registry.npmjs.org/@angular/core/latest', { signal: AbortSignal.timeout(3000) });
86
+ if (response.ok) {
87
+ const major = majorOf(asRecord(await response.json())['version']);
88
+ if (major !== undefined)
89
+ return { major, source: 'registry' };
90
+ }
91
+ }
92
+ catch {
93
+ // Offline, blocked by a proxy, or timed out: the bundled value is the answer.
94
+ }
95
+ return { major: BUNDLED_LATEST_ANGULAR_MAJOR, source: 'bundled' };
96
+ }
97
+ /**
98
+ * `angularCompilerOptions` of a tsconfig, merged along its `extends` chain
99
+ * with the child winning. TypeScript's own config parser resolves `extends`
100
+ * for `compilerOptions` only and drops this block, so it is merged by hand.
101
+ * Follows relative `extends` paths (strings or, since TS 5.0, arrays); a
102
+ * package-name `extends` is skipped, since no shared tsconfig package sets
103
+ * Angular's options.
104
+ */
105
+ export function readAngularCompilerOptions(tsconfigPath, depth = 0) {
106
+ const config = readJson(tsconfigPath);
107
+ if (!config || depth > 10)
108
+ return {};
109
+ const parents = (Array.isArray(config['extends']) ? config['extends'] : [config['extends']]).filter((entry) => typeof entry === 'string' && entry.startsWith('.'));
110
+ const inherited = parents.reduce((merged, parent) => {
111
+ const path = resolve(dirname(tsconfigPath), parent.endsWith('.json') ? parent : `${parent}.json`);
112
+ return { ...merged, ...readAngularCompilerOptions(path, depth + 1) };
113
+ }, {});
114
+ return { ...inherited, ...asRecord(config['angularCompilerOptions']) };
115
+ }
116
+ /** Reads name and version from this package's package.json, one level above both `src/` and `dist/`. */
117
+ function readToolInfo() {
118
+ try {
119
+ const packageJson = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
120
+ return { name: packageJson.name ?? 'ng-checkup', version: packageJson.version ?? '0.0.0' };
121
+ }
122
+ catch {
123
+ return { name: 'ng-checkup', version: '0.0.0' };
124
+ }
125
+ }
126
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM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IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAClD,CAAC;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Report } from '../types.js';
2
+ /**
3
+ * Renders the report as one self-contained HTML file.
4
+ *
5
+ * Self-contained is a hard requirement, not a style choice: the report is
6
+ * meant to be mailed to a client, attached to a ticket or opened on a machine
7
+ * without network, and it describes a private codebase. So there is no
8
+ * external font, script, stylesheet or image, and nothing on the page phones
9
+ * home. It follows the system light/dark preference and prints cleanly, since
10
+ * "save as PDF" is how many readers will pass it on.
11
+ */
12
+ export declare function renderHtml(report: Report): string;
13
+ /** HTML-escapes text for element content and double-quoted attributes. */
14
+ export declare function escape(text: string): string;