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 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
- ## Options
77
+ ## Commands and options
78
78
 
79
- | Flag | Description |
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 understand which tools and templates are preferred by the community, ViraStack collects strictly anonymous usage data (template, i18n choice, selected tools, package manager, and CLI version). Absolutely no personal data, project names, or file paths are collected.
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virastack",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Scaffold new projects and add tools from the ViraStack ecosystem with a single command.",
5
5
  "author": {
6
6
  "name": "Ömer Gülçiçek (ViraStack)",
@@ -24,7 +24,7 @@ _The Next.js boilerplate that feels effortless._
24
24
 
25
25
  ---
26
26
 
27
- **Docs:** [See the docs](https://www.virastack.com/nextjs-boilerplate/)
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
 
@@ -8,7 +8,7 @@ const withBundleAnalyzer = createBundleAnalyzer({
8
8
  });
9
9
 
10
10
  const nextConfig: NextConfig = {
11
- reactCompiler: true,
11
+ reactCompiler: process.env.NODE_ENV === "production",
12
12
  turbopack: {
13
13
  root: path.join(import.meta.dirname),
14
14
  },
@@ -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://www.virastack.com/nextjs-boilerplate/): ViraStack Next.js boilerplate
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://www.virastack.com/)
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://www.virastack.com/nextjs-boilerplate/)
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
 
@@ -11,7 +11,7 @@ const withBundleAnalyzer = createBundleAnalyzer({
11
11
  });
12
12
 
13
13
  const nextConfig: NextConfig = {
14
- reactCompiler: true,
14
+ reactCompiler: process.env.NODE_ENV === "production",
15
15
  turbopack: {
16
16
  root: path.join(import.meta.dirname),
17
17
  },
@@ -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://www.virastack.com/nextjs-boilerplate/): ViraStack Next.js boilerplate
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
@@ -0,0 +1,5 @@
1
+ import { notFound } from "next/navigation";
2
+
3
+ export default function CatchAllPage() {
4
+ notFound();
5
+ }
@@ -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 { getMessages, setRequestLocale } from "next-intl/server";
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.includes(locale as "en" | "tr")) {
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 messages={messages}>
54
+ <NextIntlClientProvider>
57
55
  <NuqsAdapter>
58
56
  <Providers>{children}</Providers>
59
57
  </NuqsAdapter>
@@ -0,0 +1,6 @@
1
+ import type { ReactNode } from "react";
2
+
3
+ // Required by Next.js when `app/not-found.tsx` exists.
4
+ export default function RootLayout({ children }: { children: ReactNode }) {
5
+ return children;
6
+ }
@@ -0,0 +1,13 @@
1
+ "use client";
2
+
3
+ import Error from "next/error";
4
+
5
+ export default function GlobalNotFound() {
6
+ return (
7
+ <html lang="en">
8
+ <body>
9
+ <Error statusCode={404} />
10
+ </body>
11
+ </html>
12
+ );
13
+ }
@@ -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
- let locale = await requestLocale;
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
- const handleI18nRouting = createMiddleware(routing);
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://www.virastack.com/)
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://www.virastack.com/): ViraStack
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