Skip to content

Commit 4c92d0b

Browse files
authored
Add Zed editor theme template
1 parent eb20312 commit 4c92d0b

3 files changed

Lines changed: 593 additions & 0 deletions

File tree

cli/src/template/all.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import wallpaperShirts from './wallpaper-shirts.js';
3636
import wallpaperTriangles from './wallpaper-triangles.js';
3737
import warp from './warp.js';
3838
import windowsTerminal from './windows-terminal.js';
39+
import zed from './zed.js';
3940
import wox from './wox.js';
4041
import xcode from './xcode.js';
4142
import xresources from './xresources.js';
@@ -81,6 +82,7 @@ const BUILT_IN_TEMPLATE_IDENTIFIERS = [
8182
'wox',
8283
'xcode',
8384
'xresources',
85+
'zed',
8486
] as const;
8587

8688
export type BuiltInTemplate = (typeof BUILT_IN_TEMPLATE_IDENTIFIERS)[number];
@@ -172,6 +174,8 @@ export function resolveTemplate(
172174
return xcode;
173175
case 'xresources':
174176
return xresources;
177+
case 'zed':
178+
return zed;
175179
default:
176180
return template;
177181
}

cli/src/template/zed.spec.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import test from 'ava';
2+
import themer from '../index.js';
3+
4+
test('zed', async (t) => {
5+
const files = [];
6+
for await (const file of themer(['default'], ['zed'], {
7+
wallpaperSizes: [],
8+
})) {
9+
files.push(file);
10+
}
11+
t.is(files.length, 2, 'produces a theme file and a README');
12+
const theme = files.find(({ path }) => path.endsWith('.json'));
13+
t.truthy(theme, 'produces a JSON theme file');
14+
const parsed = JSON.parse(theme?.content || '');
15+
t.is(parsed.name, 'Themer Default', 'theme family has correct name');
16+
t.is(parsed.author, 'Themer', 'theme has correct author');
17+
t.truthy(
18+
Array.isArray(parsed.themes) && parsed.themes.length > 0,
19+
'contains theme variants',
20+
);
21+
for (const variant of parsed.themes) {
22+
t.truthy(variant.name, 'variant has a name');
23+
t.regex(
24+
variant.appearance,
25+
/^(dark|light)$/,
26+
'variant has valid appearance',
27+
);
28+
t.truthy(variant.style, 'variant has style');
29+
t.truthy(variant.style.syntax, 'variant has syntax highlighting');
30+
t.truthy(
31+
Array.isArray(variant.style.players) && variant.style.players.length > 0,
32+
'variant has player colors',
33+
);
34+
}
35+
});

0 commit comments

Comments
 (0)