Skip to content

Commit 5bb593c

Browse files
author
Luke Bowerman
authored
docs: Add RELEASING documentation
1 parent ec27334 commit 5bb593c

File tree

3 files changed

+107
-63
lines changed

3 files changed

+107
-63
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,9 @@ feat(NewComponentName): Component to support exciting new thing
5151
chore(deps): Updated package dependency X from 1.0.2 to 1.0.6
5252
```
5353

54-
#### Types
54+
#### Commit Message Types
5555

56-
We generally follow [Angular's types](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type). The most common types used are:
57-
58-
- fix: a commit of the type fix patches a bug (this correlates with PATCH in Semantic Versioning).
59-
- feat: a commit of the type feat introduces a new feature or changes an existing one (this correlates with MINOR in Semantic Versioning).
60-
61-
If a change does _NOT_ make a change to the build artifacts produced (`fix` or `feat` above) you can also use one of these alternative types:
62-
63-
- build: Changes that affect the build system or external dependencies
64-
- docs: Documentation only changes
65-
- refactor: A code change that neither fixes a bug nor adds a feature
66-
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
67-
- test: Adding missing tests or correcting existing tests
56+
The most common types used are `fix` & `feature`. See [Release Types](./RELEASING.md#release-types) for all the details as well as additional types.
6857

6958
#### Scope
7059

@@ -74,6 +63,10 @@ Specify a scope when your change is focused on a specific component or portion o
7463
feat(Button): Now supports even more colors 🌈
7564
```
7665

