Skip to content

Commit 96760a4

Browse files
fullstackjamclaude
andcommitted
fix: remove shell from API responses, fix packages/casks overlap
- API no longer returns `shell` field (oh_my_zsh, theme, plugins) — shell config is part of dotfiles, not a separate concern - Fix packages array to only contain formulae, not casks. Previously casks appeared in both `packages` and `casks` arrays, causing the CLI diff to show false "missing" items. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b70ce06 commit 96760a4

File tree

2 files changed

+8
-26
lines changed

2 files changed

+8
-26
lines changed

src/routes/[username]/[slug]/config/+server.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export const GET: RequestHandler = async ({ platform, params, request }) => {
4141

4242
const tapsSet = new Set<string>();
4343
const snapshotCasks = new Set<string>();
44-
let shell: { oh_my_zsh: boolean; theme: string; plugins: string[] } | null = null;
4544
let macosPrefs: { domain: string; key: string; type: string; value: string; desc: string }[] | null = null;
4645

4746
if (config.snapshot) {
@@ -53,13 +52,6 @@ export const GET: RequestHandler = async ({ platform, params, request }) => {
5352
for (const cask of snapshot.packages?.casks || []) {
5453
snapshotCasks.add(cask);
5554
}
56-
if (snapshot.shell) {
57-
shell = {
58-
oh_my_zsh: snapshot.shell.oh_my_zsh ?? false,
59-
theme: snapshot.shell.theme ?? '',
60-
plugins: snapshot.shell.plugins ?? []
61-
};
62-
}
6355
if (Array.isArray(snapshot.macos_prefs) && snapshot.macos_prefs.length > 0) {
6456
const filtered = snapshot.macos_prefs.filter(
6557
(p: unknown): p is { domain: string; key: string; type: string; value: string; desc: string } =>
@@ -89,18 +81,18 @@ export const GET: RequestHandler = async ({ platform, params, request }) => {
8981

9082
for (const pkg of rawPackages) {
9183
if (typeof pkg === 'string') {
92-
packageNames.push(pkg);
9384
if (snapshotCasks.has(pkg)) {
9485
caskNames.push(pkg);
86+
} else {
87+
packageNames.push(pkg);
9588
}
9689
} else {
9790
if (pkg.type === 'npm') {
9891
npmNames.push(pkg.name);
92+
} else if (pkg.type === 'cask') {
93+
caskNames.push(pkg.name);
9994
} else {
10095
packageNames.push(pkg.name);
101-
if (pkg.type === 'cask') {
102-
caskNames.push(pkg.name);
103-
}
10496
}
10597
}
10698
}
@@ -127,7 +119,6 @@ export const GET: RequestHandler = async ({ platform, params, request }) => {
127119
post_install: config.custom_script
128120
? config.custom_script.split('\n').map((s: string) => s.trim()).filter((s: string) => s.length > 0)
129121
: [],
130-
shell,
131122
macos_prefs: macosPrefs
132123
});
133124
};

src/routes/api/configs/alias/[alias]/+server.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export const GET: RequestHandler = async ({ platform, params }) => {
2727

2828
const tapsSet = new Set<string>();
2929
const snapshotCasks = new Set<string>();
30-
let shell: { oh_my_zsh: boolean; theme: string; plugins: string[] } | null = null;
3130
let macosPrefs: { domain: string; key: string; type: string; value: string; desc: string }[] | null = null;
3231

3332
if (config.snapshot) {
@@ -39,13 +38,6 @@ export const GET: RequestHandler = async ({ platform, params }) => {
3938
for (const cask of snapshot.packages?.casks || []) {
4039
snapshotCasks.add(cask);
4140
}
42-
if (snapshot.shell) {
43-
shell = {
44-
oh_my_zsh: snapshot.shell.oh_my_zsh ?? false,
45-
theme: snapshot.shell.theme ?? '',
46-
plugins: snapshot.shell.plugins ?? []
47-
};
48-
}
4941
if (Array.isArray(snapshot.macos_prefs) && snapshot.macos_prefs.length > 0) {
5042
const filtered = snapshot.macos_prefs.filter(
5143
(p: unknown): p is Record<string, unknown> =>
@@ -75,18 +67,18 @@ export const GET: RequestHandler = async ({ platform, params }) => {
7567

7668
for (const pkg of rawPackages) {
7769
if (typeof pkg === 'string') {
78-
packageNames.push(pkg);
7970
if (snapshotCasks.has(pkg)) {
8071
caskNames.push(pkg);
72+
} else {
73+
packageNames.push(pkg);
8174
}
8275
} else {
8376
if (pkg.type === 'npm') {
8477
npmNames.push(pkg.name);
78+
} else if (pkg.type === 'cask') {
79+
caskNames.push(pkg.name);
8580
} else {
8681
packageNames.push(pkg.name);
87-
if (pkg.type === 'cask') {
88-
caskNames.push(pkg.name);
89-
}
9082
}
9183
}
9284
}
@@ -113,7 +105,6 @@ export const GET: RequestHandler = async ({ platform, params }) => {
113105
post_install: config.custom_script
114106
? config.custom_script.split('\n').map((s: string) => s.trim()).filter((s: string) => s.length > 0)
115107
: [],
116-
shell,
117108
macos_prefs: macosPrefs
118109
});
119110
};

0 commit comments

Comments
 (0)