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

Link KDS to Kolibri via webpack aliases rather than using yarn link #10847

Closed
MisRob opened this issue Jun 14, 2023 · 3 comments · Fixed by #11446
Closed

Link KDS to Kolibri via webpack aliases rather than using yarn link #10847

MisRob opened this issue Jun 14, 2023 · 3 comments · Fixed by #11446
Assignees
Labels
help wanted Open source contributors welcome TAG: dev experience Build performance, linting, debugging...

Comments

@MisRob
Copy link
Member

MisRob commented Jun 14, 2023

Add commands to Kolibri's package.json (e.g. yarn run devserver-with-kds and yarn run devserver-hot-with-kds) that will run Kolibri's development server but with a local kolibri-design-system repository (KDS) instead of node_modules KDS. Using these commands removes the need to use yarn link completely for developing with a local version of KDS in Kolibri.

This would also close #10809 since if a new approach works well for developers, we won't need to use yarn link anymore.

Motivation

There's currently a problem with using yarn link to link KDS to Kolibri (#10809). Also, yarn link is inefficient, especially when there's a need to switch between KDS version defined in Kolibri's package.json and local KDS frequently. I believe this would also help us to encourage contributors to work on KDS, since you'd need one simple command to run Kolibri with local KDS instead of several steps needed to yarn link.

Implementation

  • The new commands will utilize a webpack alias for kolibri-design-system that will resolve to a local location of the KDS repository (this should override node_modules KDS). You can see A better alternative to npm/yarn link for front-end web development.
  • By default, the alias could be resolved to kolibri-design-system directory that's at the same level as kolibri directory, but ideally it would be configurable.
  • @rtibbles suggests we "add an option to the kolibri tools build command that lets you set aliases, and then have a standard yarn command that just takes a path for KDS"
  • I don't expect any troubles but may be good to experiment with a quick draft implementation before polishing all details at first just to find out if this approach works in our webpack environment.
  • One more note from @rtibbles: "I think the main complexity will just be working out how to format an alias as a command line argument, the rest should just be passing it through to the webpack configuration."
@Jaspreet-singh-1032
Copy link
Contributor

Hello @MisRob, please assign this issue to me.

@MisRob
Copy link
Member Author

MisRob commented Oct 18, 2023

Hi @Jaspreet-singh-1032, great, this would be so helpful for everyone working on KDS. Thanks once again for volunteering your time and energy.

@MisRob
Copy link
Member Author

MisRob commented Oct 18, 2023

@Jaspreet-singh-1032 Let us know how it goes. Feel free to open a draft PR with work in progress if there will be anything it'd be good to chat about. This may need a bit of research and playing around. Hopefully it'll be doable. There are some good pointers by @rtibbles in the issue description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Open source contributors welcome TAG: dev experience Build performance, linting, debugging...
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants