Skip to content

fix(types): auto-generate TS types by converting barrel to TypeScript (SD-2261)#2565

Open
caio-pizzol wants to merge 6 commits intomainfrom
SD-2261_caio
Open

fix(types): auto-generate TS types by converting barrel to TypeScript (SD-2261)#2565
caio-pizzol wants to merge 6 commits intomainfrom
SD-2261_caio

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

Convert super-editor barrel from index.js to index.ts with type re-exports, replacing the hand-written index.d.ts with types derived from actual source files. This ensures type declarations always match runtime behavior.

  • Rename super-editor/src/index.js → index.ts, add type re-exports
  • Delete hand-written index.d.ts (1140 lines of manually maintained types)
  • Delete redundant Editor.d.ts sidecar (shadows Editor.ts)
  • Add missing types: BoundingRect, BinaryData, UnsupportedContentItem
  • Update vite.config.js and package.json entry points
  • Expand superdoc barrel with missing runtime exports and JSDoc type re-exports

… (SD-2261)

Convert super-editor barrel from index.js to index.ts with type re-exports,
replacing the hand-written index.d.ts with types derived from actual source
files. This ensures type declarations always match runtime behavior.

- Rename super-editor/src/index.js → index.ts, add type re-exports
- Delete hand-written index.d.ts (1140 lines of manually maintained types)
- Delete redundant Editor.d.ts sidecar (shadows Editor.ts)
- Add missing types: BoundingRect, BinaryData, UnsupportedContentItem
- Update vite.config.js and package.json entry points
- Expand superdoc barrel with missing runtime exports and JSDoc type re-exports
@linear
Copy link
Copy Markdown

linear bot commented Mar 25, 2026

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae1dafc9be

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

- Move OpenOptions re-export from EditorConfig.js to Editor.js (where
  it's actually defined)
- Update superdoc vite.config.js aliases from index.js to index.ts
Add CoreCommandMap, ExtensionCommandMap, and LayoutUpdatePayload to
type re-exports — these were in the old hand-written index.d.ts and
need to remain available for consumers.
… subpaths

- Update ensure-types.cjs regex to match `export type { ... } from` in
  addition to `import { ... } from`, so re-exported names like Fragment
  are included in workspace package shims
- Allow @superdoc/common subpath imports (e.g. BasicUpload.vue) to be
  shimmed instead of skipped
- Update public-api test to reference renamed index.ts
- Add vue-shim.d.ts to super-editor tsconfig include so tsc can resolve
  .vue imports from the renamed index.ts barrel
- Add createOrUpdateTrackedChangeComment to comments-plugin.d.ts sidecar
@caio-pizzol caio-pizzol self-assigned this Mar 25, 2026
Add typecheck-matrix.mjs that tests consumer types across 9 scenarios:
bundler/node16/nodenext module resolution, strict/loose mode,
headless Node.js usage, and superdoc/super-editor sub-exports.

Fix ensure-types.cjs to convert .ts extensions to .js in generated
.d.ts import paths — vite-plugin-dts preserves .ts from the source
entry point, but consumers need .js for TypeScript resolution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant