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:
Simplified dependency management TypeScript, for example, is now only installed once and needs updating once
Simplified configuration ESLint config, for example, is defined once at the root
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/.
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/.