From 52df97e0cb40e5067ee48f1f7202280ec256eada Mon Sep 17 00:00:00 2001 From: Dominik Kundel <dkundel@twilio.com> Date: Wed, 7 Sep 2022 11:04:06 -0700 Subject: [PATCH 1/6] docs(readme): remove mention of Runtime --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e865c35..8226c7d4 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## What is the Serverless Toolkit? -The [Serverless Toolkit](https://www.twilio.com/docs/labs/serverless-toolkit) is CLI tooling to help you develop locally and deploy to the [Twilio Runtime](https://www.twilio.com/runtime). +The [Serverless Toolkit](https://www.twilio.com/docs/labs/serverless-toolkit) is CLI tooling to help you develop locally and deploy to the [Twilio Functions & Assets](https://www.twilio.com/serverless/functions). There are two ways you can use the toolkit. If you are already using the [Twilio CLI](https://www.twilio.com/docs/twilio-cli), you can install it via a plugin. Alternatively, you can use the toolkit as a standalone using [twilio-run](https://npm.im/twilio-run) via npm or another Node.js package manager. From 238e391d0323ec30fe42b2701b393f9b5be732bb Mon Sep 17 00:00:00 2001 From: Phil Nash <philnash@gmail.com> Date: Fri, 7 Oct 2022 02:10:50 +1100 Subject: [PATCH 2/6] chore(plugin-serverless): updates to @twilio/cli-core v7 (#420) * chore(plugin-serverless): updates to @twilio/cli-core v7 Replaces `@oclif/command` and `@oclif/config` with `@oclif/core` Updates `./bin/run` command and adds `./bin/dev` command Sets engines property in package to Node 14 (matches `@oclif/core`) Updates commands to call `await this.parse` - For commands that inherit from `TwilioClientCommand`, flags and args are already parsed into `this.flags` and `this.args` when `super.run()` is called. This removes the call to parse a second time and uses `this.flags` and `this.args` instead * chore(plugin-serverless): adds package.json main property Copied from: https://github.com/oclif/hello-world/blob/main/src/index.ts Co-authored-by: Dominik Kundel <dkundel@twilio.com> --- packages/plugin-serverless/bin/dev | 15 +++++++++ packages/plugin-serverless/bin/dev.cmd | 3 ++ packages/plugin-serverless/bin/run | 10 +++--- packages/plugin-serverless/package.json | 11 +++---- .../src/commands/serverless/deploy.js | 5 ++- .../src/commands/serverless/init.js | 5 ++- .../src/commands/serverless/list-templates.js | 4 +-- .../src/commands/serverless/list.js | 5 ++- .../src/commands/serverless/logs.js | 5 ++- .../src/commands/serverless/new.js | 4 +-- .../src/commands/serverless/promote.js | 5 ++- .../src/commands/serverless/start.js | 4 +-- packages/plugin-serverless/src/index.js | 2 ++ packages/plugin-serverless/src/utils.js | 6 ++-- .../plugin-serverless/tests/utils.test.js | 32 +++++++++---------- 15 files changed, 66 insertions(+), 50 deletions(-) create mode 100644 packages/plugin-serverless/bin/dev create mode 100644 packages/plugin-serverless/bin/dev.cmd create mode 100644 packages/plugin-serverless/src/index.js diff --git a/packages/plugin-serverless/bin/dev b/packages/plugin-serverless/bin/dev new file mode 100644 index 00000000..91c17db2 --- /dev/null +++ b/packages/plugin-serverless/bin/dev @@ -0,0 +1,15 @@ +#!/usr/bin/env node + +const oclif = require('@oclif/core'); + +// In dev mode -> use ts-node and dev plugins +process.env.NODE_ENV = 'development'; + +// In dev mode, always show stack traces +oclif.settings.debug = true; + +// Configure the Twilio CLI environment +require('@twilio/cli-core').configureEnv(); + +// Start the CLI +oclif.run().then(oclif.flush).catch(oclif.Errors.handle); diff --git a/packages/plugin-serverless/bin/dev.cmd b/packages/plugin-serverless/bin/dev.cmd new file mode 100644 index 00000000..077b57ae --- /dev/null +++ b/packages/plugin-serverless/bin/dev.cmd @@ -0,0 +1,3 @@ +@echo off + +node "%~dp0\dev" %* \ No newline at end of file diff --git a/packages/plugin-serverless/bin/run b/packages/plugin-serverless/bin/run index 74157a8f..f2b9480d 100755 --- a/packages/plugin-serverless/bin/run +++ b/packages/plugin-serverless/bin/run @@ -1,9 +1,11 @@ #!/usr/bin/env node // Load up the command module *first* so that we're the parent rather than // some other dependency. -const command = require('@oclif/command'); +const oclif = require('@oclif/core'); require('@twilio/cli-core').configureEnv(); -command.run() - .then(require('@oclif/command/flush')) - .catch(require('@oclif/errors/handle')); + +oclif + .run() + .then(require('@oclif/core/flush')) + .catch(require('@oclif/core/handle')); diff --git a/packages/plugin-serverless/package.json b/packages/plugin-serverless/package.json index 1d0f3512..6fa8aa8c 100644 --- a/packages/plugin-serverless/package.json +++ b/packages/plugin-serverless/package.json @@ -6,23 +6,22 @@ "contributors": [ "Dominik Kundel <dkundel@twilio.com>" ], + "main": "src/index.js", "dependencies": { - "@oclif/command": "^1.5.19", - "@oclif/config": "^1.13.3", - "@twilio/cli-core": "^6.0.0", + "@oclif/core": "^1.14.2", + "@twilio/cli-core": "^7.0.0", "create-twilio-function": "^3.3.5", "lodash.camelcase": "^4.3.0", "lodash.kebabcase": "^4.1.1", "twilio-run": "^3.4.4" }, "devDependencies": { - "@oclif/dev-cli": "^1.22.2", - "@oclif/plugin-help": "^3.2.3", + "@oclif/plugin-help": "^5.1.12", "@oclif/test": "^1.2.5", "@twilio/cli-test": "^2.0.2" }, "engines": { - "node": ">=12.22.1" + "node": ">=14.0.0" }, "files": [ "/oclif.manifest.json", diff --git a/packages/plugin-serverless/src/commands/serverless/deploy.js b/packages/plugin-serverless/src/commands/serverless/deploy.js index b005fd61..e346cfd9 100644 --- a/packages/plugin-serverless/src/commands/serverless/deploy.js +++ b/packages/plugin-serverless/src/commands/serverless/deploy.js @@ -18,8 +18,7 @@ class FunctionsDeploy extends TwilioClientCommand { async run() { await super.run(); - let { flags, args } = this.parse(FunctionsDeploy); - flags = normalizeFlags(flags, aliasMap, process.argv); + const flags = normalizeFlags(this.flags, aliasMap, process.argv); const externalOptions = createExternalCliOptions(flags, this.twilioClient); @@ -27,7 +26,7 @@ class FunctionsDeploy extends TwilioClientCommand { flags.region = region; flags.edge = edge; - const opts = Object.assign({}, flags, args); + const opts = Object.assign({}, flags, this.args); return handler(opts, externalOptions); } } diff --git a/packages/plugin-serverless/src/commands/serverless/init.js b/packages/plugin-serverless/src/commands/serverless/init.js index fb8534e4..2af513b7 100644 --- a/packages/plugin-serverless/src/commands/serverless/init.js +++ b/packages/plugin-serverless/src/commands/serverless/init.js @@ -16,10 +16,9 @@ class FunctionsInit extends TwilioClientCommand { async run() { await super.run(); - let { flags, args } = this.parse(FunctionsInit); - flags = normalizeFlags(flags, aliasMap, process.argv); + const flags = normalizeFlags(this.flags, aliasMap, process.argv); - const opts = Object.assign({}, flags, args); + const opts = Object.assign({}, flags, this.args); opts.accountSid = flags.accountSid || this.twilioClient.accountSid; opts.authToken = flags.authToken || ''; diff --git a/packages/plugin-serverless/src/commands/serverless/list-templates.js b/packages/plugin-serverless/src/commands/serverless/list-templates.js index fc7f2ded..f05e9a59 100644 --- a/packages/plugin-serverless/src/commands/serverless/list-templates.js +++ b/packages/plugin-serverless/src/commands/serverless/list-templates.js @@ -1,4 +1,4 @@ -const { Command } = require('@oclif/command'); +const { Command } = require('@oclif/core'); const { handler, @@ -14,7 +14,7 @@ const { flags, aliasMap } = convertYargsOptionsToOclifFlags(cliInfo.options); class FunctionsListTemplates extends Command { async run() { - let { flags, args } = this.parse(FunctionsListTemplates); + let { flags, args } = await this.parse(FunctionsListTemplates); flags = normalizeFlags(flags, aliasMap, process.argv); const opts = Object.assign({}, flags, args); diff --git a/packages/plugin-serverless/src/commands/serverless/list.js b/packages/plugin-serverless/src/commands/serverless/list.js index 48dd0631..639e7577 100644 --- a/packages/plugin-serverless/src/commands/serverless/list.js +++ b/packages/plugin-serverless/src/commands/serverless/list.js @@ -14,8 +14,7 @@ class FunctionsList extends TwilioClientCommand { async run() { await super.run(); - let { flags, args } = this.parse(FunctionsList); - flags = normalizeFlags(flags, aliasMap, process.argv); + const flags = normalizeFlags(this.flags, aliasMap, process.argv); const externalOptions = createExternalCliOptions(flags, this.twilioClient); @@ -23,7 +22,7 @@ class FunctionsList extends TwilioClientCommand { flags.region = region; flags.edge = edge; - const opts = Object.assign({}, flags, args); + const opts = Object.assign({}, flags, this.args); return handler(opts, externalOptions); } } diff --git a/packages/plugin-serverless/src/commands/serverless/logs.js b/packages/plugin-serverless/src/commands/serverless/logs.js index 80ae83cd..c394847d 100644 --- a/packages/plugin-serverless/src/commands/serverless/logs.js +++ b/packages/plugin-serverless/src/commands/serverless/logs.js @@ -15,8 +15,7 @@ class LogsList extends TwilioClientCommand { async run() { await super.run(); - let { flags, args } = this.parse(LogsList); - flags = normalizeFlags(flags, aliasMap, process.argv); + const flags = normalizeFlags(this.flags, aliasMap, process.argv); const externalOptions = createExternalCliOptions(flags, this.twilioClient); @@ -24,7 +23,7 @@ class LogsList extends TwilioClientCommand { flags.region = region; flags.edge = edge; - const opts = Object.assign({}, flags, args); + const opts = Object.assign({}, flags, this.args); return handler(opts, externalOptions); } } diff --git a/packages/plugin-serverless/src/commands/serverless/new.js b/packages/plugin-serverless/src/commands/serverless/new.js index 3e422b48..d217c235 100644 --- a/packages/plugin-serverless/src/commands/serverless/new.js +++ b/packages/plugin-serverless/src/commands/serverless/new.js @@ -1,4 +1,4 @@ -const { Command } = require('@oclif/command'); +const { Command } = require('@oclif/core'); const { handler, cliInfo, describe } = require('twilio-run/dist/commands/new'); const { @@ -10,7 +10,7 @@ const { flags, aliasMap } = convertYargsOptionsToOclifFlags(cliInfo.options); class FunctionsNew extends Command { async run() { - let { flags, args } = this.parse(FunctionsNew); + let { flags, args } = await this.parse(FunctionsNew); flags = normalizeFlags(flags, aliasMap, process.argv); const opts = Object.assign({}, flags, args); diff --git a/packages/plugin-serverless/src/commands/serverless/promote.js b/packages/plugin-serverless/src/commands/serverless/promote.js index 2f45c561..04053ce8 100644 --- a/packages/plugin-serverless/src/commands/serverless/promote.js +++ b/packages/plugin-serverless/src/commands/serverless/promote.js @@ -18,8 +18,7 @@ class FunctionsPromote extends TwilioClientCommand { async run() { await super.run(); - let { flags, args } = this.parse(FunctionsPromote); - flags = normalizeFlags(flags, aliasMap, process.argv); + const flags = normalizeFlags(this.flags, aliasMap, process.argv); const externalOptions = createExternalCliOptions(flags, this.twilioClient); @@ -27,7 +26,7 @@ class FunctionsPromote extends TwilioClientCommand { flags.region = region; flags.edge = edge; - const opts = Object.assign({}, flags, args); + const opts = Object.assign({}, flags, this.args); return handler(opts, externalOptions); } } diff --git a/packages/plugin-serverless/src/commands/serverless/start.js b/packages/plugin-serverless/src/commands/serverless/start.js index bba05db3..67cc60a2 100644 --- a/packages/plugin-serverless/src/commands/serverless/start.js +++ b/packages/plugin-serverless/src/commands/serverless/start.js @@ -1,4 +1,4 @@ -const { Command } = require('@oclif/command'); +const { Command } = require('@oclif/core'); const { handler, @@ -14,7 +14,7 @@ const { flags, aliasMap } = convertYargsOptionsToOclifFlags(cliInfo.options); class FunctionsStart extends Command { async run() { - let { flags, args } = this.parse(FunctionsStart); + let { flags, args } = await this.parse(FunctionsStart); flags = normalizeFlags(flags, aliasMap, process.argv); diff --git a/packages/plugin-serverless/src/index.js b/packages/plugin-serverless/src/index.js new file mode 100644 index 00000000..bac3949e --- /dev/null +++ b/packages/plugin-serverless/src/index.js @@ -0,0 +1,2 @@ +const { run } = require('@oclif/core'); +module.exports = run; diff --git a/packages/plugin-serverless/src/utils.js b/packages/plugin-serverless/src/utils.js index 39834861..81726f1d 100644 --- a/packages/plugin-serverless/src/utils.js +++ b/packages/plugin-serverless/src/utils.js @@ -1,6 +1,6 @@ const path = require('path'); const camelCase = require('lodash.camelcase'); -const { flags } = require('@oclif/command'); +const { Flags } = require('@oclif/core'); const pkgJson = require('../package.json'); function convertYargsOptionsToOclifFlags(options) { @@ -36,10 +36,10 @@ function convertYargsOptionsToOclifFlags(options) { flag.required = opt.requiresArg; } - result[name] = flags[opt.type](flag); + result[name] = Flags[opt.type](flag); if (opt.alias && opt.alias.length > 1) { - result[opt.alias] = flags[opt.type]({ + result[opt.alias] = Flags[opt.type]({ ...flag, default: undefined, description: `[Alias for "${name}"]`, diff --git a/packages/plugin-serverless/tests/utils.test.js b/packages/plugin-serverless/tests/utils.test.js index 9a81f123..0e5a2761 100644 --- a/packages/plugin-serverless/tests/utils.test.js +++ b/packages/plugin-serverless/tests/utils.test.js @@ -1,4 +1,4 @@ -const { flags } = require('@oclif/command'); +const { Flags } = require('@oclif/core'); const { normalizeFlags, convertYargsOptionsToOclifFlags, @@ -86,12 +86,12 @@ describe('convertYargsOptionsToOclifFlags', () => { expect(result.aliasMap.size).toEqual(0); expect(result.flags.toString()).toEqual( { - production: flags.boolean({ + production: Flags.boolean({ description: yargsFlags.production.describe, default: yargsFlags.production.default, hidden: undefined, }), - 'service-sid': flags.string({ + 'service-sid': Flags.string({ description: yargsFlags['service-sid'].describe, default: yargsFlags['service-sid'].default, hidden: undefined, @@ -119,12 +119,12 @@ describe('convertYargsOptionsToOclifFlags', () => { expect(result.aliasMap.size).toEqual(0); expect(result.flags.toString()).toEqual( { - production: flags.boolean({ + production: Flags.boolean({ description: yargsFlags.production.describe, default: yargsFlags.production.default, hidden: undefined, }), - 'service-sid': flags.string({ + 'service-sid': Flags.string({ description: yargsFlags['service-sid'].describe, default: yargsFlags['service-sid'].default, hidden: undefined, @@ -152,12 +152,12 @@ describe('convertYargsOptionsToOclifFlags', () => { expect(result.aliasMap.size).toEqual(0); expect(result.flags.toString()).toEqual( { - production: flags.boolean({ + production: Flags.boolean({ description: yargsFlags.production.describe, default: yargsFlags.production.default, hidden: undefined, }), - port: flags.string({ + port: Flags.string({ description: yargsFlags.port.describe, default: yargsFlags.port.default, hidden: undefined, @@ -191,17 +191,17 @@ describe('convertYargsOptionsToOclifFlags', () => { expect(result.aliasMap.size).toEqual(0); expect(result.flags.toString()).toEqual( { - production: flags.boolean({ + production: Flags.boolean({ description: yargsFlags.production.describe, default: yargsFlags.production.default, hidden: undefined, }), - 'service-sid': flags.string({ + 'service-sid': Flags.string({ description: yargsFlags['service-sid'].describe, default: yargsFlags['service-sid'].default, hidden: undefined, }), - username: flags.string({ + username: Flags.string({ description: yargsFlags['username'].describe, default: yargsFlags['username'].default, hidden: undefined, @@ -245,32 +245,32 @@ describe('convertYargsOptionsToOclifFlags', () => { ]); expect(result.flags.toString()).toEqual( { - production: flags.boolean({ + production: Flags.boolean({ description: yargsFlags.production.describe, default: yargsFlags.production.default, hidden: undefined, }), - 'service-sid': flags.string({ + 'service-sid': Flags.string({ description: yargsFlags['service-sid'].describe, default: yargsFlags['service-sid'].default, hidden: undefined, }), - 'source-environment': flags.string({ + 'source-environment': Flags.string({ description: yargsFlags['source-environment'].describe, default: yargsFlags['source-environment'].default, hidden: undefined, }), - from: flags.string({ + from: Flags.string({ description: '[Alias for "source-environment"]', default: undefined, hidden: undefined, }), - environment: flags.string({ + environment: Flags.string({ description: yargsFlags['environment'].describe, default: yargsFlags['environment'].default, hidden: undefined, }), - to: flags.string({ + to: Flags.string({ description: '[Alias for "environment"]', default: undefined, hidden: undefined, From 93b7d316e89da4740f928ff1b37f7bacaadedfe9 Mon Sep 17 00:00:00 2001 From: Phil Nash <philnash@gmail.com> Date: Fri, 7 Oct 2022 02:17:28 +1100 Subject: [PATCH 3/6] chore(plugin-assets): updates to @twilio/cli-core v7 (#419) * chore(plugin-assets): updates to @twilio/cli-core v7 Replaces @oclif/command and @oclif/config with @oclif/core Updates ./bin/run command and adds ./bin/dev command Sets engines property in package to Node 14 (matches @oclif/core) * chore(plugin-serverless): updates to @twilio/cli-core v7 Replaces `@oclif/command` and `@oclif/config` with `@oclif/core` Updates `./bin/run` command and adds `./bin/dev` command Sets engines property in package to Node 14 (matches `@oclif/core`) Updates commands to call `await this.parse` - For commands that inherit from `TwilioClientCommand`, flags and args are already parsed into `this.flags` and `this.args` when `super.run()` is called. This removes the call to parse a second time and uses `this.flags` and `this.args` instead * fix(plugin-assets): make *.cmd files runnable * chore(plugin-assets): adds package.json main property Copied from: https://github.com/oclif/hello-world/blob/main/src/index.ts Co-authored-by: Dominik Kundel <dkundel@twilio.com> --- packages/plugin-assets/bin/dev | 15 +++++++++++++++ packages/plugin-assets/bin/dev.cmd | 3 +++ packages/plugin-assets/bin/run | 11 +++++++---- packages/plugin-assets/bin/run.cmd | 0 packages/plugin-assets/package.json | 11 +++++------ .../plugin-assets/src/commands/assets/init.js | 6 +++--- .../plugin-assets/src/commands/assets/list.js | 4 ++-- .../plugin-assets/src/commands/assets/upload.js | 6 +++--- packages/plugin-assets/src/index.js | 2 ++ 9 files changed, 40 insertions(+), 18 deletions(-) create mode 100755 packages/plugin-assets/bin/dev create mode 100755 packages/plugin-assets/bin/dev.cmd mode change 100644 => 100755 packages/plugin-assets/bin/run.cmd create mode 100644 packages/plugin-assets/src/index.js diff --git a/packages/plugin-assets/bin/dev b/packages/plugin-assets/bin/dev new file mode 100755 index 00000000..91c17db2 --- /dev/null +++ b/packages/plugin-assets/bin/dev @@ -0,0 +1,15 @@ +#!/usr/bin/env node + +const oclif = require('@oclif/core'); + +// In dev mode -> use ts-node and dev plugins +process.env.NODE_ENV = 'development'; + +// In dev mode, always show stack traces +oclif.settings.debug = true; + +// Configure the Twilio CLI environment +require('@twilio/cli-core').configureEnv(); + +// Start the CLI +oclif.run().then(oclif.flush).catch(oclif.Errors.handle); diff --git a/packages/plugin-assets/bin/dev.cmd b/packages/plugin-assets/bin/dev.cmd new file mode 100755 index 00000000..077b57ae --- /dev/null +++ b/packages/plugin-assets/bin/dev.cmd @@ -0,0 +1,3 @@ +@echo off + +node "%~dp0\dev" %* \ No newline at end of file diff --git a/packages/plugin-assets/bin/run b/packages/plugin-assets/bin/run index 74157a8f..73e8c295 100755 --- a/packages/plugin-assets/bin/run +++ b/packages/plugin-assets/bin/run @@ -1,9 +1,12 @@ #!/usr/bin/env node // Load up the command module *first* so that we're the parent rather than // some other dependency. -const command = require('@oclif/command'); + +const oclif = require('@oclif/core'); require('@twilio/cli-core').configureEnv(); -command.run() - .then(require('@oclif/command/flush')) - .catch(require('@oclif/errors/handle')); + +oclif + .run() + .then(require('@oclif/core/flush')) + .catch(require('@oclif/core/handle')); diff --git a/packages/plugin-assets/bin/run.cmd b/packages/plugin-assets/bin/run.cmd old mode 100644 new mode 100755 diff --git a/packages/plugin-assets/package.json b/packages/plugin-assets/package.json index ab64a92a..0e353ffc 100644 --- a/packages/plugin-assets/package.json +++ b/packages/plugin-assets/package.json @@ -6,25 +6,24 @@ "contributors": [ "Phil Nash <philnash@twilio.com>" ], + "main": "src/index.js", "dependencies": { - "@oclif/command": "^1.5.19", - "@oclif/config": "^1.13.3", + "@oclif/core": "^1.14.2", "@twilio-labs/serverless-api": "^5.4.4", - "@twilio/cli-core": "^6.0.0", + "@twilio/cli-core": "^7.0.0", "inquirer": "^8.0.0", "ora": "^5.4.0", "project-name-generator": "^2.1.9" }, "devDependencies": { - "@oclif/dev-cli": "^1.22.2", - "@oclif/plugin-help": "^2.2.1", + "@oclif/plugin-help": "^5.1.12", "@oclif/test": "^1.2.5", "@twilio/cli-test": "^2.1.1", "jest": "^26.6.3", "rimraf": "^3.0.2" }, "engines": { - "node": ">=10" + "node": ">=14" }, "files": [ "/oclif.manifest.json", diff --git a/packages/plugin-assets/src/commands/assets/init.js b/packages/plugin-assets/src/commands/assets/init.js index a0d25451..82f945ed 100644 --- a/packages/plugin-assets/src/commands/assets/init.js +++ b/packages/plugin-assets/src/commands/assets/init.js @@ -1,4 +1,4 @@ -const { flags } = require('@oclif/command'); +const { Flags } = require('@oclif/core'); const { TwilioClientCommand } = require('@twilio/cli-core').baseCommands; const { getPluginConfig } = require('../../pluginConfig'); const generateProjectName = require('project-name-generator'); @@ -28,11 +28,11 @@ class InitCommand extends TwilioClientCommand { } InitCommand.flags = { - 'service-name': flags.string({ + 'service-name': Flags.string({ description: 'A unique name for your asset service. May only contain alphanumeric characters and hyphens.', }), - properties: flags.string({ + properties: Flags.string({ default: 'service_sid, sid, domain_name', description: 'The asset service environment properties you would like to display (JSON output always shows all properties).', diff --git a/packages/plugin-assets/src/commands/assets/list.js b/packages/plugin-assets/src/commands/assets/list.js index 4f9a073d..f926ce31 100644 --- a/packages/plugin-assets/src/commands/assets/list.js +++ b/packages/plugin-assets/src/commands/assets/list.js @@ -1,4 +1,4 @@ -const { flags } = require('@oclif/command'); +const { Flags } = require('@oclif/core'); const { TwilioClientCommand } = require('@twilio/cli-core').baseCommands; const { getPluginConfig } = require('../../pluginConfig'); const { list } = require('../../list'); @@ -25,7 +25,7 @@ class ListCommand extends TwilioClientCommand { ListCommand.description = 'List all the assets in the service'; ListCommand.flags = { - properties: flags.string({ + properties: Flags.string({ default: 'sid, path, url, visibility', description: 'The asset properties you would like to display (JSON output always shows all properties).', diff --git a/packages/plugin-assets/src/commands/assets/upload.js b/packages/plugin-assets/src/commands/assets/upload.js index b095c7ee..c32db044 100644 --- a/packages/plugin-assets/src/commands/assets/upload.js +++ b/packages/plugin-assets/src/commands/assets/upload.js @@ -1,4 +1,4 @@ -const { flags } = require('@oclif/command'); +const { Flags } = require('@oclif/core'); const { TwilioClientCommand } = require('@twilio/cli-core').baseCommands; const { getPluginConfig } = require('../../pluginConfig'); const { upload } = require('../../upload'); @@ -37,11 +37,11 @@ UploadCommand.args = [ ]; UploadCommand.flags = { - protected: flags.boolean({ + protected: Flags.boolean({ default: false, description: "Sets the uploaded asset's visibility to 'protected'", }), - properties: flags.string({ + properties: Flags.string({ default: 'sid, path, url, visibility', description: 'The asset properties you would like to display (JSON output always shows all properties).', diff --git a/packages/plugin-assets/src/index.js b/packages/plugin-assets/src/index.js new file mode 100644 index 00000000..bac3949e --- /dev/null +++ b/packages/plugin-assets/src/index.js @@ -0,0 +1,2 @@ +const { run } = require('@oclif/core'); +module.exports = run; From 67d83bfb6707b5c03142174946b7b8fa4d0cc1d9 Mon Sep 17 00:00:00 2001 From: shrutiburman <87537688+shrutiburman@users.noreply.github.com> Date: Thu, 6 Oct 2022 20:48:09 +0530 Subject: [PATCH 4/6] fix: updated oclif-dev to oclif cmd (#426) --- packages/plugin-assets/package.json | 7 ++++--- packages/plugin-serverless/package.json | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/plugin-assets/package.json b/packages/plugin-assets/package.json index 0e353ffc..646037ac 100644 --- a/packages/plugin-assets/package.json +++ b/packages/plugin-assets/package.json @@ -20,7 +20,8 @@ "@oclif/test": "^1.2.5", "@twilio/cli-test": "^2.1.1", "jest": "^26.6.3", - "rimraf": "^3.0.2" + "rimraf": "^3.0.2", + "oclif": "^3" }, "engines": { "node": ">=14" @@ -74,8 +75,8 @@ }, "scripts": { "postpack": "rm -f oclif.manifest.json", - "prepack": "oclif-dev manifest && oclif-dev readme", - "version": "oclif-dev readme && git add README.md", + "prepack": "oclif manifest && oclif readme", + "version": "oclif readme && git add README.md", "test": "jest" }, "gitHead": "6db273648ed19474f4125042556b10c051529912" diff --git a/packages/plugin-serverless/package.json b/packages/plugin-serverless/package.json index 6fa8aa8c..e8a17d8e 100644 --- a/packages/plugin-serverless/package.json +++ b/packages/plugin-serverless/package.json @@ -18,7 +18,8 @@ "devDependencies": { "@oclif/plugin-help": "^5.1.12", "@oclif/test": "^1.2.5", - "@twilio/cli-test": "^2.0.2" + "@twilio/cli-test": "^2.0.2", + "oclif": "^3" }, "engines": { "node": ">=14.0.0" @@ -86,8 +87,8 @@ }, "scripts": { "postpack": "rm -f oclif.manifest.json", - "prepack": "oclif-dev manifest && oclif-dev readme", - "version": "oclif-dev readme && git add README.md" + "prepack": "oclif manifest && oclif readme", + "version": "oclif readme && git add README.md" }, "gitHead": "6db273648ed19474f4125042556b10c051529912" } From 2cda5b03f0205ee4ae2dbd5c5b3ff79f277f869f Mon Sep 17 00:00:00 2001 From: Dominik Kundel <dkundel@twilio.com> Date: Mon, 10 Oct 2022 08:12:28 -0700 Subject: [PATCH 5/6] chore: override broken @types package to avoid TS bump (#427) --- package.json | 3 ++- packages/runtime-handler/package.json | 5 +++-- packages/twilio-run/package.json | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 5401547f..6c23fb3d 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ "typescript": "^3.9.7" }, "overrides": { - "@types/prettier": "2.6.0" + "@types/prettier": "2.6.0", + "@types/express-serve-static-core": "ts3.9" }, "lint-staged": { "*.{js,jsx,ts,tsx}": [ diff --git a/packages/runtime-handler/package.json b/packages/runtime-handler/package.json index 6c16205c..f026bfc2 100644 --- a/packages/runtime-handler/package.json +++ b/packages/runtime-handler/package.json @@ -76,7 +76,8 @@ "twilio": "3.80.0" }, "overrides": { - "@types/prettier": "2.6.0" + "@types/prettier": "2.6.0", + "@types/express-serve-static-core": "ts3.9" }, "gitHead": "6db273648ed19474f4125042556b10c051529912" -} +} \ No newline at end of file diff --git a/packages/twilio-run/package.json b/packages/twilio-run/package.json index 382f78d1..e3c8c181 100644 --- a/packages/twilio-run/package.json +++ b/packages/twilio-run/package.json @@ -125,5 +125,8 @@ "engines": { "node": ">=12.22.1" }, + "overrides": { + "@types/express-serve-static-core": "ts3.9" + }, "gitHead": "6db273648ed19474f4125042556b10c051529912" -} +} \ No newline at end of file From d4fde968d0c73c9861456867e083c6b2648f666d Mon Sep 17 00:00:00 2001 From: Dominik Kundel <dkundel@twilio.com> Date: Tue, 11 Oct 2022 16:09:15 -0700 Subject: [PATCH 6/6] chore(release): publish %s - create-twilio-function@3.3.6 - @twilio-labs/plugin-assets@2.0.4 - @twilio-labs/plugin-serverless@3.0.4 - @twilio/runtime-handler@1.2.5 - twilio-run@3.4.5 --- packages/create-twilio-function/CHANGELOG.md | 8 + packages/create-twilio-function/package.json | 6 +- packages/plugin-assets/CHANGELOG.md | 11 + packages/plugin-assets/README.md | 52 +- packages/plugin-assets/package.json | 6 +- packages/plugin-serverless/CHANGELOG.md | 11 + packages/plugin-serverless/README.md | 841 +++++++++++-------- packages/plugin-serverless/package.json | 6 +- packages/runtime-handler/CHANGELOG.md | 8 + packages/runtime-handler/package.json | 4 +- packages/twilio-run/CHANGELOG.md | 8 + packages/twilio-run/package.json | 6 +- 12 files changed, 560 insertions(+), 407 deletions(-) diff --git a/packages/create-twilio-function/CHANGELOG.md b/packages/create-twilio-function/CHANGELOG.md index b42dc7bc..761b443f 100644 --- a/packages/create-twilio-function/CHANGELOG.md +++ b/packages/create-twilio-function/CHANGELOG.md @@ -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. +## [3.3.6](https://github.com/twilio-labs/serverless-toolkit/compare/create-twilio-function@3.3.5...create-twilio-function@3.3.6) (2022-10-11) + +**Note:** Version bump only for package create-twilio-function + + + + + ## [3.3.5](https://github.com/twilio-labs/serverless-toolkit/compare/create-twilio-function@3.3.4...create-twilio-function@3.3.5) (2022-08-31) diff --git a/packages/create-twilio-function/package.json b/packages/create-twilio-function/package.json index 9badc805..fee66283 100644 --- a/packages/create-twilio-function/package.json +++ b/packages/create-twilio-function/package.json @@ -1,6 +1,6 @@ { "name": "create-twilio-function", - "version": "3.3.5", + "version": "3.3.6", "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.2.4", + "@twilio/runtime-handler": "^1.2.5", "jest": "^26.6.3", "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.4.4", + "twilio-run": "^3.4.5", "window-size": "^1.1.1", "wrap-ansi": "^7.0.0", "yargs": "^17.2.1" diff --git a/packages/plugin-assets/CHANGELOG.md b/packages/plugin-assets/CHANGELOG.md index 0c87773a..78d7d3bf 100644 --- a/packages/plugin-assets/CHANGELOG.md +++ b/packages/plugin-assets/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.0.4](https://github.com/twilio-labs/serverless-toolkit/compare/@twilio-labs/plugin-assets@2.0.3...@twilio-labs/plugin-assets@2.0.4) (2022-10-11) + + +### Bug Fixes + +* updated oclif-dev to oclif cmd ([#426](https://github.com/twilio-labs/serverless-toolkit/issues/426)) ([67d83bf](https://github.com/twilio-labs/serverless-toolkit/commit/67d83bfb6707b5c03142174946b7b8fa4d0cc1d9)) + + + + + ## [2.0.3](https://github.com/twilio-labs/serverless-toolkit/compare/@twilio-labs/plugin-assets@2.0.2...@twilio-labs/plugin-assets@2.0.3) (2022-08-31) **Note:** Version bump only for package @twilio-labs/plugin-assets diff --git a/packages/plugin-assets/README.md b/packages/plugin-assets/README.md index 2cdb6050..2288c29e 100644 --- a/packages/plugin-assets/README.md +++ b/packages/plugin-assets/README.md @@ -56,23 +56,24 @@ Create a new assets service to use as a bucket ``` USAGE - $ twilio assets:init + $ twilio assets:init [-l debug|info|warn|error|none] [-o columns|json|tsv|none] [--silent] [-p <value>] + [--service-name <value>] [--properties <value>] -OPTIONS +FLAGS -l=(debug|info|warn|error|none) [default: info] Level of logging messages. -o=(columns|json|tsv|none) [default: columns] Format of command output. - -p, --profile=profile Shorthand identifier for your profile. - - --properties=properties [default: service_sid, sid, domain_name] The asset service environment properties you + -p, --profile=<value> Shorthand identifier for your profile. + --properties=<value> [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 A unique name for your asset service. May only contain alphanumeric characters and + --service-name=<value> A unique name for your asset service. May only contain alphanumeric characters and hyphens. - --silent Suppress output and logs. This is a shorthand for "-l none -o none". + +DESCRIPTION + Create a new assets service to use as a bucket ``` -_See code: [src/commands/assets/init.js](https://github.com/twilio-labs/serverless-toolkit/blob/v2.0.3/src/commands/assets/init.js)_ +_See code: [src/commands/assets/init.js](https://github.com/twilio-labs/serverless-toolkit/blob/v2.0.4/src/commands/assets/init.js)_ ## `twilio assets:list` @@ -80,20 +81,22 @@ List all the assets in the service ``` USAGE - $ twilio assets:list + $ twilio assets:list [-l debug|info|warn|error|none] [-o columns|json|tsv|none] [--silent] [-p <value>] + [--properties <value>] -OPTIONS +FLAGS -l=(debug|info|warn|error|none) [default: info] Level of logging messages. -o=(columns|json|tsv|none) [default: columns] Format of command output. - -p, --profile=profile Shorthand identifier for your profile. - - --properties=properties [default: sid, path, url, visibility] The asset properties you would like to display + -p, --profile=<value> Shorthand identifier for your profile. + --properties=<value> [default: sid, path, url, visibility] The asset properties you would like to display (JSON output always shows all properties). - --silent Suppress output and logs. This is a shorthand for "-l none -o none". + +DESCRIPTION + List all the assets in the service ``` -_See code: [src/commands/assets/list.js](https://github.com/twilio-labs/serverless-toolkit/blob/v2.0.3/src/commands/assets/list.js)_ +_See code: [src/commands/assets/list.js](https://github.com/twilio-labs/serverless-toolkit/blob/v2.0.4/src/commands/assets/list.js)_ ## `twilio assets:upload FILE` @@ -101,25 +104,26 @@ Upload a new asset to the Assets service ``` USAGE - $ twilio assets:upload FILE + $ twilio assets:upload [FILE] [-l debug|info|warn|error|none] [-o columns|json|tsv|none] [--silent] [-p <value>] + [--protected] [--properties <value>] ARGUMENTS FILE The path to the file you want to upload -OPTIONS +FLAGS -l=(debug|info|warn|error|none) [default: info] Level of logging messages. -o=(columns|json|tsv|none) [default: columns] Format of command output. - -p, --profile=profile Shorthand identifier for your profile. - - --properties=properties [default: sid, path, url, visibility] The asset properties you would like to display + -p, --profile=<value> Shorthand identifier for your profile. + --properties=<value> [default: sid, path, url, visibility] The asset properties you would like to display (JSON output always shows all properties). - --protected Sets the uploaded asset's visibility to 'protected' - --silent Suppress output and logs. This is a shorthand for "-l none -o none". + +DESCRIPTION + Upload a new asset to the Assets service ``` -_See code: [src/commands/assets/upload.js](https://github.com/twilio-labs/serverless-toolkit/blob/v2.0.3/src/commands/assets/upload.js)_ +_See code: [src/commands/assets/upload.js](https://github.com/twilio-labs/serverless-toolkit/blob/v2.0.4/src/commands/assets/upload.js)_ <!-- commandsstop --> ## Contributing diff --git a/packages/plugin-assets/package.json b/packages/plugin-assets/package.json index 646037ac..00987202 100644 --- a/packages/plugin-assets/package.json +++ b/packages/plugin-assets/package.json @@ -1,7 +1,7 @@ { "name": "@twilio-labs/plugin-assets", "description": "Easily upload assets to a Twilio Assets service", - "version": "2.0.3", + "version": "2.0.4", "author": "Twilio Inc. <open-source@twilio.com> (https://www.twilio.com/labs)", "contributors": [ "Phil Nash <philnash@twilio.com>" @@ -20,8 +20,8 @@ "@oclif/test": "^1.2.5", "@twilio/cli-test": "^2.1.1", "jest": "^26.6.3", - "rimraf": "^3.0.2", - "oclif": "^3" + "oclif": "^3", + "rimraf": "^3.0.2" }, "engines": { "node": ">=14" diff --git a/packages/plugin-serverless/CHANGELOG.md b/packages/plugin-serverless/CHANGELOG.md index 80085fdd..d5ecab23 100644 --- a/packages/plugin-serverless/CHANGELOG.md +++ b/packages/plugin-serverless/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.0.4](https://github.com/twilio-labs/serverless-toolkit/compare/@twilio-labs/plugin-serverless@3.0.3...@twilio-labs/plugin-serverless@3.0.4) (2022-10-11) + + +### Bug Fixes + +* updated oclif-dev to oclif cmd ([#426](https://github.com/twilio-labs/serverless-toolkit/issues/426)) ([67d83bf](https://github.com/twilio-labs/serverless-toolkit/commit/67d83bfb6707b5c03142174946b7b8fa4d0cc1d9)) + + + + + ## [3.0.3](https://github.com/twilio-labs/serverless-toolkit/compare/@twilio-labs/plugin-serverless@3.0.2...@twilio-labs/plugin-serverless@3.0.3) (2022-08-31) **Note:** Version bump only for package @twilio-labs/plugin-serverless diff --git a/packages/plugin-serverless/README.md b/packages/plugin-serverless/README.md index 40b5c698..21171c8c 100644 --- a/packages/plugin-serverless/README.md +++ b/packages/plugin-serverless/README.md @@ -54,7 +54,9 @@ export TWILIO_SERVERLESS_API_RETRY_LIMIT=0 ## Commands <!-- commands --> +* [`twilio serverless:activate`](#twilio-serverlessactivate) * [`twilio serverless:deploy`](#twilio-serverlessdeploy) +* [`twilio serverless:dev [DIR]`](#twilio-serverlessdev-dir) * [`twilio serverless:env:get`](#twilio-serverlessenvget) * [`twilio serverless:env:import`](#twilio-serverlessenvimport) * [`twilio serverless:env:list`](#twilio-serverlessenvlist) @@ -66,105 +68,185 @@ export TWILIO_SERVERLESS_API_RETRY_LIMIT=0 * [`twilio serverless:logs`](#twilio-serverlesslogs) * [`twilio serverless:new [NAMESPACE]`](#twilio-serverlessnew-namespace) * [`twilio serverless:promote`](#twilio-serverlesspromote) +* [`twilio serverless:run [DIR]`](#twilio-serverlessrun-dir) * [`twilio serverless:start [DIR]`](#twilio-serverlessstart-dir) -## `twilio serverless:deploy` +## `twilio serverless:activate` -Deploys existing functions and assets to Twilio +Promotes an existing deployment to a new environment ``` USAGE - $ twilio serverless:deploy - -OPTIONS - -c, --config=config Location of the config file. Absolute path or relative to current working - directory (cwd) - - -l, --log-level=log-level [default: info] Level of logging messages. - - -n, --service-name=service-name Overrides the name of the Serverless project. Default: the name field in your - package.json - - -o, --output-format=output-format Output the results in a different format - - -p, --profile=profile Shorthand identifier for your profile. - - -u, --username=username A specific API key or account SID to be used for deployment. Uses fields in .env - otherwise - - --[no-]assets Upload assets. Can be turned off with --no-assets + $ twilio serverless:activate [-l debug|info|warn|error|none] [-o columns|json|tsv|none] [--silent] [-p <value>] [-l + <value>] [-c <value>] [--cwd <value>] [--env <value>] [-u <value>] [--password <value>] [--load-system-env] + [--service-sid <value>] [--build-sid <value>] [--from-build <value>] [--source-environment <value>] [--from <value>] + [--environment <value>] [--to <value>] [--production] [--create-environment] [--force] [-o <value>] + +FLAGS + -c, --config=<value> Location of the config file. Absolute path or relative to current working directory + (cwd) + -l=(debug|info|warn|error|none) [default: info] Level of logging messages. + -l, --log-level=<value> [default: info] Level of logging messages. + -o=(columns|json|tsv|none) [default: columns] Format of command output. + -o, --output-format=<value> Output the results in a different format + -p, --profile=<value> Shorthand identifier for your profile. + -u, --username=<value> A specific API key or account SID to be used for deployment. Uses fields in .env + otherwise + --build-sid=<value> An existing Build SID to deploy to the new environment + --create-environment Creates environment if it couldn't find it. + --cwd=<value> Sets the directory of your existing Serverless project. Defaults to current directory + --env=<value> Path to .env file for environment variables that should be installed + --environment=<value> [default: dev] The environment name (domain suffix) you want to use for your + deployment. Alternatively you can specify an environment SID starting with ZE. + --force Will run deployment in force mode. Can be dangerous. + --from=<value> [Alias for "source-environment"] + --from-build=<value> [Alias for "build-sid"] + --load-system-env Uses system environment variables as fallback for variables specified in your .env + file. Needs to be used with --env explicitly specified. + --password=<value> A specific API secret or auth token for deployment. Uses fields from .env otherwise + --production Promote build to the production environment (no domain suffix). Overrides environment + flag + --service-sid=<value> SID of the Twilio Serverless Service to deploy to + --silent Suppress output and logs. This is a shorthand for "-l none -o none". + --source-environment=<value> SID or suffix of an existing environment you want to deploy from. + --to=<value> [Alias for "environment"] + +DESCRIPTION + Promotes an existing deployment to a new environment - --assets-folder=assets-folder Specific folder name to be used for static assets - - --cwd=cwd Sets the directory of your existing Serverless project. Defaults to current - directory - - --env=env Path to .env file for environment variables that should be installed - - --environment=environment [default: dev] The environment name (domain suffix) you want to use for your - deployment. Alternatively you can specify an environment SID starting with ZE. +ALIASES + $ twilio serverless:activate +``` - --force Will run deployment in force mode. Can be dangerous. +## `twilio serverless:deploy` - --[no-]functions Upload functions. Can be turned off with --no-functions +Deploys existing functions and assets to Twilio - --functions-folder=functions-folder Specific folder name to be used for static functions +``` +USAGE + $ twilio serverless:deploy [-l debug|info|warn|error|none] [-o columns|json|tsv|none] [--silent] [-p <value>] [-l + <value>] [-c <value>] [--cwd <value>] [--env <value>] [-u <value>] [--password <value>] [--load-system-env] + [--service-sid <value>] [--environment <value>] [--to <value>] [-n <value>] [--override-existing-project] [--force] + [--functions] [--assets] [--assets-folder <value>] [--functions-folder <value>] [--runtime <value>] [-o <value>] + [--production] + +FLAGS + -c, --config=<value> Location of the config file. Absolute path or relative to current working directory + (cwd) + -l=(debug|info|warn|error|none) [default: info] Level of logging messages. + -l, --log-level=<value> [default: info] Level of logging messages. + -n, --service-name=<value> Overrides the name of the Serverless project. Default: the name field in your + package.json + -o=(columns|json|tsv|none) [default: columns] Format of command output. + -o, --output-format=<value> Output the results in a different format + -p, --profile=<value> Shorthand identifier for your profile. + -u, --username=<value> A specific API key or account SID to be used for deployment. Uses fields in .env + otherwise + --[no-]assets Upload assets. Can be turned off with --no-assets + --assets-folder=<value> Specific folder name to be used for static assets + --cwd=<value> Sets the directory of your existing Serverless project. Defaults to current directory + --env=<value> Path to .env file for environment variables that should be installed + --environment=<value> [default: dev] The environment name (domain suffix) you want to use for your + deployment. Alternatively you can specify an environment SID starting with ZE. + --force Will run deployment in force mode. Can be dangerous. + --[no-]functions Upload functions. Can be turned off with --no-functions + --functions-folder=<value> Specific folder name to be used for static functions + --load-system-env Uses system environment variables as fallback for variables specified in your .env + file. Needs to be used with --env explicitly specified. + --override-existing-project Deploys Serverless project to existing service if a naming conflict has been found. + --password=<value> A specific API secret or auth token for deployment. Uses fields from .env otherwise + --production Please prefer the "activate" command! Deploys to the production environment (no + domain suffix). Overrides the value passed via the environment flag. + --runtime=<value> The version of Node.js to deploy the build to. (node14) + --service-sid=<value> SID of the Twilio Serverless Service to deploy to + --silent Suppress output and logs. This is a shorthand for "-l none -o none". + --to=<value> [Alias for "environment"] + +DESCRIPTION + Deploys existing functions and assets to Twilio +``` - --load-system-env Uses system environment variables as fallback for variables specified in your - .env file. Needs to be used with --env explicitly specified. +_See code: [src/commands/serverless/deploy.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.4/src/commands/serverless/deploy.js)_ - --override-existing-project Deploys Serverless project to existing service if a naming conflict has been - found. +## `twilio serverless:dev [DIR]` - --password=password A specific API secret or auth token for deployment. Uses fields from .env - otherwise +Starts local Twilio Functions development server - --production Please prefer the "activate" command! Deploys to the production environment (no - domain suffix). Overrides the value passed via the environment flag. +``` +USAGE + $ twilio serverless:dev [DIR] -p <value> [-l <value>] [-c <value>] [--cwd <value>] [--env <value>] [-f] [--ngrok + <value>] [--logs] [--detailed-logs] [--live] [--inspect <value>] [--inspect-brk <value>] [--legacy-mode] + [--assets-folder <value>] [--functions-folder <value>] [--fork-process] - --runtime=runtime The version of Node.js to deploy the build to. (node14) +ARGUMENTS + DIR Root directory to serve local Functions/Assets from - --service-sid=service-sid SID of the Twilio Serverless Service to deploy to +FLAGS + -c, --config=<value> Location of the config file. Absolute path or relative to current working directory (cwd) + -f, --load-local-env Includes the local environment variables + -l, --log-level=<value> [default: info] Level of logging messages. + -p, --port=<value> (required) [default: 3000] Override default port of 3000 + --assets-folder=<value> Specific folder name to be used for static assets + --cwd=<value> Alternative way to define the directory to start the server in. Overrides the [dir] + argument passed. + --detailed-logs Toggles detailed request logging by showing request body and query params + --env=<value> Path to .env file for environment variables that should be installed + --[no-]fork-process Disable forking function processes to emulate production environment + --functions-folder=<value> Specific folder name to be used for static functions + --inspect=<value> Enables Node.js debugging protocol + --inspect-brk=<value> Enables Node.js debugging protocol, stops execution until debugger is attached + --legacy-mode Enables legacy mode, it will prefix your asset paths with /assets + --[no-]live Always serve from the current functions (no caching) + --[no-]logs Toggles request logging + --ngrok=<value> Uses ngrok to create a public url. Pass a string to set the subdomain (requires a paid-for + ngrok account). + +DESCRIPTION + Starts local Twilio Functions development server - --to=to [Alias for "environment"] +ALIASES + $ twilio serverless:dev + $ twilio serverless:run ``` -_See code: [src/commands/serverless/deploy.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.3/src/commands/serverless/deploy.js)_ - ## `twilio serverless:env:get` Retrieves the value of a specific environment variable ``` USAGE - $ twilio serverless:env:get - -OPTIONS - -c, --config=config Location of the config file. Absolute path or relative to current working directory (cwd) - -l, --log-level=log-level [default: info] Level of logging messages. - -p, --profile=profile Shorthand identifier for your profile. - -u, --username=username A specific API key or account SID to be used for deployment. Uses fields in .env otherwise - --cwd=cwd Sets the directory of your existing Serverless project. Defaults to current directory - --env=env Path to .env file for environment variables that should be installed - - --environment=environment [default: dev] The environment name (domain suffix) you want to use for your deployment. - Alternatively you can specify an environment SID starting with ZE. - - --key=key Name of the environment variable - - --load-system-env Uses system environment variables as fallback for variables specified in your .env file. - Needs to be used with --env explicitly specified. - - --password=password A specific API secret or auth token for deployment. Uses fields from .env otherwise - - --production Promote build to the production environment (no domain suffix). Overrides environment flag - - --service-sid=service-sid SID of the Twilio Serverless Service to deploy to - - --to=to [Alias for "environment"] + $ twilio serverless:env:get [-l debug|info|warn|error|none] [-o columns|json|tsv|none] [--silent] [-p <value>] [-l + <value>] [-c <value>] [--cwd <value>] [--env <value>] [-u <value>] [--password <value>] [--load-system-env] + [--service-sid <value>] [--environment <value>] [--to <value>] [--key <value>] [--production] + +FLAGS + -c, --config=<value> Location of the config file. Absolute path or relative to current working directory + (cwd) + -l=(debug|info|warn|error|none) [default: info] Level of logging messages. + -l, --log-level=<value> [default: info] Level of logging messages. + -o=(columns|json|tsv|none) [default: columns] Format of command output. + -p, --profile=<value> Shorthand identifier for your profile. + -u, --username=<value> A specific API key or account SID to be used for deployment. Uses fields in .env + otherwise + --cwd=<value> Sets the directory of your existing Serverless project. Defaults to current directory + --env=<value> Path to .env file for environment variables that should be installed + --environment=<value> [default: dev] The environment name (domain suffix) you want to use for your + deployment. Alternatively you can specify an environment SID starting with ZE. + --key=<value> Name of the environment variable + --load-system-env Uses system environment variables as fallback for variables specified in your .env + file. Needs to be used with --env explicitly specified. + --password=<value> A specific API secret or auth token for deployment. Uses fields from .env otherwise + --production Promote build to the production environment (no domain suffix). Overrides environment + flag + --service-sid=<value> SID of the Twilio Serverless Service to deploy to + --silent Suppress output and logs. This is a shorthand for "-l none -o none". + --to=<value> [Alias for "environment"] + +DESCRIPTION + Retrieves the value of a specific environment variable ``` -_See code: [src/commands/serverless/env/get.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.3/src/commands/serverless/env/get.js)_ +_See code: [src/commands/serverless/env/get.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.4/src/commands/serverless/env/get.js)_ ## `twilio serverless:env:import` @@ -172,32 +254,37 @@ Takes a .env file and uploads all environment variables to a given environment ``` USAGE - $ twilio serverless:env:import - -OPTIONS - -c, --config=config Location of the config file. Absolute path or relative to current working directory (cwd) - -l, --log-level=log-level [default: info] Level of logging messages. - -p, --profile=profile Shorthand identifier for your profile. - -u, --username=username A specific API key or account SID to be used for deployment. Uses fields in .env otherwise - --cwd=cwd Sets the directory of your existing Serverless project. Defaults to current directory - --env=env Path to .env file for environment variables that should be installed - - --environment=environment [default: dev] The environment name (domain suffix) you want to use for your deployment. - Alternatively you can specify an environment SID starting with ZE. - - --load-system-env Uses system environment variables as fallback for variables specified in your .env file. - Needs to be used with --env explicitly specified. - - --password=password A specific API secret or auth token for deployment. Uses fields from .env otherwise - - --production Promote build to the production environment (no domain suffix). Overrides environment flag - - --service-sid=service-sid SID of the Twilio Serverless Service to deploy to - - --to=to [Alias for "environment"] + $ twilio serverless:env:import [-l debug|info|warn|error|none] [-o columns|json|tsv|none] [--silent] [-p <value>] [-l + <value>] [-c <value>] [--cwd <value>] [--env <value>] [-u <value>] [--password <value>] [--load-system-env] + [--service-sid <value>] [--environment <value>] [--to <value>] [--production] + +FLAGS + -c, --config=<value> Location of the config file. Absolute path or relative to current working directory + (cwd) + -l=(debug|info|warn|error|none) [default: info] Level of logging messages. + -l, --log-level=<value> [default: info] Level of logging messages. + -o=(columns|json|tsv|none) [default: columns] Format of command output. + -p, --profile=<value> Shorthand identifier for your profile. + -u, --username=<value> A specific API key or account SID to be used for deployment. Uses fields in .env + otherwise + --cwd=<value> Sets the directory of your existing Serverless project. Defaults to current directory + --env=<value> Path to .env file for environment variables that should be installed + --environment=<value> [default: dev] The environment name (domain suffix) you want to use for your + deployment. Alternatively you can specify an environment SID starting with ZE. + --load-system-env Uses system environment variables as fallback for variables specified in your .env + file. Needs to be used with --env explicitly specified. + --password=<value> A specific API secret or auth token for deployment. Uses fields from .env otherwise + --production Promote build to the production environment (no domain suffix). Overrides environment + flag + --service-sid=<value> SID of the Twilio Serverless Service to deploy to + --silent Suppress output and logs. This is a shorthand for "-l none -o none". + --to=<value> [Alias for "environment"] + +DESCRIPTION + Takes a .env file and uploads all environment variables to a given environment ``` -_See code: [src/commands/serverless/env/import.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.3/src/commands/serverless/env/import.js)_ +_See code: [src/commands/serverless/env/import.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.4/src/commands/serverless/env/import.js)_ ## `twilio serverless:env:list` @@ -205,45 +292,39 @@ Lists all environment variables for a given environment ``` USAGE - $ twilio serverless:env:list - -OPTIONS - -c, --config=config Location of the config file. Absolute path or relative to current working directory - (cwd) - - -l, --log-level=log-level [default: info] Level of logging messages. - - -o, --output-format=output-format Output the results in a different format - - -p, --profile=profile Shorthand identifier for your profile. - - -u, --username=username A specific API key or account SID to be used for deployment. Uses fields in .env - otherwise - - --cwd=cwd Sets the directory of your existing Serverless project. Defaults to current - directory - - --env=env Path to .env file for environment variables that should be installed - - --environment=environment [default: dev] The environment name (domain suffix) you want to use for your - deployment. Alternatively you can specify an environment SID starting with ZE. - - --load-system-env Uses system environment variables as fallback for variables specified in your .env - file. Needs to be used with --env explicitly specified. - - --password=password A specific API secret or auth token for deployment. Uses fields from .env otherwise - - --production Promote build to the production environment (no domain suffix). Overrides - environment flag - - --service-sid=service-sid SID of the Twilio Serverless Service to deploy to - - --show-values Show the values of your environment variables - - --to=to [Alias for "environment"] + $ twilio serverless:env:list [-l debug|info|warn|error|none] [-o columns|json|tsv|none] [--silent] [-p <value>] [-l + <value>] [-c <value>] [--cwd <value>] [--env <value>] [-u <value>] [--password <value>] [--load-system-env] + [--service-sid <value>] [--environment <value>] [--to <value>] [--show-values] [--production] [-o <value>] + +FLAGS + -c, --config=<value> Location of the config file. Absolute path or relative to current working directory + (cwd) + -l=(debug|info|warn|error|none) [default: info] Level of logging messages. + -l, --log-level=<value> [default: info] Level of logging messages. + -o=(columns|json|tsv|none) [default: columns] Format of command output. + -o, --output-format=<value> Output the results in a different format + -p, --profile=<value> Shorthand identifier for your profile. + -u, --username=<value> A specific API key or account SID to be used for deployment. Uses fields in .env + otherwise + --cwd=<value> Sets the directory of your existing Serverless project. Defaults to current directory + --env=<value> Path to .env file for environment variables that should be installed + --environment=<value> [default: dev] The environment name (domain suffix) you want to use for your + deployment. Alternatively you can specify an environment SID starting with ZE. + --load-system-env Uses system environment variables as fallback for variables specified in your .env + file. Needs to be used with --env explicitly specified. + --password=<value> A specific API secret or auth token for deployment. Uses fields from .env otherwise + --production Promote build to the production environment (no domain suffix). Overrides environment + flag + --service-sid=<value> SID of the Twilio Serverless Service to deploy to + --show-values Show the values of your environment variables + --silent Suppress output and logs. This is a shorthand for "-l none -o none". + --to=<value> [Alias for "environment"] + +DESCRIPTION + Lists all environment variables for a given environment ``` -_See code: [src/commands/serverless/env/list.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.3/src/commands/serverless/env/list.js)_ +_See code: [src/commands/serverless/env/list.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.4/src/commands/serverless/env/list.js)_ ## `twilio serverless:env:set` @@ -251,36 +332,39 @@ Sets an environment variable with a given key and value ``` USAGE - $ twilio serverless:env:set - -OPTIONS - -c, --config=config Location of the config file. Absolute path or relative to current working directory (cwd) - -l, --log-level=log-level [default: info] Level of logging messages. - -p, --profile=profile Shorthand identifier for your profile. - -u, --username=username A specific API key or account SID to be used for deployment. Uses fields in .env otherwise - --cwd=cwd Sets the directory of your existing Serverless project. Defaults to current directory - --env=env Path to .env file for environment variables that should be installed - - --environment=environment [default: dev] The environment name (domain suffix) you want to use for your deployment. - Alternatively you can specify an environment SID starting with ZE. - - --key=key Name of the environment variable - - --load-system-env Uses system environment variables as fallback for variables specified in your .env file. - Needs to be used with --env explicitly specified. - - --password=password A specific API secret or auth token for deployment. Uses fields from .env otherwise - - --production Promote build to the production environment (no domain suffix). Overrides environment flag - - --service-sid=service-sid SID of the Twilio Serverless Service to deploy to - - --to=to [Alias for "environment"] - - --value=value Name of the environment variable + $ twilio serverless:env:set [-l debug|info|warn|error|none] [-o columns|json|tsv|none] [--silent] [-p <value>] [-l + <value>] [-c <value>] [--cwd <value>] [--env <value>] [-u <value>] [--password <value>] [--load-system-env] + [--service-sid <value>] [--environment <value>] [--to <value>] [--key <value>] [--value <value>] [--production] + +FLAGS + -c, --config=<value> Location of the config file. Absolute path or relative to current working directory + (cwd) + -l=(debug|info|warn|error|none) [default: info] Level of logging messages. + -l, --log-level=<value> [default: info] Level of logging messages. + -o=(columns|json|tsv|none) [default: columns] Format of command output. + -p, --profile=<value> Shorthand identifier for your profile. + -u, --username=<value> A specific API key or account SID to be used for deployment. Uses fields in .env + otherwise + --cwd=<value> Sets the directory of your existing Serverless project. Defaults to current directory + --env=<value> Path to .env file for environment variables that should be installed + --environment=<value> [default: dev] The environment name (domain suffix) you want to use for your + deployment. Alternatively you can specify an environment SID starting with ZE. + --key=<value> Name of the environment variable + --load-system-env Uses system environment variables as fallback for variables specified in your .env + file. Needs to be used with --env explicitly specified. + --password=<value> A specific API secret or auth token for deployment. Uses fields from .env otherwise + --production Promote build to the production environment (no domain suffix). Overrides environment + flag + --service-sid=<value> SID of the Twilio Serverless Service to deploy to + --silent Suppress output and logs. This is a shorthand for "-l none -o none". + --to=<value> [Alias for "environment"] + --value=<value> Name of the environment variable + +DESCRIPTION + Sets an environment variable with a given key and value ``` -_See code: [src/commands/serverless/env/set.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.3/src/commands/serverless/env/set.js)_ +_See code: [src/commands/serverless/env/set.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.4/src/commands/serverless/env/set.js)_ ## `twilio serverless:env:unset` @@ -288,34 +372,38 @@ Removes an environment variable for a given key ``` USAGE - $ twilio serverless:env:unset - -OPTIONS - -c, --config=config Location of the config file. Absolute path or relative to current working directory (cwd) - -l, --log-level=log-level [default: info] Level of logging messages. - -p, --profile=profile Shorthand identifier for your profile. - -u, --username=username A specific API key or account SID to be used for deployment. Uses fields in .env otherwise - --cwd=cwd Sets the directory of your existing Serverless project. Defaults to current directory - --env=env Path to .env file for environment variables that should be installed - - --environment=environment [default: dev] The environment name (domain suffix) you want to use for your deployment. - Alternatively you can specify an environment SID starting with ZE. - - --key=key Name of the environment variable - - --load-system-env Uses system environment variables as fallback for variables specified in your .env file. - Needs to be used with --env explicitly specified. - - --password=password A specific API secret or auth token for deployment. Uses fields from .env otherwise - - --production Promote build to the production environment (no domain suffix). Overrides environment flag - - --service-sid=service-sid SID of the Twilio Serverless Service to deploy to - - --to=to [Alias for "environment"] + $ twilio serverless:env:unset [-l debug|info|warn|error|none] [-o columns|json|tsv|none] [--silent] [-p <value>] [-l + <value>] [-c <value>] [--cwd <value>] [--env <value>] [-u <value>] [--password <value>] [--load-system-env] + [--service-sid <value>] [--environment <value>] [--to <value>] [--key <value>] [--production] + +FLAGS + -c, --config=<value> Location of the config file. Absolute path or relative to current working directory + (cwd) + -l=(debug|info|warn|error|none) [default: info] Level of logging messages. + -l, --log-level=<value> [default: info] Level of logging messages. + -o=(columns|json|tsv|none) [default: columns] Format of command output. + -p, --profile=<value> Shorthand identifier for your profile. + -u, --username=<value> A specific API key or account SID to be used for deployment. Uses fields in .env + otherwise + --cwd=<value> Sets the directory of your existing Serverless project. Defaults to current directory + --env=<value> Path to .env file for environment variables that should be installed + --environment=<value> [default: dev] The environment name (domain suffix) you want to use for your + deployment. Alternatively you can specify an environment SID starting with ZE. + --key=<value> Name of the environment variable + --load-system-env Uses system environment variables as fallback for variables specified in your .env + file. Needs to be used with --env explicitly specified. + --password=<value> A specific API secret or auth token for deployment. Uses fields from .env otherwise + --production Promote build to the production environment (no domain suffix). Overrides environment + flag + --service-sid=<value> SID of the Twilio Serverless Service to deploy to + --silent Suppress output and logs. This is a shorthand for "-l none -o none". + --to=<value> [Alias for "environment"] + +DESCRIPTION + Removes an environment variable for a given key ``` -_See code: [src/commands/serverless/env/unset.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.3/src/commands/serverless/env/unset.js)_ +_See code: [src/commands/serverless/env/unset.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.4/src/commands/serverless/env/unset.js)_ ## `twilio serverless:init NAME` @@ -323,29 +411,32 @@ Creates a new Twilio Function project ``` USAGE - $ twilio serverless:init NAME + $ twilio serverless:init [NAME] [-l debug|info|warn|error|none] [-o columns|json|tsv|none] [--silent] [-p <value>] + [-a <value>] [-t <value>] [--skip-credentials] [--import-credentials] [--template <value>] [--empty] [--typescript] ARGUMENTS NAME Name of Serverless project and directory that will be created -OPTIONS - -a, --account-sid=account-sid The Account SID for your Twilio account - -p, --profile=profile Shorthand identifier for your profile. - -t, --auth-token=auth-token Your Twilio account Auth Token - --empty Initialize your new project with empty functions and assets directories - - --import-credentials Import credentials from the environment variables TWILIO_ACCOUNT_SID and - TWILIO_AUTH_TOKEN - - --skip-credentials Don't ask for Twilio account credentials or import them from the environment - - --template=template Initialize your new project with a template from - github.com/twilio-labs/function-templates - - --typescript Initialize your Serverless project with TypeScript +FLAGS + -a, --account-sid=<value> The Account SID for your Twilio account + -l=(debug|info|warn|error|none) [default: info] Level of logging messages. + -o=(columns|json|tsv|none) [default: columns] Format of command output. + -p, --profile=<value> Shorthand identifier for your profile. + -t, --auth-token=<value> Your Twilio account Auth Token + --empty Initialize your new project with empty functions and assets directories + --import-credentials Import credentials from the environment variables TWILIO_ACCOUNT_SID and + TWILIO_AUTH_TOKEN + --silent Suppress output and logs. This is a shorthand for "-l none -o none". + --skip-credentials Don't ask for Twilio account credentials or import them from the environment + --template=<value> Initialize your new project with a template from + github.com/twilio-labs/function-templates + --typescript Initialize your Serverless project with TypeScript + +DESCRIPTION + Creates a new Twilio Function project ``` -_See code: [src/commands/serverless/init.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.3/src/commands/serverless/init.js)_ +_See code: [src/commands/serverless/init.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.4/src/commands/serverless/init.js)_ ## `twilio serverless:list [TYPES]` @@ -353,47 +444,41 @@ List existing services, environments, variables, deployments for your Twilio Ser ``` USAGE - $ twilio serverless:list [TYPES] + $ twilio serverless:list [TYPES] [-l debug|info|warn|error|none] [-o columns|json|tsv|none] [--silent] [-p <value>] + [-l <value>] [-c <value>] [--cwd <value>] [--env <value>] [-u <value>] [--password <value>] [--load-system-env] [-n + <value>] [--extended-output] [--service-sid <value>] [-o <value>] [--environment <value>] [--to <value>] ARGUMENTS TYPES [default: services] Comma separated list of things to list (services,environments,functions,assets,variables) -OPTIONS - -c, --config=config Location of the config file. Absolute path or relative to current working directory - (cwd) - - -l, --log-level=log-level [default: info] Level of logging messages. - - -n, --service-name=service-name Overrides the name of the Serverless project. Default: the name field in your - package.json - - -o, --output-format=output-format Output the results in a different format - - -p, --profile=profile Shorthand identifier for your profile. - - -u, --username=username A specific API key or account SID to be used for deployment. Uses fields in .env - otherwise - - --cwd=cwd Sets the directory of your existing Serverless project. Defaults to current - directory - - --env=env Path to .env file for environment variables that should be installed - - --environment=environment [default: dev] The environment to list variables for - - --extended-output Show an extended set of properties on the output - - --load-system-env Uses system environment variables as fallback for variables specified in your .env - file. Needs to be used with --env explicitly specified. - - --password=password A specific API secret or auth token for deployment. Uses fields from .env otherwise - - --service-sid=service-sid SID of the Twilio Serverless Service to deploy to - - --to=to [Alias for "environment"] +FLAGS + -c, --config=<value> Location of the config file. Absolute path or relative to current working directory + (cwd) + -l=(debug|info|warn|error|none) [default: info] Level of logging messages. + -l, --log-level=<value> [default: info] Level of logging messages. + -n, --service-name=<value> Overrides the name of the Serverless project. Default: the name field in your + package.json + -o=(columns|json|tsv|none) [default: columns] Format of command output. + -o, --output-format=<value> Output the results in a different format + -p, --profile=<value> Shorthand identifier for your profile. + -u, --username=<value> A specific API key or account SID to be used for deployment. Uses fields in .env + otherwise + --cwd=<value> Sets the directory of your existing Serverless project. Defaults to current directory + --env=<value> Path to .env file for environment variables that should be installed + --environment=<value> [default: dev] The environment to list variables for + --extended-output Show an extended set of properties on the output + --load-system-env Uses system environment variables as fallback for variables specified in your .env + file. Needs to be used with --env explicitly specified. + --password=<value> A specific API secret or auth token for deployment. Uses fields from .env otherwise + --service-sid=<value> SID of the Twilio Serverless Service to deploy to + --silent Suppress output and logs. This is a shorthand for "-l none -o none". + --to=<value> [Alias for "environment"] + +DESCRIPTION + List existing services, environments, variables, deployments for your Twilio Serverless Account ``` -_See code: [src/commands/serverless/list.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.3/src/commands/serverless/list.js)_ +_See code: [src/commands/serverless/list.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.4/src/commands/serverless/list.js)_ ## `twilio serverless:list-templates` @@ -401,13 +486,16 @@ Lists the available Twilio Function templates ``` USAGE - $ twilio serverless:list-templates + $ twilio serverless:list-templates [-o <value>] + +FLAGS + -o, --output-format=<value> Output the results in a different format -OPTIONS - -o, --output-format=output-format Output the results in a different format +DESCRIPTION + Lists the available Twilio Function templates ``` -_See code: [src/commands/serverless/list-templates.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.3/src/commands/serverless/list-templates.js)_ +_See code: [src/commands/serverless/list-templates.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.4/src/commands/serverless/list-templates.js)_ ## `twilio serverless:logs` @@ -415,45 +503,39 @@ Print logs from your Twilio Serverless project ``` USAGE - $ twilio serverless:logs - -OPTIONS - -c, --config=config Location of the config file. Absolute path or relative to current working directory - (cwd) - - -l, --log-level=log-level [default: info] Level of logging messages. - - -o, --output-format=output-format Output the results in a different format - - -p, --profile=profile Shorthand identifier for your profile. - - -u, --username=username A specific API key or account SID to be used for deployment. Uses fields in .env - otherwise - - --cwd=cwd Sets the directory of your existing Serverless project. Defaults to current - directory - - --env=env Path to .env file for environment variables that should be installed - - --environment=environment [default: dev] The environment to retrieve the logs for - - --function-sid=function-sid Specific Function SID to retrieve logs for - - --load-system-env Uses system environment variables as fallback for variables specified in your .env - file. Needs to be used with --env explicitly specified. - - --password=password A specific API secret or auth token for deployment. Uses fields from .env otherwise - - --production Retrieve logs for the production environment. Overrides the "environment" flag - - --service-sid=service-sid SID of the Twilio Serverless Service to deploy to - - --tail Continuously stream the logs - - --to=to [Alias for "environment"] + $ twilio serverless:logs [-l debug|info|warn|error|none] [-o columns|json|tsv|none] [--silent] [-p <value>] [-l + <value>] [-c <value>] [--cwd <value>] [--env <value>] [-u <value>] [--password <value>] [--load-system-env] + [--service-sid <value>] [--function-sid <value>] [--tail] [-o <value>] [--production] [--environment <value>] [--to + <value>] + +FLAGS + -c, --config=<value> Location of the config file. Absolute path or relative to current working directory + (cwd) + -l=(debug|info|warn|error|none) [default: info] Level of logging messages. + -l, --log-level=<value> [default: info] Level of logging messages. + -o=(columns|json|tsv|none) [default: columns] Format of command output. + -o, --output-format=<value> Output the results in a different format + -p, --profile=<value> Shorthand identifier for your profile. + -u, --username=<value> A specific API key or account SID to be used for deployment. Uses fields in .env + otherwise + --cwd=<value> Sets the directory of your existing Serverless project. Defaults to current directory + --env=<value> Path to .env file for environment variables that should be installed + --environment=<value> [default: dev] The environment to retrieve the logs for + --function-sid=<value> Specific Function SID to retrieve logs for + --load-system-env Uses system environment variables as fallback for variables specified in your .env + file. Needs to be used with --env explicitly specified. + --password=<value> A specific API secret or auth token for deployment. Uses fields from .env otherwise + --production Retrieve logs for the production environment. Overrides the "environment" flag + --service-sid=<value> SID of the Twilio Serverless Service to deploy to + --silent Suppress output and logs. This is a shorthand for "-l none -o none". + --tail Continuously stream the logs + --to=<value> [Alias for "environment"] + +DESCRIPTION + Print logs from your Twilio Serverless project ``` -_See code: [src/commands/serverless/logs.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.3/src/commands/serverless/logs.js)_ +_See code: [src/commands/serverless/logs.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.4/src/commands/serverless/logs.js)_ ## `twilio serverless:new [NAMESPACE]` @@ -461,20 +543,23 @@ Creates a new Twilio Function based on an existing template ``` USAGE - $ twilio serverless:new [NAMESPACE] + $ twilio serverless:new [NAMESPACE] [-l <value>] [-c <value>] [--cwd <value>] [--env <value>] [--template <value>] ARGUMENTS NAMESPACE The namespace your assets/functions should be grouped under -OPTIONS - -c, --config=config Location of the config file. Absolute path or relative to current working directory (cwd) - -l, --log-level=log-level [default: info] Level of logging messages. - --cwd=cwd Sets the directory of your existing Serverless project. Defaults to current directory - --env=env Path to .env file for environment variables that should be installed - --template=template +FLAGS + -c, --config=<value> Location of the config file. Absolute path or relative to current working directory (cwd) + -l, --log-level=<value> [default: info] Level of logging messages. + --cwd=<value> Sets the directory of your existing Serverless project. Defaults to current directory + --env=<value> Path to .env file for environment variables that should be installed + --template=<value> + +DESCRIPTION + Creates a new Twilio Function based on an existing template ``` -_See code: [src/commands/serverless/new.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.3/src/commands/serverless/new.js)_ +_See code: [src/commands/serverless/new.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.4/src/commands/serverless/new.js)_ ## `twilio serverless:promote` @@ -482,114 +567,132 @@ Promotes an existing deployment to a new environment ``` USAGE - $ twilio serverless:promote - -OPTIONS - -c, --config=config Location of the config file. Absolute path or relative to current working - directory (cwd) - - -l, --log-level=log-level [default: info] Level of logging messages. - - -o, --output-format=output-format Output the results in a different format - - -p, --profile=profile Shorthand identifier for your profile. - - -u, --username=username A specific API key or account SID to be used for deployment. Uses fields in - .env otherwise - - --build-sid=build-sid An existing Build SID to deploy to the new environment - - --create-environment Creates environment if it couldn't find it. - - --cwd=cwd Sets the directory of your existing Serverless project. Defaults to current - directory - - --env=env Path to .env file for environment variables that should be installed - - --environment=environment [default: dev] The environment name (domain suffix) you want to use for your - deployment. Alternatively you can specify an environment SID starting with - ZE. - - --force Will run deployment in force mode. Can be dangerous. - - --from=from [Alias for "source-environment"] - - --from-build=from-build [Alias for "build-sid"] - - --load-system-env Uses system environment variables as fallback for variables specified in your - .env file. Needs to be used with --env explicitly specified. - - --password=password A specific API secret or auth token for deployment. Uses fields from .env - otherwise - - --production Promote build to the production environment (no domain suffix). Overrides - environment flag - - --service-sid=service-sid SID of the Twilio Serverless Service to deploy to - - --source-environment=source-environment SID or suffix of an existing environment you want to deploy from. - - --to=to [Alias for "environment"] + $ twilio serverless:promote [-l debug|info|warn|error|none] [-o columns|json|tsv|none] [--silent] [-p <value>] [-l + <value>] [-c <value>] [--cwd <value>] [--env <value>] [-u <value>] [--password <value>] [--load-system-env] + [--service-sid <value>] [--build-sid <value>] [--from-build <value>] [--source-environment <value>] [--from <value>] + [--environment <value>] [--to <value>] [--production] [--create-environment] [--force] [-o <value>] + +FLAGS + -c, --config=<value> Location of the config file. Absolute path or relative to current working directory + (cwd) + -l=(debug|info|warn|error|none) [default: info] Level of logging messages. + -l, --log-level=<value> [default: info] Level of logging messages. + -o=(columns|json|tsv|none) [default: columns] Format of command output. + -o, --output-format=<value> Output the results in a different format + -p, --profile=<value> Shorthand identifier for your profile. + -u, --username=<value> A specific API key or account SID to be used for deployment. Uses fields in .env + otherwise + --build-sid=<value> An existing Build SID to deploy to the new environment + --create-environment Creates environment if it couldn't find it. + --cwd=<value> Sets the directory of your existing Serverless project. Defaults to current directory + --env=<value> Path to .env file for environment variables that should be installed + --environment=<value> [default: dev] The environment name (domain suffix) you want to use for your + deployment. Alternatively you can specify an environment SID starting with ZE. + --force Will run deployment in force mode. Can be dangerous. + --from=<value> [Alias for "source-environment"] + --from-build=<value> [Alias for "build-sid"] + --load-system-env Uses system environment variables as fallback for variables specified in your .env + file. Needs to be used with --env explicitly specified. + --password=<value> A specific API secret or auth token for deployment. Uses fields from .env otherwise + --production Promote build to the production environment (no domain suffix). Overrides environment + flag + --service-sid=<value> SID of the Twilio Serverless Service to deploy to + --silent Suppress output and logs. This is a shorthand for "-l none -o none". + --source-environment=<value> SID or suffix of an existing environment you want to deploy from. + --to=<value> [Alias for "environment"] + +DESCRIPTION + Promotes an existing deployment to a new environment ALIASES $ twilio serverless:activate ``` -_See code: [src/commands/serverless/promote.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.3/src/commands/serverless/promote.js)_ +_See code: [src/commands/serverless/promote.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.4/src/commands/serverless/promote.js)_ -## `twilio serverless:start [DIR]` +## `twilio serverless:run [DIR]` Starts local Twilio Functions development server ``` USAGE - $ twilio serverless:start [DIR] + $ twilio serverless:run [DIR] -p <value> [-l <value>] [-c <value>] [--cwd <value>] [--env <value>] [-f] [--ngrok + <value>] [--logs] [--detailed-logs] [--live] [--inspect <value>] [--inspect-brk <value>] [--legacy-mode] + [--assets-folder <value>] [--functions-folder <value>] [--fork-process] ARGUMENTS DIR Root directory to serve local Functions/Assets from -OPTIONS - -c, --config=config Location of the config file. Absolute path or relative to current working - directory (cwd) - - -f, --load-local-env Includes the local environment variables +FLAGS + -c, --config=<value> Location of the config file. Absolute path or relative to current working directory (cwd) + -f, --load-local-env Includes the local environment variables + -l, --log-level=<value> [default: info] Level of logging messages. + -p, --port=<value> (required) [default: 3000] Override default port of 3000 + --assets-folder=<value> Specific folder name to be used for static assets + --cwd=<value> Alternative way to define the directory to start the server in. Overrides the [dir] + argument passed. + --detailed-logs Toggles detailed request logging by showing request body and query params + --env=<value> Path to .env file for environment variables that should be installed + --[no-]fork-process Disable forking function processes to emulate production environment + --functions-folder=<value> Specific folder name to be used for static functions + --inspect=<value> Enables Node.js debugging protocol + --inspect-brk=<value> Enables Node.js debugging protocol, stops execution until debugger is attached + --legacy-mode Enables legacy mode, it will prefix your asset paths with /assets + --[no-]live Always serve from the current functions (no caching) + --[no-]logs Toggles request logging + --ngrok=<value> Uses ngrok to create a public url. Pass a string to set the subdomain (requires a paid-for + ngrok account). + +DESCRIPTION + Starts local Twilio Functions development server - -l, --log-level=log-level [default: info] Level of logging messages. - - -p, --port=port (required) [default: 3000] Override default port of 3000 - - --assets-folder=assets-folder Specific folder name to be used for static assets - - --cwd=cwd Alternative way to define the directory to start the server in. Overrides the - [dir] argument passed. - - --detailed-logs Toggles detailed request logging by showing request body and query params - - --env=env Path to .env file for environment variables that should be installed - - --[no-]fork-process Disable forking function processes to emulate production environment - - --functions-folder=functions-folder Specific folder name to be used for static functions - - --inspect=inspect Enables Node.js debugging protocol +ALIASES + $ twilio serverless:dev + $ twilio serverless:run +``` - --inspect-brk=inspect-brk Enables Node.js debugging protocol, stops execution until debugger is attached +## `twilio serverless:start [DIR]` - --legacy-mode Enables legacy mode, it will prefix your asset paths with /assets +Starts local Twilio Functions development server - --[no-]live Always serve from the current functions (no caching) +``` +USAGE + $ twilio serverless:start [DIR] -p <value> [-l <value>] [-c <value>] [--cwd <value>] [--env <value>] [-f] [--ngrok + <value>] [--logs] [--detailed-logs] [--live] [--inspect <value>] [--inspect-brk <value>] [--legacy-mode] + [--assets-folder <value>] [--functions-folder <value>] [--fork-process] - --[no-]logs Toggles request logging +ARGUMENTS + DIR Root directory to serve local Functions/Assets from - --ngrok=ngrok Uses ngrok to create a public url. Pass a string to set the subdomain (requires a - paid-for ngrok account). +FLAGS + -c, --config=<value> Location of the config file. Absolute path or relative to current working directory (cwd) + -f, --load-local-env Includes the local environment variables + -l, --log-level=<value> [default: info] Level of logging messages. + -p, --port=<value> (required) [default: 3000] Override default port of 3000 + --assets-folder=<value> Specific folder name to be used for static assets + --cwd=<value> Alternative way to define the directory to start the server in. Overrides the [dir] + argument passed. + --detailed-logs Toggles detailed request logging by showing request body and query params + --env=<value> Path to .env file for environment variables that should be installed + --[no-]fork-process Disable forking function processes to emulate production environment + --functions-folder=<value> Specific folder name to be used for static functions + --inspect=<value> Enables Node.js debugging protocol + --inspect-brk=<value> Enables Node.js debugging protocol, stops execution until debugger is attached + --legacy-mode Enables legacy mode, it will prefix your asset paths with /assets + --[no-]live Always serve from the current functions (no caching) + --[no-]logs Toggles request logging + --ngrok=<value> Uses ngrok to create a public url. Pass a string to set the subdomain (requires a paid-for + ngrok account). + +DESCRIPTION + Starts local Twilio Functions development server ALIASES $ twilio serverless:dev $ twilio serverless:run ``` -_See code: [src/commands/serverless/start.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.3/src/commands/serverless/start.js)_ +_See code: [src/commands/serverless/start.js](https://github.com/twilio-labs/serverless-toolkit/blob/v3.0.4/src/commands/serverless/start.js)_ <!-- commandsstop --> ## Contributing diff --git a/packages/plugin-serverless/package.json b/packages/plugin-serverless/package.json index e8a17d8e..6c82fc6e 100644 --- a/packages/plugin-serverless/package.json +++ b/packages/plugin-serverless/package.json @@ -1,7 +1,7 @@ { "name": "@twilio-labs/plugin-serverless", "description": "Develop and deploy Twilio Serverless Functions", - "version": "3.0.3", + "version": "3.0.4", "author": "Twilio Inc. <open-source@twilio.com> (https://www.twilio.com/labs)", "contributors": [ "Dominik Kundel <dkundel@twilio.com>" @@ -10,10 +10,10 @@ "dependencies": { "@oclif/core": "^1.14.2", "@twilio/cli-core": "^7.0.0", - "create-twilio-function": "^3.3.5", + "create-twilio-function": "^3.3.6", "lodash.camelcase": "^4.3.0", "lodash.kebabcase": "^4.1.1", - "twilio-run": "^3.4.4" + "twilio-run": "^3.4.5" }, "devDependencies": { "@oclif/plugin-help": "^5.1.12", diff --git a/packages/runtime-handler/CHANGELOG.md b/packages/runtime-handler/CHANGELOG.md index 008716be..16443834 100644 --- a/packages/runtime-handler/CHANGELOG.md +++ b/packages/runtime-handler/CHANGELOG.md @@ -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.5](https://github.com/twilio-labs/serverless-toolkit/compare/@twilio/runtime-handler@1.2.4...@twilio/runtime-handler@1.2.5) (2022-10-11) + +**Note:** Version bump only for package @twilio/runtime-handler + + + + + ## [1.2.4](https://github.com/twilio-labs/serverless-toolkit/compare/@twilio/runtime-handler@1.2.3...@twilio/runtime-handler@1.2.4) (2022-08-08) **Note:** Version bump only for package @twilio/runtime-handler diff --git a/packages/runtime-handler/package.json b/packages/runtime-handler/package.json index f026bfc2..712b491b 100644 --- a/packages/runtime-handler/package.json +++ b/packages/runtime-handler/package.json @@ -1,6 +1,6 @@ { "name": "@twilio/runtime-handler", - "version": "1.2.4", + "version": "1.2.5", "description": "Stub runtime for Twilio Functions", "keywords": [ "twilio", @@ -80,4 +80,4 @@ "@types/express-serve-static-core": "ts3.9" }, "gitHead": "6db273648ed19474f4125042556b10c051529912" -} \ No newline at end of file +} diff --git a/packages/twilio-run/CHANGELOG.md b/packages/twilio-run/CHANGELOG.md index 0e538ffa..7c303684 100644 --- a/packages/twilio-run/CHANGELOG.md +++ b/packages/twilio-run/CHANGELOG.md @@ -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. +## [3.4.5](https://github.com/twilio-labs/serverless-toolkit/compare/twilio-run@3.4.4...twilio-run@3.4.5) (2022-10-11) + +**Note:** Version bump only for package twilio-run + + + + + ## [3.4.4](https://github.com/twilio-labs/serverless-toolkit/compare/twilio-run@3.4.3...twilio-run@3.4.4) (2022-08-31) diff --git a/packages/twilio-run/package.json b/packages/twilio-run/package.json index e3c8c181..7e8e71ac 100644 --- a/packages/twilio-run/package.json +++ b/packages/twilio-run/package.json @@ -1,6 +1,6 @@ { "name": "twilio-run", - "version": "3.4.4", + "version": "3.4.5", "bin": { "twilio-functions": "./bin/twilio-run.js", "twilio-run": "./bin/twilio-run.js", @@ -88,7 +88,7 @@ "ngrok": "^3.3.0" }, "devDependencies": { - "@twilio/runtime-handler": "^1.2.4", + "@twilio/runtime-handler": "^1.2.5", "@types/cheerio": "^0.22.12", "@types/common-tags": "^1.8.0", "@types/debug": "^4.1.4", @@ -129,4 +129,4 @@ "@types/express-serve-static-core": "ts3.9" }, "gitHead": "6db273648ed19474f4125042556b10c051529912" -} \ No newline at end of file +}