ng-checkup 0.5.3 → 0.7.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.
- package/README.md +43 -5
- package/dist/cache.d.ts +1 -0
- package/dist/cache.js.map +1 -1
- package/dist/checks/context.d.ts +5 -2
- package/dist/checks/context.js +2 -2
- package/dist/checks/context.js.map +1 -1
- package/dist/checks/dependencies.js +6 -3
- package/dist/checks/dependencies.js.map +1 -1
- package/dist/checks/deprecated-apis.js +13 -6
- package/dist/checks/deprecated-apis.js.map +1 -1
- package/dist/checks/version.js +3 -3
- package/dist/checks/version.js.map +1 -1
- package/dist/cli.d.ts +10 -0
- package/dist/cli.js +91 -6
- package/dist/cli.js.map +1 -1
- package/dist/compatibility.d.ts +23 -0
- package/dist/compatibility.js +62 -18
- package/dist/compatibility.js.map +1 -1
- package/dist/deprecations.d.ts +13 -2
- package/dist/deprecations.js +20 -3
- package/dist/deprecations.js.map +1 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/lockfile.d.ts +29 -0
- package/dist/lockfile.js +110 -0
- package/dist/lockfile.js.map +1 -0
- package/dist/package-store.d.ts +29 -0
- package/dist/package-store.js +101 -0
- package/dist/package-store.js.map +1 -0
- package/dist/plan.d.ts +1 -1
- package/dist/plan.js +35 -8
- package/dist/plan.js.map +1 -1
- package/dist/remote.d.ts +41 -0
- package/dist/remote.js +93 -0
- package/dist/remote.js.map +1 -0
- package/dist/report/html.js +150 -1
- package/dist/report/html.js.map +1 -1
- package/dist/report/markdown.js +1 -1
- package/dist/report/markdown.js.map +1 -1
- package/dist/report/notes.d.ts +19 -0
- package/dist/report/notes.js +124 -0
- package/dist/report/notes.js.map +1 -0
- package/dist/report/terminal.js +1 -1
- package/dist/report/terminal.js.map +1 -1
- package/dist/scan.d.ts +20 -0
- package/dist/scan.js +25 -0
- package/dist/scan.js.map +1 -1
- package/dist/types.d.ts +13 -0
- package/dist/typings.d.ts +25 -0
- package/dist/typings.js +49 -0
- package/dist/typings.js.map +1 -0
- package/dist/workspace.d.ts +9 -1
- package/dist/workspace.js +18 -4
- package/dist/workspace.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@ npx ng-checkup
|
|
|
25
25
|
- [Watch mode](#watch-mode)
|
|
26
26
|
- [Upgrade plan](#upgrade-plan)
|
|
27
27
|
- [Monorepos](#monorepos)
|
|
28
|
+
- [Client report](#client-report)
|
|
28
29
|
- [What it checks](#what-it-checks)
|
|
29
30
|
- [Reports](#reports)
|
|
30
31
|
- [In CI](#in-ci)
|
|
@@ -51,7 +52,16 @@ npx ng-checkup baseline
|
|
|
51
52
|
npx ng-checkup --fail-on regression
|
|
52
53
|
```
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
No `npm install` needed. Without `node_modules`, the exact versions come from the lockfile (npm, yarn or pnpm), and the Angular type definitions the deprecated-API check reads are downloaded once for those versions and cached. So it works on a fresh clone and in a CI job before `npm ci`.
|
|
56
|
+
|
|
57
|
+
Or check a repository without cloning it yourself:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx ng-checkup github:owner/repo --report checkup.html
|
|
61
|
+
npx ng-checkup https://gitlab.com/group/app#release-2.4
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
It clones only the one commit into a temporary folder, runs, and deletes it. Nothing from the repository is installed or run.
|
|
55
65
|
|
|
56
66
|
## Set it up in a project
|
|
57
67
|
|
|
@@ -195,6 +205,21 @@ npx ng-checkup --project admin --report admin.html
|
|
|
195
205
|
|
|
196
206
|
The baseline always covers the whole workspace, so `--project` runs do not compare against it.
|
|
197
207
|
|
|
208
|
+
## Client report
|
|
209
|
+
|
|
210
|
+
For consultants and tech leads who hand the result to someone else: `--client` turns the HTML report into a deliverable for a paid Health Check or an upgrade proposal.
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
npx ng-checkup github:acme/shop --client "Acme GmbH" --prepared-by "Jane Doe, jane.dev" --notes acme.md --report acme-health-check.html
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
- **For management, in front:** a cover, a summary in sentences ("Angular 17.1.1, 5 majors behind 22. Of 10 graded areas, 3 are poor…"), the key figures, a table of what to act on with the number of places each touches, and the roadmap one major at a time.
|
|
217
|
+
- **Your recommendations next:** `--notes` is a Markdown file for what the tool cannot know: your summary, estimates and price. The first run creates it as a template, prefilled with one row per upgrade step and an empty estimate column; fill it in and run the same command again. Guidance in the template sits in HTML comments and never reaches the client, and a section left empty is left out.
|
|
218
|
+
- **The full report as an appendix,** for the team.
|
|
219
|
+
- **Print to PDF** from the browser: the cover, the recommendations and the appendix each start on a new page.
|
|
220
|
+
|
|
221
|
+
The codebase is named by its repository and commit, never by a path on your disk. `NG_CHECKUP_PREPARED_BY` sets the name on the cover for every run. Nothing in the generated part is an estimate; numbers are measurements, and the estimate column is yours.
|
|
222
|
+
|
|
198
223
|
## What it checks
|
|
199
224
|
|
|
200
225
|
| Area | It looks at | Poor when |
|
|
@@ -236,12 +261,16 @@ Defaults that changed between versions are applied per version: a component with
|
|
|
236
261
|
<summary>All options</summary>
|
|
237
262
|
|
|
238
263
|
```text
|
|
239
|
-
Usage: ng-checkup [path] [options]
|
|
264
|
+
Usage: ng-checkup [path | repository] [options]
|
|
240
265
|
ng-checkup init [path] [init options]
|
|
241
266
|
ng-checkup baseline [path] [--force]
|
|
242
267
|
|
|
243
268
|
Arguments:
|
|
244
269
|
path Repository root (default: current directory)
|
|
270
|
+
repository Or a remote repository, cloned shallow into a temporary
|
|
271
|
+
folder and removed afterwards: github:owner/repo,
|
|
272
|
+
gitlab:owner/repo, a GitHub/GitLab URL, or any .git URL;
|
|
273
|
+
#<branch|tag|sha> picks a revision
|
|
245
274
|
|
|
246
275
|
Options:
|
|
247
276
|
-r, --report <file> Write the full report; format from the extension:
|
|
@@ -254,6 +283,14 @@ Options:
|
|
|
254
283
|
-p, --project <name> Analyse one project of an Angular CLI or Nx workspace.
|
|
255
284
|
Without it, a multi-project workspace also gets a
|
|
256
285
|
per-project table
|
|
286
|
+
--client <name> Write the HTML report as a client deliverable: a cover,
|
|
287
|
+
a management summary, what to act on and the roadmap,
|
|
288
|
+
with the full report as an appendix (implies --plan)
|
|
289
|
+
--prepared-by <text>
|
|
290
|
+
Name on the cover (default: $NG_CHECKUP_PREPARED_BY)
|
|
291
|
+
--notes <file.md> Your recommendations, estimates and price, in Markdown,
|
|
292
|
+
placed after the roadmap. A missing file is created as
|
|
293
|
+
a template prefilled with the upgrade steps
|
|
257
294
|
-w, --watch Re-run on every change and show how the score and the
|
|
258
295
|
measures moved since the watch started
|
|
259
296
|
--fail-on <grade> Exit with code 1 if any area is graded <grade> or worse
|
|
@@ -354,19 +391,20 @@ await writeFile('checkup.md', renderMarkdown(report));
|
|
|
354
391
|
|
|
355
392
|
## What leaves your machine
|
|
356
393
|
|
|
357
|
-
Package names, and only to the public npm registry: the latest `@angular/core` version (three-second timeout)
|
|
394
|
+
Package names and versions, and only to the public npm registry: the latest `@angular/core` version (three-second timeout); for every third-party package that depends on Angular, its public metadata, to find the release that supports the next Angular and whether it is deprecated (eight at a time, four-second timeout each); and, when `node_modules` is missing, the published tarballs of the `@angular/*`, `@ngrx/*` and `rxjs` versions your code imports, of which only `package.json` and `.d.ts` files are kept, in `~/.cache/ng-checkup` (`NG_CHECKUP_CACHE` moves it). `--offline` skips all of it and uses only what is already cached; the report then compares against the newest major this release knows and says so. A remote repository argument also clones it from its host. No source, no file names, no telemetry. The tool reads files and writes only the reports you ask for.
|
|
358
395
|
|
|
359
396
|
## How it works
|
|
360
397
|
|
|
361
398
|
- **Syntax only.** Every `.ts` file is parsed once with the TypeScript compiler API, without a type checker and without building your project. That is why it takes seconds on a large monorepo and works on a repository that does not compile. Identifiers are matched through their imports, so a local helper called `signal` is not counted as Angular's.
|
|
362
|
-
- **Deprecations come from
|
|
399
|
+
- **Deprecations come from the versions you run.** It reads the `@deprecated` tags in the `@angular/*`, `@ngrx/*` and `rxjs` type definitions (installed, or downloaded for the versions your lockfile pins), following Angular's re-exports between its bundled `.d.ts` chunks, in both the current package layout and the older one. The report always matches the version you actually run, in Angular's own words.
|
|
400
|
+
- **Generated code is left out of the counts.** A file a tool wrote (a leading `@generated` or "do not edit" comment, a name like `generated-types.ts` or `api.generated.ts`, a `generated` folder) does not count towards `any`, file sizes or lines of code, since nobody fixes it by hand; it stays in the import graph. The report says how many were left out.
|
|
363
401
|
- **Cycles are counted as groups.** A strongly connected component is one thing to untangle; counting individual cycles grows combinatorially.
|
|
364
402
|
|
|
365
403
|
## FAQ
|
|
366
404
|
|
|
367
405
|
**Does it change my code?** No. It only reads. The fixes it suggests are Angular's own `ng generate` migrations, which you run yourself.
|
|
368
406
|
|
|
369
|
-
**Why is the deprecated-API check "info"?**
|
|
407
|
+
**Why is the deprecated-API check "info"?** The Angular type definitions could not be read: dependencies are not installed and the run was `--offline` (or the registry was unreachable) before they were ever cached. Run once online, or `npm install`.
|
|
370
408
|
|
|
371
409
|
**My app is on Angular 12 and deprecated APIs are "good". Is that right?** Yes, for Angular 12: nothing that *Angular 12* deprecates is in use. Each upgrade step deprecates more, and the version check is where that gap shows.
|
|
372
410
|
|
package/dist/cache.d.ts
CHANGED
package/dist/cache.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AA4BjC,sBAAsB;AACtB,MAAM,UAAU,mBAAmB;IACjC,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,EAA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|
import type { DeprecationIndex } from '../deprecations.js';
|
|
5
5
|
import type { DependencyTangle } from '../graph.js';
|
|
6
|
+
import type { TypingsSource } from '../typings.js';
|
|
6
7
|
import type { SourceFileFacts, TemplateFact } from '../scan.js';
|
|
7
8
|
import type { CheckResult, FileRef } from '../types.js';
|
|
8
9
|
import type { WorkspaceInfo } from '../workspace.js';
|
|
@@ -17,8 +18,10 @@ export interface AnalysisContext {
|
|
|
17
18
|
sources: SourceFileFacts[];
|
|
18
19
|
/** External template files and inline `template:` strings. */
|
|
19
20
|
templates: TemplateFact[];
|
|
20
|
-
/** Empty when
|
|
21
|
+
/** Empty when no typings could be read, neither installed nor from the registry. */
|
|
21
22
|
deprecations: DeprecationIndex;
|
|
23
|
+
/** Where the typings behind `deprecations` came from, and which imported packages had none. */
|
|
24
|
+
typings: TypingsSource;
|
|
22
25
|
tangles: DependencyTangle[];
|
|
23
26
|
/**
|
|
24
27
|
* Report paths of the files loaded at startup: statically reachable from an
|
|
@@ -58,7 +61,7 @@ export declare function formatCount(value: number): string;
|
|
|
58
61
|
export declare function plural(count: number, singular: string, pluralForm?: string): string;
|
|
59
62
|
/** "uses" for one, "use" for several: the verb that agrees with a count. */
|
|
60
63
|
export declare function verb(count: number, singular: string, pluralForm: string): string;
|
|
61
|
-
/**
|
|
64
|
+
/** Application code: neither test code nor files a code generator wrote. */
|
|
62
65
|
export declare function applicationFiles(context: AnalysisContext): SourceFileFacts[];
|
|
63
66
|
/** Spec files only. */
|
|
64
67
|
export declare function specFiles(context: AnalysisContext): SourceFileFacts[];
|
package/dist/checks/context.js
CHANGED
|
@@ -42,9 +42,9 @@ export function plural(count, singular, pluralForm = `${singular}s`) {
|
|
|
42
42
|
export function verb(count, singular, pluralForm) {
|
|
43
43
|
return count === 1 ? singular : pluralForm;
|
|
44
44
|
}
|
|
45
|
-
/**
|
|
45
|
+
/** Application code: neither test code nor files a code generator wrote. */
|
|
46
46
|
export function applicationFiles(context) {
|
|
47
|
-
return context.sources.filter((file) => !file.isSpec);
|
|
47
|
+
return context.sources.filter((file) => !file.isSpec && !file.isGenerated);
|
|
48
48
|
}
|
|
49
49
|
/** Spec files only. */
|
|
50
50
|
export function specFiles(context) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/checks/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/checks/context.ts"],"names":[],"mappings":"AAiDA,+EAA+E;AAC/E,MAAM,UAAU,UAAU,CAAC,KAAwB,EAAE,GAAG,IAAc;IACpE,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,KAAK,MAAM,GAAG,IAAI,IAAI;YAAE,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC;IAC5F,OAAO,KAAK,CAAC;AACf,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,SAAS,CAAC,KAAwB,EAAE,GAAG,IAAc;IACnE,MAAM,IAAI,GAAc,EAAE,CAAC;IAC3B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/D,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,cAAc,CAAC,KAAwB,EAAE,OAAiB;IACxE,MAAM,IAAI,GAAc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AAED,4EAA4E;AAC5E,MAAM,UAAU,gBAAgB,CAAC,OAAwB;IACvD,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC7E,CAAC;AAED,uBAAuB;AACvB,MAAM,UAAU,SAAS,CAAC,OAAwB;IAChD,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -21,14 +21,17 @@ export function dependenciesCheck(context) {
|
|
|
21
21
|
const target = context.latestAngular.major;
|
|
22
22
|
const id = 'dependencies';
|
|
23
23
|
const title = 'Third-party compatibility';
|
|
24
|
-
|
|
24
|
+
// Without node_modules the peer ranges come from the registry, so only an
|
|
25
|
+
// offline run (or an unreachable registry) leaves nothing to read.
|
|
26
|
+
const unreadable = !workspace.hasNodeModules && context.latestAngular.source === 'bundled' && compatibility.length === 0;
|
|
27
|
+
if (current === undefined || unreadable) {
|
|
25
28
|
return {
|
|
26
29
|
id,
|
|
27
30
|
title,
|
|
28
31
|
grade: 'info',
|
|
29
|
-
summary: current === undefined ? 'No Angular dependency to check against.' : 'Dependencies are not installed, so the packages that depend on Angular could not be read.',
|
|
32
|
+
summary: current === undefined ? 'No Angular dependency to check against.' : 'Dependencies are not installed and the npm registry was not used, so the packages that depend on Angular could not be read.',
|
|
30
33
|
metrics: [],
|
|
31
|
-
findings: current === undefined ? [] : [{ severity: 'info', message: '
|
|
34
|
+
findings: current === undefined ? [] : [{ severity: 'info', message: 'Install the dependencies, or run without --offline to read each package from the npm registry' }],
|
|
32
35
|
};
|
|
33
36
|
}
|
|
34
37
|
const majors = Array.from({ length: target - current + 1 }, (_, index) => current + index);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../src/checks/dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAwB,MAAM,cAAc,CAAC;AAE/E;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAwB;IACxD,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAC7C,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;IACxC,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC;IAC3C,MAAM,EAAE,GAAG,cAAc,CAAC;IAC1B,MAAM,KAAK,GAAG,2BAA2B,CAAC;IAE1C,
|
|
1
|
+
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../src/checks/dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAwB,MAAM,cAAc,CAAC;AAE/E;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAwB;IACxD,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAC7C,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;IACxC,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC;IAC3C,MAAM,EAAE,GAAG,cAAc,CAAC;IAC1B,MAAM,KAAK,GAAG,2BAA2B,CAAC;IAE1C,0EAA0E;IAC1E,mEAAmE;IACnE,MAAM,UAAU,GAAG,CAAC,SAAS,CAAC,cAAc,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,KAAK,SAAS,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,CAAC;IACzH,IAAI,OAAO,KAAK,SAAS,IA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AAE,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,gBAAgB,OAAO,EAAE,EAAE;YACpG,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;SACtE;QACD,QAAQ;QACR,0GAA0G;QAC1G,QAAQ,EAAE;YACR,EAAE,EAAE,EAAE,iBAAiB,EAAE,KAAK,EAAE,mDAAmD,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE;YAC/G,EAAE,EAAE,EAAE,qBAAqB,EAAE,KAAK,EAAE,4BAA4B,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE;SAC7F;KACF,CAAC;AACJ,CAAC;AAED,+FAA+F;AAC/F,SAAS,WAAW,CAAC,KAAkE,EAAE,KAAa;IACpG,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC;IAC1C,OAAO,OAAO,CAAC,CAAC,CAAC,YAAY,OAAO,CAAC,OAAO,qBAAqB,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AACjF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isSpecFile } from '../files.js';
|
|
2
|
-
import { majorOf
|
|
2
|
+
import { majorOf } from '../workspace.js';
|
|
3
3
|
import { formatCount, plural } from './context.js';
|
|
4
4
|
/**
|
|
5
5
|
* Deprecated Angular and NgRx APIs the code uses, as the installed packages
|
|
@@ -21,13 +21,13 @@ export function deprecatedApisCheck(context) {
|
|
|
21
21
|
id: 'deprecated-apis',
|
|
22
22
|
title: 'Deprecated APIs',
|
|
23
23
|
grade: 'info',
|
|
24
|
-
summary: '
|
|
24
|
+
summary: 'The Angular type definitions could not be read, neither installed nor from the npm registry, so deprecations are not checked.',
|
|
25
25
|
metrics: [{ label: 'Legacy template directives', value: formatCount(legacyUses) }],
|
|
26
26
|
findings: [
|
|
27
27
|
{
|
|
28
28
|
severity: 'info',
|
|
29
|
-
message: '
|
|
30
|
-
detail:
|
|
29
|
+
message: 'Install the dependencies, or run without --offline so the typings of the exact versions can be downloaded',
|
|
30
|
+
detail: `Deprecations are read from the \`@deprecated\` tags of the \`@angular/*\`, \`@ngrx/*\` and \`rxjs\` type definitions of the versions the project uses: installed in \`node_modules\`, else the versions the lockfile pins, downloaded once into the cache.${context.typings.missing.length > 0 ? ` Not available: ${context.typings.missing.join(', ')}.` : ''}`,
|
|
31
31
|
},
|
|
32
32
|
],
|
|
33
33
|
measures: [{ id: 'legacy-template-directives', label: '*ngIf / *ngFor / [ngSwitch] uses', value: legacyUses }],
|
|
@@ -86,7 +86,7 @@ export function deprecatedApisCheck(context) {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
// `.toPromise()`: deprecated in RxJS 7 and removed in 8, so it only counts from 7 on.
|
|
89
|
-
const rxjsMajor = majorOf(
|
|
89
|
+
const rxjsMajor = majorOf(workspace.versions['rxjs'] ?? workspace.dependencies['rxjs']);
|
|
90
90
|
const toPromiseFiles = context.sources.filter((file) => file.toPromiseLines.length > 0);
|
|
91
91
|
const toPromiseCalls = toPromiseFiles.reduce((sum, file) => sum + file.toPromiseLines.length, 0);
|
|
92
92
|
if (rxjsMajor !== undefined && rxjsMajor >= 7 && toPromiseCalls > 0) {
|
|
@@ -108,7 +108,14 @@ export function deprecatedApisCheck(context) {
|
|
|
108
108
|
? current !== undefined && current < context.latestAngular.major
|
|
109
109
|
? `Nothing deprecated as of Angular ${current} is in use; APIs deprecated in later versions surface at each upgrade step.`
|
|
110
110
|
: 'No deprecated Angular or NgRx API in use.'
|
|
111
|
-
: `${
|
|
111
|
+
: `${[
|
|
112
|
+
usages.size > 0 ? `${plural(usages.size, 'deprecated symbol')} in ${plural(affectedFiles.size, 'file')}` : undefined,
|
|
113
|
+
rxjsMajor !== undefined && rxjsMajor >= 7 && toPromiseCalls > 0 ? plural(toPromiseCalls, '`.toPromise()` call') : undefined,
|
|
114
|
+
ngIf && legacyUses > 0 ? 'deprecated control flow in templates' : undefined,
|
|
115
|
+
]
|
|
116
|
+
.filter(Boolean)
|
|
117
|
+
.join(', ')
|
|
118
|
+
.replace(/^./, (first) => first.toUpperCase())}.`,
|
|
112
119
|
metrics: [
|
|
113
120
|
{ label: 'Deprecated symbols', value: usages.size },
|
|
114
121
|
{ label: 'Files affected', value: formatCount(affectedFiles.size) },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated-apis.js","sourceRoot":"","sources":["../../src/checks/deprecated-apis.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"deprecated-apis.js","sourceRoot":"","sources":["../../src/checks/deprecated-apis.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,EAAwB,MAAM,cAAc,CAAC;AAWzE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAwB;IAC1D,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAC5C,MAAM,eAAe,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC;IACvG,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAE5I,IAAI,YAAY,CAAC,IAAI,KAAK,CAAC,EAAE,C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,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC;AAC7D,CAAC"}
|
package/dist/checks/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { majorOf
|
|
1
|
+
import { majorOf } from '../workspace.js';
|
|
2
2
|
import { plural } from './context.js';
|
|
3
3
|
/**
|
|
4
4
|
* Packages whose presence is a finding of its own, with what replaced them.
|
|
@@ -67,7 +67,7 @@ export function versionCheck(context) {
|
|
|
67
67
|
}
|
|
68
68
|
const mismatched = Object.keys(workspace.dependencies)
|
|
69
69
|
.filter((name) => name.startsWith('@angular/') && !OWN_VERSIONING.has(name))
|
|
70
|
-
.map((name) => ({ name, major: majorOf(
|
|
70
|
+
.map((name) => ({ name, major: majorOf(workspace.versions[name] ?? workspace.dependencies[name]) }))
|
|
71
71
|
.filter((entry) => entry.major !== undefined && entry.major !== current);
|
|
72
72
|
if (mismatched.length > 0) {
|
|
73
73
|
findings.push({
|
|
@@ -100,7 +100,7 @@ export function versionCheck(context) {
|
|
|
100
100
|
grade,
|
|
101
101
|
summary: gap === 0 ? `On the latest major, Angular ${versionLabel}.` : `Angular ${versionLabel}, ${plural(gap, 'major')} behind ${latestAngular.major}.`,
|
|
102
102
|
metrics: [
|
|
103
|
-
{ label: 'Installed', value: versionLabel, hint: workspace.angular.
|
|
103
|
+
{ label: 'Installed', value: versionLabel, hint: workspace.angular.source ?? 'package.json range' },
|
|
104
104
|
{ label: 'Latest', value: latestAngular.major, hint: latestLabel },
|
|
105
105
|
{ label: 'Majors behind', value: gap },
|
|
106
106
|
{ label: 'Build system', value: webpackProjects.length > 0 ? 'webpack' : usesApplicationBuilder ? 'esbuild' : 'unknown' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/checks/version.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src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AQ,EAAE;YACR,EAAE,EAAE,EAAE,sBAAsB,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE;YACtF,EAAE,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,iCAAiC,EAAE,KAAK,EAAE,eAAe,CAAC,MAAM,EAAE;YACnG,EAAE,EAAE,EAAE,6BAA6B,EAAE,KAAK,EAAE,mCAAmC,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE;SAC5G;KACF,CAAC;AACJ,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { type CheckupConfig } from './config.js';
|
|
3
3
|
import { type CiChoice, type InitPlan } from './init.js';
|
|
4
|
+
import { type RemoteRepository } from './remote.js';
|
|
4
5
|
import type { Report } from './types.js';
|
|
5
6
|
/** Parsed and validated arguments of a checkup run, before the config file is applied. */
|
|
6
7
|
export interface CliArguments {
|
|
8
|
+
/** The local root; for a remote run, the repository argument until `main` has cloned it. */
|
|
7
9
|
root: string;
|
|
10
|
+
/** Set when the argument names a remote repository instead of a local path. */
|
|
11
|
+
remote?: RemoteRepository;
|
|
8
12
|
/** Reports named on the command line, resolved against the working directory. Empty when none. */
|
|
9
13
|
reports: string[];
|
|
10
14
|
json: boolean;
|
|
@@ -16,6 +20,12 @@ export interface CliArguments {
|
|
|
16
20
|
plan: boolean;
|
|
17
21
|
/** `--project`: one project of the workspace, by name. */
|
|
18
22
|
project?: string;
|
|
23
|
+
/** `--client`, `--prepared-by`, `--notes`: the client report. */
|
|
24
|
+
client?: {
|
|
25
|
+
name: string;
|
|
26
|
+
preparedBy?: string;
|
|
27
|
+
notes?: string;
|
|
28
|
+
};
|
|
19
29
|
watch: boolean;
|
|
20
30
|
color: boolean;
|
|
21
31
|
config?: string;
|
package/dist/cli.js
CHANGED
|
@@ -8,12 +8,14 @@ import { createAnalysisCache } from './cache.js';
|
|
|
8
8
|
import { loadConfig, REPORT_FORMATS } from './config.js';
|
|
9
9
|
import { ProjectNotFoundError, runCheckup, TOOL } from './index.js';
|
|
10
10
|
import { planInit } from './init.js';
|
|
11
|
+
import { cloneRemote, describeCheckout, parseRemote } from './remote.js';
|
|
11
12
|
import { renderHtml } from './report/html.js';
|
|
12
13
|
import { renderMarkdown } from './report/markdown.js';
|
|
14
|
+
import { notesTemplate } from './report/notes.js';
|
|
13
15
|
import { renderSarif } from './report/sarif.js';
|
|
14
16
|
import { renderTerminal } from './report/terminal.js';
|
|
15
17
|
import { describeProgress, watchCheckup } from './watch.js';
|
|
16
|
-
const HELP = `Usage: ng-checkup [path] [options]
|
|
18
|
+
const HELP = `Usage: ng-checkup [path | repository] [options]
|
|
17
19
|
ng-checkup init [path] [init options]
|
|
18
20
|
ng-checkup baseline [path] [--force]
|
|
19
21
|
|
|
@@ -24,6 +26,10 @@ registry, to look up the latest Angular and compatible releases (skip it with
|
|
|
24
26
|
|
|
25
27
|
Arguments:
|
|
26
28
|
path Repository root (default: current directory)
|
|
29
|
+
repository Or a remote repository, cloned shallow into a temporary
|
|
30
|
+
folder and removed afterwards: github:owner/repo,
|
|
31
|
+
gitlab:owner/repo, a GitHub/GitLab URL, or any .git URL;
|
|
32
|
+
#<branch|tag|sha> picks a revision
|
|
27
33
|
|
|
28
34
|
Options:
|
|
29
35
|
-r, --report <file> Write the full report; format from the extension:
|
|
@@ -36,6 +42,14 @@ Options:
|
|
|
36
42
|
-p, --project <name> Analyse one project of an Angular CLI or Nx workspace.
|
|
37
43
|
Without it, a multi-project workspace also gets a
|
|
38
44
|
per-project table
|
|
45
|
+
--client <name> Write the HTML report as a client deliverable: a cover,
|
|
46
|
+
a management summary, what to act on and the roadmap,
|
|
47
|
+
with the full report as an appendix (implies --plan)
|
|
48
|
+
--prepared-by <text>
|
|
49
|
+
Name on the cover (default: $NG_CHECKUP_PREPARED_BY)
|
|
50
|
+
--notes <file.md> Your recommendations, estimates and price, in Markdown,
|
|
51
|
+
placed after the roadmap. A missing file is created as
|
|
52
|
+
a template prefilled with the upgrade steps
|
|
39
53
|
-w, --watch Re-run on every change and show how the score and the
|
|
40
54
|
measures moved since the watch started
|
|
41
55
|
--fail-on <grade> Exit with code 1 if any area is graded <grade> or worse
|
|
@@ -62,6 +76,8 @@ Examples:
|
|
|
62
76
|
npx ng-checkup --plan --report plan.md
|
|
63
77
|
npx ng-checkup --watch
|
|
64
78
|
npx ng-checkup --project admin --report admin.html
|
|
79
|
+
npx ng-checkup github:angular/angular-cli --report checkup.html
|
|
80
|
+
npx ng-checkup --client "Acme GmbH" --notes acme.md --report acme.html
|
|
65
81
|
npx ng-checkup --fail-on poor --report checkup.md
|
|
66
82
|
npx ng-checkup init
|
|
67
83
|
npx ng-checkup baseline && npx ng-checkup --fail-on regression`;
|
|
@@ -88,6 +104,9 @@ export function parseCliArguments(argv, environment = process.env, isTty = Boole
|
|
|
88
104
|
plan: { type: 'boolean' },
|
|
89
105
|
watch: { type: 'boolean', short: 'w' },
|
|
90
106
|
project: { type: 'string', short: 'p' },
|
|
107
|
+
client: { type: 'string' },
|
|
108
|
+
'prepared-by': { type: 'string' },
|
|
109
|
+
notes: { type: 'string' },
|
|
91
110
|
config: { type: 'string' },
|
|
92
111
|
'no-color': { type: 'boolean' },
|
|
93
112
|
help: { type: 'boolean', short: 'h' },
|
|
@@ -98,7 +117,12 @@ export function parseCliArguments(argv, environment = process.env, isTty = Boole
|
|
|
98
117
|
return 'help';
|
|
99
118
|
if (values.version)
|
|
100
119
|
return 'version';
|
|
101
|
-
const
|
|
120
|
+
const remote = positionals.length === 1 ? parseRemote(positionals[0]) : undefined;
|
|
121
|
+
const root = remote ? positionals[0] : parseRoot(positionals);
|
|
122
|
+
if (remote && values.watch)
|
|
123
|
+
throw new Error('--watch needs a local checkout; clone the repository and run it there');
|
|
124
|
+
if (remote && values.offline)
|
|
125
|
+
throw new Error('a remote repository has to be cloned, which needs the network, so it cannot be combined with --offline');
|
|
102
126
|
const reports = (values.report ?? []).map((report) => resolve(report));
|
|
103
127
|
for (const report of reports)
|
|
104
128
|
assertReportFormat(report);
|
|
@@ -109,6 +133,11 @@ export function parseCliArguments(argv, environment = process.env, isTty = Boole
|
|
|
109
133
|
throw new Error('--watch prints a live summary, so it cannot be combined with --json');
|
|
110
134
|
if (values.watch && failOn !== undefined)
|
|
111
135
|
throw new Error('--watch never exits on its own, so --fail-on has nothing to fail; use it in a normal run');
|
|
136
|
+
if ((values.notes !== undefined || values['prepared-by'] !== undefined) && values.client === undefined)
|
|
137
|
+
throw new Error('--notes and --prepared-by belong to a client report; add --client "<name>"');
|
|
138
|
+
if (values.client !== undefined && values.client.trim() === '')
|
|
139
|
+
throw new Error('--client needs the client name');
|
|
140
|
+
const preparedBy = values['prepared-by'] ?? environment['NG_CHECKUP_PREPARED_BY'];
|
|
112
141
|
let maxExamples;
|
|
113
142
|
if (values['max-examples'] !== undefined) {
|
|
114
143
|
maxExamples = Number(values['max-examples']);
|
|
@@ -117,14 +146,17 @@ export function parseCliArguments(argv, environment = process.env, isTty = Boole
|
|
|
117
146
|
}
|
|
118
147
|
return {
|
|
119
148
|
root,
|
|
149
|
+
...(remote ? { remote } : {}),
|
|
120
150
|
reports,
|
|
121
151
|
json: values.json ?? false,
|
|
122
152
|
verbose: values.verbose ?? false,
|
|
123
153
|
failOn,
|
|
124
154
|
maxExamples,
|
|
125
155
|
offline: values.offline ?? false,
|
|
126
|
-
|
|
156
|
+
// The roadmap is the core of a client report.
|
|
157
|
+
plan: (values.plan ?? false) || values.client !== undefined,
|
|
127
158
|
project: values.project,
|
|
159
|
+
...(values.client !== undefined ? { client: { name: values.client.trim(), ...(preparedBy ? { preparedBy } : {}), ...(values.notes !== undefined ? { notes: resolve(values.notes) } : {}) } } : {}),
|
|
128
160
|
watch: values.watch ?? false,
|
|
129
161
|
color: !values['no-color'] && environment['NO_COLOR'] === undefined && isTty,
|
|
130
162
|
config: values.config,
|
|
@@ -267,16 +299,46 @@ async function main(argv) {
|
|
|
267
299
|
if (argv[0] === 'baseline')
|
|
268
300
|
return mainBaseline(argv.slice(1));
|
|
269
301
|
let parsed;
|
|
270
|
-
let settings;
|
|
271
|
-
let baseline;
|
|
272
302
|
try {
|
|
273
303
|
parsed = parseCliArguments(argv);
|
|
274
304
|
if (parsed === 'help' || parsed === 'version') {
|
|
275
305
|
process.stdout.write(`${parsed === 'help' ? HELP : TOOL.version}\n`);
|
|
276
306
|
return 0;
|
|
277
307
|
}
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
return usageError(error);
|
|
311
|
+
}
|
|
312
|
+
if (!parsed.remote)
|
|
313
|
+
return mainCheckup(parsed);
|
|
314
|
+
let clone;
|
|
315
|
+
try {
|
|
316
|
+
process.stderr.write(`Cloning ${parsed.remote.label}${parsed.remote.ref ? ` at ${parsed.remote.ref}` : ''} (shallow)...\n`);
|
|
317
|
+
clone = cloneRemote(parsed.remote);
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
return usageError(error);
|
|
321
|
+
}
|
|
322
|
+
try {
|
|
323
|
+
return await mainCheckup({ ...parsed, root: clone.directory }, `${parsed.remote.label} @ ${clone.commit.slice(0, 7)}`);
|
|
324
|
+
}
|
|
325
|
+
finally {
|
|
326
|
+
clone.remove();
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* One checkup run on a local root. `rootLabel` replaces the absolute root in
|
|
331
|
+
* the report for a remote run, whose temporary folder means nothing to a
|
|
332
|
+
* reader and is gone by the time they read it.
|
|
333
|
+
*/
|
|
334
|
+
async function mainCheckup(parsed, rootLabel) {
|
|
335
|
+
let settings;
|
|
336
|
+
let baseline;
|
|
337
|
+
try {
|
|
278
338
|
const { config, directory } = loadConfig(parsed.root, parsed.config);
|
|
279
|
-
|
|
339
|
+
// A remote repository's own config may name report files; they would be
|
|
340
|
+
// written into the temporary clone and deleted with it.
|
|
341
|
+
settings = resolveSettings(parsed, rootLabel ? { ...config, reports: undefined } : config, directory);
|
|
280
342
|
// The baseline records the whole workspace; one project measured against
|
|
281
343
|
// it would show every other project's code as an improvement.
|
|
282
344
|
if (parsed.project !== undefined && settings.failOn === 'regression')
|
|
@@ -301,6 +363,27 @@ async function main(argv) {
|
|
|
301
363
|
}
|
|
302
364
|
if (baseline)
|
|
303
365
|
report.baseline = compareWithBaseline(report, baseline, settings.baselinePath);
|
|
366
|
+
if (rootLabel)
|
|
367
|
+
report.root = rootLabel;
|
|
368
|
+
// A client report goes to someone else: no absolute path of this machine in it.
|
|
369
|
+
else if (parsed.client)
|
|
370
|
+
report.root = describeCheckout(parsed.root);
|
|
371
|
+
let notesMessage;
|
|
372
|
+
if (parsed.client) {
|
|
373
|
+
const { notes: notesPath, ...client } = parsed.client;
|
|
374
|
+
let notes;
|
|
375
|
+
if (notesPath && existsSync(notesPath)) {
|
|
376
|
+
notes = readFileSync(notesPath, 'utf8');
|
|
377
|
+
}
|
|
378
|
+
else if (notesPath) {
|
|
379
|
+
mkdirSync(dirname(notesPath), { recursive: true });
|
|
380
|
+
writeFileSync(notesPath, notesTemplate({ ...report, client }));
|
|
381
|
+
notesMessage = `Notes template written to ${notesPath}: add your summary, estimates and price, then run the same command again.`;
|
|
382
|
+
}
|
|
383
|
+
report.client = { ...client, ...(notes !== undefined ? { notes } : {}) };
|
|
384
|
+
if (!settings.reports.some((target) => /\.html?$/i.test(target)))
|
|
385
|
+
notesMessage = [notesMessage, 'The client report is an HTML page: add --report <file>.html to write it.'].filter(Boolean).join('\n');
|
|
386
|
+
}
|
|
304
387
|
writeReports(report, settings.reports);
|
|
305
388
|
if (parsed.json) {
|
|
306
389
|
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
@@ -309,6 +392,8 @@ async function main(argv) {
|
|
|
309
392
|
process.stdout.write(`${renderTerminal(report, { color: parsed.color, verbose: parsed.verbose })}\n`);
|
|
310
393
|
for (const target of settings.reports)
|
|
311
394
|
process.stdout.write(`Report written to ${target}\n`);
|
|
395
|
+
if (notesMessage)
|
|
396
|
+
process.stdout.write(`${notesMessage}\n`);
|
|
312
397
|
}
|
|
313
398
|
return shouldFail(report, settings.failOn) ? 1 : 0;
|
|
314
399
|
}
|