Skip to content

Commit 70d5066

Browse files
henkkelderHenk Kelder
and
Henk Kelder
authored
feat: support angular 18 (#513)
--------- Co-authored-by: Henk Kelder <[email protected]>
1 parent bad1f93 commit 70d5066

File tree

8 files changed

+1892
-767
lines changed

8 files changed

+1892
-767
lines changed

package-lock.json

Lines changed: 1823 additions & 725 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838
"@ionic/prettier-config": "^2.0.0",
3939
"commitizen": "^4.2.4",
4040
"cz-conventional-changelog": "^3.3.0",
41-
"eslint": "^7.32.0",
41+
"eslint": "^8.57.0",
4242
"eslint-config-prettier": "^8.3.0",
4343
"eslint-plugin-import": "^2.25.3",
4444
"eslint-plugin-prettier": "^4.0.0",
4545
"husky": "^7.0.4",
4646
"lerna": "^4.0.0",
4747
"prettier": "^2.4.1",
48-
"typescript": "~5.2.0",
48+
"typescript": "~5.4.0",
4949
"typescript-eslint-language-service": "^4.1.3"
5050
},
5151
"config": {

packages/cordova-builders/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [12.0.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/[email protected]...@ionic/[email protected]) (2024-09-01)
7+
8+
9+
### Features
10+
11+
* support angular 18 ([#508](https://github.com/ionic-team/angular-toolkit/issues/508)) ([c002c51](https://github.com/ionic-team/angular-toolkit/commit/c002c51cc09f45639ca97bc5354840d9c384556c))
12+
13+
14+
### BREAKING CHANGES
15+
16+
* The minimum version of Angular required is now 18. Please updates your apps to use
17+
the latest release of Angular.
18+
619
# [11.0.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/[email protected]...@ionic/[email protected]) (2024-01-09)
720

821

packages/cordova-builders/cordova-serve/index.ts

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import type {
66
DevServerBuilderOptions,
77
DevServerBuilderOutput,
88
} from '@angular-devkit/build-angular';
9-
import type { IndexHtmlTransform } from '@angular-devkit/build-angular/src/utils/index-file/index-html-generator';
109
import { ScriptsWebpackPlugin } from '@angular-devkit/build-angular/src/tools/webpack/plugins';
1110
import type { json } from '@angular-devkit/core';
1211
import * as CopyWebpackPlugin from 'copy-webpack-plugin';
@@ -74,33 +73,33 @@ const cordovaServeTransform: (
7473
context: BuilderContext
7574
) => ExecutionTransformer<Configuration> =
7675
(formattedAssets, { workspaceRoot }) =>
77-
(browserWebpackConfig) => {
78-
const scriptExtras = formattedAssets.globalScriptsByBundleName.map((script: { bundleName: any; paths: any }) => {
79-
const bundleName = script.bundleName;
80-
return new ScriptsWebpackPlugin({
81-
name: bundleName,
82-
sourceMap: true,
83-
filename: `${basename(bundleName)}.js`,
84-
scripts: script.paths,
85-
basePath: workspaceRoot,
76+
(browserWebpackConfig) => {
77+
const scriptExtras = formattedAssets.globalScriptsByBundleName.map((script: { bundleName: any; paths: any }) => {
78+
const bundleName = script.bundleName;
79+
return new ScriptsWebpackPlugin({
80+
name: bundleName,
81+
sourceMap: true,
82+
filename: `${basename(bundleName)}.js`,
83+
scripts: script.paths,
84+
basePath: workspaceRoot,
85+
});
8686
});
87-
});
8887

89-
const copyWebpackPluginInstance = new CopyWebpackPlugin({
90-
patterns: formattedAssets.copyWebpackPluginPatterns,
91-
});
88+
const copyWebpackPluginInstance = new CopyWebpackPlugin({
89+
patterns: formattedAssets.copyWebpackPluginPatterns,
90+
});
9291

93-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
94-
(browserWebpackConfig.plugins as any)?.push(...scriptExtras, copyWebpackPluginInstance);
95-
return browserWebpackConfig;
96-
};
92+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
93+
(browserWebpackConfig.plugins as any)?.push(...scriptExtras, copyWebpackPluginInstance);
94+
return browserWebpackConfig;
95+
};
9796

9897
export const indexHtmlTransformFactory: (
9998
formattedAssets: FormattedAssets,
10099
context: BuilderContext
101-
) => IndexHtmlTransform =
100+
) => (content: string) => Promise<string> =
102101
({ globalScriptsByBundleName }) =>
103-
(indexTransform: string) => {
104-
const augmentedHtml = augmentIndexHtml(indexTransform, globalScriptsByBundleName);
105-
return Promise.resolve(augmentedHtml);
106-
};
102+
(indexTransform: string) => {
103+
const augmentedHtml = augmentIndexHtml(indexTransform, globalScriptsByBundleName);
104+
return Promise.resolve(augmentedHtml);
105+
};

packages/cordova-builders/package.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ionic/cordova-builders",
3-
"version": "11.0.0",
3+
"version": "12.0.0",
44
"license": "MIT",
55
"description": "Cordova builders for @ionic/angular apps",
66
"homepage": "https://ionicframework.com/",
@@ -35,22 +35,24 @@
3535
"ionicframework"
3636
],
3737
"dependencies": {
38-
"@angular-devkit/architect": "^0.1700.0",
39-
"@angular-devkit/build-angular": "^17.0.0",
40-
"@angular-devkit/core": "^17.0.0",
41-
"@angular-devkit/schematics": "^17.0.0",
42-
"@schematics/angular": "^17.0.0",
38+
"@angular-devkit/architect": "^0.1802.0",
39+
"@angular-devkit/build-angular": "^18.0.0",
40+
"@angular-devkit/core": "^18.0.0",
41+
"@angular-devkit/schematics": "^18.0.0",
42+
"@schematics/angular": "^18.0.0",
4343
"cheerio": "^1.0.0-rc.10",
4444
"colorette": "^2.0.16",
45-
"copy-webpack-plugin": "^9.0.1",
45+
"copy-webpack-plugin": "^12.0.2",
4646
"ws": "^8.2.3"
4747
},
4848
"devDependencies": {
49-
"@types/copy-webpack-plugin": "^8.0.1",
5049
"@types/node": "^16.11.7",
51-
"@types/ws": "^8.2.0",
52-
"lint-staged": "^12.0.2",
53-
"typescript": "~5.2.0"
50+
"@types/ws": "^8.5.12",
51+
"lint-staged": "^15.2.9",
52+
"typescript": "~5.5.4",
53+
"@angular-eslint/builder": "^18.3.0",
54+
"@angular-eslint/eslint-plugin": "^18.0.1"
55+
5456
},
5557
"builders": "./builders.json",
5658
"schematics": "./collection.json",

packages/cordova-builders/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export function prepareServerConfig(options: CordovaServeBuilderSchema, root: st
171171
let { input, output, ignore = [], glob } = asset;
172172
input = resolve(root, input).replace(/\\/g, '/');
173173
input = input.endsWith('/') ? input : input + '/';
174-
output = output.endsWith('/') ? output : output + '/';
174+
output = output?.endsWith('/') ? output : (output ?? '') + '/';
175175

176176
return {
177177
context: input,

packages/schematics/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [12.0.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/[email protected]...@ionic/[email protected]) (2024-09-01)
7+
8+
9+
### Features
10+
11+
* support angular 18 ([#508](https://github.com/ionic-team/angular-toolkit/issues/508)) ([c002c51](https://github.com/ionic-team/angular-toolkit/commit/c002c51cc09f45639ca97bc5354840d9c384556c))
12+
13+
14+
### BREAKING CHANGES
15+
16+
* The minimum version of Angular required is now 18. Please updates your apps to use
17+
the latest release of Angular.
18+
619
## [11.0.1](https://github.com/ionic-team/angular-toolkit/compare/@ionic/[email protected]...@ionic/[email protected]) (2024-01-29)
720

821

packages/schematics/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ionic/angular-toolkit",
3-
"version": "11.0.1",
3+
"version": "12.0.0",
44
"license": "MIT",
55
"description": "Schematics for @ionic/angular apps.",
66
"homepage": "https://ionicframework.com/",
@@ -30,13 +30,13 @@
3030
"ionicframework"
3131
],
3232
"dependencies": {
33-
"@angular-devkit/core": "^17.0.0",
34-
"@angular-devkit/schematics": "^17.0.0",
35-
"@schematics/angular": "^17.0.0"
33+
"@angular-devkit/core": "^18.0.0",
34+
"@angular-devkit/schematics": "^18.0.0",
35+
"@schematics/angular": "^18.0.0"
3636
},
3737
"devDependencies": {
3838
"lint-staged": "^12.0.2",
39-
"typescript": "~5.2.0"
39+
"typescript": "~5.4.0"
4040
},
4141
"eslintConfig": {
4242
"extends": [

0 commit comments

Comments
 (0)