docsearch.js
Advanced tools
Comparing version 2.6.3 to 3.0.0-beta.0
101
package.json
{ | ||
"name": "docsearch.js", | ||
"version": "2.6.3", | ||
"description": "Add an autocomplete dropdown to your documentation", | ||
"main": "dist/npm/index.js", | ||
"scripts": { | ||
"build": "./scripts/build", | ||
"build:css": "./scripts/build-css", | ||
"build:js": "./scripts/build-js", | ||
"docs:build": "cd ./docs && yarn build", | ||
"docs:serve": "cd ./docs && yarn serve", | ||
"docs:deploy": "cd ./docs && yarn deploy", | ||
"doctoc": "doctoc --maxlevel 3 README.md CONTRIBUTING.md", | ||
"lint": "./scripts/lint", | ||
"format:scss": "prettier --write ./src/**/*.scss", | ||
"format:md": "prettier --write '**/*.md'", | ||
"release": "./scripts/release", | ||
"serve": "./scripts/serve", | ||
"test": "./scripts/test", | ||
"test:watch": "./scripts/test-watch" | ||
"version": "3.0.0-beta.0", | ||
"license": "MIT", | ||
"homepage": "https://community.algolia.com/docsearch/", | ||
"repository": "algolia/docsearch", | ||
"author": { | ||
"name": "Algolia, Inc.", | ||
"url": "https://www.algolia.com" | ||
}, | ||
@@ -25,62 +14,24 @@ "files": [ | ||
], | ||
"author": "Algolia <support@algolia.com> (https://github.com/algolia/)", | ||
"license": "MIT", | ||
"repository": "algolia/docsearch", | ||
"renovate": { | ||
"extends": [ | ||
"config:library", | ||
"schedule:weekends", | ||
":automergeMinor", | ||
":automergeBranchPush", | ||
":semanticCommits", | ||
":rebaseStalePrs", | ||
":timezone(Europe/Paris)" | ||
] | ||
"source": "src/index.ts", | ||
"module": "dist/es/index.js", | ||
"main": "dist/umd/index.js", | ||
"umd:main": "dist/umd/index.js", | ||
"unpkg": "dist/umd/index.js", | ||
"jsdelivr": "dist/umd/index.js", | ||
"sideEffects": false, | ||
"scripts": { | ||
"build:umd": "rollup --config", | ||
"build:es": "babel src --root-mode upward --extensions '.js,.ts,.tsx' --ignore '**/__tests__/**/*','**/__mocks__/**/*','**/__fixtures__/**/*' --out-dir dist/es --quiet", | ||
"build:prepare": "yarn run build:es", | ||
"build:types": "tsc --emitDeclarationOnly", | ||
"build": "yarn run build:umd && yarn run build:es && yarn run build:types", | ||
"watch": "babel src --root-mode upward --extensions '.js,.ts,.tsx' --ignore '**/__tests__/**/*','**/__mocks__/**/*','**/__fixtures__/**/*' --out-dir dist/es --quiet --watch", | ||
"type-check": "tsc --noEmit" | ||
}, | ||
"devDependencies": { | ||
"autoprefixer": "9.1.1", | ||
"babel-cli": "6.26.0", | ||
"babel-core": "6.26.3", | ||
"babel-eslint": "8.2.6", | ||
"babel-istanbul": "0.12.2", | ||
"babel-jest": "23.6.0", | ||
"babel-loader": "7.1.5", | ||
"babel-plugin-rewire": "1.2.0", | ||
"babel-preset-env": "1.7.0", | ||
"babel-preset-stage-3": "6.24.1", | ||
"conventional-changelog-cli": "2.0.21", | ||
"cssnano": "4.1.10", | ||
"eslint": "5.4.0", | ||
"eslint-config-algolia": "13.3.0", | ||
"eslint-config-prettier": "4.2.0", | ||
"eslint-plugin-import": "2.17.2", | ||
"eslint-plugin-jest": "22.5.1", | ||
"eslint-plugin-prettier": "2.7.0", | ||
"jest": "23.6.0", | ||
"jsdom": "11.12.0", | ||
"json": "9.0.6", | ||
"live-server": "1.2.1", | ||
"mversion": "1.13.0", | ||
"node-sass": "4.12.0", | ||
"onchange": "4.1.0", | ||
"parallelshell": "3.0.2", | ||
"postcss-cli": "6.1.2", | ||
"prettier": "1.17.0", | ||
"pretty-bytes-cli": "2.0.0", | ||
"semver": "6.0.0", | ||
"sinon": "7.3.2", | ||
"uglify-js": "3.5.11", | ||
"webpack": "3.12.0", | ||
"webpack-cli": "3.3.2" | ||
}, | ||
"peerDependencies": {}, | ||
"dependencies": { | ||
"algoliasearch": "^3.24.5", | ||
"autocomplete.js": "0.36.0", | ||
"hogan.js": "^3.0.2", | ||
"request": "^2.87.0", | ||
"stack-utils": "^1.0.1", | ||
"to-factory": "^1.0.0", | ||
"zepto": "^1.2.0" | ||
"docsearch-core": "3.0.0-beta.0", | ||
"docsearch-renderer-downshift": "3.0.0-beta.0", | ||
"docsearch-types": "3.0.0-beta.0", | ||
"preact": "^8.4.2" | ||
} | ||
} |
@@ -1,51 +0,65 @@ | ||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* | ||
# DocSearch.js | ||
- [Related projects](#related-projects) | ||
Library that packages DocSearch in a single function. | ||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
## Installation | ||
[![DocSearch][1]][8] | ||
```sh | ||
npm install docsearch.js | ||
# or | ||
yarn add docsearch.js | ||
``` | ||
The easiest way to add search to your documentation. For free. | ||
## Usage | ||
[![npm version][2]](https://npmjs.org/package/docsearch.js) | ||
[![build][3]](https://travis-ci.org/algolia/docsearch) | ||
[![coverage][4]](https://coveralls.io/github/algolia/docsearch) | ||
[![License][5]](./LICENSE) | ||
[![Downloads][6]](https://npm-stat.com/charts.html?package=docsearch.js) | ||
[![jsDelivr Hits][7]](https://www.jsdelivr.com/package/npm/docsearch.js) | ||
```ts | ||
docsearch({ | ||
indexName: 'YOUR_INDEX_NAME', | ||
apiKey: 'YOUR_API_KEY', | ||
container: 'input[type="search"]', | ||
}); | ||
``` | ||
DocSearch will crawl your documentation website, push its content to an Algolia | ||
index, and allow you to add a dropdown search menu for your users to find | ||
relevant content in no time. | ||
## API | ||
Check out our [website][8] for a complete explanation and documentation. | ||
### `docsearch(options)` | ||
[![Bootstrap demo][9]][8] | ||
```ts | ||
docsearch({ | ||
container, | ||
placeholder, | ||
stalledSearchDelay, | ||
onItemSelect, | ||
onItemHighlight, | ||
}: DocSearchOptions); | ||
## Related projects | ||
DocSearch is made of 3 repositories: | ||
- [algolia/docsearch][10] contains the `docsearch.js` code source and the | ||
documentation website. | ||
- [algolia/docsearch-configs][11] contains the JSON files representing all the | ||
configs for all the documentations DocSearch is powering | ||
- [algolia/docsearch-scraper][12] contains the crawler we use to extract data | ||
from your documentation. The code is open-source and you can run it from | ||
a Docker image | ||
[1]: ./.github/docsearch-logo.svg | ||
[2]: https://img.shields.io/npm/v/docsearch.js.svg?style=flat-square | ||
[3]: https://img.shields.io/travis/algolia/docsearch/master.svg?style=flat-square | ||
[4]: https://img.shields.io/coveralls/algolia/docsearch/master.svg?style=flat-square | ||
[5]: https://img.shields.io/badge/license-MIT-green.svg?style=flat-square | ||
[6]: https://img.shields.io/npm/dm/docsearch.js.svg?style=flat-square | ||
[7]: https://data.jsdelivr.com/v1/package/npm/docsearch.js/badge | ||
[8]: https://community.algolia.com/docsearch/ | ||
[9]: ./.github/demo.gif | ||
[10]: https://github.com/algolia/docsearch | ||
[11]: https://github.com/algolia/docsearch-configs | ||
[12]: https://github.com/algolia/docsearch-scraper | ||
interface DocSearchOptions extends DocSearchCoreOptions { | ||
/** | ||
* The container of the search box. | ||
*/ | ||
container: HTMLElement | string; | ||
/** | ||
* The text that appears in the search box input when there is | ||
* no query. | ||
* | ||
* @default `"Search"` | ||
*/ | ||
placeholder?: string; | ||
/** | ||
* The number of milliseconds before the search is considered | ||
* as stalled | ||
* | ||
* @default `300` | ||
*/ | ||
stalledSearchDelay?: number; | ||
/** | ||
* Function called when the user highlights an item. | ||
* Highlighting happens on hover and on keyboard navigation. | ||
*/ | ||
onItemHighlight?({ hit }: { hit: DocSearchHit }): void; | ||
/** | ||
* Function called when the user selects an item. | ||
*/ | ||
onItemSelect?({ hit }: { hit: DocSearchHit }): void; | ||
} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
4
0
20927
66
1
2
4879
4
35
+ Addeddocsearch-core@3.0.0-beta.0
+ Addeddocsearch-types@3.0.0-beta.0
+ Addedpreact@^8.4.2
+ Addedpreact@8.5.3(transitive)
- Removedalgoliasearch@^3.24.5
- Removedautocomplete.js@0.36.0
- Removedhogan.js@^3.0.2
- Removedrequest@^2.87.0
- Removedstack-utils@^1.0.1
- Removedto-factory@^1.0.0
- Removedzepto@^1.2.0
- Removedabbrev@1.1.1(transitive)
- Removedagentkeepalive@2.2.0(transitive)
- Removedajv@6.12.6(transitive)
- Removedalgoliasearch@3.35.1(transitive)
- Removedasn1@0.2.6(transitive)
- Removedassert-plus@1.0.0(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedautocomplete.js@0.36.0(transitive)
- Removedaws-sign2@0.7.0(transitive)
- Removedaws4@1.13.2(transitive)
- Removedbcrypt-pbkdf@1.0.2(transitive)
- Removedcaseless@0.12.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcore-util-is@1.0.2(transitive)
- Removeddashdash@1.14.1(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removeddom-walk@0.1.2(transitive)
- Removedecc-jsbn@0.1.2(transitive)
- Removedenvify@4.1.0(transitive)
- Removedes6-promise@4.2.8(transitive)
- Removedescape-string-regexp@2.0.0(transitive)
- Removedesprima@4.0.1(transitive)
- Removedevents@1.1.1(transitive)
- Removedextend@3.0.2(transitive)
- Removedextsprintf@1.3.0(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedforeach@2.0.6(transitive)
- Removedforever-agent@0.6.1(transitive)
- Removedform-data@2.3.3(transitive)
- Removedgetpass@0.1.7(transitive)
- Removedglobal@4.4.0(transitive)
- Removedhar-schema@2.0.0(transitive)
- Removedhar-validator@5.1.5(transitive)
- Removedhogan.js@3.0.2(transitive)
- Removedhttp-signature@1.2.0(transitive)
- Removedimmediate@3.3.0(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedisarray@2.0.5(transitive)
- Removedisstream@0.1.2(transitive)
- Removedjsbn@0.1.1(transitive)
- Removedjson-schema@0.4.0(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedjsprim@1.4.2(transitive)
- Removedload-script@1.0.0(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedmin-document@2.19.0(transitive)
- Removedmkdirp@0.3.0(transitive)
- Removedms@2.0.0(transitive)
- Removednopt@1.0.10(transitive)
- Removedoauth-sign@0.9.0(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedperformance-now@2.1.0(transitive)
- Removedprocess@0.11.10(transitive)
- Removedpsl@1.15.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedqs@6.5.3(transitive)
- Removedquerystring-es3@0.2.1(transitive)
- Removedreduce@1.0.3(transitive)
- Removedrequest@2.88.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsemver@5.7.2(transitive)
- Removedsshpk@1.18.0(transitive)
- Removedstack-utils@1.0.5(transitive)
- Removedthrough@2.3.8(transitive)
- Removedto-factory@1.0.0(transitive)
- Removedtough-cookie@2.5.0(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedtweetnacl@0.14.5(transitive)
- Removeduri-js@4.4.1(transitive)
- Removeduuid@3.4.0(transitive)
- Removedverror@1.10.0(transitive)
- Removedzepto@1.2.0(transitive)