Adaptive-Web-Components
Adaptive-Web-Components copied to clipboard
fix: CLI module imports on windows
Pull Request
Description
This PR fixes an issue in the CLI when running in a Windows environment. The node implementation of import only works with file:// and data:// urls and not Windows file paths so this PR uses pathToFileURL to wrap the inputFilePath and convert it into a file url if it isn't already.
Issues
Reviewer Notes
@bheston @nicholasrice I won't be able to test on a Macbook for several hours so if either of you review this before then and would like to test this branch on a Unix environment, feel free.
Test Plan
Checklist
General
- [ ] I have included a change request file using $ npm run change
- [ ] I have added tests for my changes.
- [x] I have tested my changes.
- [ ] I have updated the project documentation to reflect my changes.
- [ ] I have read the CONTRIBUTING documentation for this project.
Component-specific
- [ ] I have added a new component
- [ ] I have modified an existing component
⏭ Next Steps
Which node version are you running? I'm on 18.17.1 on Windows and it's been working when I run npx from within VSCode. Maybe they changed it in v20?
Which node version are you running?
I'm on 21
@bheston I have now tested on latest node version in both windows and Unix environments and the change added in this PR works across all the tested environments.
Tested on Mac, seems to be working.