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

Commit 9e123f6

Browse files
committed
Merge pull request #43 from purescript-contrib/0.7-updates-again
Updates for PureScript 0.7
2 parents aa1b0d0 + a62e8f6 commit 9e123f6

14 files changed

+440
-516
lines changed

MODULE.md

Lines changed: 93 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,47 @@ multipipe2 :: forall a b c. Stream a b -> Stream b c -> Stream a c
140140

141141

142142

143+
## Module GulpPurescript.OS
144+
145+
#### `OS`
146+
147+
``` purescript
148+
data OS :: !
149+
```
150+
151+
152+
#### `Platform`
153+
154+
``` purescript
155+
data Platform
156+
= Darwin
157+
| Linux
158+
| Win32
159+
```
160+
161+
162+
#### `showPlatform`
163+
164+
``` purescript
165+
instance showPlatform :: Show Platform
166+
```
167+
168+
169+
#### `isForeignPlatform`
170+
171+
``` purescript
172+
instance isForeignPlatform :: IsForeign Platform
173+
```
174+
175+
176+
#### `platform`
177+
178+
``` purescript
179+
platform :: forall eff. Eff (os :: OS | eff) (Maybe Platform)
180+
```
181+
182+
183+
143184
## Module GulpPurescript.Options
144185

145186
#### `isForeignEither`
@@ -156,10 +197,10 @@ instance isForeignPsc :: IsForeign Psc
156197
```
157198

158199

159-
#### `isForeignPscMake`
200+
#### `isForeignPscBundle`
160201

161202
``` purescript
162-
instance isForeignPscMake :: IsForeign PscMake
203+
instance isForeignPscBundle :: IsForeign PscBundle
163204
```
164205

165206

@@ -170,79 +211,101 @@ instance isForeignPscDocs :: IsForeign PscDocs
170211
```
171212

172213

214+
#### `isForeignDotPsci`
215+
216+
``` purescript
217+
instance isForeignDotPsci :: IsForeign DotPsci
218+
```
219+
220+
221+
#### `isForeignPathArray`
222+
223+
``` purescript
224+
instance isForeignPathArray :: IsForeign PathArray
225+
```
226+
227+
228+
#### `isForeignDocgen`
229+
230+
``` purescript
231+
instance isForeignDocgen :: IsForeign Docgen
232+
```
233+
234+
173235
#### `isForeignFormat`
174236

175237
``` purescript
176238
instance isForeignFormat :: IsForeign Format
177239
```
178240

179241

180-
#### `pscOptions`
242+
#### `commandLineOptionBoolean`
181243

182244
``` purescript
183-
pscOptions :: Foreign -> [String]
245+
instance commandLineOptionBoolean :: CommandLineOption Boolean
184246
```
185247

186248

187-
#### `pscOptionsNoOutput`
249+
#### `commandLineOptionString`
188250

189251
``` purescript
190-
pscOptionsNoOutput :: Foreign -> Tuple (Maybe String) [String]
252+
instance commandLineOptionString :: CommandLineOption String
191253
```
192254

193255

194-
#### `pscMakeOptions`
256+
#### `commandLineOptionEither`
195257

196258
``` purescript
197-
pscMakeOptions :: Foreign -> [String]
259+
instance commandLineOptionEither :: (CommandLineOption a, CommandLineOption b) => CommandLineOption (Either a b)
198260
```
199261

200262

201-
#### `pscDocsOptions`
263+
#### `commandLineOptionArray`
202264

203265
``` purescript
204-
pscDocsOptions :: Foreign -> [String]
266+
instance commandLineOptionArray :: (CommandLineOption a) => CommandLineOption [a]
205267
```
206268

207269

270+
#### `commandLineOptionPathArray`
208271

209-
## Module GulpPurescript.OS
272+
``` purescript
273+
instance commandLineOptionPathArray :: CommandLineOption PathArray
274+
```
210275

211-
#### `OS`
276+
277+
#### `commandLineOptionDocgen`
212278

213279
``` purescript
214-
data OS :: !
280+
instance commandLineOptionDocgen :: CommandLineOption Docgen
215281
```
216282

217283

218-
#### `Platform`
284+
#### `commandLineOptionFormat`
219285

220286
``` purescript
221-
data Platform
222-
= Darwin
223-
| Linux
224-
| Win32
287+
instance commandLineOptionFormat :: CommandLineOption Format
225288
```
226289

227290

228-
#### `showPlatform`
291+
#### `pscOptions`
229292

230293
``` purescript
231-
instance showPlatform :: Show Platform
294+
pscOptions :: Foreign -> Either ForeignError [String]
232295
```
233296

234297

235-
#### `isForeignPlatform`
298+
#### `pscBundleOptions`
236299

237300
``` purescript
238-
instance isForeignPlatform :: IsForeign Platform
301+
pscBundleOptions :: Foreign -> Either ForeignError [String]
239302
```
240303

241304

242-
#### `platform`
305+
#### `pscDocsOptions`
243306

244307
``` purescript
245-
platform :: forall eff. Eff (os :: OS | eff) (Maybe Platform)
308+
pscDocsOptions :: Foreign -> Either ForeignError [String]
246309
```
247310

248311

@@ -308,28 +371,28 @@ 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

329-
#### `dotPsci`
392+
#### `psci`
330393

331394
``` purescript
332-
dotPsci :: forall eff. Eff (Effects eff) (Stream File Unit)
395+
psci :: forall eff. Eff (Effects eff) (Stream File Unit)
333396
```
334397

335398

README.md

Lines changed: 38 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ var gulp = require('gulp');
2121

2222
var purescript = require('gulp-purescript');
2323

24-
gulp.task('purescript', function(){
25-
return gulp.src('src/**/*.purs').
26-
pipe(purescript.psc({noPrelude: true})).
27-
pipe(gulp.dest('build'));
24+
gulp.task('psc', function(){
25+
return purescript.psc({
26+
src: 'src/*.purs'
27+
});
2828
});
2929
```
3030

@@ -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+
Files to compile. Glob syntax is supported.
42+
43+
###### `ffi` (String or String Array)
44+
45+
Files for code that is included with a `foreign import` in the PureScript source. Glob syntax is supported.
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,77 +64,45 @@ 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.
75+
### `purescript.pscBundle(options)`
10676

107-
###### `noMagicDo` (Boolean)
77+
Invokes the `psc-bundle` command. The following options are supported.
10878

109-
Toggles `--no-magic-do` that disables optimizations overloading the do keyword generating efficient code for the `Eff` monad.
79+
###### `src` (String or String Array)
11080

111-
###### `noOpts` (Boolean)
81+
The `psc`-produced JavaScript source files to bundle. Glob syntax is supported.
11282

113-
Toggles `--no-opts` that skips the optimization phase.
114-
115-
###### `verboseErrors` (Boolean)
83+
###### `output` (String)
11684

117-
Toggles `--verbose-errors` that displays verbose error messages.
85+
Sets `--output=<string>` that specifies the output filename for the bundle.
11886

119-
###### `comments` (Boolean)
87+
###### `module` (String or String Array)
12088

121-
Toggles `--comments` that includes comments in generated code.
89+
The name of the module or modules to use as entry points for dead code elimination.
12290

123-
###### `output` (String)
91+
###### `main` (Boolean or String)
12492

125-
Sets `--output=<string>` the specifies the output directory, `output` by default.
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.
12694

127-
###### `noPrefix` (Boolean)
95+
###### `browserNamespace` (String)
12896

129-
Toggles `--no-prefix` that does not include the comment header.
97+
Sets `--browser-namespace=<string>` that specifies the namespace that PureScript modules will be exported to when running in the browser.
13098

131-
###### `ffi` (String Array)
99+
### `purescript.pscDocs(options)`
132100

133-
Sets one or more `--ffi=<string>` that specifies files for code that is included with a `foreign import` in the PureScript source.
101+
Invokes the `psc-docs` command. The following options are supported.
134102

135-
### `purescript.pscDocs(options)`
103+
###### `src` (String or String Array)
136104

137-
Invokes the `pscDocs` command. The following options are supported.
105+
Files to be used for generating the documentation. Glob syntax is supported.
138106

139107
###### `format` (markdown | etags | ctags)
140108

@@ -146,11 +114,19 @@ Sets `--docgen=...` that can be used to filter the modules documentation is gene
146114

147115
- If a string value is provided, the documentation for that single module will be generated.
148116
- If a list of strings is provided, the documentation for all listed modules will be generated.
149-
- If an object with module name/filename pairs (for example, `{ Module: "docs/Module.md" }`) is provided, files will be written for each of the modules. In this mode, the task requires no `dest` as no value is returned.
117+
- If an object with module name/filename pairs (for example, `{ Module: 'docs/Module.md' }`) is provided, files will be written for each of the modules. In this mode, the task requires no `dest` as no value is returned.
118+
119+
### `purescript.psci(options)`
120+
121+
Generates a `.psci` file.
122+
123+
###### `src` (String or String Array)
124+
125+
Files added to the `.psci` file with the `:m` command. Glob syntax is supported.
150126

151-
### `purescript.dotPsci()`
127+
###### `ffi` (String or String Array)
152128

153-
Generates a `.psci` file in the current directory. Each source file is added with the `:m` command.
129+
Files added to the `.psci` file with the `:f` command. Glob syntax is supported.
154130

155131
## Command line arguments
156132

0 commit comments

Comments
 (0)