@openmrs/esm-framework 9.0.3-pre.4422 → 9.0.3-pre.4437

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.
@@ -1,3 +1,3 @@
1
- [0] Successfully compiled: 3 files with swc (131.54ms)
1
+ [0] Successfully compiled: 3 files with swc (98.13ms)
2
2
  [0] swc --strip-leading-paths src -d dist exited with code 0
3
3
  [1] tsc --project tsconfig.build.json exited with code 0
@@ -84,38 +84,6 @@ Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076
84
84
 
85
85
  ***
86
86
 
87
- ### prepareStackTrace()?
88
-
89
- > `static` `optional` **prepareStackTrace**: (`err`, `stackTraces`) => `any`
90
-
91
- Defined in: node\_modules/@types/node/globals.d.ts:11
92
-
93
- Optional override for formatting stack traces
94
-
95
- #### Parameters
96
-
97
- ##### err
98
-
99
- `Error`
100
-
101
- ##### stackTraces
102
-
103
- `CallSite`[]
104
-
105
- #### Returns
106
-
107
- `any`
108
-
109
- #### See
110
-
111
- https://v8.dev/docs/stack-trace-api#customizing-stack-traces
112
-
113
- #### Inherited from
114
-
115
- `Error.prepareStackTrace`
116
-
117
- ***
118
-
119
87
  ### response
120
88
 
121
89
  > **response**: `Response`
@@ -156,7 +124,17 @@ Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1078
156
124
 
157
125
  > `static` **stackTraceLimit**: `number`
158
126
 
159
- Defined in: node\_modules/@types/node/globals.d.ts:13
127
+ Defined in: node\_modules/@types/node/globals.d.ts:68
128
+
129
+ The `Error.stackTraceLimit` property specifies the number of stack frames
130
+ collected by a stack trace (whether generated by `new Error().stack` or
131
+ `Error.captureStackTrace(obj)`).
132
+
133
+ The default value is `10` but may be set to any valid JavaScript number. Changes
134
+ will affect any stack trace captured _after_ the value has been changed.
135
+
136
+ If set to a non-number value, or set to a negative number, stack traces will
137
+ not capture any frames.
160
138
 
161
139
  #### Inherited from
162
140
 
@@ -168,9 +146,51 @@ Defined in: node\_modules/@types/node/globals.d.ts:13
168
146
 
