grg-kit-cli 0.6.14 ā 0.6.15
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 +8 -0
- package/commands/add.js +7 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -151,6 +151,14 @@ Examples:
|
|
|
151
151
|
| `shell` | `sidebar`, `sidebar-footer`, `topnav`, `topnav-footer`, `collapsible`, `collapsible-footer` |
|
|
152
152
|
| `settings` | `profile`, `security`, `notification`, `danger-zone` |
|
|
153
153
|
|
|
154
|
+
**Search tags** (for MCP server discoverability):
|
|
155
|
+
|
|
156
|
+
| Block | Search Terms |
|
|
157
|
+
|-------|--------------|
|
|
158
|
+
| `auth` | signin, sign-in, signup, register, password, credentials, onboarding |
|
|
159
|
+
| `shell` | dashboard, admin, navbar, menu, left-nav, top-bar, wrapper |
|
|
160
|
+
| `settings` | user-settings, my-account, configuration, notifications, privacy |
|
|
161
|
+
|
|
154
162
|
### `grg list [category]`
|
|
155
163
|
|
|
156
164
|
List available blocks and themes.
|
package/commands/add.js
CHANGED
|
@@ -200,11 +200,6 @@ function showUsage(RESOURCES) {
|
|
|
200
200
|
* grg add component --all # All components
|
|
201
201
|
*/
|
|
202
202
|
async function addComponent(componentName, options) {
|
|
203
|
-
// Fetch catalog dynamically (with caching)
|
|
204
|
-
const spinner = ora('Fetching catalog...').start();
|
|
205
|
-
const RESOURCES = await fetchCatalog({ silent: true });
|
|
206
|
-
spinner.stop();
|
|
207
|
-
|
|
208
203
|
// Handle --all flag (download all components)
|
|
209
204
|
if (options.all) {
|
|
210
205
|
console.log(chalk.bold.cyan(`\nš¦ Adding all components\n`));
|
|
@@ -296,11 +291,6 @@ function showComponentUsage(RESOURCES) {
|
|
|
296
291
|
* grg add theme modern-minimal # Download and set modern-minimal theme
|
|
297
292
|
*/
|
|
298
293
|
async function addTheme(themeName, options) {
|
|
299
|
-
// Fetch catalog dynamically (with caching)
|
|
300
|
-
const spinner = ora('Fetching catalog...').start();
|
|
301
|
-
const RESOURCES = await fetchCatalog({ silent: true });
|
|
302
|
-
spinner.stop();
|
|
303
|
-
|
|
304
294
|
// Validate theme name
|
|
305
295
|
if (!themeName) {
|
|
306
296
|
showThemeUsage(RESOURCES);
|
|
@@ -360,10 +350,12 @@ async function downloadTheme(theme, customOutput) {
|
|
|
360
350
|
stylesContent = '';
|
|
361
351
|
}
|
|
362
352
|
|
|
363
|
-
|
|
353
|
+
// Use relative path from src/ to the theme file
|
|
354
|
+
const relativeThemePath = path.relative('src', outputPath).replace(/\\/g, '/');
|
|
355
|
+
const themeImport = `@import './${relativeThemePath}';`;
|
|
364
356
|
|
|
365
|
-
// Check if any theme is already imported
|
|
366
|
-
const themeImportRegex = /@import\s+['"]
|
|
357
|
+
// Check if any theme is already imported (match any .css file import from relative paths)
|
|
358
|
+
const themeImportRegex = /@import\s+['"]\.\/.+\.css['"];?\n?/g;
|
|
367
359
|
const existingThemeImports = stylesContent.match(themeImportRegex);
|
|
368
360
|
|
|
369
361
|
if (existingThemeImports && existingThemeImports.length > 0) {
|
|
@@ -400,7 +392,8 @@ async function downloadTheme(theme, customOutput) {
|
|
|
400
392
|
} catch (error) {
|
|
401
393
|
downloadSpinner.warn(chalk.yellow('Could not update src/styles.css automatically'));
|
|
402
394
|
console.log(chalk.gray('\nPlease add the following to your src/styles.css:'));
|
|
403
|
-
|
|
395
|
+
const relativeThemePath = path.relative('src', outputPath).replace(/\\/g, '/');
|
|
396
|
+
console.log(chalk.cyan(` @import './${relativeThemePath}';`));
|
|
404
397
|
}
|
|
405
398
|
|
|
406
399
|
console.log();
|