Merge pull request #1644 from mermaid-js/sidv/pnpm

chore: Switch from yarn to pnpm
This commit is contained in:
Sidharth Vinod
2025-03-16 19:49:53 -07:00
committed by GitHub
16 changed files with 8552 additions and 7128 deletions

View File

@@ -14,10 +14,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
node-version-file: '.node-version'
cache: pnpm
- name: Setup Pages
uses: actions/configure-pages@v5
@@ -34,9 +37,8 @@ jobs:
run: |
export DEPLOY=true
[ "$GITHUB_EVENT_NAME" != "pull_request" ] && rm -rf docs/_app/
yarn install
version=$(yarn version --patch --no-git-tag-version | grep "New version" | cut -d':' -f 2)
yarn build
pnpm install
pnpm build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

View File

@@ -20,28 +20,31 @@ jobs:
uses: actions/checkout@v4
- uses: actions/cache@v4
id: yarn-and-build-cache
id: pnpm-and-build-cache
with:
path: |
~/.cache/Cypress
build
node_modules
key: ${{ runner.os }}-node_modules-build-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-node_modules-build-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node_modules-build-
- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'yarn'
cache: 'pnpm'
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress run
uses: cypress-io/github-action@v6
with:
build: yarn build
start: yarn preview
build: pnpm build
start: pnpm preview
wait-on: 'http://localhost:3000'
record: true
parallel: true

View File

@@ -15,22 +15,25 @@ jobs:
uses: actions/checkout@v3
- uses: actions/cache@v3
id: yarn-and-build-cache
id: pnpm-and-build-cache
with:
path: |
build
node_modules
key: ${{ runner.os }}-node_modules-build-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-node_modules-build-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node_modules-build-
- uses: actions/setup-node@v3
- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
node-version-file: '.node-version'
cache: 'pnpm'
- name: Lint & Test
run: |
yarn install
yarn lint
yarn test:unit
pnpm install
pnpm lint
pnpm test:unit

1
.gitignore vendored
View File

@@ -12,4 +12,3 @@
/functions
/node_modules
/snapshots.js
yarn-error.log

View File

@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
yarn pre-commit
pnpm pre-commit

View File

@@ -1 +1 @@
20.19.0
22.14.0

1
.npmrc
View File

@@ -1 +1,2 @@
engine-strict=true
auto-install-peers=true

View File

@@ -5,4 +5,5 @@ build/**
node_modules/**
coverage/**
__snapshots__/**
snapshots.js
snapshots.js
pnpm-lock.yaml

View File

@@ -25,7 +25,7 @@
"tailwindcss",
"uparrow"
],
"vitest.commandLine": "yarn test:unit",
"vitest.commandLine": "pnpm test:unit",
"vitest.enable": true,
"testing.autoRun.mode": "rerun",
"svelte.enable-ts-plugin": true,

View File

@@ -1,16 +1,16 @@
FROM docker.io/library/node:20-alpine3.18 AS mermaid-live-editor-dependencies
FROM docker.io/library/node:22-alpine3.21 AS mermaid-live-editor-dependencies
RUN apk --no-cache add build-base git python3 && \
rm -rf /var/cache/apk/*
RUN yarn global add node-gyp
RUN corepack enable pnpm
WORKDIR /app
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
@@ -22,13 +22,13 @@ ARG MERMAID_IS_ENABLED_MERMAID_CHART_LINKS
COPY . ./
RUN yarn build
RUN pnpm build
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.27-alpine3.21 AS mermaid
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=mermaid-live-editor-builder /app/docs /usr/share/nginx/html

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!
If you want to speed up the progress for mermaid-live-editor, join the slack channel and contact knsv.
# mermaid-live-editor
# Mermaid Live Editor
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/).
# Contributors are welcome!
If you want to speed up the progress for mermaid-live-editor, join the Discord channel and contact knsv.
## Docker
### Run published image
@@ -98,15 +100,14 @@ https://docs.github.com/en/get-started/quickstart/fork-a-repo
## Requirements
- [volta](https://volta.sh/) to manage node versions.
- [Node.js](https://nodejs.org/en/). `volta install node`
- [yarn](https://yarnpkg.com/) package manager. `volta install yarn`
- [Node.js](https://nodejs.org/en/) current LTS version
- [pnpm](https://pnpm.io/) package manager. Install with `corepack enable pnpm`
## Development
```sh
yarn install
yarn dev -- --open
pnpm install
pnpm dev -- --open
```
This app is created with Svelte Kit.

View File

@@ -6,7 +6,7 @@
# git clone https://github.com/mermaid-js/docs.git
set -e
rm -rf docs
yarn release
pnpm release
pushd .
if [ ! -d ../docs ]; then
echo "Clone https://github.com/mermaid-js/docs to parent folder before continuing."

View File

@@ -5,8 +5,8 @@
"license": "MIT",
"scripts": {
"dev": "vite dev",
"dev:force": "MERMAID_LOCAL=true yarn dev --force",
"dev:test": "yarn dev",
"dev:force": "MERMAID_LOCAL=true pnpm dev --force",
"dev:test": "pnpm dev",
"build": "vite build",
"preview": "vite preview",
"lint": "prettier --check --cache . && eslint --ignore-path .gitignore .",
@@ -18,7 +18,7 @@
"test:ui": "vitest --ui",
"test:coverage": "vitest run --coverage",
"test:browser": "cypress run",
"test": "test:unit && test:browser",
"test": "pnpm test:unit && pnpm test:browser",
"cy": "cypress open"
},
"devDependencies": {
@@ -62,7 +62,7 @@
"prettier": "^3.1.0",
"prettier-plugin-svelte": "^3.2.6",
"prettier-plugin-tailwindcss": "^0.6.0",
"svelte": "^5.0.0",
"svelte": "^5.23.1",
"svelte-preprocess": "^6.0.0",
"tailwindcss": "^3.4.1",
"tslib": "^2.6.2",
@@ -78,7 +78,7 @@
"dayjs": "^1.11.7",
"js-base64": "3.7.7",
"lodash-es": "^4.17.21",
"mermaid": "^11.3.0",
"mermaid": "^11.5.0",
"monaco-editor": "0.52.2",
"pako": "2.1.0",
"plausible-tracker": "^0.3.8",
@@ -93,11 +93,20 @@
"eslint --ignore-path .gitignore "
]
},
"volta": {
"node": "18.20.7",
"yarn": "1.22.22"
},
"engines": {
"node": ">=16.7"
"node": ">=20"
},
"packageManager": "pnpm@10.6.3+sha512.bb45e34d50a9a76e858a95837301bfb6bd6d35aea2c5d52094fa497a467c43f5c440103ce2511e9e0a2f89c3d6071baac3358fc68ac6fb75e2ceb3d2736065e6",
"pnpm": {
"onlyBuiltDependencies": [
"@cypress/snapshot",
"cypress",
"deasync",
"esbuild",
"svelte-preprocess"
],
"ignoredBuiltDependencies": [
"vue-demi"
]
}
}

8478
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -24,5 +24,6 @@
"major": {
"dependencyDashboardApproval": true
},
"dependencyDashboardAutoclose": true
"dependencyDashboardAutoclose": true,
"rangeStrategy": "bump"
}

7074
yarn.lock

File diff suppressed because it is too large Load Diff