doc: fix docs package build

Vitepress cli does some funky stuff with the tty.

Signed-off-by: Brian McGee <brian@bmcgee.ie>
This commit is contained in:
Brian McGee 2024-04-30 12:47:33 +01:00
parent 95c6cdbd57
commit 311e46a409
Signed by: brianmcgee
GPG Key ID: D49016E76AD1E8C0
3 changed files with 17 additions and 9 deletions

View File

@ -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"
}

View File

@ -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"
}
}

View File

@ -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;