Skip to content

Commit 94a4a41

Browse files
Merge branch '7.x' into backport/7.x/pr-78193
2 parents d628892 + c39243c commit 94a4a41

382 files changed

Lines changed: 13105 additions & 34092 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@
135135
"@kbn/telemetry-tools": "1.0.0",
136136
"@kbn/test-subj-selector": "0.2.1",
137137
"@kbn/ui-framework": "1.0.0",
138+
"@kbn/ace": "1.0.0",
139+
"@kbn/monaco": "1.0.0",
138140
"@kbn/ui-shared-deps": "1.0.0",
139141
"@types/yauzl": "^2.9.1",
140142
"JSONStream": "1.3.5",

packages/kbn-ace/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# @kbn/ace
2+
3+
Contains all Kibana-specific brace related code. Excluding the code that still inside of Console because that code is only used inside of console at the moment.
4+
5+
This package enables plugins to use this functionality and import it as needed -- behind an async import so that brace does not bloat the JS code needed for first page load of Kibana.

packages/kbn-ace/package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "@kbn/ace",
3+
"version": "1.0.0",
4+
"private": true,
5+
"main": "./target/index.js",
6+
"license": "Apache-2.0",
7+
"scripts": {
8+
"build": "node ./scripts/build.js",
9+
"kbn:bootstrap": "yarn build --dev"
10+
},
11+
"dependencies": {
12+
"brace": "0.11.1"
13+
},
14+
"devDependencies": {
15+
"@kbn/dev-utils": "1.0.0",
16+
"@kbn/babel-preset": "1.0.0",
17+
"raw-loader": "3.1.0",
18+
"typescript": "4.0.2"
19+
}
20+
}

packages/kbn-ace/scripts/build.js

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
const path = require('path');
21+
const del = require('del');
22+
const fs = require('fs');
23+
const supportsColor = require('supports-color');
24+
const { run } = require('@kbn/dev-utils');
25+
26+
const TARGET_BUILD_DIR = path.resolve(__dirname, '../target');
27+
const ROOT_DIR = path.resolve(__dirname, '../');
28+
const WORKER_PATH_SECTION = 'ace/modes/x_json/worker/x_json.ace.worker.js';
29+
30+
run(
31+
async ({ procRunner, log }) => {
32+
log.info('Deleting old output');
33+
34+
await del(TARGET_BUILD_DIR);
35+
36+
const cwd = ROOT_DIR;
37+
const env = { ...process.env };
38+
39+
if (supportsColor.stdout) {
40+
env.FORCE_COLOR = 'true';
41+
}
42+
43+
await procRunner.run('tsc ', {
44+
cmd: 'tsc',
45+
args: [],
46+
wait: true,
47+
env,
48+
cwd,
49+
});
50+
51+
log.success('Copying worker file to target.');
52+
53+
fs.copyFileSync(
54+
path.resolve(__dirname, '..', 'src', WORKER_PATH_SECTION),
55+
path.resolve(__dirname, '..', 'target', WORKER_PATH_SECTION)
56+
);
57+
58+
log.success('Complete');
59+
},
60+
{
61+
flags: {
62+
boolean: ['dev'],
63+
},
64+
}
65+
);

src/plugins/es_ui_shared/public/console_lang/ace/modes/index.ts renamed to packages/kbn-ace/src/ace/modes/index.ts

File renamed without changes.

src/plugins/es_ui_shared/public/console_lang/ace/modes/lexer_rules/elasticsearch_sql_highlight_rules.ts renamed to packages/kbn-ace/src/ace/modes/lexer_rules/elasticsearch_sql_highlight_rules.ts

File renamed without changes.

src/plugins/es_ui_shared/public/console_lang/ace/modes/lexer_rules/index.ts renamed to packages/kbn-ace/src/ace/modes/lexer_rules/index.ts

File renamed without changes.

src/plugins/es_ui_shared/public/console_lang/ace/modes/lexer_rules/script_highlight_rules.ts renamed to packages/kbn-ace/src/ace/modes/lexer_rules/script_highlight_rules.ts

File renamed without changes.

src/plugins/es_ui_shared/public/console_lang/ace/modes/lexer_rules/x_json_highlight_rules.ts renamed to packages/kbn-ace/src/ace/modes/lexer_rules/x_json_highlight_rules.ts

File renamed without changes.

src/plugins/es_ui_shared/public/console_lang/ace/modes/x_json/index.ts renamed to packages/kbn-ace/src/ace/modes/x_json/index.ts

File renamed without changes.

0 commit comments

Comments
 (0)