[ts] stop building @types packages in bootstrap

This commit is contained in:
spalger 2022-10-28 09:33:05 -05:00
parent 260d4855ff
commit e5d186a6f0
No known key found for this signature in database
97 changed files with 1581 additions and 3286 deletions

View file

@ -4,11 +4,8 @@ set -euo pipefail
.buildkite/scripts/bootstrap.sh
echo "--- Build TS Refs"
node scripts/build_ts_refs \
--clean \
--no-cache \
--force
echo "--- Run scripts/type_check to ensure that all build available"
node scripts/type_check
echo "--- Build API Docs"
node --max-old-space-size=12000 scripts/build_api_docs

View file

@ -8,4 +8,4 @@ source .buildkite/scripts/common/util.sh
echo --- Check Types
checks-reporter-with-killswitch "Check Types" \
node scripts/type_check --concurrency 8
node scripts/type_check

2
.gitignore vendored
View file

@ -94,6 +94,8 @@ report.asciidoc
# Automatically generated and user-modifiable
/tsconfig.refs.json
tsconfig.base.type_check.json
tsconfig.type_check.json
# Yarn local mirror content
.yarn-local-mirror

View file

@ -12,6 +12,7 @@ import { haveNodeModulesBeenManuallyDeleted, removeYarnIntegrityFileIfExists } f
import { setupRemoteCache } from './setup_remote_cache.mjs';
import { regenerateSyntheticPackageMap } from './regenerate_synthetic_package_map.mjs';
import { sortPackageJson } from './sort_package_json.mjs';
import { REPO_ROOT } from '../../lib/paths.mjs';
import { pluginDiscovery } from './plugins.mjs';
import { regenerateBaseTsconfig } from './regenerate_base_tsconfig.mjs';
@ -99,7 +100,8 @@ export const command = {
await sortPackageJson();
});
await time('regenerate tsconfig.base.json', async () => {
await regenerateBaseTsconfig(plugins);
const { discoverBazelPackages } = await import('@kbn/bazel-packages');
await regenerateBaseTsconfig(await discoverBazelPackages(REPO_ROOT), plugins);
});
if (validate) {

View file

@ -14,13 +14,27 @@ import { convertPluginIdToPackageId } from './plugins.mjs';
import { normalizePath } from './normalize_path.mjs';
/**
* @param {import('@kbn/bazel-packages').BazelPackage[]} packages
* @param {import('@kbn/plugin-discovery').KibanaPlatformPlugin[]} plugins
*/
export async function regenerateBaseTsconfig(plugins) {
export async function regenerateBaseTsconfig(packages, plugins) {
const tsconfigPath = Path.resolve(REPO_ROOT, 'tsconfig.base.json');
const lines = (await Fsp.readFile(tsconfigPath, 'utf-8')).split('\n');
const packageMap = plugins
const packagesMap = packages
.slice()
.sort((a, b) => a.normalizedRepoRelativeDir.localeCompare(b.normalizedRepoRelativeDir))
.flatMap((p) => {
if (!p.pkg) {
return [];
}
const id = p.pkg.name;
const path = p.normalizedRepoRelativeDir;
return [` "${id}": ["${path}"],`, ` "${id}/*": ["${path}/*"],`];
});
const pluginsMap = plugins
.slice()
.sort((a, b) => a.manifestPath.localeCompare(b.manifestPath))
.flatMap((p) => {
@ -32,8 +46,15 @@ export async function regenerateBaseTsconfig(plugins) {
const start = lines.findIndex((l) => l.trim() === '// START AUTOMATED PACKAGE LISTING');
const end = lines.findIndex((l) => l.trim() === '// END AUTOMATED PACKAGE LISTING');
await Fsp.writeFile(
tsconfigPath,
[...lines.slice(0, start + 1), ...packageMap, ...lines.slice(end)].join('\n')
);
const current = await Fsp.readFile(tsconfigPath, 'utf8');
const updated = [
...lines.slice(0, start + 1),
...packagesMap,
...pluginsMap,
...lines.slice(end),
].join('\n');
if (updated !== current) {
await Fsp.writeFile(tsconfigPath, updated);
}
}

View file

@ -6,5 +6,5 @@
* Side Public License, v 1.
*/
require('../src/setup_node_env');
require('../src/dev/typescript').runBuildRefsCli();
const { PROJECTS } = require('../../../src/dev/typescript/projects');
module.exports = { PROJECTS };

View file

@ -6,10 +6,267 @@
* Side Public License, v 1.
*/
import Fs from 'fs';
import Path from 'path';
import { REPO_ROOT } from '../lib/paths.mjs';
import { pluginDiscovery } from './bootstrap/plugins.mjs';
const RULE_DEPS = /([\s\n]deps\s*=\s*)((?:\w+(?: \+ )?)?(?:\[[^\]]*\])?)(\s*,|\s*\))/;
/**
* @param {string} text
* @param {number} index
*/
function findStartOfLine(text, index) {
let cursor = index;
while (cursor > 0) {
if (text[cursor - 1] === '\n') {
return cursor;
}
cursor -= 1;
}
return cursor;
}
/**
* @param {string} starlark
* @param {string} name
*/
function findBazelRule(starlark, name) {
const match = starlark.match(new RegExp(`name\\s*=\\s*${name}`));
if (typeof match?.index !== 'number') {
throw new Error(`unable to find rule named [${name}]`);
}
const openParen = starlark.slice(0, match.index).lastIndexOf('(');
if (openParen === -1) {
throw new Error(`unable to find opening paren for rule [${name}] [index=${match.index}]`);
}
const start = findStartOfLine(starlark, openParen);
const end = starlark.indexOf(')', start);
if (end === -1) {
throw new Error(`unable to find closing parent for rule [${name}] [start=${start}]`);
}
const type = starlark.slice(start, starlark.indexOf('(', start)).trim();
// add 1 so that the "end" chunk starts after the closing )
return { start, end: end + 1, type };
}
/**
* @param {string} starlark
* @param {string} name
*/
function removeBazelRule(starlark, name) {
const pos = findBazelRule(starlark, name);
let end = pos.end;
// slurp up all the newlines directly after the closing )
while (starlark[end] === '\n') {
end += 1;
}
return starlark.slice(0, pos.start) + starlark.slice(end);
}
/**
* @param {string} starlark
* @param {string} dep
* @returns
*/
function addDep(starlark, dep) {
const depsMatch = starlark.match(RULE_DEPS);
if (typeof depsMatch?.index !== 'number') {
return starlark.replace(/,?[\s\n]*\)[\s\n]*$/, '') + `,\n deps = [${dep}],\n)`;
}
const [, head, value, tail] = depsMatch;
return (
starlark.slice(0, depsMatch.index) +
head +
(() => {
const multiline = value.includes('\n');
const existingArray = value.indexOf(']');
if (existingArray === -1) {
return value + ` + [${dep}]`;
}
const valHead = value.slice(0, existingArray).replace(/,?\s*$/, ',');
const valTail = value.slice(existingArray);
return `${valHead}${multiline ? '\n ' : ' '}${dep}${multiline ? ',\n' : ''}${valTail}`;
})() +
tail +
starlark.slice(depsMatch.index + depsMatch[0].length)
);
}
/**
* @param {string} starlark
* @param {string} name
* @param {string} newName
* @param {(rule: string) => string} mod
*/
function duplicateRule(starlark, name, newName, mod) {
const origPos = findBazelRule(starlark, name);
const orig = starlark.slice(origPos.start, origPos.end);
const withName = orig.replace(
/^(\s*)name\s*=\s*.*$/m,
(match, head) => `${head}name = ${newName}${match.endsWith(',') ? ',' : ''}`
);
return starlark.slice(0, origPos.end) + `\n\n${mod(withName)}` + starlark.slice(origPos.end);
}
/** @type {import('../lib/command').Command} */
export const command = {
name: '_test',
async run({ log }) {
log.success('empty');
const updates = { pkgJson: 0, buildBazel: 0, tsconfig: 0, tsconfigRefs: 0 };
await import('../../../src/setup_node_env/index' + '.js');
const { PROJECTS } = await import('./projects' + '.js');
const { discoverBazelPackages } = await import('@kbn/bazel-packages');
const pkgs = await discoverBazelPackages(REPO_ROOT);
const plugins = await pluginDiscovery();
// update package.json files to point to their target_types dir
const relTypes = './target_types/index.d.ts';
for (const pkg of pkgs) {
if (!pkg.hasBuildTypesRule()) {
log.warning(`not defining "types" for ${pkg.manifest.id} because it doesn't build types`);
continue;
}
const dir = Path.resolve(REPO_ROOT, pkg.normalizedRepoRelativeDir);
const pkgJsonPath = Path.resolve(dir, 'package.json');
const pkgJson = Fs.readFileSync(pkgJsonPath, 'utf8');
const parsed = JSON.parse(pkgJson);
if (parsed.types === relTypes) {
continue;
}
Fs.writeFileSync(
pkgJsonPath,
JSON.stringify(
{
...parsed,
types: relTypes,
},
null,
2
) + (pkgJson.endsWith('\n') ? '\n' : '')
);
updates.pkgJson += 1;
}
log.success(`updated ${updates.pkgJson} package.json files`);
// update BUILD.bazel files to not rely on type_summarizer
for (const pkg of pkgs) {
if (!pkg.hasBuildTypesRule()) {
continue;
}
const starlark = pkg.buildBazelContent;
if (typeof starlark !== 'string') {
throw new Error('missing buildBazelContent');
}
const npmTypes = findBazelRule(starlark, '"npm_module_types"');
if (npmTypes.type === 'alias') {
log.info(`ignoring npm_module_types rule which is an alias in ${pkg.manifest.id}`);
continue;
}
// remove rules for old npm_module_types
const withoutOldTypes = removeBazelRule(starlark, '"npm_module_types"');
// duplicate js_library rule and name npm_module_types rule which adds the ':tsc_types' dep
const withTypesJsLib = duplicateRule(
withoutOldTypes,
'PKG_DIRNAME',
'"npm_module_types"',
(newRule) => addDep(newRule, '":tsc_types"')
);
const withBuildTypesWrapper =
removeBazelRule(withTypesJsLib, '"build_types"').trimEnd() +
`
pkg_npm(
name = "build_types",
deps = [":npm_module_types"],
visibility = ["//visibility:public"],
)
`;
Fs.writeFileSync(
Path.resolve(REPO_ROOT, pkg.normalizedRepoRelativeDir, 'BUILD.bazel'),
withBuildTypesWrapper
);
updates.buildBazel += 1;
}
log.success(`updated ${updates.buildBazel} BUILD.bazel files`);
// stop enabling declaration source maps in tsconfig
for (const pkg of [...pkgs, ...plugins]) {
const dir =
'normalizedRepoRelativeDir' in pkg
? Path.resolve(REPO_ROOT, pkg.normalizedRepoRelativeDir)
: pkg.directory;
let changed;
const tsconfigPath = Path.resolve(dir, 'tsconfig.json');
if (Fs.existsSync(tsconfigPath)) {
const current = Fs.readFileSync(tsconfigPath, 'utf8');
const next = current.replace(/\n\s*"declarationMap"\s*:.+\n/m, '\n');
if (current !== next) {
changed = true;
Fs.writeFileSync(tsconfigPath, next);
}
}
const buildBazelPath = Path.resolve(dir, 'BUILD.bazel');
if (Fs.existsSync(buildBazelPath)) {
const current = Fs.readFileSync(buildBazelPath, 'utf8');
const next = current.replace(/\n.*\bdeclaration_map\b.*\n/, '\n');
if (current !== next) {
changed = true;
Fs.writeFileSync(buildBazelPath, next);
}
}
if (changed) {
updates.tsconfig += 1;
}
}
log.success(`dropped declarationMap from ${updates.tsconfig} tsconfig.json files`);
// rename "references" in plugin tsconfig.json files to "kbn_references"
for (const project of PROJECTS) {
const tsconfigJson = Fs.readFileSync(project.tsConfigPath, 'utf8');
const updated = tsconfigJson.replace('"references"', '"kbn_references"');
if (updated !== tsconfigJson) {
Fs.writeFileSync(project.tsConfigPath, updated);
updates.tsconfigRefs += 1;
}
}
log.success(`updated tsconfig references key in ${updates.tsconfigRefs} tsconfig.json files`);
},
};

View file

@ -4,7 +4,6 @@
"outDir": "target",
"allowJs": true,
"checkJs": true,
"composite": false,
"target": "ES2022",
"module": "ESNext"
},

View file

@ -41,7 +41,6 @@
"bazel": "bazel",
"build": "node scripts/build --all-platforms",
"build:apidocs": "node scripts/build_api_docs",
"build:types": "rm -rf ./target/types && tsc --p tsconfig.types.json",
"checkLicenses": "node scripts/check_licenses --dev",
"cover:functional:merge": "nyc report --temp-dir target/kibana-coverage/functional --report-dir target/coverage/report/functional --reporter=json-summary",
"cover:report": "nyc report --temp-dir target/kibana-coverage/functional --report-dir target/coverage/report --reporter=lcov && open ./target/coverage/report/lcov-report/index.html",
@ -863,346 +862,6 @@
"@types/json-stable-stringify": "^1.0.32",
"@types/json5": "^0.0.30",
"@types/jsonwebtoken": "^8.5.6",
"@types/kbn__ace": "link:bazel-bin/packages/kbn-ace/npm_module_types",
"@types/kbn__aiops-components": "link:bazel-bin/x-pack/packages/ml/aiops_components/npm_module_types",
"@types/kbn__aiops-utils": "link:bazel-bin/x-pack/packages/ml/aiops_utils/npm_module_types",
"@types/kbn__alerts": "link:bazel-bin/packages/kbn-alerts/npm_module_types",
"@types/kbn__analytics": "link:bazel-bin/packages/kbn-analytics/npm_module_types",
"@types/kbn__analytics-client": "link:bazel-bin/packages/analytics/client/npm_module_types",
"@types/kbn__analytics-shippers-elastic-v3-browser": "link:bazel-bin/packages/analytics/shippers/elastic_v3/browser/npm_module_types",
"@types/kbn__analytics-shippers-elastic-v3-common": "link:bazel-bin/packages/analytics/shippers/elastic_v3/common/npm_module_types",
"@types/kbn__analytics-shippers-elastic-v3-server": "link:bazel-bin/packages/analytics/shippers/elastic_v3/server/npm_module_types",
"@types/kbn__analytics-shippers-fullstory": "link:bazel-bin/packages/analytics/shippers/fullstory/npm_module_types",
"@types/kbn__analytics-shippers-gainsight": "link:bazel-bin/packages/analytics/shippers/gainsight/npm_module_types",
"@types/kbn__apm-config-loader": "link:bazel-bin/packages/kbn-apm-config-loader/npm_module_types",
"@types/kbn__apm-synthtrace": "link:bazel-bin/packages/kbn-apm-synthtrace/npm_module_types",
"@types/kbn__apm-utils": "link:bazel-bin/packages/kbn-apm-utils/npm_module_types",
"@types/kbn__axe-config": "link:bazel-bin/packages/kbn-axe-config/npm_module_types",
"@types/kbn__bazel-packages": "link:bazel-bin/packages/kbn-bazel-packages/npm_module_types",
"@types/kbn__bazel-runner": "link:bazel-bin/packages/kbn-bazel-runner/npm_module_types",
"@types/kbn__cases-components": "link:bazel-bin/packages/kbn-cases-components/npm_module_types",
"@types/kbn__chart-icons": "link:bazel-bin/packages/kbn-chart-icons/npm_module_types",
"@types/kbn__ci-stats-core": "link:bazel-bin/packages/kbn-ci-stats-core/npm_module_types",
"@types/kbn__ci-stats-performance-metrics": "link:bazel-bin/packages/kbn-ci-stats-performance-metrics/npm_module_types",
"@types/kbn__ci-stats-reporter": "link:bazel-bin/packages/kbn-ci-stats-reporter/npm_module_types",
"@types/kbn__cli-dev-mode": "link:bazel-bin/packages/kbn-cli-dev-mode/npm_module_types",
"@types/kbn__coloring": "link:bazel-bin/packages/kbn-coloring/npm_module_types",
"@types/kbn__config": "link:bazel-bin/packages/kbn-config/npm_module_types",
"@types/kbn__config-mocks": "link:bazel-bin/packages/kbn-config-mocks/npm_module_types",
"@types/kbn__config-schema": "link:bazel-bin/packages/kbn-config-schema/npm_module_types",
"@types/kbn__content-management-table-list": "link:bazel-bin/packages/content-management/table_list/npm_module_types",
"@types/kbn__core-analytics-browser": "link:bazel-bin/packages/core/analytics/core-analytics-browser/npm_module_types",
"@types/kbn__core-analytics-browser-internal": "link:bazel-bin/packages/core/analytics/core-analytics-browser-internal/npm_module_types",
"@types/kbn__core-analytics-browser-mocks": "link:bazel-bin/packages/core/analytics/core-analytics-browser-mocks/npm_module_types",
"@types/kbn__core-analytics-server": "link:bazel-bin/packages/core/analytics/core-analytics-server/npm_module_types",
"@types/kbn__core-analytics-server-internal": "link:bazel-bin/packages/core/analytics/core-analytics-server-internal/npm_module_types",
"@types/kbn__core-analytics-server-mocks": "link:bazel-bin/packages/core/analytics/core-analytics-server-mocks/npm_module_types",
"@types/kbn__core-application-browser": "link:bazel-bin/packages/core/application/core-application-browser/npm_module_types",
"@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",
"@types/kbn__core-base-common": "link:bazel-bin/packages/core/base/core-base-common/npm_module_types",
"@types/kbn__core-base-common-internal": "link:bazel-bin/packages/core/base/core-base-common-internal/npm_module_types",
"@types/kbn__core-base-server": "link:bazel-bin/packages/core/base/core-base-server/npm_module_types",
"@types/kbn__core-base-server-internal": "link:bazel-bin/packages/core/base/core-base-server-internal/npm_module_types",
"@types/kbn__core-base-server-mocks": "link:bazel-bin/packages/core/base/core-base-server-mocks/npm_module_types",
"@types/kbn__core-capabilities-browser-internal": "link:bazel-bin/packages/core/capabilities/core-capabilities-browser-internal/npm_module_types",
"@types/kbn__core-capabilities-browser-mocks": "link:bazel-bin/packages/core/capabilities/core-capabilities-browser-mocks/npm_module_types",
"@types/kbn__core-capabilities-common": "link:bazel-bin/packages/core/capabilities/core-capabilities-common/npm_module_types",
"@types/kbn__core-capabilities-server": "link:bazel-bin/packages/core/capabilities/core-capabilities-server/npm_module_types",
"@types/kbn__core-capabilities-server-internal": "link:bazel-bin/packages/core/capabilities/core-capabilities-server-internal/npm_module_types",
"@types/kbn__core-capabilities-server-mocks": "link:bazel-bin/packages/core/capabilities/core-capabilities-server-mocks/npm_module_types",
"@types/kbn__core-chrome-browser": "link:bazel-bin/packages/core/chrome/core-chrome-browser/npm_module_types",
"@types/kbn__core-chrome-browser-internal": "link:bazel-bin/packages/core/chrome/core-chrome-browser-internal/npm_module_types",
"@types/kbn__core-chrome-browser-mocks": "link:bazel-bin/packages/core/chrome/core-chrome-browser-mocks/npm_module_types",
"@types/kbn__core-common-internal-base": "link:bazel-bin/packages/core/common/internal-base/npm_module_types",
"@types/kbn__core-config-server-internal": "link:bazel-bin/packages/core/config/core-config-server-internal/npm_module_types",
"@types/kbn__core-config-server-mocks": "link:bazel-bin/packages/core/config/core-config-server-mocks/npm_module_types",
"@types/kbn__core-deprecations-browser": "link:bazel-bin/packages/core/deprecations/core-deprecations-browser/npm_module_types",
"@types/kbn__core-deprecations-browser-internal": "link:bazel-bin/packages/core/deprecations/core-deprecations-browser-internal/npm_module_types",
"@types/kbn__core-deprecations-browser-mocks": "link:bazel-bin/packages/core/deprecations/core-deprecations-browser-mocks/npm_module_types",
"@types/kbn__core-deprecations-common": "link:bazel-bin/packages/core/deprecations/core-deprecations-common/npm_module_types",
"@types/kbn__core-deprecations-server": "link:bazel-bin/packages/core/deprecations/core-deprecations-server/npm_module_types",
"@types/kbn__core-deprecations-server-internal": "link:bazel-bin/packages/core/deprecations/core-deprecations-server-internal/npm_module_types",
"@types/kbn__core-deprecations-server-mocks": "link:bazel-bin/packages/core/deprecations/core-deprecations-server-mocks/npm_module_types",
"@types/kbn__core-doc-links-browser": "link:bazel-bin/packages/core/doc-links/core-doc-links-browser/npm_module_types",
"@types/kbn__core-doc-links-browser-internal": "link:bazel-bin/packages/core/doc-links/core-doc-links-browser-internal/npm_module_types",
"@types/kbn__core-doc-links-browser-mocks": "link:bazel-bin/packages/core/doc-links/core-doc-links-browser-mocks/npm_module_types",
"@types/kbn__core-doc-links-server": "link:bazel-bin/packages/core/doc-links/core-doc-links-server/npm_module_types",
"@types/kbn__core-doc-links-server-internal": "link:bazel-bin/packages/core/doc-links/core-doc-links-server-internal/npm_module_types",
"@types/kbn__core-doc-links-server-mocks": "link:bazel-bin/packages/core/doc-links/core-doc-links-server-mocks/npm_module_types",
"@types/kbn__core-elasticsearch-client-server": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server/npm_module_types",
"@types/kbn__core-elasticsearch-client-server-internal": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server-internal/npm_module_types",
"@types/kbn__core-elasticsearch-client-server-mocks": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-client-server-mocks/npm_module_types",
"@types/kbn__core-elasticsearch-server": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server/npm_module_types",
"@types/kbn__core-elasticsearch-server-internal": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server-internal/npm_module_types",
"@types/kbn__core-elasticsearch-server-mocks": "link:bazel-bin/packages/core/elasticsearch/core-elasticsearch-server-mocks/npm_module_types",
"@types/kbn__core-environment-server-internal": "link:bazel-bin/packages/core/environment/core-environment-server-internal/npm_module_types",
"@types/kbn__core-environment-server-mocks": "link:bazel-bin/packages/core/environment/core-environment-server-mocks/npm_module_types",
"@types/kbn__core-execution-context-browser": "link:bazel-bin/packages/core/execution-context/core-execution-context-browser/npm_module_types",
"@types/kbn__core-execution-context-browser-internal": "link:bazel-bin/packages/core/execution-context/core-execution-context-browser-internal/npm_module_types",
"@types/kbn__core-execution-context-browser-mocks": "link:bazel-bin/packages/core/execution-context/core-execution-context-browser-mocks/npm_module_types",
"@types/kbn__core-execution-context-common": "link:bazel-bin/packages/core/execution-context/core-execution-context-common/npm_module_types",
"@types/kbn__core-execution-context-server": "link:bazel-bin/packages/core/execution-context/core-execution-context-server/npm_module_types",
"@types/kbn__core-execution-context-server-internal": "link:bazel-bin/packages/core/execution-context/core-execution-context-server-internal/npm_module_types",
"@types/kbn__core-execution-context-server-mocks": "link:bazel-bin/packages/core/execution-context/core-execution-context-server-mocks/npm_module_types",
"@types/kbn__core-fatal-errors-browser": "link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser/npm_module_types",
"@types/kbn__core-fatal-errors-browser-internal": "link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser-internal/npm_module_types",
"@types/kbn__core-fatal-errors-browser-mocks": "link:bazel-bin/packages/core/fatal-errors/core-fatal-errors-browser-mocks/npm_module_types",
"@types/kbn__core-http-browser": "link:bazel-bin/packages/core/http/core-http-browser/npm_module_types",
"@types/kbn__core-http-browser-internal": "link:bazel-bin/packages/core/http/core-http-browser-internal/npm_module_types",
"@types/kbn__core-http-browser-mocks": "link:bazel-bin/packages/core/http/core-http-browser-mocks/npm_module_types",
"@types/kbn__core-http-common": "link:bazel-bin/packages/core/http/core-http-common/npm_module_types",
"@types/kbn__core-http-context-server-internal": "link:bazel-bin/packages/core/http/core-http-context-server-internal/npm_module_types",
"@types/kbn__core-http-context-server-mocks": "link:bazel-bin/packages/core/http/core-http-context-server-mocks/npm_module_types",
"@types/kbn__core-http-request-handler-context-server": "link:bazel-bin/packages/core/http/core-http-request-handler-context-server/npm_module_types",
"@types/kbn__core-http-request-handler-context-server-internal": "link:bazel-bin/packages/core/http/core-http-request-handler-context-server-internal/npm_module_types",
"@types/kbn__core-http-resources-server": "link:bazel-bin/packages/core/http/core-http-resources-server/npm_module_types",
"@types/kbn__core-http-resources-server-internal": "link:bazel-bin/packages/core/http/core-http-resources-server-internal/npm_module_types",
"@types/kbn__core-http-resources-server-mocks": "link:bazel-bin/packages/core/http/core-http-resources-server-mocks/npm_module_types",
"@types/kbn__core-http-router-server-internal": "link:bazel-bin/packages/core/http/core-http-router-server-internal/npm_module_types",
"@types/kbn__core-http-router-server-mocks": "link:bazel-bin/packages/core/http/core-http-router-server-mocks/npm_module_types",
"@types/kbn__core-http-server": "link:bazel-bin/packages/core/http/core-http-server/npm_module_types",
"@types/kbn__core-http-server-internal": "link:bazel-bin/packages/core/http/core-http-server-internal/npm_module_types",
"@types/kbn__core-http-server-mocks": "link:bazel-bin/packages/core/http/core-http-server-mocks/npm_module_types",
"@types/kbn__core-i18n-browser": "link:bazel-bin/packages/core/i18n/core-i18n-browser/npm_module_types",
"@types/kbn__core-i18n-browser-internal": "link:bazel-bin/packages/core/i18n/core-i18n-browser-internal/npm_module_types",
"@types/kbn__core-i18n-browser-mocks": "link:bazel-bin/packages/core/i18n/core-i18n-browser-mocks/npm_module_types",
"@types/kbn__core-i18n-server": "link:bazel-bin/packages/core/i18n/core-i18n-server/npm_module_types",
"@types/kbn__core-i18n-server-internal": "link:bazel-bin/packages/core/i18n/core-i18n-server-internal/npm_module_types",
"@types/kbn__core-i18n-server-mocks": "link:bazel-bin/packages/core/i18n/core-i18n-server-mocks/npm_module_types",
"@types/kbn__core-injected-metadata-browser": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser/npm_module_types",
"@types/kbn__core-injected-metadata-browser-internal": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser-internal/npm_module_types",
"@types/kbn__core-injected-metadata-browser-mocks": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-browser-mocks/npm_module_types",
"@types/kbn__core-injected-metadata-common-internal": "link:bazel-bin/packages/core/injected-metadata/core-injected-metadata-common-internal/npm_module_types",
"@types/kbn__core-integrations-browser-internal": "link:bazel-bin/packages/core/integrations/core-integrations-browser-internal/npm_module_types",
"@types/kbn__core-integrations-browser-mocks": "link:bazel-bin/packages/core/integrations/core-integrations-browser-mocks/npm_module_types",
"@types/kbn__core-lifecycle-browser": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-browser/npm_module_types",
"@types/kbn__core-lifecycle-browser-internal": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-browser-internal/npm_module_types",
"@types/kbn__core-lifecycle-browser-mocks": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-browser-mocks/npm_module_types",
"@types/kbn__core-lifecycle-server": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-server/npm_module_types",
"@types/kbn__core-lifecycle-server-internal": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-server-internal/npm_module_types",
"@types/kbn__core-lifecycle-server-mocks": "link:bazel-bin/packages/core/lifecycle/core-lifecycle-server-mocks/npm_module_types",
"@types/kbn__core-logging-server": "link:bazel-bin/packages/core/logging/core-logging-server/npm_module_types",
"@types/kbn__core-logging-server-internal": "link:bazel-bin/packages/core/logging/core-logging-server-internal/npm_module_types",
"@types/kbn__core-logging-server-mocks": "link:bazel-bin/packages/core/logging/core-logging-server-mocks/npm_module_types",
"@types/kbn__core-metrics-collectors-server-internal": "link:bazel-bin/packages/core/metrics/core-metrics-collectors-server-internal/npm_module_types",
"@types/kbn__core-metrics-collectors-server-mocks": "link:bazel-bin/packages/core/metrics/core-metrics-collectors-server-mocks/npm_module_types",
"@types/kbn__core-metrics-server": "link:bazel-bin/packages/core/metrics/core-metrics-server/npm_module_types",
"@types/kbn__core-metrics-server-internal": "link:bazel-bin/packages/core/metrics/core-metrics-server-internal/npm_module_types",
"@types/kbn__core-metrics-server-mocks": "link:bazel-bin/packages/core/metrics/core-metrics-server-mocks/npm_module_types",
"@types/kbn__core-mount-utils-browser": "link:bazel-bin/packages/core/mount-utils/core-mount-utils-browser/npm_module_types",
"@types/kbn__core-mount-utils-browser-internal": "link:bazel-bin/packages/core/mount-utils/core-mount-utils-browser-internal/npm_module_types",
"@types/kbn__core-node-server": "link:bazel-bin/packages/core/node/core-node-server/npm_module_types",
"@types/kbn__core-node-server-internal": "link:bazel-bin/packages/core/node/core-node-server-internal/npm_module_types",
"@types/kbn__core-node-server-mocks": "link:bazel-bin/packages/core/node/core-node-server-mocks/npm_module_types",
"@types/kbn__core-notifications-browser": "link:bazel-bin/packages/core/notifications/core-notifications-browser/npm_module_types",
"@types/kbn__core-notifications-browser-internal": "link:bazel-bin/packages/core/notifications/core-notifications-browser-internal/npm_module_types",
"@types/kbn__core-notifications-browser-mocks": "link:bazel-bin/packages/core/notifications/core-notifications-browser-mocks/npm_module_types",
"@types/kbn__core-overlays-browser": "link:bazel-bin/packages/core/overlays/core-overlays-browser/npm_module_types",
"@types/kbn__core-overlays-browser-internal": "link:bazel-bin/packages/core/overlays/core-overlays-browser-internal/npm_module_types",
"@types/kbn__core-overlays-browser-mocks": "link:bazel-bin/packages/core/overlays/core-overlays-browser-mocks/npm_module_types",
"@types/kbn__core-plugins-base-server-internal": "link:bazel-bin/packages/core/plugins/core-plugins-base-server-internal/npm_module_types",
"@types/kbn__core-plugins-browser": "link:bazel-bin/packages/core/plugins/core-plugins-browser/npm_module_types",
"@types/kbn__core-plugins-browser-internal": "link:bazel-bin/packages/core/plugins/core-plugins-browser-internal/npm_module_types",
"@types/kbn__core-plugins-browser-mocks": "link:bazel-bin/packages/core/plugins/core-plugins-browser-mocks/npm_module_types",
"@types/kbn__core-plugins-server": "link:bazel-bin/packages/core/plugins/core-plugins-server/npm_module_types",
"@types/kbn__core-plugins-server-internal": "link:bazel-bin/packages/core/plugins/core-plugins-server-internal/npm_module_types",
"@types/kbn__core-plugins-server-mocks": "link:bazel-bin/packages/core/plugins/core-plugins-server-mocks/npm_module_types",
"@types/kbn__core-preboot-server": "link:bazel-bin/packages/core/preboot/core-preboot-server/npm_module_types",
"@types/kbn__core-preboot-server-internal": "link:bazel-bin/packages/core/preboot/core-preboot-server-internal/npm_module_types",
"@types/kbn__core-preboot-server-mocks": "link:bazel-bin/packages/core/preboot/core-preboot-server-mocks/npm_module_types",
"@types/kbn__core-public-internal-base": "link:bazel-bin/packages/core/public/internal-base/npm_module_types",
"@types/kbn__core-rendering-browser-internal": "link:bazel-bin/packages/core/rendering/core-rendering-browser-internal/npm_module_types",
"@types/kbn__core-rendering-browser-mocks": "link:bazel-bin/packages/core/rendering/core-rendering-browser-mocks/npm_module_types",
"@types/kbn__core-rendering-server-internal": "link:bazel-bin/packages/core/rendering/core-rendering-server-internal/npm_module_types",
"@types/kbn__core-rendering-server-mocks": "link:bazel-bin/packages/core/rendering/core-rendering-server-mocks/npm_module_types",
"@types/kbn__core-root-browser-internal": "link:bazel-bin/packages/core/root/core-root-browser-internal/npm_module_types",
"@types/kbn__core-saved-objects-api-browser": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-browser/npm_module_types",
"@types/kbn__core-saved-objects-api-server": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-server/npm_module_types",
"@types/kbn__core-saved-objects-api-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-server-internal/npm_module_types",
"@types/kbn__core-saved-objects-api-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-api-server-mocks/npm_module_types",
"@types/kbn__core-saved-objects-base-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-base-server-internal/npm_module_types",
"@types/kbn__core-saved-objects-base-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-base-server-mocks/npm_module_types",
"@types/kbn__core-saved-objects-browser": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser/npm_module_types",
"@types/kbn__core-saved-objects-browser-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser-internal/npm_module_types",
"@types/kbn__core-saved-objects-browser-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-browser-mocks/npm_module_types",
"@types/kbn__core-saved-objects-common": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-common/npm_module_types",
"@types/kbn__core-saved-objects-import-export-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-import-export-server-internal/npm_module_types",
"@types/kbn__core-saved-objects-import-export-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-import-export-server-mocks/npm_module_types",
"@types/kbn__core-saved-objects-migration-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-migration-server-internal/npm_module_types",
"@types/kbn__core-saved-objects-migration-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-migration-server-mocks/npm_module_types",
"@types/kbn__core-saved-objects-server": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-server/npm_module_types",
"@types/kbn__core-saved-objects-server-internal": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-server-internal/npm_module_types",
"@types/kbn__core-saved-objects-server-mocks": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-server-mocks/npm_module_types",
"@types/kbn__core-saved-objects-utils-server": "link:bazel-bin/packages/core/saved-objects/core-saved-objects-utils-server/npm_module_types",
"@types/kbn__core-server-internal-base": "link:bazel-bin/packages/core/server/internal-base/npm_module_types",
"@types/kbn__core-status-common": "link:bazel-bin/packages/core/status/core-status-common/npm_module_types",
"@types/kbn__core-status-common-internal": "link:bazel-bin/packages/core/status/core-status-common-internal/npm_module_types",
"@types/kbn__core-status-server": "link:bazel-bin/packages/core/status/core-status-server/npm_module_types",
"@types/kbn__core-status-server-internal": "link:bazel-bin/packages/core/status/core-status-server-internal/npm_module_types",
"@types/kbn__core-status-server-mocks": "link:bazel-bin/packages/core/status/core-status-server-mocks/npm_module_types",
"@types/kbn__core-test-helpers-deprecations-getters": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-deprecations-getters/npm_module_types",
"@types/kbn__core-test-helpers-http-setup-browser": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-http-setup-browser/npm_module_types",
"@types/kbn__core-test-helpers-so-type-serializer": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-so-type-serializer/npm_module_types",
"@types/kbn__core-test-helpers-test-utils": "link:bazel-bin/packages/core/test-helpers/core-test-helpers-test-utils/npm_module_types",
"@types/kbn__core-theme-browser": "link:bazel-bin/packages/core/theme/core-theme-browser/npm_module_types",
"@types/kbn__core-theme-browser-internal": "link:bazel-bin/packages/core/theme/core-theme-browser-internal/npm_module_types",
"@types/kbn__core-theme-browser-mocks": "link:bazel-bin/packages/core/theme/core-theme-browser-mocks/npm_module_types",
"@types/kbn__core-ui-settings-browser": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-browser/npm_module_types",
"@types/kbn__core-ui-settings-browser-internal": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-browser-internal/npm_module_types",
"@types/kbn__core-ui-settings-browser-mocks": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-browser-mocks/npm_module_types",
"@types/kbn__core-ui-settings-common": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-common/npm_module_types",
"@types/kbn__core-ui-settings-server": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-server/npm_module_types",
"@types/kbn__core-ui-settings-server-internal": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-server-internal/npm_module_types",
"@types/kbn__core-ui-settings-server-mocks": "link:bazel-bin/packages/core/ui-settings/core-ui-settings-server-mocks/npm_module_types",
"@types/kbn__core-usage-data-base-server-internal": "link:bazel-bin/packages/core/usage-data/core-usage-data-base-server-internal/npm_module_types",
"@types/kbn__core-usage-data-server": "link:bazel-bin/packages/core/usage-data/core-usage-data-server/npm_module_types",
"@types/kbn__core-usage-data-server-internal": "link:bazel-bin/packages/core/usage-data/core-usage-data-server-internal/npm_module_types",
"@types/kbn__core-usage-data-server-mocks": "link:bazel-bin/packages/core/usage-data/core-usage-data-server-mocks/npm_module_types",
"@types/kbn__crypto": "link:bazel-bin/packages/kbn-crypto/npm_module_types",
"@types/kbn__crypto-browser": "link:bazel-bin/packages/kbn-crypto-browser/npm_module_types",
"@types/kbn__datemath": "link:bazel-bin/packages/kbn-datemath/npm_module_types",
"@types/kbn__dev-cli-errors": "link:bazel-bin/packages/kbn-dev-cli-errors/npm_module_types",
"@types/kbn__dev-cli-runner": "link:bazel-bin/packages/kbn-dev-cli-runner/npm_module_types",
"@types/kbn__dev-proc-runner": "link:bazel-bin/packages/kbn-dev-proc-runner/npm_module_types",
"@types/kbn__dev-utils": "link:bazel-bin/packages/kbn-dev-utils/npm_module_types",
"@types/kbn__doc-links": "link:bazel-bin/packages/kbn-doc-links/npm_module_types",
"@types/kbn__docs-utils": "link:bazel-bin/packages/kbn-docs-utils/npm_module_types",
"@types/kbn__ebt-tools": "link:bazel-bin/packages/kbn-ebt-tools/npm_module_types",
"@types/kbn__es-archiver": "link:bazel-bin/packages/kbn-es-archiver/npm_module_types",
"@types/kbn__es-errors": "link:bazel-bin/packages/kbn-es-errors/npm_module_types",
"@types/kbn__es-query": "link:bazel-bin/packages/kbn-es-query/npm_module_types",
"@types/kbn__es-types": "link:bazel-bin/packages/kbn-es-types/npm_module_types",
"@types/kbn__eslint-plugin-disable": "link:bazel-bin/packages/kbn-eslint-plugin-disable/npm_module_types",
"@types/kbn__eslint-plugin-imports": "link:bazel-bin/packages/kbn-eslint-plugin-imports/npm_module_types",
"@types/kbn__failed-test-reporter-cli": "link:bazel-bin/packages/kbn-failed-test-reporter-cli/npm_module_types",
"@types/kbn__field-types": "link:bazel-bin/packages/kbn-field-types/npm_module_types",
"@types/kbn__find-used-node-modules": "link:bazel-bin/packages/kbn-find-used-node-modules/npm_module_types",
"@types/kbn__ftr-common-functional-services": "link:bazel-bin/packages/kbn-ftr-common-functional-services/npm_module_types",
"@types/kbn__ftr-screenshot-filename": "link:bazel-bin/packages/kbn-ftr-screenshot-filename/npm_module_types",
"@types/kbn__generate": "link:bazel-bin/packages/kbn-generate/npm_module_types",
"@types/kbn__get-repo-files": "link:bazel-bin/packages/kbn-get-repo-files/npm_module_types",
"@types/kbn__guided-onboarding": "link:bazel-bin/packages/kbn-guided-onboarding/npm_module_types",
"@types/kbn__handlebars": "link:bazel-bin/packages/kbn-handlebars/npm_module_types",
"@types/kbn__hapi-mocks": "link:bazel-bin/packages/kbn-hapi-mocks/npm_module_types",
"@types/kbn__home-sample-data-card": "link:bazel-bin/packages/home/sample_data_card/npm_module_types",
"@types/kbn__home-sample-data-tab": "link:bazel-bin/packages/home/sample_data_tab/npm_module_types",
"@types/kbn__home-sample-data-types": "link:bazel-bin/packages/home/sample_data_types/npm_module_types",
"@types/kbn__i18n": "link:bazel-bin/packages/kbn-i18n/npm_module_types",
"@types/kbn__i18n-react": "link:bazel-bin/packages/kbn-i18n-react/npm_module_types",
"@types/kbn__import-resolver": "link:bazel-bin/packages/kbn-import-resolver/npm_module_types",
"@types/kbn__interpreter": "link:bazel-bin/packages/kbn-interpreter/npm_module_types",
"@types/kbn__io-ts-utils": "link:bazel-bin/packages/kbn-io-ts-utils/npm_module_types",
"@types/kbn__jest-serializers": "link:bazel-bin/packages/kbn-jest-serializers/npm_module_types",
"@types/kbn__journeys": "link:bazel-bin/packages/kbn-journeys/npm_module_types",
"@types/kbn__kbn-ci-stats-performance-metrics": "link:bazel-bin/packages/kbn-kbn-ci-stats-performance-metrics/npm_module_types",
"@types/kbn__kibana-manifest-schema": "link:bazel-bin/packages/kbn-kibana-manifest-schema/npm_module_types",
"@types/kbn__language-documentation-popover": "link:bazel-bin/packages/kbn-language-documentation-popover/npm_module_types",
"@types/kbn__logging": "link:bazel-bin/packages/kbn-logging/npm_module_types",
"@types/kbn__logging-mocks": "link:bazel-bin/packages/kbn-logging-mocks/npm_module_types",
"@types/kbn__managed-vscode-config": "link:bazel-bin/packages/kbn-managed-vscode-config/npm_module_types",
"@types/kbn__managed-vscode-config-cli": "link:bazel-bin/packages/kbn-managed-vscode-config-cli/npm_module_types",
"@types/kbn__mapbox-gl": "link:bazel-bin/packages/kbn-mapbox-gl/npm_module_types",
"@types/kbn__ml-agg-utils": "link:bazel-bin/x-pack/packages/ml/agg_utils/npm_module_types",
"@types/kbn__ml-is-populated-object": "link:bazel-bin/x-pack/packages/ml/is_populated_object/npm_module_types",
"@types/kbn__ml-string-hash": "link:bazel-bin/x-pack/packages/ml/string_hash/npm_module_types",
"@types/kbn__monaco": "link:bazel-bin/packages/kbn-monaco/npm_module_types",
"@types/kbn__optimizer": "link:bazel-bin/packages/kbn-optimizer/npm_module_types",
"@types/kbn__optimizer-webpack-helpers": "link:bazel-bin/packages/kbn-optimizer-webpack-helpers/npm_module_types",
"@types/kbn__osquery-io-ts-types": "link:bazel-bin/packages/kbn-osquery-io-ts-types/npm_module_types",
"@types/kbn__performance-testing-dataset-extractor": "link:bazel-bin/packages/kbn-performance-testing-dataset-extractor/npm_module_types",
"@types/kbn__plugin-discovery": "link:bazel-bin/packages/kbn-plugin-discovery/npm_module_types",
"@types/kbn__plugin-generator": "link:bazel-bin/packages/kbn-plugin-generator/npm_module_types",
"@types/kbn__plugin-helpers": "link:bazel-bin/packages/kbn-plugin-helpers/npm_module_types",
"@types/kbn__react-field": "link:bazel-bin/packages/kbn-react-field/npm_module_types",
"@types/kbn__repo-source-classifier": "link:bazel-bin/packages/kbn-repo-source-classifier/npm_module_types",
"@types/kbn__repo-source-classifier-cli": "link:bazel-bin/packages/kbn-repo-source-classifier-cli/npm_module_types",
"@types/kbn__rule-data-utils": "link:bazel-bin/packages/kbn-rule-data-utils/npm_module_types",
"@types/kbn__securitysolution-autocomplete": "link:bazel-bin/packages/kbn-securitysolution-autocomplete/npm_module_types",
"@types/kbn__securitysolution-es-utils": "link:bazel-bin/packages/kbn-securitysolution-es-utils/npm_module_types",
"@types/kbn__securitysolution-exception-list-components": "link:bazel-bin/packages/kbn-securitysolution-exception-list-components/npm_module_types",
"@types/kbn__securitysolution-hook-utils": "link:bazel-bin/packages/kbn-securitysolution-hook-utils/npm_module_types",
"@types/kbn__securitysolution-io-ts-alerting-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-alerting-types/npm_module_types",
"@types/kbn__securitysolution-io-ts-list-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-list-types/npm_module_types",
"@types/kbn__securitysolution-io-ts-types": "link:bazel-bin/packages/kbn-securitysolution-io-ts-types/npm_module_types",
"@types/kbn__securitysolution-io-ts-utils": "link:bazel-bin/packages/kbn-securitysolution-io-ts-utils/npm_module_types",
"@types/kbn__securitysolution-list-api": "link:bazel-bin/packages/kbn-securitysolution-list-api/npm_module_types",
"@types/kbn__securitysolution-list-constants": "link:bazel-bin/packages/kbn-securitysolution-list-constants/npm_module_types",
"@types/kbn__securitysolution-list-hooks": "link:bazel-bin/packages/kbn-securitysolution-list-hooks/npm_module_types",
"@types/kbn__securitysolution-list-utils": "link:bazel-bin/packages/kbn-securitysolution-list-utils/npm_module_types",
"@types/kbn__securitysolution-rules": "link:bazel-bin/packages/kbn-securitysolution-rules/npm_module_types",
"@types/kbn__securitysolution-t-grid": "link:bazel-bin/packages/kbn-securitysolution-t-grid/npm_module_types",
"@types/kbn__securitysolution-utils": "link:bazel-bin/packages/kbn-securitysolution-utils/npm_module_types",
"@types/kbn__server-http-tools": "link:bazel-bin/packages/kbn-server-http-tools/npm_module_types",
"@types/kbn__server-route-repository": "link:bazel-bin/packages/kbn-server-route-repository/npm_module_types",
"@types/kbn__shared-svg": "link:bazel-bin/packages/kbn-shared-svg/npm_module_types",
"@types/kbn__shared-ux-avatar-solution": "link:bazel-bin/packages/shared-ux/avatar/solution/npm_module_types",
"@types/kbn__shared-ux-avatar-user-profile-components": "link:bazel-bin/packages/shared-ux/avatar/user_profile/impl/npm_module_types",
"@types/kbn__shared-ux-button-exit-full-screen": "link:bazel-bin/packages/shared-ux/button/exit_full_screen/impl/npm_module_types",
"@types/kbn__shared-ux-button-exit-full-screen-mocks": "link:bazel-bin/packages/shared-ux/button/exit_full_screen/mocks/npm_module_types",
"@types/kbn__shared-ux-button-exit-full-screen-types": "link:bazel-bin/packages/shared-ux/button/exit_full_screen/types/npm_module_types",
"@types/kbn__shared-ux-button-toolbar": "link:bazel-bin/packages/shared-ux/button_toolbar/npm_module_types",
"@types/kbn__shared-ux-card-no-data": "link:bazel-bin/packages/shared-ux/card/no_data/impl/npm_module_types",
"@types/kbn__shared-ux-card-no-data-mocks": "link:bazel-bin/packages/shared-ux/card/no_data/mocks/npm_module_types",
"@types/kbn__shared-ux-card-no-data-types": "link:bazel-bin/packages/shared-ux/card/no_data/types/npm_module_types",
"@types/kbn__shared-ux-link-redirect-app": "link:bazel-bin/packages/shared-ux/link/redirect_app/impl/npm_module_types",
"@types/kbn__shared-ux-link-redirect-app-mocks": "link:bazel-bin/packages/shared-ux/link/redirect_app/mocks/npm_module_types",
"@types/kbn__shared-ux-link-redirect-app-types": "link:bazel-bin/packages/shared-ux/link/redirect_app/types/npm_module_types",
"@types/kbn__shared-ux-markdown": "link:bazel-bin/packages/shared-ux/markdown/impl/npm_module_types",
"@types/kbn__shared-ux-markdown-mocks": "link:bazel-bin/packages/shared-ux/markdown/mocks/npm_module_types",
"@types/kbn__shared-ux-markdown-types": "link:bazel-bin/packages/shared-ux/markdown/types/npm_module_types",
"@types/kbn__shared-ux-page-analytics-no-data": "link:bazel-bin/packages/shared-ux/page/analytics_no_data/impl/npm_module_types",
"@types/kbn__shared-ux-page-analytics-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/analytics_no_data/mocks/npm_module_types",
"@types/kbn__shared-ux-page-analytics-no-data-types": "link:bazel-bin/packages/shared-ux/page/analytics_no_data/types/npm_module_types",
"@types/kbn__shared-ux-page-kibana-no-data": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/impl/npm_module_types",
"@types/kbn__shared-ux-page-kibana-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/mocks/npm_module_types",
"@types/kbn__shared-ux-page-kibana-no-data-types": "link:bazel-bin/packages/shared-ux/page/kibana_no_data/types/npm_module_types",
"@types/kbn__shared-ux-page-kibana-template": "link:bazel-bin/packages/shared-ux/page/kibana_template/impl/npm_module_types",
"@types/kbn__shared-ux-page-kibana-template-mocks": "link:bazel-bin/packages/shared-ux/page/kibana_template/mocks/npm_module_types",
"@types/kbn__shared-ux-page-kibana-template-types": "link:bazel-bin/packages/shared-ux/page/kibana_template/types/npm_module_types",
"@types/kbn__shared-ux-page-no-data": "link:bazel-bin/packages/shared-ux/page/no_data/impl/npm_module_types",
"@types/kbn__shared-ux-page-no-data-config": "link:bazel-bin/packages/shared-ux/page/no_data_config/impl/npm_module_types",
"@types/kbn__shared-ux-page-no-data-config-mocks": "link:bazel-bin/packages/shared-ux/page/no_data_config/mocks/npm_module_types",
"@types/kbn__shared-ux-page-no-data-config-types": "link:bazel-bin/packages/shared-ux/page/no_data_config/types/npm_module_types",
"@types/kbn__shared-ux-page-no-data-mocks": "link:bazel-bin/packages/shared-ux/page/no_data/mocks/npm_module_types",
"@types/kbn__shared-ux-page-no-data-types": "link:bazel-bin/packages/shared-ux/page/no_data/types/npm_module_types",
"@types/kbn__shared-ux-page-solution-nav": "link:bazel-bin/packages/shared-ux/page/solution_nav/npm_module_types",
"@types/kbn__shared-ux-prompt-no-data-views": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/impl/npm_module_types",
"@types/kbn__shared-ux-prompt-no-data-views-mocks": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/mocks/npm_module_types",
"@types/kbn__shared-ux-prompt-no-data-views-types": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/types/npm_module_types",
"@types/kbn__shared-ux-router-mocks": "link:bazel-bin/packages/shared-ux/router/mocks/npm_module_types",
"@types/kbn__shared-ux-services": "link:bazel-bin/packages/kbn-shared-ux-services/npm_module_types",
"@types/kbn__shared-ux-storybook": "link:bazel-bin/packages/kbn-shared-ux-storybook/npm_module_types",
"@types/kbn__shared-ux-storybook-mock": "link:bazel-bin/packages/shared-ux/storybook/mock/npm_module_types",
"@types/kbn__shared-ux-utility": "link:bazel-bin/packages/kbn-shared-ux-utility/npm_module_types",
"@types/kbn__some-dev-log": "link:bazel-bin/packages/kbn-some-dev-log/npm_module_types",
"@types/kbn__sort-package-json": "link:bazel-bin/packages/kbn-sort-package-json/npm_module_types",
"@types/kbn__std": "link:bazel-bin/packages/kbn-std/npm_module_types",
"@types/kbn__stdio-dev-helpers": "link:bazel-bin/packages/kbn-stdio-dev-helpers/npm_module_types",
"@types/kbn__storybook": "link:bazel-bin/packages/kbn-storybook/npm_module_types",
"@types/kbn__telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools/npm_module_types",
"@types/kbn__test": "link:bazel-bin/packages/kbn-test/npm_module_types",
"@types/kbn__test-jest-helpers": "link:bazel-bin/packages/kbn-test-jest-helpers/npm_module_types",
"@types/kbn__test-subj-selector": "link:bazel-bin/packages/kbn-test-subj-selector/npm_module_types",
"@types/kbn__tooling-log": "link:bazel-bin/packages/kbn-tooling-log/npm_module_types",
"@types/kbn__type-summarizer": "link:bazel-bin/packages/kbn-type-summarizer/npm_module_types",
"@types/kbn__type-summarizer-cli": "link:bazel-bin/packages/kbn-type-summarizer-cli/npm_module_types",
"@types/kbn__type-summarizer-core": "link:bazel-bin/packages/kbn-type-summarizer-core/npm_module_types",
"@types/kbn__typed-react-router-config": "link:bazel-bin/packages/kbn-typed-react-router-config/npm_module_types",
"@types/kbn__ui-shared-deps-npm": "link:bazel-bin/packages/kbn-ui-shared-deps-npm/npm_module_types",
"@types/kbn__ui-shared-deps-src": "link:bazel-bin/packages/kbn-ui-shared-deps-src/npm_module_types",
"@types/kbn__ui-theme": "link:bazel-bin/packages/kbn-ui-theme/npm_module_types",
"@types/kbn__user-profile-components": "link:bazel-bin/packages/kbn-user-profile-components/npm_module_types",
"@types/kbn__utility-types": "link:bazel-bin/packages/kbn-utility-types/npm_module_types",
"@types/kbn__utility-types-jest": "link:bazel-bin/packages/kbn-utility-types-jest/npm_module_types",
"@types/kbn__utils": "link:bazel-bin/packages/kbn-utils/npm_module_types",
"@types/kbn__yarn-lock-validator": "link:bazel-bin/packages/kbn-yarn-lock-validator/npm_module_types",
"@types/license-checker": "15.0.0",
"@types/listr": "^0.14.0",
"@types/loader-utils": "^1.1.3",

View file

@ -690,13 +690,18 @@ filegroup(
],
)
# Grouping target to call all underlying packages build
# targets so we can build them all at once
# It will auto build all declared code packages and types packages
# Grouping target to call all underlying packages js builds
filegroup(
name = "build",
srcs = [
":build_pkg_code",
":build_pkg_code"
],
)
# Grouping target to call all underlying packages ts builds
filegroup(
name = "build_types",
srcs = [
":build_pkg_types"
],
)

View file

@ -9,3 +9,4 @@
export { TableListView, TableListViewProvider, TableListViewKibanaProvider } from './src';
export type { UserContentCommonSchema } from './src';
export type { TableListViewKibanaDependencies } from './src/services';

View file

@ -9,7 +9,7 @@
export { ScopedClusterClient } from './src/scoped_cluster_client';
export { ClusterClient } from './src/cluster_client';
export { configureClient } from './src/configure_client';
export { type AgentStore, AgentManager } from './src/agent_manager';
export { type AgentStore, AgentManager, type NetworkAgent } from './src/agent_manager';
export { getRequestDebugMeta, getErrorMessage } from './src/log_query_and_deprecation';
export {
PRODUCT_RESPONSE_HEADER,

View file

@ -29,3 +29,4 @@ export {
export { CoreElasticsearchRouteHandlerContext } from './src/elasticsearch_route_handler_context';
export { retryCallCluster, migrationRetryCallCluster } from './src/retry_call_cluster';
export { isInlineScriptingEnabled } from './src/is_scripting_enabled';
export type { ClusterInfo } from './src/get_cluster_info';

View file

@ -8,5 +8,5 @@
export { nodeConfig } from './src/node_config';
export { NodeService } from './src/node_service';
export { NodeService, type PrebootDeps } from './src/node_service';
export type { InternalNodeServicePreboot } from './src/node_service';

View file

@ -33,7 +33,7 @@ export interface InternalNodeServicePreboot {
roles: NodeRoles;
}
interface PrebootDeps {
export interface PrebootDeps {
loggingSystem: ILoggingSystem;
}

View file

@ -22,6 +22,7 @@ export type {
ExistsFilter,
FieldFilter,
Filter,
FilterItem,
FilterCompareOptions,
FilterMeta,
LatLon,

View file

@ -19,3 +19,5 @@ export type EsArchiver = ProvidedType<typeof EsArchiverProvider>;
import { EsProvider } from './services/es';
export type Es = ProvidedType<typeof EsProvider>;
export type { FtrProviderContext } from './services/ftr_provider_context';

View file

@ -99,7 +99,6 @@ ts_project(
srcs = SRCS,
deps = TYPES_DEPS,
declaration = True,
declaration_map = True,
emit_declaration_only = True,
out_dir = "target_types",
tsconfig = ":tsconfig",
@ -113,6 +112,14 @@ js_library(
visibility = ["//visibility:public"],
)
js_library(
name = "npm_module_types",
srcs = NPM_MODULE_EXTRA_FILES,
deps = RUNTIME_DEPS + <%- pkg.web ? '[":target_node", ":target_web", ":tsc_types"]' : '[":target_node", ":tsc_types"]' %>,
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)
pkg_npm(
name = "npm_module",
deps = [":" + PKG_DIRNAME],
@ -124,15 +131,6 @@ filegroup(
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"],

View file

@ -3,7 +3,8 @@
"version": "1.0.0",
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target_node/index.js"
"main": "./target_node/index.js",
"types": "./target_types/index.d.ts"
<%_ if (pkg.web) { %>,
"browser": "./target_web/index.js"
<%_ } %>

View file

@ -2,7 +2,6 @@
"extends": "<%- relativePathTo("tsconfig.bazel.json") %>",
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "target_types",
"stripInternal": false,

View file

@ -25,13 +25,18 @@ filegroup(
],
)
# Grouping target to call all underlying packages build
# targets so we can build them all at once
# It will auto build all declared code packages and types packages
# Grouping target to call all underlying packages js builds
filegroup(
name = "build",
srcs = [
":build_pkg_code",
":build_pkg_code"
],
)
# Grouping target to call all underlying packages ts builds
filegroup(
name = "build_types",
srcs = [
":build_pkg_types"
],
)

View file

@ -6,6 +6,6 @@
* Side Public License, v 1.
*/
export type { GuideState, GuideId } from './src/types';
export type { GuideState, GuideId, GuideStepIds, StepStatus, GuideStep } from './src/types';
export { GuideCard, ObservabilityLinkCard } from './src/components/landing_page';
export type { UseCase } from './src/components/landing_page';

View file

@ -14,4 +14,11 @@ export type { LogMeta } from './src/log_meta';
export type { LoggerFactory } from './src/logger_factory';
export type { Layout } from './src/layout';
export type { Appender, DisposableAppender } from './src/appenders';
export type { Ecs, EcsEventCategory, EcsEventKind, EcsEventOutcome, EcsEventType } from './src/ecs';
export type {
Ecs,
EcsEvent,
EcsEventCategory,
EcsEventKind,
EcsEventOutcome,
EcsEventType,
} from './src/ecs';

View file

@ -45,7 +45,13 @@ import { EcsUser } from './user';
import { EcsUserAgent } from './user_agent';
import { EcsVulnerability } from './vulnerability';
export type { EcsEventCategory, EcsEventKind, EcsEventOutcome, EcsEventType } from './event';
export type {
EcsEvent,
EcsEventCategory,
EcsEventKind,
EcsEventOutcome,
EcsEventType,
} from './event';
interface EcsField {
/**

View file

@ -6,6 +6,8 @@
* Side Public License, v 1.
*/
/** @typedef {import('./src/types').KibanaPlatformPlugin} KibanaPlatformPlugin */
const { parseKibanaPlatformPlugin } = require('./src/parse_kibana_platform_plugin');
const { getPluginSearchPaths } = require('./src/plugin_search_paths');
const {

View file

@ -26,6 +26,7 @@ function getPluginSearchPaths({ rootDir, oss, examples, testPlugins }) {
resolve(rootDir, 'test/plugin_functional/plugins'),
resolve(rootDir, 'test/interpreter_functional/plugins'),
resolve(rootDir, 'test/common/fixtures/plugins'),
resolve(rootDir, 'test/server_integration/__fixtures__/plugins'),
]
: []),
...(testPlugins && !oss

View file

@ -4,7 +4,6 @@
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"incremental": false,
"outDir": "./target_types",
"stripInternal": false,
"types": [

View file

@ -4,7 +4,6 @@
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"incremental": false,
"outDir": "target_types",
"skipLibCheck": true,
"target": "es2015",

View file

@ -6,4 +6,4 @@
* Side Public License, v 1.
*/
export { AbstractStorybookMock } from './src/mocks';
export { AbstractStorybookMock, type ArgumentParams } from './src/mocks';

View file

@ -1,10 +0,0 @@
/*
* 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.
*/
require('../src/setup_node_env');
require('../src/dev/typescript/convert_all_to_composite');

View file

@ -36,5 +36,4 @@ export * from './verify_env_task';
export * from './write_sha_sums_task';
export * from './fetch_agent_versions_list';
// @ts-expect-error this module can't be TS because it ends up pulling x-pack into Kibana
export { InstallChromium } from './install_chromium';

View file

@ -19,7 +19,7 @@ export interface I18nConfig {
}
export async function checkConfigNamespacePrefix(configPath: string) {
const { prefix, paths } = JSON.parse(await readFileAsync(resolve(configPath)));
const { prefix, paths } = JSON.parse(await readFileAsync(resolve(configPath), 'utf8'));
for (const [namespace] of Object.entries(paths)) {
if (prefix && prefix !== namespace.split('.')[0]) {
throw new Error(`namespace ${namespace} must be prefixed with ${prefix} in ${configPath}`);
@ -35,7 +35,7 @@ export async function assignConfigFromPath(
paths: {},
exclude: [],
translations: [],
...JSON.parse(await readFileAsync(resolve(configPath))),
...JSON.parse(await readFileAsync(resolve(configPath), 'utf8')),
};
for (const [namespace, namespacePaths] of Object.entries(additionalConfig.paths)) {

View file

@ -70,45 +70,38 @@ export async function matchEntriesWithExctractors(inputPath, options = {}) {
absolute,
});
const codeEntries = entries.reduce((paths, entry) => {
const resolvedPath = path.resolve(inputPath, entry);
paths.push(resolvedPath);
return paths;
}, []);
return [[codeEntries, extractCodeMessages]];
return {
entries: entries.map((entry) => path.resolve(inputPath, entry)),
extractFunction: extractCodeMessages,
};
}
export async function extractMessagesFromPathToMap(inputPath, targetMap, config, reporter) {
const categorizedEntries = await matchEntriesWithExctractors(inputPath);
return Promise.all(
categorizedEntries.map(async ([entries, extractFunction]) => {
const files = await Promise.all(
filterEntries(entries, config.exclude).map(async (entry) => {
return {
name: entry,
content: await readFileAsync(entry),
};
})
);
const { entries, extractFunction } = await matchEntriesWithExctractors(inputPath);
for (const { name, content } of files) {
const reporterWithContext = reporter.withContext({ name });
try {
for (const [id, value] of extractFunction(content, reporterWithContext)) {
validateMessageNamespace(id, name, config.paths, reporterWithContext);
addMessageToMap(targetMap, id, value, reporterWithContext);
}
} catch (error) {
if (!isFailError(error)) {
throw error;
}
reporterWithContext.report(error);
}
}
const files = await Promise.all(
filterEntries(entries, config.exclude).map(async (entry) => {
return {
name: entry,
content: await readFileAsync(entry),
};
})
);
for (const { name, content } of files) {
const reporterWithContext = reporter.withContext({ name });
try {
for (const [id, value] of extractFunction(content, reporterWithContext)) {
validateMessageNamespace(id, name, config.paths, reporterWithContext);
addMessageToMap(targetMap, id, value, reporterWithContext);
}
} catch (error) {
if (!isFailError(error)) {
throw error;
}
reporterWithContext.report(error);
}
}
}

View file

@ -7,13 +7,9 @@
*/
import { createFailError } from '@kbn/dev-cli-errors';
import {
I18nConfig,
matchEntriesWithExctractors,
normalizePath,
readFileAsync,
ErrorReporter,
} from '..';
import { matchEntriesWithExctractors } from '../extract_default_translations';
import { I18nConfig } from '../config';
import { normalizePath, readFileAsync, ErrorReporter } from '../utils';
function filterEntries(entries: string[], exclude: string[]) {
return entries.filter((entry: string) =>
@ -45,35 +41,33 @@ export async function extractUntrackedMessagesTask({
'**/dist/**',
]);
for (const inputPath of inputPaths) {
const categorizedEntries = await matchEntriesWithExctractors(inputPath, {
const { entries, extractFunction } = await matchEntriesWithExctractors(inputPath, {
additionalIgnore: ignore,
mark: true,
absolute: true,
});
for (const [entries, extractFunction] of categorizedEntries) {
const files = await Promise.all(
filterEntries(entries, config.exclude)
.filter((entry) => {
const normalizedEntry = normalizePath(entry);
return !availablePaths.some(
(availablePath) =>
normalizedEntry.startsWith(`${normalizePath(availablePath)}/`) ||
normalizePath(availablePath) === normalizedEntry
);
})
.map(async (entry: any) => ({
name: entry,
content: await readFileAsync(entry),
}))
);
const files = await Promise.all(
filterEntries(entries, config.exclude)
.filter((entry) => {
const normalizedEntry = normalizePath(entry);
return !availablePaths.some(
(availablePath) =>
normalizedEntry.startsWith(`${normalizePath(availablePath)}/`) ||
normalizePath(availablePath) === normalizedEntry
);
})
.map(async (entry: any) => ({
name: entry,
content: await readFileAsync(entry),
}))
);
for (const { name, content } of files) {
const reporterWithContext = reporter.withContext({ name });
for (const [id] of extractFunction(content, reporterWithContext)) {
const errorMessage = `Untracked file contains i18n label (${id}).`;
reporterWithContext.report(createFailError(errorMessage));
}
for (const { name, content } of files) {
const reporterWithContext = reporter.withContext({ name });
for (const [id] of extractFunction(content, reporterWithContext)) {
const errorMessage = `Untracked file contains i18n label (${id}).`;
reporterWithContext.report(createFailError(errorMessage));
}
}
}

View file

@ -17,7 +17,6 @@ export {
difference,
isPropertyWithKey,
isI18nTranslateFunction,
node,
formatJSString,
formatHTMLString,
traverseNodes,
@ -30,7 +29,7 @@ export {
extractValuesKeysFromNode,
arrayify,
// classes
ErrorReporter, // @ts-ignore
ErrorReporter,
} from './utils';
export { verifyICUMessage } from './verify_icu_message';

View file

@ -19,7 +19,6 @@ import { generateNodeNoticeText } from './generate_node_notice_text';
* getInstalledPackages() in ../packages
* @property {string} options.nodeDir The directory containing the version of node.js
* that will ship with Kibana
* @return {undefined}
*/
export async function generateBuildNoticeText(options = {}) {
const { packages, nodeDir, nodeVersion, noticeFromSource } = options;

View file

@ -11,7 +11,6 @@ import globby from 'globby';
import { REPO_ROOT } from '@kbn/utils';
import { run } from '@kbn/dev-cli-runner';
import { File } from './file';
// @ts-expect-error precommit hooks aren't migrated to TypeScript yet.
import { checkFileCasing } from './precommit_hook/check_file_casing';
run(async ({ log }) => {

View file

@ -132,7 +132,7 @@ run(
reportTime(runStartTime, 'total', {
success: true,
});
} catch (error: Error | ErrorReporter) {
} catch (error) {
process.exitCode = 1;
if (error instanceof ErrorReporter) {
error.errors.forEach((e: string | Error) => log.error(e));

View file

@ -1,43 +0,0 @@
/*
* 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.
*/
import Path from 'path';
import { ProcRunner } from '@kbn/dev-proc-runner';
import { ToolingLog } from '@kbn/tooling-log';
import { REPO_ROOT } from '@kbn/utils';
import { ROOT_REFS_CONFIG_PATH } from './root_refs_config';
import { Project } from './project';
export async function buildTsRefs({
log,
procRunner,
verbose,
project,
}: {
log: ToolingLog;
procRunner: ProcRunner;
verbose?: boolean;
project?: Project;
}): Promise<{ failed: boolean }> {
const relative = Path.relative(REPO_ROOT, project ? project.tsConfigPath : ROOT_REFS_CONFIG_PATH);
log.info(`Building TypeScript projects refs for ${relative}...`);
try {
await procRunner.run('tsc', {
cmd: Path.relative(REPO_ROOT, require.resolve('typescript/bin/tsc')),
args: ['-b', relative, '--pretty', ...(verbose ? ['--verbose'] : [])],
cwd: REPO_ROOT,
wait: true,
});
return { failed: false };
} catch (error) {
return { failed: true };
}
}

View file

@ -1,147 +0,0 @@
/*
* 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.
*/
import Path from 'path';
import { run } from '@kbn/dev-cli-runner';
import { createFlagError } from '@kbn/dev-cli-errors';
import { REPO_ROOT } from '@kbn/utils';
import del from 'del';
import { RefOutputCache } from './ref_output_cache';
import { buildTsRefs } from './build_ts_refs';
import { updateRootRefsConfig, ROOT_REFS_CONFIG_PATH } from './root_refs_config';
import { Project } from './project';
import { PROJECT_CACHE } from './projects';
import { concurrentMap } from './concurrent_map';
const CACHE_WORKING_DIR = Path.resolve(REPO_ROOT, 'data/ts_refs_output_cache');
const TS_ERROR_REF = /\sTS\d{1,6}:\s/;
const isTypeFailure = (error: any) =>
error.exitCode > 0 &&
error.stderr === '' &&
typeof error.stdout === 'string' &&
TS_ERROR_REF.test(error.stdout);
export async function runBuildRefsCli() {
run(
async ({ log, flags, procRunner, statsMeta }) => {
const enabled = process.env.BUILD_TS_REFS_DISABLE !== 'true' || !!flags.force;
statsMeta.set('buildTsRefsEnabled', enabled);
if (!enabled) {
log.info(
'Building ts refs is disabled because the BUILD_TS_REFS_DISABLE environment variable is set to "true". Pass `--force` to run the build anyway.'
);
return;
}
const projectFilter = flags.project;
if (projectFilter && typeof projectFilter !== 'string') {
throw createFlagError('expected --project to be a string');
}
// if the tsconfig.refs.json file is not self-managed then make sure it has
// a reference to every composite project in the repo
await updateRootRefsConfig(log);
const rootProject = Project.load(
projectFilter ? projectFilter : ROOT_REFS_CONFIG_PATH,
{},
{
skipConfigValidation: true,
}
);
// load all the projects referenced from the root project deeply, so we know all
// the ts projects we are going to be cleaning or populating with caches
const projects = rootProject.getProjectsDeep(PROJECT_CACHE);
const cacheEnabled = process.env.BUILD_TS_REFS_CACHE_ENABLE !== 'false' && !!flags.cache;
const doCapture = process.env.BUILD_TS_REFS_CACHE_CAPTURE === 'true';
const doClean = !!flags.clean || doCapture;
const doInitCache = cacheEnabled && !doCapture;
if (doCapture && projectFilter) {
throw createFlagError('--project can not be combined with cache capture');
}
statsMeta.set('buildTsRefsEnabled', enabled);
statsMeta.set('buildTsRefsCacheEnabled', cacheEnabled);
statsMeta.set('buildTsRefsDoCapture', doCapture);
statsMeta.set('buildTsRefsDoClean', doClean);
statsMeta.set('buildTsRefsDoInitCache', doInitCache);
if (doClean) {
log.info('deleting', projects.outDirs.length, 'ts output directories');
await concurrentMap(100, projects.outDirs, (outDir) => del(outDir));
}
let outputCache;
if (cacheEnabled) {
outputCache = await RefOutputCache.create({
log,
projects,
repoRoot: REPO_ROOT,
workingDir: CACHE_WORKING_DIR,
upstreamUrl: 'https://github.com/elastic/kibana.git',
});
}
if (outputCache && doInitCache) {
await outputCache.initCaches();
}
try {
await buildTsRefs({
log,
procRunner,
verbose: !!flags.verbose,
project: rootProject,
});
log.success('ts refs build successfully');
} catch (error) {
const typeFailure = isTypeFailure(error);
if (flags['ignore-type-failures'] && typeFailure) {
log.warning(
'tsc reported type errors but we are ignoring them for now, to see them please run `node scripts/type_check` or `node scripts/build_ts_refs` without the `--ignore-type-failures` flag.'
);
} else {
throw error;
}
}
if (outputCache && doCapture) {
await outputCache.captureCache(Path.resolve(REPO_ROOT, 'target/ts_refs_cache'));
}
if (outputCache) {
await outputCache.cleanup();
}
},
{
description: 'Build TypeScript project references',
flags: {
boolean: ['clean', 'force', 'cache', 'ignore-type-failures'],
string: ['project'],
default: {
cache: true,
},
help: `
--project Only build the TS Refs for a specific project
--force Run the build even if the BUILD_TS_REFS_DISABLE is set to "true"
--clean Delete outDirs for each ts project before building
--no-cache Disable fetching/extracting outDir caches based on the mergeBase with upstream
--ignore-type-failures If tsc reports type errors, ignore them and just log a small warning
`,
},
}
);
}

View file

@ -1,31 +0,0 @@
/*
* 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.
*/
import * as Rx from 'rxjs';
import { mergeMap, toArray, map } from 'rxjs/operators';
export async function concurrentMap<T, T2>(
concurrency: number,
arr: T[],
fn: (item: T, i: number) => Promise<T2>
): Promise<T2[]> {
if (!arr.length) {
return [];
}
return await Rx.lastValueFrom(
Rx.from(arr).pipe(
// execute items in parallel based on concurrency
mergeMap(async (item, index) => ({ index, result: await fn(item, index) }), concurrency),
// collect the results into an array
toArray(),
// sort items back into order and return array of just results
map((list) => list.sort((a, b) => a.index - b.index).map(({ result }) => result))
)
);
}

View file

@ -1,19 +0,0 @@
/*
* 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.
*/
import { run } from '@kbn/dev-cli-runner';
import { PROJECTS } from './projects';
run(async ({ log }) => {
for (const project of PROJECTS) {
if (!project.config.compilerOptions?.composite) {
log.info(project.tsConfigPath);
}
}
});

View file

@ -1,48 +0,0 @@
/*
* 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.
*/
import { relative, resolve } from 'path';
import { REPO_ROOT } from '@kbn/utils';
import { File } from '../file';
import { Project } from './project';
import { PROJECTS } from './projects';
/**
* Finds the `tsconfig.json` Project object for a specific path by looking through
* Project instances defined in `src/dev/typescript/projects.ts`. If there isn't exactly one project
* that includes the path an error is thrown with, hopefully, a helpful error
* message that aims to help developers know how to fix the situation and ensure
* that each TypeScript file maps to only a single `tsconfig.json` file.
*
* @param path Absolute path to a .ts file
*/
export function getTsProjectForAbsolutePath(path: string): Project {
const relPath = relative(REPO_ROOT, path);
const file = new File(resolve(REPO_ROOT, path));
const projects = PROJECTS.filter((p) => p.isAbsolutePathSelected(path));
if (!projects.length) {
throw new Error(
`Unable to find tsconfig.json file selecting "${relPath}". Ensure one exists and it is listed in "src/dev/typescript/projects.ts"`
);
}
if (projects.length !== 1 && !file.isTypescriptAmbient()) {
const configPaths = projects.map((p) => `"${relative(REPO_ROOT, p.tsConfigPath)}"`);
const pathsMsg = `${configPaths.slice(0, -1).join(', ')} or ${
configPaths[configPaths.length - 1]
}`;
throw new Error(
`"${relPath}" is selected by multiple tsconfig.json files. This probably means the includes/excludes in ${pathsMsg} are too broad and include the code from multiple projects.`
);
}
return projects[0];
}

View file

@ -7,6 +7,4 @@
*/
export { Project } from './project';
export { getTsProjectForAbsolutePath } from './get_ts_project_for_absolute_path';
export { runTypeCheckCli } from './run_type_check_cli';
export * from './build_ts_refs_cli';

View file

@ -12,7 +12,6 @@ import { IMinimatch, Minimatch } from 'minimatch';
import { REPO_ROOT } from '@kbn/utils';
import { parseTsConfig } from './ts_configfile';
import { ProjectSet } from './project_set';
function makeMatchers(directory: string, patterns: string[]) {
return patterns.map(
@ -109,6 +108,8 @@ export class Project {
return project;
}
public readonly typeCheckConfigPath: string;
constructor(
public readonly tsConfigPath: string,
public readonly directory: string,
@ -121,7 +122,9 @@ export class Project {
private readonly includePatterns?: string[],
private readonly exclude?: IMinimatch[],
private readonly excludePatterns?: string[]
) {}
) {
this.typeCheckConfigPath = Path.resolve(this.directory, 'tsconfig.type_check.json');
}
public getIncludePatterns(): string[] {
return this.includePatterns
@ -146,11 +149,6 @@ export class Project {
return testMatchers(this.getExclude(), path) ? false : testMatchers(this.getInclude(), path);
}
public isCompositeProject(): boolean {
const own = this.config.compilerOptions?.composite;
return !!(own === undefined ? this.baseProject?.isCompositeProject() : own);
}
public getOutDir(): string | undefined {
if (this.config.compilerOptions?.outDir) {
return Path.resolve(this.directory, this.config.compilerOptions.outDir);
@ -171,21 +169,6 @@ export class Project {
return this.baseProject ? this.baseProject.getRefdPaths() : [];
}
public getProjectsDeep(cache?: Map<string, Project>) {
const projects = new Set<Project>();
const queue = new Set<string>([this.tsConfigPath]);
for (const path of queue) {
const project = Project.load(path, {}, { skipConfigValidation: true, cache });
projects.add(project);
for (const refPath of project.getRefdPaths()) {
queue.add(refPath);
}
}
return new ProjectSet(projects);
}
public getConfigPaths(): string[] {
return this.baseProject
? [this.tsConfigPath, ...this.baseProject.getConfigPaths()]

View file

@ -1,29 +0,0 @@
/*
* 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.
*/
import { Project } from './project';
export class ProjectSet {
public readonly outDirs: string[];
private readonly projects: Project[];
constructor(projects: Iterable<Project>) {
this.projects = [...projects];
this.outDirs = this.projects
.map((p) => p.getOutDir())
.filter((p): p is string => typeof p === 'string');
}
filterByPaths(paths: string[]) {
return new ProjectSet(
this.projects.filter((p) =>
paths.some((f) => p.isAbsolutePathSelected(f) || p.getConfigPaths().includes(f))
)
);
}
}

View file

@ -32,7 +32,12 @@ export const PROJECTS = [
createProject('x-pack/test/tsconfig.json', { name: 'x-pack/test' }),
createProject('x-pack/performance/tsconfig.json', { name: 'x-pack/performance' }),
createProject('src/core/tsconfig.json'),
createProject('.buildkite/tsconfig.json'),
createProject('.buildkite/tsconfig.json', {
// this directory has additionally dependencies which scripts/type_check can't guarantee
// are present or up-to-date, and users likely won't know how to manage either, so the
// type check is explicitly disabled in this project for now
disableTypeCheck: true,
}),
createProject('kbn_pm/tsconfig.json'),
createProject('x-pack/plugins/drilldowns/url_drilldown/tsconfig.json', {
@ -89,14 +94,15 @@ export const PROJECTS = [
'src/plugins/*/tsconfig.json',
'src/plugins/chart_expressions/*/tsconfig.json',
'src/plugins/vis_types/*/tsconfig.json',
'examples/*/tsconfig.json',
'test/*/plugins/*/tsconfig.json',
'test/analytics/fixtures/plugins/*/tsconfig.json',
'test/server_integration/__fixtures__/plugins/*/tsconfig.json',
'test/interactive_setup_api_integration/fixtures/*/tsconfig.json',
'x-pack/plugins/*/tsconfig.json',
'x-pack/plugins/cloud_integrations/*/tsconfig.json',
'examples/*/tsconfig.json',
'x-pack/examples/*/tsconfig.json',
'test/analytics/fixtures/plugins/*/tsconfig.json',
'test/plugin_functional/plugins/*/tsconfig.json',
'test/interpreter_functional/plugins/*/tsconfig.json',
'test/server_integration/__fixtures__/plugins/*/tsconfig.json',
'x-pack/test/*/plugins/*/tsconfig.json',
...BAZEL_PACKAGE_DIRS.map((dir) => `${dir}/*/tsconfig.json`),
]),
];

View file

@ -1,17 +0,0 @@
# `node scripts/build_ts_refs` output cache
This module implements the logic for caching the output of building the ts refs and extracting those caches into the source repo to speed up the execution of this script. We've implemented this as a stop-gap solution while we migrate to Bazel which will handle caching the types produced by the
scripts independently and speed things up incredibly, but in the meantime we need something to fix the 10 minute bootstrap times we're seeing.
How it works:
1. traverse the TS projects referenced from `tsconfig.refs.json` and collect their `compilerOptions.outDir` setting.
2. determine the `upstreamBranch` by reading the `branch` property out of `package.json`
3. fetch the latest changes from `https://github.com/elastic/kibana.git` for that branch
4. determine the merge base between `HEAD` and the latest ref from the `upstreamBranch`
5. check in the `data/ts_refs_output_cache/archives` dir (where we keep the 10 most recent downloads) and at `https://ts-refs-cache.kibana.dev/{sha}.zip` for the cache of the merge base commit, and up to 5 commits before that in the log, stopping once we find one that is available locally or was downloaded.
6. check for the `.ts-ref-cache-merge-base` file in each `outDir`, which records the `mergeBase` that was used to initialize that `outDir`, if the file exists and matches the `sha` that we plan to use for our cache then exclude that `outDir` from getting initialized with the cache data
7. for each `outDir` that either hasn't been initialized with cache data or was initialized with cache data from another merge base, delete the `outDir` and replace it with the copy stored in the downloaded cache
1. if there isn't a cached version of that `outDir` replace it with an empty directory
8. write the current `mergeBase` to the `.ts-ref-cache-merge-base` file in each `outDir`
9. run `tsc`, which will only build things which have changed since the cache was created

View file

@ -1,186 +0,0 @@
/*
* 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.
*/
import Fs from 'fs/promises';
import { createWriteStream } from 'fs';
import Path from 'path';
import { promisify } from 'util';
import { pipeline } from 'stream';
import { ToolingLog } from '@kbn/tooling-log';
import Axios from 'axios';
import del from 'del';
// https://github.com/axios/axios/tree/ffea03453f77a8176c51554d5f6c3c6829294649/lib/adapters
// @ts-expect-error untyped internal module used to prevent axios from using xhr adapter in tests
import AxiosHttpAdapter from 'axios/lib/adapters/http';
interface Archive {
sha: string;
path: string;
time: number;
}
const asyncPipeline = promisify(pipeline);
async function getCacheNames(cacheDir: string) {
try {
return await Fs.readdir(cacheDir);
} catch (error) {
if (error.code === 'ENOENT') {
return [];
}
throw error;
}
}
export class Archives {
static async create(log: ToolingLog, workingDir: string) {
const dir = Path.resolve(workingDir, 'archives');
const bySha = new Map<string, Archive>();
for (const name of await getCacheNames(dir)) {
const path = Path.resolve(dir, name);
if (!name.endsWith('.zip')) {
log.debug('deleting unexpected file in archives dir', path);
await Fs.unlink(path);
continue;
}
const sha = name.replace('.zip', '');
log.verbose('identified archive for', sha);
const s = await Fs.stat(path);
const time = Math.max(s.atimeMs, s.mtimeMs);
bySha.set(sha, {
path,
time,
sha,
});
}
return new Archives(log, workingDir, bySha);
}
protected constructor(
private readonly log: ToolingLog,
private readonly workDir: string,
private readonly bySha: Map<string, Archive>
) {}
size() {
return this.bySha.size;
}
get(sha: string) {
return this.bySha.get(sha);
}
async delete(sha: string) {
const archive = this.get(sha);
if (archive) {
await Fs.unlink(archive.path);
this.bySha.delete(sha);
}
}
*[Symbol.iterator]() {
yield* this.bySha.values();
}
/**
* Attempt to download the cache for a given sha, adding it to this.bySha
* and returning true if successful, logging and returning false otherwise.
*
* @param sha the commit sha we should try to download the cache for
*/
async attemptToDownload(sha: string) {
if (this.bySha.has(sha)) {
return true;
}
const url = `https://ts-refs-cache.kibana.dev/${sha}.zip`;
this.log.debug('attempting to download cache for', sha, 'from', url);
const filename = `${sha}.zip`;
const target = Path.resolve(this.workDir, 'archives', `${filename}`);
const tmpTarget = `${target}.tmp`;
try {
const resp = await Axios.request({
url,
responseType: 'stream',
adapter: AxiosHttpAdapter,
});
await Fs.mkdir(Path.dirname(target), { recursive: true });
await asyncPipeline(resp.data, createWriteStream(tmpTarget));
this.log.debug('download complete, renaming tmp');
await Fs.rename(tmpTarget, target);
this.bySha.set(sha, {
sha,
path: target,
time: Date.now(),
});
this.log.debug('download of cache for', sha, 'complete');
return true;
} catch (error) {
await del(tmpTarget, { force: true });
if (!error.response) {
this.log.debug(`failed to download cache, ignoring error:`, error.message);
return false;
}
if (error.response.status === 404) {
return false;
}
this.log.debug(`failed to download cache,`, error.response.status, 'response');
}
}
/**
* Iterate through a list of shas, which represent commits
* on our upstreamBranch, and look for caches which are
* already downloaded, or try to download them. If the cache
* for that commit is not available for any reason the next
* sha will be tried.
*
* If we reach the end of the list without any caches being
* available undefined is returned.
*
* @param shas shas for commits to try and find caches for
*/
async getFirstAvailable(shas: string[]): Promise<Archive | undefined> {
if (!shas.length) {
throw new Error('no possible shas to pick archive from');
}
for (const sha of shas) {
let archive = this.bySha.get(sha);
// if we don't have one locally try to download one
if (!archive && (await this.attemptToDownload(sha))) {
archive = this.bySha.get(sha);
}
// if we found the archive return it
if (archive) {
return archive;
}
this.log.debug('no archive available for', sha);
}
return undefined;
}
}

View file

@ -1,9 +0,0 @@
/*
* 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 * from './ref_output_cache';

View file

@ -1,239 +0,0 @@
/*
* 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.
*/
import Path from 'path';
import Fs from 'fs';
import { Readable } from 'stream';
import del from 'del';
import cpy from 'cpy';
import { ToolingLog, ToolingLogCollectingWriter } from '@kbn/tooling-log';
import {
createAbsolutePathSerializer,
createRecursiveSerializer,
createStripAnsiSerializer,
} from '@kbn/jest-serializers';
expect.addSnapshotSerializer(createAbsolutePathSerializer());
expect.addSnapshotSerializer(createStripAnsiSerializer());
expect.addSnapshotSerializer(
createRecursiveSerializer(
(v) => typeof v === 'object' && v && typeof v.time === 'number',
(v) => ({ ...v, time: '<number>' })
)
);
jest.mock('axios', () => {
return {
request: jest.fn(),
};
});
const mockRequest: jest.Mock = jest.requireMock('axios').request;
import { Archives } from '../archives';
const FIXTURE = Path.resolve(__dirname, '__fixtures__');
const TMP = Path.resolve(__dirname, '__tmp__');
beforeAll(() => del(TMP, { force: true }));
beforeEach(() => cpy('.', TMP, { cwd: FIXTURE, parents: true }));
afterEach(async () => {
await del(TMP, { force: true });
jest.resetAllMocks();
});
const readArchiveDir = () =>
Fs.readdirSync(Path.resolve(TMP, 'archives')).sort((a, b) => a.localeCompare(b));
const log = new ToolingLog();
const logWriter = new ToolingLogCollectingWriter();
log.setWriters([logWriter]);
afterEach(() => (logWriter.messages.length = 0));
it('deletes invalid files', async () => {
const path = Path.resolve(TMP, 'archives/foo.txt');
Fs.writeFileSync(path, 'hello');
const archives = await Archives.create(log, TMP);
expect(archives.size()).toBe(2);
expect(Fs.existsSync(path)).toBe(false);
});
it('exposes archives by sha', async () => {
const archives = await Archives.create(log, TMP);
expect(archives.get('1234')).toMatchInlineSnapshot(`
Object {
"path": <absolute path>/src/dev/typescript/ref_output_cache/integration_tests/__tmp__/archives/1234.zip,
"sha": "1234",
"time": "<number>",
}
`);
expect(archives.get('5678')).toMatchInlineSnapshot(`
Object {
"path": <absolute path>/src/dev/typescript/ref_output_cache/integration_tests/__tmp__/archives/5678.zip,
"sha": "5678",
"time": "<number>",
}
`);
expect(archives.get('foo')).toMatchInlineSnapshot(`undefined`);
});
it('deletes archives', async () => {
const archives = await Archives.create(log, TMP);
expect(archives.size()).toBe(2);
await archives.delete('1234');
expect(archives.size()).toBe(1);
expect(readArchiveDir()).toMatchInlineSnapshot(`
Array [
"5678.zip",
]
`);
});
it('returns false when attempting to download for sha without cache', async () => {
const archives = await Archives.create(log, TMP);
mockRequest.mockImplementation(() => {
throw new Error('404!');
});
await expect(archives.attemptToDownload('foobar')).resolves.toBe(false);
});
it('returns true when able to download an archive for a sha', async () => {
const archives = await Archives.create(log, TMP);
mockRequest.mockImplementation(() => {
return {
data: Readable.from('foobar zip contents'),
};
});
expect(archives.size()).toBe(2);
await expect(archives.attemptToDownload('foobar')).resolves.toBe(true);
expect(archives.size()).toBe(3);
expect(readArchiveDir()).toMatchInlineSnapshot(`
Array [
"1234.zip",
"5678.zip",
"foobar.zip",
]
`);
expect(Fs.readFileSync(Path.resolve(TMP, 'archives/foobar.zip'), 'utf-8')).toBe(
'foobar zip contents'
);
});
it('returns true if attempting to download a cache which is already downloaded', async () => {
const archives = await Archives.create(log, TMP);
mockRequest.mockImplementation(() => {
throw new Error(`it shouldn't try to download anything`);
});
expect(archives.size()).toBe(2);
await expect(archives.attemptToDownload('1234')).resolves.toBe(true);
expect(archives.size()).toBe(2);
expect(readArchiveDir()).toMatchInlineSnapshot(`
Array [
"1234.zip",
"5678.zip",
]
`);
});
it('returns false and deletes the zip if the download fails part way', async () => {
const archives = await Archives.create(log, TMP);
mockRequest.mockImplementation(() => {
let readCounter = 0;
return {
data: new Readable({
read() {
readCounter++;
if (readCounter === 1) {
this.push('foo');
} else {
this.emit('error', new Error('something went wrong'));
}
},
}),
};
});
await expect(archives.attemptToDownload('foo')).resolves.toBe(false);
expect(archives.size()).toBe(2);
expect(readArchiveDir()).toMatchInlineSnapshot(`
Array [
"1234.zip",
"5678.zip",
]
`);
});
it('resolves to first sha if it is available locally', async () => {
const archives = await Archives.create(log, TMP);
expect(await archives.getFirstAvailable(['1234', '5678'])).toHaveProperty('sha', '1234');
expect(await archives.getFirstAvailable(['5678', '1234'])).toHaveProperty('sha', '5678');
});
it('resolves to first local sha when it tried to reach network and gets errors', async () => {
const archives = await Archives.create(log, TMP);
mockRequest.mockImplementation(() => {
throw new Error('no network available');
});
expect(await archives.getFirstAvailable(['foo', 'bar', '1234'])).toHaveProperty('sha', '1234');
expect(mockRequest).toHaveBeenCalledTimes(2);
expect(logWriter.messages).toMatchInlineSnapshot(`
Array [
" sill identified archive for 1234",
" sill identified archive for 5678",
" debg attempting to download cache for foo from https://ts-refs-cache.kibana.dev/foo.zip",
" debg failed to download cache, ignoring error: no network available",
" debg no archive available for foo",
" debg attempting to download cache for bar from https://ts-refs-cache.kibana.dev/bar.zip",
" debg failed to download cache, ignoring error: no network available",
" debg no archive available for bar",
]
`);
});
it('resolves to first remote that downloads successfully', async () => {
const archives = await Archives.create(log, TMP);
mockRequest.mockImplementation((params) => {
if (params.url === `https://ts-refs-cache.kibana.dev/bar.zip`) {
return {
data: Readable.from('bar cache data'),
};
}
throw new Error('no network available');
});
const archive = await archives.getFirstAvailable(['foo', 'bar', '1234']);
expect(archive).toHaveProperty('sha', 'bar');
expect(mockRequest).toHaveBeenCalledTimes(2);
expect(logWriter.messages).toMatchInlineSnapshot(`
Array [
" sill identified archive for 1234",
" sill identified archive for 5678",
" debg attempting to download cache for foo from https://ts-refs-cache.kibana.dev/foo.zip",
" debg failed to download cache, ignoring error: no network available",
" debg no archive available for foo",
" debg attempting to download cache for bar from https://ts-refs-cache.kibana.dev/bar.zip",
" debg download complete, renaming tmp",
" debg download of cache for bar complete",
]
`);
expect(Fs.readFileSync(archive!.path, 'utf-8')).toBe('bar cache data');
});

View file

@ -1,175 +0,0 @@
/*
* 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.
*/
import Path from 'path';
import Fs from 'fs';
import del from 'del';
import cpy from 'cpy';
import globby from 'globby';
import normalize from 'normalize-path';
import { ToolingLog, ToolingLogCollectingWriter } from '@kbn/tooling-log';
import { createAbsolutePathSerializer, createStripAnsiSerializer } from '@kbn/jest-serializers';
import { RefOutputCache, OUTDIR_MERGE_BASE_FILENAME } from '../ref_output_cache';
import { Archives } from '../archives';
import type { RepoInfo } from '../repo_info';
import { Project } from '../../project';
import { ProjectSet } from '../../project_set';
jest.mock('../repo_info');
const { RepoInfo: MockRepoInfo } = jest.requireMock('../repo_info');
jest.mock('axios');
const { request: mockRequest } = jest.requireMock('axios');
expect.addSnapshotSerializer(createAbsolutePathSerializer());
expect.addSnapshotSerializer(createStripAnsiSerializer());
const FIXTURE = Path.resolve(__dirname, '__fixtures__');
const TMP = Path.resolve(__dirname, '__tmp__');
const repo: jest.Mocked<RepoInfo> = new MockRepoInfo();
const log = new ToolingLog();
const logWriter = new ToolingLogCollectingWriter();
log.setWriters([logWriter]);
beforeAll(() => del(TMP, { force: true }));
beforeEach(() => cpy('.', TMP, { cwd: FIXTURE, parents: true }));
afterEach(async () => {
await del(TMP, { force: true });
jest.resetAllMocks();
logWriter.messages.length = 0;
});
function makeMockProject(path: string) {
Fs.mkdirSync(Path.resolve(path, 'target/test-types'), { recursive: true });
Fs.writeFileSync(
Path.resolve(path, 'tsconfig.json'),
JSON.stringify({
compilerOptions: {
outDir: './target/test-types',
},
include: ['**/*'],
exclude: ['test/target/**/*'],
})
);
return Project.load(Path.resolve(path, 'tsconfig.json'));
}
it('creates and extracts caches, ingoring dirs with matching merge-base file, placing merge-base files, and overriding modified time for updated inputs', async () => {
// setup repo mock
const HEAD = 'abcdefg';
repo.getHeadSha.mockResolvedValue(HEAD);
repo.getRelative.mockImplementation((path) => Path.relative(TMP, path));
repo.getRecentShasFrom.mockResolvedValue(['5678', '1234']);
repo.getFilesChangesSinceSha.mockResolvedValue([]);
// create two fake outDirs
const projects = new ProjectSet([
makeMockProject(Path.resolve(TMP, 'test1')),
makeMockProject(Path.resolve(TMP, 'test2')),
]);
// init an archives instance using tmp
const archives = await Archives.create(log, TMP);
// init the RefOutputCache with our mock data
const refOutputCache = new RefOutputCache(log, repo, archives, projects, HEAD);
// create the new cache right in the archives dir
await refOutputCache.captureCache(Path.resolve(TMP));
const cachePath = Path.resolve(TMP, `${HEAD}.zip`);
// check that the cache was created and stored in the archives
if (!Fs.existsSync(cachePath)) {
throw new Error('zip was not created as expected');
}
mockRequest.mockImplementation((params: any) => {
if (params.url.endsWith(`${HEAD}.zip`)) {
return {
data: Fs.createReadStream(cachePath),
};
}
throw new Error(`unexpected url: ${params.url}`);
});
// modify the files in the outDirs so we can see which ones are restored from the cache
for (const dir of projects.outDirs) {
Fs.writeFileSync(Path.resolve(dir, 'no-cleared.txt'), 'not cleared by cache init');
}
// add the mergeBase to test1 outDir so that it is not cleared
Fs.writeFileSync(Path.resolve(projects.outDirs[0], OUTDIR_MERGE_BASE_FILENAME), HEAD);
// rebuild the outDir from the refOutputCache
await refOutputCache.initCaches();
// verify that "test1" outdir is untouched and that "test2" is cleared out
const files = Object.fromEntries(
globby
.sync(
projects.outDirs.map((p) => normalize(p)),
{ dot: true }
)
.map((path) => [Path.relative(TMP, path), Fs.readFileSync(path, 'utf-8')])
);
expect(files).toMatchInlineSnapshot(`
Object {
"test1/target/test-types/.ts-ref-cache-merge-base": "abcdefg",
"test1/target/test-types/no-cleared.txt": "not cleared by cache init",
"test2/target/test-types/.ts-ref-cache-merge-base": "abcdefg",
}
`);
expect(logWriter.messages).toMatchInlineSnapshot(`
Array [
" sill identified archive for 1234",
" sill identified archive for 5678",
" debg writing ts-ref cache to abcdefg.zip",
" succ wrote archive to abcdefg.zip",
" debg attempting to download cache for abcdefg from https://ts-refs-cache.kibana.dev/abcdefg.zip",
" debg download complete, renaming tmp",
" debg download of cache for abcdefg complete",
" debg extracting archives/abcdefg.zip to rebuild caches in 1 outDirs",
" debg [test2/target/test-types] clearing outDir and replacing with cache",
]
`);
});
it('cleans up oldest archives when there are more than 10', async () => {
for (let i = 0; i < 100; i++) {
const time = i * 10_000;
const path = Path.resolve(TMP, `archives/${time}.zip`);
Fs.writeFileSync(path, '');
Fs.utimesSync(path, time, time);
}
const archives = await Archives.create(log, TMP);
const cache = new RefOutputCache(log, repo, archives, new ProjectSet([]), '1234');
expect(cache.archives.size()).toBe(102);
await cache.cleanup();
expect(cache.archives.size()).toBe(10);
expect(Fs.readdirSync(Path.resolve(TMP, 'archives')).sort((a, b) => a.localeCompare(b)))
.toMatchInlineSnapshot(`
Array [
"1234.zip",
"5678.zip",
"920000.zip",
"930000.zip",
"940000.zip",
"950000.zip",
"960000.zip",
"970000.zip",
"980000.zip",
"990000.zip",
]
`);
});

View file

@ -1,208 +0,0 @@
/*
* 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.
*/
import Path from 'path';
import Fs from 'fs/promises';
import { extract } from '@kbn/dev-utils';
import { ToolingLog } from '@kbn/tooling-log';
import { kibanaPackageJson } from '@kbn/utils';
import del from 'del';
import tempy from 'tempy';
import { Archives } from './archives';
import { zip } from './zip';
import { concurrentMap } from '../concurrent_map';
import { RepoInfo } from './repo_info';
import { ProjectSet } from '../project_set';
export const OUTDIR_MERGE_BASE_FILENAME = '.ts-ref-cache-merge-base';
export async function matchMergeBase(outDir: string, sha: string) {
try {
const existing = await Fs.readFile(Path.resolve(outDir, OUTDIR_MERGE_BASE_FILENAME), 'utf8');
return existing === sha;
} catch (error) {
if (error.code === 'ENOENT') {
return false;
}
throw error;
}
}
export async function isDir(path: string) {
try {
return (await Fs.stat(path)).isDirectory();
} catch (error) {
if (error.code === 'ENOENT') {
return false;
}
throw error;
}
}
export class RefOutputCache {
static async create(options: {
log: ToolingLog;
workingDir: string;
projects: ProjectSet;
repoRoot: string;
upstreamUrl: string;
}) {
const repoInfo = new RepoInfo(options.log, options.repoRoot, options.upstreamUrl);
const archives = await Archives.create(options.log, options.workingDir);
const upstreamBranch: string = kibanaPackageJson.branch;
const mergeBase = await repoInfo.getMergeBase('HEAD', upstreamBranch);
return new RefOutputCache(options.log, repoInfo, archives, options.projects, mergeBase);
}
constructor(
private readonly log: ToolingLog,
private readonly repo: RepoInfo,
public readonly archives: Archives,
private readonly projects: ProjectSet,
private readonly mergeBase: string
) {}
/**
* Find the most recent cache/archive of the outDirs and replace the outDirs
* on disk with the files in the cache if the outDir has an outdated merge-base
* written to the directory.
*/
async initCaches() {
const outdatedOutDirs = (
await concurrentMap(100, this.projects.outDirs, async (outDir) => ({
path: outDir,
outdated: !(await matchMergeBase(outDir, this.mergeBase)),
}))
)
.filter((o) => o.outdated)
.map((o) => o.path);
if (!outdatedOutDirs.length) {
this.log.debug('all outDirs have a recent cache');
return;
}
const archive =
this.archives.get(this.mergeBase) ??
(await this.archives.getFirstAvailable([
this.mergeBase,
...(await this.repo.getRecentShasFrom(this.mergeBase, 5)),
]));
if (!archive) {
return;
}
const changedFiles = await this.repo.getFilesChangesSinceSha(archive.sha);
const outDirsForcingExtraCacheCheck = this.projects.filterByPaths(changedFiles).outDirs;
const tmpDir = tempy.directory();
this.log.debug(
'extracting',
this.repo.getRelative(archive.path),
'to rebuild caches in',
outdatedOutDirs.length,
'outDirs'
);
await extract({
archivePath: archive.path,
targetDir: tmpDir,
});
const cacheNames = await Fs.readdir(tmpDir);
const beginningOfTime = new Date(0);
await concurrentMap(50, outdatedOutDirs, async (outDir) => {
const relative = this.repo.getRelative(outDir);
const cacheName = `${relative.split(Path.sep).join('__')}.zip`;
if (!cacheNames.includes(cacheName)) {
this.log.debug(`[${relative}] not in cache`);
await Fs.mkdir(outDir, { recursive: true });
await Fs.writeFile(Path.resolve(outDir, OUTDIR_MERGE_BASE_FILENAME), archive.sha);
return;
}
if (await matchMergeBase(outDir, archive.sha)) {
this.log.debug(`[${relative}] keeping outdir, created from selected sha`);
return;
}
const setModifiedTimes = outDirsForcingExtraCacheCheck.includes(outDir)
? beginningOfTime
: undefined;
if (setModifiedTimes) {
this.log.debug(`[${relative}] replacing outDir with cache (forcing revalidation)`);
} else {
this.log.debug(`[${relative}] clearing outDir and replacing with cache`);
}
await del(outDir);
await extract({
archivePath: Path.resolve(tmpDir, cacheName),
targetDir: outDir,
setModifiedTimes,
});
await Fs.writeFile(Path.resolve(outDir, OUTDIR_MERGE_BASE_FILENAME), this.mergeBase);
});
}
/**
* Iterate through the outDirs, zip them up, and then zip up those zips
* into a single file which we can upload/download/extract just a portion
* of the archive.
*
* @param outputDir directory that the {HEAD}.zip file should be written to
*/
async captureCache(outputDir: string) {
const tmpDir = tempy.directory();
const currentSha = await this.repo.getHeadSha();
const outputPath = Path.resolve(outputDir, `${currentSha}.zip`);
const relativeOutputPath = this.repo.getRelative(outputPath);
this.log.debug('writing ts-ref cache to', relativeOutputPath);
const subZips: Array<[string, string]> = [];
await Promise.all(
this.projects.outDirs.map(async (absolute) => {
const relative = this.repo.getRelative(absolute);
const subZipName = `${relative.split(Path.sep).join('__')}.zip`;
const subZipPath = Path.resolve(tmpDir, subZipName);
await zip([[absolute, '/']], [], subZipPath);
subZips.push([subZipPath, subZipName]);
})
);
await zip([], subZips, outputPath);
await del(tmpDir, { force: true });
this.log.success('wrote archive to', relativeOutputPath);
}
/**
* Cleanup the downloaded cache files, keeping the 10 newest files. Each file
* is about 25-30MB, so 10 downloads is a a decent amount of disk space for
* caches but we could potentially increase this number in the future if we like
*/
async cleanup() {
// sort archives by time desc
const archives = [...this.archives].sort((a, b) => b.time - a.time);
// delete the 11th+ archive
for (const { sha } of archives.slice(10)) {
await this.archives.delete(sha);
}
}
}

View file

@ -1,71 +0,0 @@
/*
* 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.
*/
import Path from 'path';
import execa from 'execa';
import { ToolingLog } from '@kbn/tooling-log';
export class RepoInfo {
constructor(
private readonly log: ToolingLog,
private readonly dir: string,
private readonly upstreamUrl: string
) {}
async getRecentShasFrom(sha: string, size: number) {
return (await this.git(['log', '--pretty=%P', `-n`, `${size}`, sha]))
.split('\n')
.map((l) => l.trim())
.filter(Boolean);
}
async getMergeBase(ref: string, upstreamBranch: string) {
this.log.info('ensuring we have the latest changelog from upstream', upstreamBranch);
await this.git(['fetch', this.upstreamUrl, upstreamBranch]);
this.log.info('determining merge base with upstream');
const mergeBase = await this.git(['merge-base', ref, 'FETCH_HEAD']);
this.log.info('merge base with', upstreamBranch, 'is', mergeBase);
return mergeBase;
}
async getHeadSha() {
return await this.git(['rev-parse', 'HEAD']);
}
getRelative(path: string) {
return Path.relative(this.dir, path);
}
private async git(args: string[]) {
const proc = await execa('git', args, {
cwd: this.dir,
});
return proc.stdout.trim();
}
async getFilesChangesSinceSha(sha: string) {
this.log.debug('determining files changes since sha', sha);
const proc = await execa('git', ['diff', '--name-only', sha], {
cwd: this.dir,
});
const files = proc.stdout
.trim()
.split('\n')
.map((p) => Path.resolve(this.dir, p));
this.log.verbose('found the following changes compared to', sha, `\n - ${files.join('\n - ')}`);
return files;
}
}

View file

@ -1,45 +0,0 @@
/*
* 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.
*/
import Fs from 'fs/promises';
import { createWriteStream } from 'fs';
import Path from 'path';
import { pipeline } from 'stream';
import { promisify } from 'util';
import archiver from 'archiver';
const asyncPipeline = promisify(pipeline);
export async function zip(
dirs: Array<[string, string]>,
files: Array<[string, string]>,
outputPath: string
) {
const archive = archiver('zip', {
zlib: {
level: 9,
},
});
for (const [absolute, relative] of dirs) {
archive.directory(absolute, relative);
}
for (const [absolute, relative] of files) {
archive.file(absolute, {
name: relative,
});
}
// ensure output dir exists
await Fs.mkdir(Path.dirname(outputPath), { recursive: true });
// await the promise from the pipeline and archive.finalize()
await Promise.all([asyncPipeline(archive, createWriteStream(outputPath)), archive.finalize()]);
}

View file

@ -7,11 +7,13 @@
*/
import Path from 'path';
import Fs from 'fs/promises';
import Fsp from 'fs/promises';
import dedent from 'dedent';
import { ToolingLog } from '@kbn/tooling-log';
import { REPO_ROOT } from '@kbn/utils';
import { createFailError } from '@kbn/dev-cli-errors';
import { BazelPackage } from '@kbn/bazel-packages';
import normalize from 'normalize-path';
import { PROJECTS } from './projects';
@ -21,7 +23,7 @@ export const REF_CONFIG_PATHS = [ROOT_REFS_CONFIG_PATH];
async function isRootRefsConfigSelfManaged() {
try {
const currentRefsFile = await Fs.readFile(ROOT_REFS_CONFIG_PATH, 'utf-8');
const currentRefsFile = await Fsp.readFile(ROOT_REFS_CONFIG_PATH, 'utf-8');
return currentRefsFile.trim().startsWith('// SELF MANAGED');
} catch (error) {
if (error.code === 'ENOENT') {
@ -34,9 +36,7 @@ async function isRootRefsConfigSelfManaged() {
function generateTsConfig(refs: string[]) {
return dedent`
// This file is automatically updated when you run \`node scripts/build_ts_refs\`. If you start this
// file with the text "// SELF MANAGED" then you can comment out any projects that you like and only
// build types for specific projects and their dependencies
// This file is automatically updated when you run \`node scripts/build_ts_refs\`.
{
"include": [],
"references": [
@ -46,18 +46,28 @@ ${refs.map((p) => ` { "path": ${JSON.stringify(p)} },`).join('\n')}
`;
}
export async function updateRootRefsConfig(log: ToolingLog) {
export async function updateRootRefsConfig(log: ToolingLog, bazelPackages: BazelPackage[]) {
if (await isRootRefsConfigSelfManaged()) {
log.warning(
'tsconfig.refs.json starts with "// SELF MANAGED" so not updating to include all projects'
throw createFailError(
`tsconfig.refs.json starts with "// SELF MANAGED" but we removed this functinality because of some complexity it caused with TS performance upgrades and we were pretty sure that nobody was using it. Please reach out to operations to discuss options <3`
);
return;
}
const refs = PROJECTS.filter((p) => p.isCompositeProject())
.map((p) => `./${normalize(Path.relative(REPO_ROOT, p.tsConfigPath))}`)
.sort((a, b) => a.localeCompare(b));
const bazelPackageDirs = new Set(
bazelPackages.map((p) => Path.resolve(REPO_ROOT, p.normalizedRepoRelativeDir))
);
const refs = PROJECTS.flatMap((p) => {
if (p.disableTypeCheck || bazelPackageDirs.has(p.directory)) {
return [];
}
return `./${normalize(Path.relative(REPO_ROOT, p.typeCheckConfigPath))}`;
}).sort((a, b) => a.localeCompare(b));
log.debug('updating', ROOT_REFS_CONFIG_PATH);
await Fs.writeFile(ROOT_REFS_CONFIG_PATH, generateTsConfig(refs) + '\n');
await Fsp.writeFile(ROOT_REFS_CONFIG_PATH, generateTsConfig(refs) + '\n');
}
export async function cleanupRootRefsConfig() {
await Fsp.unlink(ROOT_REFS_CONFIG_PATH);
}

View file

@ -7,106 +7,204 @@
*/
import Path from 'path';
import Os from 'os';
import Fs from 'fs';
import * as Rx from 'rxjs';
import { mergeMap, reduce } from 'rxjs/operators';
import execa from 'execa';
import { run } from '@kbn/dev-cli-runner';
import { createFailError } from '@kbn/dev-cli-errors';
import { REPO_ROOT } from '@kbn/utils';
import { Jsonc } from '@kbn/bazel-packages';
import { runBazel } from '@kbn/bazel-runner';
import { BazelPackage, discoverBazelPackages } from '@kbn/bazel-packages';
import { PROJECTS } from './projects';
import { buildTsRefs } from './build_ts_refs';
import { updateRootRefsConfig } from './root_refs_config';
import { Project } from './project';
import {
updateRootRefsConfig,
cleanupRootRefsConfig,
ROOT_REFS_CONFIG_PATH,
} from './root_refs_config';
function rel(from: string, to: string) {
const relative = Path.relative(from, to);
return relative.startsWith('.') ? relative : `./${relative}`;
}
function isValidRefs(refs: unknown): refs is Array<{ path: string }> {
return (
Array.isArray(refs) &&
refs.every(
(r) => typeof r === 'object' && r !== null && 'path' in r && typeof r.path === 'string'
)
);
}
function parseTsconfig(path: string) {
const jsonc = Fs.readFileSync(path, 'utf8');
const parsed = Jsonc.parse(jsonc) as Record<string, any>;
if (typeof parsed !== 'object' || parsed === null) {
throw createFailError(`expected JSON at ${path} to parse into an object`);
}
return parsed;
}
function toTypeCheckConfigPath(path: string) {
return path.endsWith('tsconfig.base.json')
? path.replace(/\/tsconfig\.base\.json$/, '/tsconfig.base.type_check.json')
: path.replace(/\/tsconfig\.json$/, '/tsconfig.type_check.json');
}
function createTypeCheckConfigs(projects: Project[], bazelPackages: BazelPackage[]) {
const created = new Set<string>();
const bazelPackageIds = new Set(bazelPackages.map((p) => p.manifest.id));
// write root tsconfig.type_check.json
const baseTypeCheckConfigPath = Path.resolve(REPO_ROOT, 'tsconfig.base.type_check.json');
const baseConfigPath = Path.resolve(REPO_ROOT, 'tsconfig.base.json');
const baseStat = Fs.statSync(baseConfigPath);
const basePaths = parseTsconfig(baseConfigPath).compilerOptions.paths;
if (typeof basePaths !== 'object' || basePaths === null) {
throw createFailError(`expected root compilerOptions.paths to be an object`);
}
Fs.writeFileSync(
baseTypeCheckConfigPath,
JSON.stringify(
{
extends: './tsconfig.base.json',
compilerOptions: {
paths: Object.fromEntries(
Object.entries(basePaths).flatMap(([key, value]) => {
if (key.endsWith('/*') && bazelPackageIds.has(key.slice(0, -2))) {
return [];
}
if (bazelPackageIds.has(key)) {
return [];
}
return [[key, value]];
})
),
},
},
null,
2
)
);
Fs.utimesSync(baseTypeCheckConfigPath, baseStat.atime, baseStat.mtime);
created.add(baseTypeCheckConfigPath);
// write tsconfig.type_check.json files for each project that is not the root
const queue = new Set(projects.map((p) => p.tsConfigPath));
for (const path of queue) {
const tsconfigStat = Fs.statSync(path);
const parsed = parseTsconfig(path);
const dir = Path.dirname(path);
const typeCheckConfigPath = Path.resolve(dir, 'tsconfig.type_check.json');
const refs = parsed.kbn_references ?? [];
if (!isValidRefs(refs)) {
throw new Error(`expected valid TS refs in ${path}`);
}
const typeCheckConfig = {
...parsed,
extends: parsed.extends
? toTypeCheckConfigPath(parsed.extends)
: rel(dir, baseTypeCheckConfigPath),
compilerOptions: {
...parsed.compilerOptions,
composite: true,
incremental: true,
rootDir: '.',
paths: undefined,
},
kbn_references: undefined,
references: refs.map((ref) => ({
path: toTypeCheckConfigPath(ref.path),
})),
};
Fs.writeFileSync(typeCheckConfigPath, JSON.stringify(typeCheckConfig, null, 2));
Fs.utimesSync(typeCheckConfigPath, tsconfigStat.atime, tsconfigStat.mtime);
created.add(typeCheckConfigPath);
// add all the referenced config files to the queue if they're not already in it
for (const ref of refs) {
queue.add(Path.resolve(dir, ref.path));
}
}
return created;
}
export async function runTypeCheckCli() {
run(
async ({ log, flags, procRunner }) => {
async ({ log, flagsReader, procRunner }) => {
log.warning(
`Building types for all bazel packages. This can take a while depending on your changes and won't show any progress while it runs.`
);
await runBazel(['build', '//packages:build_types', '--show_result=1'], {
cwd: REPO_ROOT,
logPrefix: '\x1b[94m[bazel]\x1b[39m',
onErrorExit(code: any, output: any) {
throw createFailError(
`The bazel command that was running exited with code [${code}] and output: ${output}`
);
},
});
const bazelPackages = await discoverBazelPackages(REPO_ROOT);
// if the tsconfig.refs.json file is not self-managed then make sure it has
// a reference to every composite project in the repo
await updateRootRefsConfig(log);
await updateRootRefsConfig(log, bazelPackages);
const projectFilter =
flags.project && typeof flags.project === 'string'
? Path.resolve(flags.project)
: undefined;
const projectFilter = flagsReader.path('project');
const projects = PROJECTS.filter((p) => {
return !p.disableTypeCheck && (!projectFilter || p.tsConfigPath === projectFilter);
});
if (projects.length > 1 || projects[0].isCompositeProject()) {
const { failed } = await buildTsRefs({
log,
procRunner,
verbose: !!flags.verbose,
project: projects.length === 1 ? projects[0] : undefined,
const created = createTypeCheckConfigs(projects, bazelPackages);
let pluginBuildResult;
try {
log.info(`Building TypeScript projects to check types...`);
const relative = Path.relative(
REPO_ROOT,
projects.length === 1 ? projects[0].typeCheckConfigPath : ROOT_REFS_CONFIG_PATH
);
await procRunner.run('tsc', {
cmd: Path.relative(REPO_ROOT, require.resolve('typescript/bin/tsc')),
args: [
'-b',
relative,
'--pretty',
...(flagsReader.boolean('verbose') ? ['--verbose'] : []),
],
cwd: REPO_ROOT,
wait: true,
});
if (failed) {
throw createFailError('Unable to build TS project refs');
pluginBuildResult = { failed: false };
} catch (error) {
pluginBuildResult = { failed: true };
}
// cleanup
if (flagsReader.boolean('cleanup')) {
await cleanupRootRefsConfig();
for (const path of created) {
Fs.unlinkSync(path);
}
}
if (!projects.length) {
if (projectFilter) {
throw createFailError(`Unable to find project at ${flags.project}`);
} else {
throw createFailError(`Unable to find projects to type-check`);
}
}
const concurrencyArg =
typeof flags.concurrency === 'string' && parseInt(flags.concurrency, 10);
const concurrency =
concurrencyArg && concurrencyArg > 0
? concurrencyArg
: Math.min(4, Math.round((Os.cpus() || []).length / 2) || 1) || 1;
log.info('running type check in', projects.length, 'projects');
const tscArgs = [
...['--emitDeclarationOnly', 'false'],
'--noEmit',
'--pretty',
...(flags['skip-lib-check']
? ['--skipLibCheck', flags['skip-lib-check'] as string]
: ['--skipLibCheck', 'false']),
];
const failureCount = await Rx.lastValueFrom(
Rx.from(projects).pipe(
mergeMap(async (p) => {
const relativePath = Path.relative(process.cwd(), p.tsConfigPath);
const result = await execa(
process.execPath,
[
'--max-old-space-size=5120',
require.resolve('typescript/bin/tsc'),
...['--project', p.tsConfigPath],
...tscArgs,
],
{
reject: false,
all: true,
}
);
if (result.failed) {
log.error(`Type check failed in ${relativePath}:`);
log.error(result.all ?? ' - tsc produced no output - ');
return 1;
} else {
log.success(relativePath);
return 0;
}
}, concurrency),
reduce((acc, f) => acc + f, 0)
)
);
if (failureCount > 0) {
throw createFailError(`${failureCount} type checks failed`);
if (pluginBuildResult.failed) {
throw createFailError('Unable to build TS project refs');
}
},
{
@ -121,13 +219,15 @@ export async function runTypeCheckCli() {
node scripts/type_check --project packages/kbn-pm/tsconfig.json
`,
flags: {
string: ['project', 'concurrency'],
boolean: ['skip-lib-check'],
string: ['project'],
boolean: ['cleanup'],
default: {
cleanup: true,
},
help: `
--concurrency <number> Number of projects to check in parallel. Defaults to 50% of available CPUs, up to 4.
--project [path] Path to a tsconfig.json file determines the project to check
--skip-lib-check Skip type checking of all declaration files (*.d.ts). Default is false
--help Show this message
--no-cleanup Pass to avoid deleting the temporary tsconfig files written to disk
`,
},
}

View file

@ -1,7 +1,6 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,

View file

@ -23,13 +23,13 @@ export type { DiscoverAppLocator, DiscoverAppLocatorParams } from './locator';
// re-export types and static functions to give other plugins time to migrate away
export {
SavedSearch,
type SavedSearch,
getSavedSearch,
getSavedSearchFullPathUrl,
getSavedSearchUrl,
getSavedSearchUrlConflictMessage,
throwErrorOnSavedSearchUrlConflict,
VIEW_MODE,
DiscoverGridSettings,
DiscoverGridSettingsColumn,
type DiscoverGridSettings,
type DiscoverGridSettingsColumn,
} from '@kbn/saved-search-plugin/public';

View file

@ -137,4 +137,4 @@ export type DateHistogramSeries = Pick<
'split_mode' | 'override_index_pattern' | 'series_interval' | 'series_drop_last_bucket'
>;
export { FiltersColumn, TermsColumn, DateHistogramColumn };
export type { FiltersColumn, TermsColumn, DateHistogramColumn };

View file

@ -23,9 +23,9 @@
"exclude": [
"target/**/*",
"analytics/fixtures/plugins/**/*",
"interpreter_functional/plugins/**/*",
"plugin_functional/plugins/**/*",
"interactive_setup_api_integration/fixtures/test_endpoints/**/*",
"server_integration/__fixtures__/plugins/**/*",
"*/plugins/**/*",
],
"references": [
{ "path": "../src/core/tsconfig.json" },

View file

@ -1,10 +1,707 @@
{
"compilerOptions": {
"baseUrl": ".",
"rootDir": ".",
"paths": {
"@kbn/core": ["src/core"],
"@kbn/core/*": ["src/core/*"],
// START AUTOMATED PACKAGE LISTING
"@kbn/analytics-client": ["packages/analytics/client"],
"@kbn/analytics-client/*": ["packages/analytics/client/*"],
"@kbn/analytics-shippers-elastic-v3-browser": ["packages/analytics/shippers/elastic_v3/browser"],
"@kbn/analytics-shippers-elastic-v3-browser/*": ["packages/analytics/shippers/elastic_v3/browser/*"],
"@kbn/analytics-shippers-elastic-v3-common": ["packages/analytics/shippers/elastic_v3/common"],
"@kbn/analytics-shippers-elastic-v3-common/*": ["packages/analytics/shippers/elastic_v3/common/*"],
"@kbn/analytics-shippers-elastic-v3-server": ["packages/analytics/shippers/elastic_v3/server"],
"@kbn/analytics-shippers-elastic-v3-server/*": ["packages/analytics/shippers/elastic_v3/server/*"],
"@kbn/analytics-shippers-fullstory": ["packages/analytics/shippers/fullstory"],
"@kbn/analytics-shippers-fullstory/*": ["packages/analytics/shippers/fullstory/*"],
"@kbn/analytics-shippers-gainsight": ["packages/analytics/shippers/gainsight"],
"@kbn/analytics-shippers-gainsight/*": ["packages/analytics/shippers/gainsight/*"],
"@kbn/content-management-table-list": ["packages/content-management/table_list"],
"@kbn/content-management-table-list/*": ["packages/content-management/table_list/*"],
"@kbn/core-analytics-browser": ["packages/core/analytics/core-analytics-browser"],
"@kbn/core-analytics-browser/*": ["packages/core/analytics/core-analytics-browser/*"],
"@kbn/core-analytics-browser-internal": ["packages/core/analytics/core-analytics-browser-internal"],
"@kbn/core-analytics-browser-internal/*": ["packages/core/analytics/core-analytics-browser-internal/*"],
"@kbn/core-analytics-browser-mocks": ["packages/core/analytics/core-analytics-browser-mocks"],
"@kbn/core-analytics-browser-mocks/*": ["packages/core/analytics/core-analytics-browser-mocks/*"],
"@kbn/core-analytics-server": ["packages/core/analytics/core-analytics-server"],
"@kbn/core-analytics-server/*": ["packages/core/analytics/core-analytics-server/*"],
"@kbn/core-analytics-server-internal": ["packages/core/analytics/core-analytics-server-internal"],
"@kbn/core-analytics-server-internal/*": ["packages/core/analytics/core-analytics-server-internal/*"],
"@kbn/core-analytics-server-mocks": ["packages/core/analytics/core-analytics-server-mocks"],
"@kbn/core-analytics-server-mocks/*": ["packages/core/analytics/core-analytics-server-mocks/*"],
"@kbn/core-application-browser": ["packages/core/application/core-application-browser"],
"@kbn/core-application-browser/*": ["packages/core/application/core-application-browser/*"],
"@kbn/core-application-browser-internal": ["packages/core/application/core-application-browser-internal"],
"@kbn/core-application-browser-internal/*": ["packages/core/application/core-application-browser-internal/*"],
"@kbn/core-application-browser-mocks": ["packages/core/application/core-application-browser-mocks"],
"@kbn/core-application-browser-mocks/*": ["packages/core/application/core-application-browser-mocks/*"],
"@kbn/core-application-common": ["packages/core/application/core-application-common"],
"@kbn/core-application-common/*": ["packages/core/application/core-application-common/*"],
"@kbn/core-apps-browser-internal": ["packages/core/apps/core-apps-browser-internal"],
"@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-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"],
"@kbn/core-base-browser-mocks/*": ["packages/core/base/core-base-browser-mocks/*"],
"@kbn/core-base-common": ["packages/core/base/core-base-common"],
"@kbn/core-base-common/*": ["packages/core/base/core-base-common/*"],
"@kbn/core-base-common-internal": ["packages/core/base/core-base-common-internal"],
"@kbn/core-base-common-internal/*": ["packages/core/base/core-base-common-internal/*"],
"@kbn/core-base-server-internal": ["packages/core/base/core-base-server-internal"],
"@kbn/core-base-server-internal/*": ["packages/core/base/core-base-server-internal/*"],
"@kbn/core-base-server-mocks": ["packages/core/base/core-base-server-mocks"],
"@kbn/core-base-server-mocks/*": ["packages/core/base/core-base-server-mocks/*"],
"@kbn/core-capabilities-browser-internal": ["packages/core/capabilities/core-capabilities-browser-internal"],
"@kbn/core-capabilities-browser-internal/*": ["packages/core/capabilities/core-capabilities-browser-internal/*"],
"@kbn/core-capabilities-browser-mocks": ["packages/core/capabilities/core-capabilities-browser-mocks"],
"@kbn/core-capabilities-browser-mocks/*": ["packages/core/capabilities/core-capabilities-browser-mocks/*"],
"@kbn/core-capabilities-common": ["packages/core/capabilities/core-capabilities-common"],
"@kbn/core-capabilities-common/*": ["packages/core/capabilities/core-capabilities-common/*"],
"@kbn/core-capabilities-server": ["packages/core/capabilities/core-capabilities-server"],
"@kbn/core-capabilities-server/*": ["packages/core/capabilities/core-capabilities-server/*"],
"@kbn/core-capabilities-server-internal": ["packages/core/capabilities/core-capabilities-server-internal"],
"@kbn/core-capabilities-server-internal/*": ["packages/core/capabilities/core-capabilities-server-internal/*"],
"@kbn/core-capabilities-server-mocks": ["packages/core/capabilities/core-capabilities-server-mocks"],
"@kbn/core-capabilities-server-mocks/*": ["packages/core/capabilities/core-capabilities-server-mocks/*"],
"@kbn/core-chrome-browser": ["packages/core/chrome/core-chrome-browser"],
"@kbn/core-chrome-browser/*": ["packages/core/chrome/core-chrome-browser/*"],
"@kbn/core-chrome-browser-internal": ["packages/core/chrome/core-chrome-browser-internal"],
"@kbn/core-chrome-browser-internal/*": ["packages/core/chrome/core-chrome-browser-internal/*"],
"@kbn/core-chrome-browser-mocks": ["packages/core/chrome/core-chrome-browser-mocks"],
"@kbn/core-chrome-browser-mocks/*": ["packages/core/chrome/core-chrome-browser-mocks/*"],
"@kbn/core-config-server-internal": ["packages/core/config/core-config-server-internal"],
"@kbn/core-config-server-internal/*": ["packages/core/config/core-config-server-internal/*"],
"@kbn/core-deprecations-browser": ["packages/core/deprecations/core-deprecations-browser"],
"@kbn/core-deprecations-browser/*": ["packages/core/deprecations/core-deprecations-browser/*"],
"@kbn/core-deprecations-browser-internal": ["packages/core/deprecations/core-deprecations-browser-internal"],
"@kbn/core-deprecations-browser-internal/*": ["packages/core/deprecations/core-deprecations-browser-internal/*"],
"@kbn/core-deprecations-browser-mocks": ["packages/core/deprecations/core-deprecations-browser-mocks"],
"@kbn/core-deprecations-browser-mocks/*": ["packages/core/deprecations/core-deprecations-browser-mocks/*"],
"@kbn/core-deprecations-common": ["packages/core/deprecations/core-deprecations-common"],
"@kbn/core-deprecations-common/*": ["packages/core/deprecations/core-deprecations-common/*"],
"@kbn/core-deprecations-server": ["packages/core/deprecations/core-deprecations-server"],
"@kbn/core-deprecations-server/*": ["packages/core/deprecations/core-deprecations-server/*"],
"@kbn/core-deprecations-server-internal": ["packages/core/deprecations/core-deprecations-server-internal"],
"@kbn/core-deprecations-server-internal/*": ["packages/core/deprecations/core-deprecations-server-internal/*"],
"@kbn/core-deprecations-server-mocks": ["packages/core/deprecations/core-deprecations-server-mocks"],
"@kbn/core-deprecations-server-mocks/*": ["packages/core/deprecations/core-deprecations-server-mocks/*"],
"@kbn/core-doc-links-browser": ["packages/core/doc-links/core-doc-links-browser"],
"@kbn/core-doc-links-browser/*": ["packages/core/doc-links/core-doc-links-browser/*"],
"@kbn/core-doc-links-browser-internal": ["packages/core/doc-links/core-doc-links-browser-internal"],
"@kbn/core-doc-links-browser-internal/*": ["packages/core/doc-links/core-doc-links-browser-internal/*"],
"@kbn/core-doc-links-browser-mocks": ["packages/core/doc-links/core-doc-links-browser-mocks"],
"@kbn/core-doc-links-browser-mocks/*": ["packages/core/doc-links/core-doc-links-browser-mocks/*"],
"@kbn/core-doc-links-server": ["packages/core/doc-links/core-doc-links-server"],
"@kbn/core-doc-links-server/*": ["packages/core/doc-links/core-doc-links-server/*"],
"@kbn/core-doc-links-server-internal": ["packages/core/doc-links/core-doc-links-server-internal"],
"@kbn/core-doc-links-server-internal/*": ["packages/core/doc-links/core-doc-links-server-internal/*"],
"@kbn/core-doc-links-server-mocks": ["packages/core/doc-links/core-doc-links-server-mocks"],
"@kbn/core-doc-links-server-mocks/*": ["packages/core/doc-links/core-doc-links-server-mocks/*"],
"@kbn/core-elasticsearch-client-server-internal": ["packages/core/elasticsearch/core-elasticsearch-client-server-internal"],
"@kbn/core-elasticsearch-client-server-internal/*": ["packages/core/elasticsearch/core-elasticsearch-client-server-internal/*"],
"@kbn/core-elasticsearch-client-server-mocks": ["packages/core/elasticsearch/core-elasticsearch-client-server-mocks"],
"@kbn/core-elasticsearch-client-server-mocks/*": ["packages/core/elasticsearch/core-elasticsearch-client-server-mocks/*"],
"@kbn/core-elasticsearch-server": ["packages/core/elasticsearch/core-elasticsearch-server"],
"@kbn/core-elasticsearch-server/*": ["packages/core/elasticsearch/core-elasticsearch-server/*"],
"@kbn/core-elasticsearch-server-internal": ["packages/core/elasticsearch/core-elasticsearch-server-internal"],
"@kbn/core-elasticsearch-server-internal/*": ["packages/core/elasticsearch/core-elasticsearch-server-internal/*"],
"@kbn/core-elasticsearch-server-mocks": ["packages/core/elasticsearch/core-elasticsearch-server-mocks"],
"@kbn/core-elasticsearch-server-mocks/*": ["packages/core/elasticsearch/core-elasticsearch-server-mocks/*"],
"@kbn/core-environment-server-internal": ["packages/core/environment/core-environment-server-internal"],
"@kbn/core-environment-server-internal/*": ["packages/core/environment/core-environment-server-internal/*"],
"@kbn/core-environment-server-mocks": ["packages/core/environment/core-environment-server-mocks"],
"@kbn/core-environment-server-mocks/*": ["packages/core/environment/core-environment-server-mocks/*"],
"@kbn/core-execution-context-browser": ["packages/core/execution-context/core-execution-context-browser"],
"@kbn/core-execution-context-browser/*": ["packages/core/execution-context/core-execution-context-browser/*"],
"@kbn/core-execution-context-browser-internal": ["packages/core/execution-context/core-execution-context-browser-internal"],
"@kbn/core-execution-context-browser-internal/*": ["packages/core/execution-context/core-execution-context-browser-internal/*"],
"@kbn/core-execution-context-browser-mocks": ["packages/core/execution-context/core-execution-context-browser-mocks"],
"@kbn/core-execution-context-browser-mocks/*": ["packages/core/execution-context/core-execution-context-browser-mocks/*"],
"@kbn/core-execution-context-common": ["packages/core/execution-context/core-execution-context-common"],
"@kbn/core-execution-context-common/*": ["packages/core/execution-context/core-execution-context-common/*"],
"@kbn/core-execution-context-server": ["packages/core/execution-context/core-execution-context-server"],
"@kbn/core-execution-context-server/*": ["packages/core/execution-context/core-execution-context-server/*"],
"@kbn/core-execution-context-server-internal": ["packages/core/execution-context/core-execution-context-server-internal"],
"@kbn/core-execution-context-server-internal/*": ["packages/core/execution-context/core-execution-context-server-internal/*"],
"@kbn/core-execution-context-server-mocks": ["packages/core/execution-context/core-execution-context-server-mocks"],
"@kbn/core-execution-context-server-mocks/*": ["packages/core/execution-context/core-execution-context-server-mocks/*"],
"@kbn/core-fatal-errors-browser": ["packages/core/fatal-errors/core-fatal-errors-browser"],
"@kbn/core-fatal-errors-browser/*": ["packages/core/fatal-errors/core-fatal-errors-browser/*"],
"@kbn/core-fatal-errors-browser-internal": ["packages/core/fatal-errors/core-fatal-errors-browser-internal"],
"@kbn/core-fatal-errors-browser-internal/*": ["packages/core/fatal-errors/core-fatal-errors-browser-internal/*"],
"@kbn/core-fatal-errors-browser-mocks": ["packages/core/fatal-errors/core-fatal-errors-browser-mocks"],
"@kbn/core-fatal-errors-browser-mocks/*": ["packages/core/fatal-errors/core-fatal-errors-browser-mocks/*"],
"@kbn/core-http-browser": ["packages/core/http/core-http-browser"],
"@kbn/core-http-browser/*": ["packages/core/http/core-http-browser/*"],
"@kbn/core-http-browser-internal": ["packages/core/http/core-http-browser-internal"],
"@kbn/core-http-browser-internal/*": ["packages/core/http/core-http-browser-internal/*"],
"@kbn/core-http-browser-mocks": ["packages/core/http/core-http-browser-mocks"],
"@kbn/core-http-browser-mocks/*": ["packages/core/http/core-http-browser-mocks/*"],
"@kbn/core-http-common": ["packages/core/http/core-http-common"],
"@kbn/core-http-common/*": ["packages/core/http/core-http-common/*"],
"@kbn/core-http-context-server-internal": ["packages/core/http/core-http-context-server-internal"],
"@kbn/core-http-context-server-internal/*": ["packages/core/http/core-http-context-server-internal/*"],
"@kbn/core-http-context-server-mocks": ["packages/core/http/core-http-context-server-mocks"],
"@kbn/core-http-context-server-mocks/*": ["packages/core/http/core-http-context-server-mocks/*"],
"@kbn/core-http-request-handler-context-server": ["packages/core/http/core-http-request-handler-context-server"],
"@kbn/core-http-request-handler-context-server/*": ["packages/core/http/core-http-request-handler-context-server/*"],
"@kbn/core-http-request-handler-context-server-internal": ["packages/core/http/core-http-request-handler-context-server-internal"],
"@kbn/core-http-request-handler-context-server-internal/*": ["packages/core/http/core-http-request-handler-context-server-internal/*"],
"@kbn/core-http-resources-server": ["packages/core/http/core-http-resources-server"],
"@kbn/core-http-resources-server/*": ["packages/core/http/core-http-resources-server/*"],
"@kbn/core-http-resources-server-internal": ["packages/core/http/core-http-resources-server-internal"],
"@kbn/core-http-resources-server-internal/*": ["packages/core/http/core-http-resources-server-internal/*"],
"@kbn/core-http-resources-server-mocks": ["packages/core/http/core-http-resources-server-mocks"],
"@kbn/core-http-resources-server-mocks/*": ["packages/core/http/core-http-resources-server-mocks/*"],
"@kbn/core-http-router-server-internal": ["packages/core/http/core-http-router-server-internal"],
"@kbn/core-http-router-server-internal/*": ["packages/core/http/core-http-router-server-internal/*"],
"@kbn/core-http-router-server-mocks": ["packages/core/http/core-http-router-server-mocks"],
"@kbn/core-http-router-server-mocks/*": ["packages/core/http/core-http-router-server-mocks/*"],
"@kbn/core-http-server": ["packages/core/http/core-http-server"],
"@kbn/core-http-server/*": ["packages/core/http/core-http-server/*"],
"@kbn/core-http-server-internal": ["packages/core/http/core-http-server-internal"],
"@kbn/core-http-server-internal/*": ["packages/core/http/core-http-server-internal/*"],
"@kbn/core-http-server-mocks": ["packages/core/http/core-http-server-mocks"],
"@kbn/core-http-server-mocks/*": ["packages/core/http/core-http-server-mocks/*"],
"@kbn/core-i18n-browser": ["packages/core/i18n/core-i18n-browser"],
"@kbn/core-i18n-browser/*": ["packages/core/i18n/core-i18n-browser/*"],
"@kbn/core-i18n-browser-internal": ["packages/core/i18n/core-i18n-browser-internal"],
"@kbn/core-i18n-browser-internal/*": ["packages/core/i18n/core-i18n-browser-internal/*"],
"@kbn/core-i18n-browser-mocks": ["packages/core/i18n/core-i18n-browser-mocks"],
"@kbn/core-i18n-browser-mocks/*": ["packages/core/i18n/core-i18n-browser-mocks/*"],
"@kbn/core-i18n-server": ["packages/core/i18n/core-i18n-server"],
"@kbn/core-i18n-server/*": ["packages/core/i18n/core-i18n-server/*"],
"@kbn/core-i18n-server-internal": ["packages/core/i18n/core-i18n-server-internal"],
"@kbn/core-i18n-server-internal/*": ["packages/core/i18n/core-i18n-server-internal/*"],
"@kbn/core-i18n-server-mocks": ["packages/core/i18n/core-i18n-server-mocks"],
"@kbn/core-i18n-server-mocks/*": ["packages/core/i18n/core-i18n-server-mocks/*"],
"@kbn/core-injected-metadata-browser": ["packages/core/injected-metadata/core-injected-metadata-browser"],
"@kbn/core-injected-metadata-browser/*": ["packages/core/injected-metadata/core-injected-metadata-browser/*"],
"@kbn/core-injected-metadata-browser-internal": ["packages/core/injected-metadata/core-injected-metadata-browser-internal"],
"@kbn/core-injected-metadata-browser-internal/*": ["packages/core/injected-metadata/core-injected-metadata-browser-internal/*"],
"@kbn/core-injected-metadata-browser-mocks": ["packages/core/injected-metadata/core-injected-metadata-browser-mocks"],
"@kbn/core-injected-metadata-browser-mocks/*": ["packages/core/injected-metadata/core-injected-metadata-browser-mocks/*"],
"@kbn/core-injected-metadata-common-internal": ["packages/core/injected-metadata/core-injected-metadata-common-internal"],
"@kbn/core-injected-metadata-common-internal/*": ["packages/core/injected-metadata/core-injected-metadata-common-internal/*"],
"@kbn/core-integrations-browser-internal": ["packages/core/integrations/core-integrations-browser-internal"],
"@kbn/core-integrations-browser-internal/*": ["packages/core/integrations/core-integrations-browser-internal/*"],
"@kbn/core-integrations-browser-mocks": ["packages/core/integrations/core-integrations-browser-mocks"],
"@kbn/core-integrations-browser-mocks/*": ["packages/core/integrations/core-integrations-browser-mocks/*"],
"@kbn/core-lifecycle-browser": ["packages/core/lifecycle/core-lifecycle-browser"],
"@kbn/core-lifecycle-browser/*": ["packages/core/lifecycle/core-lifecycle-browser/*"],
"@kbn/core-lifecycle-browser-internal": ["packages/core/lifecycle/core-lifecycle-browser-internal"],
"@kbn/core-lifecycle-browser-internal/*": ["packages/core/lifecycle/core-lifecycle-browser-internal/*"],
"@kbn/core-lifecycle-browser-mocks": ["packages/core/lifecycle/core-lifecycle-browser-mocks"],
"@kbn/core-lifecycle-browser-mocks/*": ["packages/core/lifecycle/core-lifecycle-browser-mocks/*"],
"@kbn/core-lifecycle-server": ["packages/core/lifecycle/core-lifecycle-server"],
"@kbn/core-lifecycle-server/*": ["packages/core/lifecycle/core-lifecycle-server/*"],
"@kbn/core-lifecycle-server-internal": ["packages/core/lifecycle/core-lifecycle-server-internal"],
"@kbn/core-lifecycle-server-internal/*": ["packages/core/lifecycle/core-lifecycle-server-internal/*"],
"@kbn/core-lifecycle-server-mocks": ["packages/core/lifecycle/core-lifecycle-server-mocks"],
"@kbn/core-lifecycle-server-mocks/*": ["packages/core/lifecycle/core-lifecycle-server-mocks/*"],
"@kbn/core-logging-server": ["packages/core/logging/core-logging-server"],
"@kbn/core-logging-server/*": ["packages/core/logging/core-logging-server/*"],
"@kbn/core-logging-server-internal": ["packages/core/logging/core-logging-server-internal"],
"@kbn/core-logging-server-internal/*": ["packages/core/logging/core-logging-server-internal/*"],
"@kbn/core-logging-server-mocks": ["packages/core/logging/core-logging-server-mocks"],
"@kbn/core-logging-server-mocks/*": ["packages/core/logging/core-logging-server-mocks/*"],
"@kbn/core-metrics-collectors-server-internal": ["packages/core/metrics/core-metrics-collectors-server-internal"],
"@kbn/core-metrics-collectors-server-internal/*": ["packages/core/metrics/core-metrics-collectors-server-internal/*"],
"@kbn/core-metrics-collectors-server-mocks": ["packages/core/metrics/core-metrics-collectors-server-mocks"],
"@kbn/core-metrics-collectors-server-mocks/*": ["packages/core/metrics/core-metrics-collectors-server-mocks/*"],
"@kbn/core-metrics-server": ["packages/core/metrics/core-metrics-server"],
"@kbn/core-metrics-server/*": ["packages/core/metrics/core-metrics-server/*"],
"@kbn/core-metrics-server-internal": ["packages/core/metrics/core-metrics-server-internal"],
"@kbn/core-metrics-server-internal/*": ["packages/core/metrics/core-metrics-server-internal/*"],
"@kbn/core-metrics-server-mocks": ["packages/core/metrics/core-metrics-server-mocks"],
"@kbn/core-metrics-server-mocks/*": ["packages/core/metrics/core-metrics-server-mocks/*"],
"@kbn/core-mount-utils-browser": ["packages/core/mount-utils/core-mount-utils-browser"],
"@kbn/core-mount-utils-browser/*": ["packages/core/mount-utils/core-mount-utils-browser/*"],
"@kbn/core-mount-utils-browser-internal": ["packages/core/mount-utils/core-mount-utils-browser-internal"],
"@kbn/core-mount-utils-browser-internal/*": ["packages/core/mount-utils/core-mount-utils-browser-internal/*"],
"@kbn/core-node-server": ["packages/core/node/core-node-server"],
"@kbn/core-node-server/*": ["packages/core/node/core-node-server/*"],
"@kbn/core-node-server-internal": ["packages/core/node/core-node-server-internal"],
"@kbn/core-node-server-internal/*": ["packages/core/node/core-node-server-internal/*"],
"@kbn/core-node-server-mocks": ["packages/core/node/core-node-server-mocks"],
"@kbn/core-node-server-mocks/*": ["packages/core/node/core-node-server-mocks/*"],
"@kbn/core-notifications-browser": ["packages/core/notifications/core-notifications-browser"],
"@kbn/core-notifications-browser/*": ["packages/core/notifications/core-notifications-browser/*"],
"@kbn/core-notifications-browser-internal": ["packages/core/notifications/core-notifications-browser-internal"],
"@kbn/core-notifications-browser-internal/*": ["packages/core/notifications/core-notifications-browser-internal/*"],
"@kbn/core-notifications-browser-mocks": ["packages/core/notifications/core-notifications-browser-mocks"],
"@kbn/core-notifications-browser-mocks/*": ["packages/core/notifications/core-notifications-browser-mocks/*"],
"@kbn/core-overlays-browser": ["packages/core/overlays/core-overlays-browser"],
"@kbn/core-overlays-browser/*": ["packages/core/overlays/core-overlays-browser/*"],
"@kbn/core-overlays-browser-internal": ["packages/core/overlays/core-overlays-browser-internal"],
"@kbn/core-overlays-browser-internal/*": ["packages/core/overlays/core-overlays-browser-internal/*"],
"@kbn/core-overlays-browser-mocks": ["packages/core/overlays/core-overlays-browser-mocks"],
"@kbn/core-overlays-browser-mocks/*": ["packages/core/overlays/core-overlays-browser-mocks/*"],
"@kbn/core-plugins-base-server-internal": ["packages/core/plugins/core-plugins-base-server-internal"],
"@kbn/core-plugins-base-server-internal/*": ["packages/core/plugins/core-plugins-base-server-internal/*"],
"@kbn/core-plugins-browser": ["packages/core/plugins/core-plugins-browser"],
"@kbn/core-plugins-browser/*": ["packages/core/plugins/core-plugins-browser/*"],
"@kbn/core-plugins-browser-internal": ["packages/core/plugins/core-plugins-browser-internal"],
"@kbn/core-plugins-browser-internal/*": ["packages/core/plugins/core-plugins-browser-internal/*"],
"@kbn/core-plugins-browser-mocks": ["packages/core/plugins/core-plugins-browser-mocks"],
"@kbn/core-plugins-browser-mocks/*": ["packages/core/plugins/core-plugins-browser-mocks/*"],
"@kbn/core-plugins-server": ["packages/core/plugins/core-plugins-server"],
"@kbn/core-plugins-server/*": ["packages/core/plugins/core-plugins-server/*"],
"@kbn/core-plugins-server-internal": ["packages/core/plugins/core-plugins-server-internal"],
"@kbn/core-plugins-server-internal/*": ["packages/core/plugins/core-plugins-server-internal/*"],
"@kbn/core-plugins-server-mocks": ["packages/core/plugins/core-plugins-server-mocks"],
"@kbn/core-plugins-server-mocks/*": ["packages/core/plugins/core-plugins-server-mocks/*"],
"@kbn/core-preboot-server": ["packages/core/preboot/core-preboot-server"],
"@kbn/core-preboot-server/*": ["packages/core/preboot/core-preboot-server/*"],
"@kbn/core-preboot-server-internal": ["packages/core/preboot/core-preboot-server-internal"],
"@kbn/core-preboot-server-internal/*": ["packages/core/preboot/core-preboot-server-internal/*"],
"@kbn/core-preboot-server-mocks": ["packages/core/preboot/core-preboot-server-mocks"],
"@kbn/core-preboot-server-mocks/*": ["packages/core/preboot/core-preboot-server-mocks/*"],
"@kbn/core-rendering-browser-internal": ["packages/core/rendering/core-rendering-browser-internal"],
"@kbn/core-rendering-browser-internal/*": ["packages/core/rendering/core-rendering-browser-internal/*"],
"@kbn/core-rendering-browser-mocks": ["packages/core/rendering/core-rendering-browser-mocks"],
"@kbn/core-rendering-browser-mocks/*": ["packages/core/rendering/core-rendering-browser-mocks/*"],
"@kbn/core-rendering-server-internal": ["packages/core/rendering/core-rendering-server-internal"],
"@kbn/core-rendering-server-internal/*": ["packages/core/rendering/core-rendering-server-internal/*"],
"@kbn/core-rendering-server-mocks": ["packages/core/rendering/core-rendering-server-mocks"],
"@kbn/core-rendering-server-mocks/*": ["packages/core/rendering/core-rendering-server-mocks/*"],
"@kbn/core-root-browser-internal": ["packages/core/root/core-root-browser-internal"],
"@kbn/core-root-browser-internal/*": ["packages/core/root/core-root-browser-internal/*"],
"@kbn/core-saved-objects-api-browser": ["packages/core/saved-objects/core-saved-objects-api-browser"],
"@kbn/core-saved-objects-api-browser/*": ["packages/core/saved-objects/core-saved-objects-api-browser/*"],
"@kbn/core-saved-objects-api-server": ["packages/core/saved-objects/core-saved-objects-api-server"],
"@kbn/core-saved-objects-api-server/*": ["packages/core/saved-objects/core-saved-objects-api-server/*"],
"@kbn/core-saved-objects-api-server-internal": ["packages/core/saved-objects/core-saved-objects-api-server-internal"],
"@kbn/core-saved-objects-api-server-internal/*": ["packages/core/saved-objects/core-saved-objects-api-server-internal/*"],
"@kbn/core-saved-objects-api-server-mocks": ["packages/core/saved-objects/core-saved-objects-api-server-mocks"],
"@kbn/core-saved-objects-api-server-mocks/*": ["packages/core/saved-objects/core-saved-objects-api-server-mocks/*"],
"@kbn/core-saved-objects-base-server-internal": ["packages/core/saved-objects/core-saved-objects-base-server-internal"],
"@kbn/core-saved-objects-base-server-internal/*": ["packages/core/saved-objects/core-saved-objects-base-server-internal/*"],
"@kbn/core-saved-objects-base-server-mocks": ["packages/core/saved-objects/core-saved-objects-base-server-mocks"],
"@kbn/core-saved-objects-base-server-mocks/*": ["packages/core/saved-objects/core-saved-objects-base-server-mocks/*"],
"@kbn/core-saved-objects-browser": ["packages/core/saved-objects/core-saved-objects-browser"],
"@kbn/core-saved-objects-browser/*": ["packages/core/saved-objects/core-saved-objects-browser/*"],
"@kbn/core-saved-objects-browser-internal": ["packages/core/saved-objects/core-saved-objects-browser-internal"],
"@kbn/core-saved-objects-browser-internal/*": ["packages/core/saved-objects/core-saved-objects-browser-internal/*"],
"@kbn/core-saved-objects-browser-mocks": ["packages/core/saved-objects/core-saved-objects-browser-mocks"],
"@kbn/core-saved-objects-browser-mocks/*": ["packages/core/saved-objects/core-saved-objects-browser-mocks/*"],
"@kbn/core-saved-objects-common": ["packages/core/saved-objects/core-saved-objects-common"],
"@kbn/core-saved-objects-common/*": ["packages/core/saved-objects/core-saved-objects-common/*"],
"@kbn/core-saved-objects-import-export-server-internal": ["packages/core/saved-objects/core-saved-objects-import-export-server-internal"],
"@kbn/core-saved-objects-import-export-server-internal/*": ["packages/core/saved-objects/core-saved-objects-import-export-server-internal/*"],
"@kbn/core-saved-objects-import-export-server-mocks": ["packages/core/saved-objects/core-saved-objects-import-export-server-mocks"],
"@kbn/core-saved-objects-import-export-server-mocks/*": ["packages/core/saved-objects/core-saved-objects-import-export-server-mocks/*"],
"@kbn/core-saved-objects-migration-server-internal": ["packages/core/saved-objects/core-saved-objects-migration-server-internal"],
"@kbn/core-saved-objects-migration-server-internal/*": ["packages/core/saved-objects/core-saved-objects-migration-server-internal/*"],
"@kbn/core-saved-objects-migration-server-mocks": ["packages/core/saved-objects/core-saved-objects-migration-server-mocks"],
"@kbn/core-saved-objects-migration-server-mocks/*": ["packages/core/saved-objects/core-saved-objects-migration-server-mocks/*"],
"@kbn/core-saved-objects-server": ["packages/core/saved-objects/core-saved-objects-server"],
"@kbn/core-saved-objects-server/*": ["packages/core/saved-objects/core-saved-objects-server/*"],
"@kbn/core-saved-objects-server-internal": ["packages/core/saved-objects/core-saved-objects-server-internal"],
"@kbn/core-saved-objects-server-internal/*": ["packages/core/saved-objects/core-saved-objects-server-internal/*"],
"@kbn/core-saved-objects-server-mocks": ["packages/core/saved-objects/core-saved-objects-server-mocks"],
"@kbn/core-saved-objects-server-mocks/*": ["packages/core/saved-objects/core-saved-objects-server-mocks/*"],
"@kbn/core-saved-objects-utils-server": ["packages/core/saved-objects/core-saved-objects-utils-server"],
"@kbn/core-saved-objects-utils-server/*": ["packages/core/saved-objects/core-saved-objects-utils-server/*"],
"@kbn/core-status-common": ["packages/core/status/core-status-common"],
"@kbn/core-status-common/*": ["packages/core/status/core-status-common/*"],
"@kbn/core-status-common-internal": ["packages/core/status/core-status-common-internal"],
"@kbn/core-status-common-internal/*": ["packages/core/status/core-status-common-internal/*"],
"@kbn/core-status-server": ["packages/core/status/core-status-server"],
"@kbn/core-status-server/*": ["packages/core/status/core-status-server/*"],
"@kbn/core-status-server-internal": ["packages/core/status/core-status-server-internal"],
"@kbn/core-status-server-internal/*": ["packages/core/status/core-status-server-internal/*"],
"@kbn/core-status-server-mocks": ["packages/core/status/core-status-server-mocks"],
"@kbn/core-status-server-mocks/*": ["packages/core/status/core-status-server-mocks/*"],
"@kbn/core-test-helpers-deprecations-getters": ["packages/core/test-helpers/core-test-helpers-deprecations-getters"],
"@kbn/core-test-helpers-deprecations-getters/*": ["packages/core/test-helpers/core-test-helpers-deprecations-getters/*"],
"@kbn/core-test-helpers-http-setup-browser": ["packages/core/test-helpers/core-test-helpers-http-setup-browser"],
"@kbn/core-test-helpers-http-setup-browser/*": ["packages/core/test-helpers/core-test-helpers-http-setup-browser/*"],
"@kbn/core-test-helpers-so-type-serializer": ["packages/core/test-helpers/core-test-helpers-so-type-serializer"],
"@kbn/core-test-helpers-so-type-serializer/*": ["packages/core/test-helpers/core-test-helpers-so-type-serializer/*"],
"@kbn/core-test-helpers-test-utils": ["packages/core/test-helpers/core-test-helpers-test-utils"],
"@kbn/core-test-helpers-test-utils/*": ["packages/core/test-helpers/core-test-helpers-test-utils/*"],
"@kbn/core-theme-browser": ["packages/core/theme/core-theme-browser"],
"@kbn/core-theme-browser/*": ["packages/core/theme/core-theme-browser/*"],
"@kbn/core-theme-browser-internal": ["packages/core/theme/core-theme-browser-internal"],
"@kbn/core-theme-browser-internal/*": ["packages/core/theme/core-theme-browser-internal/*"],
"@kbn/core-theme-browser-mocks": ["packages/core/theme/core-theme-browser-mocks"],
"@kbn/core-theme-browser-mocks/*": ["packages/core/theme/core-theme-browser-mocks/*"],
"@kbn/core-ui-settings-browser": ["packages/core/ui-settings/core-ui-settings-browser"],
"@kbn/core-ui-settings-browser/*": ["packages/core/ui-settings/core-ui-settings-browser/*"],
"@kbn/core-ui-settings-browser-internal": ["packages/core/ui-settings/core-ui-settings-browser-internal"],
"@kbn/core-ui-settings-browser-internal/*": ["packages/core/ui-settings/core-ui-settings-browser-internal/*"],
"@kbn/core-ui-settings-browser-mocks": ["packages/core/ui-settings/core-ui-settings-browser-mocks"],
"@kbn/core-ui-settings-browser-mocks/*": ["packages/core/ui-settings/core-ui-settings-browser-mocks/*"],
"@kbn/core-ui-settings-common": ["packages/core/ui-settings/core-ui-settings-common"],
"@kbn/core-ui-settings-common/*": ["packages/core/ui-settings/core-ui-settings-common/*"],
"@kbn/core-ui-settings-server": ["packages/core/ui-settings/core-ui-settings-server"],
"@kbn/core-ui-settings-server/*": ["packages/core/ui-settings/core-ui-settings-server/*"],
"@kbn/core-ui-settings-server-internal": ["packages/core/ui-settings/core-ui-settings-server-internal"],
"@kbn/core-ui-settings-server-internal/*": ["packages/core/ui-settings/core-ui-settings-server-internal/*"],
"@kbn/core-ui-settings-server-mocks": ["packages/core/ui-settings/core-ui-settings-server-mocks"],
"@kbn/core-ui-settings-server-mocks/*": ["packages/core/ui-settings/core-ui-settings-server-mocks/*"],
"@kbn/core-usage-data-base-server-internal": ["packages/core/usage-data/core-usage-data-base-server-internal"],
"@kbn/core-usage-data-base-server-internal/*": ["packages/core/usage-data/core-usage-data-base-server-internal/*"],
"@kbn/core-usage-data-server": ["packages/core/usage-data/core-usage-data-server"],
"@kbn/core-usage-data-server/*": ["packages/core/usage-data/core-usage-data-server/*"],
"@kbn/core-usage-data-server-internal": ["packages/core/usage-data/core-usage-data-server-internal"],
"@kbn/core-usage-data-server-internal/*": ["packages/core/usage-data/core-usage-data-server-internal/*"],
"@kbn/core-usage-data-server-mocks": ["packages/core/usage-data/core-usage-data-server-mocks"],
"@kbn/core-usage-data-server-mocks/*": ["packages/core/usage-data/core-usage-data-server-mocks/*"],
"@kbn/home-sample-data-card": ["packages/home/sample_data_card"],
"@kbn/home-sample-data-card/*": ["packages/home/sample_data_card/*"],
"@kbn/home-sample-data-tab": ["packages/home/sample_data_tab"],
"@kbn/home-sample-data-tab/*": ["packages/home/sample_data_tab/*"],
"@kbn/home-sample-data-types": ["packages/home/sample_data_types"],
"@kbn/home-sample-data-types/*": ["packages/home/sample_data_types/*"],
"@kbn/ace": ["packages/kbn-ace"],
"@kbn/ace/*": ["packages/kbn-ace/*"],
"@kbn/alerts": ["packages/kbn-alerts"],
"@kbn/alerts/*": ["packages/kbn-alerts/*"],
"@kbn/ambient-storybook-types": ["packages/kbn-ambient-storybook-types"],
"@kbn/ambient-storybook-types/*": ["packages/kbn-ambient-storybook-types/*"],
"@kbn/ambient-ui-types": ["packages/kbn-ambient-ui-types"],
"@kbn/ambient-ui-types/*": ["packages/kbn-ambient-ui-types/*"],
"@kbn/analytics": ["packages/kbn-analytics"],
"@kbn/analytics/*": ["packages/kbn-analytics/*"],
"@kbn/apm-config-loader": ["packages/kbn-apm-config-loader"],
"@kbn/apm-config-loader/*": ["packages/kbn-apm-config-loader/*"],
"@kbn/apm-synthtrace": ["packages/kbn-apm-synthtrace"],
"@kbn/apm-synthtrace/*": ["packages/kbn-apm-synthtrace/*"],
"@kbn/apm-utils": ["packages/kbn-apm-utils"],
"@kbn/apm-utils/*": ["packages/kbn-apm-utils/*"],
"@kbn/axe-config": ["packages/kbn-axe-config"],
"@kbn/axe-config/*": ["packages/kbn-axe-config/*"],
"@kbn/babel-plugin-synthetic-packages": ["packages/kbn-babel-plugin-synthetic-packages"],
"@kbn/babel-plugin-synthetic-packages/*": ["packages/kbn-babel-plugin-synthetic-packages/*"],
"@kbn/babel-preset": ["packages/kbn-babel-preset"],
"@kbn/babel-preset/*": ["packages/kbn-babel-preset/*"],
"@kbn/bazel-packages": ["packages/kbn-bazel-packages"],
"@kbn/bazel-packages/*": ["packages/kbn-bazel-packages/*"],
"@kbn/bazel-runner": ["packages/kbn-bazel-runner"],
"@kbn/bazel-runner/*": ["packages/kbn-bazel-runner/*"],
"@kbn/cases-components": ["packages/kbn-cases-components"],
"@kbn/cases-components/*": ["packages/kbn-cases-components/*"],
"@kbn/chart-icons": ["packages/kbn-chart-icons"],
"@kbn/chart-icons/*": ["packages/kbn-chart-icons/*"],
"@kbn/ci-stats-core": ["packages/kbn-ci-stats-core"],
"@kbn/ci-stats-core/*": ["packages/kbn-ci-stats-core/*"],
"@kbn/ci-stats-performance-metrics": ["packages/kbn-ci-stats-performance-metrics"],
"@kbn/ci-stats-performance-metrics/*": ["packages/kbn-ci-stats-performance-metrics/*"],
"@kbn/ci-stats-reporter": ["packages/kbn-ci-stats-reporter"],
"@kbn/ci-stats-reporter/*": ["packages/kbn-ci-stats-reporter/*"],
"@kbn/cli-dev-mode": ["packages/kbn-cli-dev-mode"],
"@kbn/cli-dev-mode/*": ["packages/kbn-cli-dev-mode/*"],
"@kbn/coloring": ["packages/kbn-coloring"],
"@kbn/coloring/*": ["packages/kbn-coloring/*"],
"@kbn/config": ["packages/kbn-config"],
"@kbn/config/*": ["packages/kbn-config/*"],
"@kbn/config-mocks": ["packages/kbn-config-mocks"],
"@kbn/config-mocks/*": ["packages/kbn-config-mocks/*"],
"@kbn/config-schema": ["packages/kbn-config-schema"],
"@kbn/config-schema/*": ["packages/kbn-config-schema/*"],
"@kbn/crypto": ["packages/kbn-crypto"],
"@kbn/crypto/*": ["packages/kbn-crypto/*"],
"@kbn/crypto-browser": ["packages/kbn-crypto-browser"],
"@kbn/crypto-browser/*": ["packages/kbn-crypto-browser/*"],
"@kbn/datemath": ["packages/kbn-datemath"],
"@kbn/datemath/*": ["packages/kbn-datemath/*"],
"@kbn/dev-cli-errors": ["packages/kbn-dev-cli-errors"],
"@kbn/dev-cli-errors/*": ["packages/kbn-dev-cli-errors/*"],
"@kbn/dev-cli-runner": ["packages/kbn-dev-cli-runner"],
"@kbn/dev-cli-runner/*": ["packages/kbn-dev-cli-runner/*"],
"@kbn/dev-proc-runner": ["packages/kbn-dev-proc-runner"],
"@kbn/dev-proc-runner/*": ["packages/kbn-dev-proc-runner/*"],
"@kbn/dev-utils": ["packages/kbn-dev-utils"],
"@kbn/dev-utils/*": ["packages/kbn-dev-utils/*"],
"@kbn/doc-links": ["packages/kbn-doc-links"],
"@kbn/doc-links/*": ["packages/kbn-doc-links/*"],
"@kbn/docs-utils": ["packages/kbn-docs-utils"],
"@kbn/docs-utils/*": ["packages/kbn-docs-utils/*"],
"@kbn/ebt-tools": ["packages/kbn-ebt-tools"],
"@kbn/ebt-tools/*": ["packages/kbn-ebt-tools/*"],
"@kbn/es": ["packages/kbn-es"],
"@kbn/es/*": ["packages/kbn-es/*"],
"@kbn/es-archiver": ["packages/kbn-es-archiver"],
"@kbn/es-archiver/*": ["packages/kbn-es-archiver/*"],
"@kbn/es-errors": ["packages/kbn-es-errors"],
"@kbn/es-errors/*": ["packages/kbn-es-errors/*"],
"@kbn/es-query": ["packages/kbn-es-query"],
"@kbn/es-query/*": ["packages/kbn-es-query/*"],
"@kbn/es-types": ["packages/kbn-es-types"],
"@kbn/es-types/*": ["packages/kbn-es-types/*"],
"@kbn/eslint-config": ["packages/kbn-eslint-config"],
"@kbn/eslint-config/*": ["packages/kbn-eslint-config/*"],
"@kbn/eslint-plugin-disable": ["packages/kbn-eslint-plugin-disable"],
"@kbn/eslint-plugin-disable/*": ["packages/kbn-eslint-plugin-disable/*"],
"@kbn/eslint-plugin-eslint": ["packages/kbn-eslint-plugin-eslint"],
"@kbn/eslint-plugin-eslint/*": ["packages/kbn-eslint-plugin-eslint/*"],
"@kbn/eslint-plugin-imports": ["packages/kbn-eslint-plugin-imports"],
"@kbn/eslint-plugin-imports/*": ["packages/kbn-eslint-plugin-imports/*"],
"@kbn/expect": ["packages/kbn-expect"],
"@kbn/expect/*": ["packages/kbn-expect/*"],
"@kbn/failed-test-reporter-cli": ["packages/kbn-failed-test-reporter-cli"],
"@kbn/failed-test-reporter-cli/*": ["packages/kbn-failed-test-reporter-cli/*"],
"@kbn/field-types": ["packages/kbn-field-types"],
"@kbn/field-types/*": ["packages/kbn-field-types/*"],
"@kbn/find-used-node-modules": ["packages/kbn-find-used-node-modules"],
"@kbn/find-used-node-modules/*": ["packages/kbn-find-used-node-modules/*"],
"@kbn/flot-charts": ["packages/kbn-flot-charts"],
"@kbn/flot-charts/*": ["packages/kbn-flot-charts/*"],
"@kbn/ftr-common-functional-services": ["packages/kbn-ftr-common-functional-services"],
"@kbn/ftr-common-functional-services/*": ["packages/kbn-ftr-common-functional-services/*"],
"@kbn/ftr-screenshot-filename": ["packages/kbn-ftr-screenshot-filename"],
"@kbn/ftr-screenshot-filename/*": ["packages/kbn-ftr-screenshot-filename/*"],
"@kbn/generate": ["packages/kbn-generate"],
"@kbn/generate/*": ["packages/kbn-generate/*"],
"@kbn/get-repo-files": ["packages/kbn-get-repo-files"],
"@kbn/get-repo-files/*": ["packages/kbn-get-repo-files/*"],
"@kbn/guided-onboarding": ["packages/kbn-guided-onboarding"],
"@kbn/guided-onboarding/*": ["packages/kbn-guided-onboarding/*"],
"@kbn/handlebars": ["packages/kbn-handlebars"],
"@kbn/handlebars/*": ["packages/kbn-handlebars/*"],
"@kbn/hapi-mocks": ["packages/kbn-hapi-mocks"],
"@kbn/hapi-mocks/*": ["packages/kbn-hapi-mocks/*"],
"@kbn/i18n": ["packages/kbn-i18n"],
"@kbn/i18n/*": ["packages/kbn-i18n/*"],
"@kbn/i18n-react": ["packages/kbn-i18n-react"],
"@kbn/i18n-react/*": ["packages/kbn-i18n-react/*"],
"@kbn/import-resolver": ["packages/kbn-import-resolver"],
"@kbn/import-resolver/*": ["packages/kbn-import-resolver/*"],
"@kbn/interpreter": ["packages/kbn-interpreter"],
"@kbn/interpreter/*": ["packages/kbn-interpreter/*"],
"@kbn/io-ts-utils": ["packages/kbn-io-ts-utils"],
"@kbn/io-ts-utils/*": ["packages/kbn-io-ts-utils/*"],
"@kbn/jest-serializers": ["packages/kbn-jest-serializers"],
"@kbn/jest-serializers/*": ["packages/kbn-jest-serializers/*"],
"@kbn/journeys": ["packages/kbn-journeys"],
"@kbn/journeys/*": ["packages/kbn-journeys/*"],
"@kbn/kibana-manifest-schema": ["packages/kbn-kibana-manifest-schema"],
"@kbn/kibana-manifest-schema/*": ["packages/kbn-kibana-manifest-schema/*"],
"@kbn/language-documentation-popover": ["packages/kbn-language-documentation-popover"],
"@kbn/language-documentation-popover/*": ["packages/kbn-language-documentation-popover/*"],
"@kbn/logging": ["packages/kbn-logging"],
"@kbn/logging/*": ["packages/kbn-logging/*"],
"@kbn/logging-mocks": ["packages/kbn-logging-mocks"],
"@kbn/logging-mocks/*": ["packages/kbn-logging-mocks/*"],
"@kbn/managed-vscode-config": ["packages/kbn-managed-vscode-config"],
"@kbn/managed-vscode-config/*": ["packages/kbn-managed-vscode-config/*"],
"@kbn/managed-vscode-config-cli": ["packages/kbn-managed-vscode-config-cli"],
"@kbn/managed-vscode-config-cli/*": ["packages/kbn-managed-vscode-config-cli/*"],
"@kbn/mapbox-gl": ["packages/kbn-mapbox-gl"],
"@kbn/mapbox-gl/*": ["packages/kbn-mapbox-gl/*"],
"@kbn/monaco": ["packages/kbn-monaco"],
"@kbn/monaco/*": ["packages/kbn-monaco/*"],
"@kbn/optimizer": ["packages/kbn-optimizer"],
"@kbn/optimizer/*": ["packages/kbn-optimizer/*"],
"@kbn/optimizer-webpack-helpers": ["packages/kbn-optimizer-webpack-helpers"],
"@kbn/optimizer-webpack-helpers/*": ["packages/kbn-optimizer-webpack-helpers/*"],
"@kbn/osquery-io-ts-types": ["packages/kbn-osquery-io-ts-types"],
"@kbn/osquery-io-ts-types/*": ["packages/kbn-osquery-io-ts-types/*"],
"@kbn/performance-testing-dataset-extractor": ["packages/kbn-performance-testing-dataset-extractor"],
"@kbn/performance-testing-dataset-extractor/*": ["packages/kbn-performance-testing-dataset-extractor/*"],
"@kbn/plugin-discovery": ["packages/kbn-plugin-discovery"],
"@kbn/plugin-discovery/*": ["packages/kbn-plugin-discovery/*"],
"@kbn/plugin-generator": ["packages/kbn-plugin-generator"],
"@kbn/plugin-generator/*": ["packages/kbn-plugin-generator/*"],
"@kbn/plugin-helpers": ["packages/kbn-plugin-helpers"],
"@kbn/plugin-helpers/*": ["packages/kbn-plugin-helpers/*"],
"@kbn/react-field": ["packages/kbn-react-field"],
"@kbn/react-field/*": ["packages/kbn-react-field/*"],
"@kbn/repo-source-classifier": ["packages/kbn-repo-source-classifier"],
"@kbn/repo-source-classifier/*": ["packages/kbn-repo-source-classifier/*"],
"@kbn/repo-source-classifier-cli": ["packages/kbn-repo-source-classifier-cli"],
"@kbn/repo-source-classifier-cli/*": ["packages/kbn-repo-source-classifier-cli/*"],
"@kbn/rule-data-utils": ["packages/kbn-rule-data-utils"],
"@kbn/rule-data-utils/*": ["packages/kbn-rule-data-utils/*"],
"@kbn/safer-lodash-set": ["packages/kbn-safer-lodash-set"],
"@kbn/safer-lodash-set/*": ["packages/kbn-safer-lodash-set/*"],
"@kbn/securitysolution-autocomplete": ["packages/kbn-securitysolution-autocomplete"],
"@kbn/securitysolution-autocomplete/*": ["packages/kbn-securitysolution-autocomplete/*"],
"@kbn/securitysolution-es-utils": ["packages/kbn-securitysolution-es-utils"],
"@kbn/securitysolution-es-utils/*": ["packages/kbn-securitysolution-es-utils/*"],
"@kbn/securitysolution-exception-list-components": ["packages/kbn-securitysolution-exception-list-components"],
"@kbn/securitysolution-exception-list-components/*": ["packages/kbn-securitysolution-exception-list-components/*"],
"@kbn/securitysolution-hook-utils": ["packages/kbn-securitysolution-hook-utils"],
"@kbn/securitysolution-hook-utils/*": ["packages/kbn-securitysolution-hook-utils/*"],
"@kbn/securitysolution-io-ts-alerting-types": ["packages/kbn-securitysolution-io-ts-alerting-types"],
"@kbn/securitysolution-io-ts-alerting-types/*": ["packages/kbn-securitysolution-io-ts-alerting-types/*"],
"@kbn/securitysolution-io-ts-list-types": ["packages/kbn-securitysolution-io-ts-list-types"],
"@kbn/securitysolution-io-ts-list-types/*": ["packages/kbn-securitysolution-io-ts-list-types/*"],
"@kbn/securitysolution-io-ts-types": ["packages/kbn-securitysolution-io-ts-types"],
"@kbn/securitysolution-io-ts-types/*": ["packages/kbn-securitysolution-io-ts-types/*"],
"@kbn/securitysolution-io-ts-utils": ["packages/kbn-securitysolution-io-ts-utils"],
"@kbn/securitysolution-io-ts-utils/*": ["packages/kbn-securitysolution-io-ts-utils/*"],
"@kbn/securitysolution-list-api": ["packages/kbn-securitysolution-list-api"],
"@kbn/securitysolution-list-api/*": ["packages/kbn-securitysolution-list-api/*"],
"@kbn/securitysolution-list-constants": ["packages/kbn-securitysolution-list-constants"],
"@kbn/securitysolution-list-constants/*": ["packages/kbn-securitysolution-list-constants/*"],
"@kbn/securitysolution-list-hooks": ["packages/kbn-securitysolution-list-hooks"],
"@kbn/securitysolution-list-hooks/*": ["packages/kbn-securitysolution-list-hooks/*"],
"@kbn/securitysolution-list-utils": ["packages/kbn-securitysolution-list-utils"],
"@kbn/securitysolution-list-utils/*": ["packages/kbn-securitysolution-list-utils/*"],
"@kbn/securitysolution-rules": ["packages/kbn-securitysolution-rules"],
"@kbn/securitysolution-rules/*": ["packages/kbn-securitysolution-rules/*"],
"@kbn/securitysolution-t-grid": ["packages/kbn-securitysolution-t-grid"],
"@kbn/securitysolution-t-grid/*": ["packages/kbn-securitysolution-t-grid/*"],
"@kbn/securitysolution-utils": ["packages/kbn-securitysolution-utils"],
"@kbn/securitysolution-utils/*": ["packages/kbn-securitysolution-utils/*"],
"@kbn/server-http-tools": ["packages/kbn-server-http-tools"],
"@kbn/server-http-tools/*": ["packages/kbn-server-http-tools/*"],
"@kbn/server-route-repository": ["packages/kbn-server-route-repository"],
"@kbn/server-route-repository/*": ["packages/kbn-server-route-repository/*"],
"@kbn/shared-svg": ["packages/kbn-shared-svg"],
"@kbn/shared-svg/*": ["packages/kbn-shared-svg/*"],
"@kbn/shared-ux-utility": ["packages/kbn-shared-ux-utility"],
"@kbn/shared-ux-utility/*": ["packages/kbn-shared-ux-utility/*"],
"@kbn/some-dev-log": ["packages/kbn-some-dev-log"],
"@kbn/some-dev-log/*": ["packages/kbn-some-dev-log/*"],
"@kbn/sort-package-json": ["packages/kbn-sort-package-json"],
"@kbn/sort-package-json/*": ["packages/kbn-sort-package-json/*"],
"@kbn/spec-to-console": ["packages/kbn-spec-to-console"],
"@kbn/spec-to-console/*": ["packages/kbn-spec-to-console/*"],
"@kbn/std": ["packages/kbn-std"],
"@kbn/std/*": ["packages/kbn-std/*"],
"@kbn/stdio-dev-helpers": ["packages/kbn-stdio-dev-helpers"],
"@kbn/stdio-dev-helpers/*": ["packages/kbn-stdio-dev-helpers/*"],
"@kbn/storybook": ["packages/kbn-storybook"],
"@kbn/storybook/*": ["packages/kbn-storybook/*"],
"@kbn/synthetic-package-map": ["packages/kbn-synthetic-package-map"],
"@kbn/synthetic-package-map/*": ["packages/kbn-synthetic-package-map/*"],
"@kbn/telemetry-tools": ["packages/kbn-telemetry-tools"],
"@kbn/telemetry-tools/*": ["packages/kbn-telemetry-tools/*"],
"@kbn/test": ["packages/kbn-test"],
"@kbn/test/*": ["packages/kbn-test/*"],
"@kbn/test-jest-helpers": ["packages/kbn-test-jest-helpers"],
"@kbn/test-jest-helpers/*": ["packages/kbn-test-jest-helpers/*"],
"@kbn/test-subj-selector": ["packages/kbn-test-subj-selector"],
"@kbn/test-subj-selector/*": ["packages/kbn-test-subj-selector/*"],
"@kbn/timelion-grammar": ["packages/kbn-timelion-grammar"],
"@kbn/timelion-grammar/*": ["packages/kbn-timelion-grammar/*"],
"@kbn/tinymath": ["packages/kbn-tinymath"],
"@kbn/tinymath/*": ["packages/kbn-tinymath/*"],
"@kbn/tooling-log": ["packages/kbn-tooling-log"],
"@kbn/tooling-log/*": ["packages/kbn-tooling-log/*"],
"@kbn/type-summarizer": ["packages/kbn-type-summarizer"],
"@kbn/type-summarizer/*": ["packages/kbn-type-summarizer/*"],
"@kbn/type-summarizer-cli": ["packages/kbn-type-summarizer-cli"],
"@kbn/type-summarizer-cli/*": ["packages/kbn-type-summarizer-cli/*"],
"@kbn/type-summarizer-core": ["packages/kbn-type-summarizer-core"],
"@kbn/type-summarizer-core/*": ["packages/kbn-type-summarizer-core/*"],
"@kbn/typed-react-router-config": ["packages/kbn-typed-react-router-config"],
"@kbn/typed-react-router-config/*": ["packages/kbn-typed-react-router-config/*"],
"@kbn/ui-framework": ["packages/kbn-ui-framework"],
"@kbn/ui-framework/*": ["packages/kbn-ui-framework/*"],
"@kbn/ui-shared-deps-npm": ["packages/kbn-ui-shared-deps-npm"],
"@kbn/ui-shared-deps-npm/*": ["packages/kbn-ui-shared-deps-npm/*"],
"@kbn/ui-shared-deps-src": ["packages/kbn-ui-shared-deps-src"],
"@kbn/ui-shared-deps-src/*": ["packages/kbn-ui-shared-deps-src/*"],
"@kbn/ui-theme": ["packages/kbn-ui-theme"],
"@kbn/ui-theme/*": ["packages/kbn-ui-theme/*"],
"@kbn/user-profile-components": ["packages/kbn-user-profile-components"],
"@kbn/user-profile-components/*": ["packages/kbn-user-profile-components/*"],
"@kbn/utility-types": ["packages/kbn-utility-types"],
"@kbn/utility-types/*": ["packages/kbn-utility-types/*"],
"@kbn/utility-types-jest": ["packages/kbn-utility-types-jest"],
"@kbn/utility-types-jest/*": ["packages/kbn-utility-types-jest/*"],
"@kbn/utils": ["packages/kbn-utils"],
"@kbn/utils/*": ["packages/kbn-utils/*"],
"@kbn/yarn-lock-validator": ["packages/kbn-yarn-lock-validator"],
"@kbn/yarn-lock-validator/*": ["packages/kbn-yarn-lock-validator/*"],
"@kbn/shared-ux-avatar-solution": ["packages/shared-ux/avatar/solution"],
"@kbn/shared-ux-avatar-solution/*": ["packages/shared-ux/avatar/solution/*"],
"@kbn/shared-ux-avatar-user-profile-components": ["packages/shared-ux/avatar/user_profile/impl"],
"@kbn/shared-ux-avatar-user-profile-components/*": ["packages/shared-ux/avatar/user_profile/impl/*"],
"@kbn/shared-ux-button-toolbar": ["packages/shared-ux/button_toolbar"],
"@kbn/shared-ux-button-toolbar/*": ["packages/shared-ux/button_toolbar/*"],
"@kbn/shared-ux-button-exit-full-screen": ["packages/shared-ux/button/exit_full_screen/impl"],
"@kbn/shared-ux-button-exit-full-screen/*": ["packages/shared-ux/button/exit_full_screen/impl/*"],
"@kbn/shared-ux-button-exit-full-screen-mocks": ["packages/shared-ux/button/exit_full_screen/mocks"],
"@kbn/shared-ux-button-exit-full-screen-mocks/*": ["packages/shared-ux/button/exit_full_screen/mocks/*"],
"@kbn/shared-ux-button-exit-full-screen-types": ["packages/shared-ux/button/exit_full_screen/types"],
"@kbn/shared-ux-button-exit-full-screen-types/*": ["packages/shared-ux/button/exit_full_screen/types/*"],
"@kbn/shared-ux-card-no-data": ["packages/shared-ux/card/no_data/impl"],
"@kbn/shared-ux-card-no-data/*": ["packages/shared-ux/card/no_data/impl/*"],
"@kbn/shared-ux-card-no-data-mocks": ["packages/shared-ux/card/no_data/mocks"],
"@kbn/shared-ux-card-no-data-mocks/*": ["packages/shared-ux/card/no_data/mocks/*"],
"@kbn/shared-ux-card-no-data-types": ["packages/shared-ux/card/no_data/types"],
"@kbn/shared-ux-card-no-data-types/*": ["packages/shared-ux/card/no_data/types/*"],
"@kbn/shared-ux-link-redirect-app": ["packages/shared-ux/link/redirect_app/impl"],
"@kbn/shared-ux-link-redirect-app/*": ["packages/shared-ux/link/redirect_app/impl/*"],
"@kbn/shared-ux-link-redirect-app-mocks": ["packages/shared-ux/link/redirect_app/mocks"],
"@kbn/shared-ux-link-redirect-app-mocks/*": ["packages/shared-ux/link/redirect_app/mocks/*"],
"@kbn/shared-ux-link-redirect-app-types": ["packages/shared-ux/link/redirect_app/types"],
"@kbn/shared-ux-link-redirect-app-types/*": ["packages/shared-ux/link/redirect_app/types/*"],
"@kbn/shared-ux-markdown": ["packages/shared-ux/markdown/impl"],
"@kbn/shared-ux-markdown/*": ["packages/shared-ux/markdown/impl/*"],
"@kbn/shared-ux-markdown-mocks": ["packages/shared-ux/markdown/mocks"],
"@kbn/shared-ux-markdown-mocks/*": ["packages/shared-ux/markdown/mocks/*"],
"@kbn/shared-ux-markdown-types": ["packages/shared-ux/markdown/types"],
"@kbn/shared-ux-markdown-types/*": ["packages/shared-ux/markdown/types/*"],
"@kbn/shared-ux-page-analytics-no-data": ["packages/shared-ux/page/analytics_no_data/impl"],
"@kbn/shared-ux-page-analytics-no-data/*": ["packages/shared-ux/page/analytics_no_data/impl/*"],
"@kbn/shared-ux-page-analytics-no-data-mocks": ["packages/shared-ux/page/analytics_no_data/mocks"],
"@kbn/shared-ux-page-analytics-no-data-mocks/*": ["packages/shared-ux/page/analytics_no_data/mocks/*"],
"@kbn/shared-ux-page-analytics-no-data-types": ["packages/shared-ux/page/analytics_no_data/types"],
"@kbn/shared-ux-page-analytics-no-data-types/*": ["packages/shared-ux/page/analytics_no_data/types/*"],
"@kbn/shared-ux-page-kibana-no-data": ["packages/shared-ux/page/kibana_no_data/impl"],
"@kbn/shared-ux-page-kibana-no-data/*": ["packages/shared-ux/page/kibana_no_data/impl/*"],
"@kbn/shared-ux-page-kibana-no-data-mocks": ["packages/shared-ux/page/kibana_no_data/mocks"],
"@kbn/shared-ux-page-kibana-no-data-mocks/*": ["packages/shared-ux/page/kibana_no_data/mocks/*"],
"@kbn/shared-ux-page-kibana-no-data-types": ["packages/shared-ux/page/kibana_no_data/types"],
"@kbn/shared-ux-page-kibana-no-data-types/*": ["packages/shared-ux/page/kibana_no_data/types/*"],
"@kbn/shared-ux-page-kibana-template": ["packages/shared-ux/page/kibana_template/impl"],
"@kbn/shared-ux-page-kibana-template/*": ["packages/shared-ux/page/kibana_template/impl/*"],
"@kbn/shared-ux-page-kibana-template-mocks": ["packages/shared-ux/page/kibana_template/mocks"],
"@kbn/shared-ux-page-kibana-template-mocks/*": ["packages/shared-ux/page/kibana_template/mocks/*"],
"@kbn/shared-ux-page-kibana-template-types": ["packages/shared-ux/page/kibana_template/types"],
"@kbn/shared-ux-page-kibana-template-types/*": ["packages/shared-ux/page/kibana_template/types/*"],
"@kbn/shared-ux-page-no-data-config": ["packages/shared-ux/page/no_data_config/impl"],
"@kbn/shared-ux-page-no-data-config/*": ["packages/shared-ux/page/no_data_config/impl/*"],
"@kbn/shared-ux-page-no-data-config-mocks": ["packages/shared-ux/page/no_data_config/mocks"],
"@kbn/shared-ux-page-no-data-config-mocks/*": ["packages/shared-ux/page/no_data_config/mocks/*"],
"@kbn/shared-ux-page-no-data-config-types": ["packages/shared-ux/page/no_data_config/types"],
"@kbn/shared-ux-page-no-data-config-types/*": ["packages/shared-ux/page/no_data_config/types/*"],
"@kbn/shared-ux-page-no-data": ["packages/shared-ux/page/no_data/impl"],
"@kbn/shared-ux-page-no-data/*": ["packages/shared-ux/page/no_data/impl/*"],
"@kbn/shared-ux-page-no-data-mocks": ["packages/shared-ux/page/no_data/mocks"],
"@kbn/shared-ux-page-no-data-mocks/*": ["packages/shared-ux/page/no_data/mocks/*"],
"@kbn/shared-ux-page-no-data-types": ["packages/shared-ux/page/no_data/types"],
"@kbn/shared-ux-page-no-data-types/*": ["packages/shared-ux/page/no_data/types/*"],
"@kbn/shared-ux-page-solution-nav": ["packages/shared-ux/page/solution_nav"],
"@kbn/shared-ux-page-solution-nav/*": ["packages/shared-ux/page/solution_nav/*"],
"@kbn/shared-ux-prompt-no-data-views": ["packages/shared-ux/prompt/no_data_views/impl"],
"@kbn/shared-ux-prompt-no-data-views/*": ["packages/shared-ux/prompt/no_data_views/impl/*"],
"@kbn/shared-ux-prompt-no-data-views-mocks": ["packages/shared-ux/prompt/no_data_views/mocks"],
"@kbn/shared-ux-prompt-no-data-views-mocks/*": ["packages/shared-ux/prompt/no_data_views/mocks/*"],
"@kbn/shared-ux-prompt-no-data-views-types": ["packages/shared-ux/prompt/no_data_views/types"],
"@kbn/shared-ux-prompt-no-data-views-types/*": ["packages/shared-ux/prompt/no_data_views/types/*"],
"@kbn/shared-ux-router": ["packages/shared-ux/router/impl"],
"@kbn/shared-ux-router/*": ["packages/shared-ux/router/impl/*"],
"@kbn/shared-ux-router-mocks": ["packages/shared-ux/router/mocks"],
"@kbn/shared-ux-router-mocks/*": ["packages/shared-ux/router/mocks/*"],
"@kbn/shared-ux-router-types": ["packages/shared-ux/router/types"],
"@kbn/shared-ux-router-types/*": ["packages/shared-ux/router/types/*"],
"@kbn/shared-ux-storybook-config": ["packages/shared-ux/storybook/config"],
"@kbn/shared-ux-storybook-config/*": ["packages/shared-ux/storybook/config/*"],
"@kbn/shared-ux-storybook-mock": ["packages/shared-ux/storybook/mock"],
"@kbn/shared-ux-storybook-mock/*": ["packages/shared-ux/storybook/mock/*"],
"@kbn/ml-agg-utils": ["x-pack/packages/ml/agg_utils"],
"@kbn/ml-agg-utils/*": ["x-pack/packages/ml/agg_utils/*"],
"@kbn/aiops-components": ["x-pack/packages/ml/aiops_components"],
"@kbn/aiops-components/*": ["x-pack/packages/ml/aiops_components/*"],
"@kbn/aiops-utils": ["x-pack/packages/ml/aiops_utils"],
"@kbn/aiops-utils/*": ["x-pack/packages/ml/aiops_utils/*"],
"@kbn/ml-is-populated-object": ["x-pack/packages/ml/is_populated_object"],
"@kbn/ml-is-populated-object/*": ["x-pack/packages/ml/is_populated_object/*"],
"@kbn/ml-string-hash": ["x-pack/packages/ml/string_hash"],
"@kbn/ml-string-hash/*": ["x-pack/packages/ml/string_hash/*"],
"@kbn/bfetch-explorer-plugin": ["examples/bfetch_explorer"],
"@kbn/bfetch-explorer-plugin/*": ["examples/bfetch_explorer/*"],
"@kbn/dashboard-embeddable-examples-plugin": ["examples/dashboard_embeddable_examples"],
@ -277,6 +974,10 @@
"@kbn/ui-settings-plugin/*": ["test/plugin_functional/plugins/ui_settings_plugin/*"],
"@kbn/usage-collection-test-plugin": ["test/plugin_functional/plugins/usage_collection"],
"@kbn/usage-collection-test-plugin/*": ["test/plugin_functional/plugins/usage_collection/*"],
"@kbn/status-plugin-a-plugin": ["test/server_integration/__fixtures__/plugins/status_plugin_a"],
"@kbn/status-plugin-a-plugin/*": ["test/server_integration/__fixtures__/plugins/status_plugin_a/*"],
"@kbn/status-plugin-b-plugin": ["test/server_integration/__fixtures__/plugins/status_plugin_b"],
"@kbn/status-plugin-b-plugin/*": ["test/server_integration/__fixtures__/plugins/status_plugin_b/*"],
"@kbn/alerting-example-plugin": ["x-pack/examples/alerting_example"],
"@kbn/alerting-example-plugin/*": ["x-pack/examples/alerting_example/*"],
"@kbn/embedded-lens-example-plugin": ["x-pack/examples/embedded_lens_example"],
@ -492,10 +1193,10 @@
"strict": true,
// for now, don't use unknown in catch
"useUnknownInCatchVariables": false,
// All TS projects should be composite and only include the files they select, and ref the files outside of the project
"composite": true,
// save information about the project graph on disk
"incremental": true,
// disabled for better IDE support, enabled when running the type_check script
"composite": false,
// disabled for better IDE support, enabled when running the type_check script
"incremental": false,
// Do not check d.ts files by default
"skipLibCheck": true,
// enables "core language features"

View file

@ -1,15 +1,19 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"outDir": "target/root_types"
},
"include": [
"kibana.d.ts",
"typings/**/*",
"package.json",
"src/cli/**/*",
"src/cli_setup/**/*",
"src/cli_plugin/**/*",
"src/cli_keystore/**/*",
"src/setup_node_env/**/*",
"src/dev/**/*",
"src/fixtures/**/*",

View file

@ -1,18 +0,0 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"composite": false,
"outDir": "./target/types",
"stripInternal": false,
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"declarationMap": true,
"rootDir": "./src"
},
"include": [
"src/core/server/index.ts",
"src/core/public/index.ts",
"typings"
]
}

View file

@ -6,12 +6,12 @@
*/
export {
FilesClient,
FilesSetup,
FilesStart,
type FilesClient,
type FilesSetup,
type FilesStart,
UploadFile,
FilesContext,
ScopedFilesClient,
type ScopedFilesClient,
FilePicker,
Image,
} from '@kbn/files-plugin/public';

View file

@ -11,7 +11,11 @@ export { fetchHistogramsForFields } from './src/fetch_histograms_for_fields';
export { getSamplerAggregationsResponsePath } from './src/get_sampler_aggregations_response_path';
export { numberValidator } from './src/validate_number';
export type { FieldsForHistograms } from './src/fetch_histograms_for_fields';
export type {
FieldsForHistograms,
NumericChartData,
NumericHistogramField,
} from './src/fetch_histograms_for_fields';
export type {
AggCardinality,
ChangePoint,
@ -22,5 +26,6 @@ export type {
HistogramField,
NumericColumnStats,
NumericColumnStatsMap,
FieldValuePair,
} from './src/types';
export type { NumberValidationResult } from './src/validate_number';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { KueryNode } from '@kbn/core-saved-objects-api-server';
import { KueryNode } from '@kbn/es-query';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import Boom from '@hapi/boom';
import { flatMap, get, isEmpty } from 'lodash';
@ -443,7 +443,7 @@ export function getExecutionLogAggregation({
function buildDslFilterQuery(filter: IExecutionLogAggOptions['filter']) {
try {
const filterKueryNode = typeof filter === 'string' ? fromKueryExpression(filter) : filter;
return filter ? toElasticsearchQuery(filterKueryNode) : undefined;
return filterKueryNode ? toElasticsearchQuery(filterKueryNode) : undefined;
} catch (err) {
throw Boom.badRequest(`Invalid kuery syntax for filter ${filter}`);
}

View file

@ -8,6 +8,8 @@
"target/**/*"
],
"compilerOptions": {
"target": "es2015",
"allowJs": true,
"outDir": "target/types",
"types": [
"cypress",

View file

@ -31,10 +31,7 @@ const environmentsRoute = createApmServerRoute({
environments: Array<
| 'ENVIRONMENT_NOT_DEFINED'
| 'ENVIRONMENT_ALL'
| t.Branded<
string,
import('./../../../../../../node_modules/@types/kbn__io-ts-utils/index').NonEmptyStringBrand
>
| t.Branded<string, import('@kbn/io-ts-utils').NonEmptyStringBrand>
>;
}> => {
const [setup, apmEventClient] = await Promise.all([

View file

@ -12,7 +12,7 @@ import { IClusterClient, KibanaRequest } from '@kbn/core/server';
import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { SpacesServiceStart } from '@kbn/spaces-plugin/server';
import { KueryNode } from '@kbn/core-saved-objects-api-server';
import { KueryNode } from '@kbn/es-query';
import { EsContext } from './es';
import { IEventLogClient } from './types';
import { QueryEventsBySavedObjectResult } from './es/cluster_client_adapter';

View file

@ -8,6 +8,7 @@
"target/**/*"
],
"compilerOptions": {
"allowJs": true,
"outDir": "target/types",
"types": [
"cypress",

View file

@ -1,6 +1,7 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
@ -21,13 +22,14 @@
],
"references": [
{ "path": "../../../src/core/tsconfig.json" },
{ "path": "../../../tsconfig.json" },
// add references to other TypeScript projects the plugin depends on
// requiredPlugins from ./kibana.json
{ "path": "../licensing/tsconfig.json" },
{ "path": "../../../src/plugins/data/tsconfig.json" },
{ "path": "../encrypted_saved_objects/tsconfig.json" },
{"path": "../../../src/plugins/guided_onboarding/tsconfig.json"},
{ "path": "../../../src/plugins/guided_onboarding/tsconfig.json" },
// optionalPlugins from ./kibana.json
{ "path": "../security/tsconfig.json" },

View file

@ -5,6 +5,9 @@
* 2.0.
*/
import Path from 'path';
import { REPO_ROOT } from '@kbn/utils';
// eslint-disable-next-line import/no-extraneous-dependencies
import * as ts from 'typescript';
@ -17,13 +20,19 @@ export interface DocEntry {
}
/** Generate documentation for all schema definitions in a set of .ts files */
export function extractDocumentation(
fileNames: string[],
options: ts.CompilerOptions = {
export function extractDocumentation(fileNames: string[]): Map<string, DocEntry[]> {
const json = ts.readConfigFile(Path.resolve(REPO_ROOT, 'tsconfig.base.json'), ts.sys.readFile);
if (json.error) {
throw new Error(`Unable to parse tsconfig.base.json file: ${json.error.messageText}`);
}
const options = {
target: ts.ScriptTarget.ES2015,
module: ts.ModuleKind.CommonJS,
}
): Map<string, DocEntry[]> {
paths: json.config.compilerOptions.paths,
};
// Build a program using the set of root file names in fileNames
const program = ts.createProgram(fileNames, options);

View file

@ -8,6 +8,7 @@
"target/**/*"
],
"compilerOptions": {
"allowJs": true,
"outDir": "target/types",
"types": [
"cypress",

View file

@ -6,7 +6,7 @@
*/
import type { HttpSetup } from '@kbn/core-http-browser';
import type { NotificationsStart } from '@kbn/securitysolution-io-ts-list-types';
import type { NotificationsStart } from '@kbn/core-notifications-browser';
import { createIndices, deleteIndices } from './indices';
const mockRequest = jest.fn();
@ -22,7 +22,7 @@ const mockNotification = {
addDanger: mockAddDanger,
addError: mockAddError,
},
} as NotificationsStart;
} as unknown as NotificationsStart;
const mockRenderDocLink = jest.fn();

View file

@ -6,7 +6,7 @@
*/
import type { HttpSetup } from '@kbn/core-http-browser';
import type { NotificationsStart } from '@kbn/securitysolution-io-ts-list-types';
import type { NotificationsStart } from '@kbn/core-notifications-browser';
import { createIngestPipeline, deleteIngestPipelines } from './ingest_pipelines';
const mockRequest = jest.fn();
@ -23,7 +23,7 @@ const mockNotification = {
addDanger: mockAddDanger,
addError: mockAddError,
},
} as NotificationsStart;
} as unknown as NotificationsStart;
const mockRenderDocLink = jest.fn();

View file

@ -6,7 +6,7 @@
*/
import type { HttpSetup } from '@kbn/core-http-browser';
import type { NotificationsStart } from '@kbn/securitysolution-io-ts-list-types';
import type { NotificationsStart } from '@kbn/core-notifications-browser';
import { createStoredScript, deleteStoredScript } from './stored_scripts';
const mockRequest = jest.fn();
@ -23,7 +23,7 @@ const mockNotification = {
addDanger: mockAddDanger,
addError: mockAddError,
},
} as NotificationsStart;
} as unknown as NotificationsStart;
const mockRenderDocLink = jest.fn();

View file

@ -6,7 +6,7 @@
*/
import type { HttpSetup } from '@kbn/core-http-browser';
import type { NotificationsStart } from '@kbn/securitysolution-io-ts-list-types';
import type { NotificationsStart } from '@kbn/core-notifications-browser';
import { createTransform, deleteTransforms, getTransformState, stopTransforms } from './transforms';
const mockRequest = jest.fn();
@ -24,7 +24,7 @@ const mockNotification = {
addDanger: mockAddDanger,
addError: mockAddError,
},
} as NotificationsStart;
} as unknown as NotificationsStart;
const mockRenderDocLink = jest.fn();

View file

@ -22,7 +22,7 @@ import { ColumnHeaderOptions } from '../columns';
import { TimelineItem, TimelineNonEcsData } from '../../../search_strategy';
import { Ecs } from '../../../ecs';
export {
export type {
FieldBrowserOptions,
CreateFieldComponent,
GetFieldTableColumns,

View file

@ -0,0 +1,16 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target/types"
},
"include": [
"**/*.ts",
"**/*.tsx",
],
"exclude": [
"./target"
],
"references": [
{ "path": "../../../../../src/core/tsconfig.json" }
]
}

View file

@ -0,0 +1,16 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target/types"
},
"include": [
"**/*.ts",
"**/*.tsx",
],
"exclude": [
"./target"
],
"references": [
{ "path": "../../../../../src/core/tsconfig.json" }
]
}

View file

@ -0,0 +1,17 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target/types"
},
"include": [
"**/*.ts",
"**/*.tsx",
],
"exclude": [
"./target"
],
"references": [
{ "path": "../../../../../src/core/tsconfig.json" },
{ "path": "../../../../plugins/licensing/tsconfig.json" }
]
}

View file

@ -0,0 +1,16 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target/types"
},
"include": [
"**/*.ts",
"**/*.tsx",
],
"exclude": [
"./target"
],
"references": [
{ "path": "../../../../../src/core/tsconfig.json" }
]
}

View file

@ -0,0 +1,17 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target/types"
},
"include": [
"**/*.ts",
"**/*.tsx",
],
"exclude": [
"./target"
],
"references": [
{ "path": "../../../../../src/core/tsconfig.json" },
{ "path": "../../../../plugins/event_log/tsconfig.json" }
]
}

View file

@ -0,0 +1,17 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target/types"
},
"include": [
"**/*.ts",
"**/*.tsx",
],
"exclude": [
"./target"
],
"references": [
{ "path": "../../../../../src/core/tsconfig.json" },
{ "path": "../../../../plugins/licensing/tsconfig.json" },
]
}

View file

@ -0,0 +1,17 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target/types"
},
"include": [
"**/*.ts",
"**/*.tsx",
],
"exclude": [
"./target"
],
"references": [
{ "path": "../../../../../src/core/tsconfig.json" },
{ "path": "../../../../plugins/task_manager/tsconfig.json" },
]
}

View file

@ -0,0 +1,17 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target/types"
},
"include": [
"**/*.ts",
"**/*.tsx",
],
"exclude": [
"./target"
],
"references": [
{ "path": "../../../../../src/core/tsconfig.json" },
{ "path": "../../../../plugins/task_manager/tsconfig.json" },
]
}

View file

@ -0,0 +1,17 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target/types"
},
"include": [
"**/*.ts",
"**/*.tsx",
],
"exclude": [
"./target"
],
"references": [
{ "path": "../../../../../src/core/tsconfig.json" },
{ "path": "../../../../plugins/global_search/tsconfig.json" },
]
}

View file

@ -0,0 +1,18 @@
{
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target/types"
},
"include": [
"**/*.ts",
"**/*.tsx",
],
"exclude": [
"./target"
],
"references": [
{ "path": "../../../../../src/core/tsconfig.json" },
{ "path": "../../../../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../../../plugins/security_solution/tsconfig.json" },
]
}

View file

@ -15,7 +15,10 @@
"../../typings/**/*",
"../../packages/kbn-test/types/ftr_globals/**/*",
],
"exclude": ["target/**/*"],
"exclude": [
"target/**/*",
"*/plugins/**/*",
],
"references": [
{ "path": "../../test/tsconfig.json" },
{ "path": "../../src/core/tsconfig.json" },
@ -101,6 +104,7 @@
{ "path": "../plugins/remote_clusters/tsconfig.json" },
{ "path": "../plugins/cross_cluster_replication/tsconfig.json" },
{ "path": "../plugins/index_lifecycle_management/tsconfig.json"},
{ "path": "../plugins/synthetics/tsconfig.json"}
{ "path": "../plugins/synthetics/tsconfig.json" },
{ "path": "./plugin_functional/plugins/global_search_test/tsconfig.json" }
]
}

View file

@ -7,7 +7,9 @@
"public/**/*.ts",
"public/**/*.tsx",
],
"exclude": [],
"exclude": [
"./target"
],
"references": [
{ "path": "../../../../../src/core/tsconfig.json" },
]

View file

@ -7,5 +7,10 @@
"public/**/*.ts",
"public/**/*.tsx",
],
"exclude": []
"exclude": [
"./target"
],
"references": [
{ "path": "../../../../../src/core/tsconfig.json" }
]
}

View file

@ -17,7 +17,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('keys in the schema match the registered application IDs', async () => {
await common.navigateToApp('home'); // Navigate to Home
await common.isChromeVisible(); // Make sure the page is fully loaded
const appIds = await browser.execute(() => window.__applicationIds__);
const appIds: unknown = await browser.execute(() => {
// @ts-expect-error this code runs in the browser
return window.__applicationIds__;
});
if (!appIds || !Array.isArray(appIds)) {
throw new Error(
'Failed to retrieve all the existing applications in Kibana. Did it fail to boot or to navigate to home?'

View file

@ -19,7 +19,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
before(async () => {
await common.navigateToApp('home'); // Navigate to Home to make sure all the appIds are loaded
await common.isChromeVisible(); // Make sure the page is fully loaded
registeredSettings = await browser.execute(() => window.__registeredUiSettings__);
registeredSettings = await browser.execute(() => {
// @ts-expect-error this code runs in the browser
return window.__registeredUiSettings__;
});
});
it('registers all UI Settings in the UsageStats interface', () => {

1360
yarn.lock

File diff suppressed because it is too large Load diff