]> git.immae.eu Git - github/fretlink/purs-loader.git/commitdiff
Defers to the plugin for writing PureScript output
authoreric thul <thul.eric@gmail.com>
Sun, 13 Mar 2016 14:00:17 +0000 (10:00 -0400)
committereric thul <thul.eric@gmail.com>
Sun, 13 Mar 2016 14:00:17 +0000 (10:00 -0400)
bower.json
docs/PursLoader/Plugin.md
src/PursLoader/Loader.purs
src/PursLoader/Plugin.purs

index 681612d7d09d1cc75178275105136abb1d3f5712..761c24c8d47dad1928582c42f00f131fbd3d36d9 100644 (file)
@@ -5,7 +5,6 @@
     "purescript-aff": "^0.13.0",
     "purescript-foreign": "^0.7.0",
     "purescript-unsafe-coerce": "~0.1.0",
-    "purescript-nullable": "~0.2.1",
-    "purescript-node-process": "~0.4.1"
+    "purescript-nullable": "~0.2.1"
   }
 }
index 9f9f8520a2a3153db654d567be63a6e0722ab1bf..7a524da94a35cb48427d623cbb504b72f05af176 100644 (file)
@@ -3,7 +3,7 @@
 #### `Compile`
 
 ``` purescript
-type Compile eff = Nullable Error -> DependencyGraph -> String -> Eff eff Unit
+type Compile eff = Nullable Error -> DependencyGraph -> Eff eff Unit
 ```
 
 #### `Context`
index c50c63c9d748c83ab31118489aaacfda499628d1..97954f67da7ba3e05cbea92abca2a7c35b4a7874 100644 (file)
@@ -5,12 +5,12 @@ module PursLoader.Loader
   , loaderFn
   ) where
 
-import Prelude (Unit(), ($), (>>=), (<$>), (<*>), (++), (<<<), bind, const, id, pure, unit, void)
+import Prelude (Unit(), ($), (>>=), (<$>), (<*>), (++), (<<<), bind, const, id, pure, unit)
 
 import Control.Bind (join)
 import Control.Monad.Eff (Eff(), foreachE)
 import Control.Monad.Eff.Console (CONSOLE())
-import Control.Monad.Eff.Exception (EXCEPTION(), Error(), error, message)
+import Control.Monad.Eff.Exception (EXCEPTION(), Error(), error)
 
 import Data.Array ((!!))
 import Data.Either (Either(..), either)
@@ -19,10 +19,6 @@ import Data.Maybe (maybe)
 import Data.Nullable (toMaybe)
 import Data.String.Regex (Regex(), match, noFlags, regex)
 
-import Node.Encoding (Encoding(UTF8))
-import Node.Process (stderr)
-import Node.Stream (writeString)
-
 import Unsafe.Coerce (unsafeCoerce)
 
 import PursLoader.LoaderRef
@@ -57,15 +53,11 @@ loader ref source = do
   pluginContext = (unsafeCoerce ref).purescriptWebpackPluginContext
 
   compile :: AsyncCallback (Effects eff) -> Plugin.Compile (Effects_ eff)
-  compile callback error' graph output = do
+  compile callback error' graph = do
     either (const $ pure unit) (\a -> debug ("Adding PureScript dependency " ++ a)) name
 
     addDependency ref (resourcePath ref)
 
-    void $ writeString stderr UTF8 output (pure unit)
-
-    maybe (pure unit) (\a -> void $ writeString stderr UTF8 (message a) (pure unit)) (toMaybe error')
-
     either (const $ callback (pure fixedError) "") id
            (handle <$> name <*> dependencies <*> exports)
     where
index 8bb53bec5e0b44b48c70abd21edd3ecd5a1c9263..c798c836ceef7e4b7044c838c157331e2906b7de 100644 (file)
@@ -15,7 +15,7 @@ import Data.Either (Either(..))
 import Data.Function (Fn4(), runFn4)
 import Data.Nullable (Nullable())
 
-type Compile eff = Nullable Error -> DependencyGraph -> String -> Eff eff Unit
+type Compile eff = Nullable Error -> DependencyGraph -> Eff eff Unit
 
 type Context eff = { compile :: Compile eff -> Eff eff Unit, options :: Options }