Skip to content

Commit

Permalink
chore: improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeysova committed Nov 14, 2021
1 parent ed953cc commit 8640d3d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## How to run integration tests locally

1. Change working directory to patronum sources `cd patronum`
2. Install dependencies for patronum via yarn v1: `yarn`
3. Build patronum with specific name: `LIBRARY_NAME=@effector/patronum yarn build`
4. Remove all dependencies: `rm -rf node_modules`
5. Go to the integration directory (cra or custom): `cd integration/cra`
6. Install dependencies for this package: `yarn`
7. Add prebuilt patronum to local package: `yarn add ../../dist`
8. Run tests `yarn test`

> Note: be careful NOT to commit `babel-plugin-factories.json` with changed library name `@effector/patronum`
When work is done, please remove `@effector/patronum` from integration packages via `yarn remove @effector/patronum`, else CI can be broken.
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) ![Node.js CI](https://github.com/effector/patronum/workflows/Node.js%20CI/badge.svg) [![Rate on Openbase](https://badges.openbase.com/js/rating/patronum.svg)](https://openbase.com/js/patronum?utm_source=embedded&utm_medium=badge&utm_campaign=rate-badge)


☄️ Effector operators library delivering modularity and convenience

## Table of contents
Expand Down Expand Up @@ -40,6 +39,8 @@

## Usage

> Please, review documentation for YOUR version of patronum not the latest. Find and open tag/release for your version.
```bash
npm install patronum
# or
Expand All @@ -55,8 +56,6 @@ import { inFlight } from 'patronum/in-flight';

Also use can import it from index:

> Be careful, with this import method, all functions can be at your bundle
```ts
import { delay, inFlight } from 'patronum';
```
Expand All @@ -71,13 +70,21 @@ import { status, splitMap, combineEvents } from 'patronum/macro';

> Warning: babel-plugin-macros do not support `import * as name`!
Since release of [email protected] it is required to use [email protected] or higher.

Please note, that [email protected] and older **uses outdated version** of this plugin - you can either use [yarn resolutions](https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/) or use [email protected] or higher.

## Migration guide

### v2.0.0

Removed support of effector v21. Now the minimum supported version is `v22.1.2`.

### v0.110

From `v0.110.0` patronum removed support of effector v20. Now minimum supported version is `v21.4`.

Please, before upgrade review release notes of [`effector v21`](https://github.com/zerobias/effector/releases/tag/effector%4021.0.0).
Please, before upgrade review release notes of [`effector v21`](https://github.com/effector/effector/releases/tag/effector%4021.0.0).

### v0.100

Expand Down Expand Up @@ -191,8 +198,8 @@ trigger(4);
[Method documentation & API](/src/interval)

```ts
import { createStore, createEvent } from 'effector'
import { interval } from 'patronum'
import { createStore, createEvent } from 'effector';
import { interval } from 'patronum';

const startCounter = createEvent();
const stopCounter = createEvent();
Expand All @@ -201,15 +208,15 @@ const $counter = createStore(0);
const { tick } = interval({
timeout: 500,
start: startCounter,
stop: stopCounter
stop: stopCounter,
});

$counter.on(tick, (number) => number + 1);
$counter.watch(value => console.log("COUNTER", value));
$counter.watch((value) => console.log('COUNTER', value));

startCounter();

setTimeout(() => stopCounter(), 5000)
setTimeout(() => stopCounter(), 5000);
```

[Try it](https://share.effector.dev/EOVzc3df)
Expand Down
12 changes: 4 additions & 8 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# Security Policy

<!--
## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.
Versions marked with :white_check_mark: are currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: |
-->
| `0.x` | :x: |
| `1.x` | :white_check_mark: |
| `2.x` | :white_check_mark: |

## Reporting a Vulnerability

Expand Down
2 changes: 2 additions & 0 deletions src/babel-plugin-factories.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"patronum/delay",
"patronum/every",
"patronum/in-flight",
"patronum/interval",
"patronum/pending",
"patronum/reshape",
"patronum/snapshot",
Expand All @@ -23,6 +24,7 @@
"delay": "delay",
"every": "every",
"inFlight": "in-flight",
"interval": "interval",
"pending": "pending",
"reshape": "reshape",
"snapshot": "snapshot",
Expand Down

0 comments on commit 8640d3d

Please sign in to comment.