Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rshen91 committed Aug 4, 2022
1 parent 8231364 commit 836831c
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 45 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@
"@kbn/shared-ux-prompt-no-data-views": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/impl",
"@kbn/shared-ux-prompt-no-data-views-mocks": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/mocks",
"@kbn/shared-ux-prompt-no-data-views-types": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/types",
"@kbn/shared-ux-router": "link:bazel-bin/packages/shared-ux/router",
"@kbn/shared-ux-router-types": "link:bazel-bin/packages/shared-ux/router/src",
"@kbn/shared-ux-services": "link:bazel-bin/packages/kbn-shared-ux-services",
"@kbn/shared-ux-storybook": "link:bazel-bin/packages/kbn-shared-ux-storybook",
Expand Down Expand Up @@ -974,6 +975,7 @@
"@types/kbn__shared-ux-prompt-no-data-views": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/impl/npm_module_types",
"@types/kbn__shared-ux-prompt-no-data-views-mocks": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/mocks/npm_module_types",
"@types/kbn__shared-ux-prompt-no-data-views-types": "link:bazel-bin/packages/shared-ux/prompt/no_data_views/types/npm_module_types",
"@types/kbn__shared-ux-router": "link:bazel-bin/packages/shared-ux/router/npm_module_types",
"@types/kbn__shared-ux-router-types": "link:bazel-bin/packages/shared-ux/router/src/npm_module_types",
"@types/kbn__shared-ux-services": "link:bazel-bin/packages/kbn-shared-ux-services/npm_module_types",
"@types/kbn__shared-ux-storybook": "link:bazel-bin/packages/kbn-shared-ux-storybook/npm_module_types",
Expand Down
15 changes: 4 additions & 11 deletions packages/shared-ux/router/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ load("@npm//@bazel/typescript:index.bzl", "ts_config")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")

PKG_DIRNAME = "shared-ux-router"
PKG_REQUIRE_NAME = "@kbn/shared-ux-router-types"
PKG_DIRNAME = "router"
PKG_REQUIRE_NAME = "@kbn/shared-ux-router"

SOURCE_FILES = glob(
[
Expand Down Expand Up @@ -38,10 +38,7 @@ NPM_MODULE_EXTRA_FILES = [
# "@npm//name-of-package"
# eg. "@npm//lodash"
RUNTIME_DEPS = [
"@npm//react",
"@npm//react-use",
"@npm//rxjs",
"@npm//react-router-dom",
"@npm//react"
]

# In this array place dependencies necessary to build the types, which will include the
Expand All @@ -55,12 +52,8 @@ RUNTIME_DEPS = [
# References to NPM packages work the same as RUNTIME_DEPS
TYPES_DEPS = [
"@npm//@types/node",
"@npm//react",
"@npm//@types/jest",
"@npm//@types/react",
"@npm//react-use",
"@npm//rxjs",
"@npm//@types/react-router-dom",
"@npm//@types/react"
]

jsts_transpiler(
Expand Down
2 changes: 1 addition & 1 deletion packages/shared-ux/router/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# @kbn/shared-ux-router-types
# @kbn/shared-ux-router

Empty package generated by @kbn/generate
2 changes: 1 addition & 1 deletion packages/shared-ux/router/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
rootDir: '../../..',
roots: ['<rootDir>/packages/shared-ux/router'],
};
2 changes: 1 addition & 1 deletion packages/shared-ux/router/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@kbn/shared-ux-router-types",
"name": "@kbn/shared-ux-router",
"private": true,
"version": "1.0.0",
"main": "./target_node/index.js",
Expand Down
4 changes: 3 additions & 1 deletion packages/shared-ux/router/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
* Side Public License, v 1.
*/

export { Route } from './router';
export function foo() {
return 'hello world';
}
3 changes: 1 addition & 2 deletions packages/shared-ux/router/src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
} from 'react-router-dom';
import { useKibanaSharedUX } from './services/services';
import { useSharedUXExecutionContext } from './services/use_execution_context';
// '@kbn/shared-ux-router-types';

/**
* It's a wrapper around the react-router-dom Route component that inserts
Expand Down Expand Up @@ -84,4 +83,4 @@ const MatchPropagator = () => {
});

return null;
};
};
44 changes: 22 additions & 22 deletions packages/shared-ux/router/src/services/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@
* @public
* Represents a meta-information about a Kibana entity initiating a search request.
*/
export declare interface SharedUXExecutionContext {
/**
* Kibana application initiated an operation.
* */
readonly type?: string;
/** public name of an application or a user-facing feature */
readonly name?: string;
/** a stand alone, logical unit such as an application page or tab */
readonly page?: string;
/** unique value to identify the source */
readonly id?: string;
/** human readable description. For example, a vis title, action name */
readonly description?: string;
/** in browser - url to navigate to a current page, on server - endpoint path, for task: task SO url */
readonly url?: string;
/** Metadata attached to the field. An optional parameter that allows to describe the execution context in more detail. **/
readonly meta?: {
[key: string]: string | number | boolean | undefined;
};
/** an inner context spawned from the current context. */
child?: SharedUXExecutionContext;
}
export declare interface SharedUXExecutionContext {
/**
* Kibana application initiated an operation.
* */
readonly type?: string;
/** public name of an application or a user-facing feature */
readonly name?: string;
/** a stand alone, logical unit such as an application page or tab */
readonly page?: string;
/** unique value to identify the source */
readonly id?: string;
/** human readable description. For example, a vis title, action name */
readonly description?: string;
/** in browser - url to navigate to a current page, on server - endpoint path, for task: task SO url */
readonly url?: string;
/** Metadata attached to the field. An optional parameter that allows to describe the execution context in more detail. **/
readonly meta?: {
[key: string]: string | number | boolean | undefined;
};
/** an inner context spawned from the current context. */
child?: SharedUXExecutionContext;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ export function useSharedUXExecutionContext(
executionContext?.clear();
};
}, [context]);
}
}
1 change: 0 additions & 1 deletion packages/shared-ux/router/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "../../../tsconfig.bazel.json",
"compilerOptions": {
"jsx": "react",
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
Expand Down
4 changes: 0 additions & 4 deletions packages/shared-ux/router/yarn.lock

This file was deleted.

8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3811,6 +3811,10 @@
version "0.0.0"
uid ""

"@kbn/shared-ux-router@link:bazel-bin/packages/shared-ux/router":
version "0.0.0"
uid ""

"@kbn/shared-ux-services@link:bazel-bin/packages/kbn-shared-ux-services":
version "0.0.0"
uid ""
Expand Down Expand Up @@ -7699,6 +7703,10 @@
version "0.0.0"
uid ""

"@types/kbn__shared-ux-router@link:bazel-bin/packages/shared-ux/router/npm_module_types":
version "0.0.0"
uid ""

"@types/kbn__shared-ux-services@link:bazel-bin/packages/kbn-shared-ux-services/npm_module_types":
version "0.0.0"
uid ""
Expand Down

0 comments on commit 836831c

Please sign in to comment.