create-fsd-architecture 1.0.2 → 1.0.4
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/bin/index.mjs +16 -15
- package/package.json +6 -2
- package/.claude/settings.local.json +0 -9
- package/ashraf/README.md +0 -122
- package/ashraf/bun.lock +0 -1347
- package/ashraf/components.json +0 -23
- package/ashraf/eslint.config.js +0 -23
- package/ashraf/index.html +0 -13
- package/ashraf/package-lock.json +0 -9886
- package/ashraf/package.json +0 -43
- package/ashraf/src/app/App.tsx +0 -12
- 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 +0 -190
- package/ashraf/src/assets/index.ts +0 -0
- package/ashraf/src/entities/products/api/get-product-by-id.ts +0 -8
- package/ashraf/src/entities/products/api/get-products.ts +0 -8
- package/ashraf/src/entities/products/index.ts +0 -5
- package/ashraf/src/entities/products/model/query-keys.ts +0 -5
- package/ashraf/src/entities/products/model/types.ts +0 -18
- package/ashraf/src/entities/products/ui/product-card.tsx +0 -25
- package/ashraf/src/features/products/create-product/api/create-product.ts +0 -7
- package/ashraf/src/features/products/create-product/index.ts +0 -2
- package/ashraf/src/features/products/create-product/model/create-product-schema.ts +0 -11
- package/ashraf/src/features/products/create-product/model/use-create-product.ts +0 -15
- package/ashraf/src/features/products/create-product/ui/create-product-form.tsx +0 -85
- package/ashraf/src/features/products/update-product/api/update-product.ts +0 -12
- package/ashraf/src/features/products/update-product/index.ts +0 -2
- package/ashraf/src/features/products/update-product/model/update-product.schema.ts +0 -11
- package/ashraf/src/features/products/update-product/model/use-update-product.ts +0 -17
- package/ashraf/src/features/products/update-product/ui/update-product-form.tsx +0 -69
- package/ashraf/src/main.tsx +0 -10
- package/ashraf/src/pages/products/all-products.tsx +0 -23
- package/ashraf/src/pages/products/create-product-page.tsx +0 -10
- package/ashraf/src/pages/products/update-product-page.tsx +0 -24
- package/ashraf/src/shared/config/env.ts +0 -1
- package/ashraf/src/shared/lib/utils.ts +0 -6
- package/ashraf/src/shared/types/types.d.ts +0 -0
- package/ashraf/src/shared/ui/input.tsx +0 -21
- package/ashraf/src/shared/ui/label.tsx +0 -22
- 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 +0 -32
- package/ashraf/tsconfig.json +0 -21
- package/ashraf/tsconfig.node.json +0 -26
- package/ashraf/vite.config.ts +0 -14
package/bin/index.mjs
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
1
|
import degit from "degit";
|
|
4
2
|
import prompts from "prompts";
|
|
5
3
|
import chalk from "chalk";
|
|
@@ -13,28 +11,31 @@ const TEMPLATES = [
|
|
|
13
11
|
title: "React + Vite",
|
|
14
12
|
value: "react-vite",
|
|
15
13
|
description: "React with Vite and FSD architecture",
|
|
16
|
-
repo: "
|
|
14
|
+
repo: "FSD-architectures/FSD",
|
|
17
15
|
available: true,
|
|
18
16
|
},
|
|
19
17
|
{
|
|
20
18
|
title: "Next.js",
|
|
21
19
|
value: "nextjs",
|
|
22
|
-
description: "
|
|
23
|
-
repo:
|
|
24
|
-
available:
|
|
20
|
+
description: "Next.js — Full-stack React framework with SSR, SSG, and App Router.",
|
|
21
|
+
repo: "FSD-architectures/FSD-NEXTJS",
|
|
22
|
+
available: true,
|
|
25
23
|
},
|
|
26
24
|
];
|
|
27
25
|
|
|
28
26
|
function showBanner() {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
const banner = `
|
|
28
|
+
███████╗ ███████╗ ██████╗
|
|
29
|
+
██╔════╝ ██╔════╝ ██╔══██╗
|
|
30
|
+
█████╗ ███████╗ ██║ ██║
|
|
31
|
+
██╔══╝ ╚════██║ ██║ ██║
|
|
32
|
+
██║ ███████║ ██████╔╝
|
|
33
|
+
╚═╝ ╚══════╝ ╚═════╝
|
|
34
|
+
|
|
35
|
+
Feature-Sliced Design Scaffolding
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
console.log(chalk.cyanBright(banner));
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
function showNextSteps(projectName, depsInstalled) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-fsd-architecture",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -17,8 +17,12 @@
|
|
|
17
17
|
"ora": "^9.4.0",
|
|
18
18
|
"prompts": "^2.4.2"
|
|
19
19
|
},
|
|
20
|
+
"files": [
|
|
21
|
+
"bin",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
20
24
|
"keywords": [],
|
|
21
25
|
"author": "",
|
|
22
26
|
"license": "ISC",
|
|
23
27
|
"type": "commonjs"
|
|
24
|
-
}
|
|
28
|
+
}
|
package/ashraf/README.md
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
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/ # الملحقات الثابتة داخل مصدر الكود كالأيقونات والخطوط المحلية
|