Skip to content

Commit

Permalink
[Rename] missing elastic and kibana references (#37) (#209)
Browse files Browse the repository at this point in the history
* [Rename] missing elastic and kibana references (#37)

Signed-off-by: Bishoy Boktor <[email protected]>

* Address PR comments

Signed-off-by: Bishoy Boktor <[email protected]>

* Address PR comments

Signed-off-by: Bishoy Boktor <[email protected]>
  • Loading branch information
boktorbb authored Mar 22, 2021
1 parent 6b90a62 commit 167e907
Show file tree
Hide file tree
Showing 41 changed files with 364 additions and 370 deletions.
3 changes: 2 additions & 1 deletion examples/bfetch_explorer/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ export class BfetchExplorerPlugin implements Plugin {
links: [
{
label: 'README',
href: 'https://github.com/elastic/kibana/blob/master/src/plugins/bfetch/README.md',
href:
'https://github.com/opensearch-project/OpenSearch-Dashboards/blob/master/src/plugins/bfetch/README.md',
iconType: 'logoGithub',
size: 's',
target: '_blank',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"number": 8467,
"sha": "6cb7fec4e154faa0a4a3fee4b33dfef91b9870d9"
},
"homepage": "https://www.elastic.co/products/kibana",
"homepage": "https://www.opensearch.co/products/kibana",
"bugs": {
"url": "http://github.com/elastic/kibana/issues"
"url": "http://github.com/opensearch-project/OpenSearch-Dashboards/issues"
},
"opensearchDashboards": {
"clean": {
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-plugin-generator/template/README.md.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Development

See the [kibana contributing
See the [OpenSearch Dashboards contributing
guide](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/master/CONTRIBUTING.md) for instructions
setting up your development environment.

Expand Down
6 changes: 3 additions & 3 deletions packages/osd-storybook/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Kibana Storybook
# OpenSearch Dashboards Storybook

This package provides ability to add [Storybook](https://storybook.js.org/) to any Kibana plugin.
This package provides ability to add [Storybook](https://storybook.js.org/) to any OpenSearch Dashboards plugin.

- [Kibana Storybook](#opensearch-dashboards-storybook)
- [OpenSearch Dashboards Storybook](#opensearch-dashboards-storybook)
- [Setup Instructions](#setup-instructions)
- [Customizing configuration](#customizing-configuration)

Expand Down
101 changes: 56 additions & 45 deletions packages/osd-storybook/lib/templates/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,67 @@
We use this one instead because we want to add the @osd/ui-shared-deps tags here.
-->
<html lang="en">
<head>
<meta charset="utf-8" />
<title><%= options.title || 'Storybook'%></title>

<% if (files.favicon) { %>
<head>
<meta charset="utf-8" />
<title>
<%= options.title || 'Storybook' %>
</title>

<% if (files.favicon) { %>
<link rel="shortcut icon" href="<%= files.favicon%>" />
<% } %>

<meta name="viewport" content="width=device-width, initial-scale=1" />

<!-- Added for Kibana shared dependencies -->
<script>
window.__osdPublicPath__ = { 'osd-ui-shared-deps': '/' };
</script>
<script src="/[email protected]"></script>
<script src="/osd-ui-shared-deps.js"></script>
<link href="/osd-ui-shared-deps.css" rel="stylesheet" />
<link href="/osd-ui-shared-deps.v7.light.css" rel="stylesheet" />
<!-- -->

<% if (typeof headHtmlSnippet !== 'undefined') { %> <%= headHtmlSnippet %> <% } %> <%
files.css.forEach(file => { %>
<link href="<%= file %>" rel="stylesheet" />
<% }); %>

<style>
#root[hidden],
#docs-root[hidden] {
display: none !important;
}
</style>
</head>
<body>
<% if (typeof bodyHtmlSnippet !== 'undefined') { %> <%= bodyHtmlSnippet %> <% } %>

<div id="root"></div>
<div id="docs-root"></div>

<% if (typeof globals !== 'undefined' && Object.keys(globals).length) { %>
<script>
<meta name="viewport" content="width=device-width, initial-scale=1" />

<!-- Added for OpenSearch Dashboards shared dependencies -->
<script>
window.__osdPublicPath__ = { 'osd-ui-shared-deps': '/' };
</script>
<script src="/[email protected]"></script>
<script src="/osd-ui-shared-deps.js"></script>
<link href="/osd-ui-shared-deps.css" rel="stylesheet" />
<link href="/osd-ui-shared-deps.v7.light.css" rel="stylesheet" />
<!-- -->

<% if (typeof headHtmlSnippet !=='undefined' ) { %>
<%= headHtmlSnippet %>
<% } %>
<% files.css.forEach(file=> { %>
<link href="<%= file %>" rel="stylesheet" />
<% }); %>

<style>
#root[hidden],
#docs-root[hidden] {
display: none !important;
}
</style>
</head>

<body>
<% if (typeof bodyHtmlSnippet !=='undefined' ) { %>
<%= bodyHtmlSnippet %>
<% } %>

<div id="root"></div>
<div id="docs-root"></div>

<% if (typeof globals !=='undefined' && Object.keys(globals).length) { %>
<script>
<% for (var varName in globals) { %>
<% if (globals[varName] != undefined) { %>
window['<%=varName%>'] = <%= JSON.stringify(globals[varName]) %>;
window['<%=varName%>'] = <%= JSON.stringify(globals[varName]) %>;
<% } %>
<% } %>
</script>
<% } %> <% dlls.forEach(file => { %>
<script src="<%= file %>"></script>
<% }); %> <% files.js.forEach(file => { %>
<script src="<%= file %>"></script>
<% }); %>
</body>
</html>
</script>
<% } %>
<% dlls.forEach(file=> { %>
<script src="<%= file %>"></script>
<% }); %>
<% files.js.forEach(file=> { %>
<script src="<%= file %>"></script>
<% }); %>
</body>

</html>
4 changes: 2 additions & 2 deletions src/dev/build/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dev/build

Build the default and OSS distributables of Kibana.
Build the default and OSS distributables of OpenSearch Dashboards.

# Quick Start

Expand All @@ -18,7 +18,7 @@ node scripts/build --skip-node-download --debug --no-oss

# Fixing out of memory issues

Building Kibana and its distributables can take a lot of memory to finish successfully. Builds do make use of child processes, which means you can increase the amount of memory available by specifying `NODE_OPTIONS="--max-old-space-size=VALUE-IN-MEGABYTES"`.
Building OpenSearch Dashboards and its distributables can take a lot of memory to finish successfully. Builds do make use of child processes, which means you can increase the amount of memory available by specifying `NODE_OPTIONS="--max-old-space-size=VALUE-IN-MEGABYTES"`.

```sh

Expand Down
2 changes: 1 addition & 1 deletion src/dev/build/build_distributables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export async function buildDistributables(log: ToolingLog, options: BuildOptions
await run(Tasks.BuildPackages);
await run(Tasks.CreatePackageJson);
await run(Tasks.InstallDependencies);
await run(Tasks.BuildKibanaPlatformPlugins);
await run(Tasks.BuildOpenSearchDashboardsPlatformPlugins);
await run(Tasks.TranspileBabel);
await run(Tasks.RemoveWorkspaces);
await run(Tasks.CleanPackages);
Expand Down
6 changes: 3 additions & 3 deletions src/dev/build/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ if (showHelp) {
dedent(chalk`
{dim usage:} node scripts/build
build the Kibana distributable
build the OpenSearch Dashboards distributable
options:
--oss {dim Only produce the OSS distributable of Kibana}
--no-oss {dim Only produce the default distributable of Kibana}
--oss {dim Only produce the OSS distributable of OpenSearch Dashboards}
--no-oss {dim Only produce the default distributable of OpenSearch Dashboards}
--skip-archives {dim Don't produce tar/zip archives}
--skip-os-packages {dim Don't produce rpm/deb/docker packages}
--all-platforms {dim Produce archives for all platforms, not just this one}
Expand Down
4 changes: 2 additions & 2 deletions src/dev/build/lib/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ const setup = async ({ targetAllPlatforms = true }: { targetAllPlatforms?: boole
};

describe('#getOpenSearchDashboardsPkg()', () => {
it('returns the parsed package.json from the Kibana repo', async () => {
it('returns the parsed package.json from the OpenSearch Dashboards repo', async () => {
const config = await setup();
expect(config.getOpenSearchDashboardsPkg()).toEqual(pkg);
});
});

describe('#getNodeVersion()', () => {
it('returns the node version from the kibana package.json', async () => {
it('returns the node version from the OpenSearch Dashboards package.json', async () => {
const config = await setup();
expect(config.getNodeVersion()).toEqual(pkg.engines.node);
});
Expand Down
6 changes: 3 additions & 3 deletions src/dev/build/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ export class Config {
) {}

/**
* Get Kibana's parsed package.json file
* Get OpenSearch Dashboards's parsed package.json file
*/
getOpenSearchDashboardsPkg() {
return this.pkg;
}

/**
* Get the node version required by Kibana
* Get the node version required by OpenSearch Dashboards
*/
getNodeVersion() {
return this.nodeVersion;
Expand All @@ -89,7 +89,7 @@ export class Config {
}

/**
* Resolve a set of relative paths based from the directory of the Kibana repo
* Resolve a set of relative paths based from the directory of the OpenSearch Dashboards repo
*/
resolveFromRepo(...subPaths: string[]) {
return resolve(this.repoRoot, ...subPaths);
Expand Down
4 changes: 2 additions & 2 deletions src/dev/build/lib/runner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ describe('task rejection', () => {
await expect(promise).rejects.toThrowErrorMatchingInlineSnapshot(`"FOO"`);
expect(testWriter.messages).toMatchInlineSnapshot(`
Array [
" info [ kibana ] foo",
" info [ opensearchDashboards ] foo",
" │ERROR failure 0 sec",
" │ERROR Error: FOO",
" │ <stacktrace>",
Expand All @@ -240,7 +240,7 @@ describe('task rejection', () => {
await expect(promise).rejects.toThrowErrorMatchingInlineSnapshot(`"FOO"`);
expect(testWriter.messages).toMatchInlineSnapshot(`
Array [
" info [ kibana ] foo",
" info [ opensearchDashboards ] foo",
"",
]
`);
Expand Down
2 changes: 1 addition & 1 deletion src/dev/build/tasks/bin/scripts/kibana-keystore.bat
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ IF EXIST "%CONFIG_DIR%\node.options" (
)
)

TITLE Kibana Keystore
TITLE OpenSearch Dashboards Keystore
"%NODE%" "%DIR%\src\cli_keystore\dist" %*

:finally
Expand Down
2 changes: 1 addition & 1 deletion src/dev/build/tasks/bin/scripts/kibana-plugin.bat
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ IF EXIST "%CONFIG_DIR%\node.options" (
:: Include pre-defined node option
set "NODE_OPTIONS=--no-warnings %NODE_OPTIONS%"

TITLE Kibana Server
TITLE OpenSearch Dashboards Server
"%NODE%" "%DIR%\src\cli_plugin\dist" %*

:finally
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import {

import { Task } from '../lib';

export const BuildKibanaPlatformPlugins: Task = {
description: 'Building distributable versions of Kibana platform plugins',
export const BuildOpenSearchDashboardsPlatformPlugins: Task = {
description: 'Building distributable versions of OpenSearch Dashboards platform plugins',
async run(_, log, build) {
const config = OptimizerConfig.create({
repoRoot: REPO_ROOT,
Expand Down
28 changes: 14 additions & 14 deletions src/dev/build/tasks/build_packages_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import { mkdirp, Task } from '../lib';
/**
* High-level overview of how we enable shared packages in production:
*
* tl;dr We copy the packages directly into Kibana's `node_modules` folder,
* tl;dr We copy the packages directly into OpenSearch Dashboards's `node_modules` folder,
* which means they will be available when `require(...)`d.
*
* During development we rely on `@osd/pm` to find all the packages
* in the Kibana repo and run Yarn in all the right places to create symlinks
* in the OpenSearch Dashboards repo and run Yarn in all the right places to create symlinks
* between these packages. This development setup is described in-depth in the
* readme in `@osd/pm`.
*
Expand All @@ -38,41 +38,41 @@ import { mkdirp, Task } from '../lib';
* we can't run `@osd/pm` in the same way we do for development and
* just package the result. That means we have two options: either we prepare
* everything in the built package or we perform the necessary actions when
* Kibana is starting up in production. We decided on the former: all the Kibana
* OpenSearch Dashboards is starting up in production. We decided on the former: all the OpenSearch Dashboards
* packages are prepared as part of the build process.
*
* (All of this is a bit different for Kibana plugins as they _do_ have an
* install step — the plugin CLI tool. However, Kibana plugins are not allowed
* (All of this is a bit different for OpenSearch Dashboards plugins as they _do_ have an
* install step — the plugin CLI tool. However, OpenSearch Dashboards plugins are not allowed
* to have separate packages yet.)
*
* How Kibana packages are prepared:
* How OpenSearch Dashboards packages are prepared:
*
* 1. Run the build for each package
* 2. Copy all the packages into the `build/kibana` folder
* 3. Replace `link:` dependencies with `file:` dependencies in both Kibana's
* 2. Copy all the packages into the `build/OpenSearch Dashboards` folder
* 3. Replace `link:` dependencies with `file:` dependencies in both OpenSearch Dashboards's
* `package.json` and in all the dependencies. Yarn will then copy the
* sources of these dependencies into `node_modules` instead of setting up
* symlinks.
*
* In the end after the `install dependencies` build step all Kibana packages
* In the end after the `install dependencies` build step all OpenSearch Dashboards packages
* will be located within the top-level `node_modules` folder, which means
* normal module resolution will apply and you can `require(...)` any of these
* packages when running Kibana in production.
* packages when running OpenSearch Dashboards in production.
*
* ## Known limitations
*
* - This process _only_ include packages that used by Kibana or any of its
* - This process _only_ include packages that used by OpenSearch Dashboards or any of its
* transitive packages, as it depends on only running `yarn` at the top level.
* That means a Kibana plugin can only depend on Kibana packages that are used
* in some way by Kibana itself in production, as it won't otherwise be
* That means a OpenSearch Dashboards plugin can only depend on OpenSearch Dashboards packages that are used
* in some way by OpenSearch Dashboards itself in production, as it won't otherwise be
* included in the production build.
*/
export const BuildPackages: Task = {
description: 'Building distributable versions of packages',
async run(config, log, build) {
await mkdirp(config.resolveFromRepo('target'));
await buildProductionProjects({
kibanaRoot: config.resolveFromRepo(),
opensearchDashboardsRoot: config.resolveFromRepo(),
buildRoot: build.resolvePath(),
onlyOSS: build.isOss(),
});
Expand Down
4 changes: 2 additions & 2 deletions src/dev/build/tasks/copy_source_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ export const CopySource: Task = {
'!src/setup_node_env/babel_register/register.js',
'!**/public/**/*.{js,ts,tsx,json}',
'typings/**',
'config/kibana.yml',
'config/opensearch_dashboards.yml',
'config/node.options',
'tsconfig*.json',
'.i18nrc.json',
'kibana.d.ts',
'opensearch_dashboards.d.ts',
],
});
},
Expand Down
2 changes: 1 addition & 1 deletion src/dev/build/tasks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ export * from './uuid_verification_task';
export * from './verify_env_task';
export * from './write_sha_sums_task';

// @ts-expect-error this module can't be TS because it ends up pulling x-pack into Kibana
// @ts-expect-error this module can't be TS because it ends up pulling x-pack into OpenSearch Dashboards
export { InstallChromium } from './install_chromium';
2 changes: 1 addition & 1 deletion src/dev/build/tasks/notice_file_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const CreateNoticeFile: Task = {
log.info('Generating notice from source');
log.indent(4);
const noticeFromSource = await generateNoticeFromSource({
productName: build.isOss() ? 'Kibana' : 'Kibana with X-Pack',
productName: build.isOss() ? 'OpenSearch Dashboards' : 'OpenSearch Dashboards',
directory: build.resolvePath(),
log,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import { TemplateContext } from './template_context';

export async function bundleDockerFiles(config: Config, log: ToolingLog, scope: TemplateContext) {
log.info(
`Generating kibana${scope.imageFlavor}${scope.ubiImageFlavor} docker build context bundle`
`Generating OpenSearch Dashboards${scope.imageFlavor}${scope.ubiImageFlavor} docker build context bundle`
);

const dockerFilesDirName = `kibana${scope.imageFlavor}${scope.ubiImageFlavor}-${scope.version}-docker-build-context`;
const dockerFilesDirName = `OpenSearch Dashboards${scope.imageFlavor}${scope.ubiImageFlavor}-${scope.version}-docker-build-context`;
const dockerFilesBuildDir = resolve(scope.dockerBuildDir, dockerFilesDirName);
const dockerFilesOutputDir = config.resolveFromTarget(`${dockerFilesDirName}.tar.gz`);

Expand Down
Loading

0 comments on commit 167e907

Please sign in to comment.