Skip to content

Commit

Permalink
update readme and contributors guide
Browse files Browse the repository at this point in the history
  • Loading branch information
knowbee committed Dec 22, 2019
1 parent b331c87 commit 0ffd893
Show file tree
Hide file tree
Showing 6 changed files with 2,726 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
yarn.lock
.yarn.lock
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

Expand Down Expand Up @@ -84,7 +84,7 @@ dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

Expand All @@ -102,3 +102,6 @@ dist

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test
105 changes: 105 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# How to contribute

It is a paramount to the development of `keza` that the community is empowered to make changes and get them into the library. Here are some guidelines for making a cake walk through this process.

## Reporting issues

To report a bug, request a feature, or even ask a question, make use of the GitHub Issues
section for [keza][issues]. When submitting an issue please take the following steps:

1. **Seach for existing issues.** Your question or bug may have already been answered or fixed, be sure to search the issues first before putting in a duplicate issue.

2. **Create an isolated and reproducible test case.** If you are reporting a bug, make sure you also have a minimal, runnable, code example that reproduces the problem you have.

3. **Include a live example.** After narrowing your code down to only the problem areas, make use of [repl.it][repl] or a link to your live site so that we can view a live example of the problem.

4. **Share as much information as possible.** Include browser version affected, your OS, version of
the library, steps to reproduce, etc. "X isn't working!!!1!" will probably just be closed.

## Contributing Changes

### Setting Up

To setup for making changes you will need to take a few steps, we've outlined them below:

1. Ensure you have [node][node] and npm installed.

2. Fork the [keza][keza] repository, if you are unsure how to do this GitHub has a guides for the [command line][fork-repo] and for the [GitHub Client][fork-client].

3. Next, run `npm install` from within the clone of your fork. That will install all dependencies necessary to build keza.

### Making a Change

Once you have the repository on your machine and have installed dependencies you are almost ready to make your change(s). The only other thing to do before you start is to checkout to the correct branch. Which branch you should make your change to (and send a PR to) depends on the type of change you are making.

Always make your change to `develop` as it is the branch for QA testing and feature compilation before pushing to master.

Your change should be made directly to the branch in your fork, or to a branch in your fork made off of one of the above branches.

### Branch Naming

Branches created should be named using the following format:

```
{type}-{2-3 word summary separated with hyphen}
```

Type:

- feature
- bug
- chore
- refactor

Example:

```
refactor-data
```

### PR Description Template

The description of the PR should contain the following headings and corresponding content in Markdown format.

```
#### What does this PR do?
#### Description of Task to be completed?
#### How should this be manually tested?
#### Any background context you want to provide?
#### Screenshots (if appropriate)
```

### Testing Your Change

You can run these tests by running `npm run test` from the command line. If you fix a bug please add a test that will catch that bug if it ever happens again. This prevents regressions from sneaking in.

### Submitting Your Change

After you have made and tested your change, commit and push it to your fork. Then, open a Pull Request from your fork to the main `keza` repository on the branch you used in the `Making a Change` section of this document.

## Quickie Code Style Guide

