feat: split into scoped @marqdown/* packages - #897
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
🦋 Changeset detectedLatest commit: 3c4ba96 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
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 |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
A full re-read of all 51 changed files at this head. The rename is mechanical and consistent: every internal reference, self-import, workspace scope, entry point, error message, and JSDoc note now names marqdown, and the intentional old-name leftovers (GitHub URLs, the markdown-to-jsx.quantizor.dev domain, the benchmark baseline alias, the changelog history) line up exactly with what AGENTS.md and BACKLOG.md declare should stay. The bundled "quieter dev loop" changes (scripts/verify, .githooks/pre-commit, lib/src/__mocks__/console-leak.ts) are sound and internally consistent, and both bun run typecheck and bun run validate-i18n pass on this checkout.
Package rename—lib/package.jsonname, workspace scopes (@marqdown/*), allworkspace:*deps, self-referencingmarqdown/entitiesimports wired throughlib/tsconfig.json,lib/bunup.config.ts,native/metro.config.js,knip.jsonc, and.changeset/config.json.Error messages and JSDoc— runtime messages (marqdown: the first argument must be a string) and deprecated-import pointers updated.Docs and i18n—lib/README.md, theen/hi/zhmirrors, bothllms.txtfiles,scripts/llms-snippets.tsfences, the site (title,marqdown-langkey) and the rebuiltdocs/output.Changeset and backlog— patch changeset in declarative release-note voice; BACKLOG.md tracked the remaining publish/repo/DNS steps.Quieter dev loop— verify and the pre-commit hook capture per-step output and surface it only on failure; the console-leak wrappers no longer forward to the real console (documented, leak detection preserved).
ℹ️ Informational
One pre-existing reference to the old name falls outside the two keep-lists you enumerated in the PR body and AGENTS.md: bunfig.toml:3 still has minimumReleaseAgeExcludes = ["markdown-to-jsx"]. It is functionally inert today (every consumer resolves marqdown as a workspace:* dependency, never from the registry, so the 3-day release-age floor never applies to it), so nothing needs to change now. Worth a glance only if the upcoming shim/release flow ever installs marqdown from the registry within three days of its first publish, in which case you'd want marqdown in that list.
ℹ️ Nitpicks
- You changed the site's localStorage language key from
markdown-to-jsx-langtomarqdown-lang; any visitor with a stored non-English preference will reset to the default once after this ships. Purely cosmetic on a demo site, so fine as-is.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…ompat alias Publish one package per integration under the @marqdown org: @marqdown/parser, react, native, solid, vue, html, markdown. Each renderer inlines the parser so it is self-contained with zero cross-package @marqdown runtime deps and can never skew from the parser it was tested against; @marqdown/parser is also standalone. Every package is a slice of the single lib build. bunup drops the bodies of any module outside its package root, so per-package bundling is infeasible: instead lib builds once (in-root, the proven path) and scripts/pack-packages.ts copies each package's slice from lib/dist, rewriting the externalized marqdown/entities specifier to <scope>/entities so the entity browser-swap survives. Shared bunup config moves to bunup.shared.ts. The unscoped markdown-to-jsx name is kept as a deprecated compatibility alias that re-exports the @marqdown/* packages (packages/compat, stubs generated by scripts/gen-compat.ts) so existing imports and deep imports keep resolving. Rename the private Expo harness to @marqdown/native-harness to free the published @marqdown/native name. Root build produces every package and gen-compat; verify covers all package declarations. Also codify bun as the sole package manager (packageManager pin, gitignore stray lockfiles).
Add a release guard (scripts/check-inlined-parser-changesets.ts, wired into verify) that fails when a shared parser file changed but not every published package is covered by a changeset: the parser is inlined in each renderer, so a parser change must republish all of them or a renderer ships a stale parser. Add are-the-types-wrong packaging validation (scripts/attw-packages.ts, wired into verify) across all eight published packages on the node16 and bundler profiles. node10 is excluded (engines require Node 18+) and the deliberate esModuleInterop-off default-export shape is ignored. Mark lib private: the unscoped marqdown name is unpublishable, so lib is only the internal source and build home. Rewrite the changeset to describe the scoped split, and update the naming invariant and codebase map in AGENTS.md.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Important
The new compat shim breaks the legacy package's documented CommonJS root contract: require('markdown-to-jsx') no longer returns the Markdown component, and the shim's comment promises resolution tests that do not exist.
Reviewed changes
Incremental re-review against the prior pullfrog review (head e4c4e02). Commit 8758b45 changes the whole character of this PR: it is no longer a flat rename but a full monorepo split. The lib build's output is now sliced into seven published @marqdown/* packages plus a deprecated markdown-to-jsx compat alias.
- Split
lib/bunup.config.tsinto a sharedbunup.shared.tsand per-entry config; added a standalonelib/src/parser.tsentry for@marqdown/parser. - Added
scripts/pack-packages.ts(copies each package's slice oflib/distintopackages/<dir>/dist, rewriting themarqdown/entitiesspecifier to<scope>/entitiesand converting every package'spackage.jsonbuildtobun ../../scripts/pack-packages.ts <dir>). - Added
scripts/gen-compat.ts(generates themarkdown-to-jsxcompat shim's ESM/CJS/dts re-export stubs) andpackages/compat/with dependency/peer mappings for native/solid/vue. - Renamed the native harness workspace
@marqdown/native→@marqdown/native-harness(@marqdown/nativeis now the published package). - Extended
scripts/verify-declarations.tsto check every published package's declaredtypespaths exist; heavybun.lockregeneration.
The slice/entity plumbing is sound: specifiers, exports maps, and dependency/peer declarations are internally consistent, and @marqdown/parser/entities resolves for the compat ./entities subpath. The two findings below concern the compat shim's drop-in fidelity for its stated purpose ("so existing installs keep working").
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Retarget the README (and the en/hi/zh mirrors), llms.txt, and the rebuilt site
from the abandoned marqdown package name to the scoped @marqdown/* packages:
install the package for your integration, each includes the parser, and the
markdown-to-jsx alias re-exports them. Distribute README and LICENSE into every
package at build time so npm pages are populated.
Fix the markdown-to-jsx compat CommonJS root: require('markdown-to-jsx') must be
the renderable Markdown component with the named exports attached (the legacy
default-only contract), not the @marqdown/react module namespace. Add
scripts/check-package-resolution.ts (wired into verify) which loads the built
stubs and asserts each subpath's runtime shape, including that root contract.
Retarget the llms.txt snippet runner to the scoped packages.
There was a problem hiding this comment.
✅ No new issues found. Both findings from the previous review are addressed, and the new regression test is meaningful coverage.
Reviewed changes
Incremental re-review of commit 3c4ba96 against the prior pullfrog review (head 8758b45), which had raised two IMPORTANT findings. Both are resolved in the code.
- Fixed the compat CommonJS root contract —
scripts/gen-compat.tsnow emitsvar m = require('@marqdown/react'); module.exports = Object.assign(m.default, m)for the root, sorequire('markdown-to-jsx')returns the renderableMarkdowncomponent with the named exports attached (matching the legacy default-onlyObject.assignroot inlib/src/index.cjs.tsx); the other subpaths keep their namespace shape.index.d.ts/index.d.ctsare unchanged, which is fine since they describe the same exported surface. - Added
scripts/check-package-resolution.ts, wired into verify wave 3, which loads the built compat stubs and asserts the CJS root renders as a component (# Hi→<h1 id="hi">Hi</h1>), each subpath's runtime shape, the scoped@marqdown/react/@marqdown/htmlnames, and the ESM root default. This directly pins down the CJS-shape contract the prior review asked for, and its exact HTML/typeofassertions would genuinely fail on a regression. - Retargeted the docs and snippets from the bare
marqdownname to@marqdown/*—lib/README.md, theen/hi/zhmirrors, bothllms.txtfiles, the rebuiltdocs/output, andsitemap.xml.scripts/llms-snippets.tsruns its fences frompackages/compatnow that they import scoped packages (react resolves by walking up to the root). scripts/pack-packages.tsandscripts/gen-compat.tsnow copy the sharedlib/README.mdandlib/LICENSEinto each published package root, matching the newpackages/*/README.md/packages/*/LICENSEgitignore entries.
The resolution test's assumptions are internally consistent with the build flow (pack-packages/gen-compat run in the build step before verify wave 3 runs the resolution check), and the scoped packages resolve from packages/compat whether hoisted by the workspace or not.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

What changes
markdown-to-jsx is now published as a family of focused packages under the
@marqdownscope, one per integration:@marqdown/react,@marqdown/vue,@marqdown/solid,@marqdown/native: render markdown to that framework@marqdown/html,@marqdown/markdown: render to an HTML or markdown string, no framework required@marqdown/parser: the CommonMark + GFM parser and AST onlyEach renderer includes the parser and pulls in only the framework it targets, so an install carries just the integration you use and a renderer can never fall out of step with the parser it was built against. Packages are versioned independently.
Compatibility
The
markdown-to-jsxpackage stays as a compatibility alias that re-exports these packages, deep imports (markdown-to-jsx/react,markdown-to-jsx/html, and so on) included. Existing installs keep working unchanged, so migrating is optional. New code should install the specific@marqdown/<integration>package.