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
40 changes: 40 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Changesets

This folder holds pending changesets. Versions, `CHANGELOG.md` files and npm
publishing are driven from them by
[`@changesets/cli`](https://github.com/changesets/changesets)
- see [CONTRIBUTING.md](../CONTRIBUTING.md#changesets) for the full workflow and
[Changeset format](../CONTRIBUTING.md#changeset-format) for the rules this
project expects.

Add one with `yarn changeset`, or write the file by hand:

```markdown
---
"@joint/core": minor
---

dia.Paper - add `originX` and `originY` options to `getFitToContentArea()`
```

The short version of the format:

- **Frontmatter** - which packages this changeset releases, and the bump type
(`patch`, `minor`, `major`). Listing several packages is rare: the body is
copied verbatim into each one's changelog. Prefer one changeset per package.
- **Body** - the changelog entry, one line, `scope - description`. One changeset
becomes exactly one changelog bullet (later lines are folded into that same
bullet, not turned into new ones) - so write no `-`/`*` bullets of your own
and add another changeset file for each further changelog line.
- **Scope** - usually `namespace.Class` (`dia.Paper`, `elementTools.Control`,
`mvc.View`, `layout.MSAGL`), or the component/hook for `@joint/react`
(`<Paper />`, `useCells`). A bare `namespace` (`anchors`, `connectionPoints`)
when the change covers all of it; no scope at all for package-wide,
architectural changes.
- **Description** - less than ~100 characters, lowercase, no trailing period,
verb first. Code artifacts in backticks (`` `changeId` ``,
`` `batch:start` ``, `` `initializeUnmounted: true` ``); functions and
methods always with `()`.

An empty changeset (`yarn changeset add --empty`) marks a PR that touches
releasable files but should not trigger a release.
6 changes: 6 additions & 0 deletions .changeset/clear-maps-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---

---



57 changes: 57 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"$schema": "https://unpkg.com/@changesets/config@4.0.0/schema.json",
"baseBranch": "master",
"access": "public",
"changelog": "@changesets/cli/changelog",
"commit": false,
"ignore": [],
"fixed": [],
"linked": [
[
"@joint/core",
"@joint/layout-directed-graph",
"@joint/layout-msagl"
]
],
"updateInternalDependencies": "patch",
"privatePackages": {
"version": false,
"tag": false
},
"changedFilePatterns": [
"**",
"!**/*.test.{js,jsx,ts,tsx,mjs}",
"!**/test/**",
"!**/__tests__/**",
"!**/__mocks__/**",
"!**/bench/**",
"!**/demo/**",
"!**/stories/**",
"!**/.storybook/**",
"!**/dist/**",
"!**/build/**",
"!**/coverage/**",
"!**/coverage.json",
"!**/.tscache/**",
"!**/scripts/**",
"!**/grunt/**",
"!**/Gruntfile.js",
"!**/Makefile",
"!**/rollup.config.*",
"!**/rollup.resources.mjs",
"!**/vite.config.*",
"!**/vitest.workspace.*",
"!**/jest.config.js",
"!**/jest.react18.config.mjs",
"!**/karma.conf.js",
"!**/tsconfig*.json",
"!**/dts-generator.config.js",
"!**/knip.json",
"!**/typedoc.*",
"!**/.prettierrc*",
"!**/.gitignore",
"!**/eslint.config.mjs",
"!**/*.md",
"!**/LICENSE"
]
}
3 changes: 2 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ Thank you for submitting a pull request!

Please verify that:
* [ ] Code is up-to-date with the `master` branch
* [ ] You've successfully run `grunt test` locally
* [ ] You've successfully run `yarn test` locally
* [ ] If applicable, there are new or updated unit tests validating the change
* [ ] If applicable, there are new or updated @types
* [ ] If applicable, documentation has been updated
* [ ] If the change is releasable, you've added a changeset (`yarn changeset`)
-->

## Description
Expand Down
141 changes: 141 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Release pipeline, driven by Changesets (https://changesets.dev).
#
# On every push to `master` this workflow decides between two modes:
#
# * `version` - there are pending changesets in `.changeset/`. The workflow
# applies the version bumps + per-package `CHANGELOG.md` entries, deletes
# the consumed changesets and opens (or updates) `changeset-release/master`
# PR titled "Version Packages".
# * `publish` - the release PR has been merged, so the versions in `master`
# are ahead of what is on npm. The workflow builds the workspace, publishes
# every changed public package, and creates a git tag + GitHub Release per
# published package.
#
# Nothing is published until the release PR is merged by a maintainer.
#
# Repository setup:
# * Settings > Actions > General > "Allow GitHub Actions to create and approve
# pull requests" must be enabled (needed to open the release PR).
# * Secret `NPM_TOKEN` - an npm automation token that bypasses 2FA.
#
# Note: the release PR is opened by `github-actions[bot]`, so `test-pr.yml` does
# not run on it.
Comment thread
zbynekstara marked this conversation as resolved.
name: Release

on:
push:
branches: [ "master" ]

# Reset permissions and grant them explicitly per job.
permissions: {}

# Never release twice at the same time.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
# Decide whether this push should version or publish.
select-mode:
if: ${{ github.repository == 'clientIO/joint' }}
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
mode: ${{ steps.select-mode.outputs.mode }}
steps:
- name: Checkout joint
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Node.js v22
uses: actions/setup-node@v4
with:
node-version: 22.14.0

- name: Cache Yarn
uses: actions/cache@v4
with:
path: |
.yarn/cache
key: yarn-cache-${{ hashFiles('yarn.lock') }}

- name: Install dependencies
run: yarn install --immutable

- name: Select Changesets mode
id: select-mode
uses: changesets/action/select-mode@v2

# Pending changesets: open/update the "Version Packages" PR.
version:
needs: select-mode
if: ${{ needs.select-mode.outputs.mode == 'version' }}
runs-on: ubuntu-latest
permissions:
contents: write # commit the version bumps
pull-requests: write # open the release PR
steps:
- name: Checkout joint
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Node.js v22
uses: actions/setup-node@v4
with:
node-version: 22.14.0

- name: Cache Yarn
uses: actions/cache@v4
with:
path: |
.yarn/cache
key: yarn-cache-${{ hashFiles('yarn.lock') }}

- name: Install dependencies
run: yarn install --immutable

# Runs `changeset version` and pushes the result to `changeset-release/master`.
- name: Version packages
uses: changesets/action/version@v2

# Release PR merged: build and publish everything that is not on npm yet.
publish:
needs: select-mode
if: ${{ needs.select-mode.outputs.mode == 'publish' }}
runs-on: ubuntu-latest
permissions:
contents: write # push git tags and create GitHub Releases
steps:
- name: Checkout joint
uses: actions/checkout@v4


- name: Setup Node.js v22
uses: actions/setup-node@v4
with:
node-version: 22.14.0
# No `registry-url` on purpose (not used by Yarn)

- name: Cache Yarn
uses: actions/cache@v4
with:
path: |
.yarn/cache
key: yarn-cache-${{ hashFiles('yarn.lock') }}

- name: Install dependencies
run: yarn install --immutable

- name: Build packages
run: yarn dist

# Runs `changeset publish`, which publishes through `yarn npm publish` (Yarn Berry
# is auto-detected), then tags each published package and cuts a GitHub Release.
- name: Publish packages
uses: changesets/action/publish@v2
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# No `NODE_AUTH_TOKEN` on purpose (must use Yarn)
12 changes: 12 additions & 0 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ jobs:
id: install-dependencies
run: yarn install --immutable

# Changing releasable code in a public package must provide a changeset
# (Releasable files are configured in `.changeset/config.json`)
# (Call `yarn changeset add --empty` to opt out of a release)
- name: Check changeset
id: check-changeset
# Release PR is skipped - it consumes all changesets instead
if: ${{ github.event_name == 'pull_request' && !startsWith(github.head_ref, 'changeset-release/') }}
# Compare PR to current committed master
run: |
git fetch --no-tags origin '+refs/heads/master:refs/remotes/origin/master'
yarn changeset status --since=origin/master

# Build the joint project
- name: Prepare joint
id: prepare-joint
Expand Down
Loading