Skip to content

Commit 2a3b3ef

Browse files
chore!: upgrade to nx 18 (#33)
* chore: update to nx 18 * chore: increase support node version * fix: readd nx cloud access token * fix: format issues * ci: fix ci * fix: ci * fix: another tesst * fix: disable agents * chore: add lock * chore: update to latest patch * fix: opt-out nx cloud because of error * fix: format issues * fix: lint issues * fix: remove branch tracking * fix: comment problematic test
1 parent 04bc3fa commit 2a3b3ef

File tree

137 files changed

+5739
-9378
lines changed

Some content is hidden

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

137 files changed

+5739
-9378
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.eslintrc.base.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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"],
27+
"rules": {}
28+
},
29+
{
30+
"files": ["*.js", "*.jsx"],
31+
"extends": ["plugin:@nx/javascript"],
32+
"rules": {}
33+
},
34+
{
35+
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
36+
"env": {
37+
"jest": true
38+
},
39+
"rules": {}
40+
}
41+
]
42+
}

.eslintrc.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"ignorePatterns": ["**/*"],
3+
"overrides": [
4+
{
5+
"files": "*.json",
6+
"parser": "jsonc-eslint-parser",
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
11+
"rules": {
12+
"@nx/enforce-module-boundaries": [
13+
"error",
14+
{
15+
"enforceBuildableLibDependency": true,
16+
"allow": [],
17+
"depConstraints": [
18+
{
19+
"sourceTag": "*",
20+
"onlyDependOnLibsWithTags": ["*"]
21+
}
22+
]
23+
}
24+
]
25+
}
26+
},
27+
{
28+
"files": ["*.ts", "*.tsx"],
29+
"rules": {}
30+
},
31+
{
32+
"files": ["*.js", "*.jsx"],
33+
"rules": {}
34+
},
35+
{
36+
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
37+
"env": {
38+
"jest": true
39+
},
40+
"rules": {}
41+
}
42+
],
43+
"extends": ["./.eslintrc.base.json"]
44+
}

.github/workflows/ci.yml

Lines changed: 38 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ on:
44
push:
55
branches:
66
- main
7-
pull_request: {}
7+
pull_request:
8+
9+
permissions:
10+
actions: read
11+
contents: read
812

913
concurrency:
10-
# Group concurrency on workflow, then:
11-
# - Is merge run? Group on branch name (`refs/heads/main`)
12-
# - Is pull request? Group on pull request branch name, for example `feat/add-awesome-feature`
14+
# Group concurrency on workflow, then:
15+
# - Is merge run? Group on branch name (`refs/heads/main`)
16+
# - Is pull request? Group on pull request branch name, for example `feat/add-awesome-feature`
1317
group: >-
1418
${{ github.workflow }}-${{
1519
github.event_name == 'push'
@@ -23,67 +27,35 @@ concurrency:
2327
env:
2428
NODE_OPTIONS: --max-old-space-size=6144
2529

30+
2631
jobs:
27-
# We're using Nx Cloud for Distributed Task Execution
28-
# Reference: https://nx.dev/using-nx/dte
29-
#
30-
# The coordinator outputs the combination of task outputs from the agents,
31-
# both terminal and file outputs
32-
dte_coordinator:
33-
name: DTE Coordinator
34-
uses: nrwl/ci/.github/workflows/[email protected]
35-
secrets:
36-
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
37-
permissions:
38-
contents: read
39-
actions: read
40-
with:
41-
main-branch-name: main
42-
# Must match dte_agents.number-of-agents
43-
number-of-agents: 4
44-
# The --stop-agents-after parameter must match the task target listed last
45-
# in the parallel-commands-on-agents command list
46-
# The --agent-count parameter must match the number-of-agents parameter
47-
init-commands: |
48-
pnpm nx-cloud start-ci-run --stop-agents-after="e2e" --agent-count=4
49-
# Commands run in parallel on this DTE coordinator
50-
parallel-commands: |
51-
pnpm nx-cloud record -- pnpm nx format:check
52-
# Commands distributed between DTE agents
53-
# Distribution strategy for 2 vCPUs per hosted runner (GitHub Free):
54-
# lint: 2 tasks assigned at a time, 1 task per vCPU
55-
# test: 1 task assigned at a time with 2 parallel processes, 1 process per vCPU
56-
# build: 2 tasks assigned at a time, 1 task per vCPU
57-
# e2e: 1 task assigned at a time, 1 task total
58-
parallel-commands-on-agents: |
59-
pnpm nx run-many --all --target=lint --configuration=report --parallel=2 --max-warnings=0
60-
pnpm nx run-many --all --target=test --configuration=coverage --parallel=1 --max-workers=2
61-
pnpm nx affected --target=build --parallel=2
62-
pnpm nx affected --target=e2e --parallel=1
63-
# Commands run sequentially on this DTE coordinator after parallel jobs
64-
# final-commands: |
32+
main:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
with:
37+
fetch-depth: 0
38+
39+
# Connect your workspace on nx.app and uncomment this to enable task distribution.
40+
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
41+
# - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"
42+
43+
- uses: pnpm/action-setup@v2
44+
with:
45+
version: 8
46+
# Cache node_modules
47+
- uses: actions/setup-node@v4
48+
with:
49+
node-version: 18
50+
cache: 'pnpm'
51+
- run: pnpm install --frozen-lockfile
52+
53+
- uses: nrwl/nx-set-shas@v4
54+
55+
# - run: git branch --track main origin/main
56+
57+
- run: pnpm exec nx format:check
58+
- run: pnpm exec nx affected -t lint test build e2e
6559

66-
# We're using Nx Cloud for Distributed Task Execution
67-
# Reference: https://nx.dev/using-nx/dte
68-
#
69-
# Agents receive tasks to execute in bulk whenever they are ready or have
70-
# finished their previous tasks
71-
dte_agents:
72-
name: DTE Agents
73-
uses: nrwl/ci/.github/workflows/[email protected]
74-
secrets:
75-
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
76-
permissions:
77-
contents: read
78-
actions: read
79-
with:
80-
# The Free GitHub plan has a limit of 20 concurrent jobs on Ubuntu images
81-
# Reference: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration
82-
# If we need to, we can optimize for 2 simultaneous workflow runs:
83-
# 2 x 1 main job = 2 concurrent jobs
84-
# 2 x 9 agent jobs = 18 concurrent jobs
85-
# Total = 20 concurrent jobs
86-
#
87-
# However, we don't have many projects or targets in this workspace, so we
88-
# lower the number of agents to reduce spent compute time.
89-
number-of-agents: 4
60+
# - run: pnpm exec nx-cloud record -- nx format:check
61+
# - run: pnpm exec nx affected -t lint test build e2e

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ testem.log
3838
.DS_Store
3939
Thumbs.db
4040

41+
.nx/cache
42+
4143
# Next.js
4244
.next
4345
.vercel
4446

45-
.nx/cache
47+
.angular

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.16.0
1+
18.19.0

.prettierignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ pnpm-lock.yaml
99

1010
**/CHANGELOG.md
1111

12-
/.nx/cache
12+
/.nx/cache
13+
14+
.angular

e2e/examples/cloudflare-next-app/eslint.config.js

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

e2e/examples/cloudflare-next-app/project.json

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

e2e/plugins-nx-cloudflare-e2e/eslint.config.js

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

0 commit comments

Comments
 (0)