Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Move @kbn/config-schema to server] @kbn/search-connectors #191838

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ packages/kbn-bazel-runner @elastic/kibana-operations
packages/kbn-bfetch-error @elastic/appex-sharedux
examples/bfetch_explorer @elastic/appex-sharedux
src/plugins/bfetch @elastic/appex-sharedux
packages/kbn-byte-size-value @elastic/kibana-core
packages/kbn-calculate-auto @elastic/obs-ux-management-team
packages/kbn-calculate-width-from-char-count @elastic/kibana-visualizations
x-pack/plugins/canvas @elastic/kibana-presentation
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
"@kbn/bfetch-error": "link:packages/kbn-bfetch-error",
"@kbn/bfetch-explorer-plugin": "link:examples/bfetch_explorer",
"@kbn/bfetch-plugin": "link:src/plugins/bfetch",
"@kbn/byte-size-value": "link:packages/kbn-byte-size-value",
"@kbn/calculate-auto": "link:packages/kbn-calculate-auto",
"@kbn/calculate-width-from-char-count": "link:packages/kbn-calculate-width-from-char-count",
"@kbn/canvas-plugin": "link:x-pack/plugins/canvas",
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-byte-size-value/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @kbn/byte-size-value

Implements the class `ByteSizeValue` and any related helpers in a UI-friendly way.
13 changes: 13 additions & 0 deletions packages/kbn-byte-size-value/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* 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.
*/

module.exports = {
preset: '@kbn/test',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-byte-size-value'],
};
5 changes: 5 additions & 0 deletions packages/kbn-byte-size-value/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/byte-size-value",
"owner": "@elastic/kibana-core"
}
6 changes: 6 additions & 0 deletions packages/kbn-byte-size-value/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@kbn/byte-size-value",
"private": true,
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0"
}
19 changes: 19 additions & 0 deletions packages/kbn-byte-size-value/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
"jest",
"node",
"react"
]
},
"include": [
"**/*.ts",
"**/*.tsx",
],
"exclude": [
"target/**/*"
],
"kbn_references": []
}
4 changes: 2 additions & 2 deletions packages/kbn-config-schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { Duration } from 'moment';
import { Stream } from 'stream';

import { ByteSizeValue } from './src/byte_size_value';
import { ByteSizeValue } from '@kbn/byte-size-value';
import { ContextReference, Reference, SiblingReference } from './src/references';
import {
AnyType,
Expand Down Expand Up @@ -57,8 +57,8 @@ import {

export type { AnyType, ConditionalType, TypeOf, Props, SchemaStructureEntry, NullableProps };
export { ObjectType, Type };
export { ByteSizeValue } from '@kbn/byte-size-value';
export type { SchemaValidationOptions } from './src/types';
export { ByteSizeValue } from './src/byte_size_value';
export { SchemaTypeError, ValidationError } from './src/errors';
export { isConfigSchema } from './src/typeguards';
export { offeringBasedSchema } from './src/helpers';
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-config-schema/src/internals/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { JoiRoot, CustomHelpers } from 'joi';
import { isPlainObject } from 'lodash';
import { isDuration } from 'moment';
import { Stream } from 'stream';
import { ByteSizeValue, ensureByteSizeValue } from '../byte_size_value';
import { ByteSizeValue, ensureByteSizeValue } from '@kbn/byte-size-value';
import { ensureDuration } from '../duration';

function isMap<K, V>(o: any): o is Map<K, V> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { schema } from '../..';
import { ByteSizeValue } from '../byte_size_value';
import { ByteSizeValue } from '@kbn/byte-size-value';

const { byteSize } = schema;

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-config-schema/src/types/byte_size_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import typeDetect from 'type-detect';
import { ByteSizeValue, ensureByteSizeValue } from '../byte_size_value';
import { ByteSizeValue, ensureByteSizeValue } from '@kbn/byte-size-value';
import { SchemaTypeError } from '../errors';
import { internals } from '../internals';
import { Type } from './type';
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-config-schema/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
],
"exclude": [
"target/**/*",
],
"kbn_references": [
"@kbn/byte-size-value",
]
}
2 changes: 1 addition & 1 deletion packages/kbn-config-schema/types/joi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import * as Joi from 'joi';
import type { ByteSizeValue } from '../src/byte_size_value';
import type { ByteSizeValue } from '@kbn/byte-size-value';
import type { DurationValueType } from '../src/types/duration_type';

declare module 'joi' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import React from 'react';

import { EuiBasicTable, EuiBasicTableColumn, EuiIcon, EuiToolTip, EuiCode } from '@elastic/eui';
import { ByteSizeValue } from '@kbn/config-schema/src/byte_size_value'; // importing from file to avoid leaking `joi` to the browser
import { ByteSizeValue } from '@kbn/byte-size-value';
import { i18n } from '@kbn/i18n';

import { FormattedMessage } from '@kbn/i18n-react';
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-search-connectors/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"@kbn/i18n",
"@kbn/core",
"@kbn/core-elasticsearch-server",
"@kbn/config-schema",
"@kbn/i18n-react",
"@kbn/test-jest-helpers",
"@kbn/std",
"@kbn/byte-size-value",
]
}
2 changes: 2 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@
"@kbn/bfetch-explorer-plugin/*": ["examples/bfetch_explorer/*"],
"@kbn/bfetch-plugin": ["src/plugins/bfetch"],
"@kbn/bfetch-plugin/*": ["src/plugins/bfetch/*"],
"@kbn/byte-size-value": ["packages/kbn-byte-size-value"],
"@kbn/byte-size-value/*": ["packages/kbn-byte-size-value/*"],
"@kbn/calculate-auto": ["packages/kbn-calculate-auto"],
"@kbn/calculate-auto/*": ["packages/kbn-calculate-auto/*"],
"@kbn/calculate-width-from-char-count": ["packages/kbn-calculate-width-from-char-count"],
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3486,6 +3486,10 @@
version "0.0.0"
uid ""

"@kbn/byte-size-value@link:packages/kbn-byte-size-value":
version "0.0.0"
uid ""

"@kbn/calculate-auto@link:packages/kbn-calculate-auto":
version "0.0.0"
uid ""
Expand Down