-
Notifications
You must be signed in to change notification settings - Fork 530
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: introduce
instantsearch-core
(#6371)
* feat: introduce `instantsearch-core` package * Apply suggestions from code review Co-authored-by: Dhaya <[email protected]> --------- Co-authored-by: Haroen Viaene <[email protected]> Co-authored-by: Dhaya <[email protected]>
- Loading branch information
1 parent
a8b4c8c
commit 2823c40
Showing
28 changed files
with
190 additions
and
36 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
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 @@ | ||
# Change Log |
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 @@ | ||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
||
- [instantsearch-core](#instantsearch-core) | ||
- [Contributing](#contributing) | ||
- [License](#license) | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
# instantsearch-core | ||
|
||
InstantSearch Core is an open-source UI library used by InstantSearch for common utilities and types. | ||
|
||
> Note: `instantsearch-core` exists for internal usage and isn't designed for public consumption. | ||
## Contributing | ||
|
||
We welcome all contributors, from casual to regular 💙 | ||
|
||
- **Bug report**. Is something not working as expected? [Send a bug report][contributing-bugreport]. | ||
- **Feature request**. Would you like to add something to the library? [Send a feature request][contributing-featurerequest]. | ||
- **Documentation**. Did you find a typo in the doc? [Open an issue][contributing-newissue] and we'll take care of it. | ||
- **Development**. If you don't know where to start, you can check the open issues that are [tagged easy][contributing-label-easy], the [bugs][contributing-label-bug] or [chores][contributing-label-chore]. | ||
|
||
To start contributing to code, you need to: | ||
|
||
1. [Fork the project](https://help.github.com/articles/fork-a-repo/) | ||
1. [Clone the repository](https://help.github.com/articles/cloning-a-repository/) | ||
1. Install the dependencies: `yarn` | ||
|
||
Please read [our contribution process](https://github.com/algolia/instantsearch/blob/master/CONTRIBUTING.md) to learn more. | ||
|
||
## License | ||
|
||
InstantSearch Core is [MIT licensed](../../LICENSE). | ||
|
||
<!-- Links --> | ||
|
||
[contributing-bugreport]: https://github.com/algolia/instantsearch/issues/new?template=BUG_REPORT.yml&labels=triage,Library%3A%20InstantSearch+Core | ||
[contributing-featurerequest]: https://github.com/algolia/instantsearch/discussions/new?category=ideas&labels=triage,Library%3A%20InstantSearch+Core&title=Feature%20request%3A%20 | ||
[contributing-newissue]: https://github.com/algolia/instantsearch/issues/new?labels=triage,Library%3A%20InstantSearch+Core | ||
[contributing-label-easy]: https://github.com/algolia/instantsearch/issues?q=is%3Aopen+is%3Aissue+label%3A%22Difficulty%3A+Easy%22+label%3A%22Library%3A%20InstantSearch+Core%22 | ||
[contributing-label-bug]: https://github.com/algolia/instantsearch/issues?q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Bug%22+label%3A%22Library%3A%20InstantSearch+Core%22 | ||
[contributing-label-chore]: https://github.com/algolia/instantsearch/issues?q=is%3Aissue+is%3Aopen+label%3A%22Type%3A+Chore%22+label%3A%22Library%3A%20InstantSearch+Core%22 |
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,57 @@ | ||
{ | ||
"name": "instantsearch-core", | ||
"version": "0.1.0", | ||
"description": "Common utilities and types for InstantSearch.", | ||
"types": "dist/es/index.d.ts", | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/es/index.js", | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"types": "./dist/es/index.d.ts", | ||
"require": "./dist/cjs/index.js", | ||
"default": "./dist/es/index.js" | ||
}, | ||
"./types": { | ||
"types": "./types/index.d.ts", | ||
"require": "./types/index.cjs", | ||
"default": "./types/index.mjs" | ||
} | ||
}, | ||
"sideEffects": false, | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/algolia/instantsearch" | ||
}, | ||
"author": { | ||
"name": "Algolia, Inc.", | ||
"url": "https://www.algolia.com" | ||
}, | ||
"keywords": [ | ||
"algolia", | ||
"components", | ||
"fast", | ||
"instantsearch", | ||
"react", | ||
"search" | ||
], | ||
"files": [ | ||
"README.md", | ||
"dist" | ||
], | ||
"scripts": { | ||
"clean": "rm -rf dist", | ||
"build": "yarn build:cjs && yarn build:es && yarn build:types", | ||
"build:es:base": "BABEL_ENV=es,disableHoisting babel src --root-mode upward --extensions '.js,.ts,.tsx' --out-dir dist/es --ignore '**/__tests__/**/*','**/__mocks__/**/*'", | ||
"build:es": "yarn build:es:base --quiet", | ||
"build:cjs": "BABEL_ENV=cjs,disableHoisting babel src --root-mode upward --extensions '.js,.ts,.tsx' --out-dir dist/cjs --ignore '**/__tests__/**/*','**/__mocks__/**/*' --quiet && ../../scripts/prepare-cjs.sh", | ||
"build:types": "tsc -p ./tsconfig.declaration.json --outDir ./dist/es", | ||
"version": "./scripts/version.cjs", | ||
"watch:es": "yarn --silent build:es:base --watch" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.1.2", | ||
"algoliasearch-helper": "3.22.5" | ||
} | ||
} |
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,11 @@ | ||
#!/usr/bin/env node | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const version = require('../package.json').version; | ||
|
||
fs.writeFileSync( | ||
path.resolve(__dirname, '../src/version.ts'), | ||
`export default '${version}';\n` | ||
); |
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,3 @@ | ||
import version from './version'; | ||
|
||
export { version }; |
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 @@ | ||
export default '0.1.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,3 @@ | ||
{ | ||
"extends": "../../tsconfig.declaration" | ||
} |
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,3 @@ | ||
export type * from 'algoliasearch-helper/types/algoliasearch.d.ts'; | ||
|
||
export {}; |
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,3 @@ | ||
// This file exists to ensure when someone imports `instantsearch-core/types`, | ||
// a file exists to be resolved. Normally, this will never be used. | ||
module.exports = {}; |
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,4 @@ | ||
export type * from './algoliasearch.d.ts'; | ||
export type * from './insights.d.ts'; | ||
export type * from './results.d.ts'; | ||
export type * from './utils.d.ts'; |
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,3 @@ | ||
// This file exists to ensure when someone imports `instantsearch-core/types`, | ||
// a file exists to be resolved. Normally, this will never be used. | ||
export {}; |
2 changes: 1 addition & 1 deletion
2
...es/instantsearch.js/src/types/insights.ts → ...es/instantsearch-core/types/insights.d.ts
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
2 changes: 1 addition & 1 deletion
2
...ges/instantsearch.js/src/types/results.ts → ...ges/instantsearch-core/types/results.d.ts
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,24 +1,19 @@ | ||
// internal | ||
export * from './utils'; | ||
|
||
// Algolia-related | ||
// eslint-disable-next-line import/export | ||
export * from './algoliasearch'; | ||
export * from './results'; | ||
export type * from 'instantsearch-core/types'; | ||
|
||
// component-related | ||
export * from './component'; | ||
export type * from './component'; | ||
|
||
// instantsearch-related | ||
export * from './instantsearch'; | ||
export * from './middleware'; | ||
export * from './router'; | ||
export * from './insights'; | ||
export type * from './instantsearch'; | ||
export type * from './middleware'; | ||
export type * from './router'; | ||
|
||
// widget-related | ||
export * from './connector'; | ||
export * from './widget-factory'; | ||
export * from './widget'; | ||
export * from './ui-state'; | ||
export * from './render-state'; | ||
export * from './templates'; | ||
export type * from './connector'; | ||
export type * from './widget-factory'; | ||
export type * from './widget'; | ||
export type * from './ui-state'; | ||
export type * from './render-state'; | ||
export type * from './templates'; | ||
|
||
export {}; |
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