Switch the mods installation back into the main node_modules#393
Open
tiennou wants to merge 1 commit into
Open
Switch the mods installation back into the main node_modules#393tiennou wants to merge 1 commit into
tiennou wants to merge 1 commit into
Conversation
The issue is that, because of the split between /screeps/node_modules and /screeps/mods/node_modules, depending on a mod's dependencies, you could end up with a "split package" situation. A good example of that is screepsmod-auth, which has a peer dep on @screeps/backend. This ends up pulling another copy of passport, which means that now the server talks to `/screeps/node_modules/passport`, while screepsmod-auth talks to `/screeps/mods/node_modules/passport`. With both having different authentication strategy stacks, you get random auth errors when the 'token' strategy isn't found. For consistency, just install everything into the server's package tree, but keep around a `mods/managed-deps.json` "lockfile" in a separate volume that lets us keep track of the last installed versions to prefer in case the container gets recreated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The issue is that, because of the split between /screeps/node_modules and /screeps/mods/node_modules, depending on a mod's dependencies, you could end up with a "split package" situation.
A good example of that is screepsmod-auth, which has a peer dep on @screeps/backend. This ends up pulling another copy of passport, which means that now the server talks to
/screeps/node_modules/passport, while screepsmod-auth talks to/screeps/mods/node_modules/passport. With both having different authentication strategy stacks, you get random auth errors when the 'token' strategy isn't found.For consistency, just install everything into the server's package tree, but keep around a
mods/managed-deps.json"lockfile" in a separate volume that lets us keep track of the last installed versions to prefer in case the container gets recreated.