Skip to content

Commit 400b653

Browse files
committed
feat: polish file-tree sprite generation
1 parent 63be697 commit 400b653

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

app/utils/file-icons.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/**
22
* Get icon class for a file based on its name/extension.
33
* Uses vscode-icons and carbon icons.
4+
*
5+
* Based on this file, a sprite file (<ORIGIN_URL>/file-tree-sprite.svg) is generated on postinstall
6+
* @see /scripts/generate-file-tree-sprite.ts
47
*/
58

69
// Extension to icon mapping

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"generate-pwa-icons": "pwa-assets-generator",
3131
"preview": "nuxt preview",
3232
"postinstall": "pnpm rebuild @resvg/resvg-js && pnpm generate:lexicons && pnpm generate:sprite && nuxt prepare && simple-git-hooks",
33-
"generate:sprite": "node generate-file-tree-sprite.ts",
33+
"generate:sprite": "node scripts/generate-file-tree-sprite.ts",
3434
"generate:fixtures": "node scripts/generate-fixtures.ts",
3535
"generate:lexicons": "lex build --lexicons lexicons --out shared/types/lexicons --clear",
3636
"test": "vite test",
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { promises as fs } from 'node:fs'
2-
import path from 'node:path'
31
import type { IconifyJSON } from '@iconify-json/carbon'
2+
import { promises as fs } from 'node:fs'
43
import { fileURLToPath } from 'node:url'
4+
import path from 'node:path'
55
import {
66
ADDITIONAL_ICONS,
77
EXTENSION_ICONS,
88
FILENAME_ICONS,
99
COMPOUND_EXTENSIONS,
1010
DEFAULT_ICON,
11-
} from './app/utils/file-icons.ts'
11+
} from '../app/utils/file-icons.ts'
1212

1313
const rootDir = process.cwd()
1414
const outputDevPath = path.join(rootDir, 'public', 'file-tree-sprite.svg')

0 commit comments

Comments
 (0)