-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Description
Require tree already reads all of the contents of a theme directory, but we want to add support for reading the contents of a package.json file.
On the settings page, if a theme does have a package.json file, we should read the name and version number and use these in the dropdown like:
If there is no package.json file, we should use the directory name as before.
Also if a theme does not have a package.json file output a warning on the console explaining that themes should have package.json files, and a link to a page explaining what's going on. The URL for that page is TBD.
It is worth considering how and where we load the data from the package.json file probably at the same time as doing the requireTree - and also when to output the warning - at start when the directory is loaded? When the theme is activated? I'd recommend both.
Note: This is a temporary improvement to introduce package.json files. Long term we will add support for more information via a much better UI.
Also note: When implementing this, consider that apps, which are not currently used in the UI anywhere, will also need to have package.json files which are loaded.
