Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added --proxy path@url command line argument #157

Open
wants to merge 334 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
334 commits
Select commit Hold shift + click to select a range
a2253ce
allow default index to be overridden by API
mattdesl Apr 10, 2015
536fca9
keeping it dry
mattdesl Apr 10, 2015
8943d98
use default-index for now
mattdesl Apr 10, 2015
a681021
camel case is better since its API-only
mattdesl Apr 10, 2015
4337f33
Merge pull request #22 from mattdesl/feature/default-index
mattdesl Apr 10, 2015
59b386a
bump rc
mattdesl Apr 10, 2015
8671f2e
allowing stream to be disabled via CLI, updating docs and tests for s…
mattdesl Apr 11, 2015
91b3b8e
fix typo
mattdesl Apr 11, 2015
b37c841
no longer using ecstatic or caching for bundles
mattdesl Apr 11, 2015
d2a6342
fixing args for API and CLI
mattdesl Apr 11, 2015
5c76f0d
for faster UX, trigger reload on pending
mattdesl Apr 11, 2015
1001993
reload page on bundle pending instead of ready
mattdesl Apr 11, 2015
df700b5
using callback to get buffered contents
mattdesl Apr 11, 2015
fd383c2
fixing tests
mattdesl Apr 11, 2015
22f4312
Merge pull request #24 from mattdesl/feature/api-args
mattdesl Apr 11, 2015
b034e90
fixing live options if specified after construction
mattdesl Apr 11, 2015
b2f74f3
code commenting
mattdesl Apr 11, 2015
8f25d89
adding test for CLI and API args, and whitespace serving
mattdesl Apr 12, 2015
065eecd
clean up the way debug is handled
mattdesl Apr 12, 2015
59eda97
multiple entry docs
mattdesl Apr 12, 2015
8e15d8f
Merge branch 'master' of https://github.com/mattdesl/budo into featur…
mattdesl Apr 12, 2015
3b8c47e
Merge pull request #25 from mattdesl/feature/watchify-api
mattdesl Apr 12, 2015
f51b198
3.0.0
mattdesl Apr 12, 2015
3ad8fe7
document serve option
mattdesl Apr 12, 2015
8bd0bbc
3.0.1
mattdesl Apr 12, 2015
6ac76dd
the callback approach is not working with errorify atm, will have to …
mattdesl Apr 13, 2015
a5bda41
3.0.2
mattdesl Apr 13, 2015
98fc90e
fix broken livePlugin opt for API
mattdesl Apr 13, 2015
0bc0a55
ensuring debug arg is true if given, otherwise omitted
mattdesl Apr 13, 2015
a11e42c
3.0.3
mattdesl Apr 13, 2015
50bd727
updating help.txt, ensuring --delay and --poll are passed to watchify…
mattdesl Apr 13, 2015
bb0fba6
3.0.4
mattdesl Apr 13, 2015
beaaf2c
testing opnr with bud
mattdesl Apr 13, 2015
9357615
clearer wording
mattdesl Apr 13, 2015
990e304
updating docs
mattdesl Apr 15, 2015
b7a1cd8
test with new watchify, update docs
mattdesl Apr 15, 2015
b71933b
adding full stop with --
mattdesl Apr 18, 2015
67a7475
Merge branch 'fix-subarg' of https://github.com/mattdesl/budo
mattdesl Apr 18, 2015
146a4d0
3.1.0
mattdesl Apr 18, 2015
3a4bffe
encouraging -- for transforms since it works with subarg syntax
mattdesl Apr 20, 2015
8ffa902
3.1.1
mattdesl Apr 20, 2015
2604a0a
test for subarg
mattdesl Apr 20, 2015
102cb48
including watchify as a direct dependency to avoid global usage
mattdesl Apr 23, 2015
a9c1735
updating error handling to make it a bit cleaner UX
mattdesl Apr 23, 2015
94b4d6b
4.0 pre release
mattdesl Apr 23, 2015
8e1166d
cleaning up deps
mattdesl Apr 23, 2015
75720ec
adding more details to server running message (requires latest patch …
mattdesl Apr 13, 2015
c1861d8
docs; no longer need watchify
mattdesl Apr 24, 2015
27cf97f
4.0.0
mattdesl Apr 24, 2015
3136530
code cleanup
mattdesl Apr 24, 2015
ec3243d
http listen() does not pass an error
mattdesl Jun 8, 2015
2fd8f20
add note on mobile/internal ip dev
mattdesl Jun 8, 2015
0c0eadc
docs
mattdesl Jun 8, 2015
aefb241
change the way paths work so that relative and absolute can work with…
mattdesl Jun 23, 2015
c9b4a8b
fixing server path with absolute and relative paths
mattdesl Jun 23, 2015
e491123
Merge pull request #44 from mattdesl/fix/relative-entry
mattdesl Jun 23, 2015
2c24d27
wording
mattdesl Jun 23, 2015
e167018
4.1.0
mattdesl Jun 23, 2015
853d57b
updating readme
mattdesl Jun 25, 2015
ee91d4c
Always serve index page for --pushstate
scothis Aug 5, 2015
a16b86a
Merge pull request #53 from scothis/pushstate
mattdesl Aug 21, 2015
344b5b9
4.2.0
mattdesl Aug 21, 2015
39fdb4f
document push state option
mattdesl Aug 21, 2015
a6ba33b
4.2.1
mattdesl Aug 21, 2015
0cdd397
updating readme
mattdesl Aug 21, 2015
f69d889
fix typos in Programmatic Usage doc
cvan Sep 3, 2015
2d0742c
Merge pull request #55 from cvan/patch-1
mattdesl Sep 3, 2015
47fca30
big refactoring and fixes in progress
mattdesl Sep 5, 2015
8e90142
some more refactors
mattdesl Sep 5, 2015
566d1c0
getting it working with live reload again
mattdesl Sep 5, 2015
2b18803
docs: fix typo in example
yoshuawuyts Sep 6, 2015
335454b
more cleanup
mattdesl Sep 6, 2015
8d732ed
adding more changes and a change log
mattdesl Sep 6, 2015
71c6cd4
moar changes!1!
mattdesl Sep 6, 2015
1b65c06
babel uses ansi codes in their error message
mattdesl Sep 6, 2015
0ff3dd0
fixing some issues with live args
mattdesl Sep 6, 2015
dbe3dec
add test for custom server middleware
mattdesl Sep 6, 2015
513dc96
fixing tests
mattdesl Sep 6, 2015
25e0c55
fixing tests and live reload order
mattdesl Sep 7, 2015
92c07ba
Merge pull request #56 from yoshuawuyts/typo
mattdesl Sep 7, 2015
622e251
add a default route for favicon to avoid annoying 404 error
mattdesl Sep 7, 2015
92a10f4
add logs to middleware requests
mattdesl Sep 7, 2015
07e1a66
updating docs, examples
mattdesl Sep 7, 2015
5142173
updating deps
mattdesl Sep 7, 2015
66abd58
fixing code style, using standard, fixing dependencies in package json
mattdesl Sep 7, 2015
dd05091
doc changes and cleanup
mattdesl Sep 7, 2015
c91fe56
babelify for simple example and docs updates
mattdesl Sep 7, 2015
d19d3cd
5.0.0-beta
mattdesl Sep 7, 2015
0938e87
updating readme
mattdesl Sep 7, 2015
ee41c10
updating readme
mattdesl Sep 7, 2015
9e41787
remove problematic debugging code
mattdesl Sep 9, 2015
c4642ed
5.0.0-beta1
mattdesl Sep 9, 2015
0727998
documenting other modules, using new colors for error messages
mattdesl Sep 9, 2015
6372153
testing onupdate exec events
mattdesl Sep 9, 2015
1f3c9e7
bundle times above 1 second show as yellow with garnish
mattdesl Sep 10, 2015
dc21bfe
use hard red and white background
mattdesl Sep 10, 2015
a259374
5.0.0-beta2
mattdesl Sep 10, 2015
c3c6f2d
add test for defaultIndex
mattdesl Sep 12, 2015
29fad6d
document defaultIndex
mattdesl Sep 12, 2015
8a726d9
if middleware has an error, report it with status code 400
mattdesl Sep 12, 2015
0d6010c
5.0.0-beta3
mattdesl Sep 12, 2015
54813ad
no longer need to worry about conflicts because of full-stop in args
mattdesl Sep 13, 2015
be16a09
changing styling; removing live update logs since they clutter things…
mattdesl Sep 14, 2015
3c6596b
add error to tinylr
mattdesl Sep 18, 2015
27cb6ae
outdated dependencies updated
mattdesl Sep 18, 2015
a5915dd
remove vm dep
mattdesl Sep 19, 2015
f8b1966
add gotcha about body tag
mattdesl Sep 19, 2015
04bafec
listening for bundle errors now; experimental onerror flag
mattdesl Sep 19, 2015
10de3d6
remove experimental onerror feature; add docs on update feature
mattdesl Sep 19, 2015
8cb7127
Merge branch 'next' into feature/cli-onupdate
mattdesl Sep 19, 2015
11ec30f
remove unused file; fix parse args for onupdate
mattdesl Sep 19, 2015
fe63e53
fix syntax-highlight of CLI usage
wooorm Sep 19, 2015
fbf69e7
Merge pull request #62 from wooorm/bug/fix-gh-syntax-highlighting
mattdesl Sep 19, 2015
2c14d7a
fix livereload script for npm@3 and remove vm
mattdesl Sep 21, 2015
a4bb49e
4.2.2
mattdesl Sep 21, 2015
a9e8bff
Merge branch 'master' into next
mattdesl Sep 21, 2015
fdc58f1
5.0.0-beta4
mattdesl Sep 21, 2015
c9ffb26
update cli args
mattdesl Sep 21, 2015
573577d
fix bug in onupdate test not closing; use internal-ip by default when…
mattdesl Sep 24, 2015
747eb61
add open to start script
mattdesl Sep 24, 2015
436dad7
update changelog
mattdesl Sep 24, 2015
f809dd1
allow entry to be a dot for current folder; remove unused "to" param
mattdesl Sep 24, 2015
d871dd5
better docs; adding current dir resolving
mattdesl Sep 24, 2015
edf7199
updating readme
mattdesl Sep 24, 2015
32760a4
cleaning up old examples; updating docs
mattdesl Sep 25, 2015
897494c
clean up example, use es6
mattdesl Sep 25, 2015
0fb7495
5.0.0
mattdesl Sep 25, 2015
ce980b5
update docs
mattdesl Sep 25, 2015
7e020de
improve version display for better debugging and trouble shooting
mattdesl Sep 25, 2015
a8bffc9
5.1.0
mattdesl Sep 25, 2015
c3f2f25
more robust port finding; fix liveReload port finding issue and CLI arg
mattdesl Oct 2, 2015
1765cf4
adding test for more robust portfinding
mattdesl Oct 2, 2015
1e5ef3e
code style
mattdesl Oct 2, 2015
d738297
remove unused browserify dep
mattdesl Oct 2, 2015
b523d1d
no need for this option now that it is supported in tiny-lr
mattdesl Oct 2, 2015
4318281
5.1.1
mattdesl Oct 2, 2015
3638c0f
add CI
mattdesl Oct 9, 2015
53c6727
fix the way internal-ip address is resolved from host argument; allow…
mattdesl Oct 9, 2015
b6a47ca
5.1.2
mattdesl Oct 9, 2015
f402b42
adding badges! :tada:
mattdesl Oct 9, 2015
122cd68
5.1.3
mattdesl Oct 9, 2015
8b1e4fd
README typo
wbinnssmith Oct 10, 2015
e24a966
Merge pull request #89 from wbinnssmith/patch-1
mattdesl Oct 10, 2015
8db744d
use new module for multiple portfinding; more robust than the method …
mattdesl Oct 10, 2015
a129225
Merge branch 'master' of https://github.com/mattdesl/budo
mattdesl Oct 10, 2015
828969c
5.1.4
mattdesl Oct 10, 2015
e7564f4
use master for travis badge
mattdesl Oct 19, 2015
6166426
5.1.5
mattdesl Oct 19, 2015
5465e66
use next version of browserify
mattdesl Oct 29, 2015
34c24ee
add css, title and default garnish
mattdesl Oct 29, 2015
bc69f9f
6.0.0
mattdesl Oct 29, 2015
5e65b24
clean up package.json; doc new features
mattdesl Oct 29, 2015
92bd62d
tweaks to docs
mattdesl Oct 29, 2015
b9a9e3a
comment out failing test for now
mattdesl Oct 29, 2015
726d236
ensure error handler uses monospace fonts
mattdesl Nov 7, 2015
705b598
6.0.1
mattdesl Nov 7, 2015
23ece36
fix code style
mattdesl Nov 9, 2015
2e200d5
ensure that defaults match in CLI and API; also update tap-spec
mattdesl Nov 9, 2015
c2f966f
6.0.2
mattdesl Nov 9, 2015
7db0be8
fix entry mapping for windows and letter drive absolute paths
mattdesl Nov 10, 2015
fbcef49
6.0.3
mattdesl Nov 10, 2015
e02eb2f
update the test to support back slashes
mattdesl Nov 10, 2015
953afac
6.0.4
mattdesl Nov 10, 2015
ccdc017
one more test to map entry
mattdesl Nov 10, 2015
3b275e6
add a failing test; will have to investigate
mattdesl Nov 10, 2015
d7feb08
imrpoving garnish logs
mattdesl Nov 14, 2015
6073e30
hide URL in bundle
mattdesl Nov 16, 2015
906f5b2
add debug for how many files change (experiment); remove file-watch d…
mattdesl Nov 16, 2015
603080b
better docs
mattdesl Nov 24, 2015
48944f7
search each static folder for html index
mattdesl Nov 24, 2015
c1ec9ff
remove unused line
mattdesl Nov 24, 2015
70f1c15
6.1.0
mattdesl Nov 24, 2015
81c9e33
enable livereload on directories, not strictly files ending with `.ht…
cvan Sep 25, 2015
234d9f3
Merge pull request #73 from cvan/do-livereload-for-directory-indexes
mattdesl Dec 2, 2015
5de75fa
6.1.1
mattdesl Dec 2, 2015
d489911
Merge branch 'master' into feature/garnish
mattdesl Dec 2, 2015
bbeba86
fix live-reload for directory path which doesnt end in HTML
mattdesl Dec 2, 2015
2118ea5
hide static since its assumed
mattdesl Dec 2, 2015
3444473
update to latest garnish and update docs
mattdesl Dec 2, 2015
fb365b3
6.2.0
mattdesl Dec 2, 2015
460a8e4
remove unused log
mattdesl Dec 2, 2015
6a251ae
put tap spec back
mattdesl Dec 2, 2015
cf8f161
fix ndjson parsing with new garnish logs
mattdesl Dec 2, 2015
b70a5d4
clean up code and add docs to changelog and command line usage; fix t…
mattdesl Dec 2, 2015
d31ec81
7.0.0
mattdesl Dec 2, 2015
54c0228
experimental feature to force default index even when static dirs mig…
mattdesl Dec 2, 2015
f1de9f1
use default ports if empty/invalid (fixes #110)
cvan Dec 3, 2015
a3483dd
Merge pull request #111 from cvan/use-default-ports-if-empty
mattdesl Dec 3, 2015
c8c3055
7.0.1
mattdesl Dec 3, 2015
2d9ddb4
Revert "use default ports if empty/invalid (fixes #110)"
mattdesl Dec 4, 2015
7ad4013
7.0.2
mattdesl Dec 4, 2015
036f6b2
add docs on pushstate and gotcha with base tag
mattdesl Dec 14, 2015
c2ea5c3
Add failing test for double-logging issue
anandthakker Dec 17, 2015
b603c79
Reset bole logger at startup
anandthakker Dec 17, 2015
d7309fe
fix #115; logging file size of requests
mattdesl Dec 17, 2015
2f37703
Merge branch 'fix/log-size'
mattdesl Dec 17, 2015
768ee13
7.0.3
mattdesl Dec 17, 2015
92f0cf8
Move bole.reset() from startup to shutdown
anandthakker Dec 17, 2015
2b6d292
Merge pull request #117 from anandthakker/master
mattdesl Dec 17, 2015
7405986
7.0.4
mattdesl Dec 17, 2015
0456134
use wg instead of w to avoid ambiguity with watch() function
mattdesl Dec 21, 2015
b2c6c32
add watch glob option
mattdesl Dec 21, 2015
a490577
Merge branch 'master' of https://github.com/mattdesl/budo
mattdesl Dec 21, 2015
6c24307
7.1.0
mattdesl Dec 21, 2015
822ee03
fix typo in api docs
mattdesl Dec 21, 2015
1b10017
add docs on HMR
mattdesl Jan 6, 2016
4688a64
update docs
mattdesl Jan 6, 2016
f8b0768
refactor server code to use middleware stacking
mattdesl Jan 18, 2016
23da9e2
pushstate run example
mattdesl Jan 18, 2016
4cebf58
small code cleanup
mattdesl Jan 18, 2016
2d89197
document colon operator in main block of examples
mattdesl Jan 18, 2016
ddc52b2
small tweaks and new live test for address
mattdesl Jan 18, 2016
d543895
document new breaking change
mattdesl Jan 18, 2016
2053ccd
8.0.0
mattdesl Jan 18, 2016
32b2a6c
http://stackoverflow.com/a/1732454/565303
ashnur Jan 26, 2016
7478920
Merge pull request #130 from ashnur/master
mattdesl Jan 26, 2016
f15e46c
8.0.1
mattdesl Jan 26, 2016
6b9e2c5
ensure bundling starts after server connects
mattdesl Jan 26, 2016
7cc3cc5
use mapEntry for windows tests
mattdesl Jan 26, 2016
045e33c
fixing windows tests
Jan 26, 2016
e3b857a
8.0.2
mattdesl Jan 26, 2016
5f324d5
fix opts.live from CLI and also allow array to be passed
mattdesl Feb 1, 2016
3a613c8
8.0.3
mattdesl Feb 1, 2016
063a2e6
Bump watchify-middleware to 1.6 (w/ bundle method)
bendrucker Feb 5, 2016
ad9d59d
Merge pull request #136 from bendrucker/patch-1
mattdesl Feb 5, 2016
61a2f99
8.0.4
mattdesl Feb 5, 2016
eefa3fb
split out module inject-lr-script
mattdesl Feb 11, 2016
ef4352a
update node travis versions
mattdesl Feb 13, 2016
51d8c2e
--cors option added for Access-Control-Allow-Origin: *
veggiemonk Mar 4, 2016
2abbaea
remove console.log
veggiemonk Mar 4, 2016
748f351
remove extra semicolon
veggiemonk Mar 5, 2016
5d3cb5f
add test for CORS
veggiemonk Mar 5, 2016
db82695
cors tweaks
mattdesl Mar 7, 2016
b26bd9a
8.1.0
mattdesl Mar 7, 2016
0761529
support ssl/https mode
mattdesl Mar 7, 2016
3e84b4d
8.2.0
mattdesl Mar 7, 2016
9576d15
update changelog
mattdesl Mar 7, 2016
b3c02a8
add newline to end of 'help.txt'
rosszurowski Apr 11, 2016
cc5aa22
Merge pull request #149 from rosszurowski/master
yoshuawuyts Apr 11, 2016
44f2699
8.2.1
yoshuawuyts Apr 11, 2016
a7dd8b3
add test for push state; fix serve option shorthand
mattdesl Apr 26, 2016
ff80325
8.2.2
mattdesl Apr 26, 2016
4742988
fixed typo
fibo Apr 27, 2016
d63d74e
Merge pull request #152 from fibo/patch-1
yoshuawuyts Apr 29, 2016
38c1f15
bump to latest browserify
mattdesl May 30, 2016
c4aa944
8.3.0
mattdesl May 30, 2016
a4a08a3
added --proxy path@url command line argument (eg: --poryx /api@http:/…
talmobi Jun 1, 2016
285b705
removed semicolon
talmobi Jun 1, 2016
4509fc3
switched to using opts.proxy instead of argv.proxy, added --proxy tes…
talmobi Jun 2, 2016
57300f4
fixed double path bug in proxy, improved tests, longer timeout
talmobi Jun 2, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ node_modules
*.log
.DS_Store
bundle.js
bundle-expected.js
bundle-expected.js
.tmp
*.swp
*.swo
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ demo/
docs/
example/
.npmignore
.tmp
LICENSE.md
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: node_js
node_js:
- "0.8"
- "0.10"
- "0.12"
- "4.0"
- "4.1"
- "5.0"
before_install:
- npm install -g npm@~2.14.5
160 changes: 160 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# 8.2.0

Add support for SSL (HTTPS) with `--ssl`, `--cert` and `--key` options.

# 8.1.0

Add `--cors` flag to enable `Access-Control-Allow-Origin: *`

# 8.0.4

Bump required deps.

# 8.0.3

Fix `opts.live` as a string, allowing an array of options to be passed to filter file names.

# 8.0.2

Fix flow so that bundling events start after server connects, also updated upstream in watchify-middleware.

# 8.0.1

Fix parsing issue with LiveReload resp modifier.

# 8.0.0

The server code has been refactored to use connect/express-style middleware stacking. Fixes [#80](https://github.com/mattdesl/budo/issues/80), [#79](https://github.com/mattdesl/budo/issues/79), [#124](https://github.com/mattdesl/budo/issues/124), [#128](https://github.com/mattdesl/budo/issues/128).

##### Major Changes

Functions for `opts.middleware` now assumes the following signature, and will not behave differently based on the number of arguments you specify:

- `middleware(req, res, next)`

##### Minor Changes

The `middleware` options can now be an array of functions, or a single function.

# 7.1.0

Added `--watch-glob` option which allows you to override the default watch glob without having to go through the `live()` / `watch()` API

# 7.0.4

Small patch [#117](https://github.com/mattdesl/budo/pull/117) to fix a failing test in 7.0.3.

# 7.0.3

- Bole no longer double-logs on shut-down and re-start.
- Fixed issue with request sizes being logged incorrectly in terminal

# 7.0.1 .. 7.0.2

Small patches for [#110](https://github.com/mattdesl/budo/pull/110) and [#111](https://github.com/mattdesl/budo/pull/111).

# 7.0.0

Fixes previous patch and also updates to garnish redesign, leading to new log styles.

Since various ndjson flags have changed, this is a potentially breaking change.

Also added a `--verbose` / `-v` option like watchify, which adds some additional debug messages.

# 6.1.1

Fixes live reload for directory routes like `localhost:9966/mydir`.

# 6.1.0

Search for `index.html` across all static `--dir` folders, finding the first one.

# 6.0.0

##### Major Changes

- `garnish` is now included by default in CLI and API
- you can use `--ndjson` and `ndjson: true` to have raw output (for custom pretty-printers)

##### Minor Changes

- added `--title` option for the default HTML title
- added `--css` option for a default style sheet

# 5.0.0

##### Major Changes

- you can just type `budo . | garnish` for the entry point (or `index.js`)
- added `--onupdate` for things like linting, see [the docs](docs/command-line-usage.md#--onupdate)
- if no `--host` is specified, resolves to internal IP
- you can still hit `localhost:9966` and it will work
- the `<script>` src defaults to the *filename* of the first entry
- eg: `budo src/index.js` leads to `<script src="index.js">`
- browserify options must come after a full stop `--`
- except `--no-debug` which is passed as a budo option
- eg: `budo index.js --no-debug -- -t babelify`
- `--dir` can be passed multiple times to use multiple static folders
- `budo index.js --dir public --dir tmp`
- removed `--live-plugin` option to reduce code complexity
- might be added back into CLI later
- API still supports `budo.live({ plugin: true })`
- portfinding is enabled by default in API and CLI
- user can disbale with `--no-portfind` or `portfind: false`
- removed `--verbose`, `-v`, timing is logged by default now
- entry files are now optional (i.e. if you just need a static HTML with LiveReload)
- added `--open`, `-o` to launch browser on connect
- syntax errors in code are shown in the DOM body now
- can disable with `--no-error-handler`
- in API can use `errorHandler: Boolean|Function`
- added `--version` to CLI
- `--live` can optionally be a string to only LiveReload on those globs, eg:
- `budo index.js --live=*.{css,html}`
- removed `--ignore-watch` and `--interval`
- use `budo.watch(glob, chokidarOpts)` instead
- shorthand for most CLI options now exists
- arg parsing has improved and uses camel-case in API
- most args are now supported before entries, eg:
- `budo --live src/index.js`
- cleaner error messaging in terminal

##### API Changes

- `dir` can be a string or array of static paths
- the `'connect'` event now passes `livePort`
- the `'connect'` event `ev.host` now uses internal IP by default
- exposed a CLI feature
- `require('budo').cli(process.argv.slice(2), { overrides... })`
- `errorHandler` can be used for custom bundle error handling
- `middleware` can be a `fn(req, res, next)` function for custom routes
- `'update'` event now passes `(contents, updates)`

##### Browserify Args

Users creating CLI tools on top of budo can use `opt.browserifyArgs` to handle subarg correctly. Example with minimist:

```js
var args = process.argv.slice(2)
var opts = require('minimist')(args, { '--': true })
budo.cli(args, {
browserifyArgs: opts['--']
})
```

If no `browserifyArgs` is specified, then `opt.browserify` can be used to send the actual JS object to the browserify constructor.

```js
budo.cli(args, {
browserify: {
transform: require('babelify')
}
})
```

# 4.2.0

- Added `--pushstate` option [#53](https://github.com/mattdesl/budo/pull/53)

# 4.1.0

- Fixed a bug with `budo ./foo.js`
157 changes: 121 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,161 @@
# budō

[![unstable](http://badges.github.io/stability-badges/dist/unstable.svg)](http://github.com/badges/stability-badges)
[![build status][travis-image]][travis-url]
[![stability][stability-image]][stability-url]
[![NPM version][npm-image]][npm-url]
[![Downloads][downloads-image]][downloads-url]
[![js-standard-style][standard-image]][standard-url]

This is a browserify development server inspired by [beefy](https://github.com/chrisdickinson/beefy) and [wzrd](https://github.com/maxogden/wzrd), but with a stronger focus on incremental bundling, LiveReload (including CSS injection), and other [experimental features](#script-injection) down the road.
This is a browserify development server inspired by [beefy](https://github.com/chrisdickinson/beefy) and [wzrd](https://github.com/maxogden/wzrd), but specifically focused on incremental reloading, LiveReload integration (including CSS injection), and other high-level features.

Note that budo needs a copy of `watchify` installed. It can be either local (preferred) or global.
To install:

```sh
npm install budo watchify -g
npm install budo -g
```

The simplest use cases will start up a server with a default `index.html` and incrementally bundle your source on filesave. Examples:
Running budo will start a server with a default `index.html` and incrementally bundle your source on filesave. The requests are delayed until the bundle has finished, so you won't be served stale or empty bundles if you refresh the page mid-update. Examples:

```sh
#run watchify on port 9966
budo index.js
# serve file on port 9966 and open browser
budo index.js --open

#run watchify with explicit output file
budo index.js --outfile bundle.js --verbose
# enable LiveReload on HTML/CSS/JS file changes
budo index.js --live

#run watchify with some options and trigger LiveReload on change
budo index.js --live --transform brfs
# default html will use src="static/bundle.js"
budo src/index.js:static/bundle.js

# pass some options to browserify
budo index.js --live -- -t babelify

# use HTTPS and enable CORS headers
budo index.js --ssl --cors --cert=cert.pem --key=key.pem
```

You can open `localhost:9966` to see the content in action.
Then open [http://localhost:9966/](http://localhost:9966/) to see the content in action.

To pretty-print in terminal, [garnish](https://github.com/mattdesl/garnish), [bistre](https://github.com/hughsk/bistre) or another [ndjson](ndjson.org)-based stream can be used.
By default, budo pretty-prints to terminal with [garnish](https://github.com/mattdesl/garnish).

```sh
budo index.js -o bundle.js | garnish
```

See [docs](#docs) for more features.
<center><img src="http://i.imgur.com/Pvus8vy.png" width="75%" /></center>

See [docs](#docs) for more details and integrations, such as [React Hot Module Replacement](./docs/command-line-usage.md#hot-module-replacement). PRs/suggestions/comments welcome.

## features

At a glance:

- stubs a default `index.html`
- fast incremental bundling, suspending the response until the new source is ready
- watches HTML and CSS files for changes; CSS is injected without reloading the page
- can emit [ndjson](http://ndjson.org) logs to use another pretty-printer, like [bistre](https://github.com/hughsk/bistre).
- provides clear error messaging during development in DOM and console

Below is an example of how syntax errors look during development, using the [babelify](https://github.com/babel/babelify) transform.

PRs/suggestions/comments welcome. Props to [@caspervonb](https://twitter.com/caspervonb) for the early groundwork.
![babelify](http://i.imgur.com/ZlfJL1i.png)

## about
## docs

- [basic usage](docs/basics.md)
- [comparisons](docs/comparisons.md)
- [command line usage](docs/command-line-usage.md)
- [API usage](docs/api-usage.md)
- [running tests and examples](docs/tests-and-examples.md)
- [script injection with budo-chrome](https://github.com/mattdesl/budo-chrome)
- [rapid prototyping with budō](http://mattdesl.svbtle.com/rapid-prototyping)
- [experimental script injection with budo-chrome](https://github.com/mattdesl/budo-chrome)

## usage

[![NPM](https://nodei.co/npm/budo.png)](https://www.npmjs.com/package/budo)

Details for `budo` command-line interface. Other options like `--verbose` and `--transform` are sent to browserify/watchify.
### CLI

```sh
Details for `budo` command-line interface.

```txt
Usage:
budo [entries] [opts]
budo index.js [opts] -- [browserify opts]

Options:
--outfile, -o path to output bundle
--port the port to run, default 9966
--host the host, default "localhost"
--dir the directory to serve, and the base for --outfile
--live enable LiveReload integration
--live-plugin enable LiveReload but do not inject script tag
--live-port the LiveReload port, default 35729
--help, -h show help message
--version show version
--port, -p the port to run, default 9966
--host, -H the host, default internal IP (localhost)
--dir, -d a path, or array of paths for base static content
--serve, -s override the bundle path being served
--live, -l enable default LiveReload integration
--live-port, -L the LiveReload port, default 35729
--open, -o launch the browser once connected
--pushstate, -P always render the index page instead of a 404 page
--onupdate a shell command to trigger on bundle update
--poll=N use polling for file watch, with optional interval N
--title optional title for default index.html
--css optional stylesheet href for default index.html
--ssl, -S create an HTTPS server instead of HTTP
--cert, -C the cert for SSL (default cert.pem)
--key, -K the key for SSL (default key.pem)
--cors set header to use CORS (Access-Control-Allow-Origin: *)
--ndjson print ndjson instead of pretty-printed logs
--verbose, -v also include debug messages
--no-stream do not print messages to stdout
--no-debug do not use inline source maps
--no-portfind will not attempt auto-portfinding
--no-error-handler disable default DOM error handling
--watch-glob, --wg glob(s) to watch for reloads, default '**/*.{html,css}'
--proxy path@url proxy requests on given path to url (eg: --proxy /api@http://localhost:3000/api)
```

By default, messages will be printed to `process.stdout`, and `--debug` will be sent to browserify (for source maps). You can turn these off with `--no-stream` and `--no-debug`, respectively.

Everything after `--` is passed directly to browserify. Example:

```js
budo index.js --live -- -t [ babelify --extensions .es6 ]
```

## Script Injection
### API

The API mirrors the CLI except it does not write to `process.stdout` by default.

```js
var budo = require('budo')
var babelify = require('babelify')

budo('./src/index.js', {
live: true, // setup live reload
port: 8000, // use this port
browserify: {
transform: babelify // ES6
}
}).on('connect', function (ev) {
console.log('Server running on %s', ev.uri)
console.log('LiveReload running on port %s', ev.livePort)
}).on('update', function (buffer) {
console.log('bundle - %d bytes', buffer.length)
})
```

[![screenshot](http://i.imgur.com/LJP7d9I.png)](https://www.youtube.com/watch?v=cfgeN3G_Gl0)
See [API usage](docs/api-usage.md) for details.

The original motivation for making budō was to build a simple tool around Chrome Script Injection. This has since split off into its own repository: [budo-chrome](https://github.com/mattdesl/budo-chrome) to maintain a small scope for budō.
## See Also

<sup>[(click for demo)](https://www.youtube.com/watch?v=cfgeN3G_Gl0)</sup>
budō combines several smaller and less opinionated modules.

- [watchify-middleware](https://www.npmjs.com/package/watchify-middleware) - the underlying request handler for serving incremental reloads
- [watchify-server](https://www.npmjs.com/package/watchify-server) - a less opinionated alternative to budo, built on the same underlying modules
- [simple-html-index](https://www.npmjs.com/package/simple-html-index) - a stream for a default `index.html` file

## License

MIT, see [LICENSE.md](http://github.com/mattdesl/budo/blob/master/LICENSE.md) for details.

[stability-image]: https://img.shields.io/badge/stability-stable-brightgreen.svg?style=flat-square
[stability-url]: https://nodejs.org/api/documentation.html#documentation_stability_index
[npm-image]: https://img.shields.io/npm/v/budo.svg?style=flat-square
[npm-url]: https://npmjs.org/package/budo
[travis-image]: https://img.shields.io/travis/mattdesl/budo/master.svg?style=flat-square
[travis-url]: http://travis-ci.org/mattdesl/budo
[downloads-image]: http://img.shields.io/npm/dm/budo.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/budo
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: https://github.com/feross/standard