Skip to content

Commit

Permalink
fix(a19): support of Angular 19 #10503 #10632 (#10754)
Browse files Browse the repository at this point in the history
  • Loading branch information
satanTime authored Jan 12, 2025
2 parents fec44bd + f9a73ab commit b6b24d5
Show file tree
Hide file tree
Showing 381 changed files with 23,289 additions and 239 deletions.
7 changes: 7 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ executors:
docker:
- image: satantime/puppeteer-node:20.18.1
resource_class: medium
a19:
docker:
- image: satantime/puppeteer-node:22.13.0
resource_class: medium

commands:
install:
Expand Down Expand Up @@ -622,6 +626,7 @@ workflows:
- a16
- a17
- a18
- a19

# testing a5 (exceptional)
- E2E Test:
Expand Down Expand Up @@ -701,6 +706,7 @@ workflows:
- a16
- a17
- a18
- a19

# testing lib build
- Lib Build:
Expand All @@ -727,6 +733,7 @@ workflows:
- a16
- a17
- a18
- a19

# testing lib build
- Lib Build:
Expand Down
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/e2e/a16/node_modules
/e2e/a17/node_modules
/e2e/a18/node_modules
/e2e/a19/node_modules
/e2e/jasmine/node_modules
/e2e/jest/node_modules
/e2e/min/node_modules
Expand Down
2 changes: 2 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ settings:
- ./e2e/a16/tsconfig.json
- ./e2e/a17/tsconfig.json
- ./e2e/a18/tsconfig.json
- ./e2e/a19/tsconfig.json
- ./e2e/jasmine/tsconfig.json
- ./e2e/jest/tsconfig.json
- ./e2e/min/tsconfig.json
Expand Down Expand Up @@ -61,6 +62,7 @@ overrides:
- ./e2e/a16/tsconfig.json
- ./e2e/a17/tsconfig.json
- ./e2e/a18/tsconfig.json
- ./e2e/a19/tsconfig.json
- ./e2e/jasmine/tsconfig.json
- ./e2e/jest/tsconfig.json
- ./e2e/min/tsconfig.json
Expand Down
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ updates:
commit-message:
prefix: 'chore(deps)'

- package-ecosystem: 'npm'
directory: /e2e/a19/
open-pull-requests-limit: 0
schedule:
interval: 'daily'
commit-message:
prefix: 'chore(deps)'

- package-ecosystem: 'npm'
directory: /e2e/jasmine/
open-pull-requests-limit: 0
Expand Down
122 changes: 61 additions & 61 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,21 @@ npm run test:debug
## How to add a new Angular version

First, you need to install the new Angular version somewhere.
Below is an example how to add Angular 17 to `ng-mocks`.
Below is an example how to add Angular 19 to `ng-mocks`.

### Step #1 - create an empty project

Let's create a fresh project with `@angular/cli` `v17`.
The name of the project should be `a + version`: `a17`.
Let's create a fresh project with `@angular/cli` `v19`.
The name of the project should be `a + version`: `a20`.

```shell
npx '@angular/cli@^17' new \
npx '@angular/cli@^19' new \
--routing \
--skip-git=true \
--skip-tests=true \
--style=css \
--ssr=false \
a17
a20
```

Basically, the requirements are:
Expand All @@ -142,67 +142,66 @@ Basically, the requirements are:

The next step is:

- move `a17` folder to `ng-mocks/e2e` folder
- delete `.vscode` folder in `ng-mocks/e2e/a17`
- delete `.editorconfig` file in `ng-mocks/e2e/a17`
- change `.gitignore` to be the same as in the prev version: `ng-mocks/e2e/a16/.gitignore`
- change `angular.json` to be similar as in the prev version: `ng-mocks/e2e/a16/angular.json`
- `projects/a17/schematics` should be empty
- remove `projects/a17/architect/build/options/assets`
- remove `projects/a17/architect/build/options/styles`
- remove `projects/a17/architect/build/options/scripts`
- change `projects/a17/architect/build/options/tsConfig` to `tsconfig.json`
- remove `projects/a17/architect/build/configurations/production/budgets`
- remove `projects/a17/architect/extract-i18n`
- remove `projects/a17/architect/test/options/assets`
- remove `projects/a17/architect/test/options/styles`
- remove `projects/a17/architect/test/options/scripts`
- change `projects/a17/architect/test/options/tsConfig` to `tsconfig.json`
- add `projects/a17/architect/test/options/main` with the value of `src/test.ts`
- add `projects/a17/architect/test/options/karmaConfig` with the value of `karma.conf.js`
- add `projects/lib` as it is in the prev version: `ng-mocks/e2e/a16/angular.json`
- change `package.json` to be similar as in the prev version: `ng-mocks/e2e/a16/package.json`
- `name` should be `a17`
- `description` should be `Angular 17`
- move `a20` folder to `ng-mocks/e2e` folder
- delete `.vscode` folder in `ng-mocks/e2e/a20`
- delete `.editorconfig` file in `ng-mocks/e2e/a20`
- change `.gitignore` to be the same as in the prev version: `ng-mocks/e2e/a19/.gitignore`
- change `angular.json` to be similar as in the prev version: `ng-mocks/e2e/a19/angular.json`
- `projects/a20/schematics` should be empty
- remove `projects/a20/architect/build/options/assets`
- remove `projects/a20/architect/build/options/styles`
- remove `projects/a20/architect/build/options/scripts`
- change `projects/a20/architect/build/options/tsConfig` to `tsconfig.json`
- remove `projects/a20/architect/build/configurations/production/budgets`
- remove `projects/a20/architect/extract-i18n`
- remove `projects/a20/architect/test/options/assets`
- remove `projects/a20/architect/test/options/styles`
- remove `projects/a20/architect/test/options/scripts`
- change `projects/a20/architect/test/options/tsConfig` to `tsconfig.json`
- add `projects/a20/architect/test/options/main` with the value of `src/test.ts`
- add `projects/a20/architect/test/options/karmaConfig` with the value of `karma.conf.js`
- add `projects/lib` as it is in the prev version: `ng-mocks/e2e/a19/angular.json`
- change `package.json` to be similar as in the prev version: `ng-mocks/e2e/a19/package.json`
- `name` should be `a20`
- `description` should be `Angular 20`
- `private` should be `true`
- replace `scripts` as it is in the prev version: `ng-mocks/e2e/a16/package.json`
- remove flexible versions (`^~`) in `dependencies` as it is in the prev version: `ng-mocks/e2e/a16/package.json`
- remove flexible versions (`^~`) in `devDependencies` as it is in the prev version: `ng-mocks/e2e/a16/package.json`
- replace `scripts` as it is in the prev version: `ng-mocks/e2e/a19/package.json`
- remove flexible versions (`^~`) in `dependencies` as it is in the prev version: `ng-mocks/e2e/a19/package.json`
- remove flexible versions (`^~`) in `devDependencies` as it is in the prev version: `ng-mocks/e2e/a19/package.json`
- in `devDependencies`, add `@types/jest`, `jest`, `jest-preset-angular`, `ng-packagr`, `puppeteer`, `ts-node` which support the desired angular version
- add `engines` with the correct `npm` which supports the desired angular version
- delete `README.md`
- merge `tsconfig.app.json` and `tsconfig.spec.json` into `tsconfig.json` as it is in the prev version: `ng-mocks/e2e/a16/tsconfig.json`
- merge `tsconfig.app.json` and `tsconfig.spec.json` into `tsconfig.json` as it is in the prev version: `ng-mocks/e2e/a19/tsconfig.json`
- add `compilerOptions/baseUrl`with the value of `./`
- add `compilerOptions/types` as it is in the prev version: `ng-mocks/e2e/a16/tsconfig.json`
- add `compilerOptions/skipLibCheck` as it is in the prev version: `ng-mocks/e2e/a16/tsconfig.json`
- add `compilerOptions/types` as it is in the prev version: `ng-mocks/e2e/a19/tsconfig.json`
- add `compilerOptions/skipLibCheck` as it is in the prev version: `ng-mocks/e2e/a19/tsconfig.json`
- change `compilerOptions/noImplicitOverride` to `false`
- add `files` as it is in the prev version: `ng-mocks/e2e/a16/tsconfig.json`
- add `include` as it is in the prev version: `ng-mocks/e2e/a16/tsconfig.json`
- add `files` as it is in the prev version: `ng-mocks/e2e/a19/tsconfig.json`
- add `include` as it is in the prev version: `ng-mocks/e2e/a19/tsconfig.json`
- delete `tsconfig.app.json`
- delete `tsconfig.spec.json`
- add `.nvmrc` which supports the desired angular version
- add `jest.config.ts` as it is in the prev version: `ng-mocks/e2e/a16/jest.config.ts`
- add `karma.conf.js` as it is in the prev version: `ng-mocks/e2e/a16/karma.conf.js`
- add `ng-package.json` as it is in the prev version: `ng-mocks/e2e/a16/ng-package.json`
- delete `ng-mocks/e2e/a17/src/app`
- delete `ng-mocks/e2e/a17/src/assets`
- delete `ng-mocks/e2e/a17/src/favicon.ico`
- delete `ng-mocks/e2e/a17/src/style.css`
- remove `<link rel="icon">` from `ng-mocks/e2e/a17/src/index.html`
- change `ng-mocks/e2e/a17/src/main.ts` as it is in the prev version: `ng-mocks/e2e/a16/src/main.ts`
- add `ng-mocks/e2e/a17/src/test.ts` as it is in the prev version: `ng-mocks/e2e/a16/src/test.ts`
- add `ng-mocks/e2e/a17/src/setup-jest.ts` as it is in the prev version: `ng-mocks/e2e/a16/src/setup-jest.ts`
- add `jest.config.ts` as it is in the prev version: `ng-mocks/e2e/a19/jest.config.ts`
- add `karma.conf.js` as it is in the prev version: `ng-mocks/e2e/a19/karma.conf.js`
- add `ng-package.json` as it is in the prev version: `ng-mocks/e2e/a19/ng-package.json`
- delete `ng-mocks/e2e/a20/public`
- delete `ng-mocks/e2e/a20/src/app`
- delete `ng-mocks/e2e/a20/src/style.css`
- remove `<link rel="icon">` from `ng-mocks/e2e/a20/src/index.html`
- change `ng-mocks/e2e/a20/src/main.ts` as it is in the prev version: `ng-mocks/e2e/a19/src/main.ts`
- add `ng-mocks/e2e/a20/src/test.ts` as it is in the prev version: `ng-mocks/e2e/a19/src/test.ts`
- add `ng-mocks/e2e/a20/src/setup-jest.ts` as it is in the prev version: `ng-mocks/e2e/a19/src/setup-jest.ts`

### Step #3 - update scripts

- update `ng-mocks/package.json`, search for `a16` and extended scripts to support `a17`
- update `ng-mocks/compose.yml`, search for `a16` and copy blocks to support `a17` with the right node version
- update `ng-mocks/compose.sh`, search for `a16` and copy blocks to support `a17` with the right command to install `puppeteer`
- update `ng-mocks/.dockerignore`, search for `a16` and copy blocks to support `a17`
- update `ng-mocks/.github/dependabot.yml`, search for `a16` and copy blocks to support `a17`
- update `ng-mocks/.circleci/config.yml`, search for `a16` and copy blocks to support `a17`
- update `ng-mocks/.eslintrc.yml`, search for `a16` and copy blocks to support `a17`
- execute `sh compose.sh a17` in `ng-mocks` to install dependencies for `a17`, it might require `--force` at this moment in `compose.yml` in the command for the new version
- update `ng-mocks/package.json`, search for `a19` and extended scripts to support `a20`
- update `ng-mocks/compose.yml`, search for `a19` and copy blocks to support `a20` with the right node version
- update `ng-mocks/compose.sh`, search for `a19` and copy blocks to support `a20` with the right command to install `puppeteer`
- update `ng-mocks/.dockerignore`, search for `a19` and copy blocks to support `a20`
- update `ng-mocks/.github/dependabot.yml`, search for `a19` and copy blocks to support `a20`
- update `ng-mocks/.circleci/config.yml`, search for `a19` and copy blocks to support `a20`
- update `ng-mocks/.eslintrc.yml`, search for `a19` and copy blocks to support `a20`
- execute `sh compose.sh a20` in `ng-mocks` to install dependencies for `a20`, it might require `--force` at this moment in `compose.yml` in the command for the new version

### Step #4 - update ng-mocks dependencies

Expand All @@ -211,16 +210,14 @@ The next step is:

### Step #5 - verify that`ng-mocks` does not fail with the new version

Replace `a16` with the new version below.

- execute `nvm install` in `ng-mocks`
- execute `nvm use`
- execute `npm run build`
- execute `npm run clean:a16`
- execute `npm run s:a16`
- execute `npm run s:app:a16`
- execute `npm run s:test:a16`
- execute `npm run test:a16`
- execute `npm run clean:a20`
- execute `npm run s:a20`
- execute `npm run s:app:a20`
- execute `npm run s:test:a20`
- execute `npm run test:a20`
- tests should pass successfully without failures

### Step #6 - update version references
Expand All @@ -230,6 +227,9 @@ Replace `a16` with the new version below.
- update the version table in `ng-mocks/README.md`
- update `description` in `libs/ng-mocks/package.json`
- update `peerDependencies` in `libs/ng-mocks/package.json`
- update this file and replace `a20` with `a21`
- update this file and replace `Angular 20` with `Angular 21`
- update this file and replace `a19` with `a20`

### Step #7 - verify

Expand Down
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,23 @@

The current version of the library **has been tested** and **can be used** with:

| Angular | ng-mocks | Jasmine | Jest | Ivy |
| ------: | :------: | :-----: | :--: | :-: |
| 18 | latest | yes | yes | yes |
| 17 | latest | yes | yes | yes |
| 16 | latest | yes | yes | yes |
| 15 | latest | yes | yes | yes |
| 14 | latest | yes | yes | yes |
| 13 | latest | yes | yes | yes |
| 12 | latest | yes | yes | yes |
| 11 | latest | yes | yes | yes |
| 10 | latest | yes | yes | yes |
| 9 | latest | yes | yes | yes |
| 8 | latest | yes | yes | |
| 7 | latest | yes | yes | |
| 6 | latest | yes | yes | |
| 5 | latest | yes | yes | |
| angular | ng-mocks | jasmine | jest | ivy | standalone | signals | defer |
| ------: | :------: | :-----: | :--: | :-: | :--------: | :-----: | :---: |
| 19 | latest | yes | yes | yes | yes | no | no |
| 18 | latest | yes | yes | yes | yes | no | no |
| 17 | latest | yes | yes | yes | yes | no | no |
| 16 | latest | yes | yes | yes | yes | no | |
| 15 | latest | yes | yes | yes | yes | | |
| 14 | latest | yes | yes | yes | yes | | |
| 13 | latest | yes | yes | yes | | | |
| 12 | latest | yes | yes | yes | | | |
| 11 | latest | yes | yes | yes | | | |
| 10 | latest | yes | yes | yes | | | |
| 9 | latest | yes | yes | yes | | | |
| 8 | latest | yes | yes | | | | |
| 7 | latest | yes | yes | | | | |
| 6 | latest | yes | yes | | | | |
| 5 | latest | yes | yes | | | | |

## Important links

Expand Down
9 changes: 9 additions & 0 deletions compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,15 @@ if [ "$1" = "" ] || [ "$1" = "a18" ]; then
cd ../..
fi

if [ "$1" = "" ] || [ "$1" = "a19" ]; then
docker compose up --build -- a19 && \
cd ./e2e/a19 && \
nvm install && \
nvm use && \
node ./node_modules/puppeteer/install.mjs && \
cd ../..
fi

if [ "$1" = "" ] || [ "$1" = "jasmine" ]; then
docker compose up --build -- jasmine && \
cd ./e2e/jasmine && \
Expand Down
12 changes: 12 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,18 @@ services:
- install
- --no-audit

a19:
image: satantime/puppeteer-node:22.13.0
working_dir: /app
volumes:
- ./e2e/a19:/app
- gyp:/root/.node-gyp
- npm:/root/.npm
command:
- npm
- install
- --no-audit

jasmine:
image: satantime/puppeteer-node:20.18.1
working_dir: /app
Expand Down
33 changes: 17 additions & 16 deletions docs/articles/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,23 @@ keeping interfaces as they are, but suppressing their implementation.

The current version of `ng-mocks` has been tested and **can be used** with:

| Angular | ng-mocks | Jasmine | Jest | Ivy |
|--------:|:--------:| :-----: | :--: | :-: |
| 18 | latest | yes | yes | yes |
| 17 | latest | yes | yes | yes |
| 16 | latest | yes | yes | yes |
| 15 | latest | yes | yes | yes |
| 14 | latest | yes | yes | yes |
| 13 | latest | yes | yes | yes |
| 12 | latest | yes | yes | yes |
| 11 | latest | yes | yes | yes |
| 10 | latest | yes | yes | yes |
| 9 | latest | yes | yes | yes |
| 8 | latest | yes | yes | |
| 7 | latest | yes | yes | |
| 6 | latest | yes | yes | |
| 5 | latest | yes | yes | |
| angular | ng-mocks | jasmine | jest | ivy | standalone | signals | defer |
| ------: | :------: | :-----: | :--: | :-: | :--------: | :-----: | :---: |
| 19 | latest | yes | yes | yes | yes | no | no |
| 18 | latest | yes | yes | yes | yes | no | no |
| 17 | latest | yes | yes | yes | yes | no | no |
| 16 | latest | yes | yes | yes | yes | no | |
| 15 | latest | yes | yes | yes | yes | | |
| 14 | latest | yes | yes | yes | yes | | |
| 13 | latest | yes | yes | yes | | | |
| 12 | latest | yes | yes | yes | | | |
| 11 | latest | yes | yes | yes | | | |
| 10 | latest | yes | yes | yes | | | |
| 9 | latest | yes | yes | yes | | | |
| 8 | latest | yes | yes | | | | |
| 7 | latest | yes | yes | | | | |
| 6 | latest | yes | yes | | | | |
| 5 | latest | yes | yes | | | | |

In the header menu we can find **preconfigured sandboxes**, where we could **check all the features**.
To focus on a particular one, simply prefix it with `fdescribe` or `fit`.
Expand Down
4 changes: 4 additions & 0 deletions e2e/a19/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/dist
/node_modules
/src/app
/src/test
1 change: 1 addition & 0 deletions e2e/a19/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.13.0
Loading

0 comments on commit b6b24d5

Please sign in to comment.