1
0
Fork 0

chore: more files to root

This commit is contained in:
François Chalifour 2020-09-01 11:54:48 +02:00
commit fc08ef3e12
39 changed files with 22996 additions and 0 deletions

130
.circleci/config.yml Normal file
View file

@ -0,0 +1,130 @@
aliases:
- &install_yarn_version
name: Install specific Yarn version
command: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.21.1
echo 'export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"' >> $BASH_ENV
- &restore_yarn_cache
name: Restore Yarn cache
keys:
- yarn-{{ .Branch }}-packages-{{ checksum "yarn.lock" }}
- &save_yarn_cache
name: Save Yarn cache
key: yarn-{{ .Branch }}-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- &run_yarn_install
name: Install dependencies
command: yarn install
defaults: &defaults
working_directory: ~/autocompletejs
docker:
- image: circleci/node:12.14.1
cypress: &cypress
working_directory: ~/autocompletejs
docker:
- image: cypress/browsers:node13.8.0-chrome81-ff75
environment:
## this enables colors in the output
TERM: xterm
version: 2.1
jobs:
test_build:
<<: *defaults
steps:
- checkout
- run: *install_yarn_version
- restore_cache: *restore_yarn_cache
- run: *run_yarn_install
- save_cache: *save_yarn_cache
- run:
name: Build & Test packages size
command: |
yarn run build
yarn run test:size
test_lint:
<<: *defaults
steps:
- checkout
- run: *install_yarn_version
- restore_cache: *restore_yarn_cache
- run: *run_yarn_install
- save_cache: *save_yarn_cache
- run:
name: Lint & Code styles
command: yarn run lint
- run:
name: Type Checking
command: yarn run type-check
test_unit:
<<: *defaults
steps:
- checkout
- run: *install_yarn_version
- restore_cache: *restore_yarn_cache
- run: *run_yarn_install
- save_cache: *save_yarn_cache
- run:
name: Unit tests
command: yarn run test --maxWorkers=4
release:
<<: *defaults
steps:
- checkout
- run: *install_yarn_version
- restore_cache: *restore_yarn_cache
- run: *run_yarn_install
- save_cache: *save_yarn_cache
- run:
name: Release if needed
command: yarn run shipjs trigger
test_cypress:
<<: *cypress
steps:
- checkout
- run: *install_yarn_version
- restore_cache: *restore_yarn_cache
- run: *run_yarn_install
- save_cache: *save_yarn_cache
- run:
name: Cypress test Actions
command: yarn run cy:run
- store_test_results:
path: cypress-results
- store_artifacts:
path: cypress\screenshots
- store_artifacts:
path: cypress\videos
workflows:
version: 2.1
ci:
jobs:
- test_build:
filters:
branches:
only: next
- test_unit:
filters:
branches:
only: next
- test_lint:
filters:
branches:
only: next
- test_cypress
- release:
filters:
branches:
only: next

8
.editorconfig Normal file
View file

@ -0,0 +1,8 @@
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

3
.env.sample Normal file
View file

@ -0,0 +1,3 @@
GITHUB_TOKEN=
CYPRESS_RECORD_KEY=
PERCY_TOKEN=

6
.eslintignore Normal file
View file

@ -0,0 +1,6 @@
node_modules
dist
/examples
build
.docusaurus
.cache

78
.eslintrc.js Normal file
View file

@ -0,0 +1,78 @@
module.exports = {
extends: ['algolia', 'algolia/jest', 'algolia/react', 'algolia/typescript'],
globals: {
__DEV__: false,
__VERSION__: false,
},
settings: {
react: {
pragma: 'React',
version: 'detect',
},
'import/resolver': {
node: {
extensions: ['.js', '.ts', '.tsx'],
},
},
},
rules: {
'no-param-reassign': 0,
'valid-jsdoc': 0,
'no-shadow': 0,
'prefer-template': 0,
'jest/no-disabled-tests': 0,
'react/prop-types': 0,
'react/no-unescaped-entities': 0,
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
'import/extensions': 0,
'@typescript-eslint/camelcase': ['error', { allow: ['__autocomplete_id'] }],
// Useful to call functions like `nodeItem?.scrollIntoView()`.
'no-unused-expressions': 0,
complexity: 0,
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
'newlines-between': 'always',
groups: ['builtin', 'external', 'parent', 'sibling', 'index'],
pathGroups: [
{
pattern: '@/**/*',
group: 'parent',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
},
],
},
overrides: [
{
files: ['**/rollup.config.js', 'stories/**/*', '**/__tests__/**'],
rules: {
'import/no-extraneous-dependencies': 'off',
},
},
{
files: ['cypress/**/*'],
plugins: ['cypress'],
env: {
'cypress/globals': true,
},
rules: {
'jest/expect-expect': 'off',
'spaced-comment': 'off',
'@typescript-eslint/triple-slash-reference': 'off',
},
},
{
files: ['scripts/**/*'],
rules: {
'import/no-commonjs': 'off',
},
},
],
};

