New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

astro-icon

Package Overview
Dependencies
Maintainers
0
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astro-icon - npm Package Compare versions

Comparing version 1.1.2 to 1.1.4

40

dist/vite-plugin-astro-icon.js

@@ -19,9 +19,10 @@ import { mkdir, readFile, writeFile } from "node:fs/promises";

if (id === resolvedVirtualModuleId) {
if (!collections) {
collections = await loadIconifyCollections({ root, include });
}
try {
// Attempt to create local collection
if (!collections) {
collections = await loadIconifyCollections({ root, include });
}
const local = await loadLocalCollection(iconDir, svgoOptions);
collections["local"] = local;
logCollections(collections, { ...ctx, iconDir });
await generateIconTypeDefinitions(Object.values(collections), root);
}

@@ -31,7 +32,25 @@ catch (ex) {

}
logCollections(collections, { ...ctx, iconDir });
await generateIconTypeDefinitions(Object.values(collections), root);
return `export default ${JSON.stringify(collections)};\nexport const config = ${JSON.stringify({ include })}`;
}
},
configureServer({ watcher, moduleGraph }) {
watcher.add(`${iconDir}/**/*.svg`);
watcher.on("change", async () => {
console.log(`Local icons changed, reloading`);
try {
if (!collections) {
collections = await loadIconifyCollections({ root, include });
}
const local = await loadLocalCollection(iconDir, svgoOptions);
collections["local"] = local;
logCollections(collections, { ...ctx, iconDir });
await generateIconTypeDefinitions(Object.values(collections), root);
moduleGraph.invalidateAll();
}
catch (ex) {
// Failed to load the local collection
}
return `export default ${JSON.stringify(collections)};\nexport const config = ${JSON.stringify({ include })}`;
});
},
};

@@ -64,3 +83,5 @@ }

? collections
.map((collection) => Object.keys(collection.icons).map((icon) => `\n\t\t| "${collection.prefix === defaultPack
.map((collection) => Object.keys(collection.icons)
.concat(Object.keys(collection.aliases ?? {}))
.map((icon) => `\n\t\t| "${collection.prefix === defaultPack
? ""

@@ -77,3 +98,6 @@ : `${collection.prefix}:`}${icon}"`))

hash.update(collection.prefix);
hash.update(Object.keys(collection.icons).sort().join(","));
hash.update(Object.keys(collection.icons)
.concat(Object.keys(collection.aliases ?? {}))
.sort()
.join(","));
}

@@ -80,0 +104,0 @@ return hash.digest("hex");

2

package.json
{
"name": "astro-icon",
"version": "1.1.2",
"version": "1.1.4",
"type": "module",

@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc