Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/actions/test-angular-e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ runs:
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22.x
- uses: ./.github/workflows/actions/download-archive
with:
name: ionic-core
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
strategy:
fail-fast: false
matrix:
apps: [ng16, ng17, ng18, ng19]
apps: [ng16, ng17, ng18, ng19, ng20]
needs: [build-angular, build-angular-server]
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stencil-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ jobs:
strategy:
fail-fast: false
matrix:
apps: [ng16, ng17, ng18, ng19]
apps: [ng16, ng17, ng18, ng19, ng20]
needs: [build-angular, build-angular-server]
runs-on: ubuntu-latest
steps:
Expand Down
12 changes: 6 additions & 6 deletions core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 25 additions & 13 deletions packages/angular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,48 @@ Ionic Angular specific building blocks on top of [@ionic/core](https://www.npmjs
## Testing ng-add in ionic

1. Pull the latest from `main`
2. Build ionic/angular: `npm run build`
3. Run `npm link` from `ionic/angular/dist` directory
4. Create a blank angular project
2. Install dependencies and build `core` package:

```
ng new add-test
// Say yes to including the router, we need it
cd add-test
$ cd core
$ npm install
$ npm run build
```

5. To run schematics locally, we need the schematics-cli (once published, this will not be needed)
3. Install dependencies and build Angular package:

```
npm install @angular-devkit/schematics-cli
$ cd ../packages/angular
$ npm install
$ npm run build
```

6. Link `@ionic/angular`

4. Link Angular package from `dist` folder
```
npm link @ionic/angular
$ cd dist
$ npm link
```

5. Create a blank angular project

```
$ ng new add-test
$ cd add-test
```

7. Run the local copy of the ng-add schematic
6. Link the local ionic/angular package to the add-test app

```
$ npx schematics @ionic/angular:ng-add
$ npm link @ionic/angular
```


8. Run the local copy of the ng-add schematic

```
$ ng add @ionic/angular
```

You'll now be able to add ionic components to a vanilla Angular app setup.

## Project Structure
Expand Down
156 changes: 156 additions & 0 deletions packages/angular/test/apps/ng20/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"test-app": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/test-app/browser",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"buildOptimizer": true,
"assets": [
"src/favicon.ico",
{
"glob": "**/*",
"input": "src/assets",
"output": "assets"
},
{
"glob": "**/*.svg",
"input": "node_modules/ionicons/dist/ionicons/svg",
"output": "./svg"
}
],
"styles": ["src/styles.css"],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"progress": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
]
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"buildTarget": "test-app:build"
},
"configurations": {
"production": {
"buildTarget": "test-app:build:production"
},
"development": {
"buildTarget": "test-app:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "test-app:build"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
}
},
"server": {
"builder": "@angular-devkit/build-angular:server",
"options": {
"outputPath": "dist/test-app/server",
"main": "server.ts",
"tsConfig": "tsconfig.server.json"
},
"configurations": {
"production": {
"outputHashing": "media",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"sourceMap": false,
"optimization": true
}
}
},
"serve-ssr": {
"builder": "@angular-devkit/build-angular:ssr-dev-server",
"options": {
"browserTarget": "test-app:build",
"serverTarget": "test-app:server"
},
"configurations": {
"production": {
"browserTarget": "test-app:build:production",
"serverTarget": "test-app:server:production"
}
}
},
"prerender": {
"builder": "@angular-devkit/build-angular:prerender",
"options": {
"browserTarget": "test-app:build:production",
"serverTarget": "test-app:server:production",
"routes": []
}
}
}
}
},
"cli": {
"schematicCollections": ["@angular-eslint/schematics"],
"cache": {
"enabled": false
}
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
it("should be on Angular 20", () => {
cy.visit('/lazy');

cy.get('ion-title').contains('Angular 20');
});
13 changes: 13 additions & 0 deletions packages/angular/test/apps/ng20/e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "ES2022",
"types": ["cypress", "node"]
},
"include": [
"../cypress/**/*.ts",
"../cypress/support/**/*.ts"
]
}
Loading
Loading