14
.github/ISSUE_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,14 @@
<!--
Thanks for participating in this project!
Please:
- make sure you are using the latest version of the library.
- do at least one GitHub search in current issues, maybe your question is already here
-->
**Do you want to request a _feature_ or report a _bug_?**
**What is the current behavior?**
**If the current behavior is a bug, please provide all the steps to reproduce and a minimal [JSFiddle](https://jsfiddle.net/) example or a repository on GitHub that we can `npm install` and `npm start`.**
**What is the expected behavior?**

20
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,20 @@
<!--
Thanks for submitting a pull request!
Please provide enough information so that others can review your pull request.
-->
**Summary**
<!--
Explain the **motivation** for making this change.
What existing problem does the pull request solve?
Are there any linked issues?
-->
**Result**
<!--
Demonstrate the code is solid.
Example: The exact commands you ran and their output,
screenshots / videos if the pull request changes UI.
-->

23
.gitignore vendored Normal file
View file

@ -0,0 +1,23 @@
# Generated files
node_modules/
.DS_Store
.eslintcache
*.log
coverage/
.cache
# Bundle build files
dist/
# Deployment build files
/website/stories
# IDE
.vscode/
# Environment files
.env
# Cypress Video and Screenshots output
cypress/screenshots/
cypress/videos/

1
.nvmrc Normal file
View file

@ -0,0 +1 @@
12.14.1

7
.percy.json Normal file
View file

@ -0,0 +1,7 @@
{
"version": 1,
"snapshot": {
"widths": [375, 768, 1366],
"min-height": 1024
}
}

5
.prettierignore Normal file
View file

@ -0,0 +1,5 @@
node_modules
dist
build
.docusaurus
.cache

6
.prettierrc Normal file
View file

@ -0,0 +1,6 @@
{
"proseWrap": "never",
"singleQuote": true,
"trailingComma": "es5",
"endOfLine":"auto"
}

36
.stylelintrc.json Normal file
View file

@ -0,0 +1,36 @@
{
"plugins": [
"stylelint-prettier",
"stylelint-no-unsupported-browser-features"
],
"extends": [
"stylelint-config-standard",
"stylelint-config-sass-guidelines",
"stylelint-order",
"stylelint-a11y/recommended",
"stylelint-prettier/recommended"
],
"rules": {
"selector-class-pattern": [
"^DocSearch-[A-Za-z0-9-]*$"
],
"prettier/prettier": true,
"max-nesting-depth": [
2,
{
"ignore": [
"pseudo-classes"
],
"ignoreAtRules": [
"media"
]
}
],
"plugin/no-unsupported-browser-features": [
null,
{
"severity": "warning"
}
]
}
}

630
CHANGELOG.md Normal file
View file

@ -0,0 +1,630 @@
# [1.0.0-alpha.28](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.27...v1.0.0-alpha.28) (2020-08-26)
### Bug Fixes
- **core:** add type `search` to `getInputProps` ([92d95cc](https://github.com/francoischalifour/autocomplete.js/commit/92d95ccbd6683a1d8cd3ce53786f7fffc192cd00))
- **core:** add type to `GetDropdownProps` ([6bd21fc](https://github.com/francoischalifour/autocomplete.js/commit/6bd21fc67451058f32460b1afaf65ae3a73ce71c)), closes [#70](https://github.com/francoischalifour/autocomplete.js/issues/70)
- **core:** allow calling `getDropdownProps` without argument ([c44e494](https://github.com/francoischalifour/autocomplete.js/commit/c44e49439684e8577e3341a84381acf8dba463aa))
- **core:** prevent `mousedown` event on dropdown to keep it open ([ec9733b](https://github.com/francoischalifour/autocomplete.js/commit/ec9733bfcce0be0e94a8f4d402d1bae9c3090549))
- **core:** rename `showCompletion` to `enableCompletion` ([07b46af](https://github.com/francoischalifour/autocomplete.js/commit/07b46afb6c382a3f8be5bb711b477b4cbc0c1382))
- **core:** type form props ([1c2551b](https://github.com/francoischalifour/autocomplete.js/commit/1c2551b838933c095543c7abd807c0de1ac5aeb1))
- **docsearch:** add type to `GetDropdownProps` ([50b4879](https://github.com/francoischalifour/autocomplete.js/commit/50b487969c0a1b355499b7526315eb9e4967c47a))
- **docsearch:** allow a single instance to open ([90bfaaa](https://github.com/francoischalifour/autocomplete.js/commit/90bfaaa81740be5dac4abac23c9180718527b55e))
- **docsearch:** capture `mousedown` event to close modal ([b802621](https://github.com/francoischalifour/autocomplete.js/commit/b802621c1e999d11296f1d1b711e454f980fb314)), closes [/github.com/facebook/react-native-website/pull/2139#issuecomment-678330203](https://github.com//github.com/facebook/react-native-website/pull/2139/issues/issuecomment-678330203)
- **docsearch:** remove `data-cy` attributes ([6bedbb7](https://github.com/francoischalifour/autocomplete.js/commit/6bedbb7d0fd4a086a5af974eb814e0ffaa355d1f))
- **docsearch:** remove Docusaurus style ([a52cc44](https://github.com/francoischalifour/autocomplete.js/commit/a52cc448843cba0e4a04f8cb0e180c316870abb4))
- **docsearch:** use `"false"` value for `spellCheck` in vanilla version ([d22bea7](https://github.com/francoischalifour/autocomplete.js/commit/d22bea77d7e098b6e849bd57302244c0fe15dc0a))
- **js:** return setters and `refresh` only ([758565e](https://github.com/francoischalifour/autocomplete.js/commit/758565e71f73415e9b0d9f0f454e8c1d43a43f51))
- **js:** revert highlighting conditions ([8fb33b1](https://github.com/francoischalifour/autocomplete.js/commit/8fb33b1e07eb5e18461c2290cbafaea61fc5c65f))
- **js:** update types ([607ea45](https://github.com/francoischalifour/autocomplete.js/commit/607ea4547067ca994ed8e3b5e855cb3a6f85b81c))
- **types:** allow arbitrary keys in sources ([6ed9e4a](https://github.com/francoischalifour/autocomplete.js/commit/6ed9e4ae14c6e8534f8904676b1c6d5c2755e759))
### Features
- **autocomplete:** introduce JavaScript API ([fd9d2b7](https://github.com/francoischalifour/autocomplete.js/commit/fd9d2b7d62ad5ad4ad8d641eb5bda12d02cc7931))
- **core:** add default form props ([2264f2b](https://github.com/francoischalifour/autocomplete.js/commit/2264f2bbd6b470d758a98ae445fb7efa945d34fa))
- **docsearch:** add `enterkeyhint` to `go` ([d652514](https://github.com/francoischalifour/autocomplete.js/commit/d652514bc35c16f4d406a7b89ac7b479ed316c54))
- **js:** pass state to `render` ([7f7da3d](https://github.com/francoischalifour/autocomplete.js/commit/7f7da3db27ab34c841692d034c2135d3c4e0a7a8))
# [1.0.0-alpha.27](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.26...vv1.0.0-alpha.27) (2020-08-07)
### Bug Fixes
- **docsearch:** fix vanilla DocSearch types ([2b5e7aa](https://github.com/francoischalifour/autocomplete.js/commit/2b5e7aad3cc02c4021970bc1971a719843416474))
### Features
- **docsearch:** export DocSearch types ([b499fee](https://github.com/francoischalifour/autocomplete.js/commit/b499fee3e88a496b89c62f327f25e114c8e8f486))
- **docsearch:** update missing results issue link ([fb8d735](https://github.com/francoischalifour/autocomplete.js/commit/fb8d735354d5b06752abd1008f14cef8bd986b42))
# [1.0.0-alpha.26](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.25...v1.0.0-alpha.26) (2020-08-04)
### Bug Fixes
- **docsearch:** don't open modal on `/` when editing text ([6118725](https://github.com/francoischalifour/autocomplete.js/commit/6118725dda6a3c0fc92ec478923c6b3187a43ad7))
# [1.0.0-alpha.25](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.24...v1.0.0-alpha.25) (2020-07-30)
### Bug Fixes
- **docsearch:** pass `autoFocus` prop to autocomplete for mobiles ([8f4d3fb](https://github.com/francoischalifour/autocomplete.js/commit/8f4d3fb8d9926e74d44da2b7b1eb388e5283b0db))
### Features
- **docsearch:** add `aria-label` to search button ([5bc08ca](https://github.com/francoischalifour/autocomplete.js/commit/5bc08cabc87c876fb26bf7608509cfcd000fac89))
# [1.0.0-alpha.24](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.23...v1.0.0-alpha.24) (2020-07-23)
### Bug Fixes
- **docsearch:** don't blur input on submit ([86da0fc](https://github.com/francoischalifour/autocomplete.js/commit/86da0fc3c66f8bb0757ce7b3a760ea752184de82))
- **docsearch:** focus input on Selection Search ([9f1fa52](https://github.com/francoischalifour/autocomplete.js/commit/9f1fa52c68b765a36060aef8ce25728cda37affa))
# [1.0.0-alpha.23](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.22...v1.0.0-alpha.23) (2020-07-22)
### Bug Fixes
- **docsearch:** add padding to dropdown when no recent searches ([0e3d0f5](https://github.com/francoischalifour/autocomplete.js/commit/0e3d0f570abee1361651e07de47b93c1b990a8b0))
- **docsearch:** rename `DocSearch-Button` CSS class ([f3a5449](https://github.com/francoischalifour/autocomplete.js/commit/f3a5449a7ddfdf987422e213db3b2baa52d54d0e))
- **docsearch:** use Preact alias in Babel config ([31b3bd4](https://github.com/francoischalifour/autocomplete.js/commit/31b3bd42d6677c2dbd40ee7012059bcd1202c781))
- **search:** hide content when `disableUserPersonalization` ([4940538](https://github.com/francoischalifour/autocomplete.js/commit/4940538563b89545612fbe8f19acbd0f89d1219d))
- **website:** memoize `onInput` callback ([9fa7d30](https://github.com/francoischalifour/autocomplete.js/commit/9fa7d30629578774d318989a7200385034e5ff3c))
### Features
- **docsearch:** introduce `disableUserPersonalization` API ([de31121](https://github.com/francoischalifour/autocomplete.js/commit/de311210ae2bc63d7907abfbf75b61d3b624e976))
- **docsearch:** support `initialQuery` ([11aa27b](https://github.com/francoischalifour/autocomplete.js/commit/11aa27bf332b91542cf9c0f6f7e88b0412172fb6)), closes [#51](https://github.com/francoischalifour/autocomplete.js/issues/51)
- **DocSearch:** add `DocSearch` CSS class to DocSearch elements ([0e93615](https://github.com/francoischalifour/autocomplete.js/commit/0e9361568440281f5c632d7a086cda523bf4948e))
- **website:** forward Docusaurus props to DocSearch ([abfb06d](https://github.com/francoischalifour/autocomplete.js/commit/abfb06d6ebb6973ac40c890fa9d91dbe05459c13))
# [1.0.0-alpha.22](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.21...v1.0.0-alpha.22) (2020-07-09)
### Bug Fixes
- **docsearch:** support initial query ([dc476d3](https://github.com/francoischalifour/autocomplete.js/commit/dc476d322de3a8d4d589c638076767e009dd59e4))
- **website:** import DS variables and button styles dynamically ([bef75be](https://github.com/francoischalifour/autocomplete.js/commit/bef75be039479c6b45c0f12ec12c21d1af42520f))
### Features
- **docsearch:** attach `docsearch.js` user agent to vanilla renderer ([e1bd8d3](https://github.com/francoischalifour/autocomplete.js/commit/e1bd8d3a94147b325adacafd5f609d5184d4aeb2))
- **docsearch:** introduce `transformSearchClient` API ([edf6b9b](https://github.com/francoischalifour/autocomplete.js/commit/edf6b9b77b187d6d32e43c335593eb8b1a3daacf))
- **docsearch:** introduce DocSearch.js v3 ([#56](https://github.com/francoischalifour/autocomplete.js/issues/56)) ([0ff2462](https://github.com/francoischalifour/autocomplete.js/commit/0ff2462b44eb6b42f1e4d8f53361315b0247a17b))
- **docsearch:** track `docsearch-react` UA ([2c280e2](https://github.com/francoischalifour/autocomplete.js/commit/2c280e2ad9ca6a8d99c7e60ac6da48dd06991d30))
- **website:** lazy load DocSearch styles ([e3bc021](https://github.com/francoischalifour/autocomplete.js/commit/e3bc021b52e282c5e516e84c2988e4c8c8355837))
- **website:** track `docsearch-docusaurus` UA ([eb400f2](https://github.com/francoischalifour/autocomplete.js/commit/eb400f2e4ac4c4fe2eb08bb84581ea07dd20665a))
# [1.0.0-alpha.21](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.20...v1.0.0-alpha.21) (2020-07-07)
### Bug Fixes
- **css:** don't display key shortcuts on mobile ([1adc418](https://github.com/francoischalifour/autocomplete.js/commit/1adc418722f0017b1d504e7d3f7dda8e8104a352))
- **css:** firefox placeholder opacity ([49f7ac3](https://github.com/francoischalifour/autocomplete.js/commit/49f7ac3c9a7680a4e49593f278cb815d52d8d48b))
- **docsearch:** remove theme media query ([a1030e4](https://github.com/francoischalifour/autocomplete.js/commit/a1030e493c22c5c615fa9c49e385030452b18729))
- **test:** removed extra percy snapshot ([24e38b7](https://github.com/francoischalifour/autocomplete.js/commit/24e38b7771471609e190c5c1a61c57627126551a))
### Features
- **docsearch:** support keyboard on focus on default integration ([7600f2a](https://github.com/francoischalifour/autocomplete.js/commit/7600f2a385b193fe5f60b67e135c1810e496052c))
- **docsearch:** support typing query when search button is focused ([#54](https://github.com/francoischalifour/autocomplete.js/issues/54)) ([dcf2247](https://github.com/francoischalifour/autocomplete.js/commit/dcf22474d93ab261d59d12a44b3d677b7271e86e))
# [1.0.0-alpha.20](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.19...v1.0.0-alpha.20) (2020-07-01)
### Features
- **docsearch:** add `/` keyboard shortcut ([d3a7275](https://github.com/francoischalifour/autocomplete.js/commit/d3a7275f03c8d397d797c9375a42bf977fc824ed))
# [1.0.0-alpha.19](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.18...v1.0.0-alpha.19) (2020-06-24)
### Bug Fixes
- **ci:** fix orbs declaration ([db902a1](https://github.com/francoischalifour/autocomplete.js/commit/db902a12972a206f2b75646f40625376a80cad82))
- **ci:** Install cypress ([fb32788](https://github.com/francoischalifour/autocomplete.js/commit/fb327886b6d22d3c59cab2f8e6a32b24c5bd8eaf))
- **ci:** install cypress with Yarn ([5f7dc27](https://github.com/francoischalifour/autocomplete.js/commit/5f7dc27547bcf195586d1ddb43f5a981bc1c7f42))
- **ci:** npm script + percy ([949a24a](https://github.com/francoischalifour/autocomplete.js/commit/949a24a9da50a6f1ca2c7b0a6891d0a09f63ae20))
- **ci:** remove test cypress job args ([c1bf37b](https://github.com/francoischalifour/autocomplete.js/commit/c1bf37b7966eb468281410e055a107f0e9ac3d0d))
- **ci:** rerun ([04fb6f6](https://github.com/francoischalifour/autocomplete.js/commit/04fb6f6f93da0fdd14949cb79176a1b678e83dbd))
- **ci:** use cypress docker image ([fa5521b](https://github.com/francoischalifour/autocomplete.js/commit/fa5521bce55e029e8510e41903024c4252ac2567))
- **ci:** use latest cypress browsers image with node 13 ([bdab390](https://github.com/francoischalifour/autocomplete.js/commit/bdab3901876668e7cbc5b3b15498ca82af90077a))
- **css:** fixed Modal height undefined on Gecko ([85753c5](https://github.com/francoischalifour/autocomplete.js/commit/85753c546da2465b731f70c4f7b6c6e06206feea))
- **cypress:** Added Verify and Info npm scripts ([5f4ae05](https://github.com/francoischalifour/autocomplete.js/commit/5f4ae05c58fb76d92517fab07f622444c3d9a5b3))
- **cypress:** changed env var name for cypress key ([28307a8](https://github.com/francoischalifour/autocomplete.js/commit/28307a84c92b2fe79939cfa4e0755a44326de54c))
- **docsearch:** hoist `transformItems` default value ([1e0ae9e](https://github.com/francoischalifour/autocomplete.js/commit/1e0ae9eefb5fc185cbf41e6ac5c876ed8be24075))
- **lint:** Disable import/no-common for percy ([8af940d](https://github.com/francoischalifour/autocomplete.js/commit/8af940d69bf9eb35bcc70fbc533abdcf721ea209))
- **lint:** set cariage return in prettier config ([3016601](https://github.com/francoischalifour/autocomplete.js/commit/3016601a47699a37e9fa30620e71eef3f30f8c6d))
- **lint:** set eol to auto ([e6db26e](https://github.com/francoischalifour/autocomplete.js/commit/e6db26e57aaf433b149dc16d9a846cdfa19c0314))
- **test:** lint ([896ef59](https://github.com/francoischalifour/autocomplete.js/commit/896ef5959f06576f03d6ecd4ff7ee6ce96333a6d))
- **ypress:** Record reuslts ([7dac93e](https://github.com/francoischalifour/autocomplete.js/commit/7dac93e6a538f69bfe44bfdfe0fbb939b0e241e1))
# [1.0.0-alpha.18](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.17...v1.0.0-alpha.18) (2020-06-11)
### Bug Fixes
- **css:** overflow overlay not supported on gecko ([9e5b764](https://github.com/francoischalifour/autocomplete.js/commit/9e5b764794b5de5e2169ed13f48e024f5f1df812))
### Features
- **docsearch:** introduce `initialScrollY` option ([2d5b216](https://github.com/francoischalifour/autocomplete.js/commit/2d5b21684174f0940c405d4da6839b0e94412f61))
# [1.0.0-alpha.17](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.16...v1.0.0-alpha.17) (2020-06-08)
### Bug Fixes
- **docsearch:** use `scrollTo` when unmounting modal ([aae0a14](https://github.com/francoischalifour/autocomplete.js/commit/aae0a1420caf17bb87249c988c735be5d5ae5c8a))
# [1.0.0-alpha.16](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.15...v1.0.0-alpha.16) (2020-06-08)
### Bug Fixes
- **docsearch:** always use `aria-expanded` to `true` ([b89aeb5](https://github.com/francoischalifour/autocomplete.js/commit/b89aeb5c2eccb43b3657239c519caa34ed62299e))
- **dosearch:** don't add `distinct` search parameter ([1c11457](https://github.com/francoischalifour/autocomplete.js/commit/1c1145768a74f372c683fbee9d0aaaf0dd3fb62a))
- **website:** don't pass default `appId` ([62e0609](https://github.com/francoischalifour/autocomplete.js/commit/62e060917b864e2a86328ea9816252d50c189654))
- **website:** support missing `algolia` config ([4b30cdd](https://github.com/francoischalifour/autocomplete.js/commit/4b30cdd90bfb2226cfd5f34642ea1593a64f833b))
- **website:** update netlify.com to netlify.app ([9cbb80b](https://github.com/francoischalifour/autocomplete.js/commit/9cbb80bb9078a7a19750e8f2bbef6e69ecce9cda))
### Features
- **docsearch:** display 5 hits per category maximum ([7e6582c](https://github.com/francoischalifour/autocomplete.js/commit/7e6582cf0be5df74e8f239432db6309929caf1a6))
- **docsearch:** introduce `resultsFooterComponent` option ([b613bb2](https://github.com/francoischalifour/autocomplete.js/commit/b613bb2a63da604cbd44e5d3dff32a4e60c63723))
- **website:** add "Creating a renderer" guide ([71a94ea](https://github.com/francoischalifour/autocomplete.js/commit/71a94eab8cbe6e76219730b7eda3c60460dfc35b))
- **website:** add link to search page in DocSearch modal ([d610ce9](https://github.com/francoischalifour/autocomplete.js/commit/d610ce9cd717253b33a4596ee855268e38c82ffa))
# [1.0.0-alpha.15](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.14...v1.0.0-alpha.15) (2020-05-20)
### Bug Fixes
- **css:** scroll windows ([a966e74](https://github.com/francoischalifour/autocomplete.js/commit/a966e74aee86cf4b7b25818c3f2b0e2b463636ef))
- **css:** separate docusaurus css variables ([f41c31d](https://github.com/francoischalifour/autocomplete.js/commit/f41c31dd4af5bf5178982ed725f03dc67d0d4a6e))
- **docsearch:** use `scrollTop` on body ([129c1d1](https://github.com/francoischalifour/autocomplete.js/commit/129c1d13aa77e1f6c38d09ee3b9cfa2eb9df8f57))
- **website:** update DocSearch integration ([d41605d](https://github.com/francoischalifour/autocomplete.js/commit/d41605dd0d1451c1760ad78ab361fa5a52e35820))
# [1.0.0-alpha.14](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.13...v1.0.0-alpha.14) (2020-05-15)
### Bug Fixes
- **docsearch:** remove blur effect to avoid performance issues ([978229f](https://github.com/francoischalifour/autocomplete.js/commit/978229f2b838f71effe04b77876cbcf36f17e0a4))
- **docsearch:** use `scrollTop` for IE support ([b51e81d](https://github.com/francoischalifour/autocomplete.js/commit/b51e81d94b473ed3602b02073911899cc5dc6a4a))
- **docsearch:** use absolute URLs ([e1ed4e8](https://github.com/francoischalifour/autocomplete.js/commit/e1ed4e887a9e57af37e384fb08423d293502423c))
### Features
- **docsearch:** add `DocSearch` component ([218944e](https://github.com/francoischalifour/autocomplete.js/commit/218944e4412dc0afee54521895247736a86f16ca))
- **docsearch:** add `useDocSearchKeyboardEvents` API ([5697895](https://github.com/francoischalifour/autocomplete.js/commit/5697895167e7bdc61429b9794c92ef57cd0315bc))
- **docusaurus:** import DocSearch modal on hover ([e680f24](https://github.com/francoischalifour/autocomplete.js/commit/e680f2453a9339467f3e502586d3bccc23edb911))
# [1.0.0-alpha.13](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.12...v1.0.0-alpha.13) (2020-04-24)
### Bug Fixes
- **fix**: update workspace dependencies when releasing ([076b7be](076b7be69f89fa677a66cb0a91c51d02d440ac0a))
# [1.0.0-alpha.12](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2020-04-24)
### Bug Fixes
- **docsearch:** add index name to localStorage key ([f5fbaa3](https://github.com/francoischalifour/autocomplete.js/commit/f5fbaa3b544038caa76cd8382af2a9c990f80a4f))
# [](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.11...v) (2020-04-24)
### Bug Fixes
- **docsearch:** add index name to localStorage key ([f5fbaa3](https://github.com/francoischalifour/autocomplete.js/commit/f5fbaa3b544038caa76cd8382af2a9c990f80a4f))
# [1.0.0-alpha.11](https://github.com/francoischalifour/autocomplete.js/compare/v1.0.0-alpha.10...v1.0.0-alpha.11) (2020-04-24)
### Features
- **docsearch**: create clean exports ([d0f8ff3](https://github.com/francoischalifour/autocomplete.js/commit/d0f8ff3ab4f89c9dce1f2bdc923d94aed7515dc1))
- **design:** icon actions ([056d333](https://github.com/francoischalifour/autocomplete.js/commit/056d333780d6c5f48cf86236b443916b75b073b4))
- **design:** new error icons + update icons + update light shadows / searchbox ([2e77e70](https://github.com/francoischalifour/autocomplete.js/commit/2e77e70e792ccb52d7c6300f149697fad441fd2e))
- **design:** new icons ([5bd3cbc](https://github.com/francoischalifour/autocomplete.js/commit/5bd3cbc10693d3b65f7908e3523fa9bcc187f0ea))
- **docsearch:** add `hitComponent` and `transformItems` options ([daaafe5](https://github.com/francoischalifour/autocomplete.js/commit/daaafe5178cd43e258e389f579bc7517a3935b09))
- **docsearch:** add DocSearch for Docusaurus ([#39](https://github.com/francoischalifour/autocomplete.js/issues/39)) ([ad63053](https://github.com/francoischalifour/autocomplete.js/commit/ad630539c444417f414e0e8bcf74fd20f7cd73c8))
- **docsearch:** add recent searches ([#40](https://github.com/francoischalifour/autocomplete.js/issues/40)) ([36e7fab](https://github.com/francoischalifour/autocomplete.js/commit/36e7fabe43582fe358cb15f92e5afddecd5f1a7d))
- **docsearch:** add search suggestions ([d1fe8b2](https://github.com/francoischalifour/autocomplete.js/commit/d1fe8b2be3d30f067892ac9f04f6f802b6b40826))
- **docsearch:** allow placeholder customization ([3a4f13b](https://github.com/francoischalifour/autocomplete.js/commit/3a4f13b35198a0372f6d4cab7b661e774e424c6f))
- **docsearch:** animate cards on action ([8c7bdc1](https://github.com/francoischalifour/autocomplete.js/commit/8c7bdc117f6a76a53c9245a2089cda5dd02b71e6))
- **docsearch:** append modal to body ([73a7f0e](https://github.com/francoischalifour/autocomplete.js/commit/73a7f0ed491407d9c80ef9d14ddd704c0ac8f7c4))
- **docsearch:** catch retry errors in the search client ([750c4b5](https://github.com/francoischalifour/autocomplete.js/commit/750c4b51e2159a787613aa959ac62238c1f1a65b))
- **docsearch:** display more recent searches when no favorites ([a4c7082](https://github.com/francoischalifour/autocomplete.js/commit/a4c70825cc5d204b0ee44bcb8965a325f7fa5471))
- **docsearch:** forward props to autocomplete-core ([7cbcb12](https://github.com/francoischalifour/autocomplete.js/commit/7cbcb128bd59fe5c550ffb534f399b2b1022e5a3))
- **docsearch:** introduce favorite searches ([61bd0aa](https://github.com/francoischalifour/autocomplete.js/commit/61bd0aa5f768658c70f7cb0b7bb465c9b9579da7))
- **docsearch:** introduce Selection Search ([d5fd4d6](https://github.com/francoischalifour/autocomplete.js/commit/d5fd4d66a08a1b6d7f990757261c5f9e32e95c1c))
- **docsearch:** save content record hit parent in recent searches ([3fe547f](https://github.com/francoischalifour/autocomplete.js/commit/3fe547f2cc17f2c5a2f1c526bca4e98b42093e1f))
- **docsearch:** trap focus in modal ([0ca92ca](https://github.com/francoischalifour/autocomplete.js/commit/0ca92ca18b60d3949f4150a7afb5eb1f6984612d))
- **docsearch:** use `preconnect` link in Docusaurus integration ([33e2e8b](https://github.com/francoischalifour/autocomplete.js/commit/33e2e8bd9436222933e7bd949082c3a446cb9f6e))
- **docsearch:** use relative URLs ([f434ca1](https://github.com/francoischalifour/autocomplete.js/commit/f434ca1f92c9638ddfa42f3cd8b7d0093490830f))
# [1.0.0-alpha.10](https://github.com/francoischalifour/autocomplete.js/compare/v0.37.0...v1.0.0-alpha.10) (2020-03-31)
### Bug Fixes
- remove unused prop getters ([074c92d](https://github.com/francoischalifour/autocomplete.js/commit/074c92d3601cd0208759a211b2d22ca2430a2340))
- **core:** call `generateAutocompleteId` only if necessary ([ce4d496](https://github.com/francoischalifour/autocomplete.js/commit/ce4d496d1f074d02051c1cbe1f296d2a5d6e1c1c))
- **getters:** compute `aria-autocomplete` based on the props ([9ea5042](https://github.com/francoischalifour/autocomplete.js/commit/9ea5042c3a78126c09b03daff2b682db4535aba1))
- **getters:** don't forward data prop getters ([0deb9a1](https://github.com/francoischalifour/autocomplete.js/commit/0deb9a14a14e7730c2b54c63a5138a4bfcd2d1e7))
- **react:** fix options types ([fdde35f](https://github.com/francoischalifour/autocomplete.js/commit/fdde35ff26da7a097c073816e1da76d6f0e6ed49))
- **react:** remove dropdown from DOM when closed ([c647224](https://github.com/francoischalifour/autocomplete.js/commit/c64722467f7ab77babc6e53b4f46386efd335d95))
### Features
- **core:** allow input pause in keyboard navigation ([0000499](https://github.com/francoischalifour/autocomplete.js/commit/000049971884e958e92cbfd14331ab88ff2b5e1f))
- **core:** introduce `getDropdownProps` ([9b758ee](https://github.com/francoischalifour/autocomplete.js/commit/9b758eee271954eb7228916bf822b09a1a715e61))
- **react:** attach Algolia agents in React renderer ([c6c4da5](https://github.com/francoischalifour/autocomplete.js/commit/c6c4da580afec6dbf69b55c55809b1e1f9b8e9fc))
- **react:** create highlighting components ([fb49161](https://github.com/francoischalifour/autocomplete.js/commit/fb49161ea59f3ff925bcffe3e74435acb6e47c18))
- add openOnFocus and remove minLength ([#31](https://github.com/francoischalifour/autocomplete.js/issues/31)) ([553ea68](https://github.com/francoischalifour/autocomplete.js/commit/553ea68950bfc94eb8588a71dd5580db4682931c))
- swap Preact with React ([#34](https://github.com/francoischalifour/autocomplete.js/issues/34)) ([e0f2568](https://github.com/francoischalifour/autocomplete.js/commit/e0f25689440f7177e663ac6306e49f8f89a0727a))
- **autoFocus:** add support for `autoFocus` option ([4d3f792](https://github.com/francoischalifour/autocomplete.js/commit/4d3f7921307ef9417a8dd1147e71309350de77fe))
- **core:** filter out falsy sources ([f771522](https://github.com/francoischalifour/autocomplete.js/commit/f771522df77f3297644aec5214b459fc960f0b3f))
- **core:** introduce `getEnvironmentProps` for mobile experience ([#27](https://github.com/francoischalifour/autocomplete.js/issues/27)) ([f9d7eed](https://github.com/francoischalifour/autocomplete.js/commit/f9d7eed75514911ee45ed3aaee47c30373fdbd8a))
- **core:** process completion as a state enhancer ([#29](https://github.com/francoischalifour/autocomplete.js/issues/29)) ([53c2ef7](https://github.com/francoischalifour/autocomplete.js/commit/53c2ef7b1b985486199ae2dc54069a7bcfe3b41a))
- **core:** rename `shouldDropdownOpen` to `shouldDropdownShow` ([f2c3eb2](https://github.com/francoischalifour/autocomplete.js/commit/f2c3eb2d5ec6e5338df5b685af8edfb6cc477659)), closes [/github.com/francoischalifour/autocomplete.js/pull/16#pullrequestreview-355978230](https://github.com//github.com/francoischalifour/autocomplete.js/pull/16/issues/pullrequestreview-355978230)
- **core:** support `onHighlight` on sources ([0f4101b](https://github.com/francoischalifour/autocomplete.js/commit/0f4101bbf82e15afcc6f02ae1075a05dee7f261c))
- **core:** support `onSelect` on sources ([0cf0a93](https://github.com/francoischalifour/autocomplete.js/commit/0cf0a93bf3e5c04972e70c716867ce82e220c640))
- **onInput:** support `onInput` prop for controlled mode ([7345eb9](https://github.com/francoischalifour/autocomplete.js/commit/7345eb9c279b28a00bc833912fa9697654becab0))
- **onSubmit:** introduce `onSubmit` option ([#24](https://github.com/francoischalifour/autocomplete.js/issues/24)) ([ca0891c](https://github.com/francoischalifour/autocomplete.js/commit/ca0891c87256f0eb6a04f28fbf92b42826346c67))
- **react:** introduce `inputRef` for focus management ([#32](https://github.com/francoischalifour/autocomplete.js/issues/32)) ([4d804fe](https://github.com/francoischalifour/autocomplete.js/commit/4d804fe62ee7d67fb335866aeeb87f070255319e))
- **react:** place dropdown with Popper ([#25](https://github.com/francoischalifour/autocomplete.js/issues/25)) ([ca38070](https://github.com/francoischalifour/autocomplete.js/commit/ca380704f6506dc6c9c82b564701da3ce5772109))
- **website:** add Docusaurus 2 website ([#33](https://github.com/francoischalifour/autocomplete.js/issues/33)) ([3ee0ab5](https://github.com/francoischalifour/autocomplete.js/commit/3ee0ab53bd3d78ac3943fd35ec54f14d016dbd5a))
<a name="0.37.0"></a>
# [0.37.0](https://github.com/algolia/autocomplete.js/compare/v0.36.0...v0.37.0) (2019-08-30)
### Bug Fixes
- **clear:** Avoid error when clear is called after destroy ([#287](https://github.com/algolia/autocomplete.js/issues/287)) ([244425d](https://github.com/algolia/autocomplete.js/commit/244425d))
<a name="0.36.0"></a>
# [0.36.0](https://github.com/algolia/autocomplete.js/compare/v0.35.0...v0.36.0) (2019-02-21)
### Bug Fixes
- **standalone:** use aria label from input ([#276](https://github.com/algolia/autocomplete.js/issues/276)) ([4b94466](https://github.com/algolia/autocomplete.js/commit/4b94466))
<a name="0.35.0"></a>
# [0.35.0](https://github.com/algolia/autocomplete.js/compare/v0.34.0...v0.35.0) (2018-12-17)
### Bug Fixes
- **chrome-only:** Change autocomplete from 'nope' to 'off' ([#273](https://github.com/algolia/autocomplete.js/issues/273)) ([892a8f0](https://github.com/algolia/autocomplete.js/commit/892a8f0))
- **utils:** correct \_.every method ([#274](https://github.com/algolia/autocomplete.js/issues/274)) ([55af1e3](https://github.com/algolia/autocomplete.js/commit/55af1e3))
<a name="0.34.0"></a>
# [0.34.0](https://github.com/algolia/autocomplete.js/compare/v0.33.0...v0.34.0) (2018-12-04)
### Features
- change autocomplete from 'off' to 'nope' ([#250](https://github.com/algolia/autocomplete.js/issues/250)) ([fbbed04](https://github.com/algolia/autocomplete.js/commit/fbbed04))
<a name="0.33.0"></a>
# [0.33.0](https://github.com/algolia/autocomplete.js/compare/v0.32.0...v0.33.0) (2018-11-19)
### Bug Fixes
- **release:** Update mversion to 1.12 ([#268](https://github.com/algolia/autocomplete.js/issues/268)) ([08b8e30](https://github.com/algolia/autocomplete.js/commit/08b8e30))
### Features
- **selected:** Adding context.selectionMethod to selected event ([#267](https://github.com/algolia/autocomplete.js/issues/267)) ([36028a6](https://github.com/algolia/autocomplete.js/commit/36028a6))
<a name="0.32.0"></a>
# [0.32.0](https://github.com/algolia/autocomplete.js/compare/v0.31.0...v0.32.0) (2018-11-06)
### Bug Fixes
- **zepto:** apply patch to prevent an error ([#263](https://github.com/algolia/autocomplete.js/issues/263)) ([917d5a7](https://github.com/algolia/autocomplete.js/commit/917d5a7))
### Features
- **source:** add cache disabling for datasets ([#254](https://github.com/algolia/autocomplete.js/issues/254)) ([0e65fee](https://github.com/algolia/autocomplete.js/commit/0e65fee))
- add flag for toggling tab autocompletion ([#260](https://github.com/algolia/autocomplete.js/issues/260)) ([4dc7c52](https://github.com/algolia/autocomplete.js/commit/4dc7c52))
- Throw err on update if suggestions are invalid type ([#256](https://github.com/algolia/autocomplete.js/issues/256)) ([179febf](https://github.com/algolia/autocomplete.js/commit/179febf)), closes [#131](https://github.com/algolia/autocomplete.js/issues/131)
<a name="0.31.0"></a>
# [0.31.0](https://github.com/algolia/autocomplete.js/compare/v0.30.0...v0.31.0) (2018-08-08)
### Bug Fixes
- **dataset:** avoid to call the source when upadte is canceled ([a47696d](https://github.com/algolia/autocomplete.js/commit/a47696d))
- **dataset:** avoid usage of callNow for debounce ([1a0ce74](https://github.com/algolia/autocomplete.js/commit/1a0ce74))
- Handle an odd case with the user agent ([#242](https://github.com/algolia/autocomplete.js/issues/242)) ([c194736](https://github.com/algolia/autocomplete.js/commit/c194736))
### Features
- update dist files ([9babf2e](https://github.com/algolia/autocomplete.js/commit/9babf2e))
- **clearOnSelected:** allow users to clear the input instead of filling ([#244](https://github.com/algolia/autocomplete.js/issues/244)) ([aa2edbb](https://github.com/algolia/autocomplete.js/commit/aa2edbb)), closes [#241](https://github.com/algolia/autocomplete.js/issues/241)
<a name="0.30.0"></a>
# [0.30.0](https://github.com/algolia/autocomplete.js/compare/v0.29.0...v0.30.0) (2018-04-30)
<a name="0.29.0"></a>
# [0.29.0](https://github.com/algolia/autocomplete.js/compare/v0.28.3...v0.29.0) (2017-10-12)
### Features
- **a11y:** Add ariaLabel option. ([6db8e1b](https://github.com/algolia/autocomplete.js/commit/6db8e1b))
- **a11y:** Add option to control `aria-labelledby` attribute. ([0491c43](https://github.com/algolia/autocomplete.js/commit/0491c43))
<a name="0.28.3"></a>
## [0.28.3](https://github.com/algolia/autocomplete.js/compare/v0.28.2...v0.28.3) (2017-07-31)
<a name="0.28.2"></a>
## [0.28.2](https://github.com/algolia/autocomplete.js/compare/v0.28.1...v0.28.2) (2017-06-22)
### Bug Fixes
- **empty template:** hide main empty template as long as we have results ([344e225](https://github.com/algolia/autocomplete.js/commit/344e225)), closes [#185](https://github.com/algolia/autocomplete.js/issues/185)
<a name="0.28.1"></a>
## [0.28.1](https://github.com/algolia/autocomplete.js/compare/v0.28.0...v0.28.1) (2017-03-29)
### Bug Fixes
- **iOS:** remove double tap bug on hrefs in suggestions ([e532bd8](https://github.com/algolia/autocomplete.js/commit/e532bd8))
<a name="0.28.0"></a>
# [0.28.0](https://github.com/algolia/autocomplete.js/compare/v0.27.0...v0.28.0) (2017-03-24)
<a name="0.27.0"></a>
# [0.27.0](https://github.com/algolia/autocomplete.js/compare/v0.26.0...v0.27.0) (2017-03-06)
### Bug Fixes
- **UA:** add failsafe if params not provided ([30df97a](https://github.com/algolia/autocomplete.js/commit/30df97a)), closes [#166](https://github.com/algolia/autocomplete.js/issues/166)
<a name="0.26.0"></a>
# [0.26.0](https://github.com/algolia/autocomplete.js/compare/v0.25.0...v0.26.0) (2017-02-28)
### Bug Fixes
- **test:** bad handling of no actual inner mechanics of client ([622aec5](https://github.com/algolia/autocomplete.js/commit/622aec5))
### Features
- **algolia agent:** provide an algolia agent when searching ([6ca7ac2](https://github.com/algolia/autocomplete.js/commit/6ca7ac2))
- **algolia agent:** provide an algolia agent when searching ([ef604e1](https://github.com/algolia/autocomplete.js/commit/ef604e1))
<a name="0.25.0"></a>
# [0.25.0](https://github.com/algolia/autocomplete.js/compare/v0.24.2...v0.25.0) (2017-02-07)
### Bug Fixes
- **zepto:** .is() only accepts selectors, reworked code to use pure DOM ([a47a4d4](https://github.com/algolia/autocomplete.js/commit/a47a4d4)), closes [#144](https://github.com/algolia/autocomplete.js/issues/144)
<a name="0.24.2"></a>
## [0.24.2](https://github.com/algolia/autocomplete.js/compare/v0.24.1...v0.24.2) (2017-01-20)
### Bug Fixes
- **dep:** immediate is a dependency, not a devDependency ([22164ad](https://github.com/algolia/autocomplete.js/commit/22164ad))
<a name="0.24.1"></a>
## [0.24.1](https://github.com/algolia/autocomplete.js/compare/v0.24.0...v0.24.1) (2017-01-20)
### Bug Fixes
- **postMessage:** avoid using postMessage when feasible ([a99f664](https://github.com/algolia/autocomplete.js/commit/a99f664)), closes [#142](https://github.com/algolia/autocomplete.js/issues/142)
<a name="0.24.0"></a>
# [0.24.0](https://github.com/algolia/autocomplete.js/compare/0.23.0...v0.24.0) (2017-01-10)
### Bug Fixes
- **angular:** do not launch the directive if autocomplete has a value ([f96a1ba](https://github.com/algolia/autocomplete.js/commit/f96a1ba)), closes [#136](https://github.com/algolia/autocomplete.js/issues/136)
- **typeahead:** propagate redrawn ([82293e4](https://github.com/algolia/autocomplete.js/commit/82293e4))
### Features
- **appendTo:** new parameter ([e40cbd0](https://github.com/algolia/autocomplete.js/commit/e40cbd0))
### 0.23.0 Dec 14, 2016
- feat(build): add noConflict() for standalone build, fixes #133
### 0.22.1 Nov 07, 2016
- Fixes bad behavior when `autoselectOnBlur` used, fixes #113
### 0.22.0 Oct 25, 2016
- Add `autocomplete:cursorremoved` event, see #105
- Add `autoselectOnBlur` option, fixes #113
### 0.21.8 Oct 3, 2016
- Do not allow Zepto to leak to window. Never.
### 0.21.7 Sep 21, 2016
- Ensure the `empty` templates get displayed before the `footer`.
- Ensure the dataset `empty` templates are displayed when all datasets are empty.
### 0.21.6 Sep 20, 2016
- Make sure we don't leak/override `window.Zepto`.
### 0.21.5 Sep 15, 2016
- While selecting the top suggestion (autoselect=true), do not update the input.
### 0.21.4 Sep 2, 2016
- Ensure the cursor selects the first suggestion when the dropdown is shown + send the `cursorchanged` event.
### 0.21.3 Aug 1, 2016
- Ensure empty template displays from first keystroke (#104)
### 0.21.2 July 26, 2016
- fix(empty): fix the empty even handling, fixes #95
### 0.21.1 July 19, 2016
- fix(getVal): fix getVal on standalone build
### 0.21.0 July 15, 2016
- Upgrade to zepto 1.2.0
### 0.20.1 June 14, 2016
- Ensure the dropdown menu is hidden when there is an `$empty` block and blank query.
### 0.20.0 June 04, 2016
- Ensure we don't update the input value on mouseenter (#76)
- Render an `empty` template if no results (#80)
### 0.19.1 May 04, 2016
- Fixed the angular build (\_.Event was undefined)
### 0.19.0 Apr 25, 2016
- Allow select handler to prevent menu from being closed (#72)
- Do not trigger the cursorchanged event while entering/leaving nested divs (#71)
### 0.18.0 Apr 07, 2016
- Ability to customize the CSS classes used to render the DOM
- Ensure the `autocomplete:cursorchanged` event is called on `mouseover` as well
### 0.17.3 Apr 04, 2016
- Standalone: ensure we actually use the Zepto object and not whatever is in `window.$`
### 0.17.2 Mar 21, 2016
- Ability to setup the autocomplete on a multi-inputs Zepto selector
- Propagate the `shown` event to the top-level
### 0.17.1 Mar 19, 2016
- REVERT [Ability to setup the autocomplete on a multi-inputs Zepto selector] Fix #59
### 0.17.0 Mar 18, 2016
- Ability to setup the autocomplete on a multi-inputs Zepto selector
- Add a new `shown` event triggered when the dropdown menu is opened and non-empty
BREAKING CHANGE: the standalone object returned by the `autocomplete()` method is now a Zepto object.
### 0.16.2 Jan 22, 2016
- stop using weird zepto package. Stop using chained .data calls it seems that chaining them ended up in an `undefined` return value when passing `undefined` as a value
### 0.16.1 Jan 22, 2016
- remove npm-zepto, use zepto original package (now on npm) fixes #48
### 0.16.0 Dec 11, 2015
- Emit a new `autocomplete:updated` event as soon as a dataset is rendered
### 0.15.0 Dec 10, 2015
- Ability to configure the dropdown menu container
### 0.14.1 Dec 2, 2015
- Move Zepto as a dependency (not a peer dep)
- Really use the `query` instead of the `displayKey` (was supposed to be fixed in 0.11.0)
### 0.14.0 Nov 28, 2015
- Move npm-zepto & angular to peerDependencies
- Fixed custom dropdownMenu's footer & header not being displayed properly
- Allow dataset with name=0
### 0.13.1 Nov 25, 2015
- Move the bower release name to `algolia-autocomplete.js` since `autocomplete.js` is already used
### 0.13.0 Nov 25, 2015
- Add Bower release
### 0.12.0 Oct 15, 2015
- Expose the underlying `close`, `open`, ... functions in the standalone build.
### 0.11.1 Oct 13, 2015
- Zepto doesn't work like jQuery regarding the `data` API, it doesn't support serializing objects.
### 0.11.0 Oct 07, 2015
- If the `displayKey` is not specified and the `value` attribute missing, don't update the input value with `undefined`.
- Expose the `sources` object in the Angular.js build as well.
### 0.10.0 Oct 06, 2015
- Add a new `includeAll` option to the `popularIn` source to add an extra suggestion.
### 0.9.0 Oct 01, 2015
- Full CommonJS compliance (moved from browserify to webpack)
### 0.8.0 Sep 24, 2015
- UMD compliance
### 0.7.0 Sep 16, 2015
- New standalone build (including Zepto.js)
- Get rid of lodash-compat and use jQuery, Zepto or Angular.js's helper functions
### 0.6.0 Sep 11, 2015
- Add Zepto.js support.
### 0.5.0 Sep 9, 2015
- The wrapper span will now have a `table-cell` display if the original input was a `block` inside a `table`.
### 0.4.0 Aug 12, 2015
- Add a new `openOnFocus` option to open the dropdown menu when the input is focused
### 0.3.0 July 27, 2015
- Add Angular.js support [#7]
### 0.2.0 July 16, 2015
- Ability to change the layout based on the matching datasets [#11]
### 0.1.0 July 13, 2015
- Start using semantic versioning
### 0.0.2 July 13, 2015
- Ability to keep the dropdown menu opened when the input if blurred [#1]
- Ability to use a custom dropdown menu template [#2]
- Ability to configure a custom header/footer on the dropdown menu [#3]
### 0.0.1 July 12, 2015
- First release based on Twitter's typeahead.js library
- Travis-ci.org, Coveralls.io, Saucelabs.com integration
- CommonJS compatibility

73
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,73 @@
# Contributing to Autocomplete.js
First of all, thanks for taking a look at contributing here 🎉 If you have any questions while contributing, feel free to open an issue or to send an email to <support@algolia.com> mentioning the PR or issue you're working on.
## Development
To start developing, you can use the following commands:
```sh
yarn
yarn dev
open http://localhost:8888/test/playground.html
```
Linting is done with [eslint](http://eslint.org/) and [Algolia's configuration](https://github.com/algolia/eslint-config-algolia) and can be run with:
```sh
yarn lint
```
## Tests
Unit tests are written using [Jasmine](http://jasmine.github.io/) and ran with [Karma](http://karma-runner.github.io/). Integration tests are using [Mocha](http://mochajs.org/) and [Saucelabs](https://saucelabs.com/).
To run the unit tests suite run:
```sh
yarn test
```
To run the integration tests suite run:
```sh
yarn build
yarn server
ngrok 8888
TEST_HOST=http://YOUR_NGROK_ID.ngrok.com SAUCE_ACCESS_KEY=YOUR_KEY SAUCE_USERNAME=YOUR_USERNAME./node_modules/mocha/bin/mocha --harmony -R spec ./test/integration/test.js
```
### Testing accessibility
Autocomplete.js is accessible to screen readers, and here's how to test how most blind users will experience it:
#### Steps
1. Run `yarn dev` on your development machine
1. Start the screen reader
1. Open a browser to http://YOUR_IP:8888/test/playground.html
1. Tab to the field
1. Type a search query
1. Use the arrow keys to navigate through the results
✔ SUCCESS: results are read (not necessarily in sync with the visually selected cursor)
𐄂 FAIL: no text is read or the screen reader keeps reading the typed query
#### Recommended testing platforms
- VoiceOver (CMD+F5 in macOS): Safari, Chrome
- [JAWS](http://www.freedomscientific.com/Products/Blindness/JAWS): IE11, Chrome (Windows 7 VM available at [modern.ie](https://modern.ie))
- [NVDA](http://www.nvaccess.org/): IE11, Chrome (Windows 8.1 VM available at [modern.ie](https://modern.ie))
#### Tips
- All screen readers work slightly differently - which makes making accessible pages tricky.
- Don't worry if the usability isn't 100% perfect, but make sure the functionality is there.
## Release
Decide if this is a patch, minor or major release, have a look at [semver.org](http://semver.org/).
```sh
npm run release [major|minor|patch|x.x.x]
```

21
LICENSE Normal file
View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015-present Algolia, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

32
README.md Normal file
View file

@ -0,0 +1,32 @@
# Autocomplete
Suite of Autocomplete libraries to build fast and fully-featured autocomplete experiences.
---
[![Version](https://img.shields.io/npm/v/autocomplete.js.svg?style=flat-square)](https://www.npmjs.com/package/autocomplete.js) [![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/autocomplete.js/badge?style=flat-square)](https://www.jsdelivr.com/package/npm/autocomplete.js) [![MIT License](https://img.shields.io/badge/License-MIT-green.svg?style=flat-square)](LICENSE)
## Why
You should be using Autocomplete if you want to:
- Display suggestions as you type
- Support input completion
- Support custom templates for UI flexibility
- Create custom interactions and behaviors based on your sources
- Plug the Algolia realtime search engine
## Packages
| Package | Description | Documentation |
| --- | --- | --- |
| [`autocomplete-core`](packages/autocomplete-core) | Core primitives to build an Autocomplete experience | [Documentation](https://autocomplete-experimental.netlify.app/docs/createAutocomplete) |
| [`autocomplete-js`](packages/autocomplete-js) | JavaScript package for Autocomplete | [Documentation](https://autocomplete-experimental.netlify.app/docs/autocomplete-js) |
| [`autocomplete-preset-algolia`](packages/autocomplete-preset-algolia) | Presets to use Algolia features with Autocomplete | [Documentation](https://autocomplete-experimental.netlify.app/docs/highlightAlgoliaHit) |
| [`docsearch-js`](packages/docsearch-js) | JavaScript package for DocSearch | [Documentation](https://autocomplete-experimental.netlify.app/docs/docsearch-js) |
| [`docsearch-react`](packages/docsearch-react) | React package for DocSearch | [Documentation](https://autocomplete-experimental.netlify.app/docs/DocSearch) |
| [`docsearch-css`](packages/docsearch-css) | Styles for DocSearch | [Documentation](https://autocomplete-experimental.netlify.app/docs/docsearch-css) |
## License
[MIT](LICENSE)

106
babel.config.js Normal file
View file

@ -0,0 +1,106 @@
/* eslint-disable import/no-commonjs */
module.exports = (api) => {
const isTest = api.env('test');
const modules = isTest ? 'commonjs' : false;
const targets = {};
if (isTest) {
targets.node = true;
} else {
targets.browsers = ['last 2 versions', 'ie >= 9'];
}
return {
presets: [
'@babel/preset-typescript',
[
'@babel/preset-env',
{
modules,
targets,
},
],
],
plugins: clean([
'@babel/plugin-transform-react-jsx',
!isTest && [
'inline-replace-variables',
{
__DEV__: {
type: 'node',
replacement: "process.env.NODE_ENV === 'development'",
},
},
],
]),
overrides: [
{
test: 'packages/autocomplete-core',
plugins: clean([
!isTest && [
'inline-replace-variables',
{
__DEV__: {
type: 'node',
replacement: "process.env.NODE_ENV === 'development'",
},
__VERSION__: {
type: 'node',
replacement: JSON.stringify(
require('./packages/autocomplete-core/package.json').version
),
},
},
],
]),
},
{
test: 'packages/autocomplete-preset-algolia',
plugins: clean([
!isTest && [
'inline-replace-variables',
{
__DEV__: {
type: 'node',
replacement: "process.env.NODE_ENV === 'development'",
},
__VERSION__: {
type: 'node',
replacement: JSON.stringify(
require('./packages/autocomplete-preset-algolia/package.json')
.version
),
},
},
],
]),
},
{
test: 'packages/autocomplete-react',
plugins: clean([
'@babel/plugin-transform-react-jsx',
!isTest && [
'inline-replace-variables',
{
__DEV__: {
type: 'node',
replacement: "process.env.NODE_ENV === 'development'",
},
__VERSION__: {
type: 'node',
replacement: JSON.stringify(
require('./packages/autocomplete-react/package.json').version
),
},
},
],
]),
},
],
};
};
function clean(config) {
return config.filter(Boolean);
}

32
bundlesize.config.json Normal file
View file

@ -0,0 +1,32 @@
{
"files": [
{
"path": "packages/autocomplete-core/dist/umd/index.js",
"maxSize": "4 kB"
},
{
"path": "packages/autocomplete-preset-algolia/dist/umd/index.js",
"maxSize": "1.25 kB"
},
{
"path": "packages/autocomplete-js/dist/umd/index.js",
"maxSize": "6.5 kB"
},
{
"path": "packages/autocomplete-react/dist/umd/index.js",
"maxSize": "11 kB"
},
{
"path": "packages/docsearch-css/dist/style.css",
"maxSize": "3 kB"
},
{
"path": "packages/docsearch-react/dist/umd/index.js",
"maxSize": "17.25 kB"
},
{
"path": "packages/docsearch-js/dist/umd/index.js",
"maxSize": "25 kB"
}
]
}

4
cypress.json Normal file
View file

@ -0,0 +1,4 @@
{
"projectId": "nf9rdc",
"baseUrl": "http://localhost:3000"
}

View file

@ -0,0 +1,144 @@
context('Start', () => {
beforeEach(() => {
cy.visit(Cypress.config().baseUrl!);
});
it('Open Modal on Search Button click', () => {
cy.get('.DocSearch-Button').click();
cy.get('.DocSearch-Modal').should('be.visible');
cy.get('.DocSearch-Input').should('be.focus');
cy.percySnapshot('modal-opened');
});
it('Open Modal with key shortcut on Windows/Linux', () => {
cy.get('body').type('{ctrl}k');
cy.get('.DocSearch-Modal').should('be.visible');
cy.get('.DocSearch-Input').should('be.focus');
});
it('Open Modal with key shortcut on macOS', () => {
cy.get('body').type('{meta}k');
cy.get('.DocSearch-Modal').should('be.visible');
cy.get('.DocSearch-Input').should('be.focus');
});
it('Open Modal with forward slash key shortcut', () => {
cy.get('body').type('/');
cy.get('.DocSearch-Modal').should('be.visible');
cy.get('.DocSearch-Input').should('be.focus');
});
});
context('End', () => {
beforeEach(() => {
cy.visit(Cypress.config().baseUrl!);
cy.get('.DocSearch-Button').click();
});
it('Close Modal with Esc key', () => {
cy.get('body').type('{esc}');
cy.get('.DocSearch-Modal').should('not.be.visible');
cy.percySnapshot('modal-closed');
});
it('Close Modal by clicking outside its container', () => {
cy.get('.DocSearch-Container').click();
cy.get('.DocSearch-Modal').should('not.be.visible');
});
it('Close Modal with key shortcut on Windows/Linux', () => {
cy.get('body').type('{ctrl}k');
cy.get('.DocSearch-Modal').should('not.be.visible');
});
it('Close Modal with key shortcut on macOS', () => {
cy.get('body').type('{meta}k');
cy.get('.DocSearch-Modal').should('not.be.visible');
});
});
context('Search', () => {
beforeEach(() => {
cy.visit(Cypress.config().baseUrl!);
cy.get('.DocSearch-Button').click();
});
it('Results are displayed after a Query', () => {
cy.get('.DocSearch-Input').type('get');
cy.get('.DocSearch-Hits').should('be.visible');
cy.percySnapshot('search-results');
});
it('Query can be cleared', () => {
cy.get('.DocSearch-Input').type('get');
cy.get('.DocSearch-Reset').click();
cy.get('.DocSearch-Hits').should('not.be.visible');
cy.contains('No recent searches').should('be.visible');
});
it('Keyboard Navigation leads to result', () => {
cy.get('.DocSearch-Input').type('get');
cy.get('.DocSearch-Input').type('{downArrow}{downArrow}{upArrow}');
cy.get('.DocSearch-Input').type('{enter}');
cy.url().should('include', '/docs/getalgoliahits');
cy.percySnapshot('result-page-anchor');
});
it('Pointer Navigation leads to result', () => {
cy.get('.DocSearch-Input').type('get');
cy.get('.DocSearch-Hits #docsearch-item-1 > a').click({ force: true });
cy.url().should('include', '/docs/getalgoliahits');
});
it("No Results are displayed if query doesn't match", () => {
cy.get('.DocSearch-Input').type('zzzzz');
cy.contains('No results for "zzzzz"').should('be.visible');
cy.percySnapshot('no-results');
});
});
context('Recent and Favorites', () => {
beforeEach(() => {
cy.visit(Cypress.config().baseUrl!);
cy.get('.DocSearch-Button').click();
cy.get('.DocSearch-Input').type('get');
cy.get('.DocSearch-Hits #docsearch-item-0 > a').click({ force: true });
});
it('Recent search is displayed after visiting a result', () => {
cy.get('.DocSearch-Button').click();
cy.contains('Recent').should('be.visible');
cy.get('#docsearch-item-0').should('be.visible');
cy.percySnapshot('recent-search');
});
it('Recent search can be deleted', () => {
cy.get('.DocSearch-Button').click();
cy.get('#docsearch-item-0')
.find('[title="Remove this search from history"]')
.trigger('click');
cy.contains('No recent searches').should('be.visible');
});
it('Recent search can be favorited', () => {
cy.get('.DocSearch-Button').click();
cy.get('#docsearch-item-0')
.find('[title="Save this search"]')
.trigger('click');
cy.contains('Favorites').should('be.visible');
cy.get('#docsearch-item-0').should('be.visible');
cy.percySnapshot('favorite');
});
it('Favorite can be deleted', () => {
cy.get('.DocSearch-Button').click();
cy.get('#docsearch-item-0')
.find('[title="Save this search"]')
.trigger('click');
cy.wait(2000);
cy.get('#docsearch-item-0')
.find('[title="Remove this search from favorites"]')
.trigger('click');
cy.contains('No recent searches').should('be.visible');
});
});

View file

@ -0,0 +1,123 @@
/// <reference path="../../support/commands.d.ts" />
describe('Screenshots', () => {
before(() => {
cy.exec('yarn cy:clean');
});
beforeEach(() => {
cy.visit(Cypress.config().baseUrl!);
});
const sizes: Cypress.ViewportPreset[] = ['iphone-x', 'ipad-2', 'macbook-11'];
const modes = ['light', 'dark'];
modes.forEach((mode) => {
context(mode, () => {
sizes.forEach((size) => {
context(size, () => {
it('Open Modal', () => {
if (mode === 'dark') {
cy.darkmode();
}
cy.viewport(size);
cy.openModal();
cy.screenshot('modal-opened__' + size + '__' + mode, {
capture: 'viewport',
});
});
it('Close Modal', () => {
if (mode === 'dark') {
cy.darkmode();
}
cy.viewport(size);
cy.closeModal();
cy.screenshot('modal-closed__' + size + '__' + mode, {
capture: 'viewport',
});
});
it('Results after Query', () => {
if (mode === 'dark') {
cy.darkmode();
}
cy.viewport(size);
cy.openModal();
cy.typeQueryMatching();
cy.screenshot('search-results__' + size + '__' + mode, {
capture: 'viewport',
});
});
it('Anchored result page', () => {
cy.viewport(size);
cy.openModal();
cy.typeQueryMatching();
cy.get('.DocSearch-Input').type('{downArrow}{downArrow}{upArrow}');
cy.get('.DocSearch-Input').type('{enter}');
cy.url().should('include', '/docs/getalgoliahits');
cy.screenshot('result-page-anchor__' + size + '__' + mode, {
capture: 'viewport',
});
});
it('No Results', () => {
if (mode === 'dark') {
cy.darkmode();
}
cy.viewport(size);
cy.openModal();
cy.typeQueryNotMatching();
cy.contains('No results for "zzzzz"').should('be.visible');
cy.screenshot('no-results__' + size + '__' + mode, {
capture: 'viewport',
});
});
it('Recent searches', () => {
if (mode === 'dark') {
cy.darkmode();
}
cy.viewport(size);
cy.openModal();
cy.typeQueryMatching();
cy.get('.DocSearch-Hits #docsearch-item-0 > a').click({
force: true,
});
cy.wait(1000);
cy.openModal();
cy.contains('Recent').should('be.visible');
cy.get('#docsearch-item-0').should('be.visible');
cy.screenshot('recent-search__' + size + '__' + mode, {
capture: 'viewport',
});
});
it('Favorites', () => {
if (mode === 'dark') {
cy.darkmode();
}
cy.viewport(size);
cy.openModal();
cy.typeQueryMatching();
cy.get('.DocSearch-Hits #docsearch-item-0 > a').click({
force: true,
});
cy.wait(1000);
cy.openModal();
cy.get('#docsearch-item-0')
.find('[title="Save this search"]')
.trigger('click');
cy.wait(1000);
cy.contains('Favorites').should('be.visible');
cy.get('#docsearch-item-0').should('be.visible');
cy.screenshot('favorite__' + size + '__' + mode, {
capture: 'viewport',
});
});
});
});
});
});
});

6
cypress/plugins/index.js Normal file
View file

@ -0,0 +1,6 @@
/* eslint-disable import/no-commonjs */
const percyHealthCheck = require('@percy/cypress/task');
module.exports = (on) => {
on('task', percyHealthCheck);
};

26
cypress/support/commands.d.ts vendored Normal file
View file

@ -0,0 +1,26 @@
/// <reference types="cypress" />
declare namespace Cypress {
interface Chainable {
/**
* Toggles the dark mode on the preview website.
*/
darkmode(): Chainable<Element>;
/**
* Opens the DocSearch modal.
*/
openModal(): Chainable<Element>;
/**
* Closes the DocSearch modal.
*/
closeModal(): Chainable<Element>;
/**
* Types a query that returns results.
*/
typeQueryMatching(): Chainable<Element>;
/**
* Types a query that returns no results.
*/
typeQueryNotMatching(): Chainable<Element>;
}
}

View file

@ -0,0 +1,24 @@
import '@percy/cypress';
Cypress.Commands.add('darkmode', () => {
cy.get('.react-toggle').click({ force: true });
cy.get('.react-toggle-screenreader-only').blur();
});
Cypress.Commands.add('openModal', () => {
cy.get('.DocSearch-Button').click();
});
Cypress.Commands.add('closeModal', () => {
cy.get('body').type('{esc}');
});
Cypress.Commands.add('typeQueryMatching', () => {
cy.wait(1000);
cy.get('.DocSearch-Input').type('get');
});
Cypress.Commands.add('typeQueryNotMatching', () => {
cy.wait(1000);
cy.get('.DocSearch-Input').type('zzzzz');
});

20
cypress/support/index.ts Normal file
View file

@ -0,0 +1,20 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands';
// Alternatively you can use CommonJS syntax:
// require('./commands')

6
cypress/tsconfig.json Normal file
View file

@ -0,0 +1,6 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"types": ["cypress"]
}
}

1
global.d.ts vendored Normal file
View file

@ -0,0 +1 @@
declare const __DEV__: boolean;

15
jest.config.js Normal file
View file

@ -0,0 +1,15 @@
/* eslint-disable import/no-commonjs */
module.exports = {
rootDir: process.cwd(),
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
testPathIgnorePatterns: ['node_modules/', 'dist/', 'cypress/'],
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
globals: {
__DEV__: true,
__VERSION__: 'version-test',
},
};

5
lerna.json Normal file
View file

@ -0,0 +1,5 @@
{
"packages": ["packages/*"],
"version": "1.0.0-alpha.28",
"npmClient": "yarn"
}

6
netlify.toml Normal file
View file

@ -0,0 +1,6 @@
[build]
command="yarn run website:deploy"
publish="packages/website/build"
[build.environment]
YARN_VERSION = "1.22.4"

112
package.json Normal file
View file

@ -0,0 +1,112 @@
{
"name": "@francoischalifour/autocomplete-monorepo",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"prepare": "yarn run build",
"start": "yarn run dev",
"test": "jest",
"test:size": "bundlesize",
"lint": "eslint --ext .js,.ts,.tsx .",
"storybook": "start-storybook --quiet --port 6006 --ci --static-dir .storybook/static",
"storybook:build": "build-storybook --quiet --output-dir packages/website/build/stories --static-dir .storybook/static",
"build:clean": "lerna run build:clean --scope @francoischalifour/autocomplete-* --scope @docsearch/*",
"build:umd": "lerna run build:umd --scope @francoischalifour/autocomplete-* --scope @docsearch/*",
"build:esm": "lerna run build:esm --scope @francoischalifour/autocomplete-* --scope @docsearch/*",
"build:types": "lerna run build:types --scope @francoischalifour/autocomplete-* --scope @docsearch/*",
"build": "lerna run build --scope @francoischalifour/autocomplete-* --scope @docsearch/*",
"watch": "lerna run watch --parallel --scope @francoischalifour/autocomplete-* --scope @docsearch/*",
"dev": "yarn build && yarn watch-and-storybook",
"watch-and-storybook": "concurrently \"yarn run watch\" \"yarn run storybook\"",
"type-check": "tsc --noEmit",
"website:build": "yarn run doc:build && yarn run build && yarn run storybook:build",
"website:deploy": "yarn run doc:build && yarn run storybook:build",
"release": "shipjs prepare",
"doc:start": "cd packages/website/ && yarn start",
"doc:build": "cd packages/website/ && yarn build",
"doc:deploy": "cd packages/website/ && yarn deploy",
"doc:test": "cd packages/website/ && yarn start --no-open",
"cy:verify": "cypress verify",
"cy:info": "cypress info",
"cy:record": "percy exec -- cypress run --spec 'cypress/integration/**/*' --headless --record",
"cy:run": "start-server-and-test doc:test http://localhost:3000 cy:record",
"cy:run:chrome": "yarn run cy:run --browser chrome",
"cy:run:firefox": "yarn run cy:run --browser firefox",
"cy:run:edge": "yarn run cy:run --browser edge",
"cy:clean": "rm -rf cypress/screenshots",
"docsearch:lint:css": "stylelint packages/docsearch-css/src/**/*.css"
},
"devDependencies": {
"@babel/cli": "7.10.1",
"@babel/plugin-transform-react-jsx": "7.10.1",
"@babel/preset-env": "7.10.2",
"@babel/preset-typescript": "7.10.1",
"@percy/cypress": "2.3.1",
"@rollup/plugin-json": "4.0.2",
"@rollup/plugin-node-resolve": "7.1.1",
"@rollup/plugin-replace": "2.3.1",
"@storybook/html": "5.3.12",
"@storybook/theming": "5.3.12",
"@testing-library/dom": "7.22.3",
"@testing-library/jest-dom": "5.11.3",
"@testing-library/preact": "2.0.0",
"@testing-library/user-event": "12.1.1",
"@types/react": "^16.9.23",
"@types/react-dom": "^16.9.5",
"@typescript-eslint/eslint-plugin": "2.19.0",
"@typescript-eslint/parser": "2.19.0",
"algoliasearch": "4.0.2",
"babel-eslint": "10.0.3",
"babel-loader": "8.0.6",
"babel-plugin-inline-json": "1.2.2",
"babel-plugin-inline-replace-variables": "1.3.1",
"babel-plugin-module-resolver": "4.0.0",
"bundlesize": "0.18.0",
"cssnano": "4.1.10",
"concurrently": "5.1.0",
"cypress": "4.8.0",
"dotenv": "8.2.0",
"eslint": "6.8.0",
"eslint-config-algolia": "15.0.0",
"eslint-config-prettier": "6.10.0",
"eslint-plugin-cypress": "2.11.1",
"eslint-plugin-eslint-comments": "3.1.2",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-jest": "23.6.0",
"eslint-plugin-prettier": "3.1.2",
"eslint-plugin-react": "7.18.3",
"eslint-plugin-react-hooks": "2.3.0",
"instantsearch.js": "4.2.0",
"jest": "25.1.0",
"jest-watch-typeahead": "0.4.2",
"lerna": "3.20.2",
"postcss": "7.0.32",
"prettier": "2.0.5",
"react": "16.13.0",
"react-dom": "16.13.0",
"rollup": "1.31.0",
"rollup-plugin-babel": "4.3.3",
"rollup-plugin-commonjs": "10.1.0",
"rollup-plugin-filesize": "6.2.1",
"rollup-plugin-license": "0.13.0",
"rollup-plugin-terser": "5.2.0",
"shipjs": "0.20.1",
"start-server-and-test": "^1.11.0",
"stylelint": "13.6.1",
"stylelint-a11y": "1.2.3",
"stylelint-config-prettier": "8.0.1",
"stylelint-config-sass-guidelines": "7.0.0",
"stylelint-config-standard": "20.0.0",
"stylelint-no-unsupported-browser-features": "4.0.0",
"stylelint-order": "4.0.0",
"stylelint-prettier": "1.1.2",
"typescript": "3.7.5",
"vue": "2.6.11",
"vue-loader": "15.8.3",
"vue-template-compiler": "2.6.11",
"watch": "1.0.2",
"webpack": "4.41.5"
}
}

10
renovate.json Normal file
View file

@ -0,0 +1,10 @@
{
"extends": ["config:js-lib", "algolia"],
"packageRules": [
{
"packagePatterns": ["^@types"],
"depTypeList": ["devDependencies"],
"rangeStrategy": "replace"
}
]
}

27
rollup.base.config.js Normal file
View file

@ -0,0 +1,27 @@
import json from '@rollup/plugin-json';
import resolve from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import babel from 'rollup-plugin-babel';
import filesize from 'rollup-plugin-filesize';
import { terser } from 'rollup-plugin-terser';
export const plugins = [
replace({
__DEV__: JSON.stringify(process.env.NODE_ENV === 'development'),
__VERSION__: JSON.stringify(process.env.VERSION),
}),
json(),
resolve({
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
}),
babel({
exclude: 'node_modules/**',
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
rootMode: 'upward',
}),
terser(),
filesize({
showMinifiedSize: false,
showGzippedSize: true,
}),
];

View file

@ -0,0 +1,13 @@
import { execSync } from 'child_process';
export function getBundleBanner(pkg) {
const lastCommitHash = execSync('git rev-parse --short HEAD')
.toString()
.trim();
const version = process.env.SHIPJS
? pkg.version
: `${pkg.version} (UNRELEASED ${lastCommitHash})`;
const authors = '© Algolia, Inc. and contributors';
return `/*! ${pkg.name} ${version} | MIT License | ${authors} | ${pkg.homepage} */`;
}

82
ship.config.js Normal file
View file

@ -0,0 +1,82 @@
/* eslint-disable import/no-commonjs */
const fs = require('fs');
const path = require('path');
const packages = [
'packages/autocomplete-core',
'packages/autocomplete-preset-algolia',
'packages/autocomplete-js',
'packages/docsearch-css',
'packages/docsearch-react',
'packages/docsearch-js',
];
module.exports = {
monorepo: {
mainVersionFile: 'lerna.json',
packagesToBump: packages,
packagesToPublish: packages,
},
publishCommand({ tag }) {
return `yarn publish --access public --tag ${tag}`;
},
versionUpdated({ exec, dir, version }) {
const updatePackageDependencies = (...changes) => {
for (const change of changes) {
const { package, dependencies } = change;
exec(
`yarn workspace ${package} add ${dependencies
.map((dep) => `"${dep}"`)
.join(' ')}`
);
}
};
// Ship.js reads JSON and writes with `fs.writeFileSync(JSON.stringify(json, null, 2))`
// which causes a lint error in the `lerna.json` file.
exec('yarn eslint lerna.json --fix');
updatePackageDependencies(
{
package: '@francoischalifour/autocomplete-js',
dependencies: [
`@francoischalifour/autocomplete-core@^${version}`,
`@francoischalifour/autocomplete-preset-algolia@^${version}`,
],
},
{
package: '@docsearch/react',
dependencies: [
`@docsearch/css@^${version}`,
`@francoischalifour/autocomplete-core@^${version}`,
`@francoischalifour/autocomplete-preset-algolia@^${version}`,
],
},
{
package: '@docsearch/js',
dependencies: [`@docsearch/react@^${version}`],
},
{
package: '@francoischalifour/autocomplete-website',
dependencies: [`@docsearch/react@${version}`],
}
);
fs.writeFileSync(
path.resolve(dir, 'packages', 'docsearch-react', 'src', 'version.ts'),
`export const version = '${version}';\n`
);
},
// Skip preparation if it contains only `chore` commits
shouldPrepare: ({ releaseType, commitNumbersPerType }) => {
const { fix = 0 } = commitNumbersPerType;
if (releaseType === 'patch' && fix === 0) {
return false;
}
return true;
},
};

View file

@ -0,0 +1,8 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"noEmit": false,
"declaration": true,
"emitDeclarationOnly": true
}
}

28
tsconfig.json Normal file
View file

@ -0,0 +1,28 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"jsx": "react",
"module": "es2015",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"noImplicitAny": false,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "ESNEXT"
},
"exclude": [
".storybook",
"**/__fixtures__/**/*",
"**/__mocks__/**/*",
"**/__tests__/**/*",
"**/dist",
"**/node_modules",
"website",
"stories",
"examples"
]
}

21105
yarn.lock Normal file

File diff suppressed because it is too large Load diff