Skip to content

Commit 5af1a75

Browse files
authored
Merge pull request #618 from thebuilder/feat/switch-to-pnpm
2 parents f323a0c + a3fcf3d commit 5af1a75

33 files changed

+11497
-14484
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,20 @@ jobs:
99
name: Release
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v3
12+
- uses: actions/checkout@v3
13+
- name: Install PNPM
14+
uses: pnpm/action-setup@v2
15+
with:
16+
version: 7
1417
- name: Setup Node.js
1518
uses: actions/setup-node@v3
1619
with:
1720
node-version: 18
21+
cache: 'pnpm'
1822
- name: Install dependencies
19-
run: yarn --frozen-lockfile
23+
run: pnpm install
2024
- name: Build
21-
run: yarn build
25+
run: pnpm build
2226
- name: Release
2327
env:
2428
GH_TOKEN: ${{ secrets.GH_TOKEN }}

.github/workflows/test.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,20 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v3
15+
- uses: pnpm/action-setup@v2
16+
with:
17+
version: 7
1518
- name: Use Node.js ${{ matrix.node-version }}
1619
uses: actions/setup-node@v3
1720
with:
1821
node-version: ${{ matrix.node-version }}
22+
cache: 'pnpm'
1923
- name: Install dependencies
20-
run: yarn --frozen-lockfile
24+
run: pnpm install
2125
- name: Lint
22-
run: yarn lint
26+
run: pnpm lint
2327
- name: Test
24-
run: yarn test
28+
run: pnpm test
2529
env:
2630
CI: true
2731
- name: Build

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.vscode
22
.cache
3-
.docz
43
node_modules
54
reports
65
example
@@ -11,10 +10,10 @@ nuget
1110
npm-debug.log*
1211
.DS_store
1312
.eslintcache
14-
.stylelintcache
1513
.idea
1614
.tern
1715
.tmp
1816
*.log
17+
storybook-static
1918
test-utils.js
2019
test-utils.d.ts

.npmignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@ npm-debug.log
1717
.tmp
1818
.eslintignore
1919
.flowconfig
20-
.travis.yml
21-
.babelrc
2220
.editorconfig
23-
.storybook
24-
yarn.lock
21+
storybook/.storybook
22+
pnpm-lock.yaml
2523

2624
# Project files
2725
coverage
28-
stories
26+
storybook/stories
2927
tests
3028
example
3129
jest-setup.js

.storybook/main.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

.storybook/preview-head.html

Lines changed: 0 additions & 9 deletions
This file was deleted.

.storybook/theme.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

.storybook/utils/ignore-errors.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Contribution Guidelines
2+
3+
Welcome to `react-intersection-observer`! I'm thrilled that you're interested in
4+
contributing. Here are some guidelines to help you get started.
5+
6+
The codebase is written in TypeScript, and split into two packages using PNPM
7+
workspaces:
8+
9+
- `react-intersection-observer` - The main package, which contains the
10+
`useInView` hook and the `InView` component.
11+
- `storybook` - A Storybook project that is used to develop and test the
12+
`react-intersection-observer` package.
13+
14+
## Development
15+
16+
Start by forking the repository, and after cloning it locally you can install
17+
the dependencies using [PNPM](https://pnpm.io/):
18+
19+
```shell
20+
pnpm install
21+
```
22+
23+
Then you can start the Storybook development server with the `dev` task:
24+
25+
```shell
26+
pnpm dev
27+
```
28+
29+
## Semantic Versioning
30+
31+
`react-intersection-observer` follows Semantic Versioning 2.0 as defined at
32+
http://semver.org. This means that releases will be numbered with the following
33+
format:
34+
35+
`<major>.<minor>.<patch>`
36+
37+
- Breaking changes and new features will increment the major version.
38+
- Backwards-compatible enhancements will increment the minor version.
39+
- Bug fixes and documentation changes will increment the patch version.
40+
41+
## Pull Request Process
42+
43+
Fork the repository and create a branch for your feature/bug fix.
44+
45+
- Add tests for your feature/bug fix.
46+
- Ensure that all tests pass before submitting your pull request.
47+
- Update the README.md file if necessary.
48+
- Ensure that your commits follow the conventions outlined in the next section.
49+
50+
### Commit Message Conventions
51+
52+
- We use
53+
[semantic-release](https://github.com/semantic-release/semantic-release) to
54+
manage releases automatically. To ensure that releases are automatically
55+
versioned correctly, we follow the
56+
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
57+
Conventions. This means that your commit messages should have the following
58+
format:
59+
60+
`<type>: <subject>`
61+
62+
Here's what each part of the commit message means:
63+
64+
- `<type>`: The type of change that you're committing. Valid types include
65+
`feat` for new features, `fix` for bug fixes, `docs` for documentation
66+
changes, and `chore` for changes that don't affect the code itself (e.g.
67+
updating dependencies).
68+
- `<subject>`: A short description of the change.
69+
70+
### Code Style
71+
72+
`react-intersection-observer` uses [Prettier](https://prettier.io/) for code
73+
formatting. Please ensure that your changes are formatted with Prettier before
74+
submitting your pull request.
75+
76+
### Testing
77+
78+
`react-intersection-observer` uses [Vitest](https://vitest.dev/) for testing.
79+
Please ensure that your changes are covered by tests, and that all tests pass
80+
before submitting your pull request.
81+
82+
You can run the tests with the `test` task:
83+
84+
```shell
85+
pnpm test
86+
```

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2022 React Intersection Observer authors
3+
Copyright (c) 2023 React Intersection Observer authors
44

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

0 commit comments

Comments
 (0)