@reckona/mreact-router 0.0.150 → 0.0.151
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 +1 -1
- package/dist/build.js +8 -7
- package/dist/build.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/link.d.ts +17 -7
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js.map +1 -1
- package/dist/typed-routes.d.ts +6 -1
- package/dist/typed-routes.d.ts.map +1 -1
- package/dist/typed-routes.js.map +1 -1
- package/package.json +11 -11
- package/src/build.ts +8 -8
- package/src/index.ts +9 -0
- package/src/link.ts +34 -11
- package/src/typed-routes.ts +22 -3
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ Production client source maps are disabled by default. Set `clientSourceMaps: "l
|
|
|
49
49
|
|
|
50
50
|
Production client route bundles can drop selected browser logging calls with `production.dropClientConsole`. Set it to `true` to remove `console.debug`, `console.info`, and `console.log` while preserving `console.warn` and `console.error`, or pass an array such as `["log"]` to choose specific methods.
|
|
51
51
|
|
|
52
|
-
Build output includes `.mreact/routes.d.ts`, which declares `AppRoutePath` and
|
|
52
|
+
Build output includes `.mreact/routes.d.ts`, which declares the discovered `AppRoutePath` union and augments `@reckona/mreact-router/link` so concrete `<Link href="...">` values are type-checked without importing any generated runtime module. The public `href()` helper remains available when code needs runtime URL construction from mreact route patterns such as `"/users/:id"` and `"/files/:...path"`; importing it into a client route includes that URL-building helper in the client bundle.
|
|
53
53
|
|
|
54
54
|
`mreact-router dev` reads the same config, preserves route-agnostic Vite plugins and CSS settings, and uses `server.port` from `vite.config.ts` when neither `--port` nor `PORT` is set. Use `mreact-router dev --port 15174` for one-off E2E or local port overrides without creating a separate Vite config. This keeps Vite CSS transforms, Playwright `webServer` setups, and local dev commands on the same configured port.
|
|
55
55
|
|
package/dist/build.js
CHANGED
|
@@ -405,16 +405,17 @@ function typedRoutesDeclaration(routes) {
|
|
|
405
405
|
return left.localeCompare(right);
|
|
406
406
|
});
|
|
407
407
|
const routeUnion = routePaths.map((routePath) => JSON.stringify(routePath)).join(" | ");
|
|
408
|
-
const routesObject = routePaths
|
|
409
|
-
.map((routePath) => ` readonly ${JSON.stringify(routePath)}: AppRouteHref<${JSON.stringify(routePath)}>;`)
|
|
410
|
-
.join("\n");
|
|
411
408
|
return [
|
|
412
|
-
`import type {
|
|
409
|
+
`import type { AppRouteLinkHref as MreactAppRouteLinkHref } from "@reckona/mreact-router";`,
|
|
413
410
|
``,
|
|
414
411
|
`export type AppRoutePath = ${routeUnion === "" ? "never" : routeUnion};`,
|
|
415
|
-
`export
|
|
416
|
-
|
|
417
|
-
`
|
|
412
|
+
`export type AppRouteHref = MreactAppRouteLinkHref<AppRoutePath>;`,
|
|
413
|
+
``,
|
|
414
|
+
`declare module "@reckona/mreact-router/link" {`,
|
|
415
|
+
` interface AppRouteDeclarations {`,
|
|
416
|
+
` readonly path: AppRoutePath;`,
|
|
417
|
+
` }`,
|
|
418
|
+
`}`,
|
|
418
419
|
``,
|
|
419
420
|
].join("\n");
|
|
420
421
|
}
|