Skip to content

fix(schema-org): missing subpath exports and vue import cycle - #785

Merged
harlan-zw merged 8 commits into
mainfrom
fix/schema-org-package-shape
Jun 29, 2026
Merged

harlan-zw merged 8 commits into
mainfrom
fix/schema-org-package-shape

Conversation

@harlan-zw

@harlan-zw harlan-zw commented Jun 25, 2026 •

Copy link
Copy Markdown
Collaborator

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

Fixes two schema-org package shape issues:

  • Adds @unhead/schema-org/imports and @unhead/schema-org/vue/meta subpath exports so auto-import metadata and the Vue meta bridge can be imported without pulling the full Vue entry.
  • Removes the Vue runtime import cycle between src/vue/index and the runtime components/composables by importing composables directly from the component module.

Export snapshot (test/exports/schema-org.yaml) and ATTW coverage are updated for the new public subpaths.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Schema-org adds public imports and vue/meta subpaths, updates internal Vue/runtime imports to those entrypoints, and changes the plugin minify fallback behavior. Tests and package metadata were updated for the new exports and production minify case.

Changes

Schema Org public entrypoints and runtime wiring

Layer / File(s) Summary
Public subpath declarations
packages/schema-org/build.config.ts, packages/schema-org/package.json, packages/schema-org/vitest.config.ts, tsconfig.json, test/exports/schema-org.yaml
imports and vue/meta are added to the build entry list, package exports, TypeScript path resolution, Vitest aliases, and export fixture data.
Runtime import rewires
packages/schema-org/src/core/graph.ts, packages/schema-org/src/vue/index.ts, packages/schema-org/src/vue/runtime/components.ts, packages/schema-org/src/vue/runtime/composables.ts
The graph resolver, Vue entrypoint, runtime components, and composables now import schema nodes and normalization helpers from more specific internal modules.
Auto-import metadata test
packages/schema-org/test/vue/auto-imports.test.ts
The Vue auto-import test reads schemaAutoImports, schemaOrgAutoImports, and SchemaOrgResolver from the new subpaths and checks the resolver output.

Schema Org minify default

Layer / File(s) Summary
Default minify resolution
packages/schema-org/src/plugin.ts
getDefaultMinify() reads globalThis.process.env.NODE_ENV, and tags:resolve now uses nullish coalescing for the minify fallback.
SSR minify test
packages/schema-org/test/ssr/dupes.test.ts
The SSR duplicate test restores NODE_ENV after each case and adds a production render assertion for minify: false.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • unjs/unhead#792: Updates a schema-org example to import schemaAutoImports from @unhead/schema-org/imports, which depends on the new public subpath added here.

Poem

🐇 I hopped through subpaths, neat and new,
imports and meta shone into view.
With minify: false, the lines stayed bright,
and schema carrots danced just right. 🥕

🚥 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise, conventional, and accurately summarizes the main schema-org fix.
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 The PR description matches the template's main sections and clearly explains the change, with only the linked issue section left unfilled.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/schema-org-package-shape

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.

@github-actions

github-actions Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

📦 Bundle Size

✅ No notable changes

All bundles (12)
Bundle Gzipped Raw
Core
Client (Minimal) 4.7 kB 11.7 kB ✅
Client (Full) 7.9 kB 20.6 kB ✅
Server (Minimal) 4.5 kB 11.4 kB ✅
Vue
Vue Client (Minimal) 5.2 kB 12.8 kB ✅
Vue Client (Full) 8.7 kB 22.5 kB ✅
Vue Server (Minimal) 5 kB 12.3 kB ✅
React
React Client (Minimal) 5.1 kB 12.7 kB ✅
React Client (Full) 8.5 kB 22.1 kB ✅
React Server (Minimal) 4.8 kB 12 kB ✅
Schema.org
Schema.org (Minimal) 9.5 kB 26.3 kB ✅
Schema.org Imports 0.1 kB 0.1 kB ✅
Schema.org Vue Meta 0.4 kB 0.8 kB ✅

⚡ Performance (directional)

🟢 1 faster

Benchmark base → PR Δ
SSR allocated / render 336.1 KiB → 320.8 KiB 🟢 -15.3 KiB (-4.5%)
All benchmarks (6)
Benchmark PR Δ RME
SSR render (CPU) 0.457 ms ~ noise ±9.4%
SSR render (wall) 0.292 ms ~ noise ±4.9%
SSR allocated / render 320.8 KiB 🟢 -15.3 KiB (-4.5%) —
CSR DOM mutations / nav 38 ~ noise —
CSR re-render (CPU) 0.800 ms ~ noise ±5.1%
CSR re-render (wall) 0.450 ms ~ noise ±3.4%

Baseline: main @ 00c5340 · 2026-06-29 · gzipped is the headline size metric · perf is directional (shared-runner, gated)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@packages/schema-org/test/ssr/dupes.test.ts`:
- Around line 7-10: The test cleanup in dupe.spec logic should restore NODE_ENV
to its prior state instead of always assigning it back, because assigning
process.env.NODE_ENV from originalNodeEnv can leave a lingering own property
when it was originally unset. Update the afterEach cleanup near originalNodeEnv
to delete process.env.NODE_ENV when originalNodeEnv was undefined, and only
assign it when it had a real value.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3776b719-0887-47b0-ad97-d6a3563fd744

📥 Commits

Reviewing files that changed from the base of the PR and between e740464 and 29398e7.

📒 Files selected for processing (12)
  • packages/schema-org/build.config.ts
  • packages/schema-org/package.json
  • packages/schema-org/src/core/graph.ts
  • packages/schema-org/src/plugin.ts
  • packages/schema-org/src/vue/index.ts
  • packages/schema-org/src/vue/runtime/components.ts
  • packages/schema-org/src/vue/runtime/composables.ts
  • packages/schema-org/test/ssr/dupes.test.ts
  • packages/schema-org/test/vue/auto-imports.test.ts
  • packages/schema-org/vitest.config.ts
  • test/exports/schema-org.yaml
  • tsconfig.json

@harlan-zw harlan-zw changed the title fix(schema-org): add imports/vue/meta subpath exports and fix vue import cycle fix(schema-org): missing subpath exports and vue import cycle Jun 29, 2026
@harlan-zw
harlan-zw merged commit 10a21da into main Jun 29, 2026
7 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jun 30, 2026
1 of 6 tasks
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