Add and use build-configs.yaml

This commit is contained in:
Oliver Davies 2025-10-06 12:00:00 +01:00
parent 44ae28287f
commit c3cf2f249a
8 changed files with 83 additions and 27 deletions

1
storybook/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

31
storybook/.gitignore vendored
View file

@ -1,27 +1,4 @@
# Logs /.direnv/
logs /*storybook.log
*.log /node_modules/
npm-debug.log* /storybook-static/
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*storybook.log
storybook-static

11
storybook/build Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
export PATH="$PATH:./node_modules/.bin"
: "${NODE_ENV:=production}"
export STORYBOOK_DISABLE_TELEMETRY=1
storybook build "$@"

View file

@ -0,0 +1,3 @@
---
name: oliverdavies.uk-storybook
template: node-storybook

5
storybook/clean Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail
rm -rf node_modules storybook-static

27
storybook/flake.lock generated Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1759381078,
"narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

19
storybook/flake.nix Normal file
View file

@ -0,0 +1,19 @@
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = inputs:
let
system = "x86_64-linux";
pkgs = import inputs.nixpkgs { inherit system; };
in
{
devShells.${system}.default =
with pkgs;
mkShell {
buildInputs = [
nodejs
nodePackages.npm
];
};
};
}

13
storybook/watch Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
export PATH="$PATH:./node_modules/.bin"
NODE_ENV="${NODE_ENV:-development}"
storybook dev \
--exact-port \
--no-open \
--port 6006 \
"$@"