@elliemae/pui-app-sdk 2.21.1 → 2.21.2

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.
@@ -28,7 +28,9 @@ const setAppDynamicsUserData = params => {
28
28
  };
29
29
 
30
30
  if (brum) {
31
- brum.setCustomUserData(() => ({
31
+ var _brum$setCustomUserDa;
32
+
33
+ (_brum$setCustomUserDa = brum.setCustomUserData) === null || _brum$setCustomUserDa === void 0 ? void 0 : _brum$setCustomUserDa.call(brum, () => ({
32
34
  userData
33
35
  }));
34
36
  }
@@ -1,36 +1,16 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.setStore = exports.getStore = exports.createAppStore = void 0;
9
-
10
- var _toolkit = require("@reduxjs/toolkit");
11
-
12
- var _reduxInjectors = require("redux-injectors");
13
-
14
- var _connectedReactRouter = require("connected-react-router");
15
-
16
- var _reduxSaga = _interopRequireDefault(require("redux-saga"));
17
-
18
- var _reducers = require("./reducers.js");
19
-
20
1
  /* eslint-disable max-params */
21
- const rootReducer = (0, _reducers.createReducer)();
2
+ import { configureStore } from '@reduxjs/toolkit';
3
+ import { createInjectorsEnhancer, forceReducerReload } from 'redux-injectors';
4
+ import { routerMiddleware } from 'connected-react-router';
5
+ import createSagaMiddleware from 'redux-saga';
6
+ import { createReducer } from "./reducers.js";
7
+ const rootReducer = createReducer();
22
8
  // global variable
23
9
  let appStore = null;
24
-
25
- const setStore = store => {
10
+ export const setStore = store => {
26
11
  appStore = store;
27
12
  };
28
-
29
- exports.setStore = setStore;
30
-
31
- const getStore = () => appStore;
32
-
33
- exports.getStore = getStore;
13
+ export const getStore = () => appStore;
34
14
 
35
15
  const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
36
16
  thunk: false
@@ -39,15 +19,15 @@ const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
39
19
  const {
40
20
  run: runSaga
41
21
  } = sagaMiddleware;
42
- const enhancers = [(0, _reduxInjectors.createInjectorsEnhancer)({
43
- createReducer: _reducers.createReducer,
22
+ const enhancers = [createInjectorsEnhancer({
23
+ createReducer,
44
24
  runSaga
45
25
  })];
46
- const baseStore = (0, _toolkit.configureStore)({
26
+ const baseStore = configureStore({
47
27
  reducer: rootReducer,
48
28
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
49
29
  // @ts-ignore
50
- middleware: getDefaultMiddleware => getDefaultMiddleware(middlewareConfig).concat(sagaMiddleware).concat((0, _connectedReactRouter.routerMiddleware)(history)),
30
+ middleware: getDefaultMiddleware => getDefaultMiddleware(middlewareConfig).concat(sagaMiddleware).concat(routerMiddleware(history)),
51
31
  devTools: process.env.NODE_ENV !== 'production',
52
32
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
53
33
  // @ts-ignore
@@ -57,25 +37,28 @@ const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
57
37
  let hotModule = null;
58
38
 
59
39
  try {
60
- var _module;
61
-
62
- hotModule = (_module = module) === null || _module === void 0 ? void 0 : _module.hot;
63
- } catch (err) {}
40
+ hotModule = module?.hot;
41
+ } catch (err) {
42
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
43
+ // @ts-ignore
44
+ // block:start
45
+ hotModule = import.meta?.webpackHot; // block:end
46
+ }
64
47
 
65
48
  if (hotModule) {
66
49
  hotModule.accept('./reducers', () => {
67
- (0, _reduxInjectors.forceReducerReload)(baseStore);
50
+ forceReducerReload(baseStore);
68
51
  });
69
52
  }
70
53
 
71
54
  return baseStore;
72
55
  };
73
56
 
74
- const createAppStore = (initialState = {}, history, middlewareConfig) => {
75
- const sagaMiddleware = (0, _reduxSaga.default)({});
57
+ export const createAppStore = (initialState: RootState = ({} as RootState), history: History, middlewareConfig?: MiddlewareConfig) => {
58
+ const sagaMiddleware = createSagaMiddleware({});
76
59
  const store = createStore(initialState, sagaMiddleware, history, middlewareConfig);
77
60
  setStore(store);
78
61
  return store;
79
62
  };
80
-
81
- exports.createAppStore = createAppStore;
63
+ export type AppStore = ReturnType<typeof createAppStore>;
64
+ export type AppDispatch = AppStore['dispatch'];
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ var _reactRouterDom = require("react-router-dom");
4
+
5
+ var _store = require("../store.js");
6
+
7
+ /**
8
+ * Test store addons
9
+ */
10
+ describe('createAppStore', () => {
11
+ let store;
12
+ beforeAll(() => {
13
+ store = (0, _store.createAppStore)({}, _reactRouterDom.browserHistory);
14
+ });
15
+ describe('injectedReducers', () => {
16
+ it('should contain an object for reducers', () => {
17
+ expect(typeof store.injectedReducers).toBe('object');
18
+ });
19
+ });
20
+ describe('injectedSagas', () => {
21
+ it('should contain an object for sagas', () => {
22
+ expect(typeof store.injectedSagas).toBe('object');
23
+ });
24
+ });
25
+ describe('runSaga', () => {
26
+ it('should contain a hook for `sagaMiddleware.run`', () => {
27
+ expect(typeof store.runSaga).toBe('function');
28
+ });
29
+ });
30
+ });
package/dist/cjs/index.js CHANGED
@@ -43,6 +43,7 @@ var _exportNames = {
43
43
  setAppConfigValue: true,
44
44
  setAppConfig: true,
45
45
  getMicroFrontEndAppConfig: true,
46
+ getLogger: true,
46
47
  loadAppConfig: true,
47
48
  AppRoot: true,
48
49
  ErrorBoundary: true,
@@ -379,6 +380,12 @@ Object.defineProperty(exports, "getHostAppDataByKey", {
379
380
  return _store2.getHostAppDataByKey;
380
381
  }
381
382
  });
383
+ Object.defineProperty(exports, "getLogger", {
384
+ enumerable: true,
385
+ get: function () {
386
+ return _index8.getLogger;
387
+ }
388
+ });
382
389
  Object.defineProperty(exports, "getMicroFrontEndAppConfig", {
383
390
  enumerable: true,
384
391
  get: function () {
@@ -16,8 +16,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
16
16
  const onPageView = pageTitle => {
17
17
  try {
18
18
  if (brum && pageTitle) {
19
- brum.setCustomVirtualPageName(pageTitle);
20
- brum.startVirtualPageMonitoringWithAutoEnd(pageTitle);
19
+ var _brum$setCustomVirtua, _brum$startVirtualPag;
20
+
21
+ (_brum$setCustomVirtua = brum.setCustomVirtualPageName) === null || _brum$setCustomVirtua === void 0 ? void 0 : _brum$setCustomVirtua.call(brum, pageTitle);
22
+ (_brum$startVirtualPag = brum.startVirtualPageMonitoringWithAutoEnd) === null || _brum$startVirtualPag === void 0 ? void 0 : _brum$startVirtualPag.call(brum, pageTitle);
21
23
  }
22
24
  } catch {// eslint-disable-next-line no-empty
23
25
  }
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getParameters = exports.decorators = void 0;
6
+ exports.loaders = exports.getParameters = exports.decorators = void 0;
7
7
 
8
8
  var _addonConsole = require("@storybook/addon-console");
9
9
 
@@ -21,11 +21,6 @@ var _history = require("../history.js");
21
21
 
22
22
  require("@elliemae/ds-basic/css/dimsum.css");
23
23
 
24
- (async () => {
25
- // eslint-disable-next-line no-undef
26
- await (0, _index.loadAppConfig)(__webpack_public_path__);
27
- })();
28
-
29
24
  const theme = (0, _puiTheme.getDefaultTheme)();
30
25
  const store = (0, _store.createAppStore)({}, _history.browserHistory);
31
26
 
@@ -59,4 +54,9 @@ const getParameters = storyBookTheme => ({
59
54
 
60
55
  exports.getParameters = getParameters;
61
56
  const decorators = [consoleDecorator, appDecorator];
62
- exports.decorators = decorators;
57
+ exports.decorators = decorators;
58
+ const loaders = [async () => {
59
+ // eslint-disable-next-line no-undef, camelcase
60
+ await (0, _index.loadAppConfig)(__webpack_public_path__ || './');
61
+ }];
62
+ exports.loaders = loaders;
@@ -12,7 +12,9 @@ export const setAppDynamicsUserData = params => {
12
12
  };
13
13
 
14
14
  if (brum) {
15
- brum.setCustomUserData(() => ({
15
+ var _brum$setCustomUserDa;
16
+
17
+ (_brum$setCustomUserDa = brum.setCustomUserData) === null || _brum$setCustomUserDa === void 0 ? void 0 : _brum$setCustomUserDa.call(brum, () => ({
16
18
  userData
17
19
  }));
18
20
  }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Test store addons
3
+ */
4
+ import { browserHistory } from 'react-router-dom';
5
+ import { createAppStore } from "../store.js";
6
+ describe('createAppStore', () => {
7
+ let store;
8
+ beforeAll(() => {
9
+ store = createAppStore({}, browserHistory);
10
+ });
11
+ describe('injectedReducers', () => {
12
+ it('should contain an object for reducers', () => {
13
+ expect(typeof store.injectedReducers).toBe('object');
14
+ });
15
+ });
16
+ describe('injectedSagas', () => {
17
+ it('should contain an object for sagas', () => {
18
+ expect(typeof store.injectedSagas).toBe('object');
19
+ });
20
+ });
21
+ describe('runSaga', () => {
22
+ it('should contain a hook for `sagaMiddleware.run`', () => {
23
+ expect(typeof store.runSaga).toBe('function');
24
+ });
25
+ });
26
+ });
package/dist/es/index.js CHANGED
@@ -24,7 +24,7 @@ export { CMicroAppGuest } from "./utils/micro-frontend/guest.js";
24
24
  export { CMicroAppHost } from "./utils/micro-frontend/host.js";
25
25
  export { enableReactAppForHostIntegration } from "./utils/app-host-integration/react.js";
26
26
  export { getAppConfigValue, setAppConfigValue, setAppConfig } from "./utils/app-config/config.js";
27
- export { getMicroFrontEndAppConfig } from "./utils/micro-frontend/index.js";
27
+ export { getMicroFrontEndAppConfig, getLogger } from "./utils/micro-frontend/index.js";
28
28
  export { loadAppConfig } from "./utils/app-config/index.js";
29
29
  export { AppRoot } from "./view/app-root/index.js";
30
30
  export { ErrorBoundary } from "./view/error-boundary/index.js";
@@ -3,8 +3,10 @@ import { pageViewEvent } from "../analytics/page-view-event.js";
3
3
  export const onPageView = pageTitle => {
4
4
  try {
5
5
  if (brum && pageTitle) {
6
- brum.setCustomVirtualPageName(pageTitle);
7
- brum.startVirtualPageMonitoringWithAutoEnd(pageTitle);
6
+ var _brum$setCustomVirtua, _brum$startVirtualPag;
7
+
8
+ (_brum$setCustomVirtua = brum.setCustomVirtualPageName) === null || _brum$setCustomVirtua === void 0 ? void 0 : _brum$setCustomVirtua.call(brum, pageTitle);
9
+ (_brum$startVirtualPag = brum.startVirtualPageMonitoringWithAutoEnd) === null || _brum$startVirtualPag === void 0 ? void 0 : _brum$startVirtualPag.call(brum, pageTitle);
8
10
  }
9
11
  } catch {// eslint-disable-next-line no-empty
10
12
  }
@@ -6,12 +6,6 @@ import { loadAppConfig } from "../app-config/index.js";
6
6
  import { createTheme } from "./theme.js";
7
7
  import { browserHistory } from "../history.js";
8
8
  import '@elliemae/ds-basic/css/dimsum.css';
9
-
10
- (async () => {
11
- // eslint-disable-next-line no-undef
12
- await loadAppConfig(__webpack_public_path__);
13
- })();
14
-
15
9
  const theme = getDefaultTheme();
16
10
  const store = createAppStore({}, browserHistory);
17
11
  const appDecorator = withAppDecorator.bind(null, theme, store);
@@ -41,4 +35,8 @@ export const getParameters = storyBookTheme => ({
41
35
  hideEmpty: true
42
36
  }
43
37
  });
44
- export const decorators = [consoleDecorator, appDecorator];
38
+ export const decorators = [consoleDecorator, appDecorator];
39
+ export const loaders = [async () => {
40
+ // eslint-disable-next-line no-undef, camelcase
41
+ await loadAppConfig(__webpack_public_path__ || './');
42
+ }];
@@ -23,7 +23,7 @@ export { CMicroAppGuest } from './utils/micro-frontend/guest';
23
23
  export { CMicroAppHost } from './utils/micro-frontend/host';
24
24
  export { enableReactAppForHostIntegration } from './utils/app-host-integration/react';
25
25
  export { getAppConfigValue, setAppConfigValue, setAppConfig, } from './utils/app-config/config';
26
- export { getMicroFrontEndAppConfig } from './utils/micro-frontend';
26
+ export { getMicroFrontEndAppConfig, getLogger } from './utils/micro-frontend';
27
27
  export { loadAppConfig } from './utils/app-config';
28
28
  export { AppRoot } from './view/app-root';
29
29
  export { ErrorBoundary } from './view/error-boundary';
@@ -22,3 +22,4 @@ export function getParameters(storyBookTheme: any): {
22
22
  };
23
23
  };
24
24
  export const decorators: (((story: () => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => JSX.Element) | ((storyFn: any, context: any) => any))[];
25
+ export const loaders: (() => Promise<void>)[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-app-sdk",
3
- "version": "2.21.1",
3
+ "version": "2.21.2",
4
4
  "description": "ICE MT UI Platform Application SDK ",
5
5
  "sideEffects": [
6
6
  "*.css",
@@ -72,7 +72,7 @@
72
72
  "storybook:docs": "pui-cli storybook --docs",
73
73
  "storybook:docs:build": "pui-cli storybook -b --docs",
74
74
  "storybook:build": "pui-cli storybook -b",
75
- "storybook:prod": "npm run storybook:build && http-server -g -p 11000 demo",
75
+ "storybook:prod": "http-server -g -p 11000 demo",
76
76
  "setup": "rimraf -r node_modules && rimraf package-lock.json && npm i",
77
77
  "test": "pui-cli test -p",
78
78
  "test:fix": "pui-cli test -f",
@@ -89,37 +89,37 @@
89
89
  },
90
90
  "peerDependencies": {
91
91
  "@elliemae/app-react-dependencies": "^2.10.0",
92
- "@elliemae/ds-basic": "^2.0.0",
93
- "@elliemae/ds-button": "^2.0.0",
94
- "@elliemae/ds-form": "^2.0.0",
95
- "@elliemae/ds-loading-indicator": "^2.0.0",
96
- "@elliemae/ds-date-picker": "^2.0.0",
97
- "@elliemae/ds-modal": "^2.0.0",
98
- "@elliemae/ds-popperjs": "^2.0.0",
99
- "@elliemae/ds-toast": "^2.0.0",
92
+ "@elliemae/ds-basic": "^2.2.2",
93
+ "@elliemae/ds-button": "^2.2.2",
94
+ "@elliemae/ds-form": "^2.2.2",
95
+ "@elliemae/ds-loading-indicator": "^2.2.2",
96
+ "@elliemae/ds-date-picker": "^2.2.2",
97
+ "@elliemae/ds-modal": "^2.2.2",
98
+ "@elliemae/ds-popperjs": "^2.2.2",
99
+ "@elliemae/ds-toast": "^2.2.2",
100
100
  "@elliemae/em-ssf-guest": "^1.11.1",
101
101
  "@elliemae/pui-diagnostics": "^2.7.3",
102
- "@elliemae/pui-micro-frontend-base": "^1.10.0",
102
+ "@elliemae/pui-micro-frontend-base": "^1.10.1",
103
103
  "@elliemae/pui-theme": "^2.3.0",
104
- "@elliemae/pui-user-monitoring": "^1.12.2"
104
+ "@elliemae/pui-user-monitoring": "^1.13.0"
105
105
  },
106
106
  "devDependencies": {
107
107
  "@elliemae/app-react-dependencies": "~2.10.0",
108
108
  "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.2.1",
109
- "@elliemae/ds-basic": "~2.0.0",
110
- "@elliemae/ds-button": "~2.0.0",
111
- "@elliemae/ds-form": "~2.0.0",
112
- "@elliemae/ds-loading-indicator": "~2.0.0",
113
- "@elliemae/ds-date-picker": "~2.0.0",
114
- "@elliemae/ds-modal": "~2.0.0",
115
- "@elliemae/ds-popperjs": "~2.0.0",
116
- "@elliemae/ds-toast": "~2.0.0",
109
+ "@elliemae/ds-basic": "~2.2.2",
110
+ "@elliemae/ds-button": "~2.2.2",
111
+ "@elliemae/ds-form": "~2.2.2",
112
+ "@elliemae/ds-loading-indicator": "~2.2.2",
113
+ "@elliemae/ds-date-picker": "~2.2.2",
114
+ "@elliemae/ds-modal": "~2.2.2",
115
+ "@elliemae/ds-popperjs": "~2.2.2",
116
+ "@elliemae/ds-toast": "~2.2.2",
117
117
  "@elliemae/em-ssf-guest": "~1.11.1",
118
- "@elliemae/pui-cli": "~5.23.0",
118
+ "@elliemae/pui-cli": "~5.25.1",
119
119
  "@elliemae/pui-diagnostics": "~2.7.3",
120
- "@elliemae/pui-e2e-test-sdk": "~6.8.0",
121
- "@elliemae/pui-micro-frontend-base": "~1.10.0",
120
+ "@elliemae/pui-e2e-test-sdk": "~6.10.0",
121
+ "@elliemae/pui-micro-frontend-base": "~1.10.1",
122
122
  "@elliemae/pui-theme": "~2.3.0",
123
- "@elliemae/pui-user-monitoring": "~1.12.2"
123
+ "@elliemae/pui-user-monitoring": "~1.13.0"
124
124
  }
125
125
  }