
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
A Vite plugin that adds file-based routing to React apps by wrapping React Router (peer dependency)
pnpm add navilo
Navilo automatically generates a route tree from your src/app (or custom) directory structure, including support for:
[id])[...slug]) and optional catch-all ([[...slug]])Peer dependencies: React 18+, React Router 6+, Vite 4+
You can use the CLI to setup your project automatically.
npx navilo init
You can also pass your package manager directly:
npx navilo init --pm pnpm
Supported values: pnpm, yarn, npm, bun.
Or you can do the following steps manually:
npm install react-router-dom@6.16.0
2.Add the navilo to plugin in vite config
// vite.config.ts
import {defineConfig} from 'vite';
import react from '@vitejs/plugin-react';
import navilo from 'navilo';
export default defineConfig({
plugins: [
react(),
navilo({
pagesDir: 'src/app', // default directory to scan
})
]
});
/// <reference types="vite/client" />
declare module 'virtual:navilo-routes' {
export const router;
}
import {RouterProvider} from "react-router-dom";
import {router} from 'virtual:navilo-routes';
export function App() {
return (
<RouterProvider router={router}/>
);
}
src/app/
├─ layout.tsx # Root layout
├─ page.tsx # Root index page
├──(group)/ # Grouped folder (ignored)
│ └── about/page.tsx
├─ dashboard/
│ ├─ layout.tsx # Dashboard layout
│ ├─ page.tsx # Dashboard index page
│ ├─ [userId]/ # Dynamic segment
│ │ └─ settings/
│ │ └─ [tab].tsx # Nested dynamic segment
├─ blog/
│ ├─ [id].tsx # Dynamic blog page
│ ├─ [[...slug]].tsx # Optional catch-all
Navilo generates a route tree automatically:
{
segment: '',
path
:
'/',
children
:
Map
{
'dashboard'
=>
{
segment: 'dashboard',
layout
:
'DashboardLayout',
indexPage
:
'DashboardPage',
children
:
Map
{
':userId'
=>
{
children: Map
{
'settings'
=>
{
children: Map
{
':tab'
=>
{
component: 'UserSettings'
}
}
}
}
}
}
}
,
'blog'
=>
{
children: Map
{
':id'
=>
{
component: 'BlogPost'
}
,
':slug*?'
=>
{
component: 'BlogCatchAll'
}
}
}
}
}
const routeTree = routeTreeBuilder.build(routes, {
dynamicSegmentTransform: (segment) => `:${segment.toLowerCase()}`
});
[userId] → :userid[...slug] → :slug*[[...slug]] → :slug*?| Type | Usage |
|---|---|
layout | Layout component for nested routes |
page | Regular page component |
loading | Loading UI for nested layouts |
error | Error page for nested layouts |
not-found | 404 page |
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.