Skip to content

Commit

Permalink
feat: a18 support
Browse files Browse the repository at this point in the history
  • Loading branch information
satanTime committed Apr 14, 2024
1 parent 34cc06e commit e2c1dff
Show file tree
Hide file tree
Showing 31 changed files with 19,969 additions and 83 deletions.
7 changes: 7 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ executors:
docker:
- image: satantime/puppeteer-node:20.12.1
resource_class: medium
a18:
docker:
- image: satantime/puppeteer-node:20.12.1
resource_class: medium

commands:
install:
Expand Down Expand Up @@ -602,6 +606,7 @@ workflows:
- a15
- a16
- a17
- a18

# testing a5 (exceptional)
- E2E Test:
Expand Down Expand Up @@ -680,6 +685,7 @@ workflows:
- a15
- a16
- a17
- a18

# testing lib build
- Lib Build:
Expand All @@ -705,6 +711,7 @@ workflows:
- a15
- a16
- a17
- a18

# 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 @@ -14,6 +14,7 @@
/e2e/a15/node_modules
/e2e/a16/node_modules
/e2e/a17/node_modules
/e2e/a18/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 @@ -28,6 +28,7 @@ settings:
- ./e2e/a15/tsconfig.json
- ./e2e/a16/tsconfig.json
- ./e2e/a17/tsconfig.json
- ./e2e/a18/tsconfig.json
- ./e2e/jasmine/tsconfig.json
- ./e2e/jest/tsconfig.json
- ./e2e/min/tsconfig.json
Expand Down Expand Up @@ -59,6 +60,7 @@ overrides:
- ./e2e/a15/tsconfig.json
- ./e2e/a16/tsconfig.json
- ./e2e/a17/tsconfig.json
- ./e2e/a18/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 @@ -137,6 +137,14 @@ updates:
commit-message:
prefix: 'chore(deps)'

- package-ecosystem: 'npm'
directory: /e2e/a18/
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
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx commitlint --edit $1
5 changes: 1 addition & 4 deletions .husky/post-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

git update-index --again
git update-index --again
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
npm run lint
npm run ts:check
5 changes: 1 addition & 4 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run test
npm run test
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ renovate.json
.gitignore
.prettierignore

.husky/
dist/
docs/**/*.md
docs/.docusaurus
Expand All @@ -15,8 +16,8 @@ e2e/*/src/test
e2e/nx/apps/*/src/app
e2e/nx/apps/*/src/test
node_modules/
tests-e2e/.angular
test-reports/
tests-e2e/.angular
tmp/

**/*.sh
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ The next step is:
- 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 docker-compose.sh a17` in `ng-mocks` to install dependencies for `a17`, it might require `--force` at this moment
- execute `sh docker-compose.sh a17` in `ng-mocks` to install dependencies for `a17`, it might require `--force` at this moment in `docker-compose.yml` in the command for the new version

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

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ 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 |
Expand Down
9 changes: 9 additions & 0 deletions docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ if [ "$1" = "" ] || [ "$1" = "a17" ]; then
cd ../..
fi

if [ "$1" = "" ] || [ "$1" = "a18" ]; then
docker-compose up --build -- a18 && \
cd ./e2e/a18 && \
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 docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,18 @@ services:
- install
- --no-audit

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

jasmine:
image: satantime/puppeteer-node:20.12.1
working_dir: /app
Expand Down
1 change: 1 addition & 0 deletions docs/articles/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ 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 |
Expand Down
5 changes: 5 additions & 0 deletions docs/articles/migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Below you can find critical changes. They happen on major releases.

If you are facing an issue, despite the instructions, please, feel free to [contact us](need-help.md).

## From 17 to 18

There are no special cases.
The update should be straight forward.

## From 16 to 17

There are no special cases.
Expand Down
4 changes: 4 additions & 0 deletions e2e/a18/.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/a18/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.12.2
73 changes: 73 additions & 0 deletions e2e/a18/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"a18": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/a18",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.json"
},
"configurations": {
"production": {
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "a18:build:production"
},
"development": {
"buildTarget": "a18:build:development"
}
},
"defaultConfiguration": "development"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.json",
"karmaConfig": "karma.conf.js"
}
}
}
},
"lib": {
"projectType": "library",
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "ng-package.json",
"tsConfig": "tsconfig.json"
}
}
}
}
}
}
13 changes: 13 additions & 0 deletions e2e/a18/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export default {
preset: 'jest-preset-angular',
workerIdleMemoryLimit: '1024MB',
maxWorkers: 1,
setupFilesAfterEnv: ['<rootDir>/src/setup-jest.ts'],
testEnvironmentOptions: {
url: 'http://localhost',
},
testPathIgnorePatterns: ['<rootDir>/src/test.ts'],
transform: {
'^.+\\.(ts|mjs|js|html)$': ['jest-preset-angular', { tsconfig: './tsconfig.json' }],
},
};
36 changes: 36 additions & 0 deletions e2e/a18/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

process.env.CHROME_BIN = require('puppeteer').executablePath();

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
],
client: {
clearContext: false, // leave Jasmine Spec Runner output visible in browser
jasmine: {
random: false,
},
},
customLaunchers: {
ChromeCi: {
base: 'ChromeHeadless',
flags: ['--headless', '--disable-gpu', '--no-sandbox', '--disable-dev-shm-usage'],
},
},
reporters: ['kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['ChromeCi'],
singleRun: true,
});
};
8 changes: 8 additions & 0 deletions e2e/a18/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
"dest": "./dist/lib",
"lib": {
"entryFile": "src/app/app.module.ts"
},
"allowedNonPeerDependencies": ["@angular/", "rxjs", "zone.js"]
}
Loading

0 comments on commit e2c1dff

Please sign in to comment.