If you're creating a new Frontastic component, you can use the Frontastic CLI to scaffold this new Frontastic component for you. The Frontastic CLI will create the
tastic.jsx file, the
schema.json file, and update the
tastics.js file with your new Frontastic component.
The schema file will need to be updated with the required properties and the formatting may need fixing on added and modified files to suit your eslint/prettier/... configuration.
The most basic usage is to run the command below:
frontastic generate tastic
You'll then be prompted to input a new name for your Frontastic component. This will be used as your folder name as well as the Frontastic component name with Frontastic component at the end, for example, productList would become productListTastic.
The below image shows what you'd see if you ran the command and inputted a name of
You can then open your 'tastic.jsx' and 'schema.json' in the newly created folder of the same name and they'll already contain the below:
And below is the updated
schema.jsonis edited to how you'd like it to be, don't forget to upload it to the Frontastic component section of the Frontastic studio.
If you use the below command, you can input the name of your Frontastic component straight away:
frontastic generate tastic --name tasticName
If you use the below command, it will create the
tastic.jsx file and the
schema.json file, but your new Frontastic component won't be added to the
tastics.js file. You might want to do this if you have the file in a particular format but you'll have to add it manually.
frontastic generate tastic --skipTasticsJs
You can also get help within the CLI by using:
frontastic generate tastic --help
Updated over 2 years ago