Skip to content

Commit

Permalink
chore: nx fixes and github refactor actions
Browse files Browse the repository at this point in the history
  • Loading branch information
brunotot committed Nov 26, 2024
1 parent 76c6a9b commit 915e7df
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 52 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-app-node-express.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
with:
filters: |
app-node-express:
- 'packages/mern-sample-app/app-node-express/**'
- 'apps/app-node-express/**'
- name: 🛠 Setup Git, PNPM and Node.js
if: steps.changes.outputs.app-node-express == 'true'
uses: ./.github/composite-actions/install

- name: 🚀 Run test
if: steps.changes.outputs.app-node-express == 'true'
run: pnpm run app-node-express:test
run: pnpm --filter app-node-express test
4 changes: 2 additions & 2 deletions .github/workflows/test-app-vite-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
with:
filters: |
app-vite-react:
- 'packages/mern-sample-app/app-vite-react/**'
- 'apps/app-vite-react/**'
- name: 🛠 Setup Git, PNPM and Node.js
if: steps.changes.outputs.app-vite-react == 'true'
uses: ./.github/composite-actions/install

- name: 🚀 Run test
if: steps.changes.outputs.app-vite-react == 'true'
run: pnpm run app-vite-react:test
run: pnpm --filter app-vite-react test
4 changes: 2 additions & 2 deletions .github/workflows/test-lib-api-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
with:
filters: |
lib-api-client:
- 'packages/mern-sample-app/lib-api-client/**'
- 'packages/lib-api-client/**'
- name: 🛠 Setup Git, PNPM and Node.js
if: steps.changes.outputs.lib-api-client == 'true'
uses: ./.github/composite-actions/install

- name: 🚀 Run test
if: steps.changes.outputs.lib-api-client == 'true'
run: pnpm run lib-api-client:test
run: pnpm --filter lib-api-client test
4 changes: 2 additions & 2 deletions .github/workflows/test-lib-commons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
with:
filters: |
lib-commons:
- 'packages/mern-sample-app/lib-commons/**'
- 'packages/lib-commons/**'
- name: 🛠 Setup Git, PNPM and Node.js
if: steps.changes.outputs.lib-commons == 'true'
uses: ./.github/composite-actions/install

- name: 🚀 Run test
if: steps.changes.outputs.lib-commons == 'true'
run: pnpm run lib-commons:test
run: pnpm --filter lib-commons test
35 changes: 35 additions & 0 deletions .github/workflows/test-lib-decorators.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: test-lib-decorators

on:
push:
branches:
- "main"
pull_request:
branches:
- "**"
merge_group:
workflow_dispatch:

jobs:
test-lib-decorators:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: ⚙️ Configure paths filter environment variable
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
lib-decorators:
- 'packages/lib-decorators/**'
- name: 🛠 Setup Git, PNPM and Node.js
if: steps.changes.outputs.lib-decorators == 'true'
uses: ./.github/composite-actions/install

- name: 🚀 Run test
if: steps.changes.outputs.lib-decorators == 'true'
run: pnpm --filter lib-decorators test
35 changes: 35 additions & 0 deletions .github/workflows/test-lib-mongodb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: test-lib-mongodb

on:
push:
branches:
- "main"
pull_request:
branches:
- "**"
merge_group:
workflow_dispatch:

jobs:
test-lib-mongodb:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: ⚙️ Configure paths filter environment variable
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
lib-mongodb:
- 'packages/lib-mongodb/**'
- name: 🛠 Setup Git, PNPM and Node.js
if: steps.changes.outputs.lib-mongodb == 'true'
uses: ./.github/composite-actions/install

