Skip to content

Conversation

@AndyMJones
Copy link
Contributor

@AndyMJones AndyMJones commented Jan 13, 2026

When trying to build the project on a windows machine there are a few errors relating to file paths and commands used within tsup.config.ts and patch-ts.js. I have updated the files to support both linux / mac and windows development but I have not created a new ci job to run on windows (happy to add that if you would like it).

tsup failure:
image

patch failure:
image

tsup.config.ts is an easy fix as there are simple params that can be added to glob.sync that solve the path issues.

patch-ts.js is slightly more involved, you cannot run /bin/bash and grep on windows. I have written a simple version using glob to find the file paths, then fs to read the file to search for references of "~/core" etc. This works for both windows and Linux but is significantly slower than using grep so I have kept the grep implementation for non windows builds. Happy to consolidate this if you care more about simplicity over performance (I think the functions are a little bit ugly but hopefully clear).

@AndyMJones AndyMJones changed the title fix: add support for window builds fix: add support for windows builds Jan 13, 2026
@kettanaito
Copy link
Member

Hi, @AndyMJones. Thanks for looking into this, much appreciated.

We can merge glob arguments additions straight away but otherwise this looks too big of a change to fix the issue. Perhaps there's a dependency we can use that gives us grep powers and has Windows/Linux support baked in. Or, even better, we find a way to validate file contents without relying on grep.

@AndyMJones
Copy link
Contributor Author

AndyMJones commented Jan 15, 2026

Hi @kettanaito, no problem. I've been using MSW for years and felt I should give back a little.

glob already does the heavy lifting any other library would do. I had a look into using shelljs or fast-glob but there wasn't really any major gain from what I could see.

If you are happy for grep to not be used, the flow for windows actually already worked for both linux and windows. I have refined this PR down to one solution instead of one for windows and one for linux. Let me know if you still think its too big.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants