Migrate client-side coreApp
domain to packages (#140242)
* move sass-loader related files to src/core/public/styles * create empty packages * Move all the things * fix optimizer integration tests * add kibana.jsonc files * fix bazel build * [CI] Auto-commit changed files from 'node scripts/generate codeowners' * fix usages * fix mocked service name Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2
.github/CODEOWNERS
vendored
|
@ -658,6 +658,8 @@ packages/core/application/core-application-browser @elastic/kibana-core
|
|||
packages/core/application/core-application-browser-internal @elastic/kibana-core
|
||||
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/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
|
||||
|
|
|
@ -156,6 +156,8 @@
|
|||
"@kbn/core-application-browser-internal": "link:bazel-bin/packages/core/application/core-application-browser-internal",
|
||||
"@kbn/core-application-browser-mocks": "link:bazel-bin/packages/core/application/core-application-browser-mocks",
|
||||
"@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-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",
|
||||
|
@ -844,6 +846,8 @@
|
|||
"@types/kbn__core-application-browser-internal": "link:bazel-bin/packages/core/application/core-application-browser-internal/npm_module_types",
|
||||
"@types/kbn__core-application-browser-mocks": "link:bazel-bin/packages/core/application/core-application-browser-mocks/npm_module_types",
|
||||
"@types/kbn__core-application-common": "link:bazel-bin/packages/core/application/core-application-common/npm_module_types",
|
||||
"@types/kbn__core-apps-browser-internal": "link:bazel-bin/packages/core/apps/core-apps-browser-internal/npm_module_types",
|
||||
"@types/kbn__core-apps-browser-mocks": "link:bazel-bin/packages/core/apps/core-apps-browser-mocks/npm_module_types",
|
||||
"@types/kbn__core-base-browser": "link:bazel-bin/packages/core/base/core-base-browser/npm_module_types",
|
||||
"@types/kbn__core-base-browser-internal": "link:bazel-bin/packages/core/base/core-base-browser-internal/npm_module_types",
|
||||
"@types/kbn__core-base-browser-mocks": "link:bazel-bin/packages/core/base/core-base-browser-mocks/npm_module_types",
|
||||
|
|
|
@ -24,6 +24,8 @@ filegroup(
|
|||
"//packages/core/application/core-application-browser-internal:build",
|
||||
"//packages/core/application/core-application-browser-mocks:build",
|
||||
"//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/base/core-base-browser-internal:build",
|
||||
"//packages/core/base/core-base-browser-mocks:build",
|
||||
"//packages/core/base/core-base-common:build",
|
||||
|
@ -332,6 +334,8 @@ filegroup(
|
|||
"//packages/core/application/core-application-browser-internal:build_types",
|
||||
"//packages/core/application/core-application-browser-mocks:build_types",
|
||||
"//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/base/core-base-browser-internal:build_types",
|
||||
"//packages/core/base/core-base-browser-mocks:build_types",
|
||||
"//packages/core/base/core-base-common:build_types",
|
||||
|
|
137
packages/core/apps/core-apps-browser-internal/BUILD.bazel
Normal file
|
@ -0,0 +1,137 @@
|
|||
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-browser-internal"
|
||||
PKG_REQUIRE_NAME = "@kbn/core-apps-browser-internal"
|
||||
|
||||
SOURCE_FILES = glob(
|
||||
[
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
],
|
||||
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//react",
|
||||
"@npm//react-dom",
|
||||
"@npm//history",
|
||||
"@npm//@elastic/eui",
|
||||
"//packages/kbn-i18n",
|
||||
"//packages/kbn-i18n-react",
|
||||
"//packages/core/mount-utils/core-mount-utils-browser-internal",
|
||||
]
|
||||
|
||||
TYPES_DEPS = [
|
||||
"@npm//@types/node",
|
||||
"@npm//@types/jest",
|
||||
"@npm//@types/react",
|
||||
"@npm//@types/react-dom",
|
||||
"@npm//@types/history",
|
||||
"@npm//@elastic/eui",
|
||||
"//packages/kbn-i18n:npm_module_types",
|
||||
"//packages/kbn-i18n-react:npm_module_types",
|
||||
"//packages/core/base/core-base-browser-internal:npm_module_types",
|
||||
"//packages/core/injected-metadata/core-injected-metadata-browser-internal:npm_module_types",
|
||||
"//packages/core/doc-links/core-doc-links-browser:npm_module_types",
|
||||
"//packages/core/http/core-http-browser:npm_module_types",
|
||||
"//packages/core/ui-settings/core-ui-settings-browser:npm_module_types",
|
||||
"//packages/core/notifications/core-notifications-browser:npm_module_types",
|
||||
"//packages/core/application/core-application-browser:npm_module_types",
|
||||
"//packages/core/application/core-application-browser-internal:npm_module_types",
|
||||
"//packages/core/theme/core-theme-browser-internal:npm_module_types",
|
||||
"//packages/core/mount-utils/core-mount-utils-browser-internal:npm_module_types",
|
||||
"//packages/core/status/core-status-common-internal:npm_module_types",
|
||||
]
|
||||
|
||||
jsts_transpiler(
|
||||
name = "target_node",
|
||||
srcs = SRCS,
|
||||
build_pkg_name = package_name(),
|
||||
)
|
||||
|
||||
jsts_transpiler(
|
||||
name = "target_web",
|
||||
srcs = SRCS,
|
||||
build_pkg_name = package_name(),
|
||||
web = True,
|
||||
)
|
||||
|
||||
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,
|
||||
declaration_map = 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", ":target_web"],
|
||||
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_types(
|
||||
name = "npm_module_types",
|
||||
srcs = SRCS,
|
||||
deps = [":tsc_types"],
|
||||
package_name = PKG_REQUIRE_NAME,
|
||||
tsconfig = ":tsconfig",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "build_types",
|
||||
srcs = [":npm_module_types"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
3
packages/core/apps/core-apps-browser-internal/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# @kbn/core-apps-browser-internal
|
||||
|
||||
This package contains the internal types and implementation of Core's `coreApps` service.
|
10
packages/core/apps/core-apps-browser-internal/index.ts
Normal file
|
@ -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 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, URL_MAX_LENGTH } from './src';
|
||||
export type { CoreAppsServiceSetupDeps, CoreAppsServiceStartDeps } from './src';
|
13
packages/core/apps/core-apps-browser-internal/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/core/apps/core-apps-browser-internal'],
|
||||
};
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "shared-common",
|
||||
"id": "@kbn/core-apps-browser-internal",
|
||||
"owner": "@elastic/kibana-core",
|
||||
"runtimeDeps": [],
|
||||
"typeDeps": []
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"name": "@kbn/core-apps-browser-internal",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"main": "./target_node/index.js",
|
||||
"browser": "./target_web/index.js",
|
||||
"author": "Kibana Core",
|
||||
"license": "SSPL-1.0 OR Elastic License 2.0"
|
||||
}
|
|
@ -25,14 +25,14 @@ import {
|
|||
} from './errors';
|
||||
import { renderApp as renderStatusApp } from './status';
|
||||
|
||||
export interface SetupDeps {
|
||||
export interface CoreAppsServiceSetupDeps {
|
||||
application: InternalApplicationSetup;
|
||||
http: HttpSetup;
|
||||
injectedMetadata: InternalInjectedMetadataSetup;
|
||||
notifications: NotificationsSetup;
|
||||
}
|
||||
|
||||
export interface StartDeps {
|
||||
export interface CoreAppsServiceStartDeps {
|
||||
application: InternalApplicationStart;
|
||||
docLinks: DocLinksStart;
|
||||
http: HttpStart;
|
||||
|
@ -40,12 +40,12 @@ export interface StartDeps {
|
|||
uiSettings: IUiSettingsClient;
|
||||
}
|
||||
|
||||
export class CoreApp {
|
||||
export class CoreAppsService {
|
||||
private stopHistoryListening?: UnregisterCallback;
|
||||
|
||||
constructor(private readonly coreContext: CoreContext) {}
|
||||
|
||||
public setup({ application, http, injectedMetadata, notifications }: SetupDeps) {
|
||||
public setup({ application, http, injectedMetadata, notifications }: CoreAppsServiceSetupDeps) {
|
||||
application.register(this.coreContext.coreId, {
|
||||
id: 'error',
|
||||
title: 'App Error',
|
||||
|
@ -73,7 +73,13 @@ export class CoreApp {
|
|||
});
|
||||
}
|
||||
|
||||
public start({ application, docLinks, http, notifications, uiSettings }: StartDeps) {
|
||||
public start({
|
||||
application,
|
||||
docLinks,
|
||||
http,
|
||||
notifications,
|
||||
uiSettings,
|
||||
}: CoreAppsServiceStartDeps) {
|
||||
if (!application.history) {
|
||||
return;
|
||||
}
|
|
@ -12,8 +12,9 @@ import { i18n } from '@kbn/i18n';
|
|||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
import type { DocLinksStart } from '@kbn/core-doc-links-browser';
|
||||
import type { HttpStart } from '@kbn/core-http-browser';
|
||||
import type { NotificationsStart } from '@kbn/core-notifications-browser';
|
||||
import { mountReactNode } from '@kbn/core-mount-utils-browser-internal';
|
||||
import type { HttpStart, NotificationsStart } from '../..';
|
||||
|
||||
/** Only exported for tests */
|
||||
export const MISSING_CONFIG_STORAGE_KEY = `core.warnings.publicBaseUrlMissingDismissed`;
|
11
packages/core/apps/core-apps-browser-internal/src/index.ts
Normal file
|
@ -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 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 { URL_MAX_LENGTH } from './errors';
|
||||
export type { CoreAppsServiceSetupDeps, CoreAppsServiceStartDeps } from './core_app';
|
|
@ -14,7 +14,7 @@ import type {
|
|||
StatusResponse,
|
||||
StatusInfoServiceStatus as ServiceStatus,
|
||||
} from '@kbn/core-status-common-internal';
|
||||
import type { DataType } from '.';
|
||||
import type { DataType } from './format_number';
|
||||
|
||||
interface MetricMeta {
|
||||
title: string;
|
19
packages/core/apps/core-apps-browser-internal/tsconfig.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"extends": "../../../../tsconfig.bazel.json",
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"outDir": "target_types",
|
||||
"stripInternal": false,
|
||||
"types": [
|
||||
"jest",
|
||||
"node",
|
||||
"react"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
]
|
||||
}
|
115
packages/core/apps/core-apps-browser-mocks/BUILD.bazel
Normal file
|
@ -0,0 +1,115 @@
|
|||
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-browser-mocks"
|
||||
PKG_REQUIRE_NAME = "@kbn/core-apps-browser-mocks"
|
||||
|
||||
SOURCE_FILES = glob(
|
||||
[
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
],
|
||||
exclude = [
|
||||
"**/*.config.js",
|
||||
"**/*.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//react"
|
||||
]
|
||||
|
||||
TYPES_DEPS = [
|
||||
"@npm//@types/node",
|
||||
"@npm//@types/jest",
|
||||
"//packages/kbn-utility-types:npm_module_types",
|
||||
"//packages/core/apps/core-apps-browser-internal:npm_module_types",
|
||||
]
|
||||
|
||||
jsts_transpiler(
|
||||
name = "target_node",
|
||||
srcs = SRCS,
|
||||
build_pkg_name = package_name(),
|
||||
)
|
||||
|
||||
jsts_transpiler(
|
||||
name = "target_web",
|
||||
srcs = SRCS,
|
||||
build_pkg_name = package_name(),
|
||||
web = True,
|
||||
)
|
||||
|
||||
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,
|
||||
declaration_map = 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", ":target_web"],
|
||||
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_types(
|
||||
name = "npm_module_types",
|
||||
srcs = SRCS,
|
||||
deps = [":tsc_types"],
|
||||
package_name = PKG_REQUIRE_NAME,
|
||||
tsconfig = ":tsconfig",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "build_types",
|
||||
srcs = [":npm_module_types"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
4
packages/core/apps/core-apps-browser-mocks/README.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
# @kbn/core-apps-browser-mocks
|
||||
|
||||
This package contains mocks for Core's browser-side `coreApps` service.
|
||||
- `coreAppsMock`
|
|
@ -6,5 +6,4 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
export { CoreApp } from './core_app';
|
||||
export { URL_MAX_LENGTH } from './errors';
|
||||
export { coreAppsMock } from './src';
|
13
packages/core/apps/core-apps-browser-mocks/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/core/apps/core-apps-browser-mocks'],
|
||||
};
|
7
packages/core/apps/core-apps-browser-mocks/kibana.jsonc
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "shared-common",
|
||||
"id": "@kbn/core-apps-browser-mocks",
|
||||
"owner": "@elastic/kibana-core",
|
||||
"runtimeDeps": [],
|
||||
"typeDeps": []
|
||||
}
|
9
packages/core/apps/core-apps-browser-mocks/package.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"name": "@kbn/core-apps-browser-mocks",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"main": "./target_node/index.js",
|
||||
"browser": "./target_web/index.js",
|
||||
"author": "Kibana Core",
|
||||
"license": "SSPL-1.0 OR Elastic License 2.0"
|
||||
}
|
|
@ -7,15 +7,16 @@
|
|||
*/
|
||||
|
||||
import type { PublicMethodsOf } from '@kbn/utility-types';
|
||||
import { CoreApp } from './core_app';
|
||||
import type { CoreAppsService } from '@kbn/core-apps-browser-internal';
|
||||
|
||||
type CoreAppContract = PublicMethodsOf<CoreAppsService>;
|
||||
|
||||
type CoreAppContract = PublicMethodsOf<CoreApp>;
|
||||
const createMock = (): jest.Mocked<CoreAppContract> => ({
|
||||
setup: jest.fn(),
|
||||
start: jest.fn(),
|
||||
stop: jest.fn(),
|
||||
});
|
||||
|
||||
export const coreAppMock = {
|
||||
export const coreAppsMock = {
|
||||
create: createMock,
|
||||
};
|
9
packages/core/apps/core-apps-browser-mocks/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 { coreAppsMock } from './core_app.mock';
|
18
packages/core/apps/core-apps-browser-mocks/tsconfig.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"extends": "../../../../tsconfig.bazel.json",
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"outDir": "target_types",
|
||||
"stripInternal": false,
|
||||
"types": [
|
||||
"jest",
|
||||
"node"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
]
|
||||
}
|
|
@ -164,8 +164,8 @@ it('builds expected bundles, saves bundle counts to metadata', async () => {
|
|||
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/legacy/_other_styles.scss,
|
||||
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/legacy/styles.scss,
|
||||
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/lib.ts,
|
||||
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v8dark.scss,
|
||||
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v8light.scss,
|
||||
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/styles/core_app/_globals_v8dark.scss,
|
||||
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/styles/core_app/_globals_v8light.scss,
|
||||
<absolute path>/packages/kbn-optimizer/src/worker/entry_point_creator.ts,
|
||||
]
|
||||
`);
|
||||
|
|
|
@ -188,7 +188,7 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker:
|
|||
loaderContext,
|
||||
Path.resolve(
|
||||
worker.repoRoot,
|
||||
`src/core/public/core_app/styles/_globals_${theme}.scss`
|
||||
`src/core/public/styles/core_app/_globals_${theme}.scss`
|
||||
)
|
||||
)};\n${content}`;
|
||||
},
|
||||
|
@ -246,7 +246,10 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker:
|
|||
extensions: ['.js', '.ts', '.tsx', '.json'],
|
||||
mainFields: ['browser', 'main'],
|
||||
alias: {
|
||||
core_app_image_assets: Path.resolve(worker.repoRoot, 'src/core/public/core_app/images'),
|
||||
core_app_image_assets: Path.resolve(
|
||||
worker.repoRoot,
|
||||
'src/core/public/styles/core_app/images'
|
||||
),
|
||||
vega: Path.resolve(worker.repoRoot, 'node_modules/vega/build-es5/vega.js'),
|
||||
},
|
||||
symlinks: false,
|
||||
|
|
|
@ -21,7 +21,7 @@ import { pluginsServiceMock } from './plugins/plugins_service.mock';
|
|||
import { uiSettingsServiceMock } from '@kbn/core-ui-settings-browser-mocks';
|
||||
import { renderingServiceMock } from '@kbn/core-rendering-browser-mocks';
|
||||
import { integrationsServiceMock } from '@kbn/core-integrations-browser-mocks';
|
||||
import { coreAppMock } from './core_app/core_app.mock';
|
||||
import { coreAppsMock } from '@kbn/core-apps-browser-mocks';
|
||||
|
||||
export const analyticsServiceStartMock = analyticsServiceMock.createAnalyticsServiceStart();
|
||||
export const MockAnalyticsService = analyticsServiceMock.create();
|
||||
|
@ -126,10 +126,10 @@ jest.doMock('@kbn/core-integrations-browser-internal', () => ({
|
|||
IntegrationsService: IntegrationsServiceConstructor,
|
||||
}));
|
||||
|
||||
export const MockCoreApp = coreAppMock.create();
|
||||
export const MockCoreApp = coreAppsMock.create();
|
||||
export const CoreAppConstructor = jest.fn().mockImplementation(() => MockCoreApp);
|
||||
jest.doMock('./core_app', () => ({
|
||||
CoreApp: CoreAppConstructor,
|
||||
jest.doMock('@kbn/core-apps-browser-internal', () => ({
|
||||
CoreAppsService: CoreAppConstructor,
|
||||
}));
|
||||
|
||||
export const MockThemeService = themeServiceMock.create();
|
||||
|
|
|
@ -38,10 +38,10 @@ import {
|
|||
type InternalApplicationStart,
|
||||
} from '@kbn/core-application-browser-internal';
|
||||
import { RenderingService } from '@kbn/core-rendering-browser-internal';
|
||||
import { CoreAppsService } from '@kbn/core-apps-browser-internal';
|
||||
import { fetchOptionalMemoryInfo } from './fetch_optional_memory_info';
|
||||
import { CoreSetup, CoreStart } from '.';
|
||||
import { PluginsService } from './plugins';
|
||||
import { CoreApp } from './core_app';
|
||||
|
||||
import {
|
||||
LOAD_SETUP_DONE,
|
||||
|
@ -95,7 +95,7 @@ export class CoreSystem {
|
|||
private readonly docLinks: DocLinksService;
|
||||
private readonly rendering: RenderingService;
|
||||
private readonly integrations: IntegrationsService;
|
||||
private readonly coreApp: CoreApp;
|
||||
private readonly coreApp: CoreAppsService;
|
||||
private readonly deprecations: DeprecationsService;
|
||||
private readonly theme: ThemeService;
|
||||
private readonly rootDomElement: HTMLElement;
|
||||
|
@ -140,7 +140,7 @@ export class CoreSystem {
|
|||
this.executionContext = new ExecutionContextService();
|
||||
|
||||
this.plugins = new PluginsService(this.coreContext, injectedMetadata.uiPlugins);
|
||||
this.coreApp = new CoreApp(this.coreContext);
|
||||
this.coreApp = new CoreAppsService(this.coreContext);
|
||||
|
||||
performance.mark(KBN_LOAD_MARKS, {
|
||||
detail: LOAD_CORE_CREATED,
|
||||
|
|
|
@ -224,7 +224,7 @@ export type {
|
|||
|
||||
export type { MountPoint, UnmountCallback, OverlayRef } from '@kbn/core-mount-utils-browser';
|
||||
|
||||
export { URL_MAX_LENGTH } from './core_app';
|
||||
export { URL_MAX_LENGTH } from '@kbn/core-apps-browser-internal';
|
||||
|
||||
export type { KibanaExecutionContext } from '@kbn/core-execution-context-common';
|
||||
|
||||
|
|
1
src/core/public/styles/core_app/README.txt
Normal file
|
@ -0,0 +1 @@
|
|||
These files are only used by the sass loader, located here: `packages/kbn-optimizer/src/worker/webpack.config.ts`
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
16
yarn.lock
|
@ -2744,6 +2744,14 @@
|
|||
version "0.0.0"
|
||||
uid ""
|
||||
|
||||
"@kbn/core-apps-browser-internal@link:bazel-bin/packages/core/apps/core-apps-browser-internal":
|
||||
version "0.0.0"
|
||||
uid ""
|
||||
|
||||
"@kbn/core-apps-browser-mocks@link:bazel-bin/packages/core/apps/core-apps-browser-mocks":
|
||||
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 ""
|
||||
|
@ -6727,6 +6735,14 @@
|
|||
version "0.0.0"
|
||||
uid ""
|
||||
|
||||
"@types/kbn__core-apps-browser-internal@link:bazel-bin/packages/core/apps/core-apps-browser-internal/npm_module_types":
|
||||
version "0.0.0"
|
||||
uid ""
|
||||
|
||||
"@types/kbn__core-apps-browser-mocks@link:bazel-bin/packages/core/apps/core-apps-browser-mocks/npm_module_types":
|
||||
version "0.0.0"
|
||||
uid ""
|
||||
|
||||
"@types/kbn__core-base-browser-internal@link:bazel-bin/packages/core/base/core-base-browser-internal/npm_module_types":
|
||||
version "0.0.0"
|
||||
uid ""
|
||||
|
|