Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit c76e143

Browse files
committed
Updates for 0.7
1 parent aa1b0d0 commit c76e143

File tree

6 files changed

+231
-230
lines changed

6 files changed

+231
-230
lines changed

MODULE.md

Lines changed: 76 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ instance isForeignPsc :: IsForeign Psc
156156
```
157157

158158

159-
#### `isForeignPscMake`
159+
#### `isForeignPscBundle`
160160

161161
``` purescript
162-
instance isForeignPscMake :: IsForeign PscMake
162+
instance isForeignPscBundle :: IsForeign PscBundle
163163
```
164164

165165

@@ -170,38 +170,101 @@ instance isForeignPscDocs :: IsForeign PscDocs
170170
```
171171

172172

173+
#### `isForeignDotPsci`
174+
175+
``` purescript
176+
instance isForeignDotPsci :: IsForeign DotPsci
177+
```
178+
179+
180+
#### `isForeignPathArray`
181+
182+
``` purescript
183+
instance isForeignPathArray :: IsForeign PathArray
184+
```
185+
186+
187+
#### `isForeignDocgen`
188+
189+
``` purescript
190+
instance isForeignDocgen :: IsForeign Docgen
191+
```
192+
193+
173194
#### `isForeignFormat`
174195

175196
``` purescript
176197
instance isForeignFormat :: IsForeign Format
177198
```
178199

179200

180-
#### `pscOptions`
201+
#### `commandLineOptionBoolean`
202+
203+
``` purescript
204+
instance commandLineOptionBoolean :: CommandLineOption Boolean
205+
```
206+
207+
208+
#### `commandLineOptionString`
181209

182210
``` purescript
183-
pscOptions :: Foreign -> [String]
211+
instance commandLineOptionString :: CommandLineOption String
184212
```
185213

186214

187-
#### `pscOptionsNoOutput`
215+
#### `commandLineOptionEither`
216+
217+
``` purescript
218+
instance commandLineOptionEither :: (CommandLineOption a, CommandLineOption b) => CommandLineOption (Either a b)
219+
```
220+
221+
222+
#### `commandLineOptionArray`
223+
224+
``` purescript
225+
instance commandLineOptionArray :: (CommandLineOption a) => CommandLineOption [a]
226+
```
227+
228+
229+
#### `commandLineOptionPathArray`
230+
231+
``` purescript
232+
instance commandLineOptionPathArray :: CommandLineOption PathArray
233+
```
234+
235+
236+
#### `commandLineOptionDocgen`
237+
238+
``` purescript
239+
instance commandLineOptionDocgen :: CommandLineOption Docgen
240+
```
241+
242+
243+
#### `commandLineOptionFormat`
244+
245+
``` purescript
246+
instance commandLineOptionFormat :: CommandLineOption Format
247+
```
248+
249+
250+
#### `pscOptions`
188251

189252
``` purescript
190-
pscOptionsNoOutput :: Foreign -> Tuple (Maybe String) [String]
253+
pscOptions :: Foreign -> Either ForeignError [String]
191254
```
192255

193256

194-
#### `pscMakeOptions`
257+
#### `pscBundleOptions`
195258

196259
``` purescript
197-
pscMakeOptions :: Foreign -> [String]
260+
pscBundleOptions :: Foreign -> Either ForeignError [String]
198261
```
199262

200263

201264
#### `pscDocsOptions`
202265

203266
``` purescript
204-
pscDocsOptions :: Foreign -> [String]
267+
pscDocsOptions :: Foreign -> Either ForeignError [String]
205268
```
206269

207270

