Package Exports
- @adonisjs/ace
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@adonisjs/ace) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Adonis Ace 📐
Ace is powerful command line to create command line applications in Node.js and extensively used by Adonis framework.
This repo contains the code to use and build ace commands.
Node/OS Target
This repo/branch is supposed to run fine on all major OS platforms and targets Node.js >=7.0
Development
Great! If you are planning to contribute to the framework, make sure to adhere to following conventions, since a consistent code-base is always joy to work with.
Run the following command to see list of available npm scripts.
npm run
Tests & Linting
- Lint your code using standardJs. Run
npm run lint
command to check if there are any linting errors. - Make sure you write tests for all the changes/bug fixes.
- Also you can write regression tests, which shows that something is failing but doesn't breaks the build. Which is actually a nice way to show that something fails. Regression tests are written using
test.failing()
method. - Make sure all the tests are passing on
travis
andappveyor
.
General Practices
Since Es6 is in, you should strive to use latest features. For example:
- Use
Spread
overarguments
keyword. - Never use
bind
orcall
. After calling these methods, we cannot guarantee the scope of any methods and in AdonisJs codebase we do not override the methods scope. - Make sure to write proper docblock.
Issues & PR
It is always helpful if we try to follow certain practices when creating issues or PR's, since it will save everyone's time.
- Always try creating regression tests when you find a bug (if possible).
- Share some context on what you are trying to do, with enough code to reproduce the issue.
- For general questions, please create a forum thread.
- When creating a PR for a feature, make sure to create a parallel PR for docs too.
Registering commands
Commands can be registered by calling the command
method.
const ace = require('@adonisjs/ace')
ace.command('greet {name: Name of the user to greet}', 'description', ({ name }) => {
console.log(`Hello ${name}`)
})
The command method expects three arguments as follows.
- signature: The command signature to define the command name and the expected/required inputs.
- description: The command description
- callback Callback to run when command is executed. The callback will receive an object of
inputs
andoptions
.
Documentation
You can learn more about ace in the official documentation