react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

working branch for supporting windows contributors

Open davidcoleman007 opened this issue 1 year ago • 0 comments

As a windows developer, I am unable to install RSP and contribute.

Steps to reproduce:

  1. use windows
  2. clone this repo
  3. yarn it
  4. observe the failure seen below.

I have found a number of issues, mostly around the build-icons step. image

after much trial and error (mostly error), i have found that the culprit is that we are specifying --extensions '.cjs,.js' when we build each of the icon bundles. for some reason, babel-node does not see this as a valid extension, and will actually simply ignore *.js anyway. Furthermore, this invalid extension value causes all other cli arguments to be ignored, and thus presets @babel/env is also ignored. this is where we get the cjs import transform from. Causing the above errors.

after that i had an error starting story book, due to improper path separators. The launch failed in git bash. This is because in git bash we need forward slashes, not back slashes. path is not aware of this nuance and incorrectly gives us backslashes on every shell that detects as win32. I have used the package is-mingw to solve this in our preview.js.

summarization of steps taken:

  • remove babel-node --extensions '.cjs,.js' - babel automatically will use .cjs, and for some reason this was causing babel to ignore all other cmd line args, including --presets @babel/env, which is where we get the cjs import transform on mac/linux
  • fix storybook preview paths for MinGW (git bash)

Closes (https://github.com/adobe/react-spectrum/issues/6314)

✅ Pull Request Checklist:

  • [x] Included link to corresponding React Spectrum GitHub Issue.
  • [x] Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • [x] Filled out test instructions.
    • will add details above
  • [x] Updated documentation (if it already exists for this component).
  • [x] Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

  1. use windows
  2. clone this repo and use my branch
  3. yarn it
  4. observe that it works
  5. yarn start
  6. observe that storybook starts and loads

🧢 Your Project:

davidcoleman007 avatar May 02 '24 00:05 davidcoleman007