@owlmeans/web-client 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 CHANGED
@@ -1,617 +1,78 @@
1
1
  # @owlmeans/web-client
2
2
 
3
- A complete React DOM client library for OwlMeans Common applications. This package provides a web-specific implementation that extends `@owlmeans/client` with DOM-specific functionality, including rendering utilities, web database integration, and browser-specific services.
3
+ React web application bootstrap — context factory, module/routing utilities, and app renderer for OwlMeans web apps.
4
4
 
5
5
  ## Overview
6
6
 
7
- The `@owlmeans/web-client` package is the web DOM implementation of the OwlMeans client system. It provides:
8
-
9
- - **DOM Rendering**: Direct integration with ReactDOM for web applications
10
- - **Web Database**: Browser-based database integration with IndexedDB/localStorage
11
- - **Authentication Integration**: Pre-configured web authentication services
12
- - **Browser Services**: Web-specific services and utilities
13
- - **I18n Integration**: Internationalization support for web applications
14
- - **Router Integration**: Web-specific routing with React Router DOM
15
- - **Context Management**: Enhanced context with web-specific capabilities
16
-
17
- This package is part of the OwlMeans client implementation family:
18
- - **@owlmeans/client**: Base React client library
19
- - **@owlmeans/web-client**: Web DOM implementation *(this package)*
20
- - **@owlmeans/native-client**: React Native implementation
7
+ - `makeContext(cfg)` — creates the web application context (includes auth, router, and DB services)
8
+ - `renderApp(context)` — mounts the React app to the DOM
9
+ - Re-exports module/routing helpers: `module`, `route`, `frontend`, `handler`, `elevate`
10
+ - Re-exports route constants: `BASE`, `HOME`, `ROOT`, `GUEST`
11
+ - `Module<T>` — typed client module interface for `.call()` API requests
21
12
 
22
13
  ## Installation
23
14
 
24
15
  ```bash
25
- npm install @owlmeans/web-client react react-dom react-router-dom
26
- ```
27
-
28
- ## Core Concepts
29
-
30
- ### Web-First Architecture
31
- This library is specifically designed for web browsers and provides DOM-specific functionality that isn't available in other environments.
32
-
33
- ### Enhanced Context
34
- The web context extends the base client context with web-specific services like database storage, authentication, and browser utilities.
35
-
36
- ### Integrated Rendering
37
- Provides seamless integration with ReactDOM including support for both client-side rendering and server-side hydration.
38
-
39
- ## API Reference
40
-
41
- ### Factory Functions
42
-
43
- #### `makeContext<C, T>(cfg: C): T`
44
-
45
- Creates a web-specific application context with all necessary web services pre-configured.
46
-
47
- ```typescript
48
- import { makeContext } from '@owlmeans/web-client'
49
- import { AppType, Layer } from '@owlmeans/context'
50
-
51
- const context = makeContext({
52
- service: 'my-web-app',
53
- type: AppType.Frontend,
54
- layer: Layer.Service,
55
- ready: false,
56
- services: {},
57
- brand: { name: 'My Web App' },
58
- trusted: []
59
- })
60
- ```
61
-
62
- **Parameters:**
63
- - `cfg`: AppConfig - Configuration object for the web context
64
-
65
- **Returns:** Enhanced AppContext with web-specific capabilities
66
-
67
- **Pre-configured Services:**
68
- - Web authentication service
69
- - Web database service
70
- - Client resource service
71
- - Primary host extraction
72
-
73
- #### `render(node: ReactNode, opts?: RenderOptions): void`
74
-
75
- Renders a React application to the DOM with web-specific optimizations.
76
-
77
- ```typescript
78
- import { render } from '@owlmeans/web-client'
79
- import { App } from '@owlmeans/client'
80
-
81
- render(
82
- <App context={context}>
83
- <MyApplication />
84
- </App>,
85
- {
86
- domId: 'root',
87
- onReady: true,
88
- hydrate: false,
89
- debug: true
90
- }
91
- )
92
- ```
93
-
94
- **Parameters:**
95
- - `node`: ReactNode - The React element to render
96
- - `opts`: RenderOptions (optional) - Rendering configuration
97
-
98
- ### Core Interfaces
99
-
100
- #### `AppContext<C extends AppConfig>`
101
-
102
- Web-specific application context that extends ClientContext with authentication capabilities.
103
-
104
- ```typescript
105
- interface AppContext<C extends AppConfig = AppConfig> extends ClientContext<C>,
106
- AuthServiceAppend {
107
-
108
- // Inherited from ClientContext:
109
- // - Configuration management
110
- // - State management
111
- // - Modal service
112
- // - Debug service
113
- // - Module and service registration
114
- // - Resource management
115
-
116
- // Enhanced with authentication:
117
- auth(): AuthService
118
- }
119
- ```
120
-
121
- #### `AppConfig`
122
-
123
- Configuration interface for web applications (extends ClientConfig).
124
-
125
- ```typescript
126
- interface AppConfig extends ClientConfig {
127
- // Inherits all ClientConfig properties
128
- // Can be extended with web-specific configuration
129
- }
130
- ```
131
-
132
- #### `RenderOptions`
133
-
134
- Configuration options for DOM rendering.
135
-
136
- ```typescript
137
- interface RenderOptions {
138
- domId?: string // Target DOM element ID (default: 'root')
139
- onReady?: boolean // Wait for DOMContentLoaded (default: true)
140
- hydrate?: boolean // Use hydration for SSR (default: false)
141
- debug?: boolean // Enable debug logging (default: false)
142
- }
143
- ```
144
-
145
- ### React Hooks
146
-
147
- #### `useContext<C, T>(): T`
148
-
149
- Web-specific context hook that provides strongly typed access to the AppContext.
150
-
151
- ```typescript
152
- import { useContext } from '@owlmeans/web-client'
153
-
154
- function MyWebComponent() {
155
- const context = useContext()
156
-
157
- // Access web-specific services
158
- const authService = context.auth()
159
- const dbService = context.service('web-db')
160
-
161
- // Access base client services
162
- const stateResource = context.state()
163
- const modalService = context.modal()
164
-
165
- return <div>Web Component</div>
166
- }
167
- ```
168
-
169
- ### Web Services
170
-
171
- #### Web Database Integration
172
-
173
- The package automatically configures web database services:
174
-
175
- ```typescript
176
- // Access web database service
177
- const dbService = context.service('web-db')
178
-
179
- // Store data in browser
180
- await dbService.store('user-preferences', {
181
- theme: 'dark',
182
- language: 'en'
183
- })
184
-
185
- // Retrieve data from browser
186
- const preferences = await dbService.retrieve('user-preferences')
16
+ bun add @owlmeans/web-client
187
17
  ```
188
18
 
189
- #### Authentication Service
190
-
191
- Pre-configured web authentication with persistent storage:
192
-
193
- ```typescript
194
- // Access authentication service
195
- const authService = context.auth()
196
-
197
- // Authentication persists across browser sessions
198
- const isAuthenticated = await authService.authenticated()
199
- ```
200
-
201
- ### Helper Functions
202
-
203
- #### `extractPrimaryHost<C, T>(context: T): void`
204
-
205
- Extracts and configures the primary host from the current browser location.
206
-
207
- **Purpose**: Automatically configures the application's primary host based on the browser's current URL
208
-
209
- **Usage**: Called automatically during context creation
210
-
211
- ### Constants
212
-
213
- #### `DEFAULT_ROOT`
214
- Default DOM element ID for rendering (`'root'`).
215
-
216
- ### Components and Modules
19
+ ## Usage
217
20
 
218
- The package provides web-specific components and modules:
21
+ Bootstrap the app:
219
22
 
220
- #### I18n Integration
221
23
  ```typescript
222
- import { i18nModules } from '@owlmeans/web-client'
24
+ import { makeContext, renderApp } from '@owlmeans/web-client'
223
25
 
224
- // Pre-configured internationalization modules
225
- context.registerModules(i18nModules)
226
- ```
227
-
228
- #### Authentication Components
229
- ```typescript
230
- import { authComponents } from '@owlmeans/web-client'
231
-
232
- // Web-specific authentication components
233
- // Available through the component system
234
- ```
235
-
236
- ## Usage Examples
237
-
238
- ### Complete Web Application Setup
239
-
240
- ```typescript
241
- import React from 'react'
242
- import { makeContext, render } from '@owlmeans/web-client'
243
- import { App } from '@owlmeans/client'
244
- import { createBrowserRouter } from 'react-router-dom'
245
- import { AppType, Layer } from '@owlmeans/context'
246
-
247
- // Create web application context
248
- const context = makeContext({
249
- service: 'my-web-app',
250
- type: AppType.Frontend,
251
- layer: Layer.Service,
252
- ready: false,
253
- services: {},
254
- brand: {
255
- name: 'My Web App',
256
- version: '1.0.0'
257
- },
258
- trusted: ['api.myapp.com']
259
- })
260
-
261
- // Register application modules
262
- context.registerModules(appModules)
263
-
264
- // Configure and initialize
265
- await context.configure().init()
266
-
267
- // Create router provider
268
- const routerProvider = (routes) => createBrowserRouter(routes)
269
-
270
- // Define the application
271
- function MyWebApp() {
272
- return (
273
- <App context={context} provide={routerProvider}>
274
- <header>My Web Application</header>
275
- <main>
276
- {/* Application content will be rendered here by the router */}
277
- </main>
278
- </App>
279
- )
280
- }
281
-
282
- // Render to DOM
283
- render(<MyWebApp />, {
284
- domId: 'root',
285
- debug: process.env.NODE_ENV === 'development'
286
- })
287
- ```
288
-
289
- ### Server-Side Rendering (SSR) with Hydration
290
-
291
- ```typescript
292
- import { makeContext, render } from '@owlmeans/web-client'
293
- import { App } from '@owlmeans/client'
294
-
295
- // Create context with SSR data
296
- const context = makeContext({
297
- ...config,
298
- ssrData: window.__SSR_DATA__ // Data from server
299
- })
300
-
301
- // Pre-populate context with SSR data
302
- await context.configure().init()
303
-
304
- // Hydrate the server-rendered HTML
305
- render(
306
- <App context={context}>
307
- <MyApplication />
308
- </App>,
309
- {
310
- hydrate: true, // Enable hydration
311
- onReady: false // Don't wait for DOMContentLoaded
312
- }
313
- )
314
- ```
315
-
316
- ### Authentication-Enabled Web App
317
-
318
- ```typescript
319
- import { makeContext, useContext } from '@owlmeans/web-client'
320
- import { modules as authModules } from '@owlmeans/client-auth'
321
-
322
- // Create context
323
26
  const context = makeContext(config)
324
-
325
- // Register authentication modules
326
- context.registerModules(authModules)
327
-
328
- // Initialize
329
- await context.configure().init()
330
-
331
- function AuthenticatedApp() {
332
- const context = useContext()
333
- const [isAuthenticated, setIsAuthenticated] = useState(false)
334
-
335
- useEffect(() => {
336
- const checkAuth = async () => {
337
- const authService = context.auth()
338
- const token = await authService.authenticated()
339
- setIsAuthenticated(token != null)
340
- }
341
-
342
- checkAuth()
343
- }, [])
344
-
345
- if (!isAuthenticated) {
346
- return <LoginPage />
347
- }
348
-
349
- return <Dashboard />
350
- }
351
-
352
- // Render with authentication
353
- render(<AuthenticatedApp />)
354
- ```
355
-
356
- ### Web Database Usage
357
-
358
- ```typescript
359
- import { useContext } from '@owlmeans/web-client'
360
- import { useEffect, useState } from 'react'
361
-
362
- function DataPersistentComponent() {
363
- const context = useContext()
364
- const [data, setData] = useState(null)
365
-
366
- useEffect(() => {
367
- const loadData = async () => {
368
- // Access web database through context
369
- const dbService = context.service('web-db')
370
-
371
- // Load persisted data
372
- const savedData = await dbService.retrieve('component-data')
373
- setData(savedData || { count: 0 })
374
- }
375
-
376
- loadData()
377
- }, [])
378
-
379
- const saveData = async (newData) => {
380
- const dbService = context.service('web-db')
381
- await dbService.store('component-data', newData)
382
- setData(newData)
383
- }
384
-
385
- const increment = () => {
386
- const newData = { count: data.count + 1 }
387
- saveData(newData)
388
- }
389
-
390
- return (
391
- <div>
392
- <p>Count: {data?.count || 0}</p>
393
- <button onClick={increment}>Increment</button>
394
- </div>
395
- )
396
- }
397
- ```
398
-
399
- ### Custom Rendering Options
400
-
401
- ```typescript
402
- import { render } from '@owlmeans/web-client'
403
-
404
- // Render to custom DOM element
405
- render(<MyApp />, {
406
- domId: 'custom-root',
407
- debug: true
408
- })
409
-
410
- // Immediate rendering (don't wait for DOMContentLoaded)
411
- render(<MyApp />, {
412
- onReady: false
413
- })
414
-
415
- // Server-side hydration
416
- render(<MyApp />, {
417
- hydrate: true,
418
- onReady: false
419
- })
420
- ```
421
-
422
- ### Advanced Context Configuration
423
-
424
- ```typescript
425
- import { makeContext } from '@owlmeans/web-client'
426
-
427
- const context = makeContext({
428
- service: 'advanced-app',
429
- type: AppType.Frontend,
430
- layer: Layer.Service,
431
- ready: false,
432
-
433
- // Web-specific configuration
434
- services: {
435
- database: {
436
- type: 'indexeddb',
437
- name: 'my-app-db'
438
- }
439
- },
440
-
441
- // Branding
442
- brand: {
443
- name: 'Advanced Web App',
444
- version: '2.1.0',
445
- logo: '/assets/logo.png'
446
- },
447
-
448
- // Trusted hosts for API calls
449
- trusted: [
450
- 'api.myapp.com',
451
- 'cdn.myapp.com'
452
- ],
453
-
454
- // Debug configuration
455
- debug: {
456
- all: process.env.NODE_ENV === 'development',
457
- routing: true,
458
- auth: true
459
- }
460
- })
461
-
462
- // Additional service registration
463
- context.registerService(customWebService)
464
-
465
- // Module registration with web-specific modules
466
- context.registerModules([
467
- ...appModules,
468
- ...webSpecificModules
469
- ])
27
+ context.registerModules(appModules)
28
+ context.serviceRoute(MANAGER, true)
29
+ renderApp<Config, Context>(context)
470
30
  ```
471
31
 
472
- ### Integration with Internationalization
32
+ Define modules:
473
33
 
474
34
  ```typescript
475
- import { makeContext } from '@owlmeans/web-client'
476
- import { addI18nApp } from '@owlmeans/i18n'
477
-
478
- // Add web-specific translations
479
- addI18nApp('en', 'web-common', {
480
- 'button.close': 'Close',
481
- 'message.loading': 'Loading...',
482
- 'error.network': 'Network error occurred'
483
- })
484
-
485
- const context = makeContext(config)
35
+ import { BASE, HOME, elevate, frontend, handler, module, route } from '@owlmeans/web-client'
486
36
 
487
- // Access i18n through context
488
- function I18nComponent() {
489
- const context = useContext()
490
- const i18nService = context.service('i18n')
491
-
492
- return (
493
- <div>
494
- <button>{i18nService.t('button.close')}</button>
495
- </div>
496
- )
497
- }
37
+ modules.push(module(route(BASE, '/', frontend()), handler(PublicLayout)))
38
+ modules.push(module(route(HOME, '/', frontend({ default: true, parent: BASE })), handler(HomeScreen)))
39
+ elevate(modules, manager.back.account.base)
498
40
  ```
499
41
 
500
- ## Browser Compatibility
501
-
502
- The package is designed for modern web browsers with support for:
503
-
504
- - **ES2020+**: Modern JavaScript features
505
- - **IndexedDB**: For local database storage
506
- - **LocalStorage**: For simple key-value storage
507
- - **DOM API**: Standard DOM manipulation
508
- - **Fetch API**: For HTTP requests
509
- - **WebCrypto**: For cryptographic operations (if used)
510
-
511
- ## Performance Optimizations
512
-
513
- 1. **Lazy Loading**: Components and services are loaded on demand
514
- 2. **Efficient Rendering**: Optimized ReactDOM integration
515
- 3. **Database Caching**: Intelligent caching of web database operations
516
- 4. **Bundle Splitting**: Designed for code splitting compatibility
517
- 5. **SSR Ready**: Full server-side rendering support
518
-
519
- ## Error Handling
520
-
521
- Web-specific error handling and reporting:
42
+ Call an API module from a component:
522
43
 
523
44
  ```typescript
524
- import { OwlMeansError } from '@owlmeans/error'
45
+ import type { Module } from '@owlmeans/web-client'
525
46
 
526
- // Web-specific error boundary
527
- class WebErrorBoundary extends React.Component {
528
- componentDidCatch(error, errorInfo) {
529
- const context = this.props.context
530
- const debugService = context.debug()
531
-
532
- // Log web-specific error details
533
- debugService.error('web-error', 'Browser error', {
534
- error: error.message,
535
- stack: error.stack,
536
- userAgent: navigator.userAgent,
537
- url: window.location.href
538
- })
539
- }
540
- }
47
+ const [result] = await context.module<Module<MyType>>(moduleAlias)
48
+ .call({ params: { id }, body: data })
541
49
  ```
542
50
 
543
- ## Security Considerations
544
-
545
- 1. **Trusted Hosts**: Configure trusted hosts to prevent CSRF attacks
546
- 2. **Authentication Storage**: Secure token storage in browser
547
- 3. **XSS Protection**: Built-in protection against cross-site scripting
548
- 4. **Content Security Policy**: Compatible with CSP headers
549
- 5. **HTTPS Only**: Designed for secure HTTPS environments
550
-
551
- ## Integration with Other Packages
51
+ ## API
552
52
 
553
- ### Client Ecosystem Integration
554
- ```typescript
555
- // Authentication
556
- import { makeAuthService } from '@owlmeans/client-auth'
53
+ ### `makeContext<C, T>(cfg): T`
557
54
 
558
- // Resources
559
- import { makeResourceService } from '@owlmeans/client-resource'
55
+ Creates a web app context. Automatically registers web router, IndexedDB, and auth services.
560
56
 
561
- // Internationalization
562
- import { makeI18nService } from '@owlmeans/client-i18n'
57
+ ### `renderApp<C, T>(context): void`
563
58
 
564
- // Database
565
- import { WebDbService } from '@owlmeans/web-db'
566
- ```
59
+ Renders the React application to the DOM using the provided context.
567
60
 
568
- ### Build Tool Integration
569
- ```typescript
570
- // Webpack configuration
571
- module.exports = {
572
- resolve: {
573
- alias: {
574
- '@owlmeans/web-client': path.resolve(__dirname, 'node_modules/@owlmeans/web-client')
575
- }
576
- }
577
- }
61
+ ### `useContext<C, T>(): T`
578
62
 
579
- // Vite configuration
580
- export default {
581
- resolve: {
582
- alias: {
583
- '@owlmeans/web-client': path.resolve(__dirname, 'node_modules/@owlmeans/web-client')
584
- }
585
- }
586
- }
587
- ```
63
+ React hook to access the current application context.
588
64
 
589
- ## Best Practices
65
+ ### `makeAuthWebService(alias?)`, `appendWebAuthService(ctx, alias?)`
590
66
 
591
- 1. **Single Context**: Use one web context per application
592
- 2. **Proper Hydration**: Use hydration mode for SSR applications
593
- 3. **Error Boundaries**: Implement web-specific error boundaries
594
- 4. **Performance Monitoring**: Monitor web-specific performance metrics
595
- 5. **Responsive Design**: Ensure proper responsive behavior
596
- 6. **Accessibility**: Follow web accessibility guidelines
597
- 7. **SEO Optimization**: Use SSR for better search engine optimization
67
+ Auth service factory and appender — adds logout redirect handling for web environments.
598
68
 
599
- ## Dependencies
69
+ ### `Dispatcher`
600
70
 
601
- This package depends on:
602
- - `@owlmeans/client` - Base React client library
603
- - `@owlmeans/client-context` - Client context management
604
- - `@owlmeans/client-auth` - Client authentication
605
- - `@owlmeans/web-db` - Web database integration
606
- - `@owlmeans/client-i18n` - Client internationalization
607
- - `react` - React library (peer dependency)
608
- - `react-dom` - ReactDOM library (peer dependency)
609
- - `react-router-dom` - React Router DOM (peer dependency)
71
+ Component that handles authentication routing (redirect to login, etc.).
610
72
 
611
73
  ## Related Packages
612
74
 
613
- - [`@owlmeans/client`](../client) - Base React client library
614
- - [`@owlmeans/native-client`](../native-client) - React Native implementation
615
- - [`@owlmeans/web-db`](../web-db) - Web database implementation
616
- - [`@owlmeans/client-auth`](../client-auth) - Client authentication
617
- - [`@owlmeans/client-i18n`](../client-i18n) - Client internationalization
75
+ - [`@owlmeans/client-context`](../client-context) — `ClientContext` base extended by `makeContext`
76
+ - [`@owlmeans/web-router`](../web-router) — React Router integration registered by `makeContext`
77
+ - [`@owlmeans/web-db`](../web-db) — IndexedDB service registered by `makeContext`
78
+ - [`@owlmeans/client-module`](../client-module) — `ClientModule<T>` / `Module<T>` implementation
@@ -2,8 +2,8 @@ export { handler } from '@owlmeans/client';
2
2
  export { config } from '@owlmeans/client-context';
3
3
  export { service } from '@owlmeans/config';
4
4
  export { AppType, HOME, ROOT, BASE, GUEST } from '@owlmeans/context';
5
- export { module, elevate, provideRequest, stab } from '@owlmeans/client-module';
5
+ export { entrypoint, elevate, provideRequest, stab } from '@owlmeans/client-entrypoint';
6
6
  export { route, frontend } from '@owlmeans/route';
7
- export type { ClientModule as Module } from '@owlmeans/client-module';
7
+ export type { ClientEntrypoint as Module } from '@owlmeans/client-entrypoint';
8
8
  export type { ClientRoute as Route } from '@owlmeans/client-route';
9
9
  //# sourceMappingURL=exports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAC/E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACjD,YAAY,EAAE,YAAY,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAA;AACrE,YAAY,EAAE,WAAW,IAAI,KAAK,EAAE,MAAM,wBAAwB,CAAA"}
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AACvF,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACjD,YAAY,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,6BAA6B,CAAA;AAC7E,YAAY,EAAE,WAAW,IAAI,KAAK,EAAE,MAAM,wBAAwB,CAAA"}
package/build/exports.js CHANGED
@@ -2,6 +2,6 @@ export { handler } from '@owlmeans/client';
2
2
  export { config } from '@owlmeans/client-context';
3
3
  export { service } from '@owlmeans/config';
4
4
  export { AppType, HOME, ROOT, BASE, GUEST } from '@owlmeans/context';
5
- export { module, elevate, provideRequest, stab } from '@owlmeans/client-module';
5
+ export { entrypoint, elevate, provideRequest, stab } from '@owlmeans/client-entrypoint';
6
6
  export { route, frontend } from '@owlmeans/route';
7
7
  //# sourceMappingURL=exports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAC/E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA"}
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AACvF,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA"}
@@ -6,7 +6,7 @@ export const logoutMiddleware = {
6
6
  type: MiddlewareType.Context,
7
7
  stage: MiddlewareStage.Loading,
8
8
  apply: async (context) => {
9
- context.modules().forEach(module => {
9
+ context.entrypoints().forEach(module => {
10
10
  if (module.route.route.type === AppType.Backend && module.call != null) {
11
11
  const guards = module.getGuards();
12
12
  if (guards.length > 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.js","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAGrD,MAAM,CAAC,MAAM,gBAAgB,GAAe;IAC1C,IAAI,EAAE,cAAc,CAAC,OAAO;IAC5B,KAAK,EAAE,eAAe,CAAC,OAAO;IAC9B,KAAK,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE;QACrB,OAAO,CAAC,OAAO,EAAU,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACzC,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;gBACvE,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAA;gBACjC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACtB,IAAI,MAAM,CAAC,4BAA4B,KAAK,IAAI,EAAE,CAAC;wBACjD,OAAM;oBACR,CAAC;oBACD,MAAM,CAAC,4BAA4B,GAAG,IAAI,CAAA;oBAC1C,sDAAsD;oBACtD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;oBACxB,MAAM,CAAC,IAAI,GAAG,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;wBAC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C;CACF,CAAA"}
@@ -1,2 +1,2 @@
1
- export declare const modules: import("@owlmeans/client-module").ClientModule<{}, import("@owlmeans/client-module").ClientRequest<{}>>[];
1
+ export declare const modules: import("@owlmeans/client-entrypoint").ClientEntrypoint<{}, import("@owlmeans/client-entrypoint").ClientRequest<{}>>[];
2
2
  //# sourceMappingURL=modules.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,OAAO,2GAAO,CAAA"}
1
+ {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,OAAO,uHAAO,CAAA"}
package/build/modules.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DISPATCHER } from '@owlmeans/auth';
2
2
  import { modules as list } from '@owlmeans/client-auth';
3
- import { elevate } from '@owlmeans/client-module';
3
+ import { elevate } from '@owlmeans/client-entrypoint';
4
4
  import { handler } from '@owlmeans/client';
5
5
  import { Dispatcher } from './components/dispatcher/component.js';
6
6
  elevate(list, DISPATCHER, handler(Dispatcher), { force: true });
@@ -1 +1 @@
1
- {"version":3,"file":"modules.js","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AAEjE,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;AAE/D,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,CAAA"}
1
+ {"version":3,"file":"modules.js","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AAEjE,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;AAE/D,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,CAAA"}
package/build/service.js CHANGED
@@ -8,7 +8,7 @@ export const makeAuthWebService = (alias = DEFAULT_ALIAS) => {
8
8
  service.update = async (token) => {
9
9
  await update(token);
10
10
  if (token == null) {
11
- const module = service.assertCtx().module(DISPATCHER);
11
+ const module = service.assertCtx().entrypoint(DISPATCHER);
12
12
  const [url] = await module.call();
13
13
  document.location.href = url;
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAGtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAElD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAAgB,aAAa,EAAe,EAAE;IAC/E,MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,CAAA;IAEtC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAC7B,OAAO,CAAC,MAAM,GAAG,KAAK,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MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,CAAA;IAEtC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAC7B,OAAO,CAAC,MAAM,GAAG,KAAK,EAAC,KAAK,EAAC,EAAE;QAC7B,MAAM,MAAM,CAAC,KAAK,CAAC,CAAA;QACnB,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,UAAU,CAA2B,UAAU,CAAC,CAAA;YACnF,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;YACjC,QAAQ,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,CAAA;QAC9B,CAAC;IACH,CAAC,CAAA;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,GAAM,EAAE,QAAgB,aAAa,EACd,EAAE;IACzB,MAAM,OAAO,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAA;IAEzC,MAAM,OAAO,GAAG,GAA4B,CAAA;IAE5C,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAA;IAEhC,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAA;IAC1C,OAAO,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAE5C,OAAO,CAAC,IAAI,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAE/C,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/web-client",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -21,22 +21,22 @@
21
21
  }
22
22
  },
23
23
  "dependencies": {
24
- "@owlmeans/auth": "^0.1.2",
25
- "@owlmeans/auth-common": "^0.1.2",
26
- "@owlmeans/client": "^0.1.2",
27
- "@owlmeans/client-auth": "^0.1.2",
28
- "@owlmeans/client-context": "^0.1.2",
29
- "@owlmeans/client-i18n": "^0.1.2",
30
- "@owlmeans/client-module": "^0.1.2",
31
- "@owlmeans/client-resource": "^0.1.2",
32
- "@owlmeans/client-route": "^0.1.2",
33
- "@owlmeans/config": "^0.1.2",
34
- "@owlmeans/context": "^0.1.2",
35
- "@owlmeans/error": "^0.1.2",
36
- "@owlmeans/i18n": "^0.1.2",
37
- "@owlmeans/route": "^0.1.2",
38
- "@owlmeans/web-db": "^0.1.2",
39
- "@owlmeans/web-router": "^0.1.2",
24
+ "@owlmeans/auth": "^0.1.4",
25
+ "@owlmeans/auth-common": "^0.1.4",
26
+ "@owlmeans/client": "^0.1.4",
27
+ "@owlmeans/client-auth": "^0.1.4",
28
+ "@owlmeans/client-context": "^0.1.4",
29
+ "@owlmeans/client-i18n": "^0.1.4",
30
+ "@owlmeans/client-entrypoint": "^0.1.4",
31
+ "@owlmeans/client-resource": "^0.1.4",
32
+ "@owlmeans/client-route": "^0.1.4",
33
+ "@owlmeans/config": "^0.1.4",
34
+ "@owlmeans/context": "^0.1.4",
35
+ "@owlmeans/error": "^0.1.4",
36
+ "@owlmeans/i18n": "^0.1.4",
37
+ "@owlmeans/route": "^0.1.4",
38
+ "@owlmeans/web-db": "^0.1.4",
39
+ "@owlmeans/web-router": "^0.1.4",
40
40
  "react-dropzone": "^14.3.5"
41
41
  },
42
42
  "peerDependencies": {
@@ -45,11 +45,12 @@
45
45
  "react-router": "^7.*"
46
46
  },
47
47
  "devDependencies": {
48
+ "@owlmeans/dep-config": "workspace:*",
48
49
  "@types/react": "^19.2.7",
49
50
  "@types/react-dom": "^19.2.3",
50
51
  "nodemon": "^3.1.11",
51
52
  "npm-check": "^6.0.1",
52
- "typescript": "^5.8.3"
53
+ "typescript": "^6.0.2"
53
54
  },
54
55
  "publishConfig": {
55
56
  "access": "public"
package/src/exports.ts CHANGED
@@ -3,7 +3,7 @@ export { handler } from '@owlmeans/client'
3
3
  export { config } from '@owlmeans/client-context'
4
4
  export { service } from '@owlmeans/config'
5
5
  export { AppType, HOME, ROOT, BASE, GUEST } from '@owlmeans/context'
6
- export { module, elevate, provideRequest, stab } from '@owlmeans/client-module'
6
+ export { entrypoint, elevate, provideRequest, stab } from '@owlmeans/client-entrypoint'
7
7
  export { route, frontend } from '@owlmeans/route'
8
- export type { ClientModule as Module } from '@owlmeans/client-module'
8
+ export type { ClientEntrypoint as Module } from '@owlmeans/client-entrypoint'
9
9
  export type { ClientRoute as Route } from '@owlmeans/client-route'
package/src/middleware.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Middleware } from '@owlmeans/context'
2
2
  import { MiddlewareType, MiddlewareStage, AppType } from '@owlmeans/context'
3
- import type { ClientModule } from '@owlmeans/client-module'
3
+ import type { ClientEntrypoint } from '@owlmeans/client-entrypoint'
4
4
  import { AuthUnknown } from '@owlmeans/auth'
5
5
  import { ResilientError } from '@owlmeans/error'
6
6
  import { DEFAULT_ALIAS } from '@owlmeans/client-auth'
@@ -10,7 +10,7 @@ export const logoutMiddleware: Middleware = {
10
10
  type: MiddlewareType.Context,
11
11
  stage: MiddlewareStage.Loading,
12
12
  apply: async context => {
13
- context.modules<Perked>().forEach(module => {
13
+ context.entrypoints<Perked>().forEach(module => {
14
14
  if (module.route.route.type === AppType.Backend && module.call != null) {
15
15
  const guards = module.getGuards()
16
16
  if (guards.length > 0) {
@@ -46,6 +46,6 @@ export const logoutMiddleware: Middleware = {
46
46
  }
47
47
  }
48
48
 
49
- interface Perked extends ClientModule<unknown> {
49
+ interface Perked extends ClientEntrypoint<unknown> {
50
50
  _auth_web_middleware_applied?: boolean
51
51
  }
package/src/modules.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DISPATCHER } from '@owlmeans/auth'
2
2
  import { modules as list } from '@owlmeans/client-auth'
3
- import { elevate } from '@owlmeans/client-module'
3
+ import { elevate } from '@owlmeans/client-entrypoint'
4
4
  import { handler } from '@owlmeans/client'
5
5
  import { Dispatcher } from './components/dispatcher/component.js'
6
6
 
package/src/service.ts CHANGED
@@ -5,7 +5,7 @@ import { authMiddleware } from '@owlmeans/auth-common'
5
5
  import type { AuthServiceAppend } from '@owlmeans/client-auth'
6
6
  import { DEFAULT_ALIAS, makeAuthService } from '@owlmeans/client-auth'
7
7
  import type { ClientConfig, ClientContext } from '@owlmeans/client-context'
8
- import type { ClientModule } from '@owlmeans/client-module'
8
+ import type { ClientEntrypoint } from '@owlmeans/client-entrypoint'
9
9
  import { logoutMiddleware } from './middleware.js'
10
10
 
11
11
  export const makeAuthWebService = (alias: string = DEFAULT_ALIAS): AuthService => {
@@ -15,7 +15,7 @@ export const makeAuthWebService = (alias: string = DEFAULT_ALIAS): AuthService =
15
15
  service.update = async token => {
16
16
  await update(token)
17
17
  if (token == null) {
18
- const module = service.assertCtx().module<ClientModule<string>>(DISPATCHER)
18
+ const module = service.assertCtx().entrypoint<ClientEntrypoint<string>>(DISPATCHER)
19
19
  const [url] = await module.call()
20
20
  document.location.href = url
21
21
  }
package/tsconfig.json CHANGED
@@ -1,15 +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. */
7
+ "rootDir": "./src/",
8
+ "outDir": "./build/"
9
9
  },
10
- "exclude": [
11
- "./dist/**/*",
12
- "./build/**/*",
13
- "./*.ts"
14
- ]
15
- }
10
+ "exclude": ["./dist/**/*", "./build/**/*", "./*.ts"]
11
+ }
@@ -1 +0,0 @@
1
- //# sourceMappingURL=simplified.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simplified.d.ts","sourceRoot":"","sources":["../../../src/components/dispatcher/simplified.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=simplified.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simplified.js","sourceRoot":"","sources":["../../../src/components/dispatcher/simplified.tsx"],"names":[],"mappings":""}