microsoft / msagljs

A JavaScript graph layout engine: port of MSAGL
https://microsoft.github.io/msagljs/
MIT License
146 stars 15 forks source link

Building scripts on Windows #77

Open wvdvegt opened 7 months ago

wvdvegt commented 7 months ago

Not a bug/issue, but it might be useful info for others trying to get up & running with msagl.js usign VSCode on Windows. Maybe it's useful for an FAQ entry.

I found that with some modifications the main scripts and examples can be build on Windows using VSCode.

After installing Node.js on Windows you should be able to run the following commands to install the build tools globally:

npm install -g yarn
npm install -g lerna
npm install -g esbuild

In the various package.json files split the "build" command into a separate clean (the linux rm/rmdir command that won't work on Windows) and build command.

After this you can either run commands as 'npm run build' or (if present) use the VSCode npm command window. Note that some of the examples end up in the website folder instead of the examples folder.

PS 1) the clean commands use wildcards that are not compatible with Windows so one would need a batch file (and call in in the clean command) to clean the repo from previous output.

PS 2) if you want to disable minifiying the scripts (for debugging purposes), modify the 'esbuild.js' file and change all '.min.js' extensions in build scrips to just '.js'.

levnach commented 7 months ago

Msagljs builds well on Windows WSL. You are right that it should be in the docs! VSCODE works nicely in WSL too.

https://code.visualstudio.com/docs/remote/wsl

wvdvegt commented 7 months ago

Got WSL installed but no GUI so a bit to command-line for me. But good to known it can be compiled there. It would already help id you separated the commands into clean/build and rebuild (wher rebuild calls clean & build) as is the vase in Visual Studio. One could add deply for bundling and/or minimizing.

However it would not resolve the clean commands atm (but at least let one compile).

levnach commented 7 months ago

Sorry, what do you mean by no GUI? Vscode, for example, can give you a GUI. Of course, you need to configure it a bit.

wvdvegt commented 7 months ago

You're proably right, i may be able to start VSCode from Windows from inside VSCode and have the clone of the repo on the WSL filesystem. If i have some time I will try it.

What i meant was myu WSL des not support Linux graphical shells.

levnach commented 7 months ago

Yes, that is how I work with this repo.