Skip to content

Commit

Permalink
Read coreApp assets directly from package (#144492)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
TinaHeiligers and kibanamachine authored Nov 4, 2022
1 parent c4ad1be commit b5ee95d
Show file tree
Hide file tree
Showing 76 changed files with 30 additions and 4,446 deletions.
15 changes: 8 additions & 7 deletions packages/core/apps/core-apps-server-internal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ 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",
Expand All @@ -38,8 +31,16 @@ filegroup(
srcs = SRCS,
)

ASSETS = glob(["assets/**/*"])

filegroup(
name = "assets",
srcs = ASSETS,
)

NPM_MODULE_EXTRA_FILES = [
"package.json",
":assets"
]

RUNTIME_DEPS = [
Expand Down
8 changes: 6 additions & 2 deletions packages/core/apps/core-apps-server-internal/src/core_app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Side Public License, v 1.
*/

import Path from 'path';
import { stringify } from 'querystring';
import { Env } from '@kbn/config';
import { schema } from '@kbn/config-schema';
Expand Down Expand Up @@ -202,8 +201,13 @@ export class CoreAppsService {
});
}

// After the package is built and bootstrap extracts files to bazel-bin,
// assets are exposed at the root of the package and in the package's node_modules dir
private registerStaticDirs(core: InternalCoreSetup | InternalCorePreboot) {
core.http.registerStaticDir('/ui/{path*}', Path.resolve(__dirname, './assets'));
core.http.registerStaticDir(
'/ui/{path*}',
fromRoot('node_modules/@kbn/core-apps-server-internal/assets')
);

core.http.registerStaticDir(
'/node_modules/@kbn/ui-framework/dist/{path*}',
Expand Down
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file removed src/core/server/core_app/assets/favicons/favicon.ico
Binary file not shown.
Binary file removed src/core/server/core_app/assets/favicons/favicon.png
Binary file not shown.
4 changes: 0 additions & 4 deletions src/core/server/core_app/assets/favicons/favicon.svg

This file was deleted.

Loading

0 comments on commit b5ee95d

Please sign in to comment.