create-bl-theme 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +21 -5
  2. package/bin/cli.js +76 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -43,14 +43,30 @@ Checks that your theme has all required files and valid metadata.
43
43
 
44
44
  ```
45
45
  my-theme/
46
- ├── metadata.json # Theme metadata (required)
47
- ├── style.css # Your CSS styles (required)
48
- ├── shader.json # Shader config (if enabled)
49
- ├── README.md # Theme documentation
50
- └── images/ # Screenshots (required)
46
+ ├── metadata.json # Theme metadata (required)
47
+ ├── style.css # Your CSS styles (required)
48
+ ├── DESCRIPTION.md # Rich description (optional, takes precedence)
49
+ ├── shader.json # Shader config (if enabled)
50
+ ├── README.md # Theme documentation
51
+ └── images/ # Screenshots (required)
51
52
  └── preview.png
52
53
  ```
53
54
 
55
+ ### Theme Description Options
56
+
57
+ You can provide your theme description in two ways:
58
+
59
+ 1. **`description` field in metadata.json** - Simple, inline description for basic themes
60
+ 2. **`DESCRIPTION.md` file** - For richer descriptions with formatting (recommended for longer descriptions)
61
+
62
+ If both exist, `DESCRIPTION.md` takes precedence. At least one must be present.
63
+
64
+ Better Lyrics supports **GitHub Flavored Markdown (GFM)** in DESCRIPTION.md, so you can use:
65
+ - **Bold**, *italic*, and other text formatting
66
+ - [Links](https://example.com) and images
67
+ - Lists, tables, and code blocks
68
+ - Any other GFM features
69
+
54
70
  ## Theme Development
55
71
 
56
72
  1. **Edit `style.css`** - Add your custom styles. Use browser DevTools to inspect Better Lyrics elements and find the right selectors.
package/bin/cli.js CHANGED
@@ -81,6 +81,12 @@ async function create(targetDir) {
81
81
  message: "Description:",
82
82
  initial: "A custom theme for Better Lyrics",
83
83
  },
84
+ {
85
+ type: "confirm",
86
+ name: "useDescriptionFile",
87
+ message: "Use DESCRIPTION.md for richer formatting? (recommended for longer descriptions)",
88
+ initial: false,
89
+ },
84
90
  {
85
91
  type: "text",
86
92
  name: "creator",
@@ -138,7 +144,6 @@ async function create(targetDir) {
138
144
  const metadata = {
139
145
  id: response.id,
140
146
  title: response.title,
141
- description: response.description,
142
147
  creators: [response.creator],
143
148
  minVersion: "2.0.5.6",
144
149
  hasShaders: response.hasShaders,
@@ -147,11 +152,55 @@ async function create(targetDir) {
147
152
  images: ["preview.png"],
148
153
  };
149
154
 
155
+ // Only include description in metadata.json if not using DESCRIPTION.md
156
+ if (!response.useDescriptionFile) {
157
+ metadata.description = response.description;
158
+ }
159
+
150
160
  fs.writeFileSync(
151
161
  path.join(fullPath, "metadata.json"),
152
162
  JSON.stringify(metadata, null, 2)
153
163
  );
154
164
 
165
+ // Create DESCRIPTION.md if user opted for it
166
+ if (response.useDescriptionFile) {
167
+ const descriptionMd = `<!--
168
+ Better Lyrics supports GitHub Flavored Markdown (GFM) for theme descriptions.
169
+ You can use all standard GFM features including:
170
+ - **Bold** and *italic* text
171
+ - [Links](https://example.com)
172
+ - Images: ![alt text](https://example.com/image.png)
173
+ - Lists (ordered and unordered)
174
+ - Code blocks with syntax highlighting
175
+ - Tables
176
+ - And more!
177
+
178
+ This file takes precedence over the "description" field in metadata.json.
179
+ Delete this comment block when you're ready to publish.
180
+ -->
181
+
182
+ ## Features
183
+
184
+ - Add your theme features here
185
+ - Describe what makes your theme special
186
+ - Use **bold** for emphasis on key points
187
+
188
+ ## Preview
189
+
190
+ <!-- You can embed images directly in your description -->
191
+ <!-- ![Theme Preview](https://your-image-url.png) -->
192
+
193
+ ## Installation Notes
194
+
195
+ Any special instructions for using this theme.
196
+
197
+ ## Compatibility
198
+
199
+ - Works with Better Lyrics v2.0.5.6+
200
+ `;
201
+ fs.writeFileSync(path.join(fullPath, "DESCRIPTION.md"), descriptionMd);
202
+ }
203
+
155
204
  // Create style.css from template
156
205
  const cssTemplate = fs.readFileSync(
157
206
  path.join(TEMPLATES_DIR, "style.css"),
@@ -205,12 +254,17 @@ MIT
205
254
  console.log(
206
255
  ` ${pc.dim("3.")} Add a preview screenshot to ${pc.cyan("images/preview.png")}`
207
256
  );
257
+ let stepNum = 4;
258
+ if (response.useDescriptionFile) {
259
+ console.log(` ${pc.dim(`${stepNum}.`)} Edit ${pc.cyan("DESCRIPTION.md")} with your theme description`);
260
+ stepNum++;
261
+ }
208
262
  if (response.hasShaders) {
209
- console.log(` ${pc.dim("4.")} Configure ${pc.cyan("shader.json")} for shader effects`);
263
+ console.log(` ${pc.dim(`${stepNum}.`)} Configure ${pc.cyan("shader.json")} for shader effects`);
264
+ stepNum++;
210
265
  }
211
- const submitStep = response.hasShaders ? "5." : "4.";
212
266
  console.log(
213
- ` ${pc.dim(submitStep)} Push to GitHub and submit to the theme store`
267
+ ` ${pc.dim(`${stepNum}.`)} Push to GitHub and submit to the theme store`
214
268
  );
215
269
  console.log(
216
270
  ` ${pc.dim("https://github.com/boidushya/better-lyrics-themes")}`
@@ -235,6 +289,10 @@ async function validate(dir) {
235
289
  process.exit(1);
236
290
  }
237
291
 
292
+ // Check for DESCRIPTION.md
293
+ const descriptionMdPath = path.join(fullPath, "DESCRIPTION.md");
294
+ const hasDescriptionMd = fs.existsSync(descriptionMdPath);
295
+
238
296
  // Check metadata.json
239
297
  const metadataPath = path.join(fullPath, "metadata.json");
240
298
  if (!fs.existsSync(metadataPath)) {
@@ -245,7 +303,6 @@ async function validate(dir) {
245
303
  const required = [
246
304
  "id",
247
305
  "title",
248
- "description",
249
306
  "creators",
250
307
  "minVersion",
251
308
  "hasShaders",
@@ -259,6 +316,20 @@ async function validate(dir) {
259
316
  }
260
317
  }
261
318
 
319
+ // Check for description: either in metadata.json OR in DESCRIPTION.md
320
+ if (!metadata.description && !hasDescriptionMd) {
321
+ errors.push(
322
+ 'Missing description: add "description" field in metadata.json or create DESCRIPTION.md'
323
+ );
324
+ }
325
+
326
+ if (hasDescriptionMd) {
327
+ const descContent = fs.readFileSync(descriptionMdPath, "utf-8").trim();
328
+ if (descContent.length === 0) {
329
+ errors.push("DESCRIPTION.md exists but is empty");
330
+ }
331
+ }
332
+
262
333
  if (metadata.id && !/^[a-z0-9-]+$/.test(metadata.id)) {
263
334
  errors.push(
264
335
  "metadata.json: id must be lowercase letters, numbers, and hyphens only"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-bl-theme",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "CLI tool to scaffold Better Lyrics themes",
5
5
  "type": "module",
6
6
  "bin": {