Skip to content

fix: support shared package manager commands - #12

Open
LadyBluenotes wants to merge 1 commit into
mainfrom
fix/frameworkless-package-manager-tabs
Open

fix: support shared package manager commands#12
LadyBluenotes wants to merge 1 commit into
mainfrom
fix/frameworkless-package-manager-tabs

Conversation

@LadyBluenotes

@LadyBluenotes LadyBluenotes commented Sep 6, 2026

Copy link
Copy Markdown
Member

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: TanStack/tanstack.com#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 ., so https://host/pkg.tgz, file:../pkg, and git+ssh:// specifiers stay shared while react:pkg and react: pkg remain 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 verify passed: 252 tests, typecheck, build, docs and skill checks, conformance, size measurements, benchmarks, and package dry run.
  • node --import tsx scripts/audit-external-corpus.ts passed: 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.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

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 8697aef and 2f4b2a9.

📒 Files selected for processing (7)
  • docs/guides/docs-preset.md
  • docs/reference/extensions.md
  • skills/docs-features/SKILL.md
  • skills/docs-features/references/docs-metadata.md
  • src/extensions/shared.ts
  • src/extensions/tabs.ts
  • tests/docs-extensions.test.ts

Included 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

Layer / File(s) Summary
Parse and validate shared commands
src/extensions/tabs.ts, tests/docs-extensions.test.ts
The transformer parses shared commands, merges them with framework-specific commands, emits shared metadata, and validates ordering, whitespace, install modes, protocol URLs, and special characters.
Align tab metadata and section slugs
src/extensions/tabs.ts, src/extensions/shared.ts
Bundler metadata and slugs now use section names and computed tab slugs. Heading sections explicitly allow undefined IDs, heading-less input is processed, and slug whitespace and hyphen runs collapse together.
Document shared command behavior
docs/guides/docs-preset.md, docs/reference/extensions.md, skills/docs-features/SKILL.md, skills/docs-features/references/docs-metadata.md
The documentation describes shared command syntax, metadata structure, fallback behavior, source ordering, protocol URL handling, and fenced text blocks for literal Markdown characters.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Suggested reviewers: tannerlinsley

Sequence Diagram(s)

sequenceDiagram
  participant TabsBlock
  participant transformPackageManagerTabs
  participant PackageManagerMeta
  participant DocsTests
  TabsBlock->>transformPackageManagerTabs: provide shared and framework-specific package lines
  transformPackageManagerTabs->>PackageManagerMeta: emit shared and framework command groups
  DocsTests->>transformPackageManagerTabs: verify ordering, modes, URLs, and special characters
Loading

Merge Risk: ⚪ Minimal · up to 2f4b2

No actionable merge-blocking risk remains in the shared package-manager command changes.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: support for shared package-manager commands without framework prefixes.
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.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/frameworkless-package-manager-tabs

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.

@tannerlinsley tannerlinsley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shared package-manager commands are useful, so I am keeping this open. A few things need to be resolved before merging:

  1. Shared package specs can still be parsed as framework names. I reproduced https://example.com/package.tgz becoming the https framework with //example.com/package.tgz as its package, and file:../local-package becoming the file framework. Please define and test the distinction between a framework prefix and a package protocol while preserving existing react:package syntax.
  2. Update against current main and retain its Object.create(null) map. The current PR snapshot throws on constructor: example; main already fixed that case, so it must survive the update.
  3. 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 verify and external corpus audit. This is not part of the 0.0.15 release already in progress.

Package-manager tabs accept lines without a framework prefix as shared
commands. Shared groups use the empty key in packagesByFramework, come
first, and are also appended to each named framework group in source
order. Existing `framework: package` lines keep their behavior.

A framework prefix is a `[\w-]+` name followed by a colon that is not
directly followed by `/` or `.`, so `https://host/pkg.tgz`,
`file:../pkg`, and `git+ssh://` specifiers stay shared while
`react:pkg` and `react: pkg` remain framework lines.

The null-prototype map from main is retained, so `constructor` and
`__proto__` prefixes still work. Bundle ceilings are unchanged; the
extension growth is offset by simplifications in the tabs and shared
helpers (single-pass line matching, one-literal heading sections, a
merged slugify pass, and inlined bundler names).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@LadyBluenotes
LadyBluenotes force-pushed the fix/frameworkless-package-manager-tabs branch from 8697aef to 2f4b2a9 Compare September 12, 2026 00:20
@LadyBluenotes

Copy link
Copy Markdown
Member Author

Shared package-manager commands are useful, so I am keeping this open. A few things need to be resolved before merging:

1. Shared package specs can still be parsed as framework names. I reproduced `https://example.com/package.tgz` becoming the `https` framework with `//example.com/package.tgz` as its package, and `file:../local-package` becoming the `file` framework. Please define and test the distinction between a framework prefix and a package protocol while preserving existing `react:package` syntax.

2. Update against current main and retain its `Object.create(null)` map. The current PR snapshot throws on `constructor: example`; main already fixed that case, so it must survive the update.

3. 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 verify and external corpus audit. This is not part of the 0.0.15 release already in progress.

Done!

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.

2 participants