Skip to content

Commit

Permalink
chore(NA): remove src folder requirement from packages (part 2) (#138476
Browse files Browse the repository at this point in the history
)

* refact(NA): apply root_input_dir=src to each already created pkg

* refact(NA): update package generator

* fix(NA): correctly use rootDir

* fix(NA): use root input dir on latest introduced pkgs for jsts_transpiler macro

* chore(NA): merge with main

* chore(NA): first attempt to complete removal of src folder on a small group of pkgs

* Revert "chore(NA): first attempt to complete removal of src folder on a small group of pkgs"

This reverts commit b6f34b7.

* chore(NA): remove src folder requirement from xpack pkgs

* chore(NA): remove src folder from analytics pkgs

* chore(NA): remove src folder from home pkgs

* chore(NA): remove src folder from shared_ux pkgs

* fix(NA): remove missing src folder inputs on sharedux pkg

* chore(NA): remove src folder from kbn-a* pkgs

* chore(NA): remove src folder from kbn-b* pkgs

* chore(NA): remove src folder from kbn-c* pkgs

* chore(NA): correct exclude pattern for each changed pkg

* chore(NA): remove src folder from kbn-y* pkgs

* chore(NA): remove src folder from kbn-e* pkgs

* chore(NA): remove src folder from kbn-f* and kbn-g* pkgs

* chore(NA): remove src folder from kbn-f* and kbn-g* pkgs

* chore(NA): remove src folder from kbn-h** pkgs

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Revert "chore(NA): remove src folder from kbn-h** pkgs"

This reverts commit dcdf72b.

* fix(NA): grammar location

* test(NA): fix tests for kbn/config-schema

* test(NA): fix tests for kbn/config-schema

* chore(NA): multiple errors fixed

* chore(NA): remove kuery grammar fix

* fix(NA): @kbn/ace imports

* fix(NA): grammar location

* fix(NA): add missing files to tsconfigs

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* chore(NA): complete tsconfigs

* Revert "chore(NA): complete tsconfigs"

This reverts commit f48c616.

* chore(NA): remove src folder from kbn-core* pkgs

* chore(NA): remove src folder from kbn-u* pkgs

* chore(NA): remove src folder from kbn-ui-shared-deps* pkgs

* chore(NA): fix problems on core pkgs

* chore(NA): fix problems on core pkgs

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* fix(NA): shared_built_assets correct location'

* test(NA): update @kbn/optimizer integration snapshots

* chore(NA): remove src folder from kbn-t* p1 pkgs

* chore(NA): remove src folder from kbn-t* p2 pkgs

* chore(NA): update rootDir on utility types pkg

* chore(NA): include missing files on @kbn/test

* chore(NA): include missing files on @kbn/test

* fix(NA): new jest preset paths on @kbn/test

* chore(NA): fix eslint

* fix(NA): new jest preset paths on @kbn/test

* chore(NA): remove exclusion for mocks folde on @kbn/test

* fix(NA): several imports from target_node

* fix(NA): @kbn/test mocha and jest types clash

* chore(NA): remove src folder from kbn-storybook pkg

* chore(NA): remove src folder from kbn-stdio-dev-helpers pkg

* chore(NA): remove src folder from kbn-std pkg

* chore(NA): remove src folder from kbn-sort-pkg-json pkg

* chore(NA): remove src folder from kbn-some-dev-log and kbn-shared-ux-utility pkgs

* chore(NA): remove src folder from kbn-ux-storybook pkg

* chore(NA): remove src folder from kbn-shared-ux-services pkg

* chore(NA): remove src folder from kbn-shared-ux-components pkg

* chore(NA): remove src folder from kbn-shared-svg pkg

* chore(NA): remove src folder from kbn-server-http-tools pkg

* chore(NA): remove src folder from kbn-securitysolution-* pkgs

* chore(NA): remove src folder from kbn-r-* pkgs

* chore(NA): remove src folder from kbn-p* pkgs

* chore(NA): remove src folder from kbn-o* pkgs

* chore(NA): remove src folder from kbn-m* pkgs

* chore(NA): remove src folder from kbn-j,k,l* pkgs

* chore(NA): remove src folder from kbn-j,k,l* pkgs

* chore(NA): remove src folder from kbn-io-ts-utils* pkgs

* chore(NA): remove src folder from kbn-* pkgs except a few

* chore(NA): update @kbn/generate

* fix(NA): wrong exclusion on kbn-storybook

* chore(NA): remove src folder from kbn-monaco pkg

* chore(NA): remove src folder from kbn-interpreter pkg

* fix(NA): wrong exclusion on kbn-storybook

* chore(NA): update every require for target_*/src

* chore(NA): remover src folder from @kbn/handlebars

* fix(NA): license for @kbn/handlebars

* chore(NA): copy templates as part of the jsts_transpiler macro for @kbn/storybook

* chore(NA): update handlebars

* fix(NA): @kbn/plugin-generator import paths

* fix(NA): bundle sizes

* fix(NA): web bundle for @kbn/i18n-react

* Revert "fix(NA): bundle sizes"

This reverts commit 8aefe84.

* Revert "Revert "fix(NA): bundle sizes""

This reverts commit e9d87d7.

* fix(NA): @kbn/docs-utils index.ts path expectation

* chore(NA): merge and solve conflicts with main

* fix(NA): relative import to index

* chore(NA): merge and solve conflicts with main

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* chore(NA): apply eslint fix

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
mistic and kibanamachine authored Aug 30, 2022
1 parent 8d888be commit 1cbf83f
Show file tree
Hide file tree
Showing 969 changed files with 5,040 additions and 3,660 deletions.
2 changes: 1 addition & 1 deletion docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ NOTE:

node scripts/build_plugin_list_docs

You can update the template within node_modules/@kbn/dev-utils/target_node/plugin_list/generate_plugin_list.js
You can update the template within node_modules/@kbn/dev-utils/target_node/src/plugin_list/generate_plugin_list.js

////
Expand Down
2 changes: 1 addition & 1 deletion kbn_pm/src/commands/bootstrap/plugins.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { REPO_ROOT } from '../../lib/paths.mjs';

/** @type {string} */
const PLUGIN_DISCOVERY_SRC = '../../../../packages/kbn-plugin-discovery/src/index.js';
const PLUGIN_DISCOVERY_SRC = '../../../../packages/kbn-plugin-discovery/index.js';

/**
* @param {string} pluginId
Expand Down
2 changes: 1 addition & 1 deletion kbn_pm/src/lib/bazel.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { REPO_ROOT } from './paths.mjs';
import { cleanPaths } from './clean.mjs';
import { indent } from './indent.mjs';

const BAZEL_RUNNER_SRC = '../../../packages/kbn-bazel-runner/src/index.js';
const BAZEL_RUNNER_SRC = '../../../packages/kbn-bazel-runner/index.js';

async function getBazelRunner() {
/* eslint-disable no-unsanitized/method */
Expand Down
15 changes: 11 additions & 4 deletions packages/analytics/client/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@ PKG_REQUIRE_NAME = "@kbn/analytics-client"

SOURCE_FILES = glob(
[
"src/**/*.ts",
"**/*.ts",
],
exclude = [
"**/*.config.js",
"**/*.mock.*",
"**/*.test.*",
"**/*.stories.*",
"**/__snapshots__/**",
"**/integration_tests/**",
"**/mocks/**",
"**/scripts/**",
"**/storybook/**",
"**/test_fixtures/**",
"**/test_helpers/**",
],
)

Expand Down Expand Up @@ -64,14 +74,12 @@ jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
root_input_dir = "src",
)

jsts_transpiler(
name = "target_web",
srcs = SRCS,
build_pkg_name = package_name(),
root_input_dir = "src",
web = True,
)

Expand All @@ -93,7 +101,6 @@ ts_project(
declaration_map = True,
emit_declaration_only = True,
out_dir = "target_types",
root_dir = "src",
tsconfig = ":tsconfig",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import type {
AnalyticsClientInitContext,
IAnalyticsClient as AnalyticsClient,
} from './analytics_client';
import { AnalyticsClient as AnalyticsClientClass } from './analytics_client';
} from './src/analytics_client';
import { AnalyticsClient as AnalyticsClientClass } from './src/analytics_client';

/**
* Creates an {@link AnalyticsClient}.
Expand All @@ -35,15 +35,15 @@ export type {
ContextProviderOpts,
// Types for the registerEventType API
EventTypeOpts,
} from './analytics_client';
} from './src/analytics_client';

export type {
Event,
EventContext,
EventType,
TelemetryCounter,
TelemetryCounterType,
} from './events';
} from './src/events';

export type {
RootSchema,
Expand All @@ -58,6 +58,6 @@ export type {
AllowedSchemaNumberTypes,
AllowedSchemaStringTypes,
AllowedSchemaTypes,
} from './schema';
} from './src/schema';

export type { IShipper } from './shippers';
export type { IShipper } from './src/shippers';
3 changes: 1 addition & 2 deletions packages/analytics/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "target_types",
"rootDir": "src",
"stripInternal": false,
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*"
"**/*.ts"
]
}
15 changes: 11 additions & 4 deletions packages/analytics/shippers/elastic_v3/browser/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@ PKG_REQUIRE_NAME = "@kbn/analytics-shippers-elastic-v3-browser"

SOURCE_FILES = glob(
[
"src/**/*.ts",
"**/*.ts",
],
exclude = [
"**/*.config.js",
"**/*.mock.*",
"**/*.test.*",
"**/*.stories.*",
"**/__snapshots__/**",
"**/integration_tests/**",
"**/mocks/**",
"**/scripts/**",
"**/storybook/**",
"**/test_fixtures/**",
"**/test_helpers/**",
],
)

Expand Down Expand Up @@ -63,15 +73,13 @@ jsts_transpiler(
name = "target_web",
srcs = SRCS,
build_pkg_name = package_name(),
root_input_dir = "src",
web = True,
)

jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
root_input_dir = "src",
)

ts_config(
Expand All @@ -92,7 +100,6 @@ ts_project(
declaration_map = True,
emit_declaration_only = True,
out_dir = "target_types",
root_dir = "src",
tsconfig = ":tsconfig",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
*/

export type { ElasticV3ShipperOptions } from '@kbn/analytics-shippers-elastic-v3-common';
export { ElasticV3ServerShipper } from './server_shipper';
export { ElasticV3BrowserShipper } from './src/browser_shipper';
3 changes: 1 addition & 2 deletions packages/analytics/shippers/elastic_v3/browser/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "target_types",
"rootDir": "src",
"stripInternal": false,
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*"
"**/*.ts"
]
}
15 changes: 11 additions & 4 deletions packages/analytics/shippers/elastic_v3/common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@ PKG_REQUIRE_NAME = "@kbn/analytics-shippers-elastic-v3-common"

SOURCE_FILES = glob(
[
"src/**/*.ts",
"**/*.ts",
],
exclude = [
"**/*.config.js",
"**/*.mock.*",
"**/*.test.*",
"**/*.stories.*",
"**/__snapshots__/**",
"**/integration_tests/**",
"**/mocks/**",
"**/scripts/**",
"**/storybook/**",
"**/test_fixtures/**",
"**/test_helpers/**",
],
)

Expand Down Expand Up @@ -59,14 +69,12 @@ jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
root_input_dir = "src",
)

jsts_transpiler(
name = "target_web",
srcs = SRCS,
build_pkg_name = package_name(),
root_input_dir = "src",
web = True,
)

Expand All @@ -88,7 +96,6 @@ ts_project(
declaration_map = True,
emit_declaration_only = True,
out_dir = "target_types",
root_dir = "src",
tsconfig = ":tsconfig",
)

Expand Down
15 changes: 15 additions & 0 deletions packages/analytics/shippers/elastic_v3/common/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* 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 { buildHeaders } from './src/build_headers';
export { buildUrl } from './src/build_url';
export type { BuildUrlOptions } from './src/build_url';
export { ErrorWithCode } from './src/error_with_code';
export { eventsToNDJSON } from './src/events_to_ndjson';
export { createTelemetryCounterHelper } from './src/report_telemetry_counters';
export type { ElasticV3ShipperOptions } from './src/types';
15 changes: 0 additions & 15 deletions packages/analytics/shippers/elastic_v3/common/src/index.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/analytics/shippers/elastic_v3/common/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "target_types",
"rootDir": "src",
"stripInternal": false,
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*"
"**/*.ts"
]
}
14 changes: 11 additions & 3 deletions packages/analytics/shippers/elastic_v3/server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@ PKG_REQUIRE_NAME = "@kbn/analytics-shippers-elastic-v3-server"

SOURCE_FILES = glob(
[
"src/**/*.ts",
"**/*.ts",
],
exclude = [
"**/*.config.js",
"**/*.mock.*",
"**/*.test.*",
"**/*.stories.*",
"**/__snapshots__/**",
"**/integration_tests/**",
"**/mocks/**",
"**/scripts/**",
"**/storybook/**",
"**/test_fixtures/**",
"**/test_helpers/**",
],
)

Expand Down Expand Up @@ -65,7 +75,6 @@ jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
root_input_dir = "src",
)

ts_config(
Expand All @@ -86,7 +95,6 @@ ts_project(
declaration_map = True,
emit_declaration_only = True,
out_dir = "target_types",
root_dir = "src",
tsconfig = ":tsconfig",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
*/

export type { ElasticV3ShipperOptions } from '@kbn/analytics-shippers-elastic-v3-common';
export { ElasticV3BrowserShipper } from './browser_shipper';
export { ElasticV3ServerShipper } from './src/server_shipper';
3 changes: 1 addition & 2 deletions packages/analytics/shippers/elastic_v3/server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "target_types",
"rootDir": "src",
"stripInternal": false,
"types": [
"jest",
"node"
]
},
"include": [
"src/**/*"
"**/*.ts"
]
}
15 changes: 11 additions & 4 deletions packages/analytics/shippers/fullstory/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@ PKG_REQUIRE_NAME = "@kbn/analytics-shippers-fullstory"

SOURCE_FILES = glob(
[
"src/**/*.ts",
"**/*.ts",
],
exclude = [
"**/*.config.js",
"**/*.mock.*",
"**/*.test.*",
"**/*.stories.*",
"**/__snapshots__/**",
"**/integration_tests/**",
"**/mocks/**",
"**/scripts/**",
"**/storybook/**",
"**/test_fixtures/**",
"**/test_helpers/**",
],
)

Expand Down Expand Up @@ -60,14 +70,12 @@ jsts_transpiler(
name = "target_node",
srcs = SRCS,
build_pkg_name = package_name(),
root_input_dir = "src",
)

jsts_transpiler(
name = "target_web",
srcs = SRCS,
build_pkg_name = package_name(),
root_input_dir = "src",
web = True,
)

Expand All @@ -89,7 +97,6 @@ ts_project(
declaration_map = True,
emit_declaration_only = True,
out_dir = "target_types",
root_dir = "src",
tsconfig = ":tsconfig",
)

Expand Down
Loading

0 comments on commit 1cbf83f

Please sign in to comment.