@yousxlfs/next-arch 0.1.0 → 0.2.0
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/dist/index.js +586 -85
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/app/package.json +25 -4
- package/templates/packages/better-auth/examples/src/features/_examples/with-better-auth/lib/auth-placeholder.ts +14 -0
- package/templates/packages/env/core/src/shared/config/env.ts +22 -0
- package/templates/packages/jotai/core/src/shared/providers/JotaiProvider.tsx +19 -0
- package/templates/packages/jotai/examples/src/features/_examples/with-jotai/README.md +3 -0
- package/templates/packages/jotai/examples/src/features/_examples/with-jotai/model/example.atoms.ts +19 -0
- package/templates/packages/motion/core/src/shared/lib/motion.ts +17 -0
- package/templates/packages/motion/examples/src/features/_examples/with-motion/components/ExampleMotionCard.tsx +19 -0
- package/templates/packages/next-intl/core/src/shared/config/i18n.ts +10 -0
- package/templates/packages/nuqs/examples/src/features/_examples/with-nuqs/README.md +3 -0
- package/templates/packages/nuqs/examples/src/features/_examples/with-nuqs/hooks/use-example-params.ts +19 -0
- package/templates/packages/react-hook-form/examples/src/features/_examples/with-react-hook-form/README.md +1 -0
- package/templates/packages/react-hook-form/examples/src/features/_examples/with-react-hook-form/components/ExampleRhfForm.tsx +40 -0
- package/templates/packages/redux/core/src/app/providers/redux-store.ts +15 -0
- package/templates/packages/redux/core/src/shared/providers/ReduxProvider.tsx +24 -0
- package/templates/packages/redux/examples/src/app/providers/redux-store.ts +18 -0
- package/templates/packages/redux/examples/src/features/_examples/with-redux/README.md +4 -0
- package/templates/packages/redux/examples/src/features/_examples/with-redux/model/example.slice.ts +36 -0
- package/templates/packages/sentry/core/src/shared/config/sentry.ts +9 -0
- package/templates/packages/sonner/examples/src/features/_examples/with-sonner/lib/toast.ts +7 -0
- package/templates/packages/sonner-provider/core/src/shared/providers/SonnerToaster.tsx +13 -0
- package/templates/packages/tanstack-form/examples/src/features/_examples/with-tanstack-form/README.md +3 -0
- package/templates/packages/tanstack-form/examples/src/features/_examples/with-tanstack-form/components/ExampleForm.tsx +60 -0
- package/templates/packages/tanstack-query/core/src/shared/lib/query-client.ts +24 -0
- package/templates/packages/tanstack-query/core/src/shared/providers/QueryProvider.tsx +30 -0
- package/templates/packages/tanstack-query/examples/src/features/_examples/with-tanstack-query/README.md +34 -0
- package/templates/packages/tanstack-query/examples/src/features/_examples/with-tanstack-query/actions/example.action.ts +34 -0
- package/templates/packages/tanstack-query/examples/src/features/_examples/with-tanstack-query/queries/use-example.query.ts +49 -0
- package/templates/packages/tanstack-table/examples/src/features/_examples/with-tanstack-table/README.md +3 -0
- package/templates/packages/tanstack-table/examples/src/features/_examples/with-tanstack-table/components/ExampleTable.tsx +66 -0
- package/templates/packages/trpc/core/src/app/api/trpc/router.ts +19 -0
- package/templates/packages/trpc/examples/src/app/providers/trpc-client.ts +13 -0
- package/templates/packages/uploadthing/core/src/app/api/uploadthing/route.ts +10 -0
- package/templates/packages/zustand/core/src/shared/lib/store.ts +13 -0
- package/templates/packages/zustand/examples/src/features/_examples/with-zustand/README.md +13 -0
- package/templates/packages/zustand/examples/src/features/_examples/with-zustand/model/example.store.ts +28 -0
- package/templates/pages/auth/src/app/({{name}})/layout.tsx +7 -0
- package/templates/pages/auth/src/app/({{name}})/login/page.tsx +5 -0
- package/templates/pages/auth/src/app/({{name}})/register/page.tsx +5 -0
- package/templates/pages/auth/src/entities/user/index.ts +2 -0
- package/templates/pages/auth/src/entities/user/lib/user-schema.ts +9 -0
- package/templates/pages/auth/src/entities/user/types/user.types.ts +5 -0
- package/templates/pages/auth/src/features/{{name}}/actions/login.action.ts +7 -0
- package/templates/pages/auth/src/features/{{name}}/actions/logout.action.ts +5 -0
- package/templates/pages/auth/src/features/{{name}}/actions/register.action.ts +7 -0
- package/templates/pages/auth/src/features/{{name}}/components/AuthGuard.tsx +14 -0
- package/templates/pages/auth/src/features/{{name}}/components/LoginForm.tsx +36 -0
- package/templates/pages/auth/src/features/{{name}}/components/RegisterForm.tsx +43 -0
- package/templates/pages/auth/src/features/{{name}}/hooks/use-session.ts +14 -0
- package/templates/pages/auth/src/features/{{name}}/index.ts +9 -0
- package/templates/pages/auth/src/features/{{name}}/lib/auth-helpers.ts +3 -0
- package/templates/pages/auth/src/features/{{name}}/queries/use-user.query.ts +16 -0
- package/templates/pages/auth/src/features/{{name}}/types/auth.types.ts +13 -0
- package/templates/pages/auth/src/views/{{name}}/LoginView.tsx +10 -0
- package/templates/pages/auth/src/views/{{name}}/RegisterView.tsx +10 -0
- package/templates/pages/auth/src/views/{{name}}/index.ts +2 -0
- package/templates/pages/blank/src/app/{{name}}/page.tsx +5 -0
- package/templates/pages/blank/src/features/{{name}}/index.ts +3 -0
- package/templates/pages/blank/src/views/{{name}}/index.ts +1 -0
- package/templates/pages/blank/src/views/{{name}}/{{Name}}View.tsx +8 -0
- package/templates/pages/crud/src/app/{{name}}/[id]/page.tsx +5 -0
- package/templates/pages/crud/src/app/{{name}}/new/page.tsx +5 -0
- package/templates/pages/crud/src/app/{{name}}/page.tsx +5 -0
- package/templates/pages/crud/src/entities/{{name}}/index.ts +2 -0
- package/templates/pages/crud/src/entities/{{name}}/lib/{{name}}-schema.ts +6 -0
- package/templates/pages/crud/src/entities/{{name}}/types/{{name}}.types.ts +4 -0
- package/templates/pages/crud/src/features/{{name}}/actions/create-{{name}}.action.ts +5 -0
- package/templates/pages/crud/src/features/{{name}}/actions/delete-{{name}}.action.ts +5 -0
- package/templates/pages/crud/src/features/{{name}}/actions/update-{{name}}.action.ts +5 -0
- package/templates/pages/crud/src/features/{{name}}/components/ProductCard.tsx +3 -0
- package/templates/pages/crud/src/features/{{name}}/components/ProductForm.tsx +5 -0
- package/templates/pages/crud/src/features/{{name}}/components/ProductsList.tsx +15 -0
- package/templates/pages/crud/src/features/{{name}}/index.ts +8 -0
- package/templates/pages/crud/src/features/{{name}}/queries/use-{{name}}.query.ts +10 -0
- package/templates/pages/crud/src/features/{{name}}/queries/use-{{name}}s.query.ts +10 -0
- package/templates/pages/crud/src/views/{{name}}/index.ts +1 -0
- package/templates/pages/crud/src/views/{{name}}/{{Name}}ListView.tsx +26 -0
- package/templates/pages/dashboard/src/app/{{name}}/layout.tsx +8 -0
- package/templates/pages/dashboard/src/app/{{name}}/page.tsx +5 -0
- package/templates/pages/dashboard/src/features/{{name}}/components/AnalyticsCard.tsx +8 -0
- package/templates/pages/dashboard/src/features/{{name}}/index.ts +1 -0
- package/templates/pages/dashboard/src/views/{{name}}/DashboardView.tsx +10 -0
- package/templates/pages/dashboard/src/views/{{name}}/index.ts +1 -0
- package/templates/pages/profile/src/app/{{name}}/page.tsx +5 -0
- package/templates/pages/profile/src/features/{{name}}/components/ProfileCard.tsx +8 -0
- package/templates/pages/profile/src/features/{{name}}/index.ts +1 -0
- package/templates/pages/profile/src/views/{{name}}/ProfileView.tsx +9 -0
- package/templates/pages/profile/src/views/{{name}}/index.ts +1 -0
- package/templates/pages/settings/src/app/{{name}}/page.tsx +5 -0
- package/templates/pages/settings/src/features/{{name}}/components/SettingsTabs.tsx +18 -0
- package/templates/pages/settings/src/features/{{name}}/index.ts +1 -0
- package/templates/pages/settings/src/views/{{name}}/SettingsView.tsx +10 -0
- package/templates/pages/settings/src/views/{{name}}/index.ts +1 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ProductCard } from './ProductCard';
|
|
2
|
+
|
|
3
|
+
const items = [{ id: '1', title: 'Demo item' }];
|
|
4
|
+
|
|
5
|
+
export function ProductsList() {
|
|
6
|
+
return (
|
|
7
|
+
<ul className="space-y-2">
|
|
8
|
+
{items.map((item) => (
|
|
9
|
+
<li key={item.id}>
|
|
10
|
+
<ProductCard title={item.title} />
|
|
11
|
+
</li>
|
|
12
|
+
))}
|
|
13
|
+
</ul>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { ProductsList } from './components/ProductsList';
|
|
2
|
+
export { ProductCard } from './components/ProductCard';
|
|
3
|
+
export { ProductForm } from './components/ProductForm';
|
|
4
|
+
export { use{{Name}}sQuery } from './queries/use-{{name}}s.query';
|
|
5
|
+
export { use{{Name}}Query } from './queries/use-{{name}}.query';
|
|
6
|
+
export { create{{Name}}Action } from './actions/create-{{name}}.action';
|
|
7
|
+
export { update{{Name}}Action } from './actions/update-{{name}}.action';
|
|
8
|
+
export { delete{{Name}}Action } from './actions/delete-{{name}}.action';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { {{Name}}ListView, {{Name}}DetailView, {{Name}}CreateView } from './{{Name}}ListView';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ProductsList } from '@/features/{{name}}';
|
|
2
|
+
|
|
3
|
+
export function {{Name}}ListView() {
|
|
4
|
+
return (
|
|
5
|
+
<main className="mx-auto max-w-4xl p-8">
|
|
6
|
+
<h1 className="mb-4 text-3xl font-semibold">{{Name}} list</h1>
|
|
7
|
+
<ProductsList />
|
|
8
|
+
</main>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function {{Name}}DetailView() {
|
|
13
|
+
return (
|
|
14
|
+
<main className="mx-auto max-w-4xl p-8">
|
|
15
|
+
<h1 className="text-3xl font-semibold">{{Name}} details</h1>
|
|
16
|
+
</main>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function {{Name}}CreateView() {
|
|
21
|
+
return (
|
|
22
|
+
<main className="mx-auto max-w-4xl p-8">
|
|
23
|
+
<h1 className="mb-4 text-3xl font-semibold">Create {{name}}</h1>
|
|
24
|
+
</main>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function AnalyticsCard({ title, value }: { title: string; value: string }) {
|
|
2
|
+
return (
|
|
3
|
+
<section className="rounded-xl border bg-card p-6">
|
|
4
|
+
<p className="text-sm text-muted-foreground">{title}</p>
|
|
5
|
+
<p className="mt-2 text-3xl font-semibold">{value}</p>
|
|
6
|
+
</section>
|
|
7
|
+
);
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AnalyticsCard } from './components/AnalyticsCard';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AnalyticsCard } from '@/features/{{name}}';
|
|
2
|
+
|
|
3
|
+
export function DashboardView() {
|
|
4
|
+
return (
|
|
5
|
+
<main className="grid gap-4 p-8 md:grid-cols-2">
|
|
6
|
+
<AnalyticsCard title="Users" value="1,234" />
|
|
7
|
+
<AnalyticsCard title="Revenue" value="$12,340" />
|
|
8
|
+
</main>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DashboardView } from './DashboardView';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProfileCard } from './components/ProfileCard';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProfileView } from './ProfileView';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
const tabs = ['Account', 'Notifications', 'Security'] as const;
|
|
4
|
+
|
|
5
|
+
export function SettingsTabs() {
|
|
6
|
+
return (
|
|
7
|
+
<div className="space-y-4">
|
|
8
|
+
<nav className="flex gap-2">
|
|
9
|
+
{tabs.map((tab) => (
|
|
10
|
+
<button key={tab} type="button" className="rounded border px-3 py-1 text-sm">
|
|
11
|
+
{tab}
|
|
12
|
+
</button>
|
|
13
|
+
))}
|
|
14
|
+
</nav>
|
|
15
|
+
<p className="text-muted-foreground">Выбери вкладку и добавь формы в features/{{name}}/.</p>
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SettingsTabs } from './components/SettingsTabs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SettingsView } from './SettingsView';
|