Skip to content

fix(types): clarify public component types and graphic declaration emit - #1064

Merged
Justineo merged 3 commits into
mainfrom
codex/component-public-types
Sep 28, 2026
Merged

Justineo merged 3 commits into
mainfrom
codex/component-public-types

Conversation

@Justineo

@Justineo Justineo commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Libraries need public, nameable component types when they emit declarations for export const MyChart = VChart. This follows #1060 / #1061 with release-ready type names and fixes the same TS4023 failure for wrappers around vue-echarts/graphic components.

  • Name the shared component definition helper Component. The package import already provides the Vue ECharts context; Component, Exposed, and Slots describe the three roles without repeating that context.
  • Export the existing complete bindings type as Exposed instead of exporting PublicMethods. The latter only describes a subset of methods and omits setOption, chart, and root; it remains an internal helper. Exposed describes the actual exposed API without adding another abstraction. Template refs can still use InstanceType<typeof VChart> for Vue instance properties.
  • Name the slot declaration type Slots and document that it is Vue SlotsType metadata. Callable slots remain available through InstanceType<typeof VChart>["$slots"]. Preserve the already-published VChartSlotsExtension and its graphic-entry re-export.
  • Export the existing GraphicComponent type from the graphic entry. The added group/rect consumer fixtures reproduced TS4023 until this export was present.
  • Add package-level type coverage for declaration generation, exposed methods/read-only state, inferred props, and slot module augmentation. Document the public types in both READMEs and add an unreleased changelog entry.

Compatibility: npm's latest release is still 8.3.0 (published September 6, 2026), whose root entry does not export the three names added by #1060. The changed names are being finalized before their first npm release, so no deprecated aliases are added. The published slot augmentation interface keeps its existing name and identity. No runtime behavior changes or npm release are included.

Validation:

  • pnpm lint, pnpm format, pnpm typecheck, pnpm dev:typecheck
  • pnpm build (including Vue 3.3 / ECharts 6.0 package type checks), pnpm publint, pnpm run docs
  • pnpm test: 49 files / 573 tests passed, including minimum-supported runtimes
  • Actual emitDeclarationOnly with current dependencies, Vue 3.3 + current ECharts, and Vue 3.3 + ECharts 6.0; generated consumer declarations reference public entry points without internal chunks. The emitted current-dependency declarations also typecheck as a downstream consumer.

@vercel

vercel Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
vue-echarts Ready Ready Preview Sep 28, 2026 6:34am UTC

Request Review

@Justineo
Justineo requested a review from a team as a code owner September 28, 2026 05:57
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T05:59:56.294786Z e256fcf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/vue-echarts@1064

commit: d263980

@codecov-commenter

codecov-commenter commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e31dad5) to head (d263980).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1064   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           23        23           
  Lines         1078      1078           
  Branches       289       289           
=========================================
  Hits          1078      1078           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Justineo
Justineo merged commit 5c8e622 into main Sep 28, 2026
9 checks passed
@Justineo
Justineo deleted the codex/component-public-types branch September 28, 2026 08:23

This branch was successfully deployed

1 active deployment
Preview — d2639803 Deployed Sep 28, 2026 by vercel[bot]
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