From 1a7a07b7a4fa93a55a600ca9d466020f3e11ab5a Mon Sep 17 00:00:00 2001 From: eric thul Date: Sun, 13 Mar 2016 10:06:11 -0400 Subject: Extracting out the example --- .gitignore | 4 ---- README.md | 34 +--------------------------------- example/README.md | 6 ------ example/bower.json | 7 ------- example/package.json | 18 ------------------ example/src/Bar.purs | 3 --- example/src/Foo.purs | 15 --------------- example/src/Foo/Bar.purs | 13 ------------- example/src/Foo/Baz.purs | 3 --- example/src/Foo/Boz.purs | 5 ----- example/src/FooFFI.js | 5 ----- example/src/Test.purs | 7 ------- example/src/TestFFI.js | 7 ------- example/src/entry.js | 11 ----------- example/src/jam.js | 5 ----- example/webpack.config.js | 28 ---------------------------- 16 files changed, 1 insertion(+), 170 deletions(-) delete mode 100644 example/README.md delete mode 100644 example/bower.json delete mode 100644 example/package.json delete mode 100644 example/src/Bar.purs delete mode 100644 example/src/Foo.purs delete mode 100644 example/src/Foo/Bar.purs delete mode 100644 example/src/Foo/Baz.purs delete mode 100644 example/src/Foo/Boz.purs delete mode 100644 example/src/FooFFI.js delete mode 100644 example/src/Test.purs delete mode 100644 example/src/TestFFI.js delete mode 100644 example/src/entry.js delete mode 100644 example/src/jam.js delete mode 100644 example/webpack.config.js diff --git a/.gitignore b/.gitignore index 6c930c3..0a05586 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,4 @@ index.js node_modules/ bower_components/ build/ -example/bundle.js -example/node_modules/ -example/bower_components/ -example/output/ tmp/ diff --git a/README.md b/README.md index e93e969..df92e69 100644 --- a/README.md +++ b/README.md @@ -14,36 +14,4 @@ npm install purs-loader --save-dev ## Example -```js -// webpack.config.js -'use strict'; - -var PurescriptWebpackPlugin = require('purescript-webpack-plugin'); - -var src = ['bower_components/purescript-*/src/**/*.purs', 'src/**/*.purs']; - -var ffi = ['bower_components/purescript-*/src/**/*.js', 'src/**/*FFI.js']; - -var modulesDirectories = [ - 'node_modules', - 'bower_components' -]; - -var config - = { entry: './src/entry' - , output: { path: __dirname - , pathinfo: true - , filename: 'bundle.js' - } - , module: { loaders: [ { test: /\.purs$/ - , loader: 'purs-loader' - } ] } - , resolve: { modulesDirectories: modulesDirectories } - , plugins: [ new PurescriptWebpackPlugin({src: src, ffi: ffi}) ] - } - ; - -module.exports = config; -``` - -See the [example](https://github.com/ethul/purs-loader/tree/master/example) directory for a complete example. +Refer to the [purescript-webpack-example](https://github.com/ethul/purescript-webpack-example) for an example. diff --git a/example/README.md b/example/README.md deleted file mode 100644 index bac4f6c..0000000 --- a/example/README.md +++ /dev/null @@ -1,6 +0,0 @@ -```bash -bower install -npm install -npm run-script build -npm run-script run -``` diff --git a/example/bower.json b/example/bower.json deleted file mode 100644 index c83e735..0000000 --- a/example/bower.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "example", - "private": true, - "devDependencies": { - "purescript-prelude": "~0.1.0" - } -} diff --git a/example/package.json b/example/package.json deleted file mode 100644 index e256de8..0000000 --- a/example/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "example", - "version": "0.0.0", - "private": true, - "scripts": { - "build": "webpack --progress --colors --bail", - "build:watch": "webpack --progress --colors --watch", - "run": "node bundle.js", - "clean": "rm -rf bower_components && rm -rf bundle.js && rm -rf node_modules && rm -rf output" - }, - "license": "MIT", - "devDependencies": { - "node-libs-browser": "^0.5.2", - "purescript-webpack-plugin": "^0.1.1", - "purs-loader": "file:../", - "webpack": "^1.12.9" - } -} diff --git a/example/src/Bar.purs b/example/src/Bar.purs deleted file mode 100644 index a37171f..0000000 --- a/example/src/Bar.purs +++ /dev/null @@ -1,3 +0,0 @@ -module Bar where - -test = "b" diff --git a/example/src/Foo.purs b/example/src/Foo.purs deleted file mode 100644 index a715be0..0000000 --- a/example/src/Foo.purs +++ /dev/null @@ -1,15 +0,0 @@ -module Foo where - -import Prelude - -import qualified Foo.Bar as B - -foo = "A" - -bar = "B" - -jaz = "D" ++ B.jar ++ B.jee - -foreign import foot :: String - -foreign import meter :: String diff --git a/example/src/Foo/Bar.purs b/example/src/Foo/Bar.purs deleted file mode 100644 index 1b0919c..0000000 --- a/example/src/Foo/Bar.purs +++ /dev/null @@ -1,13 +0,0 @@ -module Foo.Bar (bar, jar, jee) where - -import Foo.Boz - -bar = "u" - -bar' = "d" - -jam = "c" - -jar = "xyzw" - -jee = "abcde" diff --git a/example/src/Foo/Baz.purs b/example/src/Foo/Baz.purs deleted file mode 100644 index 7b0451e..0000000 --- a/example/src/Foo/Baz.purs +++ /dev/null @@ -1,3 +0,0 @@ -module Foo.Baz (baz) where - -baz = "d" diff --git a/example/src/Foo/Boz.purs b/example/src/Foo/Boz.purs deleted file mode 100644 index c802e47..0000000 --- a/example/src/Foo/Boz.purs +++ /dev/null @@ -1,5 +0,0 @@ -module Foo.Boz where - -a = "a" - -b = "b" diff --git a/example/src/FooFFI.js b/example/src/FooFFI.js deleted file mode 100644 index a2681c8..0000000 --- a/example/src/FooFFI.js +++ /dev/null @@ -1,5 +0,0 @@ -// module Foo - -exports.foot = "a"; - -exports.meter = "b"; diff --git a/example/src/Test.purs b/example/src/Test.purs deleted file mode 100644 index 3a92681..0000000 --- a/example/src/Test.purs +++ /dev/null @@ -1,7 +0,0 @@ -module Test (testing) where - -bar = "c" - -goo = "a" - -foreign import testing :: String diff --git a/example/src/TestFFI.js b/example/src/TestFFI.js deleted file mode 100644 index dc2f04f..0000000 --- a/example/src/TestFFI.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -// module Test - -var testing = 'abcde'; - -exports.testing = testing; diff --git a/example/src/entry.js b/example/src/entry.js deleted file mode 100644 index a1e2a99..0000000 --- a/example/src/entry.js +++ /dev/null @@ -1,11 +0,0 @@ -var Prelude = require('purescript-prelude/src/Prelude'); - -var test = require('./Test'); - -var foo = require('./Foo.purs'); - -var baz = require('./Foo/Baz'); - -var jam = require('./jam'); - -console.log(Prelude, test, foo, baz, jam); diff --git a/example/src/jam.js b/example/src/jam.js deleted file mode 100644 index 8889a69..0000000 --- a/example/src/jam.js +++ /dev/null @@ -1,5 +0,0 @@ -var x = 'a'; - -var abcde = require('./Bar'); - -module.exports = abcde; diff --git a/example/webpack.config.js b/example/webpack.config.js deleted file mode 100644 index 602de84..0000000 --- a/example/webpack.config.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -var PurescriptWebpackPlugin = require('purescript-webpack-plugin'); - -var src = ['bower_components/purescript-*/src/**/*.purs', 'src/**/*.purs']; - -var ffi = ['bower_components/purescript-*/src/**/*.js', 'src/**/*FFI.js']; - -var modulesDirectories = [ - 'node_modules', - 'bower_components' -]; - -var config - = { entry: './src/entry' - , output: { path: __dirname - , pathinfo: true - , filename: 'bundle.js' - } - , module: { loaders: [ { test: /\.purs$/ - , loader: 'purs-loader' - } ] } - , resolve: { modulesDirectories: modulesDirectories, extensions: [ '', '.js', '.purs'] } - , plugins: [ new PurescriptWebpackPlugin({src: src, ffi: ffi}) ] - } - ; - -module.exports = config; -- cgit v1.2.3