virastack 1.0.3 → 1.0.5
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/README.md +24 -3
- package/package.json +1 -1
- package/templates/nextjs/README.md +1 -1
- package/templates/nextjs/next.config.ts +1 -1
- package/templates/nextjs/public/llms.txt +1 -1
- package/templates/tanstack/README.md +1 -1
- package/templates-i18n/nextjs/README.md +1 -1
- package/templates-i18n/nextjs/next.config.ts +1 -1
- package/templates-i18n/nextjs/public/llms.txt +1 -1
- package/templates-i18n/nextjs/src/app/[locale]/[...rest]/page.tsx +5 -0
- package/templates-i18n/nextjs/src/app/[locale]/layout.tsx +4 -6
- package/templates-i18n/nextjs/src/app/layout.tsx +6 -0
- package/templates-i18n/nextjs/src/app/not-found.tsx +13 -0
- package/templates-i18n/nextjs/src/i18n/request.ts +3 -5
- package/templates-i18n/nextjs/src/proxy.ts +1 -8
- package/templates-i18n/tanstack/README.md +1 -1
- package/templates-i18n/tanstack/public/llms.txt +1 -1
package/README.md
CHANGED
|
@@ -74,10 +74,12 @@ Which ViraStack tools would you like to include?
|
|
|
74
74
|
| `@virastack/mask` | Input masking and formatting (Phone, IBAN, etc.) |
|
|
75
75
|
| `@virastack/password` | Password visibility toggle with customizable icons and text |
|
|
76
76
|
|
|
77
|
-
##
|
|
77
|
+
## Commands and options
|
|
78
78
|
|
|
79
|
-
|
|
|
79
|
+
| Command / flag | Description |
|
|
80
80
|
| :--- | :--- |
|
|
81
|
+
| `init [name]` | Create a new project (default; also runs with no command) |
|
|
82
|
+
| `add <tool>` | Add a tool to an existing project (`mask`, `password`, `ai`) |
|
|
81
83
|
| `--name <name>` | Project name (or pass as positional / `.`) |
|
|
82
84
|
| `--template <name>` | `nextjs` or `tanstack` |
|
|
83
85
|
| `--tools <list>` | Comma-separated tools (`mask,password`) |
|
|
@@ -89,9 +91,28 @@ Which ViraStack tools would you like to include?
|
|
|
89
91
|
| `-v`, `--version` | Print CLI version |
|
|
90
92
|
| `-h`, `--help` | Show usage |
|
|
91
93
|
|
|
94
|
+
```bash
|
|
95
|
+
pnpm dlx virastack add mask
|
|
96
|
+
pnpm dlx virastack add password
|
|
97
|
+
pnpm dlx virastack add ai
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Included by default
|
|
101
|
+
|
|
102
|
+
Every template ships with this stack already installed:
|
|
103
|
+
|
|
104
|
+
| Area | Packages |
|
|
105
|
+
| :--- | :--- |
|
|
106
|
+
| **State** | TanStack Query, Zustand, nuqs |
|
|
107
|
+
| **Form** | React Hook Form, Zod |
|
|
108
|
+
| **Hooks** | `usehooks-ts` |
|
|
109
|
+
| **UI** | Base UI, Framer Motion, Lucide React |
|
|
110
|
+
|
|
111
|
+
[ViraStack AI](https://github.com/virastack/ai) encodes these choices as agent rules so assistants follow the same stack from day one.
|
|
112
|
+
|
|
92
113
|
## Telemetry
|
|
93
114
|
|
|
94
|
-
To
|
|
115
|
+
To keep usage statistics, ViraStack collects strictly anonymous data (template, i18n choice, selected tools, package manager, and CLI version). Absolutely no personal data, project names, or file paths are collected.
|
|
95
116
|
|
|
96
117
|
Opt out anytime: `pnpm dlx virastack --telemetry-disable`
|
|
97
118
|
|
package/package.json
CHANGED
|
@@ -24,7 +24,7 @@ _The Next.js boilerplate that feels effortless._
|
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
-
**Docs:** [See the docs](https://
|
|
27
|
+
**Docs:** [See the docs](https://virastack.com/start/docs)
|
|
28
28
|
|
|
29
29
|
**Contents:** [Why](#why-virastack) · [Features](#features) · [Getting started](#getting-started) · [Environment](#environment-variables) · [Scripts](#scripts) · [Project structure](#project-structure) · [Customization](#customization) · [ViraStack AI](#virastack-ai) · [Deployment](#deployment)
|
|
30
30
|
|
|
@@ -19,7 +19,7 @@ Built on the App Router with Server/Client Components, streaming, and the Metada
|
|
|
19
19
|
- [Repository (GitHub)](https://github.com/virastack/start): CLI and templates
|
|
20
20
|
- [README](https://github.com/virastack/start/tree/main/templates/nextjs): Features, structure, and conventions
|
|
21
21
|
- [Architecture guide](https://github.com/virastack/ai/blob/main/templates/core/docs/architecture-guide.md): Placement rules and import conventions
|
|
22
|
-
- [Product docs](https://
|
|
22
|
+
- [Product docs](https://virastack.com/start/docs): ViraStack Start documentation
|
|
23
23
|
|
|
24
24
|
## Key Files & Entry Points
|
|
25
25
|
- [`src/app/layout.tsx`](https://github.com/virastack/start/blob/main/templates/nextjs/src/app/layout.tsx): Root layout, fonts, providers
|
|
@@ -24,7 +24,7 @@ _The TanStack Start boilerplate that feels effortless._
|
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
-
**Docs:** [See the docs](https://
|
|
27
|
+
**Docs:** [See the docs](https://virastack.com/start/docs)
|
|
28
28
|
|
|
29
29
|
**Contents:** [Why](#why-virastack) · [Features](#features) · [Getting started](#getting-started) · [Environment](#environment-variables) · [Scripts](#scripts) · [Project structure](#project-structure) · [Customization](#customization) · [ViraStack AI](#virastack-ai) · [Deployment](#deployment)
|
|
30
30
|
|
|
@@ -24,7 +24,7 @@ _The Next.js boilerplate that feels effortless._
|
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
-
**Docs:** [See the docs](https://
|
|
27
|
+
**Docs:** [See the docs](https://virastack.com/start/docs)
|
|
28
28
|
|
|
29
29
|
**Contents:** [Why](#why-virastack) · [Features](#features) · [Getting started](#getting-started) · [Environment](#environment-variables) · [Scripts](#scripts) · [Project structure](#project-structure) · [Customization](#customization) · [ViraStack AI](#virastack-ai) · [Deployment](#deployment)
|
|
30
30
|
|
|
@@ -19,7 +19,7 @@ Built on the App Router with Server/Client Components, streaming, and the Metada
|
|
|
19
19
|
- [Repository (GitHub)](https://github.com/virastack/start): CLI and templates
|
|
20
20
|
- [README](https://github.com/virastack/start/tree/main/templates/nextjs): Features, structure, and conventions
|
|
21
21
|
- [Architecture guide](https://github.com/virastack/ai/blob/main/templates/core/docs/architecture-guide.md): Placement rules and import conventions
|
|
22
|
-
- [Product docs](https://
|
|
22
|
+
- [Product docs](https://virastack.com/start/docs): ViraStack Start documentation
|
|
23
23
|
|
|
24
24
|
## Key Files & Entry Points
|
|
25
25
|
- [`src/app/layout.tsx`](https://github.com/virastack/start/blob/main/templates/nextjs/src/app/layout.tsx): Root layout, fonts, providers
|
|
@@ -2,8 +2,8 @@ import type { Metadata } from "next";
|
|
|
2
2
|
import { Inter } from "next/font/google";
|
|
3
3
|
import { notFound } from "next/navigation";
|
|
4
4
|
|
|
5
|
-
import { NextIntlClientProvider } from "next-intl";
|
|
6
|
-
import {
|
|
5
|
+
import { hasLocale, NextIntlClientProvider } from "next-intl";
|
|
6
|
+
import { setRequestLocale } from "next-intl/server";
|
|
7
7
|
import { NuqsAdapter } from "nuqs/adapters/next/app";
|
|
8
8
|
|
|
9
9
|
import { defaultMetadata } from "@/config/seo.config";
|
|
@@ -37,14 +37,12 @@ export default async function RootLayout({
|
|
|
37
37
|
}>) {
|
|
38
38
|
const { locale } = await params;
|
|
39
39
|
|
|
40
|
-
if (!routing.locales
|
|
40
|
+
if (!hasLocale(routing.locales, locale)) {
|
|
41
41
|
notFound();
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
setRequestLocale(locale);
|
|
45
45
|
|
|
46
|
-
const messages = await getMessages();
|
|
47
|
-
|
|
48
46
|
return (
|
|
49
47
|
<html
|
|
50
48
|
lang={locale}
|
|
@@ -53,7 +51,7 @@ export default async function RootLayout({
|
|
|
53
51
|
data-scroll-behavior="smooth"
|
|
54
52
|
>
|
|
55
53
|
<body className="flex min-h-full flex-col antialiased" suppressHydrationWarning>
|
|
56
|
-
<NextIntlClientProvider
|
|
54
|
+
<NextIntlClientProvider>
|
|
57
55
|
<NuqsAdapter>
|
|
58
56
|
<Providers>{children}</Providers>
|
|
59
57
|
</NuqsAdapter>
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
+
import { hasLocale } from "next-intl";
|
|
1
2
|
import { getRequestConfig } from "next-intl/server";
|
|
2
3
|
|
|
3
4
|
import { routing } from "./routing";
|
|
4
5
|
|
|
5
6
|
export default getRequestConfig(async ({ requestLocale }) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (!locale || !routing.locales.includes(locale as "en" | "tr")) {
|
|
9
|
-
locale = routing.defaultLocale;
|
|
10
|
-
}
|
|
7
|
+
const requested = await requestLocale;
|
|
8
|
+
const locale = hasLocale(routing.locales, requested) ? requested : routing.defaultLocale;
|
|
11
9
|
|
|
12
10
|
return {
|
|
13
11
|
locale,
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import type { NextRequest } from "next/server";
|
|
2
|
-
|
|
3
1
|
import createMiddleware from "next-intl/middleware";
|
|
4
2
|
|
|
5
3
|
import { routing } from "./i18n/routing";
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export default async function proxy(request: NextRequest) {
|
|
10
|
-
return handleI18nRouting(request);
|
|
11
|
-
}
|
|
5
|
+
export default createMiddleware(routing);
|
|
12
6
|
|
|
13
7
|
export const config = {
|
|
14
|
-
// Match all pathnames except for api, trpc, _next, _vercel, and static files
|
|
15
8
|
matcher: "/((?!api|trpc|_next|_vercel|.*\\..*).*)",
|
|
16
9
|
};
|
|
@@ -24,7 +24,7 @@ _The TanStack Start boilerplate that feels effortless._
|
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
-
**Docs:** [See the docs](https://
|
|
27
|
+
**Docs:** [See the docs](https://virastack.com/start/docs)
|
|
28
28
|
|
|
29
29
|
**Contents:** [Why](#why-virastack) · [Features](#features) · [Getting started](#getting-started) · [Environment](#environment-variables) · [Scripts](#scripts) · [Project structure](#project-structure) · [Customization](#customization) · [ViraStack AI](#virastack-ai) · [Deployment](#deployment)
|
|
30
30
|
|
|
@@ -19,7 +19,7 @@ Built on TanStack Router file-based routing with type-safe loaders, nested layou
|
|
|
19
19
|
- [Repository (GitHub)](https://github.com/virastack/start): CLI and templates
|
|
20
20
|
- [README](https://github.com/virastack/start/tree/main/templates/tanstack): Features, structure, and conventions
|
|
21
21
|
- [Architecture guide](https://github.com/virastack/ai/blob/main/templates/core/docs/architecture-guide.md): Placement rules and import conventions
|
|
22
|
-
- [Product docs](https://
|
|
22
|
+
- [Product docs](https://virastack.com/start/docs): ViraStack Start documentation
|
|
23
23
|
|
|
24
24
|
## Key Files & Entry Points
|
|
25
25
|
- [`src/routes/__root.tsx`](https://github.com/virastack/start/blob/main/templates/tanstack/src/routes/__root.tsx): Root route, document shell, providers, SEO head
|