Comparing version 0.4.14 to 0.4.15
# CHANGELOG | ||
## 🚀 v0.4.15 | ||
- ✨ Add components-template option (#22) | ||
- | ||
## 🚀 v0.4.14 | ||
@@ -4,0 +9,0 @@ |
@@ -33,2 +33,3 @@ var __create = Object.create; | ||
let namedComponents = false; | ||
let componentsTemplate = null; | ||
let component = "icon.tsx"; | ||
@@ -59,2 +60,5 @@ let sprite = "icon.svg"; | ||
namedComponents = true; | ||
} else if (args[i].startsWith("--components-template=")) { | ||
const templateFilename = args[i].substring("--components-template=".length); | ||
componentsTemplate = fs.readFileSync(templateFilename, "utf8"); | ||
} | ||
@@ -198,5 +202,6 @@ } | ||
icons.forEach((icon) => { | ||
var _a; | ||
const componentName = icon.replace(/(^|-|_)([a-z0-9])/g, (g) => g.at(-1).toUpperCase()); | ||
output += ` | ||
export const ${componentName}Icon = (props: SVGProps<SVGSVGElement>) => <Icon icon="${icon}" {...props} />;`; | ||
output += "\n"; | ||
output += (_a = componentsTemplate == null ? void 0 : componentsTemplate.replace(/{{icon}}/g, icon).replace(/{{componentName}}/g, componentName)) != null ? _a : `export const ${componentName}Icon = (props: SVGProps<SVGSVGElement>) => <Icon icon="${icon}" {...props} />;`; | ||
}); | ||
@@ -203,0 +208,0 @@ } |
{ | ||
"name": "rmx-cli", | ||
"version": "0.4.14", | ||
"version": "0.4.15", | ||
"description": "A CLI for remix-run", | ||
@@ -5,0 +5,0 @@ "author": "Michael J. Carter <kiliman@gmail.com> (https://kiliman.dev/)", |
# rmx-cli | ||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors-) | ||
<!-- ALL-CONTRIBUTORS-BADGE:END --> | ||
@@ -76,2 +78,3 @@ | ||
npx rmx-cli svg-sprite SOURCE_FOLDER OUTPUT_PATH [--components] [--template=TEMPLATE_FILE] | ||
[--components-template=TEMPLATE_FILE] | ||
``` | ||
@@ -78,0 +81,0 @@ |
43423
733
255