From f620b7dd1cf26d9a9eed2914da9126a2808aca75 Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Wed, 28 Oct 2020 23:49:57 -0500 Subject: [PATCH] lint and promote public rules --- Shakefile.hs | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/Shakefile.hs b/Shakefile.hs index 2dba5f9b..8844f0c0 100644 --- a/Shakefile.hs +++ b/Shakefile.hs @@ -76,16 +76,27 @@ main = need elmFiles cmd_ "elm" "make" "--docs" out - "_build/bundle.js" %> \out -> do + "public/bundle.js" %> \out -> do libJsFiles <- getDirectoryFiles "." ["lib/**/*.js"] need (["package.json", "lib/index.js", "styleguide-app/manifest.js", "log/npm-install.txt"] ++ libJsFiles) cmd_ "./node_modules/.bin/browserify" "--entry" "styleguide-app/manifest.js" "--outfile" out - "_build/elm.js" %> \out -> do + "public/elm.js" %> \out -> do elmSources <- getDirectoryFiles "." ["styleguide-app/**/*.elm", "src/**/*.elm"] need elmSources cmd_ (Cwd "styleguide-app") "elm" "make" "Main.elm" "--output" (".." out) + "public/**/*" %> \out -> + copyFileChanged (replaceDirectory1 out "styleguide-app") out + + "log/public.txt" %> \out -> do + styleguideAssets <- getDirectoryFiles ("styleguide-app" "assets") ["**/*"] + need + ( ["public/index.html", "public/elm.js", "public/bundle.js"] + ++ map (("public" "assets") ) styleguideAssets + ) + writeFileChanged out "build styleguide app successfully" + -- dev deps we get dynamically instead of from Nix (frowny face) "log/npm-install.txt" %> \out -> do -- npm looks in some unrelated files for whatever reason. We mark @@ -122,16 +133,4 @@ main = phony "ci" $ do need ["log/check-exposed.txt", "test", "log/format.txt", "log/documentation.json", "public"] - -- public folder for styleguide - "public/**/*" %> \out -> - copyFileChanged (replaceDirectory1 out "styleguide-app") out - - "log/public.txt" %> \out -> do - styleguideAssets <- getDirectoryFiles ("styleguide-app" "assets") ["**/*"] - need - ( ["public/index.html", "public/elm.js", "public/bundle.js"] - ++ map (("public" "assets") ) styleguideAssets - ) - writeFileChanged out "done" - phony "public" $ need ["log/public.txt"]