mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-08 10:06:40 +02:00
Merge branch 'develop' into pr/weedySeaDragon/3814
* develop: Rerun Support for development in Docker
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,8 +3,10 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
coverage/
|
coverage/
|
||||||
.idea/
|
.idea/
|
||||||
|
.pnpm-store/
|
||||||
|
|
||||||
dist
|
dist
|
||||||
|
v8-compile-cache-0
|
||||||
|
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
.npmrc
|
.npmrc
|
||||||
|
@@ -14,14 +14,30 @@ Please read in detail about how to contribute documentation and code on the [Mer
|
|||||||
|
|
||||||
## Development Installation
|
## Development Installation
|
||||||
|
|
||||||
|
If you don't have direct access to push to mermaid repositories, make a fork first. Then clone. Or clone directly from mermaid-js:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone git@github.com:mermaid-js/mermaid.git
|
git clone git@github.com:mermaid-js/mermaid.git
|
||||||
cd mermaid
|
cd mermaid
|
||||||
|
```
|
||||||
|
|
||||||
|
Install required packages:
|
||||||
|
|
||||||
|
```bash
|
||||||
# npx is required for first install as volta support for pnpm is not added yet.
|
# npx is required for first install as volta support for pnpm is not added yet.
|
||||||
npx pnpm install
|
npx pnpm install
|
||||||
pnpm test
|
pnpm test
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
If you are using docker and docker-compose, you have self-documented `run` bash script, which is a convenient alias for docker-compose commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./run install # npx pnpm install
|
||||||
|
./run test # pnpm test
|
||||||
|
```
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
9
docker-compose.yml
Normal file
9
docker-compose.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
version: '3.9'
|
||||||
|
services:
|
||||||
|
mermaid:
|
||||||
|
image: node:18.16.0-alpine3.18
|
||||||
|
stdin_open: true
|
||||||
|
tty: true
|
||||||
|
working_dir: /mermaid
|
||||||
|
volumes:
|
||||||
|
- ./:/mermaid
|
40
run
Executable file
40
run
Executable file
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
RUN="docker-compose run --rm"
|
||||||
|
command=$1
|
||||||
|
args=${@:2}
|
||||||
|
|
||||||
|
case $command in
|
||||||
|
|
||||||
|
sh)
|
||||||
|
$RUN mermaid sh $args
|
||||||
|
;;
|
||||||
|
|
||||||
|
install)
|
||||||
|
$RUN mermaid sh -c "npx pnpm install"
|
||||||
|
;;
|
||||||
|
|
||||||
|
test)
|
||||||
|
$RUN mermaid sh -c "npx pnpm test"
|
||||||
|
;;
|
||||||
|
|
||||||
|
lint)
|
||||||
|
$RUN mermaid sh -c "npx pnpm -w run lint:fix"
|
||||||
|
;;
|
||||||
|
|
||||||
|
help)
|
||||||
|
cat <<EOF
|
||||||
|
Run commonly used commands within docker containers
|
||||||
|
|
||||||
|
$0 install # Equvalent of pnpm install
|
||||||
|
$0 lint # Equvalent of pnpm -w run lint:fix
|
||||||
|
$0 sh # Open sh inside docker container for development
|
||||||
|
|
||||||
|
$0 help # Show this help
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
$0 help
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
Reference in New Issue
Block a user