Comments (2)
@dkundel I know you showed me where this is needed and the format you want it in, but that was a few weeks ago now. Can you point me to where this is used and what would be useful to export for your code, please?
from create-twilio-function.
Here is an example:
https://github.com/twilio-labs/twilio-run/blob/ts/src/commands/start.ts
Basically you need to export the following properties:
type Module {
// Usage description
describe: string;
// list of ways to call the command
command: string[];
// defines the different flags and their types
cliConfig: CliConfig;
// handler that receives the actual flags
handler(argv: Flags): Promise<void>
}
Here's the definition of CliOptions: https://github.com/twilio-labs/twilio-run/blob/ts/src/commands/types.ts#L3
Here you can see how I'm consuming it compared to how I'm consuming yours:
https://github.com/twilio-labs/plugin-serverless/blob/master/src/commands/serverless/start.js
https://github.com/twilio-labs/plugin-serverless/blob/master/src/commands/serverless/init.js
Let me know if this helps. You can see in the respective commands
folders in both directories how they map to each other.
I'm using yargs for the twilio-cli
. I wrote a helper function that basically takes the flags that are defined in cliConfig.options
and turns them into flags for oclif
so that the two are automatically in sync. https://github.com/twilio-labs/plugin-serverless/blob/master/src/commands/serverless/start.js#L36-L38
from create-twilio-function.
Related Issues (20)
- Example project should have more examples of types of functions/assets HOT 1
- Move this repo to twilio-labs HOT 1
- Failure to create a project prints "project already exists" no matter the error HOT 2
- Project is throwing an error when used in Twilio CLI Plugin HOT 1
- Allow for template flag to be passed HOT 1
- Output should wrap in box
- Install the latest version of twilio-run for new projects
- Add a "npm run deploy" command HOT 3
- Use fixed window size if it is not available HOT 3
- Add eslint to the project? HOT 10
- Missing credentials offer sign-up/in pop-up
- Update node version HOT 2
- Add documentation for usage with templates HOT 1
- Create function fails on windows with spaces in paths HOT 5
- Tests are failing
- Add Typescript Support HOT 4
- Add an "empty" option to create just the file structure
- Implement -l flag (logLevel) for twilio-cli compatibility
- Empty this repo and point towards the Serverless Toolkit monorepo HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from create-twilio-function.