Skip to content

Commit b88e2e9

Browse files
yoshuawuytsgoto-bus-stop
authored andcommitted
document entry level opts (#401)
* document entry level opts * fix buffer docs * Add `hash` keys to callback doc * document opts.watch * words * remove unused assert option
1 parent 8d546e5 commit b88e2e9

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ var bankai = require('bankai/http')
224224
var http = require('http')
225225
var path = require('path')
226226

227-
var compiler = bankai(path.join(__dirname, 'example'))
227+
var compiler = bankai(path.join(__dirname, 'client.js'))
228228
var server = http.createServer(function (req, res) {
229229
compiler(req, res, function () {
230230
res.statusCode = 404
@@ -270,29 +270,34 @@ Whenever a change in the internal graph occurs.
270270

271271
## API
272272
### `compiler = bankai(entry, [opts])`
273-
Create a new bankai instance. Takes either an entry file location, or an array
274-
of files.
273+
Create a new bankai instance. Takes a path to a JavaScript file as the first
274+
argument. The following options are available:
275275

276-
### `compiler.documents(routename, [opts], done(err, buffer))`
276+
- __opts.quiet:__ Defaults to `false`. Don't output any data to `stdout`. Useful
277+
if you have your own logging system.
278+
- __opts.watch:__ Defaults to `true`. Watch for changes in the source files and
279+
rebuild. Set to `false` to get optimized bundles.
280+
281+
### `compiler.documents(routename, [opts], done(err, { buffer, hash }))`
277282
Output an HTML bundle for a route. Routes are determined based on the project's
278283
router. Pass `'/'` to get the default route.
279284

280285
- __opts.state:__ Will be passed the render function for the route, and inlined
281286
in the `<head>` of the body as `window.initialState`.
282287

283-
### `compiler.scripts(filename, done(err, buffer))`
288+
### `compiler.scripts(filename, done(err, { buffer, hash }))`
284289
Pass in a filename and output a JS bundle.
285290

286-
### `compiler.assets(assetName, done(err, buffer))`
291+
### `compiler.assets(assetName, done(err, { buffer, hash }))`
287292
Output any other file besides JS, CSS or HTML.
288293

289-
### `compiler.styles(name, done(err, buffer))`
294+
### `compiler.styles(name, done(err, { buffer, hash }))`
290295
Output a CSS bundle.
291296

292-
### `compiler.manifest(done(err, buffer))`
297+
### `compiler.manifest(done(err, { buffer, hash }))`
293298
Output a `manifest.json`.
294299

295-
### `compiler.serviceWorker(done(err, buffer))`
300+
### `compiler.serviceWorker(done(err, { buffer, hash }))`
296301
Output a service worker.
297302

298303
### `compiler.close()`

index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ function Bankai (entry, opts) {
102102
// Kick off the graph.
103103
this.graph.start({
104104
dirname: this.dirname,
105-
assert: opts.assert !== false,
106105
watch: opts.watch !== false,
107106
fullPaths: opts.fullPaths,
108107
reload: Boolean(opts.reload),

lib/cmd-build.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ module.exports = build
1717
function build (entry, outdir, opts) {
1818
var bankaiOpts = {
1919
logStream: pumpify(pinoColada(), process.stdout),
20-
assert: false,
2120
watch: false
2221
}
2322
var compiler = bankai(entry, bankaiOpts)

0 commit comments

Comments
 (0)