mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
IDM: Migrate core server-side core_app to package (#144075)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: spalger <spencer@elastic.co>
This commit is contained in:
parent
57dce56bba
commit
0ba81e12d4
98 changed files with 4679 additions and 29 deletions
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
|
@ -708,6 +708,7 @@ packages/core/application/core-application-browser-mocks @elastic/kibana-core
|
|||
packages/core/application/core-application-common @elastic/kibana-core
|
||||
packages/core/apps/core-apps-browser-internal @elastic/kibana-core
|
||||
packages/core/apps/core-apps-browser-mocks @elastic/kibana-core
|
||||
packages/core/apps/core-apps-server-internal @elastic/kibana-core
|
||||
packages/core/base/core-base-browser-internal @elastic/kibana-core
|
||||
packages/core/base/core-base-browser-mocks @elastic/kibana-core
|
||||
packages/core/base/core-base-common @elastic/kibana-core
|
||||
|
|
|
@ -161,6 +161,7 @@
|
|||
"@kbn/core-application-common": "link:bazel-bin/packages/core/application/core-application-common",
|
||||
"@kbn/core-apps-browser-internal": "link:bazel-bin/packages/core/apps/core-apps-browser-internal",
|
||||
"@kbn/core-apps-browser-mocks": "link:bazel-bin/packages/core/apps/core-apps-browser-mocks",
|
||||
"@kbn/core-apps-server-internal": "link:bazel-bin/packages/core/apps/core-apps-server-internal",
|
||||
"@kbn/core-base-browser-internal": "link:bazel-bin/packages/core/base/core-base-browser-internal",
|
||||
"@kbn/core-base-browser-mocks": "link:bazel-bin/packages/core/base/core-base-browser-mocks",
|
||||
"@kbn/core-base-common": "link:bazel-bin/packages/core/base/core-base-common",
|
||||
|
|
|
@ -28,6 +28,7 @@ filegroup(
|
|||
"//packages/core/application/core-application-common:build",
|
||||
"//packages/core/apps/core-apps-browser-internal:build",
|
||||
"//packages/core/apps/core-apps-browser-mocks:build",
|
||||
"//packages/core/apps/core-apps-server-internal:build",
|
||||
"//packages/core/base/core-base-browser-internal:build",
|
||||
"//packages/core/base/core-base-browser-mocks:build",
|
||||
"//packages/core/base/core-base-common:build",
|
||||
|
@ -386,6 +387,7 @@ filegroup(
|
|||
"//packages/core/application/core-application-common:build_types",
|
||||
"//packages/core/apps/core-apps-browser-internal:build_types",
|
||||
"//packages/core/apps/core-apps-browser-mocks:build_types",
|
||||
"//packages/core/apps/core-apps-server-internal:build_types",
|
||||
"//packages/core/base/core-base-browser-internal:build_types",
|
||||
"//packages/core/base/core-base-browser-mocks:build_types",
|
||||
"//packages/core/base/core-base-common:build_types",
|
||||
|
|
140
packages/core/apps/core-apps-server-internal/BUILD.bazel
Normal file
140
packages/core/apps/core-apps-server-internal/BUILD.bazel
Normal file
|
@ -0,0 +1,140 @@
|
|||
load("@npm//@bazel/typescript:index.bzl", "ts_config")
|
||||
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
|
||||
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
|
||||
|
||||
PKG_DIRNAME = "core-apps-server-internal"
|
||||
PKG_REQUIRE_NAME = "@kbn/core-apps-server-internal"
|
||||
|
||||
SOURCE_FILES = glob(
|
||||
[
|
||||
"**/*.ts",
|
||||
"src/**/*.css",
|
||||
"src/**/*.ttf",
|
||||
"src/**/*.woff",
|
||||
"src/**/*.woff2",
|
||||
"src/**/*.ico",
|
||||
"src/**/*.png",
|
||||
"src/**/*.svg",
|
||||
],
|
||||
exclude = [
|
||||
"**/*.config.js",
|
||||
"**/*.mock.*",
|
||||
"**/*.test.*",
|
||||
"**/*.stories.*",
|
||||
"**/__snapshots__/**",
|
||||
"**/integration_tests/**",
|
||||
"**/mocks/**",
|
||||
"**/scripts/**",
|
||||
"**/storybook/**",
|
||||
"**/test_fixtures/**",
|
||||
"**/test_helpers/**",
|
||||
],
|
||||
)
|
||||
|
||||
SRCS = SOURCE_FILES
|
||||
|
||||
filegroup(
|
||||
name = "srcs",
|
||||
srcs = SRCS,
|
||||
)
|
||||
|
||||
NPM_MODULE_EXTRA_FILES = [
|
||||
"package.json",
|
||||
]
|
||||
|
||||
RUNTIME_DEPS = [
|
||||
"@npm//elastic-apm-node",
|
||||
"@npm//lru-cache",
|
||||
"@npm//mime-types",
|
||||
"//packages/kbn-config",
|
||||
"//packages/kbn-config-schema",
|
||||
"//packages/kbn-utils",
|
||||
"//packages/kbn-logging",
|
||||
"//packages/kbn-ui-shared-deps-npm",
|
||||
"//packages/kbn-ui-shared-deps-src",
|
||||
"//packages/core/base/core-base-server-internal",
|
||||
"//packages/core/lifecycle/core-lifecycle-server-internal",
|
||||
"//packages/core/plugins/core-plugins-base-server-internal",
|
||||
]
|
||||
|
||||
TYPES_DEPS = [
|
||||
"@npm//elastic-apm-node",
|
||||
"@npm//@types/node",
|
||||
"@npm//@types/jest",
|
||||
"@npm//@types/lru-cache",
|
||||
"@npm//@types/mime-types",
|
||||
"//packages/kbn-config:npm_module_types",
|
||||
"//packages/kbn-config-schema:npm_module_types",
|
||||
"//packages/kbn-ui-shared-deps-npm:npm_module_types",
|
||||
"//packages/kbn-ui-shared-deps-src:npm_module_types",
|
||||
"//packages/kbn-utils:npm_module_types",
|
||||
"//packages/kbn-logging:npm_module_types",
|
||||
"//packages/core/base/core-base-server-internal:npm_module_types",
|
||||
"//packages/core/http/core-http-resources-server:npm_module_types",
|
||||
"//packages/core/http/core-http-server:npm_module_types",
|
||||
"//packages/core/lifecycle/core-lifecycle-server-internal:npm_module_types",
|
||||
"//packages/core/plugins/core-plugins-base-server-internal:npm_module_types",
|
||||
]
|
||||
|
||||
jsts_transpiler(
|
||||
name = "target_node",
|
||||
srcs = SRCS,
|
||||
build_pkg_name = package_name(),
|
||||
additional_args = [
|
||||
"--copy-files",
|
||||
"--quiet"
|
||||
],
|
||||
)
|
||||
|
||||
ts_config(
|
||||
name = "tsconfig",
|
||||
src = "tsconfig.json",
|
||||
deps = [
|
||||
"//:tsconfig.base.json",
|
||||
"//:tsconfig.bazel.json",
|
||||
],
|
||||
)
|
||||
|
||||
ts_project(
|
||||
name = "tsc_types",
|
||||
args = ['--pretty'],
|
||||
srcs = SRCS,
|
||||
deps = TYPES_DEPS,
|
||||
declaration = True,
|
||||
emit_declaration_only = True,
|
||||
out_dir = "target_types",
|
||||
tsconfig = ":tsconfig",
|
||||
)
|
||||
|
||||
js_library(
|
||||
name = PKG_DIRNAME,
|
||||
srcs = NPM_MODULE_EXTRA_FILES,
|
||||
deps = RUNTIME_DEPS + [":target_node"],
|
||||
package_name = PKG_REQUIRE_NAME,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
js_library(
|
||||
name = "npm_module_types",
|
||||
srcs = NPM_MODULE_EXTRA_FILES,
|
||||
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"],
|
||||
package_name = PKG_REQUIRE_NAME,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
pkg_npm(
|
||||
name = "npm_module",
|
||||
deps = [":" + PKG_DIRNAME],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "build",
|
||||
srcs = [":npm_module"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
pkg_npm(
|
||||
name = "build_types",
|
||||
deps = [":npm_module_types"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
3
packages/core/apps/core-apps-server-internal/README.md
Normal file
3
packages/core/apps/core-apps-server-internal/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# @kbn/core-apps-server-internal
|
||||
|
||||
This package contains the internal types and implementation of Core's server-side `coreApps` service.
|
15
packages/core/apps/core-apps-server-internal/index.ts
Normal file
15
packages/core/apps/core-apps-server-internal/index.ts
Normal file
|
@ -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 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 { CoreAppsService } from './src';
|
||||
export type {
|
||||
InternalCoreAppsServiceRequestHandlerContext,
|
||||
InternalCoreAppsServiceRouter,
|
||||
} from './src';
|
||||
// only used by integration tests
|
||||
export { FileHashCache, registerRouteForBundle } from './src';
|
|
@ -6,4 +6,8 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
export { CoreApp } from './core_app';
|
||||
module.exports = {
|
||||
preset: '@kbn/test/jest_node',
|
||||
rootDir: '../../../..',
|
||||
roots: ['<rootDir>/packages/core/apps/core-apps-server-internal'],
|
||||
};
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "shared-common",
|
||||
"id": "@kbn/core-apps-server-internal",
|
||||
"owner": "@elastic/kibana-core",
|
||||
"runtimeDeps": [],
|
||||
"typeDeps": [],
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"name": "@kbn/core-apps-server-internal",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"main": "./target_node/index.js",
|
||||
"author": "Kibana Core",
|
||||
"license": "SSPL-1.0 OR Elastic License 2.0",
|
||||
"types": "./target_types/index.d.ts"
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
|
@ -0,0 +1,4 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 180 180">
|
||||
<style>path { fill: #1C1E23; } @media (prefers-color-scheme: dark) { path { fill: #FFFFFF; } }</style>
|
||||
<path d="M180,94.27a35.54,35.54,0,0,0-23.43-33.52A50.82,50.82,0,0,0,65.45,21.17,27,27,0,0,0,23.62,52,35.88,35.88,0,0,0,6.44,106.26a35.5,35.5,0,0,0,17.1,13.07,51.64,51.64,0,0,0-.89,9.7,50.66,50.66,0,0,0,92,29.66,27,27,0,0,0,41.85-30.75A36,36,0,0,0,180,94.27ZM69.69,26.62a44.46,44.46,0,0,1,80.2,34L110.16,95.52l-39.39-18L63.08,61ZM49.77,22.18A21.25,21.25,0,0,1,62.7,26.57l-6,30.78-27-6.4a21.43,21.43,0,0,1,20-28.77ZM7,85.77A30.16,30.16,0,0,1,27.41,57.38L57,64.4,64,79.31,26.11,113.69A29.88,29.88,0,0,1,7,85.77Zm103.53,67.61a44.52,44.52,0,0,1-81.35-25.12,45.54,45.54,0,0,1,.89-8.87L68.75,84.21l39.54,18.09,8.76,16.79Zm19.78,4.44a21,21,0,0,1-12.86-4.44l5.87-30.68,27,6.33a21.49,21.49,0,0,1-10.14,26.32,21.24,21.24,0,0,1-9.84,2.45Zm22.32-35.24-29.69-7L115,100.53l38.84-34.15A29.81,29.81,0,0,1,173,94.25a30.16,30.16,0,0,1-20.45,28.31Z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1,008 B |
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
|
@ -0,0 +1,4 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 180 180">
|
||||
<style>path { fill: #1C1E23; } @media (prefers-color-scheme: dark) { path { fill: #FFFFFF; } }</style>
|
||||
<path d="M11.19,101A30.34,30.34,0,0,1,7,85.75a30.09,30.09,0,0,1,20.5-28.4l29.6,7L64,79.25,40,101h9.9L68.8,83.85,106.23,101h9.11l-.34-.65,38.8-34.1A29.84,29.84,0,0,1,173,94.05a31.07,31.07,0,0,1-.9,7h7.21a35,35,0,0,0,.69-6.85,35.79,35.79,0,0,0-6.4-20.5,34.77,34.77,0,0,0-17-13,52.15,52.15,0,0,0,.9-9.69,51.15,51.15,0,0,0-9.7-30,50.78,50.78,0,0,0-57-18.4,51.44,51.44,0,0,0-25.4,18.6,27,27,0,0,0-16.2-5.7,26.52,26.52,0,0,0-16.3,5.3A27.3,27.3,0,0,0,23,34.86a26.69,26.69,0,0,0,.6,17.2A36.28,36.28,0,0,0,6.5,65.15,35.86,35.86,0,0,0,3.41,101ZM69.7,26.56A43.77,43.77,0,0,1,93.8,9.06a44.51,44.51,0,0,1,56.1,51.49l-39.7,34.9-39.4-18L63.1,61ZM28.6,40.86a20.6,20.6,0,0,1,3.7-9.5,22.21,22.21,0,0,1,7.6-6.7,20.23,20.23,0,0,1,9.9-2.5,20.76,20.76,0,0,1,12.9,4.4l-6,30.79L29.7,51A21.64,21.64,0,0,1,28.6,40.86Z"/><path d="M10,108v72H170V108Zm57.39,46.7a16.26,16.26,0,0,1-6.74,6.9A21.48,21.48,0,0,1,50.18,164H36V124H50.29a21.37,21.37,0,0,1,10.4,2.39,16.29,16.29,0,0,1,6.71,6.87,25.68,25.68,0,0,1,0,21.44ZM103,164H76V124h27v7H84.45v9.53h17.11v7H84.45V157H103Zm29.19,0H121.32l-13.81-40h9.39l9.67,30.39h.37L136.63,124H146Z"/><path d="M49.85,131.25H44.46v25.5h5.37q5.64,0,8.56-3T61.31,144q0-6.66-2.92-9.69C56.44,132.26,53.6,131.25,49.85,131.25Z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.4 KiB |
File diff suppressed because it is too large
Load diff
|
@ -13,7 +13,7 @@ import agent from 'elastic-apm-node';
|
|||
|
||||
import type { RequestHandler } from '@kbn/core-http-server';
|
||||
import { fstat, close } from './fs';
|
||||
import { IFileHashCache } from './file_hash_cache';
|
||||
import type { IFileHashCache } from './file_hash_cache';
|
||||
import { getFileHash } from './file_hash';
|
||||
import { selectCompressedFile } from './select_compressed_file';
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import type { Stats } from 'fs';
|
||||
import { generateFileHash, getFileCacheKey } from './utils';
|
||||
import { IFileHashCache } from './file_hash_cache';
|
||||
import type { IFileHashCache } from './file_hash_cache';
|
||||
|
||||
/**
|
||||
* Get the hash of a file via a file descriptor
|
|
@ -7,3 +7,5 @@
|
|||
*/
|
||||
|
||||
export { registerBundleRoutes } from './register_bundle_routes';
|
||||
export { type IFileHashCache, FileHashCache } from './file_hash_cache';
|
||||
export { registerRouteForBundle } from './bundles_route';
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import { registerRouteForBundleMock } from './register_bundle_routes.test.mocks';
|
||||
|
||||
import { PackageInfo } from '@kbn/config';
|
||||
import type { PackageInfo } from '@kbn/config';
|
||||
import { httpServiceMock } from '@kbn/core-http-server-mocks';
|
||||
import type { InternalPluginInfo, UiPlugins } from '@kbn/core-plugins-base-server-internal';
|
||||
import { registerBundleRoutes } from './register_bundle_routes';
|
|
@ -7,10 +7,10 @@
|
|||
*/
|
||||
|
||||
import { join } from 'path';
|
||||
import { PackageInfo } from '@kbn/config';
|
||||
import type { PackageInfo } from '@kbn/config';
|
||||
import { fromRoot } from '@kbn/utils';
|
||||
import UiSharedDepsNpm from '@kbn/ui-shared-deps-npm';
|
||||
import * as UiSharedDepsSrc from '@kbn/ui-shared-deps-src';
|
||||
import { distDir as UiSharedDepsSrcDistDir } from '@kbn/ui-shared-deps-src';
|
||||
import type { IRouter } from '@kbn/core-http-server';
|
||||
import type { UiPlugins } from '@kbn/core-plugins-base-server-internal';
|
||||
import { FileHashCache } from './file_hash_cache';
|
||||
|
@ -53,7 +53,7 @@ export function registerBundleRoutes({
|
|||
registerRouteForBundle(router, {
|
||||
publicPath: `${serverBasePath}/${buildNum}/bundles/kbn-ui-shared-deps-src/`,
|
||||
routePath: `/${buildNum}/bundles/kbn-ui-shared-deps-src/`,
|
||||
bundlesPath: UiSharedDepsSrc.distDir,
|
||||
bundlesPath: UiSharedDepsSrcDistDir,
|
||||
fileHashCache,
|
||||
isDist,
|
||||
});
|
|
@ -11,11 +11,12 @@ import { registerBundleRoutesMock } from './core_app.test.mocks';
|
|||
import { mockCoreContext } from '@kbn/core-base-server-mocks';
|
||||
import { mockRouter } from '@kbn/core-http-router-server-mocks';
|
||||
import type { UiPlugins } from '@kbn/core-plugins-base-server-internal';
|
||||
import { coreMock, httpServerMock } from '../mocks';
|
||||
import { httpServerMock } from '@kbn/core-http-server-mocks';
|
||||
import { httpResourcesMock } from '@kbn/core-http-resources-server-mocks';
|
||||
import { PluginType } from '@kbn/core-base-common';
|
||||
import { CoreApp } from './core_app';
|
||||
import { RequestHandlerContext } from '..';
|
||||
import type { RequestHandlerContext } from '@kbn/core-http-request-handler-context-server';
|
||||
import { coreInternalLifecycleMock } from '@kbn/core-lifecycle-server-mocks';
|
||||
import { CoreAppsService } from './core_app';
|
||||
|
||||
const emptyPlugins = (): UiPlugins => ({
|
||||
internal: new Map(),
|
||||
|
@ -25,16 +26,17 @@ const emptyPlugins = (): UiPlugins => ({
|
|||
|
||||
describe('CoreApp', () => {
|
||||
let coreContext: ReturnType<typeof mockCoreContext.create>;
|
||||
let coreApp: CoreApp;
|
||||
let internalCorePreboot: ReturnType<typeof coreMock.createInternalPreboot>;
|
||||
let coreApp: CoreAppsService;
|
||||
let internalCorePreboot: ReturnType<typeof coreInternalLifecycleMock.createInternalPreboot>;
|
||||
let prebootHTTPResourcesRegistrar: ReturnType<typeof httpResourcesMock.createRegistrar>;
|
||||
let internalCoreSetup: ReturnType<typeof coreMock.createInternalSetup>;
|
||||
let internalCoreSetup: ReturnType<typeof coreInternalLifecycleMock.createInternalSetup>;
|
||||
let httpResourcesRegistrar: ReturnType<typeof httpResourcesMock.createRegistrar>;
|
||||
|
||||
beforeEach(() => {
|
||||
coreContext = mockCoreContext.create();
|
||||
|
||||
internalCorePreboot = coreMock.createInternalPreboot();
|
||||
internalCorePreboot = coreInternalLifecycleMock.createInternalPreboot();
|
||||
|
||||
internalCorePreboot.http.registerRoutes.mockImplementation((path, callback) =>
|
||||
callback(mockRouter.create())
|
||||
);
|
||||
|
@ -43,10 +45,11 @@ describe('CoreApp', () => {
|
|||
prebootHTTPResourcesRegistrar
|
||||
);
|
||||
|
||||
internalCoreSetup = coreMock.createInternalSetup();
|
||||
internalCoreSetup = coreInternalLifecycleMock.createInternalSetup();
|
||||
|
||||
httpResourcesRegistrar = httpResourcesMock.createRegistrar();
|
||||
internalCoreSetup.httpResources.createRegistrar.mockReturnValue(httpResourcesRegistrar);
|
||||
coreApp = new CoreApp(coreContext);
|
||||
coreApp = new CoreAppsService(coreContext);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
|
@ -22,9 +22,9 @@ import type {
|
|||
} from '@kbn/core-http-server';
|
||||
import type { UiPlugins } from '@kbn/core-plugins-base-server-internal';
|
||||
import type { HttpResources, HttpResourcesServiceToolkit } from '@kbn/core-http-resources-server';
|
||||
import { InternalCorePreboot, InternalCoreSetup } from '@kbn/core-lifecycle-server-internal';
|
||||
import type { InternalCorePreboot, InternalCoreSetup } from '@kbn/core-lifecycle-server-internal';
|
||||
import { registerBundleRoutes } from './bundle_routes';
|
||||
import type { InternalCoreAppRequestHandlerContext } from './internal_types';
|
||||
import type { InternalCoreAppsServiceRequestHandlerContext } from './internal_types';
|
||||
|
||||
/** @internal */
|
||||
interface CommonRoutesParams {
|
||||
|
@ -39,7 +39,7 @@ interface CommonRoutesParams {
|
|||
}
|
||||
|
||||
/** @internal */
|
||||
export class CoreApp {
|
||||
export class CoreAppsService {
|
||||
private readonly logger: Logger;
|
||||
private readonly env: Env;
|
||||
|
||||
|
@ -91,7 +91,7 @@ export class CoreApp {
|
|||
|
||||
private registerDefaultRoutes(coreSetup: InternalCoreSetup, uiPlugins: UiPlugins) {
|
||||
const httpSetup = coreSetup.http;
|
||||
const router = httpSetup.createRouter<InternalCoreAppRequestHandlerContext>('');
|
||||
const router = httpSetup.createRouter<InternalCoreAppsServiceRequestHandlerContext>('');
|
||||
const resources = coreSetup.httpResources.createRegistrar(router);
|
||||
|
||||
router.get({ path: '/', validate: false }, async (context, req, res) => {
|
15
packages/core/apps/core-apps-server-internal/src/index.ts
Normal file
15
packages/core/apps/core-apps-server-internal/src/index.ts
Normal file
|
@ -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 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 { CoreAppsService } from './core_app';
|
||||
export type {
|
||||
InternalCoreAppsServiceRequestHandlerContext,
|
||||
InternalCoreAppsServiceRouter,
|
||||
} from './internal_types';
|
||||
// only used by integration tests
|
||||
export { registerRouteForBundle, FileHashCache } from './bundle_routes';
|
|
@ -13,15 +13,15 @@ import type { UiSettingsRequestHandlerContext } from '@kbn/core-ui-settings-serv
|
|||
* Request handler context used by core's coreApp routes.
|
||||
* @internal
|
||||
*/
|
||||
export interface InternalCoreAppRequestHandlerContext extends RequestHandlerContextBase {
|
||||
export interface InternalCoreAppsServiceRequestHandlerContext extends RequestHandlerContextBase {
|
||||
core: Promise<{
|
||||
uiSettings: UiSettingsRequestHandlerContext;
|
||||
}>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Router bound to the {@link InternalCoreAppRequestHandlerContext}.
|
||||
* Router bound to the {@link InternalCoreAppsServiceRequestHandlerContext}.
|
||||
* Used by core's coreApp routes.
|
||||
* @internal
|
||||
*/
|
||||
export type InternalCoreAppRouter = IRouter<InternalCoreAppRequestHandlerContext>;
|
||||
export type InternalCoreAppsServiceRouter = IRouter<InternalCoreAppsServiceRequestHandlerContext>;
|
16
packages/core/apps/core-apps-server-internal/tsconfig.json
Normal file
16
packages/core/apps/core-apps-server-internal/tsconfig.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"extends": "../../../../tsconfig.bazel.json",
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"outDir": "target_types",
|
||||
"stripInternal": false,
|
||||
"types": [
|
||||
"jest",
|
||||
"node"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"**/*.ts",
|
||||
]
|
||||
}
|
|
@ -15,8 +15,7 @@ import { contextServiceMock } from '@kbn/core-http-context-server-mocks';
|
|||
import type { IRouter } from '@kbn/core-http-server';
|
||||
import { HttpService } from '@kbn/core-http-server-internal';
|
||||
import { createHttpServer } from '@kbn/core-http-server-mocks';
|
||||
import { registerRouteForBundle } from '../../core_app/bundle_routes/bundles_route';
|
||||
import { FileHashCache } from '../../core_app/bundle_routes/file_hash_cache';
|
||||
import { registerRouteForBundle, FileHashCache } from '@kbn/core-apps-server-internal';
|
||||
|
||||
const buildNum = 1234;
|
||||
const fooPluginFixture = resolve(__dirname, './__fixtures__/plugin/foo');
|
||||
|
|
|
@ -79,7 +79,7 @@ import {
|
|||
PluginsService,
|
||||
config as pluginsConfig,
|
||||
} from '@kbn/core-plugins-server-internal';
|
||||
import { CoreApp } from './core_app';
|
||||
import { CoreAppsService } from '@kbn/core-apps-server-internal';
|
||||
import { elasticApmConfig } from './root/elastic_config';
|
||||
|
||||
const coreId = Symbol('core');
|
||||
|
@ -118,7 +118,7 @@ export class Server {
|
|||
private readonly httpResources: HttpResourcesService;
|
||||
private readonly status: StatusService;
|
||||
private readonly logging: LoggingService;
|
||||
private readonly coreApp: CoreApp;
|
||||
private readonly coreApp: CoreAppsService;
|
||||
private readonly coreUsageData: CoreUsageDataService;
|
||||
private readonly i18n: I18nService;
|
||||
private readonly deprecations: DeprecationsService;
|
||||
|
@ -161,7 +161,7 @@ export class Server {
|
|||
this.node = new NodeService(core);
|
||||
this.metrics = new MetricsService(core);
|
||||
this.status = new StatusService(core);
|
||||
this.coreApp = new CoreApp(core);
|
||||
this.coreApp = new CoreAppsService(core);
|
||||
this.httpResources = new HttpResourcesService(core);
|
||||
this.logging = new LoggingService(core);
|
||||
this.coreUsageData = new CoreUsageDataService(core);
|
||||
|
|
|
@ -31,7 +31,7 @@ export const IGNORE_FILE_GLOBS = [
|
|||
'**/.*',
|
||||
'**/__mocks__/**/*',
|
||||
'x-pack/docs/**/*',
|
||||
'src/core/server/core_app/assets/fonts/**/*',
|
||||
'packages/core/apps/core-apps-server-internal/src/assets/fonts/**/*',
|
||||
'src/dev/code_coverage/ingest_coverage/integration_tests/mocks/**/*',
|
||||
'packages/kbn-utility-types/test-d/**/*',
|
||||
'**/Jenkinsfile*',
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
"@kbn/core-apps-browser-internal/*": ["packages/core/apps/core-apps-browser-internal/*"],
|
||||
"@kbn/core-apps-browser-mocks": ["packages/core/apps/core-apps-browser-mocks"],
|
||||
"@kbn/core-apps-browser-mocks/*": ["packages/core/apps/core-apps-browser-mocks/*"],
|
||||
"@kbn/core-apps-server-internal": ["packages/core/apps/core-apps-server-internal"],
|
||||
"@kbn/core-apps-server-internal/*": ["packages/core/apps/core-apps-server-internal/*"],
|
||||
"@kbn/core-base-browser-internal": ["packages/core/base/core-base-browser-internal"],
|
||||
"@kbn/core-base-browser-internal/*": ["packages/core/base/core-base-browser-internal/*"],
|
||||
"@kbn/core-base-browser-mocks": ["packages/core/base/core-base-browser-mocks"],
|
||||
|
|
|
@ -2788,6 +2788,10 @@
|
|||
version "0.0.0"
|
||||
uid ""
|
||||
|
||||
"@kbn/core-apps-server-internal@link:bazel-bin/packages/core/apps/core-apps-server-internal":
|
||||
version "0.0.0"
|
||||
uid ""
|
||||
|
||||
"@kbn/core-base-browser-internal@link:bazel-bin/packages/core/base/core-base-browser-internal":
|
||||
version "0.0.0"
|
||||
uid ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue