Skip to content

Commit 2edea79

Browse files
committed
Merge branch 'main' of github.com:callstack/react-native-paper into adamTrz/migrate-docs-rspress-ck-theme
# Conflicts: # docs/package.json # scripts/generate-component-docs.ts # yarn.lock
2 parents 0ed99a6 + 6b16adc commit 2edea79

128 files changed

Lines changed: 4899 additions & 4608 deletions

File tree

Some content is hidden

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

‎.agents/README.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Agent Instructions
2+
3+
For code review behavior, use:
4+
5+
- `.github/copilot-instructions.md`
6+
- `.github/instructions/*.instructions.md`
7+
8+
These files are the source of truth because they are also consumed by GitHub Copilot code review.

‎.eslintignore‎

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

‎.eslintrc‎

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

‎.github/copilot-instructions.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# General Code Review Standards
2+
3+
## Review Priorities
4+
5+
- Prioritize correctness, regressions, missing tests, and API design issues.
6+
- Check that the behavior scope matches the stated intent.
7+
- Verify claims about external standards, platform conventions, accessibility, and design systems against the implementation.
8+
- Avoid asking for unrelated refactors, stylistic churn, or backwards compatibility unless required by the change.
9+
10+
## Public APIs
11+
12+
- Review new or modified public APIs for visibility, naming, defaults, customizability, and extensibility.
13+
- Ensure public APIs and exported types do not leak implementation details.
14+
15+
## Tests
16+
17+
- Call out missing tests when the changed behavior is risky.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
applyTo: "**/*.{ts,tsx,js,jsx}"
3+
---
4+
5+
# TypeScript And React Review Instructions
6+
7+
## Code Quality
8+
9+
- Flag unnecessary abstractions, one-off helpers, excessive indirection, and defensive code without a real use case.
10+
- Flag comments that restate obvious code instead of explaining non-obvious intent.
11+
- Check that changes follow existing project style, structure, naming, and local patterns.
12+
13+
## TypeScript
14+
15+
- Flag uses of `any`, unsafe `as` assertions, and non-null assertions (`!`) unless clearly justified.
16+
- Avoid broad types such as `object`, `Function`, `{}`, and `Record<string, unknown>` unless the broadness is intentional.
17+
- Do not accept `@ts-ignore`.
18+
- Only accept `@ts-expect-error` when it has a comment explaining why the error is expected and cannot be resolved.
19+
- Prefer simple types over complex conditional types, overloads, or type logic when simpler approaches work.
20+
- Prefer `type` aliases over `interface` unless there is a specific reason to use `interface`.
21+
22+
## React
23+
24+
- Check that hooks follow the Rules of Hooks.
25+
- Check dependency arrays for unstable values.
26+
- Ensure components do not perform side effects during rendering.
27+
- Avoid storing values in state when they can be derived from props or existing state.
28+
- Avoid multiple sources of truth for the same state.
29+
- Avoid `React.Children`, `cloneElement`, and reading React elements directly unless there is a strong justification.
30+
- Treat memoization as something that needs a reason: expensive calculation, stable identity requirement, or measured performance need.
31+
- Check async effects for cancellation or race conditions when relevant.
32+
- Check accessibility: labels, roles, focus order, keyboard interactions, disabled states, and loading states.
33+
34+
## Animations And Layout
35+
36+
- Check for unnecessary layout shifts.
37+
- Prefer animating only `transform` and `opacity` unless another property is required.
38+
- For layout transitions, verify the approach handles rapid state changes, gestures, interruption, and cancellation.
39+
- Check that duration and easing feel appropriate for the platform and interaction.
40+
- Verify text and UI elements do not overlap or overflow at supported screen sizes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
applyTo: "**/*.{md,mdx}"
3+
---
4+
5+
# Documentation Review Instructions
6+
7+
- Verify examples match the actual API.
8+
- Check changed heading hierarchy for consistency.
9+
- Check changed internal links and anchors for consistency.
10+
- Check that documentation explains public behavior, not implementation details.
11+
- Check that examples are self-contained and demonstrate only the relevant behavior instead of mixing multiple behaviors.
12+
- Check that migration guide examples show diff or before/after code snippets when relevant.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
applyTo: "**/*.{test,spec}.{ts,tsx,js,jsx}"
3+
---
4+
5+
# Test Review Instructions
6+
7+
- Check that tests verify public behavior, not implementation details.
8+
- Check that test titles describe user-facing behavior.
9+
- Check coverage of happy paths, edge cases, and error states.
10+
- Flag unnecessary mocking.

‎.github/pull_request_template.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313

1414
<!-- Describe the **steps to test this change**, so that a reviewer can verify it. Provide screenshots or videos if the change affects UI. -->
1515

16-
<!-- Keep in mind that PR changes must pass lint, typescript and tests. -->
16+
<!-- Keep in mind that PR changes must pass lint, typecheck and tests. -->

‎.github/workflows/ci.yml‎

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
uses: ./.github/actions/setup
1919

2020
- name: Lint
21-
run: yarn lint-no-fix
21+
run: yarn lint
2222

23-
typescript:
24-
name: TypeScript
23+
typecheck:
24+
name: Typecheck
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: Checkout
@@ -31,7 +31,7 @@ jobs:
3131
uses: ./.github/actions/setup
3232

3333
- name: Check types
34-
run: yarn typescript
34+
run: yarn typecheck
3535

3636
unit-tests:
3737
name: Unit tests
@@ -73,7 +73,20 @@ jobs:
7373
- name: Build package
7474
run: |
7575
yarn prepack
76-
node ./scripts/typescript-output-lint
76+
node ./scripts/typescript-output-lint.ts
77+
78+
build-example:
79+
name: Build example
80+
runs-on: ubuntu-latest
81+
steps:
82+
- name: Checkout
83+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
84+
85+
- name: Setup
86+
uses: ./.github/actions/setup
87+
88+
- name: Build example
89+
run: yarn example expo export --platform all
7790

7891
build-docs:
7992
name: Build docs
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Contributor Label
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened]
6+
7+
permissions:
8+
issues: write
9+
pull-requests: write
10+
11+
jobs:
12+
label:
13+
name: Add contributor label
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
17+
with:
18+
github-token: ${{ secrets.GITHUB_TOKEN }}
19+
script: |
20+
const owner = context.repo.owner;
21+
const repo = context.repo.repo;
22+
23+
let permission = 'none';
24+
25+
try {
26+
const { data } = await github.rest.repos.getCollaboratorPermissionLevel({
27+
owner,
28+
repo,
29+
username: context.payload.pull_request.user.login,
30+
});
31+
32+
permission = data.permission;
33+
} catch (error) {
34+
if (error.status !== 404) {
35+
throw error;
36+
}
37+
}
38+
39+
if (
40+
!['MEMBER', 'OWNER'].includes(context.payload.pull_request.author_association) &&
41+
!['admin', 'maintain', 'write'].includes(permission)
42+
) {
43+
return;
44+
}
45+
46+
await github.rest.issues.addLabels({
47+
owner,
48+
repo,
49+
issue_number: context.issue.number,
50+
labels: ['Contributor: Internal'],
51+
});

0 commit comments

Comments
 (0)