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

Ts project refs: Migrates Upgrade Assistant to a TS project #89949

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