You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+6-13Lines changed: 6 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,20 +51,9 @@ feat(NewComponentName): Component to support exciting new thing
51
51
chore(deps): Updated package dependency X from 1.0.2 to 1.0.6
52
52
```
53
53
54
-
#### Types
54
+
#### Commit Message Types
55
55
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.
68
57
69
58
#### Scope
70
59
@@ -74,6 +63,10 @@ Specify a scope when your change is focused on a specific component or portion o
74
63
feat(Button): Now supports even more colors 🌈
75
64
```
76
65
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
+
77
70
### Developer Checklist
78
71
79
72
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.
Copy file name to clipboardExpand all lines: README.md
+17-50Lines changed: 17 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,18 +15,19 @@ Please file issues on [Github Issues](https://github.com/looker-open-source/comp
15
15
16
16
# Setting up
17
17
18
-
### Install Yarn
18
+
## Yarn
19
19
20
20
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.
21
21
22
22
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.
23
23
24
24
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`
We follow a [semantic versioning scheme](https://semver.org/). That means:
74
+
See [RELEASING](./RELEASING.md)
81
75
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
86
77
87
-
### 4. Tooling
88
-
89
-
### Automate code formatting and correctness whenever possible
78
+
## Automate code formatting and correctness whenever possible
90
79
91
80
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.
92
81
93
-
####Use lint rules to eliminate dangerous anti-patterns
82
+
## Use lint rules to eliminate dangerous anti-patterns
94
83
95
84
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):
96
85
97
86
> 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.
98
87
99
88
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.
100
89
101
-
####Automated Tooling
90
+
### Automated Tooling
102
91
103
92
The monorepo leverages with a few code tools baked into the component authoring workflow:
104
93
105
94
-[Prettier](https://prettier.io/) simply reformats code. It has few options, intentionally, to eliminate discussion about how to configure those options.
106
95
-[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.
107
96
-[Stylelint](https://stylelint.io/) lints the CSS code in the app.
108
97
109
-
#####Using the tooling
98
+
### Using the tooling
110
99
111
100
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.
112
101
@@ -119,53 +108,31 @@ You can also configure some editors to apply their formatting on save, this is d
119
108
-**lint:css** Lint all of the CSS, including inlined CSS
120
109
-**lint:ts** Run Typescript compiler to verify type-safety
121
110
122
-
### 5. IDE Support & Configuration
111
+
## IDE Support & Configuration
123
112
124
113
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.
125
114
126
-
####VS Code
115
+
### VS Code
127
116
128
117
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.
129
118
130
119
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).
131
120
132
-
#####Running Tests
121
+
#### Running Tests
133
122
134
123
1. Go to the "Debug" panel in VS Code
135
124
2. In the top left choose either "Jest All" or "Jest Current File"
136
125
3. Click the Play button
137
126
138
-
##### Strongly Recommended Plugins
127
+
#### Recommended Plugins
139
128
140
129
-[Styled Components](https://github.com/styled-components/vscode-styled-components) enables sytax highlighting and intellisense for inline CSS.
141
130
-[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.
142
131
143
-
##### Very Helpful Plugins
132
+
####Useful Plugins
144
133
145
134
-[Spell Check](https://github.com/Jason-Rev/vscode-spell-checker) enables spell checking in code
146
135
-[Colorize](https://github.com/kamikillerto/vscode-colorize) displays known colors (string values, hex, rgb, etc) as their actual color value
147
136
-[Prettier](https://github.com/prettier/prettier-vscode) enables Prettier code formatting on save
148
137
-[Rewrap](https://github.com/stkb/Rewrap) wraps comments at the 80 character column mark automatically
149
138
-[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.
@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`).
- 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