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 - name: Run Docker container
run: docker run -d -p 5230:5230 neosmemo/memos:e2e 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 - uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 18
cache: 'yarn' cache: "pnpm"
cache-dependency-path: ./web/yarn.lock cache-dependency-path: ./web/pnpm-lock.yaml
- name: Install dependencies - name: Install dependencies
working-directory: web working-directory: web
run: yarn run: pnpm install
- name: Install Playwright Browsers - name: Install Playwright Browsers
working-directory: web working-directory: web
@ -43,14 +47,14 @@ jobs:
- name: Run Playwright tests - name: Run Playwright tests
working-directory: web working-directory: web
run: npx playwright test run: npx playwright test
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
if: always() if: always()
with: with:
name: playwright-report name: playwright-report
path: web/playwright-report/ path: web/playwright-report/
retention-days: 30 retention-days: 30
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
if: always() if: always()
with: with:

View File

@ -11,28 +11,34 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
with:
version: 8.0.0
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: "18" node-version: "18"
cache: yarn cache: pnpm
cache-dependency-path: "web/yarn.lock" cache-dependency-path: "web/pnpm-lock.yaml"
- run: yarn - run: pnpm install
working-directory: web working-directory: web
- name: Run eslint check - name: Run eslint check
run: yarn lint run: pnpm lint
working-directory: web working-directory: web
frontend-build: frontend-build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
with:
version: 8.0.0
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: "18" node-version: "18"
cache: yarn cache: pnpm
cache-dependency-path: "web/yarn.lock" cache-dependency-path: "web/pnpm-lock.yaml"
- run: yarn - run: pnpm install
working-directory: web working-directory: web
- name: Run frontend build - name: Run frontend build
run: yarn build run: pnpm build
working-directory: web working-directory: web

View File

@ -2,13 +2,13 @@
FROM node:18.12.1-alpine3.16 AS frontend FROM node:18.12.1-alpine3.16 AS frontend
WORKDIR /frontend-build 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/ . COPY ./web/ .
RUN yarn build RUN pnpm build
# Build backend exec file. # Build backend exec file.
FROM golang:1.19.3-alpine3.16 AS backend 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) - [Go](https://golang.org/doc/install)
- [Air](https://github.com/cosmtrek/air#installation) for backend live reload - [Air](https://github.com/cosmtrek/air#installation) for backend live reload
- [Node.js](https://nodejs.org/) - [Node.js](https://nodejs.org/)
- [yarn](https://yarnpkg.com/getting-started/install) - [pnpm](https://pnpm.io/installation)
## Steps ## Steps
@ -34,7 +34,7 @@ Memos is built with a curated tech stack. It is optimized for developer experien
3. start frontend dev server 3. start frontend dev server
```bash ```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. 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 dist-ssr
*.local *.local
.yarn/*
/test-results/ /test-results/
/playwright-report/ /playwright-report/
/playwright/.cache/ /playwright/.cache/

View File

@ -9,7 +9,7 @@
"dependencies": { "dependencies": {
"@emotion/react": "^11.10.5", "@emotion/react": "^11.10.5",
"@emotion/styled": "^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", "@radix-ui/react-tooltip": "^1.0.5",
"@reduxjs/toolkit": "^1.8.1", "@reduxjs/toolkit": "^1.8.1",
"axios": "^0.27.2", "axios": "^0.27.2",
@ -43,17 +43,17 @@
"@types/semver": "^7.3.13", "@types/semver": "^7.3.13",
"@typescript-eslint/eslint-plugin": "^5.6.0", "@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^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", "autoprefixer": "^10.4.2",
"eslint": "^8.4.1", "eslint": "^8.4.1",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.27.1", "eslint-plugin-react": "^7.27.1",
"less": "^4.1.1", "less": "^4.1.1",
"postcss": "^8.4.5", "postcss": "^8.4.21",
"prettier": "2.5.1", "prettier": "2.5.1",
"terser": "^5.16.1", "terser": "^5.16.1",
"typescript": "^4.3.2", "typescript": "^5.0.4",
"vite": "^4.0.0" "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 })); toast.success(t("setting.sso-section.sso-created", { name: basicInfo.name }));
} else { } else {
await api.patchIdentityProvider({ await api.patchIdentityProvider({
id: identityProvider?.id, id: identityProvider.id,
type: type, type: type,
...basicInfo, ...basicInfo,
config: { config: {

File diff suppressed because it is too large Load Diff