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

Updates for 0.7 #43

Merged
merged 5 commits into from
Jul 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 93 additions & 30 deletions MODULE.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,47 @@ multipipe2 :: forall a b c. Stream a b -> Stream b c -> Stream a c



## Module GulpPurescript.OS

#### `OS`

``` purescript
data OS :: !
```


#### `Platform`

``` purescript
data Platform
= Darwin
| Linux
| Win32
```


#### `showPlatform`

``` purescript
instance showPlatform :: Show Platform
```


#### `isForeignPlatform`

``` purescript
instance isForeignPlatform :: IsForeign Platform
```


#### `platform`

``` purescript
platform :: forall eff. Eff (os :: OS | eff) (Maybe Platform)
```



## Module GulpPurescript.Options

#### `isForeignEither`
Expand All @@ -156,10 +197,10 @@ instance isForeignPsc :: IsForeign Psc
```


#### `isForeignPscMake`
#### `isForeignPscBundle`

``` purescript
instance isForeignPscMake :: IsForeign PscMake
instance isForeignPscBundle :: IsForeign PscBundle
```


Expand All @@ -170,79 +211,101 @@ instance isForeignPscDocs :: IsForeign PscDocs
```


#### `isForeignDotPsci`

``` purescript
instance isForeignDotPsci :: IsForeign DotPsci
```


#### `isForeignPathArray`

``` purescript
instance isForeignPathArray :: IsForeign PathArray
```


#### `isForeignDocgen`

``` purescript
instance isForeignDocgen :: IsForeign Docgen
```


#### `isForeignFormat`

``` purescript
instance isForeignFormat :: IsForeign Format
```


#### `pscOptions`
#### `commandLineOptionBoolean`

``` purescript
pscOptions :: Foreign -> [String]
instance commandLineOptionBoolean :: CommandLineOption Boolean
```


#### `pscOptionsNoOutput`
#### `commandLineOptionString`

``` purescript
pscOptionsNoOutput :: Foreign -> Tuple (Maybe String) [String]
instance commandLineOptionString :: CommandLineOption String
```


#### `pscMakeOptions`
#### `commandLineOptionEither`

``` purescript
pscMakeOptions :: Foreign -> [String]
instance commandLineOptionEither :: (CommandLineOption a, CommandLineOption b) => CommandLineOption (Either a b)
```


#### `pscDocsOptions`
#### `commandLineOptionArray`

``` purescript
pscDocsOptions :: Foreign -> [String]
instance commandLineOptionArray :: (CommandLineOption a) => CommandLineOption [a]
```


#### `commandLineOptionPathArray`

## Module GulpPurescript.OS
``` purescript
instance commandLineOptionPathArray :: CommandLineOption PathArray
```

#### `OS`

#### `commandLineOptionDocgen`

``` purescript
data OS :: !
instance commandLineOptionDocgen :: CommandLineOption Docgen
```


#### `Platform`
#### `commandLineOptionFormat`

``` purescript
data Platform
= Darwin
| Linux
| Win32
instance commandLineOptionFormat :: CommandLineOption Format
```


#### `showPlatform`
#### `pscOptions`

``` purescript
instance showPlatform :: Show Platform
pscOptions :: Foreign -> Either ForeignError [String]
```


#### `isForeignPlatform`
#### `pscBundleOptions`

``` purescript
instance isForeignPlatform :: IsForeign Platform
pscBundleOptions :: Foreign -> Either ForeignError [String]
```


#### `platform`
#### `pscDocsOptions`

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


