Skip to content

Commit

Permalink
Add Lerna
Browse files Browse the repository at this point in the history
  • Loading branch information
chvmvd committed Feb 27, 2024
1 parent 9fd6b26 commit 217bfa3
Show file tree
Hide file tree
Showing 11 changed files with 8,480 additions and 1,949 deletions.
48 changes: 32 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -23,12 +25,13 @@ jobs:
run: npm ci
shell: bash

- name: Build Packages
run: npm run build:packages
shell: bash

- name: Build
run: npm run build
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
npx lerna run build --since=origin/${{ github.base_ref }}
else
npx lerna run build
fi
shell: bash

type-check:
Expand All @@ -37,6 +40,8 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -48,12 +53,13 @@ jobs:
run: npm ci
shell: bash

- name: Build Packages
run: npm run build:packages
shell: bash

- name: Type Check
run: npm run type-check
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
npx lerna run type-check --since=origin/${{ github.base_ref }}
else
npx lerna run type-check
fi
shell: bash

test:
Expand All @@ -62,6 +68,8 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -73,12 +81,13 @@ jobs:
run: npm ci
shell: bash

- name: Build Packages
run: npm run build:packages
shell: bash

- name: Test
run: npm test
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
npx lerna run test --since=origin/${{ github.base_ref }}
else
npx lerna run test
fi
shell: bash

eslint:
Expand All @@ -87,6 +96,8 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -99,7 +110,12 @@ jobs:
shell: bash

- name: Run ESLint
run: npm run lint
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
npx lerna run lint --since=origin/${{ github.base_ref }}
else
npx lerna run lint
fi
shell: bash

prettier:
Expand Down
18 changes: 3 additions & 15 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,8 @@ jobs:
run: npm ci
shell: bash

- name: Build Packages
run: npm run build:packages
shell: bash

- name: Build
run: npm run build
run: npx lerna run build --scope=@dot-tutor/website
shell: bash

- name: Upload Artifact
Expand Down Expand Up @@ -82,12 +78,8 @@ jobs:
run: npm ci
shell: bash

- name: Build Packages
run: npm run build:packages
shell: bash

- name: Build
run: npm run build
run: npx lerna run build --scope=@dot-tutor/learn
shell: bash

- name: Upload Artifact
Expand Down Expand Up @@ -138,12 +130,8 @@ jobs:
run: npm ci
shell: bash

- name: Build Packages
run: npm run build:packages
shell: bash

- name: Build
run: npm run build
run: npx lerna run build --scope=@dot-tutor/translate
shell: bash
env:
VITE_API_ENDPOINT: "https://dot-tutor-backend.onrender.com"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
shell: bash

- name: Build
run: npm run build
run: npx lerna run build --scope=@dot-tutor/website
shell: bash

- name: Upload Artifact
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
shell: bash

- name: Build
run: npm run build
run: npx lerna run build --scope=@dot-tutor/learn
shell: bash

- name: Upload Artifact
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
shell: bash

- name: Build
run: npm run build
run: npx lerna run build --scope=@dot-tutor/translate
shell: bash
env:
VITE_API_ENDPOINT: "https://dot-tutor-backend.onrender.com"
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
.DS_Store

.nx/cache
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"dbaeumer.vscode-eslint",
"unifiedjs.vscode-mdx",
"ms-python.black-formatter",
"bradlc.vscode-tailwindcss"
"bradlc.vscode-tailwindcss",
"nrwl.angular-console"
]
}
1 change: 0 additions & 1 deletion learn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"@mui/icons-material": "^5.15.10",
"@mui/material": "^5.15.10",
"@next/mdx": "^14.1.0",
"braille": "@dot-tutor/braille",
"eslint": "^8.56.0",
"next": "^14.1.0",
"react": "^18.2.0",
Expand Down
4 changes: 4 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.0.0"
}
21 changes: 21 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"targetDefaults": {
"build": {
"cache": true,
"dependsOn": ["^build"],
"outputs": ["{projectRoot}/dist"]
},
"type-check": {
"cache": true,
"dependsOn": ["^build"]
},
"lint": {
"cache": true,
"dependsOn": ["^build"]
},
"test": {
"cache": true,
"dependsOn": ["^build"]
}
}
}
Loading

0 comments on commit 217bfa3

Please sign in to comment.