diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ddcc860ae9739..07ad6e86814d9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,6 +42,10 @@ little bit helps, and credit will always be given. - [Merging](#merging) - [Post-merge Responsibility](#post-merge-responsibility) - [Design Guidelines](#design-guidelines) + - [Capitalization guidelines](#capitalization-guidelines) + - [Sentence case](#sentence-case) + - [How to refer to UI elements](#how-to-refer-to-ui-elements) + - [\*\*Exceptions to sentence case:](#exceptions-to-sentence-case) - [Managing Issues and PRs](#managing-issues-and-prs) - [Reporting a Security Vulnerability](#reporting-a-security-vulnerability) - [Revert Guidelines](#revert-guidelines) @@ -76,6 +80,7 @@ little bit helps, and credit will always be given. - [Translating](#translating) - [Enabling language selection](#enabling-language-selection) - [Extracting new strings for translation](#extracting-new-strings-for-translation) + - [Updating language files](#updating-language-files) - [Creating a new language dictionary](#creating-a-new-language-dictionary) - [Tips](#tips) - [Adding a new datasource](#adding-a-new-datasource) @@ -259,9 +264,11 @@ Finally, never submit a PR that will put master branch in broken state. If the P ### Capitalization guidelines #### Sentence case -Use sentence-case capitalization for everything in the UI (except these **). + +Use sentence-case capitalization for everything in the UI (except these \*\*). Sentence case is predominantly lowercase. Capitalize only the initial character of the first word, and other words that require capitalization, like: + - **Proper nouns.** Objects in the product _are not_ considered proper nouns e.g. dashboards, charts, saved queries etc. Proprietary feature names eg. SQL Lab, Preset Manager _are_ considered proper nouns - **Acronyms** (e.g. CSS, HTML) - When referring to **UI labels that are themselves capitalized** from sentence case (e.g. page titles - Dashboards page, Charts page, Saved queries page, etc.) @@ -272,10 +279,12 @@ Title case: "A Dog Takes a Walk in Paris" Sentence case: "A dog takes a walk in Paris" **Why sentence case?** + - It’s generally accepted as the quickest to read - It’s the easiest form to distinguish between common and proper nouns #### How to refer to UI elements + When writing about a UI element, use the same capitalization as used in the UI. For example, if an input field is labeled “Name” then you refer to this as the “Name input field”. Similarly, if a button has the label “Save” in it, then it is correct to refer to the “Save button”. @@ -293,7 +302,7 @@ Often a product page will have the same title as the objects it contains. In thi - Queries that you save will appear on the Saved queries page - Create custom queries in SQL Lab then create dashboards -#### **Exceptions to sentence case: +#### \*\*Exceptions to sentence case: - Input labels, buttons and UI tabs are all caps - User input values (e.g. column names, SQL Lab tab names) should be in their original case @@ -464,7 +473,7 @@ Frontend assets (TypeScript, JavaScript, CSS, and images) must be compiled in or ##### nvm and node -First, be sure you are using recent versions of NodeJS and npm. We recommend using [nvm](https://github.com/nvm-sh/nvm) to manage your node environment: +First, be sure you are using recent versions of node.js and npm. We recommend using [nvm](https://github.com/nvm-sh/nvm) to manage your node environment: ```bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh | bash @@ -476,6 +485,12 @@ nvm use For those interested, you may also try out [avn](https://github.com/nvm-sh/nvm#deeper-shell-integration) to automatically switch to the node version that is required to run Superset frontend. +We have upgraded our `package-lock.json` to use `lockfileversion: 2` from npm 7, so please make sure you have installed npm 7, too: + +```bash +npm install -g npm@7 +``` + #### Install dependencies Install third-party dependencies listed in `package.json` via: @@ -895,6 +910,9 @@ yarn build Then use `npm link` to create symlinks of the plugins/superset-ui packages you want to edit in `superset-frontend/node_modules`: ```bash +# Since npm 7, you have to install plugin dependencies separately, too +cd ../../superset-ui/plugins/[PLUGIN NAME] && npm install --legacy-peer-deps + cd superset/superset-frontend npm link ../../superset-ui/plugins/[PLUGIN NAME]