Gathering detailed insights and metrics for @ns3/nx-serverless
Gathering detailed insights and metrics for @ns3/nx-serverless
npm install @ns3/nx-serverless
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (99.37%)
JavaScript (0.32%)
Shell (0.31%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
1,361,384
Last Day
937
Last Week
4,786
Last Month
19,849
Last Year
461,905
MIT License
62 Stars
314 Commits
22 Forks
6 Watchers
1 Branches
8 Contributors
Updated on Jan 12, 2025
Minified
Minified + Gzipped
Latest Version
5.6.0
Package Id
@ns3/nx-serverless@5.6.0
Unpacked Size
75.80 kB
Size
20.80 kB
File Count
81
NPM Version
10.8.2
Node Version
20.18.0
Published on
Oct 23, 2024
Cumulative downloads
Total Downloads
Last Day
10.8%
937
Compared to previous day
Last Week
11.7%
4,786
Compared to previous week
Last Month
23.7%
19,849
Compared to previous month
Last Year
-31.8%
461,905
Compared to previous year
A simple plugin for running sls commands in nx monorepo. It executes serverless commands in specific app directory. It is configured to support nx cache out of the box for build and deploy commands.
npm i -D @ns3/nx-serverless
serverless-esbuild
Default plugin used in generation is serverless-esbuild
.
It supports all providers, nx cache as far as output of serverless is concerned, but it doesn't work with incremental builds.
nx generate @ns3/nx-serverless:app my-app-name
@ns3/nx-serverless/plugin
⚠️ Warning: this plugin is experimental and can change without major version bump.
You can opt in to use experimental @ns3/nx-serverless/plugin
.
It supports only aws
as a provider, but works both with nx cache and incremental build.
It uses @nx/webpack:webpack
executor to compile the code and is independent of serverless framework.
To achieve that it uses withPatterns
plugin to find which files to compile.
It means that you need to create and follow file naming pattern for your handlers.
The default one is './src/handlers/**/handler.ts'
You can use withExternals
plugin to exclude certain dependencies from the bundle (default /^@aws-sdk\//
excludes aws sdk in v3).
nx generate @ns3/nx-serverless:app my-app-name --plugin @ns3/nx-serverless/plugin
Rationale: making build step independent of serverless framework allows us to cache build process. This means that changing serverless config won't trigger rebuild of the whole app. It makes it also easy to replace webpack with other bundler like rspack etc.
If you want to use executor for build other than @nx/webpack you can.
The only requirement is for build executor to have outputPath
option defined and support for --watch
flag.
Of course, you will have to provide equivalent of withPatterns
and withExternals
plugins.
nx run my-app-name:package
nx run my-app-name:serve
nx run my-app-name:deploy
nx run my-app-name:remove
nx run my-app-name:lint
nx run my-app-name:test
To control Serverless stage
param you can use
--stage
flag, but that won't get forwarded to dependant tasks.
1nx run my-app-name:deploy --stage my-stage
STAGE
env variable, package
and deploy
targets are configured to take it into account.
As a bonus you can use it later to also configure e2e tests for your service etc.
1STAGE=my-stage nx run my-app-name:deploy
Should you need a more specific command that is not included you can run it like:
nx run my-app-name:sls logs
nx run my-app-name:sls invoke local
All arguments are forwarded.
If there is an argument that conflicts with Nx or this executor simply suffix it with _
.
For example:
--help
--help_
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
6 existing vulnerabilities detected
Details
Reason
Found 1/7 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More