ts-file-router 3.0.1 → 4.0.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.
Files changed (2) hide show
  1. package/README.md +16 -2
  2. package/package.json +5 -1
package/README.md CHANGED
@@ -68,12 +68,15 @@ Create a script to generate your routes. Example:
68
68
 
69
69
  ```js
70
70
  // scripts/generate-routes.mjs
71
- import { generateRoutesWithWatcher } from 'ts-file-router';
71
+ import { generateRoutes } from 'ts-file-router';
72
72
 
73
73
  generateRoutes({
74
74
  baseFolder: 'src/screens',
75
75
  outputFile: 'screens.ts',
76
- options: { watcher: { debounce: 500 }, exitCodeOnResolution: false },
76
+ options: {
77
+ watcher: { watch: true, debounce: 500 },
78
+ exitCodeOnResolution: false,
79
+ },
77
80
  });
78
81
  ```
79
82
 
@@ -90,3 +93,14 @@ Run the script with:
90
93
  node scripts/generate-routes.mjs
91
94
 
92
95
  or setup generateRoutesPlugin in vite.config.ts
96
+
97
+ ## Output based on your folder
98
+
99
+ ```ts
100
+ export const routes = {
101
+ page: {
102
+ path: '/',
103
+ import: () => import('./page'),
104
+ },
105
+ } as const;
106
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-file-router",
3
- "version": "3.0.1",
3
+ "version": "4.0.0",
4
4
  "description": "router based on project files using typescript",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -26,5 +26,9 @@
26
26
  "peerDependencies": {
27
27
  "chokidar": ">=4.0.0",
28
28
  "vite": ">=3.0.0"
29
+ },
30
+ "dependencies": {
31
+ "@biomejs/js-api": "^4.0.0",
32
+ "@biomejs/wasm-nodejs": "^2.3.11"
29
33
  }
30
34
  }