Skip to content

fix: inline scrolloop/core and scrolloop/shared into scrolloop bundle#43

Merged
zaewc merged 1 commit intomasterfrom
develop
Apr 20, 2026
Merged

fix: inline scrolloop/core and scrolloop/shared into scrolloop bundle#43
zaewc merged 1 commit intomasterfrom
develop

Conversation

@zaewc
Copy link
Copy Markdown
Owner

@zaewc zaewc commented Apr 20, 2026

Summary

  • Published scrolloop@0.5.1 declared @scrolloop/core and @scrolloop/shared as runtime deps, but those packages aren't on npm — npm install scrolloop fails to resolve them.
  • Force-bundle both into the adapter builds via tsup noExternal, and duplicate Range / PageResponse interfaces in the adapter packages so the public .d.ts is also self-contained (tsup dts.resolve wasn't inlining workspace package types reliably).
  • Bumps version to 0.5.2 (0.5.1 on npm is immutable and broken).

Test plan

  • pnpm run build — all 6 packages build successfully
  • pnpm run typecheck — passes
  • pnpm run test — 21 tests pass
  • dist/index.{cjs,mjs,d.ts,d.cts} contain zero references to @scrolloop/* after build
  • npm pack tarball has no runtime dependencies, only peerDependencies: { react: '>=18.0.0' }
  • CI publish job succeeds → scrolloop@0.5.2 on npm is installable standalone

🤖 Generated with Claude Code

Published scrolloop@0.5.1 declared unresolvable deps (@scrolloop/core,
@scrolloop/shared are not on npm) so npm install scrolloop failed.
Force-bundle them via tsup noExternal and duplicate the two shared
interfaces in the adapter packages so the public .d.ts is self-contained.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

📊 Test Coverage Report (vitest)

Package Statements Branches Functions Lines
@scrolloop/core 218/218 (100%) 53/53 (100%) 25/25 (100%) 218/218 (100%)
@scrolloop/react 420/715 (58.74%) 73/89 (82.02%) 5/17 (29.41%) 420/715 (58.74%)
@scrolloop/react-native 0/238 (0%) 1/4 (25%) 1/4 (25%) 0/238 (0%)
@scrolloop/shared 176/176 (100%) 54/54 (100%) 14/14 (100%) 176/176 (100%)

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request increments the version to 0.5.2, removes internal workspace dependencies from the root package.json, and redefines the Range and PageResponse interfaces locally within the React and React Native packages. The tsup configuration is updated to bundle these internal dependencies. Feedback suggests that duplicating these interfaces introduces maintenance risks and recommends using build-time inlining to maintain a single source of truth.

Comment on lines +3 to +12
export interface Range {
startIndex: number;
endIndex: number;
}

export interface PageResponse<T> {
items: T[];
total: number;
hasMore: boolean;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Defining these interfaces locally instead of importing them from @scrolloop/shared introduces a maintenance risk where the definitions might diverge over time. If the tsup configuration can be adjusted to reliably inline these types into the .d.ts file (using explicit dts.resolve), it would be preferable to keep the single source of truth in the shared package.

Comment on lines +4 to +13
export interface Range {
startIndex: number;
endIndex: number;
}

export interface PageResponse<T> {
items: T[];
total: number;
hasMore: boolean;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

As with the React package, this duplication is a potential source of bugs if the shared types are updated but these local copies are forgotten. Relying on build-time inlining of types is a safer long-term approach for maintaining a DRY codebase.

@zaewc zaewc merged commit 1181498 into master Apr 20, 2026
4 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