This re-enable deploy-previews through Netlify. It will check if
changes where made to the ./docs folder and build + deploy the preview
if so. Otherwise, it will deploy a dummy preview.
This also removes the netlify script to deploy in production whenever
we push to master, as this is now handled by Travis.
* feat(ctrl-click): Enable Ctrl-Click on suggestions
This updates the underlying autocomplete.js to a version that passes
the selection context (click or keyboard) to the
`autocomplete:selected` event.
With the default `handleSelected, and in the case of a click, it will
do nothing (as each suggestion already being a `<a href>`, it will
already follow the link), but manually change the location for
keyboard navigation.
When a custom `handleSelected` is set though, default browser clicks
on suggestions are disabled and only `handleSelected` is called. This
is to keep backward compatibility with all the live websites that
might already use `handleSelected`.
* fix(test): Making sure it does not crash when no context is passed
Script was mentioning an update to shrinkwrap that we no longer use.
Also it was calling `yarn run doctoc` that had been remove in an old
commit, and re-added.
`printf` displays everything on the same line, and with the way yarn
itself outputs its error messages, it would override our custom
messages on the terminal, preventing us to know why things failed.
Using echo instead fixes the issue.
Other fixes are `shellcheck` warnings (`read` without `-r` will fail
on input containing `\`).
Running `yarn run release` causes issues as it can't communicate with
the proper npm registry. This happens because yarn overrides the
`npm_config_registry` variable, on which the publishing depends.
In this commit I revert the value to its default, allowing the release
script to be run either with `npm run release` or `yarn run release`.
* chore(stack update): update the whole docsearch stack
In an effort to reduce our stack diversity I am moving docsearch to:
- latest eslint
- prettier
- webpack 2
- babel 6 (babel 7 is soon to be released, we were on babel 5)
- babel-preset-env (support: IE >=9, Two latest version of evergreen
browsers).
- jest
* chore(contrib): remove develop branch, cc @redox
Running `npm run serve` will watch for changes in the source files and
rebuild all `css` and `js` files accordingly in the `dist` folder. It
will also expose the same files on `http://localhost:8080/` (by
default, if port `8080` is already taken it will move to an available
one).
This will let developers use a specific branch/version of docsearch in
their projects. Just open a new tab and run `npm run serve` in the
docsearch repo, and you'll be able to include the scripts from the
running server in your HTML.
As files are automatically regenerated on disk whenever a change is
detected, you can also `require` files by targeting the `dist` folder.