Skip to content

Commit 45501c0

Browse files
committed
refactor: wip
1 parent 6d445b0 commit 45501c0

File tree

5 files changed

+13
-40
lines changed

5 files changed

+13
-40
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ jobs:
2929
- name: Install dependencies
3030
run: npm ci
3131
- name: Check formatting of affected files
32-
env:
33-
NODE_OPTIONS: --import tsx
34-
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
35-
run: NX_DAEMON=false npx nx format:check --skipNxCache
32+
run: NX_DAEMON=false npm run tsx-nx -- format:check --skipNxCache
3633

3734
lint:
3835
runs-on: ubuntu-latest
@@ -52,10 +49,7 @@ jobs:
5249
- name: Install dependencies
5350
run: npm ci
5451
- name: Lint affected projects
55-
env:
56-
NODE_OPTIONS: --import tsx
57-
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
58-
run: npx nx affected -t lint --parallel=3
52+
run: npm run tsx-nx -- affected -t lint --parallel=3
5953

6054
unit-test:
6155
strategy:
@@ -79,10 +73,7 @@ jobs:
7973
- name: Install dependencies
8074
run: npm ci
8175
- name: Unit test affected projects
82-
env:
83-
NODE_OPTIONS: --import tsx
84-
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
85-
run: npx nx affected -t unit-test --parallel=3
76+
run: npm run tsx-nx -- affected -t unit-test --parallel=3
8677

8778
integration-test:
8879
strategy:
@@ -106,10 +97,7 @@ jobs:
10697
- name: Install dependencies
10798
run: npm ci
10899
- name: Integration test affected projects
109-
env:
110-
NODE_OPTIONS: --import tsx
111-
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
112-
run: npx nx affected -t int-test --parallel=3
100+
run: npm run tsx-nx -- affected -t int-test --parallel=3
113101

114102
e2e:
115103
strategy:
@@ -133,10 +121,7 @@ jobs:
133121
- name: Install dependencies
134122
run: npm ci
135123
- name: E2E test affected projects
136-
env:
137-
NODE_OPTIONS: --import tsx
138-
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
139-
run: npx nx affected -t e2e-test --parallel=1
124+
run: npm run tsx-nx -- affected -t e2e-test --parallel=1
140125

141126
build:
142127
runs-on: ubuntu-latest
@@ -156,9 +141,6 @@ jobs:
156141
- name: Install dependencies
157142
run: npm ci
158143
- name: Build all projects # affected is not used to be able to test-releae packages
159-
env:
160-
NODE_OPTIONS: --import tsx
161-
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
162-
run: npx nx run-many --target=build --parallel=3
144+
run: npm run tsx-nx -- run-many --target=build --parallel=3
163145
- name: Test-release packages
164146
run: npx pkg-pr-new publish "packages/**/dist"

.github/workflows/coverage.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,8 @@ jobs:
2424
run: npm ci
2525
- name: List packages using Nx CLI
2626
id: list-packages
27-
env:
28-
NODE_OPTIONS: --import tsx
29-
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
3027
run: |
31-
matrix=$(node tools/scripts/create-codecov-matrix.js)
28+
matrix=$(npm run tsx-node -- tools/scripts/create-codecov-matrix.js)
3229
echo "matrix=$matrix" >> $GITHUB_OUTPUT
3330
outputs:
3431
matrix: ${{ steps.list-packages.outputs.matrix }}
@@ -51,10 +48,7 @@ jobs:
5148
- name: Install dependencies
5249
run: npm ci
5350
- name: Execute tests with coverage
54-
env:
55-
NODE_OPTIONS: --import tsx
56-
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
57-
run: npx nx run ${{ matrix.project }}:${{ matrix.target }}
51+
run: npm run tsx-nx -- run ${{ matrix.project }}:${{ matrix.target }}
5852
- name: Upload coverage reports to Codecov
5953
uses: codecov/codecov-action@v4
6054
with:

.github/workflows/publish.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,4 @@ jobs:
4242
- name: Install dependencies
4343
run: npm ci
4444
- name: Publish packages to npm
45-
env:
46-
NODE_OPTIONS: --import tsx
47-
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
48-
run: npx nx release publish
45+
run: npm run tsx-nx -- release publish

.github/workflows/release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,5 @@ jobs:
4747
run: npm ci
4848
- name: Version, release and generate changelog
4949
env:
50-
NODE_OPTIONS: --import tsx
51-
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
5250
GH_TOKEN: ${{ steps.app-token.outputs.token }}
53-
run: npx nx release --skip-publish
51+
run: npm run tsx-nx -- release --skip-publish

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
"scripts": {
1616
"prepare": "husky install",
1717
"commit": "git-cz",
18-
"knip": "knip"
18+
"knip": "knip",
19+
"tsx-nx": "NODE_OPTIONS='--import tsx' TSX_TSCONFIG_PATH=\"${GITHUB_WORKSPACE:-$PWD}/tsconfig.base.json\" nx",
20+
"tsx-node": "NODE_OPTIONS='--import tsx' TSX_TSCONFIG_PATH=\"${GITHUB_WORKSPACE:-$PWD}/tsconfig.base.json\" node"
1921
},
2022
"private": true,
2123
"dependencies": {

0 commit comments

Comments
 (0)