chore(NA): enable preserve symlinks for ts without breaking packages development (#95433)

* chore(NA): move elastic-datemath into a ts package

* chore(NA): finish elastic-datemath

* chore(NA): finish elastic-datemath

* chore(NA): source folder for elastic-datemath

* chore(NA): add source-maps ace, analytics, apm-config-loader and apm-utils packages

* chore(NA): add sourcemaps to packages on typescript

* chore(NA): move test fixtures within source

* chore(NA): correct exclusions on packages

* chore(NA): correct package.json on all packages

* chore(NA): correct package.json on all packages

* chore(NA): complete kbn pm

* chore(NA): default export on elastic-datemath

* chore(NA): include logs on kbn-logging

* chore(NA): update bundle ref module to last code used in the webpack upstream

* chore(NA): update bundle ref module to last code used in the webpack upstream - refactored

* chore(NA): remove override method for exportsArgument

* fix(NA): typechecking problems by use @internal at javascript import sources on kbn-test package

* fix(NA): typescript projects check

* fix(NA): run optimizer integration tests from source

* chore(NA): fix usage from target for kbn optimizer

* chore(NA): path on tsconfig

* chore(NA): move tsignore into ts-expect-error

* chore(NA): include souce maps on kbn cli dev

* chore(NA): include souce maps on kbn-crypto, kbn-server-http-tools and kbn-telemetry-tools

* chore(NA): add issue links into the ts-expect-error comments
This commit is contained in:
Tiago Costa 2021-03-31 00:02:22 +01:00 committed by GitHub
parent c35ef75dbb
commit 50313f75f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
93 changed files with 389 additions and 218 deletions

View file

@ -1,51 +0,0 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import moment from 'moment';
export type Unit = 'ms' | 's' | 'm' | 'h' | 'd' | 'w' | 'M' | 'y';
declare const datemath: {
unitsMap: {
[k in Unit]: {
weight: number;
type: 'calendar' | 'fixed' | 'mixed';
base: number;
};
};
units: Unit[];
unitsAsc: Unit[];
unitsDesc: Unit[];
/**
* Parses a string into a moment object. The string can be something like "now - 15m".
* @param options.forceNow If this optional parameter is supplied, "now" will be treated as this
* date, rather than the real "now".
*/
parse(
input: string,
options?: {
roundUp?: boolean;
forceNow?: Date;
momentInstance?: typeof moment;
}
): moment.Moment | undefined;
};
// eslint-disable-next-line import/no-default-export
export default datemath;

View file

@ -3,6 +3,10 @@
"version": "5.0.3",
"description": "elasticsearch datemath parser, used in kibana",
"license": "Apache-2.0",
"main": "index.js",
"typings": "index.d.ts"
"main": "./target/index.js",
"types": "./target/index.d.ts",
"scripts": {
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build"
}
}

View file

