Skip to content

Commit 7588430

Browse files
committed
feat: add monorepo structure diagram and update documentation
1 parent 7c423a2 commit 7588430

File tree

10 files changed

+1253
-19
lines changed

10 files changed

+1253
-19
lines changed

.github/CONTRIBUTING.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,128 @@ Thank you for your interest in contributing to ESLint React! This guide will hel
5454

5555
- `apps/website`: Documentation website
5656
- `apps/playground`: Interactive playground (WIP)
57+
58+
## Repository Structure Diagram
59+
60+
```mermaid
61+
flowchart TB
62+
%% Monorepo
63+
subgraph "Monorepo"
64+
%% Apps Subgraph
65+
subgraph "Apps"
66+
Website["Website"]:::apps
67+
Playground["Playground"]:::apps
68+
end
69+
70+
%% Packages Subgraph
71+
subgraph "Packages"
72+
Core["Core Functionality"]:::packages
73+
Shared["Shared Utilities"]:::packages
74+
75+
%% Utilities Subgraph
76+
subgraph "Utilities Modules"
77+
AST["AST Module"]:::utilities
78+
Eff["Eff Module"]:::utilities
79+
JSX["JSX Module"]:::utilities
80+
Kit["Kit Module"]:::utilities
81+
Var["Var Module"]:::utilities
82+
end
83+
84+
%% ESLint Plugins Subgraph
85+
subgraph "ESLint Plugins"
86+
ReactX["eslint-plugin-react-x"]:::plugins
87+
ReactDOM["eslint-plugin-react-dom"]:::plugins
88+
WebAPI["eslint-plugin-react-web-api"]:::plugins
89+
HooksExtra["eslint-plugin-react-hooks-extra"]:::plugins
90+
NamingConvention["eslint-plugin-react-naming-convention"]:::plugins
91+
Aggregated["Aggregated Plugin (@eslint-react/eslint-plugin)"]:::plugins
92+
end
93+
end
94+
95+
%% Scripts & Configurations
96+
Scripts["Scripts & Configurations"]:::external
97+
98+
%% Tests
99+
Tests["Tests"]:::external
100+
end
101+
102+
%% Relationships
103+
%% Plugins depend on Core and Shared
104+
Core -->|"dependency"| ReactX
105+
Core -->|"dependency"| ReactDOM
106+
Core -->|"dependency"| WebAPI
107+
Core -->|"dependency"| HooksExtra
108+
Core -->|"dependency"| NamingConvention
109+
110+
Shared -->|"dependency"| ReactX
111+
Shared -->|"dependency"| ReactDOM
112+
Shared -->|"dependency"| WebAPI
113+
Shared -->|"dependency"| HooksExtra
114+
Shared -->|"dependency"| NamingConvention
115+
116+
%% Utilities used by Core and Plugins
117+
AST ---|"provides"| Core
118+
Eff ---|"provides"| Core
119+
JSX ---|"provides"| Core
120+
Kit ---|"provides"| Core
121+
Var ---|"provides"| Core
122+
123+
AST ---|"provides"| ReactX
124+
Eff ---|"provides"| ReactX
125+
JSX ---|"provides"| ReactX
126+
Kit ---|"provides"| ReactX
127+
Var ---|"provides"| ReactX
128+
129+
%% Aggregation of Plugins
130+
ReactX -->|"aggregated"| Aggregated
131+
ReactDOM -->|"aggregated"| Aggregated
132+
WebAPI -->|"aggregated"| Aggregated
133+
HooksExtra -->|"aggregated"| Aggregated
134+
NamingConvention -->|"aggregated"| Aggregated
135+
136+
%% Website Documentation uses Core and Shared docs
137+
Website -->|"docs"| Core
138+
Website -->|"docs"| Shared
139+
140+
%% Scripts & CI automation interactions
141+
Scripts -->|"CI/CD"| Core
142+
Scripts -->|"CI/CD"| Shared
143+
Scripts -->|"CI/CD"| AST
144+
Scripts -->|"CI/CD"| Eff
145+
Scripts -->|"CI/CD"| JSX
146+
Scripts -->|"CI/CD"| Kit
147+
Scripts -->|"CI/CD"| Var
148+
Scripts -->|"CI/CD"| ReactX
149+
Scripts -->|"CI/CD"| ReactDOM
150+
Scripts -->|"CI/CD"| WebAPI
151+
Scripts -->|"CI/CD"| HooksExtra
152+
Scripts -->|"CI/CD"| NamingConvention
153+
Scripts -->|"CI/CD"| Aggregated
154+
Scripts -->|"CI/CD"| Tests
155+
156+
%% Click Events
157+
click Website "https://github.com/rel1cx/eslint-react/tree/main/apps/website"
158+
click Playground "https://github.com/rel1cx/eslint-react/tree/main/apps/playground"
159+
click Core "https://github.com/rel1cx/eslint-react/tree/main/packages/core"
160+
click Shared "https://github.com/rel1cx/eslint-react/tree/main/packages/shared"
161+
click AST "https://github.com/rel1cx/eslint-react/tree/main/packages/utilities/ast"
162+
click Eff "https://github.com/rel1cx/eslint-react/tree/main/packages/utilities/eff"
163+
click JSX "https://github.com/rel1cx/eslint-react/tree/main/packages/utilities/jsx"
164+
click Kit "https://github.com/rel1cx/eslint-react/tree/main/packages/utilities/kit"
165+
click Var "https://github.com/rel1cx/eslint-react/tree/main/packages/utilities/var"
166+
click ReactX "https://github.com/rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x"
167+
click ReactDOM "https://github.com/rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom"
168+
click WebAPI "https://github.com/rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-web-api"
169+
click HooksExtra "https://github.com/rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-hooks-extra"
170+
click NamingConvention "https://github.com/rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-naming-convention"
171+
click Aggregated "https://github.com/rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin"
172+
click Scripts "https://github.com/rel1cx/eslint-react/tree/main/scripts"
173+
click Tests "https://github.com/rel1cx/eslint-react/tree/main/test"
174+
175+
%% Styles
176+
classDef apps fill:#f9e79f,stroke:#7d6608,stroke-width:2px;
177+
classDef packages fill:#aed6f1,stroke:#1b4f72,stroke-width:2px;
178+
classDef utilities fill:#a9dfbf,stroke:#145a32,stroke-width:2px;
179+
classDef plugins fill:#f5b7b1,stroke:#78281f,stroke-width:2px;
180+
classDef external fill:#d2b4de,stroke:#4a235a,stroke-width:2px;
181+
```
795 KB
Loading

