chrishasz / spgo

SPGo: A Lightweight, Open Source, SharePoint IDE for Visual Studio Code
https://www.chrishasz.com/spgo
MIT License
60 stars 11 forks source link

Unable to get SPGo to work because of file system case sensitiveness #55

Closed kLeZ closed 6 years ago

kLeZ commented 6 years ago

Hi. I tried to use SPGo but it didn't work at all. Even the "Configure workspace" didn't. After many minutes of investigation in Visual Studio Code debugging console I found that the file names on the distribution folder (~/.vscode/extensions/sitego.spgo-1.3.1/out/src) don't quite correspond in casing to the requires("...")s around the code.

The issue here is an annoying case sensitiveness one, expressed only on non-NTFS filesystems (even the HFS+ filesystem on Mac OS X should have this issue) as with my case with an BTRFS file system on linux.

I think this can be a simple task to accomplish in order to let this extension be truly cross platform.

Thanks for understanding.

sg-chrishasz commented 6 years ago

Hello @kLeZ Thanks for reaching out! Do you know which files are having casing issues? I ask because I test all builds against Ubuntu 16x (using ext fs) to ensure functionality on linux and 1.3.1 does not show any casing issues with files. See issue here.

Cross-platform compatibility is important for SPGo, so if we can identify a solution, I will implement a solution in a new branch and send instructions for how you can build from source and validate. Once we have a working solution, I'll publish to the VSCode Marketplace.

kLeZ commented 6 years ago

I have applied a rough "patch" to all the files in the path ~/.vscode/extensions/sitego.spgo-1.3.1/out/src, following these two commands: find . -type f -iname '*.js' -exec sed -i 's/\/service\/authenticationservice/\/service\/authenticationService/g' {} \; find . -type f -iname '*.js' -exec sed -i 's/\/command\/discardCheckOut/\/command\/discardCheckout/g' {} \; Plus I had to rename util/UrlHelper => util/urlHelper [lowercased the initial U].

Following, you can find the files affected by the "patches":

Thanks for your help.

sg-chrishasz commented 6 years ago

I've done some testing, and I can confirm that an extension packaged for the marketplace follows a different process than an extension packaged locally. While all of the files have been correctly renamed in Git (and maintain their correct naming when installed locally), I suspect that a material change needs to take place within the file in order for the filename to change in marketplace packaging.

To test this, I tried replacing a local copy with one from the marketplace, then compared the filenames after forcibly deleting all local files and then re-downloading the package from within Visual Studio Code - confirming the incorrectly named files.

I'm going to work on a solution for fixing the filenames in the VSCode Marketplace copy of SPGo, but in the meantime, the following steps will allow you to get up and running with the latest SPGo version:

  1. manually delete the current extension: rm -r ~/.vscode/extensions/sitego.spgo-1-3-1
  2. globally install the vsce tools: sudo npm install -g vsce
  3. get latest from master: git clone https://github.com/readysitego/spgo
  4. get packages: npm install
  5. Build and install package manually: vsce package code --install-extension <package>.vsix where <package> is the name of the package generated in the step above.

Please let me know if you run into any issues with this approach. I'll keep this issue updated as I learn more.

sg-chrishasz commented 6 years ago

I just published SPGo 1.3.2 to the VS Marketplace which resolves this issue.

The root cause of this issue was simply that I needed to delete my local output folders before repackaging, otherwise when generating the .js files from TypeScript, the original filenames/paths were persisted. The intermittent nature of this issue was caused by publishing from different development environments (primary windows development vs. my Ubuntu environment).

themoreyouknow