├── .circleci └── config.yml ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ └── release.yml ├── .gitignore ├── .nvmrc ├── .prettierrc ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── docs ├── custom-templates.md └── deploy.md ├── e2e ├── __image_snapshots__ │ ├── angular-instantsearch │ │ └── src │ │ │ ├── favicon.ico-snap.png │ │ │ └── favicon.png-snap.png │ ├── autocomplete.js-0.x │ │ └── favicon.png-snap.png │ ├── autocomplete.js │ │ └── favicon.png-snap.png │ ├── autocomplete │ │ ├── assets │ │ │ ├── adaptive-icon.png-snap.png │ │ │ ├── favicon.png-snap.png │ │ │ ├── icon.png-snap.png │ │ │ └── splash.png-snap.png │ │ └── favicon.png-snap.png │ ├── instantsearch-android │ │ └── app │ │ │ └── src │ │ │ └── main │ │ │ └── res │ │ │ ├── drawable │ │ │ └── product_placeholder.png-snap.png │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png-snap.png │ │ │ └── ic_launcher_round.png-snap.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png-snap.png │ │ │ └── ic_launcher_round.png-snap.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png-snap.png │ │ │ └── ic_launcher_round.png-snap.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png-snap.png │ │ │ └── ic_launcher_round.png-snap.png │ │ │ └── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png-snap.png │ │ │ └── ic_launcher_round.png-snap.png │ ├── instantsearch.js-2.x │ │ └── favicon.png-snap.png │ ├── instantsearch.js │ │ └── favicon.png-snap.png │ ├── javascript-client │ │ └── favicon.png-snap.png │ ├── javascript-helper-2.x │ │ └── favicon.png-snap.png │ ├── javascript-helper │ │ └── favicon.png-snap.png │ ├── react-instantsearch-hooks-native │ │ └── assets │ │ │ ├── adaptive-icon.png-snap.png │ │ │ ├── favicon.png-snap.png │ │ │ ├── icon.png-snap.png │ │ │ └── splash.png-snap.png │ ├── react-instantsearch-hooks │ │ └── favicon.png-snap.png │ ├── react-instantsearch │ │ └── public │ │ │ └── favicon.png-snap.png │ ├── vue-instantsearch-1.x │ │ ├── favicon.png-snap.png │ │ └── public │ │ │ └── favicon.png-snap.png │ ├── vue-instantsearch-2.x │ │ └── public │ │ │ └── favicon.png-snap.png │ ├── vue-instantsearch-vue3 │ │ └── public │ │ │ └── favicon.png-snap.png │ └── vue-instantsearch │ │ ├── favicon.png-snap.png │ │ └── public │ │ ├── favicon.ico-snap.png │ │ └── favicon.png-snap.png ├── __snapshots__ │ └── templates.test.js.snap ├── installs.test.js └── templates.test.js ├── index.js ├── jest.config.js ├── package.json ├── preview.png ├── renovate.json ├── scripts ├── build-app.js └── release-templates.js ├── ship.config.js ├── src ├── api │ ├── __tests__ │ │ ├── __snapshots__ │ │ │ └── index.test.js.snap │ │ ├── index.test.js │ │ └── resolve-template.test.js │ ├── check-config.js │ ├── index.js │ └── resolve-template.js ├── cli │ ├── __tests__ │ │ ├── getAnswersDefaultValues.js │ │ ├── getAttributesFromIndex.test.js │ │ ├── getConfiguration.test.js │ │ ├── getFacetsFromIndex.test.js │ │ ├── getInformationFromIndex.js │ │ ├── isQuestionAsked.test.js │ │ └── postProcessAnswers.js │ ├── getAnswersDefaultValues.js │ ├── getAttributesFromIndex.js │ ├── getConfiguration.js │ ├── getFacetsFromIndex.js │ ├── getInformationFromIndex.js │ ├── index.js │ ├── isQuestionAsked.js │ └── postProcessAnswers.js ├── tasks │ ├── android │ │ └── teardown.js │ ├── common │ │ ├── build.js │ │ └── clean.js │ ├── ios │ │ ├── install.js │ │ ├── setup.js │ │ └── teardown.js │ └── node │ │ ├── install.js │ │ └── teardown.js ├── templates │ ├── Angular InstantSearch │ │ ├── .browserslistrc │ │ ├── .editorconfig │ │ ├── .gitignore.template │ │ ├── .template.js │ │ ├── README.md │ │ ├── angular.json │ │ ├── karma.conf.js │ │ ├── package.json │ │ ├── src │ │ │ ├── app │ │ │ │ ├── app.component.css │ │ │ │ ├── app.component.html.hbs │ │ │ │ ├── app.component.ts │ │ │ │ └── app.module.ts │ │ │ ├── assets │ │ │ │ └── .gitkeep │ │ │ ├── environments │ │ │ │ ├── environment.prod.ts │ │ │ │ └── environment.ts │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ ├── main.ts │ │ │ ├── polyfills.ts │ │ │ ├── styles.css │ │ │ └── test.ts │ │ ├── tsconfig.app.json │ │ ├── tsconfig.json │ │ └── tsconfig.spec.json │ ├── Autocomplete.js 0 │ │ ├── .editorconfig │ │ ├── .eslintignore │ │ ├── .eslintrc.js │ │ ├── .gitignore.template │ │ ├── .prettierrc │ │ ├── .template.js │ │ ├── README.md │ │ ├── favicon.png │ │ ├── index.html.hbs │ │ ├── manifest.webmanifest │ │ ├── package.json │ │ └── src │ │ │ ├── app.css │ │ │ ├── app.js.hbs │ │ │ └── index.css │ ├── Autocomplete │ │ ├── .editorconfig │ │ ├── .eslintignore │ │ ├── .eslintrc.js │ │ ├── .gitignore.template │ │ ├── .prettierrc │ │ ├── .template.js │ │ ├── README.md │ │ ├── app.js.hbs │ │ ├── favicon.png │ │ ├── index.html.hbs │ │ ├── manifest.webmanifest │ │ ├── package.json │ │ └── style.css │ ├── InstantSearch Android │ │ ├── .gitignore.template │ │ ├── .template.js │ │ ├── app │ │ │ ├── .gitignore.template │ │ │ ├── build.gradle │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ ├── androidTest │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── instantsearch │ │ │ │ │ └── app │ │ │ │ │ └── ExampleInstrumentedTest.java │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── instantsearch │ │ │ │ │ └── app │ │ │ │ │ └── MainActivity.java │ │ │ │ └── res │ │ │ │ ├── layout │ │ │ │ ├── activity_main.xml │ │ │ │ └── hits_item.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── settings.gradle │ ├── InstantSearch iOS │ │ ├── .gitignore.template │ │ ├── .template.js │ │ ├── App.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ ├── App.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── App │ │ │ ├── AppDelegate.swift │ │ │ ├── Assets.xcassets │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ ├── Base.lproj │ │ │ │ ├── LaunchScreen.storyboard │ │ │ │ └── Main.storyboard │ │ │ ├── Info.plist │ │ │ └── ViewController.swift │ │ └── Podfile │ ├── InstantSearch.js 2 │ │ ├── .editorconfig │ │ ├── .eslintignore │ │ ├── .eslintrc.js │ │ ├── .gitignore.template │ │ ├── .prettierrc │ │ ├── .template.js │ │ ├── README.md │ │ ├── favicon.png │ │ ├── index.html.hbs │ │ ├── manifest.webmanifest │ │ ├── package.json │ │ └── src │ │ │ ├── app.css │ │ │ ├── app.js.hbs │ │ │ └── index.css │ ├── InstantSearch.js widget │ │ ├── .eslintignore │ │ ├── .eslintrc.cjs │ │ ├── .gitignore.template │ │ ├── .prettierrc │ │ ├── .template.js │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.md.hbs │ │ ├── README.md │ │ ├── babel.config.cjs │ │ ├── config │ │ │ └── api-extractor.json │ │ ├── example │ │ │ ├── index.css │ │ │ ├── index.html │ │ │ └── index.ts.hbs │ │ ├── package.json.hbs │ │ ├── src │ │ │ ├── connector.ts.hbs │ │ │ ├── index.ts.hbs │ │ │ ├── renderer.ts.hbs │ │ │ ├── types.ts.hbs │ │ │ └── widget.ts.hbs │ │ ├── tsconfig.declaration.json │ │ ├── tsconfig.json │ │ └── vite.config.js │ ├── InstantSearch.js │ │ ├── .editorconfig │ │ ├── .eslintignore │ │ ├── .eslintrc.js │ │ ├── .gitignore.template │ │ ├── .prettierrc │ │ ├── .template.js │ │ ├── README.md │ │ ├── favicon.png │ │ ├── index.html.hbs │ │ ├── package.json │ │ ├── src │ │ │ ├── app.css │ │ │ ├── app.js.hbs │ │ │ ├── global.d.ts.hbs │ │ │ └── index.css │ │ └── tsconfig.json │ ├── JavaScript Client │ │ ├── .editorconfig │ │ ├── .eslintignore │ │ ├── .eslintrc.js │ │ ├── .gitignore.template │ │ ├── .prettierrc │ │ ├── .template.js │ │ ├── README.md │ │ ├── favicon.png │ │ ├── index.html.hbs │ │ ├── manifest.webmanifest │ │ ├── package.json │ │ └── src │ │ │ ├── app.css │ │ │ ├── app.js.hbs │ │ │ └── index.css │ ├── JavaScript Helper 2 │ │ ├── .editorconfig │ │ ├── .eslintignore │ │ ├── .eslintrc.js │ │ ├── .gitignore.template │ │ ├── .prettierrc │ │ ├── .template.js │ │ ├── README.md │ │ ├── favicon.png │ │ ├── index.html.hbs │ │ ├── manifest.webmanifest │ │ ├── package.json │ │ └── src │ │ │ ├── app.css │ │ │ ├── app.js.hbs │ │ │ └── index.css │ ├── JavaScript Helper │ │ ├── .editorconfig │ │ ├── .eslintignore │ │ ├── .eslintrc.js │ │ ├── .gitignore.template │ │ ├── .prettierrc │ │ ├── .template.js │ │ ├── README.md │ │ ├── favicon.png │ │ ├── index.html.hbs │ │ ├── manifest.webmanifest │ │ ├── package.json │ │ └── src │ │ │ ├── app.css │ │ │ ├── app.js.hbs │ │ │ └── index.css │ ├── React InstantSearch Hooks Native │ │ ├── .expo-shared │ │ │ └── assets.json │ │ ├── .gitignore.template │ │ ├── .template.js │ │ ├── App.tsx.hbs │ │ ├── README.md │ │ ├── app.json │ │ ├── assets │ │ │ ├── adaptive-icon.png │ │ │ ├── favicon.png │ │ │ ├── icon.png │ │ │ └── splash.png │ │ ├── babel.config.js │ │ ├── package.json │ │ ├── src │ │ │ ├── Highlight.tsx │ │ │ ├── InfiniteHits.tsx │ │ │ └── SearchBox.tsx.hbs │ │ ├── tsconfig.json │ │ └── types │ │ │ └── ProductHit.ts │ ├── React InstantSearch Hooks │ │ ├── .editorconfig │ │ ├── .gitignore.template │ │ ├── .prettierrc │ │ ├── .template.js │ │ ├── README.md │ │ ├── favicon.png │ │ ├── index.html │ │ ├── package.json │ │ └── src │ │ │ ├── App.css │ │ │ ├── App.tsx.hbs │ │ │ ├── Panel.tsx │ │ │ └── index.tsx │ ├── React InstantSearch Native │ │ ├── .editorconfig │ │ ├── .eslintrc.js │ │ ├── .gitignore.template │ │ ├── .prettierrc │ │ ├── .template.js │ │ ├── .watchmanconfig │ │ ├── App.js.hbs │ │ ├── README.md │ │ ├── app.json │ │ ├── babel.config.js │ │ ├── package.json │ │ └── src │ │ │ ├── Highlight.js │ │ │ ├── InfiniteHits.js.hbs │ │ │ └── SearchBox.js.hbs │ ├── React InstantSearch widget │ │ ├── .eslintignore │ │ ├── .eslintrc.cjs │ │ ├── .gitignore │ │ ├── .prettierrc │ │ ├── .template.js │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.md.hbs │ │ ├── README.md │ │ ├── babel.config.cjs │ │ ├── example │ │ │ ├── index.html.hbs │ │ │ └── index.tsx.hbs │ │ ├── package.json.hbs │ │ ├── src │ │ │ ├── index.tsx.hbs │ │ │ ├── lib │ │ │ │ ├── __tests__ │ │ │ │ │ └── dummy-test.tsx.hbs │ │ │ │ ├── component.tsx.hbs │ │ │ │ ├── connector.ts.hbs │ │ │ │ └── widget.tsx.hbs │ │ │ └── types │ │ │ │ └── connector.ts │ │ ├── tsconfig.declaration.json │ │ ├── tsconfig.json │ │ └── vite.config.ts │ ├── React InstantSearch │ │ ├── .editorconfig │ │ ├── .eslintrc.js │ │ ├── .gitignore.template │ │ ├── .prettierrc │ │ ├── .template.js │ │ ├── README.md │ │ ├── package.json │ │ ├── public │ │ │ ├── favicon.png │ │ │ ├── index.html │ │ │ └── manifest.json │ │ └── src │ │ │ ├── App.css │ │ │ ├── App.js.hbs │ │ │ ├── index.css │ │ │ └── index.js │ ├── Vue InstantSearch 1 │ │ ├── .editorconfig │ │ ├── .eslintrc.js │ │ ├── .gitignore.template │ │ ├── .prettierrc │ │ ├── .template.js │ │ ├── README.md │ │ ├── babel.config.js │ │ ├── package.json │ │ ├── public │ │ │ ├── favicon.png │ │ │ └── index.html │ │ └── src │ │ │ ├── App.vue │ │ │ └── main.js │ ├── Vue InstantSearch 2 │ │ ├── .editorconfig │ │ ├── .eslintrc.js │ │ ├── .gitignore.template │ │ ├── .prettierrc │ │ ├── .template.js │ │ ├── README.md │ │ ├── babel.config.js │ │ ├── package.json │ │ ├── public │ │ │ ├── favicon.png │ │ │ └── index.html │ │ └── src │ │ │ ├── App.vue │ │ │ └── main.js │ ├── Vue InstantSearch with Vue 3 │ │ ├── .editorconfig │ │ ├── .gitignore.template │ │ ├── .prettierrc │ │ ├── .template.js │ │ ├── README.md │ │ ├── index.html │ │ ├── package.json │ │ ├── public │ │ │ └── favicon.png │ │ ├── src │ │ │ ├── App.vue │ │ │ └── main.js │ │ └── vite.config.js │ └── Vue InstantSearch │ │ ├── .editorconfig │ │ ├── .eslintrc.js │ │ ├── .gitignore.template │ │ ├── .prettierrc │ │ ├── .template.js │ │ ├── README.md │ │ ├── babel.config.js │ │ ├── package.json │ │ ├── public │ │ ├── favicon.png │ │ └── index.html │ │ └── src │ │ ├── App.vue │ │ └── main.js └── utils │ ├── __tests__ │ ├── __snapshots__ │ │ └── index.test.js.snap │ └── index.test.js │ └── index.js └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | **/node_modules/** 2 | /src/templates 3 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['algolia', 'algolia/jest'], 3 | rules: { 4 | 'import/no-commonjs': 'off', 5 | 'no-console': 'off', 6 | 'no-process-exit': 'off', 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Did something not work? 4 | --- 5 | 6 | ## Bug description 7 | 8 | > A clear and concise description of what the bug is. 9 | 10 | ## How to reproduce 11 | 12 | > A list of the steps to reproduce the bug. 13 | 14 | 1. Run command: `...` 15 | 2. Select '...' 16 | 3. See error 17 | 18 | ## Expected behavior 19 | 20 | > A clear and concise description of what you expected to happen. 21 | 22 | ## Screenshots 23 | 24 | > If applicable, add screenshots to help explain your problem. 25 | 26 | ## Environment 27 | 28 | - OS: name / version 29 | - Create InstantSearch App version: 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Would you like to add something? 4 | --- 5 | 6 | ## The problem 7 | 8 | > A concise description of why you want a new feature. 9 | 10 | ## Solution 11 | 12 | > A clear description of what you want to happen. 13 | 14 | ## Implementation 15 | 16 | > Do you have an idea how it could be implemented? 17 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release-templates 2 | 3 | on: 4 | push: 5 | tags: 6 | - '*' 7 | 8 | jobs: 9 | release: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v3 13 | 14 | - uses: actions/setup-node@v2 15 | with: 16 | node-version: '14' 17 | 18 | - name: 📦 install dependencies 19 | run: yarn install 20 | 21 | - name: 🔧 build templates 22 | run: yarn release-templates 23 | 24 | - name: 🚀 push templates 25 | run: | 26 | cd build 27 | UNCOMMITTED_CHANGES=`git status --porcelain` 28 | if [ ! -z "$UNCOMMITTED_CHANGES" ]; then 29 | git config --global user.name "InstantSearch" 30 | git config --global user.email "66688561+instantsearch-bot@users.noreply.github.com" 31 | git commit -a -m "feat(template): Update templates" 32 | git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY 33 | git push origin templates 34 | echo "✅ Templates have been compiled to the branch templates." 35 | else 36 | echo "ℹ️ No changes made to the templates." 37 | fi 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # dependencies 2 | node_modules 3 | 4 | # misc 5 | .DS_Store 6 | .vscode 7 | .env 8 | .env.local 9 | .env.development.local 10 | .env.test.local 11 | .env.production.local 12 | 13 | npm-debug.log* 14 | yarn-debug.log* 15 | yarn-error.log* 16 | 17 | # release 18 | /build 19 | /sample 20 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 14.15.0 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-present Algolia, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # create-instantsearch-app has a new home 👋 2 | 3 | This project has moved and is now part of the [InstantSearch monorepo](https://github.com/algolia/instantsearch.js)! The CLI utility remains unchanged and is 4 | still available as `create-instantsearch-app` on [npm](https://www.npmjs.com/package/create-instantsearch-app). 5 | 6 | You can [browse the code](https://github.com/algolia/instantsearch.js/tree/master/packages/create-instantsearch-app), find [existing 7 | issues](https://github.com/algolia/instantsearch.js/labels/Package%3A%20create-instantsearch-app) and follow [new 8 | releases](https://github.com/algolia/instantsearch.js/releases) over there. 9 | -------------------------------------------------------------------------------- /docs/deploy.md: -------------------------------------------------------------------------------- 1 | # Deploy an InstantSearch app 2 | 3 | Create InstantSearch App generates applications that are ready to be deployed. They rely on bundlers and framework toolkits (Parcel, Create React App, Vue CLI, Angular CLI, etc.). 4 | 5 | Your app can be deployed in a single command, assuming you're located in its folder. 6 | 7 |
8 | Contents 9 | 10 | 11 | 12 | 13 | 14 | - [CodeSandbox](#codesandbox) 15 | - [Surge](#surge) 16 | - [Vercel](#vercel) 17 | 18 | 19 | 20 |
21 | 22 | ## CodeSandbox 23 | 24 | ``` 25 | npx codesandbox . 26 | ``` 27 | 28 | [Learn more about CodeSandbox →](https://codesandbox.io) 29 | 30 | ## Surge 31 | 32 | ``` 33 | npx surge 34 | ``` 35 | 36 | [Learn more about Surge →](https://surge.sh) 37 | 38 | ## Vercel 39 | 40 | ``` 41 | npx vercel 42 | ``` 43 | 44 | [Learn more about Vercel →](https://vercel.com) 45 | -------------------------------------------------------------------------------- /e2e/__image_snapshots__/angular-instantsearch/src/favicon.ico-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/angular-instantsearch/src/favicon.ico-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/angular-instantsearch/src/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/angular-instantsearch/src/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/autocomplete.js-0.x/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/autocomplete.js-0.x/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/autocomplete.js/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/autocomplete.js/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/autocomplete/assets/adaptive-icon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/autocomplete/assets/adaptive-icon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/autocomplete/assets/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/autocomplete/assets/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/autocomplete/assets/icon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/autocomplete/assets/icon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/autocomplete/assets/splash.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/autocomplete/assets/splash.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/autocomplete/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/autocomplete/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/instantsearch-android/app/src/main/res/drawable/product_placeholder.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/instantsearch-android/app/src/main/res/drawable/product_placeholder.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-hdpi/ic_launcher.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-hdpi/ic_launcher.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-mdpi/ic_launcher.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-mdpi/ic_launcher.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-xhdpi/ic_launcher.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-xhdpi/ic_launcher.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/instantsearch-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/instantsearch.js-2.x/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/instantsearch.js-2.x/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/instantsearch.js/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/instantsearch.js/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/javascript-client/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/javascript-client/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/javascript-helper-2.x/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/javascript-helper-2.x/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/javascript-helper/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/javascript-helper/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/react-instantsearch-hooks-native/assets/adaptive-icon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/react-instantsearch-hooks-native/assets/adaptive-icon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/react-instantsearch-hooks-native/assets/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/react-instantsearch-hooks-native/assets/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/react-instantsearch-hooks-native/assets/icon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/react-instantsearch-hooks-native/assets/icon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/react-instantsearch-hooks-native/assets/splash.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/react-instantsearch-hooks-native/assets/splash.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/react-instantsearch-hooks/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/react-instantsearch-hooks/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/react-instantsearch/public/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/react-instantsearch/public/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/vue-instantsearch-1.x/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/vue-instantsearch-1.x/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/vue-instantsearch-1.x/public/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/vue-instantsearch-1.x/public/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/vue-instantsearch-2.x/public/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/vue-instantsearch-2.x/public/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/vue-instantsearch-vue3/public/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/vue-instantsearch-vue3/public/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/vue-instantsearch/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/vue-instantsearch/favicon.png-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/vue-instantsearch/public/favicon.ico-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/vue-instantsearch/public/favicon.ico-snap.png -------------------------------------------------------------------------------- /e2e/__image_snapshots__/vue-instantsearch/public/favicon.png-snap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/e2e/__image_snapshots__/vue-instantsearch/public/favicon.png-snap.png -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const createInstantSearchApp = require('./src/api'); 2 | 3 | module.exports = createInstantSearchApp; 4 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testEnvironment: 'node', 3 | testPathIgnorePatterns: [ 4 | '/node_modules/', 5 | '/src/templates/', 6 | ], 7 | }; 8 | -------------------------------------------------------------------------------- /preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/preview.png -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["config:js-app", "algolia"] 3 | } 4 | -------------------------------------------------------------------------------- /scripts/build-app.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const fs = require('fs'); 3 | const { execSync } = require('child_process'); 4 | 5 | const usage = ` 6 | Usage: 7 | 8 | node ${path.basename(process.argv[1])} `; 9 | 10 | const [, , appPath, templateName] = process.argv; 11 | 12 | if (!appPath) { 13 | console.error(`The \`appPath\` argument is missing.\n${usage}`); 14 | process.exit(1); 15 | } 16 | 17 | if (!templateName) { 18 | console.error(`The \`templateName\` argument is missing.\n${usage}`); 19 | process.exit(1); 20 | } 21 | 22 | const appName = path.basename(appPath); 23 | 24 | const config = { 25 | template: templateName, 26 | appId: 'appId', 27 | apiKey: 'apiKey', 28 | indexName: 'indexName', 29 | searchPlaceholder: 'Search placeholder', 30 | attributesToDisplay: ['attribute1', 'attribute2'], 31 | attributesForFaceting: ['facet1', 'facet2'], 32 | organization: 'algolia', 33 | }; 34 | 35 | const configFilePath = `cisa.config.json`; 36 | 37 | fs.writeFileSync(configFilePath, JSON.stringify(config)); 38 | 39 | execSync( 40 | `yarn start ${appPath} \ 41 | --name "${appName}" \ 42 | --config "${configFilePath}"`, 43 | { stdio: 'inherit' } 44 | ); 45 | 46 | execSync(`cd ${appPath} && yarn && yarn build`, { stdio: 'inherit' }); 47 | -------------------------------------------------------------------------------- /ship.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | shouldPrepare: ({ releaseType, commitNumbersPerType }) => { 3 | const { fix = 0 } = commitNumbersPerType; 4 | if (releaseType === 'patch' && fix === 0) { 5 | return false; 6 | } 7 | return true; 8 | }, 9 | buildCommand: () => null, 10 | }; 11 | -------------------------------------------------------------------------------- /src/api/check-config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const fs = require('fs'); 3 | const { checkAppName, checkAppPath } = require('../utils'); 4 | 5 | function getOptions({ supportedTemplates }) { 6 | return { 7 | path: { 8 | validate(input) { 9 | // Side effect: `checkAppPath()` can throw 10 | return Boolean(input) && checkAppPath(input); 11 | }, 12 | }, 13 | name: { 14 | validate(input) { 15 | // Side effect: `checkAppName()` can throw 16 | return checkAppName(input); 17 | }, 18 | }, 19 | template: { 20 | validate(input) { 21 | return fs.existsSync(path.join(input || '', '.template.js')); 22 | }, 23 | getErrorMessage() { 24 | return `The template directory must contain a configuration file \`.template.js\` or must be one of those: ${supportedTemplates.join( 25 | ', ' 26 | )}`; 27 | }, 28 | }, 29 | installation: { 30 | validate(input) { 31 | return input === true || input === false; 32 | }, 33 | }, 34 | }; 35 | } 36 | 37 | module.exports = function checkConfig(config, { supportedTemplates }) { 38 | const options = getOptions({ supportedTemplates }); 39 | 40 | Object.keys(options).forEach(optionName => { 41 | const isOptionValid = options[optionName].validate(config[optionName]); 42 | 43 | if (!isOptionValid) { 44 | const errorMessage = options[optionName].getErrorMessage 45 | ? options[optionName].getErrorMessage(config[optionName]) 46 | : `The option \`${optionName}\` is required.`; 47 | 48 | throw new Error(errorMessage); 49 | } 50 | }); 51 | }; 52 | -------------------------------------------------------------------------------- /src/api/index.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const checkConfig = require('./check-config'); 3 | const resolveTemplate = require('./resolve-template'); 4 | const buildTask = require('../tasks/common/build'); 5 | const cleanTask = require('../tasks/common/clean'); 6 | const { getAllTemplates } = require('../utils'); 7 | 8 | const supportedTemplates = getAllTemplates(); 9 | 10 | function noop() {} 11 | 12 | function createInstantSearchApp(appPath, options = {}, tasks = {}) { 13 | const config = { 14 | ...options, 15 | template: resolveTemplate(options, { supportedTemplates }), 16 | name: options.name || path.basename(appPath || ''), 17 | installation: options.installation !== false, 18 | silent: options.silent === true, 19 | path: appPath ? path.resolve(appPath) : '', 20 | }; 21 | 22 | checkConfig(config, { supportedTemplates }); 23 | 24 | const { 25 | setup = noop, 26 | build = buildTask, 27 | install = noop, 28 | clean = cleanTask, 29 | teardown = noop, 30 | } = tasks; 31 | 32 | async function create() { 33 | try { 34 | await setup(config); 35 | } catch (err) { 36 | return; 37 | } 38 | 39 | try { 40 | await build(config); 41 | 42 | if (config.installation) { 43 | try { 44 | await install(config); 45 | } catch (err) { 46 | await clean(config); 47 | return; 48 | } 49 | } 50 | } catch (err) { 51 | return; 52 | } 53 | 54 | await teardown(config); 55 | } 56 | 57 | return { 58 | create, 59 | }; 60 | } 61 | 62 | module.exports = createInstantSearchApp; 63 | -------------------------------------------------------------------------------- /src/cli/__tests__/getAnswersDefaultValues.js: -------------------------------------------------------------------------------- 1 | const getAnswersDefaultValues = require('../getAnswersDefaultValues'); 2 | 3 | test('without attributesToDisplay in configuration', () => { 4 | const { attributesToDisplay } = getAnswersDefaultValues({}, {}, undefined); 5 | expect(attributesToDisplay).toBeUndefined(); 6 | }); 7 | 8 | test('with attributesToDisplay in configuration', () => { 9 | const { attributesToDisplay } = getAnswersDefaultValues( 10 | {}, 11 | { attributesToDisplay: ['name'] }, 12 | undefined 13 | ); 14 | expect(attributesToDisplay).toEqual(['name']); 15 | }); 16 | -------------------------------------------------------------------------------- /src/cli/__tests__/getAttributesFromIndex.test.js: -------------------------------------------------------------------------------- 1 | const getAttributesFromIndex = require('../getAttributesFromIndex'); 2 | const getInformationFromIndex = require('../getInformationFromIndex'); 3 | 4 | jest.mock('../getInformationFromIndex'); 5 | 6 | test('with search success should fetch attributes', async () => { 7 | getInformationFromIndex.mockImplementationOnce(() => 8 | Promise.resolve({ 9 | hits: [ 10 | { 11 | _highlightResult: { 12 | brand: 'brand', 13 | description: 'description', 14 | name: 'name', 15 | title: 'title', 16 | }, 17 | }, 18 | ], 19 | }) 20 | ); 21 | 22 | const attributes = await getAttributesFromIndex({ 23 | appId: 'appId', 24 | apiKey: 'apiKey', 25 | indexName: 'indexName', 26 | }); 27 | 28 | expect(attributes).toEqual(['title', 'name', 'description', 'brand']); 29 | }); 30 | 31 | test('with search failure should return default attributes', async () => { 32 | getInformationFromIndex.mockImplementationOnce(() => 33 | Promise.reject(new Error()) 34 | ); 35 | 36 | const attributes = await getAttributesFromIndex({ 37 | appId: 'appId', 38 | apiKey: 'apiKey', 39 | indexName: 'indexName', 40 | }); 41 | 42 | expect(attributes).toEqual(['title', 'name', 'description']); 43 | }); 44 | -------------------------------------------------------------------------------- /src/cli/__tests__/getConfiguration.test.js: -------------------------------------------------------------------------------- 1 | const loadJsonFile = require('load-json-file'); 2 | const getConfiguration = require('../getConfiguration'); 3 | 4 | jest.mock('load-json-file'); 5 | 6 | test('without template throws', async () => { 7 | expect.assertions(1); 8 | 9 | await expect(getConfiguration({})).rejects.toThrow( 10 | new Error('The template is required in the config.') 11 | ); 12 | }); 13 | 14 | test('with options from arguments and prompt merge', async () => { 15 | const configuration = await getConfiguration({ 16 | options: { 17 | name: 'my-app', 18 | }, 19 | answers: { 20 | template: 'InstantSearch.js', 21 | libraryVersion: '1.0.0', 22 | }, 23 | }); 24 | 25 | expect(configuration).toEqual( 26 | expect.objectContaining({ 27 | name: 'my-app', 28 | libraryVersion: '1.0.0', 29 | }) 30 | ); 31 | }); 32 | 33 | test('with config file overrides all options', async () => { 34 | loadJsonFile.mockImplementationOnce(x => Promise.resolve(x)); 35 | const ignoredOptions = { 36 | libraryVersion: '3.0.0', 37 | }; 38 | const options = { 39 | config: { 40 | template: 'InstantSearch.js', 41 | libraryVersion: '1.0.0', 42 | }, 43 | ...ignoredOptions, 44 | }; 45 | const answers = { 46 | ignoredKey: 'ignoredValue', 47 | }; 48 | 49 | const configuration = await getConfiguration({ 50 | options, 51 | answers, 52 | }); 53 | 54 | expect(configuration).toEqual(expect.not.objectContaining(ignoredOptions)); 55 | expect(configuration).toEqual(expect.not.objectContaining(answers)); 56 | }); 57 | -------------------------------------------------------------------------------- /src/cli/__tests__/getFacetsFromIndex.test.js: -------------------------------------------------------------------------------- 1 | const getFacetsFromIndex = require('../getFacetsFromIndex'); 2 | const getInformationFromIndex = require('../getInformationFromIndex'); 3 | 4 | jest.mock('../getInformationFromIndex'); 5 | 6 | test('with search success should fetch attributes', async () => { 7 | getInformationFromIndex.mockImplementationOnce(() => 8 | Promise.resolve({ 9 | facets: { 10 | abc: {}, 11 | def: {}, 12 | something: {}, 13 | 'something.nested': {}, 14 | }, 15 | }) 16 | ); 17 | 18 | const attributes = await getFacetsFromIndex({ 19 | appId: 'appId', 20 | apiKey: 'apiKey', 21 | indexName: 'indexName', 22 | }); 23 | 24 | expect(attributes).toEqual(['abc', 'def', 'something', 'something.nested']); 25 | }); 26 | 27 | test('with search failure should return default attributes', async () => { 28 | getInformationFromIndex.mockImplementationOnce(() => 29 | Promise.reject(new Error()) 30 | ); 31 | 32 | const attributes = await getFacetsFromIndex({ 33 | appId: 'appId', 34 | apiKey: 'apiKey', 35 | indexName: 'indexName', 36 | }); 37 | 38 | expect(attributes).toEqual([]); 39 | }); 40 | -------------------------------------------------------------------------------- /src/cli/__tests__/getInformationFromIndex.js: -------------------------------------------------------------------------------- 1 | const algoliasearch = require('algoliasearch'); 2 | const getInformationFromIndex = require('../getInformationFromIndex'); 3 | 4 | jest.mock('algoliasearch', () => { 5 | const _algoliasearch = jest.fn(() => ({ search: _algoliasearch.__search })); 6 | _algoliasearch.__search = jest.fn(() => 7 | Promise.resolve({ 8 | results: [ 9 | { 10 | hits: [], 11 | facets: {}, 12 | }, 13 | ], 14 | }) 15 | ); 16 | 17 | return _algoliasearch; 18 | }); 19 | 20 | test('returns default information', async () => { 21 | const info = await getInformationFromIndex({ 22 | appId: 'a', 23 | apiKey: 'a', 24 | indexName: 'a', 25 | }); 26 | 27 | expect(info).toEqual({ hits: [], facets: {} }); 28 | }); 29 | 30 | test('returns {} on error', async () => { 31 | algoliasearch.__search.mockImplementationOnce(() => 32 | Promise.reject(new Error()) 33 | ); 34 | 35 | const info = await getInformationFromIndex({ 36 | appId: 'a', 37 | apiKey: 'a', 38 | indexName: 'a', 39 | }); 40 | 41 | expect(info).toEqual({}); 42 | }); 43 | 44 | test('creates client once per credentials', async () => { 45 | await getInformationFromIndex({ 46 | appId: 'a', 47 | apiKey: 'a', 48 | indexName: 'a', 49 | }); 50 | 51 | expect(algoliasearch).toHaveBeenCalledTimes(1); 52 | 53 | await getInformationFromIndex({ 54 | appId: 'b', 55 | apiKey: 'b', 56 | indexName: 'b', 57 | }); 58 | 59 | expect(algoliasearch).toHaveBeenCalledTimes(2); 60 | 61 | await getInformationFromIndex({ 62 | appId: 'b', 63 | apiKey: 'b', 64 | indexName: 'c', 65 | }); 66 | 67 | expect(algoliasearch).toHaveBeenCalledTimes(2); 68 | }); 69 | -------------------------------------------------------------------------------- /src/cli/getAnswersDefaultValues.js: -------------------------------------------------------------------------------- 1 | module.exports = function getAnswersDefaultValues( 2 | optionsFromArguments, 3 | configuration, 4 | template 5 | ) { 6 | return { 7 | ...configuration, 8 | ...optionsFromArguments, 9 | template, 10 | // name has a default of '', as it's a special case in Commander 11 | name: optionsFromArguments.name || configuration.name, 12 | }; 13 | }; 14 | -------------------------------------------------------------------------------- /src/cli/getAttributesFromIndex.js: -------------------------------------------------------------------------------- 1 | const getInformationFromIndex = require('./getInformationFromIndex'); 2 | 3 | module.exports = async function getAttributesFromIndex({ 4 | appId, 5 | apiKey, 6 | indexName, 7 | } = {}) { 8 | const defaultAttributes = ['title', 'name', 'description']; 9 | let attributes = []; 10 | 11 | try { 12 | const { hits } = await getInformationFromIndex({ 13 | appId, 14 | apiKey, 15 | indexName, 16 | }); 17 | const [firstHit] = hits; 18 | const highlightedAttributes = Object.keys(firstHit._highlightResult); 19 | attributes = [ 20 | ...new Set([ 21 | ...defaultAttributes 22 | .map( 23 | attribute => highlightedAttributes.includes(attribute) && attribute 24 | ) 25 | .filter(Boolean), 26 | ...highlightedAttributes, 27 | ]), 28 | ]; 29 | } catch (err) { 30 | attributes = defaultAttributes; 31 | } 32 | 33 | return attributes; 34 | }; 35 | -------------------------------------------------------------------------------- /src/cli/getConfiguration.js: -------------------------------------------------------------------------------- 1 | const loadJsonFile = require('load-json-file'); 2 | 3 | async function getConfiguration({ options = {}, answers = {} } = {}) { 4 | const config = options.config 5 | ? await loadJsonFile(options.config) // From configuration file given as an argument 6 | : { ...options, ...answers }; // From the arguments and the prompt 7 | 8 | if (!config.template) { 9 | throw new Error('The template is required in the config.'); 10 | } 11 | 12 | return config; 13 | } 14 | 15 | module.exports = getConfiguration; 16 | -------------------------------------------------------------------------------- /src/cli/getFacetsFromIndex.js: -------------------------------------------------------------------------------- 1 | const getInformationFromIndex = require('./getInformationFromIndex'); 2 | 3 | module.exports = async function getFacetsFromIndex({ 4 | appId, 5 | apiKey, 6 | indexName, 7 | } = {}) { 8 | try { 9 | const { facets } = await getInformationFromIndex({ 10 | appId, 11 | apiKey, 12 | indexName, 13 | }); 14 | return Object.keys(facets); 15 | } catch (err) { 16 | return []; 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /src/cli/getInformationFromIndex.js: -------------------------------------------------------------------------------- 1 | const algoliasearch = require('algoliasearch'); 2 | const { createInMemoryCache } = require('@algolia/cache-in-memory'); 3 | 4 | const clients = new Map(); 5 | function getClient(appId, apiKey) { 6 | const key = [appId, apiKey].join('__'); 7 | let client = clients.get(key); 8 | if (!client) { 9 | client = algoliasearch(appId, apiKey, { 10 | responsesCache: createInMemoryCache(), 11 | requestsCache: createInMemoryCache(), 12 | }); 13 | 14 | clients.set(key, client); 15 | } 16 | 17 | return client; 18 | } 19 | 20 | async function getInformationFromIndex({ appId, apiKey, indexName }) { 21 | try { 22 | const client = getClient(appId, apiKey); 23 | return await client 24 | .search([ 25 | { 26 | indexName, 27 | params: { 28 | hitsPerPage: 1, 29 | facets: '*', 30 | maxValuesPerFacet: 1, 31 | }, 32 | }, 33 | ]) 34 | .then(({ results: [result] }) => result); 35 | } catch (err) { 36 | return {}; 37 | } 38 | } 39 | 40 | module.exports = getInformationFromIndex; 41 | -------------------------------------------------------------------------------- /src/cli/isQuestionAsked.js: -------------------------------------------------------------------------------- 1 | module.exports = function isQuestionAsked({ question, args }) { 2 | // if there's a config, ask no questions, even if it would be invalid 3 | if (args.config || !args.interactive) { 4 | return true; 5 | } 6 | 7 | const argument = args[question.name]; 8 | 9 | // Skip if the arg in the command is valid 10 | if (question.validate) { 11 | return question.validate(argument); 12 | } 13 | 14 | return argument !== undefined; 15 | }; 16 | -------------------------------------------------------------------------------- /src/tasks/android/teardown.js: -------------------------------------------------------------------------------- 1 | const chalk = require('chalk'); 2 | 3 | module.exports = function teardown(config) { 4 | if (!config.silent) { 5 | console.log(); 6 | console.log( 7 | `🎉 Created ${chalk.bold.cyan(config.name)} at ${chalk.green( 8 | config.path 9 | )}.` 10 | ); 11 | console.log(); 12 | 13 | console.log('Begin by opening the new project.'); 14 | console.log(); 15 | console.log('⚡️ Start building something awesome!'); 16 | } 17 | 18 | return Promise.resolve(); 19 | }; 20 | -------------------------------------------------------------------------------- /src/tasks/common/clean.js: -------------------------------------------------------------------------------- 1 | const util = require('util'); 2 | const exec = util.promisify(require('child_process').exec); 3 | const chalk = require('chalk'); 4 | 5 | module.exports = async function clean(config) { 6 | const logger = config.silent ? { log() {}, error() {} } : console; 7 | 8 | logger.log(); 9 | logger.log(`✨ Cleaning up ${chalk.green(config.path)}.`); 10 | logger.log(); 11 | 12 | await exec(`rm -rf ${config.path}`); 13 | }; 14 | -------------------------------------------------------------------------------- /src/tasks/ios/install.js: -------------------------------------------------------------------------------- 1 | const { execSync } = require('child_process'); 2 | const chalk = require('chalk'); 3 | 4 | module.exports = function install(config) { 5 | const logger = config.silent ? { log() {}, error() {} } : console; 6 | const initialDirectory = process.cwd(); 7 | const execSyncOptions = { 8 | stdio: config.silent ? 'ignore' : 'inherit', 9 | }; 10 | 11 | logger.log(); 12 | logger.log('📦 Installing dependencies...'); 13 | logger.log(); 14 | 15 | process.chdir(config.path); 16 | 17 | try { 18 | execSync('pod repo update', execSyncOptions); 19 | execSync('pod install', execSyncOptions); 20 | } catch (err) { 21 | logger.log(); 22 | logger.log(); 23 | logger.error(chalk.red('📦 Dependencies could not be installed.')); 24 | logger.log(err); 25 | logger.log(); 26 | logger.log('Try to create the app without installing the dependencies:'); 27 | logger.log( 28 | ` ${chalk.cyan('create-instantsearch-app')} ${process.argv 29 | .slice(2) 30 | .join(' ')} --no-installation` 31 | ); 32 | 33 | logger.log(); 34 | logger.log(); 35 | logger.error(chalk.red('🛑 Aborting the app generation.')); 36 | logger.log(); 37 | 38 | return Promise.reject(err); 39 | } 40 | 41 | process.chdir(initialDirectory); 42 | 43 | return Promise.resolve(); 44 | }; 45 | -------------------------------------------------------------------------------- /src/tasks/ios/setup.js: -------------------------------------------------------------------------------- 1 | const { execSync } = require('child_process'); 2 | const chalk = require('chalk'); 3 | 4 | module.exports = function setup(config) { 5 | const logger = config.silent ? { log() {}, error() {} } : console; 6 | 7 | if (config.installation) { 8 | try { 9 | execSync('pod --version', { stdio: 'ignore' }); 10 | } catch (err) { 11 | logger.log(); 12 | logger.error( 13 | chalk.red('You must install CocoaPods to create an iOS project.') 14 | ); 15 | logger.log('See: https://cocoapods.org'); 16 | logger.log(); 17 | 18 | process.exit(1); 19 | } 20 | } 21 | 22 | return Promise.resolve(); 23 | }; 24 | -------------------------------------------------------------------------------- /src/tasks/ios/teardown.js: -------------------------------------------------------------------------------- 1 | const chalk = require('chalk'); 2 | 3 | module.exports = function teardown(config) { 4 | if (!config.silent) { 5 | console.log(); 6 | console.log( 7 | `🎉 Created ${chalk.bold.cyan(config.name)} at ${chalk.green( 8 | config.path 9 | )}.` 10 | ); 11 | console.log(); 12 | 13 | console.log( 14 | `Begin by opening the workspace \`${chalk.green('App.xcworkspace')}\`.` 15 | ); 16 | console.log(); 17 | console.log('⚡️ Start building something awesome!'); 18 | } 19 | 20 | return Promise.resolve(); 21 | }; 22 | -------------------------------------------------------------------------------- /src/tasks/node/install.js: -------------------------------------------------------------------------------- 1 | const process = require('process'); 2 | const { execSync } = require('child_process'); 3 | const chalk = require('chalk'); 4 | const { isYarnAvailable } = require('../../utils'); 5 | 6 | module.exports = function install(config) { 7 | const logger = config.silent ? { log() {}, error() {} } : console; 8 | const installCommand = isYarnAvailable() ? 'yarn' : 'npm install'; 9 | const initialDirectory = process.cwd(); 10 | 11 | logger.log(); 12 | logger.log('📦 Installing dependencies...'); 13 | logger.log(); 14 | 15 | process.chdir(config.path); 16 | 17 | try { 18 | execSync(`${installCommand}`, { 19 | stdio: config.silent ? 'ignore' : 'inherit', 20 | }); 21 | } catch (err) { 22 | logger.log(); 23 | logger.log(); 24 | 25 | if (err.signal !== 'SIGINT') { 26 | logger.error(chalk.red('📦 Dependencies could not be installed.')); 27 | 28 | logger.log(err); 29 | logger.log(); 30 | logger.log('Try to create the app without installing the dependencies:'); 31 | logger.log( 32 | ` ${chalk.cyan('create-instantsearch-app')} ${process.argv 33 | .slice(2) 34 | .join(' ')} --no-installation` 35 | ); 36 | logger.log(); 37 | } 38 | 39 | logger.log(); 40 | logger.error(chalk.red('🛑 Aborting the app generation.')); 41 | logger.log(); 42 | 43 | return Promise.reject(err); 44 | } 45 | 46 | process.chdir(initialDirectory); 47 | 48 | return Promise.resolve(); 49 | }; 50 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # For the full list of supported browsers by the Angular framework, please see: 6 | # https://angular.io/guide/browser-support 7 | 8 | # You can see what browsers were selected by your queries by running: 9 | # npx browserslist 10 | 11 | last 1 Chrome version 12 | last 1 Firefox version 13 | last 2 Edge major versions 14 | last 2 Safari major versions 15 | last 2 iOS major versions 16 | Firefox ESR 17 | not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. 18 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/.gitignore.template: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | npm-debug.log 3 | yarn-debug.log 4 | yarn-error.log 5 | dist/ 6 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | category: 'Web', 6 | libraryName: 'angular-instantsearch', 7 | templateName: 'angular-instantsearch', 8 | supportedVersion: '^4.0.0', 9 | appName: 'angular-instantsearch-app', 10 | keywords: ['algolia', 'InstantSearch', 'Angular', 'angular-instantsearch'], 11 | tasks: { 12 | install, 13 | teardown, 14 | }, 15 | }; 16 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ 4 | 5 | ## Get started 6 | 7 | To run this project locally, install the dependencies and run the local server: 8 | 9 | ```sh 10 | npm install 11 | npm start 12 | ``` 13 | 14 | Alternatively, you may use [Yarn](https://http://yarnpkg.com/): 15 | 16 | ```sh 17 | yarn 18 | yarn start 19 | ``` 20 | 21 | Open http://localhost:3000 to see your app. 22 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | jasmine: { 17 | // you can add configuration options for Jasmine here 18 | // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html 19 | // for example, you can disable the random execution with `random: false` 20 | // or set a specific seed with `seed: 4321` 21 | }, 22 | clearContext: false // leave Jasmine Spec Runner output visible in browser 23 | }, 24 | jasmineHtmlReporter: { 25 | suppressAll: true // removes the duplicated traces 26 | }, 27 | coverageReporter: { 28 | dir: require('path').join(__dirname, './coverage/{{name}}'), 29 | subdir: '.', 30 | reporters: [ 31 | { type: 'html' }, 32 | { type: 'text-summary' } 33 | ] 34 | }, 35 | reporters: ['progress', 'kjhtml'], 36 | port: 9876, 37 | colors: true, 38 | logLevel: config.LOG_INFO, 39 | autoWatch: true, 40 | browsers: ['Chrome'], 41 | singleRun: false, 42 | restartOnFileChange: true 43 | }); 44 | }; 45 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve --port 3000", 7 | "build": "ng build", 8 | "watch": "ng build --watch --configuration development", 9 | "test": "ng test" 10 | }, 11 | "private": true, 12 | "dependencies": { 13 | "@angular/animations": "12.2.16", 14 | "@angular/common": "12.2.16", 15 | "@angular/compiler": "12.2.16", 16 | "@angular/core": "12.2.16", 17 | "@angular/forms": "12.2.16", 18 | "@angular/platform-browser": "12.2.16", 19 | "@angular/platform-browser-dynamic": "12.2.16", 20 | "@angular/router": "12.2.16", 21 | "algoliasearch": "4", 22 | "angular-instantsearch": "{{libraryVersion}}", 23 | "rxjs": "6.6.0", 24 | "tslib": "2.3.0", 25 | "zone.js": "0.11.4" 26 | }, 27 | "devDependencies": { 28 | "@angular-devkit/build-angular": "12.2.16", 29 | "@angular/cli": "12.2.16", 30 | "@angular/compiler-cli": "12.2.16", 31 | "@types/jasmine": "3.8.0", 32 | "@types/node": "12.11.1", 33 | "jasmine-core": "3.8.0", 34 | "karma": "6.3.0", 35 | "karma-chrome-launcher": "3.1.0", 36 | "karma-coverage": "2.0.3", 37 | "karma-jasmine": "4.0.0", 38 | "karma-jasmine-html-reporter": "1.7.0", 39 | "typescript": "4.3.5" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .header { 2 | display: flex; 3 | align-items: center; 4 | min-height: 50px; 5 | padding: 0.5rem 1rem; 6 | background-image: linear-gradient(to right, #c3002f, #dd0031); 7 | color: #fff; 8 | margin-bottom: 1rem; 9 | } 10 | 11 | .header a { 12 | color: #fff; 13 | text-decoration: none; 14 | } 15 | 16 | .header-title { 17 | font-size: 1.2rem; 18 | font-weight: normal; 19 | } 20 | 21 | .header-title::after { 22 | content: ' ▸ '; 23 | padding: 0 0.5rem; 24 | } 25 | 26 | .header-subtitle { 27 | font-size: 1.2rem; 28 | } 29 | 30 | .container { 31 | max-width: 1200px; 32 | margin: 0 auto; 33 | padding: 1rem; 34 | } 35 | 36 | .search-panel { 37 | display: flex; 38 | } 39 | 40 | .search-panel__filters { 41 | flex: 1; 42 | } 43 | 44 | .search-panel__results { 45 | flex: 3; 46 | } 47 | 48 | .searchbox { 49 | margin-bottom: 2rem; 50 | } 51 | 52 | .pagination { 53 | margin: 2rem auto; 54 | text-align: center; 55 | } 56 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import algoliasearch from 'algoliasearch/lite'; 3 | 4 | const searchClient = algoliasearch( 5 | '{{appId}}', 6 | '{{apiKey}}' 7 | ); 8 | 9 | @Component({ 10 | selector: 'app-root', 11 | templateUrl: './app.component.html', 12 | styleUrls: ['./app.component.css'] 13 | }) 14 | export class AppComponent { 15 | config = { 16 | indexName: '{{indexName}}', 17 | searchClient, 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { NgAisModule } from 'angular-instantsearch'; 4 | 5 | import { AppComponent } from './app.component'; 6 | 7 | @NgModule({ 8 | declarations: [ 9 | AppComponent 10 | ], 11 | imports: [ 12 | NgAisModule.forRoot(), 13 | BrowserModule 14 | ], 15 | providers: [], 16 | bootstrap: [AppComponent] 17 | }) 18 | export class AppModule { } 19 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/Angular InstantSearch/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/plugins/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/Angular InstantSearch/src/favicon.ico -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{name}} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | body, 3 | h1 { 4 | margin: 0; 5 | padding: 0; 6 | } 7 | 8 | body { 9 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, 10 | Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; 11 | } 12 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: { 11 | context(path: string, deep?: boolean, filter?: RegExp): { 12 | keys(): string[]; 13 | (id: string): T; 14 | }; 15 | }; 16 | 17 | // First, initialize the Angular testing environment. 18 | getTestBed().initTestEnvironment( 19 | BrowserDynamicTestingModule, 20 | platformBrowserDynamicTesting(), 21 | { teardown: { destroyAfterEach: true }}, 22 | ); 23 | 24 | // Then we find all the tests. 25 | const context = require.context('./', true, /\.spec\.ts$/); 26 | // And load the modules. 27 | context.keys().map(context); 28 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts", 10 | "src/polyfills.ts" 11 | ], 12 | "include": [ 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true, 11 | "sourceMap": true, 12 | "declaration": false, 13 | "downlevelIteration": true, 14 | "experimentalDecorators": true, 15 | "moduleResolution": "node", 16 | "esModuleInterop": true, 17 | "importHelpers": true, 18 | "target": "es2017", 19 | "module": "es2020", 20 | "lib": [ 21 | "es2018", 22 | "dom" 23 | ], 24 | "allowSyntheticDefaultImports": true 25 | }, 26 | "angularCompilerOptions": { 27 | "enableI18nLegacyMessageIdFormat": false, 28 | "strictInjectionParameters": true, 29 | "strictInputAccessModifiers": true, 30 | "strictTemplates": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/templates/Angular InstantSearch/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/templates/Autocomplete.js 0/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /src/templates/Autocomplete.js 0/.eslintignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /dist 3 | /.cache 4 | -------------------------------------------------------------------------------- /src/templates/Autocomplete.js 0/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: 'algolia', 3 | }; 4 | -------------------------------------------------------------------------------- /src/templates/Autocomplete.js 0/.gitignore.template: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /dist 11 | /.cache 12 | 13 | # misc 14 | .DS_Store 15 | .env.local 16 | .env.development.local 17 | .env.test.local 18 | .env.production.local 19 | 20 | npm-debug.log* 21 | yarn-debug.log* 22 | yarn-error.log* 23 | -------------------------------------------------------------------------------- /src/templates/Autocomplete.js 0/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/Autocomplete.js 0/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | libraryName: 'autocomplete.js', 6 | templateName: 'autocomplete.js-0.x', 7 | appName: 'autocomplete.js-app', 8 | keywords: ['algolia', 'Autocomplete', 'autocomplete.js'], 9 | tasks: { 10 | install, 11 | teardown, 12 | }, 13 | }; 14 | -------------------------------------------------------------------------------- /src/templates/Autocomplete.js 0/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ 4 | 5 | ## Get started 6 | 7 | To run this project locally, install the dependencies and run the local server: 8 | 9 | ```sh 10 | npm install 11 | npm start 12 | ``` 13 | 14 | Alternatively, you may use [Yarn](https://http://yarnpkg.com/): 15 | 16 | ```sh 17 | yarn 18 | yarn start 19 | ``` 20 | 21 | Open http://localhost:3000 to see your app. 22 | -------------------------------------------------------------------------------- /src/templates/Autocomplete.js 0/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/Autocomplete.js 0/favicon.png -------------------------------------------------------------------------------- /src/templates/Autocomplete.js 0/index.html.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 18 | 19 | 20 | {{name}} 21 | 22 | 23 | 24 |
25 |

26 | {{name}} 27 |

28 |

using 29 | Autocomplete.js 30 |

31 |
32 | 33 |
34 |
35 | 40 |
41 |
42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/templates/Autocomplete.js 0/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "{{name}}", 3 | "name": "{{name}} Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.png", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/templates/Autocomplete.js 0/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "src/app.js", 6 | "scripts": { 7 | "start": "parcel index.html --port 3000", 8 | "build": "parcel build index.html", 9 | "lint": "eslint ." 10 | }, 11 | "dependencies": { 12 | "algoliasearch": "3.35.1", 13 | "autocomplete.js": "{{libraryVersion}}" 14 | }, 15 | "devDependencies": { 16 | "babel-eslint": "10.0.2", 17 | "eslint": "6.8.0", 18 | "eslint-config-algolia": "15.0.0", 19 | "eslint-config-prettier": "6.10.0", 20 | "eslint-plugin-import": "2.20.1", 21 | "eslint-plugin-prettier": "3.1.2", 22 | "eslint-plugin-eslint-comments": "3.1.2", 23 | "parcel-bundler": "1.12.5", 24 | "prettier": "1.19.1" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/templates/Autocomplete.js 0/src/app.js.hbs: -------------------------------------------------------------------------------- 1 | import algoliasearch from 'algoliasearch'; 2 | import autocomplete from 'autocomplete.js'; 3 | 4 | const client = algoliasearch('{{appId}}', '{{apiKey}}'); 5 | const index = client.initIndex('{{indexName}}'); 6 | 7 | autocomplete( 8 | '#searchBox input[type=search]', 9 | { 10 | hint: false, 11 | debug: process.env.NODE_ENV === 'development', 12 | }, 13 | [ 14 | { 15 | source: autocomplete.sources.hits(index, { hitsPerPage: 5 }), 16 | displayKey: '{{attributesToDisplay.[0]}}', 17 | templates: { 18 | suggestion(suggestion) { 19 | {{#if attributesToDisplay.[0]}} 20 | return suggestion._highlightResult.{{attributesToDisplay.[0]}}.value; 21 | {{else}} 22 | return JSON.stringify(suggestion); 23 | {{/if}} 24 | }, 25 | }, 26 | }, 27 | ] 28 | ).on('autocomplete:selected', (event, suggestion, dataset) => { 29 | // eslint-disable-next-line no-console 30 | console.log({ suggestion, dataset }); 31 | }); 32 | -------------------------------------------------------------------------------- /src/templates/Autocomplete.js 0/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #fcfcfd; 3 | color: #333; 4 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, 5 | Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; 6 | margin: 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/templates/Autocomplete/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /src/templates/Autocomplete/.eslintignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /dist 3 | /.cache 4 | -------------------------------------------------------------------------------- /src/templates/Autocomplete/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-commonjs */ 2 | 3 | module.exports = { 4 | extends: ['algolia', 'algolia/react'], 5 | settings: { 6 | react: { 7 | pragma: 'React', 8 | version: 'preact', 9 | }, 10 | }, 11 | rules: { 12 | 'jsdoc/check-tag-names': [ 13 | 'error', 14 | { 15 | jsxTags: true, 16 | }, 17 | ], 18 | 'react/jsx-filename-extension': 'off', 19 | }, 20 | }; 21 | -------------------------------------------------------------------------------- /src/templates/Autocomplete/.gitignore.template: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /dist 11 | /.cache 12 | 13 | # misc 14 | .DS_Store 15 | .env.local 16 | .env.development.local 17 | .env.test.local 18 | .env.production.local 19 | 20 | npm-debug.log* 21 | yarn-debug.log* 22 | yarn-error.log* 23 | -------------------------------------------------------------------------------- /src/templates/Autocomplete/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/Autocomplete/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | category: 'Web', 6 | libraryName: '@algolia/autocomplete-js', 7 | templateName: 'autocomplete', 8 | appName: 'autocomplete-app', 9 | keywords: ['algolia', 'autocomplete'], 10 | tasks: { 11 | install, 12 | teardown, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /src/templates/Autocomplete/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ 4 | 5 | ## Get started 6 | 7 | To run this project locally, install the dependencies and run the local server: 8 | 9 | ```sh 10 | npm install 11 | npm start 12 | ``` 13 | 14 | Alternatively, you may use [Yarn](https://http://yarnpkg.com/): 15 | 16 | ```sh 17 | yarn 18 | yarn start 19 | ``` 20 | 21 | Open http://localhost:3000 to see your app. 22 | -------------------------------------------------------------------------------- /src/templates/Autocomplete/app.js.hbs: -------------------------------------------------------------------------------- 1 | /** @jsx h */ 2 | import { autocomplete, getAlgoliaResults } from '@algolia/autocomplete-js'; 3 | import algoliasearch from 'algoliasearch'; 4 | import { h } from 'preact'; 5 | 6 | import '@algolia/autocomplete-theme-classic'; 7 | 8 | const searchClient = algoliasearch('{{appId}}', '{{apiKey}}'); 9 | 10 | autocomplete({ 11 | container: '#autocomplete', 12 | placeholder: '{{placeholder}}', 13 | debug: true, 14 | getSources({ query }) { 15 | return [ 16 | { 17 | sourceId: 'items', 18 | getItems() { 19 | return getAlgoliaResults({ 20 | searchClient, 21 | queries: [ 22 | { 23 | indexName: '{{indexName}}', 24 | query, 25 | }, 26 | ], 27 | }); 28 | }, 29 | templates: { 30 | item({ item, components }) { 31 | return ( 32 |
33 |
34 |
35 |
36 | 40 |
41 |
42 |
43 |
44 | ); 45 | }, 46 | noResults() { 47 | return 'No matching items.'; 48 | }, 49 | }, 50 | }, 51 | ]; 52 | }, 53 | }); 54 | -------------------------------------------------------------------------------- /src/templates/Autocomplete/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/Autocomplete/favicon.png -------------------------------------------------------------------------------- /src/templates/Autocomplete/index.html.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{name}} 10 | 11 | 12 | 13 |
14 |
15 |
16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/templates/Autocomplete/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "{{name}}", 3 | "name": "{{name}} Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.png", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/templates/Autocomplete/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "build": "parcel build index.html", 7 | "start": "parcel index.html --port 3000", 8 | "lint": "eslint ." 9 | }, 10 | "dependencies": { 11 | "@algolia/autocomplete-js": "{{libraryVersion}}", 12 | "@algolia/autocomplete-theme-classic": "{{libraryVersion}}", 13 | "algoliasearch": "4", 14 | "preact": "10.5.14" 15 | }, 16 | "devDependencies": { 17 | "babel-eslint": "10.1.0", 18 | "eslint": "7.32.0", 19 | "eslint-config-algolia": "19.0.2", 20 | "eslint-config-prettier": "8.3.0", 21 | "eslint-plugin-eslint-comments": "3.2.0", 22 | "eslint-plugin-import": "2.24.2", 23 | "eslint-plugin-jsdoc": "36.1.0", 24 | "eslint-plugin-jsx-a11y": "6.4.1", 25 | "eslint-plugin-prettier": "4.0.0", 26 | "eslint-plugin-react": "7.26.0", 27 | "eslint-plugin-react-hooks": "4.2.0", 28 | "parcel": "2.0.0-beta.2", 29 | "prettier": "1.19.1" 30 | }, 31 | "keywords": [ 32 | "algolia", 33 | "autocomplete", 34 | "javascript" 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /src/templates/Autocomplete/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | } 4 | 5 | body { 6 | background-color: rgb(244, 244, 249); 7 | color: rgb(65, 65, 65); 8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 9 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 10 | sans-serif; 11 | -webkit-font-smoothing: antialiased; 12 | -moz-osx-font-smoothing: grayscale; 13 | padding: 1rem; 14 | } 15 | 16 | .container { 17 | margin: 0 auto; 18 | max-width: 640px; 19 | width: 100%; 20 | } 21 | -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/.gitignore.template: -------------------------------------------------------------------------------- 1 | # IDE Files 2 | *.iml 3 | .idea/* 4 | projectFilesBackup 5 | 6 | # Build 7 | .gradle 8 | /.idea/workspace.xml 9 | /.idea/libraries 10 | /build 11 | /captures 12 | 13 | # Local setup 14 | /local.properties 15 | 16 | # OS Files 17 | .DS_Store 18 | -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/.template.js: -------------------------------------------------------------------------------- 1 | const setup = require('../../tasks/ios/setup'); 2 | const install = require('../../tasks/ios/install'); 3 | const teardown = require('../../tasks/android/teardown'); 4 | 5 | module.exports = { 6 | category: 'Mobile', 7 | templateName: 'instantsearch-android', 8 | appName: 'instantsearch-android-app', 9 | tasks: { 10 | teardown, 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/.gitignore.template: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | dataBinding.enabled true 5 | compileSdkVersion 27 6 | buildToolsVersion '27.0.3' 7 | defaultConfig { 8 | applicationId "com.example.instantsearch.app" 9 | minSdkVersion 15 10 | targetSdkVersion 27 11 | versionCode 1 12 | versionName "1.0" 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | } 22 | 23 | dependencies { 24 | implementation fileTree(dir: 'libs', include: ['*.jar']) 25 | androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { 26 | exclude group: 'com.android.support', module: 'support-annotations' 27 | }) 28 | implementation 'com.android.support:appcompat-v7:27.1.1' 29 | implementation 'com.android.support.constraint:constraint-layout:1.1.2' 30 | implementation 'com.algolia:instantsearch-android:1.12.1' 31 | testImplementation 'junit:junit:4.12' 32 | } 33 | -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/pln/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/androidTest/java/com/example/instantsearch/app/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.example.instantsearch.app; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.example.instantsearch.app", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/main/java/com/example/instantsearch/app/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.instantsearch.app; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | 6 | import com.algolia.instantsearch.helpers.Searcher; 7 | import com.algolia.instantsearch.helpers.InstantSearch; 8 | 9 | public class MainActivity extends AppCompatActivity { 10 | private static final String ALGOLIA_APP_ID = "{{appId}}"; 11 | private static final String ALGOLIA_SEARCH_API_KEY = "{{apiKey}}"; 12 | private static final String ALGOLIA_INDEX_NAME = "{{indexName}}"; 13 | 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_main); 18 | final Searcher searcher = Searcher.create(ALGOLIA_APP_ID, ALGOLIA_SEARCH_API_KEY, ALGOLIA_INDEX_NAME); 19 | final InstantSearch helper = new InstantSearch(this, searcher); 20 | helper.search(); // First empty search to display default results 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 17 | 18 | 24 | 25 | -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/InstantSearch Android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/InstantSearch Android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/InstantSearch Android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/InstantSearch Android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/InstantSearch Android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/InstantSearch Android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/InstantSearch Android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/InstantSearch Android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/InstantSearch Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/InstantSearch Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | {{name}} 3 | 4 | -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | google() 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.1.3' 10 | 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle files 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | jcenter() 19 | google() 20 | } 21 | } 22 | 23 | task clean(type: Delete) { 24 | delete rootProject.buildDir 25 | } 26 | -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/InstantSearch Android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jul 03 16:02:11 CEST 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6-all.zip 7 | -------------------------------------------------------------------------------- /src/templates/InstantSearch Android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /src/templates/InstantSearch iOS/.template.js: -------------------------------------------------------------------------------- 1 | const setup = require('../../tasks/ios/setup'); 2 | const install = require('../../tasks/ios/install'); 3 | const teardown = require('../../tasks/ios/teardown'); 4 | 5 | module.exports = { 6 | category: 'Mobile', 7 | templateName: 'instantsearch-ios', 8 | appName: 'instantsearch-ios-app', 9 | tasks: { 10 | setup, 11 | install, 12 | teardown, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /src/templates/InstantSearch iOS/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/templates/InstantSearch iOS/App.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/templates/InstantSearch iOS/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/templates/InstantSearch iOS/App/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /src/templates/InstantSearch iOS/App/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/templates/InstantSearch iOS/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'App' do 5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for App 9 | pod 'InstantSearch' 10 | 11 | end 12 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js 2/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js 2/.eslintignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /dist 3 | /.cache 4 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js 2/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: 'algolia', 3 | }; 4 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js 2/.gitignore.template: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /dist 11 | /.cache 12 | 13 | # misc 14 | .DS_Store 15 | .env.local 16 | .env.development.local 17 | .env.test.local 18 | .env.production.local 19 | 20 | npm-debug.log* 21 | yarn-debug.log* 22 | yarn-error.log* 23 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js 2/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js 2/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | libraryName: 'instantsearch.js', 6 | templateName: 'instantsearch.js-2.x', 7 | supportedVersion: '>= 2.0.0 < 3.0.0', 8 | appName: 'instantsearch.js-app', 9 | keywords: ['algolia', 'InstantSearch', 'Vanilla', 'instantsearch.js'], 10 | tasks: { 11 | install, 12 | teardown, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js 2/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ 4 | 5 | ## Get started 6 | 7 | To run this project locally, install the dependencies and run the local server: 8 | 9 | ```sh 10 | npm install 11 | npm start 12 | ``` 13 | 14 | Alternatively, you may use [Yarn](https://http://yarnpkg.com/): 15 | 16 | ```sh 17 | yarn 18 | yarn start 19 | ``` 20 | 21 | Open http://localhost:3000 to see your app. 22 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js 2/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/InstantSearch.js 2/favicon.png -------------------------------------------------------------------------------- /src/templates/InstantSearch.js 2/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "{{name}}", 3 | "name": "{{name}} Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.png", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js 2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "src/app.js", 6 | "scripts": { 7 | "start": "parcel index.html --port 3000", 8 | "build": "parcel build index.html", 9 | "lint": "eslint .", 10 | "lint:fix": "npm run lint -- --fix" 11 | }, 12 | "devDependencies": { 13 | "babel-eslint": "10.0.2", 14 | "eslint": "5.7.0", 15 | "eslint-config-algolia": "13.2.3", 16 | "eslint-config-prettier": "3.6.0", 17 | "eslint-plugin-import": "2.19.1", 18 | "eslint-plugin-prettier": "3.1.2", 19 | "parcel-bundler": "1.12.5", 20 | "prettier": "1.19.1" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js 2/src/app.css: -------------------------------------------------------------------------------- 1 | em { 2 | background: cyan; 3 | font-style: normal; 4 | } 5 | 6 | .header { 7 | display: flex; 8 | align-items: center; 9 | min-height: 50px; 10 | padding: 0.5rem 1rem; 11 | background-image: linear-gradient(284deg, #fedd4e, #fcb43a); 12 | color: #fff; 13 | margin-bottom: 1rem; 14 | } 15 | 16 | .header a { 17 | color: #fff; 18 | text-decoration: none; 19 | } 20 | 21 | .header-title { 22 | font-size: 1.2rem; 23 | font-weight: normal; 24 | } 25 | 26 | .header-title::after { 27 | content: ' ▸ '; 28 | padding: 0 0.5rem; 29 | } 30 | 31 | .header-subtitle { 32 | font-size: 1.2rem; 33 | } 34 | 35 | .container { 36 | max-width: 1200px; 37 | margin: 0 auto; 38 | padding: 1rem; 39 | } 40 | 41 | .search-panel { 42 | display: flex; 43 | } 44 | 45 | .search-panel__filters { 46 | flex: 1; 47 | } 48 | 49 | .search-panel__results { 50 | flex: 3; 51 | } 52 | 53 | .ais-hits { 54 | display: grid; 55 | grid-template-columns: 47.5% 47.5%; 56 | grid-gap: 1rem; 57 | } 58 | 59 | .ais-hits--item { 60 | min-height: 100px; 61 | padding: 1rem; 62 | background: #fff; 63 | border-radius: 4px; 64 | border: 1px solid rgba(150, 150, 150, 0.16); 65 | box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.16); 66 | } 67 | 68 | #searchbox { 69 | margin-bottom: 2rem; 70 | } 71 | 72 | #pagination { 73 | margin: 2rem auto; 74 | text-align: center; 75 | } 76 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js 2/src/app.js.hbs: -------------------------------------------------------------------------------- 1 | /* global instantsearch */ 2 | 3 | const search = instantsearch({ 4 | appId: '{{appId}}', 5 | apiKey: '{{apiKey}}', 6 | indexName: '{{indexName}}', 7 | }); 8 | 9 | search.addWidget( 10 | instantsearch.widgets.searchBox({ 11 | container: '#searchbox', 12 | autofocus: false, 13 | {{#if searchPlaceholder}} 14 | placeholder: '{{searchPlaceholder}}', 15 | {{/if}} 16 | }) 17 | ); 18 | 19 | search.addWidget( 20 | instantsearch.widgets.hits({ 21 | container: '#hits', 22 | {{#if attributesToDisplay}} 23 | templates: { 24 | item: ` 25 |
26 |

