Skip to content

Commit 13d138c

Browse files
authored
chore: change package name (#305)
* chore: change package and api names * fix tests * add downloadDependencies task * Add migration guide * fix link
1 parent 5ad6ffe commit 13d138c

File tree

130 files changed

+3254
-4062
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+3254
-4062
lines changed

CONTRIBUTING.md

+184
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
# Contributing
2+
3+
We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project.
4+
5+
## Development workflow
6+
7+
To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
8+
9+
```sh
10+
yarn
11+
```
12+
13+
While developing, you can run the [example app](/example/) to test your changes.
14+
15+
To start the packager:
16+
17+
```sh
18+
yarn example start
19+
```
20+
21+
To run the example app on Android:
22+
23+
```sh
24+
yarn example android
25+
```
26+
27+
To run the example app on iOS:
28+
29+
```sh
30+
yarn example ios
31+
```
32+
33+
Make sure your code passes TypeScript and ESLint. Run the following to verify:
34+
35+
```sh
36+
yarn typescript
37+
yarn lint
38+
```
39+
40+
To fix formatting errors, run the following:
41+
42+
```sh
43+
yarn lint --fix
44+
```
45+
46+
Remember to add tests for your change if possible. Run the unit tests by:
47+
48+
```sh
49+
yarn test
50+
```
51+
52+
To edit the Objective-C files, open `example/ios/PagerViewExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-pager-view`.
53+
54+
To edit the Kotlin files, open `example/android` in Android studio and find the source files at `reactnativepagerview` under `Android`.
55+
56+
### Commit message convention
57+
58+
We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
59+
60+
- `fix`: bug fixes, e.g. fix crash due to deprecated method.
61+
- `feat`: new features, e.g. add new method to the module.
62+
- `refactor`: code refactor, e.g. migrate from class components to hooks.
63+
- `docs`: changes into documentation, e.g. add usage example for the module..
64+
- `test`: adding or updating tests, e.g. add integration tests using detox.
65+
- `chore`: tooling changes, e.g. change CI config.
66+
67+
Our pre-commit hooks verify that your commit message matches this format when committing.
68+
69+
### Linting and tests
70+
71+
[ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
72+
73+
We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
74+
75+
Our pre-commit hooks verify that the linter and tests pass when committing.
76+
77+
### Scripts
78+
79+
The `package.json` file contains various scripts for common tasks:
80+
81+
- `yarn bootstrap`: setup project by installing all dependencies and pods.
82+
- `yarn typescript`: type-check files with TypeScript.
83+
- `yarn lint`: lint files with ESLint.
84+
- `yarn test`: run unit tests with Jest.
85+
- `yarn example start`: start the Metro server for the example app.
86+
- `yarn example android`: run the example app on Android.
87+
- `yarn example ios`: run the example app on iOS.
88+
89+
### Sending a pull request
90+
91+
> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
92+
93+
When you're sending a pull request:
94+
95+
- Prefer small pull requests focused on one change.
96+
- Verify that linters and tests are passing.
97+
- Review the documentation to make sure it looks good.
98+
- Follow the pull request template when opening a pull request.
99+
- For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
100+
101+
## Code of Conduct
102+
103+
### Our Pledge
104+
105+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
106+
107+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
108+
109+
### Our Standards
110+
111+
Examples of behavior that contributes to a positive environment for our community include:
112+
113+
- Demonstrating empathy and kindness toward other people
114+
- Being respectful of differing opinions, viewpoints, and experiences
115+
- Giving and gracefully accepting constructive feedback
116+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
117+
- Focusing on what is best not just for us as individuals, but for the overall community
118+
119+
Examples of unacceptable behavior include:
120+
121+
- The use of sexualized language or imagery, and sexual attention or
122+
advances of any kind
123+
- Trolling, insulting or derogatory comments, and personal or political attacks
124+
- Public or private harassment
125+
- Publishing others' private information, such as a physical or email
126+
address, without their explicit permission
127+
- Other conduct which could reasonably be considered inappropriate in a
128+
professional setting
129+
130+
### Enforcement Responsibilities
131+
132+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
133+
134+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
135+
136+
### Scope
137+
138+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
139+
140+
### Enforcement
141+
142+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.
143+
144+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
145+
146+
### Enforcement Guidelines
147+
148+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
149+
150+
#### 1. Correction
151+
152+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
153+
154+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
155+
156+
#### 2. Warning
157+
158+
**Community Impact**: A violation through a single incident or series of actions.
159+
160+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
161+
162+
#### 3. Temporary Ban
163+
164+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
165+
166+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
167+
168+
#### 4. Permanent Ban
169+
170+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
171+
172+
**Consequence**: A permanent ban from any sort of public interaction within the community.
173+
174+
### Attribution
175+
176+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
177+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
178+
179+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
180+
181+
[homepage]: https://www.contributor-covenant.org
182+
183+
For answers to common questions about this code of conduct, see the FAQ at
184+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

LICENSE

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2015-present, Facebook, Inc.
3+
Copyright (c) 2021 Callstack
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
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

MIGRATION.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Migration Guide
2+
3+
# 5.0.x -> 5.1.x
4+
Before:
5+
```js
6+
import ViewPager from '@react-native-community/viewpager'
7+
import type { ViewPagerOnPageScrollEventData,ViewPagerOnPageSelectedEventData } from '@react-native-community/viewpager';
8+
```
9+
10+
After:
11+
```js
12+
import PagerView from 'react-native-pager-view';
13+
import type { PagerViewOnPageScrollEventData, PagerViewOnPageSelectedEventData } from 'react-native-pager-view';

0 commit comments

Comments
 (0)