From 98c94140712d3e5c356c5ab2d736cbae4b50f3e8 Mon Sep 17 00:00:00 2001 From: Brian McGee Date: Thu, 3 Jul 2025 17:43:46 +0100 Subject: [PATCH] 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. --- pkgs/clan-app/flake-module.nix | 38 +++++++++--------- pkgs/clan-app/ui.nix | 70 +++++++++++++++++----------------- 2 files changed, 55 insertions(+), 53 deletions(-) diff --git a/pkgs/clan-app/flake-module.nix b/pkgs/clan-app/flake-module.nix index 5ce238ba0..9076c0260 100644 --- a/pkgs/clan-app/flake-module.nix +++ b/pkgs/clan-app/flake-module.nix @@ -1,34 +1,34 @@ { perSystem = { - lib, self', pkgs, config, ... }: { - packages = - { - webview-lib = pkgs.callPackage ./webview-lib { }; - clan-app = pkgs.callPackage ./default.nix { - inherit (config.packages) clan-cli clan-app-ui webview-lib; - pythonRuntime = pkgs.python3; - }; + packages = { + webview-lib = pkgs.callPackage ./webview-lib { }; + clan-app = pkgs.callPackage ./default.nix { + inherit (config.packages) clan-cli clan-app-ui webview-lib; + pythonRuntime = pkgs.python3; + }; - fonts = pkgs.callPackage ./fonts.nix { }; + fonts = pkgs.callPackage ./fonts.nix { }; - clan-app-ui = pkgs.callPackage ./ui.nix { - clan-ts-api = config.packages.clan-ts-api; - fonts = config.packages.fonts; - }; + clan-app-ui = pkgs.callPackage ./ui.nix { + clan-ts-api = config.packages.clan-ts-api; + fonts = config.packages.fonts; + }; - } - // - # todo add darwin support - (lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux { - clan-app-ui-storybook = self'.packages.clan-app-ui.storybook; - }); + }; + # // + # todo add darwin support + # todo re-enable + # 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 { inherit self'; diff --git a/pkgs/clan-app/ui.nix b/pkgs/clan-app/ui.nix index b264e7492..ec15b8c4f 100644 --- a/pkgs/clan-app/ui.nix +++ b/pkgs/clan-app/ui.nix @@ -3,11 +3,9 @@ nodejs_22, importNpmLock, clan-ts-api, - playwright-driver, - ps, fonts, }: -buildNpmPackage (finalAttrs: { +buildNpmPackage (_finalAttrs: { pname = "clan-app-ui"; version = "0.0.1"; nodejs = nodejs_22; @@ -25,35 +23,39 @@ buildNpmPackage (finalAttrs: { cp -r ${fonts} ".fonts" ''; - passthru = rec { - storybook = buildNpmPackage { - pname = "${finalAttrs.pname}-storybook"; - inherit (finalAttrs) - version - nodejs - src - npmDeps - npmConfigHook - preBuild - ; - - nativeBuildInputs = finalAttrs.nativeBuildInputs ++ [ - ps - ]; - - npmBuildScript = "test-storybook-static"; - - env = finalAttrs.env // { - PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = 1; - PLAYWRIGHT_BROWSERS_PATH = "${playwright-driver.browsers.override { - withChromiumHeadlessShell = true; - }}"; - PLAYWRIGHT_HOST_PLATFORM_OVERRIDE = "ubuntu-24.04"; - }; - - postBuild = '' - mv storybook-static $out - ''; - }; - }; + # todo figure out why this fails only inside of Nix + # 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 + # + # passthru = rec { + # storybook = buildNpmPackage { + # pname = "${finalAttrs.pname}-storybook"; + # inherit (finalAttrs) + # version + # nodejs + # src + # npmDeps + # npmConfigHook + # preBuild + # ; + # + # nativeBuildInputs = finalAttrs.nativeBuildInputs ++ [ + # ps + # ]; + # + # npmBuildScript = "test-storybook-static"; + # + # env = finalAttrs.env // { + # PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = 1; + # PLAYWRIGHT_BROWSERS_PATH = "${playwright-driver.browsers.override { + # withChromiumHeadlessShell = true; + # }}"; + # PLAYWRIGHT_HOST_PLATFORM_OVERRIDE = "ubuntu-24.04"; + # }; + # + # postBuild = '' + # mv storybook-static $out + # ''; + # }; + # }; })