From 8c129b7fa9e0c4f3d2b6b940914256623b4fc828 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 2 Jun 2022 08:30:31 +0200 Subject: [PATCH] Extend SAC shell to install and compile frontend --- shells/sac/shell.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/shells/sac/shell.nix b/shells/sac/shell.nix index f8422cf..e7170e4 100644 --- a/shells/sac/shell.nix +++ b/shells/sac/shell.nix @@ -29,6 +29,31 @@ let "$PROJECT_ROOT/vendor/bin/phpstan" ''; }; + + reinstallFrontend = pkgs.writeShellApplication { + name = "compileFrontend"; + runtimeInputs = [ + pkgs.nodejs-14_x + pkgs.nodePackages.npm + ]; + text = '' + rm -rf "$PROJECT_ROOT/frontend/build/*" + npm ci --prefix="$PROJECT_ROOT/frontend/" + ''; + }; + + compileFrontend = pkgs.writeShellApplication { + name = "compileFrontend"; + runtimeInputs = [ + pkgs.nodejs-14_x + pkgs.nodePackages.npm + ]; + text = '' + npm run build --prefix="$PROJECT_ROOT/frontend" + notify-send "Done compiling frontend" + ''; + }; + in pkgs.mkShell { name = "TYPO3"; buildInputs = [ @@ -36,6 +61,8 @@ in pkgs.mkShell { pkgs.php74Packages.composer projectCsFixer projectPhpStan + reinstallFrontend + compileFrontend ]; shellHook = ''