Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
citrus327 authored Jan 17, 2024
0 parents commit ab04f1d
Show file tree
Hide file tree
Showing 15 changed files with 3,880 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: publish_on_release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
registry-url: "https://registry.npmjs.org"

- name: Install Pnpm
uses: pnpm/action-setup@v2.4.0
with:
version: 6.0.2

- name: Install Dependencies
run: pnpm i

- name: Build
run: pnpm run build

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
title: Changeset Auto PR
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish
if: steps.changesets.outputs.hasChangesets == 'false'
run: npx changeset publish
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.DS_Store
dist
*.log
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org/
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@egoist/prettier-config"
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.formatOnSave": true
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright © 2021 EGOIST (https://github.com/sponsors/egoist)

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:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

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
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# @citrus327/array-partition

![Download](https://img.shields.io/npm/dw/@citrus327/array-partition)
![Version](https://img.shields.io/npm/v/@citrus327/array-partition)

partition an array into two.


## Installation

```sh
pnpm install @citrus327/array-partition
```

## Usage

```ts
const arr = [1, 2, 3, 4, 5, 6]
const [target, rest] = partition(arr, (o) => o % 2 === 0)

expect(target).toEqual([2, 4, 6])
expect(rest).toEqual([1, 3, 5])
```
32 changes: 32 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "@citrus327/my-ts-lib",
"version": "0.0.0",
"description": "My awesome typescript library",
"publishConfig": {
"access": "public"
},
"files": [
"dist"
],
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"exports": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --dts",
"test": "vitest run",
"prepublishOnly": "pnpm run build"
},
"license": "MIT",
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@egoist/prettier-config": "^1.0.0",
"prettier": "^3.1.1",
"tsup": "^8.0.1",
"typescript": "^5.3.3",
"vitest": "^1.1.2"
}
}
Loading

0 comments on commit ab04f1d

Please sign in to comment.