From d9c03334c3e73af5294ac2c271adca1061ce1c4a Mon Sep 17 00:00:00 2001 From: Ahn Date: Mon, 18 Oct 2021 16:48:34 +0200 Subject: [PATCH] refactor(transformers): use Angular `downlevel-ctor` transformer Since we don't support Angular 9 anymore, it is safe to import `downlevel-ctor` transformer from `@angular/compiler-cli` --- .../example-app-v10/src/app/app.component.ts | 12 +- .../example-app-v10/src/app/foo.service.ts | 10 + .../example-app-v11/src/app/app.component.ts | 12 +- .../example-app-v11/src/app/foo.service.ts | 10 + .../projects/app1/src/app/app.component.ts | 12 +- .../projects/app1/src/app/foo.service.ts | 10 + .../projects/app2/src/app/app.component.ts | 12 +- .../projects/app2/src/app/foo.service.ts | 10 + .../example-app-v12/src/app/app.component.ts | 12 +- .../example-app-v12/src/app/foo.service.ts | 10 + .../packages/angular-app/package.json | 31 +- .../angular-app/src/app/app.component.ts | 12 +- .../angular-app/src/app/foo.service.ts | 10 + examples/example-app-yarn-workspace/yarn.lock | 1016 ++++++++++------- .../__snapshots__/downlevel-ctor.spec.ts.snap | 51 - src/__tests__/downlevel-ctor.spec.ts | 56 - src/compiler/ng-jest-compiler.ts | 5 +- src/transformers/downlevel-ctor.ts | 753 ------------ .../patch-alias-reference-resolution.ts | 140 --- 19 files changed, 756 insertions(+), 1428 deletions(-) create mode 100644 examples/example-app-v10/src/app/foo.service.ts create mode 100644 examples/example-app-v11/src/app/foo.service.ts create mode 100644 examples/example-app-v12-monorepo/projects/app1/src/app/foo.service.ts create mode 100644 examples/example-app-v12-monorepo/projects/app2/src/app/foo.service.ts create mode 100644 examples/example-app-v12/src/app/foo.service.ts create mode 100644 examples/example-app-yarn-workspace/packages/angular-app/src/app/foo.service.ts delete mode 100644 src/__tests__/__snapshots__/downlevel-ctor.spec.ts.snap delete mode 100644 src/__tests__/downlevel-ctor.spec.ts delete mode 100644 src/transformers/downlevel-ctor.ts delete mode 100644 src/transformers/patch-alias-reference-resolution.ts diff --git a/examples/example-app-v10/src/app/app.component.ts b/examples/example-app-v10/src/app/app.component.ts index 4b1a19b45b..1c95c51bdc 100644 --- a/examples/example-app-v10/src/app/app.component.ts +++ b/examples/example-app-v10/src/app/app.component.ts @@ -1,10 +1,18 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; + +import { FooService } from './foo.service'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], }) -export class AppComponent { +export class AppComponent implements OnInit { title = 'example-app-v10'; + + constructor(private fooService: FooService) {} + + ngOnInit(): void { + this.fooService.getFoo(); + } } diff --git a/examples/example-app-v10/src/app/foo.service.ts b/examples/example-app-v10/src/app/foo.service.ts new file mode 100644 index 0000000000..49f7501093 --- /dev/null +++ b/examples/example-app-v10/src/app/foo.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root', +}) +export class FooService { + getFoo(): string { + return 'foo'; + } +} diff --git a/examples/example-app-v11/src/app/app.component.ts b/examples/example-app-v11/src/app/app.component.ts index d211de377d..2e61a01c67 100644 --- a/examples/example-app-v11/src/app/app.component.ts +++ b/examples/example-app-v11/src/app/app.component.ts @@ -1,10 +1,18 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; + +import { FooService } from './foo.service'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], }) -export class AppComponent { +export class AppComponent implements OnInit { title = 'example-app-v11'; + + constructor(private fooService: FooService) {} + + ngOnInit(): void { + this.fooService.getFoo(); + } } diff --git a/examples/example-app-v11/src/app/foo.service.ts b/examples/example-app-v11/src/app/foo.service.ts new file mode 100644 index 0000000000..49f7501093 --- /dev/null +++ b/examples/example-app-v11/src/app/foo.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root', +}) +export class FooService { + getFoo(): string { + return 'foo'; + } +} diff --git a/examples/example-app-v12-monorepo/projects/app1/src/app/app.component.ts b/examples/example-app-v12-monorepo/projects/app1/src/app/app.component.ts index cb253f642f..08c09054f3 100644 --- a/examples/example-app-v12-monorepo/projects/app1/src/app/app.component.ts +++ b/examples/example-app-v12-monorepo/projects/app1/src/app/app.component.ts @@ -1,10 +1,18 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; + +import { FooService } from './foo.service'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], }) -export class AppComponent { +export class AppComponent implements OnInit { title = 'app1'; + + constructor(private fooService: FooService) {} + + ngOnInit(): void { + this.fooService.getFoo(); + } } diff --git a/examples/example-app-v12-monorepo/projects/app1/src/app/foo.service.ts b/examples/example-app-v12-monorepo/projects/app1/src/app/foo.service.ts new file mode 100644 index 0000000000..49f7501093 --- /dev/null +++ b/examples/example-app-v12-monorepo/projects/app1/src/app/foo.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root', +}) +export class FooService { + getFoo(): string { + return 'foo'; + } +} diff --git a/examples/example-app-v12-monorepo/projects/app2/src/app/app.component.ts b/examples/example-app-v12-monorepo/projects/app2/src/app/app.component.ts index 6142b7a750..c9f060d586 100644 --- a/examples/example-app-v12-monorepo/projects/app2/src/app/app.component.ts +++ b/examples/example-app-v12-monorepo/projects/app2/src/app/app.component.ts @@ -1,10 +1,18 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; + +import { FooService } from './foo.service'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], }) -export class AppComponent { +export class AppComponent implements OnInit { title = 'app2'; + + constructor(private fooService: FooService) {} + + ngOnInit(): void { + this.fooService.getFoo(); + } } diff --git a/examples/example-app-v12-monorepo/projects/app2/src/app/foo.service.ts b/examples/example-app-v12-monorepo/projects/app2/src/app/foo.service.ts new file mode 100644 index 0000000000..49f7501093 --- /dev/null +++ b/examples/example-app-v12-monorepo/projects/app2/src/app/foo.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root', +}) +export class FooService { + getFoo(): string { + return 'foo'; + } +} diff --git a/examples/example-app-v12/src/app/app.component.ts b/examples/example-app-v12/src/app/app.component.ts index 7fcf050509..e0e8a46131 100644 --- a/examples/example-app-v12/src/app/app.component.ts +++ b/examples/example-app-v12/src/app/app.component.ts @@ -1,10 +1,18 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; + +import { FooService } from './foo.service'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], }) -export class AppComponent { +export class AppComponent implements OnInit { title = 'example-app-v12'; + + constructor(private fooService: FooService) {} + + ngOnInit(): void { + this.fooService.getFoo(); + } } diff --git a/examples/example-app-v12/src/app/foo.service.ts b/examples/example-app-v12/src/app/foo.service.ts new file mode 100644 index 0000000000..49f7501093 --- /dev/null +++ b/examples/example-app-v12/src/app/foo.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root', +}) +export class FooService { + getFoo(): string { + return 'foo'; + } +} diff --git a/examples/example-app-yarn-workspace/packages/angular-app/package.json b/examples/example-app-yarn-workspace/packages/angular-app/package.json index 51683b98cc..1b462c8d0f 100644 --- a/examples/example-app-yarn-workspace/packages/angular-app/package.json +++ b/examples/example-app-yarn-workspace/packages/angular-app/package.json @@ -10,27 +10,26 @@ }, "private": true, "dependencies": { - "@angular/animations": "~12.2.2", - "@angular/common": "~12.2.2", - "@angular/compiler": "~12.2.2", - "@angular/core": "~12.2.2", - "@angular/forms": "~12.2.2", - "@angular/platform-browser": "~12.2.2", - "@angular/platform-browser-dynamic": "~12.2.2", - "@angular/router": "~12.2.2", - "angular-gridster2": "^12.1.0", + "@angular/animations": "~12.2.10", + "@angular/common": "~12.2.10", + "@angular/compiler": "~12.2.10", + "@angular/core": "~12.2.10", + "@angular/forms": "~12.2.10", + "@angular/platform-browser": "~12.2.10", + "@angular/platform-browser-dynamic": "~12.2.10", + "@angular/router": "~12.2.10", "rxjs": "~6.6.0", "tslib": "^2.3.1", "zone.js": "~0.11.4" }, "devDependencies": { - "@angular-devkit/build-angular": "~12.2.2", - "@angular/cli": "~12.2.2", - "@angular/compiler-cli": "~12.2.2", - "@types/jest": "^27.0.1", + "@angular-devkit/build-angular": "~12.2.10", + "@angular/cli": "~12.2.10", + "@angular/compiler-cli": "~12.2.10", + "@types/jest": "^27.0.2", "@types/node": "^12.11.1", - "jest": "^27.0.6", - "jest-preset-angular": "^10.0.0", + "jest": "^27.3.0", + "jest-preset-angular": "^10.0.1", "typescript": "~4.3.2" } -} \ No newline at end of file +} diff --git a/examples/example-app-yarn-workspace/packages/angular-app/src/app/app.component.ts b/examples/example-app-yarn-workspace/packages/angular-app/src/app/app.component.ts index 45688fbaa7..b9bf2af0d6 100644 --- a/examples/example-app-yarn-workspace/packages/angular-app/src/app/app.component.ts +++ b/examples/example-app-yarn-workspace/packages/angular-app/src/app/app.component.ts @@ -1,10 +1,18 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; + +import { FooService } from './foo.service'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], }) -export class AppComponent { +export class AppComponent implements OnInit { title = 'example-app-yarn-workspace'; + + constructor(private fooService: FooService) {} + + ngOnInit(): void { + this.fooService.getFoo(); + } } diff --git a/examples/example-app-yarn-workspace/packages/angular-app/src/app/foo.service.ts b/examples/example-app-yarn-workspace/packages/angular-app/src/app/foo.service.ts new file mode 100644 index 0000000000..49f7501093 --- /dev/null +++ b/examples/example-app-yarn-workspace/packages/angular-app/src/app/foo.service.ts @@ -0,0 +1,10 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root', +}) +export class FooService { + getFoo(): string { + return 'foo'; + } +} diff --git a/examples/example-app-yarn-workspace/yarn.lock b/examples/example-app-yarn-workspace/yarn.lock index 4feb0b3446..7902a0e89b 100644 --- a/examples/example-app-yarn-workspace/yarn.lock +++ b/examples/example-app-yarn-workspace/yarn.lock @@ -10,24 +10,24 @@ "@jridgewell/resolve-uri" "1.0.0" sourcemap-codec "1.4.8" -"@angular-devkit/architect@0.1202.2": - version "0.1202.2" - resolved "https://registry.yarnpkg.com/@angular-devkit/architect/-/architect-0.1202.2.tgz#212f07d3edb23cfeab0052fa62ba56b4a96be8e2" - integrity sha512-ylceL10SlftuhE4/rNzDeLLTm+e3Wt1PmMvBd4e+Q2bk1E+Ws/scGKpwfnYPzFaACn5kjg5qZoJOkHSprIfNlQ== +"@angular-devkit/architect@0.1202.10": + version "0.1202.10" + resolved "https://registry.yarnpkg.com/@angular-devkit/architect/-/architect-0.1202.10.tgz#6aae8e97ea209949507443cd9c414be94d258813" + integrity sha512-/sLgtXaFsNouxub5M/bQ2sBkiMIlPubuz6QMh+pA2jia82vJ3hcRMt4AnJTXuXpVY+aew4FiG0i9nt/8HETQsw== dependencies: - "@angular-devkit/core" "12.2.2" + "@angular-devkit/core" "12.2.10" rxjs "6.6.7" -"@angular-devkit/build-angular@~12.2.2": - version "12.2.2" - resolved "https://registry.yarnpkg.com/@angular-devkit/build-angular/-/build-angular-12.2.2.tgz#0089b9a3a8a5a9d290140e7e6069c0839d8a77cc" - integrity sha512-/KBz8YlujmRZwWqk3fjV5S4IWKEfDE6Vhpr2uo1GC6KtdK7/tA9usvm3ZGAFMu3DXn3eJwe2StgUnegPg3gqxA== +"@angular-devkit/build-angular@~12.2.10": + version "12.2.10" + resolved "https://registry.yarnpkg.com/@angular-devkit/build-angular/-/build-angular-12.2.10.tgz#aef9d1ab44e9f83dd8cd5625d7d10eaf81dd0e74" + integrity sha512-MuViuSmXmB67Wge3NpyfY2aAU4O4K+BbcHj1W1k1A9WTx/Hyh6jR6Zgwy/EsNh64zjdUg/Jlg/oHxIVabsWfvQ== dependencies: "@ampproject/remapping" "1.0.1" - "@angular-devkit/architect" "0.1202.2" - "@angular-devkit/build-optimizer" "0.1202.2" - "@angular-devkit/build-webpack" "0.1202.2" - "@angular-devkit/core" "12.2.2" + "@angular-devkit/architect" "0.1202.10" + "@angular-devkit/build-optimizer" "0.1202.10" + "@angular-devkit/build-webpack" "0.1202.10" + "@angular-devkit/core" "12.2.10" "@babel/core" "7.14.8" "@babel/generator" "7.14.8" "@babel/helper-annotate-as-pure" "7.14.5" @@ -39,7 +39,7 @@ "@babel/template" "7.14.5" "@discoveryjs/json-ext" "0.5.3" "@jsdevtools/coverage-istanbul-loader" "3.0.5" - "@ngtools/webpack" "12.2.2" + "@ngtools/webpack" "12.2.10" ansi-colors "4.1.1" babel-loader "8.2.2" browserslist "^4.9.1" @@ -51,7 +51,7 @@ critters "0.0.10" css-loader "6.2.0" css-minimizer-webpack-plugin "3.0.2" - esbuild "0.12.17" + esbuild-wasm "0.13.4" find-cache-dir "3.3.1" glob "7.1.7" https-proxy-agent "5.0.0" @@ -61,7 +61,7 @@ less-loader "10.0.1" license-webpack-plugin "2.3.20" loader-utils "2.0.0" - mini-css-extract-plugin "2.1.0" + mini-css-extract-plugin "2.2.1" minimatch "3.0.4" open "8.2.1" ora "5.4.1" @@ -92,28 +92,30 @@ webpack-dev-server "3.11.2" webpack-merge "5.8.0" webpack-subresource-integrity "1.5.2" + optionalDependencies: + esbuild "0.13.4" -"@angular-devkit/build-optimizer@0.1202.2": - version "0.1202.2" - resolved "https://registry.yarnpkg.com/@angular-devkit/build-optimizer/-/build-optimizer-0.1202.2.tgz#301c3410875f6b468c1a4b9be35e3b2825bf6a89" - integrity sha512-53CV0mmDV5lmRiuBgX4WuSUta6wzRyFUebZmMaLjSCjXXt6Ca0RaVcVWeojZ8aiuIcFQhn1+WLYL7WmFZ8ICrQ== +"@angular-devkit/build-optimizer@0.1202.10": + version "0.1202.10" + resolved "https://registry.yarnpkg.com/@angular-devkit/build-optimizer/-/build-optimizer-0.1202.10.tgz#f72c76e873e10139e95633d0ac3c4c8112d3f40b" + integrity sha512-NcFEtj4Vfc7gXJtXEVf1mnpk0CJ0htlkm/LbidPcs1PEQbJ/yDgZ44fO+53Pt6NzLmsmPHXOmRzN7O6HkxolPA== dependencies: source-map "0.7.3" tslib "2.3.0" typescript "4.3.5" -"@angular-devkit/build-webpack@0.1202.2": - version "0.1202.2" - resolved "https://registry.yarnpkg.com/@angular-devkit/build-webpack/-/build-webpack-0.1202.2.tgz#669c8154b443c384460271b03b5551851f1d7f33" - integrity sha512-UeD2q16UKIFPkFBH2afA8qChSBvjfSEDtov3VjRujXn3l5SXB6OQEFdiI5ga4IgpRE4+kuCKwNWUsiZHQ0ucCw== +"@angular-devkit/build-webpack@0.1202.10": + version "0.1202.10" + resolved "https://registry.yarnpkg.com/@angular-devkit/build-webpack/-/build-webpack-0.1202.10.tgz#ad92b8865623092951b4fddf6f603661f7910865" + integrity sha512-xGSy12g+wa/qeYOaPGkeoJp3zatlS+HZxECtw0Up3ES85Ewrx9PvraexHSuRxnkuBQykRORKf6WbPt/WYIAVGQ== dependencies: - "@angular-devkit/architect" "0.1202.2" + "@angular-devkit/architect" "0.1202.10" rxjs "6.6.7" -"@angular-devkit/core@12.2.2": - version "12.2.2" - resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-12.2.2.tgz#48e8f627abf54474b885c75ac8ae48dc076d62cb" - integrity sha512-iaPQc0M9FZWvE4MmxRFm5qFNBefvyN7H96pQIIPqT2yalSoiWv1HeQg/OS0WY61lvFPSHnR1n4DZsHCvLdZrFA== +"@angular-devkit/core@12.2.10": + version "12.2.10" + resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-12.2.10.tgz#3da62eceef3904f92cd3f860618b4ae513029ce2" + integrity sha512-0qhmS7Qvl0hiRVTHxEC/ipFAfzYofPstw0ZITDpEMw+pgHlOZolOlnFrv8LyOXWNqlSIH5fS9D3WF7Hpm7ApYA== dependencies: ajv "8.6.2" ajv-formats "2.1.0" @@ -122,31 +124,31 @@ rxjs "6.6.7" source-map "0.7.3" -"@angular-devkit/schematics@12.2.2": - version "12.2.2" - resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-12.2.2.tgz#bfeaddcd161b9491fa30c1f018d0d835a27b8e9a" - integrity sha512-KHPxZCSCbVFjaIlBMaxnoA96FnU62HDk8TpWRSnQY2dIkvEUU7+9UmWVodISaQ+MIYur35bFHPJ19im0YkR0tg== +"@angular-devkit/schematics@12.2.10": + version "12.2.10" + resolved "https://registry.yarnpkg.com/@angular-devkit/schematics/-/schematics-12.2.10.tgz#b8d4031053fd76d93caa7f33aeeb67383e37f0ab" + integrity sha512-oQ2EWdkEDE+eAttHeviXsvBi85PsntQT+IffjKUZdbQU+Leuk/pKUpTeea1YosU1p4Cz3PKYF+P/Nl5Jy3B7IQ== dependencies: - "@angular-devkit/core" "12.2.2" + "@angular-devkit/core" "12.2.10" ora "5.4.1" rxjs "6.6.7" -"@angular/animations@~12.2.2": - version "12.2.2" - resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-12.2.2.tgz#da221d892d8da9056e833da04dced0707720e5ba" - integrity sha512-arJzev1GYJYU5cR0x02WFm98ucuPaMuEjAoD+Yggl8Y0usefUm282ZZ+Jl4wCgbhus1JAjpFpoVQuZCVSn6F1g== +"@angular/animations@~12.2.10": + version "12.2.10" + resolved "https://registry.yarnpkg.com/@angular/animations/-/animations-12.2.10.tgz#c6610fc7b2021451c46dcfe27bd4fcc8e3789e08" + integrity sha512-K1WT3m/StW5a4SE9wKT+D7eteyWK+MW3pAwFPaKH8EU9k6dItlLr3jWZsve5w2u/GLSnrOMGJNU/JmTfskV9LA== dependencies: tslib "^2.2.0" -"@angular/cli@~12.2.2": - version "12.2.2" - resolved "https://registry.yarnpkg.com/@angular/cli/-/cli-12.2.2.tgz#8900cf22e946a9be667044ba13856e9b065f85a5" - integrity sha512-pk+UR8m0paDb1FaED6122JpN3ky+g4c/ccJx7vHZXnXa0/H76cXNoifxkZiGySjxyQyQxUCOuQwgc2cCaX8OPQ== +"@angular/cli@~12.2.10": + version "12.2.10" + resolved "https://registry.yarnpkg.com/@angular/cli/-/cli-12.2.10.tgz#73062d433434b7b25073863940d82e4e6f7fa924" + integrity sha512-gx2XlOUjAAYyJBBIz4QkgsLLRMdFTQbcOR41/Yv0kgpR6AStrOWhz7tpYPbU6vWMjehpuTaWv4NE5eGjwVTZqg== dependencies: - "@angular-devkit/architect" "0.1202.2" - "@angular-devkit/core" "12.2.2" - "@angular-devkit/schematics" "12.2.2" - "@schematics/angular" "12.2.2" + "@angular-devkit/architect" "0.1202.10" + "@angular-devkit/core" "12.2.10" + "@angular-devkit/schematics" "12.2.10" + "@schematics/angular" "12.2.10" "@yarnpkg/lockfile" "1.1.0" ansi-colors "4.1.1" debug "4.3.2" @@ -163,17 +165,17 @@ symbol-observable "4.0.0" uuid "8.3.2" -"@angular/common@~12.2.2": - version "12.2.2" - resolved "https://registry.yarnpkg.com/@angular/common/-/common-12.2.2.tgz#ae4736432387018ea29d81a3c73b09106e823276" - integrity sha512-cAfPHis8ynpR+qV9ViztCuNBjJ8YRDivvpUXtXecJYYBUPQt9uIiMLeqvBuWmFr+zKD+yAhWywbHEo/4m1JVtQ== +"@angular/common@~12.2.10": + version "12.2.10" + resolved "https://registry.yarnpkg.com/@angular/common/-/common-12.2.10.tgz#1298fc0d7becfdf5368676ceb01a7df97331d412" + integrity sha512-7IjD0frrKG/nt3/fo4mKDH0Tx5Nn8f2G8Ks/aq6xnJssy/V841COjua0ZyfPOkPS1r0VEaQJB5ieqMrp2T6MWg== dependencies: tslib "^2.2.0" -"@angular/compiler-cli@~12.2.2": - version "12.2.2" - resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-12.2.2.tgz#dbc15b3eb3a3e0a41a33099b30010b5e31050c61" - integrity sha512-n4X7nE7NEJm8QfKUkPgTXBqyF66FnLtFhjsTnqqSi9u1CdqpBLY7mJkWvQuYob4QfRoKoi2+UxNhoi26fvngCw== +"@angular/compiler-cli@~12.2.10": + version "12.2.10" + resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-12.2.10.tgz#c6b19af123d5772a8a53ac7872401fdc726f7b57" + integrity sha512-cPWxNMwPTM7IsEBxMrh4yY9XZi4gZRv7EmKWOfBw6hiW0SEmthIQWOvCaoL5CPsdUhInNxXWvwAoFggk/tfJ5g== dependencies: "@babel/core" "^7.8.6" "@babel/types" "^7.8.6" @@ -190,45 +192,45 @@ tslib "^2.2.0" yargs "^17.0.0" -"@angular/compiler@~12.2.2": - version "12.2.2" - resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-12.2.2.tgz#317b946568f934628ed566bbbf4eddb68c75c450" - integrity sha512-4RFFfpAfsT9/xSHRlp1flNAG1dj8WFgTBYb+wu496PziorTBRx/0jsLjxhz547ty6Bn1WZNwQbqBHzx67ehJBg== +"@angular/compiler@~12.2.10": + version "12.2.10" + resolved "https://registry.yarnpkg.com/@angular/compiler/-/compiler-12.2.10.tgz#7da81b341f90e779d29f7f96c82c93e57f84c02e" + integrity sha512-5fuzX8P74z28CRYTamsZgsdUyh0c53shytZYfa0cGFXyV8VD/r8AMIyQ4y7Y5Fmt4Nr+65EVeYb3sI7IzYiueg== dependencies: tslib "^2.2.0" -"@angular/core@~12.2.2": - version "12.2.2" - resolved "https://registry.yarnpkg.com/@angular/core/-/core-12.2.2.tgz#bf10931a059ee9e95ecbc3171303f2304958a601" - integrity sha512-zNgH1iFB1vCVNk9PZ+GCo0sZXD19Zt3BobgmHkWJ+PVXRPuKpuLBXWsq7d9IXdbFopQQWWfVHo0eDagIicrSFQ== +"@angular/core@~12.2.10": + version "12.2.10" + resolved "https://registry.yarnpkg.com/@angular/core/-/core-12.2.10.tgz#899f5b6e44c33790640d04df2a6981b622a9e6d7" + integrity sha512-xG1IbmEAV7gWpiY2MSFc87MlmB3yff8/TAlSE8Tj2ZFzb1lFjeFnrZ1y50Hi2AcVyX/KA1mx/RyJ0M7fmQ1ayw== dependencies: tslib "^2.2.0" -"@angular/forms@~12.2.2": - version "12.2.2" - resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-12.2.2.tgz#278aea61ed59f1ddba13a1e4f1d0fc25c4f0b290" - integrity sha512-v0zYUdbL+odeDWJNYGq9KZ3535+esDuPaPjXkZkq05/DPCMZym35hx6RlFWn5DElSSfxn4n15mfZXaIWbJNbEQ== +"@angular/forms@~12.2.10": + version "12.2.10" + resolved "https://registry.yarnpkg.com/@angular/forms/-/forms-12.2.10.tgz#c1a2f6f07354d56d78dc1dfc1f9ff92750ea4daa" + integrity sha512-ntTJOaLeH+7th5W4LEm3/yHsBvaFpfRgn0Uc88Th8p2gvorqCgpJMWogJIx/yESNolSFItY6k/x7kjuMBgm9mA== dependencies: tslib "^2.2.0" -"@angular/platform-browser-dynamic@~12.2.2": - version "12.2.2" - resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-12.2.2.tgz#ad335fb890785507c91e98e0fa9eef206596c39f" - integrity sha512-Ig0gyntnO9nt7ZLkRhDpdyqKH2kgza1i7L5fxtyw72JdPaUcgPSPvL06GST/ak4WQ04hEb28IEYQGqLKCOUvEA== +"@angular/platform-browser-dynamic@~12.2.10": + version "12.2.10" + resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-12.2.10.tgz#c30ef29587a09fbcfd0d9921b64ce264e6650893" + integrity sha512-CLYHCdTCzpxvMwITRBLlUoa44orDdogMaQfKIMEQsWrynf+zGZKYe5chAut9P/A54PVPUtKeQrfEVFjmbdYR2w== dependencies: tslib "^2.2.0" -"@angular/platform-browser@~12.2.2": - version "12.2.2" - resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-12.2.2.tgz#e967454d83836f5de03e5bb85f064b6cdee712dd" - integrity sha512-uI/tBCzGl7ifQZB7euidO4OOY4qz2jrlMH2Ri6nVuXlLFl4/39ekq75xbJtIQ9/Nf4sWYpUytkq1oW820ZOtcA== +"@angular/platform-browser@~12.2.10": + version "12.2.10" + resolved "https://registry.yarnpkg.com/@angular/platform-browser/-/platform-browser-12.2.10.tgz#402132b528f6dc0235c5571cdf0f29ef1a79277a" + integrity sha512-2pYoscOJijbqFsnYpKX6o4ojt4XfZiNhODTf9RDOPVKjVqFsRNVThg76kdKtN+N8q6N1z4I01x6aX4EeWqQqIA== dependencies: tslib "^2.2.0" -"@angular/router@~12.2.2": - version "12.2.2" - resolved "https://registry.yarnpkg.com/@angular/router/-/router-12.2.2.tgz#c837d86f042fcf58a448017ce880fbb5b602b481" - integrity sha512-zG6VtWqdPBUJq5JlZIJM4CegcPN7FE2s/I0tIhtzMO2lr65+V6X+RVWUXhDHnKR8dBmten+XZpLBYb1ZNhUUUw== +"@angular/router@~12.2.10": + version "12.2.10" + resolved "https://registry.yarnpkg.com/@angular/router/-/router-12.2.10.tgz#53d64ce59a65cde096e4a0125b117b6040d08fa8" + integrity sha512-e9sqOdLNF3pVRZPZtD6OdvERdTWKP7Et8Mz4OSNT8GEe6SctRAaptTAqY09AGpi4BO2+LsxVBERYfhZw9bZ2bA== dependencies: tslib "^2.2.0" @@ -1213,49 +1215,48 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.0.6.tgz#3eb72ea80897495c3d73dd97aab7f26770e2260f" - integrity sha512-fMlIBocSHPZ3JxgWiDNW/KPj6s+YRd0hicb33IrmelCcjXo/pXPwvuiKFmZz+XuqI/1u7nbUK10zSsWL/1aegg== +"@jest/console@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-27.3.0.tgz#a55f03a4f7e1e92a5879bdab2e8b9fe4dd5312ba" + integrity sha512-+Tr/xoNiosjckq96xIGpDaGsybeIm45VWXpSvDR8T9deXmWjYKX85prhz8yFPhLG4UVOeMo/B6RI/+flw3sO8A== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^27.0.6" - jest-util "^27.0.6" + jest-message-util "^27.3.0" + jest-util "^27.3.0" slash "^3.0.0" -"@jest/core@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.0.6.tgz#c5f642727a0b3bf0f37c4b46c675372d0978d4a1" - integrity sha512-SsYBm3yhqOn5ZLJCtccaBcvD/ccTLCeuDv8U41WJH/V1MW5eKUkeMHT9U+Pw/v1m1AIWlnIW/eM2XzQr0rEmow== +"@jest/core@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-27.3.0.tgz#50a521c663181f3a34ecb24bb9fe717e125dc784" + integrity sha512-0B3PWQouwS651m8AbQDse08dfRlzLHqSmywRPGYn2ZzU6RT4aP2Xwz8mEWfSPXXZmtwAtNgUXy0Cbt6QsBqKvw== dependencies: - "@jest/console" "^27.0.6" - "@jest/reporters" "^27.0.6" - "@jest/test-result" "^27.0.6" - "@jest/transform" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/console" "^27.3.0" + "@jest/reporters" "^27.3.0" + "@jest/test-result" "^27.3.0" + "@jest/transform" "^27.3.0" + "@jest/types" "^27.2.5" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" - jest-changed-files "^27.0.6" - jest-config "^27.0.6" - jest-haste-map "^27.0.6" - jest-message-util "^27.0.6" + jest-changed-files "^27.3.0" + jest-config "^27.3.0" + jest-haste-map "^27.3.0" + jest-message-util "^27.3.0" jest-regex-util "^27.0.6" - jest-resolve "^27.0.6" - jest-resolve-dependencies "^27.0.6" - jest-runner "^27.0.6" - jest-runtime "^27.0.6" - jest-snapshot "^27.0.6" - jest-util "^27.0.6" - jest-validate "^27.0.6" - jest-watcher "^27.0.6" + jest-resolve "^27.3.0" + jest-resolve-dependencies "^27.3.0" + jest-runner "^27.3.0" + jest-runtime "^27.3.0" + jest-snapshot "^27.3.0" + jest-util "^27.3.0" + jest-validate "^27.3.0" + jest-watcher "^27.3.0" micromatch "^4.0.4" - p-each-series "^2.1.0" rimraf "^3.0.0" slash "^3.0.0" strip-ansi "^6.0.0" @@ -1270,6 +1271,16 @@ "@types/node" "*" jest-mock "^27.0.6" +"@jest/environment@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.3.0.tgz#21b85e6f0baa18e92c5bb173a65c0df24565536d" + integrity sha512-OWx5RBd8QaPLlw7fL6l2IVyhYDpamaW3dDXlBnXb4IPGCIwoXAHZkmHV+VPIzb6xAkcPyXOmVm/rSaEneTqweg== + dependencies: + "@jest/fake-timers" "^27.3.0" + "@jest/types" "^27.2.5" + "@types/node" "*" + jest-mock "^27.3.0" + "@jest/fake-timers@^27.0.6": version "27.0.6" resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.0.6.tgz#cbad52f3fe6abe30e7acb8cd5fa3466b9588e3df" @@ -1282,25 +1293,38 @@ jest-mock "^27.0.6" jest-util "^27.0.6" -"@jest/globals@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.0.6.tgz#48e3903f99a4650673d8657334d13c9caf0e8f82" - integrity sha512-DdTGCP606rh9bjkdQ7VvChV18iS7q0IMJVP1piwTWyWskol4iqcVwthZmoJEf7obE1nc34OpIyoVGPeqLC+ryw== +"@jest/fake-timers@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.3.0.tgz#716f166f56abc01901b7823da503bf16c8a00ade" + integrity sha512-GCWgnItK6metb75QKflFxcVRlraVGomZonBQ+9B5UPc6wxBB3xzS7dATDWe/73R5P6BfnzCEaiizna771M5r9w== dependencies: - "@jest/environment" "^27.0.6" - "@jest/types" "^27.0.6" - expect "^27.0.6" + "@jest/types" "^27.2.5" + "@sinonjs/fake-timers" "^8.0.1" + "@types/node" "*" + jest-message-util "^27.3.0" + jest-mock "^27.3.0" + jest-util "^27.3.0" -"@jest/reporters@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.0.6.tgz#91e7f2d98c002ad5df94d5b5167c1eb0b9fd5b00" - integrity sha512-TIkBt09Cb2gptji3yJXb3EE+eVltW6BjO7frO7NEfjI9vSIYoISi5R3aI3KpEDXlB1xwB+97NXIqz84qYeYsfA== +"@jest/globals@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-27.3.0.tgz#8822f9a72aea428e3f11a688ff13c7992bfe1ea4" + integrity sha512-EEqmQHMLXgEZfchMVAavUfJuZmORRrP+zhomfREqVE85d1nccd7nw8uN4FQDJ53m5Glm1XtVCyOIJ9kQLrqjeA== + dependencies: + "@jest/environment" "^27.3.0" + "@jest/types" "^27.2.5" + expect "^27.3.0" + +"@jest/reporters@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-27.3.0.tgz#8d5fd17916aeb1ab415b3ce0a94a31bda654020b" + integrity sha512-D9QLaLgbH+nIjDbKIvoX7yiRX6aXHO56/GzOxKNzKuvJVYhrzeQHcCMttXpp5SB08TdxVvFOPKZfFvkIcVgfBA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^27.0.6" - "@jest/test-result" "^27.0.6" - "@jest/transform" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/console" "^27.3.0" + "@jest/test-result" "^27.3.0" + "@jest/transform" "^27.3.0" + "@jest/types" "^27.2.5" + "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" exit "^0.1.2" @@ -1311,15 +1335,15 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.0.2" - jest-haste-map "^27.0.6" - jest-resolve "^27.0.6" - jest-util "^27.0.6" - jest-worker "^27.0.6" + jest-haste-map "^27.3.0" + jest-resolve "^27.3.0" + jest-util "^27.3.0" + jest-worker "^27.3.0" slash "^3.0.0" source-map "^0.6.0" string-length "^4.0.1" terminal-link "^2.0.0" - v8-to-istanbul "^8.0.0" + v8-to-istanbul "^8.1.0" "@jest/source-map@^27.0.6": version "27.0.6" @@ -1330,41 +1354,41 @@ graceful-fs "^4.2.4" source-map "^0.6.0" -"@jest/test-result@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.0.6.tgz#3fa42015a14e4fdede6acd042ce98c7f36627051" - integrity sha512-ja/pBOMTufjX4JLEauLxE3LQBPaI2YjGFtXexRAjt1I/MbfNlMx0sytSX3tn5hSLzQsR3Qy2rd0hc1BWojtj9w== +"@jest/test-result@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-27.3.0.tgz#e093c5d9eb34afa1b653cdb550c4bcaeb3096233" + integrity sha512-5+rYZgj562oPKjExQngfboobeIF2FSrgAvoxlkrogEMIbgT7FY+VAMIkp03klVfJtqo3XKzVWkTfsDSmZFI29w== dependencies: - "@jest/console" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/console" "^27.3.0" + "@jest/types" "^27.2.5" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.0.6.tgz#80a913ed7a1130545b1cd777ff2735dd3af5d34b" - integrity sha512-bISzNIApazYOlTHDum9PwW22NOyDa6VI31n6JucpjTVM0jD6JDgqEZ9+yn575nDdPF0+4csYDxNNW13NvFQGZA== +"@jest/test-sequencer@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-27.3.0.tgz#ac245f4f29ce7f81ae5afa441e5bf7bbdd342ef4" + integrity sha512-6eQHyBUCtK06sPfsufzEVijZtAtT7yGR1qaAZBlcz6P+FGJ569VW2O5o7mZc+L++uZc7BH4X2Ks7SMIgy1npJw== dependencies: - "@jest/test-result" "^27.0.6" + "@jest/test-result" "^27.3.0" graceful-fs "^4.2.4" - jest-haste-map "^27.0.6" - jest-runtime "^27.0.6" + jest-haste-map "^27.3.0" + jest-runtime "^27.3.0" -"@jest/transform@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.0.6.tgz#189ad7107413208f7600f4719f81dd2f7278cc95" - integrity sha512-rj5Dw+mtIcntAUnMlW/Vju5mr73u8yg+irnHwzgtgoeI6cCPOvUwQ0D1uQtc/APmWgvRweEb1g05pkUpxH3iCA== +"@jest/transform@^27.3.0": + version "27.3.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.3.0.tgz#f2a63883eaada30f8141938ec1ad23ba7fdfb97e" + integrity sha512-IKrFhIT/+WIfeNjIRKTwQN7HYCdjKF/mmBqoD660gyGWVw1MzCO9pQuEJK9GXEnFWIuOcMHlm8XfUaDohP/zxA== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^27.0.6" + "@jest/types" "^27.2.5" babel-plugin-istanbul "^6.0.0" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.2.4" - jest-haste-map "^27.0.6" + jest-haste-map "^27.3.0" jest-regex-util "^27.0.6" - jest-util "^27.0.6" + jest-util "^27.3.0" micromatch "^4.0.4" pirates "^4.0.1" slash "^3.0.0" @@ -1382,6 +1406,17 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" +"@jest/types@^27.2.5": + version "27.2.5" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.5.tgz#420765c052605e75686982d24b061b4cbba22132" + integrity sha512-nmuM4VuDtCZcY+eTpw+0nvstwReMsjPoj7ZR80/BbixulhLaiX+fbv8oeLW8WZlJMcsGQsTmMKT/iTZu1Uy/lQ== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^16.0.0" + chalk "^4.0.0" + "@jridgewell/resolve-uri@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-1.0.0.tgz#3fdf5798f0b49e90155896f6291df186eac06c83" @@ -1398,10 +1433,10 @@ merge-source-map "^1.1.0" schema-utils "^2.7.0" -"@ngtools/webpack@12.2.2": - version "12.2.2" - resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-12.2.2.tgz#485098f90b88fc28f5b788d69aaa3e9263e405e5" - integrity sha512-GmzdsYtnuTDVZlUmWteT752K54JohjeID/o03Tau/BlnBukzh2m817z57bZS1nkSD2cPD51lg9oeRbZTkkd9LA== +"@ngtools/webpack@12.2.10": + version "12.2.10" + resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-12.2.10.tgz#38d4a5ee9cc39012e9ba2f987f6c1c07b132b19e" + integrity sha512-8ptz2WqEeqFLOMbiYJ6x6XARjzWIrCHzRzpGwvKS28L5iMWeYuvX2EB48uKkMFy/8RJ0SkwyAJkFClPNJvDfrQ== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -1477,13 +1512,13 @@ node-gyp "^7.1.0" read-package-json-fast "^2.0.1" -"@schematics/angular@12.2.2": - version "12.2.2" - resolved "https://registry.yarnpkg.com/@schematics/angular/-/angular-12.2.2.tgz#3eaa470b1adf639fc17034969298777021930551" - integrity sha512-Nqw9rHOTUIzhCxAgj/J1S9C7YLhrsbLbEKJ8gVy6Aakj4jdJBJ9oqPCLnVpP+48k8hSyIZ6TA5X9eVmrUhDDWQ== +"@schematics/angular@12.2.10": + version "12.2.10" + resolved "https://registry.yarnpkg.com/@schematics/angular/-/angular-12.2.10.tgz#c640be969ea7588da14ee5c4d58a6a2ce63b97e6" + integrity sha512-hjOWrC/RlZ97oYWO92f5VRu6LDzPHnowDcyGDGvI9wCrfipL4Y7Is6LgFAiVZxCHdRz71MCnES1IXSj5w6UuBA== dependencies: - "@angular-devkit/core" "12.2.2" - "@angular-devkit/schematics" "12.2.2" + "@angular-devkit/core" "12.2.10" + "@angular-devkit/schematics" "12.2.10" jsonc-parser "3.0.0" "@sinonjs/commons@^1.7.0": @@ -1500,6 +1535,13 @@ dependencies: "@sinonjs/commons" "^1.7.0" +"@sinonjs/fake-timers@^8.0.1": + version "8.0.1" + resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-8.0.1.tgz#1c1c9a91419f804e59ae8df316a07dd1c3a76b94" + integrity sha512-AU7kwFxreVd6OAXcAFlKSmZquiRUU0FvYm44k1Y1QbK7Co4m0aqfGMhjykIeQp/H6rcl+nFmj0zfdUcGVs9Dew== + dependencies: + "@sinonjs/commons" "^1.7.0" + "@tootallnate/once@1": version "1.1.2" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" @@ -1598,10 +1640,10 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@^27.0.1": - version "27.0.1" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.1.tgz#fafcc997da0135865311bb1215ba16dba6bdf4ca" - integrity sha512-HTLpVXHrY69556ozYkcq47TtQJXpcWAWfkoqz+ZGz2JnmZhzlRjprCIyFnetSy8gpDWwTTGBcRVv1J1I1vBrHw== +"@types/jest@^27.0.2": + version "27.0.2" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.0.2.tgz#ac383c4d4aaddd29bbf2b916d8d105c304a5fcd7" + integrity sha512-4dRxkS/AFX0c5XW6IPMNOydLn2tEhNhJV7DnYK+0bjoJZ+QTmfucBlihX7aoEsh/ocYtkLC73UbnBXBXIxsULA== dependencies: jest-diff "^27.0.0" pretty-format "^27.0.0" @@ -1923,13 +1965,6 @@ alphanum-sort@^1.0.2: resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM= -angular-gridster2@^12.1.0: - version "12.1.0" - resolved "https://registry.yarnpkg.com/angular-gridster2/-/angular-gridster2-12.1.0.tgz#ec6735cf6182e0ddc8ff6118e144fa02bd740765" - integrity sha512-o4iRCGdKoSLqFaIA9ZkiX3gOcNZpYDzisDV7+M832kYglo7byDVsPhLHnI4GUDigtyMqCHYjL5dhbJMk/Mv5/A== - dependencies: - tslib "^2.1.0" - ansi-colors@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" @@ -1972,6 +2007,11 @@ ansi-regex@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -2141,16 +2181,16 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== -babel-jest@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.0.6.tgz#e99c6e0577da2655118e3608b68761a5a69bd0d8" - integrity sha512-iTJyYLNc4wRofASmofpOc5NK9QunwMk+TLFgGXsTFS8uEqmd8wdI7sga0FPe2oVH3b5Agt/EAK1QjPEuKL8VfA== +babel-jest@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-27.3.0.tgz#72237bff40e1fdaaf869bcaaa43bec58b51b6159" + integrity sha512-+Utvd2yZkT7tkgbBqVcH3uRpgRSTKRi0uBtVkjmuw2jFxp45rQ9fROSqqeHKzHYRelgdVOtQ3M745Wnyme/xOg== dependencies: - "@jest/transform" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/transform" "^27.3.0" + "@jest/types" "^27.2.5" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.0.0" - babel-preset-jest "^27.0.6" + babel-preset-jest "^27.2.0" chalk "^4.0.0" graceful-fs "^4.2.4" slash "^3.0.0" @@ -2183,10 +2223,10 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^4.0.0" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.0.6.tgz#f7c6b3d764af21cb4a2a1ab6870117dbde15b456" - integrity sha512-CewFeM9Vv2gM7Yr9n5eyyLVPRSiBnk6lKZRjgwYnGKSl9M14TMn2vkN02wTF04OGuSDLEzlWiMzvjXuW9mB6Gw== +babel-plugin-jest-hoist@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.2.0.tgz#79f37d43f7e5c4fdc4b2ca3e10cc6cf545626277" + integrity sha512-TOux9khNKdi64mW+0OIhcmbAn75tTlzKhxmiNXevQaPbrBYK7YKjP1jl6NHTJ6XR5UgUrJbCnWlKVnJn29dfjw== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" @@ -2235,12 +2275,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.0.6.tgz#909ef08e9f24a4679768be2f60a3df0856843f9d" - integrity sha512-WObA0/Biw2LrVVwZkF/2GqbOdzhKD6Fkdwhoy9ASIrOWr/zodcSpQh72JOkEn6NWyjmnPDjNSqaGN4KnpKzhXw== +babel-preset-jest@^27.2.0: + version "27.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-27.2.0.tgz#556bbbf340608fed5670ab0ea0c8ef2449fba885" + integrity sha512-z7MgQ3peBwN5L5aCqBKnF6iqdlvZvFUQynEhu0J+X9nHLU72jO3iY331lcYrg+AssJ8q7xsv5/3AICzVmJ/wvg== dependencies: - babel-plugin-jest-hoist "^27.0.6" + babel-plugin-jest-hoist "^27.2.0" babel-preset-current-node-syntax "^1.0.0" balanced-match@^1.0.0: @@ -3461,10 +3501,112 @@ es-module-lexer@^0.7.1: resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.7.1.tgz#c2c8e0f46f2df06274cdaf0dd3f3b33e0a0b267d" integrity sha512-MgtWFl5No+4S3TmhDmCz2ObFGm6lEpTnzbQi+Dd+pw4mlTIZTmM2iAs5gRlmx5zS9luzobCSBSI90JM/1/JgOw== -esbuild@0.12.17: - version "0.12.17" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.12.17.tgz#5816f905c2905de0ebbc658860df7b5b48afbcd3" - integrity sha512-GshKJyVYUnlSXIZj/NheC2O0Kblh42CS7P1wJyTbbIHevTG4jYMS9NNw8EOd8dDWD0dzydYHS01MpZoUcQXB4g== +esbuild-android-arm64@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.13.4.tgz#5178a20d2b7aba741a31c19609f9e67b346996b9" + integrity sha512-elDJt+jNyoHFId0/dKsuVYUPke3EcquIyUwzJCH17a3ERglN3A9aMBI5zbz+xNZ+FbaDNdpn0RaJHCFLbZX+fA== + +esbuild-darwin-64@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.13.4.tgz#7a3e66c8e1271b650541b25eed65c84f3564a69d" + integrity sha512-zJQGyHRAdZUXlRzbN7W+7ykmEiGC+bq3Gc4GxKYjjWTgDRSEly98ym+vRNkDjXwXYD3gGzSwvH35+MiHAtWvLA== + +esbuild-darwin-arm64@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.4.tgz#793feca6032b2a57ef291eb9b2d33768d60a49d6" + integrity sha512-r8oYvAtqSGq8HNTZCAx4TdLE7jZiGhX9ooGi5AQAey37MA6XNaP8ZNlw9OCpcgpx3ryU2WctXwIqPzkHO7a8dg== + +esbuild-freebsd-64@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.4.tgz#294aec3c2cf4b41fb6900212fc9c33dd8fbbb4a2" + integrity sha512-u9DRGkn09EN8+lCh6z7FKle7awi17PJRBuAKdRNgSo5ZrH/3m+mYaJK2PR2URHMpAfXiwJX341z231tSdVe3Yw== + +esbuild-freebsd-arm64@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.4.tgz#09fe66c751c12f9b976976b1d83f3de594cb2787" + integrity sha512-q3B2k68Uf6gfjATjcK16DqxvjqRQkHL8aPoOfj4op+lSqegdXvBacB1d8jw8PxbWJ8JHpdTLdAVUYU80kotQXA== + +esbuild-linux-32@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.13.4.tgz#a9f0793d7bcc9cef4f4ffa4398c525877fba5839" + integrity sha512-UUYJPHSiKAO8KoN3Ls/iZtgDLZvK5HarES96aolDPWZnq9FLx4dIHM/x2z4Rxv9IYqQ/DxlPoE2Co1UPBIYYeA== + +esbuild-linux-64@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.13.4.tgz#c0d0b4c9d62e3bbf8bdf2cece37403aa6d60fc2e" + integrity sha512-+RnohAKiiUW4UHLGRkNR1AnENW1gCuDWuygEtd4jxTNPIoeC7lbXGor7rtgjj9AdUzFgOEvAXyNNX01kJ8NueQ== + +esbuild-linux-arm64@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.4.tgz#1292d97bfa64a08d12728f8a7837bf92776c779b" + integrity sha512-+A188cAdd6QuSRxMIwRrWLjgphQA0LDAQ/ECVlrPVJwnx+1i64NjDZivoqPYLOTkSPIKntiWwMhhf0U5/RrPHQ== + +esbuild-linux-arm@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.13.4.tgz#186cd9b8885ac132b9953a4a0afe668168debd10" + integrity sha512-BH5gKve4jglS7UPSsfwHSX79I5agC/lm4eKoRUEyo8lwQs89frQSRp2Xup+6SFQnxt3md5EsKcd2Dbkqeb3gPA== + +esbuild-linux-mips64le@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.4.tgz#42049bf72bc586817b4a51cc9e32148d13e5e807" + integrity sha512-0xkwtPaUkG5xMTFGaQPe1AadSe5QAiQuD4Gix1O9k5Xo/U8xGIkw9UFUTvfEUeu71vFb6ZgsIacfP1NLoFjWNw== + +esbuild-linux-ppc64le@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.4.tgz#adf1ce2ef2302757c4383887da6ac4dd25be9d4f" + integrity sha512-E1+oJPP7A+j23GPo3CEpBhGwG1bni4B8IbTA3/3rvzjURwUMZdcN3Fhrz24rnjzdLSHmULtOE4VsbT42h1Om4Q== + +esbuild-openbsd-64@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.4.tgz#1c8122101898c52a20c8786935cf3eb7a19b83b4" + integrity sha512-xEkI1o5HYxDzbv9jSox0EsDxpwraG09SRiKKv0W8pH6O3bt+zPSlnoK7+I7Q69tkvONkpIq5n2o+c55uq0X7cw== + +esbuild-sunos-64@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.13.4.tgz#4ec95faa14a60f295fe485bebffefff408739337" + integrity sha512-bjXUMcODMnB6hQicLBBmmnBl7OMDyVpFahKvHGXJfDChIi5udiIRKCmFUFIRn+AUAKVlfrofRKdyPC7kBsbvGQ== + +esbuild-wasm@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-wasm/-/esbuild-wasm-0.13.4.tgz#9ae8ec5234cc651b2d74b23d4adac984055cff1c" + integrity sha512-2dN7njr9/2QzKLqbTEgXr73vDbSqffdJMv4EfaMQoy04cej0owbGHH5apPgED0wN9I5e7sBT0/Q81tVy3wQBlA== + +esbuild-windows-32@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.13.4.tgz#3182c380487b797b04d0ec2c80c2945666869080" + integrity sha512-z4CH07pfyVY0XF98TCsGmLxKCl0kyvshKDbdpTekW9f2d+dJqn5mmoUyWhpSVJ0SfYWJg86FoD9nMbbaMVyGdg== + +esbuild-windows-64@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.13.4.tgz#b9e995f92d81f433a04f33611e603e82f9232e69" + integrity sha512-uVL11vORRPjocGLYam67rwFLd0LvkrHEs+JG+1oJN4UD9MQmNGZPa4gBHo6hDpF+kqRJ9kXgQSeDqUyRy0tj/Q== + +esbuild-windows-arm64@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.4.tgz#fb239532f07b764d158f4cc787178ef4c6fadb5c" + integrity sha512-vA6GLvptgftRcDcWngD5cMlL4f4LbL8JjU2UMT9yJ0MT5ra6hdZNFWnOeOoEtY4GtJ6OjZ0i+81sTqhAB0fMkg== + +esbuild@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.13.4.tgz#ce2deb56c4fb360938311cbfc67f8e467bb6841b" + integrity sha512-wMA5eUwpavTBiNl+It6j8OQuKVh69l6z4DKDLzoTIqC+gChnPpcmqdA8WNHptUHRnfyML+mKEQPlW7Mybj8gHg== + optionalDependencies: + esbuild-android-arm64 "0.13.4" + esbuild-darwin-64 "0.13.4" + esbuild-darwin-arm64 "0.13.4" + esbuild-freebsd-64 "0.13.4" + esbuild-freebsd-arm64 "0.13.4" + esbuild-linux-32 "0.13.4" + esbuild-linux-64 "0.13.4" + esbuild-linux-arm "0.13.4" + esbuild-linux-arm64 "0.13.4" + esbuild-linux-mips64le "0.13.4" + esbuild-linux-ppc64le "0.13.4" + esbuild-openbsd-64 "0.13.4" + esbuild-sunos-64 "0.13.4" + esbuild-windows-32 "0.13.4" + esbuild-windows-64 "0.13.4" + esbuild-windows-arm64 "0.13.4" escalade@^3.1.1: version "3.1.1" @@ -3606,16 +3748,16 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" -expect@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.0.6.tgz#a4d74fbe27222c718fff68ef49d78e26a8fd4c05" - integrity sha512-psNLt8j2kwg42jGBDSfAlU49CEZxejN1f1PlANWDZqIhBOVU/c2Pm888FcjWJzFewhIsNWfZJeLjUjtKGiPuSw== +expect@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-27.3.0.tgz#6cf2864a2553fe8ea68e19a6ce1641b08c3a5a98" + integrity sha512-JBRU82EBkZUBqLBAoF3ovzNGEBm14QQnePK4PmZdm6de6q/UzPnmIuWP3dRCw/FE8wRQhf/1eKzy1p1q8d6EvQ== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.2.5" ansi-styles "^5.0.0" jest-get-type "^27.0.6" - jest-matcher-utils "^27.0.6" - jest-message-util "^27.0.6" + jest-matcher-utils "^27.3.0" + jest-message-util "^27.3.0" jest-regex-util "^27.0.6" express@^4.17.1: @@ -4768,86 +4910,86 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -jest-changed-files@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.0.6.tgz#bed6183fcdea8a285482e3b50a9a7712d49a7a8b" - integrity sha512-BuL/ZDauaq5dumYh5y20sn4IISnf1P9A0TDswTxUi84ORGtVa86ApuBHqICL0vepqAnZiY6a7xeSPWv2/yy4eA== +jest-changed-files@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.3.0.tgz#22a02cc2b34583fc66e443171dc271c0529d263c" + integrity sha512-9DJs9garMHv4RhylUMZgbdCJ3+jHSkpL9aaVKp13xtXAD80qLTLrqcDZL1PHA9dYA0bCI86Nv2BhkLpLhrBcPg== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.2.5" execa "^5.0.0" throat "^6.0.1" -jest-circus@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.0.6.tgz#dd4df17c4697db6a2c232aaad4e9cec666926668" - integrity sha512-OJlsz6BBeX9qR+7O9lXefWoc2m9ZqcZ5Ohlzz0pTEAG4xMiZUJoacY8f4YDHxgk0oKYxj277AfOk9w6hZYvi1Q== +jest-circus@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-27.3.0.tgz#adc822231f5e634bd676a1eeaa7f4cd6b840cc1d" + integrity sha512-i2P6t92Z6qujHD7C0nVYWm9YofUBMbOOTE9q9vEGi9qFotKUZv1H8M0H3NPTOWButgFuSXZfcwGBXGDAt7b9NA== dependencies: - "@jest/environment" "^27.0.6" - "@jest/test-result" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/environment" "^27.3.0" + "@jest/test-result" "^27.3.0" + "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" - expect "^27.0.6" + expect "^27.3.0" is-generator-fn "^2.0.0" - jest-each "^27.0.6" - jest-matcher-utils "^27.0.6" - jest-message-util "^27.0.6" - jest-runtime "^27.0.6" - jest-snapshot "^27.0.6" - jest-util "^27.0.6" - pretty-format "^27.0.6" + jest-each "^27.3.0" + jest-matcher-utils "^27.3.0" + jest-message-util "^27.3.0" + jest-runtime "^27.3.0" + jest-snapshot "^27.3.0" + jest-util "^27.3.0" + pretty-format "^27.3.0" slash "^3.0.0" stack-utils "^2.0.3" throat "^6.0.1" -jest-cli@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.0.6.tgz#d021e5f4d86d6a212450d4c7b86cb219f1e6864f" - integrity sha512-qUUVlGb9fdKir3RDE+B10ULI+LQrz+MCflEH2UJyoUjoHHCbxDrMxSzjQAPUMsic4SncI62ofYCcAvW6+6rhhg== +jest-cli@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-27.3.0.tgz#f9d4278c6ffa1a77127d9d22d7167c2606b1a0f5" + integrity sha512-PUM2RHhqgGRuGc+7QTuyfqPPWGDTCQNMKhtlVBTBYOvhP+7g8a1a7OztM/wfpsKHfqQLHFIe1Mms6jVSXSi4Vg== dependencies: - "@jest/core" "^27.0.6" - "@jest/test-result" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/core" "^27.3.0" + "@jest/test-result" "^27.3.0" + "@jest/types" "^27.2.5" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.4" import-local "^3.0.2" - jest-config "^27.0.6" - jest-util "^27.0.6" - jest-validate "^27.0.6" + jest-config "^27.3.0" + jest-util "^27.3.0" + jest-validate "^27.3.0" prompts "^2.0.1" - yargs "^16.0.3" + yargs "^16.2.0" -jest-config@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.0.6.tgz#119fb10f149ba63d9c50621baa4f1f179500277f" - integrity sha512-JZRR3I1Plr2YxPBhgqRspDE2S5zprbga3swYNrvY3HfQGu7p/GjyLOqwrYad97tX3U3mzT53TPHVmozacfP/3w== +jest-config@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-27.3.0.tgz#d5d614098e042b4b33ca8a19aca93f8cc82999a4" + integrity sha512-hGknSnu6qJmwENNSUNY4qQjE9PENIYp4P8yHLVzo7qoQN4wuYHZuZEwAKaoQ66iHeSXmcZkCqFvAUa5WFdB0sg== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^27.0.6" - "@jest/types" "^27.0.6" - babel-jest "^27.0.6" + "@jest/test-sequencer" "^27.3.0" + "@jest/types" "^27.2.5" + babel-jest "^27.3.0" chalk "^4.0.0" deepmerge "^4.2.2" glob "^7.1.1" graceful-fs "^4.2.4" is-ci "^3.0.0" - jest-circus "^27.0.6" - jest-environment-jsdom "^27.0.6" - jest-environment-node "^27.0.6" + jest-circus "^27.3.0" + jest-environment-jsdom "^27.3.0" + jest-environment-node "^27.3.0" jest-get-type "^27.0.6" - jest-jasmine2 "^27.0.6" + jest-jasmine2 "^27.3.0" jest-regex-util "^27.0.6" - jest-resolve "^27.0.6" - jest-runner "^27.0.6" - jest-util "^27.0.6" - jest-validate "^27.0.6" + jest-resolve "^27.3.0" + jest-runner "^27.3.0" + jest-util "^27.3.0" + jest-validate "^27.3.0" micromatch "^4.0.4" - pretty-format "^27.0.6" + pretty-format "^27.3.0" -jest-diff@^27.0.0, jest-diff@^27.0.6: +jest-diff@^27.0.0: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.0.6.tgz#4a7a19ee6f04ad70e0e3388f35829394a44c7b5e" integrity sha512-Z1mqgkTCSYaFgwTlP/NUiRzdqgxmmhzHY1Tq17zL94morOHfHu3K4bgSgl+CR4GLhpV8VxkuOYuIWnQ9LnFqmg== @@ -4857,6 +4999,16 @@ jest-diff@^27.0.0, jest-diff@^27.0.6: jest-get-type "^27.0.6" pretty-format "^27.0.6" +jest-diff@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.3.0.tgz#4d6f6f9d34f7e2a359b3c7eb142bba4de1e37695" + integrity sha512-Nl2rE58B2ye+RvPcU4hN+6wBCHxX7aWz6RMTMFxe9jAg8ZueMj5QQ+T/nmHRutbBc5BEjrbbEWOrRzp9rUEsYA== + dependencies: + chalk "^4.0.0" + diff-sequences "^27.0.6" + jest-get-type "^27.0.6" + pretty-format "^27.3.0" + jest-docblock@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.0.6.tgz#cc78266acf7fe693ca462cbbda0ea4e639e4e5f3" @@ -4864,18 +5016,18 @@ jest-docblock@^27.0.6: dependencies: detect-newline "^3.0.0" -jest-each@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.0.6.tgz#cee117071b04060158dc8d9a66dc50ad40ef453b" - integrity sha512-m6yKcV3bkSWrUIjxkE9OC0mhBZZdhovIW5ergBYirqnkLXkyEn3oUUF/QZgyecA1cF1QFyTE8bRRl8Tfg1pfLA== +jest-each@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-27.3.0.tgz#7976cf15bebeef28aa5108a589f4c335b6f0eec9" + integrity sha512-i7qQt+puYusxOoiNyq/M6EyNcfEbvKvqOp89FbiHfm6/POTxgzpp5wAmoS9+BAssoX20t7Zt1A1M7yT3FLVvdg== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.2.5" chalk "^4.0.0" jest-get-type "^27.0.6" - jest-util "^27.0.6" - pretty-format "^27.0.6" + jest-util "^27.3.0" + pretty-format "^27.3.0" -jest-environment-jsdom@^27.0.0, jest-environment-jsdom@^27.0.6: +jest-environment-jsdom@^27.0.0: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.0.6.tgz#f66426c4c9950807d0a9f209c590ce544f73291f" integrity sha512-FvetXg7lnXL9+78H+xUAsra3IeZRTiegA3An01cWeXBspKXUhAwMM9ycIJ4yBaR0L7HkoMPaZsozCLHh4T8fuw== @@ -4888,29 +5040,42 @@ jest-environment-jsdom@^27.0.0, jest-environment-jsdom@^27.0.6: jest-util "^27.0.6" jsdom "^16.6.0" -jest-environment-node@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.0.6.tgz#a6699b7ceb52e8d68138b9808b0c404e505f3e07" - integrity sha512-+Vi6yLrPg/qC81jfXx3IBlVnDTI6kmRr08iVa2hFCWmJt4zha0XW7ucQltCAPhSR0FEKEoJ3i+W4E6T0s9is0w== +jest-environment-jsdom@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.3.0.tgz#bdf6282ff12a68fbc77cb26d6f56c6bddddd5f58" + integrity sha512-2R1w1z7ZlQkK22bo/MrMp7ItuCxXXFspn3HNdbusbtW4OfutaPNWPmAch1Shtuu7G75jEnDb2q0PXSfFD6kEHQ== dependencies: - "@jest/environment" "^27.0.6" - "@jest/fake-timers" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/environment" "^27.3.0" + "@jest/fake-timers" "^27.3.0" + "@jest/types" "^27.2.5" "@types/node" "*" - jest-mock "^27.0.6" - jest-util "^27.0.6" + jest-mock "^27.3.0" + jest-util "^27.3.0" + jsdom "^16.6.0" + +jest-environment-node@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-27.3.0.tgz#32483ad819a4b93ba8cf89614a5fb108efba6566" + integrity sha512-bH2Zb73K4x2Yw8j83mmlJUUOFJLzwIpupRvlS9PXiCeIgVTPxL5syBeq5lz310DQBQkNLDTSD5+yYRhheVKvWg== + dependencies: + "@jest/environment" "^27.3.0" + "@jest/fake-timers" "^27.3.0" + "@jest/types" "^27.2.5" + "@types/node" "*" + jest-mock "^27.3.0" + jest-util "^27.3.0" jest-get-type@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== -jest-haste-map@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.0.6.tgz#4683a4e68f6ecaa74231679dca237279562c8dc7" - integrity sha512-4ldjPXX9h8doB2JlRzg9oAZ2p6/GpQUNAeiYXqcpmrKbP0Qev0wdZlxSMOmz8mPOEnt4h6qIzXFLDi8RScX/1w== +jest-haste-map@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.3.0.tgz#06305f57064af766fdbb54da4c4bc663f72e8a78" + integrity sha512-HV7BXCWhHFuQyLCnmy+VzvYQDccTdt5gpmt2abwIrWTnQiHNAklLB3Djq7Ze3OypTmWBMLgF8AHcKNmLKx8Rzw== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.2.5" "@types/graceful-fs" "^4.1.2" "@types/node" "*" anymatch "^3.0.3" @@ -4918,54 +5083,54 @@ jest-haste-map@^27.0.6: graceful-fs "^4.2.4" jest-regex-util "^27.0.6" jest-serializer "^27.0.6" - jest-util "^27.0.6" - jest-worker "^27.0.6" + jest-util "^27.3.0" + jest-worker "^27.3.0" micromatch "^4.0.4" walker "^1.0.7" optionalDependencies: fsevents "^2.3.2" -jest-jasmine2@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.0.6.tgz#fd509a9ed3d92bd6edb68a779f4738b100655b37" - integrity sha512-cjpH2sBy+t6dvCeKBsHpW41mjHzXgsavaFMp+VWRf0eR4EW8xASk1acqmljFtK2DgyIECMv2yCdY41r2l1+4iA== +jest-jasmine2@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-27.3.0.tgz#d5ac6bec10f6696da99d990bf3df2377578fd331" + integrity sha512-c12xS913sE56pBYZYIuukttDyMJTgK+T/aYKuHse/jyBHk2r78IFxrEl0BL8iiezLZw6g6bKtyww/j9XWOVxqg== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^27.0.6" + "@jest/environment" "^27.3.0" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/test-result" "^27.3.0" + "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" - expect "^27.0.6" + expect "^27.3.0" is-generator-fn "^2.0.0" - jest-each "^27.0.6" - jest-matcher-utils "^27.0.6" - jest-message-util "^27.0.6" - jest-runtime "^27.0.6" - jest-snapshot "^27.0.6" - jest-util "^27.0.6" - pretty-format "^27.0.6" + jest-each "^27.3.0" + jest-matcher-utils "^27.3.0" + jest-message-util "^27.3.0" + jest-runtime "^27.3.0" + jest-snapshot "^27.3.0" + jest-util "^27.3.0" + pretty-format "^27.3.0" throat "^6.0.1" -jest-leak-detector@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.0.6.tgz#545854275f85450d4ef4b8fe305ca2a26450450f" - integrity sha512-2/d6n2wlH5zEcdctX4zdbgX8oM61tb67PQt4Xh8JFAIy6LRKUnX528HulkaG6nD5qDl5vRV1NXejCe1XRCH5gQ== +jest-leak-detector@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.3.0.tgz#2a881226a08068f6c2f3f238a65a788d4d3e787e" + integrity sha512-xlCDZUaVVpCOAAiW7b8sgxIzTkEmpElwmWe9wVdU01WnFCvQ0aQiq2JTNbeCgalhjxJVeZlACRHIsLjWrmtlRA== dependencies: jest-get-type "^27.0.6" - pretty-format "^27.0.6" + pretty-format "^27.3.0" -jest-matcher-utils@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.0.6.tgz#2a8da1e86c620b39459f4352eaa255f0d43e39a9" - integrity sha512-OFgF2VCQx9vdPSYTHWJ9MzFCehs20TsyFi6bIHbk5V1u52zJOnvF0Y/65z3GLZHKRuTgVPY4Z6LVePNahaQ+tA== +jest-matcher-utils@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.3.0.tgz#82c41750db4384d7a8db319348752df2bb0acf7a" + integrity sha512-AK2ds5J29PJcZhfJ/5J8ycbjCXTHnwc6lQeOV1a1GahU1MCpSvyHG1iIevyvp6PXPy6r0q9ywGdCObWHmkK16g== dependencies: chalk "^4.0.0" - jest-diff "^27.0.6" + jest-diff "^27.3.0" jest-get-type "^27.0.6" - pretty-format "^27.0.6" + pretty-format "^27.3.0" jest-message-util@^27.0.6: version "27.0.6" @@ -4982,6 +5147,21 @@ jest-message-util@^27.0.6: slash "^3.0.0" stack-utils "^2.0.3" +jest-message-util@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.3.0.tgz#d64d24c2f19111ea916c092fea015076bb7615fe" + integrity sha512-0c79aomiyE3mlta4NCWsICydvv2W0HlM/eVx46YEO+vdDuwUvNuQn8LqOtcHC1hSd25i03RrPvscrWgHBJQpRQ== + dependencies: + "@babel/code-frame" "^7.12.13" + "@jest/types" "^27.2.5" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.4" + micromatch "^4.0.4" + pretty-format "^27.3.0" + slash "^3.0.0" + stack-utils "^2.0.3" + jest-mock@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.0.6.tgz#0efdd40851398307ba16778728f6d34d583e3467" @@ -4990,15 +5170,23 @@ jest-mock@^27.0.6: "@jest/types" "^27.0.6" "@types/node" "*" +jest-mock@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.3.0.tgz#ddf0ec3cc3e68c8ccd489bef4d1f525571a1b867" + integrity sha512-ziZiLk0elZOQjD08bLkegBzv5hCABu/c8Ytx45nJKkysQwGaonvmTxwjLqEA4qGdasq9o2I8/HtdGMNnVsMTGw== + dependencies: + "@jest/types" "^27.2.5" + "@types/node" "*" + jest-pnp-resolver@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-preset-angular@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/jest-preset-angular/-/jest-preset-angular-10.0.0.tgz#31de62d25384a6408820c131e20f356ec0a9c178" - integrity sha512-y+wYe5/xRVabKH6XOllQth0TbuMLAMxxdyBoM28ICRC+2QcjEL3bpY/kohzj9qHBCzoBpqU7m6LSoSGKv9i9+g== +jest-preset-angular@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/jest-preset-angular/-/jest-preset-angular-10.0.1.tgz#fb9f12ae3ccad0c586079da1df92b6ac003cd218" + integrity sha512-+Rxi47jRJTX5BDhB4DqIELCWnJ319vHGI4MGcIVl+AXVXUKXe7zZiy7yC2Pdbs6SNUrwHObWq3yFkSt6jFtEPQ== dependencies: jest-environment-jsdom "^27.0.0" pretty-format "^27.0.0" @@ -5009,89 +5197,90 @@ jest-regex-util@^27.0.6: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== -jest-resolve-dependencies@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.0.6.tgz#3e619e0ef391c3ecfcf6ef4056207a3d2be3269f" - integrity sha512-mg9x9DS3BPAREWKCAoyg3QucCr0n6S8HEEsqRCKSPjPcu9HzRILzhdzY3imsLoZWeosEbJZz6TKasveczzpJZA== +jest-resolve-dependencies@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-27.3.0.tgz#1467ed51d87635aec7133b2e29a283500f4609d1" + integrity sha512-YVmlWHdSUCOLrJl8lOIjda6+DtbgOCfExfoSx9gvHFYaXPq0UP2EELiX514H0rURTbSaLsDTodLNyqqEd/IqeA== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.2.5" jest-regex-util "^27.0.6" - jest-snapshot "^27.0.6" + jest-snapshot "^27.3.0" -jest-resolve@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.0.6.tgz#e90f436dd4f8fbf53f58a91c42344864f8e55bff" - integrity sha512-yKmIgw2LgTh7uAJtzv8UFHGF7Dm7XfvOe/LQ3Txv101fLM8cx2h1QVwtSJ51Q/SCxpIiKfVn6G2jYYMDNHZteA== +jest-resolve@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.3.0.tgz#ffd1db6828b3ee2243f4e4973d80d02e988f2443" + integrity sha512-SZxjtEkM0+f5vxJVpaGztQfnzEqgVnQqHzeGW1P9UON9qDtAET01HWaPCnb10SNUaNRG9NhhOMP418zl44FaIA== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.2.5" chalk "^4.0.0" - escalade "^3.1.1" graceful-fs "^4.2.4" + jest-haste-map "^27.3.0" jest-pnp-resolver "^1.2.2" - jest-util "^27.0.6" - jest-validate "^27.0.6" + jest-util "^27.3.0" + jest-validate "^27.3.0" resolve "^1.20.0" + resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.0.6.tgz#1325f45055539222bbc7256a6976e993ad2f9520" - integrity sha512-W3Bz5qAgaSChuivLn+nKOgjqNxM7O/9JOJoKDCqThPIg2sH/d4A/lzyiaFgnb9V1/w29Le11NpzTJSzga1vyYQ== +jest-runner@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-27.3.0.tgz#0affed8232bf50daacb186091a98e4c50cc83c7a" + integrity sha512-gbkXXJdV5YpGjHvHZAAl5905qAgi+HLYO9lvLqGBxAWpx+oPOpBcMZfkRef7u86heZj1lmULzEdLjY459Z+rNQ== dependencies: - "@jest/console" "^27.0.6" - "@jest/environment" "^27.0.6" - "@jest/test-result" "^27.0.6" - "@jest/transform" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/console" "^27.3.0" + "@jest/environment" "^27.3.0" + "@jest/test-result" "^27.3.0" + "@jest/transform" "^27.3.0" + "@jest/types" "^27.2.5" "@types/node" "*" chalk "^4.0.0" emittery "^0.8.1" exit "^0.1.2" graceful-fs "^4.2.4" jest-docblock "^27.0.6" - jest-environment-jsdom "^27.0.6" - jest-environment-node "^27.0.6" - jest-haste-map "^27.0.6" - jest-leak-detector "^27.0.6" - jest-message-util "^27.0.6" - jest-resolve "^27.0.6" - jest-runtime "^27.0.6" - jest-util "^27.0.6" - jest-worker "^27.0.6" + jest-environment-jsdom "^27.3.0" + jest-environment-node "^27.3.0" + jest-haste-map "^27.3.0" + jest-leak-detector "^27.3.0" + jest-message-util "^27.3.0" + jest-resolve "^27.3.0" + jest-runtime "^27.3.0" + jest-util "^27.3.0" + jest-worker "^27.3.0" source-map-support "^0.5.6" throat "^6.0.1" -jest-runtime@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.0.6.tgz#45877cfcd386afdd4f317def551fc369794c27c9" - integrity sha512-BhvHLRVfKibYyqqEFkybsznKwhrsu7AWx2F3y9G9L95VSIN3/ZZ9vBpm/XCS2bS+BWz3sSeNGLzI3TVQ0uL85Q== +jest-runtime@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-27.3.0.tgz#6957699d74a675441f50627bca9fe8b035c82b83" + integrity sha512-CRhIM45UlYVY2u5IfCx+0jsCm6DLvY9fz34CzDi3c4W1prb7hGKLOJlxbayQIHHMhUx22WhK4eRqXjOKDnKdAQ== dependencies: - "@jest/console" "^27.0.6" - "@jest/environment" "^27.0.6" - "@jest/fake-timers" "^27.0.6" - "@jest/globals" "^27.0.6" + "@jest/console" "^27.3.0" + "@jest/environment" "^27.3.0" + "@jest/globals" "^27.3.0" "@jest/source-map" "^27.0.6" - "@jest/test-result" "^27.0.6" - "@jest/transform" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/test-result" "^27.3.0" + "@jest/transform" "^27.3.0" + "@jest/types" "^27.2.5" "@types/yargs" "^16.0.0" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" + execa "^5.0.0" exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.2.4" - jest-haste-map "^27.0.6" - jest-message-util "^27.0.6" - jest-mock "^27.0.6" + jest-haste-map "^27.3.0" + jest-message-util "^27.3.0" + jest-mock "^27.3.0" jest-regex-util "^27.0.6" - jest-resolve "^27.0.6" - jest-snapshot "^27.0.6" - jest-util "^27.0.6" - jest-validate "^27.0.6" + jest-resolve "^27.3.0" + jest-snapshot "^27.3.0" + jest-util "^27.3.0" + jest-validate "^27.3.0" slash "^3.0.0" strip-bom "^4.0.0" - yargs "^16.0.3" + yargs "^16.2.0" jest-serializer@^27.0.6: version "27.0.6" @@ -5101,10 +5290,10 @@ jest-serializer@^27.0.6: "@types/node" "*" graceful-fs "^4.2.4" -jest-snapshot@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.0.6.tgz#f4e6b208bd2e92e888344d78f0f650bcff05a4bf" - integrity sha512-NTHaz8He+ATUagUgE7C/UtFcRoHqR2Gc+KDfhQIyx+VFgwbeEMjeP+ILpUTLosZn/ZtbNdCF5LkVnN/l+V751A== +jest-snapshot@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.3.0.tgz#3792e1d22633050a1817c3e0d9a18666d43746ee" + integrity sha512-JaFXNS6D1BxvU2ORKaQwpen3Qic7IJAtGb09lbYiYk/GXXlde67Ts990i2nC5oBs0CstbeQE3jTeRayIZpM1Pw== dependencies: "@babel/core" "^7.7.2" "@babel/generator" "^7.7.2" @@ -5112,23 +5301,23 @@ jest-snapshot@^27.0.6: "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.0.0" - "@jest/transform" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/transform" "^27.3.0" + "@jest/types" "^27.2.5" "@types/babel__traverse" "^7.0.4" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^27.0.6" + expect "^27.3.0" graceful-fs "^4.2.4" - jest-diff "^27.0.6" + jest-diff "^27.3.0" jest-get-type "^27.0.6" - jest-haste-map "^27.0.6" - jest-matcher-utils "^27.0.6" - jest-message-util "^27.0.6" - jest-resolve "^27.0.6" - jest-util "^27.0.6" + jest-haste-map "^27.3.0" + jest-matcher-utils "^27.3.0" + jest-message-util "^27.3.0" + jest-resolve "^27.3.0" + jest-util "^27.3.0" natural-compare "^1.4.0" - pretty-format "^27.0.6" + pretty-format "^27.3.0" semver "^7.3.2" jest-util@^27.0.0, jest-util@^27.0.6: @@ -5143,32 +5332,44 @@ jest-util@^27.0.0, jest-util@^27.0.6: is-ci "^3.0.0" picomatch "^2.2.3" -jest-validate@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.0.6.tgz#930a527c7a951927df269f43b2dc23262457e2a6" - integrity sha512-yhZZOaMH3Zg6DC83n60pLmdU1DQE46DW+KLozPiPbSbPhlXXaiUTDlhHQhHFpaqIFRrInko1FHXjTRpjWRuWfA== +jest-util@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.3.0.tgz#178f211d308c25c9593d1c5a2f2b3aef28411741" + integrity sha512-SFSDBGKkxXi4jClmU1WLp/cMMlb4YX6+5Lb0CUySxmonArio8yJ2NALMWvQuXchgySiH7Rb912hVZ2QZ6t3x7w== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.2.5" + "@types/node" "*" + chalk "^4.0.0" + graceful-fs "^4.2.4" + is-ci "^3.0.0" + picomatch "^2.2.3" + +jest-validate@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.3.0.tgz#1a92dd52d0a493037f6e1776c49457c031e0adc8" + integrity sha512-5oqWnb9MrkicE+ywR+BxoZr0L7H3WBDAt6LZggnyFHieAk8nnIQAKRpSodNPhiNJTwaMSbNjCe7SxAzKwTsBoA== + dependencies: + "@jest/types" "^27.2.5" camelcase "^6.2.0" chalk "^4.0.0" jest-get-type "^27.0.6" leven "^3.1.0" - pretty-format "^27.0.6" + pretty-format "^27.3.0" -jest-watcher@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.0.6.tgz#89526f7f9edf1eac4e4be989bcb6dec6b8878d9c" - integrity sha512-/jIoKBhAP00/iMGnTwUBLgvxkn7vsOweDrOTSPzc7X9uOyUtJIDthQBTI1EXz90bdkrxorUZVhJwiB69gcHtYQ== +jest-watcher@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-27.3.0.tgz#13730b347e2ae8ba3c9435055bdad2ad73e5c348" + integrity sha512-xpTFRhqzUnNwTGaSBoHcyXROGbAfj2u4LS7Xosb+hzgrFgWgiHtCy3PWyN1DQk31Na98bBjXKxAbfSBACrvEiQ== dependencies: - "@jest/test-result" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/test-result" "^27.3.0" + "@jest/types" "^27.2.5" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" - jest-util "^27.0.6" + jest-util "^27.3.0" string-length "^4.0.1" -jest-worker@^27.0.2, jest-worker@^27.0.6: +jest-worker@^27.0.2: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.0.6.tgz#a5fdb1e14ad34eb228cfe162d9f729cdbfa28aed" integrity sha512-qupxcj/dRuA3xHPMUd40gr2EaAurFbkwzOh7wfPaeE9id7hyjURRQoqNfHifHK3XjJU6YJJUQKILGUnwGPEOCA== @@ -5177,14 +5378,23 @@ jest-worker@^27.0.2, jest-worker@^27.0.6: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest/-/jest-27.0.6.tgz#10517b2a628f0409087fbf473db44777d7a04505" - integrity sha512-EjV8aETrsD0wHl7CKMibKwQNQc3gIRBXlTikBmmHUeVMKaPFxdcUIBfoDqTSXDoGJIivAYGqCWVlzCSaVjPQsA== +jest-worker@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.3.0.tgz#6b636b63b6672208b91b92d8dcde112d1d4dba2d" + integrity sha512-xTTvvJqOjKBqE1AmwDHiQN8qzp9VoT981LtfXA+XiJVxHn4435vpnrzVcJ6v/ESiuB+IXPjZakn/ppT00xBCWA== dependencies: - "@jest/core" "^27.0.6" + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +jest@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-27.3.0.tgz#25f0e02aaa51d53bc6e1941eb4838a3452f3320e" + integrity sha512-ZSwT6ROUbUs3bXirxzxBvohE/1y7t+IHIu3fL8WgIeJppE2XsFoa2dB03CI9kXA81znW0Kt0t2R+QVOWeY8cYw== + dependencies: + "@jest/core" "^27.3.0" import-local "^3.0.2" - jest-cli "^27.0.6" + jest-cli "^27.3.0" js-tokens@^4.0.0: version "4.0.0" @@ -5689,12 +5899,12 @@ mimic-fn@^3.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-3.1.0.tgz#65755145bbf3e36954b949c16450427451d5ca74" integrity sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ== -mini-css-extract-plugin@2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-2.1.0.tgz#4aa6558b527ad4c168fee4a20b6092ebe9f98309" - integrity sha512-SV1GgjMcfqy6hW07rAniUbQE4qS3inh3v4rZEUySkPRWy3vMbS3jUCjMOvNI4lUnDlQYJEmuUqKktTCNY5koFQ== +mini-css-extract-plugin@2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-2.2.1.tgz#a44bbfc8ede9211f31474b91c4e8863bf52dd294" + integrity sha512-A0GBXpz8WIPgh2HfASJ0EeY8grd2dGxmC4R8uTujFJXZY7zFy0nvYSYW6SKCLKlz7y45BdHONfaxZQMIZpeF/w== dependencies: - schema-utils "^3.0.0" + schema-utils "^3.1.0" minimalistic-assert@^1.0.0: version "1.0.1" @@ -6225,11 +6435,6 @@ p-defer@^1.0.0: resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= -p-each-series@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.2.0.tgz#105ab0357ce72b202a8a8b94933672657b5e2a9a" - integrity sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA== - p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -7093,6 +7298,16 @@ pretty-format@^27.0.0, pretty-format@^27.0.6: ansi-styles "^5.0.0" react-is "^17.0.1" +pretty-format@^27.3.0: + version "27.3.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.3.0.tgz#ab4679ffc25dd9bc29bab220a4a70a873a19600e" + integrity sha512-Nkdd0xmxZdjCe6GoJomHnrLcCYGYzZKI/fRnUX0sCwDai2mmCHJfC9Ecx33lYgaxAFS/pJCAqhfxmWlm1wNVag== + dependencies: + "@jest/types" "^27.2.5" + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^17.0.1" + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -7440,6 +7655,11 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= +resolve.exports@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" + integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== + resolve@1.20.0, resolve@^1.1.7, resolve@^1.14.2, resolve@^1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" @@ -8339,7 +8559,7 @@ ts-jest@^27.0.0: semver "7.x" yargs-parser "20.x" -tslib@2.3.0, tslib@^2.0.0, tslib@^2.1.0, tslib@^2.2.0: +tslib@2.3.0, tslib@^2.0.0, tslib@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e" integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg== @@ -8541,10 +8761,10 @@ uuid@^3.3.2, uuid@^3.4.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== -v8-to-istanbul@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.0.0.tgz#4229f2a99e367f3f018fa1d5c2b8ec684667c69c" - integrity sha512-LkmXi8UUNxnCC+JlH7/fsfsKr5AU110l+SYGJimWNkWhxbN5EyeOtm1MJ0hhvqMMOhGwBj1Fp70Yv9i+hX0QAg== +v8-to-istanbul@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-8.1.0.tgz#0aeb763894f1a0a1676adf8a8b7612a38902446c" + integrity sha512-/PRhfd8aTNp9Ggr62HPzXg2XasNFGy5PBt0Rp04du7/8GNNSgxFL6WBTkgMKSL9bFjH+8kKEG3f37FmxiTqUUA== dependencies: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" @@ -8932,7 +9152,7 @@ yargs@^13.3.2: y18n "^4.0.0" yargs-parser "^13.1.2" -yargs@^16.0.3: +yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== diff --git a/src/__tests__/__snapshots__/downlevel-ctor.spec.ts.snap b/src/__tests__/__snapshots__/downlevel-ctor.spec.ts.snap deleted file mode 100644 index 9a574bf4d6..0000000000 --- a/src/__tests__/__snapshots__/downlevel-ctor.spec.ts.snap +++ /dev/null @@ -1,51 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should add ctor param to class constructor 1`] = ` -"import { forwardRef, Inject, Injector } from '@angular/core'; -class Door { - // Door attempts to inject Lock, despite it not being defined yet. - // forwardRef makes this possible. - constructor(lock) { - this.lock = lock; - } -} -Door.ctorParameters = () => [ - { type: Lock, decorators: [{ type: Inject, args: [forwardRef(() => Lock),] }] } -]; -// Only at this point Lock is defined. -class Lock { -} -Injector.create({ - providers: [ - { provide: Lock, deps: [] }, - { provide: Door, deps: [Lock] }, - ], -}); -//# " -`; - -exports[`should add ctor param to class constructor 2`] = ` -"\\"use strict\\"; -Object.defineProperty(exports, \\"__esModule\\", { value: true }); -const core_1 = require(\\"@angular/core\\"); -class Door { - // Door attempts to inject Lock, despite it not being defined yet. - // forwardRef makes this possible. - constructor(lock) { - this.lock = lock; - } -} -Door.ctorParameters = () => [ - { type: Lock, decorators: [{ type: core_1.Inject, args: [core_1.forwardRef(() => Lock),] }] } -]; -// Only at this point Lock is defined. -class Lock { -} -core_1.Injector.create({ - providers: [ - { provide: Lock, deps: [] }, - { provide: Door, deps: [Lock] }, - ], -}); -//# " -`; diff --git a/src/__tests__/downlevel-ctor.spec.ts b/src/__tests__/downlevel-ctor.spec.ts deleted file mode 100644 index cce130a6aa..0000000000 --- a/src/__tests__/downlevel-ctor.spec.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { readFileSync } from 'fs'; -import { join } from 'path'; - -import { SOURCE_MAPPING_PREFIX } from 'ts-jest/dist/compiler/compiler-utils'; -import { ConfigSet } from 'ts-jest/dist/config/config-set'; - -import { NgJestCompiler } from '../compiler/ng-jest-compiler'; -import { constructorDownlevelCtor } from '../transformers/downlevel-ctor'; - -import { jestCfgStub } from './__helpers__/test-constants'; -import { mockFolder } from './__helpers__/test-helpers'; - -const fileName = join(mockFolder, 'forward-ref.ts'); -const filePath = readFileSync(fileName, 'utf-8'); -// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -const baseJestCfg = { - ...jestCfgStub, - globals: { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - 'ts-jest': { - ...jestCfgStub.globals['ts-jest'], - tsconfig: { - esModuleInterop: false, - allowSyntheticDefaultImports: false, - }, - }, - }, -}; - -test.each([true, false])('should add ctor param to class constructor', (useESM) => { - const ngJestConfig = new ConfigSet({ - ...baseJestCfg, - globals: { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - 'ts-jest': { - ...baseJestCfg.globals['ts-jest'], - useESM, - }, - }, - }); - const compiler = new NgJestCompiler(ngJestConfig, new Map()); - // @ts-expect-error testing purpose - compiler._makeTransformers = jest.fn().mockReturnValue({ - before: [constructorDownlevelCtor(compiler)], - after: [], - afterDeclarations: [], - }); - - const output = compiler.getCompiledOutput(filePath, fileName, { - watchMode: false, - supportsStaticESM: useESM, - depGraphs: new Map(), - }); - - expect(output.substring(0, output.indexOf(SOURCE_MAPPING_PREFIX))).toMatchSnapshot(); -}); diff --git a/src/compiler/ng-jest-compiler.ts b/src/compiler/ng-jest-compiler.ts index 15bb00eb25..97fc5519df 100644 --- a/src/compiler/ng-jest-compiler.ts +++ b/src/compiler/ng-jest-compiler.ts @@ -1,9 +1,9 @@ +import { constructorParametersDownlevelTransform } from '@angular/compiler-cli'; import { TsCompiler } from 'ts-jest/dist/compiler/ts-compiler'; import { ConfigSet } from 'ts-jest/dist/config/config-set'; import type { TsJestAstTransformer } from 'ts-jest/dist/types'; import type * as ts from 'typescript'; -import { constructorDownlevelCtor } from '../transformers/downlevel-ctor'; import { replaceResources } from '../transformers/replace-resources'; export class NgJestCompiler extends TsCompiler { @@ -119,7 +119,8 @@ export class NgJestCompiler extends TsCompiler { beforeTransformer.factory(this, beforeTransformer.options), ), replaceResources(this), - constructorDownlevelCtor(this), + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + constructorParametersDownlevelTransform(this.program!), ] as Array | ts.CustomTransformerFactory>, }; } diff --git a/src/transformers/downlevel-ctor.ts b/src/transformers/downlevel-ctor.ts deleted file mode 100644 index 6672d4b9a0..0000000000 --- a/src/transformers/downlevel-ctor.ts +++ /dev/null @@ -1,753 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - * - * Copy from https://github.com/angular/angular/blob/master/packages/compiler-cli/src/transformers/downlevel_decorators_transform.ts - * This will make a bit more effort in maintaining but it will be easier to just copy to work with ESM - */ -import { Decorator, ReflectionHost, TypeScriptReflectionHost } from '@angular/compiler-cli/src/ngtsc/reflection'; -import type { TsCompilerInstance } from 'ts-jest/dist/types'; -import ts from 'typescript'; - -import { isAliasImportDeclaration, loadIsReferencedAliasDeclarationPatch } from './patch-alias-reference-resolution'; - -/** - * Transform for downleveling Angular decorators and Angular-decorated class constructor - * parameters for dependency injection. This transform can be used by the CLI for JIT-mode - * compilation where constructor parameters and associated Angular decorators should be - * downleveled so that apps are not exposed to the ES2015 temporal dead zone limitation - * in TypeScript. See https://github.com/angular/angular-cli/pull/14473 for more details. - */ -export function constructorDownlevelCtor({ program }: TsCompilerInstance): ts.TransformerFactory { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const typeChecker = program!.getTypeChecker(); - const reflectionHost = new TypeScriptReflectionHost(typeChecker); - - return getDownlevelDecoratorsTransform( - typeChecker, - reflectionHost, - [], - /* isCore */ false, - /* enableClosureCompiler */ false, - /* skipClassDecorators */ true, - ); -} - -/** - * Whether a given decorator should be treated as an Angular decorator. - * Either it's used in @angular/core, or it's imported from there. - */ -function isAngularDecorator(decorator: Decorator, isCore: boolean): boolean { - return isCore || (decorator.import !== null && decorator.import.from === '@angular/core'); -} - -/* - ##################################################################### - Code below has been extracted from the tsickle decorator downlevel transformer - and a few local modifications have been applied: - - 1. Tsickle by default processed all decorators that had the `@Annotation` JSDoc. - We modified the transform to only be concerned with known Angular decorators. - 2. Tsickle by default added `@nocollapse` to all generated `ctorParameters` properties. - We only do this when `annotateForClosureCompiler` is enabled. - 3. Tsickle does not handle union types for dependency injection. i.e. if a injected type - is denoted with `@Optional`, the actual type could be set to `T | null`. - See: https://github.com/angular/angular-cli/commit/826803d0736b807867caff9f8903e508970ad5e4. - 4. Tsickle relied on `emitDecoratorMetadata` to be set to `true`. This is due to a limitation - in TypeScript transformers that never has been fixed. We were able to work around this - limitation so that `emitDecoratorMetadata` doesn't need to be specified. - See: `patchAliasReferenceResolution` for more details. - - Here is a link to the tsickle revision on which this transformer is based: - https://github.com/angular/tsickle/blob/fae06becb1570f491806060d83f29f2d50c43cdd/src/decorator_downlevel_transformer.ts - ##################################################################### -*/ - -/** - * Creates the AST for the decorator field type annotation, which has the form - * { type: Function, args?: any[] }[] - */ -function createDecoratorInvocationType(): ts.TypeNode { - const typeElements: ts.TypeElement[] = []; - typeElements.push( - ts.createPropertySignature( - undefined, - 'type', - undefined, - ts.createTypeReferenceNode(ts.createIdentifier('Function'), undefined), - undefined, - ), - ); - typeElements.push( - ts.createPropertySignature( - undefined, - 'args', - ts.createToken(ts.SyntaxKind.QuestionToken), - ts.createArrayTypeNode(ts.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword)), - undefined, - ), - ); - - return ts.createArrayTypeNode(ts.createTypeLiteralNode(typeElements)); -} - -/** - * Extracts the type of the decorator (the function or expression invoked), as well as all the - * arguments passed to the decorator. Returns an AST with the form: - * - * // For @decorator(arg1, arg2) - * { type: decorator, args: [arg1, arg2] } - */ -function extractMetadataFromSingleDecorator( - decorator: ts.Decorator, - diagnostics: ts.Diagnostic[], -): ts.ObjectLiteralExpression { - const metadataProperties: ts.ObjectLiteralElementLike[] = []; - const expr = decorator.expression; - switch (expr.kind) { - case ts.SyntaxKind.Identifier: - // The decorator was a plain @Foo. - metadataProperties.push(ts.createPropertyAssignment('type', expr)); - break; - case ts.SyntaxKind.CallExpression: - // The decorator was a call, like @Foo(bar). - // eslint-disable-next-line no-case-declarations - const call = expr as ts.CallExpression; - metadataProperties.push(ts.createPropertyAssignment('type', call.expression)); - if (call.arguments.length) { - const args: ts.Expression[] = []; - for (const arg of call.arguments) { - args.push(arg); - } - const argsArrayLiteral = ts.createArrayLiteral(args); - argsArrayLiteral.elements.hasTrailingComma = true; - metadataProperties.push(ts.createPropertyAssignment('args', argsArrayLiteral)); - } - break; - default: - diagnostics.push({ - file: decorator.getSourceFile(), - start: decorator.getStart(), - length: decorator.getEnd() - decorator.getStart(), - messageText: `${ts.SyntaxKind[decorator.kind]} not implemented in gathering decorator metadata.`, - category: ts.DiagnosticCategory.Error, - code: 0, - }); - break; - } - - return ts.createObjectLiteral(metadataProperties); -} - -/** - * Takes a list of decorator metadata object ASTs and produces an AST for a - * static class property of an array of those metadata objects. - */ -function createDecoratorClassProperty(decoratorList: ts.ObjectLiteralExpression[]) { - const modifier = ts.createToken(ts.SyntaxKind.StaticKeyword); - const type = createDecoratorInvocationType(); - const initializer = ts.createArrayLiteral(decoratorList, true); - - // NB: the .decorators property does not get a @nocollapse property. There is - // no good reason why - it means .decorators is not runtime accessible if you - // compile with collapse properties, whereas propDecorators is, which doesn't - // follow any stringent logic. However this has been the case previously, and - // adding it back in leads to substantial code size increases as Closure fails - // to tree shake these props without @nocollapse. - return ts.createProperty(undefined, [modifier], 'decorators', undefined, type, initializer); -} - -/** - * Creates the AST for the 'ctorParameters' field type annotation: - * () => ({ type: any, decorators?: {type: Function, args?: any[]}[] }|null)[] - */ -function createCtorParametersClassPropertyType(): ts.TypeNode { - // Sorry about this. Try reading just the string literals below. - const typeElements: ts.TypeElement[] = []; - typeElements.push( - ts.createPropertySignature( - undefined, - 'type', - undefined, - ts.createTypeReferenceNode(ts.createIdentifier('any'), undefined), - undefined, - ), - ); - typeElements.push( - ts.createPropertySignature( - undefined, - 'decorators', - ts.createToken(ts.SyntaxKind.QuestionToken), - ts.createArrayTypeNode( - ts.createTypeLiteralNode([ - ts.createPropertySignature( - undefined, - 'type', - undefined, - ts.createTypeReferenceNode(ts.createIdentifier('Function'), undefined), - undefined, - ), - ts.createPropertySignature( - undefined, - 'args', - ts.createToken(ts.SyntaxKind.QuestionToken), - ts.createArrayTypeNode(ts.createTypeReferenceNode(ts.createIdentifier('any'), undefined)), - undefined, - ), - ]), - ), - undefined, - ), - ); - - return ts.createFunctionTypeNode( - undefined, - [], - ts.createArrayTypeNode( - ts.createUnionTypeNode([ts.createTypeLiteralNode(typeElements), ts.createLiteralTypeNode(ts.createNull())]), - ), - ); -} - -/** - * Sets a Closure \@nocollapse synthetic comment on the given node. This prevents Closure Compiler - * from collapsing the apparently static property, which would make it impossible to find for code - * trying to detect it at runtime. - */ -function addNoCollapseComment(n: ts.Node) { - ts.setSyntheticLeadingComments(n, [ - { - kind: ts.SyntaxKind.MultiLineCommentTrivia, - text: '* @nocollapse ', - pos: -1, - end: -1, - hasTrailingNewLine: true, - }, - ]); -} - -/** - * createCtorParametersClassProperty creates a static 'ctorParameters' property containing - * downleveled decorator information. - * - * The property contains an arrow function that returns an array of object literals of the shape: - * static ctorParameters = () => [{ - * type: SomeClass|undefined, // the type of the param that's decorated, if it's a value. - * decorators: [{ - * type: DecoratorFn, // the type of the decorator that's invoked. - * args: [ARGS], // the arguments passed to the decorator. - * }] - * }]; - */ -function createCtorParametersClassProperty( - diagnostics: ts.Diagnostic[], - entityNameToExpression: (n: ts.EntityName) => ts.Expression | undefined, - ctorParameters: ParameterDecorationInfo[], - isClosureCompilerEnabled: boolean, -): ts.PropertyDeclaration { - const params: ts.Expression[] = []; - - for (const ctorParam of ctorParameters) { - if (!ctorParam.type && ctorParam.decorators.length === 0) { - params.push(ts.createNull()); - continue; - } - - const paramType = ctorParam.type ? typeReferenceToExpression(entityNameToExpression, ctorParam.type) : undefined; - const members = [ts.createPropertyAssignment('type', paramType || ts.createIdentifier('undefined'))]; - - const decorators: ts.ObjectLiteralExpression[] = []; - for (const deco of ctorParam.decorators) { - decorators.push(extractMetadataFromSingleDecorator(deco, diagnostics)); - } - if (decorators.length) { - members.push(ts.createPropertyAssignment('decorators', ts.createArrayLiteral(decorators))); - } - params.push(ts.createObjectLiteral(members)); - } - - const initializer = ts.createArrowFunction( - undefined, - undefined, - [], - undefined, - ts.createToken(ts.SyntaxKind.EqualsGreaterThanToken), - ts.createArrayLiteral(params, true), - ); - const type = createCtorParametersClassPropertyType(); - const ctorProp = ts.createProperty( - undefined, - [ts.createToken(ts.SyntaxKind.StaticKeyword)], - 'ctorParameters', - undefined, - type, - initializer, - ); - if (isClosureCompilerEnabled) { - addNoCollapseComment(ctorProp); - } - - return ctorProp; -} - -/** - * createPropDecoratorsClassProperty creates a static 'propDecorators' property containing type - * information for every property that has a decorator applied. - * - * static propDecorators: {[key: string]: {type: Function, args?: any[]}[]} = { - * propA: [{type: MyDecorator, args: [1, 2]}, ...], - * ... - * }; - */ -function createPropDecoratorsClassProperty( - diagnostics: ts.Diagnostic[], - properties: Map, -): ts.PropertyDeclaration { - // `static propDecorators: {[key: string]: ` + {type: Function, args?: any[]}[] + `} = {\n`); - const entries: ts.ObjectLiteralElementLike[] = []; - for (const [name, decorators] of properties.entries()) { - entries.push( - ts.createPropertyAssignment( - name, - ts.createArrayLiteral(decorators.map((deco) => extractMetadataFromSingleDecorator(deco, diagnostics))), - ), - ); - } - const initializer = ts.createObjectLiteral(entries, true); - const type = ts.createTypeLiteralNode([ - ts.createIndexSignature( - undefined, - undefined, - [ - ts.createParameter( - undefined, - undefined, - undefined, - 'key', - undefined, - ts.createTypeReferenceNode('string', undefined), - undefined, - ), - ], - createDecoratorInvocationType(), - ), - ]); - - return ts.createProperty( - undefined, - [ts.createToken(ts.SyntaxKind.StaticKeyword)], - 'propDecorators', - undefined, - type, - initializer, - ); -} - -/** - * Returns an expression representing the (potentially) value part for the given node. - * - * This is a partial re-implementation of TypeScript's serializeTypeReferenceNode. This is a - * workaround for https://github.com/Microsoft/TypeScript/issues/17516 (serializeTypeReferenceNode - * not being exposed). In practice this implementation is sufficient for Angular's use of type - * metadata. - */ -function typeReferenceToExpression( - entityNameToExpression: (n: ts.EntityName) => ts.Expression | undefined, - node: ts.TypeNode, -): ts.Expression | undefined { - let kind = node.kind; - if (ts.isLiteralTypeNode(node)) { - // Treat literal types like their base type (boolean, string, number). - kind = node.literal.kind; - } - switch (kind) { - case ts.SyntaxKind.FunctionType: - case ts.SyntaxKind.ConstructorType: - return ts.createIdentifier('Function'); - case ts.SyntaxKind.ArrayType: - case ts.SyntaxKind.TupleType: - return ts.createIdentifier('Array'); - case ts.SyntaxKind.TypePredicate: - case ts.SyntaxKind.TrueKeyword: - case ts.SyntaxKind.FalseKeyword: - case ts.SyntaxKind.BooleanKeyword: - return ts.createIdentifier('Boolean'); - case ts.SyntaxKind.StringLiteral: - case ts.SyntaxKind.StringKeyword: - return ts.createIdentifier('String'); - case ts.SyntaxKind.ObjectKeyword: - return ts.createIdentifier('Object'); - case ts.SyntaxKind.NumberKeyword: - case ts.SyntaxKind.NumericLiteral: - return ts.createIdentifier('Number'); - case ts.SyntaxKind.TypeReference: - // eslint-disable-next-line no-case-declarations - const typeRef = node as ts.TypeReferenceNode; - - // Ignore any generic types, just return the base type. - return entityNameToExpression(typeRef.typeName); - case ts.SyntaxKind.UnionType: - // eslint-disable-next-line no-case-declarations - const childTypeNodes = (node as ts.UnionTypeNode).types.filter( - (t) => !(ts.isLiteralTypeNode(t) && t.literal.kind === ts.SyntaxKind.NullKeyword), - ); - - return childTypeNodes.length === 1 - ? typeReferenceToExpression(entityNameToExpression, childTypeNodes[0]) - : undefined; - default: - return undefined; - } -} - -/** - * Checks whether a given symbol refers to a value that exists at runtime (as distinct from a type). - * - * Expands aliases, which is important for the case where - * import * as x from 'some-module'; - * and x is now a value (the module object). - */ -function symbolIsRuntimeValue(typeChecker: ts.TypeChecker, symbol: ts.Symbol): boolean { - if (symbol.flags & ts.SymbolFlags.Alias) { - symbol = typeChecker.getAliasedSymbol(symbol); - } - - // Note that const enums are a special case, because - // while they have a value, they don't exist at runtime. - return (symbol.flags & ts.SymbolFlags.Value & ts.SymbolFlags.ConstEnumExcludes) !== 0; -} - -/** ParameterDecorationInfo describes the information for a single constructor parameter. */ -interface ParameterDecorationInfo { - /** - * The type declaration for the parameter. Only set if the type is a value (e.g. a class, not an - * interface). - */ - type: ts.TypeNode | null; - /** The list of decorators found on the parameter, null if none. */ - decorators: ts.Decorator[]; -} - -/** - * Gets a transformer for downleveling Angular decorators. - * @param typeChecker Reference to the program's type checker. - * @param host Reflection host that is used for determining decorators. - * @param diagnostics List which will be populated with diagnostics if any. - * @param isCore Whether the current TypeScript program is for the `@angular/core` package. - * @param isClosureCompilerEnabled Whether closure annotations need to be added where needed. - * @param skipClassDecorators Whether class decorators should be skipped from downleveling. - * This is useful for JIT mode where class decorators should be preserved as they could rely - * on immediate execution. e.g. downleveling `@Injectable` means that the injectable factory - * is not created, and injecting the token will not work. If this decorator would not be - * downleveled, the `Injectable` decorator will execute immediately on file load, and - * Angular will generate the corresponding injectable factory. - */ -function getDownlevelDecoratorsTransform( - typeChecker: ts.TypeChecker, - host: ReflectionHost, - diagnostics: ts.Diagnostic[], - isCore: boolean, - isClosureCompilerEnabled: boolean, - skipClassDecorators: boolean, -): ts.TransformerFactory { - return (context: ts.TransformationContext) => { - // Ensure that referenced type symbols are not elided by TypeScript. Imports for - // such parameter type symbols previously could be type-only, but now might be also - // used in the `ctorParameters` static property as a value. We want to make sure - // that TypeScript does not elide imports for such type references. Read more - // about this in the description for `loadIsReferencedAliasDeclarationPatch`. - const referencedParameterTypes = loadIsReferencedAliasDeclarationPatch(context); - - /** - * Converts an EntityName (from a type annotation) to an expression (accessing a value). - * - * For a given qualified name, this walks depth first to find the leftmost identifier, - * and then converts the path into a property access that can be used as expression. - */ - function entityNameToExpression(name: ts.EntityName): ts.Expression | undefined { - const symbol = typeChecker.getSymbolAtLocation(name); - // Check if the entity name references a symbol that is an actual value. If it is not, it - // cannot be referenced by an expression, so return undefined. - if ( - !symbol || - !symbolIsRuntimeValue(typeChecker, symbol) || - !symbol.declarations || - symbol.declarations.length === 0 - ) { - return undefined; - } - // If we deal with a qualified name, build up a property access expression - // that could be used in the JavaScript output. - if (ts.isQualifiedName(name)) { - const containerExpr = entityNameToExpression(name.left); - if (containerExpr === undefined) { - return undefined; - } - - return ts.createPropertyAccess(containerExpr, name.right); - } - const decl = symbol.declarations[0]; - // If the given entity name has been resolved to an alias import declaration, - // ensure that the alias declaration is not elided by TypeScript, and use its - // name identifier to reference it at runtime. - if (isAliasImportDeclaration(decl)) { - referencedParameterTypes.add(decl); - // If the entity name resolves to an alias import declaration, we reference the - // entity based on the alias import name. This ensures that TypeScript properly - // resolves the link to the import. Cloning the original entity name identifier - // could lead to an incorrect resolution at local scope. e.g. Consider the following - // snippet: `constructor(Dep: Dep) {}`. In such a case, the local `Dep` identifier - // would resolve to the actual parameter name, and not to the desired import. - // This happens because the entity name identifier symbol is internally considered - // as type-only and therefore TypeScript tries to resolve it as value manually. - // We can help TypeScript and avoid this non-reliable resolution by using an identifier - // that is not type-only and is directly linked to the import alias declaration. - if (decl.name !== undefined) { - return ts.getMutableClone(decl.name); - } - } - - // Clone the original entity name identifier so that it can be used to reference - // its value at runtime. This is used when the identifier is resolving to a file - // local declaration (otherwise it would resolve to an alias import declaration). - return ts.getMutableClone(name); - } - - /** - * Transforms a class element. Returns a three tuple of name, transformed element, and - * decorators found. Returns an undefined name if there are no decorators to lower on the - * element, or the element has an exotic name. - */ - function transformClassElement(element: ts.ClassElement): [string | undefined, ts.ClassElement, ts.Decorator[]] { - element = ts.visitEachChild(element, decoratorDownlevelVisitor, context); - const decoratorsToKeep: ts.Decorator[] = []; - const toLower: ts.Decorator[] = []; - const decorators = host.getDecoratorsOfDeclaration(element) || []; - for (const decorator of decorators) { - // We only deal with concrete nodes in TypeScript sources, so we don't - // need to handle synthetically created decorators. - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const decoratorNode = decorator.node! as ts.Decorator; - if (!isAngularDecorator(decorator, isCore)) { - decoratorsToKeep.push(decoratorNode); - continue; - } - toLower.push(decoratorNode); - } - if (!toLower.length) return [undefined, element, []]; - - if (!element.name || !ts.isIdentifier(element.name)) { - // Method has a weird name, e.g. - // [Symbol.foo]() {...} - diagnostics.push({ - file: element.getSourceFile(), - start: element.getStart(), - length: element.getEnd() - element.getStart(), - messageText: `Cannot process decorators for class element with non-analyzable name.`, - category: ts.DiagnosticCategory.Error, - code: 0, - }); - - return [undefined, element, []]; - } - - const name = (element.name as ts.Identifier).text; - const mutable = ts.getMutableClone(element); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (mutable as any).decorators = decoratorsToKeep.length - ? ts.setTextRange(ts.createNodeArray(decoratorsToKeep), mutable.decorators) - : undefined; - - return [name, mutable, toLower]; - } - - /** - * Transforms a constructor. Returns the transformed constructor and the list of parameter - * information collected, consisting of decorators and optional type. - */ - function transformConstructor( - ctor: ts.ConstructorDeclaration, - ): [ts.ConstructorDeclaration, ParameterDecorationInfo[]] { - ctor = ts.visitEachChild(ctor, decoratorDownlevelVisitor, context); - - const newParameters: ts.ParameterDeclaration[] = []; - const oldParameters = ts.visitParameterList(ctor.parameters, decoratorDownlevelVisitor, context); - const parametersInfo: ParameterDecorationInfo[] = []; - for (const param of oldParameters) { - const decoratorsToKeep: ts.Decorator[] = []; - const paramInfo: ParameterDecorationInfo = { decorators: [], type: null }; - const decorators = host.getDecoratorsOfDeclaration(param) || []; - - for (const decorator of decorators) { - // We only deal with concrete nodes in TypeScript sources, so we don't - // need to handle synthetically created decorators. - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const decoratorNode = decorator.node! as ts.Decorator; - if (!isAngularDecorator(decorator, isCore)) { - decoratorsToKeep.push(decoratorNode); - continue; - } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - paramInfo!.decorators.push(decoratorNode); - } - if (param.type) { - // param has a type provided, e.g. "foo: Bar". - // The type will be emitted as a value expression in entityNameToExpression, which takes - // care not to emit anything for types that cannot be expressed as a value (e.g. - // interfaces). - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - paramInfo!.type = param.type; - } - parametersInfo.push(paramInfo); - const newParam = ts.updateParameter( - param, - // Must pass 'undefined' to avoid emitting decorator metadata. - decoratorsToKeep.length ? decoratorsToKeep : undefined, - param.modifiers, - param.dotDotDotToken, - param.name, - param.questionToken, - param.type, - param.initializer, - ); - newParameters.push(newParam); - } - const updated = ts.updateConstructor( - ctor, - ctor.decorators, - ctor.modifiers, - newParameters, - ts.visitFunctionBody(ctor.body, decoratorDownlevelVisitor, context), - ); - - return [updated, parametersInfo]; - } - - /** - * Transforms a single class declaration: - * - dispatches to strip decorators on members - * - converts decorators on the class to annotations - * - creates a ctorParameters property - * - creates a propDecorators property - */ - function transformClassDeclaration(classDecl: ts.ClassDeclaration): ts.ClassDeclaration { - classDecl = ts.getMutableClone(classDecl); - - const newMembers: ts.ClassElement[] = []; - const decoratedProperties = new Map(); - let classParameters: ParameterDecorationInfo[] | null = null; - - for (const member of classDecl.members) { - switch (member.kind) { - case ts.SyntaxKind.PropertyDeclaration: - case ts.SyntaxKind.GetAccessor: - case ts.SyntaxKind.SetAccessor: - case ts.SyntaxKind.MethodDeclaration: { - const [name, newMember, decorators] = transformClassElement(member); - newMembers.push(newMember); - if (name) decoratedProperties.set(name, decorators); - continue; - } - case ts.SyntaxKind.Constructor: { - const ctor = member as ts.ConstructorDeclaration; - if (!ctor.body) break; - const [newMember, parametersInfo] = transformConstructor(member as ts.ConstructorDeclaration); - classParameters = parametersInfo; - newMembers.push(newMember); - continue; - } - default: - break; - } - newMembers.push(ts.visitEachChild(member, decoratorDownlevelVisitor, context)); - } - - // The `ReflectionHost.getDecoratorsOfDeclaration()` method will not return certain kinds of - // decorators that will never be Angular decorators. So we cannot rely on it to capture all - // the decorators that should be kept. Instead we start off with a set of the raw decorators - // on the class, and only remove the ones that have been identified for downleveling. - const decoratorsToKeep = new Set(classDecl.decorators); - const possibleAngularDecorators = host.getDecoratorsOfDeclaration(classDecl) || []; - - let hasAngularDecorator = false; - const decoratorsToLower = []; - for (const decorator of possibleAngularDecorators) { - // We only deal with concrete nodes in TypeScript sources, so we don't - // need to handle synthetically created decorators. - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const decoratorNode = decorator.node! as ts.Decorator; - const isNgDecorator = isAngularDecorator(decorator, isCore); - - // Keep track if we come across an Angular class decorator. This is used - // for to determine whether constructor parameters should be captured or not. - if (isNgDecorator) { - hasAngularDecorator = true; - } - - if (isNgDecorator && !skipClassDecorators) { - decoratorsToLower.push(extractMetadataFromSingleDecorator(decoratorNode, diagnostics)); - decoratorsToKeep.delete(decoratorNode); - } - } - - if (decoratorsToLower.length) { - newMembers.push(createDecoratorClassProperty(decoratorsToLower)); - } - if (classParameters) { - if (hasAngularDecorator || classParameters.some((p) => !!p.decorators.length)) { - // Capture constructor parameters if the class has Angular decorator applied, - // or if any of the parameters has decorators applied directly. - newMembers.push( - createCtorParametersClassProperty( - diagnostics, - entityNameToExpression, - classParameters, - isClosureCompilerEnabled, - ), - ); - } - } - if (decoratedProperties.size) { - newMembers.push(createPropDecoratorsClassProperty(diagnostics, decoratedProperties)); - } - - const members = ts.setTextRange( - ts.createNodeArray(newMembers, classDecl.members.hasTrailingComma), - classDecl.members, - ); - - return ts.updateClassDeclaration( - classDecl, - decoratorsToKeep.size ? Array.from(decoratorsToKeep) : undefined, - classDecl.modifiers, - classDecl.name, - classDecl.typeParameters, - classDecl.heritageClauses, - members, - ); - } - - /** - * Transformer visitor that looks for Angular decorators and replaces them with - * downleveled static properties. Also collects constructor type metadata for - * class declaration that are decorated with an Angular decorator. - */ - function decoratorDownlevelVisitor(node: ts.Node): ts.Node { - if (ts.isClassDeclaration(node)) { - return transformClassDeclaration(node); - } - - return ts.visitEachChild(node, decoratorDownlevelVisitor, context); - } - - return (sf: ts.SourceFile) => { - // Downlevel decorators and constructor parameter types. We will keep track of all - // referenced constructor parameter types so that we can instruct TypeScript to - // not elide their imports if they previously were only type-only. - return ts.visitEachChild(sf, decoratorDownlevelVisitor, context); - }; - }; -} diff --git a/src/transformers/patch-alias-reference-resolution.ts b/src/transformers/patch-alias-reference-resolution.ts deleted file mode 100644 index 988b6b98ed..0000000000 --- a/src/transformers/patch-alias-reference-resolution.ts +++ /dev/null @@ -1,140 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import ts from 'typescript'; - -/** - * Describes a TypeScript transformation context with the internal emit - * resolver exposed. There are requests upstream in TypeScript to expose - * that as public API: https://github.com/microsoft/TypeScript/issues/17516.. - */ -interface TransformationContextWithResolver extends ts.TransformationContext { - getEmitResolver: () => EmitResolver; -} - -const patchedReferencedAliasesSymbol = Symbol('patchedReferencedAliases'); - -/** Describes a subset of the TypeScript internal emit resolver. */ -interface EmitResolver { - isReferencedAliasDeclaration?(node: ts.Node, ...args: unknown[]): void; - [patchedReferencedAliasesSymbol]?: Set; -} - -/** - * Patches the alias declaration reference resolution for a given transformation context - * so that TypeScript knows about the specified alias declarations being referenced. - * - * This exists because TypeScript performs analysis of import usage before transformers - * run and doesn't refresh its state after transformations. This means that imports - * for symbols used as constructor types are elided due to their original type-only usage. - * - * In reality though, since we downlevel decorators and constructor parameters, we want - * these symbols to be retained in the JavaScript output as they will be used as values - * at runtime. We can instruct TypeScript to preserve imports for such identifiers by - * creating a mutable clone of a given import specifier/clause or namespace, but that - * has the downside of preserving the full import in the JS output. See: - * https://github.com/microsoft/TypeScript/blob/3eaa7c65f6f076a08a5f7f1946fd0df7c7430259/src/compiler/transformers/ts.ts#L242-L250. - * - * This is a trick the CLI used in the past for constructor parameter downleveling in JIT: - * https://github.com/angular/angular-cli/blob/b3f84cc5184337666ce61c07b7b9df418030106f/packages/ngtools/webpack/src/transformers/ctor-parameters.ts#L323-L325 - * The trick is not ideal though as it preserves the full import (as outlined before), and it - * results in a slow-down due to the type checker being involved multiple times. The CLI worked - * around this import preserving issue by having another complex post-process step that detects and - * elides unused imports. Note that these unused imports could cause unused chunks being generated - * by Webpack if the application or library is not marked as side-effect free. - * - * This is not ideal though, as we basically re-implement the complex import usage resolution - * from TypeScript. We can do better by letting TypeScript do the import eliding, but providing - * information about the alias declarations (e.g. import specifiers) that should not be elided - * because they are actually referenced (as they will now appear in static properties). - * - * More information about these limitations with transformers can be found in: - * 1. https://github.com/Microsoft/TypeScript/issues/17552. - * 2. https://github.com/microsoft/TypeScript/issues/17516. - * 3. https://github.com/angular/tsickle/issues/635. - * - * The patch we apply to tell TypeScript about actual referenced aliases (i.e. imported symbols), - * matches conceptually with the logic that runs internally in TypeScript when the - * `emitDecoratorMetadata` flag is enabled. TypeScript basically surfaces the same problem and - * solves it conceptually the same way, but obviously doesn't need to access an `@internal` API. - * - * The set that is returned by this function is meant to be filled with import declaration nodes - * that have been referenced in a value-position by the transform, such the the installed patch can - * ensure that those import declarations are not elided. - * - * See below. Note that this uses sourcegraph as the TypeScript checker file doesn't display on - * Github. - * https://sourcegraph.com/github.com/microsoft/TypeScript@3eaa7c65f6f076a08a5f7f1946fd0df7c7430259/-/blob/src/compiler/checker.ts#L31219-31257 - */ -export function loadIsReferencedAliasDeclarationPatch(context: ts.TransformationContext): Set { - // If the `getEmitResolver` method is not available, TS most likely changed the - // internal structure of the transformation context. We will abort gracefully. - if (!isTransformationContextWithEmitResolver(context)) { - throwIncompatibleTransformationContextError(); - } - const emitResolver = context.getEmitResolver(); - - // The emit resolver may have been patched already, in which case we return the set of referenced - // aliases that was created when the patch was first applied. - // See https://github.com/angular/angular/issues/40276. - const existingReferencedAliases = emitResolver[patchedReferencedAliasesSymbol]; - if (existingReferencedAliases !== undefined) { - return existingReferencedAliases; - } - - const originalIsReferencedAliasDeclaration = emitResolver.isReferencedAliasDeclaration; - // If the emit resolver does not have a function called `isReferencedAliasDeclaration`, then - // we abort gracefully as most likely TS changed the internal structure of the emit resolver. - if (originalIsReferencedAliasDeclaration === undefined) { - throwIncompatibleTransformationContextError(); - } - - const referencedAliases = new Set(); - emitResolver.isReferencedAliasDeclaration = function (node, ...args) { - if (isAliasImportDeclaration(node) && referencedAliases.has(node)) { - return true; - } - - return originalIsReferencedAliasDeclaration.call(emitResolver, node, ...args); - }; - - return (emitResolver[patchedReferencedAliasesSymbol] = referencedAliases); -} - -/** - * Gets whether a given node corresponds to an import alias declaration. Alias - * declarations can be import specifiers, namespace imports or import clauses - * as these do not declare an actual symbol but just point to a target declaration. - */ -export function isAliasImportDeclaration( - node: ts.Node, -): node is ts.ImportSpecifier | ts.NamespaceImport | ts.ImportClause { - return ts.isImportSpecifier(node) || ts.isNamespaceImport(node) || ts.isImportClause(node); -} - -/** Whether the transformation context exposes its emit resolver. */ -function isTransformationContextWithEmitResolver( - context: ts.TransformationContext, -): context is TransformationContextWithResolver { - return (context as Partial).getEmitResolver !== undefined; -} - -/** - * Throws an error about an incompatible TypeScript version for which the alias - * declaration reference resolution could not be monkey-patched. The error will - * also propose potential solutions that can be applied by developers. - */ -function throwIncompatibleTransformationContextError(): never { - throw Error( - 'Unable to downlevel Angular decorators due to an incompatible TypeScript ' + - 'version.\nIf you recently updated TypeScript and this issue surfaces now, consider ' + - 'downgrading.\n\n' + - 'Please report an issue on the Angular repositories when this issue ' + - 'surfaces and you are using a supposedly compatible TypeScript version.', - ); -}