-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: Angular 18 support
- Loading branch information
Showing
26 changed files
with
3,164 additions
and
2,431 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# V18 | ||
|
||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 18.0.7. | ||
|
||
## Development server | ||
|
||
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. | ||
|
||
## Code scaffolding | ||
|
||
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. | ||
|
||
## Build | ||
|
||
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. | ||
|
||
## Running unit tests | ||
|
||
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). | ||
|
||
## Running end-to-end tests | ||
|
||
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. | ||
|
||
## Further help | ||
|
||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page. |
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,124 @@ | ||
{ | ||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | ||
"version": 1, | ||
"cli": { | ||
"packageManager": "yarn" | ||
}, | ||
"newProjectRoot": "projects", | ||
"projects": { | ||
"v18": { | ||
"projectType": "application", | ||
"schematics": { | ||
"@schematics/angular:class": { | ||
"skipTests": true | ||
}, | ||
"@schematics/angular:component": { | ||
"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": "dist/v18", | ||
"index": "src/index.html", | ||
"browser": "src/main.ts", | ||
"polyfills": [ | ||
"zone.js" | ||
], | ||
"tsConfig": "tsconfig.app.json", | ||
"assets": [ | ||
{ | ||
"glob": "**/*", | ||
"input": "public" | ||
} | ||
], | ||
"styles": [ | ||
"src/styles.css" | ||
], | ||
"scripts": [] | ||
}, | ||
"configurations": { | ||
"production": { | ||
"budgets": [ | ||
{ | ||
"type": "initial", | ||
"maximumWarning": "500kB", | ||
"maximumError": "1MB" | ||
}, | ||
{ | ||
"type": "anyComponentStyle", | ||
"maximumWarning": "2kB", | ||
"maximumError": "4kB" | ||
} | ||
], | ||
"outputHashing": "all" | ||
}, | ||
"development": { | ||
"optimization": false, | ||
"extractLicenses": false, | ||
"sourceMap": true | ||
} | ||
}, | ||
"defaultConfiguration": "production" | ||
}, | ||
"serve": { | ||
"builder": "@angular-devkit/build-angular:dev-server", | ||
"configurations": { | ||
"production": { | ||
"buildTarget": "v18:build:production" | ||
}, | ||
"development": { | ||
"buildTarget": "v18:build:development" | ||
} | ||
}, | ||
"defaultConfiguration": "development" | ||
}, | ||
"extract-i18n": { | ||
"builder": "@angular-devkit/build-angular:extract-i18n" | ||
}, | ||
"test": { | ||
"builder": "@angular-devkit/build-angular:karma", | ||
"options": { | ||
"polyfills": [ | ||
"zone.js", | ||
"zone.js/testing" | ||
], | ||
"tsConfig": "tsconfig.spec.json", | ||
"assets": [ | ||
{ | ||
"glob": "**/*", | ||
"input": "public" | ||
} | ||
], | ||
"styles": [ | ||
"src/styles.css" | ||
], | ||
"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,10 @@ | ||
import { defineConfig } from 'cypress'; | ||
|
||
export default defineConfig({ | ||
video: false, | ||
e2e: { | ||
setupNodeEvents(on, config) {}, | ||
baseUrl: 'http://localhost:4000', | ||
supportFile: false | ||
}, | ||
}) |
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,69 @@ | ||
describe('Angular app', () => { | ||
beforeEach(() => { | ||
window.sessionStorage.clear(); | ||
}); | ||
|
||
it('loads', () => { | ||
cy.visit(''); | ||
}); | ||
|
||
it('loads home state by default', () => { | ||
cy.visit(''); | ||
cy.url().should('include', '/home'); | ||
}); | ||
|
||
it('renders uisref as links', () => { | ||
cy.visit(''); | ||
cy.get('a').contains('home'); | ||
cy.get('a').contains('about'); | ||
cy.get('a').contains('lazy'); | ||
cy.get('a').contains('lazy.child'); | ||
cy.get('a').contains('lazy.child.viewtarget'); | ||
}); | ||
|
||
it('renders home', () => { | ||
cy.visit('/home'); | ||
cy.get('a').contains('home').should('have.class', 'active'); | ||
cy.get('a').contains('about').should('not.have.class', 'active'); | ||
cy.get('#default').contains('home works'); | ||
}); | ||
|
||
it('renders about', () => { | ||
cy.visit('/home'); | ||
cy.visit('/about'); | ||
cy.get('a').contains('home').should('not.have.class', 'active'); | ||
cy.get('a').contains('about').should('have.class', 'active'); | ||
cy.get('#default').contains('about works'); | ||
}); | ||
|
||
it('loads lazy routes', () => { | ||
cy.visit('/home'); | ||
cy.visit('/lazy'); | ||
cy.get('a').contains('home').should('not.have.class', 'active'); | ||
cy.get('a').contains('lazy').should('have.class', 'active'); | ||
cy.get('#default').contains('lazy works'); | ||
}); | ||
|
||
it('routes to lazy routes', () => { | ||
cy.visit('/lazy'); | ||
cy.get('a').contains('home').should('not.have.class', 'active'); | ||
cy.get('a').contains('lazy').should('have.class', 'active'); | ||
cy.get('#default').contains('lazy works'); | ||
}); | ||
|
||
it('routes to lazy child routes', () => { | ||
cy.visit('/lazy/child'); | ||
cy.get('a').contains('home').should('not.have.class', 'active'); | ||
cy.get('a').contains('lazy.child').should('have.class', 'active'); | ||
cy.get('#default').contains('lazy.child works'); | ||
}); | ||
|
||
it('targets named views', () => { | ||
cy.visit('/lazy/child/viewtarget'); | ||
cy.get('a').contains('home').should('not.have.class', 'active'); | ||
cy.get('a').contains('lazy.child').should('have.class', 'active'); | ||
cy.get('#default').contains('lazy.child works'); | ||
cy.get('#header').contains('lazy.child.viewtarget works'); | ||
cy.get('#footer').contains('lazy.child.viewtarget works'); | ||
}); | ||
}); |
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,50 @@ | ||
{ | ||
"name": "v18", | ||
"version": "0.0.0", | ||
"scripts": { | ||
"ng": "ng", | ||
"start": "ng serve", | ||
"build": "ng build", | ||
"watch": "ng build --watch --configuration development", | ||
"test": "npm run test:dev && npm run test:prod", | ||
"test:dev": "ng build --configuration development && cypress-runner run --path dist/v18/browser", | ||
"test:prod": "ng build --configuration production && cypress-runner run --path dist/v18/browser" | ||
}, | ||
"private": true, | ||
"dependencies": { | ||
"@angular/animations": "^18.0.0", | ||
"@angular/common": "^18.0.0", | ||
"@angular/compiler": "^18.0.0", | ||
"@angular/core": "^18.0.0", | ||
"@angular/forms": "^18.0.0", | ||
"@angular/platform-browser": "^18.0.0", | ||
"@angular/platform-browser-dynamic": "^18.0.0", | ||
"@angular/router": "^18.0.0", | ||
"rxjs": "~7.8.0", | ||
"tslib": "^2.3.0", | ||
"zone.js": "~0.14.3", | ||
"@uirouter/angular": "*", | ||
"@uirouter/cypress-runner": "*", | ||
"@uirouter/core": "*", | ||
"@uirouter/rx": "*" | ||
}, | ||
"devDependencies": { | ||
"@angular-devkit/build-angular": "^18.0.7", | ||
"@angular/cli": "^18.0.7", | ||
"@angular/compiler-cli": "^18.0.0", | ||
"@types/jasmine": "~5.1.0", | ||
"jasmine-core": "~5.1.0", | ||
"karma": "~6.4.0", | ||
"karma-chrome-launcher": "~3.2.0", | ||
"karma-coverage": "~2.2.0", | ||
"karma-jasmine": "~5.1.0", | ||
"karma-jasmine-html-reporter": "~2.1.0", | ||
"typescript": "~5.4.5" | ||
}, | ||
"checkPeerDependencies": { | ||
"ignore": [ | ||
"ajv", | ||
"terser" | ||
] | ||
} | ||
} |
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,8 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-about', | ||
template: ` <p>about works!</p> `, | ||
standalone: true, | ||
}) | ||
export class AboutComponent {} |
Empty file.
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,35 @@ | ||
import { Component } from '@angular/core'; | ||
import { UIRouterModule } from '@uirouter/angular'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
template: ` | ||
<ui-view name="header" id="header"></ui-view> | ||
<div class="app"> | ||
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg=="> | ||
<div> | ||
<a uiSref="home" uiSrefActive="active">home</a> | ||
<a uiSref="about" uiSrefActive="active">about</a> | ||
<a uiSref="lazy" uiSrefActiveEq="active">lazy</a> | ||
<a uiSref="lazy.child" uiSrefActive="active">lazy.child</a> | ||
<a uiSref="lazy.child.viewtarget" uiSrefActive="active">lazy.child.viewtarget</a> | ||
</div> | ||
<ui-view id="default"></ui-view> | ||
</div> | ||
<ui-view name="footer" id="footer"></ui-view> | ||
`, | ||
styles: [ | ||
` | ||
.app { | ||
text-align: center; | ||
border: 1px solid; | ||
} | ||
.active { | ||
font-weight: bold; | ||
} | ||
`, | ||
], | ||
standalone: true, | ||
imports: [UIRouterModule] | ||
}) | ||
export class AppComponent {} |
Oops, something went wrong.