@openmrs/esm-app-shell 10.0.1-pre.5158 → 10.0.1-pre.5199
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/.turbo/turbo-build.log +3 -3
- package/dist/{5a2f9d1307300413.js → 29004411600d2e11.js} +1 -1
- package/dist/{5a2f9d1307300413.js.map → 29004411600d2e11.js.map} +1 -1
- package/dist/b006959f43e23fb8.js +1 -0
- package/dist/b006959f43e23fb8.js.map +1 -0
- package/dist/c23d889af7916acd.js +1 -0
- package/dist/c23d889af7916acd.js.map +1 -0
- package/dist/index.html +1 -1
- package/dist/{openmrs.f410c4694f0930bc.js → openmrs.6166de66af6e7d89.js} +3 -3
- package/dist/openmrs.6166de66af6e7d89.js.map +1 -0
- package/lib/{a0a6c45f8dc0e772.js → 4ea9d77905a960a4.js} +1 -1
- package/lib/{3744f3e72e79f0f7.js → 524b4992ba59ae68.js} +3 -3
- package/lib/d3698fffb9fc574f.js +8 -0
- package/lib/openmrs.js +3 -3
- package/package.json +3 -3
- package/rspack.config.js +1 -1
- package/src/run.ts +41 -13
- package/dist/681f20c251944f22.js +0 -1
- package/dist/681f20c251944f22.js.map +0 -1
- package/dist/f2b4c4b50e8d6a2f.js +0 -1
- package/dist/f2b4c4b50e8d6a2f.js.map +0 -1
- package/dist/openmrs.f410c4694f0930bc.js.map +0 -1
- package/lib/5081f5384bee7bc1.js +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-app-shell",
|
|
3
|
-
"version": "10.0.1-pre.
|
|
3
|
+
"version": "10.0.1-pre.5199",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"main": "dist/openmrs.js",
|
|
6
6
|
"scripts": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@carbon/react": "^1.92.1",
|
|
37
37
|
"@internationalized/date": "^3.8.0",
|
|
38
|
-
"@openmrs/esm-framework": "10.0.1-pre.
|
|
39
|
-
"@openmrs/esm-styleguide": "10.0.1-pre.
|
|
38
|
+
"@openmrs/esm-framework": "10.0.1-pre.5199",
|
|
39
|
+
"@openmrs/esm-styleguide": "10.0.1-pre.5199",
|
|
40
40
|
"@rspack/cli": "1.7.9",
|
|
41
41
|
"@rspack/core": "1.7.9",
|
|
42
42
|
"dayjs": "^1.11.13",
|
package/rspack.config.js
CHANGED
|
@@ -432,7 +432,7 @@ module.exports = (env, argv = []) => {
|
|
|
432
432
|
openmrsEnvironment,
|
|
433
433
|
openmrsConfigUrls,
|
|
434
434
|
openmrsCoreImportmap: appPatterns.length > 0 && JSON.stringify(coreImportmap),
|
|
435
|
-
openmrsCoreRoutes: Object.keys(coreRoutes).length > 0 && JSON.stringify(coreRoutes),
|
|
435
|
+
openmrsCoreRoutes: Object.keys(coreRoutes).length > 0 && JSON.stringify({ routes: coreRoutes }),
|
|
436
436
|
openmrsCssFilename,
|
|
437
437
|
openmrsExtraAssets: openmrsJsCssAssets.map((fileName) => 'assets/' + basename(fileName)),
|
|
438
438
|
},
|
package/src/run.ts
CHANGED
|
@@ -2,12 +2,14 @@ import { start, triggerAppChange } from 'single-spa';
|
|
|
2
2
|
import { type CalendarIdentifier } from '@internationalized/date';
|
|
3
3
|
import {
|
|
4
4
|
activateOfflineCapability,
|
|
5
|
+
type Config,
|
|
5
6
|
dispatchConnectivityChanged,
|
|
6
7
|
dispatchPrecacheStaticDependencies,
|
|
7
8
|
type ExtensionDefinition,
|
|
8
9
|
finishRegisteringAllApps,
|
|
9
10
|
fireOpenmrsEvent,
|
|
10
11
|
getConfig,
|
|
12
|
+
getCoreTranslation,
|
|
11
13
|
getCurrentPageMap,
|
|
12
14
|
getCurrentRouteMap,
|
|
13
15
|
getCurrentUser,
|
|
@@ -15,6 +17,7 @@ import {
|
|
|
15
17
|
interpolateUrl,
|
|
16
18
|
messageOmrsServiceWorker,
|
|
17
19
|
openmrsFetch,
|
|
20
|
+
type OpenmrsRoutes,
|
|
18
21
|
provide,
|
|
19
22
|
registerApp,
|
|
20
23
|
registerDefaultCalendar,
|
|
@@ -41,9 +44,8 @@ import {
|
|
|
41
44
|
subscribePrecacheStaticDependencies,
|
|
42
45
|
subscribeSnackbarShown,
|
|
43
46
|
subscribeToastShown,
|
|
44
|
-
tryRegisterExtension,
|
|
45
|
-
type Config,
|
|
46
47
|
type StyleguideConfigObject,
|
|
48
|
+
tryRegisterExtension,
|
|
47
49
|
} from '@openmrs/esm-framework/src/internal';
|
|
48
50
|
import { setupI18n } from './locale';
|
|
49
51
|
import './routing-events';
|
|
@@ -56,6 +58,8 @@ import { setupCoreConfig } from './core-config';
|
|
|
56
58
|
// so we can pre-load all modules
|
|
57
59
|
const REGISTRATION_PROMISES = Symbol('openmrs_registration_promises');
|
|
58
60
|
|
|
61
|
+
let initialRouteMap: OpenmrsRoutes;
|
|
62
|
+
|
|
59
63
|
/**
|
|
60
64
|
* Sets up the frontend modules (apps). Uses the defined export
|
|
61
65
|
* from the root modules of the apps. This is done by reading the
|
|
@@ -64,10 +68,10 @@ const REGISTRATION_PROMISES = Symbol('openmrs_registration_promises');
|
|
|
64
68
|
*/
|
|
65
69
|
async function setupApps() {
|
|
66
70
|
await setupRouteMapOverrides();
|
|
67
|
-
const routes = await getCurrentRouteMap();
|
|
71
|
+
const routes = (initialRouteMap = await getCurrentRouteMap());
|
|
68
72
|
|
|
69
73
|
const modules: typeof window.installedModules = [];
|
|
70
|
-
const registrationPromises = Object.entries(routes).map(async ([module, appRoutes]) => {
|
|
74
|
+
const registrationPromises = Object.entries(routes.routes).map(async ([module, appRoutes]) => {
|
|
71
75
|
modules.push([module, appRoutes]);
|
|
72
76
|
registerApp(module, appRoutes);
|
|
73
77
|
});
|
|
@@ -114,16 +118,40 @@ function connectivityChanged() {
|
|
|
114
118
|
* Runs the shell by importing the translations and starting single SPA.
|
|
115
119
|
*/
|
|
116
120
|
async function runShell() {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
try {
|
|
122
|
+
await setupI18n();
|
|
123
|
+
} catch (err) {
|
|
124
|
+
console.error(`Failed to initialize translation system`, err);
|
|
125
|
+
}
|
|
121
126
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
const applicationVersion = initialRouteMap.version;
|
|
128
|
+
if (applicationVersion === undefined || applicationVersion === null || applicationVersion.trim().length === 0) {
|
|
129
|
+
Object.defineProperty(window, 'applicationVersion', {
|
|
130
|
+
value: undefined,
|
|
131
|
+
writable: false,
|
|
132
|
+
configurable: false,
|
|
133
|
+
});
|
|
134
|
+
} else if (applicationVersion === 'prerelease') {
|
|
135
|
+
Object.defineProperty(window, 'applicationVersion', {
|
|
136
|
+
value:
|
|
137
|
+
window.spaVersion === 'local' ? getCoreTranslation('localVersion') : getCoreTranslation('prereleaseVersion'),
|
|
138
|
+
writable: false,
|
|
139
|
+
configurable: false,
|
|
140
|
+
});
|
|
141
|
+
} else {
|
|
142
|
+
Object.defineProperty(window, 'applicationVersion', {
|
|
143
|
+
value: applicationVersion,
|
|
144
|
+
writable: false,
|
|
145
|
+
configurable: false,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const { preferredCalendar } = await getConfig<StyleguideConfigObject>('@openmrs/esm-styleguide');
|
|
150
|
+
for (const entry of Object.entries(preferredCalendar)) {
|
|
151
|
+
registerDefaultCalendar(entry[0], entry[1] as CalendarIdentifier);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
start();
|
|
127
155
|
}
|
|
128
156
|
|
|
129
157
|
function handleInitFailure(e: Error) {
|