Repository navigation
fix: url resolution in windows - #3337
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (20)
✅ Files skipped from review due to trivial changes (13)
WalkthroughStandardizes dynamic imports across the CLI by converting filesystem path arguments to file:// URLs using Node's pathToFileURL(...).href and updates Node built-in imports to ChangesDynamic Import Path-to-URL Conversion
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
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. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/utils/generate.ts`:
- Around line 182-186: The dynamic import assignment blocks (assigning
userStoreConfig using pathToFileURL and path.resolve) need Biome-style
formatting: update the affected expressions (the userStoreConfig assignments in
generate.ts where pathToFileURL, path.resolve, and existsSync are used, and any
similar blocks at the other referenced locations) to follow project style—use
single quotes, remove semicolons, enforce 2-space indentation, and ensure ES5
trailing commas—then run Biome to reformat and commit the changes so CI
formatting checks pass.
In `@packages/cli/src/utils/plugins.ts`:
- Around line 172-173: Reformat the dynamic import expressions that load plugin
configs (e.g., the const { default: pluginConfig } = await
import(pathToFileURL(pluginConfigPath).href) occurrence and the other dynamic
imports later in the file) to conform to Biome style: use 2-space indentation,
single quotes for string literals, no semicolons, and include ES5-style trailing
commas where applicable; adjust whitespace/line breaks so the await import(...)
calls and their surrounding destructuring follow the project code-style rules
used elsewhere in packages/cli/src/utils/plugins.ts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5f17aec4-16b8-403a-a5a3-959e7f5fd885
📒 Files selected for processing (8)
packages/cli/src/commands/cache-graphql.tspackages/cli/src/commands/cms-sync.tspackages/cli/src/commands/generate-i18n.tspackages/cli/src/utils/commands.tspackages/cli/src/utils/config.tspackages/cli/src/utils/generate.tspackages/cli/src/utils/hcms.tspackages/cli/src/utils/plugins.ts
@faststore/api
@faststore/cli
@faststore/components
@faststore/core
@faststore/diagnostics
@faststore/lighthouse
@faststore/sdk
@faststore/ui
commit: |
Unit tests alone did not cover the CLI paths where the Windows bugs shipped to partners (#3337, #3419, #3440) actually fail. Pack the workspace and build starter.store on windows-latest, which is where the CLI is really invoked. Yarn 1 resolutions get a relative POSIX tarball path: an absolute Windows path is parsed as a protocol because of the drive letter. The pack loop checks LASTEXITCODE by hand, since GitHub only propagates the exit code of the last command in a block. Co-authored-by: Cursor <[email protected]>
Every path-handling bug we shipped to partners (vtex#3337, vtex#3419, vtex#3440) was found on Windows, in production, because nothing in the pipeline has ever run there. This job is informational while we measure how the suite behaves on a real runner, so it cannot block merges yet. Co-authored-by: Cursor <[email protected]>

Added a fix to @faststore/cli where imports was throwing in windows OS beacuse a unhandled C:/ esm path load
Summary by CodeRabbit