After the DC-005 module reorganization (41 files moved into src/ subdirs),
138 test suites failed because the refactor script's path-rewrite logic
missed three categories:
1. Files inside src/ doing 'require("./src/...")' — should be 'require("../...")'
2. Files in src/X/Y/ doing 'require("../../../src/...")' — should be 'require("../../...")'
3. Test files in __tests__/ with leftover 'require("../../../src/...")' paths
Root cause: the original refactor script ran before all files were moved,
so it computed relative paths against stale filesystem state.
Result:
- 30/30 test suites pass
- 879/879 tests pass (was: 18/30 suites, 614/687 tests)
Also fixed:
- routes/apps/restore.js: wrong responses import path
- routes/*/*.js: '../../src/utilities/X' → '../src/utilities/X' (depth 2 routes)
39 lines
867 B
JavaScript
39 lines
867 B
JavaScript
/**
|
|
* Centralized configuration module
|
|
* Exports all configuration loading and path resolution
|
|
*/
|
|
const paths = require('./paths');
|
|
const site = require('./site');
|
|
const { APP, LIMITS, TIMEOUTS, RETRIES, CADDY } = require('../utilities/constants');
|
|
|
|
// Load logging level
|
|
const LOG_LEVELS = { debug: 0, info: 1, warn: 2, error: 3 };
|
|
const LOG_LEVEL = LOG_LEVELS[process.env.LOG_LEVEL || 'info'] || 1;
|
|
|
|
const PORT = APP.PORT;
|
|
const MAX_ERROR_LOG_SIZE = LIMITS.ERROR_LOG_SIZE;
|
|
|
|
module.exports = {
|
|
// Paths
|
|
...paths,
|
|
|
|
// Site configuration
|
|
siteConfig: site.siteConfig,
|
|
loadSiteConfig: site.loadSiteConfig,
|
|
buildDomain: site.buildDomain,
|
|
buildServiceUrl: site.buildServiceUrl,
|
|
|
|
// App constants
|
|
PORT,
|
|
LOG_LEVELS,
|
|
LOG_LEVEL,
|
|
MAX_ERROR_LOG_SIZE,
|
|
|
|
// Re-export constants for convenience
|
|
APP,
|
|
LIMITS,
|
|
TIMEOUTS,
|
|
RETRIES,
|
|
CADDY,
|
|
};
|