ctheme 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DEVELOPMENT.md +17 -0
- package/README.md +7 -0
- package/bin/ctheme.js +16 -16
- package/package.json +5 -3
- package/scripts/postinstall.js +57 -0
package/DEVELOPMENT.md
CHANGED
|
@@ -55,6 +55,7 @@ Relevant env vars:
|
|
|
55
55
|
CTHEME_HOME
|
|
56
56
|
CTHEME_THEME_DIR
|
|
57
57
|
CTHEME_SNIPPET_DIR
|
|
58
|
+
CTHEME_SKIP_FONT_BOOTSTRAP
|
|
58
59
|
```
|
|
59
60
|
|
|
60
61
|
## Command Map
|
|
@@ -145,6 +146,22 @@ Google Fonts install flow:
|
|
|
145
146
|
|
|
146
147
|
Do not bundle font files in the repo.
|
|
147
148
|
|
|
149
|
+
### 6. Install Bootstrap
|
|
150
|
+
|
|
151
|
+
`npm install -g ctheme` runs `scripts/postinstall.js`.
|
|
152
|
+
|
|
153
|
+
That script:
|
|
154
|
+
|
|
155
|
+
- runs on macOS only
|
|
156
|
+
- best-effort installs the curated default font pack
|
|
157
|
+
- never hard-fails the package install because of a font download problem
|
|
158
|
+
|
|
159
|
+
Skip it with:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
CTHEME_SKIP_FONT_BOOTSTRAP=1 npm install -g ctheme
|
|
163
|
+
```
|
|
164
|
+
|
|
148
165
|
## Local Development
|
|
149
166
|
|
|
150
167
|
Install the CLI locally:
|
package/README.md
CHANGED
|
@@ -18,6 +18,12 @@ From npm:
|
|
|
18
18
|
npm install -g ctheme
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
On macOS, install also preloads the curated default font pack used by the bundled themes. If you want to skip that during install:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
CTHEME_SKIP_FONT_BOOTSTRAP=1 npm install -g ctheme
|
|
25
|
+
```
|
|
26
|
+
|
|
21
27
|
From GitHub:
|
|
22
28
|
|
|
23
29
|
```bash
|
|
@@ -150,6 +156,7 @@ solarized, solarized-dark, velvet
|
|
|
150
156
|
```
|
|
151
157
|
|
|
152
158
|
Bundled themes intentionally vary their font pairings so they do not all feel the same.
|
|
159
|
+
The npm install bootstrap preinstalls the curated font set those presets rely on, so the bundled themes render correctly immediately on macOS.
|
|
153
160
|
|
|
154
161
|
## Contributing
|
|
155
162
|
|
package/bin/ctheme.js
CHANGED
|
@@ -94,9 +94,9 @@ const BUILTIN_THEMES = [
|
|
|
94
94
|
];
|
|
95
95
|
|
|
96
96
|
const FONT_CHOICES = {
|
|
97
|
-
ui: ["Manrope", "Space Grotesk", "Outfit", "Sora", "Plus Jakarta Sans", "Newsreader", "Fraunces"],
|
|
98
|
-
code: ["IBM Plex Mono", "Space Mono", "DM Mono", "Source Code Pro", "Fira Code", "JetBrains Mono"],
|
|
99
|
-
terminal: ["IBM Plex Mono", "Space Mono", "DM Mono", "Source Code Pro", "Fira Code", "JetBrains Mono"]
|
|
97
|
+
ui: ["Manrope", "Space Grotesk", "Outfit", "Sora", "Plus Jakarta Sans", "Newsreader", "Fraunces", "Bricolage Grotesque", "Urbanist", "Source Sans 3", "IBM Plex Sans", "Instrument Serif", "Syne"],
|
|
98
|
+
code: ["IBM Plex Mono", "Space Mono", "DM Mono", "Source Code Pro", "Fira Code", "JetBrains Mono", "Roboto Mono", "Azeret Mono", "Victor Mono", "Ubuntu Mono"],
|
|
99
|
+
terminal: ["IBM Plex Mono", "Space Mono", "DM Mono", "Source Code Pro", "Fira Code", "JetBrains Mono", "Roboto Mono", "Azeret Mono", "Victor Mono", "Ubuntu Mono"]
|
|
100
100
|
};
|
|
101
101
|
|
|
102
102
|
const PRESETS = {
|
|
@@ -117,7 +117,7 @@ const PRESETS = {
|
|
|
117
117
|
cyan: "#39c5cf"
|
|
118
118
|
},
|
|
119
119
|
paper: {
|
|
120
|
-
fonts: { terminal: "
|
|
120
|
+
fonts: { terminal: "Source Code Pro", ui: "Newsreader", code: "Source Code Pro" },
|
|
121
121
|
accent: "#005cc5",
|
|
122
122
|
bg: "#fff8e8",
|
|
123
123
|
surface: "#fffdf7",
|
|
@@ -149,7 +149,7 @@ const PRESETS = {
|
|
|
149
149
|
cyan: "#7dcfff"
|
|
150
150
|
},
|
|
151
151
|
mint: {
|
|
152
|
-
fonts: { terminal: "
|
|
152
|
+
fonts: { terminal: "Roboto Mono", ui: "Plus Jakarta Sans", code: "Roboto Mono" },
|
|
153
153
|
accent: "#2bb673",
|
|
154
154
|
bg: "#081411",
|
|
155
155
|
surface: "#10201b",
|
|
@@ -165,7 +165,7 @@ const PRESETS = {
|
|
|
165
165
|
cyan: "#5ad1e6"
|
|
166
166
|
},
|
|
167
167
|
obsidian: {
|
|
168
|
-
fonts: { terminal: "
|
|
168
|
+
fonts: { terminal: "Azeret Mono", ui: "Outfit", code: "Azeret Mono" },
|
|
169
169
|
accent: "#58a6ff",
|
|
170
170
|
bg: "#05070a",
|
|
171
171
|
surface: "#0e131a",
|
|
@@ -181,7 +181,7 @@ const PRESETS = {
|
|
|
181
181
|
cyan: "#7dd3fc"
|
|
182
182
|
},
|
|
183
183
|
glacier: {
|
|
184
|
-
fonts: { terminal: "Space Mono", ui: "
|
|
184
|
+
fonts: { terminal: "Space Mono", ui: "Urbanist", code: "Space Mono" },
|
|
185
185
|
accent: "#7aa2f7",
|
|
186
186
|
bg: "#0a1220",
|
|
187
187
|
surface: "#121c2f",
|
|
@@ -197,7 +197,7 @@ const PRESETS = {
|
|
|
197
197
|
cyan: "#7dcfff"
|
|
198
198
|
},
|
|
199
199
|
cobalt: {
|
|
200
|
-
fonts: { terminal: "
|
|
200
|
+
fonts: { terminal: "Victor Mono", ui: "Bricolage Grotesque", code: "Victor Mono" },
|
|
201
201
|
accent: "#4da3ff",
|
|
202
202
|
bg: "#09111f",
|
|
203
203
|
surface: "#10203a",
|
|
@@ -229,7 +229,7 @@ const PRESETS = {
|
|
|
229
229
|
cyan: "#8bd3dd"
|
|
230
230
|
},
|
|
231
231
|
lotus: {
|
|
232
|
-
fonts: { terminal: "
|
|
232
|
+
fonts: { terminal: "Ubuntu Mono", ui: "Instrument Serif", code: "Ubuntu Mono" },
|
|
233
233
|
accent: "#d16d9e",
|
|
234
234
|
bg: "#fff7f3",
|
|
235
235
|
surface: "#fffdfb",
|
|
@@ -245,7 +245,7 @@ const PRESETS = {
|
|
|
245
245
|
cyan: "#4d8ca1"
|
|
246
246
|
},
|
|
247
247
|
dune: {
|
|
248
|
-
fonts: { terminal: "
|
|
248
|
+
fonts: { terminal: "Fira Code", ui: "Syne", code: "Fira Code" },
|
|
249
249
|
accent: "#d97706",
|
|
250
250
|
bg: "#16110c",
|
|
251
251
|
surface: "#231912",
|
|
@@ -261,7 +261,7 @@ const PRESETS = {
|
|
|
261
261
|
cyan: "#67e8f9"
|
|
262
262
|
},
|
|
263
263
|
forest: {
|
|
264
|
-
fonts: { terminal: "IBM Plex Mono", ui: "
|
|
264
|
+
fonts: { terminal: "IBM Plex Mono", ui: "IBM Plex Sans", code: "IBM Plex Mono" },
|
|
265
265
|
accent: "#7ccf7a",
|
|
266
266
|
bg: "#08100b",
|
|
267
267
|
surface: "#112016",
|
|
@@ -277,7 +277,7 @@ const PRESETS = {
|
|
|
277
277
|
cyan: "#6ee7b7"
|
|
278
278
|
},
|
|
279
279
|
aurora: {
|
|
280
|
-
fonts: { terminal: "Space Mono", ui: "
|
|
280
|
+
fonts: { terminal: "Space Mono", ui: "Urbanist", code: "Space Mono" },
|
|
281
281
|
accent: "#7c5cff",
|
|
282
282
|
bg: "#0f0a1f",
|
|
283
283
|
surface: "#181131",
|
|
@@ -293,7 +293,7 @@ const PRESETS = {
|
|
|
293
293
|
cyan: "#7bdff2"
|
|
294
294
|
},
|
|
295
295
|
espresso: {
|
|
296
|
-
fonts: { terminal: "
|
|
296
|
+
fonts: { terminal: "Victor Mono", ui: "Instrument Serif", code: "Victor Mono" },
|
|
297
297
|
accent: "#c67c4e",
|
|
298
298
|
bg: "#120d0b",
|
|
299
299
|
surface: "#1d1512",
|
|
@@ -325,7 +325,7 @@ const PRESETS = {
|
|
|
325
325
|
cyan: "#bde0fe"
|
|
326
326
|
},
|
|
327
327
|
neon: {
|
|
328
|
-
fonts: { terminal: "
|
|
328
|
+
fonts: { terminal: "Azeret Mono", ui: "Bricolage Grotesque", code: "Azeret Mono" },
|
|
329
329
|
accent: "#00f5d4",
|
|
330
330
|
bg: "#090414",
|
|
331
331
|
surface: "#130a24",
|
|
@@ -341,7 +341,7 @@ const PRESETS = {
|
|
|
341
341
|
cyan: "#00bbf9"
|
|
342
342
|
},
|
|
343
343
|
harbor: {
|
|
344
|
-
fonts: { terminal: "
|
|
344
|
+
fonts: { terminal: "Roboto Mono", ui: "Plus Jakarta Sans", code: "Roboto Mono" },
|
|
345
345
|
accent: "#3ba4c9",
|
|
346
346
|
bg: "#f4f8fb",
|
|
347
347
|
surface: "#ffffff",
|
|
@@ -389,7 +389,7 @@ const PRESETS = {
|
|
|
389
389
|
cyan: "#2aa198"
|
|
390
390
|
},
|
|
391
391
|
velvet: {
|
|
392
|
-
fonts: { terminal: "
|
|
392
|
+
fonts: { terminal: "Ubuntu Mono", ui: "Fraunces", code: "Ubuntu Mono" },
|
|
393
393
|
accent: "#d4a5ff",
|
|
394
394
|
bg: "#140d18",
|
|
395
395
|
surface: "#211328",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ctheme",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Theme manager for making terminals look better with colors, fonts, and live profile switching",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -21,13 +21,15 @@
|
|
|
21
21
|
"files": [
|
|
22
22
|
"bin",
|
|
23
23
|
"DEVELOPMENT.md",
|
|
24
|
-
"README.md"
|
|
24
|
+
"README.md",
|
|
25
|
+
"scripts"
|
|
25
26
|
],
|
|
26
27
|
"bin": {
|
|
27
28
|
"ctheme": "bin/ctheme.js"
|
|
28
29
|
},
|
|
29
30
|
"scripts": {
|
|
30
|
-
"test": "node ./bin/ctheme.js --help"
|
|
31
|
+
"test": "node ./bin/ctheme.js --help",
|
|
32
|
+
"postinstall": "node ./scripts/postinstall.js"
|
|
31
33
|
},
|
|
32
34
|
"engines": {
|
|
33
35
|
"node": ">=18"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
const DEFAULT_FONTS = [
|
|
7
|
+
"Azeret Mono",
|
|
8
|
+
"Bricolage Grotesque",
|
|
9
|
+
"DM Mono",
|
|
10
|
+
"Fira Code",
|
|
11
|
+
"Fraunces",
|
|
12
|
+
"IBM Plex Mono",
|
|
13
|
+
"IBM Plex Sans",
|
|
14
|
+
"Instrument Serif",
|
|
15
|
+
"JetBrains Mono",
|
|
16
|
+
"Newsreader",
|
|
17
|
+
"Outfit",
|
|
18
|
+
"Plus Jakarta Sans",
|
|
19
|
+
"Roboto Mono",
|
|
20
|
+
"Sora",
|
|
21
|
+
"Source Code Pro",
|
|
22
|
+
"Source Sans 3",
|
|
23
|
+
"Space Grotesk",
|
|
24
|
+
"Space Mono",
|
|
25
|
+
"Syne",
|
|
26
|
+
"Ubuntu Mono",
|
|
27
|
+
"Urbanist",
|
|
28
|
+
"Victor Mono"
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
if (process.env.CTHEME_SKIP_FONT_BOOTSTRAP === "1") {
|
|
32
|
+
console.log("ctheme: skipping default font bootstrap");
|
|
33
|
+
process.exit(0);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (process.platform !== "darwin") {
|
|
37
|
+
console.log("ctheme: skipping default font bootstrap on non-macOS");
|
|
38
|
+
process.exit(0);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const cliPath = path.join(__dirname, "..", "bin", "ctheme.js");
|
|
42
|
+
console.log(`ctheme: installing bundled default fonts (${DEFAULT_FONTS.length})`);
|
|
43
|
+
|
|
44
|
+
for (const family of DEFAULT_FONTS) {
|
|
45
|
+
const result = spawnSync(process.execPath, [cliPath, "font", "install", family], {
|
|
46
|
+
stdio: "inherit",
|
|
47
|
+
env: {
|
|
48
|
+
...process.env,
|
|
49
|
+
CTHEME_SKIP_FONT_BOOTSTRAP: "1"
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
if (result.status !== 0) {
|
|
54
|
+
console.log(`ctheme: skipped ${family}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|