mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
chore(NA): moving @kbn/dev-utils to babel transpiler (#107245)
* chore(NA): moving @kbn/dev-utils to babel transpiler * chore(NA): fix types field on tsconfig files for packages missing it * chore(NA): update package.jsons * chore(NA): update kbn/pm dist * chore(NA): update types field on package jsons Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
01293bf86f
commit
b9acd3ce74
18 changed files with 3309 additions and 3345 deletions
|
@ -6,7 +6,7 @@ NOTE:
|
|||
|
||||
node scripts/build_plugin_list_docs
|
||||
|
||||
You can update the template within node_modules/@kbn/dev-utils/target/plugin_list/generate_plugin_list.js
|
||||
You can update the template within node_modules/@kbn/dev-utils/target_node/plugin_list/generate_plugin_list.js
|
||||
|
||||
////
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ const { DevServer } = jest.requireMock('./dev_server');
|
|||
jest.mock('./base_path_proxy_server');
|
||||
const { BasePathProxyServer } = jest.requireMock('./base_path_proxy_server');
|
||||
|
||||
jest.mock('@kbn/dev-utils/target/ci_stats_reporter');
|
||||
const { CiStatsReporter } = jest.requireMock('@kbn/dev-utils/target/ci_stats_reporter');
|
||||
jest.mock('@kbn/dev-utils/ci_stats_reporter');
|
||||
const { CiStatsReporter } = jest.requireMock('@kbn/dev-utils/ci_stats_reporter');
|
||||
|
||||
jest.mock('./get_server_watch_paths', () => ({
|
||||
getServerWatchPaths: jest.fn(() => ({
|
||||
|
|
|
@ -28,7 +28,6 @@ NPM_MODULE_EXTRA_FILES = [
|
|||
|
||||
SRC_DEPS = [
|
||||
"//packages/kbn-dev-utils",
|
||||
"@npm//jest-styled-components",
|
||||
"@npm//node-forge",
|
||||
]
|
||||
|
||||
|
|
|
@ -7,7 +7,11 @@
|
|||
"declarationMap": true,
|
||||
"rootDir": "src",
|
||||
"sourceMap": true,
|
||||
"sourceRoot": "../../../../packages/kbn-crypto/src"
|
||||
"sourceRoot": "../../../../packages/kbn-crypto/src",
|
||||
"types": [
|
||||
"jest",
|
||||
"node"
|
||||
]
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
|
|
3
packages/kbn-dev-utils/.babelrc
Normal file
3
packages/kbn-dev-utils/.babelrc
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"presets": ["@kbn/babel-preset/node_preset"]
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
|
||||
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
|
||||
load("//src/dev/bazel:index.bzl", "jsts_transpiler")
|
||||
|
||||
PKG_BASE_NAME = "kbn-dev-utils"
|
||||
PKG_REQUIRE_NAME = "@kbn/dev-utils"
|
||||
|
@ -41,21 +42,18 @@ NPM_MODULE_EXTRA_FILES = [
|
|||
"tooling_log/package.json"
|
||||
]
|
||||
|
||||
SRC_DEPS = [
|
||||
"//packages/kbn-expect",
|
||||
RUNTIME_DEPS = [
|
||||
"//packages/kbn-std",
|
||||
"//packages/kbn-utils",
|
||||
"@npm//@babel/core",
|
||||
"@npm//axios",
|
||||
"@npm//chalk",
|
||||
"@npm//chance",
|
||||
"@npm//cheerio",
|
||||
"@npm//dedent",
|
||||
"@npm//execa",
|
||||
"@npm//exit-hook",
|
||||
"@npm//getopts",
|
||||
"@npm//globby",
|
||||
"@npm//jest-styled-components",
|
||||
"@npm//load-json-file",
|
||||
"@npm//markdown-it",
|
||||
"@npm//moment",
|
||||
|
@ -63,13 +61,19 @@ SRC_DEPS = [
|
|||
"@npm//rxjs",
|
||||
"@npm//tar",
|
||||
"@npm//tree-kill",
|
||||
"@npm//tslib",
|
||||
"@npm//typescript",
|
||||
"@npm//vinyl",
|
||||
"@npm//yauzl"
|
||||
]
|
||||
|
||||
TYPES_DEPS = [
|
||||
"//packages/kbn-std",
|
||||
"//packages/kbn-utils",
|
||||
"@npm//axios",
|
||||
"@npm//execa",
|
||||
"@npm//exit-hook",
|
||||
"@npm//getopts",
|
||||
"@npm//rxjs",
|
||||
"@npm//tree-kill",
|
||||
"@npm//@types/babel__core",
|
||||
"@npm//@types/cheerio",
|
||||
"@npm//@types/dedent",
|
||||
|
@ -85,7 +89,11 @@ TYPES_DEPS = [
|
|||
"@npm//@types/yauzl"
|
||||
]
|
||||
|
||||
DEPS = SRC_DEPS + TYPES_DEPS
|
||||
jsts_transpiler(
|
||||
name = "target_node",
|
||||
srcs = SRCS,
|
||||
build_pkg_name = package_name(),
|
||||
)
|
||||
|
||||
ts_config(
|
||||
name = "tsconfig",
|
||||
|
@ -96,14 +104,15 @@ ts_config(
|
|||
)
|
||||
|
||||
ts_project(
|
||||
name = "tsc",
|
||||
name = "tsc_types",
|
||||
args = ['--pretty'],
|
||||
srcs = SRCS,
|
||||
deps = DEPS,
|
||||
deps = TYPES_DEPS,
|
||||
declaration = True,
|
||||
declaration_map = True,
|
||||
incremental = True,
|
||||
out_dir = "target",
|
||||
emit_declaration_only = True,
|
||||
incremental = False,
|
||||
out_dir = "target_types",
|
||||
source_map = True,
|
||||
root_dir = "src",
|
||||
tsconfig = ":tsconfig",
|
||||
|
@ -112,7 +121,7 @@ ts_project(
|
|||
js_library(
|
||||
name = PKG_BASE_NAME,
|
||||
srcs = NPM_MODULE_EXTRA_FILES,
|
||||
deps = DEPS + [":tsc"],
|
||||
deps = RUNTIME_DEPS + [":target_node", ":tsc_types"],
|
||||
package_name = PKG_REQUIRE_NAME,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"main": "../target/ci_stats_reporter/ci_stats_reporter"
|
||||
"main": "../target_node/ci_stats_reporter/ci_stats_reporter",
|
||||
"types": "../target_types/ci_stats_reporter/ci_stats_reporter"
|
||||
}
|
|
@ -3,8 +3,8 @@
|
|||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"license": "SSPL-1.0 OR Elastic License 2.0",
|
||||
"main": "./target/index.js",
|
||||
"types": "./target/index.d.ts",
|
||||
"main": "./target_node/index.js",
|
||||
"types": "./target_types/index.d.ts",
|
||||
"kibana": {
|
||||
"devOnly": true
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"main": "../target/stdio"
|
||||
"main": "../target_node/stdio",
|
||||
"types": "../target_types/stdio"
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"main": "../target/tooling_log"
|
||||
"main": "../target_node/tooling_log",
|
||||
"types": "../target_types/tooling_log"
|
||||
}
|
|
@ -1,15 +1,16 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"incremental": true,
|
||||
"outDir": "target",
|
||||
"stripInternal": false,
|
||||
"target": "ES2019",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"incremental": false,
|
||||
"outDir": "target_types",
|
||||
"rootDir": "src",
|
||||
"sourceMap": true,
|
||||
"sourceRoot": "../../../../packages/kbn-dev-utils/src",
|
||||
"stripInternal": false,
|
||||
"target": "ES2019",
|
||||
"types": [
|
||||
"jest",
|
||||
"node"
|
||||
|
|
|
@ -7,7 +7,11 @@
|
|||
"declarationMap": true,
|
||||
"rootDir": "./src",
|
||||
"sourceMap": true,
|
||||
"sourceRoot": "../../../../packages/kbn-optimizer/src"
|
||||
"sourceRoot": "../../../../packages/kbn-optimizer/src",
|
||||
"types": [
|
||||
"jest",
|
||||
"node"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
|
|
6561
packages/kbn-pm/dist/index.js
vendored
6561
packages/kbn-pm/dist/index.js
vendored
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,11 @@
|
|||
"declarationMap": true,
|
||||
"rootDir": "src",
|
||||
"sourceMap": true,
|
||||
"sourceRoot": "../../../../packages/kbn-server-http-tools/src"
|
||||
"sourceRoot": "../../../../packages/kbn-server-http-tools/src",
|
||||
"types": [
|
||||
"jest",
|
||||
"node"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
|
|
|
@ -32,7 +32,6 @@ SRC_DEPS = [
|
|||
"//packages/kbn-dev-utils",
|
||||
"//packages/kbn-utility-types",
|
||||
"@npm//glob",
|
||||
"@npm//jest-styled-components",
|
||||
"@npm//listr",
|
||||
"@npm//normalize-path",
|
||||
"@npm//tslib",
|
||||
|
|
|
@ -8,7 +8,11 @@
|
|||
"rootDir": "src",
|
||||
"sourceMap": true,
|
||||
"sourceRoot": "../../../../packages/kbn-telemetry-tools/src",
|
||||
"isolatedModules": true
|
||||
"isolatedModules": true,
|
||||
"types": [
|
||||
"jest",
|
||||
"node"
|
||||
],
|
||||
},
|
||||
"include": [
|
||||
"src/**/*",
|
||||
|
|
|
@ -53,6 +53,7 @@ SRC_DEPS = [
|
|||
"@npm//jest",
|
||||
"@npm//jest-cli",
|
||||
"@npm//jest-snapshot",
|
||||
"@npm//jest-styled-components",
|
||||
"@npm//@jest/reporters",
|
||||
"@npm//joi",
|
||||
"@npm//mustache",
|
||||
|
|
|
@ -7,4 +7,4 @@
|
|||
*/
|
||||
|
||||
require('../src/setup_node_env/no_transpilation');
|
||||
require('@kbn/dev-utils/target/precommit_hook/cli');
|
||||
require('@kbn/dev-utils/target_node/precommit_hook/cli');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue