Skip to content

Commit aae95d1

Browse files
authored
chore: update angluar to v17 and templates to latest tauri (#544)
* chore: Update templates to latest tauri * try to fix angular? * ts 5 * come on i don't wanna update angular * why the f would you lock it to 5.0.0?? at least gimme patch versions * update angular to new init template * fmt * node 18 * finish angular update to 17 * fmt * moduleResolution bundler for angular * fix angular distDir
1 parent 476b43b commit aae95d1

27 files changed

Lines changed: 100 additions & 87 deletions

File tree

.changes/angular-17.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+
Update `angular` template to Angluar 17

.changes/update-tauri-alpha18.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+
Update templates to latest tauri versions (1.5 and 2.0.0-alpha.18).

.github/workflows/templates-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ jobs:
7878
with:
7979
bun-version: latest
8080

81-
- name: Install Node.js@16
81+
- name: Install Node.js@18
8282
if: matrix.settings.manager != 'cargo'
83-
uses: actions/setup-node@v2
83+
uses: actions/setup-node@v4
8484
with:
85-
node-version: 16
85+
node-version: 18
8686

8787
- uses: dtolnay/rust-toolchain@stable
8888

packages/cli/fragments/_base_/src-tauri/Cargo.toml.lts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ tauri-build = { version = "2.0.0-alpha", features = [] }
2323

2424
[dependencies]
2525
tauri = { version = "2.0.0-alpha", features = [] }
26-
tauri-plugin-window = "2.0.0-alpha"
2726
tauri-plugin-shell = "2.0.0-alpha"{% endif %}
2827
serde_json = "1.0"
2928

packages/cli/fragments/_base_/src-tauri/src/%(mobile)%lib.rs.lts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ fn greet(name: &str) -> String {
77
#[cfg_attr(mobile, tauri::mobile_entry_point)]
88
pub fn run() {
99
tauri::Builder::default()
10-
.plugin(tauri_plugin_window::init())
1110
.plugin(tauri_plugin_shell::init())
1211
.invoke_handler(tauri::generate_handler![greet])
1312
.run(tauri::generate_context!())

packages/cli/fragments/fragment-angular/_cta_manifest_

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
# SPDX-License-Identifier: Apache-2.0
33
# SPDX-License-Identifier: MIT
44

5-
beforeDevCommand = {% pkg_manager_run_command %} start {% double_dash_with_space %}--port 1420
5+
beforeDevCommand = {% pkg_manager_run_command %} start
66
beforeBuildCommand = {% pkg_manager_run_command %} build
77
devPath = http://localhost:1420
8-
distDir = ../dist/{% package_name %}
8+
distDir = ../dist/{% package_name %}/browser
99

1010
[mobile]
11-
beforeDevCommand = {% pkg_manager_run_command %} start {% double_dash_with_space %}--port 1420 --host $HOST --public-host $HOST
11+
beforeDevCommand = {% pkg_manager_run_command %} start {% double_dash_with_space %}--host $HOST --public-host $HOST
1212

1313
[files]
1414
tauri.svg = src/assets/tauri.svg

packages/cli/fragments/fragment-angular/angular.json.lts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,21 @@
77
},
88
"projects": {
99
"{% package_name %}": {
10-
"root": "",
1110
"projectType": "application",
11+
"root": "",
1212
"sourceRoot": "src",
1313
"prefix": "app",
1414
"architect": {
1515
"build": {
16-
"builder": "@angular-devkit/build-angular:browser",
16+
"builder": "@angular-devkit/build-angular:application",
1717
"options": {
1818
"outputPath": "dist/{% package_name %}",
1919
"index": "src/index.html",
20-
"main": "src/main.ts",
20+
"browser": "src/main.ts",
2121
"polyfills": ["zone.js"],
2222
"tsConfig": "tsconfig.app.json",
23-
"assets": ["src/favicon.ico", "src/assets"],
24-
"styles": ["src/styles.css"],
25-
"scripts": []
23+
"assets": ["src/assets"],
24+
"styles": ["src/styles.css"]
2625
},
2726
"configurations": {
2827
"production": {
@@ -41,24 +40,24 @@
4140
"outputHashing": "all"
4241
},
4342
"development": {
44-
"buildOptimizer": false,
4543
"optimization": false,
46-
"vendorChunk": true,
4744
"extractLicenses": false,
48-
"sourceMap": true,
49-
"namedChunks": true
45+
"sourceMap": true
5046
}
5147
},
5248
"defaultConfiguration": "production"
5349
},
5450
"serve": {
5551
"builder": "@angular-devkit/build-angular:dev-server",
52+
"options": {
53+
"port": 1420
54+
},
5655
"configurations": {
5756
"production": {
58-
"browserTarget": "{% package_name %}:build:production"
57+
"buildTarget": "{% package_name %}:build:production"
5958
},
6059
"development": {
61-
"browserTarget": "{% package_name %}:build:development"
60+
"buildTarget": "{% package_name %}:build:development"
6261
}
6362
},
6463
"defaultConfiguration": "development"

packages/cli/fragments/fragment-angular/package.json.lts

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,33 @@
1010
},
1111
"private": true,
1212
"dependencies": {
13-
"@angular/animations": "^15.2.0",
14-
"@angular/common": "^15.2.0",
15-
"@angular/compiler": "^15.2.0",
16-
"@angular/core": "^15.2.0",
17-
"@angular/forms": "^15.2.0",
18-
"@angular/platform-browser": "^15.2.0",
19-
"@angular/platform-browser-dynamic": "^15.2.0",
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",
2021
"rxjs": "~7.8.0",
2122
"tslib": "^2.3.0",
22-
"zone.js": "~0.12.0",
23-
"@tauri-apps/api": "^{% if alpha %}2.0.0-alpha.11{% else %}1.5.1{% endif %}"{% if alpha %},
23+
"zone.js": "~0.14.2",
24+
"@tauri-apps/api": "^{% if alpha %}2.0.0-alpha.12{% else %}1.5.2{% endif %}"{% if alpha %},
2425
"@tauri-apps/plugin-shell": "^2.0.0-alpha.3"{% endif %}
2526
},
2627
"devDependencies": {
27-
"@angular-devkit/build-angular": "^15.2.0",
28-
"@angular/cli": "~15.2.0",
29-
"@angular/compiler-cli": "^15.2.0",
30-
"@types/jasmine": "~4.3.0",
31-
"jasmine-core": "~4.5.0",
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",
3233
"karma": "~6.4.0",
33-
"karma-chrome-launcher": "~3.1.0",
34+
"karma-chrome-launcher": "~3.2.0",
3435
"karma-coverage": "~2.2.0",
3536
"karma-jasmine": "~5.1.0",
36-
"karma-jasmine-html-reporter": "~2.0.0",
37-
"typescript": "^4.9.5",
38-
"@tauri-apps/cli": "^{% if alpha %}2.0.0-alpha.17{% else %}1.5.6{% endif %}"{% if mobile %},
37+
"karma-jasmine-html-reporter": "~2.1.0",
38+
"typescript": "~5.2.2",
39+
"@tauri-apps/cli": "^{% if alpha %}2.0.0-alpha.18{% else %}1.5.7{% endif %}"{% if mobile %},
3940
"internal-ip": "^7.0.0"{% endif %}
4041
}
4142
}

packages/cli/fragments/fragment-angular/src/app/app.component.ts.lts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
import { Component } from "@angular/core";
1+
import { Component } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { RouterOutlet } from '@angular/router';
24
import { invoke } from "@tauri-apps/api/{% if alpha %}primitives{% else %}tauri{% endif %}";
35

46
@Component({
5-
selector: "app-root",
6-
templateUrl: "./app.component.html",
7-
styleUrls: ["./app.component.css"],
7+
selector: 'app-root',
8+
standalone: true,
9+
imports: [CommonModule, RouterOutlet],
10+
templateUrl: './app.component.html',
11+
styleUrl: './app.component.css'
812
})
913
export class AppComponent {
1014
greetingMessage = "";
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { ApplicationConfig } from "@angular/core";
2+
import { provideRouter } from "@angular/router";
3+
4+
import { routes } from "./app.routes";
5+
6+
export const appConfig: ApplicationConfig = {
7+
providers: [provideRouter(routes)],
8+
};

0 commit comments

Comments
 (0)