.codesandbox/README.md
Configuration files, scripts and templates used by CodeSandbox CI, Github Codespaces and Gitpod
ci.json: configuration for codesandbox ci.mjs: script files used by our clitemplates: ready to start fabric templates (next, node, vanilla, vue)To run a template use the cli.
npm run sandbox
npm start <template>
A sandbox app is started (locally) by our cli as follows:
link fabricdev cmdThe app will reload once fabric builds, see Hot Reload.
First make sure codesandbox supports the framework you would like to create the sandbox with, see the template section in sandbox configuration.
dev script in package.json starting the app locally for our cli.sandbox.config.json file, see sandbox configuration..codesandboxignore file tells the deploy script what to ignore. Deploying is restricted in size so be vigilant with deployed assets..codesandbox suffix to a file tells the deploy script to deploy the suffixed file instead of it's counterpart that will be used only locally. e.g. index.ts will be used locally whereas index.codesandbox.ts will be used by the deployed codesandbox.Once the template is initialized run npm start <template> and you're ready to go.
Unfortunately, hot reload is a pain when trying to watch a linked dependency (though it is an absolute MUST for CI).
To workaround that, the cli informs the framework to perform a hot reload when fabric builds by modifying the sandbox's package.json file.
A better solution will be appreciated.