Skip to content

Commit

Permalink
doc: fix docs package build
Browse files Browse the repository at this point in the history
Vitepress cli does some funky stuff with the tty.

Signed-off-by: Brian McGee <[email protected]>
  • Loading branch information
brianmcgee committed May 2, 2024
1 parent 95c6cdb commit 311e46a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
5 changes: 4 additions & 1 deletion docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
13 changes: 8 additions & 5 deletions nix/docs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit 311e46a

Please sign in to comment.