Skip to content

Commit 7ac79fd

Browse files
author
Liza K
committed
Merge remote-tracking branch 'upstream/master' into newplatform/data/search-msearch
2 parents 487c64e + 9567cca commit 7ac79fd

File tree

128 files changed

+1600
-921
lines changed

Some content is hidden

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

128 files changed

+1600
-921
lines changed

docs/development/core/server/kibana-plugin-server.discoveredplugin.configpath.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## DiscoveredPlugin.configPath property
66

7-
Root configuration path used by the plugin, defaults to "id".
7+
Root configuration path used by the plugin, defaults to "id" in snake\_case format.
88

99
<b>Signature:</b>
1010

docs/development/core/server/kibana-plugin-server.discoveredplugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface DiscoveredPlugin
1616

1717
| Property | Type | Description |
1818
| --- | --- | --- |
19-
| [configPath](./kibana-plugin-server.discoveredplugin.configpath.md) | <code>ConfigPath</code> | Root configuration path used by the plugin, defaults to "id". |
19+
| [configPath](./kibana-plugin-server.discoveredplugin.configpath.md) | <code>ConfigPath</code> | Root configuration path used by the plugin, defaults to "id" in snake\_case format. |
2020
| [id](./kibana-plugin-server.discoveredplugin.id.md) | <code>PluginName</code> | Identifier of the plugin. |
2121
| [optionalPlugins](./kibana-plugin-server.discoveredplugin.optionalplugins.md) | <code>readonly PluginName[]</code> | An optional list of the other plugins that if installed and enabled \*\*may be\*\* leveraged by this plugin for some additional functionality but otherwise are not required for this plugin to work properly. |
2222
| [requiredPlugins](./kibana-plugin-server.discoveredplugin.requiredplugins.md) | <code>readonly PluginName[]</code> | An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly. |

docs/development/core/server/kibana-plugin-server.pluginmanifest.configpath.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44

55
## PluginManifest.configPath property
66

7-
Root [configuration path](./kibana-plugin-server.configpath.md) used by the plugin, defaults to "id".
7+
Root [configuration path](./kibana-plugin-server.configpath.md) used by the plugin, defaults to "id" in snake\_case format.
88

99
<b>Signature:</b>
1010

1111
```typescript
1212
readonly configPath: ConfigPath;
1313
```
14+
15+
## Example
16+
17+
id: myPlugin configPath: my\_plugin
18+

docs/development/core/server/kibana-plugin-server.pluginmanifest.id.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## PluginManifest.id property
66

7-
Identifier of the plugin.
7+
Identifier of the plugin. Must be a string in camelCase. Part of a plugin public contract. Other plugins leverage it to access plugin API, navigate to the plugin, etc.
88

99
<b>Signature:</b>
1010

docs/development/core/server/kibana-plugin-server.pluginmanifest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Should never be used in code outside of Core but is exported for documentation p
2020

2121
| Property | Type | Description |
2222
| --- | --- | --- |
23-
| [configPath](./kibana-plugin-server.pluginmanifest.configpath.md) | <code>ConfigPath</code> | Root [configuration path](./kibana-plugin-server.configpath.md) used by the plugin, defaults to "id". |
24-
| [id](./kibana-plugin-server.pluginmanifest.id.md) | <code>PluginName</code> | Identifier of the plugin. |
23+
| [configPath](./kibana-plugin-server.pluginmanifest.configpath.md) | <code>ConfigPath</code> | Root [configuration path](./kibana-plugin-server.configpath.md) used by the plugin, defaults to "id" in snake\_case format. |
24+
| [id](./kibana-plugin-server.pluginmanifest.id.md) | <code>PluginName</code> | Identifier of the plugin. Must be a string in camelCase. Part of a plugin public contract. Other plugins leverage it to access plugin API, navigate to the plugin, etc. |
2525
| [kibanaVersion](./kibana-plugin-server.pluginmanifest.kibanaversion.md) | <code>string</code> | The version of Kibana the plugin is compatible with, defaults to "version". |
2626
| [optionalPlugins](./kibana-plugin-server.pluginmanifest.optionalplugins.md) | <code>readonly PluginName[]</code> | An optional list of the other plugins that if installed and enabled \*\*may be\*\* leveraged by this plugin for some additional functionality but otherwise are not required for this plugin to work properly. |
2727
| [requiredPlugins](./kibana-plugin-server.pluginmanifest.requiredplugins.md) | <code>readonly PluginName[]</code> | An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly. |

src/core/CONVENTIONS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ my_plugin/
3838
   ├── index.ts
3939
   └── plugin.ts
4040
```
41+
- [Manifest file](/docs/development/core/server/kibana-plugin-server.pluginmanifest.md) should be defined on top level.
4142
- Both `server` and `public` should have an `index.ts` and a `plugin.ts` file:
4243
- `index.ts` should only contain:
4344
- The `plugin` export

src/core/server/config/integration_tests/config_deprecation.test.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,13 @@ describe('configuration deprecations', () => {
3636
await root.setup();
3737

3838
const logs = loggingServiceMock.collect(mockLoggingService);
39-
expect(logs.warn).toMatchInlineSnapshot(`Array []`);
39+
const warnings = logs.warn.flatMap(i => i);
40+
expect(warnings).not.toContain(
41+
'"optimize.lazy" is deprecated and has been replaced by "optimize.watch"'
42+
);
43+
expect(warnings).not.toContain(
44+
'"optimize.lazyPort" is deprecated and has been replaced by "optimize.watchPort"'
45+
);
4046
});
4147

4248
it('should log deprecation warnings for core deprecations', async () => {
@@ -50,15 +56,12 @@ describe('configuration deprecations', () => {
5056
await root.setup();
5157

5258
const logs = loggingServiceMock.collect(mockLoggingService);
53-
expect(logs.warn).toMatchInlineSnapshot(`
54-
Array [
55-
Array [
56-
"\\"optimize.lazy\\" is deprecated and has been replaced by \\"optimize.watch\\"",
57-
],
58-
Array [
59-
"\\"optimize.lazyPort\\" is deprecated and has been replaced by \\"optimize.watchPort\\"",
60-
],
61-
]
62-
`);
59+
const warnings = logs.warn.flatMap(i => i);
60+
expect(warnings).toContain(
61+
'"optimize.lazy" is deprecated and has been replaced by "optimize.watch"'
62+
);
63+
expect(warnings).toContain(
64+
'"optimize.lazyPort" is deprecated and has been replaced by "optimize.watchPort"'
65+
);
6366
});
6467
});
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
import { isCamelCase } from './is_camel_case';
21+
22+
describe('isCamelCase', () => {
23+
it('matches a string in camelCase', () => {
24+
expect(isCamelCase('foo')).toBe(true);
25+
expect(isCamelCase('foo1')).toBe(true);
26+
expect(isCamelCase('fooBar')).toBe(true);
27+
expect(isCamelCase('fooBarBaz')).toBe(true);
28+
expect(isCamelCase('fooBAR')).toBe(true);
29+
});
30+
31+
it('does not match strings in other cases', () => {
32+
expect(isCamelCase('AAA')).toBe(false);
33+
expect(isCamelCase('FooBar')).toBe(false);
34+
expect(isCamelCase('3Foo')).toBe(false);
35+
expect(isCamelCase('o_O')).toBe(false);
36+
expect(isCamelCase('foo_bar')).toBe(false);
37+
expect(isCamelCase('foo_')).toBe(false);
38+
expect(isCamelCase('_fooBar')).toBe(false);
39+
expect(isCamelCase('fooBar_')).toBe(false);
40+
expect(isCamelCase('_fooBar_')).toBe(false);
41+
});
42+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
const camelCaseRegExp = /^[a-z]{1}([a-zA-Z0-9]{1,})$/;
20+
export function isCamelCase(candidate: string) {
21+
return camelCaseRegExp.test(candidate);
22+
}

0 commit comments

Comments
 (0)