Skip to content

Commit

Permalink
feat(publishing): remove lerna and use standard-version to publish v0…
Browse files Browse the repository at this point in the history
….10 (#979)

* feat: add standard-version, remove lerna, update storybook

* chore(release): 0.10.0-alpha.0

* docs(publishing): make publishing readme

* docs(readme): update readme to link publishing doc

* docs(publishing): add 'yarn build' to script commands and document
  • Loading branch information
jinlee93 authored Apr 15, 2022
1 parent b0314fa commit 7812949
Show file tree
Hide file tree
Showing 7 changed files with 761 additions and 2,798 deletions.
22 changes: 19 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
# Change Log
# Changelog

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [0.10.0-alpha.0](https://github.com/chanzuckerberg/edu-design-system/compare/v0.9.0...v0.10.0-alpha.0) (2022-04-15)


### ⚠ BREAKING CHANGES

* removes color-font tokens

### Features

* add standard-version, remove lerna, update storybook ([ee6b2c8](https://github.com/chanzuckerberg/edu-design-system/commit/ee6b2c8c97ebb0a62ab8731adc9e21d714b64013))
* introduce badges addon for storybook ([#895](https://github.com/chanzuckerberg/edu-design-system/issues/895)) ([156fa72](https://github.com/chanzuckerberg/edu-design-system/commit/156fa729acdb6d141d783426ff3c1d1dc848d49e))
* lock headlessui to 1.4.3 ([3a27bf3](https://github.com/chanzuckerberg/edu-design-system/commit/3a27bf3a7e575a43a7413a8b9ddaa679ab4206f8))
* move components/Icons to src/icons ([b0314fa](https://github.com/chanzuckerberg/edu-design-system/commit/b0314fa074ba589cd4046c71149f50568b0791f7))


* publish to lib/tokens ([7aecb68](https://github.com/chanzuckerberg/edu-design-system/commit/7aecb689fd11aeba6fa5a90ebf02fa5a31478174))

# [0.9.0](https://github.com/chanzuckerberg/edu-design-system/compare/v0.8.0...v0.9.0) (2022-03-08)

Expand Down
35 changes: 2 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The [Education Initiative](https://chanzuckerberg.com/education/)'s design syste

## Setup

Fist install the package.
First install the package.

```bash
# via npm
Expand Down Expand Up @@ -168,38 +168,7 @@ If you're also using styles from a separate library, conflicts may arise rarely
| Build package | `yarn build` |
| Run the component generator | `yarn create-component` |

### Publishing

1. Confirm that all checks are green on CI.
2. Run `git checkout main`
3. Run

```sh
yarn create-releases

# or, if there are breaking changes
yarn create-releases:breaking
```

to bump the package versions, create new git tags, and create git commits. The packages are not published, yet.

4. Confirm that the git tags, git commits, and changelog updates look correct.
5. Run `yarn publish-releases` to publish the packages to the NPM registry.
6. Push commits and tags to the git remote with `git push origin --tags && git push origin main`

**Before the first time you publish**, make sure to:

- set up Two Factor Authentication for your npm account
- run `npm login` in your terminal to generate an access token for publishing

### Note on versioning

We are currently using a _modified_ form of semver where:

- Breaking changes update the _minor_ version
- All other changes (new features, fixes, etc.) update the _patch_ version

Once we publish major version 1, we will begin following conventional semver.
### [Publishing](./docs/publishing.md)

## Project Status

Expand Down
58 changes: 58 additions & 0 deletions docs/publishing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Versioning

EDS uses [SemVer](https://semver.org/) semantic versioning to keep track of ongoing changes to the product. The three types of versions are:

- **Major (X.y.z)** - Major versions contain breaking changes to Education developers' builds.
- **Minor (x.Y.z)** - Minor versions add new features or deprecate existing features without breaking changes.
- **Patch (x.y.Z)** - Patch versions fix defects or optimize existing features without breaking changes.

Look to [this helpful document](http://designsystem.morningstar.com/about/versioning.html) from the Morning Star design system for detailed guidance on versioning.

**Note**: We are currently using a _modified_ form of semver where:

- Breaking changes update the _minor_ version
- All other changes (new features, fixes, etc.) update the _patch_ version

Once we publish major version 1, we will begin following conventional semver.

---

### Releasing a new version of EDS

_Before the first time you publish_, make sure to:

- set up Two Factor Authentication for your npm account
- run `npm login` in your terminal to generate an access token for publishing

#### Publishing steps

1. Confirm that all checks are green on CI.
2. Run `git checkout main`.
3. Run `yarn` to ensure all dependencies are upto date.
4. Run

```
yarn release
# or, if there are breaking changes
yarn release:breaking
```

We use [standard-version](https://github.com/conventional-changelog/standard-version) to increment the version number in `package.json`, create a git tag for the new release, and update `CHANGELOG.md` based on the commit log. The package is not published, yet.

5. Run the last command output by `standard-version`. It will look something like:
```
git push --follow-tags origin <branch> && npm publish
```
6. Communicate the changes via all appropriate channels. <TODO: determine communication strategy for new release>

#### Alpha release
For testing a release to build confidence.

1. Run `yarn` to ensure all dependencies are upto date.
2. Run `yarn build` to build EDS.
3. Run `yarn release:alpha` to use `standard-version` to create appropriate tags and updates.
4. Run the last command output by `standard-version` as above. It will look something like:
```
git push --follow-tags origin <branch> && npm publish
```
8 changes: 0 additions & 8 deletions lerna.json

This file was deleted.

33 changes: 16 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chanzuckerberg/eds",
"version": "0.9.0",
"version": "0.10.0-alpha.0",
"description": "The React-powered design system library for Chan Zuckerberg Initiative education web applications",
"author": "CZI <[email protected]>",
"homepage": "https://github.com/chanzuckerberg/edu-design-system",
Expand Down Expand Up @@ -29,10 +29,6 @@
"build:tokens": "node ./style-dictionary.config.js",
"chromatic": "chromatic",
"create-component": "plop",
"create-releases": "yarn create-releases:conventional patch",
"create-releases:alpha": "yarn create-releases:conventional --preid alpha prerelease",
"create-releases:breaking": "yarn create-releases:conventional minor",
"create-releases:conventional": "lerna version --no-push --conventional-commits --message 'chore(release): %s'",
"deploy:docs": "storybook-to-ghpages --ci",
"generateFlowTypes": "./scripts/generateFlowTypes.sh",
"lint": "yarn run lint:styles && yarn run lint:scripts",
Expand All @@ -42,16 +38,19 @@
"lint:scripts": "eslint --ignore-path .gitignore --ext=js,jsx,ts,tsx .",
"lint:scripts:fix": "yarn run lint:scripts --fix",
"prettier": "prettier --write \"**/*.{js,jsx,ts,tsx}\"",
"publish-releases": "lerna publish from-git --no-push",
"publish-releases:alpha": "yarn publish-releases --dist-tag alpha",
"release": "yarn build && yarn release:patch",
"release:breaking": "yarn build && yarn release:minor",
"release:major": "standard-version --release-as major",
"release:minor": "standard-version --release-as minor",
"release:patch": "standard-version --release-as patch",
"release:alpha": "standard-version --prerelease alpha",
"start": "yarn build:tokens && yarn storybook",
"storybook": "start-storybook -p 6008",
"storybook:axe": "yarn run build:storybook && yarn run storybook:axeOnly",
"storybook:axeOnly": "axe-storybook --build-dir storybook-static",
"test": "jest",
"test:ci": "yarn run test --ci --coverage && cat ./coverage/lcov.info | codecov",
"types": "tsc --noEmit",
"version": "./scripts/updateYarnLockForLerna.sh"
"types": "tsc --noEmit"
},
"size-limit": [
{
Expand Down Expand Up @@ -85,14 +84,14 @@
"@commitlint/prompt-cli": "^16.2.1",
"@geometricpanda/storybook-addon-badges": "^0.2.1",
"@size-limit/preset-small-lib": "^4.12.0",
"@storybook/addon-a11y": "^6.4.19",
"@storybook/addon-essentials": "^6.4.19",
"@storybook/addon-interactions": "^6.4.19",
"@storybook/addon-a11y": "^6.4.22",
"@storybook/addon-essentials": "^6.4.22",
"@storybook/addon-interactions": "^6.4.22",
"@storybook/addon-postcss": "^2.0.0",
"@storybook/react": "^6.4.19",
"@storybook/storybook-deployer": "^2.8.10",
"@storybook/react": "^6.4.22",
"@storybook/storybook-deployer": "^2.8.11",
"@storybook/testing-library": "^0.0.9",
"@storybook/testing-react": "^1.2.3",
"@storybook/testing-react": "^1.2.4",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.4",
"@types/jest": "^27.4.1",
Expand All @@ -109,13 +108,12 @@
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-storybook": "^0.5.6",
"eslint-plugin-storybook": "^0.5.8",
"eslint-plugin-testing-library": "^5.0.5",
"flowgen": "^1.14.1",
"husky": "^4.3.8",
"identity-obj-proxy": "^3.0.0",
"jest": "^27.5.1",
"lerna": "^4.0.0",
"lint-staged": "^10.5.4",
"plop": "^3.0.5",
"postcss": "^8.4.12",
Expand All @@ -126,6 +124,7 @@
"react": "^16.14.0",
"react-dom": "^16.14.0",
"size-limit": "^4.12.0",
"standard-version": "^9.3.2",
"storybook-css-modules-preset": "^1.1.1",
"style-dictionary": "^3.7.0",
"stylelint": "^14.5.3",
Expand Down
20 changes: 0 additions & 20 deletions scripts/updateYarnLockForLerna.sh

This file was deleted.

Loading

0 comments on commit 7812949

Please sign in to comment.