Skip to content

Commit

Permalink
Merge pull request #132 from Bartozzz/feature/commitlint
Browse files Browse the repository at this point in the history
feat(): Add Commitlint and automatic version bump scripts
  • Loading branch information
Bartozzz committed May 27, 2020
2 parents f0ce43a + ebca4fd commit 764fb5f
Show file tree
Hide file tree
Showing 7 changed files with 3,353 additions and 143 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [2.1.1](https://github.com/Bartozzz/queue-promise/compare/v2.1.0...v2.1.1) (2020-05-27)

## [2.1.0](https://github.com/Bartozzz/queue-promise/compare/v2.0.1...v2.1.0) (2020-05-27)


### Features

* **CodeSandbox:** add config for CodeSandbox bot ([dc2ea58](https://github.com/Bartozzz/queue-promise/commit/dc2ea582793fac4afc2763102f2b59d9d9abf9e6))
* **CodeSandbox:** add two CodeSandbox example sandboxes ([32c108d](https://github.com/Bartozzz/queue-promise/commit/32c108d8513f82659749f098275aaa5f5bedb6ca))
* **commitlint:** add commitlint config ([d13fe17](https://github.com/Bartozzz/queue-promise/commit/d13fe17fc849b2e09388c04256a5c2f2be57b0e5))
* add scripts for automatic version bump ([09e595a](https://github.com/Bartozzz/queue-promise/commit/09e595a08e82ae1d7777b7fa75b5c9a39b09f59e))


### Bug Fixes

* prevent uniqueId overflow ([e961a6e](https://github.com/Bartozzz/queue-promise/commit/e961a6e2c0628e3a2534a1c6dc6ff570a482d28a))
* **CodeSandbox:** fix CodeSandbox examples paths ([962596a](https://github.com/Bartozzz/queue-promise/commit/962596a61969a6a62482c016835bcaea6531dbac))
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,47 @@ Whether the queue is empty, i.e. there's no tasks.
```bash
$ npm test
```

## Contributing

### Development

We have prepared multiple commands to help you develop `queue-promise` on your own. You will need a local copy of [Node.js](https://nodejs.org/en/) installed on your machine. Then, install project dependencies using the following command:

```bash
$ npm install
```

#### Usage

```bash
$ npm run <command>
```

#### List of commands

| Command | Description |
| :---------------- | :------------------------------------------------------- |
| `test` | Run all `test:*` commands described below. |
| `test:flow` | Test Flow types. |
| `test:typescript` | Test TypeScript types. |
| `test:unit` | Run unit tests. |
| `test:lint` | Run linter tests. |
| `defs:flow` | Build Flow type definitions. |
| `defs:typescript` | Build TypeScript type definitions. |
| `clean` | Clean `dist` directory. |
| `build` | Build package and generate type definitions. |
| `watch` | Build package in watch mode. |
| `release` | Bump package version and generate a `CHANGELOG.md` file. |

### License

`queue-promise` was created and developed by [Bartosz Łaniewski](https://github.com/Bartozzz). The full list of contributors can be found [here](https://github.com/Bartozzz/queue-promise/graphs/contributors). The package is [MIT licensed](https://github.com/Bartozzz/queue-promise/blob/master/LICENSE).

### Bug reporting

[![Github Open Issues](https://img.shields.io/github/issues-raw/Bartozzz/queue-promise.svg)](https://github.com/Bartozzz/queue-promise/issues)
[![Github Closed Issues](https://img.shields.io/github/issues-closed-raw/Bartozzz/queue-promise.svg)](https://github.com/Bartozzz/queue-promise/issues?q=is%3Aissue+is%3Aclosed)
[![Github Pull Requests](https://img.shields.io/github/issues-pr-raw/Bartozzz/queue-promise.svg)](https://github.com/Bartozzz/queue-promise/pulls)

**We want contributing to `queue-promise` to be fun, enjoyable, and educational for anyone, and everyone.** Changes and improvements are more than welcome! Feel free to fork and open a pull request. We use [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) for commit messages. If you have found any issues, please [report them here](https://github.com/Bartozzz/queue-promise/new) - they are being tracked on [GitHub Issues](https://github.com/Bartozzz/queue-promise/issues).
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
};
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion dist/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ export default class Queue extends EventEmitter {
throw new Error(`You must provide a function, not ${typeof tasks}.`);
}

this.tasks.set(this.uniqueId++, tasks);
this.uniqueId = (this.uniqueId + 1) % Number.MAX_SAFE_INTEGER;
this.tasks.set(this.uniqueId, tasks);

// Start the queue if the queue should resolve new tasks automatically and
// hasn't been forced to stop:
Expand Down
Loading

0 comments on commit 764fb5f

Please sign in to comment.