@react-ui-org/react-ui 0.64.1 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -6
- package/dist/react-ui.css +16 -16
- package/dist/react-ui.d.ts +1936 -0
- package/dist/react-ui.development.css +3591 -3003
- package/dist/react-ui.development.js +2028 -1060
- package/dist/react-ui.js +1 -1
- package/package.json +74 -70
- package/src/components/Alert/{Alert.jsx → Alert.tsx} +8 -43
- package/src/components/Alert/Alert.types.ts +34 -0
- package/src/components/Alert/README.md +1 -1
- package/src/components/Alert/index.ts +2 -0
- package/src/components/Badge/Badge.tsx +30 -0
- package/src/components/Badge/Badge.types.ts +24 -0
- package/src/components/Badge/README.md +1 -1
- package/src/components/Badge/index.ts +5 -0
- package/src/components/Button/Button.tsx +110 -0
- package/src/components/Button/Button.types.ts +93 -0
- package/src/components/Button/README.md +1 -1
- package/src/components/Button/helpers/{getRootLabelVisibilityClassName.js → getRootLabelVisibilityClassName.ts} +5 -2
- package/src/components/Button/index.ts +6 -0
- package/src/components/ButtonGroup/{ButtonGroup.jsx → ButtonGroup.tsx} +9 -40
- package/src/components/ButtonGroup/ButtonGroup.types.ts +45 -0
- package/src/components/ButtonGroup/ButtonGroupContext.ts +4 -0
- package/src/components/ButtonGroup/README.md +1 -1
- package/src/components/ButtonGroup/{index.js → index.ts} +4 -0
- package/src/components/Card/Card.tsx +33 -0
- package/src/components/Card/Card.types.ts +46 -0
- package/src/components/Card/{CardBody.jsx → CardBody.tsx} +4 -11
- package/src/components/Card/{CardFooter.jsx → CardFooter.tsx} +4 -15
- package/src/components/Card/README.md +6 -7
- package/src/components/Card/{index.js → index.ts} +5 -0
- package/src/components/CheckboxField/CheckboxField.module.scss +7 -3
- package/src/components/CheckboxField/CheckboxField.tsx +81 -0
- package/src/components/CheckboxField/CheckboxField.types.ts +64 -0
- package/src/components/CheckboxField/README.md +92 -45
- package/src/components/CheckboxField/index.ts +5 -0
- package/src/components/FileInputField/FileInputField.module.scss +7 -3
- package/src/components/FileInputField/{FileInputField.jsx → FileInputField.tsx} +43 -129
- package/src/components/FileInputField/FileInputField.types.ts +101 -0
- package/src/components/FileInputField/README.md +21 -4
- package/src/components/FileInputField/index.ts +6 -0
- package/src/components/FormLayout/FormLayout.module.scss +5 -7
- package/src/components/FormLayout/{FormLayout.jsx → FormLayout.tsx} +15 -50
- package/src/components/FormLayout/FormLayout.types.ts +55 -0
- package/src/components/FormLayout/FormLayoutContext.ts +4 -0
- package/src/components/FormLayout/FormLayoutCustomField.module.scss +7 -3
- package/src/components/FormLayout/{FormLayoutCustomField.jsx → FormLayoutCustomField.tsx} +12 -67
- package/src/components/FormLayout/FormLayoutCustomField.types.ts +60 -0
- package/src/components/FormLayout/FormLayoutCustomFieldContext.ts +4 -0
- package/src/components/FormLayout/README.md +6 -15
- package/src/components/FormLayout/index.ts +14 -0
- package/src/components/Grid/Grid.module.scss +1 -1
- package/src/components/Grid/Grid.tsx +50 -0
- package/src/components/Grid/Grid.types.ts +108 -0
- package/src/components/Grid/GridSpan.tsx +36 -0
- package/src/components/Grid/README.md +2 -2
- package/src/components/Grid/_helpers/generateResponsiveCustomProperties.ts +33 -0
- package/src/components/Grid/index.ts +9 -0
- package/src/components/InputGroup/InputGroup.module.scss +7 -3
- package/src/components/InputGroup/{InputGroup.jsx → InputGroup.tsx} +25 -95
- package/src/components/InputGroup/InputGroup.types.ts +80 -0
- package/src/components/InputGroup/InputGroupContext.ts +4 -0
- package/src/components/InputGroup/README.md +40 -8
- package/src/components/InputGroup/{index.js → index.ts} +4 -0
- package/src/components/Modal/Modal.tsx +172 -0
- package/src/components/Modal/Modal.types.ts +181 -0
- package/src/components/Modal/ModalBody.tsx +34 -0
- package/src/components/Modal/{ModalCloseButton.jsx → ModalCloseButton.tsx} +6 -19
- package/src/components/Modal/{ModalContent.jsx → ModalContent.tsx} +4 -15
- package/src/components/Modal/ModalFooter.tsx +27 -0
- package/src/components/Modal/ModalHeader.tsx +27 -0
- package/src/components/Modal/ModalTitle.tsx +29 -0
- package/src/components/Modal/README.md +9 -9
- package/src/components/Modal/_helpers/{dialogOnCancelHandler.js → dialogOnCancelHandler.ts} +11 -1
- package/src/components/Modal/_helpers/{dialogOnClickHandler.js → dialogOnClickHandler.ts} +13 -7
- package/src/components/Modal/_helpers/{dialogOnCloseHandler.js → dialogOnCloseHandler.ts} +11 -1
- package/src/components/Modal/_helpers/{dialogOnKeyDownHandler.js → dialogOnKeyDownHandler.ts} +19 -6
- package/src/components/Modal/_helpers/{getJustifyClassName.js → getJustifyClassName.ts} +4 -1
- package/src/components/Modal/_helpers/getPositionClassName.ts +10 -0
- package/src/components/Modal/_helpers/getScrollingClassName.ts +14 -0
- package/src/components/Modal/_helpers/{getSizeClassName.js → getSizeClassName.ts} +4 -1
- package/src/components/Modal/_hooks/{useModalFocus.js → useModalFocus.ts} +9 -5
- package/src/components/Modal/_hooks/{useModalScrollPrevention.js → useModalScrollPrevention.ts} +4 -1
- package/src/components/Modal/{index.js → index.ts} +14 -0
- package/src/components/Paper/{Paper.jsx → Paper.tsx} +6 -26
- package/src/components/Paper/Paper.types.ts +19 -0
- package/src/components/Paper/README.md +3 -4
- package/src/components/Paper/index.ts +2 -0
- package/src/components/Popover/Popover.module.scss +1 -1
- package/src/components/Popover/Popover.tsx +61 -0
- package/src/components/Popover/Popover.types.ts +75 -0
- package/src/components/Popover/PopoverWrapper.tsx +27 -0
- package/src/components/Popover/README.md +34 -22
- package/src/components/Popover/_helpers/{cleanPlacementStyle.js → cleanPlacementStyle.ts} +4 -1
- package/src/components/Popover/_helpers/{getRootAlignmentClassName.js → getRootAlignmentClassName.ts} +4 -1
- package/src/components/Popover/_helpers/{getRootSideClassName.js → getRootSideClassName.ts} +4 -1
- package/src/components/Popover/index.ts +8 -0
- package/src/components/Radio/README.md +125 -48
- package/src/components/Radio/Radio.module.scss +7 -3
- package/src/components/Radio/Radio.tsx +116 -0
- package/src/components/Radio/Radio.types.ts +91 -0
- package/src/components/Radio/index.ts +5 -0
- package/src/components/ScrollView/README.md +1 -1
- package/src/components/ScrollView/ScrollView.module.scss +5 -0
- package/src/components/ScrollView/{ScrollView.jsx → ScrollView.tsx} +55 -166
- package/src/components/ScrollView/ScrollView.types.ts +121 -0
- package/src/components/ScrollView/_helpers/getElementsPositionDifference.ts +17 -0
- package/src/components/ScrollView/_hooks/{useLoadResizeHook.js → useLoadResizeHook.ts} +14 -3
- package/src/components/ScrollView/_hooks/{useScrollPositionHook.js → useScrollPositionHook.ts} +11 -4
- package/src/components/ScrollView/index.ts +6 -0
- package/src/components/SelectField/README.md +137 -51
- package/src/components/SelectField/SelectField.module.scss +7 -3
- package/src/components/SelectField/SelectField.tsx +139 -0
- package/src/components/SelectField/SelectField.types.ts +121 -0
- package/src/components/SelectField/_components/Option/Option.tsx +19 -0
- package/src/components/SelectField/_components/Option/Option.types.ts +21 -0
- package/src/components/SelectField/_components/Option/index.ts +2 -0
- package/src/components/SelectField/index.ts +7 -0
- package/src/components/Table/README.md +1 -1
- package/src/components/Table/{Table.jsx → Table.tsx} +4 -43
- package/src/components/Table/Table.types.ts +51 -0
- package/src/components/Table/_components/TableBodyCell/TableBodyCell.tsx +20 -0
- package/src/components/Table/_components/TableBodyCell/TableBodyCell.types.ts +20 -0
- package/src/components/Table/_components/TableBodyCell/index.ts +2 -0
- package/src/components/Table/_components/TableHeaderCell/{TableHeaderCell.jsx → TableHeaderCell.tsx} +3 -34
- package/src/components/Table/_components/TableHeaderCell/TableHeaderCell.types.ts +20 -0
- package/src/components/Table/_components/TableHeaderCell/index.ts +2 -0
- package/src/components/Table/index.ts +8 -0
- package/src/components/Tabs/README.md +2 -2
- package/src/components/Tabs/{Tabs.jsx → Tabs.tsx} +4 -20
- package/src/components/Tabs/Tabs.types.ts +19 -0
- package/src/components/Tabs/TabsItem.tsx +49 -0
- package/src/components/Tabs/TabsItem.types.ts +42 -0
- package/src/components/Tabs/index.ts +4 -0
- package/src/components/Text/README.md +1 -1
- package/src/components/Text/Text.module.scss +5 -7
- package/src/components/Text/Text.tsx +46 -0
- package/src/components/Text/Text.types.ts +31 -0
- package/src/components/Text/_helpers/getRootClampClassName.ts +13 -0
- package/src/components/Text/_helpers/getRootHyphensClassName.ts +14 -0
- package/src/components/Text/_helpers/getRootWordWrappingClassName.ts +14 -0
- package/src/components/Text/index.ts +6 -0
- package/src/components/TextArea/README.md +35 -14
- package/src/components/TextArea/TextArea.module.scss +7 -3
- package/src/components/TextArea/TextArea.tsx +95 -0
- package/src/components/TextArea/TextArea.types.ts +76 -0
- package/src/components/TextArea/index.ts +5 -0
- package/src/components/TextField/README.md +35 -13
- package/src/components/TextField/TextField.module.scss +7 -3
- package/src/components/TextField/TextField.tsx +112 -0
- package/src/components/TextField/TextField.types.ts +95 -0
- package/src/components/TextField/index.ts +6 -0
- package/src/components/TextLink/README.md +2 -2
- package/src/components/TextLink/{TextLink.jsx → TextLink.tsx} +4 -15
- package/src/components/TextLink/TextLink.types.ts +12 -0
- package/src/components/TextLink/index.ts +2 -0
- package/src/components/Toggle/README.md +92 -45
- package/src/components/Toggle/Toggle.module.scss +7 -3
- package/src/components/Toggle/Toggle.tsx +82 -0
- package/src/components/Toggle/Toggle.types.ts +59 -0
- package/src/components/Toggle/index.ts +5 -0
- package/src/components/Toolbar/README.md +3 -3
- package/src/components/Toolbar/Toolbar.tsx +41 -0
- package/src/components/Toolbar/Toolbar.types.ts +74 -0
- package/src/components/Toolbar/ToolbarGroup.tsx +38 -0
- package/src/components/Toolbar/{ToolbarItem.jsx → ToolbarItem.tsx} +5 -21
- package/src/components/Toolbar/_helpers/{getAlignClassName.js → getAlignClassName.ts} +8 -1
- package/src/components/Toolbar/_helpers/{getJustifyClassName.js → getJustifyClassName.ts} +4 -1
- package/src/components/Toolbar/{index.js → index.ts} +7 -0
- package/src/components/_helpers/{getRootColorClassName.js → getRootColorClassName.ts} +7 -2
- package/src/components/_helpers/{getRootPriorityClassName.js → getRootPriorityClassName.ts} +7 -2
- package/src/components/_helpers/{getRootSizeClassName.js → getRootSizeClassName.ts} +7 -2
- package/src/components/_helpers/getRootStateClassName.ts +24 -0
- package/src/components/_helpers/resolveContextOrProp.ts +13 -0
- package/src/helpers/classNames/{classNames.js → classNames.ts} +2 -2
- package/src/helpers/isChildrenEmpty/isChildrenEmpty.ts +5 -0
- package/src/helpers/transferProps/transferProps.ts +50 -0
- package/src/helpers/transferProps/transferProps.types.ts +11 -0
- package/src/index.ts +211 -0
- package/src/providers/globalProps/GlobalProps.types.ts +30 -0
- package/src/providers/globalProps/GlobalPropsContext.ts +6 -0
- package/src/providers/globalProps/{GlobalPropsProvider.jsx → GlobalPropsProvider.tsx} +8 -15
- package/src/providers/globalProps/{index.js → index.ts} +4 -0
- package/src/providers/globalProps/withGlobalProps.tsx +36 -0
- package/src/providers/translations/Translations.types.ts +26 -0
- package/src/providers/translations/TranslationsContext.ts +7 -0
- package/src/providers/translations/{TranslationsProvider.jsx → TranslationsProvider.tsx} +8 -15
- package/src/providers/translations/{index.js → index.ts} +5 -0
- package/src/styles/settings/_form-fields.scss +2 -1
- package/src/styles/theme/_form-fields.scss +16 -11
- package/src/styles/theme-constants/_colors.scss +21 -0
- package/src/styles/tools/_accessibility.scss +2 -2
- package/src/styles/tools/form-fields/_box-field-layout.scss +5 -8
- package/src/styles/tools/form-fields/_inline-field-elements.scss +0 -7
- package/src/styles/tools/form-fields/_inline-field-layout.scss +0 -8
- package/src/styles/tools/form-fields/_variants.scss +7 -7
- package/src/theme.scss +37 -12
- package/src/translations/{en.js → en.ts} +3 -1
- package/src/types/breakpoints.ts +1 -0
- package/src/types/colors.ts +7 -0
- package/src/types/index.ts +13 -0
- package/src/types/labelPositions.ts +1 -0
- package/src/types/layouts.ts +1 -0
- package/src/types/modules.d.ts +16 -0
- package/src/types/priorities.ts +1 -0
- package/src/types/sizes.ts +1 -0
- package/src/types/states.ts +1 -0
- package/src/types/styles.ts +4 -0
- package/src/utils/mergeDeep.ts +34 -0
- package/src/utils/mergeDeep.types.ts +4 -0
- package/.claude/agents/code-reviewer.md +0 -122
- package/.claude/rules/code.md +0 -22
- package/.claude/rules/docs.md +0 -35
- package/.claude/rules/frontend.md +0 -72
- package/.claude/rules/git.md +0 -13
- package/.claude/rules/safety-guards.md +0 -9
- package/.claude/rules/styling.md +0 -32
- package/.claude/rules/testing.md +0 -59
- package/.claude/settings.json +0 -32
- package/.claude/skills/commit/SKILL.md +0 -54
- package/.devcontainer/devcontainer.json +0 -23
- package/.eslintrc-ts +0 -40
- package/.mcp.json +0 -8
- package/.nvmrc +0 -1
- package/CLAUDE.md +0 -82
- package/docker-compose.base.yml +0 -93
- package/docker-compose.yml.dist +0 -41
- package/jest.config-ts.js +0 -34
- package/opencode.json +0 -10
- package/playwright-ct.config.ts +0 -68
- package/scripts/auto-start-mkdocs.sh +0 -5
- package/scripts/auto-start-node.sh +0 -33
- package/scripts/mcps/chrome-host/README.md +0 -118
- package/scripts/mcps/chrome-host/cdp_proxy.py +0 -90
- package/scripts/mcps/chrome-host/mcp-entry.sh +0 -33
- package/scripts/mcps/chrome-host/mcp-launch.sh +0 -36
- package/scripts/mcps/chrome-host/mcp-setup.sh +0 -70
- package/scripts/mcps/chrome-host/start-host-chrome.sh +0 -267
- package/setup.sh +0 -107
- package/src/CNAME +0 -1
- package/src/components/Alert/index.js +0 -1
- package/src/components/Badge/Badge.jsx +0 -51
- package/src/components/Badge/index.js +0 -1
- package/src/components/Button/Button.jsx +0 -203
- package/src/components/Button/helpers/getRootPriorityClassName.js +0 -15
- package/src/components/Button/index.js +0 -1
- package/src/components/ButtonGroup/ButtonGroupContext.js +0 -3
- package/src/components/Card/Card.jsx +0 -67
- package/src/components/CheckboxField/CheckboxField.jsx +0 -144
- package/src/components/CheckboxField/index.js +0 -1
- package/src/components/FileInputField/index.js +0 -1
- package/src/components/FormLayout/FormLayoutContext.js +0 -3
- package/src/components/FormLayout/FormLayoutCustomFieldContext.js +0 -3
- package/src/components/FormLayout/index.js +0 -4
- package/src/components/Grid/Grid.jsx +0 -225
- package/src/components/Grid/GridSpan.jsx +0 -88
- package/src/components/Grid/_helpers/generateResponsiveCustomProperties.js +0 -22
- package/src/components/Grid/index.js +0 -2
- package/src/components/InputGroup/InputGroupContext.js +0 -3
- package/src/components/Modal/Modal.jsx +0 -262
- package/src/components/Modal/ModalBody.jsx +0 -60
- package/src/components/Modal/ModalFooter.jsx +0 -42
- package/src/components/Modal/ModalHeader.jsx +0 -42
- package/src/components/Modal/ModalTitle.jsx +0 -42
- package/src/components/Modal/_helpers/getPositionClassName.js +0 -7
- package/src/components/Modal/_helpers/getScrollingClassName.js +0 -11
- package/src/components/Paper/index.js +0 -1
- package/src/components/Popover/Popover.jsx +0 -124
- package/src/components/Popover/PopoverWrapper.jsx +0 -38
- package/src/components/Popover/index.js +0 -2
- package/src/components/Radio/Radio.jsx +0 -212
- package/src/components/Radio/index.js +0 -1
- package/src/components/ScrollView/_helpers/getElementsPositionDifference.js +0 -11
- package/src/components/ScrollView/index.js +0 -1
- package/src/components/SelectField/SelectField.jsx +0 -272
- package/src/components/SelectField/_components/Option/Option.jsx +0 -46
- package/src/components/SelectField/_components/Option/index.js +0 -1
- package/src/components/SelectField/index.js +0 -1
- package/src/components/Table/_components/TableBodyCell/TableBodyCell.jsx +0 -46
- package/src/components/Table/_components/TableBodyCell/index.js +0 -1
- package/src/components/Table/_components/TableHeaderCell/index.js +0 -1
- package/src/components/Table/index.js +0 -1
- package/src/components/Tabs/TabsItem.jsx +0 -91
- package/src/components/Tabs/index.js +0 -2
- package/src/components/Text/Text.jsx +0 -76
- package/src/components/Text/_helpers/getRootClampClassName.js +0 -11
- package/src/components/Text/_helpers/getRootHyphensClassName.js +0 -11
- package/src/components/Text/_helpers/getRootWordWrappingClassName.js +0 -11
- package/src/components/Text/index.js +0 -1
- package/src/components/TextArea/TextArea.jsx +0 -174
- package/src/components/TextArea/index.js +0 -1
- package/src/components/TextField/TextField.jsx +0 -208
- package/src/components/TextField/index.js +0 -1
- package/src/components/TextLink/index.js +0 -1
- package/src/components/Toggle/Toggle.jsx +0 -144
- package/src/components/Toggle/index.js +0 -1
- package/src/components/Toolbar/Toolbar.jsx +0 -76
- package/src/components/Toolbar/ToolbarGroup.jsx +0 -64
- package/src/components/_helpers/getRootValidationStateClassName.js +0 -15
- package/src/components/_helpers/resolveContextOrProp.js +0 -10
- package/src/helpers/isChildrenEmpty/isChildrenEmpty.js +0 -3
- package/src/helpers/transferProps/transferProps.js +0 -38
- package/src/index.js +0 -67
- package/src/providers/globalProps/GlobalPropsContext.jsx +0 -5
- package/src/providers/globalProps/withGlobalProps.jsx +0 -38
- package/src/providers/translations/TranslationsContext.jsx +0 -6
- package/src/utils/mergeDeep.js +0 -28
- package/tsconfig.json +0 -27
- /package/src/helpers/classNames/{index.js → index.ts} +0 -0
- /package/src/helpers/isChildrenEmpty/{index.js → index.ts} +0 -0
- /package/src/helpers/transferProps/{index.js → index.ts} +0 -0
package/.claude/rules/styling.md
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
paths:
|
|
3
|
-
- "src/**/*.scss"
|
|
4
|
-
- "src/**/*.css"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Styling
|
|
8
|
-
|
|
9
|
-
## Commands
|
|
10
|
-
|
|
11
|
-
Run `npm run stylelint` after changes (add `-- --fix` to autofix).
|
|
12
|
-
|
|
13
|
-
## Styling
|
|
14
|
-
|
|
15
|
-
Styles use SCSS with CSS Modules (`.module.scss`) with camelCase class names. A
|
|
16
|
-
component's styles live next to it as `Foo.module.scss` and are imported as a
|
|
17
|
-
module.
|
|
18
|
-
|
|
19
|
-
Class naming convention:
|
|
20
|
-
|
|
21
|
-
* `root` for the root element.
|
|
22
|
-
* Modifiers follow `isRootXxx` (state), `hasRootXxx` (has feature),
|
|
23
|
-
`isRootInXxx` (context), `isRootLayoutXxx` (layout variant).
|
|
24
|
-
|
|
25
|
-
`src/styles/` contains the global theming system: settings (variables), tools
|
|
26
|
-
(mixins), and a large set of CSS custom properties for theming. Component SCSS
|
|
27
|
-
files `@use` their own `_settings`, `_theme`, `_tools` partials plus the shared
|
|
28
|
-
styles from `src/styles/`. Theme tokens are exposed as CSS custom properties.
|
|
29
|
-
|
|
30
|
-
## Reference
|
|
31
|
-
|
|
32
|
-
* [CSS Guidelines](../../src/docs/contribute/css.md)
|
package/.claude/rules/testing.md
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
paths:
|
|
3
|
-
- "**/*.spec.tsx"
|
|
4
|
-
- "**/*.story.tsx"
|
|
5
|
-
- "**/__tests__/**"
|
|
6
|
-
- "tests/**"
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Testing
|
|
10
|
-
|
|
11
|
-
## Commands
|
|
12
|
-
|
|
13
|
-
* Run all Jest unit tests with `npm run test:jest` (TS + JS). For a single file:
|
|
14
|
-
`npm run test:jest:ts -- <file>` or `npm run test:jest:js -- <file>`.
|
|
15
|
-
* Run all Playwright component tests with `npm run test:playwright-ct:all`; for
|
|
16
|
-
one component, `npm run test:playwright-ct:all -- -- src/components/Button`.
|
|
17
|
-
* Update Playwright snapshots with `npm run test:playwright-ct:all-with-update`.
|
|
18
|
-
* Serve the report with `npm run test:playwright-ct:show-report`.
|
|
19
|
-
|
|
20
|
-
## Testing
|
|
21
|
-
|
|
22
|
-
Create/update tests for added or changed components and helpers, and remove
|
|
23
|
-
obsolete tests when functionality is removed. Never leave a component or helper
|
|
24
|
-
without tests. When fixing a bug, add a test that fails before the fix and
|
|
25
|
-
passes after it.
|
|
26
|
-
|
|
27
|
-
### Organization
|
|
28
|
-
|
|
29
|
-
Jest unit/component tests are co-located in a component's `__tests__/` folder.
|
|
30
|
-
|
|
31
|
-
### Playwright component tests
|
|
32
|
-
|
|
33
|
-
`.spec.tsx` specs use a table-driven pattern:
|
|
34
|
-
|
|
35
|
-
* Import arrays of test cases from `_propTests/` directories and from shared
|
|
36
|
-
`tests/playwright/propTests/`.
|
|
37
|
-
* Each test case is `{ name, props, onBeforeTest?, onBeforeSnapshot? }`; custom
|
|
38
|
-
field tests add `customFieldLayoutProps`, `customFieldProps`, etc.
|
|
39
|
-
* `mixPropTests([...arrays])` generates the cartesian product of multiple prop
|
|
40
|
-
arrays.
|
|
41
|
-
* `propTests` from `tests/playwright/` provides standard reusable test sets
|
|
42
|
-
(e.g. `layoutPropTest`, `sizePropTest`, `disabledPropTest`).
|
|
43
|
-
* Snapshot images are stored alongside the spec file in
|
|
44
|
-
`<ComponentName>.spec.tsx-snapshots/`.
|
|
45
|
-
|
|
46
|
-
**Story components** (`.story.tsx`) wrap the real component in a minimal fixture
|
|
47
|
-
(sometimes inside a context provider) and are imported only by `.spec.tsx`
|
|
48
|
-
files. Naming convention: `<ComponentName>ForTest`, `<ComponentName>ForRefTest`,
|
|
49
|
-
`<ComponentName>ForFormLayoutTests` — the FormLayout story component is always
|
|
50
|
-
last.
|
|
51
|
-
|
|
52
|
-
**Test describe structure:** `test.describe('ComponentName')` →
|
|
53
|
-
`test.describe('base')` (if present) → `visual` / `non-visual` /
|
|
54
|
-
`functionality`; the `formLayout` describe is always the last block at the same
|
|
55
|
-
level as `base`.
|
|
56
|
-
|
|
57
|
-
## Reference
|
|
58
|
-
|
|
59
|
-
* [Testing Guidelines](../../src/docs/contribute/testing-guidelines.md)
|
package/.claude/settings.json
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
3
|
-
"permissions": {
|
|
4
|
-
"allow": [
|
|
5
|
-
"Bash(git diff:*)",
|
|
6
|
-
"Bash(git log:*)",
|
|
7
|
-
"Bash(git rev-parse:*)",
|
|
8
|
-
"Bash(git show:*)",
|
|
9
|
-
"Bash(git status:*)",
|
|
10
|
-
"Bash(npm audit)",
|
|
11
|
-
"Bash(npm audit signatures)",
|
|
12
|
-
"Bash(npm ci)",
|
|
13
|
-
"Bash(npm run build:*)",
|
|
14
|
-
"Bash(npm run lint)",
|
|
15
|
-
"Bash(npm run eslint:*)",
|
|
16
|
-
"Bash(npm run stylelint:*)",
|
|
17
|
-
"Bash(npm run markdownlint:*)",
|
|
18
|
-
"Bash(npm start)",
|
|
19
|
-
"Bash(npm run start:*)",
|
|
20
|
-
"Bash(npm test)",
|
|
21
|
-
"Bash(npm run test:jest:*)",
|
|
22
|
-
"Bash(npm run test:playwright-ct:*)"
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
"enabledMcpjsonServers": [
|
|
26
|
-
"chrome-host"
|
|
27
|
-
],
|
|
28
|
-
"enabledPlugins": {
|
|
29
|
-
"github@claude-plugins-official": true,
|
|
30
|
-
"context7@claude-plugins-official": true
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Draft a commit message and commit staged changes, following the project git conventions
|
|
3
|
-
allowed-tools: Bash(git status), Bash(git diff:*), Bash(git log:*), Bash(git blame:*), Bash(git merge-base:*), Bash(git rev-parse:*), Bash(git add:*), Bash(git commit:*)
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Commit
|
|
7
|
-
|
|
8
|
-
Draft a commit message and commit the staged changes, following the project's
|
|
9
|
-
git conventions.
|
|
10
|
-
|
|
11
|
-
## When to use
|
|
12
|
-
|
|
13
|
-
* You invoke this to commit staged work. User-only — never auto-invoked.
|
|
14
|
-
|
|
15
|
-
## Context
|
|
16
|
-
|
|
17
|
-
Status:
|
|
18
|
-
|
|
19
|
-
!`git status`
|
|
20
|
-
|
|
21
|
-
Staged diff:
|
|
22
|
-
|
|
23
|
-
!`git diff --staged`
|
|
24
|
-
|
|
25
|
-
Branch:
|
|
26
|
-
|
|
27
|
-
!`git rev-parse --abbrev-ref HEAD`
|
|
28
|
-
|
|
29
|
-
Branch commits since `master`:
|
|
30
|
-
|
|
31
|
-
!`git log master..HEAD --oneline 2>/dev/null | head -20`
|
|
32
|
-
|
|
33
|
-
## Steps
|
|
34
|
-
|
|
35
|
-
Each commit must be atomic and never leave the app broken.
|
|
36
|
-
|
|
37
|
-
If nothing is staged, stop and tell the user.
|
|
38
|
-
|
|
39
|
-
Before committing, check the following (see [Commands](../../../CLAUDE.md#commands)):
|
|
40
|
-
|
|
41
|
-
* `npm run build` passes
|
|
42
|
-
* `mkdocs build` passes
|
|
43
|
-
* `npm run lint` passes
|
|
44
|
-
* `npm run test:jest` passes
|
|
45
|
-
* `npm run test:playwright-ct:all` passes
|
|
46
|
-
|
|
47
|
-
Write a commit message for the staged changes following the project's git
|
|
48
|
-
conventions ([General Guidelines › Git Workflow](../../../src/docs/contribute/general-guidelines.md#git-workflow)):
|
|
49
|
-
|
|
50
|
-
Do not append `Co-Authored-By`.
|
|
51
|
-
|
|
52
|
-
## Reference
|
|
53
|
-
|
|
54
|
-
* [General Guidelines › Git Workflow](../../../src/docs/contribute/general-guidelines.md#git-workflow)
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "React UI (${localWorkspaceFolderBasename})",
|
|
3
|
-
"initializeCommand": "bash ./setup.sh",
|
|
4
|
-
"dockerComposeFile": [
|
|
5
|
-
"../docker-compose.yml"
|
|
6
|
-
],
|
|
7
|
-
"service": "devcontainer",
|
|
8
|
-
"shutdownAction": "stopCompose",
|
|
9
|
-
"workspaceFolder": "/workspace",
|
|
10
|
-
"forwardPorts": [
|
|
11
|
-
"docs:8000"
|
|
12
|
-
],
|
|
13
|
-
"portsAttributes": {
|
|
14
|
-
"docs:8000": {
|
|
15
|
-
"label": "Docs server",
|
|
16
|
-
"protocol": "http",
|
|
17
|
-
"onAutoForward": "openBrowser"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"otherPortsAttributes": {
|
|
21
|
-
"onAutoForward": "ignore"
|
|
22
|
-
}
|
|
23
|
-
}
|
package/.eslintrc-ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": [
|
|
3
|
-
"@visionappscz/eslint-config-visionapps",
|
|
4
|
-
"airbnb-typescript",
|
|
5
|
-
"plugin:@typescript-eslint/recommended",
|
|
6
|
-
"plugin:@typescript-eslint/recommended-type-checked",
|
|
7
|
-
"plugin:deprecation/recommended",
|
|
8
|
-
"plugin:typescript-sort-keys/recommended",
|
|
9
|
-
],
|
|
10
|
-
"env": {
|
|
11
|
-
"browser": true,
|
|
12
|
-
"jest": true
|
|
13
|
-
},
|
|
14
|
-
"overrides": [
|
|
15
|
-
{
|
|
16
|
-
"files": [
|
|
17
|
-
"*.spec.tsx",
|
|
18
|
-
"*.story.tsx",
|
|
19
|
-
],
|
|
20
|
-
"rules": {
|
|
21
|
-
"@typescript-eslint/unbound-method": "off"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
"parser": "@typescript-eslint/parser",
|
|
26
|
-
"parserOptions": {
|
|
27
|
-
"projectService": true,
|
|
28
|
-
"project": "./tsconfig.json"
|
|
29
|
-
},
|
|
30
|
-
"plugins": [
|
|
31
|
-
"@typescript-eslint"
|
|
32
|
-
],
|
|
33
|
-
"rules": {
|
|
34
|
-
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
35
|
-
"@typescript-eslint/consistent-type-exports": ["error"],
|
|
36
|
-
"@typescript-eslint/consistent-type-imports": ["error"],
|
|
37
|
-
"import/prefer-default-export": "off",
|
|
38
|
-
"no-console": ["error"]
|
|
39
|
-
}
|
|
40
|
-
}
|
package/.mcp.json
DELETED
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
24
|
package/CLAUDE.md
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
2
|
-
|
|
3
|
-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository
|
|
4
|
-
|
|
5
|
-
## Environment
|
|
6
|
-
|
|
7
|
-
This project is developed inside a Docker container called `devcontainer`.
|
|
8
|
-
The commands below assume you are running inside the `devcontainer`.
|
|
9
|
-
|
|
10
|
-
From the host, run them inside it with
|
|
11
|
-
`docker compose exec -T devcontainer <command>` (start it first with
|
|
12
|
-
`docker compose up -d`). The other service containers (`node`, `playwright`,
|
|
13
|
-
`docs`) are implementation details — do not call them directly.
|
|
14
|
-
|
|
15
|
-
If file `/.dockerenv` is present, you are in a Docker container.
|
|
16
|
-
|
|
17
|
-
For details, see the
|
|
18
|
-
[Contributing Guide](src/docs/contribute/general-guidelines.md#development-environment).
|
|
19
|
-
|
|
20
|
-
## Commands
|
|
21
|
-
|
|
22
|
-
Run these inside the `devcontainer` (from the host, prefix with
|
|
23
|
-
`docker compose exec -T devcontainer`). For details, see the
|
|
24
|
-
[Contributing Guide](src/docs/contribute/general-guidelines.md).
|
|
25
|
-
|
|
26
|
-
| Task | Command |
|
|
27
|
-
|-----------------------------------|---------------------------------------------------------------------|
|
|
28
|
-
| Install JS | `npm ci` |
|
|
29
|
-
| Build library | `npm run build` |
|
|
30
|
-
| Run static checks | `npm run lint` |
|
|
31
|
-
| Run unit tests | `npm run test:jest` |
|
|
32
|
-
| Run a single unit test file | `npm run test:jest:ts -- <file>` / `npm run test:jest:js -- <file>` |
|
|
33
|
-
| Run component tests | `npm run test:playwright-ct:all` |
|
|
34
|
-
| Component tests for one component | `npm run test:playwright-ct:all -- -- src/components/Button` |
|
|
35
|
-
| Update component snapshots | `npm run test:playwright-ct:all-with-update` |
|
|
36
|
-
| Start build watcher | `npm start` |
|
|
37
|
-
| Build documentation | `mkdocs build` |
|
|
38
|
-
| Serve documentation | `mkdocs serve` |
|
|
39
|
-
|
|
40
|
-
Notes:
|
|
41
|
-
|
|
42
|
-
* Commands like `npm`, `playwright` run in specific Docker containers.
|
|
43
|
-
Normally, when you run those commands, they are executed within dedicated
|
|
44
|
-
containers. If you need to communicate directly with specific Docker container,
|
|
45
|
-
use `sudo docker compose ...`. It can be useful when stopping server that is
|
|
46
|
-
running within `node` container even though it is started from `devcontainer`.
|
|
47
|
-
* See the `scripts` section in `package.json` for the full list of commands.
|
|
48
|
-
|
|
49
|
-
## Topics (Claude Rules)
|
|
50
|
-
|
|
51
|
-
Project rules live in [.claude/rules/](.claude/rules/). There are two kinds.
|
|
52
|
-
|
|
53
|
-
**Always-on** (no frontmatter) — apply to every change:
|
|
54
|
-
|
|
55
|
-
* [code.md](.claude/rules/code.md) — scope discipline, minimal changes.
|
|
56
|
-
* [git.md](.claude/rules/git.md) — branches, commits, PRs.
|
|
57
|
-
* [safety-guards.md](.claude/rules/safety-guards.md) — hard guard rails.
|
|
58
|
-
|
|
59
|
-
**Path-scoped** — each carries a `paths:` glob declaring the files it governs;
|
|
60
|
-
consult it when touching those files:
|
|
61
|
-
|
|
62
|
-
* [frontend.md](.claude/rules/frontend.md) — `src/**/*.js`, `src/**/*.jsx`:
|
|
63
|
-
stack, component structure, implementation pattern.
|
|
64
|
-
* [styling.md](.claude/rules/styling.md) — `src/**/*.scss`, `src/**/*.css`:
|
|
65
|
-
CSS Modules, class naming, theming.
|
|
66
|
-
* [testing.md](.claude/rules/testing.md) — `*.spec.tsx`, `*.story.tsx`,
|
|
67
|
-
`__tests__/**`, `tests/**`: Jest and table-driven Playwright tests.
|
|
68
|
-
* [docs.md](.claude/rules/docs.md) — `src/docs/**`, component `README.md`.
|
|
69
|
-
|
|
70
|
-
## Agents (Claude Agents)
|
|
71
|
-
|
|
72
|
-
Specialized agents live in [.claude/agents/](.claude/agents/).
|
|
73
|
-
|
|
74
|
-
* `code-reviewer` — review a change against this repo's rules (uncommitted work,
|
|
75
|
-
or a whole branch vs its base).
|
|
76
|
-
|
|
77
|
-
## AI Integration
|
|
78
|
-
|
|
79
|
-
MCP-capable assistants in the `devcontainer` can drive host Chrome to verify the
|
|
80
|
-
docs site and rendered components. See
|
|
81
|
-
[AI Integration](src/docs/contribute/ai-integration.md) and
|
|
82
|
-
[scripts/mcps/chrome-host/README.md](scripts/mcps/chrome-host/README.md).
|
package/docker-compose.base.yml
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
services:
|
|
2
|
-
# This service is responsible for providing the main development environment for developers
|
|
3
|
-
devcontainer:
|
|
4
|
-
hostname: ${COMPOSE_PROJECT_NAME:-react-ui}_devcontainer
|
|
5
|
-
build:
|
|
6
|
-
context: docker/react_ui_devcontainer/
|
|
7
|
-
dockerfile: Dockerfile
|
|
8
|
-
# Start dependent services before starting the `devcontainer` service to ensure that the necessary environments
|
|
9
|
-
# and tools are available when the `devcontainer` starts.
|
|
10
|
-
depends_on:
|
|
11
|
-
node:
|
|
12
|
-
condition: service_started
|
|
13
|
-
playwright:
|
|
14
|
-
condition: service_started
|
|
15
|
-
docs:
|
|
16
|
-
condition: service_started
|
|
17
|
-
# Run as host UID/GID so files created in mounted volumes are owned correctly on the host.
|
|
18
|
-
# The images use `fixuid` (https://github.com/boxboat/fixuid) to remap the built-in `developer`
|
|
19
|
-
# user to these IDs at startup — the `user:` directive is required for that remap to work.
|
|
20
|
-
# Applied to all services below for the same reason.
|
|
21
|
-
user: ${COMPOSE_UID}:${COMPOSE_GID}
|
|
22
|
-
# Keep the container running indefinitely to allow developers to attach to it and use it as their development environment
|
|
23
|
-
command: sleep infinity
|
|
24
|
-
# Injects environment variables from the `.env` file into the `devcontainer` service,
|
|
25
|
-
# making them accessible within the container's environment.
|
|
26
|
-
env_file:
|
|
27
|
-
- .env
|
|
28
|
-
environment:
|
|
29
|
-
# This must be set correctly for the `devcontainer` to be able to access the host's Docker daemon,
|
|
30
|
-
# enabling Docker-from-Docker capabilities (e.g., running Docker commands from within the `devcontainer`).
|
|
31
|
-
COMPOSE_PROJECT_NAME: ${COMPOSE_PROJECT_NAME:-react-ui}
|
|
32
|
-
init: true
|
|
33
|
-
volumes:
|
|
34
|
-
- .:/workspace:z
|
|
35
|
-
# The following volume is used to allow the `devcontainer` to access the host's Docker daemon,
|
|
36
|
-
# enabling Docker-from-Docker capabilities (e.g., running Docker commands from within the `devcontainer`).
|
|
37
|
-
- /var/run/docker.sock:/var/run/docker.sock
|
|
38
|
-
# The following named volumes persist data (e.g. terminal history, AI tools data, etc.) across container restarts.
|
|
39
|
-
# Using separate named volumes (instead of a single volume with subpaths) allows Docker to automatically
|
|
40
|
-
# seed the volume with data from the image on first use.
|
|
41
|
-
- terminal-history:/home/developer/.terminal_history
|
|
42
|
-
- claude-config:/home/developer/.config/claude
|
|
43
|
-
- claude-state:/home/developer/.local/state/claude
|
|
44
|
-
- copilot:/home/developer/.copilot
|
|
45
|
-
- copilot-config:/home/developer/.config/copilot
|
|
46
|
-
- opencode-config:/home/developer/.config/opencode
|
|
47
|
-
- opencode-share:/home/developer/.local/share/opencode
|
|
48
|
-
- opencode-state:/home/developer/.local/state/opencode
|
|
49
|
-
|
|
50
|
-
# This service provides Node environment and NPM
|
|
51
|
-
node:
|
|
52
|
-
build: docker/node
|
|
53
|
-
user: ${COMPOSE_UID}:${COMPOSE_GID}
|
|
54
|
-
entrypoint: sh -c 'if [ "$$COMPOSE_AUTOSTART" = "true" ]; then sh scripts/auto-start-node.sh; else sleep infinity; fi'
|
|
55
|
-
env_file:
|
|
56
|
-
- .env
|
|
57
|
-
volumes:
|
|
58
|
-
- .:/workspace:z
|
|
59
|
-
|
|
60
|
-
# This service provides Playwright environment and tools for browser automation and testing
|
|
61
|
-
playwright:
|
|
62
|
-
build: docker/playwright
|
|
63
|
-
user: ${COMPOSE_UID}:${COMPOSE_GID}
|
|
64
|
-
command: sleep infinity
|
|
65
|
-
env_file:
|
|
66
|
-
- .env
|
|
67
|
-
ports:
|
|
68
|
-
- ${COMPOSE_PLAYWRIGHT_REPORT_PORT}:9323
|
|
69
|
-
volumes:
|
|
70
|
-
- .:/workspace:z
|
|
71
|
-
|
|
72
|
-
# This provides server for documentation
|
|
73
|
-
docs:
|
|
74
|
-
build: docker/mkdocs
|
|
75
|
-
user: ${COMPOSE_UID}:${COMPOSE_GID}
|
|
76
|
-
entrypoint: sh -c 'if [ "$$COMPOSE_AUTOSTART" = "true" ]; then sh scripts/auto-start-mkdocs.sh; else sleep infinity; fi'
|
|
77
|
-
env_file:
|
|
78
|
-
- .env
|
|
79
|
-
ports:
|
|
80
|
-
- ${COMPOSE_DOCS_SERVER_PORT}:8000
|
|
81
|
-
volumes:
|
|
82
|
-
- .:/workspace:z
|
|
83
|
-
|
|
84
|
-
volumes:
|
|
85
|
-
# The following volumes are used to persist data (e.g. terminal history, AI tools data, etc.) across container restarts
|
|
86
|
-
terminal-history:
|
|
87
|
-
claude-config:
|
|
88
|
-
claude-state:
|
|
89
|
-
copilot:
|
|
90
|
-
copilot-config:
|
|
91
|
-
opencode-config:
|
|
92
|
-
opencode-share:
|
|
93
|
-
opencode-state:
|
package/docker-compose.yml.dist
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
services:
|
|
2
|
-
# This service is responsible for providing the main development environment for developers
|
|
3
|
-
devcontainer:
|
|
4
|
-
extends:
|
|
5
|
-
file: docker-compose.base.yml
|
|
6
|
-
service: devcontainer
|
|
7
|
-
# Use `build` when you want to customize the devcontainer using `docker/react_ui_devcontainer_local/Dockerfile`
|
|
8
|
-
# build:
|
|
9
|
-
# context: ./docker/react_ui_devcontainer_local/
|
|
10
|
-
# dockerfile: Dockerfile
|
|
11
|
-
# Use `image` when you want to use the default devcontainer
|
|
12
|
-
image: react-ui_devcontainer
|
|
13
|
-
|
|
14
|
-
# This service provides Node environment and NPM
|
|
15
|
-
node:
|
|
16
|
-
extends:
|
|
17
|
-
file: docker-compose.base.yml
|
|
18
|
-
service: node
|
|
19
|
-
|
|
20
|
-
# This service provides Playwright environment and tools for browser automation and testing
|
|
21
|
-
playwright:
|
|
22
|
-
extends:
|
|
23
|
-
file: docker-compose.base.yml
|
|
24
|
-
service: playwright
|
|
25
|
-
|
|
26
|
-
# This provides server for documentation
|
|
27
|
-
docs:
|
|
28
|
-
extends:
|
|
29
|
-
file: docker-compose.base.yml
|
|
30
|
-
service: docs
|
|
31
|
-
|
|
32
|
-
volumes:
|
|
33
|
-
# The following volumes are used to persist data (e.g. terminal history, AI tools data, etc.) across container restarts
|
|
34
|
-
terminal-history:
|
|
35
|
-
claude-config:
|
|
36
|
-
claude-state:
|
|
37
|
-
copilot:
|
|
38
|
-
copilot-config:
|
|
39
|
-
opencode-config:
|
|
40
|
-
opencode-share:
|
|
41
|
-
opencode-state:
|
package/jest.config-ts.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
module.exports = {
|
|
3
|
-
extensionsToTreatAsEsm: [
|
|
4
|
-
'.ts',
|
|
5
|
-
'.tsx',
|
|
6
|
-
],
|
|
7
|
-
moduleFileExtensions: [
|
|
8
|
-
'js',
|
|
9
|
-
'jsx',
|
|
10
|
-
'ts',
|
|
11
|
-
'tsx',
|
|
12
|
-
],
|
|
13
|
-
moduleNameMapper: {
|
|
14
|
-
'\\.scss$': 'identity-obj-proxy',
|
|
15
|
-
'\\.svg$': '<rootDir>/tests/jest/mocks/svgrMock.jsx',
|
|
16
|
-
},
|
|
17
|
-
preset: 'ts-jest',
|
|
18
|
-
setupFiles: [
|
|
19
|
-
'<rootDir>/tests/jest/setupJest.js',
|
|
20
|
-
],
|
|
21
|
-
setupFilesAfterEnv: [
|
|
22
|
-
],
|
|
23
|
-
testEnvironment: '@happy-dom/jest-environment',
|
|
24
|
-
testMatch: [
|
|
25
|
-
'**/*.test.{ts,tsx}',
|
|
26
|
-
],
|
|
27
|
-
transform: {
|
|
28
|
-
'^.+\\.(ts|tsx)$': [
|
|
29
|
-
'ts-jest',
|
|
30
|
-
{ useESM: true },
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
verbose: true,
|
|
34
|
-
};
|
package/opencode.json
DELETED
package/playwright-ct.config.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineConfig,
|
|
3
|
-
devices,
|
|
4
|
-
} from '@playwright/experimental-ct-react';
|
|
5
|
-
import { parseEnvironment } from './tests/playwright/env/parseEnvironment';
|
|
6
|
-
|
|
7
|
-
const environment = parseEnvironment();
|
|
8
|
-
|
|
9
|
-
const isCI = !!process.env.CI;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @see https://playwright.dev/docs/test-configuration
|
|
13
|
-
*/
|
|
14
|
-
module.exports = defineConfig({
|
|
15
|
-
// Fail the build on CI if you accidentally left test.only in the source code
|
|
16
|
-
forbidOnly: isCI,
|
|
17
|
-
// Run tests in files in parallel
|
|
18
|
-
fullyParallel: true,
|
|
19
|
-
// Directory where the output generated by Playwright is stored
|
|
20
|
-
outputDir: './tests/playwright/.temp/playwright-ct-output/',
|
|
21
|
-
// Run tests for following projects
|
|
22
|
-
projects: [
|
|
23
|
-
{
|
|
24
|
-
name: 'chromium',
|
|
25
|
-
use: { ...devices['Desktop Chrome'] },
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
|
29
|
-
reporter: 'html',
|
|
30
|
-
// Retry failed tests once to eliminate flakiness
|
|
31
|
-
retries: 1,
|
|
32
|
-
// Directory where the snapshots are located
|
|
33
|
-
// (must be same as testDir to save snapshots in place where tests are located)
|
|
34
|
-
snapshotDir: './src/',
|
|
35
|
-
// Directory where the tests are located
|
|
36
|
-
testDir: './src/',
|
|
37
|
-
// Pattern to search for test files
|
|
38
|
-
testMatch: '*/*.spec.{ts,tsx}',
|
|
39
|
-
// Timeout for each test
|
|
40
|
-
timeout: 10 * 1000,
|
|
41
|
-
// Do not update snapshots automatically
|
|
42
|
-
updateSnapshots: 'none',
|
|
43
|
-
// Configuration for Playwright component testing
|
|
44
|
-
use: {
|
|
45
|
-
// Directory where the cache is stored
|
|
46
|
-
ctCacheDir: './tests/playwright/.temp/playwright-ct-cache',
|
|
47
|
-
// Port to use for Playwright component endpoint
|
|
48
|
-
ctPort: environment.CT_PORT,
|
|
49
|
-
// Directory where the templates are stored
|
|
50
|
-
ctTemplateDir: './tests/playwright/templates',
|
|
51
|
-
// Launch options for Playwright
|
|
52
|
-
launchOptions: {
|
|
53
|
-
args: [
|
|
54
|
-
'--use-gl=egl',
|
|
55
|
-
// # Must be set to `new` to enable new version of Chromium Headless to obtain correct snapshots
|
|
56
|
-
'--headless=new',
|
|
57
|
-
],
|
|
58
|
-
ignoreDefaultArgs: [
|
|
59
|
-
// # Must be ignored to enable new version of Chromium Headless to obtain correct snapshots
|
|
60
|
-
'--headless',
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
// Collect trace on all retries
|
|
64
|
-
trace: 'on-all-retries',
|
|
65
|
-
},
|
|
66
|
-
// Number of workers to use
|
|
67
|
-
workers: environment.WORKERS,
|
|
68
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
set -e
|
|
4
|
-
|
|
5
|
-
# File to read the hash of the package-lock.json
|
|
6
|
-
LOCK_HASH_FILE="node_modules/.package-lock-hash"
|
|
7
|
-
|
|
8
|
-
# Parent directory of the script
|
|
9
|
-
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
|
10
|
-
|
|
11
|
-
# Change to the parent directory of the script
|
|
12
|
-
cd "$SCRIPT_DIR/.."
|
|
13
|
-
|
|
14
|
-
# Install dependencies if node_modules is missing or out of date
|
|
15
|
-
CURRENT_HASH=$(sha256sum package-lock.json | awk '{print $1}')
|
|
16
|
-
if [ ! -d "node_modules" ]; then
|
|
17
|
-
echo "Installing dependencies (node_modules directory is missing)..."
|
|
18
|
-
npm ci
|
|
19
|
-
elif [ ! -f "$LOCK_HASH_FILE" ]; then
|
|
20
|
-
echo "Installing dependencies (lockfile of package-lock.json is missing)..."
|
|
21
|
-
npm ci
|
|
22
|
-
elif [ "$(cat "$LOCK_HASH_FILE")" != "$CURRENT_HASH" ]; then
|
|
23
|
-
echo "Installing dependencies (package-lock.json has changed)..."
|
|
24
|
-
npm ci
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
# Build the application (must be run prior to starting the server to ensure the latest code is used)
|
|
28
|
-
echo "Building the application..."
|
|
29
|
-
npm run build
|
|
30
|
-
|
|
31
|
-
# Start the application
|
|
32
|
-
echo "Starting the application..."
|
|
33
|
-
npm start
|