Skip to content

Commit 79f8524

Browse files
authored
Merge pull request #2099 from Hyperkid123/nx-merge
Nx merge
2 parents 7b58162 + db0ce42 commit 79f8524

File tree

879 files changed

+52147
-109338
lines changed

Some content is hidden

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

879 files changed

+52147
-109338
lines changed

.commitlintrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports ={
2+
extends: ['@commitlint/config-conventional'],
3+
// Ignore rules can be found here
4+
// https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/is-ignored/src/defaults.ts
5+
defaultIgnores: true,
6+
}

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ packages/*/**/*.js
1212
packages/create-crc-app/templates/fec.config.js
1313

1414
src/SmartComponents/SamplePage/
15+
16+
node_modules

.eslintrc.js

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,21 @@
11
const path = require('path');
22
const rulesDirPlugin = require('eslint-plugin-rulesdir');
3+
const { env } = require('process');
34
rulesDirPlugin.RULES_DIR = path.resolve(__dirname, './packages/eslint-config/lib/rules');
45

56
module.exports = {
6-
plugins: ['rulesdir', 'import'],
7-
extends: path.resolve(__dirname, './packages/eslint-config/index.js'),
7+
root: true,
8+
ignorePatterns: ['**/*', '!.eslintrc.js'],
9+
plugins: ['@nx', 'prettier'],
10+
extends: ['plugin:prettier/recommended', 'plugin:json/recommended', path.resolve(__dirname, './packages/eslint-config/index.js')],
811
globals: {
912
insights: 'readonly',
1013
},
11-
rules: {
12-
'no-prototype-builtins': 'off',
13-
'import/prefer-default-export': ['error'],
14-
'sort-imports': [
15-
2,
16-
{
17-
ignoreDeclarationSort: true,
18-
},
19-
],
20-
'react/no-unknown-property': ['error', { ignore: ['widget-type', 'widget-id', 'page-type', 'ouiaId'] }],
21-
'rulesdir/forbid-pf-relative-imports': 1,
22-
},
2314
overrides: [
2415
{
25-
files: ['packages/**/src/**/*.ts', 'packages/**/src/**/*.tsx', 'packages/types/*.ts'],
26-
parser: '@typescript-eslint/parser',
27-
plugins: ['@typescript-eslint'],
28-
extends: ['plugin:@typescript-eslint/recommended'],
16+
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
2917
rules: {
18+
'@nx/enforce-module-boundaries': 'off',
3019
'no-use-before-define': 'off',
3120
'@typescript-eslint/no-use-before-define': ['error'],
3221
'react/prop-types': 'off',
@@ -35,15 +24,46 @@ module.exports = {
3524
},
3625
},
3726
{
38-
files: [
39-
'packages/pdf-generator/src/**/*.js',
40-
'packages/**/src/**/*__mock__*/**/*.js',
41-
'packages/**/src/**/*__mocks__*/**/*.js',
42-
'packages/create-crc-app/**/*.js',
43-
],
27+
files: ['*.ts', '*.tsx'],
28+
extends: ['plugin:@nx/typescript'],
29+
rules: {
30+
'react/react-in-jsx-scope': 'off',
31+
'react/prop-types': 'off',
32+
'no-prototype-builtins': 'off',
33+
'@typescript-eslint/ban-ts-comment': 'off',
34+
},
35+
},
36+
{
37+
files: ['*.js', '*.jsx'],
38+
extends: ['plugin:@nx/javascript'],
4439
rules: {
45-
'import/prefer-default-export': 'off',
40+
'no-prototype-builtins': 'off',
41+
'react/react-in-jsx-scope': 'off',
4642
},
4743
},
44+
{
45+
files: ['*.spec.ts', '*.spec.tsx', '*.spec.js', '*.spec.jsx', '*.test.ts', '*.test.tsx', '*.test.js', '*.test.jsx'],
46+
env: {
47+
jest: true,
48+
},
49+
rules: {},
50+
},
51+
{
52+
files: ['*.ct.js', '*.ct.jsx', '*.ct.ts', '*.ct.tsx', '*.cy.js', '*.cy.jsx', '*.cy.ts', '*.cy.tsx'],
53+
extends: ['plugin:cypress/recommended'],
54+
},
4855
],
56+
rules: {
57+
'@nx/dependency-checks': 'off',
58+
'no-prototype-builtins': 'off',
59+
'sort-imports': [
60+
2,
61+
{
62+
ignoreDeclarationSort: true,
63+
},
64+
],
65+
'react/no-unknown-property': ['error', { ignore: ['widget-type', 'widget-id', 'page-type', 'ouiaId'] }],
66+
'rulesdir/forbid-pf-relative-imports': 1,
67+
'@typescript-eslint/ban-ts-comment': 'off',
68+
},
4969
};

.github/actions/cache/action.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Node modules cache
2+
description: Retrieve and cache project node_modules
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Checkout
7+
uses: actions/checkout@v4
8+
with:
9+
fetch-depth: 0
10+
# cache node modules for all jobs to use
11+
- uses: actions/cache@v4
12+
id: node_modules-cache
13+
with:
14+
path: |
15+
**/node_modules
16+
key: install-cache-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Cypress runner cache
2+
description: Retrieve and cache the cypress runner
3+
runs:
4+
using: "composite"
5+
steps:
6+
# cache cypress runner
7+
- uses: actions/cache@v4
8+
id: cypress-cache
9+
with:
10+
path: ~/.cache/Cypress
11+
key: cypress-runner-cache-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}

