Skip to content

Conversation

@weronikaolejniczak
Copy link
Contributor

@weronikaolejniczak weronikaolejniczak commented Apr 24, 2025

Summary

Closes #8602

On this PR:

  • I remove the src-docs folder
  • I move the illustration.svg that's referenced by a EuiEmptyPrompt story to src/components/empty_prompt folder
  • I move the JSON token files and type declarations to src/themes/json, and update compile-scss.js script to keep the current functionality
  • For now, I just remove src-docs mentions from old release scripts (packages/eui/scripts/update-changelog.js) but we should probably remove them whole soon
  • I remove the yo-doc script and the associated Yeoman generator (we could create a new generator for MDX content in the future: https://github.com/elastic/eui-private/issues/302)
  • I remove prop-loader.js script which couldn't have been migrated to typescript@5 and now that we swapped to the new docs we can proceed with Upgrade typescript to latest v5 #7344
  • I update the wiki documentation

QA

  • When you run yarn lint-es in packages/eui, it should run linter without any issues
  • When you run yarn start in packages/eui, it should launch Storybook
  • When you run yarn build in packages/eui, it should copy files from src/themes/json to /dist
  • EuiEmptyPrompt stories display correctly
  • Verify the new docs and the JSON tokens (src/themes/json) include recent severity palette changes

@weronikaolejniczak weronikaolejniczak added the skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) label Apr 24, 2025
@weronikaolejniczak weronikaolejniczak marked this pull request as ready for review April 24, 2025 13:08
@weronikaolejniczak weronikaolejniczak requested a review from a team as a code owner April 24, 2025 13:08
@weronikaolejniczak weronikaolejniczak self-assigned this Apr 25, 2025
@weronikaolejniczak weronikaolejniczak force-pushed the 8602-old-docs-remove-the-documentation branch from e397ddf to 460eba4 Compare April 29, 2025 10:41
@weronikaolejniczak weronikaolejniczak enabled auto-merge (squash) April 29, 2025 12:11
@acstll acstll self-requested a review April 30, 2025 11:48
Copy link
Contributor

@acstll acstll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks perfect — thank you for tackling this one!

I ran yarn clean in the root before QA/testing. I got unexpected results in 2 of the tests (I hope it's not something related to my environment):

When you run yarn start in packages/eui, it should launch Storybook

it does launch it but there's a compile error, seems related to importing the illustration in empty_prompt.stories.tsx

ERROR in ./src/components/empty_prompt/empty_prompt.stories.tsx
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: /Users/arturo/Developer/eui/packages/eui/src/components/empty_prompt/empty_prompt.stories.tsx: Plugin name should be specified

also, if you run it for the first time, it's going to miss the theme packages, so maybe it's a good idea to suggest in the updated .md files, to run yarn build:workspaces in packages/eui when running locally the first time?

When you run yarn build in packages/eui, it should copy files from src/themes/json to /dist

it does copy the files and it looks correct, however there's also the following error printed:

cp: copyFileSync: could not write to dest file (code=ENOENT):es/themes/json/eui_theme_amsterdam_dark.json
cp: copyFileSync: could not write to dest file (code=ENOENT):optimize/es/themes/json/eui_theme_amsterdam_dark.json
cp: copyFileSync: could not write to dest file (code=ENOENT):lib/themes/json/eui_theme_amsterdam_dark.json
cp: copyFileSync: could not write to dest file (code=ENOENT):optimize/lib/themes/json/eui_theme_amsterdam_dark.json
cp: copyFileSync: could not write to dest file (code=ENOENT):test-env/themes/json/eui_theme_amsterdam_dark.json
cp: copyFileSync: could not write to dest file (code=ENOENT):es/themes/json/eui_theme_amsterdam_light.json
cp: copyFileSync: could not write to dest file (code=ENOENT):optimize/es/themes/json/eui_theme_amsterdam_light.json
cp: copyFileSync: could not write to dest file (code=ENOENT):lib/themes/json/eui_theme_amsterdam_light.json
cp: copyFileSync: could not write to dest file (code=ENOENT):optimize/lib/themes/json/eui_theme_amsterdam_light.json
cp: copyFileSync: could not write to dest file (code=ENOENT):test-env/themes/json/eui_theme_amsterdam_light.json
cp: copyFileSync: could not write to dest file (code=ENOENT):es/themes/json/eui_theme_borealis_dark.json
cp: copyFileSync: could not write to dest file (code=ENOENT):optimize/es/themes/json/eui_theme_borealis_dark.json
cp: copyFileSync: could not write to dest file (code=ENOENT):lib/themes/json/eui_theme_borealis_dark.json
cp: copyFileSync: could not write to dest file (code=ENOENT):optimize/lib/themes/json/eui_theme_borealis_dark.json
cp: copyFileSync: could not write to dest file (code=ENOENT):test-env/themes/json/eui_theme_borealis_dark.json
cp: copyFileSync: could not write to dest file (code=ENOENT):es/themes/json/eui_theme_borealis_light.json
cp: copyFileSync: could not write to dest file (code=ENOENT):optimize/es/themes/json/eui_theme_borealis_light.json
cp: copyFileSync: could not write to dest file (code=ENOENT):lib/themes/json/eui_theme_borealis_light.json
cp: copyFileSync: could not write to dest file (code=ENOENT):optimize/lib/themes/json/eui_theme_borealis_light.json
cp: copyFileSync: could not write to dest file (code=ENOENT):test-env/themes/json/eui_theme_borealis_light.json

EuiEmptyPrompt stories display correctly

there shouldn't be any issues with this, but I couldn't check because of the Storybook webpack compile error

@weronikaolejniczak
Copy link
Contributor Author

@acstll I fixed the issue with Storybook. Now there's no compilation error and the Display / EuiEmptyPrompt - Page Template story displays correctly:

Screenshot 2025-05-05 at 12 19 14

Importing media assets works out-of-box in Storybook. BUT our Babel configuration specifies "inline-react-svg" (which is not necessary in this case because we don't want to import the SVG as a React component but as a file URL) which doesn't play well with the default Webpack configuration ("assets/resource").

"inline-react-svg" ignores images/* patterns though:

[
"inline-react-svg",
{
"ignorePattern": "images/*",
"svgo": {
"plugins": [
{ "cleanupIDs": false },
{ "removeViewBox": false }
]
}
}
],

so what I did is moved the illustration.svg into images subfolder which looks more organized anyway.

I'm looking into the JSON files copying now.

@weronikaolejniczak weronikaolejniczak requested a review from acstll May 5, 2025 11:31
@weronikaolejniczak weronikaolejniczak force-pushed the 8602-old-docs-remove-the-documentation branch from 378df77 to f58b5bf Compare May 5, 2025 13:01
@weronikaolejniczak weronikaolejniczak force-pushed the 8602-old-docs-remove-the-documentation branch from f58b5bf to 89df182 Compare May 5, 2025 13:08
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @weronikaolejniczak

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @weronikaolejniczak

Copy link
Contributor

@acstll acstll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected, thank you for taking care of this! LGTM 🟢

@weronikaolejniczak weronikaolejniczak merged commit 1e78b3f into elastic:main May 6, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Old docs] Remove the documentation

3 participants