feat: setup monorepo using pnpm (#20)
* tests: fix float problems and PAT problem * extend CONTRIBUTING.md * extend build documentation, add GH action, fix build on MacOS * fix build on Vercel * update .gitignore and CONTRIBUTING.md * feat: begin work on monorepo * chore(actions/basic-build): use pnpm * fix: vercel-deploy * docs: updates with new folders * chore: apply PR review comments --------- Co-authored-by: martin-mfg <2026226+martin-mfg@users.noreply.github.com>
This commit is contained in:
co-authored by
martin-mfg
parent
d08730aafd
commit
8c065b473f
@@ -2,12 +2,15 @@
|
||||
|
||||
## Local Development
|
||||
|
||||
To run and test GitHub-Stats-Extended, you need to follow a few simple steps:
|
||||
To set up the project GitHub-Stats-Extended locally, run the following commands:
|
||||
|
||||
1. create [your own deployment](../docs/deploy.md)
|
||||
2. optional: add an SQL database; by using e.g. the ["Nile" integration](https://vercel.com/marketplace/nile) or by manually setting the environment variable `POSTGRES_URL`
|
||||
3. optional: [create your own OAuth App](https://github.com/settings/developers) and set environment variables `OAUTH_REDIRECT_URI`, `OAUTH_CLIENT_ID` and `OAUTH_CLIENT_SECRET` on Vercel accordingly
|
||||
4. optional: in addition to the Vercel project based on the `backend` folder, create a second project based on the `frontend/frontend` folder. No environment variables needed.
|
||||
```bash
|
||||
./vercel-preparation.sh
|
||||
pnpm install
|
||||
pnpm --filter frontend run build-trends
|
||||
```
|
||||
|
||||
The easiest way to run and test the project is to deploy it to Vercel as described in the [deployment guide](../docs/deploy.md).
|
||||
|
||||
## Themes Contribution
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
name: Setup Node.js + PNPM and install Dependencies
|
||||
description: |
|
||||
This is a composite GitHub Action that:
|
||||
- Sets up pnpm package manager
|
||||
- Configures Node.js environment
|
||||
- Installs project dependencies with caching
|
||||
|
||||
inputs:
|
||||
node-version:
|
||||
description: "Explicit node version. Otherwise fallback reading `.nvmrc`"
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
|
||||
steps:
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
|
||||
- name: Setup Node.js (via input)
|
||||
if: ${{ inputs.node-version }}
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
cache: "pnpm"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Setup Node.js (via .nvmrc)
|
||||
if: ${{ !inputs.node-version }}
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Install Dependencies
|
||||
shell: bash
|
||||
run: pnpm install --frozen-lockfile
|
||||
@@ -0,0 +1,31 @@
|
||||
name: Basic Build
|
||||
|
||||
on:
|
||||
workflow_dispatch: # Allows you to run this manually from the Actions tab
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
name: Build and test on ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Dependencies
|
||||
uses: ./.github/actions/install-dependencies
|
||||
|
||||
- name: Run vercel-preparation.sh
|
||||
run: |
|
||||
chmod +x ./vercel-preparation.sh
|
||||
./vercel-preparation.sh
|
||||
|
||||
- name: Build frontend
|
||||
run: pnpm --filter frontend run build-trends
|
||||
+12
-9
@@ -1,12 +1,15 @@
|
||||
backend/.vercel
|
||||
backend/.env
|
||||
backend/node_modules
|
||||
backend/*.lock
|
||||
backend/coverage
|
||||
backend/benchmarks
|
||||
backend/vercel_token
|
||||
frontend/frontend/.env
|
||||
frontend/frontend/src/backend
|
||||
node_modules
|
||||
|
||||
apps/backend/.vercel
|
||||
apps/backend/.env
|
||||
apps/backend/node_modules
|
||||
apps/backend/*.lock
|
||||
apps/backend/coverage
|
||||
apps/backend/benchmarks
|
||||
apps/backend/vercel_token
|
||||
apps/backend-copy
|
||||
apps/frontend/.env
|
||||
apps/frontend/src/backend
|
||||
|
||||
# IDE
|
||||
.idea/
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# TODO enable
|
||||
# npm test
|
||||
# npm run lint
|
||||
# npx lint-staged
|
||||
Vendored
Vendored
Vendored
Vendored
Vendored
@@ -29,7 +29,6 @@
|
||||
"generate-langs-json": "node scripts/generate-langs-json",
|
||||
"format": "prettier --write .",
|
||||
"format:check": "prettier --check .",
|
||||
"prepare": "husky",
|
||||
"lint": "npx eslint --max-warnings 0 \"./src/**/*.js\" \"./scripts/**/*.js\" \"./tests/**/*.js\" \"./api-renamed/**/*.js\" \"./themes/**/*.js\"",
|
||||
"bench": "node --experimental-vm-modules node_modules/jest/bin/jest.js --config jest.bench.config.js"
|
||||
},
|
||||
@@ -51,7 +50,6 @@
|
||||
"express": "^5.2.1",
|
||||
"globals": "^16.5.0",
|
||||
"hjson": "^3.2.2",
|
||||
"husky": "^9.1.7",
|
||||
"jest": "^30.2.0",
|
||||
"jest-environment-jsdom": "^30.2.0",
|
||||
"js-yaml": "^4.1.1",
|
||||
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user