Skip to content

Commit

Permalink
Search UI Dependency Update (#1101)
Browse files Browse the repository at this point in the history
* updates, remove storybook

* updates to workflows

* replace react-scripts with vite

* update package name and scripts

* fixes eslint
  • Loading branch information
joemcelroy authored Jan 6, 2025
1 parent dda38ce commit da556cc
Show file tree
Hide file tree
Showing 41 changed files with 8,367 additions and 15,631 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ on:
pull_request_target:
types: [opened]
paths:
- '**.asciidoc'
- '**.jpg'
- '**.png'
- '**.gif'
- "**.asciidoc"
- "**.jpg"
- "**.png"
- "**.gif"

permissions:
pull-requests: write
Expand All @@ -19,5 +19,5 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.event.repository.name }}
preview-path: 'guide/index.html'
preview-path: "guide/index.html"
pr: ${{ github.event.pull_request.number }}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.14.1
20.16.0
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ The [Search UI docs](https://www.elastic.co/guide/en/search-ui/current/overview.

Before building the docs locally make sure you have:

* Docker
* Python 3
* [elastic/docs](https://github.com/elastic/docs) cloned locally
- Docker
- Python 3
- [elastic/docs](https://github.com/elastic/docs) cloned locally

Assuming your local copy of the elastic/docs repo is in the same repo as your local copy of this repo, run this command from inside your local copy of this repo:

Expand Down
41 changes: 21 additions & 20 deletions examples/sandbox/.gitignore
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
9 changes: 5 additions & 4 deletions examples/sandbox/README.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Search UI sandbox
# React + Vite

This sandbox app is a simple example of how to use the Search UI library and also serves as a development aid.
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

See the [Contributing guide](../../CONTRIBUTING.md#sandbox) for the instructions on running the sandbox.
Currently, two official plugins are available:

A live version can be found [here](https://codesandbox.io/s/github/elastic/search-ui/tree/main/examples/sandbox).
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
38 changes: 38 additions & 0 deletions examples/sandbox/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import js from "@eslint/js";
import globals from "globals";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";

export default [
{ ignores: ["dist"] },
{
files: ["**/*.{js,jsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: "latest",
ecmaFeatures: { jsx: true },
sourceType: "module"
}
},
settings: { react: { version: "18.3" } },
plugins: {
react,
"react-hooks": reactHooks,
"react-refresh": reactRefresh
},
rules: {
...js.configs.recommended.rules,
...react.configs.recommended.rules,
...react.configs["jsx-runtime"].rules,
...reactHooks.configs.recommended.rules,
"react/jsx-no-target-blank": "off",
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true }
]
}
}
];
13 changes: 13 additions & 0 deletions examples/sandbox/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
44 changes: 23 additions & 21 deletions examples/sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,20 @@
"elasticsearch"
],
"version": "1.22.0",
"type": "module",
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint .",
"start": "vite preview"
},
"dependencies": {
"moment": "^2.30.1",
"react-router-dom": "^5.0.0",
"tailwindcss": "^3.4.17"
},
"devDependencies": {
"@elastic/behavioral-analytics-javascript-tracker": "^2.1.3",
"@elastic/datemath": "^5.0.3",
"@elastic/eui": "^49.0.0",
Expand All @@ -25,25 +37,15 @@
"@elastic/search-ui-site-search-connector": "1.22.0",
"@elastic/search-ui-workplace-search-connector": "1.22.0",
"@emotion/react": "^11.8.1",
"autoprefixer": "^10.4.7",
"moment": "^2.24.0",
"postcss": "^8.4.14",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^5.0.0",
"react-scripts": "^5.0.0",
"tailwindcss": "^3.1.6"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
"@eslint/js": "^9.17.0",
"@types/react": "^18.3.17",
"@types/react-dom": "^18.3.5",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^9.17.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.16",
"globals": "^15.13.0",
"vite": "^6.0.3"
}
}
File renamed without changes.
Binary file removed examples/sandbox/public/favicon.ico
Binary file not shown.
43 changes: 0 additions & 43 deletions examples/sandbox/public/index.html

This file was deleted.

15 changes: 0 additions & 15 deletions examples/sandbox/public/manifest.json

This file was deleted.

1 change: 1 addition & 0 deletions examples/sandbox/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions examples/sandbox/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}

.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}

@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}

.card {
padding: 2em;
}

.read-the-docs {
color: #888;
}
1 change: 1 addition & 0 deletions examples/sandbox/src/assets/react.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions examples/sandbox/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}

body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}

h1 {
font-size: 3.2em;
line-height: 1.1;
}

button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}
1 change: 0 additions & 1 deletion examples/sandbox/src/index.js → examples/sandbox/src/main.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter } from "react-router-dom";
import Router from "./Router";
Expand Down
Loading

0 comments on commit da556cc

Please sign in to comment.