Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add Angular 19 support #2269

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,19 @@ jobs:
paths:
- app/integrations/hello-world-ng18/dist-integration

integration_ng19_tests:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This job needs to be added to the build-workflow.

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

integration_test_types:
<<: *job_defaults
steps:
Expand Down Expand Up @@ -267,6 +280,10 @@ workflows:
requires:
- build

- integration_ng19_tests:
requires:
- build

- integration_test_types:
requires:
- build
Expand Down
1 change: 1 addition & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ runs:
./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
1 change: 1 addition & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ jobs:
- 'integration:ng16'
- 'integration:ng17'
- 'integration:ng18'
- 'integration:ng19'
- 'test:types'

steps:
Expand Down
42 changes: 42 additions & 0 deletions integrations/hello-world-ng19/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db
112 changes: 112 additions & 0 deletions integrations/hello-world-ng19/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ng19-test": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"inlineTemplate": true,
"inlineStyle": true,
"style": "scss",
"skipTests": true
},
"@schematics/angular:class": {
"skipTests": true
},
"@schematics/angular:directive": {
"skipTests": true
},
"@schematics/angular:guard": {
"skipTests": true
},
"@schematics/angular:interceptor": {
"skipTests": true
},
"@schematics/angular:pipe": {
"skipTests": true
},
"@schematics/angular:resolver": {
"skipTests": true
},
"@schematics/angular:service": {
"skipTests": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": {
"base": "dist-integration"
},
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": ["src/styles.scss"],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kB",
"maximumError": "1MB"
},
{
"type": "anyComponentStyle",
"maximumWarning": "4kB",
"maximumError": "8kB"
}
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "ng19-test:build:production"
},
"development": {
"buildTarget": "ng19-test:build:development"
}
},
"defaultConfiguration": "development"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"scripts": []
}
}
}
}
}
}
17 changes: 17 additions & 0 deletions integrations/hello-world-ng19/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { defineConfig } from 'cypress';

export default defineConfig({
video: false,
responseTimeout: 60000,
pageLoadTimeout: 120000,
e2e: {
supportFile: false,
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config);
},
baseUrl: 'http://localhost:4200',
excludeSpecPattern: ['**/plugins/**.js', '**/tsconfig.json']
}
});
15 changes: 15 additions & 0 deletions integrations/hello-world-ng19/cypress/e2e/index-page.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
describe('Index page', () => {
beforeEach(() => cy.visit('/'));

it('should render application using the latest version', () => {
// Arrange & act & assert
// Expect that the running applicaiton was compiled
// with the necessary Angular version!
cy.get('app-root').invoke('attr', 'ng-version').should('have.string', '19');
});

it('should click on the button and increase the counter', () => {
// Arrange & act & assert
cy.get('button').click().click().click().get('p').should('contain.text', 'Counter is 3');
});
});
5 changes: 5 additions & 0 deletions integrations/hello-world-ng19/cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]",
"body": "Fixtures are a great way to mock data for responses to routes"
}
17 changes: 17 additions & 0 deletions integrations/hello-world-ng19/cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
};
11 changes: 11 additions & 0 deletions integrations/hello-world-ng19/cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"sourceMap": false,
"declaration": false,
"moduleResolution": "node",
"types": ["node", "cypress"],
"typeRoots": ["../node_modules/@types"],
"lib": ["es2017", "dom"]
},
"include": ["e2e/*.ts", "support/*.ts", "../node_modules/cypress"]
}
47 changes: 47 additions & 0 deletions integrations/hello-world-ng19/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = config => {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/ng18'),
subdir: '.',
reporters: [{ type: 'html' }, { type: 'text-summary' }]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
},
restartOnFileChange: true
});
};
59 changes: 59 additions & 0 deletions integrations/hello-world-ng19/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "hello-world-ng19",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start-test": "start-server-and-test",
"start": "ng serve",
"build": "ng build",
"build:prod": "ng build --configuration production",
"test": "ng test",
"test:ci": "ng test --no-watch --no-progress --browsers=ChromeHeadlessCI --source-map=false",
"test:integration": "yarn install:ci && yarn test:ci && yarn build:prod && yarn e2e:ci",
"preinstall": "yarn --cwd ../../ cpx -v -C \"@ngxs/**/*\" integrations/hello-world-ng19/node_modules/@ngxs",
"install:ci": "yarn --frozen-lockfile --non-interactive --no-progress",
"cy:open": "cypress open",
"cy:run": "cypress run",
"cy:run:ssr": "cypress run --spec=cypress/integration-ssr/*.ts",
"serve:integration:static": "serve dist-integration/browser -s -l 4200 --cors",
"e2e": "start-test serve:integration:static 4200 cy:open",
"e2e:ci": "start-test serve:integration:static 4200 cy:run"
},
"private": true,
"dependencies": {
"@angular/animations": "19.0.0",
"@angular/common": "19.0.0",
"@angular/compiler": "19.0.0",
"@angular/core": "19.0.0",
"@angular/forms": "19.0.0",
"@angular/platform-browser": "19.0.0",
"@angular/platform-browser-dynamic": "19.0.0",
"@angular/router": "19.0.0",
"@ngxs/devtools-plugin": "file:./node_modules/@ngxs/devtools-plugin",
"@ngxs/form-plugin": "file:./node_modules/@ngxs/form-plugin",
"@ngxs/logger-plugin": "file:./node_modules/@ngxs/logger-plugin",
"@ngxs/router-plugin": "file:./node_modules/@ngxs/router-plugin",
"@ngxs/storage-plugin": "file:./node_modules/@ngxs/storage-plugin",
"@ngxs/store": "file:./node_modules/@ngxs/store",
"@ngxs/websocket-plugin": "file:./node_modules/@ngxs/websocket-plugin",
"rxjs": "~7.8.1",
"tslib": "^2.6.2",
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "19.0.0",
"@angular/cli": "19.0.0",
"@angular/compiler-cli": "19.0.0",
"@types/jasmine": "~4.3.0",
"@types/node": "20.1.4",
"cypress": "file:../../node_modules/cypress",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"serve": "file:../../node_modules/serve",
"start-server-and-test": "file:../../node_modules/start-server-and-test",
"typescript": "~5.6.2"
}
}
Binary file not shown.
4 changes: 4 additions & 0 deletions integrations/hello-world-ng19/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<h1>Angular 19 Integration Test</h1>

<button (click)="increment()">Increment</button>
<p>Counter is {{ counter() }}</p>
Loading
Loading