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

Migrates index_management & runtime_fields to TS project refs #89809

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ const testBedConfig: TestBedConfig = {

const initTestBed = registerTestBed(WithAppDependencies(TemplateClone), testBedConfig);

export const setup = formSetup.bind(null, initTestBed);
export const setup: any = formSetup.bind(null, initTestBed);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why are these needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type isn't inferred from formSetup and the typescript project couldn't build.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah OK. It is surprising that .bind returns any! What we'd like to express is:

const a = (a: number) => {};

const b: () => ReturnType<typeof a> = a.bind(null, 1);

Not sure what else could be done, other than enabling strictBindCallApply in tsconfig, which is a breaking type check change -- but would solve this for us :)

Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ const initTestBed = registerTestBed<TestSubjects>(
testBedConfig
);

export const setup = formSetup.bind(null, initTestBed);
export const setup: any = formSetup.bind(null, initTestBed);
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ const testBedConfig: TestBedConfig = {

const initTestBed = registerTestBed<TestSubjects>(WithAppDependencies(TemplateEdit), testBedConfig);

export const setup = formSetup.bind(null, initTestBed);
export const setup: any = formSetup.bind(null, initTestBed);
31 changes: 31 additions & 0 deletions x-pack/plugins/index_management/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"__jest__/**/*",
"common/**/*",
"public/**/*",
"server/**/*",
"test/**/*",
"../../typings/**/*",
],
"references": [
{ "path": "../../../src/core/tsconfig.json" },
{ "path": "../../../src/plugins/home/tsconfig.json" },
{ "path": "../../../src/plugins/management/tsconfig.json" },
{ "path": "../../../src/plugins/share/tsconfig.json" },
{ "path": "../../../src/plugins/usage_collection/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../../src/plugins/es_ui_shared/tsconfig.json" },
{ "path": "../features/tsconfig.json" },
{ "path": "../licensing/tsconfig.json" },
{ "path": "../security/tsconfig.json" },
{ "path": "../runtime_fields/tsconfig.json" }
]
}
19 changes: 19 additions & 0 deletions x-pack/plugins/runtime_fields/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"public/**/*",
"../../../typings/**/*",
],
"references": [
{ "path": "../../../src/core/tsconfig.json" },
{ "path": "../../../src/plugins/es_ui_shared/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_legacy/tsconfig.json"}
]
}
4 changes: 3 additions & 1 deletion x-pack/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
{ "path": "../plugins/snapshot_restore/tsconfig.json" },
{ "path": "../plugins/grokdebugger/tsconfig.json" },
{ "path": "../plugins/painless_lab/tsconfig.json" },
{ "path": "../plugins/watcher/tsconfig.json" }
{ "path": "../plugins/watcher/tsconfig.json" },
{ "path": "../plugins/runtime_fields/tsconfig.json" },
{ "path": "../plugins/index_management/tsconfig.json" }
]
}
4 changes: 4 additions & 0 deletions x-pack/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
"plugins/snapshot_restore/**/*",
"plugins/painless_lab/**/*",
"plugins/watcher/**/*",
"plugins/runtime_fields/**/*",
"plugins/index_management/**/*",
"plugins/grokdebugger/**/*",
"test/**/*"
],
Expand Down Expand Up @@ -131,6 +133,8 @@
{ "path": "./plugins/translations/tsconfig.json" },
{ "path": "./plugins/triggers_actions_ui/tsconfig.json" },
{ "path": "./plugins/ui_actions_enhanced/tsconfig.json" },
{ "path": "./plugins/runtime_fields/tsconfig.json" },
{ "path": "./plugins/index_management/tsconfig.json" },
{ "path": "./plugins/watcher/tsconfig.json" }
]
}
2 changes: 2 additions & 0 deletions x-pack/tsconfig.refs.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
{ "path": "./plugins/translations/tsconfig.json" },
{ "path": "./plugins/triggers_actions_ui/tsconfig.json" },
{ "path": "./plugins/ui_actions_enhanced/tsconfig.json" },
{ "path": "./plugins/runtime_fields/tsconfig.json" },
{ "path": "./plugins/index_management/tsconfig.json" },
{ "path": "./plugins/watcher/tsconfig.json" }
]
}