Skip to content

Commit

Permalink
search_indices: scaffold empty plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
TattdCodeMonkey committed Aug 20, 2024
1 parent a0474ae commit d823150
Show file tree
Hide file tree
Showing 21 changed files with 243 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ packages/kbn-search-errors @elastic/kibana-data-discovery
examples/search_examples @elastic/kibana-data-discovery
x-pack/plugins/search_homepage @elastic/search-kibana
packages/kbn-search-index-documents @elastic/search-kibana
x-pack/plugins/search_indices @elastic/search-kibana
x-pack/plugins/search_inference_endpoints @elastic/search-kibana
x-pack/plugins/search_notebooks @elastic/search-kibana
x-pack/plugins/search_playground @elastic/search-kibana
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,10 @@ It uses Chromium and Puppeteer underneath to run the browser in headless mode.
|The Search Homepage is a shared homepage for elasticsearch users.
|{kib-repo}blob/{branch}/x-pack/plugins/search_indices/README.mdx[searchIndices]
|The Search Indices plugin is a shared set of pages for elasticsearch users across stack and serverless search solutions.
|{kib-repo}blob/{branch}/x-pack/plugins/search_inference_endpoints/README.md[searchInferenceEndpoints]
|The Inference Endpoints is a tool used to manage inference endpoints
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@
"@kbn/search-examples-plugin": "link:examples/search_examples",
"@kbn/search-homepage": "link:x-pack/plugins/search_homepage",
"@kbn/search-index-documents": "link:packages/kbn-search-index-documents",
"@kbn/search-indices": "link:x-pack/plugins/search_indices",
"@kbn/search-inference-endpoints": "link:x-pack/plugins/search_inference_endpoints",
"@kbn/search-notebooks": "link:x-pack/plugins/search_notebooks",
"@kbn/search-playground": "link:x-pack/plugins/search_playground",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ pageLoadAssetSize:
screenshotting: 22870
searchConnectors: 30000
searchHomepage: 19831
searchIndices: 20519
searchInferenceEndpoints: 20470
searchNotebooks: 18942
searchPlayground: 19325
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,8 @@
"@kbn/search-homepage/*": ["x-pack/plugins/search_homepage/*"],
"@kbn/search-index-documents": ["packages/kbn-search-index-documents"],
"@kbn/search-index-documents/*": ["packages/kbn-search-index-documents/*"],
"@kbn/search-indices": ["x-pack/plugins/search_indices"],
"@kbn/search-indices/*": ["x-pack/plugins/search_indices/*"],
"@kbn/search-inference-endpoints": ["x-pack/plugins/search_inference_endpoints"],
"@kbn/search-inference-endpoints/*": ["x-pack/plugins/search_inference_endpoints/*"],
"@kbn/search-notebooks": ["x-pack/plugins/search_notebooks"],
Expand Down
1 change: 1 addition & 0 deletions x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"xpack.runtimeFields": "plugins/runtime_fields",
"xpack.screenshotting": "plugins/screenshotting",
"xpack.searchHomepage": "plugins/search_homepage",
"xpack.searchIndices": "plugins/search_indices",
"xpack.searchNotebooks": "plugins/search_notebooks",
"xpack.searchPlayground": "plugins/search_playground",
"xpack.searchInferenceEndpoints": "plugins/search_inference_endpoints",
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/search_indices/README.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Search Indices

The Search Indices plugin is a shared set of pages for elasticsearch users across stack and serverless search solutions.
9 changes: 9 additions & 0 deletions x-pack/plugins/search_indices/common/index.ts
Original file line number Diff line number Diff line change
@@ -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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export const PLUGIN_ID = 'searchIndices';
export const PLUGIN_NAME = 'searchIndices';
15 changes: 15 additions & 0 deletions x-pack/plugins/search_indices/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../../..',
roots: ['<rootDir>/x-pack/plugins/search_indices'],
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/search_indices',
coverageReporters: ['text', 'html'],
collectCoverageFrom: ['<rootDir>/x-pack/plugins/search_indices/{public,server}/**/*.{ts,tsx}'],
};
23 changes: 23 additions & 0 deletions x-pack/plugins/search_indices/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"type": "plugin",
"id": "@kbn/search-indices",
"owner": "@elastic/search-kibana",
"plugin": {
"id": "searchIndices",
"server": true,
"browser": true,
"configPath": [
"xpack",
"searchIndices"
],
"requiredPlugins": [
"share",
],
"optionalPlugins": [
"cloud",
"console",
"usageCollection",
],
"requiredBundles": []
}
}
15 changes: 15 additions & 0 deletions x-pack/plugins/search_indices/public/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { SearchIndicesPlugin } from './plugin';

