guardian / tag-janitor

Placeholder description: @stephengeller created this with repo-genesis
0 stars 0 forks source link

chore: Move to NPM workspaces #292

Closed akash1810 closed 2 years ago

akash1810 commented 2 years ago

It'll be easier to review this PR commit by commit.

What does this change?

In this change we move to using NPM workspaces, making the repository more like a mono-repo. This has a few benefits, including:

Other necessary changes

There are some other necessary changes to achieve this, which actually provide some benefit.

esbuild

Use esbuild to bundle the lambda. This is because NPM workspaces installs all dependencies into node_modules at the root. We need to include some dependencies in the lambda artifact, but NPM does not support installing to a custom directory.

This has a benefit of producing a smaller build artifact (from 43240590 bytes to 18929 bytes).

node version

Move to node 16.16.0. This was originally because it's good practice, but also because it makes usage of esbuild simpler.

This has a benefit of being on an LTS node version.

How to test

Deploy the app and invoke the lambda, it should run successfully.

How can we measure success?

In addition to the benefits listed above, this should also make it easier to adopt https://sst.dev/.