Conversation
9365e0d to
92871de
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4387 +/- ##
=======================================
Coverage 97.44% 97.45%
=======================================
Files 906 909 +3
Lines 26561 26637 +76
Branches 9582 9614 +32
=======================================
+ Hits 25882 25958 +76
Misses 673 673
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2daa3b6 to
17d9487
Compare
95a048e to
5a85f8a
Compare
|
|
||
| This project uses `@cloudscape-design/documenter` to generate API docs from JSDoc comments in component interface files (`src/<component>/interfaces.ts`). | ||
|
|
||
| ## Special Tags |
|
|
||
| - Props interface: `${ComponentName}Props`, namespace sub-types under it (e.g. `${ComponentName}Props.Variant`) | ||
| - Union types must be type aliases (no inline unions) | ||
| - Array types must use `ReadonlyArray<T>` |
There was a problem hiding this comment.
Does it still? I think our updated documenter can actually handle readonly T[] - could we check it?
docs/COMPONENT_CONVENTIONS.md
Outdated
| - Props interface: `${ComponentName}Props`, namespace sub-types under it (e.g. `${ComponentName}Props.Variant`) | ||
| - Union types must be type aliases (no inline unions) | ||
| - Array types must use `ReadonlyArray<T>` | ||
| - Cast string props to string at runtime if rendered in JSX — React accepts JSX content there |
There was a problem hiding this comment.
It is part of our v3-development convention. It said. If you declared property as a string type, but then you also use it in JSX content (for example: <div>{option.label}</div>), you need to add additional cast to string in runtime, because React would accept JSX content there which allows customers to provide unsupported content.. I will remove it since it's confusing.
| @@ -0,0 +1,7 @@ | |||
| # Dev Pages | |||
|
|
|||
| Dev and test pages live in `pages/<component-name>/`. They are used for local development, integration tests, and visual regression tests. | |||
There was a problem hiding this comment.
Why do we say "dev and test pages" - instead of just "test pages" or "demo pages"? We sometimes add a -test suffix to pages used in integ tests, but that rule is not always followed.
| Dev and test pages live in `pages/<component-name>/`. They are used for local development, integration tests, and visual regression tests. | ||
|
|
||
| ## Rules | ||
| - For visual regression content, either use `SimplePage` (handles heading, screenshot area, i18n, and layout) or wrap content in `ScreenshotArea`. |
There was a problem hiding this comment.
The mention of visual regression testing can be confusing. In this repo we don't run VR tests in GitHub - only in the internal pipeline.
| │ ├── generated - generated code from style-dictionary | ||
| │ └── styles - base styles and SCSS-mixins | ||
| │ | ||
| ├── lib - build output |
There was a problem hiding this comment.
why is it necessary to describe the build output structure?
There was a problem hiding this comment.
It helps with understanding the project structure and debugging build issues. This section was originally part of our CONTRIBUTING.md. I just moved it here for better organization.
docs/RUNNING_TESTS.md
Outdated
|
|
||
| ## Test Types | ||
|
|
||
| - **Build-tool tests** — test the build-tools code in a NodeJS context. |
There was a problem hiding this comment.
Do we really need to mention build-tool tests? We have a few of those, and those are touches very seldom.
At the same time, we can mention the a11y tests here. We have a util to run a11y checks in unit tests, and there are separate scripts to run a11y tests on the test pages.
| When component APIs change, you may need to update test snapshots. Use the `-u` flag to update snapshots: | ||
|
|
||
| ``` | ||
| TZ=UTC npx jest -u snapshot -c jest.unit.config.js src/ |
There was a problem hiding this comment.
All snapshot tests are grouped inside global unit and integ folders, which means:
- There is no need to run all unit tests to update snapshots
- When design tokens are touched - one must run integ tests to update snapshots
Also, it is essential to mention that the project must be built with the full build (npm run build) before updating snapshots - so that documenter docs are generated.
| TZ=UTC npx jest -u snapshot -c jest.unit.config.js src/ | ||
| ``` | ||
|
|
||
| ## Visual Regression Tests |
There was a problem hiding this comment.
We don't have these in the components repo atm.
| @@ -0,0 +1,28 @@ | |||
| # Writing Tests | |||
There was a problem hiding this comment.
Should we consider describing test utils separately from testing, either as part of component conventions or in a separate section? While we use test utils for internal testing - the main purpose of test utils is different - they are part of our contract.
At the same time, I don't think we should have separate running tests and writing tests guide, as there is a lot of similar info - I recommend combining the two.
There was a problem hiding this comment.
Separating the test-utils makes sense to me. I will move it the component conventions.
The reason I kept them separate is that the writing tests guide is meant to be shared across repositories, while the running tests part is repo-specific. for example here through the CLOUDSCAPE_COMPONENTS_GUIDE.md. Therefore I think it's better if we keep it separate for now.
| npm install | ||
| ``` | ||
|
|
||
| ## Building |
There was a problem hiding this comment.
These are useful instructions. Should we have them in our general docs somewhere? I think the agents.md should ideally only give references to other docs.
Description
Adds
AGENTS.mdas a top-level entry point for AI coding agents working in this repo, along with supporting documentation indocs/.Key changes:
AGENTS.md— setup, build, and run instructions tailored for agents, with pointers intodocs/for deeper guidance.docs/CLOUDSCAPE_COMPONENTS_GUIDE.md— central index for component conventions, styling, testing, and internals. Designed to be reusable across related repos.I have other repositories reusing the
CLOUDSCAPE_COMPONENTS_GUIDE.mdfor example take a look at this PR for chat-components repository.Related links, issue #, if available: X2NaAdxtpFej rcDoAlynI8Zj
How has this been tested?
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.