create-bl-theme 1.0.1 → 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.
- package/README.md +22 -6
- package/bin/cli.js +77 -6
- package/package.json +1 -1
- package/templates/style.css +2 -47
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ npm install -g create-bl-theme
|
|
|
11
11
|
Or use directly with npx:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npx create-bl-theme my-theme
|
|
14
|
+
npx create-bl-theme@latest my-theme
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
@@ -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
|
|
47
|
-
├── style.css
|
|
48
|
-
├──
|
|
49
|
-
├──
|
|
50
|
-
|
|
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: 
|
|
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
|
+
<!--  -->
|
|
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,19 +254,24 @@ 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(
|
|
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(
|
|
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")}`
|
|
217
271
|
);
|
|
218
272
|
console.log();
|
|
219
273
|
console.log(
|
|
220
|
-
pc.dim(" Validate your theme with: ") + pc.cyan(`npx create-bl-theme validate ${dir}`)
|
|
274
|
+
pc.dim(" Validate your theme with: ") + pc.cyan(`npx create-bl-theme@latest validate ${dir}`)
|
|
221
275
|
);
|
|
222
276
|
console.log();
|
|
223
277
|
}
|
|
@@ -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
package/templates/style.css
CHANGED
|
@@ -1,51 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Better Lyrics Theme
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Tip: Use the browser DevTools to inspect Better Lyrics elements
|
|
8
|
-
* and find the selectors you want to style.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/* Main lyrics container */
|
|
12
|
-
.blyrics-container {
|
|
13
|
-
/* Add your container styles here */
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/* Individual lyric lines */
|
|
17
|
-
.blyrics-line {
|
|
18
|
-
/* Style for each line of lyrics */
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/* Currently active/highlighted lyric */
|
|
22
|
-
.blyrics-line.active {
|
|
23
|
-
/* Make the current line stand out */
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/* Lyrics text styling */
|
|
27
|
-
.blyrics-text {
|
|
28
|
-
/* Font, color, and text styles */
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/*
|
|
32
|
-
* Example: Dark theme starter
|
|
33
|
-
* Uncomment and modify as needed
|
|
4
|
+
* For available selectors and styling guide, see:
|
|
5
|
+
* https://github.com/better-lyrics/better-lyrics/blob/master/STYLING.md
|
|
34
6
|
*/
|
|
35
|
-
|
|
36
|
-
/*
|
|
37
|
-
.blyrics-container {
|
|
38
|
-
background: rgba(0, 0, 0, 0.8);
|
|
39
|
-
backdrop-filter: blur(10px);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.blyrics-line {
|
|
43
|
-
color: rgba(255, 255, 255, 0.6);
|
|
44
|
-
transition: all 0.3s ease;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.blyrics-line.active {
|
|
48
|
-
color: #ffffff;
|
|
49
|
-
transform: scale(1.05);
|
|
50
|
-
}
|
|
51
|
-
*/
|