init: шаблон Next.js приложения
- Next.js 16 + React 19 + TypeScript - Mantine UI + PostCSS Modules - Biome (линтинг и форматирование) - Zustand, SWR - Структура FSD (screens, widgets, features, entities, shared) - Шаблоны генерации (.templates/): component, screen, feature, widget, entity, layout, store - Конфигурация VS Code (расширения, настройки) - CSS-токены (цвета, отступы, радиусы, медиа) - Open Graph метаданные - Тестовый home screen с Mantine
This commit is contained in:
1
.templates/component/{{name.kebabCase}}/index.ts
Normal file
1
.templates/component/{{name.kebabCase}}/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { {{name.pascalCase}} } from './{{name.kebabCase}}.ui'
|
||||
@@ -0,0 +1,3 @@
|
||||
.root {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { HTMLAttributes } from 'react'
|
||||
|
||||
/**
|
||||
* Параметры {{name.pascalCase}}.
|
||||
*/
|
||||
export interface {{name.pascalCase}}Props extends HTMLAttributes<HTMLDivElement> {}
|
||||
@@ -0,0 +1,15 @@
|
||||
import type { FC } from 'react'
|
||||
import cl from 'clsx'
|
||||
import type { {{name.pascalCase}}Props } from './types/{{name.kebabCase}}.interface'
|
||||
import styles from './styles/{{name.kebabCase}}.module.css'
|
||||
|
||||
/**
|
||||
* {{name.pascalCase}}.
|
||||
*/
|
||||
export const {{name.pascalCase}}: FC<{{name.pascalCase}}Props> = ({ className, ...htmlAttr }) => {
|
||||
return (
|
||||
<div {...htmlAttr} className={cl(styles.root, className)}>
|
||||
{{name.kebabCase}}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
1
.templates/entity/{{name.kebabCase}}/index.ts
Normal file
1
.templates/entity/{{name.kebabCase}}/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { {{name.pascalCase}}Entity } from './{{name.kebabCase}}.entity'
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { FC } from 'react'
|
||||
|
||||
/**
|
||||
* Сущность {{name.pascalCase}}.
|
||||
*/
|
||||
export const {{name.pascalCase}}Entity: FC = () => {
|
||||
return (
|
||||
<div>
|
||||
{{name.kebabCase}}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
1
.templates/feature/{{name.kebabCase}}/index.ts
Normal file
1
.templates/feature/{{name.kebabCase}}/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { {{name.pascalCase}}Feature } from './{{name.kebabCase}}.feature'
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { FC } from 'react'
|
||||
|
||||
/**
|
||||
* Фича {{name.pascalCase}}.
|
||||
*/
|
||||
export const {{name.pascalCase}}Feature: FC = () => {
|
||||
return (
|
||||
<div>
|
||||
{{name.kebabCase}}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
1
.templates/layout/{{name.kebabCase}}/index.ts
Normal file
1
.templates/layout/{{name.kebabCase}}/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { {{name.pascalCase}}Layout } from './{{name.kebabCase}}.layout'
|
||||
@@ -0,0 +1,3 @@
|
||||
.root {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* Параметры {{name.pascalCase}}Layout.
|
||||
*/
|
||||
export interface {{name.pascalCase}}LayoutProps {
|
||||
children: React.ReactNode
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { FC } from 'react'
|
||||
import type { {{name.pascalCase}}LayoutProps } from './types/{{name.kebabCase}}.interface'
|
||||
import styles from './styles/{{name.kebabCase}}.module.css'
|
||||
|
||||
/**
|
||||
* Layout {{name.pascalCase}}.
|
||||
*/
|
||||
export const {{name.pascalCase}}Layout: FC<{{name.pascalCase}}LayoutProps> = ({ children }) => {
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
1
.templates/screen/{{name.kebabCase}}/index.ts
Normal file
1
.templates/screen/{{name.kebabCase}}/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { {{name.pascalCase}}Screen } from './{{name.kebabCase}}.screen'
|
||||
@@ -0,0 +1,3 @@
|
||||
.root {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import type { FC } from 'react'
|
||||
import styles from './styles/{{name.kebabCase}}.module.css'
|
||||
|
||||
/**
|
||||
* Экран {{name.pascalCase}}.
|
||||
*/
|
||||
export const {{name.pascalCase}}Screen: FC = () => {
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
{{name.kebabCase}}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
2
.templates/store/{{name.kebabCase}}/index.ts
Normal file
2
.templates/store/{{name.kebabCase}}/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export { use{{name.pascalCase}}Store } from './{{name.kebabCase}}.store'
|
||||
export type { {{name.pascalCase}}State } from './{{name.kebabCase}}.type'
|
||||
@@ -0,0 +1,9 @@
|
||||
import { create } from 'zustand'
|
||||
import type { {{name.pascalCase}}State } from './{{name.kebabCase}}.type'
|
||||
|
||||
/**
|
||||
* Стор {{name.pascalCase}}.
|
||||
*/
|
||||
export const use{{name.pascalCase}}Store = create<{{name.pascalCase}}State>()(() => ({
|
||||
|
||||
}))
|
||||
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* Состояние {{name.pascalCase}}.
|
||||
*/
|
||||
export interface {{name.pascalCase}}State {
|
||||
|
||||
}
|
||||
1
.templates/widget/{{name.kebabCase}}/index.ts
Normal file
1
.templates/widget/{{name.kebabCase}}/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { {{name.pascalCase}}Widget } from './{{name.kebabCase}}.widget'
|
||||
@@ -0,0 +1,3 @@
|
||||
.root {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import type { FC } from 'react'
|
||||
import styles from './styles/{{name.kebabCase}}.module.css'
|
||||
|
||||
/**
|
||||
* Виджет {{name.pascalCase}}.
|
||||
*/
|
||||
export const {{name.pascalCase}}Widget: FC = () => {
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
{{name.kebabCase}}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user