-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add angular 17 support (#2079)
* build: add angular 17 support - extend allowed range of ng peer dependency to 18 - add an additional integration test for NG17 with updated dependencies and tests. - add additional test in all places the other tests run fixes #2078 * Update index.html to correct version number in the title * chore: regenerate yarn.lock * build: angular v17 support in websocket-plugin * chore: run CI on node 18 --------- Co-authored-by: Dmitriy Stepanenko <[email protected]>
- Loading branch information
1 parent
22a8ab1
commit 744e67c
Showing
44 changed files
with
10,026 additions
and
1,475 deletions.
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
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 http://help.github.com/ignore-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,96 @@ | ||
{ | ||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | ||
"version": 1, | ||
"newProjectRoot": "projects", | ||
"projects": { | ||
"hello-world-ng17": { | ||
"projectType": "application", | ||
"schematics": { | ||
"@schematics/angular:component": { | ||
"style": "scss" | ||
} | ||
}, | ||
"root": "", | ||
"sourceRoot": "src", | ||
"prefix": "app", | ||
"architect": { | ||
"build": { | ||
"builder": "@angular-devkit/build-angular:browser", | ||
"options": { | ||
"outputPath": "dist-integration", | ||
"index": "src/index.html", | ||
"main": "src/main.ts", | ||
"polyfills": ["zone.js"], | ||
"tsConfig": "tsconfig.app.json", | ||
"inlineStyleLanguage": "scss", | ||
"assets": ["src/favicon.ico", "src/assets"], | ||
"styles": ["src/styles.scss"], | ||
"scripts": [] | ||
}, | ||
"configurations": { | ||
"production": { | ||
"budgets": [ | ||
{ | ||
"type": "initial", | ||
"maximumWarning": "500kb", | ||
"maximumError": "1mb" | ||
}, | ||
{ | ||
"type": "anyComponentStyle", | ||
"maximumWarning": "2kb", | ||
"maximumError": "4kb" | ||
} | ||
], | ||
"fileReplacements": [ | ||
{ | ||
"replace": "src/environments/environment.ts", | ||
"with": "src/environments/environment.prod.ts" | ||
} | ||
], | ||
"outputHashing": "all" | ||
}, | ||
"development": { | ||
"buildOptimizer": false, | ||
"optimization": false, | ||
"vendorChunk": true, | ||
"extractLicenses": false, | ||
"sourceMap": true, | ||
"namedChunks": true | ||
} | ||
}, | ||
"defaultConfiguration": "production" | ||
}, | ||
"serve": { | ||
"builder": "@angular-devkit/build-angular:dev-server", | ||
"configurations": { | ||
"production": { | ||
"browserTarget": "hello-world-ng17:build:production" | ||
}, | ||
"development": { | ||
"browserTarget": "hello-world-ng17:build:development" | ||
} | ||
}, | ||
"defaultConfiguration": "development" | ||
}, | ||
"extract-i18n": { | ||
"builder": "@angular-devkit/build-angular:extract-i18n", | ||
"options": { | ||
"browserTarget": "hello-world-ng17:build" | ||
} | ||
}, | ||
"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-ng17/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', '17'); | ||
}); | ||
|
||
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/ng17'), | ||
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,61 @@ | ||
{ | ||
"name": "hello-world-ng17", | ||
"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-ng17/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 -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": "17.0.0", | ||
"@angular/common": "17.0.0", | ||
"@angular/compiler": "17.0.0", | ||
"@angular/core": "17.0.0", | ||
"@angular/forms": "17.0.0", | ||
"@angular/platform-browser": "17.0.0", | ||
"@angular/platform-browser-dynamic": "17.0.0", | ||
"@angular/platform-server": "17.0.0", | ||
"@angular/router": "17.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.14.2" | ||
}, | ||
"devDependencies": { | ||
"@angular-devkit/build-angular": "17.0.0", | ||
"@angular/cli": "17.0.0", | ||
"@angular/compiler-cli": "17.0.0", | ||
"@types/jasmine": "~4.3.0", | ||
"@types/node": "20.1.4", | ||
"cypress": "file:../../node_modules/cypress", | ||
"jasmine-core": "~4.5.0", | ||
"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.2.2" | ||
} | ||
} |
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 17 Integration Test</h1> | ||
|
||
<button (click)="increment()">Increment</button> | ||
<p>Counter is {{ counter$ | async }}</p> |
Oops, something went wrong.