@ -17,9 +17,18 @@
* under the License.
*/
const moment = require('moment');
import moment from 'moment';
const unitsMap = {
export type Unit = 'ms' | 's' | 'm' | 'h' | 'd' | 'w' | 'M' | 'y';
export type UnitsMap = {
[k in Unit]: {
weight: number;
type: 'calendar' | 'fixed' | 'mixed';
base: number;
};
};
export const unitsMap: UnitsMap = {
ms: { weight: 1, type: 'fixed', base: 1 },
s: { weight: 2, type: 'fixed', base: 1000 },
m: { weight: 3, type: 'mixed', base: 1000 * 60 },
@ -30,13 +39,14 @@ const unitsMap = {
// q: { weight: 8, type: 'calendar' }, // TODO: moment duration does not support quarter
y: { weight: 9, type: 'calendar', base: NaN },
};
const units = Object.keys(unitsMap).sort((a, b) => unitsMap[b].weight - unitsMap[a].weight);
const unitsDesc = [...units];
const unitsAsc = [...units].reverse();
export const units: Unit[] = Object.keys(unitsMap).sort(
(a, b) => unitsMap[b as Unit].weight - unitsMap[a as Unit].weight
) as Unit[];
export const unitsDesc: Unit[] = [...units] as Unit[];
export const unitsAsc: Unit[] = [...units].reverse() as Unit[];
const isDate = (d) => Object.prototype.toString.call(d) === '[object Date]';
const isValidDate = (d) => isDate(d) && !isNaN(d.valueOf());
const isDate = (d: string) => Object.prototype.toString.call(d) === '[object Date]';
const isValidDate = (d: string) => isDate(d) && !isNaN(d.valueOf() as any);
/*
* This is a simplified version of elasticsearch's date parser.
@ -44,11 +54,17 @@ const isValidDate = (d) => isDate(d) && !isNaN(d.valueOf());
* will be done using this (and its locale settings) instead of the one bundled
* with this library.
*/
function parse(text, { roundUp = false, momentInstance = moment, forceNow } = {}) {
export function parse(
input: string,
options: { roundUp?: boolean; momentInstance?: typeof moment; forceNow?: Date } = {}
) {
const text = input;
const { roundUp = false, momentInstance = moment, forceNow } = options;
if (!text) return undefined;
if (momentInstance.isMoment(text)) return text;
if (isDate(text)) return momentInstance(text);
if (forceNow !== undefined && !isValidDate(forceNow)) {
if (forceNow !== undefined && !isValidDate(forceNow as any)) {
throw new Error('forceNow must be a valid Date');
}
@ -80,7 +96,7 @@ function parse(text, { roundUp = false, momentInstance = moment, forceNow } = {}
return parseDateMath(mathString, time, roundUp);
}
function parseDateMath(mathString, time, roundUp) {
function parseDateMath(mathString: string, time: moment.Moment, roundUp: boolean) {
const dateTime = time;
const len = mathString.length;
let i = 0;
@ -89,7 +105,7 @@ function parseDateMath(mathString, time, roundUp) {
const c = mathString.charAt(i++);
let type;
let num;
let unit;
let unit: Unit;
if (c === '/') {
type = 0;
@ -101,13 +117,13 @@ function parseDateMath(mathString, time, roundUp) {
return;
}
if (isNaN(mathString.charAt(i))) {
if (isNaN(mathString.charAt(i) as any)) {
num = 1;
} else if (mathString.length === 2) {
num = mathString.charAt(i);
} else {
const numFrom = i;
while (!isNaN(mathString.charAt(i))) {
while (!isNaN(mathString.charAt(i) as any)) {
i++;
if (i >= len) return;
}
@ -121,7 +137,7 @@ function parseDateMath(mathString, time, roundUp) {
}
}
unit = mathString.charAt(i++);
unit = mathString.charAt(i++) as Unit;
// append additional characters in the unit
for (let j = i; j < len; j++) {
@ -138,12 +154,12 @@ function parseDateMath(mathString, time, roundUp) {
return;
} else {
if (type === 0) {
if (roundUp) dateTime.endOf(unit);
else dateTime.startOf(unit);
if (roundUp) dateTime.endOf(unit as any);
else dateTime.startOf(unit as any);
} else if (type === 1) {
dateTime.add(num, unit);
dateTime.add(num as any, unit);
} else if (type === 2) {
dateTime.subtract(num, unit);
dateTime.subtract(num as any, unit);
}
}
}
@ -151,8 +167,9 @@ function parseDateMath(mathString, time, roundUp) {
return dateTime;
}
module.exports = {
parse: parse,
// eslint-disable-next-line import/no-default-export
export default {
parse,
unitsMap: Object.freeze(unitsMap),
units: Object.freeze(units),
unitsAsc: Object.freeze(unitsAsc),

View file

@ -1,9 +1,17 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"tsBuildInfoFile": "../../build/tsbuildinfo/packages/elastic-datemath"
"incremental": false,
"outDir": "./target",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../packages/elastic-datemath/src",
"types": [
"node"
]
},
"include": [
"index.d.ts"
"src/index.ts"
]
}

View file

@ -3,6 +3,7 @@
"version": "1.0.0",
"private": true,
"main": "./target/index.js",
"types": "./target/index.d.ts",
"license": "SSPL-1.0 OR Elastic License 2.0",
"scripts": {
"build": "node ./scripts/build.js",

View file

@ -1,13 +1,15 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"outDir": "./target",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-ace/src",
"types": [
"jest",
"node"
]
],
},
"include": [
"src/**/*"

View file

@ -1,20 +1,19 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"incremental": false,
"outDir": "./target/types",
"stripInternal": true,
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../../packages/kbn-analytics/src",
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*"
],
"exclude": [
"target"
]
}

View file

@ -9,7 +9,7 @@
import { relative, resolve } from 'path';
import { getConfigFromFiles } from './read_config';
const fixtureFile = (name: string) => resolve(__dirname, '..', '..', '__fixtures__', name);
const fixtureFile = (name: string) => resolve(__dirname, '..', '__fixtures__', name);
test('reads single yaml from file system and parses to json', () => {
const config = getConfigFromFiles([fixtureFile('config.yml')]);

View file

@ -1,12 +1,19 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"incremental": false,
"outDir": "./target",
"stripInternal": false,
"declaration": true,
"declarationMap": true,
"types": ["jest", "node"]
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-apm-config-loader/src",
"types": [
"jest",
"node"
]
},
"include": ["./src/**/*.ts"],
"exclude": ["target"]
"include": [
"src/**/*.ts"
]
}

View file

@ -1,18 +1,18 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"incremental": false,
"outDir": "./target",
"stripInternal": false,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-apm-utils/src",
"types": [
"node"
]
},
"include": [
"./src/**/*.ts"
],
"exclude": [
"target"
]
}

View file

@ -1,11 +1,18 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"incremental": false,
"outDir": "./target",
"declaration": true,
"declarationMap": true,
"types": ["jest", "node"]
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-cli-dev-mode/src",
"types": [
"jest",
"node"
]
},
"include": ["./src/**/*.ts"],
"exclude": ["target"]
"include": [
"./src/**/*.ts"
],
}

View file

@ -1,21 +1,21 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"declarationDir": "./target/types",
"incremental": false,
"outDir": "./target/out",
"declarationDir": "./target/types",
"stripInternal": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../../packages/kbn-config-schema/src",
"types": [
"jest",
"node"
]
},
"include": [
"./types/joi.d.ts",
"./src/**/*.ts"
],
"exclude": [
"target"
"types/joi.d.ts",
"src/**/*.ts"
]
}

View file

@ -9,7 +9,7 @@
import { relative, resolve } from 'path';
import { getConfigFromFiles } from './read_config';
const fixtureFile = (name: string) => resolve(`${__dirname}/../../__fixtures__/${name}`);
const fixtureFile = (name: string) => resolve(`${__dirname}/../__fixtures__/${name}`);
test('reads single yaml from file system and parses to json', () => {
const config = getConfigFromFiles([fixtureFile('config.yml')]);

View file

@ -1,12 +1,22 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"incremental": false,
"outDir": "./target",
"stripInternal": false,
"declaration": true,
"declarationMap": true,
"types": ["jest", "node"]
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-config/src",
"types": [
"jest",
"node"
]
},
"include": ["./src/**/*.ts"],
"exclude": ["target"]
"include": [
"src/**/*.ts"
],
"exclude": [
"**/__fixtures__/**/*"
]
}

View file

@ -4,6 +4,7 @@
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"scripts": {
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build",

View file

@ -1,9 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target",
"incremental": false,
"outDir": "./target",
"declaration": true,
"declarationMap": true
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-crypto/src"
},
"include": [
"src/**/*"

View file

@ -4,6 +4,7 @@
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"scripts": {
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build",

View file

@ -1,10 +1,18 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"outDir": "target",
"stripInternal": false,
"target": "ES2019",
"declaration": true,
"declarationMap": true
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-dev-utils/src",
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*"

View file

@ -4,6 +4,7 @@
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": "true",
"main": "target/index.js",
"types": "target/index.d.ts",
"kibana": {
"devOnly": true
},

View file

@ -1,10 +1,17 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"outDir": "./target",
"target": "ES2019",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"target": "ES2019"
"sourceRoot": "../../../../packages/kbn-docs-utils/src",
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*"

View file

@ -4,6 +4,7 @@
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": "true",
"main": "target/index.js",
"types": "target/index.d.ts",
"kibana": {
"devOnly": true
},

View file

@ -1,10 +1,17 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"outDir": "./target",
"target": "ES2019",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"target": "ES2019"
"sourceRoot": "../../../../packages/kbn-es-archiver/src",
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*"

View file

@ -1,5 +1,18 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../../packages/kbn-i18n/src",
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
@ -7,15 +20,6 @@
"types/intl_relativeformat.d.ts"
],
"exclude": [
"target"
],
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./target/types",
"types": [
"jest",
"node"
]
}
"**/__fixtures__/**/*"
]
}

View file

@ -1,5 +1,6 @@
{
"private": true,
"main": "../target/common/index.js",
"types": "../target/common/index.d.ts",
"jsnext:main": "../src/common/index.js"
}

View file

@ -4,6 +4,7 @@
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"scripts": {
"build": "tsc",
"kbn:bootstrap": "yarn build",

View file

@ -1,11 +1,19 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"outDir": "target",
"stripInternal": false,
"declaration": true,
"declarationMap": true,
"types": ["jest", "node"]
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-legacy-logging/src",
"types": [
"jest",
"node"
]
},
"include": ["./src/**/*"]
"include": [
"src/**/*"
]
}

