0.1.3 • Published 4 years ago

@annex-digital/cli v0.1.3

Weekly downloads
1
License
MIT
Repository
gitlab
Last release
4 years ago

annex CLI

A CLI used by the annex team to speed up development and project setup.

Using the CLI

Installing the CLI

$ npm i -g @annex-digital/cli
$ annex

Note: You may need to restart your terminal to run

.annexrc.yml

When starting a project you are encouraged to run annex project init, which will generate a .annexrc.yml file.

Custom commands

In the config file, you are able to define custom commands (similar to ahoy).

commands:
  test:
    cmd: echo "testing"
    usage: prints testing

Now you'll be able to execute this command with annex run test.

Why do this?

The idea behind this is to test out commands and the usefulness of those commands. If the command is value to everyone on the team or for a given project type, eg Drupal projects. Then you'll be able to create a new command within the annex cli and remove the need for the custom config command.

We are encouraging these types of commands to be moved over to the annex cli to make it available to all projects and reduce the need to copy and paste the same ahoy commands between projects.

Contributing

Contributing a command

To build the project, run yarn install.

Before you create a command, make sure that it doesn't already exist. If it is your first time creating a command, have a look at src/commands/example.ts. It includes a template to copy as well as a very detailed breakdown of a command.

Before including external packages, I'd recommend looking at the Toolbox API that Gluegun provides

Once you have the starting point then you'll be ready to build the functionality. Remember to branch off master using the feature/* pattern. Once the functionality has been implemented, pass it to the testing team. Provide some details in the Jira ticket around the branch name and how the command should function. Finally, create a MR in Gitlab and assign to the Product Owner and Tech Lead to review the implementation.

More information on Gluegun commands is available at https://github.com/infinitered/gluegun/tree/master/docs.

Using VS Code?

We have a snippet that you can use to generate the command structure; annex:cmd.

Versioning

This project uses Semantic Versioning. Do not update the version number manually, use https://docs.npmjs.com/updating-your-published-package-version-number.

  • 0.0.x: Backward compatible bug fixes
  • 0.x.0: Backward compatible new features (e.g. new command)
  • x.0.0: Changes that break backward compatibility

Publishing to NPM

To package your CLI up for NPM, do this:

$ yarn lint
$ yarn test
$ yarn build
$ npm version <update_type(major|minor|patch)>
$ npm publish

License

MIT - see LICENSE