// This exports static code and TypeScript types,
// as well as, Kibana Platform `plugin()` initializer.
export function plugin() {
return new SearchIndicesPlugin();
}
export type { SearchIndicesPluginSetup, SearchIndicesPluginStart } from './types';
23 changes: 23 additions & 0 deletions x-pack/plugins/search_indices/public/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/public';
import type { SearchIndicesPluginSetup, SearchIndicesPluginStart } from './types';

export class SearchIndicesPlugin
implements Plugin<SearchIndicesPluginSetup, SearchIndicesPluginStart>
{
public setup(core: CoreSetup): SearchIndicesPluginSetup {
return {};
}

public start(core: CoreStart): SearchIndicesPluginStart {
return {};
}

public stop() {}
}
17 changes: 17 additions & 0 deletions x-pack/plugins/search_indices/public/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import type { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public';

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface SearchIndicesPluginSetup {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface SearchIndicesPluginStart {}

export interface AppPluginStartDependencies {
navigation: NavigationPublicPluginStart;
}
19 changes: 19 additions & 0 deletions x-pack/plugins/search_indices/server/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { schema, TypeOf } from '@kbn/config-schema';
import { PluginConfigDescriptor } from '@kbn/core/server';

const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: false }),
});

export type SearchIndicesConfig = TypeOf<typeof configSchema>;

export const config: PluginConfigDescriptor<SearchIndicesConfig> = {
schema: configSchema,
};
17 changes: 17 additions & 0 deletions x-pack/plugins/search_indices/server/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import type { PluginInitializerContext } from '@kbn/core/server';

export { config } from './config';

export async function plugin(initializerContext: PluginInitializerContext) {
const { SearchIndicesPlugin } = await import('./plugin');
return new SearchIndicesPlugin(initializerContext);
}

export type { SearchIndicesPluginSetup, SearchIndicesPluginStart } from './types';
45 changes: 45 additions & 0 deletions x-pack/plugins/search_indices/server/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import type {
PluginInitializerContext,
CoreSetup,
CoreStart,
Plugin,
Logger,
} from '@kbn/core/server';

import type { SearchIndicesPluginSetup, SearchIndicesPluginStart } from './types';
import { defineRoutes } from './routes';

export class SearchIndicesPlugin
implements Plugin<SearchIndicesPluginSetup, SearchIndicesPluginStart>
{
private readonly logger: Logger;

constructor(initializerContext: PluginInitializerContext) {
this.logger = initializerContext.logger.get();
}

public setup(core: CoreSetup) {
this.logger.debug('searchIndices: Setup');
this.logger.info('searchIndices test');
const router = core.http.createRouter();

// Register server side APIs
defineRoutes(router);

return {};
}

public start(core: CoreStart) {
this.logger.debug('searchIndices: Started');
return {};
}

public stop() {}
}
10 changes: 10 additions & 0 deletions x-pack/plugins/search_indices/server/routes/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import type { IRouter } from '@kbn/core/server';

export function defineRoutes(router: IRouter) {}
11 changes: 11 additions & 0 deletions x-pack/plugins/search_indices/server/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* 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; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface SearchIndicesPluginSetup {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface SearchIndicesPluginStart {}
21 changes: 21 additions & 0 deletions x-pack/plugins/search_indices/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types"
},
"include": [
"__mocks__/**/*",
"common/**/*",
"public/**/*",
"server/**/*",
"../../../typings/**/*"
],
"kbn_references": [
"@kbn/core",
"@kbn/navigation-plugin",
"@kbn/config-schema",
],
"exclude": [
"target/**/*",
]
}
1 change: 1 addition & 0 deletions x-pack/plugins/serverless_search/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"indexManagement",
"searchConnectors",
"searchHomepage",
"searchIndices",
"searchInferenceEndpoints",
"usageCollection"
],
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6219,6 +6219,10 @@
version "0.0.0"
uid ""

"@kbn/search-indices@link:x-pack/plugins/search_indices":
version "0.0.0"
uid ""

"@kbn/search-inference-endpoints@link:x-pack/plugins/search_inference_endpoints":
version "0.0.0"
uid ""
Expand Down

0 comments on commit d823150

Please sign in to comment.