Skip to content

Commit

Permalink
chore(examples): clean examples (#502)
Browse files Browse the repository at this point in the history
This formats examples in a unified way and updates their dependencies.
  • Loading branch information
francoischalifour authored Mar 25, 2021
1 parent acbaf8f commit 77a092d
Show file tree
Hide file tree
Showing 43 changed files with 198 additions and 315 deletions.
10 changes: 5 additions & 5 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"buildCommand": false,
"^": "buildCommand is false because `yarn prepare` is going to build packages anyway.",
"sandboxes": [
"/examples/js",
"/examples/react-renderer",
"/examples/query-suggestions-with-rich-hits",
"/examples/query-suggestions",
"/examples/query-suggestions-with-recent-searches",
"/examples/playground",
"/examples/query-suggestions-with-categories",
"/examples/query-suggestions-with-hits",
"/examples/query-suggestions-with-inline-categories",
"/examples/query-suggestions-with-recent-searches",
"/examples/query-suggestions",
"/examples/react-renderer",
"/examples/recently-viewed-items"
],
"node": "14"
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ about: Help us improve Autocomplete.

<!-- Fork the sandbox, reproduce the bug and paste the URL. -->

[**Preview →**](https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/js?file=/app.tsx)
[**Preview →**](https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/playground?file=/app.tsx)

**Steps**

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Opening an issue is very effective way to contribute because many users might al

Before reporting an issue, first check that there is not an already open issue for the same topic using the [issues page](https://github.com/algolia/autocomplete/issues). Don't hesitate to thumb up an issue that corresponds to the problem you have.

Another element that will help us go faster at solving the issue is to provide a reproducible test case. We recommend to [use this CodeSandbox template](https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/js?file=/app.tsx).
Another element that will help us go faster at solving the issue is to provide a reproducible test case. We recommend to [use this CodeSandbox template](https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/playground?file=/app.tsx).

## Code contribution

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ The data that populates the autocomplete results are called [sources](https://au
By configuring just those two required parameters ([`container`](https://autocomplete.algolia.com/docs/autocomplete-js/#container) and [`getSources`](https://autocomplete.algolia.com/docs/autocomplete-js/#getsources)) you can have an interactive autocomplete experience. **The library creates an input and provides the interactivity and accessibility attributes, but you're in full control of the DOM elements to output**.

<p align="center">
<a href="https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/js?file=/app.tsx">
<a href="https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/playground?file=/app.tsx">
<img src="./media/screenshot.png" alt="Screenshot">
</a>
<br>
<br>
<strong>
<a href="https://autocomplete.algolia.com/docs/introduction">Documentation</a> •
<a href="https://autocomplete.algolia.com/docs/api">API</a> •
<a href="https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/js?file=/app.tsx">Playground</a>
<a href="https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/playground?file=/app.tsx">Playground</a>
</strong>
</p>

Expand Down Expand Up @@ -86,7 +86,7 @@ The [documentation](https://autocomplete.algolia.com) offers a few ways to learn
- Read the [**Core Concepts**](https://autocomplete.algolia.com/docs/basic-options) to learn more about underlying principles, like [**Sources**](https://autocomplete.algolia.com/docs/sources) and [**State**](https://autocomplete.algolia.com/docs/state).
- Follow the [**Guides**](https://autocomplete.algolia.com/docs/adding-suggested-searches) to understand how to build common UX patterns.
- Refer to [**API reference**](https://autocomplete.algolia.com/docs/api) for a comprehensive list of parameters and options.
- Try out the [**Playground**](https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/js?file=/app.tsx) where you can fork a basic implementation and play around.
- Try out the [**Playground**](https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/playground?file=/app.tsx) where you can fork a basic implementation and play around.

You can find more on the [documentation](https://autocomplete.algolia.com).

Expand Down Expand Up @@ -122,7 +122,7 @@ Check out sandboxes using Autocomplete:
<thead>
<tr>
<th align="center">
<a href="https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/js?file=/app.tsx">
<a href="https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/playground?file=/app.tsx">
<img src="./media/screenshot.png" alt="E-commerce" width="460">
</a>
</th>
Expand All @@ -137,7 +137,7 @@ Check out sandboxes using Autocomplete:
<tbody>
<tr>
<td align="center">
<a href="https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/js?file=/app.tsx">
<a href="https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/playground?file=/app.tsx">
E-commerce
</a>
</td>
Expand Down
8 changes: 4 additions & 4 deletions cypress/test-apps/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"@algolia/autocomplete-plugin-recent-searches": "1.0.0-alpha.44",
"@algolia/autocomplete-preset-algolia": "1.0.0-alpha.44",
"@algolia/autocomplete-theme-classic": "1.0.0-alpha.44",
"@algolia/client-search": "4.8.3",
"algoliasearch": "4.8.3",
"preact": "10.5.7",
"search-insights": "1.6.3"
"@algolia/client-search": "4.8.6",
"algoliasearch": "4.8.6",
"preact": "10.5.13",
"search-insights": "1.7.1"
},
"devDependencies": {
"parcel-bundler": "1.12.4"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
2 changes: 1 addition & 1 deletion examples/js/index.html → examples/playground/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="shortcut icon" href="favicon.png" type="image/x-icon" />
<link rel="stylesheet" href="style.css" />

<title>Autocomplete JavaScript Playground</title>
<title>Playground | Autocomplete</title>
</head>

<body>
Expand Down
12 changes: 6 additions & 6 deletions examples/js/package.json → examples/playground/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/js-example",
"description": "Autocomplete JavaScript Sandbox",
"name": "@algolia/autocomplete-example-playground",
"description": "Autocomplete playground",
"version": "1.0.0-alpha.44",
"private": true,
"license": "MIT",
Expand All @@ -16,10 +16,10 @@
"@algolia/autocomplete-plugin-recent-searches": "1.0.0-alpha.44",
"@algolia/autocomplete-preset-algolia": "1.0.0-alpha.44",
"@algolia/autocomplete-theme-classic": "1.0.0-alpha.44",
"@algolia/client-search": "4.8.3",
"algoliasearch": "4.8.3",
"preact": "10.5.7",
"search-insights": "1.6.3"
"@algolia/client-search": "4.8.6",
"algoliasearch": "4.8.6",
"preact": "10.5.13",
"search-insights": "1.7.1"
},
"devDependencies": {
"parcel-bundler": "1.12.4"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/query-suggestions-with-categories/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="shortcut icon" href="favicon.png" type="image/x-icon" />
<link rel="stylesheet" href="style.css" />

<title>Autocomplete Query Suggestions with categories</title>
<title>Query Suggestions with categories | Autocomplete</title>
</head>

<body>
Expand Down
8 changes: 4 additions & 4 deletions examples/query-suggestions-with-categories/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/query-suggestion-with-categories",
"description": "Autocomplete Query Suggestions with categories",
"name": "@algolia/autocomplete-example-query-suggestion-with-categories",
"description": "Autocomplete example with Query Suggestions with categories",
"version": "1.0.0-alpha.44",
"private": true,
"license": "MIT",
Expand All @@ -13,8 +13,8 @@
"@algolia/autocomplete-js": "1.0.0-alpha.44",
"@algolia/autocomplete-plugin-query-suggestions": "1.0.0-alpha.44",
"@algolia/autocomplete-theme-classic": "1.0.0-alpha.44",
"algoliasearch": "4.8.3",
"preact": "10.5.7"
"algoliasearch": "4.8.6",
"preact": "10.5.13"
},
"devDependencies": {
"parcel-bundler": "1.12.4"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="shortcut icon" href="favicon.png" type="image/x-icon" />
<link rel="stylesheet" href="style.css" />

<title>Query Suggestions with Rich Hits Sandbox</title>
<title>Query Suggestions with hits | Autocomplete</title>
</head>

<body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/query-suggestions-with-rich-hits-example",
"description": "Autocomplete Query Suggestions With Rich Hits Sandbox",
"name": "@algolia/autocomplete-example-query-suggestions-with-hits",
"description": "Autocomplete example with Query Suggestions and hits",
"version": "1.0.0-alpha.44",
"private": true,
"license": "MIT",
Expand All @@ -11,15 +11,15 @@
},
"dependencies": {
"@algolia/autocomplete-js": "1.0.0-alpha.44",
"@algolia/autocomplete-plugin-algolia-insights": "^1.0.0-alpha.44",
"@algolia/autocomplete-plugin-algolia-insights": "1.0.0-alpha.44",
"@algolia/autocomplete-plugin-query-suggestions": "1.0.0-alpha.44",
"@algolia/autocomplete-plugin-recent-searches": "1.0.0-alpha.44",
"@algolia/autocomplete-preset-algolia": "1.0.0-alpha.44",
"@algolia/autocomplete-theme-classic": "1.0.0-alpha.44",
"@algolia/client-search": "4.8.3",
"algoliasearch": "4.8.3",
"preact": "10.5.7",
"search-insights": "1.6.3"
"@algolia/client-search": "4.8.6",
"algoliasearch": "4.8.6",
"preact": "10.5.13",
"search-insights": "1.7.1"
},
"devDependencies": {
"parcel-bundler": "1.12.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="shortcut icon" href="favicon.png" type="image/x-icon" />
<link rel="stylesheet" href="style.css" />

<title>Autocomplete Query Suggestions with Categories inlined</title>
<title>Query Suggestions with inline categories | Autocomplete</title>
</head>

<body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/qs-with-inline-categories-example",
"description": "Autocomplete Query Suggestions with inline categories",
"name": "@algolia/autocomplete-example-query-suggestions-with-inline-categories",
"description": "Autocomplete example with Query Suggestions with inline categories",
"version": "1.0.0-alpha.44",
"private": true,
"license": "MIT",
Expand All @@ -13,8 +13,8 @@
"@algolia/autocomplete-js": "1.0.0-alpha.44",
"@algolia/autocomplete-plugin-query-suggestions": "1.0.0-alpha.44",
"@algolia/autocomplete-theme-classic": "1.0.0-alpha.44",
"algoliasearch": "4.8.3",
"preact": "10.5.7"
"algoliasearch": "4.8.6",
"preact": "10.5.13"
},
"devDependencies": {
"parcel-bundler": "1.12.4"
Expand Down
2 changes: 1 addition & 1 deletion examples/query-suggestions-with-recent-searches/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="shortcut icon" href="favicon.png" type="image/x-icon" />
<link rel="stylesheet" href="style.css" />

<title>Query Suggestions with Recent Searches Sandbox</title>
<title>Query Suggestions with Recent Searches | Autocomplete</title>
</head>

<body>
Expand Down
8 changes: 4 additions & 4 deletions examples/query-suggestions-with-recent-searches/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/qs-with-rs-example",
"description": "Autocomplete Query Suggestions with Recent Searches Sandbox",
"name": "@algolia/autocomplete-example-query-suggestions-with-recent-searches",
"description": "Autocomplete example with Query Suggestions and Recent Searches",
"version": "1.0.0-alpha.44",
"private": true,
"license": "MIT",
Expand All @@ -14,8 +14,8 @@
"@algolia/autocomplete-plugin-query-suggestions": "1.0.0-alpha.44",
"@algolia/autocomplete-plugin-recent-searches": "1.0.0-alpha.44",
"@algolia/autocomplete-theme-classic": "1.0.0-alpha.44",
"algoliasearch": "4.8.3",
"preact": "10.5.7"
"algoliasearch": "4.8.6",
"preact": "10.5.13"
},
"devDependencies": {
"parcel-bundler": "1.12.4"
Expand Down
2 changes: 1 addition & 1 deletion examples/query-suggestions/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="shortcut icon" href="favicon.png" type="image/x-icon" />
<link rel="stylesheet" href="style.css" />

<title>Query Suggestions Examples</title>
<title>Query Suggestions | Autocomplete</title>
</head>

<body>
Expand Down
8 changes: 4 additions & 4 deletions examples/query-suggestions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/query-suggestions-example",
"description": "Autocomplete Query Suggestions Sandbox",
"name": "@algolia/autocomplete-example-query-suggestions",
"description": "Autocomplete example with Query Suggestions",
"version": "1.0.0-alpha.44",
"private": true,
"license": "MIT",
Expand All @@ -13,8 +13,8 @@
"@algolia/autocomplete-js": "1.0.0-alpha.44",
"@algolia/autocomplete-plugin-query-suggestions": "1.0.0-alpha.44",
"@algolia/autocomplete-theme-classic": "1.0.0-alpha.44",
"algoliasearch": "4.8.3",
"preact": "10.5.7"
"algoliasearch": "4.8.6",
"preact": "10.5.13"
},
"devDependencies": {
"parcel-bundler": "1.12.4"
Expand Down
4 changes: 2 additions & 2 deletions examples/react-renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/react-renderer-example",
"description": "Autocomplete React Renderer example",
"name": "@algolia/autocomplete-example-react-renderer",
"description": "Autocomplete example with React Renderer",
"version": "1.0.0-alpha.44",
"private": true,
"dependencies": {
Expand Down
4 changes: 3 additions & 1 deletion examples/react-renderer/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
name="description"
content="Web site created using create-react-app"
/>

<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>Autocomplete React Renderer</title>

<title>React Renderer | Autocomplete</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
2 changes: 1 addition & 1 deletion examples/recently-viewed-items/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="shortcut icon" href="favicon.png" type="image/x-icon" />
<link rel="stylesheet" href="style.css" />

<title>Recently Viewed Items Sandbox</title>
<title>Recently Viewed Items | Autocomplete</title>
</head>

<body>
Expand Down
10 changes: 5 additions & 5 deletions examples/recently-viewed-items/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algolia/recently-viewed-items-example",
"description": "Autocomplete Recently Viewed Items Sandbox",
"name": "@algolia/autocomplete-example-recently-viewed-items",
"description": "Autocomplete example with Recently Viewed Items",
"version": "1.0.0-alpha.44",
"private": true,
"license": "MIT",
Expand All @@ -13,9 +13,9 @@
"@algolia/autocomplete-js": "1.0.0-alpha.44",
"@algolia/autocomplete-plugin-recent-searches": "1.0.0-alpha.44",
"@algolia/autocomplete-theme-classic": "1.0.0-alpha.44",
"@algolia/client-search": "4.8.3",
"algoliasearch": "4.8.3",
"preact": "10.5.7"
"@algolia/client-search": "4.8.6",
"algoliasearch": "4.8.6",
"preact": "10.5.13"
},
"devDependencies": {
"parcel-bundler": "1.12.4"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"format": "prettier --write .",
"lint:css": "stylelint packages/*/src/**/*.scss",
"lint": "eslint --ext .js,.ts,.tsx .",
"playground:start": "yarn workspace @algolia/js-example start",
"playground:start": "yarn workspace @algolia/autocomplete-example-playground start",
"prepare": "lerna run prepare --no-private",
"release": "shipjs prepare",
"start": "yarn run watch",
Expand Down Expand Up @@ -55,7 +55,7 @@
"@types/react-dom": "^17.0.0",
"@typescript-eslint/eslint-plugin": "2.19.0",
"@typescript-eslint/parser": "2.19.0",
"algoliasearch": "4.8.3",
"algoliasearch": "4.8.6",
"autoprefixer": "10.0.4",
"babel-eslint": "10.1.0",
"babel-loader": "8.2.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@algolia/autocomplete-shared": "1.0.0-alpha.44"
},
"devDependencies": {
"@algolia/client-search": "4.8.3",
"@algolia/client-search": "4.8.6",
"algoliasearch": "4.8.3"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/autocomplete-preset-algolia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@algolia/autocomplete-shared": "1.0.0-alpha.44"
},
"devDependencies": {
"@algolia/client-search": "4.8.3",
"@algolia/client-search": "4.8.6",
"algoliasearch": "4.8.3"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/website/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This documentation offers a few ways to learn about the Autocomplete library:
- Read the [**Core Concepts**](basic-options) to learn more about underlying principles, like [**Sources**](sources) and [**State**](state).
- Follow the [**Guides**](adding-suggested-searches) to understand how to build common UX patterns.
- Refer to [**API reference**](api) for a comprehensive list of parameters and options.
- Try out the [**Playground**](https://codesandbox.io/s/github/algolia/autocomplete.js/tree/next/examples/js?file=/app.tsx) where you can fork a basic implementation and play around.
- Try out the [**Playground**](https://codesandbox.io/s/github/algolia/autocomplete.js/tree/next/examples/playground?file=/app.tsx) where you can fork a basic implementation and play around.

Keep reading to see how to install Autocomplete and build a basic implementation with Algolia.

Expand Down
2 changes: 1 addition & 1 deletion packages/website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
{
label: 'Playground',
to:
'https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/js?file=/app.tsx',
'https://codesandbox.io/s/github/algolia/autocomplete/tree/next/examples/playground?file=/app.tsx',
position: 'right',
},
{
Expand Down
Loading

0 comments on commit 77a092d

Please sign in to comment.