\{{{_highlightResult.{{attributesToDisplay.[0]}}.value}}}

27 | {{#each attributesToDisplay}} 28 | {{#unless @first}} 29 |

\{{{_highlightResult.{{this}}.value}}}

30 | {{/unless}} 31 | {{/each}} 32 |
33 | `, 34 | }, 35 | {{/if}} 36 | }) 37 | ); 38 | 39 | {{#each attributesForFaceting}} 40 | search.addWidget( 41 | instantsearch.widgets.refinementList({ 42 | container: '#{{this}}-list', 43 | attributeName: '{{this}}', 44 | }) 45 | ); 46 | 47 | {{/each}} 48 | search.addWidget( 49 | instantsearch.widgets.pagination({ 50 | container: '#pagination', 51 | }) 52 | ); 53 | 54 | search.start(); 55 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js 2/src/index.css: -------------------------------------------------------------------------------- 1 | body, 2 | h1 { 3 | margin: 0; 4 | padding: 0; 5 | } 6 | 7 | body { 8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, 9 | Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; 10 | } 11 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/.eslintignore: -------------------------------------------------------------------------------- 1 | # Vendors 2 | node_modules 3 | 4 | # Artifacts 5 | dist 6 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['algolia', 'algolia/jest', 'algolia/typescript'], 3 | rules: { 4 | '@typescript-eslint/explicit-function-return-type': 'off', 5 | }, 6 | settings: { 7 | 'import/resolver': { 8 | node: { 9 | extensions: ['.js', '.ts'], 10 | }, 11 | }, 12 | }, 13 | overrides: [ 14 | { 15 | files: ['*.cjs'], 16 | rules: { 17 | 'import/no-commonjs': 'off', 18 | }, 19 | }, 20 | ], 21 | }; 22 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/.gitignore.template: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | npm-debug.log 3 | yarn-debug.log 4 | yarn-error.log 5 | dist/ 6 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | category: 'Widget', 6 | libraryName: 'instantsearch.js', 7 | supportedVersion: '>= 4.27.1 < 5.0.0', 8 | templateName: 'instantsearch.js-widget', 9 | packageNamePrefix: 'instantsearch-widget-', 10 | keywords: [ 11 | 'algolia', 12 | 'InstantSearch', 13 | 'Vanilla', 14 | 'instantsearch.js', 15 | 'widget', 16 | ], 17 | tasks: { 18 | install, 19 | teardown, 20 | }, 21 | }; 22 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guide 2 | 3 | ## Test 4 | 5 | The tests are written in `/src/__tests__` and use Jest. 6 | 7 | ```bash 8 | npm test 9 | # or 10 | yarn test 11 | ``` 12 | 13 | An example can be found in the `example` directory. 14 | 15 | ## Build 16 | 17 | ```bash 18 | npm run build 19 | # or 20 | yarn build 21 | ``` 22 | 23 | ## Release 24 | 25 | ```bash 26 | npm run release 27 | # or 28 | yarn release 29 | ``` 30 | 31 | ### First Release 32 | 33 | ```bash 34 | npm run release -- --first-release 35 | # or 36 | yarn release --first-release 37 | ``` 38 | 39 | This will tag a release without bumping the version. 40 | 41 | When you are ready, push the git tag and run `npm publish`. 42 | 43 | If you want to publish it as a public scoped package, run `npm publish --access public` the first time. 44 | 45 | [To know more about `standard-version`, read this →](https://github.com/conventional-changelog/standard-version#cli-usage) 46 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/LICENSE.md.hbs: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) {{ currentYear }}-present {{ organization }}. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/example/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: sans-serif; 3 | } 4 | 5 | [class^=ais-] { 6 | font-size: 1em; 7 | } 8 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {{ name }} example 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/example/index.ts.hbs: -------------------------------------------------------------------------------- 1 | import algoliasearch from 'algoliasearch/lite'; 2 | import instantsearch from 'instantsearch.js/es'; 3 | import { configure, hits, searchBox } from 'instantsearch.js/es/widgets'; 4 | 5 | import { {{ camelCaseName }} } from '../src'; 6 | 7 | const search = instantsearch({ 8 | indexName: 'instant_search', 9 | searchClient: algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76'), 10 | }); 11 | 12 | search.addWidgets([ 13 | {{ camelCaseName }}({ container: '#example' }), 14 | 15 | searchBox({ container: '#search-box' }), 16 | configure({ 17 | attributesToSnippet: ['description:10'], 18 | snippetEllipsisText: '[…]', 19 | }), 20 | hits({ 21 | container: '#hits', 22 | templates: { 23 | item: ` 24 |

25 | {{#helpers.highlight}}{ "attribute": "name" }{{/helpers.highlight}} 26 |

27 | 28 | {{#helpers.snippet}}{ "attribute": "description" }{{/helpers.snippet}} 29 | 30 | `, 31 | }, 32 | }), 33 | ]); 34 | 35 | search.start(); 36 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/src/index.ts.hbs: -------------------------------------------------------------------------------- 1 | export * from './widget'; 2 | export * from './connector'; 3 | export * from './renderer'; 4 | export * from './types'; 5 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/src/widget.ts.hbs: -------------------------------------------------------------------------------- 1 | import { connect{{ pascalCaseName }} } from './connector'; 2 | import { create{{ pascalCaseName }}Renderer } from './renderer'; 3 | import type { 4 | {{ pascalCaseName }}WidgetCreator, 5 | {{ pascalCaseName }}ConnectorParams, 6 | {{ pascalCaseName }}WidgetParams, 7 | } from './types'; 8 | 9 | /* 10 | * Widget creator 11 | * Returns a widget instance 12 | */ 13 | export const {{ camelCaseName }}: {{ pascalCaseName }}WidgetCreator = function {{ pascalCaseName }}( 14 | widgetParams 15 | ) { 16 | const rendererWidgetParams: {{ pascalCaseName }}WidgetParams = { 17 | container: widgetParams.container, 18 | // TODO: pick the widget-only parameters from the widgetParams 19 | }; 20 | 21 | const { render, dispose } = create{{ pascalCaseName }}Renderer( 22 | rendererWidgetParams 23 | ); 24 | 25 | const createWidget = connect{{ pascalCaseName }}(render, dispose); 26 | 27 | const connectorParams: {{ pascalCaseName }}ConnectorParams = { 28 | // TODO: pick the connector-only parameters from the widgetParams 29 | }; 30 | 31 | return { 32 | ...createWidget(connectorParams), 33 | $$widgetType: '{{ widgetType }}', 34 | }; 35 | }; 36 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/tsconfig.declaration.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig", 3 | "compilerOptions": { 4 | "outDir": "dist/_types", 5 | "stripInternal": true, 6 | "noEmit": false, 7 | "declaration": true, 8 | "emitDeclarationOnly": true, 9 | "declarationMap": true 10 | }, 11 | "include": ["src"], 12 | "exclude": ["**/__tests__","**/index.cjs.ts"] 13 | } 14 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "moduleResolution": "node", 5 | "noEmit": true, 6 | "strict": true, 7 | "skipLibCheck": true, 8 | "allowSyntheticDefaultImports": true 9 | }, 10 | "exclude": ["dist"] 11 | } 12 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js widget/vite.config.js: -------------------------------------------------------------------------------- 1 | import { fileURLToPath } from 'url'; 2 | 3 | import typescript from '@rollup/plugin-typescript'; 4 | import apiExtractor from 'rollup-plugin-api-extractor'; 5 | import vite from 'vite'; 6 | 7 | // https://vitejs.dev/config/ 8 | export default vite.defineConfig({ 9 | build: { 10 | lib: { 11 | entry: fileURLToPath(new URL('src/index.ts', import.meta.url)), 12 | name: '{{ pascalCaseName }}', 13 | fileName: 'index', 14 | formats: ['es', 'cjs', 'umd'], 15 | }, 16 | rollupOptions: { 17 | // make sure to externalize deps that shouldn't be bundled 18 | // into your library 19 | external: ['instantsearch.js'], 20 | output: { 21 | globals: { 22 | 'instantsearch.js': 'instantsearch', 23 | }, 24 | }, 25 | }, 26 | }, 27 | plugins: [ 28 | typescript({ tsconfig: 'tsconfig.declaration.json' }), 29 | apiExtractor.apiExtractor(), 30 | ], 31 | }); 32 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/.eslintignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /dist 3 | /.cache 4 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: 'algolia', 3 | }; 4 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/.gitignore.template: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /dist 11 | /.cache 12 | 13 | # misc 14 | .DS_Store 15 | .env.local 16 | .env.development.local 17 | .env.test.local 18 | .env.production.local 19 | 20 | npm-debug.log* 21 | yarn-debug.log* 22 | yarn-error.log* 23 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | category: 'Web', 6 | libraryName: 'instantsearch.js', 7 | supportedVersion: '>= 3.0.0 < 5.0.0', 8 | flags: { 9 | dynamicWidgets: '>= 4.30', 10 | }, 11 | templateName: 'instantsearch.js', 12 | appName: 'instantsearch.js-app', 13 | keywords: ['algolia', 'InstantSearch', 'Vanilla', 'instantsearch.js'], 14 | tasks: { 15 | install, 16 | teardown, 17 | }, 18 | }; 19 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ 4 | 5 | ## Get started 6 | 7 | To run this project locally, install the dependencies and run the local server: 8 | 9 | ```sh 10 | npm install 11 | npm start 12 | ``` 13 | 14 | Alternatively, you may use [Yarn](https://http://yarnpkg.com/): 15 | 16 | ```sh 17 | yarn 18 | yarn start 19 | ``` 20 | 21 | Open http://localhost:3000 to see your app. 22 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/InstantSearch.js/favicon.png -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "parcel index.html --port 3000", 7 | "build": "parcel build index.html", 8 | "lint": "eslint . && prettier --check .", 9 | "lint:fix": "eslint . --fix && prettier --write ." 10 | }, 11 | "devDependencies": { 12 | "eslint": "8.15.0", 13 | "parcel": "2.0.1", 14 | "prettier": "2.6.2" 15 | }, 16 | "dependencies": { 17 | "algoliasearch": "4", 18 | "instantsearch.js": "{{libraryVersion}}" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/src/app.css: -------------------------------------------------------------------------------- 1 | .header { 2 | display: flex; 3 | align-items: center; 4 | min-height: 50px; 5 | padding: 0.5rem 1rem; 6 | background-image: linear-gradient(284deg, #fedd4e, #fcb43a); 7 | color: #fff; 8 | margin-bottom: 1rem; 9 | } 10 | 11 | .header a { 12 | color: #fff; 13 | text-decoration: none; 14 | } 15 | 16 | .header-title { 17 | font-size: 1.2rem; 18 | font-weight: normal; 19 | } 20 | 21 | .header-title::after { 22 | content: ' ▸ '; 23 | padding: 0 0.5rem; 24 | } 25 | 26 | .header-subtitle { 27 | font-size: 1.2rem; 28 | } 29 | 30 | .container { 31 | max-width: 1200px; 32 | margin: 0 auto; 33 | padding: 1rem; 34 | } 35 | 36 | .search-panel { 37 | display: flex; 38 | } 39 | 40 | .search-panel__filters { 41 | flex: 1; 42 | } 43 | 44 | .search-panel__results { 45 | flex: 3; 46 | } 47 | 48 | .ais-Highlight-highlighted { 49 | color: inherit; 50 | font-size: inherit; 51 | } 52 | 53 | #searchbox { 54 | margin-bottom: 2rem; 55 | } 56 | 57 | #pagination { 58 | margin: 2rem auto; 59 | text-align: center; 60 | } 61 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/src/global.d.ts.hbs: -------------------------------------------------------------------------------- 1 | import algoliasearch from 'algoliasearch/lite'; 2 | import instantsearch from 'instantsearch.js/dist/instantsearch.production.min'; 3 | 4 | declare global { 5 | interface Window { 6 | algoliasearch: typeof algoliasearch; 7 | instantsearch: typeof instantsearch; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/src/index.css: -------------------------------------------------------------------------------- 1 | body, 2 | h1 { 3 | margin: 0; 4 | padding: 0; 5 | } 6 | 7 | body { 8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, 9 | Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; 10 | } 11 | -------------------------------------------------------------------------------- /src/templates/InstantSearch.js/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "esModuleInterop": true, 5 | "sourceMap": true, 6 | "allowJs": true, 7 | "lib": [ 8 | "es6", 9 | "dom" 10 | ], 11 | "rootDir": "src", 12 | "moduleResolution": "node" 13 | }, 14 | "include": [ 15 | "src", 16 | "src/global.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/.eslintignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /dist 3 | /.cache 4 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: 'algolia', 3 | }; 4 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/.gitignore.template: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /dist 11 | /.cache 12 | 13 | # misc 14 | .DS_Store 15 | .env.local 16 | .env.development.local 17 | .env.test.local 18 | .env.production.local 19 | 20 | npm-debug.log* 21 | yarn-debug.log* 22 | yarn-error.log* 23 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | libraryName: 'algoliasearch', 6 | templateName: 'javascript-client', 7 | appName: 'javascript-client-app', 8 | keywords: ['algolia', 'JavaScript', 'Client', 'algoliasearch'], 9 | tasks: { 10 | install, 11 | teardown, 12 | }, 13 | }; 14 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ 4 | 5 | ## Get started 6 | 7 | To run this project locally, install the dependencies and run the local server: 8 | 9 | ```sh 10 | npm install 11 | npm start 12 | ``` 13 | 14 | Alternatively, you may use [Yarn](https://http://yarnpkg.com/): 15 | 16 | ```sh 17 | yarn 18 | yarn start 19 | ``` 20 | 21 | Open http://localhost:3000 to see your app. 22 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/JavaScript Client/favicon.png -------------------------------------------------------------------------------- /src/templates/JavaScript Client/index.html.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | {{name}} 16 | 17 | 18 | 19 |
20 |

21 | {{name}} 22 |

23 |

using the 24 | Algolia Search API Client for JavaScript 25 |

26 |
27 | 28 |
29 |
30 |
31 | 32 |
33 | 38 |
39 |
40 |
41 |
42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "{{name}}", 3 | "name": "{{name}} Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.png", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "src/app.js", 6 | "scripts": { 7 | "start": "parcel index.html --port 3000", 8 | "build": "parcel build index.html", 9 | "lint": "eslint .", 10 | "lint:fix": "npm run lint -- --fix" 11 | }, 12 | "dependencies": { 13 | "algoliasearch": "{{libraryVersion}}" 14 | }, 15 | "devDependencies": { 16 | "babel-eslint": "10.0.2", 17 | "eslint": "5.7.0", 18 | "eslint-config-algolia": "13.2.3", 19 | "eslint-config-prettier": "3.6.0", 20 | "eslint-plugin-import": "2.19.1", 21 | "eslint-plugin-prettier": "3.1.2", 22 | "parcel-bundler": "1.12.5", 23 | "prettier": "1.19.1" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/src/app.css: -------------------------------------------------------------------------------- 1 | em { 2 | background: cyan; 3 | font-style: normal; 4 | } 5 | 6 | .header { 7 | display: flex; 8 | align-items: center; 9 | min-height: 50px; 10 | padding: 0.5rem 1rem; 11 | background-image: linear-gradient(73deg, #3369e7, #1cc7d0); 12 | color: #fff; 13 | margin-bottom: 1rem; 14 | } 15 | 16 | .header a { 17 | color: #fff; 18 | text-decoration: none; 19 | } 20 | 21 | .header-title { 22 | font-size: 1.2rem; 23 | font-weight: normal; 24 | } 25 | 26 | .header-title::after { 27 | content: ' ▸ '; 28 | padding: 0 0.5rem; 29 | } 30 | 31 | .header-subtitle { 32 | font-size: 1.2rem; 33 | } 34 | 35 | .container { 36 | max-width: 1200px; 37 | margin: 0 auto; 38 | padding: 1rem; 39 | } 40 | 41 | .container-app { 42 | display: grid; 43 | } 44 | 45 | #searchBox input[type='search'] { 46 | width: 100%; 47 | padding: 12px; 48 | font: inherit; 49 | border-radius: 2px; 50 | border: 1px solid rgba(150, 150, 150, 0.16); 51 | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.16); 52 | } 53 | 54 | .ais-hits { 55 | display: grid; 56 | grid-template-columns: 49% 49%; 57 | grid-gap: 2%; 58 | padding: 0; 59 | margin: 0; 60 | } 61 | 62 | .ais-hits--item { 63 | list-style: none; 64 | min-height: 100px; 65 | padding: 1rem; 66 | background: #fff; 67 | border-radius: 4px; 68 | border: 1px solid rgba(150, 150, 150, 0.16); 69 | box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.16); 70 | margin-bottom: 1rem; 71 | } 72 | 73 | #searchBox { 74 | margin-bottom: 2rem; 75 | } 76 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/src/app.js.hbs: -------------------------------------------------------------------------------- 1 | import algoliasearch from 'algoliasearch'; 2 | 3 | const client = algoliasearch('{{appId}}', '{{apiKey}}'); 4 | const index = client.initIndex('{{indexName}}'); 5 | 6 | const $searchBox = document.querySelector('#searchBox input[type=search]'); 7 | const $hits = document.querySelector('#hits'); 8 | 9 | function renderHits(query) { 10 | index.search(query).then(result => { 11 | // Please sanitize user-provided data when using `innerHTML` to avoid XSS 12 | $hits.innerHTML = ` 13 |
    14 | ${result.hits 15 | .map( 16 | hit => 17 | `
  1. 18 |
    19 | {{#if attributesToDisplay}} 20 |

    ${hit._highlightResult.{{attributesToDisplay.[0]}}.value}

    21 | {{#each attributesToDisplay}} 22 | {{#unless @first}} 23 |

    ${hit._highlightResult.{{this}}.value}

    24 | {{/unless}} 25 | {{/each}} 26 | {{else}} 27 |

    28 | ${JSON.stringify(hit).slice(0, 100)}... 29 |

    30 | {{/if}} 31 |
    32 |
  2. ` 33 | ) 34 | .join('')} 35 |
`; 36 | }); 37 | } 38 | 39 | $searchBox.addEventListener('input', event => { 40 | const query = event.target.value; 41 | 42 | renderHits(query); 43 | }); 44 | 45 | renderHits(''); 46 | -------------------------------------------------------------------------------- /src/templates/JavaScript Client/src/index.css: -------------------------------------------------------------------------------- 1 | body, 2 | h1 { 3 | margin: 0; 4 | padding: 0; 5 | } 6 | 7 | body { 8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, 9 | Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; 10 | } 11 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper 2/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper 2/.eslintignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /dist 3 | /.cache 4 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper 2/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: 'algolia', 3 | }; 4 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper 2/.gitignore.template: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /dist 11 | /.cache 12 | 13 | # misc 14 | .DS_Store 15 | .env.local 16 | .env.development.local 17 | .env.test.local 18 | .env.production.local 19 | 20 | npm-debug.log* 21 | yarn-debug.log* 22 | yarn-error.log* 23 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper 2/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper 2/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | libraryName: 'algoliasearch-helper', 6 | templateName: 'javascript-helper-2.x', 7 | supportedVersion: '>= 2.0.0 < 3.0.0', 8 | appName: 'javascript-helper-app', 9 | keywords: ['algolia', 'JavaScript', 'Helper', 'algoliasearch-helper'], 10 | tasks: { 11 | install, 12 | teardown, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper 2/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ 4 | 5 | ## Get started 6 | 7 | To run this project locally, install the dependencies and run the local server: 8 | 9 | ```sh 10 | npm install 11 | npm start 12 | ``` 13 | 14 | Alternatively, you may use [Yarn](https://http://yarnpkg.com/): 15 | 16 | ```sh 17 | yarn 18 | yarn start 19 | ``` 20 | 21 | Open http://localhost:3000 to see your app. 22 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper 2/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/JavaScript Helper 2/favicon.png -------------------------------------------------------------------------------- /src/templates/JavaScript Helper 2/index.html.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | {{name}} 16 | 17 | 18 | 19 |
20 |

21 | {{name}} 22 |

23 |

using the 24 | Algolia Search Helper for JavaScript 25 |

26 |
27 | 28 |
29 |
30 | 35 |
36 |
37 |
38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper 2/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "{{name}}", 3 | "name": "{{name}} Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.png", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper 2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "src/app.js", 6 | "scripts": { 7 | "start": "parcel index.html --port 3000", 8 | "build": "parcel build index.html", 9 | "lint": "eslint .", 10 | "lint:fix": "npm run lint -- --fix" 11 | }, 12 | "dependencies": { 13 | "algoliasearch": "4", 14 | "algoliasearch-helper": "{{libraryVersion}}" 15 | }, 16 | "devDependencies": { 17 | "babel-eslint": "10.0.3", 18 | "eslint": "5.7.0", 19 | "eslint-config-algolia": "13.2.3", 20 | "eslint-config-prettier": "3.6.0", 21 | "eslint-plugin-import": "2.19.1", 22 | "eslint-plugin-prettier": "3.1.2", 23 | "parcel-bundler": "1.12.5", 24 | "prettier": "1.19.1" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper 2/src/app.css: -------------------------------------------------------------------------------- 1 | em { 2 | background: cyan; 3 | font-style: normal; 4 | } 5 | 6 | .header { 7 | display: flex; 8 | align-items: center; 9 | min-height: 50px; 10 | padding: 0.5rem 1rem; 11 | background-image: linear-gradient(73deg, #3369e7, #1cc7d0); 12 | color: #fff; 13 | margin-bottom: 1rem; 14 | } 15 | 16 | .header a { 17 | color: #fff; 18 | text-decoration: none; 19 | } 20 | 21 | .header-title { 22 | font-size: 1.2rem; 23 | font-weight: normal; 24 | } 25 | 26 | .header-title::after { 27 | content: ' ▸ '; 28 | padding: 0 0.5rem; 29 | } 30 | 31 | .header-subtitle { 32 | font-size: 1.2rem; 33 | } 34 | 35 | .container { 36 | max-width: 1200px; 37 | margin: 0 auto; 38 | padding: 1rem; 39 | } 40 | 41 | .container-app { 42 | display: grid; 43 | } 44 | 45 | #searchBox input[type='search'] { 46 | width: 100%; 47 | padding: 12px; 48 | font: inherit; 49 | border-radius: 2px; 50 | border: 1px solid rgba(150, 150, 150, 0.16); 51 | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.16); 52 | } 53 | 54 | .ais-hits { 55 | display: grid; 56 | grid-template-columns: 49% 49%; 57 | grid-gap: 2%; 58 | padding: 0; 59 | margin: 0; 60 | } 61 | 62 | .ais-hits--item { 63 | list-style: none; 64 | padding: 1rem; 65 | background: #fff; 66 | border-radius: 4px; 67 | border: 1px solid rgba(150, 150, 150, 0.16); 68 | box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.16); 69 | margin-bottom: 1rem; 70 | } 71 | 72 | #searchBox { 73 | margin-bottom: 2rem; 74 | } 75 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper 2/src/app.js.hbs: -------------------------------------------------------------------------------- 1 | import algoliasearch from 'algoliasearch'; 2 | import algoliasearchHelper from 'algoliasearch-helper'; 3 | 4 | const client = algoliasearch('{{appId}}', '{{apiKey}}'); 5 | const helper = algoliasearchHelper(client, '{{indexName}}'); 6 | 7 | const $searchBox = document.querySelector('#searchBox input[type=search]'); 8 | const $hits = document.querySelector('#hits'); 9 | 10 | $searchBox.addEventListener('input', event => { 11 | const query = event.target.value; 12 | 13 | helper.setQuery(query).search(); 14 | }); 15 | 16 | helper.on('result', result => { 17 | // Please sanitize user-provided data when using `innerHTML` to avoid XSS 18 | $hits.innerHTML = ` 19 |
    20 | ${result.hits 21 | .map( 22 | hit => 23 | `
  1. 24 |
    25 | {{#if attributesToDisplay}} 26 |

    ${hit._highlightResult.{{attributesToDisplay.[0]}}.value}

    27 | {{#each attributesToDisplay}} 28 | {{#unless @first}} 29 |

    ${hit._highlightResult.{{this}}.value}

    30 | {{/unless}} 31 | {{/each}} 32 | {{else}} 33 |

    34 | ${JSON.stringify(hit).slice(0, 100)}... 35 |

    36 | {{/if}} 37 |
    38 |
  2. ` 39 | ) 40 | .join('')} 41 |
`; 42 | }); 43 | 44 | helper.search(); 45 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper 2/src/index.css: -------------------------------------------------------------------------------- 1 | body, 2 | h1 { 3 | margin: 0; 4 | padding: 0; 5 | } 6 | 7 | body { 8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, 9 | Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; 10 | } 11 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper/.eslintignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /dist 3 | /.cache 4 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: 'algolia', 3 | }; 4 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper/.gitignore.template: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /dist 11 | /.cache 12 | 13 | # misc 14 | .DS_Store 15 | .env.local 16 | .env.development.local 17 | .env.test.local 18 | .env.production.local 19 | 20 | npm-debug.log* 21 | yarn-debug.log* 22 | yarn-error.log* 23 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | libraryName: 'algoliasearch-helper', 6 | templateName: 'javascript-helper', 7 | supportedVersion: '>= 3.0.0 < 4.0.0', 8 | appName: 'javascript-helper-app', 9 | keywords: ['algolia', 'JavaScript', 'Helper', 'algoliasearch-helper'], 10 | tasks: { 11 | install, 12 | teardown, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ 4 | 5 | ## Get started 6 | 7 | To run this project locally, install the dependencies and run the local server: 8 | 9 | ```sh 10 | npm install 11 | npm start 12 | ``` 13 | 14 | Alternatively, you may use [Yarn](https://http://yarnpkg.com/): 15 | 16 | ```sh 17 | yarn 18 | yarn start 19 | ``` 20 | 21 | Open http://localhost:3000 to see your app. 22 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/JavaScript Helper/favicon.png -------------------------------------------------------------------------------- /src/templates/JavaScript Helper/index.html.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | {{name}} 16 | 17 | 18 | 19 |
20 |

21 | {{name}} 22 |

23 |

using the 24 | Algolia Search Helper for JavaScript 25 |

26 |
27 | 28 |
29 |
30 | 35 |
36 |
37 |
38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "{{name}}", 3 | "name": "{{name}} Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.png", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "src/app.js", 6 | "scripts": { 7 | "start": "parcel index.html --port 3000", 8 | "build": "parcel build index.html", 9 | "lint": "eslint .", 10 | "lint:fix": "npm run lint -- --fix" 11 | }, 12 | "dependencies": { 13 | "algoliasearch": "3.30.0", 14 | "algoliasearch-helper": "{{libraryVersion}}" 15 | }, 16 | "devDependencies": { 17 | "babel-eslint": "10.0.3", 18 | "eslint": "5.7.0", 19 | "eslint-config-algolia": "13.2.3", 20 | "eslint-config-prettier": "3.6.0", 21 | "eslint-plugin-import": "2.19.1", 22 | "eslint-plugin-prettier": "3.1.2", 23 | "parcel-bundler": "1.12.5", 24 | "prettier": "1.19.1" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper/src/app.css: -------------------------------------------------------------------------------- 1 | em { 2 | background: cyan; 3 | font-style: normal; 4 | } 5 | 6 | .header { 7 | display: flex; 8 | align-items: center; 9 | min-height: 50px; 10 | padding: 0.5rem 1rem; 11 | background-image: linear-gradient(73deg, #3369e7, #1cc7d0); 12 | color: #fff; 13 | margin-bottom: 1rem; 14 | } 15 | 16 | .header a { 17 | color: #fff; 18 | text-decoration: none; 19 | } 20 | 21 | .header-title { 22 | font-size: 1.2rem; 23 | font-weight: normal; 24 | } 25 | 26 | .header-title::after { 27 | content: ' ▸ '; 28 | padding: 0 0.5rem; 29 | } 30 | 31 | .header-subtitle { 32 | font-size: 1.2rem; 33 | } 34 | 35 | .container { 36 | max-width: 1200px; 37 | margin: 0 auto; 38 | padding: 1rem; 39 | } 40 | 41 | .container-app { 42 | display: grid; 43 | } 44 | 45 | #searchBox input[type='search'] { 46 | width: 100%; 47 | padding: 12px; 48 | font: inherit; 49 | border-radius: 2px; 50 | border: 1px solid rgba(150, 150, 150, 0.16); 51 | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.16); 52 | } 53 | 54 | .ais-hits { 55 | display: grid; 56 | grid-template-columns: 49% 49%; 57 | grid-gap: 2%; 58 | padding: 0; 59 | margin: 0; 60 | } 61 | 62 | .ais-hits--item { 63 | list-style: none; 64 | padding: 1rem; 65 | background: #fff; 66 | border-radius: 4px; 67 | border: 1px solid rgba(150, 150, 150, 0.16); 68 | box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.16); 69 | margin-bottom: 1rem; 70 | } 71 | 72 | #searchBox { 73 | margin-bottom: 2rem; 74 | } 75 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper/src/app.js.hbs: -------------------------------------------------------------------------------- 1 | import algoliasearch from 'algoliasearch'; 2 | import algoliasearchHelper from 'algoliasearch-helper'; 3 | 4 | const client = algoliasearch('{{appId}}', '{{apiKey}}'); 5 | const helper = algoliasearchHelper(client, '{{indexName}}'); 6 | 7 | const $searchBox = document.querySelector('#searchBox input[type=search]'); 8 | const $hits = document.querySelector('#hits'); 9 | 10 | $searchBox.addEventListener('input', event => { 11 | const query = event.target.value; 12 | 13 | helper.setQuery(query).search(); 14 | }); 15 | 16 | helper.on('result', ({ results }) => { 17 | // Please sanitize user-provided data when using `innerHTML` to avoid XSS 18 | $hits.innerHTML = ` 19 |
    20 | ${results.hits 21 | .map( 22 | hit => 23 | `
  1. 24 |
    25 | {{#if attributesToDisplay}} 26 |

    ${hit._highlightResult.{{attributesToDisplay.[0]}}.value}

    27 | {{#each attributesToDisplay}} 28 | {{#unless @first}} 29 |

    ${hit._highlightResult.{{this}}.value}

    30 | {{/unless}} 31 | {{/each}} 32 | {{else}} 33 |

    34 | ${JSON.stringify(hit).slice(0, 100)}... 35 |

    36 | {{/if}} 37 |
    38 |
  2. ` 39 | ) 40 | .join('')} 41 |
`; 42 | }); 43 | 44 | helper.search(); 45 | -------------------------------------------------------------------------------- /src/templates/JavaScript Helper/src/index.css: -------------------------------------------------------------------------------- 1 | body, 2 | h1 { 3 | margin: 0; 4 | padding: 0; 5 | } 6 | 7 | body { 8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, 9 | Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; 10 | } 11 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks Native/.expo-shared/assets.json: -------------------------------------------------------------------------------- 1 | { 2 | "12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true, 3 | "40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true 4 | } 5 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks Native/.gitignore.template: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .expo/ 3 | dist/ 4 | npm-debug.* 5 | *.jks 6 | *.p8 7 | *.p12 8 | *.key 9 | *.mobileprovision 10 | *.orig.* 11 | web-build/ 12 | 13 | # macOS 14 | .DS_Store 15 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks Native/.template.js: -------------------------------------------------------------------------------- 1 | const chalk = require('chalk'); 2 | const install = require('../../tasks/node/install'); 3 | const teardown = require('../../tasks/node/teardown'); 4 | 5 | module.exports = { 6 | category: 'Mobile', 7 | libraryName: 'react-instantsearch-hooks', 8 | templateName: 'react-instantsearch-hooks-native', 9 | appName: 'react-instantsearch-hooks-native-app', 10 | keywords: [ 11 | 'algolia', 12 | 'instantSearch', 13 | 'react', 14 | 'react-native', 15 | 'react-instantsearch-hooks-native', 16 | ], 17 | tasks: { 18 | setup(config) { 19 | if (!config.silent && config.attributesForFaceting) { 20 | console.log(); 21 | console.log( 22 | `⚠️ The ${chalk.cyan( 23 | 'attributesForFaceting' 24 | )} option is not supported in this template.` 25 | ); 26 | console.log(); 27 | } 28 | 29 | return Promise.resolve(); 30 | }, 31 | install, 32 | teardown, 33 | }, 34 | }; 35 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks Native/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ 4 | 5 | ## Get started 6 | 7 | To run this project locally, install the dependencies and run the local server: 8 | 9 | ```sh 10 | npm install 11 | npm start 12 | ``` 13 | 14 | Alternatively, you may use [Yarn](https://http://yarnpkg.com/): 15 | 16 | ```sh 17 | yarn 18 | yarn start 19 | ``` 20 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks Native/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "name": "{{name}}", 4 | "slug": "{{name}}", 5 | "version": "1.0.0", 6 | "orientation": "portrait", 7 | "icon": "./assets/icon.png", 8 | "splash": { 9 | "image": "./assets/splash.png", 10 | "resizeMode": "contain", 11 | "backgroundColor": "#ffffff" 12 | }, 13 | "updates": { 14 | "fallbackToCacheTimeout": 0 15 | }, 16 | "assetBundlePatterns": ["**/*"], 17 | "ios": { 18 | "supportsTablet": true 19 | }, 20 | "android": { 21 | "adaptiveIcon": { 22 | "foregroundImage": "./assets/adaptive-icon.png", 23 | "backgroundColor": "#FFFFFF" 24 | } 25 | }, 26 | "web": { 27 | "favicon": "./assets/favicon.png" 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks Native/assets/adaptive-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/React InstantSearch Hooks Native/assets/adaptive-icon.png -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks Native/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/React InstantSearch Hooks Native/assets/favicon.png -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks Native/assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/React InstantSearch Hooks Native/assets/icon.png -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks Native/assets/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/React InstantSearch Hooks Native/assets/splash.png -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks Native/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | api.cache(true); 3 | return { 4 | presets: ['babel-preset-expo'], 5 | }; 6 | }; 7 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks Native/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "node_modules/expo/AppEntry.js", 6 | "scripts": { 7 | "start": "expo start", 8 | "android": "expo start --android", 9 | "ios": "expo start --ios", 10 | "web": "expo start --web", 11 | "eject": "expo eject" 12 | }, 13 | "dependencies": { 14 | "algoliasearch": "4.12.1", 15 | "expo": "~44.0.0", 16 | "expo-status-bar": "~1.2.0", 17 | "instantsearch.js": "4.38.1", 18 | "react": "17.0.1", 19 | "react-dom": "17.0.1", 20 | "react-instantsearch-hooks": "{{libraryVersion}}", 21 | "react-native": "0.64.3", 22 | "react-native-web": "0.17.1" 23 | }, 24 | "devDependencies": { 25 | "@babel/core": "^7.12.9", 26 | "@types/react": "~17.0.21", 27 | "@types/react-native": "~0.64.12", 28 | "expo-cli": "5.5.1", 29 | "typescript": "~4.3.5" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks Native/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "expo/tsconfig.base", 3 | "compilerOptions": { 4 | "strict": true 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks Native/types/ProductHit.ts: -------------------------------------------------------------------------------- 1 | import { Hit as AlgoliaHit } from '@algolia/client-search'; 2 | 3 | export type ProductHit = AlgoliaHit<{ 4 | brand: string; 5 | categories: string[]; 6 | comments: number; 7 | description: string; 8 | free_shipping: boolean; 9 | hierarchicalCategories: { 10 | lvl0: string; 11 | lvl1?: string; 12 | lvl2?: string; 13 | lvl3?: string; 14 | lvl4?: string; 15 | lvl5?: string; 16 | lvl6?: string; 17 | }; 18 | image: string; 19 | name: string; 20 | popularity: number; 21 | price: number; 22 | prince_range: string; 23 | rating: number; 24 | sale: boolean; 25 | sale_price: string; 26 | type: string; 27 | url: string; 28 | }>; 29 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks/.gitignore.template: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | .parcel-cache 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode 17 | .idea 18 | .DS_Store 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | category: 'Web', 6 | libraryName: 'react-instantsearch-hooks-web', 7 | supportedVersion: '>= 6.0.0 < 7.0.0', 8 | flags: { 9 | dynamicWidgets: '>=6.16', 10 | }, 11 | templateName: 'react-instantsearch-hooks', 12 | appName: 'react-instantsearch-hooks-app', 13 | keywords: [ 14 | 'algolia', 15 | 'InstantSearch', 16 | 'React', 17 | 'Hooks', 18 | 'react-instantsearch-hooks', 19 | ], 20 | tasks: { 21 | install, 22 | teardown, 23 | }, 24 | }; 25 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ 4 | 5 | ## Get started 6 | 7 | To run this project locally, install the dependencies and run the local server: 8 | 9 | ```sh 10 | npm install 11 | npm start 12 | ``` 13 | 14 | Alternatively, you may use [Yarn](https://http://yarnpkg.com/): 15 | 16 | ```sh 17 | yarn 18 | yarn start 19 | ``` 20 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/React InstantSearch Hooks/favicon.png -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 12 | 16 | 20 | 21 | {{name}} 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "build": "parcel build index.html", 7 | "start": "parcel index.html" 8 | }, 9 | "dependencies": { 10 | "algoliasearch": "4", 11 | "instantsearch.js": "4.43.1", 12 | "react": "18.1.0", 13 | "react-dom": "18.1.0", 14 | "react-instantsearch-hooks-web": "{{libraryVersion}}" 15 | }, 16 | "devDependencies": { 17 | "@types/react": "18.0.15", 18 | "@types/react-dom": "18.0.6", 19 | "parcel": "2.5.0", 20 | "typescript": "4.7.4" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks/src/App.css: -------------------------------------------------------------------------------- 1 | body, 2 | h1 { 3 | margin: 0; 4 | padding: 0; 5 | } 6 | 7 | body { 8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, 9 | Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; 10 | } 11 | 12 | em { 13 | background: cyan; 14 | font-style: normal; 15 | } 16 | 17 | .header { 18 | display: flex; 19 | align-items: center; 20 | min-height: 50px; 21 | padding: 0.5rem 1rem; 22 | background-image: linear-gradient(to right, #8e43e7, #00aeff); 23 | color: #fff; 24 | margin-bottom: 1rem; 25 | } 26 | 27 | .header a { 28 | color: #fff; 29 | text-decoration: none; 30 | } 31 | 32 | .header-title { 33 | font-size: 1.2rem; 34 | font-weight: normal; 35 | } 36 | 37 | .header-title::after { 38 | content: ' ▸ '; 39 | padding: 0 0.5rem; 40 | } 41 | 42 | .header-subtitle { 43 | font-size: 1.2rem; 44 | } 45 | 46 | .container { 47 | max-width: 1200px; 48 | margin: 0 auto; 49 | padding: 1rem; 50 | } 51 | 52 | .search-panel { 53 | display: flex; 54 | } 55 | 56 | .search-panel__filters { 57 | flex: 1; 58 | } 59 | 60 | .search-panel__results { 61 | flex: 3; 62 | } 63 | 64 | .searchbox { 65 | margin-bottom: 2rem; 66 | } 67 | 68 | .pagination { 69 | margin: 2rem auto; 70 | text-align: center; 71 | } 72 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks/src/Panel.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | type PanelProps = React.PropsWithChildren<{ 4 | header: string; 5 | }>; 6 | 7 | export function Panel({ header, children }: PanelProps) { 8 | return ( 9 |
10 |
11 | {header} 12 |
13 |
{children}
14 |
15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Hooks/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { createRoot } from 'react-dom/client'; 3 | 4 | import { App } from './App'; 5 | 6 | createRoot(document.getElementById('root')!).render(); 7 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Native/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Native/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: 'algolia/react', 3 | }; 4 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Native/.gitignore.template: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # expo 4 | .expo/ 5 | 6 | # dependencies 7 | /node_modules 8 | 9 | # misc 10 | .env.local 11 | .env.development.local 12 | .env.test.local 13 | .env.production.local 14 | 15 | npm-debug.log* 16 | yarn-debug.log* 17 | yarn-error.log* 18 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Native/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Native/.template.js: -------------------------------------------------------------------------------- 1 | const chalk = require('chalk'); 2 | const install = require('../../tasks/node/install'); 3 | const teardown = require('../../tasks/node/teardown'); 4 | 5 | module.exports = { 6 | category: 'Mobile', 7 | libraryName: 'react-instantsearch-native', 8 | templateName: 'react-instantsearch-native', 9 | appName: 'react-instantsearch-native-app', 10 | keywords: [ 11 | 'algolia', 12 | 'instantSearch', 13 | 'react', 14 | 'react-native', 15 | 'react-instantsearch-native', 16 | ], 17 | tasks: { 18 | setup(config) { 19 | if (!config.silent && config.attributesForFaceting) { 20 | console.log(); 21 | console.log( 22 | `⚠️ The ${chalk.cyan( 23 | 'attributesForFaceting' 24 | )} option is not supported in this template.` 25 | ); 26 | console.log(); 27 | } 28 | 29 | return Promise.resolve(); 30 | }, 31 | install, 32 | teardown, 33 | }, 34 | }; 35 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Native/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Native/App.js.hbs: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { StyleSheet, View, SafeAreaView, StatusBar } from 'react-native'; 3 | import algoliasearch from 'algoliasearch'; 4 | import { InstantSearch } from 'react-instantsearch-native'; 5 | import SearchBox from './src/SearchBox'; 6 | import InfiniteHits from './src/InfiniteHits'; 7 | 8 | const searchClient = algoliasearch( 9 | '{{appId}}', 10 | '{{apiKey}}' 11 | ); 12 | 13 | const styles = StyleSheet.create({ 14 | safe: { 15 | flex: 1, 16 | backgroundColor: '#252b33', 17 | }, 18 | container: { 19 | flex: 1, 20 | backgroundColor: '#FFFFFF', 21 | }, 22 | }); 23 | 24 | const App = () => { 25 | return ( 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | ); 36 | }; 37 | 38 | export default App; 39 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Native/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ 4 | 5 | ## Get started 6 | 7 | To run this project locally, install the dependencies and run the local server: 8 | 9 | ```sh 10 | npm install 11 | npm start 12 | ``` 13 | 14 | Alternatively, you may use [Yarn](https://http://yarnpkg.com/): 15 | 16 | ```sh 17 | yarn 18 | yarn start 19 | ``` 20 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Native/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "name": "{{name}}", 4 | "slug": "{{name}}", 5 | "sdkVersion": "44.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Native/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | api.cache(true); 3 | return { 4 | presets: ['babel-preset-expo'], 5 | }; 6 | }; 7 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Native/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "private": true, 5 | "main": "node_modules/expo/AppEntry.js", 6 | "scripts": { 7 | "start": "expo start", 8 | "android": "expo start --android", 9 | "ios": "expo start --ios", 10 | "eject": "expo eject" 11 | }, 12 | "dependencies": { 13 | "algoliasearch": "4", 14 | "expo": "44.0.3", 15 | "prop-types": "15.8.0", 16 | "react": "17.0.2", 17 | "react-instantsearch-native": "{{libraryVersion}}", 18 | "react-native": "0.64.3" 19 | }, 20 | "devDependencies": { 21 | "@babel/core": "7.16.5", 22 | "babel-preset-expo": "9.0.2", 23 | "eslint": "8.5.0", 24 | "eslint-config-algolia": "20.0.0", 25 | "eslint-config-prettier": "8.3.0", 26 | "eslint-plugin-import": "2.25.3", 27 | "eslint-plugin-prettier": "4.0.0", 28 | "eslint-plugin-react": "7.28.0", 29 | "expo-cli": "5.0.3", 30 | "prettier": "2.5.1" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Native/src/Highlight.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Text } from 'react-native'; 3 | import PropTypes from 'prop-types'; 4 | import { connectHighlight } from 'react-instantsearch-native'; 5 | 6 | const Highlight = ({ attribute, hit, highlight }) => { 7 | const highlights = highlight({ 8 | highlightProperty: '_highlightResult', 9 | attribute, 10 | hit, 11 | }); 12 | 13 | return ( 14 | 15 | {highlights.map(({ value, isHighlighted }, index) => { 16 | const style = { 17 | backgroundColor: isHighlighted ? 'yellow' : 'transparent', 18 | }; 19 | 20 | return ( 21 | 22 | {value} 23 | 24 | ); 25 | })} 26 | 27 | ); 28 | }; 29 | 30 | Highlight.propTypes = { 31 | attribute: PropTypes.string.isRequired, 32 | hit: PropTypes.object.isRequired, 33 | highlight: PropTypes.func.isRequired, 34 | }; 35 | 36 | export default connectHighlight(Highlight); 37 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Native/src/InfiniteHits.js.hbs: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { StyleSheet, Text, View, FlatList } from 'react-native'; 3 | import PropTypes from 'prop-types'; 4 | import { connectInfiniteHits } from 'react-instantsearch-native'; 5 | {{#if attributesToDisplay}} 6 | import Highlight from './Highlight'; 7 | {{/if}} 8 | 9 | const styles = StyleSheet.create({ 10 | separator: { 11 | borderBottomWidth: 1, 12 | borderColor: '#ddd', 13 | }, 14 | item: { 15 | padding: 10, 16 | flexDirection: 'column', 17 | }, 18 | titleText: { 19 | fontWeight: 'bold', 20 | }, 21 | }); 22 | 23 | const InfiniteHits = ({ hits, hasMore, refineNext }) => ( 24 | item.objectID} 27 | ItemSeparatorComponent={() => } 28 | onEndReached={() => hasMore && refineNext()} 29 | renderItem={({ item }) => ( 30 | 31 | {{#if attributesToDisplay}} 32 | 33 | 34 | 35 | {{#each attributesToDisplay}} 36 | {{#unless @first}} 37 | 38 | 39 | 40 | {{/unless}} 41 | {{/each}} 42 | {{else}} 43 | {JSON.stringify(item).slice(0, 100)} 44 | {{/if}} 45 | 46 | )} 47 | /> 48 | ); 49 | 50 | InfiniteHits.propTypes = { 51 | hits: PropTypes.arrayOf(PropTypes.object).isRequired, 52 | hasMore: PropTypes.bool.isRequired, 53 | refineNext: PropTypes.func.isRequired, 54 | }; 55 | 56 | export default connectInfiniteHits(InfiniteHits); 57 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch Native/src/SearchBox.js.hbs: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { StyleSheet, View, TextInput } from 'react-native'; 3 | import PropTypes from 'prop-types'; 4 | import { connectSearchBox } from 'react-instantsearch-native'; 5 | 6 | const styles = StyleSheet.create({ 7 | container: { 8 | padding: 16, 9 | backgroundColor: '#252b33', 10 | }, 11 | input: { 12 | height: 48, 13 | padding: 12, 14 | fontSize: 16, 15 | backgroundColor: '#fff', 16 | borderRadius: 4, 17 | borderWidth: 1, 18 | borderColor: '#ddd', 19 | shadowColor: '#000', 20 | shadowOffset: { width: 0, height: 2 }, 21 | shadowOpacity: 0.2, 22 | shadowRadius: 2, 23 | }, 24 | }); 25 | 26 | const SearchBox = ({ currentRefinement, refine }) => ( 27 | 28 | refine(value)} 31 | value={currentRefinement} 32 | placeholder="{{searchPlaceholder}}" 33 | /> 34 | 35 | ); 36 | 37 | SearchBox.propTypes = { 38 | currentRefinement: PropTypes.string.isRequired, 39 | refine: PropTypes.func.isRequired, 40 | }; 41 | 42 | export default connectSearchBox(SearchBox); 43 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/.eslintignore: -------------------------------------------------------------------------------- 1 | /dist 2 | node_modules/ -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line import/no-commonjs 2 | module.exports = { 3 | extends: ['algolia', 'algolia/jest', 'algolia/react', 'algolia/typescript'], 4 | rules: { 5 | '@typescript-eslint/explicit-function-return-type': 'off', 6 | 'jest/expect-expect': 'off', 7 | }, 8 | settings: { 9 | react: { 10 | version: 'detect', 11 | }, 12 | }, 13 | }; 14 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | category: 'Widget', 6 | libraryName: 'react-instantsearch', 7 | supportedVersion: '>= 6.0.0 < 7.0.0', 8 | templateName: 'react-instantsearch-widget', 9 | packageNamePrefix: 'react-instantsearch-widget-', 10 | keywords: [ 11 | 'algolia', 12 | 'InstantSearch', 13 | 'React', 14 | 'react-instantsearch', 15 | 'widget', 16 | ], 17 | tasks: { 18 | install, 19 | teardown, 20 | }, 21 | }; 22 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guide 2 | 3 | ## Test 4 | 5 | ```bash 6 | npm test 7 | # or 8 | yarn test 9 | ``` 10 | 11 | ## Build 12 | 13 | ```bash 14 | npm run build 15 | # or 16 | yarn build 17 | ``` 18 | 19 | ## Run example 20 | 21 | ```bash 22 | npm start 23 | # or 24 | yarn start 25 | ``` 26 | 27 | ## Release 28 | 29 | ```bash 30 | npm run release 31 | # or 32 | yarn release 33 | ``` 34 | 35 | ### First Release 36 | 37 | ```bash 38 | npm run release -- --first-release 39 | # or 40 | yarn release --first-release 41 | ``` 42 | 43 | This will tag a release without bumping the version. 44 | 45 | When you are ready, push the git tag and run `npm publish`. 46 | 47 | If you want to publish it as a public scoped package, run `npm publish --access public` the first time. 48 | 49 | [To know more about `standard-version`, read this →](https://github.com/conventional-changelog/standard-version#cli-usage) 50 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/LICENSE.md.hbs: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) {{ currentYear }}-present {{ organization }}. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/babel.config.cjs: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line import/no-commonjs 2 | module.exports = { 3 | presets: [ 4 | ['@babel/preset-env', { targets: { node: 'current' } }], 5 | '@babel/preset-react', 6 | '@babel/preset-typescript', 7 | ], 8 | }; 9 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/example/index.html.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ packageName }} | example 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/example/index.tsx.hbs: -------------------------------------------------------------------------------- 1 | import algoliasearch from 'algoliasearch/lite'; 2 | import React from 'react'; 3 | import ReactDOM from 'react-dom'; 4 | import { InstantSearch, SearchBox, Hits } from 'react-instantsearch-dom'; 5 | 6 | import { {{ pascalCaseName }} } from '../src'; 7 | 8 | const searchClient = algoliasearch( 9 | 'latency', 10 | '6be0576ff61c053d5f9a3225e2a90f76' 11 | ); 12 | 13 | ReactDOM.render( 14 | 15 | 16 | <{{ pascalCaseName }} /> 17 | 18 | 19 | 20 | , 21 | document.getElementById('root') 22 | ); 23 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/src/index.tsx.hbs: -------------------------------------------------------------------------------- 1 | export { connect{{ pascalCaseName }} } from './lib/connector'; 2 | export { {{ pascalCaseName }}Component } from './lib/component'; 3 | export { {{ pascalCaseName }} } from './lib/widget'; 4 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/src/lib/__tests__/dummy-test.tsx.hbs: -------------------------------------------------------------------------------- 1 | import { render } from '@testing-library/react'; 2 | import React from 'react'; 3 | import { InstantSearch, Hits } from 'react-instantsearch-dom'; 4 | 5 | import { {{ pascalCaseName }} } from '../widget'; 6 | 7 | const runAllMicroTasks = (): Promise => new Promise(setImmediate); 8 | 9 | describe('nothing', () => { 10 | it('tests nothing', async () => { 11 | const searchClient = { 12 | search(_requests: any[]) { 13 | return Promise.resolve({ 14 | results: [ 15 | { 16 | hits: 17 | [ 18 | { 19 | objectID: 'a', 20 | name: 'test', 21 | }, 22 | ], 23 | }, 24 | ], 25 | }); 26 | }, 27 | }; 28 | 29 | const { debug } = render( 30 | 31 | <{{ pascalCaseName }} /> 32 | hit.name} /> 33 | 34 | ); 35 | 36 | await runAllMicroTasks(); 37 | debug(); 38 | }); 39 | }); 40 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/src/lib/component.tsx.hbs: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | import type { ProvidedProps } from './connector' 4 | 5 | type Props = ProvidedProps & { 6 | refine: () => void; 7 | }; 8 | 9 | export const {{ pascalCaseName }}Component = ({}: Props) => { 10 | return ( 11 |
12 | {/* TODO: render something */} 13 |
14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/src/lib/connector.ts.hbs: -------------------------------------------------------------------------------- 1 | import type { Connector } from '../types/connector'; 2 | 3 | import { createConnector } from 'react-instantsearch-dom'; 4 | 5 | export type ProvidedProps = { 6 | // TODO: fill props that are returned by `getProvidedProps` 7 | } 8 | 9 | export const connect{{ pascalCaseName }}: Connector = createConnector({ 10 | displayName: '{{ pascalCaseName }}', 11 | $$type: '{{ widgetType }}', 12 | 13 | getProvidedProps(props, searchState, searchResults) { 14 | return { 15 | // TODO: return a props for the component 16 | }; 17 | }, 18 | 19 | refine(props, searchState, nextRefinement) { 20 | return { 21 | // TODO: return a next searchState 22 | }; 23 | }, 24 | 25 | cleanUp(props, searchState) { 26 | return { 27 | // TODO: return a searchState where this widget is removed from the widget tree 28 | }; 29 | }, 30 | 31 | getSearchParameters(searchParameters, props, searchState) { 32 | // TODO: update and return the searchParameters 33 | return searchParameters; 34 | }, 35 | }); 36 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/src/lib/widget.tsx.hbs: -------------------------------------------------------------------------------- 1 | import { {{ pascalCaseName }}Component } from './component'; 2 | import { connect{{ pascalCaseName }} } from './connector'; 3 | 4 | type WidgetParams = { 5 | /** 6 | * Placeholder text for input element. 7 | */ 8 | placeholder?: string; 9 | }; 10 | 11 | export const {{ pascalCaseName }}: React.ElementType = connect{{ pascalCaseName }}( 12 | {{ pascalCaseName }}Component, 13 | { $$widgetType: '{{ widgetType }}' } 14 | ); 15 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/src/types/connector.ts: -------------------------------------------------------------------------------- 1 | import type { 2 | ConnectedComponentClass, 3 | ConnectorProvided, 4 | } from 'react-instantsearch-core'; 5 | 6 | type AdditionalWidgetProperties = { 7 | $$widgetType?: string; 8 | }; 9 | 10 | export type Connector = (( 11 | stateless: React.FunctionComponent>, 12 | additionalWidgetProperties: AdditionalWidgetProperties 13 | ) => React.ComponentClass) & 14 | (>>( 15 | Composed: React.ComponentType, 16 | additionalWidgetProperties: AdditionalWidgetProperties 17 | ) => ConnectedComponentClass, TExposed>); 18 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/tsconfig.declaration.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "noEmit": false, 6 | "declaration": true, 7 | "emitDeclarationOnly": true 8 | }, 9 | "exclude": ["example/index.tsx", "**/__tests__"] 10 | } 11 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "lib": ["DOM", "DOM.Iterable", "ESNext"], 5 | "types": ["vite/client", "node", "jest"], 6 | "allowJs": false, 7 | "skipLibCheck": true, 8 | "esModuleInterop": false, 9 | "allowSyntheticDefaultImports": true, 10 | "strict": true, 11 | "forceConsistentCasingInFileNames": true, 12 | "module": "ESNext", 13 | "moduleResolution": "Node", 14 | "resolveJsonModule": true, 15 | "isolatedModules": true, 16 | "noEmit": true, 17 | "jsx": "react" 18 | }, 19 | "include": ["./src", "example/index.tsx"] 20 | } 21 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch widget/vite.config.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | 3 | import reactRefresh from '@vitejs/plugin-react-refresh'; 4 | import vite from 'vite'; 5 | 6 | // import { defineConfig } from 'vite' -> fails when type:module in package.json 7 | // it seems related to https://github.com/vitejs/vite/issues/1560 8 | // so far this is the workaround. 9 | const { defineConfig } = vite; 10 | 11 | // https://vitejs.dev/config/ 12 | export default defineConfig({ 13 | plugins: [reactRefresh()], 14 | build: { 15 | lib: { 16 | entry: path.resolve(__dirname, 'src/index.tsx'), 17 | name: '{{ pascalCaseName }}', 18 | fileName: 'index', 19 | formats: ['es', 'cjs', 'umd'], 20 | }, 21 | rollupOptions: { 22 | // make sure to externalize deps that shouldn't be bundled 23 | // into your library 24 | external: ['react', 'react-dom', 'react-instantsearch-dom'], 25 | output: { 26 | globals: { 27 | react: 'React', 28 | 'react-dom': 'ReactDOM', 29 | 'react-instantsearch-dom': 'ReactInstantSearchDOM', 30 | }, 31 | }, 32 | }, 33 | }, 34 | }); 35 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: 'algolia/react', 3 | }; 4 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch/.gitignore.template: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | category: 'Web', 6 | libraryName: 'react-instantsearch-dom', 7 | supportedVersion: '>= 5.0.0 < 7.0.0', 8 | flags: { 9 | dynamicWidgets: '>=6.16', 10 | }, 11 | templateName: 'react-instantsearch', 12 | appName: 'react-instantsearch-app', 13 | keywords: ['algolia', 'InstantSearch', 'React', 'react-instantsearch'], 14 | tasks: { 15 | install, 16 | teardown, 17 | }, 18 | }; 19 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ 4 | 5 | ## Get started 6 | 7 | To run this project locally, install the dependencies and run the local server: 8 | 9 | ```sh 10 | npm install 11 | npm start 12 | ``` 13 | 14 | Alternatively, you may use [Yarn](https://http://yarnpkg.com/): 15 | 16 | ```sh 17 | yarn 18 | yarn start 19 | ``` 20 | 21 | Open http://localhost:3000 to see your app. 22 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "react-scripts start", 7 | "build": "react-scripts build", 8 | "lint": "eslint .", 9 | "lint:fix": "npm run lint -- --fix" 10 | }, 11 | "dependencies": { 12 | "algoliasearch": "4", 13 | "react": "18.1.0", 14 | "react-dom": "18.1.0", 15 | "react-instantsearch-dom": "{{libraryVersion}}", 16 | "react-scripts": "2.1.1" 17 | }, 18 | "devDependencies": { 19 | "eslint": "5.6.0", 20 | "eslint-config-algolia": "13.2.3", 21 | "eslint-config-prettier": "3.6.0", 22 | "eslint-plugin-import": "2.19.1", 23 | "eslint-plugin-prettier": "3.1.2", 24 | "eslint-plugin-react": "7.17.0", 25 | "prettier": "1.19.1", 26 | "prop-types": "15.7.2" 27 | }, 28 | "browserslist": [ 29 | ">0.2%", 30 | "not dead", 31 | "not ie <= 11", 32 | "not op_mini all" 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/React InstantSearch/public/favicon.png -------------------------------------------------------------------------------- /src/templates/React InstantSearch/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 16 | 17 | 18 | {{name}} 19 | 20 | 21 | 22 | 25 | 26 |
27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "{{name}}", 3 | "name": "{{name}} Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.png", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch/src/App.css: -------------------------------------------------------------------------------- 1 | em { 2 | background: cyan; 3 | font-style: normal; 4 | } 5 | 6 | .header { 7 | display: flex; 8 | align-items: center; 9 | min-height: 50px; 10 | padding: 0.5rem 1rem; 11 | background-image: linear-gradient(to right, #8e43e7, #00aeff); 12 | color: #fff; 13 | margin-bottom: 1rem; 14 | } 15 | 16 | .header a { 17 | color: #fff; 18 | text-decoration: none; 19 | } 20 | 21 | .header-title { 22 | font-size: 1.2rem; 23 | font-weight: normal; 24 | } 25 | 26 | .header-title::after { 27 | content: ' ▸ '; 28 | padding: 0 0.5rem; 29 | } 30 | 31 | .header-subtitle { 32 | font-size: 1.2rem; 33 | } 34 | 35 | .container { 36 | max-width: 1200px; 37 | margin: 0 auto; 38 | padding: 1rem; 39 | } 40 | 41 | .search-panel { 42 | display: flex; 43 | } 44 | 45 | .search-panel__filters { 46 | flex: 1; 47 | } 48 | 49 | .search-panel__results { 50 | flex: 3; 51 | } 52 | 53 | .searchbox { 54 | margin-bottom: 2rem; 55 | } 56 | 57 | .pagination { 58 | margin: 2rem auto; 59 | text-align: center; 60 | } 61 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch/src/index.css: -------------------------------------------------------------------------------- 1 | body, 2 | h1 { 3 | margin: 0; 4 | padding: 0; 5 | } 6 | 7 | body { 8 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, 9 | Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; 10 | } 11 | -------------------------------------------------------------------------------- /src/templates/React InstantSearch/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { createRoot } from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | 6 | createRoot(document.getElementById('root')).render(); 7 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 1/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 1/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // extends from 'prettier/vue' until we update the Algolia configuration 3 | extends: ['algolia/vue', 'prettier/vue'], 4 | rules: { 5 | 'import/no-commonjs': 'off', 6 | // enable the rule until we update the Algolia configuration 7 | 'vue/component-name-in-template-casing': ['error', 'kebab-case'], 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 1/.gitignore.template: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 1/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 1/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | libraryName: 'vue-instantsearch', 6 | templateName: 'vue-instantsearch-1.x', 7 | supportedVersion: '>= 1.0.0 < 2.0.0', 8 | appName: 'vue-instantsearch-app', 9 | keywords: ['algolia', 'InstantSearch', 'Vue', 'vue-instantsearch'], 10 | tasks: { 11 | install, 12 | teardown, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 1/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ 4 | 5 | ## Get started 6 | 7 | To run this project locally, install the dependencies and run the local server: 8 | 9 | ```sh 10 | npm install 11 | npm start 12 | ``` 13 | 14 | Alternatively, you may use [Yarn](https://http://yarnpkg.com/): 15 | 16 | ```sh 17 | yarn 18 | yarn start 19 | ``` 20 | 21 | Open http://localhost:3000 to see your app. 22 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 1/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['@vue/app'], 3 | }; 4 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "vue-cli-service serve --port 3000", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint", 9 | "lint:fix": "npm run lint -- --fix" 10 | }, 11 | "dependencies": { 12 | "core-js": "2.6.9", 13 | "vue": "2.6.10", 14 | "vue-instantsearch": "{{libraryVersion}}" 15 | }, 16 | "devDependencies": { 17 | "@vue/cli-plugin-babel": "3.6.0", 18 | "@vue/cli-plugin-eslint": "3.6.0", 19 | "@vue/cli-service": "3.6.0", 20 | "babel-eslint": "10.0.2", 21 | "eslint": "5.7.0", 22 | "eslint-config-algolia": "13.2.3", 23 | "eslint-config-prettier": "4.1.0", 24 | "eslint-plugin-import": "2.19.1", 25 | "eslint-plugin-prettier": "3.1.2", 26 | "eslint-plugin-vue": "5.2.2", 27 | "prettier": "1.19.1", 28 | "vue-template-compiler": "2.6.10" 29 | }, 30 | "browserslist": [ 31 | "> 1%", 32 | "last 2 versions", 33 | "not ie <= 8" 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 1/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/Vue InstantSearch 1/public/favicon.png -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 1/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | {{name}} 14 | 15 | 16 | 19 |
20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 1/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import InstantSearch from 'vue-instantsearch'; 3 | import App from './App.vue'; 4 | 5 | Vue.config.productionTip = false; 6 | 7 | Vue.use(InstantSearch); 8 | 9 | new Vue({ 10 | render: h => h(App), 11 | }).$mount('#app'); 12 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 2/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 2/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // extends from 'prettier/vue' until we update the Algolia configuration 3 | extends: ['algolia/vue', 'prettier/vue'], 4 | rules: { 5 | 'import/no-commonjs': 'off', 6 | // enable the rule until we update the Algolia configuration 7 | 'vue/component-name-in-template-casing': ['error', 'kebab-case'], 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 2/.gitignore.template: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 2/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 2/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | category: 'Web', 6 | libraryName: 'vue-instantsearch', 7 | templateName: 'vue-instantsearch-2.x', 8 | supportedVersion: '>= 2.0.0 < 3.0.0', 9 | appName: 'vue-instantsearch-app', 10 | keywords: ['algolia', 'InstantSearch', 'Vue', 'vue-instantsearch'], 11 | tasks: { 12 | install, 13 | teardown, 14 | }, 15 | }; 16 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 2/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ 4 | 5 | ## Get started 6 | 7 | To run this project locally, install the dependencies and run the local server: 8 | 9 | ```sh 10 | npm install 11 | npm start 12 | ``` 13 | 14 | Alternatively, you may use [Yarn](https://http://yarnpkg.com/): 15 | 16 | ```sh 17 | yarn 18 | yarn start 19 | ``` 20 | 21 | Open http://localhost:3000 to see your app. 22 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 2/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['@vue/app'], 3 | }; 4 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "vue-cli-service serve --port 3000", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint", 9 | "lint:fix": "npm run lint -- --fix" 10 | }, 11 | "dependencies": { 12 | "algoliasearch": "4", 13 | "core-js": "3.6.5", 14 | "vue": "2.6.11", 15 | "vue-instantsearch": "{{libraryVersion}}" 16 | }, 17 | "devDependencies": { 18 | "@babel/eslint-parser": "7.17.0", 19 | "@vue/cli-plugin-babel": "4.5.15", 20 | "@vue/cli-plugin-eslint": "4.5.15", 21 | "@vue/cli-service": "4.5.15", 22 | "@vue/eslint-config-prettier": "6.0.0", 23 | "babel-eslint": "10.1.0", 24 | "eslint": "6.7.2", 25 | "eslint-config-algolia": "20.0.0", 26 | "eslint-plugin-import": "2.25.4", 27 | "eslint-plugin-prettier": "3.3.1", 28 | "eslint-plugin-vue": "6.2.2", 29 | "prettier": "2.2.1", 30 | "vue-template-compiler": "2.6.11" 31 | }, 32 | "browserslist": [ 33 | "> 1%", 34 | "last 2 versions", 35 | "not ie <= 8" 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 2/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/Vue InstantSearch 2/public/favicon.png -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 2/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | {{name}} 14 | 15 | 16 | 19 |
20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch 2/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import InstantSearch from 'vue-instantsearch'; 3 | import App from './App.vue'; 4 | 5 | Vue.config.productionTip = false; 6 | 7 | Vue.use(InstantSearch); 8 | 9 | new Vue({ 10 | render: h => h(App), 11 | }).$mount('#app'); 12 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch with Vue 3/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch with Vue 3/.gitignore.template: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode 17 | .idea 18 | .DS_Store 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch with Vue 3/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch with Vue 3/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | category: 'Web', 6 | libraryName: 'vue-instantsearch', 7 | supportedVersion: '>= 4.3.3 < 5.0.0', 8 | flags: { 9 | dynamicWidgets: '>=4.2.0', 10 | }, 11 | templateName: 'vue-instantsearch-vue3', 12 | appName: 'vue-instantsearch-app', 13 | keywords: ['algolia', 'InstantSearch', 'Vue', 'vue-instantsearch'], 14 | tasks: { 15 | install, 16 | teardown, 17 | }, 18 | }; 19 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch with Vue 3/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ 4 | 5 | ## Get started 6 | 7 | To run this project locally, install the dependencies and run the local server: 8 | 9 | ```sh 10 | npm install 11 | npm start 12 | ``` 13 | 14 | Alternatively, you may use [Yarn](https://http://yarnpkg.com/): 15 | 16 | ```sh 17 | yarn 18 | yarn start 19 | ``` 20 | 21 | Open http://localhost:3000 to see your app. 22 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch with Vue 3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | {{name}} 14 | 15 | 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch with Vue 3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "vite", 7 | "start": "vite", 8 | "build": "vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "algoliasearch": "4.12.1", 13 | "vue": "3.2.25", 14 | "vue-instantsearch": "{{libraryVersion}}" 15 | }, 16 | "devDependencies": { 17 | "@vitejs/plugin-vue": "2.2.0", 18 | "@vitejs/plugin-vue-jsx": "1.3.7", 19 | "vite": "2.8.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch with Vue 3/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/Vue InstantSearch with Vue 3/public/favicon.png -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch with Vue 3/src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue'; 2 | import InstantSearch from 'vue-instantsearch/vue3/es'; 3 | import App from './App.vue'; 4 | 5 | const app = createApp(App); 6 | app.use(InstantSearch); 7 | app.mount('#app'); 8 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch with Vue 3/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import vue from '@vitejs/plugin-vue'; 3 | import vueJsx from '@vitejs/plugin-vue-jsx'; 4 | 5 | // https://vitejs.dev/config/ 6 | export default defineConfig({ 7 | plugins: [vue(), vueJsx()], 8 | }); 9 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // extends from 'prettier/vue' until we update the Algolia configuration 3 | extends: ['algolia/vue', 'prettier/vue'], 4 | rules: { 5 | 'import/no-commonjs': 'off', 6 | // enable the rule until we update the Algolia configuration 7 | 'vue/component-name-in-template-casing': ['error', 'kebab-case'], 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch/.gitignore.template: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "proseWrap": "never", 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch/.template.js: -------------------------------------------------------------------------------- 1 | const install = require('../../tasks/node/install'); 2 | const teardown = require('../../tasks/node/teardown'); 3 | 4 | module.exports = { 5 | category: 'Web', 6 | libraryName: 'vue-instantsearch', 7 | supportedVersion: '>= 3.0.0 < 5.0.0', 8 | flags: { 9 | dynamicWidgets: '>=4.2.0', 10 | }, 11 | templateName: 'vue-instantsearch', 12 | appName: 'vue-instantsearch-app', 13 | keywords: ['algolia', 'InstantSearch', 'Vue', 'vue-instantsearch'], 14 | tasks: { 15 | install, 16 | teardown, 17 | }, 18 | }; 19 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch/README.md: -------------------------------------------------------------------------------- 1 | # {{name}} 2 | 3 | _This project was generated with [create-instantsearch-app](https://github.com/algolia/create-instantsearch-app) by [Algolia](https://algolia.com)._ 4 | 5 | ## Get started 6 | 7 | To run this project locally, install the dependencies and run the local server: 8 | 9 | ```sh 10 | npm install 11 | npm start 12 | ``` 13 | 14 | Alternatively, you may use [Yarn](https://http://yarnpkg.com/): 15 | 16 | ```sh 17 | yarn 18 | yarn start 19 | ``` 20 | 21 | Open http://localhost:3000 to see your app. 22 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['@vue/app'], 3 | }; 4 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{{name}}", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "vue-cli-service serve --port 3000", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint", 9 | "lint:fix": "npm run lint -- --fix" 10 | }, 11 | "dependencies": { 12 | "algoliasearch": "4", 13 | "core-js": "3.6.5", 14 | "vue": "2.6.11", 15 | "vue-instantsearch": "{{libraryVersion}}" 16 | }, 17 | "devDependencies": { 18 | "@babel/eslint-parser": "7.17.0", 19 | "@vue/cli-plugin-babel": "4.5.15", 20 | "@vue/cli-plugin-eslint": "4.5.15", 21 | "@vue/cli-service": "4.5.15", 22 | "@vue/eslint-config-prettier": "6.0.0", 23 | "babel-eslint": "10.1.0", 24 | "eslint": "6.7.2", 25 | "eslint-config-algolia": "20.0.0", 26 | "eslint-plugin-import": "2.25.4", 27 | "eslint-plugin-prettier": "3.3.1", 28 | "eslint-plugin-vue": "6.2.2", 29 | "prettier": "2.2.1", 30 | "vue-template-compiler": "2.6.11" 31 | }, 32 | "browserslist": [ 33 | "> 1%", 34 | "last 2 versions", 35 | "not ie <= 8" 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/algolia/create-instantsearch-app/6a1124077ebcdb860b507f2d575e0deb354732a1/src/templates/Vue InstantSearch/public/favicon.png -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | {{name}} 14 | 15 | 16 | 19 |
20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/templates/Vue InstantSearch/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import InstantSearch from 'vue-instantsearch'; 3 | import App from './App.vue'; 4 | 5 | Vue.config.productionTip = false; 6 | 7 | Vue.use(InstantSearch); 8 | 9 | new Vue({ 10 | render: h => h(App), 11 | }).$mount('#app'); 12 | -------------------------------------------------------------------------------- /src/utils/__tests__/__snapshots__/index.test.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`checkAppName throws with correct error message 1`] = ` 4 | "Could not create a project called \\"./project-name\\" because of npm naming restrictions. 5 | - name cannot start with a period 6 | - name can only contain URL-friendly characters" 7 | `; 8 | --------------------------------------------------------------------------------