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", "version": "5.0.3",
"description": "elasticsearch datemath parser, used in kibana", "description": "elasticsearch datemath parser, used in kibana",
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "index.js", "main": "./target/index.js",
"typings": "index.d.ts" "types": "./target/index.d.ts",
"scripts": {
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build"
}
} }

View file

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

View file

@ -1,9 +1,17 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": { "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": [ "include": [
"index.d.ts" "src/index.ts"
] ]
} }

View file

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

View file

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

View file

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

View file

@ -9,7 +9,7 @@
import { relative, resolve } from 'path'; import { relative, resolve } from 'path';
import { getConfigFromFiles } from './read_config'; 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', () => { test('reads single yaml from file system and parses to json', () => {
const config = getConfigFromFiles([fixtureFile('config.yml')]); const config = getConfigFromFiles([fixtureFile('config.yml')]);

View file

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

View file

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

View file

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

View file

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

View file

@ -9,7 +9,7 @@
import { relative, resolve } from 'path'; import { relative, resolve } from 'path';
import { getConfigFromFiles } from './read_config'; 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', () => { test('reads single yaml from file system and parses to json', () => {
const config = getConfigFromFiles([fixtureFile('config.yml')]); const config = getConfigFromFiles([fixtureFile('config.yml')]);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,18 @@
{ {
"extends": "../../tsconfig.base.json", "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": [ "include": [
"src/**/*.ts", "src/**/*.ts",
"src/**/*.tsx", "src/**/*.tsx",
@ -7,15 +20,6 @@
"types/intl_relativeformat.d.ts" "types/intl_relativeformat.d.ts"
], ],
"exclude": [ "exclude": [
"target" "**/__fixtures__/**/*"
], ]
"compilerOptions": {
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./target/types",
"types": [
"jest",
"node"
]
}
} }

View file

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

View file

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

View file

@ -1,11 +1,19 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"incremental": false,
"outDir": "target", "outDir": "target",
"stripInternal": false, "stripInternal": false,
"declaration": true, "declaration": true,
"declarationMap": 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, "private": true,
"license": "SSPL-1.0 OR Elastic License 2.0", "license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js", "main": "./target/index.js",
"types": "./target/index.d.ts",
"scripts": { "scripts": {
"build": "../../node_modules/.bin/tsc", "build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build", "kbn:bootstrap": "yarn build",

View file

@ -1,11 +1,19 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"incremental": false,
"outDir": "target", "outDir": "target",
"stripInternal": false, "stripInternal": false,
"declaration": true, "declaration": true,
"declarationMap": 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", "version": "1.0.0",
"private": true, "private": true,
"main": "./target/index.js", "main": "./target/index.js",
"types": "./target/index.d.ts",
"license": "SSPL-1.0 OR Elastic License 2.0", "license": "SSPL-1.0 OR Elastic License 2.0",
"scripts": { "scripts": {
"build": "node ./scripts/build.js", "build": "node ./scripts/build.js",

View file

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

View file

@ -4,8 +4,9 @@
"private": true, "private": true,
"license": "SSPL-1.0 OR Elastic License 2.0", "license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js", "main": "./target/index.js",
"types": "./target/index.d.ts",
"scripts": { "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:bootstrap": "yarn build",
"kbn:watch": "yarn build --watch" "kbn:watch": "yarn build --watch"
}, },

View file

@ -16,7 +16,7 @@ import del from 'del';
import { tap, filter } from 'rxjs/operators'; import { tap, filter } from 'rxjs/operators';
import { REPO_ROOT } from '@kbn/utils'; import { REPO_ROOT } from '@kbn/utils';
import { ToolingLog } from '@kbn/dev-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'; 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/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/index.ts,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/lib.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, <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/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_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/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, <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 [ 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/kibana.json,
<absolute path>/packages/kbn-optimizer/src/__fixtures__/__tmp__/mock_repo/x-pack/baz/public/index.ts, <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, <absolute path>/packages/kbn-ui-shared-deps/public_path_module_creator.js,
] ]
`); `);

View file

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

View file

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

View file

@ -6,4 +6,5 @@
* Side Public License, v 1. * 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", "extends": "../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"tsBuildInfoFile": "../../build/tsbuildinfo/packages/kbn-optimizer" "incremental": false,
"outDir": "./target",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"sourceRoot": "../../../../packages/kbn-optimizer/src"
}, },
"include": [ "include": [
"index.d.ts",
"src/**/*" "src/**/*"
],
"exclude": [
"**/__fixtures__/**/*"
] ]
} }

View file

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

View file

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

View file

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

View file

@ -1,10 +1,17 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"incremental": false,
"outDir": "target", "outDir": "target",
"target": "ES2018",
"declaration": true, "declaration": true,
"declarationMap": true,
"sourceMap": true, "sourceMap": true,
"target": "ES2018" "sourceRoot": "../../../../packages/kbn-plugin-helpers/src",
"types": [
"jest",
"node"
]
}, },
"include": [ "include": [
"src/**/*" "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; } }); Object.defineProperty(exports, "parseLogLevel", { enumerable: true, get: function () { return log_levels_1.parseLogLevel; } });
var tooling_log_collecting_writer_1 = __webpack_require__(127); var tooling_log_collecting_writer_1 = __webpack_require__(127);
Object.defineProperty(exports, "ToolingLogCollectingWriter", { enumerable: true, get: function () { return tooling_log_collecting_writer_1.ToolingLogCollectingWriter; } }); Object.defineProperty(exports, "ToolingLogCollectingWriter", { enumerable: true, get: function () { return tooling_log_collecting_writer_1.ToolingLogCollectingWriter; } });
//# sourceMappingURL=index.js.map
/***/ }), /***/ }),
/* 6 */ /* 6 */
@ -628,7 +628,7 @@ class ToolingLog {
} }
} }
exports.ToolingLog = ToolingLog; exports.ToolingLog = ToolingLog;
//# sourceMappingURL=tooling_log.js.map
/***/ }), /***/ }),
/* 7 */ /* 7 */
@ -6749,7 +6749,7 @@ class ToolingLogTextWriter {
} }
} }
exports.ToolingLogTextWriter = ToolingLogTextWriter; exports.ToolingLogTextWriter = ToolingLogTextWriter;
//# sourceMappingURL=tooling_log_text_writer.js.map
/***/ }), /***/ }),
/* 112 */ /* 112 */
@ -8790,7 +8790,7 @@ function parseLogLevel(name) {
}; };
} }
exports.parseLogLevel = parseLogLevel; exports.parseLogLevel = parseLogLevel;
//# sourceMappingURL=log_levels.js.map
/***/ }), /***/ }),
/* 127 */ /* 127 */
@ -8823,7 +8823,7 @@ class ToolingLogCollectingWriter extends tooling_log_text_writer_1.ToolingLogTex
} }
} }
exports.ToolingLogCollectingWriter = ToolingLogCollectingWriter; exports.ToolingLogCollectingWriter = ToolingLogCollectingWriter;
//# sourceMappingURL=tooling_log_collecting_writer.js.map
/***/ }), /***/ }),
/* 128 */ /* 128 */
@ -54377,7 +54377,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = __webpack_require__(7); const tslib_1 = __webpack_require__(7);
tslib_1.__exportStar(__webpack_require__(476), exports); tslib_1.__exportStar(__webpack_require__(476), exports);
tslib_1.__exportStar(__webpack_require__(477), exports); tslib_1.__exportStar(__webpack_require__(477), exports);
//# sourceMappingURL=index.js.map
/***/ }), /***/ }),
/* 476 */ /* 476 */
@ -54436,7 +54436,7 @@ function observeLines(readable) {
operators_1.catchError(() => Rx.empty()))); operators_1.catchError(() => Rx.empty())));
} }
exports.observeLines = observeLines; exports.observeLines = observeLines;
//# sourceMappingURL=observe_lines.js.map
/***/ }), /***/ }),
/* 477 */ /* 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)))); 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; exports.observeReadable = observeReadable;
//# sourceMappingURL=observe_readable.js.map
/***/ }), /***/ }),
/* 478 */ /* 478 */
@ -59798,7 +59798,7 @@ class CiStatsReporter {
} }
} }
exports.CiStatsReporter = CiStatsReporter; exports.CiStatsReporter = CiStatsReporter;
//# sourceMappingURL=ci_stats_reporter.js.map
/***/ }), /***/ }),
/* 516 */ /* 516 */
@ -63258,7 +63258,7 @@ function parseConfig(log) {
return; return;
} }
exports.parseConfig = parseConfig; exports.parseConfig = parseConfig;
//# sourceMappingURL=ci_stats_config.js.map
/***/ }), /***/ }),
/* 557 */ /* 557 */

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,9 +1,19 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"declaration": true, "incremental": false,
"outDir": "target", "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", "version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0", "license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js", "main": "./target/index.js",
"types": "./target/index.d.ts",
"private": true, "private": true,
"kibana": { "kibana": {
"devOnly": true "devOnly": true

View file

@ -1,7 +1,12 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": { "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": [ "include": [
"src/**/*", "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, "private": true,
"license": "SSPL-1.0 OR Elastic License 2.0", "license": "SSPL-1.0 OR Elastic License 2.0",
"main": "./target/index.js", "main": "./target/index.js",
"types": "./target/types/index.d.ts",
"scripts": { "scripts": {
"build": "node scripts/build", "build": "node scripts/build",
"kbn:bootstrap": "node scripts/build --source-maps", "kbn:bootstrap": "node scripts/build --source-maps",

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,22 +1,26 @@
{ {
"extends": "../../tsconfig.base.json", "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": [ "include": [
"types/**/*", "types/**/*",
"src/**/*", "src/**/*",
"index.d.ts" "index.d.ts"
], ],
"exclude": [ "exclude": [
"types/ftr_globals/**/*" "types/ftr_globals/**/*",
], "**/__fixtures__/**/*"
"compilerOptions": { ]
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "./target/types",
"types": [
"jest",
"node"
],
"stripInternal": true,
"declarationMap": true
}
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -38,6 +38,8 @@
"moduleResolution": "node", "moduleResolution": "node",
// "resolveJsonModule" allows for importing, extracting types from and generating .json files. // "resolveJsonModule" allows for importing, extracting types from and generating .json files.
"resolveJsonModule": true, "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. // Disallow inconsistently-cased references to the same file.
"forceConsistentCasingInFileNames": false, "forceConsistentCasingInFileNames": false,
// Forbid unused local variables as the rule was deprecated by ts-lint // 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 { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { resolve } from 'path'; import { resolve } from 'path';
import fs from 'fs'; import fs from 'fs';
// @ts-expect-error https://github.com/elastic/kibana/issues/95679
import { KIBANA_ROOT } from '@kbn/test'; import { KIBANA_ROOT } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) { export default async function ({ readConfigFile }: FtrConfigProviderContext) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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