`keza` adheres stricty to the [eslint airbnb](https://www.npmjs.com/package/eslint-config-airbnb-base) style guide. Read below for a quickie style guide:

- Rely heavily on ES5 style of writing code.
- Indentation of two spaces

[issues]: https://github.com/knowbee/keza/issues
[keza]: https://github.com/knowbee/keza
[repl]: http://repl.it
[node]: https://nodejs.org/en/
[fork-repo]: https://help.github.com/articles/fork-a-repo/
[fork-client]: https://guides.github.com/activities/forking/

## Support

`keza` supports node.js.
Bear in mind this when altering and/or extending the sources.

# Important

- Please make sure that you run tests before making a PR.

## Contributor Code of Conduct

[Code of Conduct](CONTRIBUTOR_CONVENANT.md) is adapted from [Contributor Covenant, version 2.0](http://contributor-covenant.org/version/2/0)
61 changes: 61 additions & 0 deletions CONTRIBUTOR_COVENANT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# CONTRIBUTOR COVENANT CODE OF CONDUCT

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community
Examples of unacceptable behavior by participants include:

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others’ private information, such as a physical or email address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team, you can do this by raising an issue in this repository. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](./CONTRIBUTOR_COVENANT.md), version 2.0,
available at [http://contributor-covenant.org/version/2/0][version]

[homepage]: https://www.contributor-covenant.org/version/2/0/code_of_conduct
[version]: https://www.contributor-covenant.org/version/2/0/
55 changes: 53 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,54 @@
# keza
# Keza

Generate nodejs CI template files, Eslint config files, gitignore and readme file from the command line when keza's CLI is installed globally
[![Build Status](https://travis-ci.org/knowbee/keza.svg?branch=master)](https://travis-ci.org/knowbee/keza)
[![npm](https://img.shields.io/npm/dt/keza.svg)](https://www.npmjs.com/package/keza)
[![Dependency Status](https://david-dm.org/knowbee/keza.svg)](https://david-dm.org/knowbee/keza)
[![npm](https://img.shields.io/npm/v/keza.svg)](https://www.npmjs.com/package/keza)
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://github.com/ellerbrock/open-source-badge/)
[![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://github.com/ellerbrock/open-source-badge/)

Generate nodejs CI template files, Eslint config files, gitignore, docker and readme file from the command line when keza's CLI is installed globally

## Install

```cli
npm install -g keza
```

or

```cli
yarn global add keza
```

## Using Keza CLI

#### Command Line

```cli
$ keza <options>
```

## Options:

- `-h` or `--help`: display helper screen.
- `-b` or `--babel`: generate .babelrc.
- `-d` or `--docker`: generate docker file.
- `-e` or `--eslint`: generate .eslintrc and .eslintignore file.
- `-g` or `--gitignore`: generate nodejs .gitignore.
- `-ho` or `--hound`: generate hound yml file.
- `-r` or `--readme`: generate readme file.
- `-s` or `--sequelize`: generate .sequerizerc.
- `-t` or `--travis`: generate travis yml file.

## Contribution

- Please before making a PR, read first this [Contributing Guideline](./CONTRIBUTING.md)

## License

MIT

## Author

Igwaneza Bruce
90 changes: 90 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/usr/bin/env node

const fs = require("fs");
const clear = require("clear");
const chalk = require("chalk");
const figlet = require("figlet");
const bar = require("cli-progress");
const cli = require("commander");

clear();
const keza = new cli.Command();
console.log(chalk.green(figlet.textSync("Keza", { horizontalLayout: "full" })));
const progress = new bar.SingleBar({
format: "Done |" + chalk.magenta("{bar}") + "| {percentage}%",
barCompleteChar: "\u2588",
hideCursor: true
});

if (fs.existsSync("package.json")) {
helper();
keza.parse(process.argv);
process.argv.slice(2).forEach(function(item) {
if (item === "-b" || item === "--babel") {
generate(__dirname + "/templates/" + ".babelrc", ".babelrc");
} else if (item === "-d" || item === "--docker") {
generate(__dirname + "/templates/" + ".dockerignore", ".dockerignore");
generate(__dirname + "/templates/" + "Dockerfile", "Dockerfile");
} else if (item === "-e" || item === "--eslint") {
generate(__dirname + "/templates/" + ".eslintrc", ".eslintrc");
generate(__dirname + "/templates/" + ".eslintignore", ".eslintignore");
} else if (item === "-g" || item === "--gitignore") {
generate(__dirname + "/templates/" + ".gitignore", ".gitignore");
} else if (item === "-ho" || item === "--hound") {
generate(__dirname + "/templates/" + ".hound.yml", ".hound.yml");
} else if (item === "-r" || item === "--readme") {
generate(__dirname + "/templates/" + "README.md", "README.md");
} else if (item === "-s" || item === "--sequelizerc") {
generate(__dirname + "/templates/" + ".sequelizerc", ".sequelizerc");
} else if (item === "-t" || item === "--travis") {
generate(__dirname + "/templates/" + ".travis.yml", ".travis.yml");
}
});
if (process.argv.length == 2) {
fs.readdir(__dirname + "/templates", function(err, filenames) {
if (err) {
return;
}
progress.start(filenames.length);
filenames.forEach(file => {
generate(__dirname + "/templates/" + file, file);
progress.update(filenames.length);
});
progress.stop();
});
}
function generate(from, to) {
progress.start(to.length);
fs.copyFile(from, to, err => {
progress.update(100);
if (err) throw err;
progress.stop();
});
}
} else {
helper();
keza.parse(process.argv);
console.log(
chalk.magenta("You have to initialize your project with npm or yarn first")
);

process.exit();
}
function helper() {
keza
.version("0.0.1")
.option("-b, --babel", "generate babelrc")
.option("-d, --docker", "generate docker file")
.option("-e, --eslint", "generate eslintrc and eslintignore")
.option("-g, --gitignore", "generate nodejs gitignore")
.option("-ho, --hound", "generate hound file")
.option("-r, --readme", "generate readme file")
.option("-s, --sequelize", "generate sequerizerc")
.option("-t, --travis", "generate travis");
keza.on("--help", function() {
console.log("Examples:");
console.log(" $ keza --help");
console.log(" $ keza -h");
console.log(" $ keza -b -d -t");
});
}
Loading

0 comments on commit 0ffd893

Please sign in to comment.