Create
Create new script preset
Creating a New Script Preset
It's recommended to run the CLI from the root of a project that already contains the files structured the way you want them to be in the preset.
After accessing the script presets menu, you can select the option to create a new preset:
Add Files
You can add files to your preset by selecting the Add files
option:
All files starting from the directory where the CLI was executed will be displayed
In the menu that appears with the files, you can search for a specific file by simply typing. To select/deselect a file, press the Tab
key and confirm with the Enter
key.
Remove Files
If you’ve already added files to the preset, the Remove files
option will appear. You can use it to select which files to remove:
If you change your mind about a file, you can select it for removal.
Add Dependencies
If the files you've selected require dependencies, you can add them using the Add dependencies
option:
You’ll be able to type the name of a dependency to add it to the preset.
You can add a dependency with a specific version using the same syntax as npm: Using the Fastify library as an example:
- Install a major version:
fastify@5
- Install a minor version:
fastify@4.28
- Install a specific version:
fastify@3.25.2
Then, you can choose whether to add it as a production or development dependency:
Dependency Type | Property in package.json |
---|---|
Production dependency | dependencies |
Development dependency | devDependencies |
Remove Dependencies
You can remove previously added dependencies using the Remove dependencies
option:
Preview
You can preview the structure of your script preset using the Preview
option:
The terminal will display the file and dependency structure of the preset.
Save
Once you’ve finished building your script preset, save it using the Save
option:
You’ll be asked to enter a name for the preset. Choose a short and clear name that helps identify its contents (you can use emojis if you'd like).