From 311e46a40922262b109f84c9217ea96f88e0f9eb Mon Sep 17 00:00:00 2001 From: Brian McGee Date: Tue, 30 Apr 2024 12:47:33 +0100 Subject: [PATCH] doc: fix docs package build Vitepress cli does some funky stuff with the tty. Signed-off-by: Brian McGee --- docs/package-lock.json | 5 ++++- docs/package.json | 8 +++++--- nix/docs.nix | 13 ++++++++----- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/docs/package-lock.json b/docs/package-lock.json index 5d8c8e1..7683767 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -1,9 +1,12 @@ { - "name": "docs", + "name": "Treefmt Docs", + "version": "0.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { + "name": "Treefmt Docs", + "version": "0.0.1", "devDependencies": { "vitepress": "^1.1.4" } diff --git a/docs/package.json b/docs/package.json index c23fc98..7855144 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,11 +1,13 @@ { + "name": "treefmt-docs", + "version": "0.0.1", "devDependencies": { "vitepress": "^1.1.4" }, "scripts": { "vitepress": "vitepress", - "docs:dev": "vitepress dev", - "docs:build": "vitepress build", - "docs:preview": "vitepress preview" + "dev": "vitepress dev", + "build": "vitepress build", + "preview": "vitepress preview" } } diff --git a/nix/docs.nix b/nix/docs.nix index ca777fe..50a921a 100644 --- a/nix/docs.nix +++ b/nix/docs.nix @@ -9,9 +9,12 @@ _: { inherit (self'.packages.default) version; src = ../docs; - npmDepsHash = "sha256-acT9uaUhvxyM/S3hv1M9h5h2H5EpzrNbaxCYmzYn100="; + npmDepsHash = "sha256-J9qTWueOcSBq7qRec6YdTuWI2VlVQ0q6AynDLovf6s0="; - npmBuildScript = "docs:build"; + # we have to use a custom build phase because vitepress is doing something funky with the ttty + buildPhase = '' + cat | npm run build 2>&1 | cat + ''; installPhase = '' runHook preInstall @@ -32,19 +35,19 @@ _: { inherit category; name = "docs:dev"; help = "serve docs for local development"; - command = "cd $PRJ_ROOT/docs && npm run docs:dev"; + command = "cd $PRJ_ROOT/docs && npm dev"; } { inherit category; name = "docs:build"; help = "create a production build of docs"; - command = "cd $PRJ_ROOT/docs && npm run docs:build"; + command = "cd $PRJ_ROOT/docs && npm build"; } { inherit category; name = "docs:preview"; help = "preview a production build of docs"; - command = "cd $PRJ_ROOT/docs && npm run docs:preview"; + command = "cd $PRJ_ROOT/docs && npm preview"; } { inherit category;