-
Notifications
You must be signed in to change notification settings - Fork 95
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
Introduce monorepo to manage packages using pnpm
#880
Conversation
Using commands other than 'pnpm' will be rejected
There was a problem with 'output' field in nextjs.config.js. Upgrading the version of Next to 14.1.3 will resolve this issue
Caution Review failedThe pull request is closed. WalkthroughThis update introduces a monorepo structure using pnpm to effectively manage multiple packages within a single repository. Key changes include transitioning from npm to pnpm across various workflows, updating dependency management, and restructuring project directories to enhance efficiency in building and testing processes. The addition of a pnpm workspace configuration streamlines package handling, making the development experience more cohesive and organized. Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant CI/CD
participant pnpm
participant Workspace
Developer->>CI/CD: Push code changes
CI/CD->>pnpm: Install dependencies
pnpm->>Workspace: Manage package installations
Workspace-->>CI/CD: Return installed packages
CI/CD->>Workspace: Build and test applications
Workspace-->>CI/CD: Return build results
Assessment against linked issues
Possibly related PRs
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Here is an update. Issue above "4. Scripts in create-yorkie-app" has been resolved. It turns out that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Outside diff range, codebase verification and nitpick comments (2)
examples/nextjs-scheduler/tsconfig.json (1)
7-7
: Consider enabling strict mode for better type safety.The
strict
option has been set tofalse
, which disables several type-checking features. Consider enabling it to ensure better type safety and catch potential errors at compile time.- "strict": false, + "strict": true,examples/README.md (1)
33-33
: Consider using a markdown link for the URL.Using a markdown link improves readability and follows best practices.
- Open the browser and go to the URL that is printed in the terminal. + Open the browser and go to the [URL](https://yorkie.dev) that is printed in the terminal.Tools
Markdownlint
33-33: null
Bare URL used(MD034, no-bare-urls)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (6)
examples/nextjs-scheduler/package-lock.json
is excluded by!**/package-lock.json
package-lock.json
is excluded by!**/package-lock.json
packages/devtools/assets/icon.png
is excluded by!**/*.png
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
tools/create-yorkie-app/package-lock.json
is excluded by!**/package-lock.json
tools/devtools/package-lock.json
is excluded by!**/package-lock.json
Files selected for processing (49)
- .github/workflows/ci.yml (2 hunks)
- .github/workflows/create-yorkie-app-publish.yml (2 hunks)
- .github/workflows/devtools-publish.yml (2 hunks)
- .github/workflows/github-page-publish.yml (1 hunks)
- .github/workflows/npm-publish.yml (1 hunks)
- .gitignore (1 hunks)
- .npmrc (1 hunks)
- CONTRIBUTING.md (5 hunks)
- examples/README.md (1 hunks)
- examples/nextjs-scheduler/.eslintrc.js (1 hunks)
- examples/nextjs-scheduler/README.md (1 hunks)
- examples/nextjs-scheduler/package.json (1 hunks)
- examples/nextjs-scheduler/tsconfig.json (3 hunks)
- examples/profile-stack/README.md (1 hunks)
- examples/profile-stack/package.json (1 hunks)
- examples/profile-stack/vite.config.js (1 hunks)
- examples/react-tldraw/README.md (1 hunks)
- examples/react-tldraw/package.json (1 hunks)
- examples/react-tldraw/src/hooks/useMultiplayerState.ts (1 hunks)
- examples/react-tldraw/tsconfig.json (1 hunks)
- examples/react-tldraw/vite.config.ts (1 hunks)
- examples/react-todomvc/README.md (1 hunks)
- examples/react-todomvc/package.json (1 hunks)
- examples/react-todomvc/tsconfig.json (1 hunks)
- examples/react-todomvc/vite.config.ts (1 hunks)
- examples/simultaneous-cursors/README.md (3 hunks)
- examples/simultaneous-cursors/package.json (1 hunks)
- examples/simultaneous-cursors/vite.config.js (1 hunks)
- examples/vanilla-codemirror6/README.md (1 hunks)
- examples/vanilla-codemirror6/package.json (2 hunks)
- examples/vanilla-codemirror6/tsconfig.json (1 hunks)
- examples/vanilla-codemirror6/vite.config.js (1 hunks)
- examples/vanilla-quill/README.md (3 hunks)
- examples/vanilla-quill/package.json (1 hunks)
- examples/vanilla-quill/src/utils.ts (2 hunks)
- examples/vanilla-quill/tsconfig.json (1 hunks)
- examples/vanilla-quill/vite.config.js (1 hunks)
- examples/vuejs-kanban/README.md (1 hunks)
- examples/vuejs-kanban/package.json (1 hunks)
- examples/vuejs-kanban/vite.config.js (1 hunks)
- package.json (1 hunks)
- packages/create-yorkie-app/README.md (1 hunks)
- packages/create-yorkie-app/package.json (1 hunks)
- packages/devtools/README.md (1 hunks)
- packages/devtools/package.json (1 hunks)
- packages/devtools/tsconfig.json (1 hunks)
- packages/sdk/buf.gen.yaml (1 hunks)
- packages/sdk/package.json (1 hunks)
- pnpm-workspace.yaml (1 hunks)
Files skipped from review due to trivial changes (10)
- .gitignore
- examples/profile-stack/README.md
- examples/react-tldraw/README.md
- examples/simultaneous-cursors/README.md
- examples/vanilla-codemirror6/README.md
- examples/vanilla-quill/README.md
- examples/vuejs-kanban/README.md
- packages/create-yorkie-app/README.md
- packages/create-yorkie-app/package.json
- packages/devtools/README.md
Additional context used
yamllint
pnpm-workspace.yaml
[error] 7-7: no new line character at the end of file
(new-line-at-end-of-file)
Markdownlint
examples/README.md
33-33: null
Bare URL used(MD034, no-bare-urls)
Additional comments not posted (81)
.npmrc (1)
2-2
: Custom registry for@buf
scope added.The addition of
@buf:registry=https://buf.build/gen/npm/v1
allows scoped packages to be fetched from a specific registry, which can improve package management and version control for@buf
packages.examples/nextjs-scheduler/.eslintrc.js (1)
2-2
: Enhanced linting with Prettier integration.The ESLint configuration now extends
'plugin:prettier/recommended'
, which helps maintain consistent code formatting alongside Next.js specific rules. This integration enhances code quality by enforcing uniform style guidelines.packages/sdk/buf.gen.yaml (1)
6-11
: Shift to TypeScript-only outputs.The target output format for both
es
andconnect-es
plugins has been changed tots
, reflecting a focus on TypeScript. This aligns with modern development practices and simplifies the output by removing JavaScript support.examples/profile-stack/package.json (1)
12-15
: Dependency updates are appropriate for the monorepo setup.The upgrade to
vite
and the use ofworkspace:*
foryorkie-js-sdk
align with the goals of the monorepo structure, enhancing development flexibility.examples/vuejs-kanban/package.json (1)
11-15
: Dependency updates are suitable for the monorepo structure.The updates to
@vitejs/plugin-vue
,vite
, and the use ofworkspace:*
foryorkie-js-sdk
are well-aligned with the monorepo strategy, promoting better integration and development efficiency.examples/profile-stack/vite.config.js (1)
2-14
: LGTM!The addition of the alias for
@yorkie-js-sdk/src
usingpath.resolve
is a good practice for managing imports more efficiently. This enhances maintainability and readability.examples/vanilla-codemirror6/vite.config.js (1)
2-15
: LGTM!The alias configuration for
@yorkie-js-sdk/src
is consistent with other examples and effectively simplifies import paths. This is a beneficial change for code maintainability.examples/vanilla-quill/vite.config.js (1)
2-15
: LGTM!The addition of the alias for
@yorkie-js-sdk/src
usingpath.resolve
is consistent with other configurations and enhances the readability and maintainability of import paths.packages/devtools/tsconfig.json (1)
1-13
: Configuration looks good! Verify the base configuration.The
tsconfig.json
file is well-structured and extends a base configuration. Ensure thatplasmo/templates/tsconfig.base
is correctly set up to provide the necessary compiler options for this package.examples/simultaneous-cursors/vite.config.js (1)
1-17
: Aliasing mechanism is well-implemented! Verify alias usage.The addition of the alias for
@yorkie-js-sdk/src
in the Vite configuration is a good practice for simplifying imports. Ensure that this alias is used consistently across the project.Verification successful
Alias Usage Verified
The alias
@yorkie-js-sdk/src
is consistently used across the project in various JavaScript and TypeScript files, confirming that the aliasing mechanism is effectively implemented. No issues found with its usage.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the alias in the project files. # Test: Search for instances where the alias is used in import statements. rg --type js --type ts --type tsx "@yorkie-js-sdk/src"Length of output: 82
Script:
#!/bin/bash # Description: Verify the usage of the alias in the project files. # Find all JavaScript and TypeScript files and search for the alias usage. fd --type f --extension js --extension ts | xargs rg "@yorkie-js-sdk/src"Length of output: 48420
examples/react-tldraw/vite.config.ts (1)
1-17
: Enhancements are well-executed! Verify plugin and alias usage.The introduction of
vite-tsconfig-paths
and the alias for@yorkie-js-sdk/src
improve the configuration. Ensure that the plugin is functioning correctly and that the alias is used consistently.Verification successful
Alias and Plugin Verification Completed Successfully
The alias
@yorkie-js-sdk/src
is actively used throughout the codebase, confirming its consistent application. Additionally, thevite-tsconfig-paths
plugin is correctly listed as a development dependency in theexamples/react-tldraw/package.json
, ensuring its availability for the project. No issues were found regarding the plugin and alias usage.
- The alias
@yorkie-js-sdk/src
is used in multiple TypeScript files.- The
vite-tsconfig-paths
plugin is present inexamples/react-tldraw/package.json
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the plugin and alias in the project files. # Test: Check for the usage of the alias in import statements and confirm the plugin is listed in package.json. rg --type ts --type tsx "@yorkie-js-sdk/src" jq '.devDependencies | has("vite-tsconfig-paths")' package.jsonLength of output: 144
Script:
#!/bin/bash # Correct the file type error and verify the alias usage in TypeScript files. rg --type ts --type tsx "@yorkie-js-sdk/src" # Check again for the presence of vite-tsconfig-paths in package.json. jq '.dependencies | has("vite-tsconfig-paths") or .devDependencies | has("vite-tsconfig-paths")' package.json # Check for any mention of vite-tsconfig-paths in other configuration files. rg "vite-tsconfig-paths" --type js --type jsonLength of output: 515
Script:
#!/bin/bash # Verify the alias usage in TypeScript files, focusing on .ts files. rg --type ts "@yorkie-js-sdk/src" # Confirm the presence of vite-tsconfig-paths in the specific example's package.json. jq '.devDependencies | has("vite-tsconfig-paths")' examples/react-tldraw/package.jsonLength of output: 48091
examples/react-todomvc/vite.config.ts (1)
1-17
: LGTM! Verify alias path correctness.The integration of
vite-tsconfig-paths
and the alias for@yorkie-js-sdk/src
improves module resolution and maintainability.Ensure that the alias path
../../packages/sdk/src
correctly points to the SDK's source directory.Verification successful
Alias path correctly points to the SDK's source directory. The alias path
../../packages/sdk/src
invite.config.ts
is valid and correctly resolves to the intended directory.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the alias path in vite.config.ts correctly points to the SDK's source directory. # Test: Check if the path exists. Expect: The path should exist. if [ -d "examples/react-todomvc/../../packages/sdk/src" ]; then echo "Alias path exists." else echo "Alias path does not exist." fiLength of output: 105
examples/vanilla-codemirror6/tsconfig.json (1)
14-17
: Verify impact of removing strict options.The removal of
noUnusedLocals
,noUnusedParameters
, andnoImplicitReturns
may reduce code quality by allowing unused code and potential logical errors.The addition of the
paths
mapping for@yorkie-js-sdk/src/*
enhances module resolution.examples/vanilla-quill/tsconfig.json (1)
14-17
: Verify impact of removing strict options.The removal of
noUnusedLocals
,noUnusedParameters
, andnoImplicitReturns
may reduce code quality by allowing unused code and potential logical errors.The addition of the
paths
mapping for@yorkie-js-sdk/src/*
enhances module resolution.examples/simultaneous-cursors/package.json (2)
14-14
: Switch to workspace reference foryorkie-js-sdk
.The change to
"yorkie-js-sdk": "workspace:*"
allows the project to use the latest local version of the SDK, facilitating development within a monorepo setup.
17-20
: Update devDependencies to the latest versions.The updates to
@types/react
,@types/react-dom
,@vitejs/plugin-react
, andvite
ensure compatibility with the latest features and improvements, enhancing the development experience.examples/vanilla-quill/package.json (3)
14-14
: Update TypeScript to version 5.3.3.Upgrading TypeScript to
^5.3.3
introduces new features and improvements in type checking and compilation, aligning with modern development practices.
15-15
: Update Vite to version 5.0.12.The upgrade to Vite
^5.0.12
brings enhancements in the build process and development server capabilities, improving overall project performance.
22-22
: Switch to workspace reference foryorkie-js-sdk
.The change to
"yorkie-js-sdk": "workspace:*"
allows the project to utilize the latest local version of the SDK, supporting the monorepo structure.examples/vuejs-kanban/vite.config.js (1)
12-21
: Enhance alias configuration with array-based structure.The transition to an array-based alias configuration allows for multiple entries, improving flexibility and clarity. This setup facilitates better path resolution in the project.
examples/vanilla-codemirror6/package.json (2)
23-23
: Switch to workspace reference foryorkie-js-sdk
.The
yorkie-js-sdk
dependency now uses a workspace reference (workspace:*
). This change aligns with the monorepo structure, allowing for local development and testing.
12-13
: Upgrade TypeScript and Vite versions.The
typescript
andvite
dependencies have been upgraded to versions5.3.3
and5.0.12
, respectively. These updates should provide new features and improvements. Ensure compatibility with your current codebase.examples/react-todomvc/package.json (5)
16-16
: Switch to workspace reference foryorkie-js-sdk
.The
yorkie-js-sdk
dependency now uses a workspace reference (workspace:*
). This change aligns with the monorepo structure, allowing for local development and testing.
22-23
: Upgrade TypeScript and Vite versions.The
typescript
andvite
dependencies have been upgraded to versions5.3.3
and5.0.12
, respectively. These updates should provide new features and improvements. Ensure compatibility with your current codebase.
24-24
: Addvite-tsconfig-paths
.The
vite-tsconfig-paths
plugin has been added to facilitate TypeScript path mapping in Vite projects. This addition should improve path resolution and simplify imports.
21-21
: Upgrade@vitejs/plugin-react
.The
@vitejs/plugin-react
dependency has been upgraded to version4.2.1
. This update may introduce new features or improvements. Ensure compatibility with your current Vite setup.
19-20
: Upgrade React type definitions.The
@types/react
and@types/react-dom
dependencies have been upgraded to version18.2.0
. Ensure that these updates are compatible with your current React code.examples/react-tldraw/tsconfig.json (1)
18-20
: Addpaths
configuration for module resolution.The new
paths
configuration allows for module resolution of@yorkie-js-sdk/src/*
paths to point to../../packages/sdk/src/*
. This change simplifies imports and enhances maintainability.examples/react-todomvc/tsconfig.json (1)
18-19
: LGTM! Verify the usage of the new path alias.The addition of the
paths
property for module resolution is a beneficial change that simplifies imports. Ensure that all imports using this alias are updated and functioning correctly across the codebase.Verification successful
Path Alias Usage Verified
The new path alias
@yorkie-js-sdk/src/
is used extensively throughout the codebase, indicating it is being correctly utilized for module resolution. Ensure that your build and test processes confirm the absence of any import-related issues.
- Path alias
@yorkie-js-sdk/src/
is present in both source and test files.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the new path alias in the codebase. # Test: Search for occurrences of the new path alias. Expect: Correct usage in imports. rg --type js --type ts '@yorkie-js-sdk/src/'Length of output: 47862
examples/nextjs-scheduler/package.json (1)
6-6
: LGTM! Verify compatibility with updated dependencies.The updates to the dependencies and devDependencies align with the monorepo setup and modernize the project. Ensure that the application functions correctly with these updated versions.
Also applies to: 12-16, 20-26
.github/workflows/devtools-publish.yml (1)
8-8
: LGTM! Verify workflow execution.The updates to the workflow configuration are consistent with the new monorepo structure and the adoption of
pnpm
. Ensure that the workflow executes successfully with these changes.Also applies to: 20-20, 24-26, 32-32
Verification successful
Review the versioning process in the deployment workflow
The recent failure in the
devtools-publish.yml
workflow was due to an invalid version number in the manifest file during deployment. This issue is not related to the workflow configuration changes. Ensure that the versioning process is properly managed to prevent such deployment errors. The cancellation appears unrelated to the workflow changes and might be due to external factors.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the successful execution of the updated workflow. # Test: Check the latest workflow runs for any failures. gh run list --workflow devtools-publish.yml --limit 5 --json name,conclusionLength of output: 422
Script:
#!/bin/bash # Fetch details of the failed and cancelled workflow runs to understand the reasons. gh run view --workflow devtools-publish.yml --status failure --limit 1 --log gh run view --workflow devtools-publish.yml --status cancelled --limit 1 --logLength of output: 1635
Script:
#!/bin/bash # List the run IDs for the failed and cancelled runs and fetch their details. # Get the run ID for the most recent failed run failed_run_id=$(gh run list --workflow devtools-publish.yml --limit 5 --json databaseId,conclusion | jq -r '.[] | select(.conclusion == "failure") | .databaseId' | head -n 1) # Get the run ID for the most recent cancelled run cancelled_run_id=$(gh run list --workflow devtools-publish.yml --limit 5 --json databaseId,conclusion | jq -r '.[] | select(.conclusion == "cancelled") | .databaseId' | head -n 1) # Fetch details for the failed run if [ -n "$failed_run_id" ]; then gh run view "$failed_run_id" --log fi # Fetch details for the cancelled run if [ -n "$cancelled_run_id" ]; then gh run view "$cancelled_run_id" --log fiLength of output: 117495
examples/nextjs-scheduler/tsconfig.json (1)
23-25
: Verify the correctness of path mappings.The path mappings have been updated to include
@yorkie-js-sdk/src/*
. Ensure these mappings are correct and resolve to the intended modules within the monorepo structure.Verification successful
Path mappings are correct.
The path mapping
@yorkie-js-sdk/src/*
intsconfig.json
is correctly set up and resolves to the intended modules. This is confirmed by its usage across multiple TypeScript files in the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the path mappings in tsconfig.json. # Test: Check if the mapped paths exist in the file system. Expect: Paths should resolve correctly. fd 'yorkie.ts' packages/sdk/srcLength of output: 58
Script:
#!/bin/bash # Search for TypeScript files using the path alias `@yorkie-js-sdk/src/*` in their imports rg --glob '*.ts' --glob '!node_modules' "from '@yorkie-js-sdk/src/" -A 1Length of output: 57290
examples/react-tldraw/package.json (2)
20-20
: Ensure compatibility with workspace reference.The
yorkie-js-sdk
dependency has been changed to a workspace reference. Ensure that this change is compatible with the monorepo setup and that the package is correctly linked.
28-29
: Check for compatibility with updated TypeScript and Vite versions.The TypeScript and Vite versions have been significantly updated. Ensure that these updates do not introduce breaking changes and are compatible with the existing codebase.
Verification successful
Compatibility Verification for TypeScript and Vite Updates
The updated versions of TypeScript and Vite appear to be compatible with the existing configurations and plugins used in the codebase. Here are the key findings:
- TypeScript Configuration: The
tsconfig.json
files use standard options that should be compatible with TypeScript 5.3.3. No deprecated or removed features were identified.- Vite Configuration: The Vite configuration files and plugins (
vite-plugin-commonjs
,vite-plugin-dts
,vite-tsconfig-paths
) seem to be compatible with Vite 5.0.12. No breaking changes were identified in the configuration or usage patterns.Overall, the configurations and plugins do not indicate any immediate compatibility issues with the updated versions of TypeScript and Vite. However, it's always a good practice to run the actual build and test processes in a fully equipped environment to ensure everything works as expected.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify compatibility with updated TypeScript and Vite versions. # Test: Check for any TypeScript compilation errors. Expect: No errors should be present. pnpm tsc --noEmit # Test: Ensure Vite can build the project without issues. Expect: Build should succeed. pnpm vite buildLength of output: 181
Script:
#!/bin/bash # Search for TypeScript configuration files to check for potential compatibility issues. fd --type f --name "tsconfig.json" --exec cat {} # Search for Vite configuration files to check for potential compatibility issues. fd --type f --name "vite.config.*" --exec cat {} # Search for TypeScript-specific syntax or features that might be incompatible with newer versions. rg --lang typescript --pattern "namespace " -A 3 # Search for Vite-specific configurations or plugins that might be incompatible with newer versions. rg "vite-plugin" -A 3Length of output: 4025
Script:
#!/bin/bash # Corrected search for TypeScript configuration files to check for potential compatibility issues. fd 'tsconfig.json' --exec cat {} # Corrected search for Vite configuration files to check for potential compatibility issues. fd 'vite.config.*' --exec cat {} # Search for TypeScript-specific syntax or features that might be incompatible with newer versions. rg 'namespace ' -A 3 # Search for Vite-specific configurations or plugins that might be incompatible with newer versions. rg 'vite-plugin' -A 3Length of output: 10998
examples/vanilla-quill/src/utils.ts (1)
3-3
: Verify the integration of YorkiePresence.The type definition for
displayLog
now includesYorkiePresence
. Ensure that this change aligns with the intended functionality and that all related code correctly handles the presence data..github/workflows/create-yorkie-app-publish.yml (4)
8-9
: Update paths for monorepo structure.The path updates from
tools/create-yorkie-app/**
topackages/create-yorkie-app/**
reflect the new monorepo structure. Ensure all relevant files and directories are correctly moved and referenced.
24-24
: Switch to pnpm for caching.Switching the cache from
npm
topnpm
aligns with the transition topnpm
for package management. This should improve caching efficiency.
29-31
: Use pnpm for installation and build.The commands
pnpm install
andpnpm build
replace the previousnpm
commands, which is consistent with the monorepo setup usingpnpm
. Ensure all scripts and dependencies are compatible withpnpm
.
34-34
: Update publish command to use pnpm.The publish command now uses
pnpm publish --provenance
, reflecting the switch topnpm
. Verify that theprovenance
option is supported and correctly configured.packages/devtools/package.json (3)
23-23
: Shift yorkie-js-sdk to workspace reference.Changing
yorkie-js-sdk
to"workspace:*"
aligns with the monorepo structure, ensuring local development uses the latest package version. Verify that the workspace setup is correctly configured.
31-31
: Upgrade TypeScript version.Upgrading TypeScript to
5.3.3
introduces new features and improvements. Ensure that all TypeScript code is compatible with this version.
28-29
: Downgrade React type definitions.The downgrade of
@types/react
and@types/react-dom
to18.2.0
might affect compatibility. Ensure that this version is compatible with your React setup and doesn't introduce type issues.package.json (4)
2-4
: Update project metadata for monorepo.The project name, version, and
private
flag updates reflect the transition to a monorepo structure. Ensure that all references to the old project name are updated.
8-20
: Use pnpm for workspace management.The scripts section now uses
pnpm
for workspace management, reflecting the monorepo setup. Ensure that all scripts are correctly defined and functional.
23-24
: Update author and license information.The author and license fields have been updated. Ensure that these changes are reflected in all relevant documentation and legal files.
6-6
: Change main entry point.The main entry point is now
index.js
, indicating a restructuring. Verify that this change aligns with the project's new file organization..github/workflows/npm-publish.yml (4)
14-16
: LGTM: pnpm setup is correctly configured.The setup for pnpm version 8 is appropriately added using the
pnpm/action-setup
action.
21-22
: LGTM: Cache configuration for pnpm is correct.The cache type and dependency path are correctly updated for pnpm.
25-32
: LGTM: pnpm store caching is correctly configured.The caching path and keys are appropriately set for pnpm.
36-39
: LGTM: Commands updated to use pnpm.The installation and build commands are correctly updated to use pnpm.
examples/README.md (3)
17-18
: LGTM: Installation command updated to pnpm.The command is correctly updated to use pnpm in the root directory.
24-28
: LGTM: Running examples command updated to pnpm.The documentation provides clear and flexible instructions for running examples using pnpm.
35-36
: LGTM: Build command for releasing examples updated to pnpm.The instructions are clear and correctly updated to use pnpm for building examples.
.github/workflows/github-page-publish.yml (3)
19-20
: LGTM: Cache configuration for pnpm is correct.The cache type and dependency path are correctly updated for pnpm.
22-29
: LGTM: pnpm store caching is correctly configured.The caching path and keys are appropriately set for pnpm.
33-40
: LGTM: Commands updated to use pnpm.The installation and build commands are correctly updated to use pnpm.
.github/workflows/ci.yml (6)
20-22
: Correctly configured pnpm setup.The pnpm setup step is correctly configured using
pnpm/action-setup@v2
with version 8.
25-27
: Correct Node.js setup with pnpm caching.The Node.js setup step correctly configures caching for pnpm, optimizing the workflow.
29-36
: Correct pnpm cache configuration.The pnpm cache step is correctly configured with the path set to
~/.pnpm-store
and appropriate cache keys.
39-41
: Efficient dependencies installation with cache condition.The dependencies installation step is efficiently conditioned on the cache hit, using
pnpm install
.
43-47
: Correct use of pnpm for build and test steps.The build and test steps correctly use pnpm commands, ensuring consistency with the new package manager.
55-57
: Correct integration of Codecov and benchmark steps.The Codecov and benchmark steps are correctly integrated using pnpm, aligning with the workflow changes.
packages/sdk/package.json (7)
2-5
: Correctly specified package metadata.The package metadata, including name, version, description, and entry point, is correctly specified.
6-13
: Correct publish configuration and files setup.The publishConfig and files array are correctly set up for package distribution.
14-26
: Comprehensive scripts section.The scripts section comprehensively covers build, test, lint, and other necessary tasks using pnpm.
28-30
: Correctly specified engines.The engines section correctly specifies minimum versions for Node.js and npm.
32-44
: Accurate repository and author metadata.The repository, author, license, bugs, and homepage fields are accurately specified.
45-70
: Comprehensive devDependencies.The devDependencies section includes necessary tools for building, testing, and linting.
72-82
: Necessary dependencies and correctly configured husky hooks.The dependencies are necessary for runtime, and husky hooks are correctly configured for pre-commit linting.
examples/react-todomvc/README.md (2)
22-23
: Clear installation instructions with pnpm.The installation instructions are clearly updated to use pnpm in the root directory.
29-33
: Clear demo running instructions with pnpm options.The demo running instructions provide clear options for using pnpm, depending on the directory.
examples/nextjs-scheduler/README.md (2)
22-23
: Update dependency installation instructions.The command for installing dependencies has been updated to use
pnpm
. Ensure that all users are aware of this change and havepnpm
installed.
29-33
: Clarify the demo execution instructions.The instructions now specify that the demo can be run from either the root directory or the example directory. This provides flexibility but ensure users understand the context of each option.
CONTRIBUTING.md (7)
39-42
: Ensure clarity in prerequisites.The prerequisites section now specifies the required versions for Node.js and
pnpm
. This is crucial for avoiding compatibility issues.
47-48
: Update package installation instructions.The command for installing packages has been updated to use
pnpm
. Ensure contributors are aware of this change.
52-53
: Update build instructions.The build command has been updated to use
pnpm
. This aligns with the new monorepo structure.
63-64
: Update proto message generation instructions.The command for generating proto messages has been updated to use
pnpm
. Ensure contributors understand this change.
81-82
: Update testing instructions.The testing command has been updated to use
pnpm
. This is part of the transition to the new package manager.
118-119
: Clarify test execution instructions.The instructions now specify how to run specific test suites using
pnpm
. This is useful for targeted testing.
133-134
: Update development server instructions.The command for starting the development server has been updated to use
pnpm
. Ensure contributors are aware of this change.examples/react-tldraw/src/hooks/useMultiplayerState.ts (1)
237-240
: Improve clarity and safety in option construction.The refactoring ensures that
initialPresence
is only included ifapp.currentUser
is defined. This prevents potential errors and improves code readability.
@chacha912 |
There was a problem hiding this 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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- packages/devtools/src/devtools/contexts/SelectedNode.tsx (2 hunks)
- packages/devtools/src/devtools/contexts/SelectedPresence.tsx (2 hunks)
- packages/devtools/src/devtools/contexts/YorkieSource.tsx (4 hunks)
- packages/sdk/src/util/error.ts (1 hunks)
Additional comments not posted (6)
packages/devtools/src/devtools/contexts/SelectedNode.tsx (1)
20-20
: Enhanced error handling withYorkieError
.The change to use
YorkieError
withCode.ErrContextNotProvided
improves error specificity and debugging clarity. EnsureYorkieError
is consistently used across the codebase for similar contexts.Also applies to: 44-45
packages/devtools/src/devtools/contexts/SelectedPresence.tsx (1)
20-20
: Improved error handling withYorkieError
.The use of
YorkieError
withCode.ErrContextNotProvided
enhances error clarity and consistency. Verify thatYorkieError
is used consistently for similar cases across the codebase.Also applies to: 46-47
packages/sdk/src/util/error.ts (1)
60-61
: Addition ofErrContextNotProvided
toCode
enum.The new error code
ErrContextNotProvided
enhances the error handling capabilities by providing a specific identifier for missing React contexts.packages/devtools/src/devtools/contexts/YorkieSource.tsx (3)
129-130
: Improved Error Handling with YorkieError.The use of
YorkieError
withCode.ErrContextNotProvided
provides clearer context for errors, improving debugging and usage clarity.
140-143
: Consistent Error Handling with YorkieError.Switching to
YorkieError
enhances the semantic clarity of the error, ensuring consistency with other parts of the code.
176-177
: Enhanced Error Context with YorkieError.The use of
YorkieError
provides a more informative error message, aiding in better debugging and usage enforcement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution.
I will commit some necessary changes.
|
$ pnpm sdk build:ghpages
> [email protected] sdk /Users/hackerwins/Development/yorkie-team/yorkie-js-sdk
> pnpm --filter=yorkie-js-sdk "build:ghpages"
> [email protected] build:ghpages /Users/hackerwins/Development/yorkie-team/yorkie-js-sdk/packages/sdk
> mkdir -p ghpages/examples && cp -r docs ghpages/api-reference && find examples -name 'dist' -type d -exec sh -c 'cp -r {} ghpages/examples/$(basename $(dirname {}))' \;
cp: docs: No such file or directory
/Users/hackerwins/Development/yorkie-team/yorkie-js-sdk/packages/sdk:
ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL [email protected] build:ghpages: `mkdir -p ghpages/examples && cp -r docs ghpages/api-reference && find examples -name 'dist' -type d -exec sh -c 'cp -r {} ghpages/examples/$(basename $(dirname {}))' \;`
Exit status 1
ELIFECYCLE Command failed with exit code 1. |
There was a problem hiding this 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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- .github/workflows/create-yorkie-app-publish.yml (2 hunks)
- .gitignore (1 hunks)
- .npmrc (1 hunks)
- packages/sdk/test/helper/helper.ts (1 hunks)
- pnpm-workspace.yaml (1 hunks)
Files skipped from review due to trivial changes (1)
- .gitignore
Files skipped from review as they are similar to previous changes (3)
- .github/workflows/create-yorkie-app-publish.yml
- .npmrc
- pnpm-workspace.yaml
Additional comments not posted (1)
packages/sdk/test/helper/helper.ts (1)
17-17
: Verify compatibility ofassert.throws
withvitest
.The import of
assert
has been changed fromchai
tovitest
. Ensure that theassert.throws
function used inassertThrowsAsync
is compatible withvitest
.
It would be good to test after merging this PR to see if the examples are distributed properly on the homepage and work on it if necessary. |
Workspace: ``` examples/ - nextjs-scheduler - profile-stack - react-tldraw - react-todomvc - simultaneous-cursors - vanilla-codemirror6 - vanilla-quill - vuejs-kanban packages/ - create-yorkie-app - devtools - sdk <-- previous yorkie-js-sdk package ``` Command: ``` `sdk` - [x] pnpm sdk build - [x] pnpm sdk build:proto - [x] pnpm sdk build:docs - [x] pnpm sdk build:ghpages - [x] pnpm sdk dev - [x] pnpm sdk test - [x] pnpm sdk test:watch - [x] pnpm sdk test:bench - [x] pnpm sdk test:ci - [x] pnpm sdk test:yorkie.dev - [x] pnpm sdk lint - [x] pnpm sdk prepare `devtools` - [x] pnpm devtools dev - [x] pnpm devtools build - [x] pnpm devtools test `create-yorkie-app` - [x] pnpm create-yorkie-app start - [x] pnpm create-yorkie-app build - [x] pnpm create-yorkie-app build:copy-assets ``` --------- Co-authored-by: Youngteac Hong <[email protected]>
Workspace: ``` examples/ - nextjs-scheduler - profile-stack - react-tldraw - react-todomvc - simultaneous-cursors - vanilla-codemirror6 - vanilla-quill - vuejs-kanban packages/ - create-yorkie-app - devtools - sdk <-- previous yorkie-js-sdk package ``` Command: ``` `sdk` - [x] pnpm sdk build - [x] pnpm sdk build:proto - [x] pnpm sdk build:docs - [x] pnpm sdk build:ghpages - [x] pnpm sdk dev - [x] pnpm sdk test - [x] pnpm sdk test:watch - [x] pnpm sdk test:bench - [x] pnpm sdk test:ci - [x] pnpm sdk test:yorkie.dev - [x] pnpm sdk lint - [x] pnpm sdk prepare `devtools` - [x] pnpm devtools dev - [x] pnpm devtools build - [x] pnpm devtools test `create-yorkie-app` - [x] pnpm create-yorkie-app start - [x] pnpm create-yorkie-app build - [x] pnpm create-yorkie-app build:copy-assets ``` --------- Co-authored-by: Youngteac Hong <[email protected]>
Workspace: ``` examples/ - nextjs-scheduler - profile-stack - react-tldraw - react-todomvc - simultaneous-cursors - vanilla-codemirror6 - vanilla-quill - vuejs-kanban packages/ - create-yorkie-app - devtools - sdk <-- previous yorkie-js-sdk package ``` Command: ``` `sdk` - [x] pnpm sdk build - [x] pnpm sdk build:proto - [x] pnpm sdk build:docs - [x] pnpm sdk build:ghpages - [x] pnpm sdk dev - [x] pnpm sdk test - [x] pnpm sdk test:watch - [x] pnpm sdk test:bench - [x] pnpm sdk test:ci - [x] pnpm sdk test:yorkie.dev - [x] pnpm sdk lint - [x] pnpm sdk prepare `devtools` - [x] pnpm devtools dev - [x] pnpm devtools build - [x] pnpm devtools test `create-yorkie-app` - [x] pnpm create-yorkie-app start - [x] pnpm create-yorkie-app build - [x] pnpm create-yorkie-app build:copy-assets ``` --------- Co-authored-by: Youngteac Hong <[email protected]>
Workspace: ``` examples/ - nextjs-scheduler - profile-stack - react-tldraw - react-todomvc - simultaneous-cursors - vanilla-codemirror6 - vanilla-quill - vuejs-kanban packages/ - create-yorkie-app - devtools - sdk <-- previous yorkie-js-sdk package ``` Command: ``` `sdk` - [x] pnpm sdk build - [x] pnpm sdk build:proto - [x] pnpm sdk build:docs - [x] pnpm sdk build:ghpages - [x] pnpm sdk dev - [x] pnpm sdk test - [x] pnpm sdk test:watch - [x] pnpm sdk test:bench - [x] pnpm sdk test:ci - [x] pnpm sdk test:yorkie.dev - [x] pnpm sdk lint - [x] pnpm sdk prepare `devtools` - [x] pnpm devtools dev - [x] pnpm devtools build - [x] pnpm devtools test `create-yorkie-app` - [x] pnpm create-yorkie-app start - [x] pnpm create-yorkie-app build - [x] pnpm create-yorkie-app build:copy-assets ``` --------- Co-authored-by: Youngteac Hong <[email protected]>
Workspace: ``` examples/ - nextjs-scheduler - profile-stack - react-tldraw - react-todomvc - simultaneous-cursors - vanilla-codemirror6 - vanilla-quill - vuejs-kanban packages/ - create-yorkie-app - devtools - sdk <-- previous yorkie-js-sdk package ``` Command: ``` `sdk` - [x] pnpm sdk build - [x] pnpm sdk build:proto - [x] pnpm sdk build:docs - [x] pnpm sdk build:ghpages - [x] pnpm sdk dev - [x] pnpm sdk test - [x] pnpm sdk test:watch - [x] pnpm sdk test:bench - [x] pnpm sdk test:ci - [x] pnpm sdk test:yorkie.dev - [x] pnpm sdk lint - [x] pnpm sdk prepare `devtools` - [x] pnpm devtools dev - [x] pnpm devtools build - [x] pnpm devtools test `create-yorkie-app` - [x] pnpm create-yorkie-app start - [x] pnpm create-yorkie-app build - [x] pnpm create-yorkie-app build:copy-assets ``` --------- Co-authored-by: Youngteac Hong <[email protected]>
Workspace: ``` examples/ - nextjs-scheduler - profile-stack - react-tldraw - react-todomvc - simultaneous-cursors - vanilla-codemirror6 - vanilla-quill - vuejs-kanban packages/ - create-yorkie-app - devtools - sdk <-- previous yorkie-js-sdk package ``` Command: ``` `sdk` - [x] pnpm sdk build - [x] pnpm sdk build:proto - [x] pnpm sdk build:docs - [x] pnpm sdk build:ghpages - [x] pnpm sdk dev - [x] pnpm sdk test - [x] pnpm sdk test:watch - [x] pnpm sdk test:bench - [x] pnpm sdk test:ci - [x] pnpm sdk test:yorkie.dev - [x] pnpm sdk lint - [x] pnpm sdk prepare `devtools` - [x] pnpm devtools dev - [x] pnpm devtools build - [x] pnpm devtools test `create-yorkie-app` - [x] pnpm create-yorkie-app start - [x] pnpm create-yorkie-app build - [x] pnpm create-yorkie-app build:copy-assets ``` --------- Co-authored-by: Youngteac Hong <[email protected]>
What this PR does / why we need it?
pnpm
.Any background context you want to provide?
Referred to the work from from #746 by @easylogic
The workspace is divided into two types:
examples
andpackages
.SDK
examples
for instance,react-tldraw
packages
examples
Specs
update typescript version -> 5.3.3
update vite version -> 5.0.12
update @types/react -> 18.2.0
update @types/react-dom -> 18.2.0
What are the relevant tickets?
Fixes #648
Checklist
Summary by CodeRabbit
New Features
package.json
file for theyorkie-js-sdk
project.Bug Fixes
displayLog
function to incorporateYorkiePresence
.Documentation
Chores
.gitignore
file to prevent tracking of unnecessary files.