chore(NA): splits types from code on @kbn/ui-shared-deps-npm (#122788)

This commit is contained in:
Tiago Costa 2022-01-13 02:23:18 +00:00 committed by GitHub
parent f47839ecaf
commit a6d21cc715
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 43 additions and 14 deletions

View file

@ -602,6 +602,7 @@
"@types/kbn__server-route-repository": "link:bazel-bin/packages/kbn-server-route-repository/npm_module_types",
"@types/kbn__std": "link:bazel-bin/packages/kbn-std/npm_module_types",
"@types/kbn__telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools/npm_module_types",
"@types/kbn__ui-shared-deps-npm": "link:bazel-bin/packages/kbn-ui-shared-deps-npm/npm_module_types",
"@types/kbn__utility-types": "link:bazel-bin/packages/kbn-utility-types/npm_module_types",
"@types/kbn__utils": "link:bazel-bin/packages/kbn-utils/npm_module_types",
"@types/license-checker": "15.0.0",

View file

@ -120,6 +120,7 @@ filegroup(
"//packages/kbn-server-route-repository:build_types",
"//packages/kbn-std:build_types",
"//packages/kbn-telemetry-tools:build_types",
"//packages/kbn-ui-shared-deps-npm:build_types",
"//packages/kbn-utility-types:build_types",
"//packages/kbn-utils:build_types",
],

View file

@ -69,7 +69,7 @@ TYPES_DEPS = [
"//packages/kbn-config-schema:npm_module_types",
"//packages/kbn-dev-utils:npm_module_types",
"//packages/kbn-std:npm_module_types",
"//packages/kbn-ui-shared-deps-npm",
"//packages/kbn-ui-shared-deps-npm:npm_module_types",
"//packages/kbn-ui-shared-deps-src",
"//packages/kbn-utils:npm_module_types",
"@npm//chalk",

View file

@ -49,7 +49,7 @@ RUNTIME_DEPS = [
TYPES_DEPS = [
"//packages/kbn-dev-utils:npm_module_types",
"//packages/kbn-ui-shared-deps-npm",
"//packages/kbn-ui-shared-deps-npm:npm_module_types",
"//packages/kbn-ui-shared-deps-src",
"//packages/kbn-utils:npm_module_types",
"@npm//@storybook/addons",

View file

@ -1,10 +1,11 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("@npm//webpack-cli:index.bzl", webpack = "webpack_cli")
load("//src/dev/bazel:index.bzl", "jsts_transpiler")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
PKG_BASE_NAME = "kbn-ui-shared-deps-npm"
PKG_REQUIRE_NAME = "@kbn/ui-shared-deps-npm"
TYPES_PKG_REQUIRE_NAME = "@types/kbn__ui-shared-deps-npm"
SOURCE_FILES = glob(
[
@ -150,7 +151,7 @@ webpack(
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + [":target_node", ":tsc_types", ":shared_built_assets"],
deps = RUNTIME_DEPS + [":target_node", ":shared_built_assets"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
@ -169,3 +170,20 @@ filegroup(
],
visibility = ["//visibility:public"],
)
pkg_npm_types(
name = "npm_module_types",
srcs = SRCS,
deps = [":tsc_types"],
package_name = TYPES_PKG_REQUIRE_NAME,
tsconfig = ":tsconfig",
visibility = ["//visibility:public"],
)
filegroup(
name = "build_types",
srcs = [
":npm_module_types",
],
visibility = ["//visibility:public"],
)

View file

@ -4,6 +4,5 @@
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "target_node/index.js",
"browser": "target_node/entry.js",
"types": "target_types/index.d.ts"
"browser": "target_node/entry.js"
}

View file

@ -12,20 +12,26 @@
const Path = require('path');
// extracted const vars
const distDir = Path.resolve(__dirname, '../shared_built_assets');
const dllManifestPath = Path.resolve(distDir, 'kbn-ui-shared-deps-npm-manifest.json');
const dllFilename = 'kbn-ui-shared-deps-npm.dll.js';
const publicPathLoader = require.resolve('./public_path_loader');
/**
* Absolute path to the distributable directory
*/
exports.distDir = Path.resolve(__dirname, '../shared_built_assets');
exports.distDir = distDir;
/**
* Path to dll manifest of modules included in this bundle
*/
exports.dllManifestPath = Path.resolve(exports.distDir, 'kbn-ui-shared-deps-npm-manifest.json');
exports.dllManifestPath = dllManifestPath;
/**
* Filename of the main bundle file in the distributable directory
*/
exports.dllFilename = 'kbn-ui-shared-deps-npm.dll.js';
exports.dllFilename = dllFilename;
/**
* Filename of the light-theme css file in the distributable directory
@ -54,4 +60,4 @@ exports.darkCssDistFilename = (themeVersion) => {
/**
* Webpack loader for configuring the public path lookup from `window.__kbnPublicPath__`.
*/
exports.publicPathLoader = require.resolve('./public_path_loader');
exports.publicPathLoader = publicPathLoader;

View file

@ -49,7 +49,7 @@ TYPES_DEPS = [
"//packages/kbn-i18n-react:npm_module_types",
"//packages/kbn-monaco:npm_module_types",
"//packages/kbn-std:npm_module_types",
"//packages/kbn-ui-shared-deps-npm",
"//packages/kbn-ui-shared-deps-npm:npm_module_types",
"@npm//@elastic/eui",
"@npm//webpack",
]

View file

@ -5956,6 +5956,10 @@
version "0.0.0"
uid ""
"@types/kbn__ui-shared-deps-npm@link:bazel-bin/packages/kbn-ui-shared-deps-npm/npm_module_types":
version "0.0.0"
uid ""
"@types/kbn__utility-types@link:bazel-bin/packages/kbn-utility-types/npm_module_types":
version "0.0.0"
uid ""
@ -10526,7 +10530,7 @@ core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.9:
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2"
integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==
core-js@^3.0.4, core-js@^3.6.5, core-js@^3.8.2, core-js@^3.8.3, core-js@^3.20.2:
core-js@^3.0.4, core-js@^3.20.2, core-js@^3.6.5, core-js@^3.8.2, core-js@^3.8.3:
version "3.20.2"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.20.2.tgz#46468d8601eafc8b266bd2dd6bf9dee622779581"
integrity sha512-nuqhq11DcOAbFBV4zCbKeGbKQsUDRqTX0oqx7AttUBuqe3h20ixsE039QHelbL6P4h+9kytVqyEtyZ6gsiwEYw==