Skip to content

Commit 2d2388d

Browse files
authoredSep 28, 2022
feat(dragula): updated angular 14 (#1065)
* feat(chore): updated angular 14 * fix(ci): fixed build and test in yml files * fix(ci): fixed build and test in yml files * fix(chore): updated peerdependencies * fix(chore): deleted unnecessery command
1 parent aae781b commit 2d2388d

23 files changed

+14176
-7471
lines changed
 

‎.eslintrc.json

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
{
2424
"files": ["*.ts", "*.tsx"],
2525
"extends": ["plugin:@nrwl/nx/typescript"],
26-
"parserOptions": { "project": "./tsconfig.*?.json" },
2726
"rules": {
2827
"semi": "off",
2928
"@typescript-eslint/semi": ["error"],

‎.github/workflows/on-push-or-pull.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ jobs:
5656
path: ${{ env.CACHE_DIST_PATH }}
5757
key: dist-${{ github.run_id }}
5858
- run: |
59-
npx nx build demo --runner cloud --configuration production
60-
npx nx build --runner cloud --configuration production
59+
npx nx build demo --configuration production
6160
6261
# run unit tests
6362
unit_tests_with_coverage:
@@ -73,7 +72,7 @@ jobs:
7372
with:
7473
path: ${{ env.CACHE_DIST_PATH }}
7574
key: dist-${{ github.run_id }}
76-
- run: npm run test -- --runner cloud --code-coverage
75+
- run: npx nx run-many --target=test --all --code-coverage
7776
continue-on-error: true
7877

7978
# run linting
@@ -86,7 +85,7 @@ jobs:
8685
with:
8786
path: ${{ env.CACHE_NODE_MODULES_PATH }}
8887
key: node_modules-${{ hashFiles('**/package-lock.json') }}
89-
- run: npm run lint -- --runner cloud
88+
- run: npm run lint
9089

9190
# firebase deploy preview
9291
firebase_preview:

‎.github/workflows/on-release.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ jobs:
5050
path: dist
5151
key: dist-${{ github.run_id }}
5252
- run: |
53-
npx nx build demo --runner cloud --configuration production
54-
npx nx build --runner cloud --configuration production
53+
npx nx build demo --configuration production
5554
5655
# update release notes in github
5756
update_release_draft:

‎apps/demo/.eslintrc.json

+17-29
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,30 @@
11
{
2-
"extends": ["../../.eslintrc.json"],
3-
"ignorePatterns": ["!**/*", "src/test.ts"],
2+
"extends": [
3+
"../../.eslintrc.json"
4+
],
5+
"ignorePatterns": [
6+
"!**/*"
7+
],
48
"overrides": [
59
{
6-
"files": ["*.ts"],
10+
"files": [
11+
"*.ts"
12+
],
713
"extends": [
814
"plugin:@nrwl/nx/angular",
915
"plugin:@angular-eslint/template/process-inline-templates"
1016
],
11-
"parserOptions": {
12-
"project": ["apps/demo/tsconfig.*?.json"]
13-
},
14-
"rules": {
15-
"@angular-eslint/directive-selector": [
16-
"off",
17-
{
18-
"type": "attribute",
19-
"prefix": "ngx-bootstrap-base",
20-
"style": "camelCase"
21-
}
22-
],
23-
"@angular-eslint/component-selector": [
24-
"off",
25-
{
26-
"type": "element",
27-
"prefix": "ngx-bootstrap-base",
28-
"style": "kebab-case"
29-
}
30-
],
31-
"@typescript-eslint/no-explicit-any": 0,
32-
"@angular-eslint/component-class-suffix": 0,
33-
"@angular-eslint/no-output-on-prefix": 0
34-
}
17+
"rules": {}
3518
},
3619
{
37-
"files": ["*.html"],
38-
"extends": ["plugin:@nrwl/nx/angular-template"],
20+
"files": [
21+
"*.html"
22+
],
23+
"extends": [
24+
"plugin:@nrwl/nx/angular-template"
25+
],
3926
"rules": {}
4027
}
4128
]
4229
}
30+

‎apps/demo/src/app/app.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
22
import { FormsModule } from '@angular/forms';
33
import { BrowserModule } from '@angular/platform-browser';
44
import { CommonModule } from '@angular/common';
5-
import {DragulaModule, DragulaService} from 'ng2-dragula';
5+
import { DragulaModule, DragulaService } from 'ng2-dragula';
66
import { DemoComponent } from './app.component';
77
import { BasicComponent } from './examples/01-basic.component';
88
import { EventsComponent } from './examples/02-events.component';

‎apps/demo/src/main.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import './polyfills';
12
import { enableProdMode } from '@angular/core';
23
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
34

‎apps/demo/tsconfig.app.json

+21-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,30 @@
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "../../dist/out-tsc",
5-
"module": "es2015",
6-
"types": []
5+
"types": ["node"],
6+
"forceConsistentCasingInFileNames": true,
7+
"target": "es2020"
78
},
89
"exclude": [
910
"src/test.ts",
1011
"**/*.spec.ts"
12+
],
13+
"files": [
14+
"./src/main.ts",
15+
"./src/polyfills.ts"
16+
],
17+
"include": [
18+
"./src/typings.d.ts"
19+
],
20+
"references": [
21+
{
22+
"path": "./tsconfig.app.json"
23+
},
24+
{
25+
"path": "./tsconfig.spec.json"
26+
},
27+
{
28+
"path": "./tsconfig.editor.json"
29+
}
1130
]
1231
}

‎apps/demo/tsconfig.spec.json

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"polyfills.ts"
1414
],
1515
"include": [
16-
"**/*.spec.ts",
1716
"**/*.d.ts"
1817
]
1918
}

