0

This is the context: I have two separate projects that have a common layer of components.

Both projects are on gitlab on separate repos and both have gitlab CI pipelines that helps us with deploy.

In project 1 (the builder) we have a layer of components that we can rearrange and reposition.

In project 2 we use the same layer to display those components in their respective position / order as we set it on builder.

Right now, when we do modifications on those components, we just copy/paste them over builder project so we can ensure the exact same thing is shown on both sides.

I would like to take that layer of components and move it outside and import it in those 2 projects. I just don't know where i should start to do this and if this is possible to work with current CI flow we have

Something like:

<!-- ON THE BUILDER -->
<div class="builder">
  <div class="other-stuff"></div>
  <components-layer>
    <component-one :editable="true" />
    <component-two :editable="true" />
    <component-three :editable="true" />
  </components-layer>
</div>


<!-- ON THE CLIENT VIEW -->
<div class="client-view">
  <div class="bla-bla-stuff"></div>
  <components-layer>
    <component-one />
    <component-two />
    <component-three />
  </components-layer>
</div>
John
  • 1,081
  • 1
  • 9
  • 34
  • This common component, did you install it as a package? – Yom T. Apr 22 '20 at 08:47
  • no, nothing is installed. everything is written by us – John Apr 22 '20 at 10:30
  • Then you probably should. Given it's imported in multiple projects. In other words, do a repo for this shared component and have the projects (builder & client) install and import it. And let your package manager of choice handle the versions. – Yom T. Apr 22 '20 at 10:38
  • @YomS. so i should publish it on npm? is there any other solution where we don't publish publicly this package (maybe without payment)? – John Apr 22 '20 at 13:03
  • 1
    It doesn't necessarily have to be a public package, you could actually install a private package. I don't personally use GitLab, but [this doc](https://docs.gitlab.com/ee/user/packages/npm_registry/#installing-a-package) should get you started. – Yom T. Apr 22 '20 at 13:20
  • If you don't need the package be on the cloud, you could also [install it locally](https://stackoverflow.com/a/17371987/3634538). – Yom T. Apr 22 '20 at 13:26

0 Answers0