@owlmeans/web-client 0.1.1 → 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.
- package/LICENSE +1 -1
- package/README.md +37 -576
- package/build/components/dispatcher/index.d.ts +2 -0
- package/build/components/dispatcher/index.d.ts.map +1 -1
- package/build/components/dispatcher/index.js +1 -0
- package/build/components/dispatcher/index.js.map +1 -1
- package/build/components/dispatcher/parametrise.d.ts +5 -0
- package/build/components/dispatcher/parametrise.d.ts.map +1 -0
- package/build/components/dispatcher/parametrise.js +24 -0
- package/build/components/dispatcher/parametrise.js.map +1 -0
- package/build/components/dispatcher/types.d.ts +6 -0
- package/build/components/dispatcher/types.d.ts.map +1 -0
- package/build/components/dispatcher/types.js +2 -0
- package/build/components/dispatcher/types.js.map +1 -0
- package/build/exports.d.ts +2 -2
- package/build/exports.d.ts.map +1 -1
- package/build/exports.js +1 -1
- package/build/exports.js.map +1 -1
- package/build/middleware.d.ts +3 -0
- package/build/middleware.d.ts.map +1 -0
- package/build/middleware.js +44 -0
- package/build/middleware.js.map +1 -0
- package/build/modules.d.ts +1 -1
- package/build/modules.d.ts.map +1 -1
- package/build/modules.js +1 -1
- package/build/modules.js.map +1 -1
- package/build/service.d.ts +1 -1
- package/build/service.d.ts.map +1 -1
- package/build/service.js +4 -3
- package/build/service.js.map +1 -1
- package/package.json +20 -18
- package/src/components/dispatcher/index.ts +2 -0
- package/src/components/dispatcher/parametrise.tsx +28 -0
- package/src/components/dispatcher/types.ts +6 -0
- package/src/exports.ts +2 -2
- package/src/middleware.ts +51 -0
- package/src/modules.ts +1 -1
- package/src/service.ts +8 -7
- package/tsconfig.json +6 -10
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2026 OwlMeans Common — Fullstack typescript framework
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -1,617 +1,78 @@
|
|
|
1
1
|
# @owlmeans/web-client
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
21
|
+
Bootstrap the app:
|
|
219
22
|
|
|
220
|
-
#### I18n Integration
|
|
221
23
|
```typescript
|
|
222
|
-
import {
|
|
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
|
-
|
|
326
|
-
context
|
|
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
|
-
|
|
32
|
+
Define modules:
|
|
473
33
|
|
|
474
34
|
```typescript
|
|
475
|
-
import {
|
|
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
|
-
|
|
488
|
-
|
|
489
|
-
|
|
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
|
-
|
|
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 {
|
|
45
|
+
import type { Module } from '@owlmeans/web-client'
|
|
525
46
|
|
|
526
|
-
|
|
527
|
-
|
|
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
|
-
##
|
|
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
|
-
###
|
|
554
|
-
```typescript
|
|
555
|
-
// Authentication
|
|
556
|
-
import { makeAuthService } from '@owlmeans/client-auth'
|
|
53
|
+
### `makeContext<C, T>(cfg): T`
|
|
557
54
|
|
|
558
|
-
|
|
559
|
-
import { makeResourceService } from '@owlmeans/client-resource'
|
|
55
|
+
Creates a web app context. Automatically registers web router, IndexedDB, and auth services.
|
|
560
56
|
|
|
561
|
-
|
|
562
|
-
import { makeI18nService } from '@owlmeans/client-i18n'
|
|
57
|
+
### `renderApp<C, T>(context): void`
|
|
563
58
|
|
|
564
|
-
|
|
565
|
-
import { WebDbService } from '@owlmeans/web-db'
|
|
566
|
-
```
|
|
59
|
+
Renders the React application to the DOM using the provided context.
|
|
567
60
|
|
|
568
|
-
###
|
|
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
|
-
|
|
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
|
-
|
|
65
|
+
### `makeAuthWebService(alias?)`, `appendWebAuthService(ctx, alias?)`
|
|
590
66
|
|
|
591
|
-
|
|
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
|
-
|
|
69
|
+
### `Dispatcher`
|
|
600
70
|
|
|
601
|
-
|
|
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)
|
|
614
|
-
- [`@owlmeans/
|
|
615
|
-
- [`@owlmeans/web-db`](../web-db)
|
|
616
|
-
- [`@owlmeans/client-
|
|
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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/dispatcher/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/dispatcher/index.ts"],"names":[],"mappings":"AACA,mBAAmB,YAAY,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/dispatcher/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/dispatcher/index.ts"],"names":[],"mappings":"AAEA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RoutedComponent } from "@owlmeans/client";
|
|
2
|
+
import type { DispatcherProps } from "@owlmeans/client-auth";
|
|
3
|
+
import { ParametrisedProps } from "./types.js";
|
|
4
|
+
export declare const parametriseDispatcher: (def: Partial<ParametrisedProps>, Com?: RoutedComponent<DispatcherProps>) => (props: ParametrisedProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=parametrise.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parametrise.d.ts","sourceRoot":"","sources":["../../../src/components/dispatcher/parametrise.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAI5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C,eAAO,MAAM,qBAAqB,GAAI,KAAK,OAAO,CAAC,iBAAiB,CAAC,EAAE,MAAM,eAAe,CAAC,eAAe,CAAC,MAEnG,OAAO,iBAAiB,4CAiBjC,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { Dispatcher } from "./component.js";
|
|
4
|
+
export const parametriseDispatcher = (def, Com) => {
|
|
5
|
+
console.log('Parametrising dispatcher with', def);
|
|
6
|
+
return (props) => {
|
|
7
|
+
console.log('Rendering parametrised dispatcher with', props);
|
|
8
|
+
const _props = useMemo(() => {
|
|
9
|
+
let payload = undefined;
|
|
10
|
+
if (def.payload != null) {
|
|
11
|
+
payload = def.payload;
|
|
12
|
+
}
|
|
13
|
+
if (props.payload != null) {
|
|
14
|
+
payload ??= {};
|
|
15
|
+
Object.assign(payload, props.payload);
|
|
16
|
+
}
|
|
17
|
+
return { ...def, ...props, payload };
|
|
18
|
+
}, [props]);
|
|
19
|
+
console.log('Computed dispatcher props', _props);
|
|
20
|
+
Com ??= Dispatcher;
|
|
21
|
+
return _jsx(Com, { ..._props });
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=parametrise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parametrise.js","sourceRoot":"","sources":["../../../src/components/dispatcher/parametrise.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAG3C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,GAA+B,EAAE,GAAsC,EAAG,EAAE;IAChH,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,GAAG,CAAC,CAAA;IACjD,OAAO,CAAC,KAAwB,EAAE,EAAE;QAClC,OAAO,CAAC,GAAG,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAA;QAC5D,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE;YAC1B,IAAI,OAAO,GAA4B,SAAS,CAAA;YAChD,IAAI,GAAG,CAAC,OAAO,IAAI,IAAI,EAAE,CAAC;gBACxB,OAAO,GAAG,GAAG,CAAC,OAAO,CAAA;YACvB,CAAC;YACD,IAAI,KAAK,CAAC,OAAO,IAAI,IAAI,EAAE,CAAC;gBAC1B,OAAO,KAAK,EAAE,CAAA;gBACd,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;YACvC,CAAC;YACD,OAAO,EAAE,GAAG,GAAG,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,CAAA;QACtC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;QACX,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAA;QAChD,GAAG,KAAK,UAAU,CAAA;QAClB,OAAO,KAAC,GAAG,OAAK,MAAM,GAAI,CAAA;IAC5B,CAAC,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ModuleContextParams } from "@owlmeans/client";
|
|
2
|
+
import type { DispatcherProps } from "@owlmeans/client-auth";
|
|
3
|
+
import type { PropsWithChildren } from "react";
|
|
4
|
+
export interface ParametrisedProps extends PropsWithChildren<ModuleContextParams & DispatcherProps> {
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/dispatcher/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAE9C,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB,CAAC,mBAAmB,GAAG,eAAe,CAAC;CAClG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/dispatcher/types.ts"],"names":[],"mappings":""}
|
package/build/exports.d.ts
CHANGED
|
@@ -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 {
|
|
5
|
+
export { entrypoint, elevate, provideRequest, stab } from '@owlmeans/client-entrypoint';
|
|
6
6
|
export { route, frontend } from '@owlmeans/route';
|
|
7
|
-
export type {
|
|
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
|
package/build/exports.d.ts.map
CHANGED
|
@@ -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,
|
|
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 {
|
|
5
|
+
export { entrypoint, elevate, provideRequest, stab } from '@owlmeans/client-entrypoint';
|
|
6
6
|
export { route, frontend } from '@owlmeans/route';
|
|
7
7
|
//# sourceMappingURL=exports.js.map
|
package/build/exports.js.map
CHANGED
|
@@ -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,
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAQnD,eAAO,MAAM,gBAAgB,EAAE,UAsC9B,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { MiddlewareType, MiddlewareStage, AppType } from '@owlmeans/context';
|
|
2
|
+
import { AuthUnknown } from '@owlmeans/auth';
|
|
3
|
+
import { ResilientError } from '@owlmeans/error';
|
|
4
|
+
import { DEFAULT_ALIAS } from '@owlmeans/client-auth';
|
|
5
|
+
export const logoutMiddleware = {
|
|
6
|
+
type: MiddlewareType.Context,
|
|
7
|
+
stage: MiddlewareStage.Loading,
|
|
8
|
+
apply: async (context) => {
|
|
9
|
+
context.entrypoints().forEach(module => {
|
|
10
|
+
if (module.route.route.type === AppType.Backend && module.call != null) {
|
|
11
|
+
const guards = module.getGuards();
|
|
12
|
+
if (guards.length > 0) {
|
|
13
|
+
if (module._auth_web_middleware_applied === true) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
module._auth_web_middleware_applied = true;
|
|
17
|
+
// const auth = context.service<GuardService>(service)
|
|
18
|
+
const call = module.call;
|
|
19
|
+
module.call = async (req, res) => {
|
|
20
|
+
try {
|
|
21
|
+
return await call(req, res);
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
if (e instanceof Error) {
|
|
25
|
+
const err = ResilientError.ensure(e);
|
|
26
|
+
if (err instanceof AuthUnknown) {
|
|
27
|
+
if (err.message.endsWith(':invalid')) {
|
|
28
|
+
if (typeof window !== 'undefined') {
|
|
29
|
+
const auth = context.service(DEFAULT_ALIAS);
|
|
30
|
+
await auth.update(undefined);
|
|
31
|
+
throw err;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
throw e;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=middleware.js.map
|
|
@@ -0,0 +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,WAAW,EAAU,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7C,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/B,IAAI,CAAC;4BACH,OAAO,MAAM,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;wBAC7B,CAAC;wBAAC,OAAO,CAAC,EAAE,CAAC;4BACX,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC;gCACvB,MAAM,GAAG,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;gCACpC,IAAI,GAAG,YAAY,WAAW,EAAE,CAAC;oCAC/B,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;wCACrC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;4CAClC,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAc,aAAa,CAAC,CAAA;4CACxD,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;4CAC5B,MAAM,GAAG,CAAA;wCACX,CAAC;oCACH,CAAC;gCACH,CAAC;4BACH,CAAC;4BACD,MAAM,CAAC,CAAA;wBACT,CAAC;oBACH,CAAC,CAAA;gBAEH,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
|
package/build/modules.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const modules: import("@owlmeans/client-
|
|
1
|
+
export declare const modules: import("@owlmeans/client-entrypoint").ClientEntrypoint<{}, import("@owlmeans/client-entrypoint").ClientRequest<{}>>[];
|
|
2
2
|
//# sourceMappingURL=modules.d.ts.map
|
package/build/modules.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,OAAO,
|
|
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-
|
|
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 });
|
package/build/modules.js.map
CHANGED
|
@@ -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,
|
|
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.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AuthServiceAppend } from '@owlmeans/client-auth';
|
|
2
1
|
import type { AuthService } from '@owlmeans/auth-common';
|
|
2
|
+
import type { AuthServiceAppend } from '@owlmeans/client-auth';
|
|
3
3
|
import type { ClientConfig, ClientContext } from '@owlmeans/client-context';
|
|
4
4
|
export declare const makeAuthWebService: (alias?: string) => AuthService;
|
|
5
5
|
export declare const appendWebAuthService: <C extends ClientConfig, T extends ClientContext<C>>(ctx: T, alias?: string) => T & AuthServiceAppend;
|
package/build/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAI3E,eAAO,MAAM,kBAAkB,GAAI,QAAO,MAAsB,KAAG,WAclE,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,EACrF,KAAK,CAAC,EAAE,QAAO,MAAsB,KACpC,CAAC,GAAG,iBAaN,CAAA"}
|
package/build/service.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { DEFAULT_ALIAS } from '@owlmeans/client-auth';
|
|
2
|
-
import { makeAuthService } from '@owlmeans/client-auth';
|
|
3
1
|
import { DISPATCHER } from '@owlmeans/auth';
|
|
4
2
|
import { authMiddleware } from '@owlmeans/auth-common';
|
|
3
|
+
import { DEFAULT_ALIAS, makeAuthService } from '@owlmeans/client-auth';
|
|
4
|
+
import { logoutMiddleware } from './middleware.js';
|
|
5
5
|
export const makeAuthWebService = (alias = DEFAULT_ALIAS) => {
|
|
6
6
|
const service = makeAuthService(alias);
|
|
7
7
|
const update = service.update;
|
|
8
8
|
service.update = async (token) => {
|
|
9
9
|
await update(token);
|
|
10
10
|
if (token == null) {
|
|
11
|
-
const module = service.assertCtx().
|
|
11
|
+
const module = service.assertCtx().entrypoint(DISPATCHER);
|
|
12
12
|
const [url] = await module.call();
|
|
13
13
|
document.location.href = url;
|
|
14
14
|
}
|
|
@@ -20,6 +20,7 @@ export const appendWebAuthService = (ctx, alias = DEFAULT_ALIAS) => {
|
|
|
20
20
|
const context = ctx;
|
|
21
21
|
context.registerService(service);
|
|
22
22
|
context.registerMiddleware(authMiddleware);
|
|
23
|
+
context.registerMiddleware(logoutMiddleware);
|
|
23
24
|
context.auth = () => ctx.service(service.alias);
|
|
24
25
|
return context;
|
|
25
26
|
};
|
package/build/service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
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,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,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/web-client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"scripts": {
|
|
6
7
|
"build": "tsc -b",
|
|
@@ -20,22 +21,22 @@
|
|
|
20
21
|
}
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
23
|
-
"@owlmeans/auth": "^0.1.
|
|
24
|
-
"@owlmeans/auth-common": "^0.1.
|
|
25
|
-
"@owlmeans/client": "^0.1.
|
|
26
|
-
"@owlmeans/client-auth": "^0.1.
|
|
27
|
-
"@owlmeans/client-context": "^0.1.
|
|
28
|
-
"@owlmeans/client-i18n": "^0.1.
|
|
29
|
-
"@owlmeans/client-
|
|
30
|
-
"@owlmeans/client-resource": "^0.1.
|
|
31
|
-
"@owlmeans/client-route": "^0.1.
|
|
32
|
-
"@owlmeans/config": "^0.1.
|
|
33
|
-
"@owlmeans/context": "^0.1.
|
|
34
|
-
"@owlmeans/error": "^0.1.
|
|
35
|
-
"@owlmeans/i18n": "^0.1.
|
|
36
|
-
"@owlmeans/route": "^0.1.
|
|
37
|
-
"@owlmeans/web-db": "^0.1.
|
|
38
|
-
"@owlmeans/web-router": "^0.1.
|
|
24
|
+
"@owlmeans/auth": "^0.1.3",
|
|
25
|
+
"@owlmeans/auth-common": "^0.1.3",
|
|
26
|
+
"@owlmeans/client": "^0.1.3",
|
|
27
|
+
"@owlmeans/client-auth": "^0.1.3",
|
|
28
|
+
"@owlmeans/client-context": "^0.1.3",
|
|
29
|
+
"@owlmeans/client-i18n": "^0.1.3",
|
|
30
|
+
"@owlmeans/client-entrypoint": "^0.1.3",
|
|
31
|
+
"@owlmeans/client-resource": "^0.1.3",
|
|
32
|
+
"@owlmeans/client-route": "^0.1.3",
|
|
33
|
+
"@owlmeans/config": "^0.1.3",
|
|
34
|
+
"@owlmeans/context": "^0.1.3",
|
|
35
|
+
"@owlmeans/error": "^0.1.3",
|
|
36
|
+
"@owlmeans/i18n": "^0.1.3",
|
|
37
|
+
"@owlmeans/route": "^0.1.3",
|
|
38
|
+
"@owlmeans/web-db": "^0.1.3",
|
|
39
|
+
"@owlmeans/web-router": "^0.1.3",
|
|
39
40
|
"react-dropzone": "^14.3.5"
|
|
40
41
|
},
|
|
41
42
|
"peerDependencies": {
|
|
@@ -44,11 +45,12 @@
|
|
|
44
45
|
"react-router": "^7.*"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
48
|
+
"@owlmeans/dep-config": "workspace:*",
|
|
47
49
|
"@types/react": "^19.2.7",
|
|
48
50
|
"@types/react-dom": "^19.2.3",
|
|
49
51
|
"nodemon": "^3.1.11",
|
|
50
52
|
"npm-check": "^6.0.1",
|
|
51
|
-
"typescript": "^
|
|
53
|
+
"typescript": "^6.0.2"
|
|
52
54
|
},
|
|
53
55
|
"publishConfig": {
|
|
54
56
|
"access": "public"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { RoutedComponent } from "@owlmeans/client"
|
|
2
|
+
import type { DispatcherProps } from "@owlmeans/client-auth"
|
|
3
|
+
import type { FlowPayload } from "@owlmeans/flow"
|
|
4
|
+
import { useMemo } from "react"
|
|
5
|
+
import { Dispatcher } from "./component.js"
|
|
6
|
+
import { ParametrisedProps } from "./types.js"
|
|
7
|
+
|
|
8
|
+
export const parametriseDispatcher = (def: Partial<ParametrisedProps>, Com?: RoutedComponent<DispatcherProps> ) => {
|
|
9
|
+
console.log('Parametrising dispatcher with', def)
|
|
10
|
+
return (props: ParametrisedProps) => {
|
|
11
|
+
console.log('Rendering parametrised dispatcher with', props)
|
|
12
|
+
const _props = useMemo(() => {
|
|
13
|
+
let payload: FlowPayload | undefined = undefined
|
|
14
|
+
if (def.payload != null) {
|
|
15
|
+
payload = def.payload
|
|
16
|
+
}
|
|
17
|
+
if (props.payload != null) {
|
|
18
|
+
payload ??= {}
|
|
19
|
+
Object.assign(payload, props.payload)
|
|
20
|
+
}
|
|
21
|
+
return { ...def, ...props, payload }
|
|
22
|
+
}, [props])
|
|
23
|
+
console.log('Computed dispatcher props', _props)
|
|
24
|
+
Com ??= Dispatcher
|
|
25
|
+
return <Com {..._props} />
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ModuleContextParams } from "@owlmeans/client"
|
|
2
|
+
import type { DispatcherProps } from "@owlmeans/client-auth"
|
|
3
|
+
import type { PropsWithChildren } from "react"
|
|
4
|
+
|
|
5
|
+
export interface ParametrisedProps extends PropsWithChildren<ModuleContextParams & DispatcherProps> {
|
|
6
|
+
}
|
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 {
|
|
6
|
+
export { entrypoint, elevate, provideRequest, stab } from '@owlmeans/client-entrypoint'
|
|
7
7
|
export { route, frontend } from '@owlmeans/route'
|
|
8
|
-
export type {
|
|
8
|
+
export type { ClientEntrypoint as Module } from '@owlmeans/client-entrypoint'
|
|
9
9
|
export type { ClientRoute as Route } from '@owlmeans/client-route'
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Middleware } from '@owlmeans/context'
|
|
2
|
+
import { MiddlewareType, MiddlewareStage, AppType } from '@owlmeans/context'
|
|
3
|
+
import type { ClientEntrypoint } from '@owlmeans/client-entrypoint'
|
|
4
|
+
import { AuthUnknown } from '@owlmeans/auth'
|
|
5
|
+
import { ResilientError } from '@owlmeans/error'
|
|
6
|
+
import { DEFAULT_ALIAS } from '@owlmeans/client-auth'
|
|
7
|
+
import { AuthService } from '@owlmeans/auth-common'
|
|
8
|
+
|
|
9
|
+
export const logoutMiddleware: Middleware = {
|
|
10
|
+
type: MiddlewareType.Context,
|
|
11
|
+
stage: MiddlewareStage.Loading,
|
|
12
|
+
apply: async context => {
|
|
13
|
+
context.entrypoints<Perked>().forEach(module => {
|
|
14
|
+
if (module.route.route.type === AppType.Backend && module.call != null) {
|
|
15
|
+
const guards = module.getGuards()
|
|
16
|
+
if (guards.length > 0) {
|
|
17
|
+
if (module._auth_web_middleware_applied === true) {
|
|
18
|
+
return
|
|
19
|
+
}
|
|
20
|
+
module._auth_web_middleware_applied = true
|
|
21
|
+
// const auth = context.service<GuardService>(service)
|
|
22
|
+
const call = module.call
|
|
23
|
+
module.call = async (req, res) => {
|
|
24
|
+
try {
|
|
25
|
+
return await call(req, res)
|
|
26
|
+
} catch (e) {
|
|
27
|
+
if (e instanceof Error) {
|
|
28
|
+
const err = ResilientError.ensure(e)
|
|
29
|
+
if (err instanceof AuthUnknown) {
|
|
30
|
+
if (err.message.endsWith(':invalid')) {
|
|
31
|
+
if (typeof window !== 'undefined') {
|
|
32
|
+
const auth = context.service<AuthService>(DEFAULT_ALIAS)
|
|
33
|
+
await auth.update(undefined)
|
|
34
|
+
throw err
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
throw e
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface Perked extends ClientEntrypoint<unknown> {
|
|
50
|
+
_auth_web_middleware_applied?: boolean
|
|
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-
|
|
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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
import { DEFAULT_ALIAS } from '@owlmeans/client-auth'
|
|
3
|
-
import type { AuthServiceAppend } from '@owlmeans/client-auth'
|
|
4
|
-
import type { AuthService } from '@owlmeans/auth-common'
|
|
5
|
-
import { makeAuthService } from '@owlmeans/client-auth'
|
|
6
|
-
import type { ClientModule } from '@owlmeans/client-module'
|
|
7
2
|
import { DISPATCHER } from '@owlmeans/auth'
|
|
8
|
-
import type {
|
|
3
|
+
import type { AuthService } from '@owlmeans/auth-common'
|
|
9
4
|
import { authMiddleware } from '@owlmeans/auth-common'
|
|
5
|
+
import type { AuthServiceAppend } from '@owlmeans/client-auth'
|
|
6
|
+
import { DEFAULT_ALIAS, makeAuthService } from '@owlmeans/client-auth'
|
|
7
|
+
import type { ClientConfig, ClientContext } from '@owlmeans/client-context'
|
|
8
|
+
import type { ClientEntrypoint } from '@owlmeans/client-entrypoint'
|
|
9
|
+
import { logoutMiddleware } from './middleware.js'
|
|
10
10
|
|
|
11
11
|
export const makeAuthWebService = (alias: string = DEFAULT_ALIAS): AuthService => {
|
|
12
12
|
const service = makeAuthService(alias)
|
|
@@ -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().
|
|
18
|
+
const module = service.assertCtx().entrypoint<ClientEntrypoint<string>>(DISPATCHER)
|
|
19
19
|
const [url] = await module.call()
|
|
20
20
|
document.location.href = url
|
|
21
21
|
}
|
|
@@ -34,6 +34,7 @@ export const appendWebAuthService = <C extends ClientConfig, T extends ClientCon
|
|
|
34
34
|
context.registerService(service)
|
|
35
35
|
|
|
36
36
|
context.registerMiddleware(authMiddleware)
|
|
37
|
+
context.registerMiddleware(logoutMiddleware)
|
|
37
38
|
|
|
38
39
|
context.auth = () => ctx.service(service.alias)
|
|
39
40
|
|
package/tsconfig.json
CHANGED
|
@@ -1,15 +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/"
|
|
7
|
+
"rootDir": "./src/",
|
|
8
|
+
"outDir": "./build/"
|
|
9
9
|
},
|
|
10
|
-
"exclude": [
|
|
11
|
-
|
|
12
|
-
"./build/**/*",
|
|
13
|
-
"./*.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
10
|
+
"exclude": ["./dist/**/*", "./build/**/*", "./*.ts"]
|
|
11
|
+
}
|