Skip to content

Feat/used homebrew remark plugins#282

Merged
stephansama merged 8 commits into
mainfrom
feat/used-homebrew-remark-plugins
May 16, 2026
Merged

Feat/used homebrew remark plugins#282
stephansama merged 8 commits into
mainfrom
feat/used-homebrew-remark-plugins

Conversation

@stephansama
Copy link
Copy Markdown
Owner

Checklist

  • Latest changes from main have been merged
  • Conflicts have been resolved
  • The branch is pointing to main
  • Eslint hasn't reported any issues.
  • All unit tests pass

@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
packages Ready Ready Preview, Comment May 16, 2026 7:22pm

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 16, 2026

🦋 Changeset detected

Latest commit: 46d253e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stephansama/auto-readme Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

Review Change Stack

Warning

Rate limit exceeded

@stephansama has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 51 minutes and 7 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 54cc05a3-57d8-4e1e-88fa-e9c621c6d5e1

📥 Commits

Reviewing files that changed from the base of the PR and between 6d2293a and 46d253e.

📒 Files selected for processing (7)
  • .changeset/full-items-stick.md
  • core/remark-asciinema/README.md
  • core/remark-asciinema/example/index.ts
  • core/typed-events/README.md
  • core/typed-events/example/index.ts
  • core/types-lhci/__snapshots__/tsnapi/index.snapshot.d.ts
  • core/types-lhci/src/index.ts
📝 Walkthrough

Walkthrough

Workspace migration to scoped npm packages, auto-readme integration updates, TypeScript modernization of examples and documentation across all packages, schema optionality refinement for LHCI uploads, and robustness improvements for typed-events examples with DOM guards.

Changes

Scoped packages and example modernization

Layer / File(s) Summary
Workspace dependency migration to scoped packages
pnpm-workspace.yaml, core/auto-readme/package.json, core/auto-readme/src/plugin.ts, .config/autoreadmerc.json
Workspace catalog pins scoped packages @stephansama/mdast-zone and @stephansama/remark-usage; auto-readme dependencies are updated and reorganized to match. Auto-readme configuration points to TypeScript usage file.
Auto-readme pipeline and test integration
core/auto-readme/src/pipeline.ts, core/auto-readme/src/pipeline.test.ts
Pipeline imports reordered and test mocks reorganized to reference the scoped @stephansama/remark-usage package; plugin, utility, and vfile mocks grouped together.
Hook and plugin example TypeScript migration
core/pnpm-hooks/README.md, core/pnpm-hooks/example/index.ts, core/pnpm-hooks/tsconfig.json, core/prettier-plugin-handlebars/README.md, core/prettier-plugin-handlebars/example/index.ts, core/prettier-plugin-handlebars/tsconfig.json, core/remark-asciinema/README.md, core/remark-asciinema/example/index.ts, core/remark-asciinema/tsconfig.json
Examples converted to TypeScript with satisfies type assertions; README snippets updated to show typed imports and assertions; build entry points updated from CJS to ESM where applicable; tsconfig.json files expanded to include example directories.
API and schema example TypeScript migration
core/typed-nocodb-api/README.md, core/typed-nocodb-api/example/index.ts, core/typed-nocodb-api/tsconfig.json, core/types-lhci/README.md, core/types-lhci/example/index.ts, core/types-lhci/src/index.ts, core/types-lhci/__snapshots__/tsnapi/index.snapshot.d.ts, core/types-lhci/tsconfig.json
typed-nocodb-api and types-lhci examples converted to TypeScript with non-null assertions and satisfies checks; LHCI upload schema refined to wrap previously required fields (token, serverBaseUrl, GitHub config) with .partial() to make them optional; snapshot declarations updated to reflect nested ZodOptional wrappers.
typed-events example robustness and documentation
core/typed-events/README.md, core/typed-events/example/index.ts, core/typed-events/tsconfig.json
Examples enhanced with DOM element null checks that throw errors before listener registration; numeric event data coerced via String(...) before DOM assignment; React handler implementations simplified to no-ops; README documentation converted to TypeScript throughout with typed querySelector calls and consistent error guard patterns shown across all event listener/dispatcher examples.
Documentation language labels and configuration cleanup
core/eslint-config/README.md, core/eslint-config/tsconfig.json, core/single-file/README.md, core/single-file/tsconfig.json, core/typed-env/README.md, core/typed-env/example/index.ts, core/typed-env/tsconfig.json, core/typed-templates/README.md, core/typed-templates/example/index.ts, core/typed-templates/tsconfig.json
Code fence language identifiers updated from javascript to typescript in multiple README examples; top-of-file lint/remark suppression directives removed from example files; tsconfig.json files across packages expanded to include example directories in TypeScript project inputs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • stephansama/packages#277: Introduces pnpm hooks readPackageHooks setup; this PR consolidates the hook wiring by migrating core/pnpm-hooks/example from JavaScript to TypeScript with proper type assertions.
  • stephansama/packages#210: Introduces the core/types-lhci package; this PR refines the LHCI upload schema to make previously required fields optional via .partial() wrappers.

