Skip to content
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

Conventional Commits & Changelogs #279

Merged
merged 32 commits into from
Sep 19, 2019
Merged

Conventional Commits & Changelogs #279

merged 32 commits into from
Sep 19, 2019

Conversation

lazd
Copy link
Member

@lazd lazd commented Sep 16, 2019

Todo

Description

This PR adds CHANGELOG.md generation based on conventional commits. In addition, we're now using yarn, bundles are no longer managed by lerna, and a new release process has been added for bundles.

Adopt Conventional Commits

Git hooks are now included that ensure commit messages conform to the conventional commits convention.

This gets us consistency and automatic releases that know exactly what version of a component to release based on the commit messages as well as automatic CHANGELOG generation.

Generate CHANGELOGs

This PR adds CHANGELOG generation for components based on conventional commits and is able to generate CHANGELOGs for bundles as well, linking out to the individual component's CHANGELOG for details.

Custom Spectrum CHANGELOG template

It's pretty and it knows how to link to documentation for bundles. I've asked design to weigh in to see if we can make it prettier.

New release process for bundles

Since the version number of a bundle needs to be in step with the components inside of it, a new gulp updateDeps task was added to analyze the current package.json vs all of the components in the monorepo, update their version numbers if available, and bump the version number of the bundle appropriately. That is, if a component included in the bundle has a patch, minor, or major version bump, the bundle should get one too.

Switch to yarn

It's faster and works based on package.json's workspaces field. Nice.

Codify use of peerDependencies

If a component relies on another component to render the example markup, it should be declared in both devDependencies and peerDependencies.

The release will error out if:

  1. A package is specified in peerDependencies that does not appear in devDependencies
  2. The version of a package is specified in devDependencies satisfy the range defined for that package in peerDependencies

Related Issues

  • SDS-2239 - Implement support for Spectrum CSS releases and changelogs with conventional commits and commitlint
  • SDS-2241 Update CONTRIBUTING.md, ISSUE_TEMPLATE.md, and PULL_REQUEST_TEMPLATE.md
  • SDS-2240 Finalize dependency declaration strategy
  • SDS-2252 Look into lerna link convert instead of lerna bootstrap

Motivation and Context

This helps us perform releases efficiently and document what has changed.

How Has This Been Tested?

Many fake releases.

Bundle changelog: https://git.corp.adobe.com/lawdavis/spectrum-css-lerna-test/blob/ccc/bundles/spectrum-css-compat/CHANGELOG.md

Component changelog: https://git.corp.adobe.com/lawdavis/spectrum-css-lerna-test/blob/ccc/components/calendar/CHANGELOG.md

Screenshots (if appropriate):

Bundle changelog:
image

Component changelog:
image

.travis.yml Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
package.json Show resolved Hide resolved
@@ -0,0 +1,15 @@
### ISC License
Copy link
Member Author

@lazd lazd Sep 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what to do about the fact that this was forked from https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular. We need to reach out to that project's owners and see if this needs to live in their monorepo...

In the mean time, then package is set to private, so we're good.

{{#if isPatch~}}
##
{{~else~}}
#
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I like the fact that patch releases get a smaller heading... Thoughts from others?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like small heading as it is more clear at the first glance.

lerna.json Outdated Show resolved Hide resolved
@lazd lazd force-pushed the ccc branch 3 times, most recently from 3a5edc7 to 1ed924d Compare September 17, 2019 15:17
@lazd lazd added the blocked See description and comments for what is blocking this issue label Sep 18, 2019
@lazd lazd changed the title WIP: Conventional Commits & Changelogs Conventional Commits & Changelogs Sep 18, 2019
.github/CONTRIBUTING.md Outdated Show resolved Hide resolved
@bernhard-adobe bernhard-adobe self-requested a review September 18, 2019 18:20
lazd and others added 19 commits September 18, 2019 17:34
add ignore-optional to yarn config
use yarn to install global gulp-cli package for ci
refactor subrunner to work on arbitrary collections of packages
fix some cwd-induced bugs
only check if peerDependencies satisfy devDependencies, fail if they don't
release all bundles with npm run release-bundles
update docs
@jianliao jianliao merged commit 8163b0b into lerna Sep 19, 2019
@lazd lazd removed the blocked See description and comments for what is blocking this issue label Sep 19, 2019
@GarthDB GarthDB deleted the ccc branch September 21, 2020 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants