Open goldbergyoni opened 2 years ago
@rluvaton @DanielGluskin Kindly have a look here, I'd like to brainstorm with both of you about this soon 🙏
- Make 'em share Jest and TS config (how? this should be discussed)
for jest, we could have one common config file and each file require and export it (this will enable to edit config based on the specific library)
for typescript, in case it doesn't search in the parent folder and the parent of the parent folder (how does it called again?) we could use the extends
option in the tsconfig file
- Make 'em have the same set of package.json scripts (e.g., test, build, dev, etc)
Great idea!
- Use a publishing tool like np to prevent silly mistakes
I've not used this but it looks like it's requiring user interaction, and instead, we should use an automated one.
I recommend using semantic-release
.
I'm using it in some of my NPM packages and it works great, it reads your commits messages and based on that it increases the package version (commits should be in a certain format)
- Create index file for every lib that is solely an interface to public functions/modules
Agree, this is really important IMO
- README per package with the same format
Sound great!
- Write very few E2E that publish the package and then consume it like a user (can detect packaging or package.json issues)
Agree, I saw that currently, we use npm link
, npm link doesn't reflect real-world usage and has problems, instead, I recommend using a local registry like verdaccio
which is really easy to set up and use (I've used it before)
apparently, in create-react-app
they switched to it too - Twitter post by Dan Abramov
- Other ideas here
The link is broken 😢
for jest, we could have one common config
Jest has a dedicated mechanism for this - Preset
I've not used this but it looks like it's requiring user interaction, and instead, we should use an automated one.
I'm pretty sure np can be automated, although not sure if user interaction is not the better way to publish. Do you run it locally or from CI?
The link is broken
Weirdly enough, the post was removed from the web. Here is an archived version:
I'm pretty sure np can be automated, although not sure if user interaction is not the better way to publish. Do you run it locally or from CI?
From CI, yeah I see np
can be automated after all
Concern - We have a bunch of libraries like logger, auth, and more. Currently, they hold different configuration/structure and also lack some fundamental standards, let's nail this?
The list: