@owlmeans/web-router 0.1.2 → 0.1.3

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.
Files changed (3) hide show
  1. package/README.md +32 -15
  2. package/package.json +4 -3
  3. package/tsconfig.json +6 -11
package/README.md CHANGED
@@ -1,24 +1,41 @@
1
- # OwlMeans Package Template
1
+ # @owlmeans/web-router
2
2
 
3
- This is a template directory for creating new packages within the OwlMeans Common Libraries ecosystem.
3
+ React Router DOM integration for the OwlMeans context system.
4
4
 
5
- ## Usage
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
- Copy this template directory when creating a new package:
12
+ ## Installation
8
13
 
9
14
  ```bash
10
- cp -r packages/_tpl packages/your-new-package
11
- cd packages/your-new-package
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
- Then update:
15
- - `package.json` - Change the package name and dependencies
16
- - `README.md` - Replace with proper documentation following OwlMeans standards
17
- - `src/index.ts` - Implement your package functionality
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
- ## Template Structure
38
+ ## Related Packages
20
39
 
21
- - **package.json** - Base package configuration with common scripts and exports
22
- - **tsconfig.json** - TypeScript configuration aligned with OwlMeans standards
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.2",
3
+ "version": "0.1.3",
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": "^5.8.3"
32
+ "typescript": "^6.0.2"
32
33
  },
33
34
  "dependencies": {
34
- "@owlmeans/router": "^0.1.2"
35
+ "@owlmeans/router": "^0.1.3"
35
36
  },
36
37
  "publishConfig": {
37
38
  "access": "public"
package/tsconfig.json CHANGED
@@ -1,16 +1,11 @@
1
1
  {
2
2
  "extends": [
3
- "../tsconfig.default.json",
4
- "../tsconfig.react.json",
3
+ "@owlmeans/dep-config/tsconfig.base.json",
4
+ "@owlmeans/dep-config/tsconfig.react.json"
5
5
  ],
6
6
  "compilerOptions": {
7
- "rootDir": "./src/", /* Specify the root folder within your source files. */
8
- "outDir": "./build/", /* Specify an output folder for all emitted files. */
9
- "moduleResolution": "Bundler",
7
+ "rootDir": "./src/",
8
+ "outDir": "./build/"
10
9
  },
11
- "exclude": [
12
- "./dist/**/*",
13
- "./build/**/*",
14
- "./*.ts"
15
- ]
16
- }
10
+ "exclude": ["./dist/**/*", "./build/**/*", "./*.ts"]
11
+ }