kirbydesign / designsystem

Kirby Design System
https://cookbook.kirby.design
MIT License
82 stars 22 forks source link

[RESEARCH] Research & Reconsider Library Aliases #1775

Closed MadsBuchmann closed 8 months ago

MadsBuchmann commented 2 years ago

Describe the housekeeping request

I would like for us to reconsider how we alias imports from @kirbydesign/core in the designsystem package.

With the current setup a symlink is created from node_modules/@kirbydesign/core to libs/core on npm install due to the current configuration in package.json:

// package.json
{
   ...
    "devDependencies": {
      ...
      "@kirbydesign/core": "file:libs/core",
      ...
   }
  ...
}

I would like to investigate if this is in any way bad pratice. I'm personally a bit unsure if it can result in any problems with for example the NGCC compiler. It seems circular to me that a dependency in package.json is actually the files in the library themselves.

In many ways I suppose it does exactly what we want and the NGCC UMD problems (#1740) might just have made me a tad paranoid.

But I can't help but think why the ionic framework repo, which seems to largely have inspired the structure of this repository, has theirs setup the way they do.

They seems to rely on the path property in their tsconfig.json file if I understand correctly.

What are the pros and cons? Is it something we should consider? If we moved to using the tsconfig.json path how would we handle scss files, which is not compiled with ts?

Have you considered any alternatives?

Let it be as is. Consider changing it up if it ever becomes a problem.

RasmusKjeldgaard commented 2 years ago

Timeboxed for 2 days.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because of no recent activity. It will be closed in 10 weeks if no further activity occurs. Thank you for your contributions.

MadsBuchmann commented 2 years ago

I also think it is worth considering using NX for setting up stencil: https://ionicframework.com/blog/building-react-and-angular-component-libraries-with-stencil-and-nx/