Skip to content

Commit

Permalink
Ts project refs: Migrates Upgrade Assistant to a TS project (#89949)
Browse files Browse the repository at this point in the history
  • Loading branch information
TinaHeiligers authored Feb 3, 2021
1 parent d07ae11 commit c67e291
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

import { SemVer } from 'semver';
import { IScopedClusterClient, kibanaResponseFactory } from 'src/core/server';
import { xpackMocks } from '../../../../mocks';
import { coreMock } from 'src/core/server/mocks';
import { licensingMock } from '../../../../plugins/licensing/server/mocks';
import { MOCK_VERSION_STRING, getMockVersionInfo } from './__fixtures__/version';

import {
Expand All @@ -18,6 +19,18 @@ import { versionService } from './version';

const { currentMajor, currentVersion } = getMockVersionInfo();

// Re-implement the mock that was imported directly from `x-pack/mocks`
function createCoreRequestHandlerContextMock() {
return {
core: coreMock.createRequestHandlerContext(),
licensing: licensingMock.createRequestHandlerContext(),
};
}

const xpackMocks = {
createRequestHandlerContext: createCoreRequestHandlerContextMock,
};

describe('getAllNodeVersions', () => {
it('returns a list of unique node versions', async () => {
const adminClient = ({
Expand Down
26 changes: 26 additions & 0 deletions x-pack/plugins/upgrade_assistant/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"common/**/*",
"public/**/*",
"server/**/*",
// have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636
"public/**/*.json",
"server/**/*.json"
],
"references": [
{ "path": "../../../src/core/tsconfig.json" },
{ "path": "../../../src/plugins/management/tsconfig.json" },
{ "path": "../../../src/plugins/usage_collection/tsconfig.json" },
{ "path": "../cloud/tsconfig.json" },
{ "path": "../features/tsconfig.json" },
{ "path": "../licensing/tsconfig.json" },
]
}
1 change: 1 addition & 0 deletions x-pack/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
{ "path": "../plugins/snapshot_restore/tsconfig.json" },
{ "path": "../plugins/grokdebugger/tsconfig.json" },
{ "path": "../plugins/painless_lab/tsconfig.json" },
{ "path": "../plugins/upgrade_assistant/tsconfig.json" },
{ "path": "../plugins/watcher/tsconfig.json" },
{ "path": "../plugins/runtime_fields/tsconfig.json" },
{ "path": "../plugins/index_management/tsconfig.json" }
Expand Down
2 changes: 2 additions & 0 deletions x-pack/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"plugins/runtime_fields/**/*",
"plugins/index_management/**/*",
"plugins/grokdebugger/**/*",
"plugins/upgrade_assistant/**/*",
"test/**/*"
],
"compilerOptions": {
Expand Down Expand Up @@ -135,6 +136,7 @@
{ "path": "./plugins/translations/tsconfig.json" },
{ "path": "./plugins/triggers_actions_ui/tsconfig.json" },
{ "path": "./plugins/ui_actions_enhanced/tsconfig.json" },
{ "path": "./plugins/upgrade_assistant/tsconfig.json" },
{ "path": "./plugins/runtime_fields/tsconfig.json" },
{ "path": "./plugins/index_management/tsconfig.json" },
{ "path": "./plugins/watcher/tsconfig.json" }
Expand Down
1 change: 1 addition & 0 deletions x-pack/tsconfig.refs.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
{ "path": "./plugins/translations/tsconfig.json" },
{ "path": "./plugins/triggers_actions_ui/tsconfig.json" },
{ "path": "./plugins/ui_actions_enhanced/tsconfig.json" },
{ "path": "./plugins/upgrade_assistant/tsconfig.json" },
{ "path": "./plugins/runtime_fields/tsconfig.json" },
{ "path": "./plugins/index_management/tsconfig.json" },
{ "path": "./plugins/watcher/tsconfig.json" }
Expand Down

0 comments on commit c67e291

Please sign in to comment.