Adaptive-Web-Components icon indicating copy to clipboard operation
Adaptive-Web-Components copied to clipboard

fix: CLI module imports on windows

Open KingOfTac opened this issue 1 year ago • 4 comments

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

KingOfTac avatar Jun 25 '24 18:06 KingOfTac

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?

bheston avatar Jun 26 '24 14:06 bheston

Which node version are you running?

I'm on 21

KingOfTac avatar Jun 26 '24 23:06 KingOfTac

@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.

KingOfTac avatar Jun 30 '24 01:06 KingOfTac

Tested on Mac, seems to be working.

nicholasrice avatar Jul 02 '24 17:07 nicholasrice