Skip to content

Commit e5ed3c2

Browse files
authored
feat: migrate to Nx 12 (#14)
- Use Nx 12.0. - Use Node.js 14.x. - Add manual trigger to CI workflow - Lock PNPM to version 5.x because of Cypress issues with PNPM version 6.x and Node.js 14.x
1 parent 3a6dcf8 commit e5ed3c2

File tree

56 files changed

+7795
-9048
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+7795
-9048
lines changed

.eslintrc.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@
3131
"sourceTag": "type:tool",
3232
"onlyDependOnLibsWithTags": ["type:tool"]
3333
},
34-
{ "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] }
34+
{
35+
"sourceTag": "*",
36+
"onlyDependOnLibsWithTags": ["*"]
37+
}
3538
]
3639
}
3740
]
@@ -40,7 +43,6 @@
4043
{
4144
"files": ["*.ts", "*.tsx"],
4245
"extends": ["plugin:@nrwl/nx/typescript"],
43-
"parserOptions": { "project": "./tsconfig.*?.json" },
4446
"rules": {}
4547
},
4648
{

.github/workflows/ci.yml

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,43 @@ name: '@nxworker CI pipeline'
33
env:
44
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
55
NODE_OPTIONS: --max_old_space_size=6144
6+
node-version: 14.x
67
NX_BRANCH: ${{ github.event.number }}
78
NX_RUN_GROUP: ${{ github.run_id }}
89
PNPM_STORE_PATH: ~/.pnpm-store
10+
PNPM_VERSION: 5.x
11+
is-feature-branch: ${{ github.ref != 'refs/heads/$BASE_BRANCH' && (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch') }}
12+
is-main-branch: ${{ github.ref == 'refs/heads/$BASE_BRANCH' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
913

1014
on:
1115
push:
12-
branches: [main]
13-
pull_request:
16+
branches:
17+
- main
18+
pull_request: {}
19+
workflow_dispatch: {}
1420

1521
jobs:
1622
lint:
1723
runs-on: ubuntu-latest
1824

1925
steps:
20-
- if: github.event_name == 'push'
26+
- if: ${{ env.is-main-branch }}
2127
uses: actions/checkout@v2
2228
# needed for nx affected command
23-
- if: github.event_name == 'pull_request'
29+
- if: ${{ env.is-feature-branch }}
2430
uses: actions/checkout@v2
2531
with:
2632
fetch-depth: 0
2733
# needed for nx affected command
28-
- if: github.event_name == 'pull_request'
34+
- if: ${{ env.is-feature-branch }}
2935
run: git fetch --no-tags --depth=1 origin $BASE_BRANCH
3036

31-
- name: Use Node.js
37+
- name: Use Node.js ${{ env.node-version }}
3238
uses: actions/setup-node@v2
3339
with:
34-
node-version: 12.x
40+
node-version: ${{ env.node-version }}
3541

36-
- run: npm install --global pnpm
42+
- run: npm install --global pnpm@$PNPM_VERSION
3743
- run: pnpm config set store-dir $PNPM_STORE_PATH
3844
- name: Cache PNPM store
3945
uses: actions/cache@v2
@@ -42,37 +48,35 @@ jobs:
4248
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
4349
restore-keys: |
4450
${{ runner.os }}-pnpm-
45-
- run:
46-
pnpm install --reporter silent --frozen-lockfile false
47-
--verify-store-integrity false
51+
- run: pnpm install
4852
- run: pnpm store prune
4953

50-
- if: github.event_name == 'push'
54+
- if: ${{ env.is-main-branch }}
5155
run: pnpm lint
52-
- if: github.event_name == 'pull_request'
56+
- if: ${{ env.is-feature-branch }}
5357
run: pnpm affected:lint -- --base=origin/$BASE_BRANCH
5458

5559
test:
5660
runs-on: ubuntu-latest
5761

5862
steps:
59-
- if: github.event_name == 'push'
63+
- if: ${{ env.is-main-branch }}
6064
uses: actions/checkout@v2
6165
# needed for nx affected command
62-
- if: github.event_name == 'pull_request'
66+
- if: ${{ env.is-feature-branch }}
6367
uses: actions/checkout@v2
6468
with:
6569
fetch-depth: 0
6670
# needed for nx affected command
67-
- if: github.event_name == 'pull_request'
71+
- if: ${{ env.is-feature-branch }}
6872
run: git fetch --no-tags --depth=1 origin $BASE_BRANCH
6973

70-
- name: Use Node.js
74+
- name: Use Node.js ${{ env.node-version }}
7175
uses: actions/setup-node@v2
7276
with:
73-
node-version: 12.x
77+
node-version: ${{ env.node-version }}
7478

75-
- run: npm install --global pnpm
79+
- run: npm install --global pnpm@$PNPM_VERSION
7680
- run: pnpm config set store-dir $PNPM_STORE_PATH
7781
- name: Cache PNPM store
7882
uses: actions/cache@v2
@@ -81,37 +85,35 @@ jobs:
8185
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
8286
restore-keys: |
8387
${{ runner.os }}-pnpm-
84-
- run:
85-
pnpm install --reporter silent --frozen-lockfile false
86-
--verify-store-integrity false
88+
- run: pnpm install
8789
- run: pnpm store prune
8890

89-
- if: github.event_name == 'push'
91+
- if: ${{ env.is-main-branch }}
9092
run: pnpm test
91-
- if: github.event_name == 'pull_request'
93+
- if: ${{ env.is-feature-branch }}
9294
run: pnpm affected:test -- --base=origin/$BASE_BRANCH
9395

9496
build:
9597
runs-on: ubuntu-latest
9698

9799
steps:
98-
- if: github.event_name == 'push'
100+
- if: ${{ env.is-main-branch }}
99101
uses: actions/checkout@v2
100102
# needed for nx affected command
101-
- if: github.event_name == 'pull_request'
103+
- if: ${{ env.is-feature-branch }}
102104
uses: actions/checkout@v2
103105
with:
104106
fetch-depth: 0
105107
# needed for nx affected command
106-
- if: github.event_name == 'pull_request'
108+
- if: ${{ env.is-feature-branch }}
107109
run: git fetch --no-tags --depth=1 origin $BASE_BRANCH
108110

109-
- name: Use Node.js
111+
- name: Use Node.js ${{ env.node-version }}
110112
uses: actions/setup-node@v2
111113
with:
112-
node-version: 12.x
114+
node-version: ${{ env.node-version }}
113115

114-
- run: npm install --global pnpm
116+
- run: npm install --global pnpm@$PNPM_VERSION
115117
- run: pnpm config set store-dir $PNPM_STORE_PATH
116118
- name: Cache PNPM store
117119
uses: actions/cache@v2
@@ -120,14 +122,12 @@ jobs:
120122
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
121123
restore-keys: |
122124
${{ runner.os }}-pnpm-
123-
- run:
124-
pnpm install --reporter silent --frozen-lockfile false
125-
--verify-store-integrity false
125+
- run: pnpm install
126126
- run: pnpm store prune
127127

128-
- if: github.event_name == 'push'
128+
- if: ${{ env.is-main-branch }}
129129
run: pnpm build
130-
- if: github.event_name == 'pull_request'
130+
- if: ${{ env.is-feature-branch }}
131131
run: pnpm affected:build -- --base=origin/$BASE_BRANCH
132132
- uses: actions/upload-artifact@v2
133133
with:
@@ -141,12 +141,12 @@ jobs:
141141
steps:
142142
- uses: actions/checkout@v2
143143

144-
- name: Use Node.js
144+
- name: Use Node.js ${{ env.node-version }}
145145
uses: actions/setup-node@v2
146146
with:
147-
node-version: 12.x
147+
node-version: ${{ env.node-version }}
148148

149-
- run: npm install --global pnpm
149+
- run: npm install --global pnpm@$PNPM_VERSION
150150
- run: pnpm config set store-dir $PNPM_STORE_PATH
151151
- name: Cache PNPM store
152152
uses: actions/cache@v2
@@ -155,9 +155,7 @@ jobs:
155155
key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
156156
restore-keys: |
157157
${{ runner.os }}-pnpm-
158-
- run:
159-
pnpm install --reporter silent --frozen-lockfile false
160-
--verify-store-integrity false
158+
- run: pnpm install
161159
- run: pnpm store prune
162160

163161
- run: pnpm e2e

e2e/examples/angular/nrwl-airlines/booking/desktop-app/jest.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ module.exports = {
44
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
55
globals: {
66
'ts-jest': {
7-
tsConfig: '<rootDir>/tsconfig.spec.json',
87
stringifyContentPathRegex: '\\.(html|svg)$',
98
astTransformers: {
109
before: [
1110
'jest-preset-angular/build/InlineFilesTransformer',
1211
'jest-preset-angular/build/StripStylesTransformer',
1312
],
1413
},
14+
tsconfig: '<rootDir>/tsconfig.spec.json',
1515
},
1616
},
1717
coverageDirectory:
1818
'../../../../../../coverage/e2e/examples/angular/nrwl-airlines/booking/desktop-app',
1919
snapshotSerializers: [
20-
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
21-
'jest-preset-angular/build/AngularSnapshotSerializer.js',
22-
'jest-preset-angular/build/HTMLCommentSerializer.js',
20+
'jest-preset-angular/build/serializers/no-ng-attributes',
21+
'jest-preset-angular/build/serializers/ng-snapshot',
22+
'jest-preset-angular/build/serializers/html-comment',
2323
],
2424
};

e2e/examples/angular/nrwl-airlines/booking/desktop-app/src/environments/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ export const environment = {
1313
* This import should be commented out in production mode because it will have a negative impact
1414
* on performance if an error is thrown.
1515
*/
16-
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
16+
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.

e2e/examples/angular/nrwl-airlines/booking/desktop-app/src/polyfills.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
/***************************************************************************************************
5656
* Zone JS is required by default for Angular itself.
5757
*/
58-
import 'zone.js/dist/zone'; // Included with Angular CLI.
58+
import 'zone.js'; // Included with Angular CLI.
5959

6060
/***************************************************************************************************
6161
* APPLICATION IMPORTS
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
import 'jest-preset-angular';
1+
import 'jest-preset-angular/setup-jest';

e2e/examples/angular/nrwl-airlines/booking/mobile-app/jest.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ module.exports = {
44
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
55
globals: {
66
'ts-jest': {
7-
tsConfig: '<rootDir>/tsconfig.spec.json',
87
stringifyContentPathRegex: '\\.(html|svg)$',
98
astTransformers: {
109
before: [
1110
'jest-preset-angular/build/InlineFilesTransformer',
1211
'jest-preset-angular/build/StripStylesTransformer',
1312
],
1413
},
14+
tsconfig: '<rootDir>/tsconfig.spec.json',
1515
},
1616
},
1717
coverageDirectory:
1818
'../../../../../../coverage/e2e/examples/angular/nrwl-airlines/booking/mobile-app',
1919
snapshotSerializers: [
20-
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
21-
'jest-preset-angular/build/AngularSnapshotSerializer.js',
22-
'jest-preset-angular/build/HTMLCommentSerializer.js',
20+
'jest-preset-angular/build/serializers/no-ng-attributes',
21+
'jest-preset-angular/build/serializers/ng-snapshot',
22+
'jest-preset-angular/build/serializers/html-comment',
2323
],
2424
};

e2e/examples/angular/nrwl-airlines/booking/mobile-app/src/environments/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ export const environment = {
1313
* This import should be commented out in production mode because it will have a negative impact
1414
* on performance if an error is thrown.
1515
*/
16-
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
16+
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.

e2e/examples/angular/nrwl-airlines/booking/mobile-app/src/polyfills.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
/***************************************************************************************************
5656
* Zone JS is required by default for Angular itself.
5757
*/
58-
import 'zone.js/dist/zone'; // Included with Angular CLI.
58+
import 'zone.js'; // Included with Angular CLI.
5959

6060
/***************************************************************************************************
6161
* APPLICATION IMPORTS
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
import 'jest-preset-angular';
1+
import 'jest-preset-angular/setup-jest';

0 commit comments

Comments
 (0)