.github/workflows/ci.yaml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Frontend components CI pipeline
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
- nx
7+
push:
8+
branches:
9+
- master
10+
- nx
11+
12+
jobs:
13+
install:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- uses: nrwl/nx-set-shas@v4
21+
- uses: './.github/actions/cache'
22+
- uses: './.github/actions/cypress-cache'
23+
- name: Install dependencies
24+
run: npm i
25+
build:
26+
runs-on: ubuntu-latest
27+
needs: install
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
- name: Use Node.js 20.x
34+
uses: actions/setup-node@v3
35+
with:
36+
node-version: 20.x
37+
- uses: nrwl/nx-set-shas@v4
38+
- uses: './.github/actions/cache'
39+
- name: Build
40+
run: npm run build
41+
unit-test:
42+
runs-on: ubuntu-latest
43+
needs: [install]
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v4
47+
with:
48+
fetch-depth: 0
49+
- name: Use Node.js 20.x
50+
uses: actions/setup-node@v3
51+
with:
52+
node-version: 20.x
53+
- uses: nrwl/nx-set-shas@v4
54+
- uses: './.github/actions/cache'
55+
- name: Run unit tests
56+
run: npm run test:unit
57+
component-test:
58+
runs-on: ubuntu-latest
59+
needs: install
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
with:
64+
fetch-depth: 0
65+
- uses: nrwl/nx-set-shas@v4
66+
- uses: './.github/actions/cache'
67+
- uses: './.github/actions/cypress-cache'
68+
- name: Install deps
69+
shell: bash
70+
run: npm i
71+
- name: Run component tests
72+
uses: cypress-io/github-action@v6
73+
with:
74+
command: npx nx affected -t test:component --exclude=demo --configuration=ci --parallel=1
75+
lint:
76+
runs-on: ubuntu-latest
77+
needs: install
78+
steps:
79+
- name: Checkout
80+
uses: actions/checkout@v4
81+
with:
82+
fetch-depth: 0
83+
- uses: nrwl/nx-set-shas@v4
84+
- uses: './.github/actions/cache'
85+
- name: Lint
86+
run: npx nx affected -t test:lint --exclude=demo
87+
commitlint:
88+
needs: [install]
89+
runs-on: ubuntu-latest
90+
steps:
91+
- name: Checkout
92+
uses: actions/checkout@v4
93+
with:
94+
fetch-depth: 0
95+
- uses: './.github/actions/cache'
96+
- name: install
97+
shell: bash
98+
run: npm i
99+
- name: Validate current commit on push
100+
shell: bash
101+
if: github.event_name == 'push'
102+
run: npx commitlint --last --verbose
103+
- name: Validate PR commits
104+
shell: bash
105+
if: github.event_name == 'pull_request'
106+
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
107+
check-circular-imports:
108+
runs-on: ubuntu-latest
109+
needs: install
110+
steps:
111+
- name: Checkout
112+
uses: actions/checkout@v4
113+
with:
114+
fetch-depth: 0
115+
- uses: './.github/actions/cache'
116+
- name: install
117+
shell: bash
118+
run: npm i
119+
- uses: nrwl/nx-set-shas@v4
120+
- uses: './.github/actions/cache'
121+
- name: Check circular imports
122+
run: npx nx affected -t test:circular-dependencies --exclude=demo

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,11 @@ packages/**/.cache
3737

3838
# Ibutsu test reports
3939
ibutsu-report
40+
41+
42+
43+
.nx/cache
44+
.nx/workspace-data
45+
tmp
46+
47+
packages/docs/pages/fec

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no-install commitlint --edit $1

.husky/pre-push

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
npx --no-install nx affected -t lint
2+
npx --no-install nx affected -t test:unit --exclude=demo
3+
npx --no-install nx affected -t test:component --exclude=demo --parallel=1
4+
npx --no-install nx affected -t build --exclude=demo

.travis.yml

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

0 commit comments

Comments
 (0)