@troyio/vite-file-router 0.3.1 → 0.3.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 CHANGED
@@ -108,6 +108,12 @@ Catch-all segments such as `[...slug]` become `*`. Parenthesized directories
108
108
  are route groups; they organize files and can have their own page, layout,
109
109
  loading files, loaders, and actions, but their names do not add a URL segment.
110
110
 
111
+ Directories whose names start with an underscore, such as `_components` or
112
+ `_utils`, are private folders. The plugin skips them and everything nested
113
+ inside them, so you can colocate components, hooks, and helpers next to the
114
+ routes that use them without creating routes. A `_components/page.tsx` file is
115
+ never routed.
116
+
111
117
  ### Layouts
112
118
 
113
119
  The plugin adapts React Router's matched child route to a `children` prop. A
package/dist/index.js CHANGED
@@ -53,6 +53,7 @@ function scan(directory, conventions = DEFAULT_CONVENTIONS) {
53
53
  for (const entry of entries) {
54
54
  const file = path.join(directory, entry.name);
55
55
  if (entry.isDirectory()) {
56
+ if (entry.name.startsWith("_")) continue;
56
57
  node.children.push(scan(file, conventions));
57
58
  continue;
58
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@troyio/vite-file-router",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "File-system routing plugin for Vite",
5
5
  "type": "module",
6
6
  "private": false,