lerna-to-lambda (l2l) is a specialized utility designed for developers working with Lerna monorepos who need to deploy individual packages as AWS Lambda functions. At version 0.3.1, this tool facilitates the creation of compact, standalone deployment archives by intelligently bundling a specific monorepo package with only its necessary dependencies. It resolves the common challenge of dealing with hoisted `node_modules` in Lerna projects by copying direct and recursive subdependencies into a single `node_modules` structure within the output directory. A key differentiator is its ability to correctly handle both external npm packages and internal, inter-dependent monorepo packages, ensuring a self-contained runtime environment for Lambda. By default, it excludes `aws-sdk`, assuming it's provided by the Lambda runtime. While a powerful bundling solution, it is not a package manager itself; users must ensure all dependencies are installed via `yarn` or `npm` prior to execution. Its release cadence is likely feature-driven given its current version number.
npm install lerna-to-lambdaVerified import paths — ran on the pinned version, not inferred.
Demonstrates adding `lerna-to-lambda` as a dev dependency and integrating its `l2l` command into a TypeScript project's build workflow to create Lambda deployment packages.
Always run `yarn install` or `npm install` in your monorepo root to ensure `node_modules` is populated before invoking `l2l`.
Thoroughly test bundled Lambda functions after running `l2l`. Pay close attention to packages that might be sensitive to their location or to multiple versions of the same dependency. Consider using a `nohoist` strategy for problematic packages in Lerna if issues persist.
If `aws-sdk` is explicitly needed in your bundle, review `l2l` CLI options (e.g., `--no-omit-aws-sdk`) to include it. Verify the Lambda runtime's `aws-sdk` version compatibility with your function's requirements.
Ensure 'my-internal-monorepo-package' is listed in the `package.json` dependencies of the target Lambda package. Verify that Lerna has correctly linked it before running `l2l`.
Run `yarn install` or `npm install` in your monorepo root to ensure all external dependencies are installed. Confirm `l2l` is running *after* this installation step in your build process.
Ensure the user executing `l2l` has write permissions to the specified output directory. You might need to adjust directory permissions or run the command with elevated privileges (e.g., `sudo`, or correct user setup in CI/CD).
No dependency data recorded yet.