[SOLVED] wcms-modules.json Woes!

Ask for help or provide support to other members.
Post Reply
NorfolkGreg
Posts: 89
Joined: Wed Sep 01, 2021 7:50 am

[SOLVED] wcms-modules.json Woes!

Post by NorfolkGreg »

I'm developing a WonderCMS theme. Since v3.3.0 we've been asked to add a file file wcms-modules.json to our repository. As I write the documentation at https://github.com/robiso/wondercms/wiki/Custom-modules says it should take the form:

Code: Select all

{
    "version": 1,
    "themes": {
        "theme-name": {
            "name": "Name of your theme",
            "repo": "https://github.com/yourUsername/theme-name/tree/master",
            "zip": "https://github.com/yourUsename/theme-name/archive/refs/heads/master.zip",
            "summary": "My sample theme",
            "version": "2.0.0",
            "image": "https://raw.githubusercontent.com/yourUsername/theme-name/master/preview.jpg"
        }
    }
}
After substituting my "yourUsername" and "theme-name" I got a couple of error messages when entering the json file into the . I visited the Sky theme page to see a working version and see it's .json file does not include the "refs/heads/" folders in its "zip:" line. I removed those folders from my file and once I'd discovered the correct URL to use to add my repository to my installation of WCMS all was well.

I'm not clear if the additional folder references in the "zip" line may be required in some circumstances. If so then I suggest the documentation at https://github.com/robiso/wondercms/wiki/Custom-modules explain what those might be.

As for the second error message, Entirely my fault! I had failed to read the whole page and spent some time using trial and error to find the correct form of URL to use to add the repository to my copy of WonderCMS! I missed that the answer is already there! It's:

Code: Select all

https://raw.githubusercontent.com/yourUsername/theme-name/master/wcms-modules.json
Last edited by NorfolkGreg on Fri Feb 04, 2022 5:49 pm, edited 1 time in total.
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: wcms-modules.json Woes!

Post by wiz »

Thanks for feedback and giving this a run.

Can you please verify the below?

Code: Select all

https://github.com/your-username/theme-name/archive/master.zip
worked for you and the below one didn't because it included refs?

Code: Select all

https://github.com/your-username/theme-name/archive/refs/heads/master.zip
I'm not clear if the additional folder references in the "zip" line may be required in some circumstances. If so then I suggest the documentation at https://github.com/robiso/wondercms/wiki/Custom-modules explain what those might be.
Additional references should be required, I simpy copied and pasted the "Download ZIP" URL from Github.

'll add this to the docs, the basic explanation is: the zip is required after the theme is updated, because WonderCMS fetches the whole ZIP and unzips it in your theme folder (once it's updated). The additional references might be unnecessary, I have to check, but for me it worked both with refs/head and without, but maybe it will be safer to just include it without in the documentation. I'll also add on how to find this info.
NorfolkGreg
Posts: 89
Joined: Wed Sep 01, 2021 7:50 am

Re: wcms-modules.json Woes!

Post by NorfolkGreg »

wiz wrote: Fri Feb 04, 2022 7:04 amCan you please verify the below?

Code: Select all

https://github.com/your-username/theme-name/archive/master.zip
worked for you and the below one didn't because it included refs?

Code: Select all

https://github.com/your-username/theme-name/archive/refs/heads/master.zip
Yes, that is what I found. The first worked. The second didn't.
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: wcms-modules.json Woes!

Post by wiz »

Fixed the documentation to reflect the actual requirements that seem to generally work, without refs/heads.
If you agree, we can mark this thread as [SOLVED]?

Thank you! Appreciate you giving this a go.
NorfolkGreg
Posts: 89
Joined: Wed Sep 01, 2021 7:50 am

Re: [SOLVED]wcms-modules.json Woes!

Post by NorfolkGreg »

Agreed! I've marked my initial post SOLVED!
Not sure that in this case the status deserves needing my approval though!
User avatar
wiz
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: [SOLVED] wcms-modules.json Woes!

Post by wiz »

Wasn't completely sure if you had any additional issues, so rather confirmed than falsely marking it as solved.
Cheers for marking it!
Post Reply