Open taylortom opened 2 years ago
@taylortom I've taken down the comments I added to make some revisions - will post back soon.
UPDATE on the below comments: at present I am correcting dependencies across packages and adding peerDependencies
as per OP to verify Node behaviour (especially w.r.t. workspaces).
Peer dependencies are for plugin architectures. The AAT doesn't implement a plugin architecture: it is a single application split across packages. These packages have a mix of import and runtime interdependencies. Most packages are therefore coupled and some tightly (jsonschema <-> config, content <-> contentplugin).
Propose the following:
adapt-*
dependencies from package.json
files and hoist them to the root project package.json
(adapt-authoring
)This will mean we have a single place to change paths (e.g. select a different Git branch) for whatever dependencies we like and therefore not have resolution conflicts when we are using Node workspaces.
For example, if I am working on adaptframework issue/31, and content issue/23 (but from a different Git user) I can just edit one package.json
with:
"adapt-authoring-adaptframework": "github:adapt-security/adapt-authoring-adaptframework#issue/31",
"adapt-authoring-content": "github:chris-steele/adapt-authoring-content#issue/23"
As discussed with Ollie, we'll keep nested dependencies to allow for simpler installations and a more transparent dependency map.
After running a few tests on peer dependencies, I agree that they introduce more problems than they solve, so think we need to forget that approach for now. I do still think we need a way for developers to flag when certain modules are used at runtime to give useful warnings to the user.
Need to make sure all module interdependencies are defined using the
peerDependencies
object.This includes the following:
waitForModule
See this article for a bit of an explanation.