Skip to content

Commit

Permalink
[Alerting] Migrate Actions, Alerts, Stack Alerts and TriggersActionsU…
Browse files Browse the repository at this point in the history
…I plugins to TS project references (#88556)

* [Alerting] Migrate Actions plugin to TS project references

* alerts plugin ts migration

* triggers_actions_ui plugin ts migration

* fixed build

* fixed build
  • Loading branch information
YulNaumenko authored Jan 20, 2021
1 parent c9002a2 commit 8b1a228
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 7 deletions.
2 changes: 1 addition & 1 deletion x-pack/examples/alerting_example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"public/**/*.tsx",
"server/**/*.ts",
"common/**/*.ts",
"../../../typings/**/*",
"../../typings/**/*",
],
"exclude": [],
"references": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
import { ActionType } from '../types';
import { LICENSE_TYPE } from '../../../licensing/common/types';
import { ServerLogActionTypeId, IndexActionTypeId } from '../builtin_action_types';
import { CASE_ACTION_TYPE_ID } from '../../../case/server';
import { ActionTypeConfig, ActionTypeSecrets, ActionTypeParams } from '../types';

export const CASE_ACTION_TYPE_ID = '.case';

const ACTIONS_SCOPED_WITHIN_STACK = new Set([
ServerLogActionTypeId,
IndexActionTypeId,
Expand Down
27 changes: 27 additions & 0 deletions x-pack/plugins/actions/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"server/**/*",
// have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636
"server/**/*.json",
"common/*"
],
"references": [
{ "path": "../../../src/core/tsconfig.json" },
{ "path": "../spaces/tsconfig.json" },
{ "path": "../security/tsconfig.json" },
{ "path": "../licensing/tsconfig.json" },
{ "path": "../task_manager/tsconfig.json" },
{ "path": "../event_log/tsconfig.json" },
{ "path": "../encrypted_saved_objects/tsconfig.json" },
{ "path": "../features/tsconfig.json" },
{ "path": "../../../src/plugins/usage_collection/tsconfig.json" }
]
}
6 changes: 2 additions & 4 deletions x-pack/plugins/alerts/server/saved_objects/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ import {
} from '../../../../../src/core/server';
import { RawAlert } from '../types';
import { EncryptedSavedObjectsPluginSetup } from '../../../encrypted_saved_objects/server';
import {
APP_ID as SIEM_APP_ID,
SERVER_APP_ID as SIEM_SERVER_APP_ID,
} from '../../../security_solution/common/constants';

const SIEM_APP_ID = 'securitySolution';
const SIEM_SERVER_APP_ID = 'siem';
export const LEGACY_LAST_MODIFIED_VERSION = 'pre-7.10.0';

type AlertMigration = (
Expand Down
30 changes: 30 additions & 0 deletions x-pack/plugins/alerts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"server/**/*",
// have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636
"server/**/*.json",
"public/**/*",
"common/*"
],
"references": [
{ "path": "../../../src/core/tsconfig.json" },
{ "path": "../actions/tsconfig.json" },
{ "path": "../spaces/tsconfig.json" },
{ "path": "../security/tsconfig.json" },
{ "path": "../licensing/tsconfig.json" },
{ "path": "../task_manager/tsconfig.json" },
{ "path": "../event_log/tsconfig.json" },
{ "path": "../encrypted_saved_objects/tsconfig.json" },
{ "path": "../features/tsconfig.json" },
{ "path": "../../../src/plugins/usage_collection/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_utils/tsconfig.json" }
]
}
25 changes: 25 additions & 0 deletions x-pack/plugins/stack_alerts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"server/**/*",
"server/**/*.json",
"public/**/*",
"common/*"
],
"references": [
{ "path": "../../../src/core/tsconfig.json" },
{ "path": "../alerts/tsconfig.json" },
{ "path": "../features/tsconfig.json" },
{ "path": "../triggers_actions_ui/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../../src/plugins/saved_objects/tsconfig.json" },
{ "path": "../../../src/plugins/data/tsconfig.json" }
]
}
29 changes: 29 additions & 0 deletions x-pack/plugins/triggers_actions_ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"server/**/*",
"public/**/*",
"common/**/*",
"config.ts",
"../../../typings/**/*"
],
"references": [
{ "path": "../../../src/core/tsconfig.json" },
{ "path": "../alerts/tsconfig.json" },
{ "path": "../features/tsconfig.json" },
{ "path": "../../../src/plugins/data/tsconfig.json" },
{ "path": "../../../src/plugins/saved_objects/tsconfig.json" },
{ "path": "../../../src/plugins/home/tsconfig.json" },
{ "path": "../../../src/plugins/charts/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../../src/plugins/kibana_utils/tsconfig.json" },
{ "path": "../../../src/plugins/management/tsconfig.json" },
]
}
4 changes: 4 additions & 0 deletions x-pack/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
{ "path": "../../src/plugins/ui_actions/tsconfig.json" },
{ "path": "../../src/plugins/url_forwarding/tsconfig.json" },

{ "path": "../plugins/actions/tsconfig.json"},
{ "path": "../plugins/alerts/tsconfig.json"},
{ "path": "../plugins/console_extensions/tsconfig.json" },
{ "path": "../plugins/data_enhanced/tsconfig.json" },
{ "path": "../plugins/global_search/tsconfig.json" },
Expand All @@ -46,10 +48,12 @@
{ "path": "../plugins/licensing/tsconfig.json" },
{ "path": "../plugins/task_manager/tsconfig.json" },
{ "path": "../plugins/telemetry_collection_xpack/tsconfig.json" },
{ "path": "../plugins/triggers_actions_ui/tsconfig.json" },
{ "path": "../plugins/ui_actions_enhanced/tsconfig.json" },
{ "path": "../plugins/spaces/tsconfig.json" },
{ "path": "../plugins/security/tsconfig.json" },
{ "path": "../plugins/encrypted_saved_objects/tsconfig.json" },
{ "path": "../plugins/stack_alerts/tsconfig.json" },
{ "path": "../plugins/beats_management/tsconfig.json" },
{ "path": "../plugins/cloud/tsconfig.json" },
{ "path": "../plugins/saved_objects_tagging/tsconfig.json" },
Expand Down
10 changes: 9 additions & 1 deletion x-pack/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"extends": "../tsconfig.base.json",
"include": ["mocks.ts", "typings/**/*", "plugins/**/*", "tasks/**/*"],
"exclude": [
"plugins/actions/**/*",
"plugins/alerts/**/*",
"plugins/apm/e2e/cypress/**/*",
"plugins/apm/ftr_e2e/**/*",
"plugins/apm/scripts/**/*",
Expand All @@ -21,10 +23,12 @@
"plugins/task_manager/**/*",
"plugins/telemetry_collection_xpack/**/*",
"plugins/translations/**/*",
"plugins/triggers_actions_ui/**/*",
"plugins/ui_actions_enhanced/**/*",
"plugins/vis_type_timeseries_enhanced/**/*",
"plugins/spaces/**/*",
"plugins/security/**/*",
"plugins/stack_alerts/**/*",
"plugins/encrypted_saved_objects/**/*",
"plugins/beats_management/**/*",
"plugins/cloud/**/*",
Expand Down Expand Up @@ -92,6 +96,10 @@
{ "path": "./plugins/beats_management/tsconfig.json" },
{ "path": "./plugins/cloud/tsconfig.json" },
{ "path": "./plugins/saved_objects_tagging/tsconfig.json" },
{ "path": "./plugins/global_search_bar/tsconfig.json" }
{ "path": "./plugins/global_search_bar/tsconfig.json" },
{ "path": "./plugins/actions/tsconfig.json"},
{ "path": "./plugins/alerts/tsconfig.json"},
{ "path": "./plugins/triggers_actions_ui/tsconfig.json"},
{ "path": "./plugins/stack_alerts/tsconfig.json"}
]
}
4 changes: 4 additions & 0 deletions x-pack/tsconfig.refs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"include": [],
"references": [
{ "path": "./plugins/actions/tsconfig.json"},
{ "path": "./plugins/alerts/tsconfig.json"},
{ "path": "./plugins/dashboard_enhanced/tsconfig.json" },
{ "path": "./plugins/licensing/tsconfig.json" },
{ "path": "./plugins/console_extensions/tsconfig.json" },
Expand All @@ -18,8 +20,10 @@
{ "path": "./plugins/ui_actions_enhanced/tsconfig.json" },
{ "path": "./plugins/vis_type_timeseries_enhanced/tsconfig.json" },
{ "path": "./plugins/translations/tsconfig.json" },
{ "path": "./plugins/triggers_actions_ui/tsconfig.json"},
{ "path": "./plugins/spaces/tsconfig.json" },
{ "path": "./plugins/security/tsconfig.json" },
{ "path": "./plugins/stack_alerts/tsconfig.json"},
{ "path": "./plugins/encrypted_saved_objects/tsconfig.json" },
{ "path": "./plugins/beats_management/tsconfig.json" },
{ "path": "./plugins/cloud/tsconfig.json" },
Expand Down

0 comments on commit 8b1a228

Please sign in to comment.