Skip to content

fix: resolve framework-specific files when building on Windows - #252

Open
DamianGlowala wants to merge 2 commits into
open-circle:mainfrom
DamianGlowala:fix/windows-build
Open

DamianGlowala wants to merge 2 commits into
open-circle:mainfrom
DamianGlowala:fix/windows-build

Conversation

@DamianGlowala

@DamianGlowala DamianGlowala commented Oct 31, 2026 •

Copy link
Copy Markdown

Normalises paths for Windows, so that @formisch/core or @formisch/methods can be built on Windows.

Summary by CodeRabbit

  • Bug Fixes
    • Improved resolution of framework-specific imports when file paths use either forward or backward slashes, helping builds work more reliably across platforms.

Copilot AI balanced review requested due to automatic review settings October 31, 2026 11:09
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Both build configurations now use dirname and join to construct framework-specific paths. Their resolvers also match .ts paths with either / or \ separators.

Suggested reviewers: fabian-hiller

Merge Risk: Minimal · up to babd4

The change makes framework-specific path resolution work with Windows-style separators in the core and methods builds. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix: resolve framework-specific files when building on Windows" matches the main change. The summaries show both tsdown.config.ts files changed to build framework-specific paths with dirnam…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix: resolve framework-specific files when building on Windows" matches the main change. The summaries show both tsdown.config.ts files changed to build framework-specific paths with dirname and join, and to match both / and \ separators in the resolveId pattern. This is the Windows path fix the PR objectives describe. The title is specific and does not list files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

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.

packages/core/tsdown.config.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

packages/methods/tsdown.config.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

Warning

⚠️ This pull request shows signs of AI-generated slop (redundant_comments). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e1e93bc and babd472.

Files selected for processing: 2

  • packages/core/tsdown.config.ts
  • packages/methods/tsdown.config.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the cross-platform file-resolution changes.

No open issues 🎉

1 file not reviewed
  • pnpm-lock.yaml: Generated file
What changed in this PR

This PR updates framework-specific file resolution so Formisch’s core and methods packages can be built on Windows.

Changes:

  • Uses pathe to construct paths without assuming Unix-style separators or root paths.
  • Normalizes resolved module paths before selecting framework-specific files.
  • Adds pathe as a development dependency in both packages and updates the lockfile.
File Description
pnpm-lock.yaml Records the new pathe dependencies.
packages/​methods/​tsdown.config.ts Makes framework-specific path construction and resolution cross-platform.
packages/​methods/​package.json Adds the pathe development dependency.
packages/​core/​tsdown.config.ts Makes framework-specific path construction and resolution cross-platform.
packages/​core/​package.json Adds the pathe development dependency.

Review effort: Balanced

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Re-trigger cubic

@coderabbitai coderabbitai Bot added the invalid This doesn't seem right label Oct 31, 2026
@fabian-hiller

Copy link
Copy Markdown
Member

Thanks for fixing this! I'd prefer to avoid the extra dependency here. dirname/join from node:path already accept both separators on Windows, so the transform change works as-is with node:path. For resolveId, we can make the regex separator-agnostic instead of normalizing:

const frameworkFilePath = resolved.id.replace(
  /([/\\][\w-]+)\.ts$/,
  `$1.${framework}.ts`
);

That also keeps rolldown's native ID format. Could you drop pathe and switch to that?

@fabian-hiller fabian-hiller self-assigned this Oct 31, 2026
@DamianGlowala

Copy link
Copy Markdown
Author

@fabian-hiller should be fine now! :)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants