Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to TS v4 #73924

Merged
merged 55 commits into from
Aug 27, 2020
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
d046e4c
bump ts to v4
mshustov Jul 31, 2020
50ca66b
MOAR RAM
mshustov Jul 31, 2020
3890f8e
fix type errors for OSS
mshustov Jul 31, 2020
095b3c8
first pass on x-pack errors
mshustov Jul 31, 2020
d43af38
second pass on x-pack type errors
mshustov Aug 1, 2020
21e799c
3rd pass on x-pack type-errors
mshustov Aug 1, 2020
3d60683
mute errors if complex cases
mshustov Aug 1, 2020
d356ee9
don't delete if spread suffices
mshustov Aug 1, 2020
052afca
mute other complex cases
mshustov Aug 1, 2020
ea154f3
make User fields optional
mshustov Aug 1, 2020
02712a0
fix optional types
mshustov Aug 1, 2020
1c1e5af
fix tests
mshustov Aug 1, 2020
3391a8a
fix typings for time_range
mshustov Aug 1, 2020
4d2b092
fix type errors in x-pack/tests
mshustov Aug 1, 2020
5313695
rebuild kbn-pm
mshustov Aug 1, 2020
dc1e691
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 1, 2020
e5e2e7b
remove leftovers from master update
mshustov Aug 1, 2020
85e5c27
fix alert tests
mshustov Aug 1, 2020
e6297cf
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 5, 2020
44e41e2
[Telemetry Checker] TS4 Fixes
afharo Aug 6, 2020
3b1394a
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 19, 2020
c6e7e2a
bump to 4.0.1-rc
mshustov Aug 19, 2020
4741fc2
fix new errors in master
mshustov Aug 19, 2020
e59c2fa
Merge pull request #5 from afharo/telemetry/ts-4-fixes
mshustov Aug 19, 2020
17f705c
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 20, 2020
e381915
bump typescript-eslint to version supporting TS v4 syntax
mshustov Aug 20, 2020
1a96c4e
fix merge commit errors
mshustov Aug 20, 2020
4d4dedd
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 20, 2020
47afdec
Merge remote-tracking branch 'origin/issue-71932-ts-4' into issue-719…
mshustov Aug 20, 2020
d95d4ca
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 20, 2020
aaa0fdd
update to the stable TS version 4.0.2
mshustov Aug 20, 2020
e43efca
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 21, 2020
3941c86
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 23, 2020
fd012b7
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 24, 2020
802bced
bump ts-eslint to version supporting ts v4
mshustov Aug 24, 2020
bf9e19e
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 24, 2020
b2cda91
fix typo
mshustov Aug 25, 2020
0abeed4
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 25, 2020
02292ce
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 25, 2020
e5d576a
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 26, 2020
c1203c6
fix type errors after merge
mshustov Aug 26, 2020
26ca40e
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 26, 2020
fe1821b
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 26, 2020
68214e2
update ts in another new package.json
mshustov Aug 26, 2020
dc0fc3b
TEMP: remove me
mshustov Aug 26, 2020
0190a92
Revert "TEMP: remove me"
mshustov Aug 26, 2020
87bbb63
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 26, 2020
7271d03
[Telemetry] Update snapshot for new TS4 SyntaxKind
afharo Aug 26, 2020
8621677
Merge remote-tracking branch 'origin/issue-71932-ts-4' into issue-719…
mshustov Aug 26, 2020
de8c29c
bump prettier to support TS v4 syntax
mshustov Aug 26, 2020
da5ed0f
fix prettier rules
mshustov Aug 26, 2020
47cfea2
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 26, 2020
5da4226
last style change
mshustov Aug 27, 2020
8973a1d
Merge branch 'master' into issue-71932-ts-4
mshustov Aug 27, 2020
577b8fb
fix new type errors
mshustov Aug 27, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"**/@types/chai": "^4.2.11",
"**/cypress/@types/lodash": "^4.14.159",
"**/cypress/lodash": "^4.17.20",
"**/typescript": "3.9.5",
"**/typescript": "4.0.2",
"**/graphql-toolkit/lodash": "^4.17.15",
"**/hoist-non-react-statics": "^3.3.2",
"**/isomorphic-git/**/base64-js": "^1.2.1",
Expand Down Expand Up @@ -337,8 +337,8 @@
"@types/vinyl": "^2.0.4",
"@types/vinyl-fs": "^2.4.11",
"@types/zen-observable": "^0.8.0",
"@typescript-eslint/eslint-plugin": "^3.7.1",
"@typescript-eslint/parser": "^3.7.1",
"@typescript-eslint/eslint-plugin": "^3.10.0",
"@typescript-eslint/parser": "^3.10.0",
"angular-aria": "^1.8.0",
"angular-mocks": "^1.7.9",
"angular-recursion": "^1.0.5",
Expand Down Expand Up @@ -380,7 +380,7 @@
"eslint-plugin-no-unsanitized": "^3.0.2",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-prefer-object-spread": "^1.2.1",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.3",
"eslint-plugin-react-hooks": "^4.0.4",
"eslint-plugin-react-perf": "^3.2.3",
Expand Down Expand Up @@ -442,7 +442,7 @@
"pkg-up": "^2.0.0",
"pngjs": "^3.4.0",
"postcss": "^7.0.32",
"prettier": "^2.0.5",
"prettier": "^2.1.1",
"prop-types": "15.6.0",
"proxyquire": "1.8.0",
"react-grid-layout": "^0.16.2",
Expand All @@ -468,7 +468,7 @@
"tape": "^4.13.0",
"topojson-client": "3.0.0",
"tree-kill": "^1.2.2",
"typescript": "3.9.5",
"typescript": "4.0.2",
"typings-tester": "^0.3.2",
"ui-select": "0.19.8",
"vega": "^5.13.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-kibana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
},
"homepage": "https://github.com/elastic/kibana/tree/master/packages/eslint-config-kibana",
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "^3.7.1",
"@typescript-eslint/parser": "^3.7.1",
"@typescript-eslint/eslint-plugin": "^3.10.0",
"@typescript-eslint/parser": "^3.10.0",
"babel-eslint": "^10.0.3",
"eslint": "^6.8.0",
"eslint-plugin-babel": "^5.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"@babel/cli": "^7.10.5",
"@kbn/dev-utils": "1.0.0",
"@kbn/babel-preset": "1.0.0",
"typescript": "3.9.5"
"typescript": "4.0.2"
}
}
2 changes: 1 addition & 1 deletion packages/kbn-config-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"kbn:bootstrap": "yarn build"
},
"devDependencies": {
"typescript": "3.9.5",
"typescript": "4.0.2",
"tsd": "^0.7.4"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"tslib": "^2.0.0"
},
"devDependencies": {
"typescript": "3.9.5",
"typescript": "4.0.2",
"@kbn/expect": "1.0.0",
"chance": "1.0.18"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"del": "^5.1.0",
"getopts": "^2.2.4",
"supports-color": "^7.0.0",
"typescript": "3.9.5"
"typescript": "4.0.2"
},
"dependencies": {
"intl-format-cache": "^2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-monaco/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"del": "^5.1.0",
"raw-loader": "3.1.0",
"supports-color": "^7.0.0",
"typescript": "3.9.5",
"typescript": "4.0.2",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-plugin-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"execa": "^4.0.2",
"inquirer": "^7.3.3",
"normalize-path": "^3.0.0",
"prettier": "^2.0.5",
"prettier": "^2.1.1",
"vinyl": "^2.2.0",
"vinyl-fs": "^3.0.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-plugin-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@types/through2": "^2.0.35",
"@types/through2-map": "^3.0.0",
"@types/vinyl": "^2.0.4",
"typescript": "3.9.5"
"typescript": "4.0.2"
},
"peerDependencies": {
"@kbn/babel-preset": "1.0.0"
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-pm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ module.exports = require("path");
* under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToolingLogCollectingWriter = exports.parseLogLevel = exports.pickLevelFromFlags = exports.ToolingLogTextWriter = exports.ToolingLog = void 0;
var tooling_log_1 = __webpack_require__(6);
Object.defineProperty(exports, "ToolingLog", { enumerable: true, get: function () { return tooling_log_1.ToolingLog; } });
var tooling_log_text_writer_1 = __webpack_require__(110);
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-pm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@
"multimatch": "^4.0.0",
"ncp": "^2.0.0",
"ora": "^1.4.0",
"prettier": "^2.0.5",
"prettier": "^2.1.1",
"read-pkg": "^5.2.0",
"rxjs": "^6.5.5",
"spawn-sync": "^1.0.15",
"string-replace-loader": "^2.2.0",
"strip-ansi": "^4.0.0",
"strong-log-transformer": "^2.1.0",
"tempy": "^0.3.0",
"typescript": "3.9.5",
"typescript": "4.0.2",
"unlazy-loader": "^0.1.3",
"webpack": "^4.41.5",
"webpack-cli": "^3.3.10",
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-release-notes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
},
"devDependencies": {
"markdown-it": "^10.0.0",
"typescript": "3.9.5"
"typescript": "4.0.2"
}
}
}
2 changes: 1 addition & 1 deletion packages/kbn-spec-to-console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"homepage": "https://github.com/jbudz/spec-to-console#readme",
"devDependencies": {
"jest": "^25.5.4",
"prettier": "^2.0.5"
"prettier": "^2.1.1"
},
"dependencies": {
"commander": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-telemetry-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"normalize-path": "^3.0.0",
"@types/lodash": "^3.10.1",
"moment": "^2.24.0",
"typescript": "3.9.5"
"typescript": "4.0.2"
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions packages/kbn-telemetry-tools/src/tools/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,11 @@ export function getDescriptor(node: ts.Node, program: ts.Program): Descriptor |
}

if (ts.isUnionTypeNode(node)) {
const types = node.types.filter((typeNode) => {
return (
typeNode.kind !== ts.SyntaxKind.NullKeyword &&
typeNode.kind !== ts.SyntaxKind.UndefinedKeyword
);
});
const types = node.types.filter(discardNullOrUndefined);

const kinds = types.map((typeNode) => getDescriptor(typeNode, program));
const kinds = types
.map((typeNode) => getDescriptor(typeNode, program))
.filter(discardNullOrUndefined);

const uniqueKinds = uniq(kinds, 'kind');

Expand All @@ -172,3 +169,9 @@ export function getDescriptor(node: ts.Node, program: ts.Program): Descriptor |
throw new Error(`Unknown type ${ts.SyntaxKind[node.kind]}; ${node.getText()}`);
}
}

function discardNullOrUndefined(typeNode: ts.TypeNode | Descriptor | DescriptorValue) {
return (
typeNode.kind !== ts.SyntaxKind.NullKeyword && typeNode.kind !== ts.SyntaxKind.UndefinedKeyword
);
}
2 changes: 1 addition & 1 deletion src/fixtures/agg_resp/date_histogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default {
hits: [],
},
aggregations: {
'1': {
1: {
buckets: [
{
key_as_string: '2015-01-30T01:00:00.000Z',
Expand Down
2 changes: 1 addition & 1 deletion src/fixtures/agg_resp/range.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default {
hits: [],
},
aggregations: {
'1': {
1: {
buckets: {
'*-1024.0': {
to: 1024,
Expand Down
8 changes: 4 additions & 4 deletions src/legacy/server/status/lib/metrics.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ describe('Metrics', function () {
Object.defineProperty(process, 'pid', { get: pidMock }); //

const hapiEvent = {
requests: { '5603': { total: 22, disconnects: 0, statusCodes: { '200': 22 } } },
responseTimes: { '5603': { avg: 1.8636363636363635, max: 4 } },
requests: { 5603: { total: 22, disconnects: 0, statusCodes: { 200: 22 } } },
responseTimes: { 5603: { avg: 1.8636363636363635, max: 4 } },
osload: [2.20751953125, 2.02294921875, 1.89794921875],
osmem: { total: 17179869184, free: 102318080 },
osup: 1008991,
Expand Down Expand Up @@ -150,9 +150,9 @@ describe('Metrics', function () {
it('parses event with missing fields / NaN for responseTimes.avg', async () => {
const hapiEvent = {
requests: {
'5603': { total: 22, disconnects: 0, statusCodes: { '200': 22 } },
5603: { total: 22, disconnects: 0, statusCodes: { 200: 22 } },
},
responseTimes: { '5603': { avg: NaN, max: 4 } },
responseTimes: { 5603: { avg: NaN, max: 4 } },
host: 'blahblah.local',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class AdvancedSettingsComponent extends Component<
}

export const AdvancedSettings = (props: AdvancedSettingsProps) => {
const { query } = useParams();
const { query } = useParams<{ query: string }>();
return (
<AdvancedSettingsComponent
queryText={query || ''}
Expand Down
Loading