refactor: привести проект к стайлгайду
- Убран FC из всех шаблонов и компонентов - Заменён interface на type, .interface.ts на .type.ts - Добавлен паттерн Params/Props/RootAttrs в типы - Деструктуризация пропсов перенесена в тело компонента - Добавлены styles/ и types/ для feature, entity, widget, screen - Добавлен расширенный JSDoc-шаблон с назначением и сценариями - Исправлен баг в index.ts шаблона component - Добавлены .editorconfig, .env.example - Добавлен organizeImports.biome в .vscode/settings.json - Исправлен .gitignore для .env.example - Переписан README под проект-шаблон - Удалён CLAUDE.md
This commit is contained in:
76
README.md
76
README.md
@@ -1,36 +1,64 @@
|
||||
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
|
||||
# Next.js Template
|
||||
|
||||
## Getting Started
|
||||
Шаблон проекта на Next.js, построенный по [стайлгайду](https://gromlab.ru/docs/nextjs-style-guide).
|
||||
|
||||
First, run the development server:
|
||||
## Стек
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
# or
|
||||
yarn dev
|
||||
# or
|
||||
pnpm dev
|
||||
# or
|
||||
bun dev
|
||||
- **Next.js 16** — фреймворк
|
||||
- **React 19** / **TypeScript 5** — UI и типизация
|
||||
- **Mantine UI 8** — компоненты
|
||||
- **Zustand 5** — глобальное состояние
|
||||
- **SWR 2** — получение данных
|
||||
- **PostCSS Modules** — стили
|
||||
- **Biome** — линтер и форматтер
|
||||
- **clsx** — конкатенация CSS-классов
|
||||
|
||||
## Архитектура
|
||||
|
||||
Проект использует кастомизированный FSD (Feature-Sliced Design):
|
||||
|
||||
```
|
||||
src/
|
||||
├── app/ # Роутинг Next.js, провайдеры, глобальные стили
|
||||
├── screens/ # Собранные страницы (UI)
|
||||
├── layouts/ # Каркасы и шаблоны страниц
|
||||
├── widgets/ # Крупные самостоятельные блоки интерфейса
|
||||
├── features/ # Пользовательские сценарии
|
||||
├── entities/ # Бизнес-сущности
|
||||
└── shared/ # Переиспользуемый код (UI, утилиты, типы)
|
||||
```
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||
Зависимости идут строго сверху вниз: `app` -> `screens` -> `layouts` -> `widgets` -> `features` -> `entities` -> `shared`.
|
||||
|
||||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
||||
## Быстрый старт
|
||||
|
||||
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
|
||||
```bash
|
||||
npx tiged git@gromlab.ru:templates/nextjs.git my-app
|
||||
cd my-app
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
## Learn More
|
||||
## Генерация кода
|
||||
|
||||
To learn more about Next.js, take a look at the following resources:
|
||||
Модули создаются из шаблонов `.templates/`:
|
||||
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
```bash
|
||||
npx @gromlab/create component button src/shared/ui
|
||||
npx @gromlab/create feature auth src/features
|
||||
npx @gromlab/create widget header src/widgets
|
||||
npx @gromlab/create entity user src/entities
|
||||
npx @gromlab/create layout admin src/layouts
|
||||
npx @gromlab/create screen profile src/screens
|
||||
npx @gromlab/create store auth src/shared/model
|
||||
```
|
||||
|
||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
||||
## Скрипты
|
||||
|
||||
## Deploy on Vercel
|
||||
|
||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
||||
|
||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|
||||
| Команда | Описание |
|
||||
|---|---|
|
||||
| `npm run dev` | Запуск dev-сервера |
|
||||
| `npm run build` | Сборка для продакшена |
|
||||
| `npm run start` | Запуск продакшен-сервера |
|
||||
| `npm run lint` | Проверка кода (Biome) |
|
||||
| `npm run format` | Форматирование кода (Biome) |
|
||||
|
||||
Reference in New Issue
Block a user