Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor package names to include scope #944

Merged
merged 2 commits into from
Mar 4, 2025
Merged

Refactor package names to include scope #944

merged 2 commits into from
Mar 4, 2025

Conversation

hackerwins
Copy link
Member

@hackerwins hackerwins commented Mar 4, 2025

What this PR does / why we need it?

Refactor package names to include scope

Introduce scoped packages in yorkie-js-sdk to make it easier to add
binders like React or Redux in the future.

Before:

import yorkie from 'yorkie-js-sdk';

After:

import yorkie from '@yorkie-js/sdk';

Any background context you want to provide?

What are the relevant tickets?

Fixes #

Checklist

  • Added relevant tests or not required
  • Didn't break anything

Summary by CodeRabbit

  • Refactor

    • Updated all package references and import statements to the new scoped format, transitioning from the old name to the new namespaced package.
    • Renamed related packages for enhanced consistency and modularity.
  • Chores

    • Adjusted publish commands and script filters to reflect the new naming convention.
    • Upgraded several development tools to newer versions, ensuring improved code quality and consistency.

Copy link

coderabbitai bot commented Mar 4, 2025

Walkthrough

This pull request renames the Yorkie SDK package from yorkie-js-sdk to a scoped @yorkie-js/sdk across the repository. Changes include updates to GitHub Actions workflows, various example projects, and internal package configurations. Import statements, dependency declarations, and script filters have been modified accordingly, along with minor configuration reordering and development dependency upgrades. No changes were made to the functionality or control flow.

Changes