Poem

🐰 With scopes and types, examples shine bright,
Package migration done just right—
TypeScript guards keep DOM safe from despair,
Schema fields optional, refined with care. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adopting homebrew/scoped remark plugins (@stephansama namespace) and related updates across the codebase.
Description check ✅ Passed The pull request description includes the required checklist template with all items checked, confirming readiness for merge.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/used-homebrew-remark-plugins

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates several packages to scoped versions of @stephansama/mdast-zone and @stephansama/remark-usage, updates documentation examples to TypeScript using the satisfies operator, and includes example directories in various tsconfig.json files. Feedback highlights a critical runtime error in the lhciUploadSchema where calling .partial() on a discriminated union branch makes the required discriminator optional. Additionally, improvements were suggested for documentation examples to fix broken syntax in code blocks and remove redundant optional chaining after explicit null checks.

Comment thread core/types-lhci/src/index.ts Outdated
"s/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/UUID/ig",
]),
})
.partial(),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Calling .partial() on an object that is a member of a z.discriminatedUnion makes the discriminator field (target) optional. Zod requires the discriminator to be a required literal or enum to correctly identify the union branch. This will cause a runtime error during schema initialization.

Suggested change
.partial(),
.partial().required({ target: true }),

Comment on lines +320 to +324
first(_payload) {
```

```typescript
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The code block is incorrectly split, which breaks the syntax of the example. Merging the blocks and simplifying the method definition makes the example cleaner and valid.

Suggested change
first(_payload) {
```
```typescript
},
first(_payload) {},

Comment thread core/typed-events/README.md Outdated
Comment thread core/typed-events/example/index.ts Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 16, 2026

Open in StackBlitz

@stephansama/ai-commit-msg

pnpm add https://pkg.pr.new/@stephansama/ai-commit-msg@282

@stephansama/alfred-kaomoji

pnpm add https://pkg.pr.new/@stephansama/alfred-kaomoji@282

@stephansama/astro-iconify-svgmap

pnpm add https://pkg.pr.new/@stephansama/astro-iconify-svgmap@282

@stephansama/auto-readme

pnpm add https://pkg.pr.new/@stephansama/auto-readme@282

@stephansama/catppuccin-jsonresume-theme

pnpm add https://pkg.pr.new/@stephansama/catppuccin-jsonresume-theme@282

@stephansama/catppuccin-opml

pnpm add https://pkg.pr.new/@stephansama/catppuccin-opml@282

@stephansama/catppuccin-rss

pnpm add https://pkg.pr.new/@stephansama/catppuccin-rss@282

@stephansama/catppuccin-typedoc

pnpm add https://pkg.pr.new/@stephansama/catppuccin-typedoc@282

@stephansama/catppuccin-xsl

pnpm add https://pkg.pr.new/@stephansama/catppuccin-xsl@282

@stephansama/eslint-config

pnpm add https://pkg.pr.new/@stephansama/eslint-config@282

create-stephansama-example

pnpm add https://pkg.pr.new/create-stephansama-example@282

@stephansama/find-makefile-targets

pnpm add https://pkg.pr.new/@stephansama/find-makefile-targets@282

@stephansama/github-env

pnpm add https://pkg.pr.new/@stephansama/github-env@282

@stephansama/multipublish

pnpm add https://pkg.pr.new/@stephansama/multipublish@282

@stephansama/pnpm-hooks

pnpm add https://pkg.pr.new/@stephansama/pnpm-hooks@282

@stephansama/prettier-plugin-handlebars

pnpm add https://pkg.pr.new/@stephansama/prettier-plugin-handlebars@282

@stephansama/remark-asciinema

pnpm add https://pkg.pr.new/@stephansama/remark-asciinema@282

@stephansama/single-file

pnpm add https://pkg.pr.new/@stephansama/single-file@282

@stephansama/svelte-social-share-links

pnpm add https://pkg.pr.new/@stephansama/svelte-social-share-links@282

@stephansama/typed-env

pnpm add https://pkg.pr.new/@stephansama/typed-env@282

@stephansama/typed-events

pnpm add https://pkg.pr.new/@stephansama/typed-events@282

@stephansama/typed-nocodb-api

pnpm add https://pkg.pr.new/@stephansama/typed-nocodb-api@282

@stephansama/typed-templates

pnpm add https://pkg.pr.new/@stephansama/typed-templates@282

@stephansama/types-github-action-env

pnpm add https://pkg.pr.new/@stephansama/types-github-action-env@282

@stephansama/types-lhci

pnpm add https://pkg.pr.new/@stephansama/types-lhci@282

commit: 46d253e

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

♻️ Duplicate comments (2)
core/typed-events/README.md (2)

93-110: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Remove redundant optional chaining after null check.

Line 99 throws if button is null, so the optional chaining button?.addEventListener on line 103 is redundant.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/typed-events/README.md` around lines 93 - 110, In dispatchEvent(), you
already throw when button is null, so remove the redundant optional chaining on
the addEventListener call: replace the button?.addEventListener(...) usage with
a direct button.addEventListener(...) call (located in the dispatchEvent
function where the click listener is attached) to reflect the guaranteed
non-nullness.

76-89: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Invalid CSS properties x and y on CSSStyleDeclaration.

The properties style.x and style.y do not exist on the standard CSSStyleDeclaration interface. This documentation example will cause TypeScript errors and fail at runtime.

Consider documenting one of these alternatives:

  • CSS transform: item.style.transform = \translate(${event.data.x}px, ${event.data.y}px)``
  • CSS custom properties: item.style.setProperty('--x', String(event.data.x))
  • Direct element properties for SVG: If this is an SVG element, use item.setAttribute('x', String(event.data.x))
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/typed-events/README.md` around lines 76 - 89, The example uses
non-existent CSS properties item.style.x and item.style.y which causes
TypeScript/runtime errors; update the listenForAnimationEvent example to apply
positions via a supported approach (e.g., set item.style.transform =
`translate(${event.data.x}px, ${event.data.y}px)` or use
item.style.setProperty('--x', String(event.data.x)) / '--y' for CSS variables),
or if the element is an SVG use item.setAttribute('x', String(event.data.x)) and
item.setAttribute('y', String(event.data.y)) and adjust the querySelector
generic (HTMLElement → SVGElement) accordingly; keep the same
customAnimationEvent.listen and cleanup handling but replace the invalid
style.x/style.y assignments with one of these valid alternatives.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/remark-asciinema/README.md`:
- Line 61: The README imports the module using a repo-internal path ("import
asciinema from \"../dist/index.mjs\"") which won't work for package consumers;
update the example to import from the published package name (e.g., replace that
import with "import asciinema from 'remark-asciinema'" or the actual npm package
name) so the user-facing documentation demonstrates the public API import
instead of a relative dist path.

In `@core/typed-events/example/index.ts`:
- Line 45: The optional chaining on the event hookup is redundant because
`button` is already null-checked and throws earlier; replace
`button?.addEventListener("click", ...)` with a direct call
`button.addEventListener("click", ...)` (locate the `button` variable and the
`addEventListener` call in the example/index.ts and remove the `?`).

In `@core/typed-events/README.md`:
- Around line 310-330: The React example's TypeScript snippet is split into two
separate code blocks which breaks the ExampleComponent function; merge the
fragments into a single ```typescript``` code block that contains the import of
useListeners, the createBroadcastEvent call (map), and the full export function
ExampleComponent with its useListeners({...}) call (including the first and
second listener bodies and closing braces), ensuring the listener function names
(first, second), the createBroadcastEvent, and ExampleComponent are intact and
properly indented so the example can be copy-pasted and compile.

In `@core/types-lhci/src/index.ts`:
- Around line 88-108: The schema for the "lhci" branch is being made fully
optional by calling .partial(), which inadvertently makes the discriminant
target: z.literal("lhci") optional and breaks the z.discriminatedUnion; after
applying .partial() on the object schema, call .extend({ target:
z.literal("lhci") }) (or otherwise re-define target as a required literal) to
re-assert the discriminator requirement so Zod can correctly route to the lhci
branch; apply this change to the schema expression that currently ends with
.partial().

---

Duplicate comments:
In `@core/typed-events/README.md`:
- Around line 93-110: In dispatchEvent(), you already throw when button is null,
so remove the redundant optional chaining on the addEventListener call: replace
the button?.addEventListener(...) usage with a direct
button.addEventListener(...) call (located in the dispatchEvent function where
the click listener is attached) to reflect the guaranteed non-nullness.
- Around line 76-89: The example uses non-existent CSS properties item.style.x
and item.style.y which causes TypeScript/runtime errors; update the
listenForAnimationEvent example to apply positions via a supported approach
(e.g., set item.style.transform = `translate(${event.data.x}px,
${event.data.y}px)` or use item.style.setProperty('--x', String(event.data.x)) /
'--y' for CSS variables), or if the element is an SVG use item.setAttribute('x',
String(event.data.x)) and item.setAttribute('y', String(event.data.y)) and
adjust the querySelector generic (HTMLElement → SVGElement) accordingly; keep
the same customAnimationEvent.listen and cleanup handling but replace the
invalid style.x/style.y assignments with one of these valid alternatives.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e243e682-ac59-4687-9641-99eee4edffaf

📥 Commits

Reviewing files that changed from the base of the PR and between 91c8f18 and 6d2293a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (39)
  • .config/autoreadmerc.json
  • core/auto-readme/package.json
  • core/auto-readme/src/pipeline.test.ts
  • core/auto-readme/src/pipeline.ts
  • core/auto-readme/src/plugin.ts
  • core/eslint-config/README.md
  • core/eslint-config/example/index.ts
  • core/eslint-config/tsconfig.json
  • core/pnpm-hooks/README.md
  • core/pnpm-hooks/example/index.js
  • core/pnpm-hooks/example/index.ts
  • core/pnpm-hooks/tsconfig.json
  • core/prettier-plugin-handlebars/README.md
  • core/prettier-plugin-handlebars/example/index.ts
  • core/prettier-plugin-handlebars/tsconfig.json
  • core/remark-asciinema/README.md
  • core/remark-asciinema/example/index.ts
  • core/remark-asciinema/tsconfig.json
  • core/single-file/README.md
  • core/single-file/example/index.ts
  • core/single-file/tsconfig.json
  • core/typed-env/README.md
  • core/typed-env/example/index.ts
  • core/typed-env/tsconfig.json
  • core/typed-events/README.md
  • core/typed-events/example/index.ts
  • core/typed-events/tsconfig.json
  • core/typed-nocodb-api/README.md
  • core/typed-nocodb-api/example/index.ts
  • core/typed-nocodb-api/tsconfig.json
  • core/typed-templates/README.md
  • core/typed-templates/example/index.ts
  • core/typed-templates/tsconfig.json
  • core/types-lhci/README.md
  • core/types-lhci/__snapshots__/tsnapi/index.snapshot.d.ts
  • core/types-lhci/example/index.ts
  • core/types-lhci/src/index.ts
  • core/types-lhci/tsconfig.json
  • pnpm-workspace.yaml
💤 Files with no reviewable changes (3)
  • core/pnpm-hooks/example/index.js
  • core/typed-env/example/index.ts
  • core/typed-templates/example/index.ts

Comment thread core/remark-asciinema/README.md Outdated
Comment thread core/typed-events/example/index.ts Outdated
Comment on lines +310 to 330
```typescript
import { useListeners } from "../dist/react.mjs";

const map = createBroadcastEvent("react-example", {
first: z.object({}),
second: z.object({ payload: z.number() }),
first: z.object({}),
second: z.object({ payload: z.number() }),
});

export function ExampleComponent() {
useListeners(map, {
first: () => console.info("first event happened"),
second: ({ data }) => console.info(data.payload),
});
useListeners(map, {
first(_payload) {
```

```typescript
},
second(_payload) {},
});

return; // more jsx...
return; // more jsx...
}
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix broken code block structure in React example.

The useListeners example is split across two separate TypeScript code blocks (lines 310-321 and 323-330), which breaks the function syntax. This would fail if a reader tries to copy-paste the complete example.

📝 Proposed fix to merge code blocks
-```typescript
-import { useListeners } from "../dist/react.mjs";
-
-const map = createBroadcastEvent("react-example", {
-	first: z.object({}),
-	second: z.object({ payload: z.number() }),
-});
-
-export function ExampleComponent() {
-	useListeners(map, {
-		first(_payload) {
-```
-
-```typescript
-		},
-		second(_payload) {},
-	});
-
-	return; // more jsx...
-}
-```
+```typescript
+import { useListeners } from "../dist/react.mjs";
+
+const map = createBroadcastEvent("react-example", {
+  first: z.object({}),
+  second: z.object({ payload: z.number() }),
+});
+
+export function ExampleComponent() {
+  useListeners(map, {
+    first(_payload) {
+      //
+    },
+    second(_payload) {},
+  });
+
+  return; // more jsx...
+}
+```
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/typed-events/README.md` around lines 310 - 330, The React example's
TypeScript snippet is split into two separate code blocks which breaks the
ExampleComponent function; merge the fragments into a single ```typescript```
code block that contains the import of useListeners, the createBroadcastEvent
call (map), and the full export function ExampleComponent with its
useListeners({...}) call (including the first and second listener bodies and
closing braces), ensuring the listener function names (first, second), the
createBroadcastEvent, and ExampleComponent are intact and properly indented so
the example can be copy-pasted and compile.

Comment thread core/types-lhci/src/index.ts Outdated
@stephansama stephansama merged commit 4defdad into main May 16, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant