Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Enable exception catching; Separate build targets for
node
andworker
environments. #11Enable exception catching; Separate build targets for
node
andworker
environments. #11Changes from 5 commits
333dd2c
3b18e26
9cdcb3b
4bd6677
9000016
990fd0c
34ca552
27337c8
b6b4dba
d6d7327
3d2b3df
33565a8
7607a9e
48a9910
c0f4d68
3f9775b
d3caf42
ad8f9c4
6df29f3
3d7a40f
340cca5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
💡 Codebase verification
emsdk Dependency Remains in Use
The "emsdk" dependency is still referenced in both CMakeLists.txt and Taskfile.yml. Commenting out the dependency in Taskfile.yml does not fully remove its usage and may impact the build process. Please ensure that all references to "emsdk" are appropriately handled.
🔗 Analysis chain
Please clarify the reason for commenting out the emsdk dependency.
The emsdk dependency has been commented out, which could potentially affect the build process. This change wasn't mentioned in the PR objectives or summary. Could you please explain the rationale behind this modification?
To ensure this change doesn't introduce issues, please run the following script:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 1314
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.
Right, that was a typo. Reverted.
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.
@junhaoliao, thanks for correcting the typo!
(^_^)/
If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
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.
Correct the "files" field path
The change from
"./dist"
to"/dist"
in the "files" field is problematic. The leading slash in "/dist" typically refers to the root of the file system, which is likely not the intended behaviour.Please change this back to
"./dist"
or simply"dist"
to correctly reference the distribution directory relative to the package root. For example:This ensures that the correct directory is included when the package is published.
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.
I believe the
/
refers to the project root. Correct me if I'm wrong.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.
@junhaoliao, in the
package.json
files
field, the leading slash/
refers to the root of the filesystem, not the project root. This means that specifying"/dist"
may not include the intended directory when publishing your package. Paths in thefiles
field should be relative to the package root, so it's recommended to use"./dist"
or simply"dist"
to correctly reference thedist
directory.(_/)
(•_•)
( > 🧐
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.
The slash was needed to mitigate an issue when I was simulated the package publish / installation locally with Yalc on a Mac computer (previously I don't recall observing the issue on a Linux computer). With the "./", the "dist" folder does not seem to be correctly included in the installations.
Still, it seems with no "./" or "/" added the installation and the config works fine locally with Yalc. Will stick with simply "dist" then.
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.
@junhaoliao, glad to hear that using
"dist"
works correctly with Yalc on Mac as well. Let me know if you have any other questions.(_/)
(•ᴗ•)
( ♥
✏️ Learnings added
If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
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.
💡 Codebase verification
🛠️ Refactor suggestion
Exported files are missing in the dist directory
The verification script indicates that the following exported files do not exist:
dist/ClpFfiJs-worker.js
dist/ClpFfiJs-worker.d.ts
dist/ClpFfiJs-node.js
dist/ClpFfiJs-node.d.ts
This suggests that the "exports" field in
package.json
references files that are missing, which may lead to runtime errors or broken imports.Actions Needed:
dist
directory.package.json
to reference existing files or adjust the build to produce the required files.🔗 Analysis chain
Review the changes to export configurations
The modifications to the "exports" field indicate a shift towards supporting multiple environments (Node.js and Web Workers). However, there are some considerations:
The main export (
.
) now points to the worker version by default. This might not be suitable for all use cases and could potentially break existing implementations.The addition of specific exports for node and worker environments provides more flexibility, which is good.
Consider the following suggestions:
Ensure that the
ClpFfiJs.js
file can detect the environment and use the appropriate version (node or worker).Update the documentation to clearly explain the different export options and when to use each one.
Please run the following script to verify the existence of all referenced files:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 553
Script:
Length of output: 1237
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.
The files are generated rather than directly checked in, so it's expected you don't see the files under /dist without any compilations.
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.
@junhaoliao, thank you for the clarification. I understand that the files under
/dist
are generated during the build process and are not checked into source control. I'll make a note of this for future reviews.(_/)
(•_•)
(🧠) Curious rabbit learns
✏️ Learnings added