fix(ui): disabled storybook derivation

Something about passing orientation in any of the Form stories is causing the browser to crash

`npm run test-storybook-static` works fine in the devshell.

Disabling for now as it's slowing down development.
This commit is contained in:
Brian McGee
2025-07-03 17:43:46 +01:00
parent dcb7e546ca
commit 98c9414071
2 changed files with 55 additions and 53 deletions

View File

@@ -1,34 +1,34 @@
{ {
perSystem = perSystem =
{ {
lib,
self', self',
pkgs, pkgs,
config, config,
... ...
}: }:
{ {
packages = packages = {
{ webview-lib = pkgs.callPackage ./webview-lib { };
webview-lib = pkgs.callPackage ./webview-lib { }; clan-app = pkgs.callPackage ./default.nix {
clan-app = pkgs.callPackage ./default.nix { inherit (config.packages) clan-cli clan-app-ui webview-lib;
inherit (config.packages) clan-cli clan-app-ui webview-lib; pythonRuntime = pkgs.python3;
pythonRuntime = pkgs.python3; };
};
fonts = pkgs.callPackage ./fonts.nix { }; fonts = pkgs.callPackage ./fonts.nix { };
clan-app-ui = pkgs.callPackage ./ui.nix { clan-app-ui = pkgs.callPackage ./ui.nix {
clan-ts-api = config.packages.clan-ts-api; clan-ts-api = config.packages.clan-ts-api;
fonts = config.packages.fonts; fonts = config.packages.fonts;
}; };
} };
// # //
# todo add darwin support # todo add darwin support
(lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux { # todo re-enable
clan-app-ui-storybook = self'.packages.clan-app-ui.storybook; # see ui.nix for an explanation of why this is disabled for now
}); # (lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
# clan-app-ui-storybook = self'.packages.clan-app-ui.storybook;
# });
devShells.clan-app = pkgs.callPackage ./shell.nix { devShells.clan-app = pkgs.callPackage ./shell.nix {
inherit self'; inherit self';

View File

@@ -3,11 +3,9 @@
nodejs_22, nodejs_22,
importNpmLock, importNpmLock,
clan-ts-api, clan-ts-api,
playwright-driver,
ps,
fonts, fonts,
}: }:
buildNpmPackage (finalAttrs: { buildNpmPackage (_finalAttrs: {
pname = "clan-app-ui"; pname = "clan-app-ui";
version = "0.0.1"; version = "0.0.1";
nodejs = nodejs_22; nodejs = nodejs_22;
@@ -25,35 +23,39 @@ buildNpmPackage (finalAttrs: {
cp -r ${fonts} ".fonts" cp -r ${fonts} ".fonts"
''; '';
passthru = rec { # todo figure out why this fails only inside of Nix
storybook = buildNpmPackage { # Something about passing orientation in any of the Form stories is causing the browser to crash
pname = "${finalAttrs.pname}-storybook"; # `npm run test-storybook-static` works fine in the devshell
inherit (finalAttrs) #
version # passthru = rec {
nodejs # storybook = buildNpmPackage {
src # pname = "${finalAttrs.pname}-storybook";
npmDeps # inherit (finalAttrs)
npmConfigHook # version
preBuild # nodejs
; # src
# npmDeps
nativeBuildInputs = finalAttrs.nativeBuildInputs ++ [ # npmConfigHook
ps # preBuild
]; # ;
#
npmBuildScript = "test-storybook-static"; # nativeBuildInputs = finalAttrs.nativeBuildInputs ++ [
# ps
env = finalAttrs.env // { # ];
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = 1; #
PLAYWRIGHT_BROWSERS_PATH = "${playwright-driver.browsers.override { # npmBuildScript = "test-storybook-static";
withChromiumHeadlessShell = true; #
}}"; # env = finalAttrs.env // {
PLAYWRIGHT_HOST_PLATFORM_OVERRIDE = "ubuntu-24.04"; # PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = 1;
}; # PLAYWRIGHT_BROWSERS_PATH = "${playwright-driver.browsers.override {
# withChromiumHeadlessShell = true;
postBuild = '' # }}";
mv storybook-static $out # PLAYWRIGHT_HOST_PLATFORM_OVERRIDE = "ubuntu-24.04";
''; # };
}; #
}; # postBuild = ''
# mv storybook-static $out
# '';
# };
# };
}) })