- name: 🚀 Run test
if: steps.changes.outputs.lib-mongodb == 'true'
run: pnpm --filter lib-mongodb test
62 changes: 18 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,25 @@
"engines": {
"pnpm": ">=8.15.7"
},
"keywords": [
"monorepo",
"starter",
"template",
"mern",
"railway",
"react",
"mongodb",
"express",
"node"
],
"scripts": {
"prepare": "npm run lib-commons:build && npm run lib-api-client:build",
"renameProjectLabels": "node renameProjectLabels.js",
"test": "npm run app-node-express:test && npm run app-vite-react:test && npm run lib-commons:test && npm run lib-api-client:test",
"build": "npm run lib-commons:build && npm run lib-api-client:build && npm run app-node-express:build && npm run app-vite-react:build",
"clean": "rm -rf docs && npm run app-node-express:clean && npm run app-vite-react:clean && npm run lib-commons:clean && npm run lib-api-client:clean",
"reinstall": "rm -rf node_modules packages/mern-sample-app/app-node-express/node_modules packages/mern-sample-app/app-vite-react/node_modules packages/mern-sample-app/lib-commons/node_modules packages/mern-sample-app/lib-api-client/node_modules && npx pnpm i",
"lint": "npm run app-node-express:lint && npm run app-vite-react:lint && npm run lib-commons:lint && npm run lib-api-client:lint",
"lint:fix": "npm run app-node-express:lint:fix && npm run app-vite-react:lint:fix && npm run lib-commons:lint:fix && npm run lib-api-client:lint:fix",
"test": "pnpm -r test",
"build": "pnpm -r build",
"clean": "pnpm -r clean",
"lint": "pnpm -r lint",
"lint:fix": "pnpm -r lint:fix",
"writeTypedoc": "bash assets/sh/typedoc.sh",
"app-node-express:start": "npm run start --prefix app/app-node-express",
"app-node-express:dev": "npm run start --prefix app/app-node-express",
"app-node-express:test": "npm run test --prefix app/app-node-express",
"app-node-express:build": "npm run build --prefix app/app-node-express",
"app-node-express:clean": "npm run clean --prefix app/app-node-express",
"app-node-express:lint": "npm run lint --prefix app/app-node-express",
"app-node-express:lint:fix": "npm run lint:fix --prefix app/app-node-express",
"app-vite-react:start": "npm run start --prefix app/app-vite-react",
"app-vite-react:dev": "npm run dev --prefix app/app-vite-react",
"app-vite-react:test": "npm run test --prefix app/app-vite-react",
"app-vite-react:build": "npm run build --prefix app/app-vite-react",
"app-vite-react:clean": "npm run clean --prefix app/app-vite-react",
"app-vite-react:lint": "npm run lint --prefix app/app-vite-react",
"app-vite-react:lint:fix": "npm run lint:fix --prefix app/app-vite-react",
"lib-commons:lint": "npm run lint --prefix packages/lib-commons",
"lib-commons:lint:fix": "npm run lint:fix --prefix packages/lib-commons",
"lib-commons:build": "npm run build --prefix packages/lib-commons",
"lib-commons:test": "npm run test --prefix packages/lib-commons",
"lib-commons:clean": "npm run clean --prefix packages/lib-commons",
"lib-api-client:lint": "npm run lint --prefix packages/lib-api-client",
"lib-api-client:lint:fix": "npm run lint:fix --prefix packages/lib-api-client",
"lib-api-client:build": "npm run build --prefix packages/lib-api-client",
"lib-api-client:test": "npm run test --prefix packages/lib-api-client",
"lib-api-client:clean": "npm run clean --prefix packages/lib-api-client"
"renameProjectLabels": "node renameProjectLabels.js"
},
"devDependencies": {
"@nx/eslint": "20.1.2",
Expand All @@ -69,16 +54,5 @@
"typescript": "^5.7.2",
"vite-tsconfig-paths": "^5.1.3",
"vitest": "^2.1.5"
},
"keywords": [
"monorepo",
"starter",
"template",
"mern",
"railway",
"react",
"mongodb",
"express",
"node"
]
}
}

0 comments on commit 915e7df

Please sign in to comment.