From d60f8f24922bb23960c9f50cb7144c6210c0e298 Mon Sep 17 00:00:00 2001 From: Italo Fontes Date: Fri, 1 Apr 2022 17:43:15 -0300 Subject: [PATCH 1/5] build: :arrow_up: upgrade dependencies --- astro.config.mjs | 12 +- package.json | 21 +- src/components/Header/Header.astro | 9 - src/components/Header/LanguageSelect.tsx | 14 +- src/components/Header/Search.css | 76 - src/components/Header/Search.tsx | 79 - src/components/Header/SidebarToggle.tsx | 6 +- src/components/PageContent/PageContent.astro | 6 +- src/components/RightSidebar/MoreMenu.astro | 27 +- .../RightSidebar/RightSidebar.astro | 4 +- .../RightSidebar/TableOfContents.tsx | 14 +- .../RightSidebar/ThemeToggleButton.tsx | 8 +- src/config.ts | 13 - src/layouts/MainLayout.astro | 15 +- src/layouts/Test.astro | 23 + src/pages/index.astro | 2 +- tsconfig.json | 6 +- yarn.lock | 2254 +++++++++-------- 18 files changed, 1276 insertions(+), 1313 deletions(-) delete mode 100644 src/components/Header/Search.css delete mode 100644 src/components/Header/Search.tsx create mode 100644 src/layouts/Test.astro diff --git a/astro.config.mjs b/astro.config.mjs index 40635c9..382926f 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,18 +1,12 @@ +import react from '@astrojs/react'; // Full Astro Configuration API Documentation: // https://docs.astro.build/reference/configuration-reference -// @type-check enabled! -// VSCode and other TypeScript-enabled text editors will provide auto-completion, -// helpful tooltips, and warnings if your exported object is invalid. -// You can disable this by removing "@ts-check" and `@type` comments below. // @ts-check export default /** @type {import('astro').AstroUserConfig} */ ({ - renderers: [ - // Enable the Preact renderer to support Preact JSX components. - '@astrojs/renderer-preact', - // Enable the React renderer, for the Algolia search component - '@astrojs/renderer-react', + integrations: [ + react(), ], dist: "dist/firebolt-docs/" diff --git a/package.json b/package.json index 377403f..1aaa830 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "post-build": "node ./post-build.mjs -path https://iq-tech.github.io/firebolt-docs/", "dev": "astro dev", "start": "astro dev", + "astro-build": "astro build", "build": "yarn generate-json-docs && astro build && yarn post-build", "preview": "astro preview", "cms": "npx netlify-cms-proxy-server", @@ -14,13 +15,19 @@ "generate-json-docs": "node scripts/generate-json-docs.js " }, "dependencies": { - "@docsearch/react": "^1.0.0-alpha.28", - "@iq-firebolt/json-schema": "^0.6.0" + "@algolia/client-search": "4.13.0", + "@docsearch/css": "3.0.0", + "@docsearch/react": "3.0.0", + "@iq-firebolt/json-schema": "0.6.0", + "react": "17.0.2", + "react-dom": "17.0.2" }, "devDependencies": { - "@astrojs/renderer-preact": "^0.4.0", - "astro": "^0.22.20", - "gh-pages": "^3.2.3", - "json-schema-to-markdown": "^1.1.1" + "@astrojs/react": "0.0.2", + "@types/react": "17.0.43", + "@types/react-dom": "17.0.14", + "astro": "0.25.4", + "gh-pages": "3.2.3", + "json-schema-to-markdown": "1.1.1" } -} \ No newline at end of file +} diff --git a/src/components/Header/Header.astro b/src/components/Header/Header.astro index ed2639b..8bddbcc 100644 --- a/src/components/Header/Header.astro +++ b/src/components/Header/Header.astro @@ -4,7 +4,6 @@ import * as CONFIG from '../../config.ts'; import SkipToContent from './SkipToContent.astro'; import SidebarToggle from './SidebarToggle.tsx'; import LanguageSelect from './LanguageSelect.tsx'; -import Search from './Search.tsx'; const { currentPage } = Astro.props; const lang = currentPage && getLanguageFromURL(currentPage); @@ -18,17 +17,9 @@ const lang = currentPage && getLanguageFromURL(currentPage);
{KNOWN_LANGUAGE_CODES.length > 1 && } - {CONFIG.ALGOLIA && ( -
- -
- )} diff --git a/src/components/Header/LanguageSelect.tsx b/src/components/Header/LanguageSelect.tsx index 0904dc8..995e089 100644 --- a/src/components/Header/LanguageSelect.tsx +++ b/src/components/Header/LanguageSelect.tsx @@ -1,10 +1,8 @@ -import type { FunctionalComponent } from "preact"; -import { h } from "preact"; import "./LanguageSelect.css"; import { KNOWN_LANGUAGES, langPathRegex } from "../../languages"; -const LanguageSelect: FunctionalComponent<{ lang: string }> = ({ lang }) => { - const handleChangeLanguage = (url, language) => { +const LanguageSelect: React.FC<{ lang: string }> = ({ lang }) => { + function handleChangeLanguage(url, language){ const isDev = url.host === "localhost:3000"; const actualDest = url.pathname.replace(langPathRegex, "/"); @@ -23,7 +21,7 @@ const LanguageSelect: FunctionalComponent<{ lang: string }> = ({ lang }) => { } }; return ( -
+