Renamed defaultSettings to defaultRouteSettings

refs https://github.com/TryGhost/Toolbox/issues/214

- The `defaultSettings` path name in the config (one pointing to routes yaml file) creates confusion with the `defaultSettings` which populate defaults for  in the database settings table.
- Furthermore, the name collision creates a problem when trying to make database default settings dynamic - being able to load them from configurable file path.
- Rename makes "routing" explicit to avoid ambiguity and free up the name for the database defaults
- The value seems to be safe to be renamed as all keys used in `overrides.json` are taking priority - the name "defaultRouteSettings" hasn't surfaced at any point in the git history
This commit is contained in:
Naz 2022-02-18 09:17:10 +07:00 committed by naz
parent 178e7db066
commit 7f0bf62ec9
4 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@ module.exports = {
type: 'routes',
extension: '.yaml',
destinationFolderPath: config.getContentPath('settings'),
sourceFolderPath: config.get('paths').defaultSettings
sourceFolderPath: config.get('paths').defaultRouteSettings
});
return await defaultSettingsManager.ensureSettingsFileExists();

View File

@ -6,7 +6,7 @@
"helperTemplates": "core/frontend/helpers/tpl/",
"adminViews": "core/server/web/admin/views/",
"defaultViews": "core/server/views/",
"defaultSettings": "core/server/services/route-settings/",
"defaultRouteSettings": "core/server/services/route-settings/",
"internalAppPath": "core/frontend/apps/",
"internalAdaptersPath": "core/server/adapters/",
"migrationPath": "core/server/data/migrations",

View File

@ -43,7 +43,7 @@ describe('DB version integrity', function () {
// If this test is failing, then it is likely a change has been made that requires a DB version bump,
// and the values above will need updating as confirmation
it('should not change without fixing this test', function () {
const routesPath = path.join(config.get('paths').defaultSettings, 'default-routes.yaml');
const routesPath = path.join(config.get('paths').defaultRouteSettings, 'default-routes.yaml');
const defaultRoutes = validateRouteSettings(yaml.load(fs.readFileSync(routesPath, 'utf-8')));
const tablesNoValidation = _.cloneDeep(schema);

View File

@ -104,7 +104,7 @@ describe('Config Loader', function () {
'helperTemplates',
'adminViews',
'defaultViews',
'defaultSettings',
'defaultRouteSettings',
'internalAppPath',
'internalAdaptersPath',
'migrationPath',