Skip to content

Commit d1e911a

Browse files
authored
feat: angular v20 and NX v21 (#1534)
1 parent 6f19745 commit d1e911a

File tree

567 files changed

+28170
-22649
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

567 files changed

+28170
-22649
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ junit.xml
2222
**/.cache**/
2323

2424
.nx/cache
25-
.nx/workspace-data
25+
.nx/workspace-data
26+
.cursor/rules/nx-rules.mdc
27+
.github/instructions/nx.instructions.md

.global/integration-app.style.scss

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,35 @@
11
@use '@angular/material' as mat;
22

3-
$theme: mat.define-theme(
3+
@include mat.core();
4+
5+
$ng-app-variable-primary: mat.m2-define-palette(mat.$m2-indigo-palette);
6+
$ng-app-variable-accent: mat.m2-define-palette(mat.$m2-pink-palette, A200, A100, A400);
7+
$ng-app-variable-warn: mat.m2-define-palette(mat.$m2-red-palette);
8+
9+
$ng-app-variable-theme: mat.m2-define-light-theme(
410
(
511
color: (
6-
theme-type: dark,
7-
primary: mat.$violet-palette,
8-
),
9-
typography: (
10-
brand-family: 'Comic Sans',
11-
bold-weight: 900,
12-
),
13-
density: (
14-
scale: -1,
12+
primary: $ng-app-variable-primary,
13+
accent: $ng-app-variable-accent,
14+
warn: $ng-app-variable-warn,
1515
),
16+
typography: mat.m2-define-typography-config(),
17+
density: -1,
1618
)
1719
);
1820

19-
@include mat.core();
21+
@include mat.all-component-themes($ng-app-variable-theme);
22+
@include mat.typography-hierarchy($ng-app-variable-theme);
23+
@include mat.form-field-density(-4);
2024

2125
html,
2226
body {
2327
height: 100%;
24-
25-
@include mat.core-theme($theme);
26-
@include mat.button-theme($theme);
27-
@include mat.core-color($theme);
28-
@include mat.button-color($theme);
2928
}
3029

3130
body {
3231
margin: 0;
33-
font-family:
34-
pfhighway,
35-
-apple-system,
36-
BlinkMacSystemFont,
37-
Segoe UI,
38-
Roboto,
39-
Helvetica,
40-
Arial,
41-
sans-serif;
32+
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
4233
}
4334

4435
a {
@@ -54,9 +45,11 @@ a {
5445
}
5546

5647
.dashboard__menu {
57-
background: rgb(24, 75, 170);
58-
color: #fff;
59-
width: 300px;
48+
--mat-sidenav-container-background-color: rgb(24, 75, 170);
49+
--mat-sidenav-container-text-color: #fff;
50+
--mat-sidenav-container-width: 300px;
51+
--mat-toolbar-container-background-color: var(--mat-sidenav-container-background-color);
52+
--mat-toolbar-container-text-color: var(--mat-sidenav-container-text-color);
6053
}
6154

6255
.title {
@@ -95,7 +88,7 @@ a {
9588
color: red;
9689
}
9790

98-
.spinner.mat-progress-spinner {
91+
.spinner.mat-mdc-progress-spinner {
9992
position: absolute;
10093
right: 0;
10194
}
@@ -124,7 +117,7 @@ code {
124117
}
125118

126119
.mat-divider {
127-
border-top-color: rgba(241, 232, 232, 0.12);
120+
--mat-divider-color: rgba(241, 232, 232, 0.12);
128121
width: 80%;
129122
margin: 0 auto !important;
130123
}

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ found in the Angular.
1010

1111
---
1212

13+
### Migration to v19
14+
15+
Check out the [migration guide](docs/introduction/migration-v19.md) when migrating to `v19` from `v18` or earlier.
16+
17+
### Compatiblity
18+
19+
| Angular | cdk / ngxs | Standalone Components |
20+
| ------- | ---------- | --------------------- |
21+
| 20+ | 19 | ✔️ |
22+
| 18+ | 18 ||
23+
24+
### Packages
25+
1326
| **Package** | **Version** | **README** | **Downloads** |
1427
| -------------------------------------------------------------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
1528
| [@angular-ru/cdk](https://npmjs.com/package/@angular-ru/cdk) | ![](https://img.shields.io/npm/v/%40angular-ru%2Fcdk/latest.svg) | [![](https://img.shields.io/badge/Documentation--green.svg)](https://angular-ru.gitbook.io/sdk/cdk) | [![](https://img.shields.io/npm/dw/@angular-ru/cdk)](https://npmjs.com/package/@angular-ru/cdk) |

apps/cdk-demo/main.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
import {enableProdMode} from '@angular/core';
2-
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
1+
import {bootstrapApplication} from '@angular/platform-browser';
32

4-
import {environment} from './environments/environment';
5-
import {AppModule} from './src/app.module';
3+
import {AppComponent} from './src/app.component';
4+
import {appConfig} from './src/app.config';
65

7-
if (environment.production) {
8-
enableProdMode();
9-
}
10-
11-
platformBrowserDynamic()
12-
.bootstrapModule(AppModule, {ngZoneEventCoalescing: true})
13-
.catch((error: Error): void => console.error(error));
6+
bootstrapApplication(AppComponent, appConfig).catch((error: unknown) =>
7+
console.error(error),
8+
);

apps/cdk-demo/polyfills.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

apps/cdk-demo/project.json

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,59 +6,58 @@
66
"tags": ["apps"],
77
"targets": {
88
"build": {
9-
"executor": "@angular-devkit/build-angular:browser",
9+
"executor": "@angular/build:application",
1010
"options": {
11-
"outputPath": "dist/cdk-demo",
12-
"tsConfig": "apps/cdk-demo/tsconfig.app.json",
13-
"main": "apps/cdk-demo/main.ts",
11+
"outputPath": {
12+
"base": "dist/cdk-demo",
13+
"browser": ""
14+
},
1415
"index": "apps/cdk-demo/index.html",
16+
"browser": "apps/cdk-demo/main.ts",
17+
"tsConfig": "apps/cdk-demo/tsconfig.app.json",
18+
"inlineStyleLanguage": "scss",
1519
"assets": ["apps/cdk-demo/assets"],
16-
"polyfills": "apps/cdk-demo/polyfills.ts",
1720
"styles": [".global/integration-app.style.scss", "apps/cdk-demo/styles.scss"],
18-
"aot": false,
19-
"vendorChunk": true,
20-
"extractLicenses": false,
21-
"buildOptimizer": false,
22-
"sourceMap": true,
23-
"optimization": false,
24-
"namedChunks": true
21+
"scripts": [],
22+
"stylePreprocessorOptions": {
23+
"includePaths": ["./src"],
24+
"sass": {
25+
"silenceDeprecations": ["import"]
26+
}
27+
}
2528
},
2629
"configurations": {
2730
"production": {
28-
"fileReplacements": [
31+
"budgets": [
2932
{
30-
"replace": "apps/cdk-demo/environments/environment.ts",
31-
"with": "apps/cdk-demo/environments/environment.prod.ts"
33+
"type": "initial",
34+
"maximumWarning": "1mb",
35+
"maximumError": "2mb"
36+
},
37+
{
38+
"type": "anyComponentStyle",
39+
"maximumWarning": "6kb"
3240
}
3341
],
34-
"optimization": true,
3542
"outputHashing": "all",
36-
"sourceMap": false,
37-
"namedChunks": false,
38-
"aot": true,
39-
"extractLicenses": true,
40-
"buildOptimizer": true
41-
},
42-
"development": {
4343
"fileReplacements": [
4444
{
4545
"replace": "apps/cdk-demo/environments/environment.ts",
4646
"with": "apps/cdk-demo/environments/environment.prod.ts"
4747
}
48-
],
48+
]
49+
},
50+
"development": {
4951
"optimization": false,
50-
"outputHashing": "all",
51-
"aot": true
52+
"extractLicenses": false,
53+
"sourceMap": true
5254
}
5355
},
5456
"defaultConfiguration": "production",
55-
"outputs": ["{projectRoot}/dist/cdk-demo"]
57+
"outputs": ["{options.outputPath}"]
5658
},
5759
"serve": {
58-
"executor": "@angular-devkit/build-angular:dev-server",
59-
"options": {
60-
"buildTarget": "cdk-demo:build"
61-
},
60+
"executor": "@angular/build:dev-server",
6261
"configurations": {
6362
"production": {
6463
"buildTarget": "cdk-demo:build:production"

apps/cdk-demo/src/app-routing.module.ts

Lines changed: 0 additions & 37 deletions
This file was deleted.

apps/cdk-demo/src/app.component.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
import {ChangeDetectionStrategy, Component} from '@angular/core';
2+
import {MatDivider, MatList, MatListItem} from '@angular/material/list';
3+
import {MatDrawer, MatDrawerContainer, MatDrawerContent} from '@angular/material/sidenav';
4+
import {MatToolbar} from '@angular/material/toolbar';
5+
import {RouterLink, RouterOutlet} from '@angular/router';
26

37
@Component({
48
selector: 'app-root',
9+
imports: [
10+
MatDivider,
11+
MatDrawer,
12+
MatDrawerContainer,
13+
MatDrawerContent,
14+
MatList,
15+
MatListItem,
16+
MatToolbar,
17+
RouterLink,
18+
RouterOutlet,
19+
],
520
templateUrl: './app.component.html',
621
changeDetection: ChangeDetectionStrategy.OnPush,
722
})

apps/cdk-demo/src/app.config.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import type {ApplicationConfig} from '@angular/core';
2+
import {
3+
provideBrowserGlobalErrorListeners,
4+
provideZonelessChangeDetection,
5+
} from '@angular/core';
6+
import {provideAnimationsAsync} from '@angular/platform-browser/animations/async';
7+
import {
8+
PreloadAllModules,
9+
provideRouter,
10+
withComponentInputBinding,
11+
withHashLocation,
12+
withInMemoryScrolling,
13+
withPreloading,
14+
withRouterConfig,
15+
} from '@angular/router';
16+
import {provideAmountFormat} from '@angular-ru/cdk/directives';
17+
18+
import {routes} from './app.routes';
19+
20+
export const appConfig: ApplicationConfig = {
21+
providers: [
22+
provideZonelessChangeDetection(),
23+
provideBrowserGlobalErrorListeners(),
24+
provideRouter(
25+
routes,
26+
withPreloading(PreloadAllModules),
27+
withRouterConfig({
28+
paramsInheritanceStrategy: 'always',
29+
}),
30+
withComponentInputBinding(),
31+
withInMemoryScrolling({
32+
scrollPositionRestoration: 'enabled',
33+
}),
34+
withHashLocation(),
35+
),
36+
provideAnimationsAsync(),
37+
provideAmountFormat(),
38+
],
39+
};

apps/cdk-demo/src/app.module.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)