generated from Seekra/repository-template
add settings configuration parser #78
Reference in New Issue
Block a user
Delete Branch "feature/settings-config-parser"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a JSON-based settings configuration parser. The config file lives at
src/features/settings/settings.jsonand is loaded via dynamic import. A validator checks all entry types (bool, number, string, selection, section) and a Vue.js composable provides reactive access to the parsed configuration.Related Issues
Closes: #77
Please do not put the settings file into
public/and do not load it viafetch. You should use a dynamic JavaScript import (await import('…')) and I ask you to put the settings intosrc/features/settings/settings.jsonor something similar.Please provide a description/summay of the PR.
Why did you create the empty file
public/settings.js?Can you please remove the example settings?
@@ -0,0 +57,4 @@assertString(entry.name, `${path}.name`);assertString(entry.i18n, `${path}.i18n`);if (entry.default === undefined) {Not every setting does need a default value. I suggest omitting this check.
@@ -0,0 +72,4 @@}if (entry.type === 'selection') {validateSelectionOptions(entry.options, path);if (typeof entry.allowMultiple !== 'boolean') {I think it should have a default value (
false) that is used if it is not specified.@@ -0,0 +32,4 @@* @property {string} [description]*//**Could you please check the value of
typeinstead of the type ofdefault?