From e85021a7ba49eadaee0dc59b08bf6f5077041496 Mon Sep 17 00:00:00 2001 From: Matthieu Riegler Date: Fri, 11 Oct 2024 14:50:44 +0200 Subject: [PATCH] build: Migrate all integration tests with the schematic. (#58160) All components, directives and pipes will now use standalone as default. Non-standalone decorators have now . PR Close #58160 --- .../cli-elements-universal/src/app/app.component.spec.ts | 1 + integration/cli-elements-universal/src/app/app.component.ts | 1 + integration/cli-elements-universal/src/app/title.component.ts | 1 + integration/cli-hello-world-ivy-i18n/src/app/app.component.ts | 1 + integration/cli-hello-world-mocha/src/app/app.component.ts | 1 + integration/cli-hello-world/src/app/app.component.ts | 1 + integration/dynamic-compiler/src/app.component.ts | 1 + integration/dynamic-compiler/src/lazy.module.ts | 1 + integration/forms/src/app/app.component.ts | 3 +++ integration/injectable-def/src/app.ts | 1 + integration/injectable-def/src/lib2.ts | 1 + integration/ivy-i18n/src/app/app.component.ts | 1 + integration/ng-add-localize/src/app/app.component.ts | 1 + integration/ng_elements/src/elements.ts | 4 ++++ integration/ng_update_migrations/src/app/app.component.ts | 1 + .../projects/ngmodule/src/app/app.component.ts | 1 + .../ngmodule/src/app/helloworld/hello-world.component.ts | 1 + .../http-transferstate-lazy-on-init.component.ts | 1 + .../http-transferstate-lazy/http-transfer-state.component.ts | 1 + .../src/app/transferstate/transfer-state.component.ts | 1 + integration/trusted-types/src/app/app.component.ts | 1 + 21 files changed, 26 insertions(+) diff --git a/integration/cli-elements-universal/src/app/app.component.spec.ts b/integration/cli-elements-universal/src/app/app.component.spec.ts index b3ce4ffd7df..c9feb4d1cc1 100644 --- a/integration/cli-elements-universal/src/app/app.component.spec.ts +++ b/integration/cli-elements-universal/src/app/app.component.spec.ts @@ -36,6 +36,7 @@ describe('AppComponent', () => { @Component({ selector: 'app-title-ce', template: '', + standalone: false, }) class TestTitleComponent { @Input() appName = ''; diff --git a/integration/cli-elements-universal/src/app/app.component.ts b/integration/cli-elements-universal/src/app/app.component.ts index 6a2d21bfd2c..2b0d7b431fc 100644 --- a/integration/cli-elements-universal/src/app/app.component.ts +++ b/integration/cli-elements-universal/src/app/app.component.ts @@ -3,6 +3,7 @@ import {Component} from '@angular/core'; @Component({ selector: 'app-root', template: '', + standalone: false, }) export class AppComponent { title = 'cli-elements-universal'; diff --git a/integration/cli-elements-universal/src/app/title.component.ts b/integration/cli-elements-universal/src/app/title.component.ts index ab0eb80ebde..b46ca3bc923 100644 --- a/integration/cli-elements-universal/src/app/title.component.ts +++ b/integration/cli-elements-universal/src/app/title.component.ts @@ -3,6 +3,7 @@ import {Component, Input} from '@angular/core'; @Component({ selector: 'app-title', template: '

{{ appName }} app is running!

', + standalone: false, }) export class TitleComponent { @Input() appName = 'Unknown'; diff --git a/integration/cli-hello-world-ivy-i18n/src/app/app.component.ts b/integration/cli-hello-world-ivy-i18n/src/app/app.component.ts index e1f091d019b..fa132f3a977 100644 --- a/integration/cli-hello-world-ivy-i18n/src/app/app.component.ts +++ b/integration/cli-hello-world-ivy-i18n/src/app/app.component.ts @@ -3,6 +3,7 @@ import {Component, Inject, LOCALE_ID} from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', + standalone: false, }) export class AppComponent { constructor(@Inject(LOCALE_ID) public locale: string) {} diff --git a/integration/cli-hello-world-mocha/src/app/app.component.ts b/integration/cli-hello-world-mocha/src/app/app.component.ts index 2aa776389f2..ff6ebf80023 100644 --- a/integration/cli-hello-world-mocha/src/app/app.component.ts +++ b/integration/cli-hello-world-mocha/src/app/app.component.ts @@ -4,6 +4,7 @@ import {Component} from '@angular/core'; selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], + standalone: false, }) export class AppComponent { title = 'cli-hello-world'; diff --git a/integration/cli-hello-world/src/app/app.component.ts b/integration/cli-hello-world/src/app/app.component.ts index 2aa776389f2..ff6ebf80023 100644 --- a/integration/cli-hello-world/src/app/app.component.ts +++ b/integration/cli-hello-world/src/app/app.component.ts @@ -4,6 +4,7 @@ import {Component} from '@angular/core'; selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], + standalone: false, }) export class AppComponent { title = 'cli-hello-world'; diff --git a/integration/dynamic-compiler/src/app.component.ts b/integration/dynamic-compiler/src/app.component.ts index 294b0da541d..89c2045beb0 100644 --- a/integration/dynamic-compiler/src/app.component.ts +++ b/integration/dynamic-compiler/src/app.component.ts @@ -6,6 +6,7 @@ import {AfterViewInit, Compiler, Component, ViewChild, ViewContainerRef} from '@

Hello world!

`, + standalone: false, }) export class AppComponent implements AfterViewInit { @ViewChild('vc', {read: ViewContainerRef}) container: ViewContainerRef; diff --git a/integration/dynamic-compiler/src/lazy.module.ts b/integration/dynamic-compiler/src/lazy.module.ts index 42346ec196c..6327cf8d8c6 100644 --- a/integration/dynamic-compiler/src/lazy.module.ts +++ b/integration/dynamic-compiler/src/lazy.module.ts @@ -4,6 +4,7 @@ import {NgModule, Component} from '@angular/core'; selector: 'lazy-component', template: 'Lazy-loaded component!', jit: true, + standalone: false, }) export class LazyComponent {} diff --git a/integration/forms/src/app/app.component.ts b/integration/forms/src/app/app.component.ts index be46689e6d6..9f48cb8bf08 100644 --- a/integration/forms/src/app/app.component.ts +++ b/integration/forms/src/app/app.component.ts @@ -28,6 +28,7 @@ import {FormArray, FormBuilder, FormControl, FormGroup, Validators} from '@angul `, + standalone: false, }) export class TemplateFormsComponent { name = {first: 'Nancy', last: 'Drew', subscribed: true}; @@ -68,6 +69,7 @@ export class TemplateFormsComponent { `, + standalone: false, }) export class ReactiveFormsComponent { profileForm!: FormGroup; @@ -109,5 +111,6 @@ export class ReactiveFormsComponent { @Component({ selector: 'app-root', templateUrl: './app.component.html', + standalone: false, }) export class AppComponent {} diff --git a/integration/injectable-def/src/app.ts b/integration/injectable-def/src/app.ts index a5005b43bac..86683641d07 100644 --- a/integration/injectable-def/src/app.ts +++ b/integration/injectable-def/src/app.ts @@ -6,6 +6,7 @@ import {Lib2Module} from 'lib2_built'; @Component({ selector: 'test-app', template: '', + standalone: false, }) export class TestApp {} diff --git a/integration/injectable-def/src/lib2.ts b/integration/injectable-def/src/lib2.ts index ebf7ce9bdd4..9b813a7baf8 100644 --- a/integration/injectable-def/src/lib2.ts +++ b/integration/injectable-def/src/lib2.ts @@ -4,6 +4,7 @@ import {Lib1Module, Service} from 'lib1_built'; @Component({ selector: 'test-cmp', template: '{{instance1}}:{{instance2}}', + standalone: false, }) export class TestCmp { instance1: number; diff --git a/integration/ivy-i18n/src/app/app.component.ts b/integration/ivy-i18n/src/app/app.component.ts index f1b6804a69a..9940fbd90e2 100644 --- a/integration/ivy-i18n/src/app/app.component.ts +++ b/integration/ivy-i18n/src/app/app.component.ts @@ -4,6 +4,7 @@ import {Component, Inject, LOCALE_ID} from '@angular/core'; selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], + standalone: false, }) export class AppComponent { constructor(@Inject(LOCALE_ID) public locale: string) {} diff --git a/integration/ng-add-localize/src/app/app.component.ts b/integration/ng-add-localize/src/app/app.component.ts index 9a2dac41ab8..391875b670a 100644 --- a/integration/ng-add-localize/src/app/app.component.ts +++ b/integration/ng-add-localize/src/app/app.component.ts @@ -26,6 +26,7 @@ import {Component} from '@angular/core'; `, styles: [], + standalone: false, }) export class AppComponent { title = $localize`ng-add-localize`; diff --git a/integration/ng_elements/src/elements.ts b/integration/ng_elements/src/elements.ts index 28879505fc0..963ea000e7c 100644 --- a/integration/ng_elements/src/elements.ts +++ b/integration/ng_elements/src/elements.ts @@ -3,6 +3,7 @@ import {ChangeDetectionStrategy, Component, Input, ViewEncapsulation} from '@ang @Component({ selector: 'hello-world-el', template: 'Hello {{name}}!', + standalone: false, }) export class HelloWorldComponent { @Input() name: string = 'World'; @@ -12,6 +13,7 @@ export class HelloWorldComponent { selector: 'hello-world-onpush-el', template: 'Hello {{name}}!', changeDetection: ChangeDetectionStrategy.OnPush, + standalone: false, }) export class HelloWorldOnpushComponent { @Input() name: string = 'World'; @@ -21,6 +23,7 @@ export class HelloWorldOnpushComponent { selector: 'hello-world-shadow-el', template: 'Hello {{name}}!', encapsulation: ViewEncapsulation.ShadowDom, + standalone: false, }) export class HelloWorldShadowComponent { @Input() name: string = 'World'; @@ -37,5 +40,6 @@ export class HelloWorldShadowComponent { `, encapsulation: ViewEncapsulation.ShadowDom, + standalone: false, }) export class TestCardComponent {} diff --git a/integration/ng_update_migrations/src/app/app.component.ts b/integration/ng_update_migrations/src/app/app.component.ts index dd325a7812e..fbad1c92137 100644 --- a/integration/ng_update_migrations/src/app/app.component.ts +++ b/integration/ng_update_migrations/src/app/app.component.ts @@ -4,6 +4,7 @@ import {Component} from '@angular/core'; selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.less'], + standalone: false, }) export class AppComponent { title = 'ng-update-migrations'; diff --git a/integration/platform-server/projects/ngmodule/src/app/app.component.ts b/integration/platform-server/projects/ngmodule/src/app/app.component.ts index 894c1a636d7..6a346c4a551 100644 --- a/integration/platform-server/projects/ngmodule/src/app/app.component.ts +++ b/integration/platform-server/projects/ngmodule/src/app/app.component.ts @@ -3,5 +3,6 @@ import {Component} from '@angular/core'; @Component({ selector: 'app-root', template: '', + standalone: false, }) export class AppComponent {} diff --git a/integration/platform-server/projects/ngmodule/src/app/helloworld/hello-world.component.ts b/integration/platform-server/projects/ngmodule/src/app/helloworld/hello-world.component.ts index 6ca4dc69e2e..907972d9a45 100644 --- a/integration/platform-server/projects/ngmodule/src/app/helloworld/hello-world.component.ts +++ b/integration/platform-server/projects/ngmodule/src/app/helloworld/hello-world.component.ts @@ -20,6 +20,7 @@ import {Component} from '@angular/core'; } `, ], + standalone: false, }) export class HelloWorldComponent { name: string = 'world'; diff --git a/integration/platform-server/projects/ngmodule/src/app/http-transferstate-lazy-on-init/http-transferstate-lazy-on-init.component.ts b/integration/platform-server/projects/ngmodule/src/app/http-transferstate-lazy-on-init/http-transferstate-lazy-on-init.component.ts index f2af6929d60..f319789e9a4 100644 --- a/integration/platform-server/projects/ngmodule/src/app/http-transferstate-lazy-on-init/http-transferstate-lazy-on-init.component.ts +++ b/integration/platform-server/projects/ngmodule/src/app/http-transferstate-lazy-on-init/http-transferstate-lazy-on-init.component.ts @@ -12,6 +12,7 @@ import {Component, OnInit} from '@angular/core'; @Component({ selector: 'transfer-state-http-on-init', template: `
{{ responseOne }}
`, + standalone: false, }) export class TransferStateComponentOnInit implements OnInit { responseOne: string = ''; diff --git a/integration/platform-server/projects/ngmodule/src/app/http-transferstate-lazy/http-transfer-state.component.ts b/integration/platform-server/projects/ngmodule/src/app/http-transferstate-lazy/http-transfer-state.component.ts index 532a30ec5ec..c2d91c8b624 100644 --- a/integration/platform-server/projects/ngmodule/src/app/http-transferstate-lazy/http-transfer-state.component.ts +++ b/integration/platform-server/projects/ngmodule/src/app/http-transferstate-lazy/http-transfer-state.component.ts @@ -15,6 +15,7 @@ import {Component, OnInit} from '@angular/core';
{{ responseOne }}
{{ responseTwo }}
`, + standalone: false, }) export class TransferStateComponent implements OnInit { responseOne: string = ''; diff --git a/integration/platform-server/projects/ngmodule/src/app/transferstate/transfer-state.component.ts b/integration/platform-server/projects/ngmodule/src/app/transferstate/transfer-state.component.ts index 47e252ed512..13f8c189b05 100644 --- a/integration/platform-server/projects/ngmodule/src/app/transferstate/transfer-state.component.ts +++ b/integration/platform-server/projects/ngmodule/src/app/transferstate/transfer-state.component.ts @@ -14,6 +14,7 @@ const COUNTER_KEY = makeStateKey('counter'); @Component({ selector: 'transfer-state', template: `
{{ counter }}
`, + standalone: false, }) export class TransferStateComponent { counter = 0; diff --git a/integration/trusted-types/src/app/app.component.ts b/integration/trusted-types/src/app/app.component.ts index c16b215e0a9..dea094c7ee1 100644 --- a/integration/trusted-types/src/app/app.component.ts +++ b/integration/trusted-types/src/app/app.component.ts @@ -5,6 +5,7 @@ import {DomSanitizer, SafeHtml, SafeResourceUrl} from '@angular/platform-browser selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], + standalone: false, }) export class AppComponent { title = 'trusted-types';