Skip to content

chore: move tsup config to a separate package#981

Merged
ocavue merged 15 commits intomasterfrom
ocavue/refactor-config
Apr 18, 2025
Merged

chore: move tsup config to a separate package#981
ocavue merged 15 commits intomasterfrom
ocavue/refactor-config

Conversation

@ocavue
Copy link
Copy Markdown
Collaborator

@ocavue ocavue commented Apr 18, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a new configuration package to streamline and standardize build entry points across multiple packages.
    • Added explicit build entry point definitions for all packages, improving clarity and consistency for development builds.
  • Refactor

    • Updated build configuration imports to use the new configuration package.
    • Enhanced type safety in Solid components by introducing and applying a new type utility.
  • Chores

    • Updated development dependencies and TypeScript project references.
    • Improved internal configuration structure for better maintainability.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 18, 2025

⚠️ No Changeset found

Latest commit: ad51da8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package "@prosekit/basic" depends on the ignored package "@prosekit/config-tsup", but "@prosekit/basic" is not being ignored. Please add "@prosekit/basic" to the `ignore` option.
The package "@prosekit/core" depends on the ignored package "@prosekit/config-tsup", but "@prosekit/core" is not being ignored. Please add "@prosekit/core" to the `ignore` option.
The package "@prosekit/extensions" depends on the ignored package "@prosekit/config-tsup", but "@prosekit/extensions" is not being ignored. Please add "@prosekit/extensions" to the `ignore` option.
The package "@prosekit/lit" depends on the ignored package "@prosekit/config-tsup", but "@prosekit/lit" is not being ignored. Please add "@prosekit/lit" to the `ignore` option.
The package "@prosekit/pm" depends on the ignored package "@prosekit/config-tsup", but "@prosekit/pm" is not being ignored. Please add "@prosekit/pm" to the `ignore` option.
The package "@prosekit/preact" depends on the ignored package "@prosekit/config-tsup", but "@prosekit/preact" is not being ignored. Please add "@prosekit/preact" to the `ignore` option.
The package "prosekit" depends on the ignored package "@prosekit/config-tsup", but "prosekit" is not being ignored. Please add "prosekit" to the `ignore` option.
The package "@prosekit/react" depends on the ignored package "@prosekit/config-tsup", but "@prosekit/react" is not being ignored. Please add "@prosekit/react" to the `ignore` option.
The package "@prosekit/solid" depends on the ignored package "@prosekit/config-tsup", but "@prosekit/solid" is not being ignored. Please add "@prosekit/solid" to the `ignore` option.
The package "@prosekit/svelte" depends on the ignored package "@prosekit/config-tsup", but "@prosekit/svelte" is not being ignored. Please add "@prosekit/svelte" to the `ignore` option.
The package "@prosekit/vue" depends on the ignored package "@prosekit/config-tsup", but "@prosekit/vue" is not being ignored. Please add "@prosekit/vue" to the `ignore` option.
The package "@prosekit/web" depends on the ignored package "@prosekit/config-tsup", but "@prosekit/web" is not being ignored. Please add "@prosekit/web" to the `ignore` option.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 18, 2025

Walkthrough

This change introduces a new internal package, @prosekit/config-tsup, which centralizes and standardizes the tsup build configuration across multiple packages in the repository. All packages that previously relied on @prosekit/dev/config-tsup are migrated to use the new package. The update involves adding new dev dependencies, modifying package.json files to declare multiple build entry points under a new dev.entry field, and updating import paths in build configuration files. The old config-tsup implementation and its type declarations are removed from the @prosekit/dev package. Type safety is improved in Solid.js components by introducing and applying an explicit PropsWithElement type.

Changes

File(s) / Path(s) Change Summary
packages/config-tsup/* (new package: package.json, src/index.ts, tsconfig.build.json, tsconfig.json) Introduced new internal package @prosekit/config-tsup providing a config function for generating tsup build configs based on package.json entries. Adds types, build scripts, and TypeScript project references.
packages/*/package.json (basic, core, extensions, lit, pm, preact, prosekit, react, solid, svelte, vue, web) Added @prosekit/config-tsup as a devDependency, introduced new dev.entry fields listing multiple build entry points, and added empty dev objects in publishConfig.
packages/*/tsup.config.ts Updated import paths from @prosekit/dev/config-tsup to @prosekit/config-tsup.
packages/dev/package.json Removed the export for ./config-tsup and related dependencies; cleaned up dependencies and devDependencies.
packages/dev/src/config-tsup.ts, packages/dev/src/config-tsup-types.d.ts Deleted the previous config-tsup implementation and its type declarations from the dev package.
packages/dev/src/gen-components.ts Enhanced Solid.js component code generation to add explicit type annotations using Component<PropsWithElement<...>>.
packages/dev/src/normalize-package-json.ts Added dev properties to publishConfig and root object, embedding entry points for development builds.
packages/solid/src/components/*/*.gen.ts Refactored all generated Solid.js components to use explicit Component<PropsWithElement<...>> typings for their exports.
packages/solid/src/components/create-component.ts Changed the return type of createComponent to use PropsWithElement instead of a manual intersection type.
packages/solid/src/types.ts, packages/solid/src/index.ts Introduced and exported a new type alias PropsWithElement for combining props with HTML attributes.
package.json Updated @ocavue/tsconfig devDependency version.
.changeset/config.json Added @prosekit/config-tsup to the list of ignored packages for changeset tracking.
tsconfig.json Added project references for the new @prosekit/config-tsup package.

Sequence Diagram(s)

sequenceDiagram
    participant PackageJSON
    participant ConfigTsup
    participant Tsup

    PackageJSON->>ConfigTsup: Provide dev.entry mapping and tsconfig path
    ConfigTsup->>ConfigTsup: Validate package.json and dev.entry
    ConfigTsup->>ConfigTsup: Resolve tsconfig (build or default)
    ConfigTsup->>ConfigTsup: Merge user options with defaults
    ConfigTsup->>Tsup: Return final tsup config
    Tsup->>Tsup: Build package using provided config
Loading

Possibly related PRs

Poem

In the warren, configs grew,
A new kit for tsup, shiny and new! 🐇
Entries mapped, types refined,
Solid props now well-aligned.
From dev to build, the flow is neat,
With every hop, our setup’s complete.
Hooray for code that’s clear and bright—
The rabbit’s burrow feels just right! ✨

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 18, 2025

Open in StackBlitz

@prosekit/basic

npm i https://pkg.pr.new/prosekit/prosekit/@prosekit/basic@981

@prosekit/core

npm i https://pkg.pr.new/prosekit/prosekit/@prosekit/core@981

@prosekit/lit

npm i https://pkg.pr.new/prosekit/prosekit/@prosekit/lit@981

@prosekit/extensions

npm i https://pkg.pr.new/prosekit/prosekit/@prosekit/extensions@981

@prosekit/pm

npm i https://pkg.pr.new/prosekit/prosekit/@prosekit/pm@981

@prosekit/preact

npm i https://pkg.pr.new/prosekit/prosekit/@prosekit/preact@981

prosekit

npm i https://pkg.pr.new/prosekit/prosekit@981

@prosekit/react

npm i https://pkg.pr.new/prosekit/prosekit/@prosekit/react@981

@prosekit/solid

npm i https://pkg.pr.new/prosekit/prosekit/@prosekit/solid@981

@prosekit/svelte

npm i https://pkg.pr.new/prosekit/prosekit/@prosekit/svelte@981

@prosekit/vue

npm i https://pkg.pr.new/prosekit/prosekit/@prosekit/vue@981

@prosekit/web

npm i https://pkg.pr.new/prosekit/prosekit/@prosekit/web@981

commit: ad51da8

@ocavue ocavue changed the title chore: refactor tsup config chore: move tsup config to a separate package Apr 18, 2025
@ocavue ocavue changed the title chore: move tsup config to a separate package chore: move tsup config to a separate package Apr 18, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 18, 2025

size-limit report 📦

Path Size
prosekit/basic 65.84 KB (0%)
prosekit/basic/style.css 1018 B (0%)
prosekit/basic/typography.css 666 B (0%)
prosekit/core 62.2 KB (0%)
prosekit/core/test 51.06 KB (0%)
prosekit/extensions 13 B (0%)
prosekit/extensions/autocomplete 28.98 KB (0%)
prosekit/extensions/blockquote 21.41 KB (0%)
prosekit/extensions/bold 21.63 KB (0%)
prosekit/extensions/code 21.55 KB (0%)
prosekit/extensions/code-block 1.05 MB (0%)
prosekit/extensions/commit 31.56 KB (0%)
prosekit/extensions/commit/style.css 60 B (0%)
prosekit/extensions/doc 10.5 KB (0%)
prosekit/extensions/drop-cursor 14.73 KB (0%)
prosekit/extensions/enter-rule 15.14 KB (0%)
prosekit/extensions/file 14.42 KB (0%)
prosekit/extensions/gap-cursor 30.1 KB (0%)
prosekit/extensions/gap-cursor/style.css 149 B (0%)
prosekit/extensions/heading 21.72 KB (0%)
prosekit/extensions/horizontal-rule 15.71 KB (0%)
prosekit/extensions/image 14.98 KB (0%)
prosekit/extensions/input-rule 15.08 KB (0%)
prosekit/extensions/italic 21.58 KB (0%)
prosekit/extensions/link 25.66 KB (0%)
prosekit/extensions/list 40.91 KB (0%)
prosekit/extensions/list/style.css 450 B (0%)
prosekit/extensions/loro 19.27 KB (0%)
prosekit/extensions/loro/style.css 181 B (0%)
prosekit/extensions/mark-rule 14.43 KB (0%)
prosekit/extensions/mention 14.93 KB (0%)
prosekit/extensions/mod-click-prevention 13.84 KB (0%)
prosekit/extensions/paragraph 20.22 KB (0%)
prosekit/extensions/placeholder 33.01 KB (0%)
prosekit/extensions/placeholder/style.css 61 B (0%)
prosekit/extensions/readonly 13.76 KB (0%)
prosekit/extensions/search 30.45 KB (0%)
prosekit/extensions/search/style.css 117 B (0%)
prosekit/extensions/strike 21.61 KB (0%)
prosekit/extensions/table 44.84 KB (0%)
prosekit/extensions/table/style.css 241 B (0%)
prosekit/extensions/text 10.5 KB (0%)
prosekit/extensions/text-align 20.24 KB (0%)
prosekit/extensions/underline 20.6 KB (0%)
prosekit/extensions/virtual-selection 28.52 KB (0%)
prosekit/extensions/virtual-selection/style.css 64 B (0%)
prosekit/extensions/yjs 19.49 KB (0%)
prosekit/extensions/yjs/style.css 192 B (0%)
prosekit/lit 13 B (0%)
prosekit/lit/autocomplete 46.76 KB (0%)
prosekit/lit/block-handle 26.57 KB (0%)
prosekit/lit/inline-popover 30 KB (0%)
prosekit/lit/popover 14.07 KB (0%)
prosekit/lit/resizable 4.03 KB (0%)
prosekit/lit/table-handle 34.77 KB (0%)
prosekit/lit/tooltip 11.41 KB (0%)
prosekit/pm 13 B (0%)
prosekit/pm/commands 15.84 KB (0%)
prosekit/pm/history 13.55 KB (0%)
prosekit/pm/inputrules 11.8 KB (0%)
prosekit/pm/keymap 11.72 KB (0%)
prosekit/pm/model 12.71 KB (0%)
prosekit/pm/state 16.8 KB (0%)
prosekit/pm/transform 14.62 KB (0%)
prosekit/pm/view 39.91 KB (0%)
prosekit/pm/view/style/prosemirror.css 259 B (0%)
prosekit/preact 19.57 KB (0%)
prosekit/preact/autocomplete 47.41 KB (0%)
prosekit/preact/block-handle 27.22 KB (0%)
prosekit/preact/inline-popover 30.54 KB (0%)
prosekit/preact/popover 14.62 KB (0%)
prosekit/preact/resizable 4.63 KB (0%)
prosekit/preact/table-handle 35.41 KB (0%)
prosekit/preact/tooltip 11.97 KB (0%)
prosekit/react 36.51 KB (0%)
prosekit/react/autocomplete 47.34 KB (0%)
prosekit/react/block-handle 27.11 KB (0%)
prosekit/react/inline-popover 30.51 KB (0%)
prosekit/react/popover 14.62 KB (0%)
prosekit/react/resizable 4.64 KB (0%)
prosekit/react/table-handle 35.36 KB (0%)
prosekit/react/tooltip 11.94 KB (0%)
prosekit/solid 39.69 KB (0%)
prosekit/solid/autocomplete 47.3 KB (+0.12% 🔺)
prosekit/solid/block-handle 27.09 KB (+0.08% 🔺)
prosekit/solid/inline-popover 30.51 KB (+0.13% 🔺)
prosekit/solid/popover 14.57 KB (-0.05% 🔽)
prosekit/solid/resizable 4.56 KB (+0.37% 🔺)
prosekit/solid/table-handle 35.34 KB (+0.22% 🔺)
prosekit/solid/tooltip 11.91 KB (-0.08% 🔽)
prosekit/vue 36.58 KB (0%)
prosekit/vue/autocomplete 47.26 KB (0%)
prosekit/vue/block-handle 27.05 KB (0%)
prosekit/vue/inline-popover 30.42 KB (0%)
prosekit/vue/popover 14.52 KB (0%)
prosekit/vue/resizable 4.47 KB (0%)
prosekit/vue/table-handle 35.25 KB (0%)
prosekit/vue/tooltip 11.8 KB (0%)
prosekit/web 13 B (0%)
prosekit/web/autocomplete 46.78 KB (0%)
prosekit/web/block-handle 26.54 KB (0%)
prosekit/web/inline-popover 30.02 KB (0%)
prosekit/web/popover 14.02 KB (0%)
prosekit/web/resizable 4.03 KB (0%)
prosekit/web/table-handle 34.79 KB (0%)
prosekit/web/tooltip 11.39 KB (0%)

@ocavue ocavue marked this pull request as ready for review April 18, 2025 06:55
@ocavue ocavue enabled auto-merge (squash) April 18, 2025 06:58
@ocavue ocavue merged commit b948e4b into master Apr 18, 2025
14 of 15 checks passed
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