AdobeXD / design-system-package-dsp

DSP Documentation
MIT License
335 stars 38 forks source link

No generation on WSL #14

Open allurefx opened 3 years ago

allurefx commented 3 years ago

I installed the Adobe XD extension (1.1.2) on both the Windows 10 and WSL:Ubuntu VSCode versions. The Windows version generates the code, but not the WSL version. I need Flutter/Dart, but even other languages aren't generating. On the WSL version, the dsp folder gets generated, with assets/, data/, and dsp.json, installs dist/styledictionary/ with node_modules/, etc. but doesn't actually generate the code. I thought it's a path issue where the generator isn't finding the path, but there is no error displayed, says the generation completed successfully.

carlohcs commented 3 years ago

@allurefx I am having the same problem and nothing is being generated by the extension (1.1.2 too). In the first time when I used the extension, worked. Now I am in another computer (Ubuntu) and doesn't work. Just the JSON files are being generated.

demianborba commented 3 years ago

@allurefx @carlohcs can you please try again with our latest version (v1.1.4)? It fixes some of the path resolving issues you might be seeing. https://marketplace.visualstudio.com/items?itemName=Adobe.xd

carlohcs commented 3 years ago

@demianborba nothing changed! I tried to install other versions of the extension, but nothing changed. Stack: Ubuntu (18.04.5 LTS), VSCode (1.56.0) image

TheKvist commented 2 years ago

@demianborba Any updates on this? Having the exact same issue as @carlohcs with my WSL 2 configuration. Very sad to see this has not been fixed in a year now.

TheKvist commented 2 years ago

So, it turns out that the fix to the problem is dead simple. I dug around in the extension code located in extension-bundle.js in my .vscode-server directory in the WSL and found the culprit:

In the function that generates the style-dictionary config file, the template file build/SDconfig.template.js is loaded from the extension directory. However, in the call to the path resolver in the function, the file name is mistakenly spelt as "build/SDConfig.template.js" with a capital C in "SDConfig". The reason why it doesn't crash on Windows or Mac OS X is that their file systems are not case sensitive and so the casing of the name does not matter, it would load with any casing there. Linux' ext4 however is case sensitive, so the case mistake leads to an empty SD config file being generated, which in turn leads to the error of style-dictionary trying to iterate over the keys of a non-existing config property.

Just from looking at how this repository has not really been maintained at all, I'd suggest simply renaming the file, located inside the WSL at ~/.vscode-server/extensions/adobe.xd-1.2.3/build/SDconfig.template.js to .../SDConfig.template.js to match the path in the function call and get things working again. On an actual Linux, the same problem should exist, but there the path would be ~/.vscode/... instead of ~/.vscode-server/....

carlohcs commented 2 years ago

Hey @TheKvist, I gave up on this package. I think the only responsible for this it was @demianborba. And if I not wrong, he isn't more worker in Adobe. So maybe this request it will not be resolved... I started to use just Style Dictionary to solve my case. I hope you have a better experience! Good luck!