Skip to content

Commit

Permalink
docs(snapshots): document how to update public api snapshots (carbon-…
Browse files Browse the repository at this point in the history
  • Loading branch information
tay1orjones authored Feb 18, 2025
1 parent 73c1439 commit 82675c2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
9 changes: 9 additions & 0 deletions docs/developer-handbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,15 @@ need to do anything in `@carbon/styles` side.

## Maintainers

### Public API Snapshot

The entire public api of `@carbon/react` is tracked in one file by iterating
over all PropTypes and storing the output in a snapshot file. When adding,
removing, or updating PropTypes, run `yarn test -u` from the root to update the
snapshot and include it in your pull request for review. This helps core
reviewers to determine if api changes are being made in a backwards compatible
way to avoid breaking changes.

### Working with icons and pictograms

We get work submitted by the IBM Brand team, along with other designers at IBM,
Expand Down
4 changes: 3 additions & 1 deletion docs/guides/adding-component-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ the repository. There is an issue tracking curring status of this effort,
probably not public.
- The entire Public API is snapshotted, you can
[search the snapshot here](https://github.com/carbon-design-system/carbon/blob/main/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap).
If it's not included there, it's not part of the public API.
If it's not included there, it's not part of the public API. When PropTypes
are updated you can regenerate these snapshots by running `yarn test -u` at
the root of the project.

### Should components have both prototypes and ts interface?

Expand Down
11 changes: 10 additions & 1 deletion docs/guides/versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ types of changes you can expect to occur as a consumer of that package. We'll
try to highlight common changes in code and the corresponding `semver` bump that
you can expect for the package when it is updated.

## `carbon-components-react`, `@carbon/react`
## `@carbon/react`

### Changes

Expand Down Expand Up @@ -288,3 +288,12 @@ where possible to minimize the impact of the change.
unless absolutely necessary_ and instead use more stable
[relative queries focused on accessible roles](https://testing-library.com/docs/queries/about#priority)
or HTML5 and ARIA semantics for selecting elements for testing.**

### Public API Snapshot

The entire public api of `@carbon/react` is tracked in one file by iterating
over all PropTypes and storing the output in a snapshot file. When adding,
removing, or updating PropTypes, run `yarn test -u` from the root to update the
snapshot and include it in your pull request for review. This helps core
reviewers to determine if api changes are being made in a backwards compatible
way to avoid breaking changes.
4 changes: 4 additions & 0 deletions docs/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -1112,3 +1112,7 @@ test('Public API', async () => {
`);
});
```

You can run `yarn test -u` from the root to update the snapshot and include it
in your pull request for review. This helps core reviewers to determine if api
changes are being made in a backwards compatible way to avoid breaking changes.

0 comments on commit 82675c2

Please sign in to comment.