Skip to content

Commit b24cc91

Browse files
authored
build: update nx to 15.8.9 (#495)
* ci: migrate from yarn to npm * ci: remove test with @next version workflow
1 parent 5c757a7 commit b24cc91

File tree

14 files changed

+30787
-7586
lines changed

14 files changed

+30787
-7586
lines changed

.github/actions/setup/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ runs:
1515
- name: Use Node.js
1616
uses: actions/setup-node@v3
1717
with:
18-
cache: 'yarn'
18+
cache: 'npm'
1919
node-version: ${{ inputs.node-version }}
2020
# This doesn't just set the registry url, but also sets
2121
# the right configuration in .npmrc that reads NPM token
2222
# from NPM_AUTH_TOKEN environment variable.
2323
# It actually creates a .npmrc in a temporary folder
2424
# and sets the NPM_CONFIG_USERCONFIG environment variable.
2525
registry-url: https://registry.npmjs.org
26-
- name: yarn install
26+
- name: npm install
2727
shell: bash
28-
run: yarn --frozen-lockfile --no-progress --non-interactive --prefer-offline
28+
run: npm ci

.github/workflows/angular-e2e-test.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
name: Angular E2E Test
22

3-
on:
4-
workflow_call:
5-
inputs:
6-
# Install @angular@next instead of the current one on the package.json
7-
install-next-version:
8-
type: boolean
9-
default: false
10-
required: false
3+
on: workflow_call
114

125
jobs:
136
angular-e2e-test:
@@ -23,11 +16,6 @@ jobs:
2316
with:
2417
node-version: ${{ matrix.node-version }}
2518

26-
# Perform angular e2e with @angular@next
27-
- if: inputs.install-next-version == true
28-
name: install @angular@next
29-
run: npx update-by-scope -t next @angular
30-
3119
- uses: ./.github/actions/download-build
3220

3321
- name: yarn link

.github/workflows/basic-test.yml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ on:
99
default: true
1010
required: false
1111

12-
# Install @nrwl@next instead of the current one on the package.json
13-
install-next-version:
14-
type: boolean
15-
default: false
16-
required: false
17-
1812
jobs:
1913
lint:
2014
runs-on: ubuntu-latest
@@ -24,17 +18,12 @@ jobs:
2418
fetch-depth: 0
2519
- uses: ./.github/actions/setup
2620

27-
# Perform lint with @nrwl@next
28-
- if: inputs.install-next-version == true
29-
name: install @nrwl@next
30-
run: npx update-by-scope -t next @nrwl
31-
3221
- name: Lint
3322
run: npx nx lint --outputFile=""
3423

3524
- if: inputs.reports == true
3625
name: Lint report
37-
run: npx nx lint --format ./tools/sonarqube-linter-reporter.js
26+
run: npx nx lint --format=./tools/sonarqube-linter-reporter.js
3827

3928
- if: inputs.reports == true
4029
name: Archive lint report results
@@ -51,11 +40,6 @@ jobs:
5140
fetch-depth: 0
5241
- uses: ./.github/actions/setup
5342

54-
# Perform build with @nrwl@next
55-
- if: inputs.install-next-version == true
56-
name: install @nrwl@next
57-
run: npx update-by-scope -t next @nrwl
58-
5943
- run: npx nx build
6044

6145
- name: Archive build result
@@ -78,11 +62,6 @@ jobs:
7862
with:
7963
node-version: ${{ matrix.node-version }}
8064

81-
# Perform unit test with @nrwl@next
82-
- if: inputs.install-next-version == true
83-
name: install @nrwl@next
84-
run: npx update-by-scope -t next @nrwl
85-
8665
- run: npx nx test --code-coverage
8766

8867
- if: matrix.node-version == 18 && inputs.reports == true

.github/workflows/e2e-test.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
name: E2E Test
22

3-
on:
4-
workflow_call:
5-
inputs:
6-
# Install @nrwl@next instead of the current one on the package.json
7-
install-next-version:
8-
type: boolean
9-
default: false
10-
required: false
3+
on: workflow_call
114

125
jobs:
136
e2e-test:
@@ -24,9 +17,4 @@ jobs:
2417
with:
2518
node-version: ${{ matrix.node-version }}
2619

27-
# Perform e2e with @nrwl@next
28-
- if: inputs.install-next-version == true
29-
name: install @nrwl@next
30-
run: npx update-by-scope -t next @nrwl
31-
3220
- run: npx nx e2e ngx-deploy-npm-e2e

.github/workflows/next-test.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

e2e/ngx-deploy-npm-e2e/integration/next.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ describe('Next', () => {
77
const nxPlugin = '@nrwl/next';
88

99
basicSetTestForLibs(libName, nxPlugin, {
10-
libGeneratorCommandOptions: '--style css',
10+
libGeneratorCommandOptions: '--style css --bundler rollup',
1111
});
1212
});

e2e/ngx-deploy-npm-e2e/integration/react-native.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('React Native', () => {
1919
beforeEach(() => {
2020
runNxCommand(`generate ${nxPlugin}:init`);
2121
runCommand(
22-
`yarn add -D @babel/preset-react @nrwl/web@${currentNrwlVersion}`
22+
`npm add -D @babel/preset-react @nrwl/web@${currentNrwlVersion}`
2323
);
2424
});
2525

e2e/ngx-deploy-npm-e2e/utils/install-deps.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { currentNrwlVersion } from './get-nrwl-current-version';
44
export function installDependencies(nxPlugin: string) {
55
beforeEach(() => {
66
const packageToInstall = `${nxPlugin}@${currentNrwlVersion}`;
7-
runCommand(`yarn add -D ${packageToInstall}`);
7+
8+
runCommand(`npm add -D ${packageToInstall}`);
9+
runCommand(`npx nx g ${nxPlugin}:init`);
810
}, 120000);
911
}

e2e/ngx-deploy-npm-e2e/utils/utils-ngx-deploy-npm.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
import { ensureNxProject, runNxCommand } from '@nrwl/nx-plugin/testing';
1+
import {
2+
ensureNxProject,
3+
runNxCommand,
4+
runPackageManagerInstall,
5+
} from '@nrwl/nx-plugin/testing';
26

37
export function initNgxDeployNPMProject() {
48
// Init project
59
beforeAll(() => {
610
ensureNxProject('ngx-deploy-npm', 'dist/packages/ngx-deploy-npm');
711

812
runNxCommand('generate ngx-deploy-npm:init');
13+
runPackageManagerInstall();
914
}, 120000);
1015
}
1116

jest.preset.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
const nxPreset = require('@nrwl/jest/preset');
22

3-
module.exports = { ...nxPreset };
3+
module.exports = {
4+
...nxPreset,
5+
/* TODO: Update to latest Jest snapshotFormat
6+
* By default Nx has kept the older style of Jest Snapshot formats
7+
* to prevent breaking of any existing tests with snapshots.
8+
* It's recommend you update to the latest format.
9+
* You can do this by removing snapshotFormat property
10+
* and running tests with --update-snapshot flag.
11+
* Example: "nx affected --targets=test --update-snapshot"
12+
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
13+
*/
14+
snapshotFormat: { escapeString: true, printBasicPrototype: true },
15+
};

0 commit comments

Comments
 (0)