jpuri / react-draft-wysiwyg

A Wysiwyg editor build on top of ReactJS and DraftJS. https://jpuri.github.io/react-draft-wysiwyg
MIT License
6.41k stars 1.16k forks source link

Mixed upper / lower case everywhere in sources #241

Open cveilleux opened 7 years ago

cveilleux commented 7 years ago

The project does not run on a case-sensitive OS (linux) because the source files are mixed case.

Here is the errors output after a npm start on master branch:

ERROR in ./js/src/components/Editor/index.js
Module not found: Error: Can't resolve '../../utils/BlockStyle' in '/home/cveilleux/git/react-draft-wysiwyg/js/src/components/Editor'
 @ ./js/src/components/Editor/index.js 39:18-51
 @ ./js/src/components/index.js
 @ ./js/src/index.js
 @ ./js/playground/index.js
 @ multi webpack-hot-middleware/client ./js/playground/index
ERROR in ./js/src/components/Editor/index.js
Module not found: Error: Can't resolve '../../decorators/Link' in '/home/cveilleux/git/react-draft-wysiwyg/js/src/components/Editor'
 @ ./js/src/components/Editor/index.js 51:12-44
 @ ./js/src/components/index.js
 @ ./js/src/index.js
 @ ./js/playground/index.js
 @ multi webpack-hot-middleware/client ./js/playground/index
ERROR in ./js/src/components/Editor/index.js
Module not found: Error: Can't resolve '../../decorators/Hashtag' in '/home/cveilleux/git/react-draft-wysiwyg/js/src/components/Editor'
 @ ./js/src/components/Editor/index.js 59:15-50
 @ ./js/src/components/index.js
 @ ./js/src/index.js
 @ ./js/playground/index.js
 @ multi webpack-hot-middleware/client ./js/playground/index
ERROR in ./js/src/renderer/index.js
Module not found: Error: Can't resolve './Image' in '/home/cveilleux/git/react-draft-wysiwyg/js/src/renderer'
 @ ./js/src/renderer/index.js 11:13-31
 @ ./js/src/components/Editor/index.js
 @ ./js/src/components/index.js
 @ ./js/src/index.js
 @ ./js/playground/index.js
 @ multi webpack-hot-middleware/client ./js/playground/index

Here is the content of the js/src/ directory under linux:

components config Decorators decorators event-handler i18n index.js Renderer renderer Utils utils

You can see the duplicate decorators, renderer and utils directories with different case.

I will try to sort it out and open a PR.

roychoo commented 7 years ago

Yeah I got this too when trying to submit a travis job with linux os due to the case sensitive. Wanted to look at it this coming weekend. But i do not mind that you are taking over so... :+1

lavoiedn commented 7 years ago

I wrote a pull request that should fix any case issue.

I added an eslint rule that will raise a lint error on unresolved dependencies (case-sensitive).

I also had to do some changes to the webpack dev config to be able to do npm start, see #243

lavoiedn commented 7 years ago

I tried opening the source code on a Windows machine and I was very confused by the difference in filesystem!

I tried a slightly more "aggressive" fix where I removed duplicate folders.

I'd rather get feedback on it first in case there was a reason for the different case. Here it is: https://github.com/DesjardinsLab/react-draft-wysiwyg/commit/1179265c84f6d8fed3479ce79e07b88350fef2db

jpuri commented 7 years ago

Hi @lavoiedn: The differing cases are not intentional - they are wrong and need to be re-factored. I have use Uppercase for all Components and lowercase to everything else.