ts-file-router 6.0.0 â 6.0.2
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 +226 -46
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js +47 -30
- package/dist/helpers/serializeHelper.d.ts.map +1 -1
- package/dist/helpers/serializeHelper.js +9 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
# ðĶ ts-file-router
|
|
2
2
|
|
|
3
|
-
A lightweight
|
|
4
|
-
Automatically scans folders and outputs a clean, structured `routes.ts` tree ready for dynamic imports (e.g., `React.lazy`).
|
|
3
|
+
A lightweight **filesystem router generator** for TypeScript projects. Automatically scans your folder structure and generates a clean, typed `routes.ts` tree ready for dynamic imports (e.g., `React.lazy`).
|
|
5
4
|
|
|
6
5
|
---
|
|
7
6
|
|
|
8
7
|
## âĻ Features
|
|
9
8
|
|
|
10
|
-
- ð
|
|
11
|
-
- ð
|
|
12
|
-
- âïļ Works
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
9
|
+
- ð **Automatic folder scanning** - Recursively scans your pages/screens directory
|
|
10
|
+
- ð **Generated TypeScript routes** - Fully typed `routes.ts` file with `as const` assertions
|
|
11
|
+
- âïļ **Framework agnostic** - Works with React.lazy, Vue, Solid, or any framework with dynamic imports
|
|
12
|
+
- ðŠķ **Zero runtime dependencies** - Only used at build/dev time
|
|
13
|
+
- ð **File watcher support** - Auto-regenerate routes when files change (powered by Chokidar)
|
|
14
|
+
- ðĻ **Biome formatting** - Output files are automatically formatted with Biome
|
|
15
|
+
- ð§Đ **Vite plugin** - Seamless integration with Vite dev server
|
|
16
|
+
- ðŦ **Smart file filtering** - Ignores `index` files, `_` prefixed files (private routes), and output files
|
|
17
|
+
- ð **Full TypeScript support** - Complete `.d.ts` definitions included
|
|
17
18
|
|
|
18
19
|
---
|
|
19
20
|
|
|
@@ -21,16 +22,24 @@ Automatically scans folders and outputs a clean, structured `routes.ts` tree rea
|
|
|
21
22
|
|
|
22
23
|
```bash
|
|
23
24
|
npm install ts-file-router
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Optional dependencies:**
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# For file watcher support
|
|
31
|
+
npm install chokidar
|
|
26
32
|
|
|
33
|
+
# Vite is automatically supported as a peer dependency
|
|
27
34
|
```
|
|
28
35
|
|
|
29
36
|
---
|
|
30
37
|
|
|
31
|
-
##
|
|
38
|
+
## ð Quick Start
|
|
39
|
+
|
|
40
|
+
### 1. Basic Usage (One-time generation)
|
|
32
41
|
|
|
33
|
-
Create a script to generate your routes
|
|
42
|
+
Create a script to generate your routes:
|
|
34
43
|
|
|
35
44
|
```js
|
|
36
45
|
// scripts/generate-routes.mjs
|
|
@@ -38,68 +47,239 @@ import { generateRoutes } from 'ts-file-router';
|
|
|
38
47
|
|
|
39
48
|
generateRoutes({
|
|
40
49
|
baseFolder: 'src/screens',
|
|
41
|
-
outputFile: '
|
|
50
|
+
outputFile: 'routes.ts',
|
|
42
51
|
});
|
|
43
52
|
```
|
|
44
53
|
|
|
45
|
-
|
|
54
|
+
Run it:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
node scripts/generate-routes.mjs
|
|
58
|
+
```
|
|
46
59
|
|
|
47
|
-
|
|
60
|
+
### 2. With File Watcher (Auto-regenerate on changes)
|
|
48
61
|
|
|
49
62
|
```js
|
|
50
|
-
// scripts/
|
|
63
|
+
// scripts/generate-routes.mjs
|
|
64
|
+
import { generateRoutes } from 'ts-file-router';
|
|
65
|
+
|
|
66
|
+
generateRoutes({
|
|
67
|
+
baseFolder: 'src/screens',
|
|
68
|
+
outputFile: 'routes.ts',
|
|
69
|
+
options: {
|
|
70
|
+
watcher: {
|
|
71
|
+
watch: true,
|
|
72
|
+
debounce: 500, // Wait 500ms after changes before regenerating
|
|
73
|
+
},
|
|
74
|
+
exitCodeOnResolution: false, // Don't exit process after generation
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
This will keep running and regenerate routes whenever you add, remove, or modify files in the `src/screens` folder.
|
|
80
|
+
|
|
81
|
+
### 3. With Vite Plugin
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
// vite.config.ts
|
|
85
|
+
import { defineConfig } from 'vite';
|
|
51
86
|
import { generateRoutesPlugin } from 'ts-file-router';
|
|
52
87
|
|
|
53
|
-
// https://vite.dev/config/
|
|
54
88
|
export default defineConfig({
|
|
55
89
|
plugins: [
|
|
56
90
|
generateRoutesPlugin({
|
|
57
91
|
baseFolder: 'src/screens',
|
|
58
|
-
outputFile: 'screens.ts',
|
|
92
|
+
outputFile: 'src/screens/routes.ts',
|
|
93
|
+
// Optional: customize watcher behavior
|
|
94
|
+
options: {
|
|
95
|
+
watcher: { watch: true, debounce: 500 },
|
|
96
|
+
exitCodeOnResolution: false,
|
|
97
|
+
},
|
|
59
98
|
}),
|
|
60
99
|
],
|
|
61
100
|
});
|
|
62
101
|
```
|
|
63
102
|
|
|
64
|
-
|
|
103
|
+
The plugin automatically runs during Vite's dev server (`vite dev`) and regenerates routes on file changes.
|
|
104
|
+
|
|
105
|
+
---
|
|
65
106
|
|
|
66
|
-
|
|
107
|
+
## ð How It Works
|
|
67
108
|
|
|
68
|
-
|
|
69
|
-
// scripts/generate-routes.mjs
|
|
70
|
-
import { generateRoutes } from 'ts-file-router';
|
|
109
|
+
Given this folder structure:
|
|
71
110
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
111
|
+
```
|
|
112
|
+
src/screens/ # Home page
|
|
113
|
+
âââ about/
|
|
114
|
+
â âââ page.tsx # About page
|
|
115
|
+
âââ users/
|
|
116
|
+
â âââ page.tsx # Users list
|
|
117
|
+
â âââ profile/
|
|
118
|
+
â â âââ page.tsx # User profile
|
|
119
|
+
â âââ _private/
|
|
120
|
+
â âââ page.tsx # Ignored (starts with _)
|
|
121
|
+
âââ index.tsx # Ignored (index file)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Generates:
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
// GENERATED WITH TS-FILE-ROUTER DO NOT EDIT
|
|
128
|
+
export const routes = {
|
|
129
|
+
about: {
|
|
130
|
+
path: '/about',
|
|
131
|
+
import: () => import('./about/page'),
|
|
78
132
|
},
|
|
79
|
-
|
|
133
|
+
users: {
|
|
134
|
+
page: {
|
|
135
|
+
path: '/users',
|
|
136
|
+
import: () => import('./users/page'),
|
|
137
|
+
},
|
|
138
|
+
profile: {
|
|
139
|
+
path: '/users/profile',
|
|
140
|
+
import: () => import('./users/profile/page'),
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
} as const;
|
|
80
144
|
```
|
|
81
145
|
|
|
82
|
-
|
|
146
|
+
---
|
|
83
147
|
|
|
84
|
-
|
|
148
|
+
## ð§ Configuration Options
|
|
85
149
|
|
|
86
|
-
|
|
150
|
+
### `generateRoutes()` Parameters
|
|
87
151
|
|
|
88
|
-
|
|
152
|
+
| Parameter | Type | Required | Description |
|
|
153
|
+
| ------------ | ------------------------ | -------- | ---------------------------------- |
|
|
154
|
+
| `baseFolder` | `string` | â
Yes | Root directory to scan for routes |
|
|
155
|
+
| `outputFile` | `string` | â
Yes | Path for the generated routes file |
|
|
156
|
+
| `options` | `TGenerateRoutesOptions` | â No | Additional configuration |
|
|
89
157
|
|
|
90
|
-
|
|
158
|
+
### Options Object
|
|
91
159
|
|
|
92
|
-
|
|
160
|
+
```ts
|
|
161
|
+
interface TGenerateRoutesOptions {
|
|
162
|
+
watcher?: {
|
|
163
|
+
watch: boolean; // Enable file watching
|
|
164
|
+
debounce?: number; // Debounce delay in ms (default: 500)
|
|
165
|
+
};
|
|
166
|
+
exitCodeOnResolution?: boolean; // Exit process after generation (default: true)
|
|
167
|
+
}
|
|
168
|
+
```
|
|
93
169
|
|
|
94
|
-
|
|
170
|
+
### `exitCodeOnResolution`
|
|
95
171
|
|
|
96
|
-
|
|
172
|
+
- **`true`** (default for CLI): Process exits with code `0` on success or `1` on error
|
|
173
|
+
- **`false`** (default for Vite/plugin): Process keeps running (required for watchers)
|
|
97
174
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## ðŊ Usage Examples
|
|
178
|
+
|
|
179
|
+
### With React Router And React Lazy Using
|
|
180
|
+
|
|
181
|
+
```tsx
|
|
182
|
+
import { routes } from './screens/routes';
|
|
183
|
+
import { BrowserRouter, Routes, Route } from 'react-router-dom';
|
|
184
|
+
import React from 'react';
|
|
185
|
+
|
|
186
|
+
const About = lazy(() =>
|
|
187
|
+
routes.about.import().then((r) => ({ default: res.About })),
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
const Profile = lazy(() =>
|
|
191
|
+
routes.users.profile.import().then((r) => ({ default: res.Profile })),
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
function App() {
|
|
195
|
+
return (
|
|
196
|
+
<BrowserRouter>
|
|
197
|
+
<Routes>
|
|
198
|
+
<Route path={routes.about.path} element={<About />} />
|
|
199
|
+
<Route path={routes.users.profile.path} element={<Profile />} />
|
|
200
|
+
</Routes>
|
|
201
|
+
</BrowserRouter>
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## ðŦ File Filtering Rules
|
|
209
|
+
|
|
210
|
+
The following files/folders are **automatically ignored**:
|
|
211
|
+
|
|
212
|
+
- **`index.*`** files - Index files are skipped
|
|
213
|
+
- **`_` prefixed** files/folders - Files starting with underscore are treated as private
|
|
214
|
+
- **Output file** - The generated routes file is ignored to prevent infinite loops
|
|
215
|
+
|
|
216
|
+
This allows you to have helper files, components, or private routes alongside your page files without polluting the routes tree.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## ðĶ Output File Structure
|
|
221
|
+
|
|
222
|
+
The generated file is a TypeScript module with:
|
|
223
|
+
|
|
224
|
+
- â
`export const routes` - Named export with all routes
|
|
225
|
+
- â
`as const` assertion - Full type inference for route paths and imports
|
|
226
|
+
|
|
227
|
+
## ð Advanced Usage
|
|
228
|
+
|
|
229
|
+
### Custom Route File Names
|
|
230
|
+
|
|
231
|
+
By default, any file (except ignored ones) becomes a route. You can control this by:
|
|
232
|
+
|
|
233
|
+
1. Using a consistent naming convention (e.g., all pages named `page.tsx`)
|
|
234
|
+
2. Using `_` prefix for non-route files: `_components.tsx`, `_utils.ts`
|
|
235
|
+
|
|
236
|
+
### Watcher Events
|
|
237
|
+
|
|
238
|
+
When using the watcher, routes regenerate on:
|
|
239
|
+
|
|
240
|
+
- `add` - New file added
|
|
241
|
+
- `addDir` - New directory added
|
|
242
|
+
- `change` - File modified
|
|
243
|
+
- `unlink` - File deleted
|
|
244
|
+
- `unlinkDir` - Directory deleted
|
|
245
|
+
|
|
246
|
+
If the output file is deleted, it's automatically regenerated.
|
|
247
|
+
|
|
248
|
+
### Graceful Shutdown
|
|
249
|
+
|
|
250
|
+
The watcher listens for:
|
|
251
|
+
|
|
252
|
+
- `SIGINT` (Ctrl+C) - Graceful cleanup
|
|
253
|
+
- `SIGTERM` - Container/process termination
|
|
254
|
+
|
|
255
|
+
Both trigger proper watcher cleanup before exit.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## ð Tips
|
|
260
|
+
|
|
261
|
+
1. **Add to `package.json`**:
|
|
262
|
+
|
|
263
|
+
```json
|
|
264
|
+
{
|
|
265
|
+
"scripts": {
|
|
266
|
+
"generate:routes": "node scripts/generate-routes.mjs",
|
|
267
|
+
"dev": "npm run generate:routes && vite",
|
|
268
|
+
"dev:watch": "node scripts/generate-routes.mjs --watch"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
105
271
|
```
|
|
272
|
+
|
|
273
|
+
2. **Use relative paths in output**: The `outputFile` path is relative to `baseFolder`.
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## ðĪ Contributing
|
|
278
|
+
|
|
279
|
+
Found a bug or have a feature request? Open an issue or submit a PR!
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## ð License
|
|
284
|
+
|
|
285
|
+
ISC ÂĐ MatheusF10
|
package/dist/generator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAKrE,eAAO,MAAM,cAAc,GAAI,sCAI5B,qBAAqB,
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAKrE,eAAO,MAAM,cAAc,GAAI,sCAI5B,qBAAqB,SAmKvB,CAAC"}
|
package/dist/generator.js
CHANGED
|
@@ -8,38 +8,45 @@ export const generateRoutes = ({ baseFolder, outputFile, options = { exitCodeOnR
|
|
|
8
8
|
const output = path.resolve(basePath, outputFile);
|
|
9
9
|
const mapRoutes = async (dir) => {
|
|
10
10
|
const routes = {};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (!directory.length || directory.length === 0) {
|
|
11
|
+
try {
|
|
12
|
+
const directory = await fs.readdir(dir);
|
|
13
|
+
if (!directory || !directory.length || directory.length === 0) {
|
|
14
14
|
throw new Error(`Invalid pages structure: The folder "${dir}" must contain at least one valid file.`);
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
for (const file of directory) {
|
|
17
|
+
// ignore index files, underscore marked, or route file generated
|
|
18
|
+
if (FileHelper.getIgnoredFiles(file, outputFile)) {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
const fullPath = path.join(dir, file);
|
|
22
|
+
// Get directory info to control file or folder
|
|
23
|
+
const dirInfo = await fs.stat(fullPath);
|
|
24
|
+
// Path to browser sync if necessary
|
|
25
|
+
const relativePath = '/' + path.relative(basePath, dir);
|
|
26
|
+
const importPath = './' + path.relative(basePath, fullPath);
|
|
27
|
+
// Remove extension from file to naming the route
|
|
28
|
+
const key = path.basename(file, path.extname(file));
|
|
29
|
+
if (dirInfo.isDirectory()) {
|
|
30
|
+
// Dev friendly when enter in this conditional file is a directory(folder)
|
|
31
|
+
const directory = file;
|
|
32
|
+
// Recursively for sub directories
|
|
33
|
+
routes[directory] = await mapRoutes(fullPath);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
// Mount the route object with path like "/folder" and import
|
|
37
|
+
// import will be like "import((./baseFolder/file or ./baseFolder/folders).extension)"
|
|
38
|
+
routes[key] = {
|
|
39
|
+
// Normalize path
|
|
40
|
+
path: FileHelper.cleanPaths(relativePath),
|
|
41
|
+
// Normalize import path to esm pattern
|
|
42
|
+
import: FileHelper.cleanPaths(importPath),
|
|
43
|
+
};
|
|
34
44
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
routes
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// Normalize import path to esm pattern
|
|
41
|
-
import: FileHelper.cleanPaths(importPath),
|
|
42
|
-
};
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
console.error(`Error mapping routes ${dir}:`, err);
|
|
48
|
+
// Stop the process immediatelly
|
|
49
|
+
process.exit(1);
|
|
43
50
|
}
|
|
44
51
|
return routes;
|
|
45
52
|
};
|
|
@@ -80,6 +87,7 @@ export const generateRoutes = ({ baseFolder, outputFile, options = { exitCodeOnR
|
|
|
80
87
|
createRoutes();
|
|
81
88
|
}, debounce);
|
|
82
89
|
};
|
|
90
|
+
runFromWatcher();
|
|
83
91
|
watcher.on('all', (ev, file) => {
|
|
84
92
|
const ignoredOuput = FileHelper.getIgnoredOutputFile(file, outputFile);
|
|
85
93
|
// If output file as deleted regenerate it
|
|
@@ -102,7 +110,16 @@ export const generateRoutes = ({ baseFolder, outputFile, options = { exitCodeOnR
|
|
|
102
110
|
runFromWatcher();
|
|
103
111
|
}
|
|
104
112
|
});
|
|
105
|
-
|
|
113
|
+
const cleanup = async () => {
|
|
114
|
+
console.log('ð Stopping watcher...');
|
|
115
|
+
await watcher.close();
|
|
116
|
+
// Code 0 to finish the process as success
|
|
117
|
+
process.exit(0);
|
|
118
|
+
};
|
|
119
|
+
// If CRTL + C was pressed
|
|
120
|
+
process.on('SIGINT', cleanup);
|
|
121
|
+
// If Script or container treatment
|
|
122
|
+
process.on('SIGTERM', cleanup);
|
|
106
123
|
};
|
|
107
124
|
if (!!options.watcher) {
|
|
108
125
|
watcher(options.watcher);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeHelper.d.ts","sourceRoot":"","sources":["../../src/helpers/serializeHelper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"serializeHelper.d.ts","sourceRoot":"","sources":["../../src/helpers/serializeHelper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA0JtD,eAAO,MAAM,eAAe;kCAxHA,OAAO,KAAG,KAAK,IAAI,UAAU;2CAyGd,WAAW,cAAc,MAAM;kDAhBxB,MAAM,QAAQ,MAAM;CAmC5D,CAAC"}
|
|
@@ -20,8 +20,8 @@ const getBiomeSingleton = async () => {
|
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
return {
|
|
23
|
+
biome: biomeInstance.biome,
|
|
23
24
|
projectKey: biomeInstance.project.projectKey,
|
|
24
|
-
formatContent: biomeInstance.biome.formatContent,
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
// Type guard
|
|
@@ -36,7 +36,12 @@ const createRouteObject = (obj) => {
|
|
|
36
36
|
if (isRouteLeaf(value)) {
|
|
37
37
|
return ts.factory.createPropertyAssignment(ts.factory.createIdentifier(key), ts.factory.createObjectLiteralExpression([
|
|
38
38
|
ts.factory.createPropertyAssignment('path', ts.factory.createStringLiteral(value.path)),
|
|
39
|
-
ts.factory.createPropertyAssignment('import', ts.factory.
|
|
39
|
+
ts.factory.createPropertyAssignment('import', ts.factory.createArrowFunction(undefined, // modifiers
|
|
40
|
+
undefined, // type parameters
|
|
41
|
+
[], // parameters
|
|
42
|
+
undefined, // return type
|
|
43
|
+
ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), // =>
|
|
44
|
+
ts.factory.createCallExpression(ts.factory.createIdentifier('import'), undefined, [ts.factory.createStringLiteral(value.import)]))),
|
|
40
45
|
], true));
|
|
41
46
|
}
|
|
42
47
|
// Recursive object
|
|
@@ -56,10 +61,8 @@ const createRoutesFile = (obj) => {
|
|
|
56
61
|
return ts.factory.createSourceFile([exportStatement], ts.factory.createToken(ts.SyntaxKind.EndOfFileToken), ts.NodeFlags.None);
|
|
57
62
|
};
|
|
58
63
|
const formatAndWriteOutputFile = async (filePath, code) => {
|
|
59
|
-
const
|
|
60
|
-
const formatted =
|
|
61
|
-
filePath: path.basename(filePath),
|
|
62
|
-
});
|
|
64
|
+
const biomeSingleton = await getBiomeSingleton();
|
|
65
|
+
const formatted = biomeSingleton.biome.formatContent(biomeSingleton.projectKey, code, { filePath: path.basename(filePath) });
|
|
63
66
|
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
64
67
|
fs.writeFileSync(filePath, formatted.content, 'utf8');
|
|
65
68
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-file-router",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"description": "router based on project files using typescript",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"vite": ">=3.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@biomejs/js-api": "
|
|
33
|
-
"@biomejs/wasm-nodejs": "
|
|
32
|
+
"@biomejs/js-api": "4.0.0",
|
|
33
|
+
"@biomejs/wasm-nodejs": "2.3.11"
|
|
34
34
|
}
|
|
35
35
|
}
|