astro-icon
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -7,2 +7,5 @@ import { cleanupSVG, importDirectory, isEmptyColor, parseColors, runSVGO, } from "@iconify/tools"; | ||
keepTitles: true, | ||
includeSubDirs: true, | ||
ignoreImportErrors: "warn", | ||
keyword: (file) => file.subdir + file.file, | ||
}); | ||
@@ -9,0 +12,0 @@ // Validate, clean up, fix palette and optimize |
@@ -21,3 +21,2 @@ import { mkdir, readFile, writeFile } from "node:fs/promises"; | ||
collections = await loadIconifyCollections({ root, include }); | ||
logCollections(collections, ctx); | ||
} | ||
@@ -32,2 +31,3 @@ try { | ||
} | ||
logCollections(collections, { ...ctx, iconDir }); | ||
await generateIconTypeDefinitions(Object.values(collections), root); | ||
@@ -39,3 +39,3 @@ return `export default ${JSON.stringify(collections)};\nexport const config = ${JSON.stringify({ include })}`; | ||
} | ||
function logCollections(collections, { logger }) { | ||
function logCollections(collections, { logger, iconDir }) { | ||
if (Object.keys(collections).length === 0) { | ||
@@ -45,3 +45,6 @@ logger.warn("No icons detected!"); | ||
} | ||
const names = Object.keys(collections); | ||
const names = Object.keys(collections).filter((v) => v !== "local"); | ||
if (collections["local"]) { | ||
names.unshift(iconDir); | ||
} | ||
logger.info(`Loaded icons from ${names.join(", ")}`); | ||
@@ -48,0 +51,0 @@ } |
{ | ||
"name": "astro-icon", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts", |
26162
307