@sodacore/create
The @sodacore/create
package offers a standalone ability to create sodacore projects with defaults and can install and initialise boilerplate code for the given plugins.
Usage
To use the package, you can do the following:
bun create @sodacore
NOTE
The reason it is @sodacore
instead of sodacore
is because bun
will utilise @sodacore/create
rather than look for a create-sodacore
package, I prefer everthing being namespaced.
Once you run this command, you can follow the prompts on screen to create your project.
Create your own template
To create your own template for others to use, create a Github repository, and then ensure you follow the structure below:
- template.json
- package.json
- README.md
- LICENSE
- src/
- main.ts
Essentially, the core files here are template.json
.
The template.json
should contain the following structure:
{
"name": "My Community Template",
"description": "A description of my template",
"author": "YourGithubName",
"license": "Apache-2.0",
"files": [
{
"source": "https://raw.githubusercontent.com/YOUR_NAME/YOUR_REPO/refs/heads/YOUR_BRANCH/src/main.ts",
"destination": "src/main.ts"
},
{
"source": "https://raw.githubusercontent.com/YOUR_NAME/YOUR_REPO/refs/heads/YOUR_BRANCH/package.json",
"destination": "package.json"
},
{
"source": "https://raw.githubusercontent.com/YOUR_NAME/YOUR_REPO/refs/heads/YOUR_BRANCH/README.md",
"destination": "README.md"
},
{
"source": "https://raw.githubusercontent.com/YOUR_NAME/YOUR_REPO/refs/heads/YOUR_BRANCH/LICENSE",
"destination": "LICENSE"
}
],
}
TIP
You can replace YOUR_NAME
, YOUR_REPO
and YOUR_BRANCH
with your own details.
For a user to use your template, they will be asked the following information:
- User/Repository: This is the
YOUR_NAME/YOUR_REPO
part of the URL. - Branch: This is the branch to use, defaults to
main
if not specified.
Using community templates
To download a community template, simply pick the "Community" option within the prompts, and then enter the User/Repository
and Branch
details when prompted.