From 051c54bc5fd21db7758abfc8cbd53921bf50495e Mon Sep 17 00:00:00 2001 From: eric thul Date: Wed, 14 Jan 2015 22:53:28 -0500 Subject: updating example --- example/src/Foo.purs | 5 +++++ example/src/Test.purs | 2 ++ example/src/entry.js | 6 ++++-- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 example/src/Foo.purs (limited to 'example/src') diff --git a/example/src/Foo.purs b/example/src/Foo.purs new file mode 100644 index 0000000..2d35d3f --- /dev/null +++ b/example/src/Foo.purs @@ -0,0 +1,5 @@ +module Foo (foo) where + +import Data.Maybe + +foo = "b" diff --git a/example/src/Test.purs b/example/src/Test.purs index 7409c6e..8a5cb88 100644 --- a/example/src/Test.purs +++ b/example/src/Test.purs @@ -1,3 +1,5 @@ module Test (test) where +import Data.Maybe + test = "a" diff --git a/example/src/entry.js b/example/src/entry.js index 65119f6..4c15475 100644 --- a/example/src/entry.js +++ b/example/src/entry.js @@ -1,3 +1,5 @@ -var test = require('purs?no-prelude&output=output!./Test.purs'); +var test = require('purs?output=output!./Test.purs'); -console.log(test); +var foo = require('purs?output=output!./Foo.purs'); + +console.log(test, foo); -- cgit v1.2.3 From a92aa714f0a5436d9f06f82b3cad4df8129e4064 Mon Sep 17 00:00:00 2001 From: eric thul Date: Sat, 17 Jan 2015 16:24:33 -0500 Subject: Parsing module name from source Resolves issue #3 since the the module name defined in the PureScript file is used to resolve the location of the CommonJS-generated output. --- example/src/Foo.purs | 1 + example/src/Foo/Bar.purs | 3 +++ example/src/Foo/Baz.purs | 3 +++ example/src/entry.js | 4 +++- 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 example/src/Foo/Bar.purs create mode 100644 example/src/Foo/Baz.purs (limited to 'example/src') diff --git a/example/src/Foo.purs b/example/src/Foo.purs index 2d35d3f..3e3a04c 100644 --- a/example/src/Foo.purs +++ b/example/src/Foo.purs @@ -1,5 +1,6 @@ module Foo (foo) where import Data.Maybe +import qualified Foo.Bar as B foo = "b" diff --git a/example/src/Foo/Bar.purs b/example/src/Foo/Bar.purs new file mode 100644 index 0000000..4ae100d --- /dev/null +++ b/example/src/Foo/Bar.purs @@ -0,0 +1,3 @@ +module Foo.Bar (bar) where + +bar = "c" diff --git a/example/src/Foo/Baz.purs b/example/src/Foo/Baz.purs new file mode 100644 index 0000000..7b0451e --- /dev/null +++ b/example/src/Foo/Baz.purs @@ -0,0 +1,3 @@ +module Foo.Baz (baz) where + +baz = "d" diff --git a/example/src/entry.js b/example/src/entry.js index 4c15475..160bee4 100644 --- a/example/src/entry.js +++ b/example/src/entry.js @@ -2,4 +2,6 @@ var test = require('purs?output=output!./Test.purs'); var foo = require('purs?output=output!./Foo.purs'); -console.log(test, foo); +var baz = require('purs?output=output!./Foo/Baz.purs'); + +console.log(test, foo, baz); -- cgit v1.2.3