@owlmeans/web-router 0.1.2 → 0.1.4
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 +32 -15
- package/package.json +4 -3
- package/tsconfig.json +6 -11
package/README.md
CHANGED
|
@@ -1,24 +1,41 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @owlmeans/web-router
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React Router DOM integration for the OwlMeans context system.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
- `makeWebRouterService()` — creates a router service backed by React Router DOM
|
|
8
|
+
- `appendWebRouter(ctx)` — registers the web router service in the context
|
|
9
|
+
- Provides `useParams`, `useLocation`, `useNavigate`, `outlet()`, `provider()` via the service
|
|
10
|
+
- Used internally by `@owlmeans/web-client`'s `makeContext` — not typically used directly
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
## Installation
|
|
8
13
|
|
|
9
14
|
```bash
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
bun add @owlmeans/web-router
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
This package is registered automatically when using `makeContext` from `@owlmeans/web-client`. Direct use is only needed for custom context setup:
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { appendWebRouter } from '@owlmeans/web-router'
|
|
24
|
+
|
|
25
|
+
appendWebRouter(context)
|
|
12
26
|
```
|
|
13
27
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
28
|
+
## API
|
|
29
|
+
|
|
30
|
+
### `makeWebRouterService(): RouterService`
|
|
31
|
+
|
|
32
|
+
Creates a router service with React Router DOM hooks and components.
|
|
33
|
+
|
|
34
|
+
### `appendWebRouter<C, T>(ctx): void`
|
|
35
|
+
|
|
36
|
+
Registers the web router service in the given context.
|
|
18
37
|
|
|
19
|
-
##
|
|
38
|
+
## Related Packages
|
|
20
39
|
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
- **src/index.ts** - Entry point file
|
|
24
|
-
- **README.md** - This template documentation (replace with actual docs)
|
|
40
|
+
- [`@owlmeans/router`](../router) — `RouterService` base interface
|
|
41
|
+
- [`@owlmeans/web-client`](../web-client) — calls `appendWebRouter` inside `makeContext`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/web-router",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -25,13 +25,14 @@
|
|
|
25
25
|
"react-router": "^7.9.6"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
+
"@owlmeans/dep-config": "workspace:*",
|
|
28
29
|
"@types/node": "^24.10.1",
|
|
29
30
|
"@types/react": "^19.2.7",
|
|
30
31
|
"nodemon": "^3.1.11",
|
|
31
|
-
"typescript": "^
|
|
32
|
+
"typescript": "^6.0.2"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"@owlmeans/router": "^0.1.
|
|
35
|
+
"@owlmeans/router": "^0.1.4"
|
|
35
36
|
},
|
|
36
37
|
"publishConfig": {
|
|
37
38
|
"access": "public"
|
package/tsconfig.json
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": [
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"@owlmeans/dep-config/tsconfig.base.json",
|
|
4
|
+
"@owlmeans/dep-config/tsconfig.react.json"
|
|
5
5
|
],
|
|
6
6
|
"compilerOptions": {
|
|
7
|
-
"rootDir": "./src/",
|
|
8
|
-
"outDir": "./build/"
|
|
9
|
-
"moduleResolution": "Bundler",
|
|
7
|
+
"rootDir": "./src/",
|
|
8
|
+
"outDir": "./build/"
|
|
10
9
|
},
|
|
11
|
-
"exclude": [
|
|
12
|
-
|
|
13
|
-
"./build/**/*",
|
|
14
|
-
"./*.ts"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
10
|
+
"exclude": ["./dist/**/*", "./build/**/*", "./*.ts"]
|
|
11
|
+
}
|