Skip to content

Commit

Permalink
Relocating module @kbn/monaco
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosant committed Jan 7, 2025
1 parent bf516e6 commit 2ed76e7
Show file tree
Hide file tree
Showing 162 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ snapshots.js
/packages/kbn-test/src/functional_test_runner/lib/config/__tests__/fixtures/
/packages/kbn-ui-framework/dist
/src/platform/packages/shared/kbn-flot-charts/lib
/packages/kbn-monaco/src/**/antlr
/src/platform/packages/shared/kbn-monaco/src/**/antlr
/src/platform/packages/shared/kbn-esql-ast/src/**/antlr

# Bazel
Expand Down
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ packages/kbn-management/storybook/config @elastic/kibana-management
packages/kbn-manifest @elastic/kibana-core
packages/kbn-mock-idp-plugin @elastic/kibana-security
packages/kbn-mock-idp-utils @elastic/kibana-security
packages/kbn-monaco @elastic/appex-sharedux
packages/kbn-object-versioning @elastic/appex-sharedux
packages/kbn-object-versioning-utils @elastic/appex-sharedux
packages/kbn-openapi-bundler @elastic/security-detection-rule-management
Expand Down Expand Up @@ -505,6 +504,7 @@ src/platform/packages/shared/kbn-management/settings/components/field_row @elast
src/platform/packages/shared/kbn-management/settings/field_definition @elastic/kibana-management
src/platform/packages/shared/kbn-management/settings/types @elastic/kibana-management
src/platform/packages/shared/kbn-management/settings/utilities @elastic/kibana-management
src/platform/packages/shared/kbn-monaco @elastic/appex-sharedux
src/platform/packages/shared/kbn-openapi-common @elastic/security-detection-rule-management
src/platform/packages/shared/kbn-osquery-io-ts-types @elastic/security-asset-management
src/platform/packages/shared/kbn-profiling-utils @elastic/obs-ux-infra_services-team
Expand Down Expand Up @@ -1206,7 +1206,7 @@ src/platform/plugins/shared/discover/public/context_awareness/profile_providers/
/test/api_integration/apis/event_annotations @elastic/kibana-visualizations
/x-pack/test_serverless/functional/test_suites/common/visualizations/ @elastic/kibana-visualizations
/x-pack/test_serverless/functional/fixtures/kbn_archiver/lens/ @elastic/kibana-visualizations
packages/kbn-monaco/src/esql @elastic/kibana-esql
src/platform/packages/shared/kbn-monaco/src/esql @elastic/kibana-esql

