Conversation
🦋 Changeset detectedLatest commit: eb630d5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull Request Overview
This PR removes the CWD constant and other unused imports from the codebase, replacing them with direct process.cwd() calls, and updates various dependency versions.
- Removes the
CWDconstant from@pkgr/coreand replaces its usage withprocess.cwd()throughout the codebase - Simplifies the
cjsRequireimplementation and removes unusedEVAL_FILENAMESconstant - Updates multiple dependencies to their latest versions across package.json files
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/utils/src/helpers.ts | Removes CWD import and uses process.cwd() directly in tryGlob function |
| packages/rollup/src/config.ts | Removes CWD import and replaces usage with process.cwd() calls |
| packages/rollup/package.json | Updates rollup dependencies to newer versions |
| packages/core/src/helpers.ts | Removes CWD import and uses process.cwd() in function defaults |
| packages/core/src/constants.ts | Removes CWD constant definition and simplifies cjsRequire implementation |
| packages/browser/package.json | Updates open dependency version |
| package.json | Updates multiple dev dependencies to latest versions |
| .github/workflows/autofix.yml | Updates autofix-ci action to a newer version with specific commit hash |
|
Caution Review failedThe pull request is closed. WalkthroughThis update removes the Changes
Sequence Diagram(s)sequenceDiagram
participant Module
participant NodeProcess
Module->>NodeProcess: Call process.cwd()
NodeProcess-->>Module: Return current working directory
Note right of Module: Uses process.cwd() instead of CWD constant
Possibly related PRs
Poem
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
packages/core/src/constants.tsOops! Something went wrong! :( ESLint: 9.31.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@1stg/eslint-config' imported from /eslint.config.js packages/core/src/helpers.tsOops! Something went wrong! :( ESLint: 9.31.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@1stg/eslint-config' imported from /eslint.config.js packages/rollup/src/config.tsOops! Something went wrong! :( ESLint: 9.31.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@1stg/eslint-config' imported from /eslint.config.js
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #423 +/- ##
=========================================
+ Coverage 9.67% 9.74% +0.06%
=========================================
Files 12 12
Lines 434 431 -3
Branches 191 187 -4
=========================================
Hits 42 42
+ Misses 392 389 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
@pkgr/browser
@pkgr/core
@pkgr/es-modules
@pkgr/imagemin
@pkgr/rollup
@pkgr/umd-globals
@pkgr/utils
commit: |
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to 12109ab in 46 seconds. Click for details.
- Reviewed
235lines of code in8files - Skipped
1files when reviewing. - Skipped posting
6draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/autofix.yml:34
- Draft comment:
Updated autofix-ci/action commit to v1.3.2 looks correct. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. package.json:78
- Draft comment:
The 'resolutions' field for prettier is still set to '^3.5.3' while devDependencies uses '^3.6.2'. Consider updating for consistency. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
3. packages/core/src/constants.ts:9
- Draft comment:
Removal of the CWD constant is correctly done. Dynamic calls to process.cwd() should now reflect any directory changes. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
4. packages/core/src/helpers.ts:35
- Draft comment:
Default parameter updated to process.cwd() ensures dynamic resolution instead of using a stale CWD constant. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
5. packages/rollup/src/config.ts:223
- Draft comment:
Replaced use of CWD with process.cwd() in the monorepo resolution; this change is consistent with the removal of CWD. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
6. packages/utils/src/helpers.ts:39
- Draft comment:
Default 'baseDir' is now set to process.cwd() instead of the removed CWD constant, ensuring it reflects any change in working directory. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
Workflow ID: wflow_Ky30wD5ywnaHz0v5
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
|
Deploy preview for pkgr ready! ✅ Preview Built with commit eb630d5. |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (8)
.github/workflows/autofix.yml(1 hunks)package.json(1 hunks)packages/browser/package.json(1 hunks)packages/core/src/constants.ts(1 hunks)packages/core/src/helpers.ts(3 hunks)packages/rollup/package.json(1 hunks)packages/rollup/src/config.ts(2 hunks)packages/utils/src/helpers.ts(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
packages/rollup/package.json (1)
Learnt from: JounQin
PR: un-ts/pkgr#408
File: .changeset/poor-walls-arrive.md:2-3
Timestamp: 2025-06-01T05:58:16.903Z
Learning: The @pkgr/core package is still in 0.x versions (pre-1.0). For 0.x versions, breaking changes should use minor version bumps, not major ones, following semantic versioning rules for pre-release versions.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Lint and Test with Node.js 22 on windows-latest
- GitHub Check: Lint and Test with Node.js 20 on windows-latest
- GitHub Check: Lint and Test with Node.js 18 on windows-latest
🔇 Additional comments (11)
packages/browser/package.json (1)
34-34: LGTM! Standard dependency update.The minor version bump for the "open" package follows semantic versioning and should be backward compatible.
packages/rollup/package.json (1)
38-38: LGTM! Standard dependency updates.These minor and patch version bumps follow semantic versioning and should maintain backward compatibility.
Also applies to: 43-43, 45-45, 48-48
package.json (1)
34-75: LGTM! Comprehensive devDependency updates.These development dependency updates follow semantic versioning and are part of regular maintenance. Since they're devDependencies, they don't impact production runtime.
packages/rollup/src/config.ts (2)
224-224: LGTM! Good refactoring to use direct Node.js API.Replacing the CWD constant with
process.cwd()makes the code more direct and reduces import dependencies while maintaining the same functionality.
236-236: LGTM! Consistent with the CWD constant cleanup.This change aligns with the PR objective to remove the CWD constant and use the native Node.js API directly.
packages/utils/src/helpers.ts (2)
3-3: LGTM! CWD import removal aligns with cleanup objective.Removing the CWD import is consistent with the PR's goal to eliminate the CWD constant across the codebase.
39-39: LGTM! Clean replacement of CWD constant.Using
process.cwd()directly as the default value maintains the same functionality while eliminating the need for the imported CWD constant.packages/core/src/helpers.ts (3)
4-4: LGTM: Clean removal of CWD import.The import statement correctly removes the CWD constant reference, aligning with the constants cleanup objective.
35-35: LGTM: Correct replacement of CWD with process.cwd().The default parameter change maintains the same functionality while removing dependency on the CWD constant.
97-102: LGTM: Improved destructuring with correct CWD replacement.The destructuring format is cleaner and more readable, while correctly replacing CWD with process.cwd() to maintain the same default behavior.
packages/core/src/constants.ts (1)
9-10: LGTM: Improved cjsRequire logic with clearer environment detection.The refactored logic is more explicit and direct - checking for the existence of
requireas a function is clearer than the previousimport.meta.urltruthiness check. This maintains the same functionality while being more readable.
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed eb630d5 in 1 minute and 26 seconds. Click for details.
- Reviewed
247lines of code in9files - Skipped
0files when reviewing. - Skipped posting
8draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .changeset/deep-candles-start.md:1
- Draft comment:
Changeset entry correctly documents patch releases for @pkgr/core and @pkgr/rollup. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. .github/workflows/autofix.yml:33
- Draft comment:
Updated autofix.ci action to a specific commit (v1.3.2); change appears correct. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
3. package.json:77
- Draft comment:
The 'prettier' devDependency is updated to '^3.6.2' while resolutions still pin it to '^3.5.3'; verify if this mismatch is intentional. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% Version mismatches in package.json can cause issues, but this is a dependency-related comment. The rules explicitly state not to comment on dependency changes or versions. Even though there is a real discrepancy, we should trust that the author knows what they're doing with dependency management. The version mismatch could potentially cause build or dependency resolution issues. The resolutions field exists for a reason and this might be unintentional. While true, the rules are very clear about not commenting on dependency versions or dependency-related issues. We must assume the author has a reason for this configuration. Delete the comment as it violates the rule about not commenting on dependency changes or version-related issues.
4. packages/browser/package.json:33
- Draft comment:
Dependency 'open' was updated to '^10.2.0'; the change is appropriate. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
5. packages/core/src/constants.ts:8
- Draft comment:
Removed the 'CWD' and 'EVAL_FILENAMES' constants in favor of dynamic process.cwd() usage; this cleanup avoids stale working directory issues. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
6. packages/core/src/helpers.ts:35
- Draft comment:
Replaced the default 'base' parameter from using CWD to process.cwd(), ensuring dynamic resolution of the current working directory. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
7. packages/rollup/src/config.ts:221
- Draft comment:
Replaced usage of the CWD constant with process.cwd() for monorepo resolution; change is consistent with other modules. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
8. packages/utils/src/helpers.ts:38
- Draft comment:
Updated the default 'baseDir' in tryGlob to use process.cwd(), ensuring consistency in dynamic working directory resolution. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
Workflow ID: wflow_RqDmEHAWdgAxkRl1
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
close #420
close #421
related rollup/rollup#6021 and un-ts/synckit#252
Summary by CodeRabbit
process.cwd()across various modules for determining the current working directory.Important
Refactor to replace
CWDconstant withprocess.cwd()and update dependencies and GitHub Actions workflow.CWDconstant fromconstants.tsand replace withprocess.cwd()inhelpers.ts,config.ts, andhelpers.tsinutils.autofix.ymlto use autofix-ci/action@v1.3.2.package.json,browser/package.json, androllup/package.json.This description was created by
for eb630d5. You can customize this summary. It will automatically update as commits are pushed.