@genesislcap/foundation-utils 14.103.0-auth-mf.23 → 14.103.0-auth-mf.24

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.
@@ -414,6 +414,7 @@
414
414
  }
415
415
  }
416
416
  ],
417
+ "description": "assureDesignSystem.",
417
418
  "privacy": "public"
418
419
  }
419
420
  ],
@@ -1,5 +1,6 @@
1
1
  import { DesignSystem } from '@microsoft/fast-foundation';
2
2
  /**
3
+ * DesignSystemModule.
3
4
  * @public
4
5
  */
5
6
  export interface DesignSystemModule {
@@ -7,10 +8,46 @@ export interface DesignSystemModule {
7
8
  [key: string]: any;
8
9
  }
9
10
  /**
11
+ * DesignSystemResource.
10
12
  * @public
11
13
  */
12
14
  export type DesignSystemResource<T = DesignSystemModule> = Promise<T>;
13
15
  /**
16
+ * assureDesignSystem.
17
+ *
18
+ * @remarks
19
+ * Webpack caching strategies can backfill missing modules with placeholders in an attempt to prevent errors. In the case
20
+ * of offline remotes, we rely on the error to fall back to local versions. This utility assures we have a design system.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * async function zeroDesignSystemImport(): Promise<DesignSystemModule> {
25
+ * let module: DesignSystemModule;
26
+ * let type: ResourceType = ResourceType.remote;
27
+ * try {
28
+ * module = await import('foundationZero/ZeroDesignSystem');
29
+ * return assureDesignSystem(module);
30
+ * } catch (e) {
31
+ * logger.info(
32
+ * `Please note remoteEntry.js load errors are expected if module federated dependencies are offline. Falling back to locally bundled versions.`,
33
+ * );
34
+ * type = ResourceType.local;
35
+ * module = await import('@genesislcap/foundation-zero');
36
+ * return assureDesignSystem(module);
37
+ * } finally {
38
+ * logger.debug(`Using '${type}' version of foundation-zero`);
39
+ * }
40
+ * }
41
+ * ```
42
+ *
43
+ * @example You can also instruct webpack to use strict handling.
44
+ * ```ts
45
+ * output: {
46
+ * strictModuleErrorHandling: true,
47
+ * strictModuleExceptionHandling: true,
48
+ * }
49
+ * ```
50
+ *
14
51
  * @public
15
52
  */
16
53
  export declare function assureDesignSystem(module: DesignSystemModule): DesignSystemModule;
@@ -1 +1 @@
1
- {"version":3,"file":"design-system.d.ts","sourceRoot":"","sources":["../../../src/design-system/design-system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,mBAAmB,CACjB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,CAAC,EAAE,MAAM,GACd,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACjD,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,kBAAkB,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;AAEtE;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,CAQjF"}
1
+ {"version":3,"file":"design-system.d.ts","sourceRoot":"","sources":["../../../src/design-system/design-system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,mBAAmB,CACjB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,CAAC,EAAE,MAAM,GACd,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACjD,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,kBAAkB,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,CAQjF"}
@@ -1,4 +1,39 @@
1
1
  /**
2
+ * assureDesignSystem.
3
+ *
4
+ * @remarks
5
+ * Webpack caching strategies can backfill missing modules with placeholders in an attempt to prevent errors. In the case
6
+ * of offline remotes, we rely on the error to fall back to local versions. This utility assures we have a design system.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * async function zeroDesignSystemImport(): Promise<DesignSystemModule> {
11
+ * let module: DesignSystemModule;
12
+ * let type: ResourceType = ResourceType.remote;
13
+ * try {
14
+ * module = await import('foundationZero/ZeroDesignSystem');
15
+ * return assureDesignSystem(module);
16
+ * } catch (e) {
17
+ * logger.info(
18
+ * `Please note remoteEntry.js load errors are expected if module federated dependencies are offline. Falling back to locally bundled versions.`,
19
+ * );
20
+ * type = ResourceType.local;
21
+ * module = await import('@genesislcap/foundation-zero');
22
+ * return assureDesignSystem(module);
23
+ * } finally {
24
+ * logger.debug(`Using '${type}' version of foundation-zero`);
25
+ * }
26
+ * }
27
+ * ```
28
+ *
29
+ * @example You can also instruct webpack to use strict handling.
30
+ * ```ts
31
+ * output: {
32
+ * strictModuleErrorHandling: true,
33
+ * strictModuleExceptionHandling: true,
34
+ * }
35
+ * ```
36
+ *
2
37
  * @public
3
38
  */
4
39
  export function assureDesignSystem(module) {
@@ -230,7 +230,7 @@
230
230
  {
231
231
  "kind": "Function",
232
232
  "canonicalReference": "@genesislcap/foundation-utils!assureDesignSystem:function(1)",
233
- "docComment": "/**\n * @public\n */\n",
233
+ "docComment": "/**\n * assureDesignSystem.\n *\n * @remarks\n *\n * Webpack caching strategies can backfill missing modules with placeholders in an attempt to prevent errors. In the case of offline remotes, we rely on the error to fall back to local versions. This utility assures we have a design system.\n *\n * @example\n * ```ts\n * async function zeroDesignSystemImport(): Promise<DesignSystemModule> {\n * let module: DesignSystemModule;\n * let type: ResourceType = ResourceType.remote;\n * try {\n * module = await import('foundationZero/ZeroDesignSystem');\n * return assureDesignSystem(module);\n * } catch (e) {\n * logger.info(\n * `Please note remoteEntry.js load errors are expected if module federated dependencies are offline. Falling back to locally bundled versions.`,\n * );\n * type = ResourceType.local;\n * module = await import('@genesislcap/foundation-zero');\n * return assureDesignSystem(module);\n * } finally {\n * logger.debug(`Using '${type}' version of foundation-zero`);\n * }\n * }\n * ```\n *\n * @example\n *\n * You can also instruct webpack to use strict handling.\n * ```ts\n * output: {\n * strictModuleErrorHandling: true,\n * strictModuleExceptionHandling: true,\n * }\n * ```\n *\n * @public\n */\n",
234
234
  "excerptTokens": [
235
235
  {
236
236
  "kind": "Content",
@@ -2372,7 +2372,7 @@
2372
2372
  {
2373
2373
  "kind": "Interface",
2374
2374
  "canonicalReference": "@genesislcap/foundation-utils!DesignSystemModule:interface",
2375
- "docComment": "/**\n * @public\n */\n",
2375
+ "docComment": "/**\n * DesignSystemModule.\n *\n * @public\n */\n",
2376
2376
  "excerptTokens": [
2377
2377
  {
2378
2378
  "kind": "Content",
@@ -2519,7 +2519,7 @@
2519
2519
  {
2520
2520
  "kind": "TypeAlias",
2521
2521
  "canonicalReference": "@genesislcap/foundation-utils!DesignSystemResource:type",
2522
- "docComment": "/**\n * @public\n */\n",
2522
+ "docComment": "/**\n * DesignSystemResource.\n *\n * @public\n */\n",
2523
2523
  "excerptTokens": [
2524
2524
  {
2525
2525
  "kind": "Content",
@@ -29,6 +29,41 @@ export declare const activeColorScheme: CSSDesignToken<string>;
29
29
  export declare let API_HOST: string;
30
30
 
31
31
  /**
32
+ * assureDesignSystem.
33
+ *
34
+ * @remarks
35
+ * Webpack caching strategies can backfill missing modules with placeholders in an attempt to prevent errors. In the case
36
+ * of offline remotes, we rely on the error to fall back to local versions. This utility assures we have a design system.
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * async function zeroDesignSystemImport(): Promise<DesignSystemModule> {
41
+ * let module: DesignSystemModule;
42
+ * let type: ResourceType = ResourceType.remote;
43
+ * try {
44
+ * module = await import('foundationZero/ZeroDesignSystem');
45
+ * return assureDesignSystem(module);
46
+ * } catch (e) {
47
+ * logger.info(
48
+ * `Please note remoteEntry.js load errors are expected if module federated dependencies are offline. Falling back to locally bundled versions.`,
49
+ * );
50
+ * type = ResourceType.local;
51
+ * module = await import('@genesislcap/foundation-zero');
52
+ * return assureDesignSystem(module);
53
+ * } finally {
54
+ * logger.debug(`Using '${type}' version of foundation-zero`);
55
+ * }
56
+ * }
57
+ * ```
58
+ *
59
+ * @example You can also instruct webpack to use strict handling.
60
+ * ```ts
61
+ * output: {
62
+ * strictModuleErrorHandling: true,
63
+ * strictModuleExceptionHandling: true,
64
+ * }
65
+ * ```
66
+ *
32
67
  * @public
33
68
  */
34
69
  export declare function assureDesignSystem(module: DesignSystemModule): DesignSystemModule;
@@ -268,6 +303,7 @@ export declare class DefaultServerRowDTOMapper implements ServerRowDTOMapper {
268
303
  }
269
304
 
270
305
  /**
306
+ * DesignSystemModule.
271
307
  * @public
272
308
  */
273
309
  export declare interface DesignSystemModule {
@@ -276,6 +312,7 @@ export declare interface DesignSystemModule {
276
312
  }
277
313
 
278
314
  /**
315
+ * DesignSystemResource.
279
316
  * @public
280
317
  */
281
318
  export declare type DesignSystemResource<T = DesignSystemModule> = Promise<T>;
@@ -4,6 +4,7 @@
4
4
 
5
5
  ## assureDesignSystem() function
6
6
 
7
+ assureDesignSystem.
7
8
 
8
9
  **Signature:**
9
10
 
@@ -21,3 +22,41 @@ export declare function assureDesignSystem(module: DesignSystemModule): DesignSy
21
22
 
22
23
  [DesignSystemModule](./foundation-utils.designsystemmodule.md)
23
24
 
25
+ ## Remarks
26
+
27
+ Webpack caching strategies can backfill missing modules with placeholders in an attempt to prevent errors. In the case of offline remotes, we rely on the error to fall back to local versions. This utility assures we have a design system.
28
+
29
+ ## Example 1
30
+
31
+
32
+ ```ts
33
+ async function zeroDesignSystemImport(): Promise<DesignSystemModule> {
34
+ let module: DesignSystemModule;
35
+ let type: ResourceType = ResourceType.remote;
36
+ try {
37
+ module = await import('foundationZero/ZeroDesignSystem');
38
+ return assureDesignSystem(module);
39
+ } catch (e) {
40
+ logger.info(
41
+ `Please note remoteEntry.js load errors are expected if module federated dependencies are offline. Falling back to locally bundled versions.`,
42
+ );
43
+ type = ResourceType.local;
44
+ module = await import('@genesislcap/foundation-zero');
45
+ return assureDesignSystem(module);
46
+ } finally {
47
+ logger.debug(`Using '${type}' version of foundation-zero`);
48
+ }
49
+ }
50
+ ```
51
+
52
+ ## Example 2
53
+
54
+ You can also instruct webpack to use strict handling.
55
+
56
+ ```ts
57
+ output: {
58
+ strictModuleErrorHandling: true,
59
+ strictModuleExceptionHandling: true,
60
+ }
61
+ ```
62
+
@@ -4,6 +4,7 @@
4
4
 
5
5
  ## DesignSystemModule interface
6
6
 
7
+ DesignSystemModule.
7
8
 
8
9
  **Signature:**
9
10
 
@@ -4,6 +4,7 @@
4
4
 
5
5
  ## DesignSystemResource type
6
6
 
7
+ DesignSystemResource.
7
8
 
8
9
  **Signature:**
9
10
 
@@ -26,7 +26,7 @@
26
26
 
27
27
  | Function | Description |
28
28
  | --- | --- |
29
- | [assureDesignSystem(module)](./foundation-utils.assuredesignsystem.md) | |
29
+ | [assureDesignSystem(module)](./foundation-utils.assuredesignsystem.md) | assureDesignSystem. |
30
30
  | [createLogger(name, options)](./foundation-utils.createlogger.md) | Creates a logger with the given name and options. |
31
31
  | [customNumberParser(value)](./foundation-utils.customnumberparser.md) | A Default Number Parser for deserializing objects. |
32
32
  | [formatDateTimestamp(timestamp)](./foundation-utils.formatdatetimestamp.md) | Formats \[DATE\] UNIX Timestamps (without time) to readable strings |
@@ -45,7 +45,7 @@
45
45
  | --- | --- |
46
46
  | [Database](./foundation-utils.database.md) | Represents a database with basic CRUD operations. |
47
47
  | [DatabaseRecord](./foundation-utils.databaserecord.md) | Represents a database record. |
48
- | [DesignSystemModule](./foundation-utils.designsystemmodule.md) | |
48
+ | [DesignSystemModule](./foundation-utils.designsystemmodule.md) | DesignSystemModule. |
49
49
  | [DTOMapper](./foundation-utils.dtomapper.md) | |
50
50
  | [ErrorMap](./foundation-utils.errormap.md) | |
51
51
  | [JSONSerializer](./foundation-utils.jsonserializer.md) | An interface representing a JSON serializer. |
@@ -108,7 +108,7 @@
108
108
  | [ConstructableLifecycleHandler](./foundation-utils.constructablelifecyclehandler.md) | |
109
109
  | [ConstructablePendingState](./foundation-utils.constructablependingstate.md) | A mixin that provides functionality for raising <code>pending-state</code> events. |
110
110
  | [ConversionType](./foundation-utils.conversiontype.md) | Represents the possible types of value conversion for data synchronization. |
111
- | [DesignSystemResource](./foundation-utils.designsystemresource.md) | |
111
+ | [DesignSystemResource](./foundation-utils.designsystemresource.md) | DesignSystemResource. |
112
112
  | [ErrorDetailMap](./foundation-utils.errordetailmap.md) | |
113
113
  | [ErrorMapLogger](./foundation-utils.errormaplogger.md) | |
114
114
  | [EventName](./foundation-utils.eventname.md) | Represents the possible event names for data synchronization. |
@@ -25,7 +25,7 @@ export const activeColorScheme: CSSDesignToken<string>;
25
25
  // @public
26
26
  export let API_HOST: string;
27
27
 
28
- // @public (undocumented)
28
+ // @public
29
29
  export function assureDesignSystem(module: DesignSystemModule): DesignSystemModule;
30
30
 
31
31
  // Warning: (ae-internal-missing-underscore) The name "BIG_INT_64_BITS" should be prefixed with an underscore because the declaration is marked as @internal
@@ -163,7 +163,7 @@ export class DefaultServerRowDTOMapper implements ServerRowDTOMapper {
163
163
  toDTO: (entity: ServerRowEntity) => ServerRowDTO;
164
164
  }
165
165
 
166
- // @public (undocumented)
166
+ // @public
167
167
  export interface DesignSystemModule {
168
168
  // (undocumented)
169
169
  [key: string]: any;
@@ -171,7 +171,7 @@ export interface DesignSystemModule {
171
171
  provideDesignSystem(element?: HTMLElement, prefix?: string): DesignSystem | Pick<DesignSystem, 'register'>;
172
172
  }
173
173
 
174
- // @public (undocumented)
174
+ // @public
175
175
  export type DesignSystemResource<T = DesignSystemModule> = Promise<T>;
176
176
 
177
177
  // Warning: (ae-internal-missing-underscore) The name "DOMContainer" should be prefixed with an underscore because the declaration is marked as @internal
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-utils",
3
3
  "description": "Genesis Foundation Utils",
4
- "version": "14.103.0-auth-mf.23",
4
+ "version": "14.103.0-auth-mf.24",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -19,12 +19,12 @@
19
19
  "test": "genx test"
20
20
  },
21
21
  "devDependencies": {
22
- "@genesislcap/foundation-testing": "14.103.0-auth-mf.23",
23
- "@genesislcap/genx": "14.103.0-auth-mf.23",
22
+ "@genesislcap/foundation-testing": "14.103.0-auth-mf.24",
23
+ "@genesislcap/genx": "14.103.0-auth-mf.24",
24
24
  "rimraf": "^3.0.2"
25
25
  },
26
26
  "dependencies": {
27
- "@genesislcap/foundation-logger": "14.103.0-auth-mf.23",
27
+ "@genesislcap/foundation-logger": "14.103.0-auth-mf.24",
28
28
  "@microsoft/fast-components": "^2.21.3",
29
29
  "@microsoft/fast-element": "^1.7.0",
30
30
  "@microsoft/fast-foundation": "^2.33.2",
@@ -42,5 +42,5 @@
42
42
  "access": "public"
43
43
  },
44
44
  "customElements": "dist/custom-elements.json",
45
- "gitHead": "66e311fb26ce45f26e0083e7075e73948e1765e9"
45
+ "gitHead": "0ecbee6397572e9daf901d0560d465b653440f52"
46
46
  }