Skip to content

Commit 4a745fc

Browse files
committed
Merge branch 'main' into add-draft-mode-support
2 parents 32d69a5 + a7c5002 commit 4a745fc

33 files changed

Lines changed: 2223 additions & 3953 deletions

.babelrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/happy-singers-hammer.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Setup CI
2+
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Setup Node.js
7+
uses: actions/setup-node@v6
8+
with:
9+
node-version-file: ".node-version"
10+
cache: yarn
11+
12+
- name: Install dependencies
13+
shell: bash
14+
run: yarn install --frozen-lockfile

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "npm" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Node CI
22

3-
on: [pull_request]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
48

59
jobs:
610
build:
@@ -9,16 +13,14 @@ jobs:
913
runs-on: ubuntu-latest
1014

1115
steps:
12-
- name: Checkout Repo
13-
uses: actions/checkout@v2
14-
15-
- name: Use Node.js 20
16-
uses: actions/setup-node@v1
16+
- uses: actions/checkout@v4
1717
with:
18-
node-version: 20.x
18+
ref: ${{ github.event.pull_request.head.sha }}
19+
20+
- uses: ./.github/actions/ci-setup
1921

20-
- name: Install Dependencies
21-
run: yarn --frozen-lockfile
22+
- name: Typecheck
23+
run: yarn typecheck
2224

2325
- name: Test
2426
run: yarn test

.github/workflows/release-pr.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Release PR
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
release_check:
9+
if: github.repository == 'changesets/action' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/release-pr')
10+
runs-on: ubuntu-latest
11+
steps:
12+
- id: report_in_progress
13+
run: |
14+
echo "in_progress_reaction_id=$(gh api /repos/${{github.repository}}/issues/comments/${{github.event.comment.id}}/reactions -f content='eyes' --jq '.id')" >> "$GITHUB_OUTPUT"
15+
env:
16+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
18+
- id: check_authorization
19+
run: |
20+
if [[ $AUTHOR_ASSOCIATION == 'MEMBER' || $AUTHOR_ASSOCIATION == 'OWNER' || $AUTHOR_ASSOCIATION == 'COLLABORATOR' ]]
21+
then
22+
echo "User is authorized to release"
23+
else
24+
echo "User is not authorized to release"
25+
exit 1
26+
fi
27+
env:
28+
AUTHOR_ASSOCIATION: ${{ github.event.comment.author_association }}
29+
30+
outputs:
31+
in_progress_reaction_id: ${{ steps.report_in_progress.outputs.in_progress_reaction_id }}
32+
33+
release:
34+
if: github.repository == 'changesets/action'
35+
timeout-minutes: 20
36+
runs-on: ubuntu-latest
37+
needs: release_check
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: ./.github/actions/ci-setup
41+
42+
- name: Checkout pull request
43+
run: gh pr checkout ${{ github.event.issue.number }}
44+
env:
45+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
47+
- name: Check if Version Packages PR
48+
id: check_version_packages
49+
run: |
50+
echo "version_packages=$(gh pr view ${{ github.event.issue.number }} --json headRefName --jq '.headRefName|startswith("changeset-release/")')" >> "$GITHUB_OUTPUT"
51+
env:
52+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
54+
- name: Reset Version Packages PR
55+
if: steps.check_version_packages.outputs.version_packages == 'true'
56+
run: git reset --hard HEAD~1
57+
58+
- run: yarn changeset version --snapshot pr${{ github.event.issue.number }}
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- name: Build
63+
run: yarn build
64+
65+
- name: Setup Git user
66+
run: |
67+
git config --global user.name "github-actions[bot]"
68+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
69+
70+
- name: Release snapshot version
71+
run: yarn run release:pr
72+
73+
- run: gh api /repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions -f content='rocket'
74+
env:
75+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
77+
- run: gh api -X DELETE /repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions/${{ needs.release_check.outputs.in_progress_reaction_id }}
78+
env:
79+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
81+
- run: gh pr comment ${{ github.event.issue.number }} --body "The [${{ github.repository }}@$(git rev-parse HEAD)](https://github.com/${{ github.repository }}/commit/$(git rev-parse HEAD)) release triggered by [this comment](${{ github.event.comment.url }}) has [succeeded](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})."
82+
env:
83+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
85+
report-failure-if-needed:
86+
needs: [release_check, release]
87+
timeout-minutes: 2
88+
runs-on: ubuntu-latest
89+
if: failure() && github.repository == 'changesets/action' && (needs.release_check.result == 'failure' || needs.release.result == 'failure')
90+
steps:
91+
- run: gh api /repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions -f content='-1'
92+
env:
93+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
95+
- run: gh api -X DELETE /repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions/${{ needs.release_check.outputs.in_progress_reaction_id }}
96+
env:
97+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98+
99+
- run: gh pr comment ${{ github.event.issue.number }} --body "The release triggered by [this comment](${{ github.event.comment.url }}) has [failed](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})."
100+
env:
101+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102+
GH_REPO: ${{ github.repository }}

.github/workflows/version-or-publish.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,8 @@ jobs:
1111
changesets:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: Checkout Repo
15-
uses: actions/checkout@v2
16-
17-
- name: Use Node.js 20
18-
uses: actions/setup-node@v1
19-
with:
20-
node-version: 20.x
21-
22-
- name: Install Dependencies
23-
run: yarn --frozen-lockfile
14+
- uses: actions/checkout@v4
15+
- uses: ./.github/actions/ci-setup
2416

2517
- name: Build
2618
run: yarn build

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v24.11.0

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
3+
"version": "0.2.0",
4+
"configurations": [
5+
{
6+
"type": "node",
7+
"request": "launch",
8+
"name": "Debug Current Test File",
9+
"autoAttachChildProcesses": true,
10+
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
11+
"args": ["run", "${relativeFile}"],
12+
"smartStep": true,
13+
"console": "integratedTerminal"
14+
}
15+
]
16+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

0 commit comments

Comments
 (0)