chore: Switch from yarn to pnpm

This commit is contained in:
Sidharth Vinod
2025-03-16 19:19:10 -07:00
parent b5be8ca4fc
commit 592c3addac
13 changed files with 8529 additions and 7084 deletions
+6 -4
View File
@@ -17,7 +17,10 @@ jobs:
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 18
cache: yarn cache: pnpm
- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Setup Pages - name: Setup Pages
uses: actions/configure-pages@v5 uses: actions/configure-pages@v5
@@ -34,9 +37,8 @@ jobs:
run: | run: |
export DEPLOY=true export DEPLOY=true
[ "$GITHUB_EVENT_NAME" != "pull_request" ] && rm -rf docs/_app/ [ "$GITHUB_EVENT_NAME" != "pull_request" ] && rm -rf docs/_app/
yarn install pnpm install
version=$(yarn version --patch --no-git-tag-version | grep "New version" | cut -d':' -f 2) pnpm build
yarn build
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v3 uses: actions/upload-pages-artifact@v3
+8 -5
View File
@@ -20,28 +20,31 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- uses: actions/cache@v4 - uses: actions/cache@v4
id: yarn-and-build-cache id: pnpm-and-build-cache
with: with:
path: | path: |
~/.cache/Cypress ~/.cache/Cypress
build build
node_modules node_modules
key: ${{ runner.os }}-node_modules-build-${{ hashFiles('**/yarn.lock') }} key: ${{ runner.os }}-node_modules-build-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-node_modules-build- ${{ runner.os }}-node_modules-build-
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version-file: '.node-version' node-version-file: '.node-version'
cache: 'yarn' cache: 'pnpm'
- name: Install pnpm
uses: pnpm/action-setup@v3
# Install NPM dependencies, cache them correctly # Install NPM dependencies, cache them correctly
# and run all Cypress tests # and run all Cypress tests
- name: Cypress run - name: Cypress run
uses: cypress-io/github-action@v6 uses: cypress-io/github-action@v6
with: with:
build: yarn build build: pnpm build
start: yarn preview start: pnpm preview
wait-on: 'http://localhost:3000' wait-on: 'http://localhost:3000'
record: true record: true
parallel: true parallel: true
+10 -7
View File
@@ -15,22 +15,25 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
- uses: actions/cache@v3 - uses: actions/cache@v3
id: yarn-and-build-cache id: pnpm-and-build-cache
with: with:
path: | path: |
build build
node_modules node_modules
key: ${{ runner.os }}-node_modules-build-${{ hashFiles('**/yarn.lock') }} key: ${{ runner.os }}-node_modules-build-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-node_modules-build- ${{ runner.os }}-node_modules-build-
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18 node-version-file: '.node-version'
cache: 'yarn' cache: 'pnpm'
- name: Install pnpm
uses: pnpm/action-setup@v3
- name: Lint & Test - name: Lint & Test
run: | run: |
yarn install pnpm install
yarn lint pnpm lint
yarn test:unit pnpm test:unit
-1
View File
@@ -12,4 +12,3 @@
/functions /functions
/node_modules /node_modules
/snapshots.js /snapshots.js
yarn-error.log
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
. "$(dirname "$0")/_/husky.sh" . "$(dirname "$0")/_/husky.sh"
yarn pre-commit pnpm pre-commit
+1
View File
@@ -1 +1,2 @@
engine-strict=true engine-strict=true
auto-install-peers=true
+1 -1
View File
@@ -25,7 +25,7 @@
"tailwindcss", "tailwindcss",
"uparrow" "uparrow"
], ],
"vitest.commandLine": "yarn test:unit", "vitest.commandLine": "pnpm test:unit",
"vitest.enable": true, "vitest.enable": true,
"testing.autoRun.mode": "rerun", "testing.autoRun.mode": "rerun",
"svelte.enable-ts-plugin": true, "svelte.enable-ts-plugin": true,
+5 -5
View File
@@ -3,14 +3,14 @@ FROM docker.io/library/node:20-alpine3.18 AS mermaid-live-editor-dependencies
RUN apk --no-cache add build-base git python3 && \ RUN apk --no-cache add build-base git python3 && \
rm -rf /var/cache/apk/* rm -rf /var/cache/apk/*
RUN yarn global add node-gyp RUN npm install -g pnpm
WORKDIR /app WORKDIR /app
COPY ./package.json . COPY ./package.json .
COPY ./yarn.lock . COPY ./pnpm-lock.yaml .
RUN yarn install RUN pnpm install
FROM mermaid-live-editor-dependencies AS mermaid-live-editor-builder FROM mermaid-live-editor-dependencies AS mermaid-live-editor-builder
@@ -22,11 +22,11 @@ ARG MERMAID_IS_ENABLED_MERMAID_CHART_LINKS
COPY . ./ COPY . ./
RUN yarn build RUN pnpm build
FROM mermaid-live-editor-builder AS mermaid-dev FROM mermaid-live-editor-builder AS mermaid-dev
ENTRYPOINT ["yarn", "dev"] ENTRYPOINT ["pnpm", "dev"]
FROM nginx:1.25-alpine3.18 AS mermaid FROM nginx:1.25-alpine3.18 AS mermaid
+12 -11
View File
@@ -1,10 +1,8 @@
[![Mermaid Live Editor](https://img.shields.io/endpoint?url=https://dashboard.cypress.io/badge/detailed/2ckppp/master&style=flat&logo=cypress)](https://dashboard.cypress.io/projects/2ckppp/runs) [![Join our Slack!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=slack&label=slack)](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) [![Netlify Status](https://api.netlify.com/api/v1/badges/27fa023d-7c73-4a3f-9791-b3b657a47100/deploy-status)](https://app.netlify.com/sites/mermaidjs/deploys) [![Mermaid Live Editor](https://img.shields.io/endpoint?url=https://dashboard.cypress.io/badge/detailed/2ckppp/master&style=flat&logo=cypress)](https://dashboard.cypress.io/projects/2ckppp/runs)
[![Join our Discord!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=discord&label=discord)](https://discord.gg/sKeNQX4Wtj)
[![Netlify Status](https://api.netlify.com/api/v1/badges/27fa023d-7c73-4a3f-9791-b3b657a47100/deploy-status)](https://app.netlify.com/sites/mermaidjs/deploys)
# Contributors are welcome! # Mermaid Live Editor
If you want to speed up the progress for mermaid-live-editor, join the slack channel and contact knsv.
# mermaid-live-editor
Edit, preview and share mermaid charts/diagrams. Edit, preview and share mermaid charts/diagrams.
@@ -19,6 +17,10 @@ Edit, preview and share mermaid charts/diagrams.
You can try out a live version [here](https://mermaid.live/). You can try out a live version [here](https://mermaid.live/).
# Contributors are welcome!
If you want to speed up the progress for mermaid-live-editor, join the Discord channel and contact knsv.
## Docker ## Docker
### Run published image ### Run published image
@@ -98,15 +100,14 @@ https://docs.github.com/en/get-started/quickstart/fork-a-repo
## Requirements ## Requirements
- [volta](https://volta.sh/) to manage node versions. - [Node.js](https://nodejs.org/en/) version 18.20.7 or higher
- [Node.js](https://nodejs.org/en/). `volta install node` - [pnpm](https://pnpm.io/) package manager. Install with `npm install -g pnpm`
- [yarn](https://yarnpkg.com/) package manager. `volta install yarn`
## Development ## Development
```sh ```sh
yarn install pnpm install
yarn dev -- --open pnpm dev -- --open
``` ```
This app is created with Svelte Kit. This app is created with Svelte Kit.
+1 -1
View File
@@ -6,7 +6,7 @@
# git clone https://github.com/mermaid-js/docs.git # git clone https://github.com/mermaid-js/docs.git
set -e set -e
rm -rf docs rm -rf docs
yarn release pnpm release
pushd . pushd .
if [ ! -d ../docs ]; then if [ ! -d ../docs ]; then
echo "Clone https://github.com/mermaid-js/docs to parent folder before continuing." echo "Clone https://github.com/mermaid-js/docs to parent folder before continuing."
+6 -6
View File
@@ -5,8 +5,8 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
"dev:force": "MERMAID_LOCAL=true yarn dev --force", "dev:force": "MERMAID_LOCAL=true pnpm dev --force",
"dev:test": "yarn dev", "dev:test": "pnpm dev",
"build": "vite build", "build": "vite build",
"preview": "vite preview", "preview": "vite preview",
"lint": "prettier --check --cache . && eslint --ignore-path .gitignore .", "lint": "prettier --check --cache . && eslint --ignore-path .gitignore .",
@@ -18,7 +18,7 @@
"test:ui": "vitest --ui", "test:ui": "vitest --ui",
"test:coverage": "vitest run --coverage", "test:coverage": "vitest run --coverage",
"test:browser": "cypress run", "test:browser": "cypress run",
"test": "test:unit && test:browser", "test": "pnpm test:unit && pnpm test:browser",
"cy": "cypress open" "cy": "cypress open"
}, },
"devDependencies": { "devDependencies": {
@@ -94,10 +94,10 @@
] ]
}, },
"volta": { "volta": {
"node": "18.20.7", "node": "18.20.7"
"yarn": "1.22.22"
}, },
"engines": { "engines": {
"node": ">=16.7" "node": ">=16.7"
} },
"packageManager": "pnpm@9.15.5+sha512.845196026aab1cc3f098a0474b64dfbab2afe7a1b4e91dd86895d8e4aa32a7a6d03049e2d0ad770bbe4de023a7122fb68c1a1d6e0d033c7076085f9d5d4800d4"
} }
+8478
View File
File diff suppressed because it is too large Load Diff
-7042
View File
File diff suppressed because it is too large Load Diff