mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-12 13:38:32 +00:00
* Deprecates tags.json and icons.json * Removed tags.json dependency from Figma plugin * Add JSON descriptor information to readme * Restore packages/index.tsx * Update packages/lucide-figma/src/api/fetchIcons.ts Add multiple fetches to `Promise.all` * Added caching to API endpoints * Updates pnpm-lock.yaml * Add tags to static * Trigger site build * Added prebuild script to generate api caches at build time * Migrated NextCache function from arrow to regular to simplify markup * test if contents are read from cache * Add cache clear to prebuild * removes debug object --------- Co-authored-by: Karsa <karsa@karsa.org> Co-authored-by: Eric Fennis <eric.fennis@gmail.com>
18 lines
452 B
TypeScript
18 lines
452 B
TypeScript
import {fetchTags} from "../src/lib/fetchTags";
|
|
import {fetchIconNodes} from "../src/lib/fetchIconNodes";
|
|
import NextCache from "../src/lib/nextCache";
|
|
|
|
const clearCache = async () => {
|
|
await NextCache.clear('api-tags', 'api-icon-nodes')
|
|
}
|
|
|
|
const buildCache = async () => {
|
|
await Promise.all([fetchTags(), fetchIconNodes()])
|
|
}
|
|
|
|
const rebuildCache = async () => {
|
|
await Promise.all([clearCache(), buildCache()])
|
|
}
|
|
|
|
rebuildCache().then(() => null)
|