Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works with mono-repos or single package repos to help you verion and release your code. You can find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in [our documentation](https://github.com/changesets/changesets/blob/master/docs/common-questions.md)
75 changes: 75 additions & 0 deletions .changeset/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
const changesetOptions = {
// If true, we will automatically commit the changeset when the command is run
commit: false,
};

// This function takes information about a changeset to generate an entry for it in your
// changelog. We provide the full changeset object as well as the version.
// It may be a good idea to replace the commit hash with a link to the commit.

/* the default shape is:
### Bump Type

- GIT_HASH: A summary message you wrote, indented?
*/

const getReleaseLine = async (changeset, type) => {
const [firstLine, ...futureLines] = changeset.summary
.split('\n')
.map(l => l.trimRight());

return `- ${changeset.commit}: ${firstLine}\n${futureLines
.map(l => ` ${l}`)
.join('\n')}`;
};

// This function takes information about what dependencies we are updating in the package.
// It provides an array of related changesets, as well as the dependencies updated.

/*
- Updated dependencies: [ABCDEFG]:
- Updated dependencies: [HIJKLMN]:
- [email protected]
- [email protected]
*/
const getDependencyReleaseLine = async (changesets, dependenciesUpdated) => {
if (dependenciesUpdated.length === 0) return '';

const changesetLinks = changesets.map(
changeset => `- Updated dependencies [${changeset.commit}]:`,
);

const updatedDepenenciesList = dependenciesUpdated.map(
dependency => ` - ${dependency.name}@${dependency.version}`,
);

return [...changesetLinks, ...updatedDepenenciesList].join('\n');
};

const versionOptions = {
// If true, we will automatically commit the version updating when the command is run
commit: false,
// Adds a skipCI flag to the commit - only valid if `commit` is also true.
skipCI: false,
// Do not modify the `changelog.md` files for packages that are updated
updateChangelog: true,
// A function that returns a string. It takes in options about a change. This allows you to customise your changelog entries
getReleaseLine,
// A function that returns a string. It takes in options about when a pacakge is updated because
getDependencyReleaseLine,
// An array of arrays that defines packages that are linked.
// Linked packages are packages that should be at the same version when they're released.
// If you've used Lerna to version packages before, this is very similar.
linked: [[]],
};

const publishOptions = {
// This sets whether unpublished packages are public by default. We err on the side of caution here.
public: false,
};

module.exports = {
versionOptions,
changesetOptions,
publishOptions,
};
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,15 @@ yarn test

## Commiting

We follow conventional commits with our commit messages.
When making a PR that contains changes that should be included in a package's changelog, be sure to do so by running:

```
<type>[optional scope]: <description>
yarn changeset
```

### Options:
This will generate a `changes.json` file, keeping track of version upgrades and update descriptions. We follow semver conventions for versioning, so each change will either be major, minor, or patch.

**Types:** `fix:` (patch), `feat:` (minor change), `breaking change:` (major change), `chore:`, `docs:`, `style:`, `perf:`, `test:`. For more information visit [Conventional Commits.](https://www.conventionalcommits.org/en/v1.0.0-beta.4/)

**Scopes:** can be any of the components within the `packages` directory. If your commit does not directly relate to one of the packages, or includes multiple, omit the optional scope.
Make sure that the PR includes the changes made by running this command.

## Publishing

Expand All @@ -102,13 +100,25 @@ yarn ts

2. Create a new branch, and make sure to push it. This is where package version updates, and git tags will be pushed from.

3. Publish all packages to NPM using Lerna. In the future, this will also include automatic changelog creation.
3. Generate a changeset for each package.

```
yarn changeset bump
Copy link
Collaborator

Choose a reason for hiding this comment

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

Need to also commit these changes too right?

When do we commit?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated!

```

Make sure changes made from this commmand are merged back into master before releasing.

4. Publish all packages to NPM using Changesets.

```
yarn release
```

4. Push the branch you created, and make a pull request. It will contain all `package.json` changes for your publish.
5. Push the branch you created, and make a pull request. It will contain all `package.json` changes for your publish.

```
git push --follow-tags
```

## Deploy gh-pages

Expand Down
13 changes: 4 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@
"test": "jest --env jsdom",
"ts": "tsc --build tsconfig.json",
"prepublishOnly": "yarn lint && yarn test && yarn build",
"release": "lerna publish --no-commit-hooks",
"release": "yarn changeset release --public",
"release:site": "gh-pages --dist storybook/public"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-push": "yarn lint"
}
},
Expand All @@ -53,9 +52,7 @@
"@babel/preset-typescript": "^7.3.3",
"@babel/register": "7.4.0",
"@babel/runtime": "7.4.3",
"@commitlint/cli": "^7.6.1",
"@commitlint/config-conventional": "^7.6.0",
"@commitlint/config-lerna-scopes": "^7.6.0",
"@changesets/cli": "^1.3.0",
"@emotion/core": "^10.0.10",
"@emotion/styled": "^10.0.11",
"@leafygreen-ui/lib": "^2.1.7",
Expand All @@ -72,6 +69,7 @@
"@types/node": "^11.13.4",
"@types/react": "^16.8.13",
"@types/react-dom": "^16.8.4",
"@types/react-transition-group": "^4.2.0",
"@types/storybook__addon-knobs": "^5.0.0",
"@types/storybook__react": "^4.0.1",
"@types/xml2json": "^0.10.0",
Expand Down Expand Up @@ -121,8 +119,5 @@
"packages": [
"packages/*"
]
},
"dependencies": {
"@types/react-transition-group": "^4.2.0"
}
}
}
Loading