Skip to content

Commit

Permalink
switch from lerna to changesets for versioning and publishing (#5274)
Browse files Browse the repository at this point in the history
* chore: get rid of lerna and install changesets

* chore: dont ignore demos in changesets

* chore: add deprecation notice for global CHANGELOG.md

* chore: remove commitlint from husky

* update package-lock

* join pre track for develop

* add new publish workflow with changesets

* update CONTRIBUTING guidelines

* fix typo in CONTRIBUTING

* update PR template

* rename release script to publish

* added pre actions

* use singular workflow for publishing
  • Loading branch information
bdbch authored Jun 27, 2024
1 parent de04a9f commit 58e43bb
Show file tree
Hide file tree
Showing 12 changed files with 6,593 additions and 14,587 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)
13 changes: 13 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [
["@tiptap/*"]
],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
62 changes: 62 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"mode": "pre",
"tag": "pre",
"initialVersions": {
"tiptap-demos": "2.4.0",
"@tiptap/core": "2.4.0",
"@tiptap/extension-blockquote": "2.4.0",
"@tiptap/extension-bold": "2.4.0",
"@tiptap/extension-bubble-menu": "2.4.0",
"@tiptap/extension-bullet-list": "2.4.0",
"@tiptap/extension-character-count": "2.4.0",
"@tiptap/extension-code": "2.4.0",
"@tiptap/extension-code-block": "2.4.0",
"@tiptap/extension-code-block-lowlight": "2.4.0",
"@tiptap/extension-collaboration": "2.4.0",
"@tiptap/extension-collaboration-cursor": "2.4.0",
"@tiptap/extension-color": "2.4.0",
"@tiptap/extension-document": "2.4.0",
"@tiptap/extension-dropcursor": "2.4.0",
"@tiptap/extension-floating-menu": "2.4.0",
"@tiptap/extension-focus": "2.4.0",
"@tiptap/extension-font-family": "2.4.0",
"@tiptap/extension-gapcursor": "2.4.0",
"@tiptap/extension-hard-break": "2.4.0",
"@tiptap/extension-heading": "2.4.0",
"@tiptap/extension-highlight": "2.4.0",
"@tiptap/extension-history": "2.4.0",
"@tiptap/extension-horizontal-rule": "2.4.0",
"@tiptap/extension-image": "2.4.0",
"@tiptap/extension-italic": "2.4.0",
"@tiptap/extension-link": "2.4.0",
"@tiptap/extension-list-item": "2.4.0",
"@tiptap/extension-list-keymap": "2.4.0",
"@tiptap/extension-mention": "2.4.0",
"@tiptap/extension-ordered-list": "2.4.0",
"@tiptap/extension-paragraph": "2.4.0",
"@tiptap/extension-placeholder": "2.4.0",
"@tiptap/extension-strike": "2.4.0",
"@tiptap/extension-subscript": "2.4.0",
"@tiptap/extension-superscript": "2.4.0",
"@tiptap/extension-table": "2.4.0",
"@tiptap/extension-table-cell": "2.4.0",
"@tiptap/extension-table-header": "2.4.0",
"@tiptap/extension-table-row": "2.4.0",
"@tiptap/extension-task-item": "2.4.0",
"@tiptap/extension-task-list": "2.4.0",
"@tiptap/extension-text": "2.4.0",
"@tiptap/extension-text-align": "2.4.0",
"@tiptap/extension-text-style": "2.4.0",
"@tiptap/extension-typography": "2.4.0",
"@tiptap/extension-underline": "2.4.0",
"@tiptap/extension-youtube": "2.4.0",
"@tiptap/html": "2.4.0",
"@tiptap/pm": "2.4.0",
"@tiptap/react": "2.4.0",
"@tiptap/starter-kit": "2.4.0",
"@tiptap/suggestion": "2.4.0",
"@tiptap/vue-2": "2.4.0",
"@tiptap/vue-3": "2.4.0"
},
"changesets": []
}
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- Add any other notes or screenshots about the PR here. -->

## Checklist
- [ ] I have renamed my PR according to the naming conventions. (e.g. `feat: Implement new feature` or `chore(deps): Update dependencies`)
- [ ] I have created a [changeset](https://github.com/changesets/changesets) for this PR if necessary.
- [ ] My changes do not break the library.
- [ ] I have added tests where applicable.
- [ ] I have followed the project guidelines.
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Publish

on:
push:
branches:
- main
- develop

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node 20
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/

- name: Install Dependencies
run: npm ci

- name: Create Release PR or publish stable version to npm
if: github.ref_name == 'main'
id: changesets
uses: changesets/action@v1
with:
publish: npm run publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}

- name: Create Release PR or publish pre version to npm
if: github.ref_name != 'main'
id: changesets_pre
uses: changesets/action@v1
with:
publish: npm run publish:pre
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}

- name: Send release notification
if: steps.changesets.outputs.published == 'true' || steps.changesets_pre.outputs.published == 'true'
id: slack
uses: slackapi/[email protected]
with:
payload: |
{
"message": "[Tiptap Editor Release]: New Tiptap Editor version has been released to NPM."
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

- name: Send failure notification
if: failure()
id: slack_failure
uses: slackapi/[email protected]
with:
payload: |
{
"message": "[Tiptap Editor Release]: There was an issue publishing a new version."
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
31 changes: 0 additions & 31 deletions .github/workflows/release.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .husky/commit-msg

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Before submitting a pull request:
Before commiting:

- Make sure to run the tests and linter before committing your changes.
- Write [conventional commit messages](https://www.conventionalcommits.org/en). You can use `npm run cz` for that.
- If you are making changes to one of the packages, make sure to **always** include a [changeset](https://github.com/changesets/changesets) in your PR describing **what changed** with a **description** of the change. Those are responsible for changelog creation

## Requirements

Expand Down
12 changes: 0 additions & 12 deletions lerna.json

This file was deleted.

Loading

0 comments on commit 58e43bb

Please sign in to comment.