fix: support shared package manager commands #12
main fromfix/frameworkless-package-manager-tabs·merged by tannerlinsley Description#
Package-manager tabs currently ignore lines without a framework prefix. Accept those lines as shared commands so framework-independent tools do not need the same commands repeated for each framework. Each source line remains a separate command group:
<!-- ::start:tabs variant="package-manager" mode="local-install" -->
@tanstack/intent@latest list
@tanstack/intent@latest validate
@tanstack/intent@latest review
<!-- ::end:tabs -->
Shared groups use the empty key in the existing packagesByFramework metadata and precede named groups. Named groups include shared lines in source order. This works with tanstack.com's existing native package-manager component and fallback selection; no new public attribute or framework name is required.
The change preserves existing prefixed commands, prefix whitespace handling, and install modes. Regression coverage includes mixed shared/framework lines and literal arguments inside fenced text. The docs describe the authoring syntax and renderer contract.
Companion website PR: https://github.com/TanStack/tanstack.com/pull/1225. It remains draft until this fix is released and the website dependency is updated.
Verification#
- Rebased on current main; the null-prototype map is retained and the
constructor/__proto__regression test still passes. - A framework prefix is a
[\w-]+name followed by a colon that is not directly followed by/or., sohttps://host/pkg.tgz,file:../pkg, andgit+ssh://specifiers stay shared whilereact:pkgandreact: pkgremain framework lines. This is documented and covered by a regression test. - Bundle ceilings are unchanged. The growth is offset by simplifications in the tabs and shared helpers. Margins under the current ceilings (min / gzip / brotli bytes): docs preset -138 / -19 / -14, tabs transforms -138 / -15 / -6,
./extensions/tabs-138 / -14 / -2,./extensions/docs-138 / -19 / -24. pnpm run verifypassed: 252 tests, typecheck, build, docs and skill checks, conformance, size measurements, benchmarks, and package dry run.node --import tsx scripts/audit-external-corpus.tspassed: 10,517 Markdown files audited and 813 MDX files inventoried across 20 pinned repositories.- Verified the locally packed parser with tanstack.com's native package-manager tabs: four package managers, eight framework/no-framework routes, three command lines per block, synchronized blocks, and persisted selection after reload.
- 1
tannerlinsley requested changes
Shared package-manager commands are useful, so I am keeping this open. A few things need to be resolved before merging:
- Shared package specs can still be parsed as framework names. I reproduced
https://example.com/package.tgzbecoming thehttpsframework with//example.com/package.tgzas its package, andfile:../local-packagebecoming thefileframework. Please define and test the distinction between a framework prefix and a package protocol while preserving existingreact:packagesyntax. - Update against current main and retain its
Object.create(null)map. The current PR snapshot throws onconstructor: example; main already fixed that case, so it must survive the update. - The extension size increase needs review. Using the current esbuild measurement settings and preserving the null-prototype map, this change takes the docs preset from 2,292 to 2,383 gzip bytes (+91), tabs transforms from 1,221 to 1,326 (+105), and the full tabs export from 1,338 to 1,447 (+109). The parser stays unchanged. These exceed the current extension ceilings, so please look for offsetting simplifications rather than raising the budgets automatically.
After that, run the current
pnpm run verifyand external corpus audit. This is not part of the 0.0.15 release already in progress.- Shared package specs can still be parsed as framework names. I reproduced
Shared package-manager commands are useful, so I am keeping this open. A few things need to be resolved before merging:
Shared package specs can still be parsed as framework names. I reproduced
https://example.com/package.tgzbecoming thehttpsframework with//example.com/package.tgzas its package, andfile:../local-packagebecoming thefileframework. Please define and test the distinction between a framework prefix and a package protocol while preserving existingreact:packagesyntax.Update against current main and retain its
Object.create(null)map. The current PR snapshot throws onconstructor: example; main already fixed that case, so it must survive the update.The extension size increase needs review. Using the current esbuild measurement settings and preserving the null-prototype map, this change takes the docs preset from 2,292 to 2,383 gzip bytes (+91), tabs transforms from 1,221 to 1,326 (+105), and the full tabs export from 1,338 to 1,447 (+109). The parser stays unchanged. These exceed the current extension ceilings, so please look for offsetting simplifications rather than raising the budgets automatically.
After that, run the current
pnpm run verifyand external corpus audit. This is not part of the 0.0.15 release already in progress.Done!
tannerlinsley merged thisf2cc666
tannerlinsley closed this
Sign in to join this conversation.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID:
cf82dbe6-377c-4e16-a8c0-9237e17fa6d2📥 Commits
Reviewing files that changed from the base of the PR and between 8697aef8f9b256cac8166ab219533e40d5835ccb and 2f4b2a9ba93211ad0c40da46a214ca97f7def2d7.
📒 Files selected for processing (7)
docs/guides/docs-preset.mddocs/reference/extensions.mdskills/docs-features/SKILL.mdskills/docs-features/references/docs-metadata.mdsrc/extensions/shared.tssrc/extensions/tabs.tstests/docs-extensions.test.tsIncluded review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.
📝 Walkthrough
Walkthrough#
The package-manager tabs transformation now accepts shared, unprefixed package commands. It stores shared commands under the empty framework key and merges them into named framework groups. Tests and documentation cover ordering, whitespace, install modes, protocol URLs, and special characters. Tab slug and heading utility handling also changed.
Changes#
Package-manager tab transformation
src/extensions/tabs.ts,tests/docs-extensions.test.tssrc/extensions/tabs.ts,src/extensions/shared.tsdocs/guides/docs-preset.md,docs/reference/extensions.md,skills/docs-features/SKILL.md,skills/docs-features/references/docs-metadata.mdPriority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Feature
Suggested reviewers:
tannerlinsleySequence Diagram(s)#
Merge Risk: ⚪ Minimal · up to
2f4b2No actionable merge-blocking risk remains in the shared package-manager command changes.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files. (4 skipped: 4 unsupported.)
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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