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

fix(shake): stop using Omit on return type and give filter parameter a safer type #415

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bdfa49d
chore: rename to radashi
aleclarson Jun 23, 2024
d2f8e27
chore: update readme
aleclarson Jun 23, 2024
f88e009
chore(types): stop using `NodeJS.Timeout` type
aleclarson Jun 23, 2024
a877b98
chore: add sponsor button
aleclarson Jun 23, 2024
51269d7
chore: remove tslint
aleclarson Jun 23, 2024
5cf082f
chore: use pnpm lockfile
aleclarson Jun 23, 2024
bcf7e5e
chore: lock chiller to 1.0.0-rc.30
aleclarson Jun 23, 2024
ac0873e
chore: render banner.png in readme
aleclarson Jun 23, 2024
3444538
chore: remove dependabot
aleclarson Jun 23, 2024
fad80cd
chore: remove cdn/* artifacts
aleclarson Jun 23, 2024
004d1f2
chore: enable formatOnSave in vscode settings
aleclarson Jun 23, 2024
9fe293a
chore: keep NodeJS types out of src files
aleclarson Jun 23, 2024
b57fa7b
chore: add self to license
aleclarson Jun 23, 2024
b866f9d
chore(build): switch to tsup for builds
aleclarson Jun 23, 2024
d749ec6
chore: update contributing.md
aleclarson Jun 23, 2024
d80c7eb
chore: update lockfile
Jun 23, 2024
930216d
chore: update the PR template
aleclarson Jun 23, 2024
db1e2c4
chore: move chiller to `docs:install` script
aleclarson Jun 23, 2024
2d55adf
chore: fix banner image
aleclarson Jun 23, 2024
0e98cd1
chore: fix spacing in readme
aleclarson Jun 23, 2024
6f0fa36
chore: add "Apply here" link
aleclarson Jun 23, 2024
e3ec38d
chore: migrate tests from Jest to Vitest (#5)
aleclarson Jun 23, 2024
5d60893
fix(retry): stop using `range()`
aleclarson Jun 24, 2024
d769a38
chore: add @vitest/coverage-v8
aleclarson Jun 24, 2024
077ca54
chore: update lockfile
Jun 24, 2024
a9af7b8
chore: fix typo in test name
aleclarson Jun 24, 2024
fa500d3
feat: add `isIntString` function
aleclarson Jun 24, 2024
bac48d1
chore: remove minify options
aleclarson Jun 24, 2024
a342a8e
fix(shake): stop using `Omit` on return type and give `filter` parame…
aleclarson Jun 24, 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
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: aleclarson
21 changes: 10 additions & 11 deletions .github/contributing.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
# Contributing to Radash
# Contributing to Radashi

Thank you for investing your time in contributing to radash!

> The [documentation site](https://radash-docs.vercel.app) has a [separate project](https://github.com/rayepps/radash-docs). This repo and guide is specifically for the radash library source code.
Thank you for investing your time in contributing to Radashi!

## You have a question?

If you have a general question about radash, how to use it, the roadmap, or an idea to chat about you can ask it on the [discussions](https://github.com/rayepps/radash/discussions) page. Before you do, search to see if it's been asked before. If a related topic doesn't exist, you can start a new one.
If you have a general question about Radashi, how to use it, the roadmap, or an idea to chat about you can ask it on the [discussions](https://github.com/aleclarson/radashi/discussions) page. Before you do, search to see if it's been asked before. If a related topic doesn't exist, you can start a new one.

## You have a problem?

If you have an issue with radash, you want to report a bug, or you need an improvement you can create an issue on the [issues](https://github.com/rayepps/radash/issues) page. Before you do, search to see if it's already been brought up. If a similar issue doesn't exist, you can create a new one.
If you have an issue with Radashi, you want to report a bug, or you need an improvement you can create an issue on the [issues](https://github.com/aleclarson/radashi/issues) page. Before you do, search to see if it's already been brought up. If a similar issue doesn't exist, you can create a new one.

## You want to contribute?

Scan through the [existing issues](https://github.com/rayepps/radash/issues) to find one that interests you. As a general rule, I don’t assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix. Feel free to ask questions about the implementation or design in a comment on the issue before diving in.
Scan through the [existing issues](https://github.com/aleclarson/radashi/issues) to find one that interests you. As a general rule, I don’t assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix. Feel free to ask questions about the implementation or design in a comment on the issue before diving in.

## You want to write code?

- To get started, run `yarn` in the project's root directory to install the dependencies.
- You can run the unit tests with `yarn test`. They require Node v16+. You can run `nvm use` in the root directory to change to the correct Node version. The tests should pass (duh) and maintain 100% code coverage.
- To get familiar with the existing code I would recommend looking through the docs and the codebase in parallel. For each function in the docs, find the implementation in the source and skim over the code.
- When coding, try not to create internal APIs (any function or module that is not exported to be used by the client).
- Also, try not to use functions from other radash modules. This is a softer rule but we want to make it easy for readers to understand a function without having to navigate the codebase. As a utility library users should ideally be able to copy/paste a function from radash into their project. Most radash functions should be easy to write in isolation.
- When coding, try not to create internal APIs (any function or module that is not exported to be used by the client).
- Also, try not to use functions from other Radashi modules. This is a softer rule but we want to make it easy for readers to understand a function without having to navigate the codebase. As a utility library users should ideally be able to copy/paste a function from Radashi into their project. Most Radashi functions should be easy to write in isolation.
- If an implementation needs more than ~20 lines of code it might be better suited for another package or library. This is another softer rule.

## You're ready to push a change?

Once you've made your changes on a fork of the radash repo, create a pull request to the `master` branch of the [radash](https://github.com/rayepps/radash) repository.
Once you've made your changes on a fork of the Radashi repo, create a pull request to the `master` branch of the [radashi](https://github.com/aleclarson/radashi) repository.

- Be sure to fill in a description that lets readers and reviewers understand both the implementation and intent of your changes.
- Don't forget to [link the PR to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if you are solving one.
- Enable the checkbox to [allow maintainer edits](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork) so the branch can be updated for a merge.

Once you submit your PR, I (@rayepps) will review it. I might ask questions or request additional information.
Once you submit your PR, one of Radashi's maintainers will review it. They might ask questions or request additional information.

## Your PR gets merged!

Expand Down
11 changes: 0 additions & 11 deletions .github/dependabot.yml

This file was deleted.

6 changes: 2 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
## Description

Please provide a detailed description of the changes and the intent behind them :)
<!-- Please provide a detailed description of the changes and the intent behind them :) -->

## Checklist

- [ ] Changes are covered by tests if behavior has been changed or added
- [ ] Tests have 100% coverage
- [ ] If code changes were made, the version in `package.json` has been bumped (matching semver)
- [ ] If code changes were made, the `yarn build` command has been run and to update the `cdn` directory
- [ ] If code changes were made, the documentation (in the `/docs` directory) has been updated

## Resolves

If the PR resolves an open issue tag it here. For example, `Resolves #34`
<!-- If the PR resolves an open issue tag it here. For example, `Resolves #34` -->
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode", "vitest.explorer"]
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
3 changes: 2 additions & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
MIT License

Copyright (c) 2024 Alec Larson
Copyright (c) 2022 radash

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -18,4 +19,4 @@ 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.
SOFTWARE.
101 changes: 30 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,91 +1,50 @@
# Radash
# radashi

:loud_sound: `/raw-dash/`
:loud_sound: `/raw-dash-ee/`

<div align="center">
<p align="center">
<img src="https://github.com/rayepps/radash/raw/master/banner.png" alt="radash" width="100%" style="border-radius:4px" />
<img src="https://github.com/radashi-org/radashi/raw/main/radashi.png" alt="Radashi" width="100%" />
</p>
</div>

<div>
<h3 align="center">
Functional utility library - modern, simple, typed, powerful
</h3>
</div>
- **What is this?**
A fork of the renowned [`radash`](https://github.com/sodiray/radash) library by Ray Epps [@sodiray](https://github.com/sodiray).

<p align="center">
<a href="https://bundlephobia.com/package/radash">
<img src="https://img.shields.io/bundlephobia/minzip/radash?label=minzipped" alt="bundle size" height="18">
</a>
<a href="https://www.npmjs.com/package/radash">
<img src="https://img.shields.io/npm/dm/radash.svg" alt="npm downloads" height="18">
</a>
<a href="https://www.npmjs.com/package/radash">
<img src="https://img.shields.io/npm/v/radash.svg" alt="npm version" height="18">
</a>
<a href="https://github.com/rayepps/radash">
<img src="https://img.shields.io/npm/l/radash.svg" alt="MIT license" height="18">
</a>
</p>
- **Why does this exist?**
This fork aims to be a more consistently maintained version of the library, with bug fixes and improvements. Pull requests are encouraged, but please keep them small and focused. Sweeping changes are discouraged and won't be merged.

<div align="center">
<a href="https://radash-docs.vercel.app" target="_blank">
Full Documentation
</a>
</div>
- **Can I help you maintain this?**
Yes! I'll add you as a contributor to the repository. You can review pull requests and even merge them. You can help with closing issues, too. Committing directly to the main branch is a privilege you can earn, as is publishing versions to NPM. [Apply here.](https://github.com/orgs/radashi-org/discussions/4)

- **Is backwards compatibility a goal?**
Yes! We want the transition from `radash` to this library to be smooth. We'll make sure to avoid breaking changes. If any are made, they will be clearly documented at the bottom of this page.

- **Is there official documentation?**
Currently, there is no documentation beyond this page. I will get to it eventually, but for now, you can refer to the original `radash` documentation [here](https://radash-docs.vercel.app).

## Install

```sh
pnpm add radashi
```
yarn add radash

```sh
yarn add radashi
```

## Usage

A very brief kitchen sink. See the full documentation [here](https://radash-docs.vercel.app).

```ts
import * as _ from 'radash'

const gods = [{
name: 'Ra',
power: 'sun',
rank: 100,
culture: 'egypt'
}, {
name: 'Loki',
power: 'tricks',
rank: 72,
culture: 'norse'
}, {
name: 'Zeus',
power: 'lightning',
rank: 96,
culture: 'greek'
}]

_.max(gods, g => g.rank) // => ra
_.sum(gods, g => g.rank) // => 268
_.fork(gods, g => g.culture === 'norse') // => [[loki], [ra, zeus]]
_.sort(gods, g => g.rank) // => [ra, zeus, loki]
_.boil(gods, (a, b) => a.rank > b.rank ? a : b) // => ra

_.objectify(
gods,
g => g.name.toLowerCase(),
g => _.pick(g, ['power', 'rank', 'culture'])
) // => { ra, zeus, loki }

const godName = _.get(gods, g => g[0].name)

const [err, god] = await _.try(api.gods.findByName)(godName)

const allGods = await _.map(gods, async ({ name }) => {
return api.gods.findByName(name)
})
```sh
npm install radashi
```

## Contributing

Contributions are welcome and appreciated! Check out the [contributing guide](./.github/contributing.md) before you dive in.

## Changelog

This section documents the changes between the original `radash` library and this fork.

### 12.1.0

- Initial release. No differences.
Binary file removed banner.png
Binary file not shown.
Loading
Loading