Files Change Summary
.github/workflows/npm-publish.yml, package.json (root) Updated pnpm publish filter and script commands from yorkie-js-sdk to @yorkie-js/sdk; dev dependency versions were upgraded.
examples/... (nextjs-scheduler, profile-stack, react-, vanilla-, vuejs-kanban) Refactored import statements and dependency declarations to use @yorkie-js/sdk in source files and package.json files.
examples/nextjs-scheduler/tsconfig.json Reordered "paths" entries (e.g. for "react" and @yorkie-js/sdk/src/*); functionality remains unchanged.
packages/... (create-yorkie-app, devtools, sdk, etc.) Renamed internal package names and updated import paths and dependency references to the new scoped format.

Possibly related PRs

Suggested labels

enhancement 🌟

Poem

I'm a rabbit with a joyful hop,
Scoping our code until it pops!
From flat names to a scoped display,
Every file hops in a brand new way.
I twirl my ears and cheer the change today!
🐇🎉


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6399ab4 and 701ca3a.

📒 Files selected for processing (1)
  • packages/README.md (0 hunks)
💤 Files with no reviewable changes (1)
  • packages/README.md
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build (18.x)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/sdk/package.json (1)

6-9: PublishConfig Naming Consistency Notice:
In the publishConfig section, the bundle file names still reference yorkie-js-sdk.js and yorkie-js-sdk.d.ts. Consider updating these filenames to better reflect the new scoped package name for complete consistency.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b52bb0d and 6399ab4.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (39)
  • .github/workflows/npm-publish.yml (1 hunks)
  • examples/nextjs-scheduler/app/page.tsx (1 hunks)
  • examples/nextjs-scheduler/app/utils/handlePeers.ts (1 hunks)
  • examples/nextjs-scheduler/package.json (1 hunks)
  • examples/nextjs-scheduler/tsconfig.json (1 hunks)
  • examples/profile-stack/main.js (1 hunks)
  • examples/profile-stack/package.json (1 hunks)
  • examples/react-tldraw/package.json (1 hunks)
  • examples/react-tldraw/src/hooks/types.ts (1 hunks)
  • examples/react-tldraw/src/hooks/useMultiplayerState.ts (1 hunks)
  • examples/react-todomvc/package.json (1 hunks)
  • examples/react-todomvc/src/App.tsx (1 hunks)
  • examples/simultaneous-cursors/package.json (1 hunks)
  • examples/simultaneous-cursors/src/App.jsx (1 hunks)
  • examples/vanilla-codemirror6/package.json (1 hunks)
  • examples/vanilla-codemirror6/src/main.ts (1 hunks)
  • examples/vanilla-codemirror6/src/network.ts (1 hunks)
  • examples/vanilla-codemirror6/src/type.ts (1 hunks)
  • examples/vanilla-codemirror6/src/utils.ts (1 hunks)
  • examples/vanilla-quill/package.json (1 hunks)
  • examples/vanilla-quill/src/main.ts (1 hunks)
  • examples/vanilla-quill/src/network.ts (1 hunks)
  • examples/vanilla-quill/src/type.ts (1 hunks)
  • examples/vanilla-quill/src/utils.ts (1 hunks)
  • examples/vuejs-kanban/package.json (1 hunks)
  • examples/vuejs-kanban/src/App.vue (1 hunks)
  • package.json (2 hunks)
  • packages/create-yorkie-app/package.json (1 hunks)
  • packages/devtools/package.json (2 hunks)
  • packages/devtools/src/content.ts (1 hunks)
  • packages/devtools/src/devtools/components/Detail.tsx (1 hunks)
  • packages/devtools/src/devtools/components/Tree.tsx (1 hunks)
  • packages/devtools/src/devtools/contexts/YorkieSource.tsx (1 hunks)
  • packages/devtools/src/devtools/panel/index.tsx (1 hunks)
  • packages/devtools/src/devtools/tabs/Document.tsx (1 hunks)
  • packages/devtools/src/devtools/tabs/History.tsx (1 hunks)
  • packages/devtools/src/port.ts (1 hunks)
  • packages/sdk/package.json (1 hunks)
  • packages/sdk/public/prosemirror.html (1 hunks)
✅ Files skipped from review due to trivial changes (26)
  • examples/nextjs-scheduler/app/utils/handlePeers.ts
  • packages/devtools/src/devtools/tabs/Document.tsx
  • examples/vanilla-codemirror6/src/utils.ts
  • examples/vanilla-quill/package.json
  • examples/nextjs-scheduler/app/page.tsx
  • examples/vanilla-quill/src/network.ts
  • examples/react-tldraw/src/hooks/types.ts
  • examples/vanilla-codemirror6/src/type.ts
  • examples/vuejs-kanban/src/App.vue
  • examples/vanilla-quill/src/type.ts
  • examples/profile-stack/main.js
  • packages/devtools/src/devtools/components/Tree.tsx
  • examples/simultaneous-cursors/src/App.jsx
  • examples/react-todomvc/src/App.tsx
  • packages/devtools/src/devtools/contexts/YorkieSource.tsx
  • examples/vanilla-codemirror6/src/network.ts
  • packages/devtools/src/content.ts
  • packages/devtools/src/devtools/panel/index.tsx
  • examples/vanilla-codemirror6/src/main.ts
  • packages/devtools/src/devtools/components/Detail.tsx
  • examples/nextjs-scheduler/tsconfig.json
  • examples/vanilla-quill/src/utils.ts
  • packages/devtools/src/port.ts
  • packages/devtools/src/devtools/tabs/History.tsx
  • examples/vanilla-quill/src/main.ts
  • examples/react-tldraw/src/hooks/useMultiplayerState.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build (18.x)
🔇 Additional comments (22)
examples/profile-stack/package.json (1)

15-15: Scoped Dependency Name Update Confirmed:
The dependency for the Yorkie SDK has been updated to "@yorkie-js/sdk": "workspace:*". This change aligns with the scoped package strategy and improves clarity in dependency management.

examples/vuejs-kanban/package.json (1)

11-11: Dependency Name Refactor:
The dependency has been updated to "@yorkie-js/sdk": "workspace:*", ensuring consistency with the new scoped naming convention. Please verify that corresponding import statements in the project are updated accordingly.

packages/sdk/package.json (1)

2-2: Package Name Scoped Update:
The package name is now declared as "@yorkie-js/sdk", which satisfies the new scoped naming requirements and improves module clarity.

packages/create-yorkie-app/package.json (1)

2-2: CLI Tool Package Name Update:
The package name has been updated to "@yorkie-js/create-yorkie-app", aligning it with the new scoped naming convention. Ensure that the CLI alias and related tooling continue to work as expected after this refactor.

examples/simultaneous-cursors/package.json (1)

14-14: Scoped Dependency Update:
The dependency "@yorkie-js/sdk": "workspace:*" is correctly updated, ensuring consistency across the codebase with the new scoped package naming. Confirm that all module import paths have been adjusted accordingly.

packages/sdk/public/prosemirror.html (1)

50-50: Scoped Import Mapping Updated
The import mapping now references "@yorkie-js/sdk": "./yorkie.js", which correctly reflects the new scoped package name. Please verify that the file ./yorkie.js exports the expected API for the scoped package.

.github/workflows/npm-publish.yml (1)

41-41: Updated Publish Filter to Scoped Package
The pnpm publish command has been updated to use --filter=@yorkie-js/sdk, ensuring that only the new scoped package is targeted during publishing. This change is consistent with the refactor objectives.

examples/react-todomvc/package.json (1)

16-16: Dependency Name Change to Scoped Package
The dependency for the Yorkie SDK has been updated from "yorkie-js-sdk": "workspace:*" to "@yorkie-js/sdk": "workspace:*", which aligns with the new naming convention across the project.

examples/vanilla-codemirror6/package.json (1)

23-23: Dependency Update for Scoped Package
The dependency now correctly references "@yorkie-js/sdk": "workspace:*". This change ensures consistency with the overall package renaming effort.

examples/react-tldraw/package.json (1)

20-20: Dependency Renaming to Scoped Format
The Yorkie SDK dependency was renamed from "yorkie-js-sdk": "workspace:*" to "@yorkie-js/sdk": "workspace:*", fulfilling the refactoring objective.

packages/devtools/package.json (2)

2-2: Scoped Package Name Update
The package name has been updated to the new scoped format "@yorkie-js/devtools" as intended by the refactor. This change improves consistency across the project.


23-23: Dependency Scope Revision
The dependency for the Yorkie SDK is now correctly referenced as "@yorkie-js/sdk", ensuring that all package references use the updated namespacing.

examples/nextjs-scheduler/package.json (1)

16-16: Scoped Dependency Update
The dependency for the Yorkie SDK has been updated to "@yorkie-js/sdk", which aligns with the new scoped naming standard required by this refactor.

package.json (9)

8-8: Scoped Script Update – SDK
The script for the SDK now uses "pnpm --filter=@yorkie-js/sdk". This update correctly reflects the refactored package naming across script commands.


9-9: Scoped Script Update – Create Yorkie App
The command for creating a Yorkie app has been updated to use "pnpm --filter=@yorkie-js/create-yorkie-app", ensuring consistent namespacing.


10-10: Scoped Script Update – Devtools
The devtools script now references "pnpm --filter=@yorkie-js/devtools", keeping the naming consistent per the new scoped package convention.


30-30: ESLint Version Upgrade
Upgrading ESLint to "^8.57.1" helps ensure that the project benefits from the latest linting improvements and fixes.


31-31: ESLint Plugin JSDoc Update
The update for "eslint-plugin-jsdoc" to "^39.9.1" is appropriate and will aid in better documentation linting.


32-32: ESLint Plugin Prettier Update
Updating "eslint-plugin-prettier" to "^5.2.3" ensures compatibility with the latest prettier guidelines and integration.


33-33: Husky Version Upgrade
Upgrading Husky to "^9.1.7" is a good move to maintain robust Git hook management and compatibility with recent changes.


34-34: Lint-Staged Version Upgrade
The upgrade of lint-staged to "^15.4.3" will help ensure more effective pre-commit checks and code quality enforcement.


35-35: Only-Allow Dependency Update
Updating "only-allow" to "^1.2.1" maintains the integrity of the package management policy enforced during preinstall.

Copy link

codecov bot commented Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.54%. Comparing base (b52bb0d) to head (701ca3a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #944   +/-   ##
=======================================
  Coverage   78.54%   78.54%           
=======================================
  Files          63       63           
  Lines        5421     5421           
  Branches      998      998           
=======================================
  Hits         4258     4258           
  Misses        873      873           
  Partials      290      290           

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

@hackerwins hackerwins requested a review from chacha912 March 4, 2025 07:39
@hackerwins hackerwins merged commit 4be4077 into main Mar 4, 2025
2 checks passed
@hackerwins hackerwins deleted the scope-package branch March 4, 2025 09:32
hackerwins added a commit that referenced this pull request Mar 4, 2025
Introduce scoped packages in yorkie-js-sdk to make it easier to add
binders like React or Redux in the future.

- Before: `import yorkie from 'yorkie-js-sdk';`
- After: `import yorkie from '@yorkie-js/sdk';`
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