(dir: string, prefix: string, icon: string)
| 6 | |
| 7 | // Install a fake `@iconify-json/<prefix>` collection into `<dir>/node_modules` |
| 8 | function installCollection(dir: string, prefix: string, icon: string) { |
| 9 | const collectionDir = join(dir, 'node_modules', '@iconify-json', prefix) |
| 10 | mkdirSync(collectionDir, { recursive: true }) |
| 11 | writeFileSync(join(collectionDir, 'package.json'), JSON.stringify({ |
| 12 | name: `@iconify-json/${prefix}`, |
| 13 | version: '0.0.0', |
| 14 | main: 'index.js', |
| 15 | exports: { |
| 16 | './*': './*', |
| 17 | './icons.json': './icons.json', |
| 18 | }, |
| 19 | })) |
| 20 | writeFileSync(join(collectionDir, 'icons.json'), JSON.stringify({ |
| 21 | prefix, |
| 22 | icons: { |
| 23 | [icon]: { body: '<path d="M0 0h24v24H0z"/>' }, |
| 24 | }, |
| 25 | width: 24, |
| 26 | height: 24, |
| 27 | })) |
| 28 | } |
| 29 | |
| 30 | function createContext(rootDir: string, workspaceDir: string, icons: string[], hookIcons: string[] = []) { |
| 31 | const nuxt = { |
no outgoing calls
no test coverage detected
searching dependent graphs…