Skip to content

Commit

Permalink
Merge pull request #1 from giraugh/chore/ci-and-release
Browse files Browse the repository at this point in the history
Add documentation and set up CI for release
  • Loading branch information
giraugh authored Apr 19, 2023
2 parents f81c902 + b624d18 commit 977fd3b
Show file tree
Hide file tree
Showing 10 changed files with 1,873 additions and 15 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/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/warm-buses-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@giraugh/tools": minor
---

Initial release
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release

on:
push:
branches: ['main']
paths:
- '**/package.json'
- '.changeset/**'
- '.github/workflows/release.yml'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn install --immutable
- uses: changesets/action@v1
with:
publish: yarn ci:release
commit: 'ci: release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test

on:
pull_request:
paths:
- 'lib/**'
- 'tsconfig.json'
- 'vite.config.ts'
- '.github/workflows/test.yml'

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn install --immutable
- run: yarn test

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- run: yarn install --immutable
- run: yarn tsc
54 changes: 54 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Contributing Guide

If you find an issue or want to request a feature, please [create an issue](https://github.com/giraugh/tools/issues/new/choose).

## Project Structure

The code for all tools is located under `./lib`. They are sorted into relevant folders and each tool lives in it's own file with detailed TSDocs and inline tests.

Each subfolder in `./lib` contains a barrel file that re-exports the tools, which are then all re-exported through `./lib/main.ts`.

## Development

After cloning the repo, run `yarn` to install dependencies, then you can use `yarn build` to bundle the code and types to `./dist`.

Add new tools under a relevant subfolder in `./lib`, each tool should be in it's own file. Don't forget to re-export tools from `./lib/main.ts`.

## Testing

You can add tests for a tool using [in-source testing](https://vitest.dev/guide/in-source.html) with vitest. Run `yarn test` to check that they all pass.

## Git Conventions

### Branches

🏠 `main`
Production branch. Do not commit directly to this branch.

`feat/branch`
Prefix new feature branches with feat. When complete, submit a PR into main.

🔧 `fix/branch`
When fixing a bug, prefix branches with bug. When complete, submit a PR into main.

🔮 `refactor/branch`
For refactoring code. When complete, submit a PR into main.

🧹 `chore/branch`
For chores like adding type checking, adding README text, fixing typos etc. When finished, submit a PR into main.

### Pull Requests

If your PR will close or fix an existing issue, be sure to mention the issue you are closing at the top of your PR like so:

```
Closes #6
[describe your PR...]
```

Make sure the title and body of the PR are descriptive.

## Releases

This library uses [changesets](https://github.com/changesets/changesets), if the changes you've made would constitute a version bump, run `yarn changeset` and follow the prompts to document the changes you've made. Changesets are consumed on releases, and used to generate a changelog and bump version number.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Ewan Breakey

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.
45 changes: 43 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
# Giraugh Tools
# 🦒 Giraugh Tools

Generic typescript utilities built with simplicity in mind
[![npm version](https://img.shields.io/npm/v/@giraugh/tools)](https://www.npmjs.com/package/@giraugh/tools)
[![minzip size](https://img.shields.io/bundlephobia/minzip/@giraugh/tools)](https://bundlephobia.com/package/@giraugh/tools)

Generic typescript utilities built with simplicity in mind.

## Installation

**Yarn**

```bash
yarn add @giraugh/tools
```

**PNPM**

```bash
pnpm add @giraugh/tools
```

**NPM**

```bash
npm install @giraugh/tools
```

## Usage

```ts
import { pluralize } from '@giraugh/tools'

pluralize('cake', 2) === 'cakes'
```

## Development

If you find an issue or want to request a feature, please [create an issue](https://github.com/giraugh/tools/issues/new/choose).

Refer to the [Contributing Guide](./CONTRIBUTING.md) for details on local development and contributing to this project.

## License

`@giraugh/tools` is licensed under MIT
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{
"name": "@giraugh/tools",
"private": false,
"version": "0.1.1",
"version": "0.0.0",
"type": "module",
"description": "Vector utilities",
"license": "MIT",
"author": "Ewan Breakey (https://ewanb.me)",
"repository": "github:giraugh/tools",
"description": "Generic typescript utilities built with simplicity in mind",
"keywords": [
"utility",
"typescript",
"arrays"
"arrays",
"objects",
"promises"
],
"files": [
"dist"
Expand All @@ -21,12 +26,12 @@
}
},
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"test": "vitest"
"test": "vitest",
"ci:release": "yarn build && yarn changeset publish"
},
"devDependencies": {
"@changesets/cli": "^2.26.1",
"typescript": "^4.6.4",
"vite": "^4.2.1",
"vite-plugin-dts": "^1.6.5",
Expand Down
Loading

0 comments on commit 977fd3b

Please sign in to comment.