chore: use pnpm (#1533)

* chore: use pnpm

* chore: update
This commit is contained in:
boojack 2023-04-16 00:47:40 +08:00 committed by GitHub
parent a654a1cb88
commit 648634d376
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 3867 additions and 3443 deletions

View File

@ -25,16 +25,20 @@ jobs:
- name: Run Docker container
run: docker run -d -p 5230:5230 neosmemo/memos:e2e
- uses: pnpm/action-setup@v2.2.4
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
@ -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:

View File

@ -11,28 +11,34 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
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/action-setup@v2.2.4
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

View File

@ -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

View File

@ -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
@ -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
web/.gitignore vendored
View File

@ -4,7 +4,6 @@ dist
dist-ssr
*.local
.yarn/*
/test-results/
/playwright-report/
/playwright/.cache/

View File

@ -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",
@ -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"
}
}

3831
web/pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -197,7 +197,7 @@ const CreateIdentityProviderDialog: React.FC<Props> = (props: Props) => {
toast.success(t("setting.sso-section.sso-created", { name: basicInfo.name }));
} else {
await api.patchIdentityProvider({
id: identityProvider?.id,
id: identityProvider.id,
type: type,
...basicInfo,
config: {

File diff suppressed because it is too large Load Diff