Skip to content

Commit

Permalink
chore: use pnpm (usememos#1533)
Browse files Browse the repository at this point in the history
* chore: use pnpm

* chore: update
  • Loading branch information
boojack authored Apr 15, 2023
1 parent a654a1c commit 648634d
Show file tree
Hide file tree
Showing 9 changed files with 3,867 additions and 3,443 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,20 @@ jobs:

- name: Run Docker container
run: docker run -d -p 5230:5230 neosmemo/memos:e2e


- uses: pnpm/[email protected]
with:
version: 8.0.0

- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: ./web/yarn.lock
cache: "pnpm"
cache-dependency-path: ./web/pnpm-lock.yaml

- name: Install dependencies
working-directory: web
run: yarn
run: pnpm install

- name: Install Playwright Browsers
working-directory: web
Expand All @@ -43,14 +47,14 @@ jobs:
- name: Run Playwright tests
working-directory: web
run: npx playwright test

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: web/playwright-report/
retention-days: 30

- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/frontend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,34 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
with:
version: 8.0.0
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: yarn
cache-dependency-path: "web/yarn.lock"
- run: yarn
cache: pnpm
cache-dependency-path: "web/pnpm-lock.yaml"
- run: pnpm install
working-directory: web
- name: Run eslint check
run: yarn lint
run: pnpm lint
working-directory: web

frontend-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
with:
version: 8.0.0
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: yarn
cache-dependency-path: "web/yarn.lock"
- run: yarn
cache: pnpm
cache-dependency-path: "web/pnpm-lock.yaml"
- run: pnpm install
working-directory: web
- name: Run frontend build
run: yarn build
run: pnpm build
working-directory: web
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
FROM node:18.12.1-alpine3.16 AS frontend
WORKDIR /frontend-build

COPY ./web/package.json ./web/yarn.lock ./
COPY ./web/package.json ./web/pnpm-lock.yaml ./

RUN yarn
RUN npm install -g pnpm && pnpm i --frozen-lockfile

COPY ./web/ .

RUN yarn build
RUN pnpm build

# Build backend exec file.
FROM golang:1.19.3-alpine3.16 AS backend
Expand Down
4 changes: 2 additions & 2 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Memos is built with a curated tech stack. It is optimized for developer experien
- [Go](https://golang.org/doc/install)
- [Air](https://github.com/cosmtrek/air#installation) for backend live reload
- [Node.js](https://nodejs.org/)
- [yarn](https://yarnpkg.com/getting-started/install)
- [pnpm](https://pnpm.io/installation)

## Steps

Expand All @@ -34,7 +34,7 @@ Memos is built with a curated tech stack. It is optimized for developer experien
3. start frontend dev server

```bash
cd web && yarn && yarn dev
cd web && pnpm i && pnpm dev
```

Memos should now be running at [http://localhost:3001](http://localhost:3001) and change either frontend or backend code would trigger live reload.
1 change: 0 additions & 1 deletion web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ dist
dist-ssr
*.local

.yarn/*
/test-results/
/playwright-report/
/playwright/.cache/
Expand Down
10 changes: 5 additions & 5 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dependencies": {
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@mui/joy": "^5.0.0-alpha.67",
"@mui/joy": "^5.0.0-alpha.75",
"@radix-ui/react-tooltip": "^1.0.5",
"@reduxjs/toolkit": "^1.8.1",
"axios": "^0.27.2",
Expand Down Expand Up @@ -43,17 +43,17 @@
"@types/semver": "^7.3.13",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0",
"@vitejs/plugin-react-swc": "^3.0.0",
"@vitejs/plugin-react-swc": "^3.3.0",
"autoprefixer": "^10.4.2",
"eslint": "^8.4.1",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.27.1",
"less": "^4.1.1",
"postcss": "^8.4.5",
"postcss": "^8.4.21",
"prettier": "2.5.1",
"terser": "^5.16.1",
"typescript": "^4.3.2",
"vite": "^4.0.0"
"typescript": "^5.0.4",
"vite": "^4.2.1"
}
}
Loading

0 comments on commit 648634d

Please sign in to comment.