View file

@ -4,6 +4,7 @@
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"scripts": {
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build",

View file

@ -1,11 +1,19 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"outDir": "target",
"stripInternal": false,
"declaration": true,
"declarationMap": true,
"types": ["jest", "node"]
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-logging/src",
"types": [
"jest",
"node"
]
},
"include": ["./src/**/*.ts"]
"include": [
"src/**/*.ts"
]
}

View file

@ -3,6 +3,7 @@
"version": "1.0.0",
"private": true,
"main": "./target/index.js",
"types": "./target/index.d.ts",
"license": "SSPL-1.0 OR Elastic License 2.0",
"scripts": {
"build": "node ./scripts/build.js",

View file

@ -1,9 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"outDir": "./target",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-monaco/src",
"types": [
"jest",
"node"

View file

@ -4,8 +4,9 @@
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"scripts": {
"build": "../../node_modules/.bin/babel src --out-dir target --copy-files --delete-dir-on-start --extensions .ts --ignore *.test.ts --source-maps=inline",
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build",
"kbn:watch": "yarn build --watch"
},

View file

@ -16,7 +16,7 @@ import del from 'del';
import { tap, filter } from 'rxjs/operators';
import { REPO_ROOT } from '@kbn/utils';
import { ToolingLog } from '@kbn/dev-utils';
import { runOptimizer, OptimizerConfig, OptimizerUpdate, logOptimizerState } from '@kbn/optimizer';
import { runOptimizer, OptimizerConfig, OptimizerUpdate, logOptimizerState } from '../index';
import { allValuesFrom } from '../common';
@ -135,7 +135,7 @@ it('builds expected bundles, saves bundle counts to metadata', async () => {
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/ext.ts,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/index.ts,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/lib.ts,
<absolute path>/packages/kbn-optimizer/target/worker/entry_point_creator.js,
<absolute path>/packages/kbn-optimizer/src/worker/entry_point_creator.ts,
<absolute path>/packages/kbn-ui-shared-deps/public_path_module_creator.js,
]
`);
@ -161,7 +161,7 @@ it('builds expected bundles, saves bundle counts to metadata', async () => {
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/lib.ts,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v8dark.scss,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v8light.scss,
<absolute path>/packages/kbn-optimizer/target/worker/entry_point_creator.js,
<absolute path>/packages/kbn-optimizer/src/worker/entry_point_creator.ts,
<absolute path>/packages/kbn-ui-shared-deps/public_path_module_creator.js,
]
`);
@ -175,7 +175,7 @@ it('builds expected bundles, saves bundle counts to metadata', async () => {
Array [
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/x-pack/baz/kibana.json,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/x-pack/baz/public/index.ts,
<absolute path>/packages/kbn-optimizer/target/worker/entry_point_creator.js,
<absolute path>/packages/kbn-optimizer/src/worker/entry_point_creator.ts,
<absolute path>/packages/kbn-ui-shared-deps/public_path_module_creator.js,
]
`);

View file

@ -61,18 +61,26 @@ function usingWorkerProc<T>(
) {
return Rx.using(
(): ProcResource => {
const proc = execa.node(require.resolve('../worker/run_worker'), [], {
nodeOptions: [
...process.execArgv,
...(inspectFlag && config.inspectWorkers
? [`${inspectFlag}=${inspectPortCounter++}`]
: []),
...(config.maxWorkerCount <= 3 ? ['--max-old-space-size=2048'] : []),
],
buffer: false,
stderr: 'pipe',
stdout: 'pipe',
});
const workerPath = require.resolve('../worker/run_worker');
const proc = execa.node(
workerPath.endsWith('.ts')
? require.resolve('../worker/run_worker_from_source') // workerFromSourcePath
: workerPath,
[],
{
nodeOptions: [
'--preserve-symlinks',
'--preserve-symlinks-main',
...(inspectFlag && config.inspectWorkers
? [`${inspectFlag}=${inspectPortCounter++}`]
: []),
...(config.maxWorkerCount <= 3 ? ['--max-old-space-size=2048'] : []),
],
buffer: false,
stderr: 'pipe',
stdout: 'pipe',
}
);
return {
proc,

View file

@ -16,7 +16,6 @@ export class BundleRefModule extends Module {
public built = false;
public buildMeta?: any;
public buildInfo?: any;
public exportsArgument = '__webpack_exports__';
constructor(public readonly ref: BundleRef) {
super('kbn/bundleRef', null);
@ -45,7 +44,9 @@ export class BundleRefModule extends Module {
build(_: any, __: any, ___: any, ____: any, callback: () => void) {
this.built = true;
this.buildMeta = {};
this.buildInfo = {};
this.buildInfo = {
exportsArgument: '__webpack_exports__',
};
callback();
}

View file

@ -6,4 +6,5 @@
* Side Public License, v 1.
*/
export * from './src/index';
require('@kbn/optimizer').registerNodeAutoTranspilation();
require('./run_worker');

View file

@ -1,10 +1,17 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"tsBuildInfoFile": "../../build/tsbuildinfo/packages/kbn-optimizer"
"incremental": false,
"outDir": "./target",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-optimizer/src"
},
"include": [
"index.d.ts",
"src/**/*"
],
"exclude": [
"**/__fixtures__/**/*"
]
}

View file

@ -4,6 +4,7 @@
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "target/index.js",
"types": "target/index.d.ts",
"scripts": {
"kbn:bootstrap": "node scripts/build",
"kbn:watch": "node scripts/build --watch"

View file

@ -1,12 +1,22 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"outDir": "target",
"target": "ES2019",
"declaration": true,
"declarationMap": true,
"sourceMap": true
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-plugin-generator/src",
"types": [
"jest",
"node"
]
},
"include": ["src/**/*"],
"exclude": ["src/template/*"]
"include": [
"src/**/*"
],
"exclude": [
"src/template/*"
],
}

View file

@ -8,6 +8,7 @@
"devOnly": true
},
"main": "target/index.js",
"types": "target/index.d.ts",
"bin": {
"plugin-helpers": "bin/plugin-helpers.js"
},

View file

@ -1,10 +1,17 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"outDir": "target",
"target": "ES2018",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"target": "ES2018"
"sourceRoot": "../../../../packages/kbn-plugin-helpers/src",
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*"

View file

@ -550,7 +550,7 @@ Object.defineProperty(exports, "pickLevelFromFlags", { enumerable: true, get: fu
Object.defineProperty(exports, "parseLogLevel", { enumerable: true, get: function () { return log_levels_1.parseLogLevel; } });
var tooling_log_collecting_writer_1 = __webpack_require__(127);
Object.defineProperty(exports, "ToolingLogCollectingWriter", { enumerable: true, get: function () { return tooling_log_collecting_writer_1.ToolingLogCollectingWriter; } });
//# sourceMappingURL=index.js.map
/***/ }),
/* 6 */
@ -628,7 +628,7 @@ class ToolingLog {
}
}
exports.ToolingLog = ToolingLog;
//# sourceMappingURL=tooling_log.js.map
/***/ }),
/* 7 */
@ -6749,7 +6749,7 @@ class ToolingLogTextWriter {
}
}
exports.ToolingLogTextWriter = ToolingLogTextWriter;
//# sourceMappingURL=tooling_log_text_writer.js.map
/***/ }),
/* 112 */
@ -8790,7 +8790,7 @@ function parseLogLevel(name) {
};
}
exports.parseLogLevel = parseLogLevel;
//# sourceMappingURL=log_levels.js.map
/***/ }),
/* 127 */
@ -8823,7 +8823,7 @@ class ToolingLogCollectingWriter extends tooling_log_text_writer_1.ToolingLogTex
}
}
exports.ToolingLogCollectingWriter = ToolingLogCollectingWriter;
//# sourceMappingURL=tooling_log_collecting_writer.js.map
/***/ }),
/* 128 */
@ -54377,7 +54377,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = __webpack_require__(7);
tslib_1.__exportStar(__webpack_require__(476), exports);
tslib_1.__exportStar(__webpack_require__(477), exports);
//# sourceMappingURL=index.js.map
/***/ }),
/* 476 */
@ -54436,7 +54436,7 @@ function observeLines(readable) {
operators_1.catchError(() => Rx.empty())));
}
exports.observeLines = observeLines;
//# sourceMappingURL=observe_lines.js.map
/***/ }),
/* 477 */
@ -54465,7 +54465,7 @@ function observeReadable(readable) {
return Rx.race(Rx.fromEvent(readable, 'end').pipe(operators_1.first(), operators_1.ignoreElements()), Rx.fromEvent(readable, 'error').pipe(operators_1.first(), operators_1.mergeMap((err) => Rx.throwError(err))));
}
exports.observeReadable = observeReadable;
//# sourceMappingURL=observe_readable.js.map
/***/ }),
/* 478 */
@ -59798,7 +59798,7 @@ class CiStatsReporter {
}
}
exports.CiStatsReporter = CiStatsReporter;
//# sourceMappingURL=ci_stats_reporter.js.map
/***/ }),
/* 516 */
@ -63258,7 +63258,7 @@ function parseConfig(log) {
return;
}
exports.parseConfig = parseConfig;
//# sourceMappingURL=ci_stats_config.js.map
/***/ }),
/* 557 */

View file

@ -1,16 +1,14 @@
{
"extends": "../../tsconfig.base.json",
"include": [
"./index.d.ts",
"./src/**/*.ts",
"./dist/*.d.ts"
],
"exclude": [],
"compilerOptions": {
"tsBuildInfoFile": "../../build/tsbuildinfo/packages/kbn-pm",
"types": [
"jest",
"node"
]
}
},
"include": [
"./index.d.ts",
"./src/**/*.ts"
]
}

View file

@ -1,6 +1,7 @@
{
"name": "@kbn/server-http-tools",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": true,

View file

@ -1,14 +1,14 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target",
"incremental": false,
"outDir": "./target",
"declaration": true,
"declarationMap": true
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-server-http-tools/src"
},
"include": [
"src/**/*"
],
"dependencies": {
"@kbn/std": "link:../kbn-std"
}
]
}

View file

@ -1,13 +1,23 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"incremental": false,
"declarationDir": "./target",
"outDir": "./target",
"stripInternal": true,
"declaration": true,
"declarationMap": true,
"types": ["jest", "node"]
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-std/src",
"types": [
"jest",
"node"
]
},
"include": ["./src/**/*.ts"],
"exclude": ["target"]
"include": [
"./src/**/*.ts"
],
"exclude": [
"**/__fixture__/**/*"
]
}

View file

@ -4,6 +4,7 @@
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"kibana": {
"devOnly": true
},

View file

@ -1,9 +1,19 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"declaration": true,
"incremental": false,
"outDir": "target",
"skipLibCheck": true
"skipLibCheck": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-storybook",
"types": [
"node"
]
},
"include": ["*.ts", "lib/*.ts"]
"include": [
"*.ts",
"lib/*.ts"
]
}

View file

@ -3,6 +3,7 @@
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"private": true,
"kibana": {
"devOnly": true

View file

@ -1,7 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"tsBuildInfoFile": "../../build/tsbuildinfo/packages/kbn-telemetry-tools"
"incremental": false,
"outDir": "./target",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-telemetry-tools/src"
},
"include": [
"src/**/*",

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 './src/index';

View file

@ -4,6 +4,7 @@
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js",
"types": "./target/types/index.d.ts",
"scripts": {
"build": "node scripts/build",
"kbn:bootstrap": "node scripts/build --source-maps",

View file

@ -10,6 +10,7 @@ export { Lifecycle } from './lifecycle';
export { LifecyclePhase } from './lifecycle_phase';
export { readConfigFile, Config } from './config';
export { readProviderSpec, ProviderCollection } from './providers';
// @internal
export { runTests, setupMocha } from './mocha';
export { FailureMetadata } from './failure_metadata';
export * from './docker_servers';

View file

@ -7,5 +7,7 @@
*/
// @ts-ignore will be replaced shortly
// @internal
export { setupMocha } from './setup_mocha';
// @internal
export { runTests } from './run_tests';

View file

@ -6,6 +6,7 @@
* Side Public License, v 1.
*/
// @internal
import {
runTestsCli,
processRunTestsCliOptions,
@ -14,27 +15,34 @@ import {
// @ts-ignore not typed yet
} from './functional_tests/cli';
// @internal
export { runTestsCli, processRunTestsCliOptions, startServersCli, processStartServersCliOptions };
// @ts-ignore not typed yet
// @internal
export { runTests, startServers } from './functional_tests/tasks';
// @ts-ignore not typed yet
// @internal
export { KIBANA_ROOT } from './functional_tests/lib/paths';
// @ts-ignore not typed yet
// @internal
export { esTestConfig, createLegacyEsTestCluster } from './legacy_es';
// @ts-ignore not typed yet
// @internal
export { kbnTestConfig, kibanaServerTestUser, kibanaTestUser, adminTestUser } from './kbn';
// @ts-ignore not typed yet
// @internal
export { setupUsers, DEFAULT_SUPERUSER_PASS } from './functional_tests/lib/auth';
export { readConfigFile } from './functional_test_runner/lib/config/read_config_file';
export { runFtrCli } from './functional_test_runner/cli';
// @internal
export { setupJUnitReportGeneration, escapeCdata } from './mocha';
export { runFailedTestsReporterCli } from './failed_tests_reporter';

View file

@ -10,7 +10,7 @@ import Path from 'path';
import Url from 'url';
import { RunWithCommands, createFlagError, Flags } from '@kbn/dev-utils';
import { KbnClient } from '@kbn/test';
import { KbnClient } from './kbn_client';
import { readConfigFile } from './functional_test_runner';

View file

@ -7,8 +7,11 @@
*/
// @ts-ignore not typed yet
// @internal
export { setupJUnitReportGeneration } from './junit_report_generation';
// @ts-ignore not typed yet
// @internal
export { recordLog, snapshotLogsForRunnable } from './log_cache';
// @ts-ignore not typed yet
// @internal
export { escapeCdata } from './xml';

View file

@ -1,22 +1,26 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"outDir": "./target/types",
"stripInternal": true,
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../../packages/kbn-test/src",
"types": [
"jest",
"node"
],
},
"include": [
"types/**/*",
"src/**/*",
"index.d.ts"
],
"exclude": [
"types/ftr_globals/**/*"
],
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./target/types",
"types": [
"jest",
"node"
],
"stripInternal": true,
"declarationMap": true
}
"types/ftr_globals/**/*",
"**/__fixtures__/**/*"
]
}

View file

@ -3,7 +3,7 @@
"version": "1.0.0",
"private": true,
"license": "SSPL-1.0 OR Elastic License 2.0",
"main": "target",
"main": "target/index.js",
"types": "target/index.d.ts",
"kibana": {
"devOnly": false

View file

@ -1,18 +1,22 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"declaration": true,
"declarationDir": "./target",
"incremental": false,
"outDir": "./target",
"declarationDir": "./target",
"stripInternal": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-utility-types",
"types": [
"node",
"jest"
"jest",
"node"
]
},
"include": ["index.ts", "jest/**/*", "test-d/**/*"],
"exclude": [
"target"
"include": [
"index.ts",
"jest/**/*",
"test-d/**/*"
]
}

View file

@ -1,6 +1,7 @@
{
"name": "@kbn/utils",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": true,

View file

@ -1,9 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"outDir": "target",
"declaration": true,
"declarationMap": true
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-utils/src",
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*"

View file

@ -9,12 +9,19 @@
import { Client } from 'elasticsearch';
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
import {
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
createLegacyEsTestCluster,
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
DEFAULT_SUPERUSER_PASS,
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
esTestConfig,
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
kbnTestConfig,
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
kibanaServerTestUser,
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
kibanaTestUser,
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
setupUsers,
} from '@kbn/test';
import { defaultsDeep, get } from 'lodash';

View file

@ -38,6 +38,8 @@
"moduleResolution": "node",
// "resolveJsonModule" allows for importing, extracting types from and generating .json files.
"resolveJsonModule": true,
// Do not resolve symlinks to their real path; treat a symlinked file like a real one.
"preserveSymlinks": true,
// Disallow inconsistently-cased references to the same file.
"forceConsistentCasingInFileNames": false,
// Forbid unused local variables as the rule was deprecated by ts-lint

View file

@ -8,6 +8,7 @@
import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { resolve } from 'path';
import fs from 'fs';
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { KIBANA_ROOT } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {

View file

@ -5,6 +5,7 @@
* 2.0.
*/
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { adminTestUser } from '@kbn/test';
import { FtrProviderContext } from '../ftr_provider_context';
import { AuthenticatedUser, Role } from '../../../plugins/security/common/model';

View file

@ -8,6 +8,7 @@
import Url from 'url';
import Path from 'path';
import type { FtrConfigProviderContext } from '@kbn/test/types/ftr';
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { kbnTestConfig } from '@kbn/test';
import { pageObjects } from '../functional/page_objects';

View file

@ -6,6 +6,7 @@
*/
import Hapi from '@hapi/hapi';
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { kbnTestConfig } from '@kbn/test';
import { take } from 'rxjs/operators';
import Url from 'url';

View file

@ -6,6 +6,7 @@
*/
import path from 'path';
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { KIBANA_ROOT } from '@kbn/test';
import { FtrConfigProviderContext } from '@kbn/test/types/ftr';

View file

@ -7,6 +7,7 @@
import { resolve } from 'path';
import fs from 'fs';
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { KIBANA_ROOT } from '@kbn/test';
import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { services } from './services';

View file

@ -5,6 +5,7 @@
* 2.0.
*/
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { esTestConfig, kbnTestConfig, kibanaServerTestUser } from '@kbn/test';
import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { format as formatUrl } from 'url';

View file

@ -5,6 +5,7 @@
* 2.0.
*/
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { esTestConfig, kbnTestConfig } from '@kbn/test';
import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { format as formatUrl } from 'url';

View file

@ -7,6 +7,7 @@
import expect from '@kbn/expect';
import request, { Cookie } from 'request';
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { adminTestUser } from '@kbn/test';
import { FtrProviderContext } from '../../ftr_provider_context';

View file

@ -8,6 +8,7 @@
import expect from '@kbn/expect';
import request, { Cookie } from 'request';
import { delay } from 'bluebird';
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { adminTestUser } from '@kbn/test';
import { FtrProviderContext } from '../../ftr_provider_context';
import {

View file

@ -9,6 +9,7 @@ import expect from '@kbn/expect';
import request, { Cookie } from 'request';
import url from 'url';
import { delay } from 'bluebird';
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { adminTestUser } from '@kbn/test';
import { getStateAndNonce } from '../../../fixtures/oidc/oidc_tools';
import { FtrProviderContext } from '../../../ftr_provider_context';

View file

@ -11,6 +11,7 @@ import { delay } from 'bluebird';
import { readFileSync } from 'fs';
import { resolve } from 'path';
import { CA_CERT_PATH } from '@kbn/dev-utils';
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { adminTestUser } from '@kbn/test';
import { FtrProviderContext } from '../../ftr_provider_context';

View file

@ -10,6 +10,7 @@ import url from 'url';
import { delay } from 'bluebird';
import expect from '@kbn/expect';
import request, { Cookie } from 'request';
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { adminTestUser } from '@kbn/test';
import {
getLogoutRequest,

View file

@ -8,6 +8,7 @@
import request, { Cookie } from 'request';
import { delay } from 'bluebird';
import expect from '@kbn/expect';
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { adminTestUser } from '@kbn/test';
import type { AuthenticationProvider } from '../../../../plugins/security/common/model';
import { getSAMLRequestId, getSAMLResponse } from '../../fixtures/saml/saml_tools';

View file

@ -7,6 +7,7 @@
import request, { Cookie } from 'request';
import expect from '@kbn/expect';
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { adminTestUser } from '@kbn/test';
import type { AuthenticationProvider } from '../../../../plugins/security/common/model';
import { getSAMLRequestId, getSAMLResponse } from '../../fixtures/saml/saml_tools';

View file

@ -8,6 +8,7 @@
import request, { Cookie } from 'request';
import { delay } from 'bluebird';
import expect from '@kbn/expect';
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { adminTestUser } from '@kbn/test';
import type { AuthenticationProvider } from '../../../../plugins/security/common/model';
import { getSAMLRequestId, getSAMLResponse } from '../../fixtures/saml/saml_tools';

View file

@ -7,6 +7,7 @@
import fs from 'fs';
import Path from 'path';
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { KIBANA_ROOT } from '@kbn/test';
import { FtrProviderContext } from '../ftr_provider_context';