|
1 | | -# Contributing Guidelines |
2 | | - |
3 | | -- [Development setup](#development-setup) |
4 | | -- [Forking the repository](#forking-the-repository) |
5 | | -- [Don't reference internal systems, issues, or links](#dont-reference-internal-systems-issues-or-links) |
6 | | -- [Versioning a package](#versioning-a-package) |
| 1 | +# Contributing |
| 2 | + |
| 3 | +- [Development](#development) |
| 4 | + - [Forking the repository](#forking-the-repository) |
| 5 | + - [Don't reference internal systems, issues, or links](#dont-reference-internal-systems-issues-or-links) |
| 6 | + - [Getting started](#getting-started) |
| 7 | + - [Adding a release note](#adding-a-release-note) |
| 8 | + - [Updating style variables](#updating-style-variables) |
| 9 | + - [Translations and static strings](#translations-and-static-strings) |
7 | 10 | - [Best practices](#best-practices) |
8 | 11 | - [Proceed with caution when upgrading Storybook](#proceed-with-caution-when-upgrading-storybook) |
9 | 12 | - [Prefer controls over stories](#prefer-controls-over-stories) |
|
26 | 29 | - [Bubble and compose events](#bubble-and-compose-events) |
27 | 30 | - [Avoid custom events](#avoid-custom-events) |
28 | 31 | - [Override and decorate inherited properties used in templates](#override-and-decorate-inherited-properties-used-in-templates) |
29 | | - - [Translations and static strings](#translations-and-static-strings) |
30 | 32 | - [Questions](#questions) |
31 | 33 | - [What is `per-env`?](#what-is-per-env) |
32 | 34 |
|
33 | 35 | ## Development |
34 | 36 |
|
35 | | -Follow the instructions in [README](./README.md) to set up your machine for development. |
36 | | - |
37 | | -## Forking the repository |
| 37 | +### Forking the repository |
38 | 38 |
|
39 | 39 | If you are a member of the CrowdStrike GitHub organization, you can branch off of `main`. |
40 | 40 | For those not in the organization, you can [fork the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) and contribute as if you were contributing to any other open source project on GitHub. |
41 | 41 |
|
42 | | -## Don't reference internal systems, issues, or links |
| 42 | +### Don't reference internal systems, issues, or URLs |
| 43 | + |
| 44 | +> [!WARNING] |
| 45 | +> When writing commit messages, creating branch names, providing Pull Request feedback, and creating Pull Request descriptions, one must take caution in what is written. |
| 46 | +> This content **cannot** contain references to internal systems, proprietary images or source code, or anything else that could harm CrowdStrike or any other organization or individual contributing to this repository. |
| 47 | +> Use common sense. If you're unsure, please ask the team for guidance. |
| 48 | +
|
| 49 | +### Getting started |
| 50 | + |
| 51 | +We recommend using [Corepack](https://pnpm.io/installation#using-corepack) to manage PNPM. |
| 52 | + |
| 53 | +```bash |
| 54 | +pnpm install |
| 55 | +pnpm start |
| 56 | +``` |
| 57 | + |
| 58 | +- If you have `ignore-scripts=true` in your `~/.npmrc`, also run `pnpm prepare` to install the Git hooks. |
43 | 59 |
|
44 | | -When writing commit messages, providing Pull Request feedback, and creating Pull Request descriptions, one must take caution in what is written. |
45 | | -This content **cannot** contain references to internal systems, proprietary images or source code, or anything else that could harm CrowdStrike or any other organization or individual contributing to this repository. |
46 | | -Use common sense. If you're unsure, please ask the team for guidance. |
| 60 | +Read through the remainder of this document before opening a pull request. |
47 | 61 |
|
48 | | -## Versioning a package |
| 62 | +### Adding a release note |
49 | 63 |
|
50 | | -We use [changesets](https://github.com/changesets/changesets) to manage our release notes. |
51 | | -Include a changeset with your Pull Request if the change you made is one that consumers should know about: |
| 64 | +We use [Changesets](https://github.com/changesets/changesets) for release notes. |
| 65 | +Include one with your Pull Request if you made a change consumers should know about: |
52 | 66 |
|
53 | 67 | ```bash |
54 | 68 | pnpm changeset |
55 | 69 | ``` |
56 | 70 |
|
57 | | -You'll be prompted to select the type of change according to [Semantic Versioning](https://semver.org). |
58 | | -You'll also be prompted for a description. |
59 | | -Descriptions are used in our release notes for consumers. |
60 | | -So be sure to be as descriptive and helpful as possible. |
| 71 | +1. Select the type of change according to [Semantic Versioning](https://semver.org). |
| 72 | +1. Add a concise but comprehensive description. |
| 73 | + |
| 74 | +### Updating style variables |
| 75 | + |
| 76 | +1. Generate a Figma [personal access token](https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens). |
| 77 | +1. `FIGMA_TOKEN=<token> pnpm start:production:figma` |
| 78 | + |
| 79 | +### Translations and static strings |
| 80 | + |
| 81 | +Most of the text we render is provided by the consumer directly; however, we do have a few cases where we have static strings in place. |
| 82 | +In particular, static strings are helpful for screenreaders so that our components can provide additional context for accessibility. |
| 83 | + |
| 84 | +The process for adding static strings is as follows: |
| 85 | + |
| 86 | +1. Update the type definition at [`src/library/localize.ts`](https://github.com/CrowdStrike/glide-core/blob/main/src/library/localize.ts) to include your new string. |
| 87 | +1. Add the new string directly to [`src/translations/en.ts`](https://github.com/CrowdStrike/glide-core/blob/main/src/translations/en.ts). This is what will be used in code. |
| 88 | +1. Add the new string in the JSON format to [`src/translations/en.json`](https://github.com/CrowdStrike/glide-core/blob/main/src/translations/en.json). |
| 89 | +1. Copy the additions from `src/translations/en.ts` and `src/translations/en.json` to the other language files. |
| 90 | + |
| 91 | +The non-English languages will fallback to English until they are translated. |
| 92 | +The `src/translations/en.json` will be sent to our translation team and returned for each language we support. |
| 93 | +When a new file is received from the translators, please update all `src/translations/*.json` and `src/translations/*.ts` files with the updated strings. |
61 | 94 |
|
62 | 95 | ## Best practices |
63 | 96 |
|
@@ -558,22 +591,6 @@ Many components don't change inherited properties internally. |
558 | 591 | However, if one is made to after the fact, it may result in a subtle bug. |
559 | 592 | So it's best to always override and decorate (using `@property`) inherited properties used in templates. |
560 | 593 |
|
561 | | -### Translations and static strings |
562 | | -
|
563 | | -Most of the text we render is provided by the consumer directly; however, we do have a few cases where we have static strings in place. |
564 | | -In particular, static strings are helpful for screenreaders so that our components can provide additional context for accessibility. |
565 | | -
|
566 | | -The process for adding static strings is as follows: |
567 | | -
|
568 | | -1. Update the type definition at [`src/library/localize.ts`](https://github.com/CrowdStrike/glide-core/blob/main/src/library/localize.ts) to include your new string. |
569 | | -2. Add the new string directly to [`src/translations/en.ts`](https://github.com/CrowdStrike/glide-core/blob/main/src/translations/en.ts). This is what will be used in code. |
570 | | -3. Add the new string in the JSON format to [`src/translations/en.json`](https://github.com/CrowdStrike/glide-core/blob/main/src/translations/en.json). |
571 | | -4. Copy the additions from `src/translations/en.ts` and `src/translations/en.json` to the other language files. |
572 | | -
|
573 | | -The non-English languages will fallback to English until they are translated. |
574 | | -The `src/translations/en.json` will be sent to our translation team and returned for each language we support. |
575 | | -When a new file is received from the translators, please update all `src/translations/*.json` and `src/translations/*.ts` files with the updated strings. |
576 | | -
|
577 | 594 | ## Questions |
578 | 595 |
|
579 | 596 | ### What is [`per-env`](https://github.com/ericclemmons/per-env)? |
|
0 commit comments