Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: twilio-labs/serverless-toolkit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @twilio-labs/[email protected]
Choose a base ref
...
head repository: twilio-labs/serverless-toolkit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @twilio-labs/[email protected]
Choose a head ref
  • 6 commits
  • 25 files changed
  • 2 contributors

Commits on Jul 16, 2021

  1. docs(assets): update readme

    dkundel committed Jul 16, 2021
    Copy the full SHA
    8d2d762 View commit details

Commits on Jul 19, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7f9205e View commit details
  2. feat(create-twilio-function): add runtime-handler to js projects (#321)

    Seems that adding the runtime handler in create-twilio-function only previously applied to TypeScript projects. This adds it into JavaScript projects too.
    philnash authored Jul 19, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6b5bcf4 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    47051de View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5ca27b6 View commit details
  5. Copy the full SHA
    600dd6b View commit details
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -12,16 +12,22 @@ Throughout the [docs](https://www.twilio.com/docs/labs/serverless-toolkit), you

## Let's work together

Everything in this toolkit is released under [Twilio Labs](https://www.twilio.com/docs/labs) and fully open-source. If you find any problems with this, [please file an issue](https://github.com/twilio-labs/twilio-run/issues) or even create a pull request to work together with us on the toolkit. We would love to hear your ideas and feedback!
Everything in this toolkit is released under [Twilio Labs](https://www.twilio.com/docs/labs) and fully open-source. If you find any problems with this, [please file an issue](https://github.com/twilio-labs/serverless-toolkit/issues) or even create a pull request to work together with us on the toolkit. We would love to hear your ideas and feedback!

## Project Structure & Contributing

This project is a monorepo, meaning it contains multiple packages in one repository. It consists out of the following packages:

- [`twilio-run`](packages/twilio-run) - The underlying CLI tool
- [`plugin-serverless`](https://github.com/twilio-labs/plugin-serverless) - Exposes the `twilio-run` CLI into the [Twilio CLI](https://www.twilio.com/docs/twilio-cli)
- [`create-twilio-function`](https://github.com/twilio-labs/create-twilio-function) - Handles templating and bootstrapping of new projects and Functions
- [`serverless-api`](https://github.com/twilio-labs/serverless-api) - The module used to interact with the actual [Serverless API](https://github.com/twilio-labs/serverless-api)
- [`plugin-serverless`](packages/plugin-serverless) - Exposes the `twilio-run` CLI into the [Twilio CLI](https://www.twilio.com/docs/twilio-cli)
- [`create-twilio-function`](packages/create-twilio-function) - Handles templating and bootstrapping of new projects and Functions
- [`serverless-api`](packages/serverless-api) - The module used to interact with the actual [Twilio Functions and Assets API](https://www.twilio.com/docs/runtime/functions-assets-api)
- [`runtime-handler`](packages/runtime-handler) - A version of the [Twilio Functions Runtime Handler](https://www.twilio.com/docs/runtime/runtime-handler) to be used in local development
- [`plugin-assets`](packages/plugin-assets) - A plugin for the Twilio CLI to easily upload assets to a Twilio Assets service
- [`serverless-runtime-types`](packages/serverless-runtime-types) - TypeScript definitions to define globals for the Twilio Serverless runtime

Also part of the Serverless toolkit, but in another repository:

- [`function-templates`](https://github.com/twilio-labs/function-templates) - The templates used by the toolkit to create new Functions

To understand more about the structure and the design of the Toolkit check out the [design documentation](docs/DESIGN.md).
@@ -31,7 +37,7 @@ To understand more about the structure and the design of the Toolkit check out t
This project uses [`lerna`](https://npm.im/lerna) as a tool to manage the monorepo. If you are unfamiliar with the tool, start by checking out the the [lerna docs](https://lerna.js.org/).

```bash
git clone git@github.com:twilio-labs/twilio-run.git serverless-toolkit
git clone git@github.com:twilio-labs/serverless-toolkit.git serverless-toolkit
cd serverless-toolkit
npm install
npm run bootstrap
2 changes: 2 additions & 0 deletions packages/README.md
Original file line number Diff line number Diff line change
@@ -5,8 +5,10 @@ This repository is structured as a monorepo using [Lerna](https://lerna.js.org)
| Package | Description | Changelog | |
| :-------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`@twilio-labs/plugin-serverless`](plugin-serverless) | [Twilio CLI](https://www.twilio.com/docs/cli) Plugin that wraps `create-twilio-function` and `twilio-run` | [Changelog](@twilio-labs/plugin-serverless/CHANGELOG.md) | ![npm](https://img.shields.io/npm/v/@twilio-labs/plugin-serverless?color=red&label=@twilio-labs/plugin-serverless&style=flat-square) <br> ![npm](https://img.shields.io/npm/dm/@twilio-labs/plugin-serverless?style=flat-square) |
| [`@twilio-labs/plugin-assets`](plugin-assets) | [Twilio CLI](https://www.twilio.com/docs/cli) Plugin that makes it easy to upload assets to a Twilio Assets service | [Changelog](plugin-assets/CHANGELOG.md) | ![npm](https://img.shields.io/npm/v/@twilio-labs/plugin-assets?color=red&label=@twilio-labs/plugin-assets&style=flat-square) <br> ![npm](https://img.shields.io/npm/dm/@twilio-labs/plugin-assets?style=flat-square)
| [`@twilio-labs/serverless-api`](serverless-api) | Wrapper library to work with the [Functions & Assets API from Twilio](https://twilio.com/docs/runtime/functions-assets-api) | [Changelog](@twilio-labs/serverless-api/CHANGELOG.md) | ![npm](https://img.shields.io/npm/v/@twilio-labs/serverless-api?color=red&label=@twilio-labs/serverless-api&style=flat-square) <br> ![npm](https://img.shields.io/npm/dm/@twilio-labs/serverless-api?style=flat-square) |
| [`@twilio-labs/serverless-runtime-types`](serverless-runtime-types) | TypeScript types representing the Twilio Runtime for Functions | [Changelog](@twilio-labs/serverless-runtime-types/CHANGELOG.md) | ![npm](https://img.shields.io/npm/v/@twilio-labs/serverless-runtime-types?color=red&label=@twilio-labs/serverless-runtime-types&style=flat-square) <br> ![npm](https://img.shields.io/npm/dm/@twilio-labs/serverless-runtime-types?style=flat-square) |
| [`@twilio-labs/serverless-twilio-runtime`](serverless-twilio-runtime) | Integration for the [Serverless](https://serverless.com) Platform. | [Changelog](@twilio-labs/serverless-twilio-runtime/CHANGELOG.md) | ![npm](https://img.shields.io/npm/v/@twilio-labs/serverless-twilio-runtime?color=red&label=@twilio-labs/serverless-twilio-runtime&style=flat-square) <br> ![npm](https://img.shields.io/npm/dm/@twilio-labs/serverless-twilio-runtime?style=flat-square) |
| [`create-twilio-function`](create-twilio-function) | CLI tool to create new Twilio Functions projects | [Changelog](create-twilio-function/CHANGELOG.md) | ![npm](https://img.shields.io/npm/v/create-twilio-function?color=red&label=create-twilio-function&style=flat-square) <br> ![npm](https://img.shields.io/npm/dm/create-twilio-function?style=flat-square) |
| [`twilio-run`](twilio-run) | CLI tool to develop, debug and deploy Twilio Serverless products | [Changelog](twilio-run/CHANGELOG.md) | ![npm](https://img.shields.io/npm/v/twilio-run?color=red&label=twilio-run&style=flat-square) <br> ![npm](https://img.shields.io/npm/dm/twilio-run?style=flat-square) |
| [`runtime-handler`](runtime-handler) | A version of the [Twilio Functions Runtime Handler](https://www.twilio.com/docs/runtime/runtime-handler) to be used in local development | [Changelog](runtime-handler/CHANGELOG.md) | ![npm](https://img.shields.io/npm/v/@twilio/runtime-handler?color=red&label=@twilio/runtime-handler&style=flat-square) <br> ![npm](https://img.shields.io/npm/dm/@twilio/runtime-handler?style=flat-square) |
12 changes: 12 additions & 0 deletions packages/create-twilio-function/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.2.0](https://github.com/twilio-labs/serverless-toolkit/compare/create-twilio-function@3.1.2...create-twilio-function@3.2.0) (2021-07-19)


### Features

* **create-twilio-function:** add deployinfo file to gitignore ([#320](https://github.com/twilio-labs/serverless-toolkit/issues/320)) ([5ca27b6](https://github.com/twilio-labs/serverless-toolkit/commit/5ca27b66f91249566893fd1816b03b421414d055))
* **create-twilio-function:** add runtime-handler to js projects ([#321](https://github.com/twilio-labs/serverless-toolkit/issues/321)) ([6b5bcf4](https://github.com/twilio-labs/serverless-toolkit/commit/6b5bcf41a62f84b39bcdd6868eb34634fde8dda0))





## [3.1.2](https://github.com/twilio-labs/serverless-toolkit/compare/create-twilio-function@3.1.1...create-twilio-function@3.1.2) (2021-07-14)

**Note:** Version bump only for package create-twilio-function
6 changes: 3 additions & 3 deletions packages/create-twilio-function/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-twilio-function",
"version": "3.1.2",
"version": "3.2.0",
"description": "A CLI tool to generate a new Twilio Function using that can be run locally with twilio-run.",
"bin": "./bin/create-twilio-function",
"main": "./src/create-twilio-function.js",
@@ -26,7 +26,7 @@
},
"license": "MIT",
"devDependencies": {
"@twilio/runtime-handler": "^1.1.1",
"@twilio/runtime-handler": "^1.1.2",
"jest": "^24.5.0",
"nock": "^11.3.4"
},
@@ -39,7 +39,7 @@
"pkg-install": "^1.0.0",
"rimraf": "^2.6.3",
"terminal-link": "^2.0.0",
"twilio-run": "^3.2.0",
"twilio-run": "^3.2.1",
"window-size": "^1.1.1",
"wrap-ansi": "^6.0.0",
"yargs": "^12.0.5"
Original file line number Diff line number Diff line change
@@ -27,10 +27,12 @@ const typescriptDeps = {
'@twilio-labs/serverless-runtime-types': versions.serverlessRuntimeTypes,
...javaScriptDeps,
};
const javaScriptDevDeps = { 'twilio-run': versions.twilioRun };
const typescriptDevDeps = {
const javaScriptDevDeps = {
'@twilio/runtime-handler': versions.twilioRuntimeHandler,
'twilio-run': versions.twilioRun,
};
const typescriptDevDeps = {
...javaScriptDevDeps,
typescript: versions.typescript,
copyfiles: versions.copyfiles,
};
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
const fs = require('fs');
const path = require('path');
const { promisify } = require('util');
const { createWriteStream } = require('fs');
const { join } = require('path');
const gitignore = require('gitignore');

const writeGitignore = promisify(require('gitignore').writeFile);

const open = promisify(fs.open);
const ADDITIONAL_CONTENT = '# Twilio Serverless\n.twiliodeployinfo\n\n';

function createGitignore(dirPath) {
const fullPath = path.join(dirPath, '.gitignore');
return open(fullPath, 'wx').then((fd) => {
const stream = fs.createWriteStream(null, { fd });
return writeGitignore({
type: 'Node',
file: stream,
return new Promise((resolve, reject) => {
const fullPath = join(dirPath, '.gitignore');
const stream = createWriteStream(fullPath, { flags: 'wx' });
stream.on('error', reject);
stream.write(ADDITIONAL_CONTENT, 'utf-8', (error) => {
if (error) {
reject(error);
}
gitignore.writeFile(
{
type: 'Node',
file: stream,
},
(error) => {
if (error) {
reject(error);
}
resolve();
}
);
});
});
}
6 changes: 6 additions & 0 deletions packages/create-twilio-function/tests/create-files.test.js
Original file line number Diff line number Diff line change
@@ -79,6 +79,9 @@ describe('create-files', () => {
expect(packageJSON.devDependencies['twilio-run']).toEqual(
versions.twilioRun
);
expect(packageJSON.devDependencies['@twilio/runtime-handler']).toEqual(
versions.twilioRuntimeHandler
);
expect(packageJSON.dependencies['twilio']).toEqual(versions.twilio);
cleanUp();
});
@@ -102,6 +105,9 @@ describe('create-files', () => {
expect(packageJSON.devDependencies.typescript).toEqual(
versions.typescript
);
expect(packageJSON.devDependencies['@twilio/runtime-handler']).toEqual(
versions.twilioRuntimeHandler
);
expect(
packageJSON.dependencies['@twilio-labs/serverless-runtime-types']
).toEqual(versions.serverlessRuntimeTypes);
Original file line number Diff line number Diff line change
@@ -57,6 +57,7 @@ describe('create-gitignore', () => {
});
expect(contents).toMatch('*.log');
expect(contents).toMatch('.env');
expect(contents).toMatch('.twiliodeployinfo');
cleanUp();
});

8 changes: 8 additions & 0 deletions packages/plugin-assets/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.2.2](https://github.com/twilio-labs/serverless-toolkit/compare/@twilio-labs/plugin-assets@1.2.1...@twilio-labs/plugin-assets@1.2.2) (2021-07-19)

**Note:** Version bump only for package @twilio-labs/plugin-assets





## [1.2.1](https://github.com/twilio-labs/serverless-toolkit/compare/@twilio-labs/plugin-assets@1.2.0...@twilio-labs/plugin-assets@1.2.1) (2021-07-14)

**Note:** Version bump only for package @twilio-labs/plugin-assets
8 changes: 4 additions & 4 deletions packages/plugin-assets/README.md
Original file line number Diff line number Diff line change
@@ -64,11 +64,11 @@ OPTIONS
--properties=properties [default: service_sid, sid, domain_name] The asset service environment properties you
would like to display (JSON output always shows all properties).
--service-name=service-name [default: tacit-year] A unique name for your asset service. May only contain
--service-name=service-name [default: nippy-slip] A unique name for your asset service. May only contain
alphanumeric characters and hyphens.
```

_See code: [src/commands/assets/init.js](https://github.com/twilio-labs/serverless-toolkit/blob/v1.2.1/src/commands/assets/init.js)_
_See code: [src/commands/assets/init.js](https://github.com/twilio-labs/serverless-toolkit/blob/v1.2.2/src/commands/assets/init.js)_

## `twilio assets:list`

@@ -89,7 +89,7 @@ OPTIONS
(JSON output always shows all properties).
```

_See code: [src/commands/assets/list.js](https://github.com/twilio-labs/serverless-toolkit/blob/v1.2.1/src/commands/assets/list.js)_
_See code: [src/commands/assets/list.js](https://github.com/twilio-labs/serverless-toolkit/blob/v1.2.2/src/commands/assets/list.js)_

## `twilio assets:upload FILE`

@@ -115,7 +115,7 @@ OPTIONS
--protected Sets the uploaded asset's visibility to 'protected'
```

_See code: [src/commands/assets/upload.js](https://github.com/twilio-labs/serverless-toolkit/blob/v1.2.1/src/commands/assets/upload.js)_
_See code: [src/commands/assets/upload.js](https://github.com/twilio-labs/serverless-toolkit/blob/v1.2.2/src/commands/assets/upload.js)_
<!-- commandsstop -->

## Contributing
2 changes: 1 addition & 1 deletion packages/plugin-assets/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@twilio-labs/plugin-assets",
"description": "Easily upload assets to a Twilio Assets service",
"version": "1.2.1",
"version": "1.2.2",
"author": "Twilio Inc. <open-source@twilio.com> (https://www.twilio.com/labs)",
"contributors": [
"Phil Nash <philnash@twilio.com>"
8 changes: 8 additions & 0 deletions packages/plugin-serverless/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.2.1](https://github.com/twilio-labs/serverless-toolkit/compare/@twilio-labs/plugin-serverless@2.2.0...@twilio-labs/plugin-serverless@2.2.1) (2021-07-19)

**Note:** Version bump only for package @twilio-labs/plugin-serverless





# [2.2.0](https://github.com/twilio-labs/serverless-toolkit/compare/@twilio-labs/plugin-serverless@2.1.1...@twilio-labs/plugin-serverless@2.2.0) (2021-07-14)


Loading