Add CodeSandbox config by default when creating Frontity projects with `npx frontity create`

Description

Just by adding a sandbox.config.json file with the following content

{
  "template": "node"
}

to the structure generated by npx frontity create we would be able to directly open in CodeSandbox all the Frontity projects in a repo by using

githubbox.com/<%GITHUB_ACCOUNT%>/<%FRONTITY_PROJECT_REPOSITORY%>

This would be super helpful for providing support in the Community Forum for specific projects in repositories (like this one → Mobile Error // Unhandled Promise Rejection - can't read the WP REST API)

Examples

This doesn’t work properly in CodeSandbox (doesn’t have sandbox.config.json)

But this one does (does have sandbox.config.json)

Possible solution

Adding this file with this content in all projects created via npx frontity create

Thanks for opening it @juanma :slightly_smiling_face: I liked the idea of making every Frontity repository a codesandbox template. I have no idea if it makes sense in terms of the framework itself to have a new file sandbox.config.json. I’m aware that Luis asked if they plan to add support for this configuration in the package.json file, but the issue seems stuck. I don’t know if it would be better to push that issue and add the configuration to the package.json or create the sandbox.config.json.

It would be great managing codesandbox through package.json but that’s something that is not in our hands and that it may take a while.

From my point of view, adding this file in the default configuration is something that can have a positive impact in the way users (and ourselvers when giving support) can access Frontity projects in repositories

I don’t see any drawback on adding this file now, and then managing the configuration via package.json when it works that way. Also I think the effort of implementing this feature is low and the benefits of having this feature are high.

Maybe I’m lacking info here, but that’s my point of view with the info I have.

At the end, you have all the info to properly decide what’s the real effort of doing this and what the priorities are :blush:

1 Like

Yes, I totally agree with this, and as you say we could go with this and change to the package.json if that issue is solved. What I wanted to say is that I don’t have the knowledge to know how “easy” it is to create this new file or if there is something we aren’t aware of. I’m sure @David will know better than me.