Skip to content

Commit

Permalink
[7.x][DX] Upgrade prettier to v2.4.0 (#112359) (#112524)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Smalley <[email protected]>
  • Loading branch information
Tyler Smalley authored Sep 20, 2021
1 parent 039a0d4 commit c16480e
Show file tree
Hide file tree
Showing 2,933 changed files with 28,678 additions and 30,585 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ async function getDeprecations({ esClient, savedObjectsClient }: GetDeprecations
const deprecations: DeprecationsDetails[] = [];
const count = await getFooCount(savedObjectsClient);
if (count > 0) {
// Example of a manual correctiveAction
deprecations.push({
title: i18n.translate('xpack.foo.deprecations.title', {
defaultMessage: `Foo's are deprecated`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface OpsMetrics
| [collected\_at](./kibana-plugin-core-server.opsmetrics.collected_at.md) | <code>Date</code> | Time metrics were recorded at. |
| [concurrent\_connections](./kibana-plugin-core-server.opsmetrics.concurrent_connections.md) | <code>OpsServerMetrics['concurrent_connections']</code> | number of current concurrent connections to the server |
| [os](./kibana-plugin-core-server.opsmetrics.os.md) | <code>OpsOsMetrics</code> | OS related metrics |
| [process](./kibana-plugin-core-server.opsmetrics.process.md) | <code>OpsProcessMetrics</code> | Process related metrics. Deprecated in favor of processes field. |
| [process](./kibana-plugin-core-server.opsmetrics.process.md) | <code>OpsProcessMetrics</code> | Process related metrics. |
| [processes](./kibana-plugin-core-server.opsmetrics.processes.md) | <code>OpsProcessMetrics[]</code> | Process related metrics. Reports an array of objects for each kibana pid. |
| [requests](./kibana-plugin-core-server.opsmetrics.requests.md) | <code>OpsServerMetrics['requests']</code> | server requests stats |
| [response\_times](./kibana-plugin-core-server.opsmetrics.response_times.md) | <code>OpsServerMetrics['response_times']</code> | server response time stats |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

> Warning: This API is now obsolete.
>
> use the processes field instead.
>
Process related metrics. Deprecated in favor of processes field.
Process related metrics.

<b>Signature:</b>

Expand Down
27 changes: 13 additions & 14 deletions examples/bfetch_explorer/public/mount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@ export interface BfetchDeps {
explorer: ExplorerService;
}

export const mount = (
coreSetup: CoreSetup<BfetchExplorerStartPlugins>,
explorer: ExplorerService
) => async ({ appBasePath, element }: AppMountParameters) => {
const [core, plugins] = await coreSetup.getStartServices();
const deps: BfetchDeps = { appBasePath, core, plugins, explorer };
const reactElement = (
<KibanaContextProvider services={deps}>
<App />
</KibanaContextProvider>
);
render(reactElement, element);
return () => unmountComponentAtNode(element);
};
export const mount =
(coreSetup: CoreSetup<BfetchExplorerStartPlugins>, explorer: ExplorerService) =>
async ({ appBasePath, element }: AppMountParameters) => {
const [core, plugins] = await coreSetup.getStartServices();
const deps: BfetchDeps = { appBasePath, core, plugins, explorer };
const reactElement = (
<KibanaContextProvider services={deps}>
<App />
</KibanaContextProvider>
);
render(reactElement, element);
return () => unmountComponentAtNode(element);
};
3 changes: 2 additions & 1 deletion examples/dashboard_embeddable_examples/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export class DashboardEmbeddableExamples implements Plugin<void, void, {}, Start
return renderApp(
{
basename: params.appBasePath,
DashboardContainerByValueRenderer: depsStart.dashboard.getDashboardContainerByValueRenderer(),
DashboardContainerByValueRenderer:
depsStart.dashboard.getDashboardContainerByValueRenderer(),
},
params.element
);
Expand Down
3 changes: 2 additions & 1 deletion examples/embeddable_examples/public/book/book_embeddable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ function getHasMatch(search?: string, savedAttributes?: BookSavedObjectAttribute

export class BookEmbeddable
extends Embeddable<BookEmbeddableInput, BookEmbeddableOutput>
implements ReferenceOrValueEmbeddable<BookByValueInput, BookByReferenceInput> {
implements ReferenceOrValueEmbeddable<BookByValueInput, BookByReferenceInput>
{
public readonly type = BOOK_EMBEDDABLE;
private subscription: Subscription;
private node?: HTMLElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export class BookEmbeddableFactoryDefinition
BookEmbeddableOutput,
BookEmbeddable,
BookSavedObjectAttributes
> {
>
{
public readonly type = BOOK_EMBEDDABLE;
public savedObjectMetaData = {
name: 'Book',
Expand Down Expand Up @@ -116,10 +117,8 @@ export class BookEmbeddableFactoryDefinition

private async unwrapMethod(savedObjectId: string): Promise<BookSavedObjectAttributes> {
const { savedObjectsClient } = await this.getStartServices();
const savedObject: SimpleSavedObject<BookSavedObjectAttributes> = await savedObjectsClient.get<BookSavedObjectAttributes>(
this.type,
savedObjectId
);
const savedObject: SimpleSavedObject<BookSavedObjectAttributes> =
await savedObjectsClient.get<BookSavedObjectAttributes>(this.type, savedObjectId);
return { ...savedObject.attributes };
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ interface StartServices {

export type ListContainerFactory = EmbeddableFactory<ContainerInput, ContainerOutput>;
export class ListContainerFactoryDefinition
implements EmbeddableFactoryDefinition<ContainerInput, ContainerOutput> {
implements EmbeddableFactoryDefinition<ContainerInput, ContainerOutput>
{
public readonly type = LIST_CONTAINER;
public readonly isContainerType = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export type SimpleEmbeddableInput = EmbeddableInput & {

export type SimpleEmbeddableFactory = EmbeddableFactory;
export class SimpleEmbeddableFactoryDefinition
implements EmbeddableFactoryDefinition<SimpleEmbeddableInput> {
implements EmbeddableFactoryDefinition<SimpleEmbeddableInput>
{
public readonly type = SIMPLE_EMBEDDABLE;

// we need to provide migration function every time we change the interface of our state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export type MultiTaskTodoEmbeddableFactory = EmbeddableFactory<

export class MultiTaskTodoEmbeddableFactoryDefinition
implements
EmbeddableFactoryDefinition<MultiTaskTodoInput, MultiTaskTodoOutput, MultiTaskTodoEmbeddable> {
EmbeddableFactoryDefinition<MultiTaskTodoInput, MultiTaskTodoOutput, MultiTaskTodoEmbeddable>
{
public readonly type = MULTI_TASK_TODO_EMBEDDABLE;

public async isEditable() {
Expand Down
115 changes: 62 additions & 53 deletions examples/embeddable_examples/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,65 +88,74 @@ export class EmbeddableExamplesPlugin
EmbeddableExamplesStart,
EmbeddableExamplesSetupDependencies,
EmbeddableExamplesStartDependencies
> {
>
{
private exampleEmbeddableFactories: Partial<ExampleEmbeddableFactories> = {};

public setup(
core: CoreSetup<EmbeddableExamplesStartDependencies>,
deps: EmbeddableExamplesSetupDependencies
) {
this.exampleEmbeddableFactories.getHelloWorldEmbeddableFactory = deps.embeddable.registerEmbeddableFactory(
HELLO_WORLD_EMBEDDABLE,
new HelloWorldEmbeddableFactoryDefinition()
);

this.exampleEmbeddableFactories.getMigrationsEmbeddableFactory = deps.embeddable.registerEmbeddableFactory(
SIMPLE_EMBEDDABLE,
new SimpleEmbeddableFactoryDefinition()
);

this.exampleEmbeddableFactories.getMultiTaskTodoEmbeddableFactory = deps.embeddable.registerEmbeddableFactory(
MULTI_TASK_TODO_EMBEDDABLE,
new MultiTaskTodoEmbeddableFactoryDefinition()
);

this.exampleEmbeddableFactories.getSearchableListContainerEmbeddableFactory = deps.embeddable.registerEmbeddableFactory(
SEARCHABLE_LIST_CONTAINER,
new SearchableListContainerFactoryDefinition(async () => ({
embeddableServices: (await core.getStartServices())[1].embeddable,
}))
);

this.exampleEmbeddableFactories.getListContainerEmbeddableFactory = deps.embeddable.registerEmbeddableFactory(
LIST_CONTAINER,
new ListContainerFactoryDefinition(async () => ({
embeddableServices: (await core.getStartServices())[1].embeddable,
}))
);

this.exampleEmbeddableFactories.getTodoEmbeddableFactory = deps.embeddable.registerEmbeddableFactory(
TODO_EMBEDDABLE,
new TodoEmbeddableFactoryDefinition(async () => ({
openModal: (await core.getStartServices())[0].overlays.openModal,
}))
);

this.exampleEmbeddableFactories.getTodoRefEmbeddableFactory = deps.embeddable.registerEmbeddableFactory(
TODO_REF_EMBEDDABLE,
new TodoRefEmbeddableFactoryDefinition(async () => ({
savedObjectsClient: (await core.getStartServices())[0].savedObjects.client,
getEmbeddableFactory: (await core.getStartServices())[1].embeddable.getEmbeddableFactory,
}))
);
this.exampleEmbeddableFactories.getBookEmbeddableFactory = deps.embeddable.registerEmbeddableFactory(
BOOK_EMBEDDABLE,
new BookEmbeddableFactoryDefinition(async () => ({
getAttributeService: (await core.getStartServices())[1].embeddable.getAttributeService,
openModal: (await core.getStartServices())[0].overlays.openModal,
savedObjectsClient: (await core.getStartServices())[0].savedObjects.client,
overlays: (await core.getStartServices())[0].overlays,
}))
);
this.exampleEmbeddableFactories.getHelloWorldEmbeddableFactory =
deps.embeddable.registerEmbeddableFactory(
HELLO_WORLD_EMBEDDABLE,
new HelloWorldEmbeddableFactoryDefinition()
);

this.exampleEmbeddableFactories.getMigrationsEmbeddableFactory =
deps.embeddable.registerEmbeddableFactory(
SIMPLE_EMBEDDABLE,
new SimpleEmbeddableFactoryDefinition()
);

this.exampleEmbeddableFactories.getMultiTaskTodoEmbeddableFactory =
deps.embeddable.registerEmbeddableFactory(
MULTI_TASK_TODO_EMBEDDABLE,
new MultiTaskTodoEmbeddableFactoryDefinition()
);

this.exampleEmbeddableFactories.getSearchableListContainerEmbeddableFactory =
deps.embeddable.registerEmbeddableFactory(
SEARCHABLE_LIST_CONTAINER,
new SearchableListContainerFactoryDefinition(async () => ({
embeddableServices: (await core.getStartServices())[1].embeddable,
}))
);

this.exampleEmbeddableFactories.getListContainerEmbeddableFactory =
deps.embeddable.registerEmbeddableFactory(
LIST_CONTAINER,
new ListContainerFactoryDefinition(async () => ({
embeddableServices: (await core.getStartServices())[1].embeddable,
}))
);

this.exampleEmbeddableFactories.getTodoEmbeddableFactory =
deps.embeddable.registerEmbeddableFactory(
TODO_EMBEDDABLE,
new TodoEmbeddableFactoryDefinition(async () => ({
openModal: (await core.getStartServices())[0].overlays.openModal,
}))
);

this.exampleEmbeddableFactories.getTodoRefEmbeddableFactory =
deps.embeddable.registerEmbeddableFactory(
TODO_REF_EMBEDDABLE,
new TodoRefEmbeddableFactoryDefinition(async () => ({
savedObjectsClient: (await core.getStartServices())[0].savedObjects.client,
getEmbeddableFactory: (await core.getStartServices())[1].embeddable.getEmbeddableFactory,
}))
);
this.exampleEmbeddableFactories.getBookEmbeddableFactory =
deps.embeddable.registerEmbeddableFactory(
BOOK_EMBEDDABLE,
new BookEmbeddableFactoryDefinition(async () => ({
getAttributeService: (await core.getStartServices())[1].embeddable.getAttributeService,
openModal: (await core.getStartServices())[0].overlays.openModal,
savedObjectsClient: (await core.getStartServices())[0].savedObjects.client,
overlays: (await core.getStartServices())[0].overlays,
}))
);

const editBookAction = createEditBookAction(async () => ({
getAttributeService: (await core.getStartServices())[1].embeddable.getAttributeService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export type SearchableListContainerFactory = EmbeddableFactory<
ContainerOutput
>;
export class SearchableListContainerFactoryDefinition
implements EmbeddableFactoryDefinition<SearchableContainerInput, ContainerOutput> {
implements EmbeddableFactoryDefinition<SearchableContainerInput, ContainerOutput>
{
public readonly type = SEARCHABLE_LIST_CONTAINER;
public readonly isContainerType = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ interface StartServices {
export type TodoEmbeddableFactory = EmbeddableFactory<TodoInput, TodoOutput, TodoEmbeddable>;

export class TodoEmbeddableFactoryDefinition
implements EmbeddableFactoryDefinition<TodoInput, TodoOutput, TodoEmbeddable> {
implements EmbeddableFactoryDefinition<TodoInput, TodoOutput, TodoEmbeddable>
{
public readonly type = TODO_EMBEDDABLE;

constructor(private getStartServices: () => Promise<StartServices>) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export class TodoRefEmbeddableFactoryDefinition
TodoRefOutput,
TodoRefEmbeddable,
TodoSavedObjectAttributes
> {
>
{
public readonly type = TODO_REF_EMBEDDABLE;
public readonly savedObjectMetaData = {
name: 'Todo',
Expand Down
3 changes: 2 additions & 1 deletion examples/embeddable_examples/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export interface EmbeddableExamplesSetupDependencies {
}

export class EmbeddableExamplesPlugin
implements Plugin<void, void, EmbeddableExamplesSetupDependencies> {
implements Plugin<void, void, EmbeddableExamplesSetupDependencies>
{
public setup(core: CoreSetup, { embeddable }: EmbeddableExamplesSetupDependencies) {
core.savedObjects.registerType(todoSavedObject);
core.savedObjects.registerType(bookSavedObject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ export class IndexPatternFieldEditorPlugin implements Plugin<void, void, SetupDe
links: [
{
label: 'README',
href:
'https://github.com/elastic/kibana/blob/master/src/plugins/index_pattern_field_editor/README.md',
href: 'https://github.com/elastic/kibana/blob/master/src/plugins/index_pattern_field_editor/README.md',
iconType: 'logoGithub',
size: 's',
target: '_blank',
Expand Down
2 changes: 1 addition & 1 deletion examples/locator_examples/public/locator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ export class HelloLocatorDefinition implements LocatorDefinition<HelloLocatorPar
};

public readonly migrations = {
'0.0.2': (migrateV1ToV2 as unknown) as MigrateFunction,
'0.0.2': migrateV1ToV2 as unknown as MigrateFunction,
};
}
3 changes: 2 additions & 1 deletion examples/locator_examples/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export interface LocatorExamplesSetup {
}

export class LocatorExamplesPlugin
implements Plugin<LocatorExamplesSetup, void, SetupDeps, StartDeps> {
implements Plugin<LocatorExamplesSetup, void, SetupDeps, StartDeps>
{
public setup(core: CoreSetup<StartDeps>, plugins: SetupDeps) {
const locator = plugins.share.url.locators.create(new HelloLocatorDefinition());

Expand Down
3 changes: 1 addition & 2 deletions examples/locator_explorer/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ export class LocatorExplorerPlugin implements Plugin<void, void, SetupDeps, Star
links: [
{
label: 'README',
href:
'https://github.com/elastic/kibana/blob/master/src/plugins/share/common/url_service/locators/README.md',
href: 'https://github.com/elastic/kibana/blob/master/src/plugins/share/common/url_service/locators/README.md',
iconType: 'logoGithub',
size: 's',
target: '_blank',
Expand Down
6 changes: 2 additions & 4 deletions examples/routing_example/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,14 @@ function RoutingExplorer({
listItems={[
{
label: 'IRouter API docs',
href:
'https://github.com/elastic/kibana/blob/master/docs/development/core/server/kibana-plugin-core-server.irouter.md',
href: 'https://github.com/elastic/kibana/blob/master/docs/development/core/server/kibana-plugin-core-server.irouter.md',
iconType: 'logoGithub',
target: '_blank',
size: 's',
},
{
label: 'HttpHandler (core.http.fetch) API docs',
href:
'https://github.com/elastic/kibana/blob/master/docs/development/core/public/kibana-plugin-core-public.httphandler.md',
href: 'https://github.com/elastic/kibana/blob/master/docs/development/core/public/kibana-plugin-core-public.httphandler.md',
iconType: 'logoGithub',
target: '_blank',
size: 's',
Expand Down
6 changes: 2 additions & 4 deletions examples/routing_example/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,14 @@ export class RoutingExamplePlugin implements Plugin<{}, {}, SetupDeps, {}> {
links: [
{
label: 'IRouter',
href:
'https://github.com/elastic/kibana/blob/master/docs/development/core/server/kibana-plugin-core-server.irouter.md',
href: 'https://github.com/elastic/kibana/blob/master/docs/development/core/server/kibana-plugin-core-server.irouter.md',
iconType: 'logoGithub',
target: '_blank',
size: 's',
},
{
label: 'HttpHandler (core.http.fetch)',
href:
'https://github.com/elastic/kibana/blob/master/docs/development/core/public/kibana-plugin-core-public.httphandler.md',
href: 'https://github.com/elastic/kibana/blob/master/docs/development/core/public/kibana-plugin-core-public.httphandler.md',
iconType: 'logoGithub',
target: '_blank',
size: 's',
Expand Down
3 changes: 2 additions & 1 deletion examples/search_examples/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export class SearchExamplesPlugin
SearchExamplesPluginStart,
AppPluginSetupDependencies,
AppPluginStartDependencies
> {
>
{
public setup(
core: CoreSetup<AppPluginStartDependencies>,
{ developerExamples, share }: AppPluginSetupDependencies
Expand Down
Loading

0 comments on commit c16480e

Please sign in to comment.