fix(types): auto-generate TS types by converting barrel to TypeScript (SD-2261)#2565
Open
caio-pizzol wants to merge 6 commits intomainfrom
Open
fix(types): auto-generate TS types by converting barrel to TypeScript (SD-2261)#2565caio-pizzol wants to merge 6 commits intomainfrom
caio-pizzol wants to merge 6 commits intomainfrom
Conversation
… (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
There was a problem hiding this comment.
💡 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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.