prev-cli 0.21.0 → 0.22.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.
- package/dist/cli.js +12 -2
- package/package.json +1 -1
- package/src/theme/entry.tsx +19 -7
package/dist/cli.js
CHANGED
|
@@ -146,7 +146,16 @@ async function scanPages(rootDir, options = {}) {
|
|
|
146
146
|
for (const dir of includeDirs) {
|
|
147
147
|
patterns.push(`${dir}/**/*.{md,mdx}`);
|
|
148
148
|
}
|
|
149
|
-
const ignore = [
|
|
149
|
+
const ignore = [
|
|
150
|
+
"node_modules/**",
|
|
151
|
+
"dist/**",
|
|
152
|
+
".cache/**",
|
|
153
|
+
"CLAUDE.md",
|
|
154
|
+
"CHANGELOG.md",
|
|
155
|
+
"CONTRIBUTING.md",
|
|
156
|
+
"LICENSE.md",
|
|
157
|
+
"SECURITY.md"
|
|
158
|
+
];
|
|
150
159
|
const files = await fg.glob(patterns, {
|
|
151
160
|
cwd: rootDir,
|
|
152
161
|
ignore,
|
|
@@ -829,7 +838,8 @@ async function createViteConfig(options) {
|
|
|
829
838
|
plugins: [
|
|
830
839
|
mdx({
|
|
831
840
|
remarkPlugins: [remarkGfm],
|
|
832
|
-
rehypePlugins: [rehypeHighlight]
|
|
841
|
+
rehypePlugins: [rehypeHighlight],
|
|
842
|
+
providerImportSource: "@mdx-js/react"
|
|
833
843
|
}),
|
|
834
844
|
react(),
|
|
835
845
|
createConfigPlugin(config),
|
package/package.json
CHANGED
package/src/theme/entry.tsx
CHANGED
|
@@ -343,17 +343,24 @@ const rootRoute = createRootRoute({
|
|
|
343
343
|
component: RootLayout,
|
|
344
344
|
})
|
|
345
345
|
|
|
346
|
-
// Previews
|
|
347
|
-
const
|
|
346
|
+
// Previews layout route (just passes through to children)
|
|
347
|
+
const previewsLayoutRoute = createRoute({
|
|
348
348
|
getParentRoute: () => rootRoute,
|
|
349
349
|
path: '/previews',
|
|
350
|
+
component: () => <Outlet />,
|
|
351
|
+
})
|
|
352
|
+
|
|
353
|
+
// Previews catalog route (index)
|
|
354
|
+
const previewsCatalogRoute = createRoute({
|
|
355
|
+
getParentRoute: () => previewsLayoutRoute,
|
|
356
|
+
path: '/',
|
|
350
357
|
component: PreviewsCatalog,
|
|
351
358
|
})
|
|
352
359
|
|
|
353
|
-
// Individual preview route (
|
|
360
|
+
// Individual preview route (splat captures nested paths like buttons/primary)
|
|
354
361
|
const previewDetailRoute = createRoute({
|
|
355
|
-
getParentRoute: () =>
|
|
356
|
-
path: '
|
|
362
|
+
getParentRoute: () => previewsLayoutRoute,
|
|
363
|
+
path: '$',
|
|
357
364
|
component: PreviewPage,
|
|
358
365
|
})
|
|
359
366
|
|
|
@@ -390,9 +397,14 @@ function NotFoundPage() {
|
|
|
390
397
|
}
|
|
391
398
|
|
|
392
399
|
// Create router with notFoundRoute
|
|
393
|
-
|
|
394
|
-
|
|
400
|
+
// Previews routes: layout with catalog (index) and detail (splat) children
|
|
401
|
+
const previewsRouteWithChildren = previewsLayoutRoute.addChildren([
|
|
402
|
+
previewsCatalogRoute,
|
|
395
403
|
previewDetailRoute,
|
|
404
|
+
])
|
|
405
|
+
|
|
406
|
+
const routeTree = rootRoute.addChildren([
|
|
407
|
+
previewsRouteWithChildren,
|
|
396
408
|
...(indexRedirectRoute ? [indexRedirectRoute] : []),
|
|
397
409
|
...pageRoutes,
|
|
398
410
|
])
|