-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from giraugh/chore/ci-and-release
Add documentation and set up CI for release
- Loading branch information
Showing
10 changed files
with
1,873 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@giraugh/tools": minor | ||
--- | ||
|
||
Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.