Skip to content

Commit

Permalink
Merge branch 'radashi-org-main'
Browse files Browse the repository at this point in the history
  • Loading branch information
SaidbekAbdiganiev committed Nov 12, 2024
2 parents ce81db5 + e898384 commit 8f5d945
Show file tree
Hide file tree
Showing 80 changed files with 2,441 additions and 867 deletions.
7 changes: 7 additions & 0 deletions .github/next-major.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
If you open a PR that contains a breaking change, add it to this file.

The `####` headline should be short and descriptive of the breaking change. In the body of the section, include a link to the PR. You don't need to include a description of the change itself, as we will extract that from the PR description.

## Breaking Changes

####
11 changes: 11 additions & 0 deletions .github/next-minor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
If you open a PR that introduces a new function, add it to the "New Functions" section. If you're extending an existing function, add it to the "New Features" section.

The `####` headline should be short and descriptive of the new functionality. In the body of the section, include a link to the PR. You don't need to include a description of the change itself, as we will extract that from the documentation.

## New Functions

####

## New Features

####
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- [ ] Related documentation has been updated, if needed
- [ ] Related tests have been added or updated, if needed
- [ ] Related benchmarks have been added or updated, if needed
- [ ] Release notes in [next-minor.md](.github/next-minor.md) or [next-major.md](.github/next-major.md) have been added, if needed

## Does this PR introduce a breaking change?

Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/check-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Check main branch

on:
workflow_dispatch:
push:
branches: [main]
paths: ['src/**', 'tests/**']

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install
- run: pnpm test

validate:
name: Validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
node-version: '22.x'
cache: pnpm
- run: pnpm install
- name: Lint
run: pnpm lint
- name: Check Build
run: pnpm build
35 changes: 35 additions & 0 deletions .github/workflows/prerelease-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Prerelease PR

on:
pull_request_target:
types: [labeled]

