- Refactor `src/roster.mjs` to support dependency injection for `fs` and `loadTorchConfig`.
- Add `test/roster.test.mjs` to test roster loading scenarios including file precedence, caching, fallback, and configuration overrides.
- Export `_resetRosterCache` in `src/roster.mjs` for testing purposes.
Co-authored-by: PR0M3TH3AN <[email protected]>
Replaces synchronous `fs.readFileSync` with `fs.promises.readFile` in `loadTorchConfig` to prevent event loop blocking.
Updates all dependent configuration getters and consumers to use async/await.
Includes benchmark proving non-blocking behavior.
Fixes dashboard tests to properly await server listening.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Modify `src/ops.mjs` to copy all critical application directories (`src`, `bin`, `dashboard`, `scripts`, etc.) and files (`package.json`, `build.mjs`) to the `torch/` directory during `init` and `update`.
- Update `src/ops.mjs` to generate `torch-config.json` inside the `torch/` directory (if missing) instead of only in the project root, supporting self-contained execution.
- Update `src/roster.mjs` to fallback to checking for `roster.json` in the current working directory, enabling `npm run` commands to work correctly when executed from within the `torch/` directory.
- This allows `torch/` to function as a standalone sub-package within a project, where users can `cd torch`, `npm install`, and `npm run build` as expected.
Co-authored-by: PR0M3TH3AN <[email protected]>