@openmrs/esm-framework 10.0.1-pre.4973 → 10.0.1-pre.5035

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 (116.73ms)
1
+ [0] Successfully compiled: 3 files with swc (139.92ms)
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
@@ -6,7 +6,7 @@
6
6
 
7
7
  Defined in: [packages/framework/esm-react-utils/src/ExtensionSlot.tsx:71](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/ExtensionSlot.tsx#L71)
8
8
 
9
- An [extension slot](https://o3-docs.openmrs.org/docs/extension-system).
9
+ An [extension slot](https://o3-docs.openmrs.org/en-US/docs/extension-system).
10
10
  A place with a name. Extensions that get connected to that name
11
11
  will be rendered into this.
12
12
 
@@ -10,7 +10,7 @@ This defines a configuration schema for a module. The schema tells the
10
10
  configuration system how the module can be configured. It specifies
11
11
  what makes configuration valid or invalid.
12
12
 
13
- See [Configuration System](https://o3-docs.openmrs.org/docs/configuration-system)
13
+ See [Configuration System](https://o3-docs.openmrs.org/en-US/docs/configuration-system)
14
14
  for more information about defining a config schema.
15
15
 
16
16
  ## Parameters
@@ -14,7 +14,7 @@ in which it is defined.
14
14
  The schema tells the configuration system how the module can be configured.
15
15
  It specifies what makes configuration valid or invalid.
16
16
 
17
- See [Configuration System](https://o3-docs.openmrs.org/docs/configuration-system)
17
+ See [Configuration System](https://o3-docs.openmrs.org/en-US/docs/configuration-system)
18
18
  for more information about defining a config schema.
19
19
 
20
20
  ## Parameters
package/mock-jest.tsx CHANGED
@@ -17,7 +17,18 @@ export * from '@openmrs/esm-state/mock';
17
17
  export * from '@openmrs/esm-styleguide/mock';
18
18
  export * from '@openmrs/esm-translations/mock';
19
19
 
20
- export { parseDate, formatDate, formatDatetime, formatTime, isOmrsDateToday, matchLocale } from '@openmrs/esm-utils';
20
+ export {
21
+ parseDate,
22
+ formatDate,
23
+ formatDatetime,
24
+ formatTime,
25
+ formatDuration,
26
+ formatDurationBetween,
27
+ duration,
28
+ ageAsDuration,
29
+ isOmrsDateToday,
30
+ matchLocale,
31
+ } from '@openmrs/esm-utils';
21
32
 
22
33
  /* esm-globals */
23
34
 
package/mock.tsx CHANGED
@@ -18,7 +18,18 @@ export * from '@openmrs/esm-state/mock';
18
18
  export * from '@openmrs/esm-styleguide/mock';
19
19
  export * from '@openmrs/esm-translations/mock';
20
20
 
21
- export { parseDate, formatDate, formatDatetime, formatTime, isOmrsDateToday, matchLocale } from '@openmrs/esm-utils';
21
+ export {
22
+ parseDate,
23
+ formatDate,
24
+ formatDatetime,
25
+ formatTime,
26
+ formatDuration,
27
+ formatDurationBetween,
28
+ duration,
29
+ ageAsDuration,
30
+ isOmrsDateToday,
31
+ matchLocale,
32
+ } from '@openmrs/esm-utils';
22
33
 
23
34
  /* esm-globals */
24
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-framework",
3
- "version": "10.0.1-pre.4973",
3
+ "version": "10.0.1-pre.5035",
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": "10.0.1-pre.4973",
63
- "@openmrs/esm-config": "10.0.1-pre.4973",
64
- "@openmrs/esm-context": "10.0.1-pre.4973",
65
- "@openmrs/esm-dynamic-loading": "10.0.1-pre.4973",
66
- "@openmrs/esm-emr-api": "10.0.1-pre.4973",
67
- "@openmrs/esm-error-handling": "10.0.1-pre.4973",
68
- "@openmrs/esm-expression-evaluator": "10.0.1-pre.4973",
69
- "@openmrs/esm-extensions": "10.0.1-pre.4973",
70
- "@openmrs/esm-feature-flags": "10.0.1-pre.4973",
71
- "@openmrs/esm-globals": "10.0.1-pre.4973",
72
- "@openmrs/esm-navigation": "10.0.1-pre.4973",
73
- "@openmrs/esm-offline": "10.0.1-pre.4973",
74
- "@openmrs/esm-react-utils": "10.0.1-pre.4973",
75
- "@openmrs/esm-routes": "10.0.1-pre.4973",
76
- "@openmrs/esm-state": "10.0.1-pre.4973",
77
- "@openmrs/esm-styleguide": "10.0.1-pre.4973",
78
- "@openmrs/esm-translations": "10.0.1-pre.4973",
79
- "@openmrs/esm-utils": "10.0.1-pre.4973"
62
+ "@openmrs/esm-api": "10.0.1-pre.5035",
63
+ "@openmrs/esm-config": "10.0.1-pre.5035",
64
+ "@openmrs/esm-context": "10.0.1-pre.5035",
65
+ "@openmrs/esm-dynamic-loading": "10.0.1-pre.5035",
66
+ "@openmrs/esm-emr-api": "10.0.1-pre.5035",
67
+ "@openmrs/esm-error-handling": "10.0.1-pre.5035",
68
+ "@openmrs/esm-expression-evaluator": "10.0.1-pre.5035",
69
+ "@openmrs/esm-extensions": "10.0.1-pre.5035",
70
+ "@openmrs/esm-feature-flags": "10.0.1-pre.5035",
71
+ "@openmrs/esm-globals": "10.0.1-pre.5035",
72
+ "@openmrs/esm-navigation": "10.0.1-pre.5035",
73
+ "@openmrs/esm-offline": "10.0.1-pre.5035",
74
+ "@openmrs/esm-react-utils": "10.0.1-pre.5035",
75
+ "@openmrs/esm-routes": "10.0.1-pre.5035",
76
+ "@openmrs/esm-state": "10.0.1-pre.5035",
77
+ "@openmrs/esm-styleguide": "10.0.1-pre.5035",
78
+ "@openmrs/esm-translations": "10.0.1-pre.5035",
79
+ "@openmrs/esm-utils": "10.0.1-pre.5035"
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": "10.0.1-pre.4973",
92
+ "@openmrs/typedoc-plugin-file-categories": "10.0.1-pre.5035",
93
93
  "@swc/cli": "0.8.1",
94
94
  "@swc/core": "1.15.21",
95
95
  "@vitest/coverage-v8": "^4.1.2",
@@ -22,4 +22,21 @@ describe('@openmrs/esm-framework/mock', () => {
22
22
  expect(mock.getHistory()).toEqual([history[0]]);
23
23
  expect(mock.navigate).toHaveBeenCalled();
24
24
  });
25
+
26
+ it('should re-export the duration-formatting helpers from @openmrs/esm-utils', () => {
27
+ expect(typeof mock.formatDuration).toBe('function');
28
+ expect(typeof mock.formatDurationBetween).toBe('function');
29
+ expect(typeof mock.duration).toBe('function');
30
+ expect(typeof mock.ageAsDuration).toBe('function');
31
+ });
32
+
33
+ it('should format a duration without any per-test setup', () => {
34
+ // The mock sets `window.i18next.language = 'en'` and loads the
35
+ // `Intl.DurationFormat` polyfill, so this resolves out of the box.
36
+ const result = mock.formatDurationBetween('2022-01-01', '2024-07-30', {
37
+ largestUnit: 'years',
38
+ smallestUnit: 'days',
39
+ });
40
+ expect(result).toMatch(/2\s+yrs/);
41
+ });
25
42
  });