Skip to content

Commit

Permalink
add CHANGELOG.md file and rename execArgs function to exec
Browse files Browse the repository at this point in the history
  • Loading branch information
erincones committed Oct 14, 2022
1 parent 2232140 commit 1dbf260
Show file tree
Hide file tree
Showing 8 changed files with 514 additions and 263 deletions.
243 changes: 243 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
# v1.2.0

## Features

- Add [CHANGELOG.md](https://github.com/erincones/cowsayjs/blob/v1.2.0/CHANGELOG.md) file.
- Add any version of node to engines in [`package.json`](https://github.com/erincones/cowsayjs/blob/v1.2.0/package.json).
- Update dependencies.

## Fixed

- Don't export the `parseArgs` function from [cli/index.js](https://github.com/erincones/cowsayjs/blob/v1.2.0/cli.index.js) and rename the `execArgs` to `exec`.
- Fix [`README.md`](https://github.com/erincones/cowsayjs/blob/v1.2.0/README.md) badges.

### To do
- [ ] Fix tests.
- [ ] Setup CI.


# v1.1.4

## Features

- Name of custom cows for `moo`, `cowsay` and `cowthink` methods is not mandatory and ignored if it's provided.

## Fixed

- Custom cow usage in [`README.md`](https://github.com/erincones/cowsayjs/blob/v1.1.4/README.md) file has been improved.
- Version for help message of [cli commands](https://github.com/erincones/cowsayjs/blob/v1.1.4/cli/index.js#L43) is taken from [`package.json`](https://github.com/erincones/cowsayjs/blob/v1.1.4/package.json) file instead of hardcoding it.
- Copyright year for help message of [cli commands](https://github.com/erincones/cowsayjs/blob/v1.1.4/cli/index.js#L97) is taken from machine clock instead of hardcoding it.

### To do
- [ ] Fix tests.
- [ ] Setup CI.


# v1.1.3

## Fixed

- Cows design errors.

### To do
- [ ] Fix tests.
- [ ] Setup CI.


# v1.1.2

## Features

- New cows have been added.
- Custom cows management feature.
- Custom modes management feature.

## Fixed

- Type definitions.
- Cow rendering function.
- Box rendering function.
- Cows design.

### To do
- [ ] Fix tests.
- [x] Add more cows.
- [ ] Setup CI.
- [x] Add modes programmatically.
- [x] Add cows programmatically.


# v1.0.7

## Features

- Update dependencies

## Fixed

- Type documentation comments:
- `CowRenderer`
- `CowAllOptions`
- `moo`
- `cowsay`
- `cowthink`.

### To do
- [ ] Fix tests.
- [ ] Add more cows.
- [ ] Setup CI.
- [ ] Add modes programmatically.
- [ ] Add cows programmatically.


# v1.0.5

## Features

- Add badges to [README.md](https://github.com/erincones/cowsayjs/blob/v1.0.5/README.md).
- Update dependencies

## Fixed

- Independent testing of the `cowsay` and `cowthink` commands.

### To do
- [ ] Add modes programmatically.
- [ ] Add cows programmatically.


# v1.0.4

## Fixed

- Fix action for `cowthink` when options is not given.

### To do
- [ ] Add modes programmatically.
- [ ] Add cows programmatically.


# v1.0.3

## Fixed

- Fix [#1](https://github.com/erincones/cowsayjs/issues/1): ES6 example code is not using the right format.

### To do
- [ ] Add modes programmatically.
- [ ] Add cows programmatically.


# v1.0.2

## Fixed

- Documentation misspellings.

### To do
- [ ] Add modes programmatically.
- [ ] Add cows programmatically.


# v1.0.1

## Features

- Update the home page.

### To do
- [ ] Add modes programmatically.
- [ ] Add cows programmatically.


# v1.0.0

## Features

- Receive the one argument with all options or traditional two arguments with the message and options separately.
- Improve the documentation.

### To do
- [ ] Add modes programmatically.
- [ ] Add cows programmatically.


# v0.3.5

## Fixed

- Fatal bug when wrap is a string with not valid integer format.

## Features

- Simplify tests without affect the coverage.

### To do
- [ ] Add modes programmatically.
- [ ] Add cows programmatically.


# v0.3.4

## Fixed

- Webpack support.

### To do
- [ ] Add modes programmatically.
- [ ] Add cows programmatically.


# v0.3.3

## Features

- How to pipe messages example now available in [README.md](https://github.com/erincones/cowsayjs/blob/v0.3.3/README.md).

### To do
- [ ] Add modes programmatically.
- [ ] Add cows programmatically.


# v0.3.2

## Fixed

- Code blocks in [README.md](https://github.com/erincones/cowsayjs/blob/v0.3.2/README.md).
- Version number for cli commands help output.

### To do
- [ ] Add modes programmatically.
- [ ] Add cows programmatically.


# v0.3.1

## Fixed

- Default eyes to `".."` for the small cow when a empty eyes string is provided.
- Eyes spacing for the udder cow when the eyes string is only one character.
- Special wrapping cases.

### To do
- [x] Complete the [README.md](https://github.com/erincones/cowsayjs/blob/v0.3.1/README.md) file.
- [x] Improve tests.
- [ ] Add modes programmatically.
- [ ] Add cows programmatically.


# v0.3.0

## Features

- **Zero dependencies**.
- Coded in pure **ES5** for best support.
- Full **documented** code with **JSDoc** and **TypeScript** declaration files.
- **CLI** commands with the same parameters as the original `cowsay` and `cowthink` commands.
- **Tested** against the original `cowsay` and `cowthink` commands.

### To do
- [ ] Complete the [README.md](https://github.com/erincones/cowsayjs/blob/v0.3.0/README.md) file.
- [ ] Improve tests.
- [ ] Add modes programmatically.
- [ ] Add cows programmatically.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[![](https://img.shields.io/npm/v/cowsayjs)][npm]
[![](https://img.shields.io/npm/dt/cowsayjs)][npm]
[![](https://img.shields.io/github/stars/erincones/cowsayjs)][github]
[![](https://img.shields.io/github/issues-raw/erincones/cowsayjs)][issues]
[![](https://img.shields.io/github/last-commit/erincones/cowsayjs)][commits]
[![](https://img.shields.io/github/languages/code-size/erincones/cowsayjs)][github]
[![](https://img.shields.io/npm/l/cowsayjs)][LICENSE]
[![npm version](https://img.shields.io/npm/v/cowsayjs)][npm]
[![npm total downloads](https://img.shields.io/npm/dt/cowsayjs)][npm]
[![npm bundle size](https://img.shields.io/bundlephobia/minzip/cowsayjs)][npm]
[![npm license](https://img.shields.io/npm/l/cowsayjs)][LICENSE]

[![GitHub stars](https://img.shields.io/github/stars/erincones/cowsayjs)][stars]
[![GitHub open issues](https://img.shields.io/github/issues-raw/erincones/cowsayjs)][issues]
[![GitHub last commit](https://img.shields.io/github/last-commit/erincones/cowsayjs)][commits]


# cowsayjs
Expand Down Expand Up @@ -76,7 +77,7 @@ commands, once installed, run `cowsayjs -h`, `cowthinkjs -h` or `moojs -h` to
print the help.

```Text
moojs, cowsayjs, cowthinkjs v1.1.4
moojs, cowsayjs, cowthinkjs v1.2.0
Copyright (c) 2022 Erick Rincones
Licensed under the MIT License
Expand Down Expand Up @@ -448,6 +449,7 @@ Share and enjoy!
<!-- References -->
[npm]: https://www.npmjs.com/package/cowsayjs
[github]: https://github.com/erincones/cowsayjs
[stars]: https://github.com/erincones/cowsayjs/stargazers
[commits]: https://github.com/erincones/cowsayjs/graphs/commit-activity
[issues]: https://github.com/erincones/cowsayjs/issues

Expand Down
2 changes: 1 addition & 1 deletion cli/cowsay.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ var cli = require(".");


// Parse and execute arguments
cli.execArgs(cli.parseArgs("say"));
cli.exec("say");
2 changes: 1 addition & 1 deletion cli/cowthink.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ var cli = require(".");


// Parse and execute arguments
cli.execArgs(cli.parseArgs("think"));
cli.exec("think");
16 changes: 10 additions & 6 deletions cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var package_json = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "packag
* Get all available cow mode data IDs
*
* @returns {string[]}
* @package
*/
function getModes() {
return mode.modes
Expand Down Expand Up @@ -182,6 +183,7 @@ function printCorral() {
*
* @param {import("../lib/box").BoxAction} [action] Default cow action
* @returns {CowArgs} Script arguments
* @package
*/
function parseArgs(action) {
// Set default action and initial values
Expand Down Expand Up @@ -265,11 +267,14 @@ function parseArgs(action) {
}

/**
* Execute the given cow aruments
* Parse arguments and execute the given cow action
*
* @param {CowArgs} args Cow arguments
* @param {import("../lib/box").BoxAction} [action] Default cow action
*/
function execArgs(args) {
function exec(action) {
// Get arguments
var args = parseArgs(action);

// Print help
if (args.help) {
printHelp();
Expand Down Expand Up @@ -302,11 +307,10 @@ function execArgs(args) {


/**
* Argument parse and other cli utilites
* Argument parser
*
* @module cowsayjs/cli
*/
module.exports = {
parseArgs: parseArgs,
execArgs: execArgs
exec: exec
};
2 changes: 1 addition & 1 deletion cli/moo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ var cli = require(".");


// Parse and execute arguments
cli.execArgs(cli.parseArgs());
cli.exec();
Loading

0 comments on commit 1dbf260

Please sign in to comment.