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

Migration script for expected types in EventCatalog on updates #796

Open
boyney123 opened this issue Sep 13, 2024 · 3 comments
Open

Migration script for expected types in EventCatalog on updates #796

boyney123 opened this issue Sep 13, 2024 · 3 comments

Comments

@boyney123
Copy link
Collaborator

Use Case

When new packages are added to EventCatalog (lodash for example), the types are also added. Now EventCatalog will bundle the lodash package fine, but people will miss the types as they dev dependency.

We either, add them add project dependencies or write a script to add them to folks dev deps for them when they run the dev command for example.

I'm leaning towards making them a dep of the project....

Proposed Solution

No response

Implementation Notes

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
  • If this issue is labeled needs-discussion, it means the spec has not been finalized yet. Please reach out in the EventCatalog Discord.
@carlosallexandre
Copy link
Contributor

carlosallexandre commented Sep 13, 2024

This PR add these dependencies to EC and create a test emulating the package on production (npm pack) to catch errors such as missing dependency sooner.

But, i think we could go a step further.

The way i see, EC is two projects - the eventcatalog bin and astro project. The bin needs the following packages at production: @parcel/watcher, commander, concurrently, cross-env and rimraf (Now, some of them are installed by the create-eventcatalog bin as devDependencies at the user project). All other dependencies are there for the astro only. So, if we pack only the bin dependencies the final size could be reduced a lot. The other dependencies could be installed at the user directory.

But, how do you distinguish the packages needed for each one? By separating the EC into two projects with workspaces, resulting in the following structure:

.
├── astro             # All the files related to astro
│   ├── ...          
│   └── package.json                   
├── bin               # Files related with `eventcatalog` bin
│   ├── scripts          
│   └── package.json                   
├── examples          # Catalog examples
│   ├── default          
│   └── ...                   
└── ...               # Other config files

The final package would be the bin bundled by tsup along with its dependencies and the astro directory to copy/paste into the user's .eventcatalog-core directory.

@boyney123
Copy link
Collaborator Author

Yeah interesting @carlosallexandre I think you might be ontop something here. Happy to explore it in more details, what would the workspaces look like? Would we need to use turbo or anything? Or just plain workspaces?

@carlosallexandre
Copy link
Contributor

@boyney123 I think just plain workspaces.

I will work on something more concrete by this weekend to show you.

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