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

chore: Add widget-lib and publish to NPM #2704

Merged
merged 5 commits into from
Jun 22, 2023
Merged

chore: Add widget-lib and publish to NPM #2704

merged 5 commits into from
Jun 22, 2023

Conversation

anxolin
Copy link
Contributor

@anxolin anxolin commented Jun 21, 2023

Summary

This PR adds the widget library to the monorepo (credits to @shoom3301 for implementing the main widget in https://shoom3301.github.io/cow-widget/)

This PR creates a publishable lib (meaning we can push it to NPM). We will also be able to use it in another monorepo project, which will make development easier.

The library has its own tests (i created tests just for the param to URL mapping (we could add more coverage if desired):

image

Last but not least, it adds a way to publish this into production, for that read the lib README for instructions.
For that is uses a custom script that will: copy the README, write the version in the package.json, and publish into NPM

To Test

Just run:
nx test widget-lib

To build:
nx build widget-lib, you will see the artifacts in dist/widget-lib

@vercel
Copy link

vercel bot commented Jun 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
swap-dev 🔄 Building (Inspect) Jun 22, 2023 1:05pm

Copy link
Collaborator

@shoom3301 shoom3301 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing example of addding a new lib!

@shoom3301
Copy link
Collaborator

shoom3301 commented Jun 22, 2023

image

I have this error locally.
Actually, we can just remove the declaration from cowswap/src/libs/widget-lib/src/types.ts

@anxolin anxolin changed the base branch from add-library to develop June 22, 2023 13:05
@anxolin anxolin merged commit b72b190 into develop Jun 22, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 22, 2023
@anxolin anxolin deleted the npm-widget branch August 16, 2023 11:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants