rbin-task-flow 1.10.0 → 1.12.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.
|
@@ -376,6 +376,14 @@ Each component has a single responsibility. Components:
|
|
|
376
376
|
- Follow the **page prefix** naming above when they are page-specific (inside a feature)
|
|
377
377
|
- Stay small and focused; child components stay in the same `components/` folder with the inherited prefix in the name
|
|
378
378
|
|
|
379
|
+
### Base components — no raw usage (Front web & Mobile)
|
|
380
|
+
|
|
381
|
+
Do **not** use raw `<button>`, `<input>`, or other base HTML/primitive elements scattered in the code. If a screen uses a button or an input, there must be a **reusable component** for it (in `shared/components/` or, when feature-specific, in the feature’s `components/`). This applies to all base-level UI: buttons, inputs, selects, checkboxes, textareas, links, etc.
|
|
382
|
+
|
|
383
|
+
- **Shared**: Use `shared/components/` for app-wide primitives (e.g. `button.tsx`, `input-text.tsx`, `input-select.tsx`). Pages and feature components import and use these.
|
|
384
|
+
- **Feature-specific**: If the variant is only used in one feature, create it in `features/[feature]/components/` and reuse it inside that feature; do not repeat the same JSX in multiple files.
|
|
385
|
+
- **Never**: Inline `<button>`, `<input type="text">`, etc. in a page or component without going through a defined component. Every button/input on a screen must come from a named, reusable component.
|
|
386
|
+
|
|
379
387
|
---
|
|
380
388
|
|
|
381
389
|
## shared/ — Global Reusable Code
|
|
@@ -797,6 +805,37 @@ export const useAuth = () => useContext(AuthContext)
|
|
|
797
805
|
- Test files: `[feature].spec.ts` (Playwright) or `[feature].cy.ts` (Cypress)
|
|
798
806
|
- Cover critical user flows: auth, main feature interactions, form submissions
|
|
799
807
|
|
|
808
|
+
### Playwright — single root folder (e2e/)
|
|
809
|
+
|
|
810
|
+
Do **not** create `playwright-report/` or `test-results/` at project root. Use **only** `e2e/` at root; put all Playwright outputs inside it:
|
|
811
|
+
|
|
812
|
+
- **`e2e/`** — tests, helpers, and outputs (single folder at root)
|
|
813
|
+
- **`e2e/.results/`** — test artifacts (traces, screenshots; replaces default `test-results/`)
|
|
814
|
+
- **`e2e/.report/`** — HTML report (replaces default `playwright-report/`)
|
|
815
|
+
|
|
816
|
+
**playwright.config.ts:**
|
|
817
|
+
|
|
818
|
+
```typescript
|
|
819
|
+
import { defineConfig } from '@playwright/test'
|
|
820
|
+
|
|
821
|
+
export default defineConfig({
|
|
822
|
+
testDir: './e2e',
|
|
823
|
+
outputDir: './e2e/.results',
|
|
824
|
+
fullyParallel: true,
|
|
825
|
+
forbidOnly: !!process.env.CI,
|
|
826
|
+
retries: process.env.CI ? 2 : 0,
|
|
827
|
+
workers: process.env.CI ? 1 : undefined,
|
|
828
|
+
reporter: [['html', { outputFolder: './e2e/.report' }]],
|
|
829
|
+
use: {
|
|
830
|
+
baseURL: 'http://localhost:3000',
|
|
831
|
+
trace: 'on-first-retry',
|
|
832
|
+
// ...
|
|
833
|
+
},
|
|
834
|
+
})
|
|
835
|
+
```
|
|
836
|
+
|
|
837
|
+
**.gitignore:** add `e2e/.results/` and `e2e/.report/` so outputs stay untracked. The leading `.` keeps the folders collapsed in the editor.
|
|
838
|
+
|
|
800
839
|
### Mobile (Expo / React Native)
|
|
801
840
|
- **E2E**: Detox
|
|
802
841
|
- Tests live in `e2e/` at project root
|
|
@@ -819,3 +858,4 @@ export const useAuth = () => useContext(AuthContext)
|
|
|
819
858
|
10. **Naming reflects role**: File name + suffix must make the file's purpose immediately obvious.
|
|
820
859
|
11. **No barrel files for re-exports**: Do not use `index.ts` (or `index.tsx`) only to re-export other modules. Import directly from the source file (e.g. `from '@/shared/components/button'` not `from '@/shared/components'`). An `index.ts` is only allowed when it contains real logic or composition, not mere re-exports.
|
|
821
860
|
12. **Page-specific components use page prefix**: In features, the page file is `[page-name].page.tsx`; components specific to that page use the same prefix in file and function name (e.g. `admin-question-card.tsx` → `AdminQuestionCard`). Child components stay in the same `components/` folder and inherit the parent prefix (e.g. `admin-question-card-item.tsx` → `AdminQuestionCardItem`). App route exports `AdminQuestion`, feature page exports `AdminQuestionPage`.
|
|
861
|
+
13. **No raw base UI in screens**: Buttons, inputs, selects, and other base elements must not be used in isolation in the code. Create and reuse a component (in `shared/components/` or in the feature’s `components/`) for each usage; no inline `<button>` or `<input>` without a dedicated component.
|