Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove modules #88

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7c2f383
Remove redis, axios, got, flydrive, memcached dependencies
pierroberto Oct 29, 2024
8c099eb
Update CHANGELOG
pierroberto Oct 29, 2024
39588c3
Remove number, GeneratorL, Log, Random, Storage, Void
pierroberto Oct 30, 2024
56d1203
Remove several modules
pierroberto Oct 31, 2024
47101ed
Add export
pierroberto Oct 31, 2024
81c23fe
Remove tests
pierroberto Oct 31, 2024
21ec005
Fix readonlyRecord type error
pierroberto Nov 4, 2024
3c6d599
Remove io-ts-types, monocle-ts, newtype-ts + add types for node
pierroberto Nov 4, 2024
6cd5a7d
Rewrite README
pierroberto Nov 4, 2024
08199b4
Add missing sections titles
pierroberto Nov 4, 2024
6a49c8b
Remove unused functions from Yield module
pierroberto Nov 5, 2024
9d650ed
Remove collectWithIndex function
pierroberto Nov 5, 2024
7a3966d
Remove cartesian, words and anyElem from ReadonlyArray module
pierroberto Nov 5, 2024
d347dbb
Remove deprecated type
pierroberto Nov 5, 2024
519567e
Add logo
pierroberto Nov 8, 2024
47429bc
Remove unused var
pierroberto Nov 8, 2024
f524b57
Remove ReadonlyRecord module
pierroberto Nov 8, 2024
0396009
Remove ReadonlyArray module
pierroberto Nov 8, 2024
2f675e9
Rename cjs + remove declaration
pierroberto Nov 8, 2024
9219ea4
Add test watch script
pierroberto Nov 8, 2024
400efc7
Remove index
pierroberto Nov 8, 2024
64586f5
Increase logo size
pierroberto Nov 8, 2024
82cb3e5
Rename lib to cjs
pierroberto Nov 8, 2024
ace7aee
Rename lib to cjs
pierroberto Nov 8, 2024
bfd9b20
Rearrange folders structure
pierroberto Nov 10, 2024
d43ef5b
Remove hybridize + refactor dist build
pierroberto Nov 10, 2024
2202686
Run prettier
pierroberto Nov 10, 2024
a45725c
Remove peer dependencies
pierroberto Nov 11, 2024
3c70bf1
Remove bold
pierroberto Nov 11, 2024
f87d229
Replace keyword
pierroberto Nov 11, 2024
edf3fd0
Replace deprecated Predicate
pierroberto Nov 11, 2024
5958737
Update yarn.lock
pierroberto Nov 11, 2024
403c59b
Update README.md
pierroberto Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,52 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Removed

- Remove `Http` module.
- Remove `Cache` module.
- Remove `Memcached` module.
- Remove `Buffer` module.
- Remove `Stream` module.
- Remove `Memory` module.
- Remove `Redis` module.
- Remove `Storage` module.
- Remove `Axios` module.
- Remove `Fetch` module.
- Remove `Got` module.
- Remove `Flydrive` module.
- Remove `Fs` module.
- Remove `Random` module.
- Remove `Log` module.
- Remove `Void` module.
- Remove `GeneratorL` module.
- Remove `number` module.
- Remove `Console` module.
- Remove `Crypto` module.
- Remove `Binary` module.
- Remove `Date` module.
- Remove `AsyncYield` module.
- Remove `Magma` module.
- Remove `Matrix` module.
- Remove `Option` module.
- Remove `Reader` module.
- Remove `ReaderEither` module.
- Remove `ReaderTask` module.
- Remove `ReaderTaskEither` module.
- Remove `ReadonlyTuple` module.
- Remove `TaskEither` module.
- Remove `Validation` module.
- Remove `Has` module.
- Remove `Aggregate` module.
- Remove `Eq` module.
- Remove `string` module.
- Remove `Error` module.
- Remove `ReadonlyRecord` module.
- Remove `ReadonlyArray` module.
- Remove unused functions from `Yield`, `ReadonlyArray`, `Type`, `function` and `struct` modules.

## [0.1.9](https://github.com/facile-it/fortepiano/compare/v0.1.8...v0.1.9) - 2024-05-14

### Security
Expand Down
47 changes: 30 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<p align="center">
<img src="./logo.png" width=150px" height="auto"/>
</p>

# fortepiano [ˌfɔrteˈpjaːno]

