Skip to content

Commit

Permalink
refactor: use pnpm as package manger
Browse files Browse the repository at this point in the history
  • Loading branch information
kareemmahlees committed Jan 1, 2024
1 parent 47a6a79 commit aea4d30
Show file tree
Hide file tree
Showing 11 changed files with 10,533 additions and 6,939 deletions.
39 changes: 28 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
sparse-checkout: .

- uses: pnpm/action-setup@v2
with:
run_install: |
- recursive: false
args: [--frozen-lockfile]
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
cache-dependency-path: "yarn.lock"
cache: "pnpm"

- name: Install commitlint
run: |
yarn add conventional-changelog-conventionalcommits
Expand All @@ -30,34 +38,43 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- uses: pnpm/action-setup@v2
with:
run_install: |
- recursive: true
args: [--frozen-lockfile]
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
cache-dependency-path: "yarn.lock"
- name: Install Dependencies
run: yarn add next eslint eslint-config-next prettier
- name: Run Eslint
run: yarn next:lint
cache: "pnpm"

- name: Run Lint
run: pnpm lint
- name: Run Prettier
run: yarn check-format
run: pnpm format:check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
sparse-checkout: | # fetch only rust code
apps/core/src-tauri
- name: Install tauri specific dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev librsvg2-dev
- uses: moonrepo/setup-rust@v1
with:
components: clippy
- name: Run Clippy
run: yarn rust:lint

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"

- name: Run Clippy
run: pnpm --filter @tablex/core rust:lint
17 changes: 12 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
apps/core
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
Expand All @@ -34,16 +37,20 @@ jobs:
with:
workspaces: "./src-tauri -> target"

- uses: pnpm/action-setup@v2
with:
run_install: |
- recursive: true
args: [--prod]
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
cache: "pnpm"

- name: install frontend dependencies
run: |
yarn install --production
yarn add -D @tauri-apps/cli
- name: install tauri cli
run: pnpm add -Dw @tauri-apps/cli

- uses: tauri-apps/tauri-action@v0
env:
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
push:
pull_request:
paths-ignore:
- README.md
- "*.md"
- docs/**
- public/**
- .husky/**
- .gitignore
- .github/**
- website/**
- apps/web/**
workflow_dispatch:

jobs:
Expand All @@ -23,6 +23,9 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
apps/core
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
Expand All @@ -38,15 +41,20 @@ jobs:
with:
workspaces: "./src-tauri -> target"

- uses: pnpm/action-setup@v2
with:
run_install: |
- recursive: true
args: [--prod]
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: install frontend dependencies
run: |
yarn install --production
yarn add -D @tauri-apps/cli
- name: install tauri cli
run: pnpm add -Dw @tauri-apps/cli

- uses: tauri-apps/tauri-action@v0
env:
Expand Down
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint
yarn format:check
pnpm lint
pnpm format:check
2 changes: 1 addition & 1 deletion apps/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": "next start",
"next:lint": "next lint",
"rust:lint": "cargo clippy --manifest-path ./src-tauri/Cargo.toml",
"lint": "yarn next:lint && yarn rust:lint"
"lint": "pnpm next:lint && pnpm rust:lint"
},
"dependencies": {
"@hookform/resolvers": "^3.3.2",
Expand Down
3 changes: 2 additions & 1 deletion apps/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"]
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules", "src-tauri"]
}
3 changes: 2 additions & 1 deletion apps/web/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"extends": ["astro/tsconfigs/strict", "../../tsconfig.base.json"]
"extends": ["astro/tsconfigs/strict", "../../tsconfig.base.json"],
"exclude": ["node_modules"]
}
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,24 @@
"apps/*"
],
"scripts": {
"tauri:dev": "yarn workspace @tablex/core tauri dev",
"tauri:build": "yarn workspace @tablex/core tauri build",
"astro:dev": "yarn workspace @tablex/web dev",
"astro:build": "yarn workspace @tablex/web astro check && yarn workspace @tablex/web astro build",
"astro:preview": "yarn workspace @tablex/web astro preview",
"lint": "eslint . && yarn workspace @tablex/core next:lint && yarn workspace @tablex/core rust:lint",
"tauri:dev": "pnpm --filter @tablex/core exec tauri dev",
"tauri:build": "pnpm --filter @tablex/core exec tauri build",
"astro:dev": "pnpm --filter @tablex/web dev",
"astro:build": "pnpm --filter @tablex/web build",
"astro:preview": "pnpm --filter @tablex/web preview",
"lint": "eslint . && pnpm --filter @tablex/core next:lint && pnpm --filter @tablex/core rust:lint",
"format:check": "npx prettier . --check",
"format": "npx prettier . --write"
"format:fix": "npx prettier . --write"
},
"devDependencies": {
"eslint": "^8",
"eslint-config-prettier": "^9.1.0",
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"husky": "^8.0.3",
"prettier": "3.1.1",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0"
}
"@typescript-eslint/parser": "^6.16.0",
"eslint": "^8",
"eslint-config-prettier": "^9.1.0",
"husky": "^8.0.3",
"prettier": "3.1.1"
},
"packageManager": "pnpm@8.13.1"
}
Loading

0 comments on commit aea4d30

Please sign in to comment.