Closed gxkl closed 3 weeks ago
The pull request introduces updates to the @eggjs/tegg-standalone
project by adding a new development dependency and enhancing the configuration options for module loading. Specifically, a dump
property is added to both the EggModuleLoaderOptions
and RunnerOptions
interfaces, allowing for conditional dumping of module descriptors. Additionally, the test suite is modified to validate the new functionality, ensuring that the dump
method behaves correctly based on the specified options.
File Path | Change Summary |
---|---|
standalone/standalone/package.json | Added new development dependency: "mm": "^3.2.1" in devDependencies . |
standalone/standalone/src/EggModuleLoader.ts | Added optional property dump?: boolean to EggModuleLoaderOptions . Modified generateAppGraph to conditionally dump module descriptors based on options.dump . |
standalone/standalone/src/Runner.ts | Updated RunnerOptions to include dump?: boolean; . Modified constructor and loadUnitLoader to utilize the dump option. |
standalone/standalone/test/index.test.ts | Added imports for mocking and dumping. Introduced beforeEach hook for restoring mocks. Added tests for main function to check behavior with and without dump option. |
mm
dependency may relate to the modifications in the EggModuleLoader
and Runner
classes in the retrieved PR, which also involve enhancements to module loading and configuration, potentially utilizing the new dependency for testing or mocking purposes.🐇 In the land of code where rabbits play,
New dependencies hop in, brightening the day.
Withdump
options added, our modules align,
Testing their behavior, all will be fine!
So let’s celebrate changes, both big and small,
In the world of coding, we’re having a ball! 🎉
Successfully published:
Checklist
npm test
passesAffected core subsystem(s)
Description of change
Summary by CodeRabbit
New Features
dump
in theEggModuleLoaderOptions
andRunnerOptions
interfaces, allowing users to control module descriptor dumping.Runner
class with the newdump
option.Bug Fixes
Tests
main
function with thedump
option in different configurations.