@herdingbits/trailhead-core 0.0.3 → 0.0.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,6 +1,24 @@
1
1
  # @herdingbits/trailhead-core
2
2
 
3
- Core shell orchestration for the Trailhead micro-frontend framework.
3
+ Simple application shell that orchestrates multiple SPAs. No webpack magic, just the browser's native module system.
4
+
5
+ ## What is this?
6
+
7
+ This package provides the core shell logic for the Trailhead micro-frontend pattern:
8
+ - Orchestrates multiple single page applications (SPAs) within a shared layout
9
+ - Manages navigation and routing (no URL rewrites needed between apps)
10
+ - Provides centralized HTTP client with error handling
11
+ - Coordinates user feedback (toasts, dialogs, busy states)
12
+ - Integrates with design systems via adapters
13
+
14
+ **Think of it like browser extensions or VS Code plugins** - the shell provides infrastructure, SPAs focus on business logic.
15
+
16
+ ## Key Features
17
+
18
+ - **Framework Agnostic**: SPAs can use React, Vue, Svelte, or vanilla JS
19
+ - **Independent Deployment**: Deploy one SPA without touching others
20
+ - **Simple Deployment**: No URL rewrites, works on any static host
21
+ - **Design System Adapters**: Pluggable UI layer (Shoelace, CloudScape, or custom)
4
22
 
5
23
  ## Installation
6
24
 
@@ -21,6 +39,11 @@ const shell = new Trailhead({
21
39
  });
22
40
  ```
23
41
 
42
+ ## Available Adapters
43
+
44
+ - **[@herdingbits/trailhead-shoelace](https://www.npmjs.com/package/@herdingbits/trailhead-shoelace)** - Shoelace web components (vanilla TypeScript)
45
+ - **[@herdingbits/trailhead-cloudscape](https://www.npmjs.com/package/@herdingbits/trailhead-cloudscape)** - AWS CloudScape Design System (React)
46
+
24
47
  ## Documentation
25
48
 
26
49
  See the [main Trailhead documentation](https://github.com/herdingbits/trailhead) for more information.
@@ -1,96 +1,428 @@
1
1
  /**
2
2
  * Shell API Interface
3
- * Exposed to plugin applications via window.shell
3
+ *
4
+ * The main API exposed to single page applications (SPAs) via `window.shell`.
5
+ * Provides access to shared services including feedback, HTTP client, and navigation.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * export function init(shell: ShellAPI) {
10
+ * shell.feedback.success('App loaded!');
11
+ * const result = await shell.http.get('/api/data');
12
+ * }
13
+ * ```
4
14
  */
5
15
  export interface ShellAPI {
16
+ /** Shell version string (e.g., "1.0.0") */
6
17
  version: string;
18
+ /** User feedback system for toasts, dialogs, and loading states */
7
19
  feedback: FeedbackAPI;
20
+ /** HTTP client with automatic error handling and loading indicators */
8
21
  http: HttpAPI;
22
+ /** Navigation and routing utilities */
9
23
  navigation: NavigationAPI;
10
24
  }
11
25
  /**
12
26
  * Feedback system API
27
+ *
28
+ * Provides consistent user feedback across all SPAs using the shell's design system.
29
+ * Handles toasts, loading overlays, confirmation dialogs, and alerts.
13
30
  */
