Skip to content

Commit 13151f9

Browse files
authored
Merge pull request #68 from getlarge/67-chore-move-to-nx-workspace
chore: move to nx workspace
2 parents 2b95a1b + 8644024 commit 13151f9

File tree

190 files changed

+13137
-52509
lines changed

Some content is hidden

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

190 files changed

+13137
-52509
lines changed

.eslintrc.js

-75
This file was deleted.

.eslintrc.json

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["**/*"],
4+
"plugins": ["@nx"],
5+
"overrides": [
6+
{
7+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
8+
"rules": {
9+
"@nx/enforce-module-boundaries": [
10+
"error",
11+
{
12+
"enforceBuildableLibDependency": true,
13+
"allow": [],
14+
"depConstraints": [
15+
{
16+
"sourceTag": "*",
17+
"onlyDependOnLibsWithTags": ["*"]
18+
}
19+
]
20+
}
21+
]
22+
}
23+
},
24+
{
25+
"files": ["*.ts", "*.tsx"],
26+
"extends": ["plugin:@nx/typescript", "eslint:recommended", "plugin:@typescript-eslint/recommended"],
27+
"plugins": [
28+
"@typescript-eslint/eslint-plugin",
29+
"unused-imports",
30+
"import",
31+
"max-params-no-constructor",
32+
"simple-import-sort"
33+
],
34+
"rules": {
35+
"arrow-parens": "off",
36+
"complexity": "error",
37+
"interface-name": "off",
38+
"max-depth": "error",
39+
"max-lines": [
40+
"error",
41+
{
42+
"max": 400
43+
}
44+
],
45+
"max-lines-per-function": [
46+
"error",
47+
{
48+
"max": 50
49+
}
50+
],
51+
"max-nested-callbacks": [
52+
"error",
53+
{
54+
"max": 3
55+
}
56+
],
57+
"max-params": ["error", 10],
58+
"max-params-no-constructor/max-params-no-constructor": ["error", 4],
59+
"member-access": "off",
60+
"no-console": [
61+
"error",
62+
{
63+
"allow": ["error", "warn", "info", "table"]
64+
}
65+
],
66+
"no-duplicate-imports": "error",
67+
"no-empty": "error",
68+
"no-fallthrough": "error",
69+
"no-param-reassign": "error",
70+
"no-unreachable": "error",
71+
"no-unreachable-loop": "error",
72+
"no-var": "error",
73+
"object-literal-sort-keys": "off",
74+
"prefer-const": "error",
75+
"quotes": [
76+
"warn",
77+
"single",
78+
{
79+
"avoidEscape": true
80+
}
81+
],
82+
"simple-import-sort/imports": [
83+
"error",
84+
{
85+
"groups": [
86+
// Side effects.
87+
["^\\u0000"],
88+
// 3rd party.
89+
["^@?\\w"],
90+
// Anything not fitting group above.
91+
["^"],
92+
// Relative imports.
93+
["^\\."]
94+
]
95+
}
96+
],
97+
"simple-import-sort/exports": "error"
98+
}
99+
},
100+
{
101+
"files": ["*.js", "*.jsx"],
102+
"extends": ["plugin:@nx/javascript"],
103+
"rules": {}
104+
},
105+
{
106+
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
107+
"env": {
108+
"jest": true
109+
},
110+
"rules": {}
111+
}
112+
]
113+
}

.github/workflows/node.yml

+22-27
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
paths-ignore:
66
- 'README.md'
7-
- 'renovate.json'
87
- '**/package-lock.json'
98
branches:
109
- main
@@ -16,7 +15,6 @@ on:
1615
- ready_for_review
1716
paths-ignore:
1817
- 'README.md'
19-
- 'renovate.json'
2018
- '**/package-lock.json'
2119
branches:
2220
- main
@@ -38,7 +36,7 @@ jobs:
3836

3937
strategy:
4038
matrix:
41-
node-version: [16.x, 18.x]
39+
node-version: [18.x, 20.x]
4240

4341
services:
4442
rabbitmq:
@@ -53,51 +51,49 @@ jobs:
5351

5452
steps:
5553
- name: Check out repository code
56-
uses: actions/checkout@v3
54+
uses: actions/checkout@v4
5755
with:
5856
fetch-depth: 0
5957
ref: ${{ github.head_ref }}
6058

