astro-icon
Advanced tools
Comparing version 1.0.0 to 1.0.1
import { readFile } from "node:fs/promises"; | ||
import { detectAgent } from "@skarab/detect-package-manager"; | ||
import { getIcons } from "@iconify/utils"; | ||
import { loadCollectionFromFS } from "@iconify/utils/lib/loader/fs"; | ||
import { fileURLToPath } from "node:url"; | ||
import { promisify } from "node:util"; | ||
@@ -49,27 +47,9 @@ import { exec } from "node:child_process"; | ||
try { | ||
const agent = await detectAgent(fileURLToPath(root)); | ||
let packages = []; | ||
if (!agent) { | ||
const text = await readFile(new URL("./package.json", root), { | ||
encoding: "utf8", | ||
}); | ||
const { dependencies = {}, devDependencies = {} } = JSON.parse(text); | ||
packages.push(...Object.keys(dependencies)); | ||
packages.push(...Object.keys(devDependencies)); | ||
} | ||
else { | ||
const { stdout: text } = await execa(`${agent.name} list --json`); | ||
const data = JSON.parse(text); | ||
if (Array.isArray(data)) { | ||
for (const { dependencies = {}, devDependencies = {} } of data) { | ||
packages.push(...Object.keys(dependencies)); | ||
packages.push(...Object.keys(devDependencies)); | ||
} | ||
} | ||
else { | ||
const { dependencies = {}, devDependencies = {} } = data; | ||
packages.push(...Object.keys(dependencies)); | ||
packages.push(...Object.keys(devDependencies)); | ||
} | ||
} | ||
const text = await readFile(new URL("./package.json", root), { | ||
encoding: "utf8", | ||
}); | ||
const { dependencies = {}, devDependencies = {} } = JSON.parse(text); | ||
packages.push(...Object.keys(dependencies)); | ||
packages.push(...Object.keys(devDependencies)); | ||
const collections = packages | ||
@@ -76,0 +56,0 @@ .filter((name) => name.startsWith("@iconify-json/")) |
{ | ||
"name": "astro-icon", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"type": "module", | ||
@@ -47,4 +47,3 @@ "types": "./dist/index.d.ts", | ||
"@iconify/types": "^2.0.0", | ||
"@iconify/utils": "^2.1.5", | ||
"@skarab/detect-package-manager": "^1.0.0" | ||
"@iconify/utils": "^2.1.5" | ||
}, | ||
@@ -51,0 +50,0 @@ "devDependencies": { |
@@ -233,3 +233,3 @@ # Astro Icon | ||
`astro-icon` v1 contains a number of breaking changes. Please reference the [**Migrate to `astro-icon` v1** guide](https://github.com/natemoo-re/astro-icon/tree/main/docs/migrate-to-v1.md) to update from older versions of `astro-icon`. | ||
`astro-icon` v1 contains a number of breaking changes. Please reference the [**Migrate to `astro-icon` v1** guide](https://www.astroicon.dev/guides/upgrade/v1/) to update from older versions of `astro-icon`. | ||
@@ -236,0 +236,0 @@ ## Contributing |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3
25924
301
- Removed@skarab/detect-package-manager@1.0.0(transitive)