14
31
  export interface FeedbackAPI {
32
+ /**
33
+ * Show a loading overlay with a message.
34
+ * Call `clear()` to remove it.
35
+ *
36
+ * @param message - Loading message to display
37
+ * @example
38
+ * ```typescript
39
+ * shell.feedback.busy('Loading data...');
40
+ * await fetchData();
41
+ * shell.feedback.clear();
42
+ * ```
43
+ */
15
44
  busy(message: string): void;
45
+ /**
46
+ * Clear the loading overlay.
47
+ */
16
48
  clear(): void;
49
+ /**
50
+ * Show a success toast notification.
51
+ *
52
+ * @param message - Success message to display
53
+ * @param duration - Duration in milliseconds (default: 3000)
54
+ * @example
55
+ * ```typescript
56
+ * shell.feedback.success('User saved successfully!');
57
+ * ```
58
+ */
17
59
  success(message: string, duration?: number): void;
60
+ /**
61
+ * Show an error toast notification.
62
+ *
63
+ * @param message - Error message to display
64
+ * @param duration - Duration in milliseconds (default: 5000)
65
+ * @example
66
+ * ```typescript
67
+ * shell.feedback.error('Failed to save user');
68
+ * ```
69
+ */
18
70
  error(message: string, duration?: number): void;
71
+ /**
72
+ * Show a warning toast notification.
73
+ *
74
+ * @param message - Warning message to display
75
+ * @param duration - Duration in milliseconds (default: 4000)
76
+ */
19
77
  warning(message: string, duration?: number): void;
78
+ /**
79
+ * Show an info toast notification.
80
+ *
81
+ * @param message - Info message to display
82
+ * @param duration - Duration in milliseconds (default: 3000)
83
+ */
20
84
  info(message: string, duration?: number): void;
85
+ /**
86
+ * Show an alert toast with a specific variant.
87
+ *
88
+ * @param message - Alert message to display
89
+ * @param variant - Alert type: "success" | "error" | "warning" | "info"
90
+ * @param duration - Duration in milliseconds
91
+ */
21
92
  alert(message: string, variant?: AlertVariant, duration?: number): void;
93
+ /**
94
+ * Show a confirmation dialog with OK/Cancel buttons.
95
+ *
96
+ * @param message - Confirmation message
97
+ * @param title - Dialog title (optional)
98
+ * @returns Promise that resolves to `true` if confirmed, `false` if cancelled
99
+ * @example
100
+ * ```typescript
101
+ * const confirmed = await shell.feedback.confirm('Delete this user?', 'Confirm Delete');
102
+ * if (confirmed) {
103
+ * await deleteUser();
104
+ * }
105
+ * ```
106
+ */
22
107
  confirm(message: string, title?: string): Promise<boolean>;
108
+ /**
109
+ * Show an alert dialog with an OK button.
110
+ *
111
+ * @param message - Alert message
112
+ * @param title - Dialog title (optional)
113
+ * @returns Promise that resolves when OK is clicked
114
+ */
23
115
  ok(message: string, title?: string): Promise<void>;
116
+ /**
117
+ * Show a dialog with Yes/No buttons.
118
+ *
119
+ * @param message - Question message
120
+ * @param title - Dialog title (optional)
121
+ * @returns Promise that resolves to `true` for Yes, `false` for No
122
+ */
24
123
  yesNo(message: string, title?: string): Promise<boolean>;
124
+ /**
125
+ * Show a dialog with Yes/No/Cancel buttons.
126
+ *
127
+ * @param message - Question message
128
+ * @param title - Dialog title (optional)
129
+ * @returns Promise that resolves to "yes", "no", or "cancel"
130
+ * @example
131
+ * ```typescript
132
+ * const choice = await shell.feedback.yesNoCancel('Save changes?', 'Unsaved Changes');
133
+ * if (choice === 'yes') {
134
+ * await saveChanges();
135
+ * } else if (choice === 'no') {
136
+ * discardChanges();
137
+ * }
138
+ * ```
139
+ */
25
140
  yesNoCancel(message: string, title?: string): Promise<"yes" | "no" | "cancel">;
141
+ /**
142
+ * Show a custom dialog with user-defined buttons.
143
+ *
144
+ * @param message - Dialog message
145
+ * @param title - Dialog title
146
+ * @param buttons - Array of button configurations
147
+ * @returns Promise that resolves to the selected button's value, or null if cancelled
148
+ * @example
149
+ * ```typescript
150
+ * const action = await shell.feedback.custom(
151
+ * 'Choose an action',
152
+ * 'User Actions',
153
+ * [
154
+ * { label: 'Edit', value: 'edit', variant: 'primary' },
155
+ * { label: 'Delete', value: 'delete', variant: 'danger' },
156
+ * { label: 'Cancel', value: 'cancel' }
157
+ * ]
158
+ * );
159
+ * if (action === 'delete') {
160
+ * await deleteUser();
161
+ * }
162
+ * ```
163
+ */
26
164
  custom<T extends string>(message: string, title: string, buttons: Array<{
27
165
  label: string;
28
166
  value: T;
29
167
  variant?: string;
30
168
  }>): Promise<T | null>;
31
169
  }
170
+ /** Alert variant types for toast notifications */
32
171
  export type AlertVariant = "success" | "error" | "warning" | "info";
33
172
  /**
34
173
  * HTTP client API with automatic feedback orchestration
174
+ *
175
+ * Provides HTTP methods with built-in error handling, loading indicators,
176
+ * and success/error feedback. All requests return a discriminated union
177
+ * for type-safe error handling.
35
178
  */
