Skip to content

Commit

Permalink
fix(use-scroller): unsubscribe from updates when hook has unmounted (#97
Browse files Browse the repository at this point in the history
)

* fix(use-scroller): unsubscribe from updates when hook has unmounted

* chore: add master branch github action branches
  • Loading branch information
jaredLunde committed Oct 23, 2021
1 parent df073ac commit 2117625
Show file tree
Hide file tree
Showing 52 changed files with 10,089 additions and 10,443 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
@@ -1,9 +1,9 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
title: ""
labels: ""
assignees: ""
---

**Describe the bug**
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
@@ -1,9 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
4 changes: 2 additions & 2 deletions .github/pull_request_template.md 100644 → 100755
Expand Up @@ -2,11 +2,11 @@
> **Any change needs to be discussed before proceeding.** Failure to do so may result
> in the rejection of the pull request.
## Thank you for contributing to Masonic
## Thank you for contributing to `masonic`

### Before submitting

Read the [CONTRIBUTING.md](https://github.com/jaredLunde/react-hook/blob/master/CONTRIBUTING.md) file and confirm that you're following
Read the [CONTRIBUTING.md](../CONTRIBUTING.md) file and confirm that you're following
all of the guidelines

### Please provide enough information so that others can review your pull request
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,70 @@
name: release

on:
push:
branches:
- master
- main
- next
- alpha
pull_request:
branches:
- master
- main
- next
- alpha

jobs:
release:
name: 🚀 Release
if: "!contains(github.event.head_commit.message, '[skip ci]') && !startsWith(github.event.head_commit.message, 'chore:') && !startsWith(github.event.head_commit.message, 'style:') && !contains(github.event.pull_request.title, '[skip ci]') && !startsWith(github.event.pull_request.title, 'chore:') && !startsWith(github.event.pull_request.title, 'style:') && !startsWith(github.event.head_commit.message, 'chore(') && !startsWith(github.event.head_commit.message, 'style(') && !startsWith(github.event.pull_request.title, 'chore(') && !startsWith(github.event.pull_request.title, 'style(')"
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v2.0.1
with:
version: 6.14.3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: pnpm install --reporter=silent
- name: ✅ Check types
run: pnpm check-types
- name: 🧹 Lint
run: pnpm lint -- --quiet
- name: 🧪 Test
run: pnpm test -- --coverage --silent
- name: Publish tests to Codecov
if: always()
uses: codecov/codecov-action@v2
with:
directory: coverage
verbose: false
fail_ci_if_error: false
- name: Build
if: "github.event_name == 'push'"
run: pnpm build
- name: Stage changes
if: "github.event_name == 'push'"
run: git add .
- name: 🚀 Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpx -y semantic-release
4 changes: 4 additions & 0 deletions .husky/commit-msg
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm lint-staged
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

62 changes: 23 additions & 39 deletions CONTRIBUTING.md 100644 → 100755
Expand Up @@ -2,10 +2,15 @@

To contribute to this project, first:

- Fork this repo to your account
- `git clone https://github.com/[your-username]/masonic.git`
- `cd masonic`
- `yarn install`
1. [Fork this repo to your account](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo)
2. [Clone this repo](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) to your local machine
3. ```sh
# Install the repo using pnpm
cd masonic
pnpm install
# Start dev mode
pnpm dev
```

## Before you contribute

Expand All @@ -20,77 +25,56 @@ Before your PR will be considered I will look for:

- **Documentation** Please submit updates to the docs when public-facing APIs are changed.
- **Tests** Your PR will not be accepted if it doesn't have well-designed tests. Additionally, make sure
that you run `yarn validate` before you submit your PR and make sure your PR passes the linting rules,
that you run `pnpm validate` before you submit your PR and make sure your PR passes the linting rules,
type checking, and tests that already exist.
- **Types** Your types should be as strict as possible.
- **Types** Your types should be as strong as possible.
- **Comments** If your PR implements non-obvious logic, I fully expect you to explain the rationale in
the form of code comments. I also expect you to update existing comments if the PR changes the behavior
of existing code that could make those comments stale.

## Development

Here's what you need to know to start devleoping Masonic.
Here's what you need to know to start developing `masonic`.

### Package scripts

#### `build`

Builds types, commonjs, and module distributions

#### `build-main`

Builds the commonjs distribution

#### `build-module`

Builds the module distribution

#### `build-types`

Builds the TypeScript type definitions

#### `check-types`

Runs a type check on the project using the local `tsconfig.json`

#### `dev`

Builds `module` and `cjs` builds in `watch` mode

#### `format`

Formats all of the applicable source files with prettier as defined by `.prettierrc`
Formats all of the applicable source files with prettier

#### `lint`

Runs `eslint` on the package source

#### `prepublishOnly`

Runs before the package is published. This calls `lint`, `build`, `test`, and `format` scripts

#### `test`

Tests the package with `jest` as defined by options in `jest.config.js`
Tests the package with `jest`

#### `validate`

Runs `check-types`, `lint`, `test`, and `format` scripts
Runs `check-types`, `lint`, and `test` scripts.

---

### Husky hooks

#### `pre-commit`

Runs `lint-staged` and the `build-types` script

---

### Lint staged

Used for calling commands on git staged files that match a glob pattern

#### `**/*.{ts,tsx,js,jsx}`

Calls `eslint` and `prettier --write` to lint and format the staged files
Runs `lint-staged` script

#### `**/*.{md,yml,json,eslintrc,prettierrc}`
#### `commit-msg`

Calls `prettier --write` to format the staged files
Runs `commitlint` on your commit message. The easiest way
to conform to `standard-version` rules is to use [`cz-cli`](https://github.com/commitizen/cz-cli)
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Jared Lunde
Copyright (c) 2019 Jared Lunde

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down

0 comments on commit 2117625

Please sign in to comment.