‎jest.config.js

-5
This file was deleted.

‎jest.config.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const { getJestProjects } = require('@nrwl/jest');
2+
3+
export default {"projects": getJestProjects()};

‎jest.preset.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const nxPreset = require('@nrwl/jest/preset');
2-
1+
const nxPreset = require('@nrwl/jest/preset').default;
32
module.exports = {
4-
...nxPreset, ...{
3+
...nxPreset,
4+
...{
55
coverageReporters: ['text-summary', 'json', 'lcov']
66
}
7-
};
7+
}

‎libs/ng2-dragula/jest.config.js ‎libs/ng2-dragula/jest.config.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
module.exports = {
1+
/* eslint-disable */
2+
export default {
23
displayName: 'ng2-dragula',
34
preset: '../../jest.preset.js',
45
setupFilesAfterEnv: ['<rootDir>/src/spec/test-setup.ts'],
56
globals: {
67
'ts-jest': {
78
tsconfig: '<rootDir>/tsconfig.spec.json',
8-
stringifyContentPathRegex: '\\.(html|svg)$'
9-
},
9+
}
1010
},
11-
coverageDirectory: '../../coverage/ng2-dragula',
11+
coverageDirectory: '../../coverage/libs/ng2-dragula',
1212
snapshotSerializers: [
1313
'jest-preset-angular/build/serializers/no-ng-attributes',
1414
'jest-preset-angular/build/serializers/ng-snapshot',

‎libs/ng2-dragula/package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
"peerDependencies": {
3131
"rxjs": ">=6.0.0",
3232
"@types/dragula": "^2.1.34",
33-
"dragula": "^3.7.2"
33+
"dragula": "^3.7.2",
34+
"@angular/animations": "^14.0.0",
35+
"@angular/core": "^14.0.0",
36+
"@angular/common": "^14.0.0"
3437
},
3538
"files": [
3639
"dist",

‎libs/ng2-dragula/project.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"executor": "@nrwl/jest:jest",
3131
"outputs": ["coverage/ng2-dragula"],
3232
"options": {
33-
"jestConfig": "libs/ng2-dragula/jest.config.js",
33+
"jestConfig": "libs/ng2-dragula/jest.config.ts",
3434
"passWithNoTests": true
3535
}
3636
}

‎libs/ng2-dragula/scripts/matchers.ts

-21
This file was deleted.

‎libs/ng2-dragula/scripts/sauce-browsers.js

-18
This file was deleted.

‎libs/ng2-dragula/scripts/test.ts

-37
This file was deleted.

‎libs/ng2-dragula/scripts/typings.d.ts

-11
This file was deleted.

‎libs/ng2-dragula/tsconfig.spec.json

+11-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@
33
"compilerOptions": {
44
"outDir": "../../dist/out-tsc",
55
"module": "commonjs",
6-
"types": ["jest", "node"]
6+
"types": [
7+
"jest",
8+
"node"
9+
]
710
},
811
"files": [
9-
"src/spec/test-setup.ts"
1012
],
11-
"include": ["**/*.spec.ts", "**/*.d.ts"]
13+
"include": [
14+
"**/*.spec.ts",
15+
"**/*.test.ts",
16+
"**/*.d.ts",
17+
"jest.config.ts"
18+
]
1219
}
20+

‎nx.json

+19-23
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,40 @@
11
{
22
"npmScope": "demo",
3-
"affected": {
4-
"defaultBase": "development"
5-
},
63
"implicitDependencies": {
74
"angular.json": "*",
85
"package.json": "*",
6+
"tsconfig.json": "*",
97
"tslint.json": "*",
108
".eslintrc.json": "*",
11-
"nx.json": "*",
12-
"tsconfig.base.json": "*"
9+
"nx.json": "*"
1310
},
1411
"tasksRunnerOptions": {
15-
"cloud": {
16-
"runner": "@nrwl/nx-cloud",
17-
"options": {
18-
"cacheableOperations": [
19-
"build",
20-
"test",
21-
"lint",
22-
"e2e"
23-
],
24-
"canTrackAnalytics": false,
25-
"showUsageWarnings": true
26-
}
27-
},
2812
"default": {
29-
"runner": "@nrwl/workspace/tasks-runners/default",
13+
"runner": "nx/tasks-runners/default",
3014
"options": {
3115
"cacheableOperations": [
3216
"build",
3317
"lint",
3418
"test",
3519
"e2e"
36-
]
20+
],
21+
"parallel": 1
3722
}
3823
}
3924
},
40-
"cli": {
41-
"defaultCollection": "@nrwl/angular"
25+
"affected": {
26+
"defaultBase": "development"
27+
},
28+
"defaultProject": "demo",
29+
"generators": {
30+
"@schematics/angular:component": {
31+
"prefix": "",
32+
"styleext": "css"
33+
},
34+
"@schematics/angular:directive": {
35+
"prefix": ""
36+
}
4237
},
43-
"defaultProject": "demo"
38+
"$schema": "./node_modules/nx/schemas/nx-schema.json"
4439
}
40+

‎package-lock.json

+14,043-7,261
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+42-41
Original file line numberDiff line numberDiff line change
@@ -5,63 +5,64 @@
55
"scripts": {
66
"ng": "nx",
77
"start": "ng serve",
8-
"build": "ng build",
9-
"test": "nx run-many --all --target=test",
10-
"e2e": "ng e2e",
11-
"nx": "nx",
12-
"lint": "nx run-many --all --target=lint",
8+
"demo.build": "ng build",
9+
"demo.build-prod": "ng build",
10+
"build": "nx run ng2-dragula:build",
11+
"lint": "nx run-many --target=lint --all",
12+
"test": "nx run-many --target=test --all",
13+
"version": "nx run ng2-dragula:version",
14+
"pretest": "run-s lint build",
15+
"test-coverage": "nx run-many --all --target=test --codeCoverage",
1316
"postinstall": "node ./decorate-angular-cli.js"
1417
},
1518
"dependencies": {
16-
"@angular/animations": "~13.2.0",
17-
"@angular/common": "~13.2.0",
18-
"@angular/compiler": "~13.2.0",
19-
"@angular/core": "~13.2.0",
20-
"@angular/forms": "~13.2.0",
21-
"@angular/platform-browser": "~13.2.0",
22-
"@angular/platform-browser-dynamic": "~13.2.0",
23-
"@angular/router": "~13.2.0",
24-
"@nrwl/angular": "13.7.1",
25-
"@nrwl/workspace": "^13.7.1",
26-
"core-js": "^3.21.0",
19+
"@angular/animations": "14.2.2",
20+
"@angular/common": "14.2.2",
21+
"@angular/compiler": "14.2.2",
22+
"@angular/core": "14.2.2",
23+
"@angular/forms": "14.2.2",
24+
"@angular/platform-browser": "14.2.2",
25+
"@angular/platform-browser-dynamic": "14.2.2",
26+
"@angular/router": "14.2.2",
27+
"@nrwl/angular": "14.7.5",
28+
"@nrwl/workspace": "14.7.5",
2729
"rxjs": "~6.6.0",
28-
"tslib": "^2.3.1",
29-
"zone.js": "~0.11.4"
30+
"zone.js": "~0.11.5"
3031
},
3132
"devDependencies": {
32-
"@angular-devkit/build-angular": "~13.2.0",
33-
"@angular-eslint/eslint-plugin": "13.0.1",
34-
"@angular-eslint/eslint-plugin-template": "13.0.1",
35-
"@angular-eslint/template-parser": "13.0.1",
36-
"@angular/cli": "~13.2.0",
37-
"@angular/compiler-cli": "~13.2.0",
38-
"@nrwl/eslint-plugin-nx": "13.3.6",
39-
"@nrwl/jest": "^13.7.2",
40-
"@nrwl/linter": "13.3.6",
41-
"@nrwl/nx-cloud": "^13.1.2",
33+
"@angular-devkit/build-angular": "14.2.3",
34+
"@angular-eslint/eslint-plugin": "14.0.4",
35+
"@angular-eslint/eslint-plugin-template": "14.0.4",
36+
"@angular-eslint/template-parser": "14.0.4",
37+
"@angular/cli": "~14.2.0",
38+
"@angular/compiler-cli": "14.2.2",
39+
"@nrwl/eslint-plugin-nx": "14.7.5",
40+
"@nrwl/jest": "14.7.5",
41+
"@nrwl/linter": "14.7.5",
42+
"@nrwl/nx-cloud": "14.6.2",
4243
"@types/dragula": "^2.1.34",
43-
"@types/jest": "^27.4.0",
44-
"@types/node": "^12.11.1",
45-
"@typescript-eslint/eslint-plugin": "5.7.0",
46-
"@typescript-eslint/parser": "5.7.0",
44+
"@types/jest": "28.1.8",
45+
"@types/node": "18.7.1",
46+
"@typescript-eslint/eslint-plugin": "5.33.1",
47+
"@typescript-eslint/parser": "5.33.1",
4748
"dragula": "^3.7.2",
48-
"eslint": "8.4.1",
49+
"eslint": "8.15.0",
4950
"eslint-config-prettier": "8.3.0",
5051
"eslint-plugin-cypress": "2.12.1",
51-
"jest": "^27.4.7",
52-
"jest-preset-angular": "^11.1.0",
53-
"ng-packagr": "13.2.1",
54-
"ts-node": "~8.3.0",
55-
"ts-jest": "^27.1.3",
56-
"typescript": "~4.5.5",
57-
"@nrwl/workspace": "13.7.1",
52+
"jest": "28.1.3",
53+
"jest-preset-angular": "12.2.2",
54+
"jest-environment-jsdom": "28.1.1",
55+
"ng-packagr": "14.2.1",
56+
"ts-node": "10.9.1",
57+
"ts-jest": "28.0.8",
58+
"typescript": "4.7.4",
5859
"prettier": "^2.5.1",
59-
"@compodoc/compodoc": "^1.1.11",
6060
"codecov": "^3.8.2",
6161
"conventional-changelog-cli": "2.1.1",
6262
"conventional-github-releaser": "3.1.5",
6363
"rimraf": "*",
6464
"testdouble": "^3.16.1",
65+
"tslib": "^2.4.0",
6566
"rollup": "^2.51.1"
6667
}
6768
}

‎tsconfig.base.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"emitDecoratorMetadata": true,
1414
"experimentalDecorators": true,
1515
"importHelpers": true,
16-
"target": "es2017",
16+
"target": "es2020",
1717
"module": "es2020",
1818
"lib": [
1919
"es2020",

0 commit comments

Comments
 (0)
Please sign in to comment.