Skip to content

Commit 6f6545c

Browse files
author
Christian Guy
committed
Update dependencies, clean up util imports
1 parent 8efd063 commit 6f6545c

13 files changed

Lines changed: 1180 additions & 1809 deletions

File tree

.eslintrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"compat/compat": 2,
1616
"consistent-return": "off",
1717
"comma-dangle": "off",
18-
"flowtype-errors/show-errors": 2,
1918
"generator-star-spacing": "off",
2019
"import/no-unresolved": ["error", { "ignore": ["electron", "atom"] }],
2120
"import/no-extraneous-dependencies": "off",
@@ -45,8 +44,6 @@
4544
"react/sort-comp": "off"
4645
},
4746
"plugins": [
48-
"flowtype",
49-
"flowtype-errors",
5047
"import",
5148
"promise",
5249
"compat",

.flowconfig

Lines changed: 0 additions & 21 deletions
This file was deleted.

lib/LintHandler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use babel';
22
'use strict';
33

4-
import StreamsUtils from './util/streams-utils';
4+
import { StreamsUtils } from './util';
55

66
export default class LintHandler {
77
linter = null;

lib/epics/index.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,15 @@ import {
5151
refreshToolkits,
5252
setFormDataField,
5353
} from '../actions';
54-
import StateSelector from '../util/state-selectors';
55-
import ResponseSelector from '../util/rest-v5-response-selector';
56-
import StreamsRestUtils from '../util/streams-rest-v5';
57-
import SourceArchiveUtils from '../util/source-archive-utils';
58-
import StatusUtils from '../util/status-utils';
59-
import StreamsToolkitUtils from '../util/streams-toolkits-utils';
60-
import KeychainUtils from '../util/keychain-utils';
54+
import {
55+
StateSelector,
56+
ResponseSelector,
57+
StreamsRestUtils,
58+
SourceArchiveUtils,
59+
StatusUtils,
60+
StreamsToolkitsUtils,
61+
KeychainUtils
62+
} from '../util';
6163
import MessageHandlerRegistry from '../message-handler-registry';
6264

6365

@@ -424,14 +426,14 @@ const refreshToolkitsEpic = (action, state) => action.pipe(
424426
mergeMap(([a, s]) => StreamsRestUtils.toolkit.getToolkits(s).pipe(
425427
tap(() => MessageHandlerRegistry.getDefault().handleInfo('Initializing toolkit index cache')),
426428
map(toolkitsResponse => ResponseSelector.getToolkits(toolkitsResponse)),
427-
map(toolkits => StreamsToolkitUtils.getToolkitsToCache(s, toolkits)),
429+
map(toolkits => StreamsToolkitsUtils.getToolkitsToCache(s, toolkits)),
428430
mergeMap(toolkitsToCache => forkJoin(from(toolkitsToCache).pipe(
429431
mergeMap(toolkitToCache => StreamsRestUtils.toolkit.getToolkitIndex(s, toolkitToCache.id).pipe(
430-
map(toolkitIndexResponse => StreamsToolkitUtils.cacheToolkitIndex(s, toolkitToCache, toolkitIndexResponse.body))
432+
map(toolkitIndexResponse => StreamsToolkitsUtils.cacheToolkitIndex(s, toolkitToCache, toolkitIndexResponse.body))
431433
)),
432434
defaultIfEmpty('empty')
433435
))),
434-
tap(() => StreamsToolkitUtils.refreshLspToolkits(s, MessageHandlerRegistry.sendLspNotification)),
436+
tap(() => StreamsToolkitsUtils.refreshLspToolkits(s, MessageHandlerRegistry.sendLspNotification)),
435437
map(() => ({ type: actions.POST_REFRESH_TOOLKITS })),
436438
tap(() => MessageHandlerRegistry.getDefault().handleSuccess('Toolkit indexes cached successfully', { notificationAutoDismiss: true })),
437439
catchError(error => of(handleError(a, error)))

lib/spl-build.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@ import LintHandler from './LintHandler';
1313
import LintHandlerRegistry from './lint-handler-registry';
1414
import { SplBuilder } from './spl-build-common';
1515
import MainCompositePickerView from './views/MainCompositePickerView';
16+
import Icp4dAuthenticationView from './views/icp4dAuth/Icp4dAuthenticationView';
1617

17-
import KeychainUtils from './util/keychain-utils';
18-
import StreamsUtils from './util/streams-utils';
19-
import SourceArchiveUtils from './util/source-archive-utils';
20-
import StreamsToolkitUtils from './util/streams-toolkits-utils';
18+
import {
19+
StateSelector,
20+
KeychainUtils,
21+
StreamsUtils,
22+
SourceArchiveUtils,
23+
StreamsToolkitsUtils
24+
} from './util';
2125
import {
2226
setIcp4dUrl,
2327
queueAction,
@@ -36,12 +40,9 @@ import {
3640
checkIcp4dHostExists
3741
} from './actions';
3842
import getStore from './redux-store/configure-store';
39-
import StateSelector from './util/state-selectors';
4043

4144
import { version } from '../package.json';
4245

43-
import Icp4dAuthenticationView from './views/icp4dAuth/Icp4dAuthenticationView';
44-
4546
const CONF_TOOLKITS_PATH = 'ide-ibmstreams.toolkitsPath';
4647
const CONF_STREAMING_ANALYTICS_CREDENTIALS = 'build-ibmstreams.streamingAnalyticsCredentials';
4748
const CONF_ICP4D_URL = 'build-ibmstreams.icp4dUrl';
@@ -807,7 +808,7 @@ export default {
807808
if (StateSelector.hasAuthenticatedToStreamsInstance(getStore().getState())) {
808809
getStore().dispatch(refreshToolkits());
809810
}
810-
const toolkitInitOptions = StreamsToolkitUtils.getLangServerOptionForInitToolkits(StateSelector.getToolkitsCacheDir(getStore().getState()), StateSelector.getToolkitsPathSetting(getStore().getState()));
811+
const toolkitInitOptions = StreamsToolkitsUtils.getLangServerOptionForInitToolkits(StateSelector.getToolkitsCacheDir(getStore().getState()), StateSelector.getToolkitsPathSetting(getStore().getState()));
811812
MessageHandlerRegistry.sendLspNotification(toolkitInitOptions);
812813
}
813814
}

lib/util/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export { default as ResponseSelector } from './rest-v5-response-selector';
2+
export { default as StateSelector } from './state-selectors';
3+
export { default as SourceArchiveUtils } from './source-archive-utils';
4+
export { default as StatusUtils } from './status-utils';
5+
export { default as StreamsRestUtils } from './streams-rest-v5';
6+
export { default as StreamsToolkitsUtils } from './streams-toolkits-utils';
7+
export { default as StreamsUtils } from './streams-utils';
8+
export { default as KeychainUtils } from './keychain-utils';

lib/util/streams-rest-v5.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const baseRequestOptions = {
2929
const baseRequest = request.defaults(baseRequestOptions);
3030

3131
/**
32-
* StreamsRestUtil.build
32+
* StreamsRestUtils.build
3333
*/
3434

3535
function getAll(state) {
@@ -172,7 +172,7 @@ function getSnapshots(state) {
172172
}
173173

174174
/**
175-
* StreamsRestUtil.artifact
175+
* StreamsRestUtils.artifact
176176
*/
177177

178178
function getArtifacts(state, buildId) {
@@ -268,7 +268,7 @@ function submitJob(
268268
}
269269

270270
/**
271-
* StreamsRestUtil.toolkit
271+
* StreamsRestUtils.toolkit
272272
*/
273273

274274
function getToolkits(state) {
@@ -445,11 +445,11 @@ const icp4d = {
445445
getStreamsAuthToken
446446
};
447447

448-
const StreamsRestUtil = {
448+
const StreamsRestUtils = {
449449
build,
450450
artifact,
451451
toolkit,
452452
icp4d
453453
};
454454

455-
export default StreamsRestUtil;
455+
export default StreamsRestUtils;

lib/views/icp4dAuth/components/Step1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
setFormDataField,
1414
setIcp4dAuthError
1515
} from '../../../actions';
16-
import StateSelector from '../../../util/state-selectors';
16+
import { StateSelector } from '../../../util';
1717
import MessageHandlerRegistry from '../../../message-handler-registry';
1818

1919
const errorInputStyle = {

lib/views/icp4dAuth/components/Step2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ReactLoading } from 'react-loading';
88
import Select from 'react-select';
99
import { connect } from 'react-redux';
1010
import { setSelectedInstance, setCurrentLoginStep } from '../../../actions';
11-
import StateSelector from '../../../util/state-selectors';
11+
import { StateSelector } from '../../../util';
1212

1313
const buttonBarStyle = {
1414
display: 'flex',

lib/views/icp4dAuth/components/Step3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
55
import * as React from 'react';
66
import { Button, ButtonToolbar, Alert } from 'react-bootstrap';
77
import { connect } from 'react-redux';
8-
import StateSelector from '../../../util/state-selectors';
8+
import { StateSelector } from '../../../util';
99
import { setCurrentLoginStep } from '../../../actions';
1010

1111
const buttonContainerStyle = {

0 commit comments

Comments
 (0)