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

Commit 2e690d1

Browse files
committed
Update for options in psc 0.4.9
1 parent 39b0703 commit 2e690d1

File tree

3 files changed

+32
-32
lines changed

3 files changed

+32
-32
lines changed

README.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> Runs the [PureScript](https://github.com/purescript/purescript) compiler to produce JavaScript files.
44
55
## Getting started
6-
This plugin requires Grunt `~0.4.2` and [PureScript](http://hackage.haskell.org/package/purescript) `>=0.4.7`
6+
This plugin requires Grunt `~0.4.2` and [PureScript](http://hackage.haskell.org/package/purescript) `>=0.4.9`
77

88
If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
99

@@ -37,11 +37,17 @@ grunt.initConfig({
3737

3838
### Options
3939

40-
#### options.browserNamespace
41-
Type: `String`
42-
Default value: `PS`
40+
#### options.main
41+
Type: `Boolean` or `String`
42+
Default value: `false`
4343

44-
Invokes the `--browser-namespace` compiler flag with the specified argument. Specifies the namespace that PureScript modules will be exported to when running in the browser.
44+
Toggles the `--main` compiler flag. Can be set to `true` or the name of a module in which a `main` function resides. When enabled, a call to `main` will be added after all other generated JavaScript. When set to `true`, the module name will be assumed to be `Main`.
45+
46+
#### options.modules
47+
Type: `String` or `Array`
48+
Default value: none
49+
50+
Enables dead code elimination, ensuring that the named module (or list of modules) are included in the generated JavaScript, along with all their dependencies.
4551

4652
#### options.codegen
4753
Type: `String` or `Array`
@@ -55,48 +61,42 @@ Default value: none
5561

5662
Invokes the `--externs` compiler flag with the specified argument. Generates a `.e.ps` file for foreign imports.
5763

58-
#### options.magicDo
64+
#### options.browserNamespace
65+
Type: `String`
66+
Default value: `PS`
67+
68+
Invokes the `--browser-namespace` compiler flag with the specified argument. Specifies the namespace that PureScript modules will be exported to when running in the browser.
69+
70+
#### options.noPrelude
5971
Type: `Boolean`
6072
Default value: `false`
6173

62-
Toggles the `--magic-do` compiler flag. Overloads the `do` keyword to inline calls to `>>=` for the `Eff` monad to generate more efficient code when enabled.
74+
Toggles the `--no-prelude` compiler flag. Omits the Prelude from the generated JavaScript when enabled.
6375

6476
#### options.noOpts
6577
Type: `Boolean`
6678
Default value: `false`
6779

6880
Toggles the `--no-opts` compiler flag. Skips the optimization phase for the generated JavaScript when enabled.
6981

70-
#### options.noPrelude
82+
#### options.noMagicDo
7183
Type: `Boolean`
7284
Default value: `false`
7385

74-
Toggles the `--no-prelude` compiler flag. Omits the Prelude from the generated JavaScript when enabled.
86+
Toggles the `--no-magic-do` compiler flag. Disables overloading of the `do` keyword to inline calls to `>>=` for the `Eff` monad to generate more efficient code.
7587

76-
#### options.main
77-
Type: `Boolean` or `String`
88+
#### options.noTco
89+
Type: `Boolean`
7890
Default value: `false`
7991

80-
Toggles the `--main` compiler flag. Can be set to `true` or the name of a module in which a `main` function resides. When enabled, a call to `main` will be added after all other generated JavaScript. When set to `true`, the module name will be assumed to be `Main`.
81-
82-
#### options.modules
83-
Type: `String` or `Array`
84-
Default value: none
85-
86-
Enables dead code elimination, ensuring that the named module (or list of modules) are included in the generated JavaScript, along with all their dependencies.
92+
Toggles the `--no-tco` compiler flag. Disables tail-call elimination on the generated JavaScript.
8793

8894
#### options.runtimeTypeChecks
8995
Type: `Boolean`
9096
Default value: `false`
9197

9298
Toggles the `--runtime-type-checks` compiler flag. Generates simple runtime type checks for function arguments with simple types when enabled.
9399

94-
#### options.tco
95-
Type: `Boolean`
96-
Default value: `false`
97-
98-
Toggles the `--tco` compiler flag. Performs tail-call elimination on the generated JavaScript when enabled.
99-
100100
## The "purescript-make" task
101101

102102
### Overview
@@ -120,11 +120,11 @@ grunt.initConfig({
120120
### Options
121121

122122
- options.browserNamespace
123-
- options.magicDo
124-
- options.noOpts
125123
- options.noPrelude
124+
- options.noOpts
125+
- options.noMagicDo
126+
- options.noTco
126127
- options.runtimeTypeChecks
127-
- options.tco
128128

129129
These options have the same affect as described for the `purescript` task above.
130130

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "grunt-purescript",
33
"description": "Compile PureScript files.",
4-
"version": "0.3.1",
4+
"version": "0.4.0",
55
"homepage": "https://github.com/purescript/grunt-purescript",
66
"author": {
77
"name": "Gary Burgess",

tasks/purescript.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
module.exports = function (grunt) {
1212

1313
var flagOptions = {
14-
magicDo: "--magic-do",
15-
noOpts: "--no-opts",
1614
noPrelude: "--no-prelude",
17-
runtimeTypeChecks: "--runtime-type-checks",
18-
tco: "--tco"
15+
noOpts: "--no-opts",
16+
noMagicDo: "--no-magic-do",
17+
noTco: "--no-tco",
18+
runtimeTypeChecks: "--runtime-type-checks"
1919
};
2020

2121
var argumentOptions = {

0 commit comments

Comments
 (0)