apps/website/content/docs/contributing.md

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
---
2+
title: Contributing
3+
---
4+
5+
import diagram from "../../assets/monorepo_diagram.png"
6+
7+
Contributions are welcome!
8+
9+
Please follow our [contributing guidelines](https://github.com/Rel1cx/eslint-react/blob/main/.github/CONTRIBUTING.md).
10+
11+
## Repository Structure
12+
13+
### Local Packages
14+
15+
- `.pkgs/configs`: Workspace config bases
16+
- `.pkgs/eslint-plugin-local`: Internal workspace ESLint plugin
17+
18+
### Internal Packages
19+
20+
- **Utilities**
21+
- `packages/utilities/eff`: JavaScript and TypeScript utilities (previously some re-exports of the `effect` library)
22+
- `packages/utilities/ast`: TSESTree AST utility module for static analysis
23+
- `packages/utilities/var`: TSESTree AST utility module for static analysis of variables
24+
- `packages/utilities/jsx`: TSESTree AST utility module for static analysis of JSX
25+
- `packages/utilities/kit`: ESLint React's Plugin Kit for building plugins and rules
26+
- **Core & Shared**
27+
- `packages/core`: Utility module for static analysis of React core APIs and patterns
28+
- `packages/shared`: Shared constants, types and functions
29+
30+
### Public Packages
31+
32+
- **ESLint Plugins**
33+
- `eslint-plugin-react-x`: Core React rules
34+
- `eslint-plugin-react-dom`: React DOM rules
35+
- `eslint-plugin-react-web-api`: Web API interaction rules
36+
- `eslint-plugin-react-hooks-extra`: Extra React Hooks rules
37+
- `eslint-plugin-react-naming-convention`: Naming convention rules
38+
- `eslint-plugin-react-debug`: Debugging rules for inspecting React patterns in code
39+
- `eslint-plugin`: Main plugin combining all rules and presets from the above packages
40+
41+
### Documentation
42+
43+
- `apps/website`: Documentation website
44+
- `apps/playground`: Interactive playground (WIP)
45+
46+
## Repository Structure Diagram
47+
48+
```mermaid
49+
flowchart TB
50+
%% Monorepo
51+
subgraph "Monorepo"
52+
%% Apps Subgraph
53+
subgraph "Apps"
54+
Website["Website"]:::apps
55+
Playground["Playground"]:::apps
56+
end
57+
58+
%% Packages Subgraph
59+
subgraph "Packages"
60+
Core["Core Functionality"]:::packages
61+
Shared["Shared Utilities"]:::packages
62+
63+
%% Utilities Subgraph
64+
subgraph "Utilities Modules"
65+
AST["AST Module"]:::utilities
66+
Eff["Eff Module"]:::utilities
67+
JSX["JSX Module"]:::utilities
68+
Kit["Kit Module"]:::utilities
69+
Var["Var Module"]:::utilities
70+
end
71+
72+
%% ESLint Plugins Subgraph
73+
subgraph "ESLint Plugins"
74+
ReactX["eslint-plugin-react-x"]:::plugins
75+
ReactDOM["eslint-plugin-react-dom"]:::plugins
76+
WebAPI["eslint-plugin-react-web-api"]:::plugins
77+
HooksExtra["eslint-plugin-react-hooks-extra"]:::plugins
78+
NamingConvention["eslint-plugin-react-naming-convention"]:::plugins
79+
Aggregated["Aggregated Plugin (@eslint-react/eslint-plugin)"]:::plugins
80+
end
81+
end
82+
83+
%% Scripts & Configurations
84+
Scripts["Scripts & Configurations"]:::external
85+
86+
%% Tests
87+
Tests["Tests"]:::external
88+
end
89+
90+
%% Relationships
91+
%% Plugins depend on Core and Shared
92+
Core -->|"dependency"| ReactX
93+
Core -->|"dependency"| ReactDOM
94+
Core -->|"dependency"| WebAPI
95+
Core -->|"dependency"| HooksExtra
96+
Core -->|"dependency"| NamingConvention
97+
98+
Shared -->|"dependency"| ReactX
99+
Shared -->|"dependency"| ReactDOM
100+
Shared -->|"dependency"| WebAPI
101+
Shared -->|"dependency"| HooksExtra
102+
Shared -->|"dependency"| NamingConvention
103+
104+
%% Utilities used by Core and Plugins
105+
AST ---|"provides"| Core
106+
Eff ---|"provides"| Core
107+
JSX ---|"provides"| Core
108+
Kit ---|"provides"| Core
109+
Var ---|"provides"| Core
110+
111+
AST ---|"provides"| ReactX
112+
Eff ---|"provides"| ReactX
113+
JSX ---|"provides"| ReactX
114+
Kit ---|"provides"| ReactX
115+
Var ---|"provides"| ReactX
116+
117+
%% Aggregation of Plugins
118+
ReactX -->|"aggregated"| Aggregated
119+
ReactDOM -->|"aggregated"| Aggregated
120+
WebAPI -->|"aggregated"| Aggregated
121+
HooksExtra -->|"aggregated"| Aggregated
122+
NamingConvention -->|"aggregated"| Aggregated
123+
124+
%% Website Documentation uses Core and Shared docs
125+
Website -->|"docs"| Core
126+
Website -->|"docs"| Shared
127+
128+
%% Scripts & CI automation interactions
129+
Scripts -->|"CI/CD"| Core
130+
Scripts -->|"CI/CD"| Shared
131+
Scripts -->|"CI/CD"| AST
132+
Scripts -->|"CI/CD"| Eff
133+
Scripts -->|"CI/CD"| JSX
134+
Scripts -->|"CI/CD"| Kit
135+
Scripts -->|"CI/CD"| Var
136+
Scripts -->|"CI/CD"| ReactX
137+
Scripts -->|"CI/CD"| ReactDOM
138+
Scripts -->|"CI/CD"| WebAPI
139+
Scripts -->|"CI/CD"| HooksExtra
140+
Scripts -->|"CI/CD"| NamingConvention
141+
Scripts -->|"CI/CD"| Aggregated
142+
Scripts -->|"CI/CD"| Tests
143+
144+
%% Click Events
145+
click Website "https://github.com/rel1cx/eslint-react/tree/main/apps/website"
146+
click Playground "https://github.com/rel1cx/eslint-react/tree/main/apps/playground"
147+
click Core "https://github.com/rel1cx/eslint-react/tree/main/packages/core"
148+
click Shared "https://github.com/rel1cx/eslint-react/tree/main/packages/shared"
149+
click AST "https://github.com/rel1cx/eslint-react/tree/main/packages/utilities/ast"
150+
click Eff "https://github.com/rel1cx/eslint-react/tree/main/packages/utilities/eff"
151+
click JSX "https://github.com/rel1cx/eslint-react/tree/main/packages/utilities/jsx"
152+
click Kit "https://github.com/rel1cx/eslint-react/tree/main/packages/utilities/kit"
153+
click Var "https://github.com/rel1cx/eslint-react/tree/main/packages/utilities/var"
154+
click ReactX "https://github.com/rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x"
155+
click ReactDOM "https://github.com/rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom"
156+
click WebAPI "https://github.com/rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-web-api"
157+
click HooksExtra "https://github.com/rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-hooks-extra"
158+
click NamingConvention "https://github.com/rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-naming-convention"
159+
click Aggregated "https://github.com/rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin"
160+
click Scripts "https://github.com/rel1cx/eslint-react/tree/main/scripts"
161+
click Tests "https://github.com/rel1cx/eslint-react/tree/main/test"
162+
163+
%% Styles
164+
classDef apps fill:#f9e79f,stroke:#7d6608,stroke-width:2px;
165+
classDef packages fill:#aed6f1,stroke:#1b4f72,stroke-width:2px;
166+
classDef utilities fill:#a9dfbf,stroke:#145a32,stroke-width:2px;
167+
classDef plugins fill:#f5b7b1,stroke:#78281f,stroke-width:2px;
168+
classDef external fill:#d2b4de,stroke:#4a235a,stroke-width:2px;
169+
```

apps/website/content/docs/faq.mdx

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,33 @@ Just as in [Beyond the DOM](https://legacy.reactjs.org/docs/design-principles.ht
2222

2323
Currently, it includes the following:
2424

25+
**Internal Packages**
26+
27+
- **Utility Modules**
28+
- `packages/utilities/eff`: JavaScript and TypeScript utilities (previously some re-exports of the `effect` library).
29+
- `packages/utilities/ast`: TSESTree AST utility module.
30+
- `packages/utilities/var`: TSESTree AST utility module for static analysis of variables.
31+
- `packages/utilities/jsx`: TSESTree AST utility module for static analysis of JSX.
32+
- `packages/utilities/kit`: ESLint React's Plugin Kit for building plugins and rules.
33+
- **Core & Shared Modules**
34+
- `packages/core`: Utility module for static analysis of React core APIs and patterns.
35+
- `packages/shared`: Shared constants, types and functions.
36+
2537
**Public Packages**
26-
- **ESLint Plugins**
27-
- [`eslint-plugin-react-x`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) - Core React rules.
28-
- [`eslint-plugin-react-dom`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) - React DOM rules.
29-
- [`eslint-plugin-react-web-api`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-web-api) - Web API interaction rules.
30-
- [`eslint-plugin-react-hooks-extra`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-hooks-extra) - Extra React Hooks rules.
31-
- [`eslint-plugin-react-naming-convention`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-naming-convention) - Naming convention rules.
32-
- [`eslint-plugin-react-debug`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-debug) - Debugging rules for inspecting React patterns in code.
33-
- [`@eslint-react/eslint-plugin`](https://www.npmjs.com/package/@eslint-react/eslint-plugin) - Main plugin combining all rules and presets from the above packages.
38+
39+
- **ESLint Plugins**
40+
- [`eslint-plugin-react-x`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) - Core React rules.
41+
- [`eslint-plugin-react-dom`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) - React DOM rules.
42+
- [`eslint-plugin-react-web-api`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-web-api) - Web API interaction rules.
43+
- [`eslint-plugin-react-hooks-extra`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-hooks-extra) - Extra React Hooks rules.
44+
- [`eslint-plugin-react-naming-convention`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-naming-convention) - Naming convention rules.
45+
- [`eslint-plugin-react-debug`](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-debug) - Debugging rules for inspecting React patterns in code.
46+
- [`@eslint-react/eslint-plugin`](https://www.npmjs.com/package/@eslint-react/eslint-plugin) - Main plugin combining all rules and presets from the above packages.
3447

3548
**Website & Playground**
36-
- `website`: This documentation website.
37-
- `playground`: The playground for ESLint React (WIP).
49+
50+
- `website`: This documentation website.
51+
- `playground`: The playground for ESLint React (WIP).
3852

3953
You can view our long-term plans on the [roadmap](/roadmap#plugins-with-ecological-niche-explanation).
4054

apps/website/content/docs/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"!advanced-configuration",
1111
"!using-an-alternative-parser",
1212
"---Other---",
13+
"contributing",
1314
"community",
1415
"changelog",
1516
"roadmap",

apps/website/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@local/configs": "workspace:*",
3838
"@mdx-js/mdx": "^3.1.0",
3939
"@tailwindcss/postcss": "^4.0.17",
40+
"@theguild/remark-mermaid": "^0.3.0",
4041
"@tsconfig/next": "^2.0.3",
4142
"@tsconfig/node22": "^22.0.1",
4243
"@tsconfig/strictest": "^2.0.5",

apps/website/source.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { rehypeCodeDefaultOptions } from "fumadocs-core/mdx-plugins";
22
import { remarkDocGen, remarkInstall } from "fumadocs-docgen";
33
import { defineConfig, defineDocs } from "fumadocs-mdx/config";
44
import { transformerTwoslash } from "fumadocs-twoslash";
5+
import { remarkMermaid } from "@theguild/remark-mermaid";
56

67
export const docs = defineDocs({
78
dir: "content/docs",
@@ -25,8 +26,9 @@ export default defineConfig({
2526
],
2627
},
2728
remarkPlugins: [
28-
[remarkDocGen, { generators: [] }],
29+
remarkMermaid,
2930
remarkInstall,
31+
[remarkDocGen, { generators: [] }],
3032
],
3133
},
3234
});

assets/monorepo_diagram.png

795 KB
Loading

0 commit comments

Comments
 (0)