_Playing actual music over `fp-ts` notes_
_Playing actual music over `fp-ts` notes_ 🎶

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/facile-it/fortepiano/main)](https://github.com/facile-it/fortepiano/actions)
[![Codecov](https://img.shields.io/codecov/c/gh/facile-it/fortepiano)](https://app.codecov.io/gh/facile-it/fortepiano)
Expand All @@ -9,36 +13,45 @@ _Playing actual music over `fp-ts` notes_

## Description

`fortepiano` provides a set of common abstractions for functional application development (e.g., `Http`, `Storage`...), while extending [`fp-ts`](https://github.com/gcanti/fp-ts) with useful modules _à la_ [`fp-ts-contrib`](https://github.com/gcanti/fp-ts-contrib).
Fortepiano is a mocking library for TypeScript. It promotes immutability, composability and purity, making it ideal for projects that embrace functional programming principles.

## Getting Started

`fortepiano` stands on the shoulders of the giant `fp-ts`. As such, a good understanding of its [concepts](https://gcanti.github.io/fp-ts/) is suggested.

### Installation

The package is available via [npm](https://www.npmjs.com/package/fortepiano), and must be installed along with its peer dependencies:
To install the stable version:

```
npm install fortepiano fp-ts io-ts io-ts-types
```bash
npm install fortepiano
```

Additional packages are required, shall you want to use specific abstractions:
or using yarn:

- [`memcached`](https://www.npmjs.com/package/memcached) and [`@types/memcached`](https://www.npmjs.com/package/@types/memcached) (`cache/Memcached`)
- [`redis`](https://www.npmjs.com/package/redis) and [`@types/redis`](https://www.npmjs.com/package/@types/redis) (`cache/Redis`)
- [`axios`](https://www.npmjs.com/package/axios) (`http/Axios`)
- [`@slynova/flydrive`](https://www.npmjs.com/package/@slynova/flydrive) (`storage/Flydrive`)
```bash
yarn add fortepiano
```

### Usage

Import modules (e.g., values) from package index and types from specific modules. "Function" module and abstraction implementations are an exception:
Fortepiano uses a functional API to create and configure mocks, encouraging pure function usage and immutable mock objects.

Here's an example:

```typescript
import { $type } from 'fortepiano'
import { Struct } from 'fortepiano/struct'
import { curry } from 'fortepiano/function'
import { $axios } from 'fortepiano/http/Axios'
import { $mock } from 'fortepiano'

interface User {
firstName: string
lastName: string
}

export const UserMock = (): $mock.Mock<User> =>
$mock.struct({
firstName: $mock.string,
lastName: $mock.string,
})

console.log(UserMock()()()) // Output: { firstName: 'randomString', lastName: 'randomString' }
```

## Contributing
Expand Down
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 17 additions & 53 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@
"typescript",
"functional-programming",
"fp-ts",
"io-ts"
"testing"
],
"exports": {
".": {
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js"
}
},
"files": [
"./dist/cjs/**",
"./dist/esm/**"
],
"homepage": "https://github.com/facile-it/fortepiano#readme",
"bugs": {
Expand All @@ -19,9 +29,9 @@
"license": "MIT",
"author": "Alberto Villa <[email protected]>",
"sideEffects": false,
"main": "./lib/index.js",
"module": "./esm/index.js",
"types": "./index.d.ts",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/esm/index.d.ts",
"scripts": {
"prebuild": "yarn clean",
"build": "yarn prebuild && yarn build:esm && yarn build:cjs",
Expand All @@ -32,73 +42,27 @@
"eslint:fix": "eslint --fix ./",
"prettier": "prettier --check ./",
"prettier:fix": "prettier --write ./",
"prerelease": "yarn build && ./scripts/hybridize.sh && cp ./package.json ./*.md ./dist/",
"prerelease": "yarn build && cp ./package.json ./*.md ./dist/",
"release": "yarn prerelease && npm publish ./dist/",
"test": "jest",
"test:watch": "jest --watchAll",
"test:coverage": "jest --coverage"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.1.3",
"@slynova/flydrive": "^1.0.0",
"@types/jest": "^26.0.24",
"@types/memcached": "^2.0.0",
"@types/node": "^22.8.7",
"@types/node-fetch": "^2.5.12",
"@types/redis": "^2.0.0",
"@types/redis-mock": "^0.17.0",
"axios": "^0.28.0",
"eslint": "^8.16.0",
"eslint-config-facile": "^0.5.0",
"fp-ts": "^2.0.0",
"got": "^11.0.0",
"io-ts": "^2.0.0",
"io-ts-types": "^0.5.0",
"jest": "^26.6.3",
"memcached": "^2.0.0",
"memcached-mock": "^0.1.0",
"monocle-ts": "^2.3.10",
"newtype-ts": "^0.3.4",
"node-fetch": "^2.6.7",
"prettier": "^2.6.2",
"redis": "^3.0.0",
"redis-mock": "^0.56.3",
"ts-jest": "^26.5.6",
"ts-node": "^10.9.2",
"typescript": "^4.6.4"
},
"peerDependencies": {
"@slynova/flydrive": "^1.0.0",
"@types/memcached": "^2.0.0",
"@types/redis": "^2.0.0",
"axios": "^0.21.2 || ^0.28.0",
"fp-ts": "^2.0.0",
"got": "^11.0.0",
"io-ts": "^2.0.0",
"io-ts-types": "^0.5.0",
"memcached": "^2.0.0",
"redis": "^3.0.0"
},
"peerDependenciesMeta": {
"@slynova/flydrive": {
"optional": true
},
"@types/memcached": {
"optional": true
},
"@types/redis": {
"optional": true
},
"axios": {
"optional": true
},
"got": {
"optional": true
},
"memcached": {
"optional": true
},
"redis": {
"optional": true
}
},
"packageManager": "[email protected]"
}
28 changes: 0 additions & 28 deletions scripts/hybridize.sh

This file was deleted.

4 changes: 0 additions & 4 deletions src/Aggregate.ts

This file was deleted.

Loading
Loading