Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DISCUSS] Script for pre-release EUI build testing in consuming projects #1808

Closed
chandlerprall opened this issue Apr 8, 2019 · 14 comments
Closed

Comments

@chandlerprall
Copy link
Contributor

Because node_modules exists within the EUI project dir, yarn linking EUI into another project can create conflicts between dependency versions, most notably with React. Another recurring "issue" when testing EUI linked into another project is forgetting to buildchanges to EUI.

I'd like to add a new script in EUI that mimics a linking behaviour by building & copying the es and lib directories to a specified project, then watch for changes to EUI sources and update the es and lib builds on additional changes.

Something like yarn build-into ~/projects/kibana

@snide
Copy link
Contributor

snide commented Apr 8, 2019

I assume the build would be wiped on a kbn bootstrap? Which is fine. I'm just wondering if you're thinking it's a generic copy of files, or more of symlink like yarn link?

@cchaos
Copy link
Contributor

cchaos commented Apr 8, 2019

I'm always up for whatever makes it easier without having to remember the entire procedure. One thing to note, I think I had trouble getting back to the original EUI without the link. And it most often always requires a yarn clean which takes terribly long. So if it's possible to avoid that, that would be wonderful.

@chandlerprall
Copy link
Contributor Author

I assume the build would be wiped on a kbn bootstrap?

I think I had trouble getting back to the original EUI without the link. And it most often always requires a yarn clean which takes terribly long.

Noted! I've always had problems getting things back in order even when linking / unlinking was successful.

The script can backup the existing es & lib directories and revert them when its process is killed.

@chandlerprall
Copy link
Contributor Author

I'm just wondering if you're thinking it's a generic copy of files, or more of symlink like yarn link?

I was thinking copying the files themselves; symlinks aren't cross-platform (Windows) compatible.

@thompsongl
Copy link
Contributor

I tried some things out today and here's a diff containing a linking/copying script: master...thompsongl:link-eui

Things to note:

  • It's naive. Given Kibana as the dest project, it can hold its own through yarn kbn bootstrap, but can't introduce any new deps. That is, it has to be able to run on the deps currently installed for EUI in that project (probably whatever version is currently on master). This is a limitation of yarn that I'm not sure how to work around.
  • It's destructive. Once you use it, you'll need to yarn install --force (or something) to get the dest project back to normal. This isn't different from what happens today after a yarn unlink, but we can do better.
  • It's inefficient. The build and watch sequences just use yarn build, which take forever. With @chandlerprall's help, we can do better.

Also, this is absolutely not the approach we need to take. I just needed something to better work through upcoming typescript config changes that would give consistent results when synced with Kibana.

@thompsongl
Copy link
Contributor

thompsongl commented Apr 18, 2019

This will likely become a bigger priority: #1822 (comment) (yarn link + reading real file paths + different babel configs)

@thompsongl
Copy link
Contributor

Looked into using yarn pack to be able to more accurately/comprehensively install local EUI in Kibana. Ran into a problem running yarn add after changing the process directory because of node version expectations (Kibana wants 10.15, EUI has 8.15).
Not sure trying to match versions is something we want to do, but it's a blocker for having a script handle all the steps if interacting with yarn

@chandlerprall
Copy link
Contributor Author

chandlerprall commented Jun 25, 2019

Ideally, this thought/script/thing could be expanded to support testing EUI builds against any number of projects. e.g. validate against create-react-app, codesandbox (snapshot a blank project?), etc. This should have the ability to run those projects' test and/or build scripts for validation.

@chandlerprall
Copy link
Contributor Author

Found this tool which may satisfy many of the above constraints/ideas, however:

  • no Windows support
  • uses npm to install, may not be able to configure it to yarn
  • doesn't support incremental builds

https://github.com/ORESoftware/r2g

r2g tests your package after using npm pack and npm install --production. You can use your current test suite for testing, and also write some new smoke tests that are specific to r2g.

@snide snide mentioned this issue Mar 9, 2021
41 tasks
@thompsongl thompsongl changed the title [DISCUSS] yarn linking EUI is unstable [DISCUSS] Script for pre-release EUI build testing in consuming projects Mar 10, 2021
@github-actions
Copy link

github-actions bot commented Sep 7, 2021

👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

@github-actions
Copy link

github-actions bot commented Mar 6, 2022

👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

@github-actions
Copy link

github-actions bot commented Sep 3, 2022

👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

@github-actions
Copy link

github-actions bot commented Mar 5, 2023

👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

@github-actions
Copy link

❌ We're automatically closing this issue due to lack of activity. Please comment if you feel this was done in error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants