next-vite-router 1.0.6 → 1.0.8

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.
Files changed (3) hide show
  1. package/README.md +287 -248
  2. package/dist/cli.cjs +7 -2
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -1,248 +1,287 @@
1
- # Next Vite Router
2
-
3
- Next Vite Router is an npm package that provides Next.js-style, file-based routing for React applications built with Vite. It generates React Router route objects from a filesystem layout (pages, layouts, not-found), and it exposes a Vite plugin that injects a virtual module to generate routes at build/dev time.
4
-
5
- ## Installation
6
-
7
- Install with your package manager of choice:
8
-
9
- ```bash
10
- pnpm add next-vite-router
11
- # or
12
- npm install next-vite-router
13
- # or
14
- yarn add next-vite-router
15
- ```
16
-
17
- The package has peer dependencies: React, React DOM and React Router DOM. Make sure your project already includes compatible versions (React 18+ is recommended).
18
-
19
- ## CLI / Getting Started
20
-
21
- The quickest way to start a new project with `next-vite-router` is to use the interactive CLI:
22
-
23
- ```bash
24
- npx next-vite-router init
25
- # or
26
- pnpm dlx next-vite-router init
27
- # or
28
- yarn dlx next-vite-router init
29
- # or
30
- bunx next-vite-router init
31
- ```
32
-
33
- The CLI will prompt you for:
34
-
35
- 1. **Project name** name of the folder to create
36
- 2. **Template** which React Vite variant to use:
37
- - `react-ts` (React + TypeScript)
38
- - `react-swc-ts` (React + SWC + TypeScript)
39
- - `react-compiler-ts` (React Compiler + TypeScript)
40
- 3. **Src folder** whether to keep source files in `src/` (recommended) or place them at the project root
41
- 4. **Tailwind CSS** whether to add and configure Tailwind CSS (with `@tailwindcss/vite`)
42
-
43
- ### What the CLI does
44
-
45
- The CLI automates the entire setup:
46
-
47
- - Scaffolds a new Vite + React project using `create-vite`
48
- - Installs `next-vite-router` and `react-router-dom@latest`
49
- - Configures the Vite plugin in `vite.config.ts`
50
- - Sets up path aliases (`@/*`) in `tsconfig.json` and Vite config
51
- - Creates TypeScript declarations for the virtual module (`virtual:next-vite-router`)
52
- - Generates example pages (`app/page.tsx`, `app/layout.tsx`, `app/example/page.tsx`)
53
- - Optionally configures Tailwind CSS with `@tailwindcss/vite` and creates `global.css`
54
-
55
- After the CLI finishes:
56
-
57
- ```bash
58
- cd <your-project-name>
59
- pnpm dev
60
- ```
61
-
62
- Your app is ready with file-based routing!
63
-
64
- ## Quick Start Vite plugin
65
-
66
- The recommended and easiest way to use this library in a Vite app is via the Vite plugin. The plugin exposes a virtual module `virtual:next-vite-router` that provides a `generateRoutes()` function and re-exports `useRoutes` from `react-router-dom` for convenience.
67
-
68
- Example `vite.config.ts`:
69
-
70
- ```ts
71
- import { defineConfig } from 'vite';
72
- import react from '@vitejs/plugin-react';
73
- import { nextViteRouter } from 'next-vite-router';
74
-
75
- export default defineConfig({
76
- plugins: [
77
- react(),
78
- nextViteRouter({ pagesDir: 'src/pages' })
79
- ]
80
- });
81
- ```
82
-
83
- Example usage inside your app. **Important: generate routes once at module level** (not inside the component) to avoid infinite re-renders.
84
-
85
- File: `src/App.tsx`
86
-
87
- ```tsx
88
- import { useRoutes } from 'react-router-dom';
89
- import { generateRoutes } from 'virtual:next-vite-router';
90
-
91
- const routes = generateRoutes();
92
-
93
- export default function App() {
94
- const element = useRoutes(routes);
95
- return element;
96
- }
97
- ```
98
-
99
- File: `src/main.tsx`
100
-
101
- ```tsx
102
- import { StrictMode } from 'react';
103
- import { createRoot } from 'react-dom/client';
104
- import { BrowserRouter } from 'react-router-dom';
105
- import App from './App';
106
-
107
- createRoot(document.getElementById('root')!).render(
108
- <StrictMode>
109
- <BrowserRouter>
110
- <App />
111
- </BrowserRouter>
112
- </StrictMode>
113
- );
114
- ```
115
-
116
- **Key points:**
117
-
118
- - Call `generateRoutes()` once at module level, not inside the component (prevents infinite re-renders).
119
- - Wrap your app with `BrowserRouter` at the entry point (`main.tsx`), not inside `App`.
120
- - `pagesDir` (default: `src/app`) is the directory where you organize your **route files** (`page.tsx`, `layout.tsx`, `not-found.tsx`). It has nothing to do with the `App.tsx` component.
121
- - The virtual module is `virtual:next-vite-router` (the plugin resolves it internally).
122
-
123
- **Example file structure:**
124
-
125
- ```
126
- src/
127
- ├── App.tsx ← Your main app component
128
- ├── main.tsx ← Entry point (with BrowserRouter)
129
- └── app/ ← pagesDir (routes are organized here)
130
- ├── page.tsx ← Home page
131
- ├── layout.tsx ← Root layout
132
- └── dashboard/
133
- ├── page.tsx ← /dashboard page
134
- └── layout.tsx ← Dashboard layout
135
- ```
136
-
137
- TypeScript note:
138
-
139
- If you're using TypeScript in a consuming project, add a declaration file so the virtual module is recognized by the compiler. Create a file such as `src/virtual.d.ts` (or any `*.d.ts` included by your `tsconfig.json`) with the following content:
140
-
141
- ```ts
142
- declare module 'virtual:next-vite-router' {
143
- import type { RouteObject } from 'react-router-dom';
144
-
145
- export const generateRoutes: () => RouteObject[];
146
- export { useRoutes } from 'react-router-dom';
147
- }
148
- ```
149
-
150
- This ensures TypeScript knows the shape of the virtual module provided by the Vite plugin and avoids `Cannot find module 'virtual:next-vite-router'` errors in editors and builds.
151
-
152
- ## Programmatic route generation
153
-
154
- If you prefer to generate routes manually (for custom setups), the package exports helpers you can use with `import.meta.glob`.
155
-
156
- Example:
157
-
158
- ```ts
159
- import { createRouteGenerator } from 'next-vite-router';
160
-
161
- // in a Vite environment
162
- const pages = import.meta.glob('../../pages/**/page.tsx');
163
- const layouts = import.meta.glob('../../pages/**/layout.tsx', { eager: true });
164
- const notFounds = import.meta.glob('../../pages/**/not-found.tsx');
165
-
166
- const generateRoutes = createRouteGenerator(pages, layouts, notFounds);
167
- const routes = generateRoutes();
168
- ```
169
-
170
- Use this when you need a fully custom glob layout or want to call the generator at runtime.
171
-
172
- ## API Reference
173
-
174
- Exports from the package (see `src/index.ts`):
175
-
176
- - `createRouteGenerator(pages, layouts, notFounds)` returns a function that builds `RouteObject[]` using your globs.
177
- - `buildRouteTree` builds the intermediate route tree from page/layout/not-found globs.
178
- - `treeToRoutes` converts the route tree to React Router routes.
179
- - `registerMiddleware`, `clearMiddlewares` middleware helpers to manage registered middlewares.
180
- - `configureRouter` configure router-level options.
181
- - `nextViteRouter(options)` Vite plugin factory. Options:
182
- - `pagesDir?: string` (default: `src/app`)
183
- - `pageFile?: string` (default: `page.tsx`)
184
- - `layoutFile?: string` (default: `layout.tsx`)
185
- - `notFoundFile?: string` (default: `not-found.tsx`)
186
- - Types exported: `RouterConfig`, `RouteNode`, `RouteMiddleware`, `NextViteRouterPluginOptions`.
187
-
188
- ### `configureRouter(config: RouterConfig)`
189
-
190
- Use `configureRouter` to set global router options for runtime behavior. The function merges the provided `config` with any existing configuration.
191
-
192
- Common `RouterConfig` fields:
193
-
194
- - `loadingFallback?: React.ComponentType` component shown while lazy-loaded page components load.
195
- - `pagesDir?: string` path used by the generator to resolve pages (useful if you need to override defaults at runtime).
196
- - `enableLazyLoading?: boolean` when true, pages are wrapped to load lazily.
197
-
198
- Example:
199
-
200
- ```ts
201
- import { configureRouter } from 'next-vite-router';
202
-
203
- configureRouter({
204
- loadingFallback: () => <div>Loading...</div>,
205
- enableLazyLoading: true,
206
- });
207
- ```
208
-
209
- Call `configureRouter` during app bootstrap before calling `generateRoutes()`.
210
-
211
- ### `registerMiddleware(pattern: RegExp, middleware: RouteMiddleware)`
212
-
213
- `registerMiddleware` lets you register middleware functions that will be applied to route elements whose path matches the provided `pattern` (a `RegExp`). Middlewares receive the route element (`ReactElement`) and should return a new element (for example wrapping it with providers, guards, or layout components).
214
-
215
- Important details:
216
-
217
- - Middlewares are stored in insertion order and applied sequentially.
218
- - To remove all registered middlewares, use `clearMiddlewares()`.
219
- - The internal helper `applyMiddlewares(path, element)` is used when constructing the final route element.
220
-
221
- Example:
222
-
223
- ```ts
224
- import { registerMiddleware } from 'next-vite-router';
225
-
226
- registerMiddleware(/^\/dashboard/, (element) => (
227
- <AuthGuard>{element}</AuthGuard>
228
- ));
229
- ```
230
-
231
- ## Configuration options (plugin)
232
-
233
- The plugin takes an options object. Defaults are:
234
-
235
- ```ts
236
- {
237
- pagesDir: 'src/app',
238
- pageFile: 'page.tsx',
239
- layoutFile: 'layout.tsx',
240
- notFoundFile: 'not-found.tsx',
241
- }
242
- ```
243
-
244
- Pass a custom `pagesDir` if your project uses `src/pages` or another convention.
245
-
246
- ## License
247
-
248
- MIT
1
+ # Next Vite Router
2
+
3
+ Next Vite Router is an npm package that provides Next.js-style, file-based routing for React applications built with Vite. It generates React Router route objects from a filesystem layout (pages, layouts, not-found), and it exposes a Vite plugin that injects a virtual module to generate routes at build/dev time.
4
+
5
+ ## Installation
6
+
7
+ Install with your package manager of choice:
8
+
9
+ ```next-vite-router/README.md#L1-4
10
+ pnpm add next-vite-router
11
+ # or
12
+ npm install next-vite-router
13
+ # or
14
+ yarn add next-vite-router
15
+ ```
16
+
17
+ The package has peer dependencies: React, React DOM and React Router DOM. Make sure your project already includes compatible versions (React 18+ is recommended).
18
+
19
+ ## CLI / Getting Started
20
+
21
+ The quickest way to start a new project with `next-vite-router` is to use the interactive CLI:
22
+
23
+ ```next-vite-router/README.md#L5-10
24
+ npx next-vite-router init
25
+ # or
26
+ pnpm dlx next-vite-router init
27
+ # or
28
+ yarn dlx next-vite-router init
29
+ # or
30
+ bunx next-vite-router init
31
+ ```
32
+
33
+ The CLI will prompt you for:
34
+
35
+ 1. **Project name** — name of the folder to create
36
+ 2. **Template** — which React Vite variant to use:
37
+ - `react-ts` (React + TypeScript)
38
+ - `react-swc-ts` (React + SWC + TypeScript)
39
+ - `react-compiler-ts` (React Compiler + TypeScript)
40
+ 3. **Src folder** — whether to keep source files in `src/` (recommended) or place them at the project root
41
+ 4. **Tailwind CSS** — whether to add and configure Tailwind CSS (with `@tailwindcss/vite`)
42
+
43
+ ### What the CLI does
44
+
45
+ The CLI automates the entire setup:
46
+
47
+ - Scaffolds a new Vite + React project using `create-vite`
48
+ - Installs `next-vite-router` and `react-router-dom@latest`
49
+ - Configures the Vite plugin in `vite.config.ts`
50
+ - Sets up path aliases (`@/*`) in `tsconfig.json` and Vite config
51
+ - Creates TypeScript declarations for the virtual module (`virtual:next-vite-router`)
52
+ - Generates example pages (`app/page.tsx`, `app/layout.tsx`, `app/example/page.tsx`)
53
+ - Optionally configures Tailwind CSS with `@tailwindcss/vite` and creates `global.css`
54
+
55
+ After the CLI finishes:
56
+
57
+ ```next-vite-router/README.md#L11-12
58
+ cd <your-project-name>
59
+ pnpm dev
60
+ ```
61
+
62
+ Your app is ready with file-based routing!
63
+
64
+ ## Quick Start — Vite plugin
65
+
66
+ The recommended and easiest way to use this library in a Vite app is via the Vite plugin. The plugin exposes a virtual module `virtual:next-vite-router` that provides a `generateRoutes()` function and re-exports `useRoutes` from `react-router-dom` for convenience.
67
+
68
+ Example `vite.config.ts` usage:
69
+
70
+ ```next-vite-router/README.md#L13-18
71
+ import { defineConfig } from 'vite';
72
+ import react from '@vitejs/plugin-react';
73
+ import { nextViteRouter } from 'next-vite-router';
74
+
75
+ export default defineConfig({
76
+ plugins: [
77
+ react(),
78
+ nextViteRouter({ pagesDir: 'src/pages' })
79
+ ]
80
+ });
81
+ ```
82
+
83
+ Example usage inside your app. Important: call `generateRoutes()` once at module level (not inside a component) to avoid infinite re-renders.
84
+
85
+ File: `src/App.tsx`
86
+
87
+ ```next-vite-router/README.md#L19-24
88
+ import { useRoutes } from 'react-router-dom';
89
+ import { generateRoutes } from 'virtual:next-vite-router';
90
+
91
+ const routes = generateRoutes();
92
+
93
+ export default function App() {
94
+ const element = useRoutes(routes);
95
+ return element;
96
+ }
97
+ ```
98
+
99
+ File: `src/main.tsx`
100
+
101
+ ```next-vite-router/README.md#L25-33
102
+ import { StrictMode } from 'react';
103
+ import { createRoot } from 'react-dom/client';
104
+ import { BrowserRouter } from 'react-router-dom';
105
+ import App from './App';
106
+
107
+ createRoot(document.getElementById('root')!).render(
108
+ <StrictMode>
109
+ <BrowserRouter>
110
+ <App />
111
+ </BrowserRouter>
112
+ </StrictMode>
113
+ );
114
+ ```
115
+
116
+ Key points:
117
+
118
+ - Call `generateRoutes()` once at module level, not inside the component (prevents infinite re-renders).
119
+ - Wrap your app with `BrowserRouter` at the entry point (`main.tsx`), not inside `App`.
120
+ - `pagesDir` (default: `src/app`) is the directory where you organize your route files (`page.tsx`, `layout.tsx`, `not-found.tsx`). It has nothing to do with your `App.tsx` component.
121
+ - The virtual module is `virtual:next-vite-router` (the plugin resolves it internally).
122
+
123
+ Example file structure:
124
+
125
+ ```next-vite-router/README.md#L34-42
126
+ src/
127
+ ├── App.tsx ← Your main app component
128
+ ├── main.tsx ← Entry point (with BrowserRouter)
129
+ └── app/ ← pagesDir (routes are organized here)
130
+ ├── page.tsx ← Home page
131
+ ├── layout.tsx ← Root layout
132
+ └── dashboard/
133
+ ├── page.tsx ← /dashboard page
134
+ └── layout.tsx ← Dashboard layout
135
+ ```
136
+
137
+ TypeScript note:
138
+
139
+ If you're using TypeScript in a consuming project, add a declaration file so the virtual module is recognized by the compiler. Create a file such as `src/virtual.d.ts` (or any `*.d.ts` included by your `tsconfig.json`) with the following content:
140
+
141
+ ```next-vite-router/README.md#L43-47
142
+ declare module 'virtual:next-vite-router' {
143
+ import type { RouteObject } from 'react-router-dom';
144
+
145
+ export const generateRoutes: () => RouteObject[];
146
+ export { useRoutes } from 'react-router-dom';
147
+ }
148
+ ```
149
+
150
+ This ensures TypeScript knows the shape of the virtual module provided by the Vite plugin and avoids `Cannot find module 'virtual:next-vite-router'` errors in editors and builds.
151
+
152
+ ## Programmatic route generation
153
+
154
+ If you prefer to generate routes manually (for custom setups), the package exports helpers you can use with `import.meta.glob`.
155
+
156
+ Example:
157
+
158
+ ```next-vite-router/README.md#L48-54
159
+ import { createRouteGenerator } from 'next-vite-router';
160
+
161
+ // in a Vite environment
162
+ const pages = import.meta.glob('../../pages/**/page.tsx');
163
+ const layouts = import.meta.glob('../../pages/**/layout.tsx', { eager: true });
164
+ const notFounds = import.meta.glob('../../pages/**/not-found.tsx');
165
+
166
+ const generateRoutes = createRouteGenerator(pages, layouts, notFounds);
167
+ const routes = generateRoutes();
168
+ ```
169
+
170
+ Use this when you need a fully custom glob layout or want to call the generator at runtime.
171
+
172
+ ## Route folder conventions: grouping vs dynamic segments
173
+
174
+ This library follows Next.js-style conventions for naming folders that affect routing. Two common patterns are:
175
+
176
+ - Parentheses for grouping routes without affecting the URL (route groups).
177
+ - Square brackets for dynamic route segments (dynamic params in the URL).
178
+
179
+ Concrete examples:
180
+
181
+ ```next-vite-router/README.md#L55-62
182
+ - Structure:
183
+ - `src/app/(components)/header/page.tsx`
184
+ - `src/app/blog/[id]/page.tsx`
185
+
186
+ - Behavior:
187
+ - `header/page.tsx` will be included as a page, but the `(components)` folder will NOT appear in the generated URL. The page will be reachable at `/header` (or depending on nesting, at `/<parent>/header`).
188
+ - `blog/[id]/page.tsx` will produce a route like `/blog/:id` where `:id` is a dynamic parameter.
189
+ ```
190
+
191
+ Notes and additional patterns:
192
+
193
+ - Route groups (folders named with parentheses, e.g. `(admin)` or `(components)`) are useful to organize files, share layouts, or split code visually without adding path segments. Anything inside a group is treated as if the grouping folder does not exist in the URL.
194
+ - Dynamic segments use square brackets (e.g. `[slug]`, `[id]`). They map to route parameters and are available to your components via React Router's `useParams()` hook.
195
+ - Catch-all segments are commonly written as `[...slug]` and typically map to a wildcard or splat parameter. Optional catch-all segments are written `[[...slug]]` in Next.js — if you use or expect these conventions, confirm the behavior in your app (this library mirrors Next.js-style patterns, but check your generated routes when using more advanced patterns).
196
+
197
+ Examples of expected mappings:
198
+
199
+ ```next-vite-router/README.md#L63-74
200
+ src/app/
201
+ ├── blog/
202
+ │ ├── page.tsx ← /blog
203
+ │ └── [id]/page.tsx ← /blog/:id
204
+ └── (components)/
205
+ └── header/
206
+ └── page.tsx ← /header (the `(components)` folder is not part of the path)
207
+ ```
208
+
209
+ If you ever need to verify the final route objects, call `generateRoutes()` (the virtual module) and inspect the returned `RouteObject[]` to confirm path strings and param names.
210
+
211
+ ## API Reference
212
+
213
+ Exports from the package (see `src/index.ts`):
214
+
215
+ - `createRouteGenerator(pages, layouts, notFounds)` — returns a function that builds `RouteObject[]` using your globs.
216
+ - `buildRouteTree` — builds the intermediate route tree from page/layout/not-found globs.
217
+ - `treeToRoutes` — converts the route tree to React Router routes.
218
+ - `registerMiddleware`, `clearMiddlewares` — middleware helpers to manage registered middlewares.
219
+ - `configureRouter` — configure router-level options.
220
+ - `nextViteRouter(options)` — Vite plugin factory. Options:
221
+ - `pagesDir?: string` (default: `src/app`)
222
+ - `pageFile?: string` (default: `page.tsx`)
223
+ - `layoutFile?: string` (default: `layout.tsx`)
224
+ - `notFoundFile?: string` (default: `not-found.tsx`)
225
+ - Types exported: `RouterConfig`, `RouteNode`, `RouteMiddleware`, `NextViteRouterPluginOptions`.
226
+
227
+ ### `configureRouter(config: RouterConfig)`
228
+
229
+ Use `configureRouter` to set global router options for runtime behavior. The function merges the provided `config` with any existing configuration.
230
+
231
+ Common `RouterConfig` fields:
232
+
233
+ - `loadingFallback?: React.ComponentType` — component shown while lazy-loaded page components load.
234
+ - `pagesDir?: string` — path used by the generator to resolve pages (useful if you need to override defaults at runtime).
235
+ - `enableLazyLoading?: boolean` — when true, pages are wrapped to load lazily.
236
+
237
+ Example:
238
+
239
+ ```next-vite-router/README.md#L75-80
240
+ import { configureRouter } from 'next-vite-router';
241
+
242
+ configureRouter({
243
+ loadingFallback: () => <div>Loading...</div>,
244
+ enableLazyLoading: true,
245
+ });
246
+ ```
247
+
248
+ Call `configureRouter` during app bootstrap before calling `generateRoutes()`.
249
+
250
+ ### `registerMiddleware(pattern: RegExp, middleware: RouteMiddleware)`
251
+
252
+ `registerMiddleware` lets you register middleware functions that will be applied to route elements whose path matches the provided `pattern` (a `RegExp`). Middlewares receive the route element (`ReactElement`) and should return a new element (for example wrapping it with providers, guards, or layout components).
253
+
254
+ Important details:
255
+
256
+ - Middlewares are stored in insertion order and applied sequentially.
257
+ - To remove all registered middlewares, use `clearMiddlewares()`.
258
+ - The internal helper `applyMiddlewares(path, element)` is used when constructing the final route element.
259
+
260
+ Example:
261
+
262
+ ```next-vite-router/README.md#L81-86
263
+ import { registerMiddleware } from 'next-vite-router';
264
+
265
+ registerMiddleware(/^\/dashboard/, (element) => (
266
+ <AuthGuard>{element}</AuthGuard>
267
+ ));
268
+ ```
269
+
270
+ ## Configuration options (plugin)
271
+
272
+ The plugin takes an options object. Defaults are:
273
+
274
+ ```next-vite-router/README.md#L87-92
275
+ {
276
+ pagesDir: 'src/app',
277
+ pageFile: 'page.tsx',
278
+ layoutFile: 'layout.tsx',
279
+ notFoundFile: 'not-found.tsx',
280
+ }
281
+ ```
282
+
283
+ Pass a custom `pagesDir` if your project uses `src/pages` or another convention.
284
+
285
+ ## License
286
+
287
+ MIT
package/dist/cli.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  "use strict";
2
3
  const commander = require("commander");
3
4
  const node_child_process = require("node:child_process");
@@ -220,7 +221,7 @@ import { generateRoutes, useRoutes } from 'virtual:next-vite-router';
220
221
 
221
222
  const routes = generateRoutes();
222
223
 
223
- function App() {
224
+ export default function App() {
224
225
  const element = useRoutes(routes);
225
226
  return element;
226
227
  }
@@ -530,9 +531,13 @@ const init = new commander.Command().name("init").description(
530
531
  Project "${projectName}" is ready!
531
532
  `);
532
533
  });
534
+ const version = "1.0.8";
535
+ const pkg = {
536
+ version
537
+ };
533
538
  async function main() {
534
539
  const program = new commander.Command();
535
- program.name("next-vite-router").version("1.0.5").addCommand(init);
540
+ program.name("create-next-vite-router").version(pkg.version).addCommand(init);
536
541
  program.parse(process.argv);
537
542
  }
538
543
  main();
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "next-vite-router",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Next.js-like file-based routing for React + Vite",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "bin": {
9
- "next-vite-router": "./dist/cli.cjs"
9
+ "create-next-vite-router": "./dist/cli.cjs"
10
10
  },
11
11
  "exports": {
12
12
  ".": {
@@ -64,6 +64,6 @@
64
64
  "build": "vite build && vite build -c vite.config.cli.ts",
65
65
  "test:local": "node test/test-package.js",
66
66
  "preview": "pnpm pack --dry-run",
67
- "cli": "cd test && node ../dist/cli.cjs init"
67
+ "cli": "cd test && node ../dist/cli.cjs"
68
68
  }
69
69
  }