unable to generate custom components using @sapphire/cli

.sapphirerc.json
{
"$schema": "https://raw.githubusercontent.com/sapphiredev/cli/main/templates/schemas/.sapphirerc.scheme.json",
"projectLanguage": "ts",
"locations": {
"base": "src",
"arguments": "arguments",
"commands": "commands",
"listeners": "listeners",
"preconditions": "preconditions",
"interaction-handlers": "interaction-handlers",
"routes": "routes",
"builders": "builders"
},
"customFileTemplates": {
"enabled": true,
"location": "templates"
}
}
{
"$schema": "https://raw.githubusercontent.com/sapphiredev/cli/main/templates/schemas/.sapphirerc.scheme.json",
"projectLanguage": "ts",
"locations": {
"base": "src",
"arguments": "arguments",
"commands": "commands",
"listeners": "listeners",
"preconditions": "preconditions",
"interaction-handlers": "interaction-handlers",
"routes": "routes",
"builders": "builders"
},
"customFileTemplates": {
"enabled": true,
"location": "templates"
}
}
templates/builder.tsx.sapphire
{
"category": "builders"
}
---
import { JSX, Builder, loadImage } from "canvacord";

export class {{name}} extends Builder {
constructor() {
super(300, 300);
}

override async render() {
return ()
}
}
{
"category": "builders"
}
---
import { JSX, Builder, loadImage } from "canvacord";

export class {{name}} extends Builder {
constructor() {
super(300, 300);
}

override async render() {
return ()
}
}
No description
Solution:
FWIW btw, development on the new version of the CLI has started in #cli-development
Jump to solution
8 Replies
Oreo ™
Oreo ™4mo ago
Idk if "tsx" is a supported file type Maybe change the file name to builder.ts.sapphire
Dynamic
Dynamic4mo ago
i dont care, ts doesn't worked either thats why im asking
First, create a file in your template directory with a name in the format <templateName>.<language>.sapphire
First, create a file in your template directory with a name in the format <templateName>.<language>.sapphire
in guide ^^
Oreo ™
Oreo ™4mo ago
Yeah. And iirc the only languages are js and ts to my knowledge U used "builders" as the name in your screenshot And you named the file "builder" If that doesn't work then something is wrong with your file structure
Dynamic
Dynamic4mo ago
i tried with all singular names aswell as all plural names nothing works
Favna
Favna4mo ago
tsx is definitely not supported btw. This is a typescript node app, not a react frontend app. Anyway I'll look into it ig
Dynamic
Dynamic4mo ago
still cannot generate ts file extension components i tried to generate database as component
Favna
Favna4mo ago
yeah I'm sorry I havent got around this yet
Solution
Favna
Favna4mo ago
FWIW btw, development on the new version of the CLI has started in #cli-development
Want results from more Discord servers?
Add your server