Gathering detailed insights and metrics for @hewmen/serverless-plugin-typescript
Gathering detailed insights and metrics for @hewmen/serverless-plugin-typescript
Gathering detailed insights and metrics for @hewmen/serverless-plugin-typescript
Gathering detailed insights and metrics for @hewmen/serverless-plugin-typescript
serverless-plugin-typescript
[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com) [![npm version](https://badge.fury.io/js/serverless-plugin-typescript.svg)](https://badge.fury.io/js/serverless-plugin-typescript) [![Build Status](https://travis-ci.or
@serverless/dashboard-plugin
The Serverless Dashboard plugin
serverless-esbuild
Serverless plugin for zero-config JavaScript and TypeScript code bundling using extremely fast esbuild
serverless-bundle
An extension of the serverless-webpack plugin that bundles your ES6 + TypeScript Node.js Lambda functions.
npm install @hewmen/serverless-plugin-typescript
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
8 Stars
133 Commits
4 Forks
5 Watching
16 Branches
Updated on 09 Aug 2021
TypeScript (100%)
Cumulative downloads
Total Downloads
Last day
3.4%
240
Compared to previous day
Last week
-13.3%
1,267
Compared to previous week
Last month
-10%
6,285
Compared to previous month
Last year
-16%
80,267
Compared to previous year
4
7
Serverless plugin for zero-config Typescript support
Original NPM Module: http://www.npmjs.com/package/serverless-plugin-typescript
This version of serverless-typescript-plugin
fixes symbolic link issues with Windows OS resulting in the following errors:
- EPERM: operation not permitted, scandir...
- EPERM: operation not permitted, symlink...
When attaching the "node_modules" folder to the build
Created PR for original plugin: http://www.github.com/prismagraphql/serverless-plugin-typescript/pull/103
export
, import
, async
, await
, Promise
, ...)sls package
, sls deploy
and sls deploy function
sls invoke local
+ --watch
modeserverless-offline
1yarn add --dev @hewmen/serverless-plugin-typescript
or
npm install --save-dev @hewmen/serverless-plugin-typescript
Add the following plugin to your serverless.yml
:
1plugins: 2 - '@hewmen/serverless-plugin-typescript'
See example folder for a minimal example.
tsconfig.json
The default tsconfig.json
file used by the plugin looks like this:
1{ 2 "compilerOptions": { 3 "preserveConstEnums": true, 4 "strictNullChecks": true, 5 "sourceMap": true, 6 "target": "es5", 7 "outDir": ".build", 8 "moduleResolution": "node", 9 "lib": ["es2015"], 10 "rootDir": "./" 11 } 12}
Note 1: The
outDir
androotDir
options cannot be overwritten.
Note 2: Don't confuse the
tsconfig.json
in this repository with the one mentioned above.
All files from package/include
will be included in the final build file. See Exclude/Include
When using with Google Cloud Functions via the serverless-google-cloudfunctions
plugin, you simply have to provide a main
field in your package.json
:
1{ 2 // ... 3 "main": "handler.js", 4 // .. 5}
And this plugin will automatically compile your typescript correctly. Note
that the field must refer to the compiled file name, namely, ending with a .js
extension.
If a main
field was not found, then this plugin will use index.js
. Before
compilation begins, it will check to see that the file indicated exists with a
.ts
extension before actually trying to compile it.
The normal Serverless deploy procedure will automatically compile with Typescript:
serverless create -t aws-nodejs
serverless deploy
The plugin integrates very well with serverless-offline to simulate AWS Lambda and AWS API Gateway locally.
Add the plugins to your serverless.yml
file and make sure that @hewmen/serverless-plugin-typescript
precedes serverless-offline
as the order is important:
1 plugins: 2 ... 3 - '@hewmen/serverless-plugin-typescript' 4 ... 5 - serverless-offline 6 ...
Run serverless offline
or serverless offline start
to start the Lambda/API simulation.
In comparison to serverless offline
, the start
command will fire an init
and a end
lifecycle hook which is needed for serverless-offline
and e.g. serverless-dynamodb-local
to switch off resources (see below)
Configure your service the same as mentioned above, but additionally add the serverless-dynamodb-local
plugin as follows:
1 plugins: 2 - '@hewmen/serverless-plugin-typescript' 3 - serverless-dynamodb-local 4 - serverless-offline
Run serverless offline start
.
You can reduce the clutter generated by serverless-offline
with --dontPrintOutput
and
disable timeouts with --noTimeout
.
To run your compiled functions locally you can:
1$ serverless invoke local --function <function-name>
Options are:
--function
or -f
(required) is the name of the function to run--watch
- recompile and run a function locally on source changes--path
or -p
(optional) path to JSON or YAML file holding input data--data
or -d
(optional) input dataYou can easily enable support for source-maps (making stacktraces easier to read) by installing and using the following plugin:
1yarn add --dev source-map-support
1// inside of your function 2import 'source-map-support/register'
If you are using webpack (most likely). Add devtool: 'source-map'
to webpack.config.js
:
1module.exports = { 2 .... snip .... 3 devtool: 'source-map', 4 .... snip .... 5 6}
Join our Slack community if you run into issues or have questions. We love talking to you!
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no SAST tool detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
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
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
68 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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