-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce text linting of our documentation #1588
base: main
Are you sure you want to change the base?
Changes from all commits
c65419e
fc267b8
c5e8e7e
67bbac9
cf6b2ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
CHANGELOG.md | ||
*/*/CHANGELOG.md | ||
*/*/LICENSE.md | ||
LICENSE.md | ||
build | ||
*/*/build/* | ||
*/*/dist/* | ||
apps/demo/build/** | ||
apps/storybook/build/** | ||
docs/** | ||
examples/** | ||
exporters/** | ||
packages/**/dist/** | ||
packages/design-tokens/** | ||
packages/exporters/** | ||
packages/form-validations/** | ||
packages/icons/** | ||
packages/web/** | ||
packages/web-react/** | ||
packages/web-twig/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = { | ||
rules: { | ||
'@lmc-eu/textlint-rule-preset-lmc': { | ||
'title-case': { | ||
headingLevels: [6], | ||
exclude: [ | ||
'@lmc-eu', | ||
'@lmc-eu/spirit-icons', | ||
'jest-config-spirit', | ||
'prettier-config-spirit', | ||
], | ||
}, | ||
'stop-words': { | ||
severity: 'warning', | ||
}, | ||
}, | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Contributing to Spirit Design System | ||
|
||
First of all, thanks for your contribution to this project! ❤️ | ||
Thanks for your contribution to this project! ❤️ | ||
Here are some tips how to make your contributing efforts efficient and eventually accepted & merged: | ||
|
||
- [General Usage](#general-usage) | ||
|
@@ -31,7 +31,7 @@ See [Developer Handbook][developer-handbook] for more information about developm | |
|
||
## Commit Conventions | ||
|
||
All commits you make SHOULD adhere to our commit guidelines. We use [conventional commits][conventional-commits] strategy with a slight modification of our own - [@lmc-eu/commitlint-config][commitlint-config]. This is later used during the release phase to determine how to bump the packages' version numbers based on commit history. 🚀 | ||
All commits you make SHOULD adhere to our commit guidelines. We use [conventional commits][conventional-commits] strategy with a slight modification of our own - [@lmc-eu/commitlint-config][commitlint-config]. This is later used during the release phase to determine how to bump the packages’ version numbers based on commit history. 🚀 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The correct apostrophe sign is important for a great typography, and I have always been rooting for a great typography. But this is a technical document and I'm afraid people (I mean us) will struggle with the correct styling. If we are going to check the correct apostrophe character, I'd also check quotes and dashes, to name a few. But we cannot force people to use them, IMO. |
||
|
||
### Commit Message Format | ||
|
||
|
@@ -74,7 +74,7 @@ The `<type>` and `<summary>` fields are mandatory, the `(<scope>)` field is opti | |
|
||
MUST be one of the following: | ||
|
||
- **Chore**: Changes to our CI configuration files and scripts (examples: CircleCI, SauceLabs) or changes that affect the build system | ||
- **Chore**: Changes to our CI configuration files and scripts (examples: CircleCI, SauceLabs) or changes that affect the build tool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, I don't think "system" is a wrong word in this context. |
||
- **Deps**: Changes to dependencies | ||
- **Docs**: Documentation only changes | ||
- **Feat**: A new feature | ||
|
@@ -109,7 +109,7 @@ The following is the list of supported scopes: | |
- Repository-wide: | ||
- `ci`: used for changes that affect the Continuous Integration process and builds | ||
- `repo`: used for repository-wide changes | ||
- none/empty string: useful for `Test` and `Refactor` changes that are done across all packages (e.g. `Test: Add missing unit tests`) and for docs changes that are not related to a specific package (e.g. `Docs: Fix typo in the tutorial`). | ||
- none/empty string: useful for `Test` and `Refactor` changes that are done across all packages (for example `Test: Add missing unit tests`) and for docs changes that are not related to a specific package (for example `Docs: Fix typo in the tutorial`). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I'm willing to get used to this form. I suppose it means "i.e." is also undesired. |
||
|
||
##### Summary | ||
|
||
|
@@ -124,7 +124,7 @@ Use the summary field to provide a succinct description of the change: | |
Just as in the summary, use the imperative, present tense: "fix" not "fixed" nor "fixes". | ||
|
||
Explain the motivation for the change in the commit message body. This commit message SHOULD explain _why_ you are making the change. | ||
You can include a comparison of the previous behavior with the new behavior in order to illustrate the impact of the change. | ||
You can include a comparison of the previous behavior with the new behavior to illustrate the impact of the change. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, looks better now. |
||
|
||
#### Commit Message Footer | ||
|
||
|
@@ -149,7 +149,7 @@ If the commit reverts a previous commit, it SHOULD begin with `Revert: `, follow | |
The content of the commit message body SHOULD contain: | ||
|
||
- information about the SHA of the commit being reverted in the following format: `This reverts commit <SHA>`, | ||
- a clear description of the reason for reverting the commit message. | ||
- a clear description of why the commit message is being reverted. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good catch. |
||
|
||
### Before Commit | ||
|
||
|
@@ -161,18 +161,18 @@ This project uses Prettier for code formatting. You can run `make format` to for | |
|
||
## Documenting the Components | ||
|
||
1. All components MUST be documented in a `README` file in the root of the component, e.g. `packages/web-react/Accordion/README.md`. | ||
1. All components MUST be documented in a `README` file in the root of the component, for example `packages/web-react/Accordion/README.md`. | ||
2. The documentation MUST be written in Markdown. | ||
3. The documentation MUST contain at least a basic example usage of the component. | ||
4. For complex components or components with subcomponents, the documentation SHOULD contain examples of individual building blocks as well as an example composition. | ||
5. Component and subcomponent props MUST be documented in a table. | ||
1. The table MUST be placed in a section introduced by a headline called `API`. | ||
2. The table MUST contain the following columns: | ||
- `Name` — the name of the prop, e.g. `title` | ||
- `Type` — the type of the prop, e.g. `string`, `number`, `bool`, `[horizontal | vertical]`, an existing [dictionary][dictionary], etc. | ||
- `Default` — the default value of the prop, e.g. `null` or `—` (em-dash) if there is no default value | ||
- `Name` — the name of the prop, for example `title` | ||
- `Type` — the type of the prop, for example `string`, `number`, `bool`, `[horizontal | vertical]`, an existing [dictionary][dictionary], etc. | ||
- `Default` — the default value of the prop, for example `null` or `—` (em-dash) if there is no default value | ||
- `Required` — if the prop is required `✓` or not `✕` | ||
- `Description` — the description of the prop, e.g. `Title of the accordion` | ||
- `Description` — the description of the prop, for example `Title of the accordion` | ||
3. The props MUST be sorted alphabetically by their name. | ||
|
||
## Testing | ||
|
@@ -182,15 +182,15 @@ Using this you can test the entire package and verify that all parts of the pack | |
|
||
The testing script includes: | ||
|
||
- linting using [ESlint][eslint] | ||
- linting using [ESLint][eslint] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is correct, but "SASS" (meaning the CSS preprocessor) is incorrect: "Sass" is correct. And there are more. |
||
- checking format using the [Prettier][prettier] | ||
- checking types using the [Typescript][typescript] compiler | ||
- checking types using the [TypeScript][typescript] compiler | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, this is correct. |
||
- running unit test using the [Jest][jest] | ||
|
||
### Unit Testing | ||
|
||
You can run unit testing via `test:unit` scripts. | ||
For all available scripts see the package's `package.json` file. | ||
For all available scripts see the package’s `package.json` file. | ||
|
||
### Manual Testing | ||
|
||
|
@@ -225,7 +225,7 @@ We have two test suites and you can find them in the `./tests/e2e` directory: | |
|
||
- `demo-homepages` - tests the homepages of our demo apps. | ||
- This test is used to verify that the demo apps are working properly and their homepages are not broken. | ||
- `demo-components-compare` - tests components' pages of our demo apps'. | ||
- `demo-components-compare` - tests components’ pages of our demo apps’. | ||
- This test gets the list of components from the file system for each package and then it goes through each component and compares its page in all demo apps. | ||
- Only one screenshot is taken for each component. If you run the update command, only the last screenshot will be saved. | ||
|
||
|
@@ -242,16 +242,16 @@ When the tests fail, there will be a comment in the PR with a link to the report | |
You can also find the report URL in the GitHub Actions run under the `Run actions/upload-artifact` section. | ||
Look for `Artifact download URL: https://github.com/lmc-eu/spirit-design-system/actions/runs/<run-id>/artifacts/<artifact-id>`. | ||
|
||
⚠️ Currently we do not deploy the Web Twig package to any environment, so you can only test it locally. | ||
⚠️ We do not deploy the Web Twig package to any environment, so you can only test it locally. | ||
|
||
### Developing and Testing GitHub Actions | ||
|
||
It can be time-consuming and painful to test GitHub Actions. | ||
First, you have to change the GitHub Actions file locally, push your local code into the GitHub repository, and wait for the result. | ||
|
||
To solve this issue, you can use [act][act] CLI tool to test and write the GitHub actions locally. | ||
To solve this issue, you can use [act][act] command line tool to test and write the GitHub actions locally. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK 🤷🏻♂️ |
||
|
||
For more, please read the article [How to Run GitHub Actions Locally with the act CLI tool][act-article]. | ||
For more, please read the article [How to Run GitHub Actions Locally with the act command line tool][act-article]. | ||
|
||
## Publishing | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,11 +21,11 @@ Introducing deprecations and feature flags to be removed in the version 2 lists. | |
|
||
<!--lint enable heading-capitalization --> | ||
|
||
- _spirit-web-twig_ was released as version 2 already. See the [CHANGELOG][twig-changelog] for more details or refer to the [migration guide][twig-migration-v2]. | ||
- _spirit-web-twig_ was released as version 2 already. See the [CHANGELOG][twig-changelog] for more details or check the [migration guide][twig-migration-v2]. | ||
|
||
--- | ||
|
||
Please refer back to this list or reach out to our team if you encounter any issues during migration. | ||
If you face any problems during migration, please check this list or contact our team for assistance. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good, more comprehensible now. |
||
|
||
[web-deprecations-v2]: https://github.com/lmc-eu/spirit-design-system/blob/main/packages/web/DEPRECATIONS-v2.md | ||
[web-react-deprecations-v2]: https://github.com/lmc-eu/spirit-design-system/blob/main/packages/web-react/DEPRECATIONS-v2.md | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? I don't feel it was wrong…