jobs:
prerelease:
if: ${{ contains(github.event.pull_request.labels.*.name, 'prerelease') && github.event.pull_request.state == 'open' && github.event.pull_request.draft == false && github.event.pull_request.mergeable_state == 'clean' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
node-version: '22.x'
cache: pnpm

- name: Install script dependencies
run: |
pnpm install -C scripts/prerelease
- name: Merge PR into target branch
continue-on-error: true
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_REPO_URL: ${{ github.event.pull_request.head.repo.clone_url }}
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
run: |
./scripts/prerelease/node_modules/.bin/tsx ./scripts/prerelease/ci-prerelease.ts
14 changes: 6 additions & 8 deletions .github/workflows/publish-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: Publish radashi@beta

on:
workflow_dispatch:
schedule:
- cron: '0 5 * * *'
push:
branches: [beta, next]
paths: ['src/**']

jobs:
test:
Expand All @@ -22,11 +23,6 @@ jobs:
cache: pnpm
- run: pnpm install
- run: pnpm test
- if: ${{ matrix.node-version == '22.x' }}
name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}

validate:
name: Validate
Expand All @@ -50,6 +46,8 @@ jobs:
needs: [test, validate]
runs-on: ubuntu-latest
continue-on-error: true
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -77,4 +75,4 @@ jobs:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
NIGHTLY_DEPLOY_KEY: ${{ secrets.NIGHTLY_DEPLOY_KEY }}
run: |
./scripts/versions/node_modules/.bin/tsx ./scripts/versions/ci-publish.ts --tag beta
./scripts/versions/node_modules/.bin/tsx ./scripts/versions/ci-publish.ts --tag ${{ github.ref_name }}
39 changes: 39 additions & 0 deletions .github/workflows/publish-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish radashi@latest

on:
workflow_dispatch:

jobs:
publish-latest:
if: ${{ github.ref == 'refs/heads/main' }}
name: Publish Latest
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
node-version: '22.x'
cache: pnpm
- run: pnpm install
- run: pnpm build

- name: Install script dependencies
run: |
pnpm install -C scripts/versions
pnpm install -C scripts/radashi-db
- name: Publish
env:
GIT_CLIFF_PAT: ${{ secrets.GIT_CLIFF_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
RADASHI_BOT_TOKEN: ${{ secrets.RADASHI_BOT_TOKEN }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
run: |
./scripts/versions/node_modules/.bin/tsx ./scripts/versions/ci-publish.ts --latest
43 changes: 43 additions & 0 deletions .github/workflows/publish-patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish patch

on:
workflow_run:
workflows: ['Check main branch']
types:
- completed

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Publish
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
node-version: '22.x'
cache: pnpm
- run: pnpm install
- run: pnpm build

- name: Install script dependencies
run: |
pnpm install -C scripts/versions
pnpm install -C scripts/radashi-db
- name: Publish
env:
GIT_CLIFF_PAT: ${{ secrets.GIT_CLIFF_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
RADASHI_BOT_TOKEN: ${{ secrets.RADASHI_BOT_TOKEN }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
NIGHTLY_DEPLOY_KEY: ${{ secrets.NIGHTLY_DEPLOY_KEY }}
run: |
./scripts/versions/node_modules/.bin/tsx ./scripts/versions/ci-publish.ts --patch
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
package-manager-strict=false
package-manager-strict=false
provenance=true
41 changes: 37 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,31 @@ 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).

## [radashi@beta]
## [[email protected]] - 2024-11-10
### Details
#### <!-- 08 -->Types
- Export `PromiseWithResolvers` type by [@aleclarson](https://github.com/aleclarson) in [#301](https://github.com/radashi-org/radashi/pull/301)

- Improve `isEmpty` signature by [@MarlonPassos-git](https://github.com/MarlonPassos-git) in [#219](https://github.com/radashi-org/radashi/pull/219)

- Narrow return type of `first` and `last` by [@crishoj](https://github.com/crishoj) in [#160](https://github.com/radashi-org/radashi/pull/160)

- Improve `draw` signature for non-empty arrays by [@crishoj](https://github.com/crishoj) in [#153](https://github.com/radashi-org/radashi/pull/153)


## [[email protected]] - 2024-11-09
### Details
#### <!-- 08 -->Types
- Improve signature of `shake` by [@aleclarson](https://github.com/aleclarson) in [#293](https://github.com/radashi-org/radashi/pull/293)

- `mapValues` index signature handling by [@aleclarson](https://github.com/aleclarson) in [#297](https://github.com/radashi-org/radashi/pull/297)

- Let `zipToObject` receive readonly arrays by [@aeharding](https://github.com/aeharding) in [#294](https://github.com/radashi-org/radashi/pull/294)


### New Contributors
* [@aeharding](https://github.com/aeharding) made their first contribution in [#294](https://github.com/radashi-org/radashi/pull/294)
## [[email protected]] - 2024-11-01
### Details
#### <!-- 03 -->Added
- Add `isIntString` function by [@aleclarson](https://github.com/aleclarson) in [fa500d3](https://github.com/radashi-org/radashi/commit/fa500d329d7e06062e7a42cbf4ff9ad9dcb89191)
Expand Down Expand Up @@ -124,6 +148,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- **(shuffle)** Use the Fisher-Yates algorithm by [@eumkz](https://github.com/eumkz) in [#76](https://github.com/radashi-org/radashi/pull/76)

- **(merge)** Improved handling of large arrays by [@Minhir](https://github.com/Minhir) in [#240](https://github.com/radashi-org/radashi/pull/240)


#### <!-- 08 -->Types
- Let `filterKey` accept `key: keyof any` by [@aleclarson](https://github.com/aleclarson) in [73ac8bb](https://github.com/radashi-org/radashi/commit/73ac8bba9e2a2a39eb3c117cc940cc2b18199834)
Expand All @@ -148,17 +174,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Align `isPromise` return type with its logic by [@aleclarson](https://github.com/aleclarson) in [#175](https://github.com/radashi-org/radashi/pull/175)

- Publicize the `Falsy` type by [@aleclarson](https://github.com/aleclarson) in [736d334](https://github.com/radashi-org/radashi/commit/736d3342f86cf16199d6d50cacd0cec3f51db078)
- Avoid inferring `memo` return type from `key` option by [@aleclarson](https://github.com/aleclarson) in [#231](https://github.com/radashi-org/radashi/pull/231)

- Allow readonly array in `omit` function by [@shan-shaji](https://github.com/shan-shaji) in [#272](https://github.com/radashi-org/radashi/pull/272)


### New Contributors
* [@crishoj](https://github.com/crishoj) made their first contribution in [#128](https://github.com/radashi-org/radashi/pull/128)
* [@shan-shaji](https://github.com/shan-shaji) made their first contribution in [#272](https://github.com/radashi-org/radashi/pull/272)
* [@nnmrts](https://github.com/nnmrts) made their first contribution in [#126](https://github.com/radashi-org/radashi/pull/126)
* [@stefaanv](https://github.com/stefaanv) made their first contribution in [#95](https://github.com/radashi-org/radashi/pull/95)
* [@eumkz](https://github.com/eumkz) made their first contribution in [#76](https://github.com/radashi-org/radashi/pull/76)
* [@cimbraien](https://github.com/cimbraien) made their first contribution in [#58](https://github.com/radashi-org/radashi/pull/58)
* [@shan-shaji](https://github.com/shan-shaji) made their first contribution in [#53](https://github.com/radashi-org/radashi/pull/53)
* [@cdreeves](https://github.com/cdreeves) made their first contribution in [#37](https://github.com/radashi-org/radashi/pull/37)
* [@localusercamp](https://github.com/localusercamp) made their first contribution in [#33](https://github.com/radashi-org/radashi/pull/33)

[radashi@beta]: https://github.com/radashi-org/radashi/compare/v12.1.0..HEAD
[[email protected]]: https://github.com/radashi-org/radashi/compare/v12.2.1..v12.2.2

[[email protected]]: https://github.com/radashi-org/radashi/compare/v12.2.0..v12.2.1

[[email protected]]: https://github.com/radashi-org/radashi/compare/v12.1.0..v12.2.0

<!-- generated by git-cliff -->
6 changes: 3 additions & 3 deletions README-pt_br.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<a href="https://biomejs.dev/"><img src="https://img.shields.io/badge/estilo_de_código-biome.js-blue?logo=biome" alt="Estilo de Código: Biome.js" /></a>
<a href="https://github.com/radashi-org/radashi/discussions"><img src="https://img.shields.io/github/discussions/radashi-org/radashi?logo=github" alt="Discussões no GitHub" /></a>
<a href="https://app.gitter.im/#/room/#radashi:gitter.im"><img src="https://badges.gitter.im/join_chat.svg" alt="Gitter.im" /></a>
<p align="center">
<a href="./README.md">English</a> | <span>Português</span>
</p>
</div>

&nbsp;
[English](./README.md) | Português

**Diga adeus ao peso do Lodash. Pare de reinventar a roda.**

Radashi (pronunciado /ruh-DAH-shee/) é uma biblioteca de utilitários para TypeScript, repleta de funções leves, legíveis, performáticas e robustas.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
<img src="https://github.com/radashi-org/radashi/raw/main/.github/img/banner.png" alt="Radashi" width="100%" />
</p>
<a href="https://github.com/radashi-org/radashi/blob/main/LICENSE.md"><img src="https://img.shields.io/npm/l/radashi" alt="License" /></a>
<a href="https://github.com/radashi-org/radashi/actions/workflows/publish-beta.yml"><img src="https://img.shields.io/github/actions/workflow/status/radashi-org/radashi/publish-beta.yml?logo=github" alt="Build Status" /></a>
<a href="https://github.com/radashi-org/radashi/actions/workflows/check-main.yml"><img src="https://img.shields.io/github/actions/workflow/status/radashi-org/radashi/check-main.yml?logo=github" alt="Build Status" /></a>
<a href="https://app.codecov.io/gh/radashi-org/radashi/tree/main/src"><img src="https://img.shields.io/codecov/c/github/radashi-org/radashi?logo=codecov" alt="Codecov" /></a>
<a href="https://biomejs.dev/"><img src="https://img.shields.io/badge/code_style-biome.js-blue?logo=biome" alt="Code Style: Biome.js" /></a>
<a href="https://github.com/radashi-org/radashi/discussions"><img src="https://img.shields.io/github/discussions/radashi-org/radashi?logo=github" alt="GitHub Discussions" /></a>
<a href="https://app.gitter.im/#/room/#radashi:gitter.im"><img src="https://badges.gitter.im/join_chat.svg" alt="Gitter.im" /></a>
<p align="center">
<span>English</span> | <a href="./README-pt_br.md">Português</a>
</p>
</div>

&nbsp;
English | [Português](./README-pt_br.md)

**Ditch the bloat of Lodash. Stop reinventing the wheel.**

<!-- cSpell:ignore shee -->
Expand Down
1 change: 1 addition & 0 deletions cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ignorePaths:
- '**/tsconfig.json'
- '**/pnpm-lock.yaml'
- '**/dist'
- 'vitest.config.ts'
- 'coverage'
- 'cliff.toml'
- 'README-pt_br.md'
Expand Down
6 changes: 0 additions & 6 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,5 @@
},
"publish": {
"include": ["src", "LICENSE.md", "README.md"]
},
"lint": {
"include": ["src"],
"rules": {
"tags": ["jsr"]
}
}
}
2 changes: 1 addition & 1 deletion docs/array/list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ _.list(0, 3, 'y') // [y, y, y, y]
_.list(0, 3, () => 'y') // [y, y, y, y]
_.list(0, 3, i => i) // [0, 1, 2, 3]
_.list(0, 3, i => `y${i}`) // [y0, y1, y2, y3]
_.list(0, 3, obj) // [obj, obj, obj, obj]
_.list(0, 3, {}) // [{}, {}, {}, {}]
_.list(0, 6, i => i, 2) // [0, 2, 4, 6]
```

Expand Down
Loading

0 comments on commit 8f5d945

Please sign in to comment.