@@ -308,21 +371,21 @@ type Effects eff = (which :: Which, through2 :: Through2, resolveBin :: ResolveB
308371
#### `psc`
309372

310373
``` purescript
311-
psc :: forall eff. Foreign -> Eff (Effects eff) (Stream File File)
374+
psc :: forall eff. Foreign -> (Error -> Eff (Effects eff) Unit) -> (Unit -> Eff (Effects eff) Unit) -> Eff (Effects eff) Unit
312375
```
313376

314377

315-
#### `pscMake`
378+
#### `pscBundle`
316379

317380
``` purescript
318-
pscMake :: forall eff. Foreign -> Eff (Effects eff) (Stream File Unit)
381+
pscBundle :: forall eff. Foreign -> (Error -> Eff (Effects eff) Unit) -> (Unit -> Eff (Effects eff) Unit) -> Eff (Effects eff) Unit
319382
```
320383

321384

322385
#### `pscDocs`
323386

324387
``` purescript
325-
pscDocs :: forall eff. Foreign -> Eff (Effects eff) (Stream File File)
388+
pscDocs :: forall eff. Foreign -> (Error -> Eff (Effects eff) Unit) -> (File -> Eff (Effects eff) Unit) -> Eff (Effects eff) Unit
326389
```
327390

328391

README.md

Lines changed: 19 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ Refer to the PureScript [compiler usage](https://github.com/purescript/purescrip
3636

3737
Invokes the `psc` command. The following options are supported.
3838

39-
###### `noPrelude` (Boolean)
39+
###### `src` (String or String Array)
4040

41-
Toggles `--no-prelude` that omits the Prelude.
41+
The location of the source files to compile. Glob syntax is supported.
42+
43+
###### `ffi` (String or String Array)
44+
45+
Sets one or more `--ffi=<string>` that specifies files for code that is included with a `foreign import` in the PureScript source.
4246

4347
###### `noTco` (Boolean)
4448

@@ -48,10 +52,6 @@ Toggles `--no-tco` that disables tail-call optimizations.
4852

4953
Toggles `--no-magic-do` that disables optimizations overloading the do keyword generating efficient code for the `Eff` monad.
5054

51-
###### `main` (Boolean or String)
52-
53-
Toggles `--main` or sets `--main=<string>` that generates code to run the `main` function in the specified module or the `Main` module by default.
54-
5555
###### `noOpts` (Boolean)
5656

5757
Toggles `--no-opts` that skips the optimization phase.
@@ -64,73 +64,37 @@ Toggles `--verbose-errors` that displays verbose error messages.
6464

6565
Toggles `--comments` that includes comments in generated code.
6666

67-
###### `browserNamespace` (String)
68-
69-
Sets `--browser-namespace=<string>` that specifies the namespace that PureScript modules will be exported to when running in the browser.
70-
71-
###### `externs` (String)
72-
73-
Sets `--externs=<string>` that specifies the externs file.
74-
75-
###### `module` (String Array)
76-
77-
Sets one or more `--module=<string>` that enables dead code elimination, removing all code without a transitive dependency of one of the specified modules.
78-
79-
###### `codegen` (String Array)
80-
81-
Sets one or more `--codegen=<string>` that generates code and externs for the specified modules.
82-
8367
###### `output` (String)
8468

85-
Sets the path value of the [File](https://github.com/wearefractal/vinyl) passed through the Gulp stream. Note that this will not set `--output=<string>`.
69+
Sets `--output=<string>` the specifies the output directory, `output` by default.
8670

8771
###### `noPrefix` (Boolean)
8872

8973
Toggles `--no-prefix` that does not include the comment header.
9074

91-
###### `ffi` (String Array)
92-
93-
Sets one or more `--ffi=<string>` that specifies the files for code that is included with a `foreign import` in the PureScript source.
94-
95-
### `purescript.pscMake(options)`
96-
97-
Invokes the `psc-make` command. The following options are supported.
98-
99-
###### `noPrelude` (Boolean)
100-
101-
Toggles `--no-prelude` that omits the Prelude.
102-
103-
###### `noTco` (Boolean)
104-
105-
Toggles `--no-tco` that disables tail-call optimizations.
106-
107-
###### `noMagicDo` (Boolean)
108-
109-
Toggles `--no-magic-do` that disables optimizations overloading the do keyword generating efficient code for the `Eff` monad.
110-
111-
###### `noOpts` (Boolean)
75+
### `purescript.pscBundle(options)`
11276

113-
Toggles `--no-opts` that skips the optimization phase.
77+
Invokes the `psc-bundle` command. The following options are supported.
11478

115-
###### `verboseErrors` (Boolean)
79+
###### `src` (String or String Array)
11680

117-
Toggles `--verbose-errors` that displays verbose error messages.
81+
The location of the `psc`-produced javascript source files to bundle. Glob syntax is supported.
11882

119-
###### `comments` (Boolean)
83+
###### `output` (String)
12084

121-
Toggles `--comments` that includes comments in generated code.
85+
Sets `--output=<string>` that specifies the output filename for the bundle.
12286

123-
###### `output` (String)
87+
###### `module` (String or String Array)
12488

125-
Sets `--output=<string>` the specifies the output directory, `output` by default.
89+
The name of the module or modules to use as entry points for dead code elimination.
12690

127-
###### `noPrefix` (Boolean)
91+
###### `main` (Boolean or String)
12892

129-
Toggles `--no-prefix` that does not include the comment header.
93+
Toggles `--main` or sets `--main=<string>` that generates code to run the `main` function in the specified module or the `Main` module by default.
13094

131-
###### `ffi` (String Array)
95+
###### `browserNamespace` (String)
13296

133-
Sets one or more `--ffi=<string>` that specifies files for code that is included with a `foreign import` in the PureScript source.
97+
Sets `--browser-namespace=<string>` that specifies the namespace that PureScript modules will be exported to when running in the browser.
13498

13599
### `purescript.pscDocs(options)`
136100

entry.js

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
11
'use strict';
22

33
var gulpPurescript = require('GulpPurescript.Plugin');
4+
var Promise = require('promise');
5+
6+
function promisify(aff) {
7+
return new Promise(function (resolve, reject) {
8+
var errback = function (err) {
9+
return function () {
10+
reject(err);
11+
};
12+
};
13+
var callback = function (x) {
14+
return function () {
15+
resolve(x);
16+
};
17+
};
18+
aff(errback)(callback)();
19+
});
20+
}
421

522
function psc(options) {
6-
var result = gulpPurescript.psc(options);
7-
return result();
23+
return promisify(gulpPurescript.psc(options));
824
}
925

10-
function pscMake(options) {
11-
var result = gulpPurescript.pscMake(options);
12-
return result();
26+
function pscBundle(options) {
27+
return promisify(gulpPurescript.pscBundle(options));
1328
}
1429

1530
function pscDocs(options) {
16-
var result = gulpPurescript.pscDocs(options);
17-
return result();
31+
return promisify(gulpPurescript.pscDocs(options));
1832
}
1933

2034
function dotPsci() {
@@ -24,7 +38,7 @@ function dotPsci() {
2438

2539
module.exports.psc = psc;
2640

27-
module.exports.pscMake = pscMake;
41+
module.exports.pscBundle = pscBundle;
2842

2943
module.exports.pscDocs = pscDocs;
3044

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "gulp-purescript",
33
"description": "Run the PureScript compiler",
4-
"version": "0.5.0-rc.1",
4+
"version": "0.5.0-rc.2",
55
"license": "MIT",
66
"repository": "purescript-contrib/gulp-purescript",
77
"author": {
@@ -35,6 +35,7 @@
3535
"logalot": "^2.1.0",
3636
"minimist": "^1.1.1",
3737
"multipipe": "^0.1.2",
38+
"promise": "^7.0.3",
3839
"resolve-bin": "^0.3.0",
3940
"through2": "^0.6.3",
4041
"which": "^1.0.9"

0 commit comments

Comments
 (0)