brain_emesis•

Correct me if I'm wrong, but doesn't npm use a nested dependency structure? Where each dependency has its own node_modules folder underneath it?

My understanding is that this is how they solve the 'diamond dependency' problem. With npm, you can actually have multiple different versions of the same library in the dependency graph. Which is really cool for javascript, but if this is all dumped into the unity Assets/ folder then won't Unity try and compile everything together?

Also I think you mean .unitypackage files, not asset bundles, in your introduction

4
TheRealCorngood•

This is where I gave up on using npm for this purpose. I'd love to know if anyone found a solution.

I tried virtually every package manager I could find, and the only one which really did what I wanted it to was pacman. I built pacman for cygwin, and treated the unity project as the root of the system, with its own package db etc. I haven't rolled it out to a full team yet, but it seems promising. You can even take advantage of separate source and binary packages, and use dev dependencies (e.g. mono) to build the script code to a dll, or do other types of preprocessing.

2
shadowmintOP•

Npm 3 aggregates dependencies at the top level and attempts to resolve to versions that satisfy all version deps; but ultimately it's true to say if you have conflicting requirements it wont work.

(but no, you won't get multiple copies of stuff on the assets folder if you use two packages with the same dependency)

1
TheRealCorngood•

You won't get multiple copies, but you'll still run into problems with multiple versions installing/uninstalling in the same place.

1
shadowmintOP•

doesn't seem to. Like I said, npm3 aggregates modules at a top level, so one single copy of the module exists in the node_modules folder.

The post install script only runs once as far as I can tell. /shrug

2
llkkjjhh•

It would be easier to just forget about the post install script and simply run npm install from within the assets folder.

1
shadowmintOP•

Depends if you have any other npm packages. For example, I use https://github.com/shadowmint/gulp-unity/ to run my projects and collect test results.

If you put your node_modules in the Assets folder unity scans all the .js files as scripts and complains about it.

...but if you dont use any other packages, yeah, that totally works too~

1
omg_ketchup•

So... I see most of these are under shadowmint. Are you setting up like your own set of packages, as in just assets converted to use npm?

I might have a package to submit.

1
shadowmintOP•

Its just my github account; if you want to turn something into a package just add a package.json to it.

I've simply forked a few things and done so because it's convenient; also, getting ready for the global game jam in couple of weeks. :)

1
Ardivaba•

YES!!!

-1