Skip to content

Commit

Permalink
feat: support angular 18 (#513)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Henk Kelder <[email protected]>
  • Loading branch information
henkkelder and Henk Kelder authored Sep 3, 2024
1 parent bad1f93 commit 70d5066
Show file tree
Hide file tree
Showing 8 changed files with 1,892 additions and 767 deletions.
2,548 changes: 1,823 additions & 725 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
"@ionic/prettier-config": "^2.0.0",
"commitizen": "^4.2.4",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^7.32.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.4",
"lerna": "^4.0.0",
"prettier": "^2.4.1",
"typescript": "~5.2.0",
"typescript": "~5.4.0",
"typescript-eslint-language-service": "^4.1.3"
},
"config": {
Expand Down
13 changes: 13 additions & 0 deletions packages/cordova-builders/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [12.0.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/[email protected]...@ionic/[email protected]) (2024-09-01)


### Features

* support angular 18 ([#508](https://github.com/ionic-team/angular-toolkit/issues/508)) ([c002c51](https://github.com/ionic-team/angular-toolkit/commit/c002c51cc09f45639ca97bc5354840d9c384556c))


### BREAKING CHANGES

* The minimum version of Angular required is now 18. Please updates your apps to use
the latest release of Angular.

# [11.0.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/[email protected]...@ionic/[email protected]) (2024-01-09)


Expand Down
45 changes: 22 additions & 23 deletions packages/cordova-builders/cordova-serve/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type {
DevServerBuilderOptions,
DevServerBuilderOutput,
} from '@angular-devkit/build-angular';
import type { IndexHtmlTransform } from '@angular-devkit/build-angular/src/utils/index-file/index-html-generator';
import { ScriptsWebpackPlugin } from '@angular-devkit/build-angular/src/tools/webpack/plugins';
import type { json } from '@angular-devkit/core';
import * as CopyWebpackPlugin from 'copy-webpack-plugin';
Expand Down Expand Up @@ -74,33 +73,33 @@ const cordovaServeTransform: (
context: BuilderContext
) => ExecutionTransformer<Configuration> =
(formattedAssets, { workspaceRoot }) =>
(browserWebpackConfig) => {
const scriptExtras = formattedAssets.globalScriptsByBundleName.map((script: { bundleName: any; paths: any }) => {
const bundleName = script.bundleName;
return new ScriptsWebpackPlugin({
name: bundleName,
sourceMap: true,
filename: `${basename(bundleName)}.js`,
scripts: script.paths,
basePath: workspaceRoot,
(browserWebpackConfig) => {
const scriptExtras = formattedAssets.globalScriptsByBundleName.map((script: { bundleName: any; paths: any }) => {
const bundleName = script.bundleName;
return new ScriptsWebpackPlugin({
name: bundleName,
sourceMap: true,
filename: `${basename(bundleName)}.js`,
scripts: script.paths,
basePath: workspaceRoot,
});
});
});

const copyWebpackPluginInstance = new CopyWebpackPlugin({
patterns: formattedAssets.copyWebpackPluginPatterns,
});
const copyWebpackPluginInstance = new CopyWebpackPlugin({
patterns: formattedAssets.copyWebpackPluginPatterns,
});

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
(browserWebpackConfig.plugins as any)?.push(...scriptExtras, copyWebpackPluginInstance);
return browserWebpackConfig;
};
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
(browserWebpackConfig.plugins as any)?.push(...scriptExtras, copyWebpackPluginInstance);
return browserWebpackConfig;
};

export const indexHtmlTransformFactory: (
formattedAssets: FormattedAssets,
context: BuilderContext
) => IndexHtmlTransform =
) => (content: string) => Promise<string> =
({ globalScriptsByBundleName }) =>
(indexTransform: string) => {
const augmentedHtml = augmentIndexHtml(indexTransform, globalScriptsByBundleName);
return Promise.resolve(augmentedHtml);
};
(indexTransform: string) => {
const augmentedHtml = augmentIndexHtml(indexTransform, globalScriptsByBundleName);
return Promise.resolve(augmentedHtml);
};
24 changes: 13 additions & 11 deletions packages/cordova-builders/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ionic/cordova-builders",
"version": "11.0.0",
"version": "12.0.0",
"license": "MIT",
"description": "Cordova builders for @ionic/angular apps",
"homepage": "https://ionicframework.com/",
Expand Down Expand Up @@ -35,22 +35,24 @@
"ionicframework"
],
"dependencies": {
"@angular-devkit/architect": "^0.1700.0",
"@angular-devkit/build-angular": "^17.0.0",
"@angular-devkit/core": "^17.0.0",
"@angular-devkit/schematics": "^17.0.0",
"@schematics/angular": "^17.0.0",
"@angular-devkit/architect": "^0.1802.0",
"@angular-devkit/build-angular": "^18.0.0",
"@angular-devkit/core": "^18.0.0",
"@angular-devkit/schematics": "^18.0.0",
"@schematics/angular": "^18.0.0",
"cheerio": "^1.0.0-rc.10",
"colorette": "^2.0.16",
"copy-webpack-plugin": "^9.0.1",
"copy-webpack-plugin": "^12.0.2",
"ws": "^8.2.3"
},
"devDependencies": {
"@types/copy-webpack-plugin": "^8.0.1",
"@types/node": "^16.11.7",
"@types/ws": "^8.2.0",
"lint-staged": "^12.0.2",
"typescript": "~5.2.0"
"@types/ws": "^8.5.12",
"lint-staged": "^15.2.9",
"typescript": "~5.5.4",
"@angular-eslint/builder": "^18.3.0",
"@angular-eslint/eslint-plugin": "^18.0.1"

},
"builders": "./builders.json",
"schematics": "./collection.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/cordova-builders/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export function prepareServerConfig(options: CordovaServeBuilderSchema, root: st
let { input, output, ignore = [], glob } = asset;
input = resolve(root, input).replace(/\\/g, '/');
input = input.endsWith('/') ? input : input + '/';
output = output.endsWith('/') ? output : output + '/';
output = output?.endsWith('/') ? output : (output ?? '') + '/';

return {
context: input,
Expand Down
13 changes: 13 additions & 0 deletions packages/schematics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [12.0.0](https://github.com/ionic-team/angular-toolkit/compare/@ionic/[email protected]...@ionic/[email protected]) (2024-09-01)


### Features

* support angular 18 ([#508](https://github.com/ionic-team/angular-toolkit/issues/508)) ([c002c51](https://github.com/ionic-team/angular-toolkit/commit/c002c51cc09f45639ca97bc5354840d9c384556c))


### BREAKING CHANGES

* The minimum version of Angular required is now 18. Please updates your apps to use
the latest release of Angular.

## [11.0.1](https://github.com/ionic-team/angular-toolkit/compare/@ionic/[email protected]...@ionic/[email protected]) (2024-01-29)


Expand Down
10 changes: 5 additions & 5 deletions packages/schematics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ionic/angular-toolkit",
"version": "11.0.1",
"version": "12.0.0",
"license": "MIT",
"description": "Schematics for @ionic/angular apps.",
"homepage": "https://ionicframework.com/",
Expand Down Expand Up @@ -30,13 +30,13 @@
"ionicframework"
],
"dependencies": {
"@angular-devkit/core": "^17.0.0",
"@angular-devkit/schematics": "^17.0.0",
"@schematics/angular": "^17.0.0"
"@angular-devkit/core": "^18.0.0",
"@angular-devkit/schematics": "^18.0.0",
"@schematics/angular": "^18.0.0"
},
"devDependencies": {
"lint-staged": "^12.0.2",
"typescript": "~5.2.0"
"typescript": "~5.4.0"
},
"eslintConfig": {
"extends": [
Expand Down

0 comments on commit 70d5066

Please sign in to comment.