elm-make 0.1.1 → 0.1.2
raw patch · 4 files changed
+22/−8 lines, 4 filesdep ~elm-compiler
Dependency ranges changed: elm-compiler
Files
- elm-make.cabal +2/−2
- src/Arguments.hs +3/−1
- src/Build.hs +1/−1
- src/CrawlPackage.hs +16/−4
elm-make.cabal view
@@ -1,5 +1,5 @@ Name: elm-make-Version: 0.1.1+Version: 0.1.2 Synopsis: A build tool for Elm projects@@ -62,7 +62,7 @@ bytestring, containers >= 0.3, directory,- elm-compiler >= 0.14.1 && < 0.15,+ elm-compiler >= 0.15 && < 0.16, elm-package, filepath, mtl,
src/Arguments.hs view
@@ -7,7 +7,9 @@ import qualified Paths_elm_make as This import qualified Text.PrettyPrint.ANSI.Leijen as PP +import qualified Elm.Compiler as Compiler + data Arguments = Arguments { files :: [FilePath] , outputFile :: Maybe FilePath@@ -62,7 +64,7 @@ where top = "elm-make " ++ showVersion This.version- ++ ", (c) Evan Czaplicki 2014\n"+ ++ " (Elm Platform " ++ Compiler.version ++ ")\n" moreHelp = linesToDoc
src/Build.hs view
@@ -156,7 +156,7 @@ progress = fromIntegral (numIncompleteTasks state) / fromIntegral (numTasks env)- + -- WAIT - REGISTER RESULTS
src/CrawlPackage.hs view
@@ -2,7 +2,7 @@ module CrawlPackage where import Control.Arrow (second)-import Control.Monad.Error (MonadError, MonadIO, liftIO, throwError)+import Control.Monad.Error (MonadError, MonadIO, catchError, liftIO, throwError) import qualified Data.Map as Map import qualified Data.Maybe as Maybe import System.Directory (doesFileExist, getCurrentDirectory, setCurrentDirectory)@@ -51,7 +51,7 @@ dfsFromFiles root solution desc filePaths = do env <- initEnv root desc solution- + let pkgName = Desc.name desc info <- mapM (readPackageData pkgName Nothing) filePaths let names = map fst info@@ -162,7 +162,7 @@ addJsPath locs = do let jsPath = dir </> Module.nameToPath moduleName <.> "js"- jsExists <- + jsExists <- case moduleName of Module.Name ("Native" : _) -> liftIO (doesFileExist jsPath) _ -> return False@@ -181,7 +181,11 @@ -> m (Module.Name, (PackageData, [(Module.Name, Maybe Module.Name)])) readPackageData pkgName maybeName filePath = do source <- liftIO (readFile filePath)- (name, rawDeps) <- Compiler.parseDependencies source++ (name, rawDeps) <-+ Compiler.parseDependencies source `catchError` \msg ->+ throwError (addContext msg)+ checkName filePath name maybeName let deps =@@ -190,6 +194,14 @@ else Module.defaultImports ++ rawDeps return (name, (PackageData filePath deps, addParent (Just name) deps))+ where+ addContext msg =+ "Problem parsing imports in file " ++ filePath ++ " " ++ msg ++ "\n\n"+ ++ "There is probably a problem with the syntax of your imports. For example,\n"+ ++ "import syntax was changed a bit from 0.14 to 0.15:\n\n"+ ++ " 0.14: import Html (..)\n"+ ++ " 0.15: import Html exposing (..)\n\n"+ ++ "See <http://elm-lang.org/learn/Syntax.elm> for more info.\n\n" checkName