You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change design of package @docusaurus/core.
This code has implicit dependencies and is hard for newbs. Logic this package interwined with infrastructure code. Modules interact with file system, network and third-party libraries. Tests also have problems. By tests hard understand what does package. Tests is written for individuals files and they probably check implementation, not interface, that user interact with one.
💥 Proposal
To fix this problems, propose remove external dependencies from modules from folder commands. And later move features to custom webpack loaders and plugins.
Steps necessary to perform for that.
Write integration tests. Tests should checks commands corecteness interact with external environment.
Replace code that interact with fs, network and 3rd-party libraries to wrappers.
Change requirements for commands. That modules shouldn't interact with infrastructure now, only call explicit injected functions. Move wrappers to individual files. Pass every dependency explicit to constructor. In tests instead of external dependencies use mocks.
Source tests could be removed because module tests from commands and integration tests should cover all possible cases.
Features from commands step-by-step move to webpack loaders and plugins. Requirements and сonsequently
tests should change also step-by-step. Finally, instead of methods createConfig and modules commands should be files with webpack config.
The idea is solid although the language is hardly understandable.
By my understanding, the OP is asking for:
Tests to be fully E2E instead of testing internal impl; (which I partially agree, E2E tests should be improved, but unit tests are also necessary)
Separate side-effects (fs, web request...) from pure core logic (I don't know how that's possible but the idea is sound, like how functional programmers do things);
Change design of package @docusaurus/core.
This code has implicit dependencies and is hard for newbs. Logic this package interwined with infrastructure code. Modules interact with file system, network and third-party libraries. Tests also have problems. By tests hard understand what does package. Tests is written for individuals files and they probably check implementation, not interface, that user interact with one.
💥 Proposal
To fix this problems, propose remove external dependencies from modules from folder
commands
. And later move features to custom webpack loaders and plugins.Steps necessary to perform for that.
Write integration tests. Tests should checks
commands
corecteness interact with external environment.Replace code that interact with fs, network and 3rd-party libraries to wrappers.
Change requirements for
commands
. That modules shouldn't interact with infrastructure now, only call explicit injected functions. Move wrappers to individual files. Pass every dependency explicit to constructor. In tests instead of external dependencies use mocks.Source tests could be removed because module tests from
commands
and integration tests should cover all possible cases.Features from commands step-by-step move to webpack loaders and plugins. Requirements and сonsequently
tests should change also step-by-step. Finally, instead of methods createConfig and modules
commands
should be files with webpack config.Have you read the Contributing Guidelines on issues?
Yes
The text was updated successfully, but these errors were encountered: