This repository has been archived by the owner on Jun 11, 2021. It is now read-only.
forked from algolia/autocomplete
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docsearch): add DocSearch for Docusaurus (#39)
Co-authored-by: eunjae-lee <[email protected]> Co-authored-by: Shipow <[email protected]>
- Loading branch information
1 parent
b446194
commit ad63053
Showing
59 changed files
with
1,990 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* 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: [['@babel/plugin-transform-react-jsx']], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "docsearch-react", | ||
"version": "1.0.0-alpha.10", | ||
"license": "MIT", | ||
"homepage": "https://github.com/algolia/autocomplete.js", | ||
"repository": "algolia/autocomplete.js", | ||
"author": { | ||
"name": "Algolia, Inc.", | ||
"url": "https://www.algolia.com" | ||
}, | ||
"sideEffects": false, | ||
"files": [ | ||
"dist/" | ||
], | ||
"source": "src/index.ts", | ||
"types": "dist/esm/index.d.ts", | ||
"module": "dist/esm/index.js", | ||
"main": "dist/umd/index.js", | ||
"umd:main": "dist/umd/index.js", | ||
"unpkg": "dist/umd/index.js", | ||
"jsdelivr": "dist/umd/index.js", | ||
"scripts": { | ||
"build": "yarn build:clean && yarn build:umd && yarn build:esm && yarn build:css", | ||
"": "// TODO: have a proper build:css, probably including autoprefixer?", | ||
"build:css": "cp src/style.css dist/esm/ && cp src/style.css dist/umd/", | ||
"build:css:watch": "chokidar src/style.css --command \"yarn build:css\"", | ||
"build:esm": "babel src --root-mode upward --extensions '.ts,.tsx' --out-dir dist/esm", | ||
"build:esm:watch": "yarn build:esm --watch", | ||
"build:umd": "rollup --config", | ||
"build:types": "tsc -p ./tsconfig.declaration.json --outDir ./dist/esm", | ||
"build:types:watch": "chokidar \"**/*.ts\" \"**/*.tsx\" --command \"yarn build:types\" --ignore \"dist\"", | ||
"build:clean": "rm -rf ./dist", | ||
"watch": "concurrently \"yarn build:esm:watch\" \"yarn build:types:watch\" \"yarn build:css:watch\"" | ||
}, | ||
"dependencies": { | ||
"@francoischalifour/autocomplete-core": "^1.0.0-alpha.10", | ||
"@francoischalifour/autocomplete-preset-algolia": "^1.0.0-alpha.10", | ||
"algoliasearch": "^4.0.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.8.0", | ||
"react-dom": "^16.8.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import json from '@rollup/plugin-json'; | ||
|
||
import { name } from './package.json'; | ||
import { sharedPlugins } from '../autocomplete-core/rollup.config'; | ||
|
||
export default { | ||
input: 'src/index.ts', | ||
external: ['react', 'react-dom'], | ||
output: { | ||
file: 'dist/umd/index.js', | ||
format: 'umd', | ||
sourcemap: true, | ||
name, | ||
globals: { | ||
react: 'React', | ||
'react-dom': 'ReactDOM', | ||
}, | ||
}, | ||
plugins: [json(), ...sharedPlugins], | ||
}; |
Oops, something went wrong.