Expand Down Expand Up @@ -308,28 +371,28 @@ type Effects eff = (which :: Which, through2 :: Through2, resolveBin :: ResolveB
#### `psc`

``` purescript
psc :: forall eff. Foreign -> Eff (Effects eff) (Stream File File)
psc :: forall eff. Foreign -> (Error -> Eff (Effects eff) Unit) -> (Unit -> Eff (Effects eff) Unit) -> Eff (Effects eff) Unit
```


#### `pscMake`
#### `pscBundle`

``` purescript
pscMake :: forall eff. Foreign -> Eff (Effects eff) (Stream File Unit)
pscBundle :: forall eff. Foreign -> (Error -> Eff (Effects eff) Unit) -> (Unit -> Eff (Effects eff) Unit) -> Eff (Effects eff) Unit
```


#### `pscDocs`

``` purescript
pscDocs :: forall eff. Foreign -> Eff (Effects eff) (Stream File File)
pscDocs :: forall eff. Foreign -> (Error -> Eff (Effects eff) Unit) -> (File -> Eff (Effects eff) Unit) -> Eff (Effects eff) Unit
```


#### `dotPsci`
#### `psci`

``` purescript
dotPsci :: forall eff. Eff (Effects eff) (Stream File Unit)
psci :: forall eff. Eff (Effects eff) (Stream File Unit)
```


Expand Down
100 changes: 38 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ var gulp = require('gulp');

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

gulp.task('purescript', function(){
return gulp.src('src/**/*.purs').
pipe(purescript.psc({noPrelude: true})).
pipe(gulp.dest('build'));
gulp.task('psc', function(){
return purescript.psc({
src: 'src/*.purs'
});
});
```

Expand All @@ -36,9 +36,13 @@ Refer to the PureScript [compiler usage](https://github.com/purescript/purescrip

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

###### `noPrelude` (Boolean)
###### `src` (String or String Array)

Toggles `--no-prelude` that omits the Prelude.
Files to compile. Glob syntax is supported.

###### `ffi` (String or String Array)

Files for code that is included with a `foreign import` in the PureScript source. Glob syntax is supported.

###### `noTco` (Boolean)

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

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

###### `main` (Boolean or String)

Toggles `--main` or sets `--main=<string>` that generates code to run the `main` function in the specified module or the `Main` module by default.

###### `noOpts` (Boolean)

Toggles `--no-opts` that skips the optimization phase.
Expand All @@ -64,77 +64,45 @@ Toggles `--verbose-errors` that displays verbose error messages.

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

###### `browserNamespace` (String)

Sets `--browser-namespace=<string>` that specifies the namespace that PureScript modules will be exported to when running in the browser.

###### `externs` (String)

Sets `--externs=<string>` that specifies the externs file.

###### `module` (String Array)

Sets one or more `--module=<string>` that enables dead code elimination, removing all code without a transitive dependency of one of the specified modules.

###### `codegen` (String Array)

Sets one or more `--codegen=<string>` that generates code and externs for the specified modules.

###### `output` (String)

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

###### `noPrefix` (Boolean)

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

###### `ffi` (String Array)

Sets one or more `--ffi=<string>` that specifies the files for code that is included with a `foreign import` in the PureScript source.

### `purescript.pscMake(options)`

Invokes the `psc-make` command. The following options are supported.

###### `noPrelude` (Boolean)

Toggles `--no-prelude` that omits the Prelude.

###### `noTco` (Boolean)

Toggles `--no-tco` that disables tail-call optimizations.
### `purescript.pscBundle(options)`

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

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

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

Toggles `--no-opts` that skips the optimization phase.

###### `verboseErrors` (Boolean)
###### `output` (String)

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

###### `comments` (Boolean)
###### `module` (String or String Array)

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

###### `output` (String)
###### `main` (Boolean or String)

Sets `--output=<string>` the specifies the output directory, `output` by default.
Toggles `--main` or sets `--main=<string>` that generates code to run the `main` function in the specified module or the `Main` module by default.

###### `noPrefix` (Boolean)
###### `browserNamespace` (String)

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

###### `ffi` (String Array)
### `purescript.pscDocs(options)`

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

### `purescript.pscDocs(options)`
###### `src` (String or String Array)

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

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

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

- If a string value is provided, the documentation for that single module will be generated.
- If a list of strings is provided, the documentation for all listed modules will be generated.
- 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.
- 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.

### `purescript.psci(options)`

Generates a `.psci` file.

###### `src` (String or String Array)

Files added to the `.psci` file with the `:m` command. Glob syntax is supported.

### `purescript.dotPsci()`
###### `ffi` (String or String Array)

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

## Command line arguments

Expand Down
Loading