6159
- name: Use Node.js ${{ matrix.node-version }}
62-
uses: actions/setup-node@v3
60+
uses: actions/setup-node@v4
6361
with:
6462
node-version: ${{ matrix.node-version }}
65-
66-
- name: Cache Node.js modules
67-
uses: actions/cache@v3
68-
with:
69-
path: ~/.npm
70-
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
71-
restore-keys: |
72-
${{ runner.OS }}-node-
73-
${{ runner.OS }}-
63+
cache: 'npm'
7464

7565
- name: Derive appropriate SHAs for base and head for `nx affected` commands
7666
id: set-sha
77-
uses: nrwl/nx-set-shas@v3
67+
uses: nrwl/nx-set-shas@v4
7868

7969
- name: Install dependencies
80-
run: npm run bootstrap
70+
run: npm ci
71+
72+
- uses: 8BitJonny/[email protected]
73+
id: current-pr
74+
75+
- if: steps.current-pr.outputs.number != 'null' && github.ref_name != 'main'
76+
# This line is needed for nx affected to work when CI is running on a PR
77+
run: git branch --track main origin/main
8178

8279
# Boot package has issues with @asyncapi monorepo
8380
# - name: Scan dependencies with Audit CI
84-
# run: npm run scan:deps
81+
# run: npm run scan:deps
8582

86-
- name: Build packages
87-
run: npm run build:affected
83+
- run: npx nx format:check
8884

89-
- name: Run Jest tests
90-
run: npm run test:cov:affected
85+
- name: Run checks
9186
env:
9287
CI: true
9388
S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
9489
S3_BUCKET: ${{ secrets.S3_BUCKET }}
9590
S3_REGION: ${{ secrets.S3_REGION }}
9691
S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }}
9792
S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
93+
run: npx nx affected -t lint,test,build --parallel=3
9894

9995
- name: Upload coverage
100-
uses: actions/upload-artifact@v3
96+
uses: actions/upload-artifact@v4
10197
with:
10298
name: coverage-${{ matrix.node-version }}
10399
path: ./coverage
@@ -110,16 +106,16 @@ jobs:
110106

111107
strategy:
112108
matrix:
113-
node-version: [16.x]
109+
node-version: [18.x]
114110

115111
steps:
116112
- name: Check out repository code
117-
uses: actions/checkout@v3
113+
uses: actions/checkout@v4
118114
with:
119115
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
120116

121117
- name: Use Node.js ${{ matrix.node-version }}
122-
uses: actions/setup-node@v3
118+
uses: actions/setup-node@v4
123119
with:
124120
node-version: ${{ matrix.node-version }}
125121

@@ -128,7 +124,7 @@ jobs:
128124
uses: martinbeentjes/npm-get-version-action@main
129125

130126
- name: Retrieve coverage
131-
uses: actions/download-artifact@v3
127+
uses: actions/download-artifact@v4
132128
with:
133129
name: coverage-${{ matrix.node-version }}
134130
path: ./coverage
@@ -137,7 +133,6 @@ jobs:
137133
uses: sonarsource/sonarcloud-github-action@master
138134
env:
139135
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140-
SONAR_URL: ${{ secrets.SONAR_URL }}
141136
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
142137
with:
143138
args: >

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,8 @@ dist
109109
# Sonar scanner
110110
.scannerwork
111111

112-
junit.xml
112+
junit.xml
113+
114+
#Nx
115+
.tmp/
116+
.nx/cache

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Add files here to ignore them from prettier formatting
2+
/dist
3+
/coverage
4+
/.nx/cache

.prettierrc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"singleQuote": true,
3+
"arrowParens": "always",
4+
"bracketSpacing": true,
5+
"endOfLine": "auto",
6+
"useTabs": false,
7+
"semi": true,
8+
"trailingComma": "all",
9+
"tabWidth": 2,
10+
"printWidth": 120
11+
}

.prettierrc.js

-11
This file was deleted.

.vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["nrwl.angular-console", "esbenp.prettier-vscode", "firsttris.vscode-jest-runner"]
3+
}

0 commit comments

Comments
 (0)