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 import paths to use '@yorkie-js/sdk' #947

Merged
merged 1 commit into from
Mar 6, 2025
Merged

Conversation

hackerwins
Copy link
Member

@hackerwins hackerwins commented Mar 6, 2025

What this PR does / why we need it?

Refactor import paths to use '@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

    • Standardized module path aliases across all components, examples, and tests for improved consistency and maintainability.
  • Chore

    • Updated project configurations and mapping settings to align with the new naming convention, ensuring smoother module resolution without affecting functionality.

Copy link

coderabbitai bot commented Mar 6, 2025

Walkthrough

This pull request systematically updates the import paths and alias configurations across the codebase. All references to the Yorkie SDK have been modified from using the old format (@yorkie-js-sdk/...) to the new format (@yorkie-js/sdk/...). Changes are applied throughout examples, package sources (including devtools, react, and sdk modules), tests, and the TypeScript configuration files. No modifications to the core logic, error handling, or control flow have been introduced.

Changes

File(s) Change Summary
examples/.../tsconfig.json, examples/.../vite.config.*, examples/.../*.d.ts Update alias and import paths from @yorkie-js-sdk to @yorkie-js/sdk in configuration and type declarations.
packages/devtools/** Modified import paths (e.g. error handling) from @yorkie-js-sdk to @yorkie-js/sdk in context components and configuration.
packages/react/** Updated TypeScript and Vite configuration to reference the new SDK import paths.
packages/sdk/src/** Across API, client, document (change, crdt, json, operation, presence, time), util, and main yorkie.ts, all import paths changed to @yorkie-js/sdk/....
packages/sdk/test/** All test files (integration, unit, bench, etc.) modified to use updated import paths from @yorkie-js-sdk to @yorkie-js/sdk.
packages/sdk/tsconfig.json Path mappings updated from "@yorkie-js-sdk/src/*" and "@yorkie-js-sdk/test/*" to "@yorkie-js/sdk/src/*" and "@yorkie-js/sdk/test/*".

Possibly related PRs

Suggested labels

enhancement 🌟

Poem

I'm a bunny with a hop in my stride,
Scanning the code with whiskers open wide.
Paths now shine in a brand new light,
"sdk" leads the way, making everything bright.
Leaping through updates with a joyful cheer,
Carrots and code – a treat I hold dear!
Hop on, dear coder, the future is clear!

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

examples/react-tldraw/src/tldraw.d.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "@typescript-eslint/eslint-plugin".

(The package "@typescript-eslint/eslint-plugin" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install @typescript-eslint/eslint-plugin@latest --save-dev

The plugin "@typescript-eslint/eslint-plugin" was referenced from the config file in ".eslintrc.js".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

examples/profile-stack/vite.config.js

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "@typescript-eslint/eslint-plugin".

(The package "@typescript-eslint/eslint-plugin" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install @typescript-eslint/eslint-plugin@latest --save-dev

The plugin "@typescript-eslint/eslint-plugin" was referenced from the config file in ".eslintrc.js".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

examples/react-tldraw/vite.config.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "@typescript-eslint/eslint-plugin".

(The package "@typescript-eslint/eslint-plugin" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install @typescript-eslint/eslint-plugin@latest --save-dev

The plugin "@typescript-eslint/eslint-plugin" was referenced from the config file in ".eslintrc.js".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

  • 88 others

📜 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 0c51e7a and 5b34d06.

📒 Files selected for processing (99)
  • examples/nextjs-scheduler/tsconfig.json (1 hunks)
  • examples/profile-stack/vite.config.js (1 hunks)
  • examples/react-tldraw/src/tldraw.d.ts (1 hunks)
  • examples/react-tldraw/tsconfig.json (1 hunks)
  • examples/react-tldraw/vite.config.ts (1 hunks)
  • examples/react-todomvc/tsconfig.json (1 hunks)
  • examples/react-todomvc/vite.config.ts (1 hunks)
  • examples/simultaneous-cursors/vite.config.js (1 hunks)
  • examples/vanilla-codemirror6/tsconfig.json (1 hunks)
  • examples/vanilla-codemirror6/vite.config.js (1 hunks)
  • examples/vanilla-quill/tsconfig.json (1 hunks)
  • examples/vanilla-quill/vite.config.js (1 hunks)
  • examples/vuejs-kanban/vite.config.js (1 hunks)
  • packages/devtools/src/devtools/contexts/SelectedNode.tsx (1 hunks)
  • packages/devtools/src/devtools/contexts/SelectedPresence.tsx (1 hunks)
  • packages/devtools/src/devtools/contexts/YorkieSource.tsx (1 hunks)
  • packages/devtools/tsconfig.json (1 hunks)
  • packages/react/tsconfig.json (1 hunks)
  • packages/react/vite.config.js (1 hunks)
  • packages/sdk/src/api/converter.ts (2 hunks)
  • packages/sdk/src/client/attachment.ts (1 hunks)
  • packages/sdk/src/client/client.ts (2 hunks)
  • packages/sdk/src/devtools/index.ts (1 hunks)
  • packages/sdk/src/devtools/types.ts (2 hunks)
  • packages/sdk/src/document/change/change.ts (1 hunks)
  • packages/sdk/src/document/change/change_id.ts (1 hunks)
  • packages/sdk/src/document/change/change_pack.ts (1 hunks)
  • packages/sdk/src/document/change/context.ts (1 hunks)
  • packages/sdk/src/document/crdt/array.ts (1 hunks)
  • packages/sdk/src/document/crdt/counter.ts (1 hunks)
  • packages/sdk/src/document/crdt/element.ts (1 hunks)
  • packages/sdk/src/document/crdt/element_rht.ts (1 hunks)
  • packages/sdk/src/document/crdt/gc.ts (1 hunks)
  • packages/sdk/src/document/crdt/object.ts (1 hunks)
  • packages/sdk/src/document/crdt/primitive.ts (1 hunks)
  • packages/sdk/src/document/crdt/rga_tree_list.ts (1 hunks)
  • packages/sdk/src/document/crdt/rga_tree_split.ts (1 hunks)
  • packages/sdk/src/document/crdt/rht.ts (1 hunks)
  • packages/sdk/src/document/crdt/root.ts (1 hunks)
  • packages/sdk/src/document/crdt/text.ts (1 hunks)
  • packages/sdk/src/document/crdt/tree.ts (2 hunks)
  • packages/sdk/src/document/document.ts (6 hunks)
  • packages/sdk/src/document/json/array.ts (5 hunks)
  • packages/sdk/src/document/json/counter.ts (1 hunks)
  • packages/sdk/src/document/json/element.ts (1 hunks)
  • packages/sdk/src/document/json/object.ts (1 hunks)
  • packages/sdk/src/document/json/text.ts (1 hunks)
  • packages/sdk/src/document/json/tree.ts (2 hunks)
  • packages/sdk/src/document/operation/add_operation.ts (1 hunks)
  • packages/sdk/src/document/operation/edit_operation.ts (1 hunks)
  • packages/sdk/src/document/operation/increase_operation.ts (1 hunks)
  • packages/sdk/src/document/operation/move_operation.ts (1 hunks)
  • packages/sdk/src/document/operation/operation.ts (1 hunks)
  • packages/sdk/src/document/operation/remove_operation.ts (1 hunks)
  • packages/sdk/src/document/operation/set_operation.ts (1 hunks)
  • packages/sdk/src/document/operation/style_operation.ts (1 hunks)
  • packages/sdk/src/document/operation/tree_edit_operation.ts (1 hunks)
  • packages/sdk/src/document/operation/tree_style_operation.ts (1 hunks)
  • packages/sdk/src/document/presence/presence.ts (1 hunks)
  • packages/sdk/src/document/time/ticket.ts (1 hunks)
  • packages/sdk/src/util/llrb_tree.ts (1 hunks)
  • packages/sdk/src/util/object.ts (1 hunks)
  • packages/sdk/src/util/observable.ts (1 hunks)
  • packages/sdk/src/yorkie.ts (5 hunks)
  • packages/sdk/test/bench/counter.bench.ts (1 hunks)
  • packages/sdk/test/bench/document.bench.ts (1 hunks)
  • packages/sdk/test/bench/splay_tree.bench.ts (1 hunks)
  • packages/sdk/test/bench/text.bench.ts (1 hunks)
  • packages/sdk/test/bench/tree.bench.ts (1 hunks)
  • packages/sdk/test/helper/helper.ts (2 hunks)
  • packages/sdk/test/integration/array_test.ts (1 hunks)
  • packages/sdk/test/integration/client_test.ts (1 hunks)
  • packages/sdk/test/integration/counter_test.ts (1 hunks)
  • packages/sdk/test/integration/document_test.ts (1 hunks)
  • packages/sdk/test/integration/gc_test.ts (1 hunks)
  • packages/sdk/test/integration/integration_helper.ts (1 hunks)
  • packages/sdk/test/integration/object_test.ts (1 hunks)
  • packages/sdk/test/integration/presence_test.ts (1 hunks)
  • packages/sdk/test/integration/primitive_test.ts (1 hunks)
  • packages/sdk/test/integration/snapshot_test.ts (1 hunks)
  • packages/sdk/test/integration/text_test.ts (1 hunks)
  • packages/sdk/test/integration/tree_concurrency_test.ts (1 hunks)
  • packages/sdk/test/integration/tree_test.ts (1 hunks)
  • packages/sdk/test/integration/webhook_test.ts (1 hunks)
  • packages/sdk/test/unit/api/converter_test.ts (1 hunks)
  • packages/sdk/test/unit/document/crdt/counter_test.ts (2 hunks)
  • packages/sdk/test/unit/document/crdt/primitive_test.ts (1 hunks)
  • packages/sdk/test/unit/document/crdt/rht_test.ts (1 hunks)
  • packages/sdk/test/unit/document/crdt/root_test.ts (1 hunks)
  • packages/sdk/test/unit/document/crdt/tree_test.ts (1 hunks)
  • packages/sdk/test/unit/document/document_test.ts (1 hunks)
  • packages/sdk/test/unit/document/gc_test.ts (1 hunks)
  • packages/sdk/test/unit/util/index_tree_test.ts (1 hunks)
  • packages/sdk/test/unit/util/llrb_tree_test.ts (1 hunks)
  • packages/sdk/test/unit/util/logger_test.ts (1 hunks)
  • packages/sdk/test/unit/util/splay_tree_test.ts (1 hunks)
  • packages/sdk/test/vitest.d.ts (1 hunks)
  • packages/sdk/test/vitest.setup.ts (1 hunks)
  • packages/sdk/tsconfig.json (1 hunks)
✅ Files skipped from review due to trivial changes (98)
  • examples/profile-stack/vite.config.js
  • examples/vanilla-quill/vite.config.js
  • packages/sdk/test/integration/integration_helper.ts
  • packages/sdk/src/document/operation/move_operation.ts
  • examples/vanilla-codemirror6/vite.config.js
  • examples/react-tldraw/tsconfig.json
  • packages/sdk/src/document/operation/remove_operation.ts
  • examples/react-tldraw/vite.config.ts
  • examples/vuejs-kanban/vite.config.js
  • packages/sdk/src/document/operation/set_operation.ts
  • packages/react/vite.config.js
  • packages/devtools/src/devtools/contexts/SelectedNode.tsx
  • packages/sdk/src/document/change/change.ts
  • packages/sdk/src/util/llrb_tree.ts
  • examples/simultaneous-cursors/vite.config.js
  • examples/nextjs-scheduler/tsconfig.json
  • packages/sdk/src/yorkie.ts
  • packages/sdk/test/helper/helper.ts
  • packages/sdk/test/bench/text.bench.ts
  • packages/sdk/src/document/json/tree.ts
  • packages/sdk/src/document/json/counter.ts
  • packages/devtools/tsconfig.json
  • packages/devtools/src/devtools/contexts/SelectedPresence.tsx
  • packages/sdk/src/document/json/text.ts
  • packages/sdk/test/unit/util/logger_test.ts
  • examples/react-todomvc/tsconfig.json
  • packages/sdk/src/util/object.ts
  • packages/devtools/src/devtools/contexts/YorkieSource.tsx
  • packages/sdk/test/vitest.d.ts
  • packages/sdk/test/bench/splay_tree.bench.ts
  • packages/sdk/src/document/operation/add_operation.ts
  • packages/sdk/src/document/operation/style_operation.ts
  • packages/sdk/src/document/change/change_id.ts
  • packages/sdk/test/unit/document/crdt/counter_test.ts
  • packages/sdk/src/document/crdt/tree.ts
  • packages/sdk/src/document/crdt/object.ts
  • packages/sdk/test/bench/tree.bench.ts
  • packages/sdk/test/integration/counter_test.ts
  • packages/sdk/test/unit/util/splay_tree_test.ts
  • packages/sdk/test/integration/gc_test.ts
  • packages/sdk/src/document/crdt/text.ts
  • packages/sdk/src/document/crdt/rga_tree_split.ts
  • packages/sdk/src/document/crdt/primitive.ts
  • packages/sdk/src/document/operation/operation.ts
  • packages/sdk/src/document/json/element.ts
  • packages/sdk/src/document/change/change_pack.ts
  • packages/sdk/src/document/crdt/element.ts
  • packages/sdk/src/document/change/context.ts
  • packages/sdk/test/integration/document_test.ts
  • packages/sdk/src/client/attachment.ts
  • packages/sdk/test/integration/snapshot_test.ts
  • packages/sdk/src/util/observable.ts
  • packages/sdk/test/unit/api/converter_test.ts
  • packages/sdk/src/document/document.ts
  • examples/vanilla-codemirror6/tsconfig.json
  • packages/sdk/test/integration/primitive_test.ts
  • packages/sdk/test/bench/counter.bench.ts
  • packages/sdk/src/document/crdt/element_rht.ts
  • examples/react-tldraw/src/tldraw.d.ts
  • packages/sdk/test/bench/document.bench.ts
  • packages/sdk/src/devtools/types.ts
  • packages/sdk/src/devtools/index.ts
  • packages/sdk/test/integration/text_test.ts
  • packages/sdk/test/unit/util/llrb_tree_test.ts
  • packages/sdk/src/document/crdt/rht.ts
  • packages/sdk/src/document/time/ticket.ts
  • packages/sdk/src/document/operation/tree_style_operation.ts
  • packages/sdk/test/unit/document/crdt/rht_test.ts
  • packages/sdk/test/integration/array_test.ts
  • packages/sdk/src/document/operation/edit_operation.ts
  • packages/sdk/src/document/crdt/counter.ts
  • packages/sdk/test/integration/client_test.ts
  • examples/vanilla-quill/tsconfig.json
  • packages/sdk/test/unit/document/gc_test.ts
  • packages/sdk/src/document/json/object.ts
  • packages/sdk/test/integration/webhook_test.ts
  • packages/sdk/src/document/crdt/gc.ts
  • packages/sdk/test/integration/object_test.ts
  • packages/sdk/src/document/presence/presence.ts
  • packages/sdk/src/document/operation/tree_edit_operation.ts
  • packages/sdk/test/unit/document/crdt/primitive_test.ts
  • packages/sdk/test/integration/tree_concurrency_test.ts
  • packages/sdk/test/unit/util/index_tree_test.ts
  • packages/sdk/test/unit/document/document_test.ts
  • packages/sdk/src/document/crdt/root.ts
  • packages/sdk/test/vitest.setup.ts
  • packages/sdk/test/integration/presence_test.ts
  • packages/sdk/tsconfig.json
  • packages/sdk/test/unit/document/crdt/tree_test.ts
  • packages/sdk/src/document/operation/increase_operation.ts
  • packages/sdk/src/document/crdt/array.ts
  • packages/sdk/src/client/client.ts
  • packages/sdk/test/integration/tree_test.ts
  • packages/sdk/src/document/json/array.ts
  • packages/sdk/src/document/crdt/rga_tree_list.ts
  • packages/sdk/test/unit/document/crdt/root_test.ts
  • packages/react/tsconfig.json
  • packages/sdk/src/api/converter.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build (18.x)
🔇 Additional comments (1)
examples/react-todomvc/vite.config.ts (1)

17-17: Import path standardization looks good.

This change aligns with the PR objective of refactoring import paths to use '@yorkie-js/sdk'. The alias path has been updated from '@yorkie-js-sdk/src' to '@yorkie-js/sdk/src' which helps standardize the import pattern across the codebase.

✨ 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.

Copy link

codecov bot commented Mar 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.50%. Comparing base (0c51e7a) to head (5b34d06).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #947   +/-   ##
=======================================
  Coverage   78.50%   78.50%           
=======================================
  Files          63       63           
  Lines        5421     5421           
  Branches      998      998           
=======================================
  Hits         4256     4256           
  Misses        874      874           
  Partials      291      291           

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hackerwins hackerwins merged commit 0acf73c into main Mar 6, 2025
2 checks passed
@hackerwins hackerwins deleted the import-path branch March 6, 2025 06:41
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