-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows support #1
Comments
I've been digging some more into this and come to the following conclusion:
Is it possible to get the process.platform to get set using some kind of preprocessing on the process lib used? Any help is greatly appreciated! If I get a few pointers I'll happily make PRs where appropriate to make everything work for both platforms (nix/windows). |
See the reference for a workaround. |
Windows support would be an enormous help for users trying to maintain cross-platform code. This is literally issue #1 - it would be so good to see support for this. |
Paths like `C:\Users\username\Documents\Github\studio-prototype\packages\studio\tests\__mocks__/test.tsx` are not considered absolute by `path.isAbsolute` in the frontend. This is because we are using `path-browserify` (a browser version of nodejs's `path`) which does not have proper windows support. In real nodejs, `path.isAbsolute` will return true for a windows path like the above. browserify/path-browserify#1 We could look for an alternative but I'm not sure if that will be necessary. I think I'll have a better picture of that when I'm further in with getting the unit tests compatibility. For the createPage action, the path.isAbsolute check is unnecessary since we do a `filepath.startsWith(pagesPath)` check as well, and `pagesPath` is always absolute. We may want to support a relative pagesPath at which point we may need to add additional validation, but it would probably make more sense for that validation to go into the backend. J=SLAP-2791 TEST=auto tests for createPage.ts and AddPageButton are now passing
Oh whoops, just posted this: #31 The module is unusable for Windows users until this is resolved. |
The separator is hard-coded as '/' but in reality, node also supports windows which has '' as default separator (see http://nodejs.org/api/path.html#path_path_sep ). This should be automatically detected and all fns that split things up depending upon the separator should should the os-proper separator.
The text was updated successfully, but these errors were encountered: