@memobit/icons 1.1.1 → 1.2.0
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/dist/vite.js +21 -1
- package/package.json +1 -1
package/dist/vite.js
CHANGED
|
@@ -19,6 +19,7 @@ var SKIP_DIRECTORIES = /* @__PURE__ */ new Set([
|
|
|
19
19
|
"coverage"
|
|
20
20
|
]);
|
|
21
21
|
var MAP_SPECIFIER = "@memobit/icons/map";
|
|
22
|
+
var USAGE_MANIFEST = "memobit-icons.json";
|
|
22
23
|
var VIRTUAL_ID = "\0virtual:memobit-icon-map";
|
|
23
24
|
var QUOTED_STRING = /['"`]([a-z][a-z0-9-]*)['"`]/g;
|
|
24
25
|
var collectSourceFiles = (directory, found) => {
|
|
@@ -44,9 +45,28 @@ var resolvePackageDist = (root, packageName) => {
|
|
|
44
45
|
const conventional = join(root, "node_modules", packageName, "dist");
|
|
45
46
|
return existsSync(conventional) ? conventional : null;
|
|
46
47
|
};
|
|
48
|
+
var readUsageManifest = (distDir) => {
|
|
49
|
+
try {
|
|
50
|
+
const parsed = JSON.parse(readFileSync(join(distDir, USAGE_MANIFEST), "utf8"));
|
|
51
|
+
if (typeof parsed !== "object" || parsed === null || !("icons" in parsed) || !Array.isArray(parsed.icons)) return null;
|
|
52
|
+
return parsed.icons.filter((name) => typeof name === "string" && name in iconModules);
|
|
53
|
+
} catch {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
47
57
|
var scanForIconNames = (root, scanDirs, scanPackages) => {
|
|
48
58
|
const names = /* @__PURE__ */ new Set();
|
|
49
|
-
const directories =
|
|
59
|
+
const directories = scanDirs.map((dir) => resolve(root, dir));
|
|
60
|
+
for (const packageName of scanPackages) {
|
|
61
|
+
const distDir = resolvePackageDist(root, packageName);
|
|
62
|
+
if (distDir === null) continue;
|
|
63
|
+
const declared = readUsageManifest(distDir);
|
|
64
|
+
if (declared === null) {
|
|
65
|
+
directories.push(distDir);
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
for (const name of declared) names.add(name);
|
|
69
|
+
}
|
|
50
70
|
for (const directory of directories) for (const file of collectSourceFiles(directory, [])) {
|
|
51
71
|
let contents;
|
|
52
72
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memobit/icons",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "495 hand-built SVG icons for the Memobit apps — individually exported and tree-shakeable, with categories and search aliases. TypeScript-first, ESM-only, React 19.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|