create-fsd-architecture 1.0.1 → 1.0.2
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/.claude/settings.local.json +9 -0
- package/README.md +84 -0
- package/ashraf/README.md +122 -0
- package/ashraf/bun.lock +1347 -0
- package/ashraf/components.json +23 -0
- package/ashraf/eslint.config.js +23 -0
- package/ashraf/index.html +13 -0
- package/ashraf/package-lock.json +9886 -0
- package/ashraf/package.json +43 -0
- package/ashraf/src/app/App.tsx +12 -0
- package/ashraf/src/app/providers/axios-interceptor.tsx +0 -0
- package/ashraf/src/app/providers.tsx +0 -0
- package/ashraf/src/app/routing/auth-routes.tsx +0 -0
- package/ashraf/src/app/routing/dashboard-routes.tsx +0 -0
- package/ashraf/src/app/routing/guards/auth-guard.tsx +0 -0
- package/ashraf/src/app/routing/guards/dashboard-guard.tsx +0 -0
- package/ashraf/src/app/styles/index.css +190 -0
- package/ashraf/src/assets/index.ts +0 -0
- package/ashraf/src/entities/products/api/get-product-by-id.ts +8 -0
- package/ashraf/src/entities/products/api/get-products.ts +8 -0
- package/ashraf/src/entities/products/index.ts +5 -0
- package/ashraf/src/entities/products/model/query-keys.ts +5 -0
- package/ashraf/src/entities/products/model/types.ts +18 -0
- package/ashraf/src/entities/products/ui/product-card.tsx +25 -0
- package/ashraf/src/features/products/create-product/api/create-product.ts +7 -0
- package/ashraf/src/features/products/create-product/index.ts +2 -0
- package/ashraf/src/features/products/create-product/model/create-product-schema.ts +11 -0
- package/ashraf/src/features/products/create-product/model/use-create-product.ts +15 -0
- package/ashraf/src/features/products/create-product/ui/create-product-form.tsx +85 -0
- package/ashraf/src/features/products/update-product/api/update-product.ts +12 -0
- package/ashraf/src/features/products/update-product/index.ts +2 -0
- package/ashraf/src/features/products/update-product/model/update-product.schema.ts +11 -0
- package/ashraf/src/features/products/update-product/model/use-update-product.ts +17 -0
- package/ashraf/src/features/products/update-product/ui/update-product-form.tsx +69 -0
- package/ashraf/src/main.tsx +10 -0
- package/ashraf/src/pages/products/all-products.tsx +23 -0
- package/ashraf/src/pages/products/create-product-page.tsx +10 -0
- package/ashraf/src/pages/products/update-product-page.tsx +24 -0
- package/ashraf/src/shared/config/env.ts +1 -0
- package/ashraf/src/shared/lib/utils.ts +6 -0
- package/ashraf/src/shared/types/types.d.ts +0 -0
- package/ashraf/src/shared/ui/input.tsx +21 -0
- package/ashraf/src/shared/ui/label.tsx +22 -0
- package/ashraf/src/widgets/dashboard-header.tsx +0 -0
- package/ashraf/src/widgets/index.ts +0 -0
- package/ashraf/src/widgets/sidebar.tsx +0 -0
- package/ashraf/tsconfig.app.json +32 -0
- package/ashraf/tsconfig.json +21 -0
- package/ashraf/tsconfig.node.json +26 -0
- package/ashraf/vite.config.ts +14 -0
- package/bin/index.mjs +180 -39
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# create-fsd-architecture
|
|
2
|
+
|
|
3
|
+
Scaffold production-ready projects with [Feature-Sliced Design](https://feature-sliced.design/) architecture in seconds.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **FSD Architecture** — Pre-configured layers: app, pages, widgets, features, entities, shared
|
|
8
|
+
- **Interactive CLI** — Guided setup with project name, template selection, and dependency installation
|
|
9
|
+
- **Multiple Templates** — Choose from available project templates (more coming soon)
|
|
10
|
+
- **Zero Config** — Start coding immediately with sensible defaults
|
|
11
|
+
- **TypeScript** — Full TypeScript support out of the box
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx create-fsd-architecture my-app
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or with a specific package manager:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm create fsd-architecture my-app
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
### Interactive Mode
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx create-fsd-architecture
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The CLI will guide you through:
|
|
34
|
+
|
|
35
|
+
1. **Project name** — Name your project
|
|
36
|
+
2. **Template selection** — Choose your framework
|
|
37
|
+
3. **Install dependencies** — Optionally install packages
|
|
38
|
+
4. **Start dev server** — Optionally launch the development server
|
|
39
|
+
|
|
40
|
+
### With Arguments
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npx create-fsd-architecture my-app
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Pass the project name directly to skip the name prompt.
|
|
47
|
+
|
|
48
|
+
## Available Templates
|
|
49
|
+
|
|
50
|
+
| Template | Status |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
| React + Vite | Available |
|
|
53
|
+
| Next.js | Coming Soon |
|
|
54
|
+
|
|
55
|
+
## Project Structure
|
|
56
|
+
|
|
57
|
+
Projects are scaffolded with the FSD architecture:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
src/
|
|
61
|
+
├── app/ # App-level setup: providers, routing, styles
|
|
62
|
+
├── pages/ # Full pages composed from widgets and features
|
|
63
|
+
├── widgets/ # Large self-contained UI blocks
|
|
64
|
+
├── features/ # User interactions and actions
|
|
65
|
+
├── entities/ # Business entities and their representations
|
|
66
|
+
└── shared/ # Reusable utilities, UI kit, configs
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Roadmap
|
|
70
|
+
|
|
71
|
+
- [x] React + Vite template
|
|
72
|
+
- [ ] Next.js template
|
|
73
|
+
- [ ] Vue + Vite template
|
|
74
|
+
- [ ] Custom template support
|
|
75
|
+
- [ ] Git initialization option
|
|
76
|
+
- [ ] Package manager detection (npm, yarn, pnpm, bun)
|
|
77
|
+
|
|
78
|
+
## Requirements
|
|
79
|
+
|
|
80
|
+
- Node.js 18 or later
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
ISC
|
package/ashraf/README.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
+
|
|
10
|
+
## React Compiler
|
|
11
|
+
|
|
12
|
+
The React Compiler is currently not compatible with SWC. See [this issue](https://github.com/vitejs/vite-plugin-react/issues/428) for tracking the progress.
|
|
13
|
+
|
|
14
|
+
## Expanding the ESLint configuration
|
|
15
|
+
|
|
16
|
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
export default defineConfig([
|
|
20
|
+
globalIgnores(['dist']),
|
|
21
|
+
{
|
|
22
|
+
files: ['**/*.{ts,tsx}'],
|
|
23
|
+
extends: [
|
|
24
|
+
// Other configs...
|
|
25
|
+
|
|
26
|
+
// Remove tseslint.configs.recommended and replace with this
|
|
27
|
+
tseslint.configs.recommendedTypeChecked,
|
|
28
|
+
// Alternatively, use this for stricter rules
|
|
29
|
+
tseslint.configs.strictTypeChecked,
|
|
30
|
+
// Optionally, add this for stylistic rules
|
|
31
|
+
tseslint.configs.stylisticTypeChecked,
|
|
32
|
+
|
|
33
|
+
// Other configs...
|
|
34
|
+
],
|
|
35
|
+
languageOptions: {
|
|
36
|
+
parserOptions: {
|
|
37
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
38
|
+
tsconfigRootDir: import.meta.dirname,
|
|
39
|
+
},
|
|
40
|
+
// other options...
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
])
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
// eslint.config.js
|
|
50
|
+
import reactX from 'eslint-plugin-react-x'
|
|
51
|
+
import reactDom from 'eslint-plugin-react-dom'
|
|
52
|
+
|
|
53
|
+
export default defineConfig([
|
|
54
|
+
globalIgnores(['dist']),
|
|
55
|
+
{
|
|
56
|
+
files: ['**/*.{ts,tsx}'],
|
|
57
|
+
extends: [
|
|
58
|
+
// Other configs...
|
|
59
|
+
// Enable lint rules for React
|
|
60
|
+
reactX.configs['recommended-typescript'],
|
|
61
|
+
// Enable lint rules for React DOM
|
|
62
|
+
reactDom.configs.recommended,
|
|
63
|
+
],
|
|
64
|
+
languageOptions: {
|
|
65
|
+
parserOptions: {
|
|
66
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
67
|
+
tsconfigRootDir: import.meta.dirname,
|
|
68
|
+
},
|
|
69
|
+
// other options...
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
])
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
```mudular-structure-v2/
|
|
77
|
+
├── 📄 package.json # إعدادات المشروع والمكتبات
|
|
78
|
+
├── 📄 package-lock.json
|
|
79
|
+
├── 📄 bun.lock # ملف قفل الإصدارات الخاص بـ Bun
|
|
80
|
+
├── 📄 vite.config.ts # إعدادات Vite (المشغل)
|
|
81
|
+
├── 📄 tsconfig.json # إعدادات TypeScript الرئيسية
|
|
82
|
+
├── 📄 index.html # نقطة الدخول لملف الـ HTML
|
|
83
|
+
├── 📄 components.json # إعدادات مخصصة (غالباً لـ shadcn/ui)
|
|
84
|
+
├── 📄 eslint.config.js # إعدادات أداة فحص الكود ESLint
|
|
85
|
+
├── 📁 public/ # الملفات العامة والموارد الثابتة ( كالصور والأيقونات)
|
|
86
|
+
└── 📁 src/ # المجلد الرئيسي للكود المصدري
|
|
87
|
+
├── 📄 main.tsx # نقطة الدخول الرئيسية لـ React (Entry Point)
|
|
88
|
+
│
|
|
89
|
+
├── 📁 app/ # طبقة التطبيق (App Layer) الإعدادات العامة للمشروع
|
|
90
|
+
│ ├── 📄 App.tsx
|
|
91
|
+
│ ├── 📁 providers/ # مزودي الخدمات (مثل Context Providers و Axios interceptors)
|
|
92
|
+
│ ├── 📁 routing/ # إعدادات مسارات التطبيق (Auth و Dashboard) و الـ Guards
|
|
93
|
+
│ └── 📁 styles/ # ملفات التصميم الأساسية (index.css)
|
|
94
|
+
│
|
|
95
|
+
├── 📁 pages/ # طبقة الصفحات (Pages Layer): التجميع النهائي للمكونات
|
|
96
|
+
│ ├── 📁 authentication/# صفحات تسجيل الدخول والتحقق
|
|
97
|
+
│ │ ├── 📄 login.tsx
|
|
98
|
+
│ │ ├── 📄 email-checker.tsx
|
|
99
|
+
│ │ ├── 📄 otp-chercker.tsx
|
|
100
|
+
│ │ └── 📄 new-password.tsx
|
|
101
|
+
│ └── 📁 dashboard/ # صفحات لوحة التحكم (الدخل، والمستخدمين...)
|
|
102
|
+
│
|
|
103
|
+
├── 📁 widgets/ # طبقة الكتل المستقلة المجمعة (Widgets Layer)
|
|
104
|
+
│ ├── 📄 dashboard-header.tsx
|
|
105
|
+
│ ├── 📄 sidebar.tsx
|
|
106
|
+
│ └── 📄 index.ts
|
|
107
|
+
│
|
|
108
|
+
├── 📁 features/ # طبقة الميزات (Features Layer): العمليات المنطقية للمستخدم
|
|
109
|
+
│ ├── 📁 authentication/
|
|
110
|
+
│ └── 📁 dashboard/
|
|
111
|
+
│
|
|
112
|
+
├── 📁 entities/ # طبقة الكيانات (Entities Layer): البيانات الخاصة بكيانات العمليات
|
|
113
|
+
│ ├── 📁 income/ # قسم المداخيل (API، hooks، نماذج)
|
|
114
|
+
│ └── 📁 user/ # قسم المستخدمين (API، hooks، نماذج)
|
|
115
|
+
│
|
|
116
|
+
├── 📁 shared/ # طبقة العناصر المشتركة (Shared Layer): يمكن استخدامها في أي مكان
|
|
117
|
+
│ ├── 📁 config/ # إعدادات عامة (مثل env.ts)
|
|
118
|
+
│ ├── 📁 lib/ # دوال برمجية مساعدة (مثل utils.ts)
|
|
119
|
+
│ ├── 📁 ui/ # عناصر واجهة المستخدم البسيطة (مثل input, label)
|
|
120
|
+
│ └── 📁 types/ # الأنواع والإسنادات (Types) لـ TypeScript
|
|
121
|
+
│
|
|
122
|
+
└── 📁 assets/ # الملحقات الثابتة داخل مصدر الكود كالأيقونات والخطوط المحلية
|