# ESQL
/test/api_integration/apis/esql/*.ts @elastic/kibana-esql
Expand Down
2 changes: 1 addition & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"src/platform/packages/shared/kbn-management",
"packages/kbn-management"
],
"monaco": "packages/kbn-monaco/src",
"monaco": "src/platform/packages/shared/kbn-monaco/src",
"navigation": ["src/platform/plugins/shared/navigation", "packages/solution-nav"],
"links": "src/platform/plugins/private/links",
"newsfeed": "src/platform/plugins/shared/newsfeed",
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 @@ -22,7 +22,7 @@ const BAZEL_RUNNER_SRC = '../../../packages/kbn-bazel-runner/index.js';
const BAZEL_TARGETS = [
'//src/platform/packages/private/kbn-ui-shared-deps-npm:shared_built_assets',
'//src/platform/packages/private/kbn-ui-shared-deps-src:shared_built_assets',
'//packages/kbn-monaco:target_workers',
'//src/platform/packages/shared/kbn-monaco:target_workers',
];

async function getBazelRunner() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@
"@kbn/ml-ui-actions": "link:x-pack/platform/packages/private/ml/ui_actions",
"@kbn/ml-url-state": "link:x-pack/platform/packages/private/ml/url_state",
"@kbn/ml-validators": "link:x-pack/platform/packages/private/ml/validators",
"@kbn/monaco": "link:packages/kbn-monaco",
"@kbn/monaco": "link:src/platform/packages/shared/kbn-monaco",
"@kbn/monitoring-collection-plugin": "link:x-pack/platform/plugins/private/monitoring_collection",
"@kbn/monitoring-plugin": "link:x-pack/platform/plugins/private/monitoring",
"@kbn/navigation-plugin": "link:src/platform/plugins/shared/navigation",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-plugin-helpers/src/tasks/bazel_packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function buildBazelPackages({ log, dist }: TaskContext) {
'build',
'//src/platform/packages/private/kbn-ui-shared-deps-npm:shared_built_assets',
'//src/platform/packages/private/kbn-ui-shared-deps-src:shared_built_assets',
'//packages/kbn-monaco:target_workers',
'//src/platform/packages/shared/kbn-monaco:target_workers',
'--show_result=1',
].concat(dist ? [`--define=dist=true`] : []),
{
Expand Down
2 changes: 1 addition & 1 deletion src/dev/build/tasks/build_packages_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const BuildPackages: Task = {
'build',
'//src/platform/packages/private/kbn-ui-shared-deps-npm:shared_built_assets',
'//src/platform/packages/private/kbn-ui-shared-deps-src:shared_built_assets',
'//packages/kbn-monaco:target_workers',
'//src/platform/packages/shared/kbn-monaco:target_workers',
'--show_result=1',
'--define=dist=true',
],
Expand Down
2 changes: 1 addition & 1 deletion src/platform/packages/private/kbn-esql-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Contains the editor for text based languages. Specifically for:
---

Contains the ESQL editor with the autocomplete and the autosuggest functionality (based on atlr).
The antlr code can be found in packages/kbn-monaco/src/esql
The antlr code can be found in src/platform/packages/shared/kbn-monaco/src/esql

A **monaco** based editor that is part of the unified search experience. It is rendered for all the applications that support text-based languages.
In order to enable text based languages on your unified search bar add `textBasedLanguages: ['ESQL', '...']` to the dataViewPicker properties.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ webpack_cli(
"//src/platform/packages/shared/kbn-i18n-react",
"//src/platform/packages/shared/kbn-ebt-tools",
"//src/platform/packages/shared/kbn-esql-ast",
"//packages/kbn-monaco",
"//src/platform/packages/shared/kbn-monaco",
"//src/platform/packages/shared/kbn-datemath",
"//src/platform/packages/shared/kbn-analytics",
"//src/platform/packages/shared/kbn-crypto-browser",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-monaco'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/platform/packages/shared/kbn-monaco'],
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('ESQL Theme', () => {
const theme = buildESQLTheme(mockTheme);

// These names aren't from the lexer... they are added on our side
// see packages/kbn-monaco/src/esql/lib/esql_token_helpers.ts
// see src/platform/packages/shared/kbn-monaco/src/esql/lib/esql_token_helpers.ts
const syntheticNames = ['functions', 'nulls_order', 'timespan_literal'];

const rulesWithNoName: string[] = [];
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/platform/plugins/shared/console/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ POST /_some_endpoint
```

## Architecture
Console uses Monaco editor that is wrapped with [`kbn-monaco`](https://github.com/elastic/kibana/blob/main/packages/kbn-monaco/index.ts), so that if needed it can easily be replaced with another editor.
Console uses Monaco editor that is wrapped with [`kbn-monaco`](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-monaco/index.ts), so that if needed it can easily be replaced with another editor.
The autocomplete logic is located in [`autocomplete`](https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/console/public/lib/autocomplete) folder. Autocomplete rules are computed by classes in `components` sub-folder.

## Autocomplete definitions
Expand Down
4 changes: 2 additions & 2 deletions test/functional/services/monaco_editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class MonacoEditorService extends FtrService {
await this.retry.try(async () => {
values = await this.browser.execute(
() =>
// @ts-expect-error this value is provided in @kbn/monaco for this specific purpose, see {@link packages/kbn-monaco/src/register_globals.ts}
// @ts-expect-error this value is provided in @kbn/monaco for this specific purpose, see {@link src/platform/packages/shared/kbn-monaco/src/register_globals.ts}
(window.MonacoEnvironment?.monaco.editor as typeof monaco.editor)
.getModels()
.map((model: any) => model.getValue()) as string[]
Expand All @@ -48,7 +48,7 @@ export class MonacoEditorService extends FtrService {
await this.retry.try(async () => {
await this.browser.execute(
(editorIndex, codeEditorValue) => {
// @ts-expect-error this value is provided in @kbn/monaco for this specific purpose, see {@link packages/kbn-monaco/src/register_globals.ts}
// @ts-expect-error this value is provided in @kbn/monaco for this specific purpose, see {@link src/platform/packages/shared/kbn-monaco/src/register_globals.ts}
const editor = window.MonacoEnvironment?.monaco.editor as typeof monaco.editor;
const textModels = editor.getModels();

Expand Down
4 changes: 2 additions & 2 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1298,8 +1298,8 @@
"@kbn/mock-idp-plugin/*": ["packages/kbn-mock-idp-plugin/*"],
"@kbn/mock-idp-utils": ["packages/kbn-mock-idp-utils"],
"@kbn/mock-idp-utils/*": ["packages/kbn-mock-idp-utils/*"],
"@kbn/monaco": ["packages/kbn-monaco"],
"@kbn/monaco/*": ["packages/kbn-monaco/*"],
"@kbn/monaco": ["src/platform/packages/shared/kbn-monaco"],
"@kbn/monaco/*": ["src/platform/packages/shared/kbn-monaco/*"],
"@kbn/monitoring-collection-plugin": ["x-pack/platform/plugins/private/monitoring_collection"],
"@kbn/monitoring-collection-plugin/*": ["x-pack/platform/plugins/private/monitoring_collection/*"],
"@kbn/monitoring-plugin": ["x-pack/platform/plugins/private/monitoring"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const INGEST_PIPELINE_PAINLESS_CONTEXT = 'ctx' as const as SafePainlessExpressio
* - Subsequent characters can be underscores, letters, or digits.
*
* This is the ID and DOTID regexp in the Painless grammar under the following link:
* @link packages/kbn-monaco/src/painless/antlr/painless_parser.g4
* @link src/platform/packages/shared/kbn-monaco/src/painless/antlr/painless_parser.g4
*/
const PAINLESS_IDENTIFIER_REGEXP = /^[_a-zA-Z][_a-zA-Z0-9]*$/;

Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6449,7 +6449,7 @@
version "0.0.0"
uid ""

"@kbn/monaco@link:packages/kbn-monaco":
"@kbn/monaco@link:src/platform/packages/shared/kbn-monaco":
version "0.0.0"
uid ""

Expand Down

0 comments on commit 2ed76e7

Please sign in to comment.