Skip to content

Commit 03b7497

Browse files
Add documentation and cleanup
1 parent 9a98f5f commit 03b7497

14 files changed

+191
-87
lines changed

.github/document.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
export FL_TITLE="Functional Redis"
22
export FL_DESCRIPTION="A simple Redis client in tune with Functional Programming principles in JavaScript for Deno."
3-
export FL_VERSION=$(git describe --tags --abbrev=0)
3+
export FL_GITHUB_URL="https://github.com/sebastienfilion/functional-redis"
4+
export FL_DENO_URL="https://deno.land/x/functional_redis"
5+
export FL_VERSION="v0.1.2"
46

5-
deno run --allow-all --unstable ../@functional:generate-documentation/cli.js document "$FL_TITLE" "$FL_DESCRIPTION" $FL_VERSION ./.github/readme-fragment-usage.md ./library/*.js ./.github/readme-fragment-license.md
7+
deno run --allow-all --unstable ../@functional:generate-documentation/cli.js document \
8+
"$FL_TITLE" \
9+
"$FL_DESCRIPTION" \
10+
$FL_GITHUB_URL \
11+
$FL_DENO_URL \
12+
$FL_VERSION \
13+
./.github/readme-fragment-usage.md \
14+
./library/*.js \
15+
./.github/readme-fragment-license.md
File renamed without changes.

.github/readme-fragment-license.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
1+
## Contributing
2+
3+
We appreciate your help! Please, [read the guidelines](./CONTRIBUTING.md).
4+
15
## License
26

7+
MIT License
8+
39
Copyright © 2020 - Sebastien Filion
410

5-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
11+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
12+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
13+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
14+
persons to whom the Software is furnished to do so, subject to the following conditions:
615

7-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
16+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
17+
Software.
818

9-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
21+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

.github/readme-fragment-usage.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Functional Redis is optimized to write elegant and powerful point-free functions
44
This example uses the Ramda library - for simplification - but you should be able to use any library that implements the Fantasy-land specifications.
55

66
```js
7-
import { safeExtract } from "https://deno.land/x/functional@v1.2.1/library/utilities.js";
8-
import File from "https://deno.land/x/functional_io@v1.0.0/library/File.js";
9-
import { writeFile } from "https://deno.land/x/functional_io@v1.0.0/library/fs.js";
10-
import RedisRequest from "https://deno.land/x/functional_redis@v0.2.0/library/RedisRequest.js";
7+
import { safeExtract } from "https://deno.land/x/functional@v1.3.2/library/utilities.js";
8+
import File from "https://deno.land/x/functional_io@v1.1.0/library/File.js";
9+
import { writeFile } from "https://deno.land/x/functional_io@v1.1.0/library/fs.js";
10+
import RedisRequest from "https://deno.land/x/functional_redis@v0.1.2/library/RedisRequest.js";
1111
import {
1212
createRedisSession,
1313
pipeRedisCommand
14-
} from "https://deno.land/x/functional_redis@v0.2.0/library/client.js";
14+
} from "https://deno.land/x/functional_redis@v0.1.2/library/client.js";
1515

1616
const copyHogeToFuga = createRedisSession(
1717
compose(

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.DS_Store
2+
.data/
3+
.docs/
4+
.dump/
5+
.idea/
6+
.nyc_output/
7+
.sass-cache/
8+
coverage/
9+
journal/
10+
node_modules/
11+
out/
12+
scratch/
13+
14+
*.db
15+
*.iml
16+
*.log
17+
*.rdb
18+
*.zip
19+
20+
.todo.md
21+
22+
dmfx
23+
.dmfx
24+
*.dmfx.js

CONTRIBUTING.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Contributor guidelines
2+
3+
## What do I need to know to help?
4+
5+
If you are looking to help to with a code contribution our project uses JavaScript to run on Deno and modern browsers.
6+
If you don't feel ready to make a code contribution yet, no problem! You can also check out
7+
[the issues](https://github.com/sebastienfilion/functional/issues).
8+
9+
Never made an open source contribution before? Wondering how contributions work in the in our project? Here's a quick
10+
rundown!
11+
12+
1. Find an issue that you are interested in addressing, or a feature that you would like to add;
13+
2. Fork the repository associated with the issue to your local GitHub organization. This means that you will have a
14+
copy of the repository under `github-username/repository-name`;
15+
3. Clone the repository to your local machine using git clone https://github.com/github-username/repository-name.git;
16+
4. Create a new branch for your fix using `git checkout -b branch-name-here`. The preferred pattern is to prefix the
17+
branch name, i.e.: `fix/[issue-number|*]`, `document/*` or, `implement/[issue-number|*]`;
18+
5. Make the appropriate changes for the issue you are trying to address, or the feature that you want to implement;
19+
6. Use git to commit your changes with a descriptive message, you can refer to
20+
[this article](https://dev.to/jacobherrington/how-to-write-useful-commit-messages-my-commit-message-template-20n9)
21+
to learn how to write a good commit message;
22+
7. Push the changes to the remote repository using git push origin branch-name-here;
23+
8. Submit a pull request to the upstream repository;
24+
9. Title the pull request with a short description of the changes made and the issue or bug number associated with
25+
your change. For example, you can title an issue like so "Add log messages #4352";
26+
10. In the description of the pull request, explain the changes that you made, any issues you think exist with the
27+
pull request you made, and any questions you have for the maintainer. It's OK if your pull request is not perfect
28+
(no pull request is), the reviewer will be able to help you fix any problems and improve it!
29+
11. Wait for the pull request to be reviewed by a maintainer;
30+
12. Make changes to the pull request if the reviewing maintainer recommends them.
31+
13. Celebrate your success after your pull request is merged!
32+
33+
## Where can I go for help?
34+
35+
If you need help, you can ask questions [on Discord](https://discord.gg/gp83e8dr).
36+
37+
## What does the Code of Conduct mean for me?
38+
39+
Our Code of Conduct means that you are responsible for treating everyone on the project with respect and courtesy
40+
regardless of their identity. If you are the victim of any inappropriate behavior or comments as described in our
41+
Code of Conduct, we are here for you and will do the best to ensure that the abuser is reprimanded appropriately,
42+
per our code.

README.md

Lines changed: 51 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
# Functional Redis
1+
<img src="./.github/fl-logo.svg" alt="Functional Redis" width="450" />
22

33
A simple Redis client in tune with Functional Programming principles in JavaScript for Deno.
44

5-
[![deno land](http://img.shields.io/badge/available%20on-deno.land/x-lightgrey.svg?logo=deno&labelColor=black)](https://deno.land/x/functional-redis@v0.1.1)
6-
[![deno version](https://img.shields.io/badge/deno-^1.5.4-lightgrey?logo=deno)](https://github.com/denoland/deno)
5+
[![deno land](http://img.shields.io/badge/available%20on-deno.land/x-lightgrey.svg?logo=deno&labelColor=black)](https://deno.land/x/functional_redis@v0.1.2)
6+
[![deno version](https://img.shields.io/badge/deno-^1.6.1-lightgrey?logo=deno)](https://github.com/denoland/deno)
77
[![GitHub release](https://img.shields.io/github/v/release/sebastienfilion/functional-redis)](https://github.com/sebastienfilion/functional-redis/releases)
8-
[![GitHub licence](https://img.shields.io/github/license/sebastienfilion/functional-redis)](https://github.com/sebastienfilion/functional-redis/blob/v0.1.1/LICENSE)
8+
[![GitHub licence](https://img.shields.io/github/license/sebastienfilion/functional-redis)](https://github.com/sebastienfilion/functional-redis/blob/v0.1.2/LICENSE)
9+
[![Discord Chat](https://img.shields.io/discord/790708610023555093.svg)](https://discord.gg/)
910

1011
* [Redis Request](#redis-request)
1112
* [Redis Response](#redis-response)
@@ -17,14 +18,14 @@ Functional Redis is optimized to write elegant and powerful point-free functions
1718
This example uses the Ramda library - for simplification - but you should be able to use any library that implements the Fantasy-land specifications.
1819

1920
```js
20-
import { safeExtract } from "https://deno.land/x/functional@v1.2.1/library/utilities.js";
21-
import File from "https://deno.land/x/functional_io@v1.0.0/library/File.js";
22-
import { writeFile } from "https://deno.land/x/functional_io@v1.0.0/library/fs.js";
23-
import RedisRequest from "https://deno.land/x/functional_redis@v0.2.0/library/RedisRequest.js";
21+
import { safeExtract } from "https://deno.land/x/functional@v1.3.2/library/utilities.js";
22+
import File from "https://deno.land/x/functional_io@v1.1.0/library/File.js";
23+
import { writeFile } from "https://deno.land/x/functional_io@v1.1.0/library/fs.js";
24+
import RedisRequest from "https://deno.land/x/functional_redis@v0.1.2/library/RedisRequest.js";
2425
import {
2526
createRedisSession,
2627
pipeRedisCommand
27-
} from "https://deno.land/x/functional_redis@v0.2.0/library/client.js";
28+
} from "https://deno.land/x/functional_redis@v0.1.2/library/client.js";
2829

2930
const copyHogeToFuga = createRedisSession(
3031
compose(
@@ -81,7 +82,7 @@ A Symbol named `rawPlaceholder` may be used as a placeholder for the buffer.
8182
In the following example, the request will resolve to: `SET hoge piyo`.
8283

8384
```js
84-
import { encodeText } from "https://deno.land/x/functional@v1.2.1/library/utilities.js";
85+
import { encodeText } from "https://deno.land/x/functional@v1.3.2/library/utilities.js";
8586
import RedisRequest from "https://deno.land/x/[email protected]/library/RedisRequest.js";
8687
import { $$rawPlaceholder } from "https://deno.land/x/[email protected]/library/Symbol.js";
8788

@@ -93,7 +94,7 @@ assert(RedisRequest.is(redisRequest));
9394
The placeholder can be used multiple times if the buffer has multiple values separated by CLRF (`\r\n`).
9495

9596
```js
96-
import { encodeText } from "https://deno.land/x/functional@v1.2.1/library/utilities.js";
97+
import { encodeText } from "https://deno.land/x/functional@v1.3.2/library/utilities.js";
9798
import RedisRequest from "https://deno.land/x/[email protected]/library/RedisRequest.js";
9899
import { $$rawPlaceholder } from "https://deno.land/x/[email protected]/library/Symbol.js";
99100

@@ -324,9 +325,11 @@ const redisRequest = RedisRequest.flushall();
324325
325326
The `RedisResponse` represents a Redis response.
326327
It has only one argument, a typed array named "raw".
327-
The `RedisResponse` type is mostly interoperable with `RedisRequest`, [`Resource`](https://github.com/sebastienfilion/functional-io#resource),
328-
[`File`](https://github.com/sebastienfilion/functional-io#file), [`(HTTP) Request`](https://github.com/sebastienfilion/functional-io#request)
329-
and [`(HTTP) Response`](https://github.com/sebastienfilion/functional-io#response).
328+
The `RedisResponse` type is mostly interoperable with `RedisRequest`,
329+
[`Resource`](https://github.com/sebastienfilion/functional-io#resource),
330+
[`File`](https://github.com/sebastienfilion/functional-io#file),
331+
[`(HTTP) Request`](https://github.com/sebastienfilion/functional-io#request)
332+
and, [`(HTTP) Response`](https://github.com/sebastienfilion/functional-io#response).
330333
331334
The `RedisResponse` type implements the following algebras:
332335
- [x] Alternative
@@ -380,7 +383,7 @@ This function takes an object for the connection options and, return a
380383
[`Task`](https://github.com/sebastienfilion/functional#task-type) of a `Resource`.
381384
382385
```js
383-
import { connectRedisClient } from "https://deno.land/x/functional_redis@v0.2.0/library/client.js";
386+
import { connectRedisClient } from "https://deno.land/x/functional_redis@v0.1.2/library/client.js";
384387

385388
const container = await connectRedisClient({ port: 6379 }).run();
386389
const redisResource = safeExtract("Failed to connect the client.", container);
@@ -393,7 +396,7 @@ This function takes a Resource and, return a
393396
[`Task`](https://github.com/sebastienfilion/functional#task-type) of a `Resource`.
394397
395398
```js
396-
import { disconnectRedisClient } from "https://deno.land/x/functional_redis@v0.2.0/library/client.js";
399+
import { disconnectRedisClient } from "https://deno.land/x/functional_redis@v0.1.2/library/client.js";
397400

398401
await disconnectRedisClient(redisResource).run();
399402
```
@@ -405,10 +408,10 @@ This curried function accepts a `RedisRequest` and a `Resource` that represents
405408
and, returns a [`Task`](https://github.com/sebastienfilion/functional#task-type) of a `RedisResponse`.
406409
407410
```js
408-
import { safeExtract } from "https://deno.land/x/functional@v1.2.1/library/utilities.js";
409-
import { executeRedisCommand } from "https://deno.land/x/functional_redis@v0.2.0/library/client.js";
410-
import RedisRequest from "https://deno.land/x/functional_redis@v0.2.0/library/RedisRequest.js";
411-
import RedisResponse from "https://deno.land/x/functional_redis@v0.2.0/library/RedisResponse.js";
411+
import { safeExtract } from "https://deno.land/x/functional@v1.3.2/library/utilities.js";
412+
import { executeRedisCommand } from "https://deno.land/x/functional_redis@v0.1.2/library/client.js";
413+
import RedisRequest from "https://deno.land/x/functional_redis@v0.1.2/library/RedisRequest.js";
414+
import RedisResponse from "https://deno.land/x/functional_redis@v0.1.2/library/RedisResponse.js";
412415

413416
const container = await executeRedisCommand(
414417
RedisRequest.set({}, "hoge", "piyo"),
@@ -429,10 +432,10 @@ server. The function returns a [`Task`](https://github.com/sebastienfilion/funct
429432
[ability of a Redis server](https://redis.io/topics/pipelining) to parse multiple request at a time.*
430433
431434
```js
432-
import { safeExtract } from "https://deno.land/x/functional@v1.2.1/library/utilities.js";
433-
import { executeRedisCommandPipeline } from "https://deno.land/x/functional_redis@v0.2.0/library/client.js";
434-
import RedisRequest from "https://deno.land/x/functional_redis@v0.2.0/library/RedisRequest.js";
435-
import RedisResponse from "https://deno.land/x/functional_redis@v0.2.0/library/RedisResponse.js";
435+
import { safeExtract } from "https://deno.land/x/functional@v1.3.2/library/utilities.js";
436+
import { executeRedisCommandPipeline } from "https://deno.land/x/functional_redis@v0.1.2/library/client.js";
437+
import RedisRequest from "https://deno.land/x/functional_redis@v0.1.2/library/RedisRequest.js";
438+
import RedisResponse from "https://deno.land/x/functional_redis@v0.1.2/library/RedisResponse.js";
436439

437440
const container = await executeRedisCommandPipeline(
438441
[
@@ -466,14 +469,14 @@ The function resolves to a `Task` of the `Resource`; if you need to access the `
466469
should compose with the handler.
467470
468471
```js
469-
import { safeExtract } from "https://deno.land/x/functional@v1.2.1/library/utilities.js";
470-
import File from "https://deno.land/x/functional_io@v1.0.0/library/File.js";
471-
import { writeFile } from "https://deno.land/x/functional_io@v1.0.0/library/fs.js";
472+
import { safeExtract } from "https://deno.land/x/functional@v1.3.2/library/utilities.js";
473+
import File from "https://deno.land/x/functional_io@v1.1.0/library/File.js";
474+
import { writeFile } from "https://deno.land/x/functional_io@v1.1.0/library/fs.js";
472475
import {
473476
createRedisSession,
474477
executeRedisCommand
475-
} from "https://deno.land/x/functional_redis@v0.2.0/library/client.js";
476-
import RedisRequest from "https://deno.land/x/functional_redis@v0.2.0/library/RedisRequest.js";
478+
} from "https://deno.land/x/functional_redis@v0.1.2/library/client.js";
479+
import RedisRequest from "https://deno.land/x/functional_redis@v0.1.2/library/RedisRequest.js";
477480

478481
const writeHogeToFile = createRedisSession(
479482
compose(
@@ -504,12 +507,12 @@ This function will execute all Redis requests sequentially and optionally pipe t
504507
request.
505508
506509
```js
507-
import { safeExtract } from "https://deno.land/x/functional@v1.2.1/library/utilities.js";
510+
import { safeExtract } from "https://deno.land/x/functional@v1.3.2/library/utilities.js";
508511
import {
509512
createRedisSession,
510513
pipeRedisCommand
511-
} from "https://deno.land/x/functional_redis@v0.2.0/library/client.js";
512-
import RedisRequest from "https://deno.land/x/functional_redis@v0.2.0/library/RedisRequest.js";
514+
} from "https://deno.land/x/functional_redis@v0.1.2/library/client.js";
515+
import RedisRequest from "https://deno.land/x/functional_redis@v0.1.2/library/RedisRequest.js";
513516

514517
const copyHogeToFuga = createRedisSession(
515518
compose(
@@ -533,12 +536,25 @@ safeExtract("Failed to read the response.", container);
533536
534537
---
535538
539+
## Contributing
540+
541+
We appreciate your help! Please, [read the guidelines](./CONTRIBUTING.md).
542+
536543
## License
537544
545+
MIT License
546+
538547
Copyright © 2020 - Sebastien Filion
539548
540-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
549+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
550+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
551+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
552+
persons to whom the Software is furnished to do so, subject to the following conditions:
541553
542-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
554+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
555+
Software.
543556
544-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
557+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
558+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
559+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
560+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)