From 3fcb0715925860680eef34e874232567ffebaa45 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Tue, 18 Jul 2023 22:06:43 +0530 Subject: [PATCH] Move docs.cli to scripts --- .vscode/launch.json | 2 +- packages/mermaid/package.json | 10 +++++----- packages/mermaid/{src => scripts}/docs.cli.mts | 0 packages/mermaid/{src => scripts}/docs.mts | 0 packages/mermaid/{src => scripts}/docs.spec.ts | 0 packages/mermaid/scripts/update-release-version.mts | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) rename packages/mermaid/{src => scripts}/docs.cli.mts (100%) rename packages/mermaid/{src => scripts}/docs.mts (100%) rename packages/mermaid/{src => scripts}/docs.spec.ts (100%) diff --git a/.vscode/launch.json b/.vscode/launch.json index 01ed070465..dc5ec94a10 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -17,7 +17,7 @@ "name": "Docs generation", "type": "node", "request": "launch", - "args": ["src/docs.cli.mts"], + "args": ["scripts/docs.cli.mts"], "runtimeArgs": ["--loader", "ts-node/esm"], "cwd": "${workspaceRoot}/packages/mermaid", "skipFiles": ["/**", "**/node_modules/**"], diff --git a/packages/mermaid/package.json b/packages/mermaid/package.json index cf0979d48f..c2e0d98344 100644 --- a/packages/mermaid/package.json +++ b/packages/mermaid/package.json @@ -25,12 +25,12 @@ "scripts": { "clean": "rimraf dist", "docs:code": "typedoc src/defaultConfig.ts src/config.ts src/mermaidAPI.ts && prettier --write ./src/docs/config/setup", - "docs:build": "rimraf ../../docs && pnpm docs:spellcheck && pnpm docs:code && ts-node-esm src/docs.cli.mts", - "docs:verify": "pnpm docs:spellcheck && pnpm docs:code && ts-node-esm src/docs.cli.mts --verify", - "docs:pre:vitepress": "pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && ts-node-esm src/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts", + "docs:build": "rimraf ../../docs && pnpm docs:spellcheck && pnpm docs:code && ts-node-esm scripts/docs.cli.mts", + "docs:verify": "pnpm docs:spellcheck && pnpm docs:code && ts-node-esm scripts/docs.cli.mts --verify", + "docs:pre:vitepress": "pnpm --filter ./src/docs prefetch && rimraf src/vitepress && pnpm docs:code && ts-node-esm scripts/docs.cli.mts --vitepress && pnpm --filter ./src/vitepress install --no-frozen-lockfile --ignore-scripts", "docs:build:vitepress": "pnpm docs:pre:vitepress && (cd src/vitepress && pnpm run build) && cpy --flat src/docs/landing/ ./src/vitepress/.vitepress/dist/landing", - "docs:dev": "pnpm docs:pre:vitepress && concurrently \"pnpm --filter ./src/vitepress dev\" \"ts-node-esm src/docs.cli.mts --watch --vitepress\"", - "docs:dev:docker": "pnpm docs:pre:vitepress && concurrently \"pnpm --filter ./src/vitepress dev:docker\" \"ts-node-esm src/docs.cli.mts --watch --vitepress\"", + "docs:dev": "pnpm docs:pre:vitepress && concurrently \"pnpm --filter ./src/vitepress dev\" \"ts-node-esm scripts/docs.cli.mts --watch --vitepress\"", + "docs:dev:docker": "pnpm docs:pre:vitepress && concurrently \"pnpm --filter ./src/vitepress dev:docker\" \"ts-node-esm scripts/docs.cli.mts --watch --vitepress\"", "docs:serve": "pnpm docs:build:vitepress && vitepress serve src/vitepress", "docs:spellcheck": "cspell --config ../../cSpell.json \"src/docs/**/*.md\"", "docs:release-version": "ts-node-esm scripts/update-release-version.mts", diff --git a/packages/mermaid/src/docs.cli.mts b/packages/mermaid/scripts/docs.cli.mts similarity index 100% rename from packages/mermaid/src/docs.cli.mts rename to packages/mermaid/scripts/docs.cli.mts diff --git a/packages/mermaid/src/docs.mts b/packages/mermaid/scripts/docs.mts similarity index 100% rename from packages/mermaid/src/docs.mts rename to packages/mermaid/scripts/docs.mts diff --git a/packages/mermaid/src/docs.spec.ts b/packages/mermaid/scripts/docs.spec.ts similarity index 100% rename from packages/mermaid/src/docs.spec.ts rename to packages/mermaid/scripts/docs.spec.ts diff --git a/packages/mermaid/scripts/update-release-version.mts b/packages/mermaid/scripts/update-release-version.mts index 82fa6442a7..7f292f21b2 100644 --- a/packages/mermaid/scripts/update-release-version.mts +++ b/packages/mermaid/scripts/update-release-version.mts @@ -12,7 +12,7 @@ import { SOURCE_DOCS_DIR, readSyncedUTF8file, MERMAID_RELEASE_VERSION, -} from '../src/docs.mjs'; +} from './docs.mjs'; import { writeFile } from 'fs/promises'; const verifyOnly: boolean = process.argv.includes('--verify');