66+
### Fix Backporting
67+
68+
Evaluate if it makes sense to back-port fix to a previous version. See [Backports in RELEASING.md](./RELEASING.md#backports) for more details.
69+
7770
### Developer Checklist
7871

7972
Edit the developer checklist to reflect only items relevant to your pull request (delete items that aren't relevant). Feel free to reach out if you have questions or get stuck.

README.md

Lines changed: 17 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,19 @@ Please file issues on [Github Issues](https://github.com/looker-open-source/comp
1515

1616
# Setting up
1717

18-
### Install Yarn
18+
## Yarn
1919

2020
This is a monorepo utilizing [Lerna](https://lerna.js.org) and [Yarn Workspaces](https://yarnpkg.com/lang/en/docs/workspaces/). It is composed of a collection of packages.
2121

2222
If you don't have [`yarn`](https://yarnpkg.com/en/) installed, have a look at https://yarnpkg.com/en/docs/install and choose the appropriate installation for your environment.
2323

2424
We recommend using [Node Version Manager (NVM)](https://github.com/nvm-sh/nvm#installation-and-update) to manage multiple versions of Node. Once installed you can simply type `nvm use` in side the repository to get the appropriate version of Node installed. Then you'll need to install Yarn globally via NPM - `npm install --global yarn`
2525

26-
### Clone this Repository & Setup
26+
## Clone Repository & Setup
2727

2828
1. `git clone [email protected]:looker-open-source/components.git`
29-
1. `yarn`
29+
1. `yarn install`
30+
1.
3031

3132
## Packages
3233

@@ -46,6 +47,7 @@ We recommend using [Node Version Manager (NVM)](https://github.com/nvm-sh/nvm#in
4647
- **yarn develop** shortcut for booting up www, playground, and server packages for local development
4748
- **yarn playground** starts a bare-bones React app used for developing components
4849
- **yarn gatsby** starts the Gatsby server (powers our documentation site)
50+
- **yarn storybook** starts Storybook in "Docs" mode (includes stories from all packages)
4951
- **yarn build** runs build across all packages. This calls several subtasks
5052
- **yarn prebuild** run clean, then use lerna to do any pre-build tasks needed for packages
5153
- **yarn build** runs build:\* in parallel (see below)
@@ -59,54 +61,41 @@ We recommend using [Node Version Manager (NVM)](https://github.com/nvm-sh/nvm#in
5961
- **yarn clean** remove all build artifacts
6062
- **yarn test** runs Jest across all packages
6163

62-
#### Storybook
63-
64-
Storybook is a tool used to develop, demonstrate and document components in isolation.
65-
66-
- **yarn storybook** starts Storybook (includes stories from all packages)
67-
- **yarn storybook docs** starts Storybook in "Docs" mode
68-
- **yarn workspace [workspace-package-name] storybook** starts a storybook with just stories within the specified package.
69-
7064
### Workspace Commands
7165

7266
If you're working with a specific workspace you can run commands within that specific workspace (package) by pre-pending the yarn command like so:
7367

7468
`yarn workspace [workspace-package-name] [command]`
7569

76-
E.g.: `yarn workspace @looker/components build:es`
70+
E.g.: `yarn workspace playground develop`
7771

7872
# Publishing Components
7973

80-
We follow a [semantic versioning scheme](https://semver.org/). That means:
74+
See [RELEASING](./RELEASING.md)
8175

82-
1. API changes are only allowed in major version changes.
83-
1. Backwards compatible API changes can occur in minor version changes.
84-
1. Bug fixes occur in patch version changes.
85-
1. Publishing and release processes are handled by our CI/CD workflows
76+
# Tooling
8677

87-
### 4. Tooling
88-
89-
### Automate code formatting and correctness whenever possible
78+
## Automate code formatting and correctness whenever possible
9079

9180
This project takes the perspective that, as much as possible, code style (code formatting, alignment, interchangeable idioms, etc) should be dictated by automated tooling. This means tooling that can statically analyze code and actually rewrite it, either for the purpose of consistent formatting or correctness. This approach not only saves time by eliminating arguments about preferred code styles, it also reduces arbitrary diff noise for code reviewers, and decreases an engineer's overhead needed to keep code consistent with a code style or linter.
9281

93-
#### Use lint rules to eliminate dangerous anti-patterns
82+
## Use lint rules to eliminate dangerous anti-patterns
9483

9584
When automated tooling cannot reformat code without causing logical errors, this project employs linter rules to ensure it produces consistent, correct code. An example of one of these rules is the TSLint `no-namespace` rule. Namespacing, while a valid feature in Typescript, is the byproduct of Typescript evolving during a time when ES6 style modules did not exist (nor did the tooling around them). [Typescript itself calls out ES6 modules as the best approach to code organization moving forward](https://www.typescriptlang.org/docs/handbook/namespaces-and-modules.html#using-modules):
9685

9786
> Starting with ECMAScript 2015, modules are native part of the language, and should be supported by all compliant engine implementations. Thus, for new projects modules would be the recommended code organization mechanism.
9887
9988
To ensure Typescript namespaces are never introduced into this project (because we use ES6 modules), our linter configuration disallows any use of them in code.
10089

101-
#### Automated Tooling
90+
### Automated Tooling
10291

10392
The monorepo leverages with a few code tools baked into the component authoring workflow:
10493

10594
- [Prettier](https://prettier.io/) simply reformats code. It has few options, intentionally, to eliminate discussion about how to configure those options.
10695
- [ESLint](https://eslint.org/) is the standard Javascript & Typescript linting tool. It comes with a `--fix` flag which can fix many of the errors it finds.
10796
- [Stylelint](https://stylelint.io/) lints the CSS code in the app.
10897

109-
##### Using the tooling
98+
### Using the tooling
11099

111100
The majority of the time, using these tools should be transparent as they are hooked into a fast pre-commit hook that is enabled for all developers. If one of the lint or prettier steps fail during the pre-commit hook you'll have to fix the error before committing.
112101

@@ -119,53 +108,31 @@ You can also configure some editors to apply their formatting on save, this is d
119108
- **lint:css** Lint all of the CSS, including inlined CSS
120109
- **lint:ts** Run Typescript compiler to verify type-safety
121110

122-
### 5. IDE Support & Configuration
111+
## IDE Support & Configuration
123112

124113
Code in this project is written in Typescript and the core team uses VSCode as our IDE of choice. Please feel free to add your favorite editor's mechanism of support if you wish.
125114

126-
#### VS Code
115+
### VS Code
127116

128117
A [settings.json](https://github.com/looker-open-source/components/blob/main/.vscode/settings.json) file is checked into the repository, which contains some required settings for VS Code.
129118

130119
Additionally a simplistic [launch.json](https://github.com/looker-open-source/components/blob/main/.vscode/launch.json) file is also included which should allow developers to quickly run and debug tests locally, through the Jest test runner. [This file is based off of the recommendations here](https://github.com/Microsoft/vscode-recipes/tree/main/debugging-jest-tests).
131120

132-
##### Running Tests
121+
#### Running Tests
133122

134123
1. Go to the "Debug" panel in VS Code
135124
2. In the top left choose either "Jest All" or "Jest Current File"
136125
3. Click the Play button
137126

138-
##### Strongly Recommended Plugins
127+
#### Recommended Plugins
139128

140129
- [Styled Components](https://github.com/styled-components/vscode-styled-components) enables sytax highlighting and intellisense for inline CSS.
141130
- [ESLint](https://github.com/Microsoft/vscode-eslint) enables inline linting and fixing of code on save. If you have the older vscode-tslint plugin installed, uninstall it first.
142131

143-
##### Very Helpful Plugins
132+
#### Useful Plugins
144133

145134
- [Spell Check](https://github.com/Jason-Rev/vscode-spell-checker) enables spell checking in code
146135
- [Colorize](https://github.com/kamikillerto/vscode-colorize) displays known colors (string values, hex, rgb, etc) as their actual color value
147136
- [Prettier](https://github.com/prettier/prettier-vscode) enables Prettier code formatting on save
148137
- [Rewrap](https://github.com/stkb/Rewrap) wraps comments at the 80 character column mark automatically
149138
- [Sort Lines](https://github.com/Tyriar/vscode-sort-lines) quickly resort lines of code
150-
151-
# Yarn Link
152-
153-
Since Looker UI Components are often developed in tandem with another repo it can be useful to use Yarn's `link` functionality to develop new components and test the built output without having to commit and publish the changes.
154-
155-
See Yarn's Link documentation (https://yarnpkg.com/lang/en/docs/cli/link/) for setting up the link between the `@looker/components` package and your project.
156-
157-
To work properly you'll need to make this addition to your `webpack.config.js` file:
158-
159-
```
160-
resolve: {
161-
alias: {
162-
'styled-components': path.resolve(
163-
__dirname,
164-
'node_modules',
165-
'styled-components',
166-
),
167-
}
168-
}
169-
```
170-
171-
Finally, only changes that have been built will be reflected in the linked package so run `yarn build` when you want to refresh the locally-built version.

RELEASING.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Releasing
2+
3+
## Definitions
4+
5+
### Semantic Versioning (SemVer)
6+
7+
@looker/components and its sibling packages follow [Semantic Versioning](https://semver.org/).
8+
9+
### Commit Message Types
10+
11+
We generally follow [Angular's types](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type).
12+
13+
- `fix`: a commit of the type fix patches a bug (this correlates with PATCH in Semantic Versioning).
14+
- `feat`: Changes that add a new feature or capability without breaking an existing interface or behavior
15+
16+
If a change does NOT make a change to the build artifacts produced (fix above) you can also use one of these alternative types:
17+
18+
- `docs`: Documentation only changes
19+
- `refactor`: A code change that neither fixes a bug nor adds a feature.
20+
- NOTE: Use this keyword only if absolutely sure that there are no changes to output - if there’s a chance of regression use `fix` or `feature` instead. Refactor keyword should be used judiciously.
21+
- `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc)
22+
- `test`: Adding missing tests or correcting existing tests
23+
24+
### Release Types
25+
26+
#### Patch (bug fixes only)
27+
28+
A patch release is any minor release that only contains bug fixes or changes that don’t alter the code artifact(s) shipped in the library.
29+
30+
Patch release generally only include commits with a `fix` type.
31+
32+
#### Minor
33+
34+
Minor releases contain changes that add or modify features (`feat`) as well as any other commit type as long as none of the changes are "BREAKING" in nature (see [Major](#major) below)
35+
36+
Interfaces and components may be changed as long as the changes only constitute additions or fixes to existing behavior.
37+
38+
#### Major
39+
40+
Major releases include change(s) that removes an existing component or reduces the properties it supports. Significant changes to behavior may also merit a major release. It is generally assumed that an upgrade between major versions (`1.x` to `2.x`) will require developer intervention and downstream integration work.
41+
42+
## Process
43+
44+
Audit possible downstream impacts
45+
46+
- Verify bundle size has not erroneously changed
47+
- Audit for IE11 impacts
48+
- Audit for new dependencies
49+
- Obtain sign-off from contributors that their code is ready for release
50+
51+
### Checklist
52+
53+
- [] Review & polish CHANGELOGs
54+
- [] If edits are required checkout `chore/release` branch and alter `CHANGELOG.md` files as needed.
55+
- [] Note updates to non-devDependencies
56+
- NOTE: "patch" release should NOT include dependency updates unless directly related to a `fix` within the release.
57+
- devDependencies aren’t relevant to consumers and don’t need to be noted
58+
- [] Note any new deprecations (these deprecations will go into effect in the next MAJOR release)
59+
- Newly added deprecations should cause a release to be treated as “Minor” instead of a “Patch” release.
60+
- [] Push changes to `chore/release` branch
61+
- [] Approve `chore: Release` pull request
62+
- [] Merge `chore: Release` pull request. During the squash-merge process rewrite the commit title to `CHANGELOG ${VERSION}` (e.g.: `CHANGELOG 1.2.9`).
63+
- Upon merge CI will automatically:
64+
- Update documentation [components.looker.com](https://components.looker.com)
65+
- Publish Release (https://github.com/looker-open-source/components/releases)
66+
- Publish packages to NPM (example: https://www.npmjs.com/package/@looker/components)
67+
- [] Follow steps outline in “Announcement Channels” per team documentation
68+
69+
### Major
70+
71+
PRE-RELEASE: Write a document describing how to mitigate any breaking changes that are part of the release.
72+
73+
- [] Clearly explain each breaking change
74+
- Make sure to justify changes (for instance how it ties to long-term road-map, improves product quality, or simplifies developer experience)
75+
- [] If a feature is removed and no longer available, offer possible replacement solutions.
76+
- Ideally this would include an automated codemod (if feasible) to allow consumers to quickly make any required adjustments.
77+
78+
## Backports
79+
80+
Changes should always land in `HEAD` (currently `main` in `looker-open-source/components repository`) sometimes those fixes are valuable to users of a previous version.
81+
82+
Each MINOR version should have a release branch (`release-1.1` for instance). AFTER applying a bug-fix to `HEAD` checkout the release branch you’d like to patch, `cherry-pick` the relevant commit(s) and open a Pull Request against the release branch.
83+
84+
NOTE: Releasing backport versions is currently a manual process. Automation TBD.

0 commit comments

Comments
 (0)