From d843b5fd34fe0c83dbbc9e2d7035273664d77d8a Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sun, 2 Mar 2025 09:22:14 +0200 Subject: [PATCH] Tweak npm scripts * add `--strict` in the mkdocs build like on CI * add a `start` script to run serve (can be used with `npm start`) * move `build` to `pretest` As a result, build runs once on CI now --- .github/workflows/ci.yml | 5 +---- package.json | 8 +++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74ee3dd2f..dad7df8af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,8 +40,5 @@ jobs: - name: Install npm dependencies run: npm ci - - name: Build docs - run: mkdocs build --strict - - - name: Test + - name: Build and test run: npm test diff --git a/package.json b/package.json index c6a0511d8..637727c16 100644 --- a/package.json +++ b/package.json @@ -16,11 +16,13 @@ }, "homepage": "https://docs.pi-hole.net/", "scripts": { - "build": "mkdocs build --clean", + "build": "mkdocs build --clean --strict", "markdownlint": "markdownlint-cli2 \"**/*.md\" \"!**/node_modules/**\"", - "linkinator": "npm run build && linkinator site --recurse --silent --skip \"^(?!http://localhost)\"", + "linkinator": "linkinator site --recurse --silent --skip \"^(?!http://localhost)\"", + "pretest": "npm run build", "test": "npm run markdownlint && npm run linkinator", - "serve": "mkdocs serve --dev-addr 0.0.0.0:8000" + "serve": "mkdocs serve --dev-addr 0.0.0.0:8000", + "start": "npm run serve" }, "devDependencies": { "linkinator": "^6.1.2",