mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Removed volta requirement, leave pnpm only
This commit is contained in:
parent
a3092fc174
commit
f6b321d769
2
Dockerfile
Normal file
2
Dockerfile
Normal file
@ -0,0 +1,2 @@
|
||||
FROM node:18.19.0-alpine3.18 AS base
|
||||
RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" sh -
|
@ -1,11 +1,14 @@
|
||||
version: '3.9'
|
||||
services:
|
||||
mermaid:
|
||||
image: node:18.19.0-alpine3.18
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
stdin_open: true
|
||||
tty: true
|
||||
working_dir: /mermaid
|
||||
mem_limit: '8G'
|
||||
entrypoint: "/mermaid/docker-entrypoint.sh"
|
||||
environment:
|
||||
- NODE_OPTIONS=--max_old_space_size=8192
|
||||
volumes:
|
||||
|
3
docker-entrypoint.sh
Executable file
3
docker-entrypoint.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
source /root/.shrc
|
||||
exec "$@"
|
@ -45,17 +45,18 @@ We support **development within Docker** environment along with **host setup**.
|
||||
|
||||
These are the tools we use for working with the code and documentation:
|
||||
|
||||
- [volta](https://volta.sh/) to manage node versions.
|
||||
- [Node.js](https://nodejs.org/en/). `volta install node`
|
||||
- [pnpm](https://pnpm.io/) package manager. `volta install pnpm`
|
||||
- [Node.js](https://nodejs.org/en/).
|
||||
- [pnpm](https://pnpm.io/) package manager.
|
||||
|
||||
In case you do not use `volta` the following commands must be sufficient enough to start with:
|
||||
The following commands must be sufficient enough to start with:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://get.pnpm.io/install.sh | sh -
|
||||
pnpm env use --global 18
|
||||
```
|
||||
|
||||
You may also need to reload `.shrc` or `.bashrc` afterwards.
|
||||
|
||||
**Docker**
|
||||
|
||||
[Install Docker](https://docs.docker.com/engine/install/). And that is pretty much all you need.
|
||||
|
42
run
42
run
@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
RUN="docker-compose run --rm"
|
||||
RUN="docker compose run --rm"
|
||||
|
||||
ansi() { echo -e "\e[${1}m${*:2}\e[0m"; }
|
||||
bold() { ansi 1 "$@"; }
|
||||
@ -14,16 +14,20 @@ args=${@:2}
|
||||
|
||||
case $command in
|
||||
|
||||
build)
|
||||
docker compose build $args
|
||||
;;
|
||||
|
||||
sh)
|
||||
$RUN mermaid sh -c "npx $args"
|
||||
$RUN mermaid sh # -c "npx $args"
|
||||
;;
|
||||
|
||||
pnpm)
|
||||
$RUN mermaid sh -c "npx pnpm $args"
|
||||
$RUN mermaid sh -c "pnpm $args"
|
||||
;;
|
||||
|
||||
dev)
|
||||
$RUN --service-ports mermaid sh -c "npx pnpm run dev"
|
||||
$RUN --service-ports mermaid sh -c "pnpm run dev"
|
||||
;;
|
||||
|
||||
docs:dev)
|
||||
@ -46,24 +50,26 @@ Welcome! Thank you for joining the development.
|
||||
This is a script for running commands within docker containers at ease.
|
||||
__________________________________________________________________________________________
|
||||
|
||||
Development quick start guide:
|
||||
Development Quick Start Guide:
|
||||
|
||||
$(bold ./$name pnpm install) # Install packages
|
||||
$(bold ./$name dev) # Run dev server with examples, open http://localhost:9000
|
||||
$(bold ./$name pnpm vitest) # Run watcher for unit tests
|
||||
$(bold ./$name cypress) # Run integration tests (after starting dev server)
|
||||
$(bold ./$name pnpm build) # Prepare it for production
|
||||
$(bold ./$name docs:dev) # Then add documentation, open http://localhost:3333
|
||||
$(bold ./$name pnpm install) # Install packages
|
||||
$(bold ./$name dev) # Launch dev server with examples, open http://localhost:9000
|
||||
$(bold ./$name docs:dev) # Launch official website, open http://localhost:3333
|
||||
|
||||
$(bold ./$name pnpm vitest) # Run watcher for unit tests
|
||||
$(bold ./$name cypress) # Run integration tests (after starting dev server)
|
||||
$(bold ./$name pnpm build) # Prepare it for production
|
||||
__________________________________________________________________________________________
|
||||
|
||||
Commands:
|
||||
|
||||
$(bold ./$name pnpm) # Run any 'pnpm' command
|
||||
$(bold ./$name dev) # Run dev server with examples, open http://localhost:9000
|
||||
$(bold ./$name docs:dev) # For docs contributions, open http://localhost:3333
|
||||
$(bold ./$name cypress) # Run integration tests
|
||||
$(bold ./$name sh) # Open 'sh' inside docker container for development
|
||||
$(bold ./$name help) # Show this help
|
||||
$(bold ./$name build) # Build image
|
||||
$(bold ./$name cypress) # Run integration tests
|
||||
$(bold ./$name dev) # Run dev server with examples, open http://localhost:9000
|
||||
$(bold ./$name docs:dev) # For docs contributions, open http://localhost:3333
|
||||
$(bold ./$name help) # Show this help
|
||||
$(bold ./$name pnpm) # Run any 'pnpm' command
|
||||
$(bold ./$name sh) # Open 'sh' inside docker container for development
|
||||
__________________________________________________________________________________________
|
||||
|
||||
Examples of frequiently used commands:
|
||||
@ -81,7 +87,7 @@ $(bold ./$name cypress open --project .)
|
||||
Open cypress interactive GUI
|
||||
|
||||
$(bold ./$name cypress run --spec cypress/integration/rendering/)$(underline test.spec.ts)
|
||||
Run specific test in cypress\n
|
||||
Run specific test in cypress
|
||||
|
||||
$(bold xhost +local:)
|
||||
Allow local connections for x11 server
|
||||
|
Loading…
x
Reference in New Issue
Block a user