Skip to content

Commit f63f768

Browse files
committed
fix: tests to use new config
1 parent 8f7eafb commit f63f768

File tree

1 file changed

+2
-44
lines changed

1 file changed

+2
-44
lines changed

e2e/uno.config.ts

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,5 @@
1-
import fs from 'node:fs/promises';
2-
import { basename, dirname, join } from 'node:path';
3-
import { globSync, convertPathToPattern } from 'fast-glob';
4-
import { defineConfig, presetIcons, presetUno, transformerDirectives } from 'unocss';
5-
import { rules, shortcuts, theme } from '@tutorialkit/theme';
6-
7-
const iconPaths = globSync('./icons/languages/*.svg');
8-
9-
const customIconCollection = iconPaths.reduce(
10-
(acc, iconPath) => {
11-
const collectionName = basename(dirname(iconPath));
12-
const [iconName] = basename(iconPath).split('.');
13-
14-
acc[collectionName] ??= {};
15-
acc[collectionName][iconName] = async () => fs.readFile(iconPath, 'utf8');
16-
17-
return acc;
18-
},
19-
{} as Record<string, Record<string, () => Promise<string>>>,
20-
);
1+
import { defineConfig } from '@tutorialkit/theme';
212

223
export default defineConfig({
23-
rules,
24-
shortcuts,
25-
theme,
26-
content: {
27-
inline: globSync([
28-
`${convertPathToPattern(join(require.resolve('@tutorialkit/components-react'), '..')).replace('\\@', '/@')}/**/*.js`,
29-
`${convertPathToPattern(join(require.resolve('@tutorialkit/astro'), '..')).replace('\\@', '/@')}/default/**/*.astro`,
30-
]).map((filePath) => {
31-
return () => fs.readFile(filePath, { encoding: 'utf8' });
32-
}),
33-
},
34-
transformers: [transformerDirectives()],
35-
presets: [
36-
presetUno({
37-
dark: {
38-
dark: '[data-theme="dark"]',
39-
},
40-
}),
41-
presetIcons({
42-
collections: {
43-
...customIconCollection,
44-
},
45-
}),
46-
],
4+
// add your UnoCSS config here: https://unocss.dev/guide/config-file
475
});

0 commit comments

Comments
 (0)