Skip to content

Commit

Permalink
[kbn/generate] add basic package generator (#127095)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer authored Mar 9, 2022
1 parent 7923667 commit ad0eb60
Show file tree
Hide file tree
Showing 38 changed files with 2,200 additions and 1,166 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ snapshots.js
# package overrides
/packages/elastic-eslint-config-kibana
/packages/kbn-plugin-generator/template
/packages/kbn-generate/templates
/packages/kbn-pm/dist
/packages/kbn-test/src/functional_test_runner/__tests__/fixtures/
/packages/kbn-test/src/functional_test_runner/lib/config/__tests__/fixtures/
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,9 @@
"@kbn/eslint-import-resolver-kibana": "link:bazel-bin/packages/kbn-eslint-import-resolver-kibana",
"@kbn/eslint-plugin-eslint": "link:bazel-bin/packages/kbn-eslint-plugin-eslint",
"@kbn/expect": "link:bazel-bin/packages/kbn-expect",
"@kbn/generate": "link:bazel-bin/packages/kbn-generate",
"@kbn/optimizer": "link:bazel-bin/packages/kbn-optimizer",
"@kbn/packages": "link:bazel-bin/packages/kbn-packages",
"@kbn/plugin-generator": "link:bazel-bin/packages/kbn-plugin-generator",
"@kbn/plugin-helpers": "link:bazel-bin/packages/kbn-plugin-helpers",
"@kbn/pm": "link:packages/kbn-pm",
Expand Down Expand Up @@ -585,6 +587,7 @@
"@types/kbn__es-archiver": "link:bazel-bin/packages/kbn-es-archiver/npm_module_types",
"@types/kbn__es-query": "link:bazel-bin/packages/kbn-es-query/npm_module_types",
"@types/kbn__field-types": "link:bazel-bin/packages/kbn-field-types/npm_module_types",
"@types/kbn__generate": "link:bazel-bin/packages/kbn-generate/npm_module_types",
"@types/kbn__i18n": "link:bazel-bin/packages/kbn-i18n/npm_module_types",
"@types/kbn__i18n-react": "link:bazel-bin/packages/kbn-i18n-react/npm_module_types",
"@types/kbn__interpreter": "link:bazel-bin/packages/kbn-interpreter/npm_module_types",
Expand All @@ -594,6 +597,7 @@
"@types/kbn__mapbox-gl": "link:bazel-bin/packages/kbn-mapbox-gl/npm_module_types",
"@types/kbn__monaco": "link:bazel-bin/packages/kbn-monaco/npm_module_types",
"@types/kbn__optimizer": "link:bazel-bin/packages/kbn-optimizer/npm_module_types",
"@types/kbn__packages": "link:bazel-bin/packages/kbn-packages/npm_module_types",
"@types/kbn__plugin-generator": "link:bazel-bin/packages/kbn-plugin-generator/npm_module_types",
"@types/kbn__plugin-helpers": "link:bazel-bin/packages/kbn-plugin-helpers/npm_module_types",
"@types/kbn__react-field": "link:bazel-bin/packages/kbn-react-field/npm_module_types",
Expand Down
278 changes: 143 additions & 135 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,157 +1,165 @@
################
################
## This file is automatically generated, to create a new package use `node scripts/generate package --help`
################
################

# It will build all declared code packages
filegroup(
name = "build_pkg_code",
srcs = [
"//packages/elastic-apm-synthtrace:build",
"//packages/elastic-datemath:build",
"//packages/elastic-eslint-config-kibana:build",
"//packages/elastic-safer-lodash-set:build",
"//packages/kbn-ace:build",
"//packages/kbn-alerts:build",
"//packages/kbn-analytics:build",
"//packages/kbn-apm-config-loader:build",
"//packages/kbn-apm-utils:build",
"//packages/kbn-babel-code-parser:build",
"//packages/kbn-babel-preset:build",
"//packages/kbn-cli-dev-mode:build",
"//packages/kbn-config:build",
"//packages/kbn-config-schema:build",
"//packages/kbn-crypto:build",
"//packages/kbn-dev-utils:build",
"//packages/kbn-doc-links:build",
"//packages/kbn-docs-utils:build",
"//packages/kbn-es:build",
"//packages/kbn-es-archiver:build",
"//packages/kbn-es-query:build",
"//packages/kbn-eslint-import-resolver-kibana:build",
"//packages/kbn-eslint-plugin-eslint:build",
"//packages/kbn-expect:build",
"//packages/kbn-field-types:build",
"//packages/kbn-flot-charts:build",
"//packages/kbn-i18n:build",
"//packages/kbn-i18n-react:build",
"//packages/kbn-interpreter:build",
"//packages/kbn-io-ts-utils:build",
"//packages/kbn-logging:build",
"//packages/kbn-logging-mocks:build",
"//packages/kbn-mapbox-gl:build",
"//packages/kbn-monaco:build",
"//packages/kbn-optimizer:build",
"//packages/kbn-plugin-generator:build",
"//packages/kbn-plugin-helpers:build",
"//packages/kbn-react-field:build",
"//packages/kbn-rule-data-utils:build",
"//packages/kbn-securitysolution-autocomplete:build",
"//packages/kbn-securitysolution-list-constants:build",
"//packages/kbn-securitysolution-io-ts-types:build",
"//packages/kbn-securitysolution-io-ts-alerting-types:build",
"//packages/kbn-securitysolution-io-ts-list-types:build",
"//packages/kbn-securitysolution-io-ts-utils:build",
"//packages/kbn-securitysolution-list-api:build",
"//packages/kbn-securitysolution-list-hooks:build",
"//packages/kbn-securitysolution-list-utils:build",
"//packages/kbn-securitysolution-rules:build",
"//packages/kbn-securitysolution-utils:build",
"//packages/kbn-securitysolution-es-utils:build",
"//packages/kbn-securitysolution-t-grid:build",
"//packages/kbn-securitysolution-hook-utils:build",
"//packages/kbn-server-http-tools:build",
"//packages/kbn-server-route-repository:build",
"//packages/kbn-spec-to-console:build",
"//packages/kbn-std:build",
"//packages/kbn-storybook:build",
"//packages/kbn-telemetry-tools:build",
"//packages/kbn-test:build",
"//packages/kbn-test-jest-helpers:build",
"//packages/kbn-test-subj-selector:build",
"//packages/kbn-timelion-grammar:build",
"//packages/kbn-tinymath:build",
"//packages/kbn-type-summarizer:build",
"//packages/kbn-typed-react-router-config:build",
"//packages/kbn-ui-framework:build",
"//packages/kbn-ui-shared-deps-npm:build",
"//packages/kbn-ui-shared-deps-src:build",
"//packages/kbn-ui-theme:build",
"//packages/kbn-utility-types:build",
"//packages/kbn-utils:build",
"//packages/elastic-apm-synthtrace:build",
"//packages/elastic-datemath:build",
"//packages/elastic-eslint-config-kibana:build",
"//packages/elastic-safer-lodash-set:build",
"//packages/kbn-ace:build",
"//packages/kbn-alerts:build",
"//packages/kbn-analytics:build",
"//packages/kbn-apm-config-loader:build",
"//packages/kbn-apm-utils:build",
"//packages/kbn-babel-code-parser:build",
"//packages/kbn-babel-preset:build",
"//packages/kbn-cli-dev-mode:build",
"//packages/kbn-config-schema:build",
"//packages/kbn-config:build",
"//packages/kbn-crypto:build",
"//packages/kbn-dev-utils:build",
"//packages/kbn-doc-links:build",
"//packages/kbn-docs-utils:build",
"//packages/kbn-es-archiver:build",
"//packages/kbn-es-query:build",
"//packages/kbn-es:build",
"//packages/kbn-eslint-import-resolver-kibana:build",
"//packages/kbn-eslint-plugin-eslint:build",
"//packages/kbn-expect:build",
"//packages/kbn-field-types:build",
"//packages/kbn-flot-charts:build",
"//packages/kbn-generate:build",
"//packages/kbn-i18n-react:build",
"//packages/kbn-i18n:build",
"//packages/kbn-interpreter:build",
"//packages/kbn-io-ts-utils:build",
"//packages/kbn-logging-mocks:build",
"//packages/kbn-logging:build",
"//packages/kbn-mapbox-gl:build",
"//packages/kbn-monaco:build",
"//packages/kbn-optimizer:build",
"//packages/kbn-packages:build",
"//packages/kbn-plugin-generator:build",
"//packages/kbn-plugin-helpers:build",
"//packages/kbn-react-field:build",
"//packages/kbn-rule-data-utils:build",
"//packages/kbn-securitysolution-autocomplete:build",
"//packages/kbn-securitysolution-es-utils:build",
"//packages/kbn-securitysolution-hook-utils:build",
"//packages/kbn-securitysolution-io-ts-alerting-types:build",
"//packages/kbn-securitysolution-io-ts-list-types:build",
"//packages/kbn-securitysolution-io-ts-types:build",
"//packages/kbn-securitysolution-io-ts-utils:build",
"//packages/kbn-securitysolution-list-api:build",
"//packages/kbn-securitysolution-list-constants:build",
"//packages/kbn-securitysolution-list-hooks:build",
"//packages/kbn-securitysolution-list-utils:build",
"//packages/kbn-securitysolution-rules:build",
"//packages/kbn-securitysolution-t-grid:build",
"//packages/kbn-securitysolution-utils:build",
"//packages/kbn-server-http-tools:build",
"//packages/kbn-server-route-repository:build",
"//packages/kbn-spec-to-console:build",
"//packages/kbn-std:build",
"//packages/kbn-storybook:build",
"//packages/kbn-telemetry-tools:build",
"//packages/kbn-test-jest-helpers:build",
"//packages/kbn-test-subj-selector:build",
"//packages/kbn-test:build",
"//packages/kbn-timelion-grammar:build",
"//packages/kbn-tinymath:build",
"//packages/kbn-type-summarizer:build",
"//packages/kbn-typed-react-router-config:build",
"//packages/kbn-ui-framework:build",
"//packages/kbn-ui-shared-deps-npm:build",
"//packages/kbn-ui-shared-deps-src:build",
"//packages/kbn-ui-theme:build",
"//packages/kbn-utility-types:build",
"//packages/kbn-utils:build",
],
)

# It will build all declared package types
filegroup(
name = "build_pkg_types",
srcs = [
"//packages/elastic-apm-synthtrace:build_types",
"//packages/elastic-datemath:build_types",
"//packages/elastic-safer-lodash-set:build_types",
"//packages/kbn-ace:build_types",
"//packages/kbn-alerts:build_types",
"//packages/kbn-analytics:build_types",
"//packages/kbn-apm-config-loader:build_types",
"//packages/kbn-apm-utils:build_types",
"//packages/kbn-cli-dev-mode:build_types",
"//packages/kbn-config:build_types",
"//packages/kbn-config-schema:build_types",
"//packages/kbn-crypto:build_types",
"//packages/kbn-dev-utils:build_types",
"//packages/kbn-doc-links:build_types",
"//packages/kbn-docs-utils:build_types",
"//packages/kbn-es-archiver:build_types",
"//packages/kbn-es-query:build_types",
"//packages/kbn-field-types:build_types",
"//packages/kbn-i18n:build_types",
"//packages/kbn-i18n-react:build_types",
"//packages/kbn-interpreter:build_types",
"//packages/kbn-io-ts-utils:build_types",
"//packages/kbn-logging:build_types",
"//packages/kbn-logging-mocks:build_types",
"//packages/kbn-mapbox-gl:build_types",
"//packages/kbn-monaco:build_types",
"//packages/kbn-optimizer:build_types",
"//packages/kbn-plugin-generator:build_types",
"//packages/kbn-plugin-helpers:build_types",
"//packages/kbn-react-field:build_types",
"//packages/kbn-rule-data-utils:build_types",
"//packages/kbn-securitysolution-autocomplete:build_types",
"//packages/kbn-securitysolution-es-utils:build_types",
"//packages/kbn-securitysolution-hook-utils:build_types",
"//packages/kbn-securitysolution-io-ts-alerting-types:build_types",
"//packages/kbn-securitysolution-io-ts-list-types:build_types",
"//packages/kbn-securitysolution-io-ts-types:build_types",
"//packages/kbn-securitysolution-io-ts-utils:build_types",
"//packages/kbn-securitysolution-list-api:build_types",
"//packages/kbn-securitysolution-list-constants:build_types",
"//packages/kbn-securitysolution-list-hooks:build_types",
"//packages/kbn-securitysolution-list-utils:build_types",
"//packages/kbn-securitysolution-rules:build_types",
"//packages/kbn-securitysolution-t-grid:build_types",
"//packages/kbn-securitysolution-utils:build_types",
"//packages/kbn-server-http-tools:build_types",
"//packages/kbn-server-route-repository:build_types",
"//packages/kbn-std:build_types",
"//packages/kbn-storybook:build_types",
"//packages/kbn-telemetry-tools:build_types",
"//packages/kbn-test:build_types",
"//packages/kbn-test-jest-helpers:build_types",
"//packages/kbn-type-summarizer:build_types",
"//packages/kbn-typed-react-router-config:build_types",
"//packages/kbn-ui-shared-deps-npm:build_types",
"//packages/kbn-ui-shared-deps-src:build_types",
"//packages/kbn-ui-theme:build_types",
"//packages/kbn-utility-types:build_types",
"//packages/kbn-utils:build_types",
"//packages/elastic-apm-synthtrace:build_types",
"//packages/elastic-datemath:build_types",
"//packages/elastic-safer-lodash-set:build_types",
"//packages/kbn-ace:build_types",
"//packages/kbn-alerts:build_types",
"//packages/kbn-analytics:build_types",
"//packages/kbn-apm-config-loader:build_types",
"//packages/kbn-apm-utils:build_types",
"//packages/kbn-cli-dev-mode:build_types",
"//packages/kbn-config-schema:build_types",
"//packages/kbn-config:build_types",
"//packages/kbn-crypto:build_types",
"//packages/kbn-dev-utils:build_types",
"//packages/kbn-doc-links:build_types",
"//packages/kbn-docs-utils:build_types",
"//packages/kbn-es-archiver:build_types",
"//packages/kbn-es-query:build_types",
"//packages/kbn-field-types:build_types",
"//packages/kbn-generate:build_types",
"//packages/kbn-i18n-react:build_types",
"//packages/kbn-i18n:build_types",
"//packages/kbn-interpreter:build_types",
"//packages/kbn-io-ts-utils:build_types",
"//packages/kbn-logging-mocks:build_types",
"//packages/kbn-logging:build_types",
"//packages/kbn-mapbox-gl:build_types",
"//packages/kbn-monaco:build_types",
"//packages/kbn-optimizer:build_types",
"//packages/kbn-packages:build_types",
"//packages/kbn-plugin-generator:build_types",
"//packages/kbn-plugin-helpers:build_types",
"//packages/kbn-react-field:build_types",
"//packages/kbn-rule-data-utils:build_types",
"//packages/kbn-securitysolution-autocomplete:build_types",
"//packages/kbn-securitysolution-es-utils:build_types",
"//packages/kbn-securitysolution-hook-utils:build_types",
"//packages/kbn-securitysolution-io-ts-alerting-types:build_types",
"//packages/kbn-securitysolution-io-ts-list-types:build_types",
"//packages/kbn-securitysolution-io-ts-types:build_types",
"//packages/kbn-securitysolution-io-ts-utils:build_types",
"//packages/kbn-securitysolution-list-api:build_types",
"//packages/kbn-securitysolution-list-constants:build_types",
"//packages/kbn-securitysolution-list-hooks:build_types",
"//packages/kbn-securitysolution-list-utils:build_types",
"//packages/kbn-securitysolution-rules:build_types",
"//packages/kbn-securitysolution-t-grid:build_types",
"//packages/kbn-securitysolution-utils:build_types",
"//packages/kbn-server-http-tools:build_types",
"//packages/kbn-server-route-repository:build_types",
"//packages/kbn-std:build_types",
"//packages/kbn-storybook:build_types",
"//packages/kbn-telemetry-tools:build_types",
"//packages/kbn-test-jest-helpers:build_types",
"//packages/kbn-test:build_types",
"//packages/kbn-type-summarizer:build_types",
"//packages/kbn-typed-react-router-config:build_types",
"//packages/kbn-ui-shared-deps-npm:build_types",
"//packages/kbn-ui-shared-deps-src:build_types",
"//packages/kbn-ui-theme:build_types",
"//packages/kbn-utility-types:build_types",
"//packages/kbn-utils:build_types",
],
)



# Grouping target to call all underlying packages build
# targets so we can build them all at once
# It will auto build all declared code packages and types packages
filegroup(
name = "build",
srcs = [
":build_pkg_code",
":build_pkg_types"
":build_pkg_code",
":build_pkg_types"
],
)
7 changes: 5 additions & 2 deletions packages/kbn-dev-utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ NPM_MODULE_EXTRA_FILES = [
"README.md",
":certs",
"ci_stats_reporter/package.json",
"sort_package_json/package.json",
"stdio/package.json",
"tooling_log/package.json"
]

RUNTIME_DEPS = [
"//packages/kbn-utils",
"//packages/kbn-std",
"//packages/kbn-utils",
"@npm//@babel/core",
"@npm//axios",
"@npm//chalk",
Expand All @@ -59,15 +60,16 @@ RUNTIME_DEPS = [
"@npm//normalize-path",
"@npm//prettier",
"@npm//rxjs",
"@npm//sort-package-json",
"@npm//tar",
"@npm//tree-kill",
"@npm//vinyl",
"@npm//yauzl",
]

TYPES_DEPS = [
"//packages/kbn-utils:npm_module_types",
"//packages/kbn-std:npm_module_types",
"//packages/kbn-utils:npm_module_types",
"@npm//@babel/parser",
"@npm//@babel/types",
"@npm//@types/babel__core",
Expand All @@ -89,6 +91,7 @@ TYPES_DEPS = [
"@npm//exit-hook",
"@npm//getopts",
"@npm//rxjs",
"@npm//sort-package-json",
"@npm//tree-kill",
]

Expand Down
4 changes: 4 additions & 0 deletions packages/kbn-dev-utils/sort_package_json/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"main": "../target_node/sort_package_json",
"types": "../target_types/sort_package_json"
}
1 change: 1 addition & 0 deletions packages/kbn-dev-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ export * from './streams';
export * from './babel';
export * from './extract';
export * from './vscode_config';
export * from './sort_package_json';
Loading

0 comments on commit ad0eb60

Please sign in to comment.