-
Notifications
You must be signed in to change notification settings - Fork 405
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
arturovt
wants to merge
3
commits into
master
Choose a base branch
from
build/ng19
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": [] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
15
integrations/hello-world-ng19/cypress/e2e/index-page.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
.