[code] fix additional type errors

This commit is contained in:
Fuyao Zhao 2018-12-18 17:03:17 -08:00
parent cb5ab56bd5
commit dfe54f7643
15 changed files with 71 additions and 130 deletions

View file

@ -298,7 +298,7 @@
"@types/redux": "^3.6.31",
"@types/redux-actions": "^2.2.1",
"@types/semver": "^5.5.0",
"@types/sinon": "^5.0.1",
"@types/sinon": "^7.0.0",
"@types/strip-ansi": "^3.0.0",
"@types/styled-components": "^3.0.1",
"@types/supertest": "^2.0.5",
@ -381,7 +381,7 @@
"proxyquire": "1.7.11",
"regenerate": "^1.4.0",
"simple-git": "1.37.0",
"sinon": "v7.2.2",
"sinon": "^7.2.2",
"strip-ansi": "^3.0.1",
"supertest": "^3.1.0",
"supertest-as-promised": "^4.0.2",

View file

@ -65,7 +65,7 @@
"redux": "3.7.2",
"redux-thunk": "2.2.0",
"sass-loader": "^7.1.0",
"sinon": "^5.0.7",
"sinon": "^7.2.2",
"style-loader": "^0.23.1",
"webpack": "^4.23.1",
"webpack-dev-server": "^3.1.10",

View file

@ -48,6 +48,7 @@ export const OptimizeBuildTask = {
cwd: build.resolvePath('.'),
env: {
FORCE_DLL_CREATION: 'true',
// To make DLL pass
NODE_OPTIONS: '--max-old-space-size=4096'
},
});

View file

@ -67,7 +67,7 @@
"@types/reduce-reducers": "^0.1.3",
"@types/redux-actions": "^2.2.1",
"@types/rimraf": "^2.0.2",
"@types/sinon": "^5.0.1",
"@types/sinon": "^7.0.0",
"@types/socket.io": "^1.4.38",
"@types/socket.io-client": "^1.4.32",
"@types/styled-components": "^3.0.1",
@ -122,7 +122,7 @@
"run-sequence": "^2.2.1",
"sass-loader": "^7.1.0",
"simple-git": "1.37.0",
"sinon": "^5.0.7",
"sinon": "^7.2.2",
"supertest": "^3.1.0",
"supertest-as-promised": "^4.0.2",
"tmp": "0.0.31",

View file

@ -1,5 +0,0 @@
*.js
!packages/esqueue/**/*.js
!webpackShims/init-monaco.js
!server/lib/**/*.js
/public/styles.css

View file

@ -106,10 +106,14 @@ export const code = (kibana: any) =>
const socketService = new SocketService(server, log);
// Initialize search clients
// @ts-ignore
const repoSearchClient = new RepositorySearchClient(dataCluster.getClient(), log);
// @ts-ignore
const documentSearchClient = new DocumentSearchClient(dataCluster.getClient(), log);
// @ts-ignore
const symbolSearchClient = new SymbolSearchClient(dataCluster.getClient(), log);
// @ts-ignore
const esClient: EsClient = adminCluster.getClient();
const installManager = new InstallManager(serverOptions);

View file

@ -19,11 +19,7 @@ exports[`render correctly 1`] = `
className="euiIcon euiIcon--medium euiSideNav__mobileIcon"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -81,16 +77,13 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
<svg
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -117,16 +110,13 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
<svg
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -153,16 +143,13 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
<svg
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -190,16 +177,13 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
<svg
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -226,6 +210,7 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
pom.xml
</div>
@ -236,16 +221,13 @@ exports[`render correctly 1`] = `
<div
className="activeFileNode"
onClick={[Function]}
role="button"
>
<svg
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -273,16 +255,13 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
<svg
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -309,16 +288,13 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
<svg
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -349,6 +325,7 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
guava-bom/pom.xml
</div>
@ -359,16 +336,13 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
<svg
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -395,16 +369,13 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
<svg
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -431,16 +402,13 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
<svg
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -467,16 +435,13 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
<svg
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -503,16 +468,13 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
<svg
className="euiIcon euiIcon--medium"
focusable="false"
height="16"
style={
Object {
"fill": undefined,
}
}
style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
@ -539,6 +501,7 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
.gitattributes
</div>
@ -549,6 +512,7 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
.gitignore
</div>
@ -559,6 +523,7 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
.travis.yml
</div>
@ -569,6 +534,7 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
CONTRIBUTING.md
</div>
@ -579,6 +545,7 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
CONTRIBUTORS
</div>
@ -589,6 +556,7 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
COPYING
</div>
@ -599,6 +567,7 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
README.md
</div>
@ -609,6 +578,7 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
cycle_whitelist.txt
</div>
@ -619,6 +589,7 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
javadoc-stylesheet.css
</div>
@ -629,6 +600,7 @@ exports[`render correctly 1`] = `
<div
className="fileNode"
onClick={[Function]}
role="button"
>
pom.xml
</div>

View file

@ -68,7 +68,7 @@ export class CodeFileTree extends React.Component<Props> {
}
};
return (
<div onClick={onFolderClick} className={className}>
<div onClick={onFolderClick} className={className} role="button">
<EuiIcon type={forceOpen ? 'arrowDown' : 'arrowRight'} />
{`${node.name}/`}
</div>
@ -76,14 +76,14 @@ export class CodeFileTree extends React.Component<Props> {
}
case FileTreeItemType.Submodule: {
return (
<div onClick={onClick} className={className}>
<div onClick={onClick} className={className} role="button">
{node.name}
</div>
);
}
case FileTreeItemType.File: {
return (
<div onClick={onClick} className={className}>
<div onClick={onClick} className={className} role="button">
{node.name}
</div>
);

View file

@ -44,7 +44,7 @@ class FileListDropdownComponent extends React.Component<Props, State> {
public render() {
const path = this.props.paths[this.props.paths.length - 1];
const button = (
<span onClick={this.onClick} className="breadcrumbs">
<span onClick={this.onClick} className="breadcrumbs" role="button">
{path}
</span>
);

View file

@ -378,6 +378,7 @@ export class QueryBar extends Component<Props, State> {
aria-haspopup="true"
aria-expanded={this.state.isSuggestionsVisible}
aria-owns="typeahead-items"
aria-controls="typeahead-items"
>
<form role="form" name="queryBarForm">
<div className="kuiLocalSearch" role="search">

View file

@ -128,6 +128,7 @@ export const SuggestionComponent: SFC<Props> = props => {
active={props.selected}
onMouseEnter={props.onMouseEnter}
id={props.ariaId}
aria-selected={props.selected}
>
<SuggestionItemInner>
{icon}

View file

@ -7,7 +7,7 @@
import fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import rimraf = require('rimraf');
import rimraf from 'rimraf';
import { ServerOptions } from '../server_options';
import { ConsoleLoggerFactory } from '../utils/console_logger_factory';
import { TYPESCRIPT } from './language_servers';

View file

@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import moment = require('moment');
import moment from 'moment';
import { IndexStats, IndexWorkerResult, RepositoryUri, WorkerProgress } from '../../model';
import { IndexerFactory, IndexProgress } from '../indexer';

View file

@ -39,6 +39,7 @@ export function repositoryRoute(
const repo = RepositoryUtils.buildRepository(repoUrl);
const repoObjectClient = new RepositoryObjectClient(
// @ts-ignore
req.server.plugins.elasticsearch.getCluster('data').getClient()
);
@ -85,6 +86,7 @@ export function repositoryRoute(
const repoUri: string = req.params.uri as string;
const log = new Log(req.server);
const repoObjectClient = new RepositoryObjectClient(
// @ts-ignore
req.server.plugins.elasticsearch.getCluster('data').getClient()
);
try {
@ -127,6 +129,7 @@ export function repositoryRoute(
const log = new Log(req.server);
try {
const repoObjectClient = new RepositoryObjectClient(
// @ts-ignore
req.server.plugins.elasticsearch.getCluster('data').getClient()
);
return await repoObjectClient.getRepository(repoUri);
@ -146,6 +149,7 @@ export function repositoryRoute(
const log = new Log(req.server);
try {
const repoObjectClient = new RepositoryObjectClient(
// @ts-ignore
req.server.plugins.elasticsearch.getCluster('data').getClient()
);
return await repoObjectClient.getRepositoryGitStatus(repoUri);
@ -165,6 +169,7 @@ export function repositoryRoute(
const log = new Log(req.server);
try {
const repoObjectClient = new RepositoryObjectClient(
// @ts-ignore
req.server.plugins.elasticsearch.getCluster('data').getClient()
);
return await repoObjectClient.getAllRepositories();
@ -187,6 +192,7 @@ export function repositoryRoute(
const log = new Log(req.server);
try {
const repoObjectClient = new RepositoryObjectClient(
// @ts-ignore
req.server.plugins.elasticsearch.getCluster('data').getClient()
);
const cloneStatus = await repoObjectClient.getRepositoryGitStatus(repoUri);
@ -223,6 +229,7 @@ export function repositoryRoute(
const repo = RepositoryUtils.buildRepository(repoUrl);
const repoObjectClient = new RepositoryObjectClient(
// @ts-ignore
req.server.plugins.elasticsearch.getCluster('data').getClient()
);
@ -256,6 +263,7 @@ export function repositoryRoute(
const log = new Log(req.server);
try {
const repoObjectClient = new RepositoryObjectClient(
// @ts-ignore
req.server.plugins.elasticsearch.getCluster('data').getClient()
);
return await repoObjectClient.getRepositoryConfig(repoUri);

View file

@ -1108,13 +1108,6 @@
dependencies:
type-detect "4.0.8"
"@sinonjs/formatio@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@sinonjs/formatio/-/formatio-2.0.0.tgz#84db7e9eb5531df18a8c5e0bfb6e449e55e654b2"
integrity sha512-ls6CAMA6/5gG+O/IdsBcblvnd8qcO/l1TYoNeAzp3wcISOxlPXQEus0mLcdwazEkWjaBdaJ3TaxmNgCLWwvWzg==
dependencies:
samsam "1.3.0"
"@sinonjs/formatio@^3.1.0":
version "3.1.0"
resolved "http://registry.npm.taobao.org/@sinonjs/formatio/download/@sinonjs/formatio-3.1.0.tgz#6ac9d1eb1821984d84c4996726e45d1646d8cce5"
@ -1904,10 +1897,10 @@
dependencies:
"@types/node" "*"
"@types/sinon@^5.0.1":
version "5.0.3"
resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-5.0.3.tgz#2b1840122f372350c563e3ceda2f447b55f3a927"
integrity sha512-JvnfqYfBapg1Ktjjvb79myQ2A848yCdB+1g/okS9OyNqPrT/qWUIt71G0eyi7msZf0gC4fBd40Yu15Btw6BMfQ==
"@types/sinon@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-7.0.0.tgz#84e707e157ec17d3e4c2a137f41fc3f416c0551e"
integrity sha512-kcYoPw0uKioFVC/oOqafk2yizSceIQXCYnkYts9vJIwQklFRsMubTObTDrjQamUyBRd47332s85074cd/hCwxg==
"@types/socket.io-client@^1.4.32":
version "1.4.32"
@ -13283,11 +13276,6 @@ jszip@2.5.0:
dependencies:
pako "~0.2.5"
just-extend@^1.1.27:
version "1.1.27"
resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-1.1.27.tgz#ec6e79410ff914e472652abfa0e603c03d60e905"
integrity sha512-mJVp13Ix6gFo3SBAy9U/kL+oeZqzlYYYLQBwXVBlVzIsZwBqGREnOro24oC/8s8aox+rJhtZ2DiQof++IrkA+g==
just-extend@^4.0.2:
version "4.0.2"
resolved "http://registry.npm.taobao.org/just-extend/download/just-extend-4.0.2.tgz#f3f47f7dfca0f989c55410a7ebc8854b07108afc"
@ -14419,7 +14407,7 @@ loglevel@^1.4.1, loglevel@^1.6.1:
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa"
integrity sha1-4PyVEztu8nbNyIh82vJKpvFW+Po=
lolex@^2.2.0, lolex@^2.3.2:
lolex@^2.3.2:
version "2.6.0"
resolved "https://registry.yarnpkg.com/lolex/-/lolex-2.6.0.tgz#cf9166f3c9dece3cdeb5d6b01fce50f14a1203e3"
integrity sha512-e1UtIo1pbrIqEXib/yMjHciyqkng5lc0rrIbytgjmRgDR9+2ceNIAcwOWSgylRjoEP9VdVguCSRwnNmlbnOUwA==
@ -15448,17 +15436,6 @@ nigel@3.x.x:
hoek "5.x.x"
vise "3.x.x"
nise@^1.2.0:
version "1.3.3"
resolved "https://registry.yarnpkg.com/nise/-/nise-1.3.3.tgz#c17a850066a8a1dfeb37f921da02441afc4a82ba"
integrity sha512-v1J/FLUB9PfGqZLGDBhQqODkbLotP0WtLo9R4EJY2PPu5f5Xg4o0rA8FDlmrjFSv9vBBKcfnOSpfYYuu5RTHqg==
dependencies:
"@sinonjs/formatio" "^2.0.0"
just-extend "^1.1.27"
lolex "^2.3.2"
path-to-regexp "^1.7.0"
text-encoding "^0.6.4"
nise@^1.4.7:
version "1.4.8"
resolved "http://registry.npm.taobao.org/nise/download/nise-1.4.8.tgz#ce91c31e86cf9b2c4cac49d7fcd7f56779bfd6b0"
@ -19352,11 +19329,6 @@ safefs@^4.0.0:
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
samsam@1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.3.0.tgz#8d1d9350e25622da30de3e44ba692b5221ab7c50"
integrity sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg==
sane@^2.0.0:
version "2.5.2"
resolved "https://registry.yarnpkg.com/sane/-/sane-2.5.2.tgz#b4dc1861c21b427e929507a3e751e2a2cb8ab3fa"
@ -19808,23 +19780,10 @@ simple-swizzle@^0.2.2:
dependencies:
is-arrayish "^0.3.1"
sinon@^5.0.7:
version "5.0.7"
resolved "https://registry.yarnpkg.com/sinon/-/sinon-5.0.7.tgz#3bded6a73613ccc9e512e20246ced69a27c27dab"
integrity sha512-GvNLrwpvLZ8jIMZBUhHGUZDq5wlUdceJWyHvZDmqBxnjazpxY1L0FNbGBX6VpcOEoQ8Q4XMWFzm2myJMvx+VjA==
dependencies:
"@sinonjs/formatio" "^2.0.0"
diff "^3.1.0"
lodash.get "^4.4.2"
lolex "^2.2.0"
nise "^1.2.0"
supports-color "^5.1.0"
type-detect "^4.0.5"
sinon@v7.2.2:
sinon@^7.2.2:
version "7.2.2"
resolved "http://registry.npm.taobao.org/sinon/download/sinon-7.2.2.tgz#388ecabd42fa93c592bfc71d35a70894d5a0ca07"
integrity sha1-OI7KvUL6k8WSv8cdNacIlNWgygc=
resolved "https://registry.yarnpkg.com/sinon/-/sinon-7.2.2.tgz#388ecabd42fa93c592bfc71d35a70894d5a0ca07"
integrity sha512-WLagdMHiEsrRmee3jr6IIDntOF4kbI6N2pfbi8wkv50qaUQcBglkzkjtoOEbeJ2vf1EsrHhLI+5Ny8//WHdMoA==
dependencies:
"@sinonjs/commons" "^1.2.0"
"@sinonjs/formatio" "^3.1.0"