36
179
  export interface HttpAPI {
180
+ /**
181
+ * Perform a GET request.
182
+ *
183
+ * @param url - Request URL (relative to apiUrl or absolute)
184
+ * @param options - Request options for feedback and headers
185
+ * @returns Promise with success/error result
186
+ * @example
187
+ * ```typescript
188
+ * const result = await shell.http.get('/api/users', {
189
+ * busyMessage: 'Loading users...',
190
+ * successMessage: 'Users loaded!',
191
+ * showSuccess: true
192
+ * });
193
+ *
194
+ * if (result.success) {
195
+ * console.log(result.data);
196
+ * } else {
197
+ * console.error(result.error.message);
198
+ * }
199
+ * ```
200
+ */
37
201
  get<T = any>(url: string, options?: RequestOptions): Promise<Result<T>>;
202
+ /**
203
+ * Perform a POST request.
204
+ *
205
+ * @param url - Request URL
206
+ * @param data - Request body data
207
+ * @param options - Request options for feedback and headers
208
+ * @returns Promise with success/error result
209
+ * @example
210
+ * ```typescript
211
+ * const result = await shell.http.post('/api/users', userData, {
212
+ * busyMessage: 'Creating user...',
213
+ * successMessage: 'User created!',
214
+ * showSuccess: true
215
+ * });
216
+ * ```
217
+ */
38
218
  post<T = any>(url: string, data?: any, options?: RequestOptions): Promise<Result<T>>;
219
+ /**
220
+ * Perform a PUT request.
221
+ *
222
+ * @param url - Request URL
223
+ * @param data - Request body data
224
+ * @param options - Request options for feedback and headers
225
+ * @returns Promise with success/error result
226
+ */
39
227
  put<T = any>(url: string, data?: any, options?: RequestOptions): Promise<Result<T>>;
228
+ /**
229
+ * Perform a PATCH request.
230
+ *
231
+ * @param url - Request URL
232
+ * @param data - Request body data
233
+ * @param options - Request options for feedback and headers
234
+ * @returns Promise with success/error result
235
+ */
40
236
  patch<T = any>(url: string, data?: any, options?: RequestOptions): Promise<Result<T>>;
237
+ /**
238
+ * Perform a DELETE request.
239
+ *
240
+ * @param url - Request URL
241
+ * @param options - Request options for feedback and headers
242
+ * @returns Promise with success/error result
243
+ * @example
244
+ * ```typescript
245
+ * const result = await shell.http.delete(`/api/users/${userId}`, {
246
+ * busyMessage: 'Deleting user...',
247
+ * successMessage: 'User deleted!',
248
+ * showSuccess: true
249
+ * });
250
+ * ```
251
+ */
41
252
  delete<T = any>(url: string, options?: RequestOptions): Promise<Result<T>>;
42
253
  }
254
+ /**
255
+ * HTTP request options
256
+ */
43
257
  export interface RequestOptions {
258
+ /**
259
+ * Unique key to prevent duplicate concurrent requests.
260
+ * If a request with the same key is in progress, subsequent requests are ignored.
261
+ *
262
+ * @example
263
+ * ```typescript
264
+ * // Only one save request at a time
265
+ * await shell.http.post('/api/save', data, { requestKey: 'save-user' });
266
+ * ```
267
+ */
44
268
  requestKey?: string;
269
+ /**
270
+ * Message to show in loading overlay while request is in progress.
271
+ * If not provided, no loading overlay is shown.
272
+ */
45
273
  busyMessage?: string;
274
+ /**
275
+ * Message to show in success toast when request completes successfully.
276
+ * Only shown if `showSuccess` is true.
277
+ */
46
278
  successMessage?: string;
279
+ /**
280
+ * Whether to show success toast on successful request.
281
+ * Default: false
282
+ */
47
283
  showSuccess?: boolean;
284
+ /**
285
+ * Disable all automatic feedback (loading, success, error).
286
+ * Useful when you want to handle feedback manually.
287
+ * Default: false
288
+ */
48
289
  noFeedback?: boolean;
290
+ /**
291
+ * Additional HTTP headers to include in the request.
292
+ *
293
+ * @example
294
+ * ```typescript
295
+ * await shell.http.get('/api/data', {
296
+ * headers: { 'X-Custom-Header': 'value' }
297
+ * });
298
+ * ```
299
+ */
49
300
  headers?: Record<string, string>;
50
301
  }
302
+ /**
303
+ * Successful HTTP response
304
+ */
51
305
  export interface SuccessResult<T> {
306
+ /** Always true for successful responses */
52
307
  success: true;
308
+ /** Response data */
53
309
  data: T;
310
+ /** Request key if provided in options */
54
311
  requestKey?: string;
55
312
  }
313
+ /**
314
+ * Failed HTTP response
315
+ */
56
316
  export interface ErrorResult {
317
+ /** Always false for error responses */
57
318
  success: false;
319
+ /** Error details */
58
320
  error: HttpError;
321
+ /** Request key if provided in options */
59
322
  requestKey?: string;
60
323
  }
324
+ /**
325
+ * Discriminated union of success or error result.
326
+ * Use the `success` property to narrow the type.
327
+ *
328
+ * @example
329
+ * ```typescript
330
+ * const result = await shell.http.get('/api/data');
331
+ *
332
+ * if (result.success) {
333
+ * // TypeScript knows result.data exists
334
+ * console.log(result.data);
335
+ * } else {
336
+ * // TypeScript knows result.error exists
337
+ * console.error(result.error.message);
338
+ * }
339
+ * ```
340
+ */
61
341
  export type Result<T> = SuccessResult<T> | ErrorResult;
342
+ /**
343
+ * HTTP error details
344
+ */
62
345
  export interface HttpError {
346
+ /** Error name (e.g., "HTTPError", "TimeoutError") */
63
347
  name: string;
348
+ /** Human-readable error message */
64
349
  message: string;
350
+ /** HTTP status code if available (e.g., 404, 500) */
65
351
  status?: number;
352
+ /** Additional error data from server response */
66
353
  data?: any;
67
354
  }
68
355
  /**
69
356
  * Navigation API
357
+ *
358
+ * Provides navigation between SPAs and route change notifications.
70
359
  */
71
360
  export interface NavigationAPI {
361
+ /**
362
+ * Navigate to a different path.
363
+ * Triggers a full page reload to load the target SPA.
364
+ *
365
+ * @param path - Target path (e.g., "/demo", "/users")
366
+ * @example
367
+ * ```typescript
368
+ * shell.navigation.navigate('/demo');
369
+ * ```
370
+ */
72
371
  navigate(path: string): void;
372
+ /**
373
+ * Get the current path.
374
+ *
375
+ * @returns Current path (e.g., "/demo")
376
+ */
73
377
  getCurrentPath(): string;
378
+ /**
379
+ * Subscribe to route changes.
380
+ *
381
+ * @param callback - Function called when route changes
382
+ * @returns Unsubscribe function
383
+ * @example
384
+ * ```typescript
385
+ * const unsubscribe = shell.navigation.onRouteChange((path) => {
386
+ * console.log('Route changed to:', path);
387
+ * });
388
+ *
389
+ * // Later, unsubscribe
390
+ * unsubscribe();
391
+ * ```
392
+ */
74
393
  onRouteChange(callback: (path: string) => void): () => void;
75
394
  }
76
395
  /**
77
- * Navigation configuration
396
+ * Navigation item configuration
397
+ *
398
+ * Defines a navigation menu item in `navigation.json`.
78
399
  */
79
400
  export interface NavItem {
401
+ /** Unique identifier for the navigation item */
80
402
  id: string;
403
+ /** URL path for the navigation item (e.g., "/demo") */
81
404
  path: string;
405
+ /** SPA identifier (matches directory name) */
82
406
  app: string;
407
+ /** Icon name (design system specific) */
83
408
  icon: string;
409
+ /** Display label for the navigation item */
84
410
  label: string;
411
+ /** Sort order (lower numbers appear first) */
85
412
  order: number;
413
+ /** Optional badge function that returns a count to display */
86
414
  badge?: () => number;
87
415
  }
88
416
  /**
89
417
  * Global window extension
418
+ *
419
+ * Extends the Window interface to include Trailhead shell API.
90
420
  */
91
421
  declare global {
92
422
  interface Window {
423
+ /** Trailhead shell API available to all SPAs */
93
424
  shell: ShellAPI;
425
+ /** Legacy mount function (deprecated, use init() export instead) */
94
426
  AppMount?: (container: HTMLElement) => void;
95
427
  }
96
428
  }
@@ -1 +1 @@
1
- {"version":3,"file":"shell-api.d.ts","sourceRoot":"","sources":["../../src/types/shell-api.ts"],"names":[],"mappings":"AAAA;;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CAAC;QAEhB,oEAAoE;QACpE,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,KAAK,IAAI,CAAC;KAC7C;CACF"}
@@ -1,5 +1 @@
1
- /**
2
- * Shell API Interface
3
- * Exposed to plugin applications via window.shell
4
- */
5
1
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@herdingbits/trailhead-core",
3
- "version": "0.0.3",
4
- "description": "Core shell orchestration for Trailhead micro-frontend framework",
3
+ "version": "0.0.4",
4
+ "description": "Simple application shell that orchestrates multiple SPAs. No webpack magic, just the browser's native module system.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",