From 9821c56abff6a7a365a1f18a37d683f5794a5e98 Mon Sep 17 00:00:00 2001 From: mad Date: Thu, 23 Mar 2023 02:16:06 +0600 Subject: [PATCH] [CCI] Adding second command to Install yarn step in Developer Guide (#3633) * added prepare command Signed-off-by: kappassov * Use mirrors to download Node.js binaries to escape sporadic 404 errors (#3619) Issue Resolved: https://github.com/opensearch-project/OpenSearch-Dashboards/issues/3618 Signed-off-by: Anan Zhuang * Allow selecting the Node.js binary OSD uses (#3508) New reusable use_node scripts take care of selecting the correct Node.js binary based OSD_NODE_HOME, OSD_HOME, and whatever is in the PATH. It also takes care of finding the binary on FreeBSD. * The startup scripts check `OSD_NODE_HOME` and `NODE_HOME` before falling back to use the bundled or system-wide Node.js binary. * Update `package.json` to replace `node` with `use_node`. * Update file templates and shell scripts to internally use `use_node`. * Update the build scripts to copy `use_node` into releases * Make tests that execute node internally, honor the binary being used. Signed-off-by: Miki * Clean up and rebuild @osd/pm (#3570) * Fix the build failures * Removed some unused packages * Update gist url templates in Lychee's exclusion list Signed-off-by: Miki * Refactor dev tool console to use opensearch-js client to send request (#3544) Refactor dev tool console to use opensearch-js client to interact with OpenSearch Signed-off-by: Su * updates after the 1st review Signed-off-by: kappassov --------- Signed-off-by: kappassov Signed-off-by: Anan Zhuang Signed-off-by: Miki Signed-off-by: Su Co-authored-by: Anan Zhuang Co-authored-by: Miki Co-authored-by: Zhongnan Su --- DEVELOPER_GUIDE.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index ae4344022bda..2c964f3d6989 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -63,8 +63,12 @@ If it's the only version of node installed, it will automatically be set to the #### Install `yarn` +Take a look at the [latest Yarn release](https://github.com/yarnpkg/berry/releases/latest), note the version number, and run: + ```bash $ npm i -g corepack + +$ corepack prepare yarn@ --activate ``` (See the [Yarn installation documentation](https://yarnpkg.com/getting-started/install) for more information.) @@ -111,6 +115,7 @@ $ yarn osd clean OpenSearch Dashboards requires a running version of OpenSearch to connect to. In a separate terminal you can run the latest snapshot built using: _(Linux, Windows, Darwin (MacOS) only - for others, you'll need to [set up using Docker](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/docs/docker-dev/docker-dev-setup-manual.md) or [run OpenSearch from a tarball](#alternative---run-opensearch-from-tarball) instead)_ + ```bash $ yarn opensearch snapshot ``` @@ -185,6 +190,7 @@ By default, the snapshot command will run [a minimal distribution of OpenSearch] If you would like to run OpenSearch with a particular plugin installed on the cluster snapshot, pass the `--P` flag after `yarn opensearch snapshot`. You can use the flag multiple times to install multiple plugins. The argument value can be a URL to the plugin's zip file, maven coordinates of the plugin, or a local zip file path (use `file://` followed by the absolute or relative path, in that case). For example: _(Linux, Windows, Darwin (MacOS) only - for others, you'll need to [run OpenSearch from a tarball](#alternative---run-opensearch-from-tarball) instead)_ + ```bash $ yarn opensearch snapshot --P https://repo1.maven.org/maven2/org/opensearch/plugin/opensearch-test-plugin/2.4.0.0/opensearch-test-plugin-2.4.0.0.zip ``` @@ -227,7 +233,7 @@ This method can also be used to develop against the [full distribution of OpenSe ### Configure OpenSearch Dashboards for security -*This step is only mandatory if you have the [`security` plugin](https://github.com/opensearch-project/security) installed on your OpenSearch cluster with https/authentication enabled.* +_This step is only mandatory if you have the [`security` plugin](https://github.com/opensearch-project/security) installed on your OpenSearch cluster with https/authentication enabled._ Once the bootstrap of OpenSearch Dashboards is finished, you need to apply some changes to the default [`opensearch_dashboards.yml`](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/config/opensearch_dashboards.yml#L25-L72) in order to connect to OpenSearch. @@ -258,10 +264,11 @@ yarn build-platform --darwin You could pass one or multiple flags. If you don't pass any flag, `yarn build-platform` will build an artifact based on your local environment. Currently, the supported flags for this script are: -* `darwin` (builds Darwin x64) -* `linux` (builds Linux x64) -* `linux-arm` (builds Linux ARM64). -* `windows` (builds Windows x64) + +- `darwin` (builds Darwin x64) +- `linux` (builds Linux x64) +- `linux-arm` (builds Linux ARM64). +- `windows` (builds Windows x64) If you would like to build only a DEB x64 artifact, run the following: @@ -334,9 +341,7 @@ This part contains developer guide rules around general (framework agnostic) HTM Use camel case for the values of attributes such as `id` and `data-test-subj` selectors. ```html - + ``` The only exception is in cases where you're dynamically creating the value, and you need to use @@ -432,10 +437,8 @@ import './component.scss'; // All other imports below the SASS import export const Component = () => { - return ( -
- ); -} + return
; +}; ``` ```scss @@ -446,7 +449,6 @@ export const Component = () => { Do not use the underscore `_` SASS file naming pattern when importing directly into a javascript file. - ### TypeScript/JavaScript The following developer guide rules apply for working with TypeScript/JavaScript files.