Skip to content

Commit 43802a4

Browse files
feat: update angular template to latest version (#912)
1 parent 4e317ce commit 43802a4

File tree

11 files changed

+72
-58
lines changed

11 files changed

+72
-58
lines changed

.changes/angular-template-update.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"create-tauri-app": patch
3+
"create-tauri-app-js": patch
4+
---
5+
6+
updated angular template to v20

templates/template-angular/_gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# See http://help.github.com/ignore-files/ for more about ignoring files.
1+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
22

33
# Compiled output
44
/dist

templates/template-angular/angular.json.lte

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,43 @@
88
"projects": {
99
"{% package_name %}": {
1010
"projectType": "application",
11+
"schematics": {
12+
"@schematics/angular:component": {
13+
"style": "css"
14+
}
15+
},
1116
"root": "",
1217
"sourceRoot": "src",
1318
"prefix": "app",
1419
"architect": {
1520
"build": {
16-
"builder": "@angular-devkit/build-angular:application",
21+
"builder": "@angular/build:application",
1722
"options": {
18-
"outputPath": "dist/{% package_name %}",
19-
"index": "src/index.html",
2023
"browser": "src/main.ts",
2124
"polyfills": ["zone.js"],
2225
"tsConfig": "tsconfig.app.json",
23-
"assets": ["src/assets"]
26+
"inlineStyleLanguage": "scss",
27+
"assets": [
28+
{
29+
"glob": "**/*",
30+
"input": "src/assets",
31+
"output": "assets"
32+
}
33+
],
34+
"styles": ["src/styles.css"]
2435
},
2536
"configurations": {
2637
"production": {
2738
"budgets": [
2839
{
2940
"type": "initial",
30-
"maximumWarning": "500kb",
31-
"maximumError": "1mb"
41+
"maximumWarning": "500kB",
42+
"maximumError": "1MB"
3243
},
3344
{
3445
"type": "anyComponentStyle",
35-
"maximumWarning": "2kb",
36-
"maximumError": "4kb"
46+
"maximumWarning": "4kB",
47+
"maximumError": "8kB"
3748
}
3849
],
3950
"outputHashing": "all"
@@ -47,7 +58,7 @@
4758
"defaultConfiguration": "production"
4859
},
4960
"serve": {
50-
"builder": "@angular-devkit/build-angular:dev-server",
61+
"builder": "@angular/build:dev-server",
5162
"options": {
5263
"port": 1420
5364
},

templates/template-angular/package.json.lte

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,23 @@
1010
},
1111
"private": true,
1212
"dependencies": {
13-
"@angular/animations": "^17.0.0",
14-
"@angular/common": "^17.0.0",
15-
"@angular/compiler": "^17.0.0",
16-
"@angular/core": "^17.0.0",
17-
"@angular/forms": "^17.0.0",
18-
"@angular/platform-browser": "^17.0.0",
19-
"@angular/platform-browser-dynamic": "^17.0.0",
20-
"@angular/router": "^17.0.0",
21-
"rxjs": "~7.8.0",
22-
"tslib": "^2.3.0",
23-
"zone.js": "~0.14.2",
13+
"@angular/common": "^20.1.4",
14+
"@angular/compiler": "^20.1.4",
15+
"@angular/core": "^20.1.4",
16+
"@angular/forms": "^20.1.4",
17+
"@angular/platform-browser": "^20.1.4",
18+
"@angular/router": "^20.1.4",
19+
"rxjs": "~7.8.2",
20+
"tslib": "^2.8.1",
21+
"zone.js": "~0.15.1",
2422
"@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
2523
"@tauri-apps/plugin-opener": "^2"{% endif %}
2624
},
2725
"devDependencies": {
28-
"@angular-devkit/build-angular": "^17.0.0",
29-
"@angular/cli": "^17.0.0",
30-
"@angular/compiler-cli": "^17.0.0",
31-
"@types/jasmine": "~5.1.0",
32-
"jasmine-core": "~5.1.0",
33-
"karma": "~6.4.0",
34-
"karma-chrome-launcher": "~3.2.0",
35-
"karma-coverage": "~2.2.0",
36-
"karma-jasmine": "~5.1.0",
37-
"karma-jasmine-html-reporter": "~2.1.0",
38-
"typescript": "~5.4.0",
39-
"@tauri-apps/cli": "{% if v2 %}^2{% else %}^1{% endif %}"
26+
"@angular/build": "^20.1.4",
27+
"@angular/cli": "^20.1.4",
28+
"@angular/compiler-cli": "^20.1.4",
29+
"@tauri-apps/cli": "{% if v2 %}^2{% else %}^1{% endif %}",
30+
"typescript": "~5.8.3"
4031
}
4132
}

templates/template-angular/src/app/app.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ <h1>Welcome to Tauri + Angular!</h1>
1616
<button type="submit">Greet</button>
1717
</form>
1818
<p>{{ greetingMessage }}</p>
19+
20+
<router-outlet />
1921
</main>

templates/template-angular/src/app/app.component.ts.lte

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import { Component } from '@angular/core';
2-
import { CommonModule } from '@angular/common';
3-
import { RouterOutlet } from '@angular/router';
1+
import { Component } from "@angular/core";
2+
import { RouterOutlet } from "@angular/router";
43
import { invoke } from "@tauri-apps/api/{% if v2 %}core{% else %}tauri{% endif %}";
54

65
@Component({
7-
selector: 'app-root',
8-
standalone: true,
9-
imports: [CommonModule, RouterOutlet],
10-
templateUrl: './app.component.html',
11-
styleUrl: './app.component.css'
6+
selector: "app-root",
7+
imports: [RouterOutlet],
8+
templateUrl: "./app.component.html",
9+
styleUrl: "./app.component.css",
1210
})
1311
export class AppComponent {
1412
greetingMessage = "";
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
import { ApplicationConfig } from "@angular/core";
1+
import {
2+
ApplicationConfig,
3+
provideBrowserGlobalErrorListeners,
4+
provideZoneChangeDetection,
5+
} from "@angular/core";
26
import { provideRouter } from "@angular/router";
37

48
import { routes } from "./app.routes";
59

610
export const appConfig: ApplicationConfig = {
7-
providers: [provideRouter(routes)],
11+
providers: [
12+
provideBrowserGlobalErrorListeners(),
13+
provideZoneChangeDetection({ eventCoalescing: true }),
14+
provideRouter(routes),
15+
],
816
};

templates/template-angular/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { bootstrapApplication } from "@angular/platform-browser";
2-
import { appConfig } from "./app/app.config";
32
import { AppComponent } from "./app/app.component";
3+
import { appConfig } from "./app/app.config";
44

55
bootstrapApplication(AppComponent, appConfig).catch((err) =>
66
console.error(err),
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* You can add global styles to this file, and also import other style files */
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
1+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
23
{
34
"extends": "./tsconfig.json",
45
"compilerOptions": {
56
"outDir": "./out-tsc/app",
67
"types": []
78
},
8-
"files": ["src/main.ts"],
9-
"include": ["src/**/*.d.ts"]
9+
"include": ["src/**/*.ts"],
10+
"exclude": ["src/**/*.spec.ts"]
1011
}

0 commit comments

Comments
 (0)