Skip to content

RafalWilinski/serverless-develop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless Develop Plugin

serverless npm version PRs Welcome

Deploy your functions to AWS Lambda as you code and get realtime feedback.

What is this?

Right now, unpolished PoC, however, works.

What problem does it solve?

Iterating with Serverless Framework is slow.

Plugins like serverless-offline or emulator try to solve that problem by Emulating AWS Lambda environment locally. That solution is far from perfect because of different container, different environment, different IAM roles etc. etc. - Inconsistency.

This plugin, instead of running Lambdas offline, deploys your code to AWS Lambda as you type, in realtime. Welcome back to 2000's, where PHP FTP deployments were made every time CMD+S was hit.

Demo

Installation

  1. Run npm install serverless-develop --save
  2. Add serverless-develop to your serverless.yml plugins section:
plugins:
  - serverless-develop
  1. Run serverless develop

Configuration

serverless-develop can be configured by changing following variables in serverless.yml file.

custom:
  develop:
    middleware:
      - npm run build    # Runs `npm run build` before packaging
    buildPath: build     # Packages files from `build` directory
    sourcePath: src      # Points to source files directory
    changeInterval: 0.2  # Specifies max amount of seconds between deployments

How does it work?

  1. Plugin builds individual artifacts, one for each function
  2. After that, plugin watches files for changes
  3. Once change is made, function checks affected functions, runs middleware (if any) and adds change to function's archive in .serverless directory
  4. Deploy using raw AWS-SDK call without performing checks or updating CloudFormation

Note: Right now, only JS is supported.

Examples:

Integration with serverless-webpack

To be added...

Credits and inspiration

Heavily inspired by @keithwhor's article and @mthenw thoughts.

Contributing

Awesome! All contributions are welcome.

License

MIT

Releases

No releases published

Packages

No packages published