Skip to content

Commit

Permalink
feat(observer-spy): add autoUnsubscribe and rename subscribeAndSpyOn
Browse files Browse the repository at this point in the history
Here is the list of changes in this PR:

* Rename `subscribeAndSpyOn` to `subscribeSpyTo`
* Rename `ObserverSpyWithSubscription` to `subscriberSpy`
* Add deprecation messages to `subscribeAndSpyOn` and `ObserverSpyWithSubscription`
* Add `autoUnsubscribe` + setup file and `queueForAutoUnsubscribe
* Update and improve README doc
* Update CONTRIBUTING and CODE_OF_CONDUCT docs

closes #15

Co-authored-by: Shai Reznik <[email protected]>
  • Loading branch information
ThomasBurleson and shairez committed Sep 27, 2020
1 parent f359182 commit 931dd68
Show file tree
Hide file tree
Showing 14 changed files with 714 additions and 261 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.md
129 changes: 123 additions & 6 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,128 @@
# Contributor Code of Conduct
# Contributor Covenant Code of Conduct

As contributors and maintainers of jasmine-auto-spies, we pledge to respect everyone who contributes by posting issues, updating documentation, submitting pull requests, providing feedback in comments, and any other activities.
## Our Pledge

Communication through any of channel (GitHub, Gitter, IRC, mailing lists, Google+, Twitter, etc.) must be constructive and never resort to personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
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.

We promise to extend courtesy and respect to everyone involved in this project regardless of gender, gender identity, sexual orientation, disability, age, race, ethnicity, religion, or level of experience. We expect anyone contributing to jasmine-auto-spies project to do the same.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

If any member of the community violates this code of conduct, the maintainers of jasmine-auto-spies may take action, removing issues, comments, and PRs or blocking accounts as deemed appropriate.
## Our Standards

This doc is based on [Angular's code of conduct](https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md)
Examples of behavior that contributes to a positive environment for our
community 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 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

## Enforcement Responsibilities

Community leaders 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.

Community leaders 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 within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[email protected].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
127 changes: 79 additions & 48 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,103 @@
# Contributing to observer-spy
# Contribution Guidelines

We would love for you to contribute to this project.
As a contributor, here are the guidelines we would like you to follow:

## 1. Be Kind - Code of Conduct
## Be Kind - Code of Conduct

Help us keep this project open and inclusive. Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md)
Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md) to help us keep this project open and inclusive.

## 2. Submitting an Issue
<br/>

You can file new issues by selecting from our [new issue templates](https://github.com/hirezio/observer-spy/issues/new/choose) and filling out the issue template.
## Found a bug? Want a feature? - Submit an Issue

## 3. Submitting a Pull Request (PR)
[Choose an issue template](https://github.com/hirezio/observer-spy/issues/new/choose) to file a bug report / feature request.

Before you submit your Pull Request (PR) consider the following guidelines:

1. Search [GitHub](https://github.com/hirezio/observer-spy/pulls) for an open or closed PR
that relates to your submission. You don't want to duplicate effort.
1. Be sure that **there is an issue** describes the problem you're fixing, or documents the design for the feature you'd like to add.
Discussing the design up front helps to ensure that we're ready to accept your work.
<br/>

1. Fork the this repo.
1. Make your changes in a new git branch:
## Ready to contribute a Pull Request (PR)?

```shell
git checkout -b my-fix-branch master
```
<br/>

1. Create your patch, **including appropriate test cases**.
1. Run `yarn test` to check if all the tests are passing.
and ensure that all tests pass.
1. Commit your changes using:
### ▶ 1. First - [Search this repo for existing PRs](https://github.com/hirezio/observer-spy/pulls) !

```shell
yarn commit
```
Try to find an open or closed PR that relates to the change you want to introduce.

This will create a descriptive commit message that follows our
[commit message conventions](#commit-message-format).
This is necessary to generate meaningful release notes automatically.
<br/>

1. Push your branch to GitHub:
### ▶ 2. **Before you start coding - [find](https://github.com/hirezio/observer-spy/issues) / [create an issue](https://github.com/hirezio/observer-spy/issues/new/choose)**

```shell
git push origin my-fix-branch
```
**Make sure there's an issue** describing the problem you're fixing, or documents the design for the feature you'd like to add.
Discussing the design up front helps to ensure that we're ready to accept your work.

1. In GitHub, send a pull request to `observer-spy:master`.
**Don't waste your time working on code before you got a 👍 in an issue comment.**

- If we suggest changes then:
<br/>

- Make the required updates.
- Re-run the tests to ensure tests are still passing.
- Rebase your branch and force push to your GitHub repository (this will update your Pull Request):

```shell
git rebase master -i
git push -f
```
### ▶ 3. Fork the this repo and create a branch.

That's it! Thank you for your contribution!
Make your changes in a new git branch:

#### After your pull request is merged
```shell
git checkout -b my-fix-branch master
```

After your pull request is merged, you can safely delete your branch and pull the changes
from the main (upstream) repository:
<br/>

### ▶ 4. Make sure you add / modify tests

Run `yarn test:full` to make sure there aren't any errors

<br/>

### ▶ 5. Commit your changes using commitizen:

Instead of `git commit` use the following command:

```shell
yarn commit
```

It will then ask you a bunch of questions.

This will create a descriptive commit message that follows the
[Angular commit message convention](#commit-message-format).

This is necessary to generate meaningful release notes / CHANGELOG automatically.

<br/>

### ▶ 6. Push your branch to GitHub:

```shell
git push origin my-fix-branch
```


### ▶ 7. Create a PR

In GitHub, create a pull request for `hirezio/observer-spy:master`.

If you need to update your PR for some reason -

- Make the required updates.

- Re-run the tests to ensure tests are still passing `yarn test:full`

- Rebase your branch and force push to your GitHub repository (this will update your Pull Request):

```shell
git rebase master -i
git push -f
```

<br/>

### ▶ 8. After your PR is merged - delete your branches

After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:

- Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:

Expand All @@ -90,11 +123,9 @@ from the main (upstream) repository:
git pull --ff upstream master
```

<hr>
<br/>

### ▶ 9. That's it! Thank you for your contribution! 🙏💓

This doc is based on [Angular's contributing document](https://github.com/angular/angular/blob/master/CONTRIBUTING.md)

[coc]: CODE_OF_CONDUCT.md
[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#
[github]: https://github.com/hirezio/observer-spy
[stackblitz]: https://stackblitz.com/
Loading

0 comments on commit 931dd68

Please sign in to comment.