169
147
  > `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
170
148
 
171
- Defined in: node\_modules/@types/node/globals.d.ts:4
149
+ Defined in: node\_modules/@types/node/globals.d.ts:52
150
+
151
+ Creates a `.stack` property on `targetObject`, which when accessed returns
152
+ a string representing the location in the code at which
153
+ `Error.captureStackTrace()` was called.
154
+
155
+ ```js
156
+ const myObject = {};
157
+ Error.captureStackTrace(myObject);
158
+ myObject.stack; // Similar to `new Error().stack`
159
+ ```
160
+
161
+ The first line of the trace will be prefixed with
162
+ `${myObject.name}: ${myObject.message}`.
172
163
 
173
- Create .stack property on a target object
164
+ The optional `constructorOpt` argument accepts a function. If given, all frames
165
+ above `constructorOpt`, including `constructorOpt`, will be omitted from the
166
+ generated stack trace.
167
+
168
+ The `constructorOpt` argument is useful for hiding implementation
169
+ details of error generation from the user. For instance:
170
+
171
+ ```js
172
+ function a() {
173
+ b();
174
+ }
175
+
176
+ function b() {
177
+ c();
178
+ }
179
+
180
+ function c() {
181
+ // Create an error without stack trace to avoid calculating the stack trace twice.
182
+ const { stackTraceLimit } = Error;
183
+ Error.stackTraceLimit = 0;
184
+ const error = new Error();
185
+ Error.stackTraceLimit = stackTraceLimit;
186
+
187
+ // Capture the stack trace above function b
188
+ Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
189
+ throw error;
190
+ }
191
+
192
+ a();
193
+ ```
174
194
 
175
195
  #### Parameters
176
196
 
@@ -189,3 +209,33 @@ Create .stack property on a target object
189
209
  #### Inherited from
190
210
 
191
211
  `Error.captureStackTrace`
212
+
213
+ ***
214
+
215
+ ### prepareStackTrace()
216
+
217
+ > `static` **prepareStackTrace**(`err`, `stackTraces`): `any`
218
+
219
+ Defined in: node\_modules/@types/node/globals.d.ts:56
220
+
221
+ #### Parameters
222
+
223
+ ##### err
224
+
225
+ `Error`
226
+
227
+ ##### stackTraces
228
+
229
+ `CallSite`[]
230
+
231
+ #### Returns
232
+
233
+ `any`
234
+
235
+ #### See
236
+
237
+ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
238
+
239
+ #### Inherited from
240
+
241
+ `Error.prepareStackTrace`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-framework",
3
- "version": "9.0.3-pre.4422",
3
+ "version": "9.0.3-pre.4437",
4
4
  "license": "MPL-2.0",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
@@ -59,24 +59,24 @@
59
59
  "access": "public"
60
60
  },
61
61
  "dependencies": {
62
- "@openmrs/esm-api": "9.0.3-pre.4422",
63
- "@openmrs/esm-config": "9.0.3-pre.4422",
64
- "@openmrs/esm-context": "9.0.3-pre.4422",
65
- "@openmrs/esm-dynamic-loading": "9.0.3-pre.4422",
66
- "@openmrs/esm-emr-api": "9.0.3-pre.4422",
67
- "@openmrs/esm-error-handling": "9.0.3-pre.4422",
68
- "@openmrs/esm-expression-evaluator": "9.0.3-pre.4422",
69
- "@openmrs/esm-extensions": "9.0.3-pre.4422",
70
- "@openmrs/esm-feature-flags": "9.0.3-pre.4422",
71
- "@openmrs/esm-globals": "9.0.3-pre.4422",
72
- "@openmrs/esm-navigation": "9.0.3-pre.4422",
73
- "@openmrs/esm-offline": "9.0.3-pre.4422",
74
- "@openmrs/esm-react-utils": "9.0.3-pre.4422",
75
- "@openmrs/esm-routes": "9.0.3-pre.4422",
76
- "@openmrs/esm-state": "9.0.3-pre.4422",
77
- "@openmrs/esm-styleguide": "9.0.3-pre.4422",
78
- "@openmrs/esm-translations": "9.0.3-pre.4422",
79
- "@openmrs/esm-utils": "9.0.3-pre.4422"
62
+ "@openmrs/esm-api": "9.0.3-pre.4437",
63
+ "@openmrs/esm-config": "9.0.3-pre.4437",
64
+ "@openmrs/esm-context": "9.0.3-pre.4437",
65
+ "@openmrs/esm-dynamic-loading": "9.0.3-pre.4437",
66
+ "@openmrs/esm-emr-api": "9.0.3-pre.4437",
67
+ "@openmrs/esm-error-handling": "9.0.3-pre.4437",
68
+ "@openmrs/esm-expression-evaluator": "9.0.3-pre.4437",
69
+ "@openmrs/esm-extensions": "9.0.3-pre.4437",
70
+ "@openmrs/esm-feature-flags": "9.0.3-pre.4437",
71
+ "@openmrs/esm-globals": "9.0.3-pre.4437",
72
+ "@openmrs/esm-navigation": "9.0.3-pre.4437",
73
+ "@openmrs/esm-offline": "9.0.3-pre.4437",
74
+ "@openmrs/esm-react-utils": "9.0.3-pre.4437",
75
+ "@openmrs/esm-routes": "9.0.3-pre.4437",
76
+ "@openmrs/esm-state": "9.0.3-pre.4437",
77
+ "@openmrs/esm-styleguide": "9.0.3-pre.4437",
78
+ "@openmrs/esm-translations": "9.0.3-pre.4437",
79
+ "@openmrs/esm-utils": "9.0.3-pre.4437"
80
80
  },
81
81
  "peerDependencies": {
82
82
  "dayjs": "1.x",
@@ -89,7 +89,7 @@
89
89
  "swr": "2.x"
90
90
  },
91
91
  "devDependencies": {
92
- "@openmrs/typedoc-plugin-file-categories": "9.0.3-pre.4422",
92
+ "@openmrs/typedoc-plugin-file-categories": "9.0.3-pre.4437",
93
93
  "@swc/cli": "0.8.0",
94
94
  "@swc/core": "1.15.18",
95
95
  "@vitest/coverage-v8": "^4.0.18",
@@ -1,11 +1,11 @@
1
- /* eslint-disable */
1
+ /* eslint-disable testing-library/no-node-access, testing-library/no-wait-for-multiple-assertions, testing-library/no-unnecessary-act, testing-library/no-manual-cleanup, jest-dom/prefer-empty, testing-library/prefer-presence-queries */
2
2
  import React from 'react';
3
3
  import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
4
4
  import '@testing-library/jest-dom/vitest';
5
5
  import { act, cleanup, render, screen, waitFor } from '@testing-library/react';
6
6
  import { type Person } from '@openmrs/esm-api';
7
7
  import { mockSessionStore } from '@openmrs/esm-api/mock';
8
- import { attach, registerExtension, updateInternalExtensionStore } from '../../../esm-extensions';
8
+ import { attach, registerExtension, updateInternalExtensionStore } from '../../../esm-extensions/src';
9
9
  import { ExtensionSlot, getSyncLifecycle, openmrsComponentDecorator, useConfig } from '../../../esm-react-utils/src';
10
10
  import {
11
11
  configInternalStore,
@@ -54,6 +54,20 @@ describe('Expression evaluation in extension display conditions', () => {
54
54
  cleanup();
55
55
  });
56
56
 
57
+ function RootComponent() {
58
+ return (
59
+ <div>
60
+ <ExtensionSlot data-testid="slot" name="A slot" />
61
+ </div>
62
+ );
63
+ }
64
+
65
+ const App = openmrsComponentDecorator({
66
+ moduleName: 'esm-bedrock',
67
+ featureName: 'Bedrock',
68
+ disableTranslations: true,
69
+ })(RootComponent);
70
+
57
71
  it('should show extension when the expression evalutes to true', async () => {
58
72
  registerSimpleExtension('Schmoo', 'esm-bedrock', true);
59
73
  attach('A slot', 'Schmoo');
@@ -67,20 +81,6 @@ describe('Expression evaluation in extension display conditions', () => {
67
81
  },
68
82
  });
69
83
 
70
- function RootComponent() {
71
- return (
72
- <div>
73
- <ExtensionSlot data-testid="slot" name="A slot" />
74
- </div>
75
- );
76
- }
77
-
78
- const App = openmrsComponentDecorator({
79
- moduleName: 'esm-bedrock',
80
- featureName: 'Bedrock',
81
- disableTranslations: true,
82
- })(RootComponent);
83
-
84
84
  act(() => {
85
85
  render(<App />);
86
86
  });
@@ -102,20 +102,6 @@ describe('Expression evaluation in extension display conditions', () => {
102
102
  },
103
103
  });
104
104
 
105
- function RootComponent() {
106
- return (
107
- <div>
108
- <ExtensionSlot data-testid="slot" name="A slot" />
109
- </div>
110
- );
111
- }
112
-
113
- const App = openmrsComponentDecorator({
114
- moduleName: 'esm-bedrock',
115
- featureName: 'Bedrock',
116
- disableTranslations: true,
117
- })(RootComponent);
118
-
119
105
  act(() => {
120
106
  render(<App />);
121
107
  });
@@ -137,20 +123,6 @@ describe('Expression evaluation in extension display conditions', () => {
137
123
  },
138
124
  });
139
125
 
140
- function RootComponent() {
141
- return (
142
- <div>
143
- <ExtensionSlot data-testid="slot" name="A slot" />
144
- </div>
145
- );
146
- }
147
-
148
- const App = openmrsComponentDecorator({
149
- moduleName: 'esm-bedrock',
150
- featureName: 'Bedrock',
151
- disableTranslations: true,
152
- })(RootComponent);
153
-
154
126
  render(<App />);
155
127
 
156
128
  // Update session state after rendering so the component can react to the change
@@ -167,7 +139,7 @@ describe('Expression evaluation in extension display conditions', () => {
167
139
  systemId: 'nonadmin',
168
140
  userProperties: {},
169
141
  person: {} as Person,
170
- privileges: [{ uuid: '1', display: 'YOWTCH!' }],
142
+ privileges: [{ uuid: '1', name: 'YOWTCH!', display: 'YOWTCH!' }],
171
143
  roles: [],
172
144
  retired: false,
173
145
  locale: 'en',
@@ -196,20 +168,6 @@ describe('Expression evaluation in extension display conditions', () => {
196
168
  },
197
169
  });
198
170
 
199
- function RootComponent() {
200
- return (
201
- <div>
202
- <ExtensionSlot data-testid="slot" name="A slot" />
203
- </div>
204
- );
205
- }
206
-
207
- const App = openmrsComponentDecorator({
208
- moduleName: 'esm-bedrock',
209
- featureName: 'Bedrock',
210
- disableTranslations: true,
211
- })(RootComponent);
212
-
213
171
  render(<App />);
214
172
 
215
173
  // Update session state after rendering so the component can react to the change
@@ -226,7 +184,7 @@ describe('Expression evaluation in extension display conditions', () => {
226
184
  systemId: 'nonadmin',
227
185
  userProperties: {},
228
186
  person: {} as Person,
229
- privileges: [{ uuid: '1', display: 'YOWTCH!' }],
187
+ privileges: [{ uuid: '1', name: 'YOWTCH!', display: 'YOWTCH!' }],
230
188
  roles: [],
231
189
  retired: false,
232
190
  locale: 'en',
@@ -248,20 +206,6 @@ describe('Expression evaluation in extension display conditions', () => {
248
206
  defineConfigSchema('esm-bedrock', {});
249
207
  registerModuleLoad('esm-bedrock');
250
208
 
251
- function RootComponent() {
252
- return (
253
- <div>
254
- <ExtensionSlot data-testid="slot" name="A slot" />
255
- </div>
256
- );
257
- }
258
-
259
- const App = openmrsComponentDecorator({
260
- moduleName: 'esm-bedrock',
261
- featureName: 'Bedrock',
262
- disableTranslations: true,
263
- })(RootComponent);
264
-
265
209
  render(<App />);
266
210
 
267
211
  // Provide config with error expression after rendering so the component can react to the change
@@ -1,11 +1,11 @@
1
- /* eslint-disable */
1
+ /* eslint-disable testing-library/no-node-access, testing-library/no-wait-for-multiple-assertions, testing-library/no-unnecessary-act, testing-library/no-manual-cleanup, testing-library/await-async-queries */
2
2
  import React from 'react';
3
3
  import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
4
4
  import '@testing-library/jest-dom/vitest';
5
5
  import { act, cleanup, render, screen, waitFor } from '@testing-library/react';
6
6
  import { type Person } from '@openmrs/esm-api';
7
7
  import { mockSessionStore } from '@openmrs/esm-api/mock';
8
- import { attach, registerExtension, updateInternalExtensionStore } from '../../../esm-extensions';
8
+ import { attach, registerExtension, updateInternalExtensionStore } from '../../../esm-extensions/src';
9
9
  import {
10
10
  ExtensionSlot,
11
11
  getSyncLifecycle,
@@ -172,11 +172,7 @@ describe('Interaction between configuration and extension systems', () => {
172
172
  moduleName: 'esm-flintstone',
173
173
  featureName: 'The Flintstones',
174
174
  disableTranslations: true,
175
- })(() => (
176
- <>
177
- <ExtensionSlot data-testid="flintstone-slot" name="Flintstone slot" />
178
- </>
179
- ));
175
+ })(() => <ExtensionSlot data-testid="flintstone-slot" name="Flintstone slot" />);
180
176
 
181
177
  act(() => {
182
178
  render(<App />);
@@ -356,19 +352,11 @@ describe('Interaction between configuration and extension systems', () => {
356
352
  'esm-flintstones': {},
357
353
  });
358
354
 
359
- function RootComponent() {
360
- return (
361
- <div>
362
- <ExtensionSlot data-testid="slot" name="A slot" />
363
- </div>
364
- );
365
- }
366
-
367
355
  const App = openmrsComponentDecorator({
368
356
  moduleName: 'esm-bedrock',
369
357
  featureName: 'Bedrock',
370
358
  disableTranslations: true,
371
- })(RootComponent);
359
+ })(() => <ExtensionSlot data-testid="slot" name="A slot" />);
372
360
 
373
361
  act(() => {
374
362
  render(<App />);
@@ -394,7 +382,7 @@ describe('Interaction between configuration and extension systems', () => {
394
382
  systemId: 'nonadmin',
395
383
  userProperties: {},
396
384
  person: {} as Person,
397
- privileges: [{ uuid: '1', display: 'Yabadabadoo!' }],
385
+ privileges: [{ uuid: '1', name: 'Yabadabadoo!', display: 'Yabadabadoo!' }],
398
386
  roles: [],
399
387
  retired: false,
400
388
  locale: 'en',
@@ -415,19 +403,11 @@ describe('Interaction between configuration and extension systems', () => {
415
403
  },
416
404
  });
417
405
 
418
- function RootComponent() {
419
- return (
420
- <div>
421
- <ExtensionSlot data-testid="slot" name="A slot" />
422
- </div>
423
- );
424
- }
425
-
426
406
  const App = openmrsComponentDecorator({
427
407
  moduleName: 'esm-bedrock',
428
408
  featureName: 'Bedrock',
429
409
  disableTranslations: true,
430
- })(RootComponent);
410
+ })(() => <ExtensionSlot data-testid="slot" name="A slot" />);
431
411
 
432
412
  act(() => {
433
413
  render(<App />);
@@ -451,7 +431,7 @@ describe('Interaction between configuration and extension systems', () => {
451
431
  systemId: 'nonadmin',
452
432
  userProperties: {},
453
433
  person: {} as Person,
454
- privileges: [{ uuid: '1', display: 'YOWTCH!' }],
434
+ privileges: [{ uuid: '1', name: 'YOWTCH!', display: 'YOWTCH!' }],
455
435
  roles: [],
456
436
  retired: false,
457
437
  locale: 'en',