Skip to content

Commit ee9302a

Browse files
SarahSoutoulmanovotnyclaude
authored
ci(repo): restore release-triggered TypeDoc sync (#9988)
Co-authored-by: Michael Novotny <manovotny@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 2eae624 commit ee9302a

5 files changed

Lines changed: 33 additions & 17 deletions

File tree

‎.changeset/fix-typedoc-workflow.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

‎.github/workflows/pr-title-linter.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ jobs:
3434
PR_TITLE: ${{ github.event.pull_request.title }}
3535
run: |
3636
npm init --scope=clerk --yes
37-
npm i --save-dev @commitlint/config-conventional @commitlint/cli globby --audit=false --fund=false
37+
npm i --save-dev @commitlint/config-conventional @commitlint/cli --audit=false --fund=false
3838
echo "$PR_TITLE" | npm exec @commitlint/cli -- --config commitlint.config.ts

‎.github/workflows/release.yml‎

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ jobs:
130130

131131
- name: Trigger workflows on related repos
132132
if: steps.changesets.outputs.published == 'true'
133-
continue-on-error: true
134133
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
135134
with:
136135
result-encoding: string
@@ -148,17 +147,25 @@ jobs:
148147
const targets = [
149148
{ repo: 'sdk-infra-workers', workflow_id: 'update-pkg-versions.yml', inputs: { clerkjsVersion, clerkUiVersion } },
150149
{ repo: 'dashboard', workflow_id: 'prepare-nextjs-sdk-update.yml', inputs: { version: nextjsVersion } },
151-
{ repo: 'clerk-docs', workflow_id: 'typedoc.yml' },
150+
{ repo: 'clerk', workflow_id: 'docs-typedoc.yml', inputs: { javascript_ref: context.sha }, critical: true },
152151
];
153152
const results = await Promise.allSettled(
154-
targets.map(t => github.rest.actions.createWorkflowDispatch({ owner: 'clerk', ref: 'main', ...t }))
153+
targets.map(({ repo, workflow_id, inputs }) =>
154+
github.rest.actions.createWorkflowDispatch({ owner: 'clerk', repo, workflow_id, ref: 'main', inputs })
155+
)
155156
);
156157
const failures = results
157158
.map((r, i) => r.status === 'rejected' ? { target: targets[i], reason: r.reason } : null)
158159
.filter(Boolean);
159160
if (failures.length) {
160-
failures.forEach(f => core.error(`Dispatch to ${f.target.repo}/${f.target.workflow_id} failed: ${f.reason?.message ?? f.reason}`));
161-
core.setFailed(`${failures.length} downstream dispatch(es) failed`);
161+
failures.forEach(f => {
162+
const message = `Dispatch to ${f.target.repo}/${f.target.workflow_id} failed: ${f.reason?.message ?? f.reason}`;
163+
if (f.target.critical) {
164+
core.setFailed(message);
165+
} else {
166+
core.warning(message);
167+
}
168+
});
162169
}
163170
} else{
164171
core.warning("Changeset in pre-mode should not prepare a ClerkJS production release")
@@ -171,7 +178,6 @@ jobs:
171178
# if the packages are already live.
172179
- name: Recover downstream notifications
173180
if: always() && steps.changesets.conclusion == 'failure'
174-
continue-on-error: true
175181
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
176182
with:
177183
result-encoding: string
@@ -230,24 +236,32 @@ jobs:
230236
const targets = [
231237
{ repo: 'sdk-infra-workers', workflow_id: 'update-pkg-versions.yml', inputs: { clerkjsVersion, clerkUiVersion } },
232238
{ repo: 'dashboard', workflow_id: 'prepare-nextjs-sdk-update.yml', inputs: { version: nextjsVersion } },
233-
{ repo: 'clerk-docs', workflow_id: 'typedoc.yml' },
239+
{ repo: 'clerk', workflow_id: 'docs-typedoc.yml', inputs: { javascript_ref: context.sha }, critical: true },
234240
];
235241
const results = await Promise.allSettled(
236-
targets.map(t => github.rest.actions.createWorkflowDispatch({ owner: 'clerk', ref: 'main', ...t }))
242+
targets.map(({ repo, workflow_id, inputs }) =>
243+
github.rest.actions.createWorkflowDispatch({ owner: 'clerk', repo, workflow_id, ref: 'main', inputs })
244+
)
237245
);
238246
const failures = results
239247
.map((r, i) => r.status === 'rejected' ? { target: targets[i], reason: r.reason } : null)
240248
.filter(Boolean);
241249
if (failures.length) {
242-
failures.forEach(f => core.error(`Recovery dispatch to ${f.target.repo}/${f.target.workflow_id} failed: ${f.reason?.message ?? f.reason}`));
243-
core.setFailed(`${failures.length} recovery dispatch(es) failed`);
250+
failures.forEach(f => {
251+
const message = `Recovery dispatch to ${f.target.repo}/${f.target.workflow_id} failed: ${f.reason?.message ?? f.reason}`;
252+
if (f.target.critical) {
253+
core.setFailed(message);
254+
} else {
255+
core.warning(message);
256+
}
257+
});
244258
} else {
245259
core.notice('Recovery dispatch completed successfully');
246260
}
247261
248262
- name: Generate notification payload
249263
id: notification
250-
if: steps.changesets.outputs.published == 'true'
264+
if: ${{ !cancelled() && steps.changesets.outputs.published == 'true' }}
251265
env:
252266
PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
253267
GH_ACTOR: ${{ github.actor }}
@@ -261,7 +275,7 @@ jobs:
261275
262276
- name: Send commit log to Slack
263277
id: slack
264-
if: steps.changesets.outputs.published == 'true'
278+
if: ${{ !cancelled() && steps.changesets.outputs.published == 'true' && steps.notification.outcome == 'success' }}
265279
uses: slackapi/slack-github-action@fcfb566f8b0aab22203f066d80ca1d7e4b5d05b3 # v1.27.1
266280
with:
267281
payload: ${{ steps.notification.outputs.payload }}

‎docs/CICD.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ A stable release will be triggered every time the "ci(repo): Version packages" P
1414
- All SDKs will be published to `npm`, except for those found in the excluded packages list in `.changeset/config.json`, or any packages with `private: true` set in their `package.json` file.
1515
- A workflow dispatch will be triggered to update the `clerkjs-proxy` worker in `clerk/sdk-infra-workers`.
1616
- A workflow dispatch will be triggered to update the `@clerk/nextjs` version in `clerk/dashboard`.
17-
- A workflow dispatch will be triggered to update the typedoc generated docs in `clerk/clerk-docs`.
17+
- A workflow dispatch will be triggered to update the generated TypeDoc files in `clerk/clerk` under `clerk-docs/clerk-typedoc/`.
1818

1919
For details regarding the package versioning/publishing process, refer to the [Publishing docs](https://github.com/clerk/javascript/blob/main/docs/PUBLISH.md).
2020

‎docs/CONTRIBUTING.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,17 +192,17 @@ For a comprehensive guide on **authoring** JSDoc/Typedoc comments, see [this gui
192192

193193
To review your changes locally, you can run `pnpm run typedoc:generate` to generate the docs. Afterwards, you can inspect the MDX files inside `.typedoc/docs`. But if you want to preview how the Typedoc output will look in Clerk Docs, there's a few things you need to do first:
194194

195-
Create a PR that includes your changes to any Typedoc comments. Once the PR has been merged and a release is published, a PR will [automatically](https://github.com/clerk/clerk-docs/blob/main/.github/workflows/typedoc.yml) be opened in `clerk-docs` to merge in the Typedoc changes.
195+
Create a PR that includes your changes to any Typedoc comments. Once the PR has been merged and a release is published, the release workflow automatically opens a PR in Clerk's docs repository with the Typedoc changes.
196196

197197
Typedoc output is embedded in `clerk-docs` files with the `<Typedoc />` component. For example, if you updated Typedoc comments for the `useAuth()` hook in `clerk/javascript`, you'll need to make sure that in `clerk-docs`, in the `/hooks/use-auth.mdx` file, there's a `<Typedoc />` component linked to the `./clerk-typedoc/react/use-auth.mdx` file, like:
198198

199199
```mdx
200200
<Typedoc src='react/use-auth' />
201201
```
202202

203-
Read more about this in the [`clerk-docs` CONTRIBUTING.md](https://github.com/clerk/clerk-docs/blob/main/CONTRIBUTING.md#typedoc-).
203+
Read more about this in the [`clerk-docs` CONTRIBUTING.md](https://github.com/clerk/clerk-docs/blob/main/contributing/CONTRIBUTING.md#typedoc-).
204204

205-
Then, to preview how the `<Typedoc />` component renders, the `clerk-docs` PR will have a Vercel preview. Or to get local previews set up, see the [section in `clerk/clerk` about setting up local docs](https://github.com/clerk/clerk?tab=readme-ov-file#5-optional-set-up-local-docs).
205+
Then, to preview how the `<Typedoc />` component renders, that docs PR will have a Vercel preview. Or to get local previews set up, see the [section in `clerk/clerk` about setting up local docs](https://github.com/clerk/clerk?tab=readme-ov-file#5-optional-set-up-local-docs).
206206

207207
### Experimental and internal APIs
208208

0 commit comments

Comments
 (0)