Skip to content

Commit

Permalink
Migrate Lerna & NX to lerna-lite & turborepo (#1590)
Browse files Browse the repository at this point in the history
* refactor: replaced lerna with lerna-lite

* refactor: updated github actions to cache turbo

* fix: update turbo cache

* chore: updated link to internal lib

* chore: updated react and react types

---------

Co-authored-by: Danilo Velasquez <[email protected]>
  • Loading branch information
dvelasquez and Danilo Velasquez authored Dec 21, 2024
1 parent e2675c2 commit fae1a4d
Show file tree
Hide file tree
Showing 13 changed files with 12,900 additions and 11,417 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 20.15.0
node-version: 22.12.0

- uses: pnpm/action-setup@v4
name: Setup PNPM & Install dependencies 👨🏻‍💻
with:
version: 9.5.0
version: 9.15.1
run_install: false

- name: Get pnpm store directory
Expand All @@ -36,7 +36,8 @@ jobs:
path: |
${{ steps.pnpm-cache.outputs.STORE_PATH }}
/home/runner/.cache/Cypress
./nx
.turbo
**/.turbo
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
Expand All @@ -54,15 +55,15 @@ jobs:
needs: install_dependencies
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 20.15.0
node-version: 22.12.0

- uses: pnpm/action-setup@v4
name: Setup PNPM & Install dependencies 👨🏻‍💻
with:
version: 9.5.0
version: 9.15.1
run_install: false

- name: Get pnpm store directory
Expand All @@ -77,7 +78,8 @@ jobs:
path: |
${{ steps.pnpm-cache.outputs.STORE_PATH }}
/home/runner/.cache/Cypress
./nx
.turbo
**/.turbo
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/publish-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
CI: 'true'
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 20.15.0
node-version: 22.12.0

- uses: pnpm/action-setup@v4
name: Setup PNPM & Install dependencies 👨🏻‍💻
with:
version: 9.5.0
version: 9.15.1
run_install: false

- name: Get pnpm store directory
Expand All @@ -37,7 +37,8 @@ jobs:
path: |
${{ steps.pnpm-cache.outputs.STORE_PATH }}
/home/runner/.cache/Cypress
./nx
.turbo
**/.turbo
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/release-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ jobs:
path: |
~/.pnpm-store
/home/runner/.cache/Cypress
**/.turbo
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
- name: Use Node.js 20.x
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 20.15.0
node-version: 22.12.0

- uses: pnpm/action-setup@v4
name: Setup PNPM & Install dependencies 👨🏻‍💻
Expand Down Expand Up @@ -99,15 +100,15 @@ jobs:
CI: 'true'
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 20.15.0
node-version: 22.12.0

- uses: pnpm/action-setup@v4
name: Setup PNPM & Install dependencies 👨🏻‍💻
with:
version: 9.5.0
version: 9.15.1
run_install: false

- name: Get pnpm store directory
Expand All @@ -122,7 +123,8 @@ jobs:
path: |
${{ steps.pnpm-cache.outputs.STORE_PATH }}
/home/runner/.cache/Cypress
./nx
.turbo
**/.turbo
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 20.15.0
node-version: 22.12.0

- uses: pnpm/action-setup@v4
name: Setup PNPM & Install dependencies 👨🏻‍💻
with:
version: 9.5.0
version: 9.15.1
run_install: false

- name: Get pnpm store directory
Expand All @@ -35,7 +35,8 @@ jobs:
path: |
${{ steps.pnpm-cache.outputs.STORE_PATH }}
/home/runner/.cache/Cypress
./nx
.turbo
**/.turbo
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
Expand All @@ -54,15 +55,15 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 20.15.0
node-version: 22.12.0

- uses: pnpm/action-setup@v4
name: Setup PNPM & Install dependencies 👨🏻‍💻
with:
version: 9.5.0
version: 9.15.1
run_install: false

- name: Get pnpm store directory
Expand All @@ -77,7 +78,8 @@ jobs:
path: |
${{ steps.pnpm-cache.outputs.STORE_PATH }}
/home/runner/.cache/Cypress
./nx
.turbo
**/.turbo
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
Expand Down Expand Up @@ -109,15 +111,15 @@ jobs:
needs: run_cypress
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 20.15.0
node-version: 22.12.0

- uses: pnpm/action-setup@v4
name: Setup PNPM & Install dependencies 👨🏻‍💻
with:
version: 9.5.0
version: 9.15.1
run_install: false

- name: Get pnpm store directory
Expand All @@ -132,7 +134,8 @@ jobs:
path: |
${{ steps.pnpm-cache.outputs.STORE_PATH }}
/home/runner/.cache/Cypress
./nx
.turbo
**/.turbo
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/update-lockfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 20.15.0
node-version: 22.12.0

- uses: pnpm/action-setup@v4
name: Setup PNPM & Install dependencies 👨🏻‍💻
with:
version: 9.5.0
version: 9.15.1
run_install: false

- name: Get pnpm store directory
Expand All @@ -37,7 +37,7 @@ jobs:
path: |
${{ steps.pnpm-cache.outputs.STORE_PATH }}
/home/runner/.cache/Cypress
./nx
.turbo
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ dist
.cache
.angular
.npmrc
.nx
.nx
.turbo
10 changes: 5 additions & 5 deletions examples/nextjs-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"start": "next start"
},
"dependencies": {
"@types/node": "18",
"@types/react": "18.0.28",
"@types/react-dom": "18.0.11",
"@types/node": "22",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"next": "13.2.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react2-lighthouse-viewer": "workspace:0.1.241",
"typescript": "4.9.5"
}
Expand Down
53 changes: 0 additions & 53 deletions nx.json

This file was deleted.

14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "Root of the monorepo multipackage project for the lighthouse viewer stuffs",
"main": "index.js",
"scripts": {
"lerna:start": "nx run-many --target=dev",
"lerna:build": "nx run-many --target=build",
"lerna:start": "turbo run dev",
"lerna:build": "turbo run build",
"lerna:release": "lerna version --conventional-commits --yes",
"lerna:deploy:ci": "lerna publish from-package --yes",
"lerna:deploy:ci:canary": "lerna publish from-package --yes --canary --preid beta --message 'chore: release new canary versions'",
Expand All @@ -20,7 +20,10 @@
"author": "",
"license": "MIT",
"devDependencies": {
"@nrwl/nx-cloud": "latest",
"@lerna-lite/cli": "3.10.1",
"@lerna-lite/core": "3.10.1",
"@lerna-lite/publish": "3.10.1",
"@lerna-lite/version": "3.10.1",
"@types/node": "20",
"@typescript-eslint/eslint-plugin": "6.21.0",
"@typescript-eslint/parser": "6.21.0",
Expand All @@ -31,11 +34,10 @@
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.2.1",
"http-server": "14.1.1",
"lerna": "8.1.9",
"nx": "20.2.2",
"prettier": "3.4.2",
"rimraf": "6.0.1",
"tslib": "2.8.1",
"turbo": "2.3.3",
"typescript": "5.6.3"
},
"snyk": true,
Expand All @@ -46,7 +48,9 @@
"npm": "10.8.2",
"node": "20.18.0"
},
"packageManager": "[email protected]",
"workspaces": [
"examples/*",
"packages/*",
"examples/*"
]
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-lighthouse-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "3.1.2",
"@tsconfig/svelte": "5.0.4",
"lighthouse-viewer": "^0.1.235",
"lighthouse-viewer": "workspace:^0.1.235",
"svelte": "4.2.19",
"svelte-check": "4.0.9",
"svelte-preprocess": "6.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-lighthouse-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"preview": "vite preview"
},
"devDependencies": {
"lighthouse-viewer": "^0.1.235",
"lighthouse-viewer": "workspace:^0.1.235",
"typed-query-selector": "2.12.0",
"typescript": "5.6.3",
"vite": "5.4.11",
Expand Down
Loading

0 comments on commit fae1a4d

Please sign in to comment.