mermaid integration

This commit is contained in:
Martin Kavík 2024-09-26 12:45:17 +02:00
parent 39887b3396
commit 9bca370872
6 changed files with 1451 additions and 1 deletions

View file

@ -18,6 +18,7 @@ dependencies = [
"install_mzoon",
"init_pixi_canvas",
"init_tauri_glue",
"init_mermaid",
]
[tasks.start]
@ -27,6 +28,7 @@ run_task = { fork = true, parallel = true, name = [
"tauri_dev_with_cleanup",
"watch_pixi_canvas",
"watch_tauri_glue",
"watch_mermaid",
]}
[tasks.start_browser]
@ -36,6 +38,7 @@ run_task = { fork = true, parallel = true, name = [
"mzoon_start_with_cleanup",
"watch_pixi_canvas",
"watch_tauri_glue",
"watch_mermaid",
]}
[tasks.start_browser_release]
@ -45,6 +48,7 @@ run_task = { fork = true, parallel = true, name = [
"mzoon_start_release_with_cleanup",
"watch_pixi_canvas",
"watch_tauri_glue",
"watch_mermaid",
]}
[tasks.bundle]
@ -272,3 +276,47 @@ args = [
[tasks.watch_typecheck_tauri_glue.windows]
command = "node_modules/.bin/tsc.cmd"
## mermaid ##
[tasks.init_mermaid]
description = "Initialize `frontend/typescript/mermaid`"
cwd = "frontend/typescript/mermaid"
command = "npm"
args = ["install"]
[tasks.init_mermaid.windows]
command = "npm.cmd"
[tasks.watch_mermaid]
description = "Build and typescheck Typescript on change"
run_task = { fork = true, parallel = true, name = [
"watch_build_mermaid",
"watch_typecheck_mermaid",
]}
[tasks.watch_build_mermaid]
description = "Compile `frontend/typescript/mermaid` on change"
cwd = "frontend/typescript/mermaid"
command = "node_modules/.bin/esbuild"
args = ["mermaid.ts", "--bundle", "--outfile=../bundles/mermaid.js", "--format=esm", "--watch"]
[tasks.watch_build_mermaid.windows]
command = "node_modules/.bin/esbuild.cmd"
[tasks.watch_typecheck_mermaid]
description = "Typecheck `frontend/typescript/mermaid` on change"
cwd = "frontend/typescript/mermaid"
command = "node_modules/.bin/tsc"
args = [
"mermaid.ts",
"--watch",
"--noEmit",
"--preserveWatchOutput",
"--strict",
"--target", "esnext",
"--module", "esnext",
"--moduleResolution", "bundler",
]
[tasks.watch_typecheck_mermaid.windows]
command = "node_modules/.bin/tsc.cmd"

View file

@ -0,0 +1,12 @@
Init
- `npm install`
Watch & build (without typechecking)
- `node_modules/.bin/esbuild mermaid.ts --bundle --outfile=../bundles/mermaid.js --format=esm --watch`
Watch & typecheck (without building)
- `node_modules/.bin/tsc mermaid.ts --watch -noEmit --preserveWatchOutput --target esnext --module esnext --moduleResolution bundler`
Created with commands:
- `npm i -E mermaid`
- `npm i -D esbuild typescript`

View file

@ -0,0 +1,3 @@
export function hello(): String {
return "Hello from Mermaid"
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,9 @@
{
"dependencies": {
"mermaid": "11.2.1"
},
"devDependencies": {
"esbuild": "^0.24.0",
"typescript": "^5.6.2"
}
}

View file

@ -2,7 +2,7 @@ Init
- `npm install`
Watch & build (without typechecking)
-`- `node_modules/.bin/esbuild pixi_canvas.ts --bundle --outfile=../bundles/tauri_glue.js --format=esm --watch``
- `node_modules/.bin/esbuild tauri_glue.ts --bundle --outfile=../bundles/tauri_glue.js --format=esm --watch`
Watch & typecheck (without building)
- `node_modules/.bin/tsc tauri_glue.ts --watch -noEmit --preserveWatchOutput --target esnext --module esnext --moduleResolution bundler`