Skip to content

Commit

Permalink
build: add Angular 19 support (#2269)
Browse files Browse the repository at this point in the history
* build: add Angular 19 support

* build: add job to circle

* chore: remove redundant module

* refactor: upgrade workspace and unit tests

* refactor: update `store` target unit tests

* refactor: fix `create-app` build (TS version upgrade)

* refactor: drop ng16 integration

* refactor: drop ng17 integration

* refactor: drop ng18 integration

* refactor: upgrade peer dep version

* refactor: address feedback

* refactor: remove redundant file
  • Loading branch information
arturovt authored Nov 29, 2024
1 parent d290a0e commit a9e7ff3
Show file tree
Hide file tree
Showing 153 changed files with 5,921 additions and 21,112 deletions.
44 changes: 5 additions & 39 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,44 +139,18 @@ jobs:
name: Run integration tests for the SSR build application
command: yarn test:ci:integration:ssr

integration_ng16_tests:
integration_ng19_tests:
<<: *job_defaults
steps:
- *attach_workspace
- browser-tools/install-browser-tools
- run:
name: Run integration tests for ng16 application
command: yarn integration:ng16
name: Run integration tests for ng19 application
command: yarn integration:ng19
- persist_to_workspace:
root: ~/workspace
paths:
- app/integrations/hello-world-ng16/dist-integration

integration_ng17_tests:
<<: *job_defaults
steps:
- *attach_workspace
- browser-tools/install-browser-tools
- run:
name: Run integration tests for ng17 application
command: yarn integration:ng17
- persist_to_workspace:
root: ~/workspace
paths:
- app/integrations/hello-world-ng17/dist-integration

integration_ng18_tests:
<<: *job_defaults
steps:
- *attach_workspace
- browser-tools/install-browser-tools
- run:
name: Run integration tests for ng18 application
command: yarn integration:ng18
- persist_to_workspace:
root: ~/workspace
paths:
- app/integrations/hello-world-ng18/dist-integration
- app/integrations/hello-world-ng19/dist-integration

integration_test_types:
<<: *job_defaults
Expand Down Expand Up @@ -255,15 +229,7 @@ workflows:
### requires:
### - build

- integration_ng16_tests:
requires:
- build

- integration_ng17_tests:
requires:
- build

- integration_ng18_tests:
- integration_ng19_tests:
requires:
- build

Expand Down
4 changes: 1 addition & 3 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ runs:
~/.cache
./node_modules
./@ngxs
./integrations/hello-world-ng16/dist-integration
./integrations/hello-world-ng17/dist-integration
./integrations/hello-world-ng18/dist-integration
./integrations/hello-world-ng19/dist-integration
key: ${{ runner.os }}-node-${{ inputs.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}-branch-${{ inputs.github-ref-name }}-sha-${{ inputs.github-sha }}
restore-keys: |
${{ runner.os }}-node-${{ inputs.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}-branch-${{ inputs.github-ref-name }}-sha-
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/upload-integration-test-artifact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
# - ./.github/actions/upload-integration-test-artifact

name: upload-integration-test-artifact
description: Upload an integration test artifact with a name such as 'hello-world-ng16'.
description: Upload an integration test artifact with a name such as 'hello-world-ng19'.

inputs:
script:
description: A script with a name such as 'integration:ng16' that generates an integration test artifact.
description: A script with a name such as 'integration:ng19' that generates an integration test artifact.
required: true

runs:
Expand All @@ -21,7 +21,7 @@ runs:
id: artifact-name
shell: bash
run: |
echo "Replace colons with dashes, substring 'integration' with a substring 'hello-world'. Example result: hello-world-ng16"
echo "Replace colons with dashes, substring 'integration' with a substring 'hello-world'. Example result: hello-world-ng19"
echo "value=$(echo ${SCRIPT} | sed -r "s/:/-/g" | sed -r "s/integration/hello-world/g")" >> $GITHUB_OUTPUT
env:
SCRIPT: ${{ inputs.script }}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ jobs:
strategy:
matrix:
script:
- 'integration:ng16'
- 'integration:ng17'
- 'integration:ng18'
- 'integration:ng19'
- 'test:types'

steps:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ jobs:
strategy:
matrix:
script:
- 'integration:ng16'
- 'integration:ng17'
- 'integration:ng18'
- 'test:types'

steps:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ jobs:
strategy:
matrix:
script:
- 'integration:ng16'
- 'integration:ng17'
- 'integration:ng18'
- 'test:types'

steps:
Expand Down
4 changes: 3 additions & 1 deletion integration/app/counter/counter.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { CommonModule } from '@angular/common';
import { Component, OnInit, Signal } from '@angular/core';
import { Store } from '@ngxs/store';
import { Observable } from 'rxjs';
Expand All @@ -7,7 +8,8 @@ import { CounterState, CounterStateModel } from '@integration/counter/counter.st

@Component({
selector: 'counter',
templateUrl: './counter.component.html'
templateUrl: './counter.component.html',
imports: [CommonModule]
})
export class CounterComponent implements OnInit {
counter$: Observable<CounterStateModel> = this._store.select(CounterState.getCounterState);
Expand Down
8 changes: 1 addition & 7 deletions integration/app/counter/counter.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,10 @@ import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';

import { routes } from '@integration/counter/counter.routes';
import { CounterComponent } from '@integration/counter/counter.component';
import { NgxsModule } from '@ngxs/store';
import { CounterState } from '@integration/counter/counter.state';

@NgModule({
imports: [
CommonModule,
RouterModule.forChild(routes),
NgxsModule.forFeature([CounterState])
],
declarations: [CounterComponent]
imports: [CommonModule, RouterModule.forChild(routes), NgxsModule.forFeature([CounterState])]
})
export class CounterModule {}
4 changes: 3 additions & 1 deletion integration/app/detail/detail.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { CommonModule } from '@angular/common';
import { Component, Signal } from '@angular/core';
import { Store } from '@ngxs/store';
import { Observable } from 'rxjs';
Expand All @@ -6,7 +7,8 @@ import { DetailState, DetailStateModel } from '@integration/detail/detail.state'

@Component({
selector: 'app-detail',
templateUrl: './detail.component.html'
templateUrl: './detail.component.html',
imports: [CommonModule]
})
export class DetailComponent {
detail$: Observable<DetailStateModel> = this._store.select(DetailState.getDetailState);
Expand Down
4 changes: 1 addition & 3 deletions integration/app/detail/detail.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { NgxsModule } from '@ngxs/store';

import { DetailComponent } from '@integration/detail/detail.component';
import { DetailState } from '@integration/detail/detail.state';
import { routes } from '@integration/detail/detail.routes';

@NgModule({
imports: [CommonModule, RouterModule.forChild(routes), NgxsModule.forFeature([DetailState])],
declarations: [DetailComponent]
imports: [CommonModule, RouterModule.forChild(routes), NgxsModule.forFeature([DetailState])]
})
export class DetailModule {}
4 changes: 3 additions & 1 deletion integration/app/list/list.component.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { CommonModule } from '@angular/common';
import { Component, Signal } from '@angular/core';
import { RouterStateSnapshot } from '@angular/router';
import { Store } from '@ngxs/store';
Expand All @@ -8,7 +9,8 @@ import { ListState } from '@integration/list/list.state';

@Component({
selector: 'app-list',
templateUrl: './list.component.html'
templateUrl: './list.component.html',
imports: [CommonModule]
})
export class ListComponent {
list$: Observable<string[]> = this._store.select(ListState.getListState);
Expand Down
2 changes: 0 additions & 2 deletions integration/app/list/list.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import { RouterModule } from '@angular/router';
import { NgxsModule } from '@ngxs/store';

import { ListState } from '@integration/list/list.state';
import { ListComponent } from '@integration/list/list.component';
import { routes } from '@integration/list/list.routes';
import { ListResolver } from '@integration/list/list.resolver';

@NgModule({
imports: [CommonModule, RouterModule.forChild(routes), NgxsModule.forFeature([ListState])],
declarations: [ListComponent],
providers: [ListResolver]
})
export class ListModule {}
96 changes: 0 additions & 96 deletions integrations/hello-world-ng16/angular.json

This file was deleted.

15 changes: 0 additions & 15 deletions integrations/hello-world-ng16/cypress/e2e/index-page.cy.ts

This file was deleted.

47 changes: 0 additions & 47 deletions integrations/hello-world-ng16/karma.conf.js

This file was deleted.

Loading

0 comments on commit a9e7ff3

Please sign in to comment.