mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
create @kbn/ui-actions-browser package (#149202)
## Summary Partially addresses https://github.com/elastic/kibana/issues/147757 Sets up Ui Actions package and starts moving services from the plugin to the package. - [x] Setup `@kbn/ui-actions` package. - [ ] Move code components to the package - [x] Types - [ ] Triggers - [ ] Actions - [ ] `UiActionsService` - [x] Make `ui_actions` plugin use the new package. Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
c5faa31faf
commit
ebb61a5089
19 changed files with 84 additions and 9 deletions
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
|
@ -1017,6 +1017,7 @@ packages/kbn-tooling-log @elastic/kibana-operations
|
|||
packages/kbn-ts-projects @elastic/kibana-operations
|
||||
packages/kbn-ts-type-check-cli @elastic/kibana-operations
|
||||
packages/kbn-typed-react-router-config @elastic/apm-ui
|
||||
packages/kbn-ui-actions-browser @elastic/appex-sharedux
|
||||
packages/kbn-ui-framework @elastic/kibana-design
|
||||
packages/kbn-ui-shared-deps-npm @elastic/kibana-operations
|
||||
packages/kbn-ui-shared-deps-src @elastic/kibana-operations
|
||||
|
|
|
@ -447,6 +447,7 @@
|
|||
"@kbn/timelion-grammar": "link:packages/kbn-timelion-grammar",
|
||||
"@kbn/tinymath": "link:packages/kbn-tinymath",
|
||||
"@kbn/typed-react-router-config": "link:packages/kbn-typed-react-router-config",
|
||||
"@kbn/ui-actions-browser": "link:packages/kbn-ui-actions-browser",
|
||||
"@kbn/ui-framework": "link:packages/kbn-ui-framework",
|
||||
"@kbn/ui-shared-deps-npm": "link:packages/kbn-ui-shared-deps-npm",
|
||||
"@kbn/ui-shared-deps-src": "link:packages/kbn-ui-shared-deps-src",
|
||||
|
|
|
@ -30,14 +30,16 @@ instead be:
|
|||
"@kbn/i18n": "link:../../kibana/packages/kbn-i18n"
|
||||
```
|
||||
|
||||
then run `yarn kbn bootstrap` from the plugin directory.
|
||||
|
||||
## Creating a new package
|
||||
|
||||
Create a new sub-folder. The name of the folder should mirror the `name` in the
|
||||
package's `package.json`. E.g. if the name is `@kbn/i18n` the folder name
|
||||
should be `kbn-i18n`.
|
||||
Run the following command from the root of the Kibana repo:
|
||||
|
||||
```
|
||||
node scripts/generate package @kbn/<PACKAGE_NAME> --web --owner @elastic/<TEAM_NAME>
|
||||
```
|
||||
|
||||
All new packages should use the `@kbn` namespace, and should be marked with
|
||||
`"private": true`.
|
||||
|
||||
## Unit tests for a package
|
||||
|
||||
|
|
3
packages/kbn-ui-actions-browser/README.md
Normal file
3
packages/kbn-ui-actions-browser/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# @kbn/ui-actions-browser
|
||||
|
||||
Empty package generated by @kbn/generate
|
9
packages/kbn-ui-actions-browser/index.ts
Normal file
9
packages/kbn-ui-actions-browser/index.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
export * from './src';
|
13
packages/kbn-ui-actions-browser/jest.config.js
Normal file
13
packages/kbn-ui-actions-browser/jest.config.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../..',
|
||||
roots: ['<rootDir>/packages/kbn-ui-actions-browser'],
|
||||
};
|
5
packages/kbn-ui-actions-browser/kibana.jsonc
Normal file
5
packages/kbn-ui-actions-browser/kibana.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"type": "shared-common",
|
||||
"id": "@kbn/ui-actions-browser",
|
||||
"owner": "@elastic/appex-sharedux"
|
||||
}
|
6
packages/kbn-ui-actions-browser/package.json
Normal file
6
packages/kbn-ui-actions-browser/package.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"name": "@kbn/ui-actions-browser",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"license": "SSPL-1.0 OR Elastic License 2.0"
|
||||
}
|
9
packages/kbn-ui-actions-browser/src/index.ts
Normal file
9
packages/kbn-ui-actions-browser/src/index.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
export * from './types';
|
19
packages/kbn-ui-actions-browser/tsconfig.json
Normal file
19
packages/kbn-ui-actions-browser/tsconfig.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "target/types",
|
||||
"types": [
|
||||
"jest",
|
||||
"node",
|
||||
"react"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
],
|
||||
"exclude": [
|
||||
"target/**/*"
|
||||
],
|
||||
"kbn_references": []
|
||||
}
|
|
@ -6,7 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import type { Presentable } from '../util/presentable';
|
||||
import type { Presentable } from '@kbn/ui-actions-browser';
|
||||
import type { Trigger } from '../triggers';
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*/
|
||||
|
||||
import * as React from 'react';
|
||||
import { Presentable, PresentableGrouping } from '@kbn/ui-actions-browser';
|
||||
import { Action, ActionDefinition, ActionMenuItemProps } from './action';
|
||||
import { Presentable, PresentableGrouping } from '../util/presentable';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
import { EuiContextMenuPanelDescriptor } from '@elastic/eui';
|
||||
import { buildContextMenuForActions } from './build_eui_context_menu_panels';
|
||||
import { Action, createAction } from '../actions';
|
||||
import { PresentableGrouping } from '../util';
|
||||
import { PresentableGrouping } from '@kbn/ui-actions-browser';
|
||||
|
||||
const createTestAction = ({
|
||||
type,
|
||||
|
|
|
@ -22,7 +22,7 @@ export { buildContextMenuForActions } from './context_menu';
|
|||
export type {
|
||||
Presentable as UiActionsPresentable,
|
||||
PresentableGrouping as UiActionsPresentableGrouping,
|
||||
} from './util';
|
||||
} from '@kbn/ui-actions-browser';
|
||||
export type { Trigger, RowClickContext } from './triggers';
|
||||
export {
|
||||
VISUALIZE_FIELD_TRIGGER,
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
"@kbn/i18n",
|
||||
"@kbn/es-query",
|
||||
"@kbn/ui-theme",
|
||||
"@kbn/ui-actions-browser",
|
||||
],
|
||||
"exclude": [
|
||||
"target/**/*",
|
||||
|
|
|
@ -1218,6 +1218,8 @@
|
|||
"@kbn/ts-type-check-cli/*": ["packages/kbn-ts-type-check-cli/*"],
|
||||
"@kbn/typed-react-router-config": ["packages/kbn-typed-react-router-config"],
|
||||
"@kbn/typed-react-router-config/*": ["packages/kbn-typed-react-router-config/*"],
|
||||
"@kbn/ui-actions-browser": ["packages/kbn-ui-actions-browser"],
|
||||
"@kbn/ui-actions-browser/*": ["packages/kbn-ui-actions-browser/*"],
|
||||
"@kbn/ui-actions-enhanced-examples-plugin": ["x-pack/examples/ui_actions_enhanced_examples"],
|
||||
"@kbn/ui-actions-enhanced-examples-plugin/*": ["x-pack/examples/ui_actions_enhanced_examples/*"],
|
||||
"@kbn/ui-actions-enhanced-plugin": ["src/plugins/ui_actions_enhanced"],
|
||||
|
|
|
@ -4277,6 +4277,10 @@
|
|||
version "0.0.0"
|
||||
uid ""
|
||||
|
||||
"@kbn/ui-actions-browser@link:packages/kbn-ui-actions-browser":
|
||||
version "0.0.0"
|
||||
uid ""
|
||||
|
||||
"@kbn/ui-framework@link:packages/kbn-ui-framework":
|
||||
version "0.0.0"
|
||||
uid ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue