From f0c03eed3165304c45b6f359f229a7270acdf4a2 Mon Sep 17 00:00:00 2001 From: Tomasz Kajtoch Date: Tue, 11 Jun 2024 15:50:40 +0200 Subject: [PATCH 1/5] feat: remove default docusaurus theme overrides --- packages/website/docusaurus.config.ts | 3 --- packages/website/src/css/custom.css | 30 --------------------------- 2 files changed, 33 deletions(-) delete mode 100644 packages/website/src/css/custom.css diff --git a/packages/website/docusaurus.config.ts b/packages/website/docusaurus.config.ts index 640f1e40cf2..6a369ac0b2a 100644 --- a/packages/website/docusaurus.config.ts +++ b/packages/website/docusaurus.config.ts @@ -49,9 +49,6 @@ const config: Config = { editUrl: 'https://github.com/elastic/eui/tree/main/website/', }, - theme: { - customCss: './src/css/custom.css', - }, } satisfies Preset.Options, ], ], diff --git a/packages/website/src/css/custom.css b/packages/website/src/css/custom.css deleted file mode 100644 index 2bc6a4cfdef..00000000000 --- a/packages/website/src/css/custom.css +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Any CSS included here will be global. The classic template - * bundles Infima by default. Infima is a CSS framework designed to - * work well for content-centric websites. - */ - -/* You can override the default Infima variables here. */ -:root { - --ifm-color-primary: #2e8555; - --ifm-color-primary-dark: #29784c; - --ifm-color-primary-darker: #277148; - --ifm-color-primary-darkest: #205d3b; - --ifm-color-primary-light: #33925d; - --ifm-color-primary-lighter: #359962; - --ifm-color-primary-lightest: #3cad6e; - --ifm-code-font-size: 95%; - --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); -} - -/* For readability concerns, you should choose a lighter palette in dark mode. */ -[data-theme='dark'] { - --ifm-color-primary: #25c2a0; - --ifm-color-primary-dark: #21af90; - --ifm-color-primary-darker: #1fa588; - --ifm-color-primary-darkest: #1a8870; - --ifm-color-primary-light: #29d5b0; - --ifm-color-primary-lighter: #32d8b4; - --ifm-color-primary-lightest: #4fddbf; - --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); -} From 22d16743555769e83d2cb4e1b48f374c7a25a2f8 Mon Sep 17 00:00:00 2001 From: Tomasz Kajtoch Date: Tue, 11 Jun 2024 15:53:48 +0200 Subject: [PATCH 2/5] feat: setup `docusaurus-theme` package --- packages/docusaurus-theme/.gitignore | 8 +++ packages/docusaurus-theme/package.json | 44 ++++++++++++ .../src/components/badge/index.ts | 0 packages/docusaurus-theme/src/index.ts | 13 ++++ .../src/theme/Footer/index.tsx | 47 +++++++++++++ .../src/theme/MDXComponents/index.ts} | 4 +- .../src/theme/Root.tsx | 1 + packages/docusaurus-theme/tsconfig.base.json | 68 +++++++++++++++++++ .../docusaurus-theme/tsconfig.client.json | 17 +++++ packages/docusaurus-theme/tsconfig.json | 26 +++++++ packages/website/docusaurus.config.ts | 4 ++ packages/website/package.json | 1 + yarn.lock | 60 ++++++++++++++-- 13 files changed, 287 insertions(+), 6 deletions(-) create mode 100644 packages/docusaurus-theme/.gitignore create mode 100644 packages/docusaurus-theme/package.json rename packages/{website => docusaurus-theme}/src/components/badge/index.ts (100%) create mode 100644 packages/docusaurus-theme/src/index.ts create mode 100644 packages/docusaurus-theme/src/theme/Footer/index.tsx rename packages/{website/src/theme/MDXComponents/index.js => docusaurus-theme/src/theme/MDXComponents/index.ts} (79%) rename packages/{website => docusaurus-theme}/src/theme/Root.tsx (93%) create mode 100644 packages/docusaurus-theme/tsconfig.base.json create mode 100644 packages/docusaurus-theme/tsconfig.client.json create mode 100644 packages/docusaurus-theme/tsconfig.json diff --git a/packages/docusaurus-theme/.gitignore b/packages/docusaurus-theme/.gitignore new file mode 100644 index 00000000000..0e1641a21b1 --- /dev/null +++ b/packages/docusaurus-theme/.gitignore @@ -0,0 +1,8 @@ +# Dependencies +/node_modules + +# Production +/lib + +yarn-debug.log* +yarn-error.log* diff --git a/packages/docusaurus-theme/package.json b/packages/docusaurus-theme/package.json new file mode 100644 index 00000000000..19e71834cdf --- /dev/null +++ b/packages/docusaurus-theme/package.json @@ -0,0 +1,44 @@ +{ + "name": "@elastic/eui-docusaurus-theme", + "version": "0.1.0", + "description": "EUI theme for Docusaurus", + "private": true, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "build": "tsc --build", + "start": "tsc --watch" + }, + "repository": { + "type": "git", + "url": "https://github.com/tkajtoch/eui.git", + "directory": "packages/docusaurus-theme" + }, + "devDependencies": { + "@docusaurus/types": "^3.4.0", + "@types/react": "^18", + "@types/react-dom": "^18", + "typescript": "~5.4.5" + }, + "main": "lib/index.js", + "exports": { + "./lib/*": "./lib/*", + "./src/*": "./src/*", + ".": { + "default": "./lib/index.js" + } + }, + "dependencies": { + "@docusaurus/core": "^3.4.0", + "@docusaurus/module-type-aliases": "^3.4.0", + "@docusaurus/utils-validation": "^3.4.0", + "@elastic/datemath": "^5.0.3", + "@elastic/eui": "94.5.0", + "@emotion/css": "^11.11.2", + "@emotion/react": "^11.11.4", + "moment": "^2.30.1" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } +} diff --git a/packages/website/src/components/badge/index.ts b/packages/docusaurus-theme/src/components/badge/index.ts similarity index 100% rename from packages/website/src/components/badge/index.ts rename to packages/docusaurus-theme/src/components/badge/index.ts diff --git a/packages/docusaurus-theme/src/index.ts b/packages/docusaurus-theme/src/index.ts new file mode 100644 index 00000000000..cada6cc597a --- /dev/null +++ b/packages/docusaurus-theme/src/index.ts @@ -0,0 +1,13 @@ +import type { Plugin } from '@docusaurus/types'; + +export default function euiDocusaurusTheme(): Plugin { + return { + name: 'eui-docusaurus-theme', + getThemePath() { + return '../lib/theme'; + }, + getTypeScriptThemePath() { + return '../src/theme'; + }, + }; +} diff --git a/packages/docusaurus-theme/src/theme/Footer/index.tsx b/packages/docusaurus-theme/src/theme/Footer/index.tsx new file mode 100644 index 00000000000..488c80f4f16 --- /dev/null +++ b/packages/docusaurus-theme/src/theme/Footer/index.tsx @@ -0,0 +1,47 @@ +import { css } from '@emotion/react'; +import { EuiText, EuiLink, UseEuiTheme, EuiThemeProvider, useEuiMemoizedStyles } from '@elastic/eui'; + +const ELASTIC_LICENSE_URL = "https://github.com/elastic/eui/blob/main/licenses/ELASTIC-LICENSE-2.0.md"; +const SSPL_LICENSE_URL = "https://github.com/elastic/eui/blob/main/licenses/SSPL-LICENSE.md"; + +const getFooterStyles = ({ euiTheme }: UseEuiTheme) => { + return { + root: css` + background: #1C1E23; // Color not available in EUI + border-radius: ${euiTheme.size.s} ${euiTheme.size.s} 0 0; + padding: ${euiTheme.size.l}; + text-align: center; + `, + heart: css` + color: ${euiTheme.colors.accent}; + `, + }; +}; + +const Footer = () => { + const styles = useEuiMemoizedStyles(getFooterStyles); + + return ( + +
+ + EUI is dual-licensed under {' '} + + Elastic License 2.0 + + {' and '} + + Server Side Public License, v 1 + + {' | '} + Crafted with by{' '} + + Elastic + + +
+
+ ); +}; + +export default Footer; diff --git a/packages/website/src/theme/MDXComponents/index.js b/packages/docusaurus-theme/src/theme/MDXComponents/index.ts similarity index 79% rename from packages/website/src/theme/MDXComponents/index.js rename to packages/docusaurus-theme/src/theme/MDXComponents/index.ts index c2c3ecbb8cc..2cec1d9100e 100644 --- a/packages/website/src/theme/MDXComponents/index.js +++ b/packages/docusaurus-theme/src/theme/MDXComponents/index.ts @@ -6,8 +6,8 @@ * Side Public License, v 1. */ -import OriginalMDXComponents from '@theme-original/MDXComponents'; -import { Badge } from '@site/src/components/badge'; +import OriginalMDXComponents from '@theme-init/MDXComponents'; +import { Badge } from '../../components/badge'; const MDXComponents = { ...OriginalMDXComponents, diff --git a/packages/website/src/theme/Root.tsx b/packages/docusaurus-theme/src/theme/Root.tsx similarity index 93% rename from packages/website/src/theme/Root.tsx rename to packages/docusaurus-theme/src/theme/Root.tsx index b00094b7721..150b1f4cbc2 100644 --- a/packages/website/src/theme/Root.tsx +++ b/packages/docusaurus-theme/src/theme/Root.tsx @@ -8,6 +8,7 @@ import { EuiProvider } from '@elastic/eui'; import { Props } from '@theme/Root'; +import '@elastic/eui/dist/eui_theme_light.css'; // Wrap docusaurus root component with // See https://docusaurus.io/docs/swizzling#wrapper-your-site-with-root diff --git a/packages/docusaurus-theme/tsconfig.base.json b/packages/docusaurus-theme/tsconfig.base.json new file mode 100644 index 00000000000..ce236d79b78 --- /dev/null +++ b/packages/docusaurus-theme/tsconfig.base.json @@ -0,0 +1,68 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + /* Emit */ + "target": "ES2020", + "lib": ["ESNext", "DOM"], + "declaration": true, + // These two options will be selectively overridden in each project. + // Utility libraries will have source maps on, but plugins will not. + "declarationMap": false, + "sourceMap": false, + "jsx": "react-jsx", + "jsxImportSource": "@emotion/react", + "importHelpers": true, + "noEmitHelpers": true, + // Avoid accidentally using this config to build + "noEmit": true, + + /* Strict Type-Checking Options */ + "allowUnreachableCode": false, + // Too hard to turn on + "exactOptionalPropertyTypes": false, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + // `process.env` is usually accessed as property + "noPropertyAccessFromIndexSignature": false, + "noUncheckedIndexedAccess": true, + /* strict family */ + "strict": true, + "alwaysStrict": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictBindCallApply": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "useUnknownInCatchVariables": true, + /* Handled by ESLint */ + "noUnusedLocals": false, + "noUnusedParameters": false, + "importsNotUsedAsValues": "remove", + + /* Module Resolution */ + "moduleResolution": "Node", + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "allowJs": true, + "skipLibCheck": true, // @types/webpack and webpack/types.d.ts are not the same thing + "types": [ + "@docusaurus/module-type-aliases" + ] + }, + "include": ["./**/*", "./**/.eslintrc.js"], + "exclude": [ + "node_modules", + "coverage/**", + "**/lib/**/*", + "website/**", + "**/__mocks__/**/*", + "**/__fixtures__/**/*", + "examples/**", + "packages/create-docusaurus/templates/**" + ] +} diff --git a/packages/docusaurus-theme/tsconfig.client.json b/packages/docusaurus-theme/tsconfig.client.json new file mode 100644 index 00000000000..965bee0c991 --- /dev/null +++ b/packages/docusaurus-theme/tsconfig.client.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "noEmit": false, + "incremental": true, + "moduleResolution": "bundler", + "module": "esnext", + "target": "esnext", + "esModuleInterop": true, + "composite": true, + "rootDir": "src", + "outDir": "lib", + "tsBuildInfoFile": "lib/.tsbuildinfo-client" + }, + "include": ["src/client", "src/components", "src/theme", "src/*.d.ts"], + "exclude": ["**/__tests__/**"] +} diff --git a/packages/docusaurus-theme/tsconfig.json b/packages/docusaurus-theme/tsconfig.json new file mode 100644 index 00000000000..886a780da95 --- /dev/null +++ b/packages/docusaurus-theme/tsconfig.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "references": [{"path": "./tsconfig.client.json"}], + "compilerOptions": { + "target": "ES2020", + "lib": ["ESNext"], + "declaration": true, + "sourceMap": true, + "jsx": "react-jsx", + "jsxImportSource": "@emotion/react", + "noEmitHelpers": true, + "incremental": true, + "tsBuildInfoFile": "lib/.tsbuildinfo", + "rootDir": "src", + "outDir": "lib", + "esModuleInterop": true, + "strict": true, + "skipLibCheck": true, + "moduleResolution": "Node", + "types": [ + "@docusaurus/module-type-aliases" + ] + }, + "include": ["src/**/*"], + "exclude": ["src/client", "src/theme", "**/__tests__/**"] +} diff --git a/packages/website/docusaurus.config.ts b/packages/website/docusaurus.config.ts index 6a369ac0b2a..bdec4dbc64a 100644 --- a/packages/website/docusaurus.config.ts +++ b/packages/website/docusaurus.config.ts @@ -35,6 +35,10 @@ const config: Config = { locales: ['en'], }, + themes: [ + '@elastic/eui-docusaurus-theme', + ], + presets: [ [ 'classic', diff --git a/packages/website/package.json b/packages/website/package.json index a903764cd47..5b2e7671c21 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -19,6 +19,7 @@ "@docusaurus/preset-classic": "3.4.0", "@elastic/datemath": "^5.0.3", "@elastic/eui": "94.5.0", + "@elastic/eui-docusaurus-theme": "workspace:^", "@emotion/css": "^11.11.2", "@emotion/react": "^11.11.4", "@mdx-js/react": "^3.0.0", diff --git a/yarn.lock b/yarn.lock index fc5126f1ddd..564fbd14fbc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5171,7 +5171,7 @@ __metadata: languageName: node linkType: hard -"@docusaurus/core@npm:3.4.0": +"@docusaurus/core@npm:3.4.0, @docusaurus/core@npm:^3.4.0": version: 3.4.0 resolution: "@docusaurus/core@npm:3.4.0" dependencies: @@ -5309,7 +5309,7 @@ __metadata: languageName: node linkType: hard -"@docusaurus/module-type-aliases@npm:3.4.0": +"@docusaurus/module-type-aliases@npm:3.4.0, @docusaurus/module-type-aliases@npm:^3.4.0": version: 3.4.0 resolution: "@docusaurus/module-type-aliases@npm:3.4.0" dependencies: @@ -5614,7 +5614,7 @@ __metadata: languageName: node linkType: hard -"@docusaurus/types@npm:3.4.0": +"@docusaurus/types@npm:3.4.0, @docusaurus/types@npm:^3.4.0": version: 3.4.0 resolution: "@docusaurus/types@npm:3.4.0" dependencies: @@ -5648,7 +5648,7 @@ __metadata: languageName: node linkType: hard -"@docusaurus/utils-validation@npm:3.4.0": +"@docusaurus/utils-validation@npm:3.4.0, @docusaurus/utils-validation@npm:^3.4.0": version: 3.4.0 resolution: "@docusaurus/utils-validation@npm:3.4.0" dependencies: @@ -5752,6 +5752,28 @@ __metadata: languageName: unknown linkType: soft +"@elastic/eui-docusaurus-theme@workspace:^, @elastic/eui-docusaurus-theme@workspace:packages/docusaurus-theme": + version: 0.0.0-use.local + resolution: "@elastic/eui-docusaurus-theme@workspace:packages/docusaurus-theme" + dependencies: + "@docusaurus/core": "npm:^3.4.0" + "@docusaurus/module-type-aliases": "npm:^3.4.0" + "@docusaurus/types": "npm:^3.4.0" + "@docusaurus/utils-validation": "npm:^3.4.0" + "@elastic/datemath": "npm:^5.0.3" + "@elastic/eui": "npm:94.5.0" + "@emotion/css": "npm:^11.11.2" + "@emotion/react": "npm:^11.11.4" + "@types/react": "npm:^18" + "@types/react-dom": "npm:^18" + moment: "npm:^2.30.1" + typescript: "npm:~5.4.5" + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + languageName: unknown + linkType: soft + "@elastic/eui-monorepo@workspace:.": version: 0.0.0-use.local resolution: "@elastic/eui-monorepo@workspace:." @@ -9916,6 +9938,15 @@ __metadata: languageName: node linkType: hard +"@types/react-dom@npm:^18": + version: 18.3.0 + resolution: "@types/react-dom@npm:18.3.0" + dependencies: + "@types/react": "npm:*" + checksum: 10c0/6c90d2ed72c5a0e440d2c75d99287e4b5df3e7b011838cdc03ae5cd518ab52164d86990e73246b9d812eaf02ec351d74e3b4f5bd325bf341e13bf980392fd53b + languageName: node + linkType: hard + "@types/react-dom@npm:^18.0.0, @types/react-dom@npm:^18.2.6": version: 18.2.6 resolution: "@types/react-dom@npm:18.2.6" @@ -36133,6 +36164,16 @@ __metadata: languageName: node linkType: hard +"typescript@npm:~5.4.5": + version: 5.4.5 + resolution: "typescript@npm:5.4.5" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10c0/2954022ada340fd3d6a9e2b8e534f65d57c92d5f3989a263754a78aba549f7e6529acc1921913560a4b816c46dce7df4a4d29f9f11a3dc0d4213bb76d043251e + languageName: node + linkType: hard + "typescript@patch:typescript@npm%3A4.5.3#optional!builtin": version: 4.5.3 resolution: "typescript@patch:typescript@npm%3A4.5.3#optional!builtin::version=4.5.3&hash=f1b8ea" @@ -36153,6 +36194,16 @@ __metadata: languageName: node linkType: hard +"typescript@patch:typescript@npm%3A~5.4.5#optional!builtin": + version: 5.4.5 + resolution: "typescript@patch:typescript@npm%3A5.4.5#optional!builtin::version=5.4.5&hash=5adc0c" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10c0/db2ad2a16ca829f50427eeb1da155e7a45e598eec7b086d8b4e8ba44e5a235f758e606d681c66992230d3fc3b8995865e5fd0b22a2c95486d0b3200f83072ec9 + languageName: node + linkType: hard + "uglify-js@npm:^3.1.4": version: 3.17.4 resolution: "uglify-js@npm:3.17.4" @@ -37799,6 +37850,7 @@ __metadata: "@docusaurus/types": "npm:3.4.0" "@elastic/datemath": "npm:^5.0.3" "@elastic/eui": "npm:94.5.0" + "@elastic/eui-docusaurus-theme": "workspace:^" "@emotion/css": "npm:^11.11.2" "@emotion/react": "npm:^11.11.4" "@mdx-js/react": "npm:^3.0.0" From 6650e9325a823906bfd371ee1ca90c09860dea29 Mon Sep 17 00:00:00 2001 From: Tomasz Kajtoch Date: Tue, 18 Jun 2024 01:36:18 +0200 Subject: [PATCH 3/5] chore: update website package name --- packages/website/package.json | 4 +-- yarn.lock | 48 +++++++++++++++++------------------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/website/package.json b/packages/website/package.json index 5b2e7671c21..371a8b9f3d4 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { - "name": "website", - "version": "0.0.0", + "name": "@elastic/eui-website", + "version": "0.1.0", "private": true, "scripts": { "docusaurus": "docusaurus", diff --git a/yarn.lock b/yarn.lock index 564fbd14fbc..46979235300 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5782,6 +5782,30 @@ __metadata: languageName: unknown linkType: soft +"@elastic/eui-website@workspace:packages/website": + version: 0.0.0-use.local + resolution: "@elastic/eui-website@workspace:packages/website" + dependencies: + "@docusaurus/core": "npm:3.4.0" + "@docusaurus/module-type-aliases": "npm:3.4.0" + "@docusaurus/preset-classic": "npm:3.4.0" + "@docusaurus/tsconfig": "npm:3.4.0" + "@docusaurus/types": "npm:3.4.0" + "@elastic/datemath": "npm:^5.0.3" + "@elastic/eui": "npm:94.5.0" + "@elastic/eui-docusaurus-theme": "workspace:^" + "@emotion/css": "npm:^11.11.2" + "@emotion/react": "npm:^11.11.4" + "@mdx-js/react": "npm:^3.0.0" + clsx: "npm:^2.0.0" + moment: "npm:^2.30.1" + prism-react-renderer: "npm:^2.3.0" + react: "npm:^18.0.0" + react-dom: "npm:^18.0.0" + typescript: "npm:~5.2.2" + languageName: unknown + linkType: soft + "@elastic/eui@npm:94.5.0": version: 94.5.0 resolution: "@elastic/eui@npm:94.5.0" @@ -37839,30 +37863,6 @@ __metadata: languageName: node linkType: hard -"website@workspace:packages/website": - version: 0.0.0-use.local - resolution: "website@workspace:packages/website" - dependencies: - "@docusaurus/core": "npm:3.4.0" - "@docusaurus/module-type-aliases": "npm:3.4.0" - "@docusaurus/preset-classic": "npm:3.4.0" - "@docusaurus/tsconfig": "npm:3.4.0" - "@docusaurus/types": "npm:3.4.0" - "@elastic/datemath": "npm:^5.0.3" - "@elastic/eui": "npm:94.5.0" - "@elastic/eui-docusaurus-theme": "workspace:^" - "@emotion/css": "npm:^11.11.2" - "@emotion/react": "npm:^11.11.4" - "@mdx-js/react": "npm:^3.0.0" - clsx: "npm:^2.0.0" - moment: "npm:^2.30.1" - prism-react-renderer: "npm:^2.3.0" - react: "npm:^18.0.0" - react-dom: "npm:^18.0.0" - typescript: "npm:~5.2.2" - languageName: unknown - linkType: soft - "websocket-driver@npm:>=0.5.1, websocket-driver@npm:^0.7.4": version: 0.7.4 resolution: "websocket-driver@npm:0.7.4" From af295296868202610b109878052964aedeabcbe9 Mon Sep 17 00:00:00 2001 From: Tomasz Kajtoch Date: Tue, 18 Jun 2024 01:36:38 +0200 Subject: [PATCH 4/5] chore: add README to `docusaurus-theme` and `website` packages --- packages/docusaurus-theme/README.md | 42 ++++++++++++++++++++ packages/website/README.md | 60 ++++++++++++++++++----------- 2 files changed, 80 insertions(+), 22 deletions(-) create mode 100644 packages/docusaurus-theme/README.md diff --git a/packages/docusaurus-theme/README.md b/packages/docusaurus-theme/README.md new file mode 100644 index 00000000000..3f3780c502f --- /dev/null +++ b/packages/docusaurus-theme/README.md @@ -0,0 +1,42 @@ +# EUI Docusaurus theme + +`@elastic/eui-docusaurus-theme` + +EUI theme for [Docusaurus](https://docusaurus.io/) made for the new EUI [documentation website](https://eui.elastic.co). + +## Installation and usage + +This package is not yet published to npm. + +## Local development + +### Prerequisites + +This package requires Node.js (check current version in [.nvmrc](/.nvmrc)) to be installed +and [corepack](https://nodejs.org/api/corepack.html) to be enabled. + +### Installing dependencies + +Please run `yarn` to install dependencies: + +```shell +yarn +``` + +### Building the package + +```shell +yarn build +``` + +### Building in watch mode + +Run the following command to build this package whenever a file is edited: + +```shell +yarn start +``` + +Please note that this package is configured to do incremental builds and sometimes `tsc` may not update +the `lib` directory with your latest changes if you rename or delete files. +If that's the case please run `yarn build`. diff --git a/packages/website/README.md b/packages/website/README.md index 0c6c2c27be9..74f8344c4fb 100644 --- a/packages/website/README.md +++ b/packages/website/README.md @@ -1,41 +1,57 @@ -# Website +# EUI documentation website -This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. +This package contains sources of the upcoming new EUI documentation website +built with [Docusaurus](https://docusaurus.io/), an open-source documentation +platform powered by React. -### Installation +This is a **private** package and is not meant to be published to npm. +If you're looking for EUI components or utilities, check out our other [packages](../). -``` -$ yarn -``` +## Local development -### Local Development +### Prerequisites -``` -$ yarn start +Like other packages in this repository, this package requires Node.js (check version in [.nvmrc](/.nvmrc)) +to be installed and [corepack](https://nodejs.org/api/corepack.html) enabled. + +### Installing dependencies + +Please run `yarn` to install dependencies: + +```shell +yarn ``` -This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. +### Building helper packages -### Build +Before you run scripts, it's mandatory to build all local dependency packages: +```shell +yarn workspaces foreach -Rpt --from @elastic/eui-website run build ``` -$ yarn build + +### Running the development server + +Run a local development server with hot reloading capabilities: + +```shell +yarn start ``` -This command generates static content into the `build` directory and can be served using any static contents hosting service. +Please note that this command does not watch for changes in other packages' sources +(e.g., the [theme](../docusaurus-theme) package). Please check out each package's +README to see if watch mode is available and how to use it. -### Deployment +### Building the website -Using SSH: +This step is usually unnecessary to run locally unless you're testing production builds. -``` -$ USE_SSH=true yarn deploy +```shell +yarn build ``` -Not using SSH: +### Running type checks +```shell +yarn typecheck ``` -$ GIT_USER= yarn deploy -``` - -If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. From d58d07c5533593fbd4871adb1ee3155fa34b65a1 Mon Sep 17 00:00:00 2001 From: Tomasz Kajtoch Date: Tue, 18 Jun 2024 01:47:15 +0200 Subject: [PATCH 5/5] chore: move `.prettierrc` back to the root directory --- packages/eui/.prettierrc => .prettierrc | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/eui/.prettierrc => .prettierrc (100%) diff --git a/packages/eui/.prettierrc b/.prettierrc similarity index 100% rename from packages/eui/.prettierrc rename to .prettierrc