Skip to content

Commit

Permalink
ci: migrate lerna to changesets (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin authored Jul 23, 2022
1 parent 52030ac commit 58e529c
Show file tree
Hide file tree
Showing 12 changed files with 1,304 additions and 3,140 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish 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/main/docs/common-questions.md)
6 changes: 6 additions & 0 deletions .changeset/clean-berries-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"eslint-mdx": patch
"eslint-plugin-mdx": patch
---

fix: resolve circular imports in worker
15 changes: 15 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/@changesets/config/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "mdx-js/eslint-mdx"
}
],
"commit": false,
"linked": [],
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/small-plums-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eslint-plugin-mdx": patch
---

chore(deps): upgrade `eslint-plugin-markdown` to `v3`
5 changes: 5 additions & 0 deletions .changeset/tasty-dodos-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eslint-mdx": patch
---

fix(deps): add missing dependencies for yarn@v2+ and pnpm
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

on:
push:
branches:
- master

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn

- name: Install Dependencies
run: yarn --frozen-lockfile

- name: Create Release Pull Request
id: changesets
uses: changesets/action@v1
with:
commit: 'chore: release package(s)'
title: 'chore: release package(s)'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 7 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ Hi! 👋 We’re excited that you’re interested in contributing!

## Packages Releasing Difference

This project is a [lerna][] monorepo, so packages releasing is controlled by [lerna][].
This project is managed by [changesets][], so packages releasing is controlled by [changesets][].

1. Make sure you have both GitHub repository and npm write permissions at the same time.
2. You need a GitHub token with a `public_repo` scope as `GH_TOKEN` in the environment to publish
3. Run `yarn release` simply, or `GH_TOKEN=xxx yarn release` to export `GH_TOKEN` at one time.

### Release a bete next version

Run `yarn build && yarn release-next`
1. There will be a release PR generated by [changesets][]'s [action](https://github.com/changesets/action) automatically, when the release is ready, you should merge that PR firstly.
2. Then you'll need to pull the latest codes from remote.
3. Make sure you have both GitHub repository and npm write permissions at the same time.
4. You need a GitHub token with a `public_repo` scope as `GITHUB_TOKEN` in the environment to publish
5. Run `yarn release` simply, or `GITHUB_TOKEN=xxx yarn release` to export `GITHUB_TOKEN` at one time.

[changesets]: https://github.com/changesets/changesets
[contributing]: https://mdxjs.com/contributing
[lerna]: https://github.com/lerna/lerna
29 changes: 0 additions & 29 deletions lerna.json

This file was deleted.

18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"workspaces": [
"packages/*"
],
"packageManager": "yarn@1.22.19",
"scripts": {
"build": "run-p build:*",
"build:r": "r -f es2015",
Expand All @@ -20,24 +21,25 @@
"prelint": "yarn build",
"prepare": "patch-package && simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0",
"prerelease": "yarn build",
"release": "lerna publish --conventional-commits --create-release github --yes",
"release-next": "yarn build && lerna publish --conventional-prerelease --preid next --pre-dist-tag next --yes",
"release": "changeset publish",
"test": "jest",
"typecov": "type-coverage"
},
"devDependencies": {
"@1stg/lib-config": "^8.0.0",
"@1stg/lib-config": "^9.0.1",
"@changesets/changelog-github": "^0.4.6",
"@changesets/cli": "^2.24.0",
"@types/eslint": "^8.4.5",
"@types/eslint-plugin-markdown": "^2.0.0",
"@types/jest": "^28.1.4",
"@types/node": "^18.0.3",
"@types/jest": "^28.1.6",
"@types/node": "^18.0.6",
"@types/react": "^18.0.15",
"@types/unist": "^2.0.6",
"lerna": "^5.1.8",
"jest": "^28.1.3",
"patch-package": "^6.4.7",
"react": "^18.2.0",
"ts-jest": "^28.0.5",
"ts-node": "^10.8.2",
"ts-jest": "^28.0.7",
"ts-node": "^10.9.1",
"type-coverage": "^2.22.0",
"typescript": "^4.7.4",
"yarn-deduplicate": "^5.0.0"
Expand Down
6 changes: 5 additions & 1 deletion packages/eslint-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,19 @@
"eslint": ">=8.0.0"
},
"dependencies": {
"acorn": "^8.8.0",
"acorn-jsx": "^5.3.2",
"cosmiconfig": "^7.0.1",
"espree": "^9.3.2",
"estree-util-visit": "^1.1.0",
"remark-mdx": "^2.1.2",
"remark-parse": "^10.0.1",
"remark-stringify": "^10.0.2",
"synckit": "^0.7.2",
"synckit": "^0.8.1",
"tslib": "^2.4.0",
"unified": "^10.1.2",
"unist-util-visit": "^4.1.0",
"uvu": "^0.5.6",
"vfile": "^5.3.4"
}
}
2 changes: 1 addition & 1 deletion packages/eslint-plugin-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
},
"dependencies": {
"eslint-mdx": "^2.0.1",
"eslint-plugin-markdown": "^2.2.1",
"eslint-plugin-markdown": "^3.0.0",
"remark-mdx": "^2.1.2",
"remark-parse": "^10.0.1",
"remark-stringify": "^10.0.2",
Expand Down
Loading

0 comments on commit 58e529c

Please sign in to comment.