@@ -24,35 +24,35 @@ srcKey = "src"
24
24
25
25
noOptsOpt = " no-opts"
26
26
27
- noOptsKey = " noOpts "
27
+ noOptsKey = camelcase noOptsOpt
28
28
29
29
noMagicDoOpt = " no-magic-do"
30
30
31
- noMagicDoKey = " noMagicDo "
31
+ noMagicDoKey = camelcase noMagicDoOpt
32
32
33
33
noTcoOpt = " no-tco"
34
34
35
35
noTcoKey = " noTco"
36
36
37
37
verboseErrorsOpt = " verbose-errors"
38
38
39
- verboseErrorsKey = " verboseErrors "
39
+ verboseErrorsKey = camelcase verboseErrorsOpt
40
40
41
41
outputOpt = " output"
42
42
43
43
outputKey = outputOpt
44
44
45
45
browserNamespaceOpt = " browser-namespace"
46
46
47
- browserNamespaceKey = " browserNamespace "
47
+ browserNamespaceKey = camelcase browserNamespaceOpt
48
48
49
49
commentsOpt = " comments"
50
50
51
51
commentsKey = commentsOpt
52
52
53
53
noPrefixOpt = " no-prefix"
54
54
55
- noPrefixKey = " noPrefix "
55
+ noPrefixKey = camelcase noPrefixOpt
56
56
57
57
mainOpt = " main"
58
58
@@ -74,6 +74,10 @@ docgenOpt = "docgen"
74
74
75
75
docgenKey = docgenOpt
76
76
77
+ requirePathOpt = " require-path"
78
+
79
+ requirePathKey = camelcase requirePathOpt
80
+
77
81
newtype Psc
78
82
= Psc { src :: Either String [String ]
79
83
, ffi :: NullOrUndefined (Either String [String ])
@@ -84,6 +88,7 @@ newtype Psc
84
88
, verboseErrors :: NullOrUndefined Boolean
85
89
, comments :: NullOrUndefined Boolean
86
90
, noPrefix :: NullOrUndefined Boolean
91
+ , requirePath :: NullOrUndefined String
87
92
}
88
93
89
94
newtype PscBundle
@@ -126,6 +131,7 @@ instance isForeignPsc :: IsForeign Psc where
126
131
, verboseErrors: _
127
132
, comments: _
128
133
, noPrefix: _
134
+ , requirePath: _
129
135
} <$> readProp srcKey obj
130
136
<*> readProp ffiKey obj
131
137
<*> readProp outputKey obj
@@ -134,7 +140,8 @@ instance isForeignPsc :: IsForeign Psc where
134
140
<*> readProp noOptsKey obj
135
141
<*> readProp verboseErrorsKey obj
136
142
<*> readProp commentsKey obj
137
- <*> readProp noPrefixKey obj)
143
+ <*> readProp noPrefixKey obj
144
+ <*> readProp requirePathKey obj)
138
145
139
146
instance isForeignPscBundle :: IsForeign PscBundle where
140
147
read obj =
@@ -238,7 +245,8 @@ pscOptions opts = fold <$> parsed
238
245
opt noOptsOpt a.noOpts <>
239
246
opt verboseErrorsOpt a.verboseErrors <>
240
247
opt commentsOpt a.comments <>
241
- opt noPrefixOpt a.noPrefix
248
+ opt noPrefixOpt a.noPrefix <>
249
+ opt requirePathOpt a.requirePath
242
250
243
251
pscBundleOptions :: Foreign -> Either ForeignError [String ]
244
252
pscBundleOptions opts = fold <$> parsed
@@ -256,12 +264,12 @@ pscDocsOptions opts = fold <$> parsed
256
264
opt formatOpt a.format <>
257
265
opt docgenOpt a.docgen
258
266
259
- foreign import expandGlob
260
- " " "
261
- var expandGlob = (function () {
262
- var glob = require( " glob " );
263
- return function (pattern) {
264
- return glob.sync(pattern) ;
265
- };
266
- }());
267
- " " " :: String -> [ String ]
267
+ foreign import expandGlob " " "
268
+ function expandGlob() {
269
+ var glob = require( " glob " );
270
+ return function(pattern) {
271
+ return glob.sync (pattern);
272
+ } ;
273
+ } " " " :: String -> [ String ]
274
+
275
+ foreign import camelcase " function camelcase(a){return require('camelcase')(a);} " :: String -> String
0 commit comments