Skip to content

Commit 0c81c59

Browse files
ruibabyCopilot
andcommitted
Remove redundant --uri options from plugin and theme commands
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f539e09 commit 0c81c59

File tree

9 files changed

+24
-39
lines changed

9 files changed

+24
-39
lines changed

skills/halo-cli-operations/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Rules:
4545

4646
- `theme list` marks the active theme in table output.
4747
- Local theme install uses `--file`.
48-
- `theme install --url|--uri` and `theme upgrade --url|--uri` prompt for confirmation when the remote host is not `www.halo.run`; use `--yes` to bypass that prompt in automation or other non-interactive runs.
48+
- `theme install --url` and `theme upgrade --url` prompt for confirmation when the remote host is not `www.halo.run`; use `--yes` to bypass that prompt in automation or other non-interactive runs.
4949
- `upgrade --all` is for App Store-aware upgrades, not direct `--file` or `--url` sources.
5050

5151
## Plugins
@@ -65,7 +65,7 @@ halo plugin uninstall <name> --force
6565
Rules:
6666

6767
- Plugin upgrades can use App Store-aware logic.
68-
- `plugin install --url|--uri` and `plugin upgrade --url|--uri` prompt for confirmation when the remote host is not `www.halo.run`; use `--yes` to bypass that prompt in automation or other non-interactive runs.
68+
- `plugin install --url` and `plugin upgrade --url` prompt for confirmation when the remote host is not `www.halo.run`; use `--yes` to bypass that prompt in automation or other non-interactive runs.
6969
- Treat `disable`, `upgrade`, and `uninstall` as mutating operations.
7070

7171
## Attachments

src/commands/plugin/__test__/plugin-entry.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,13 @@ test("tryRunPluginCommand rejects unknown install flags during parsing", async (
609609
await expect(
610610
tryRunPluginCommand(["plugin", "install", "--online"], runtimeMock as never),
611611
).rejects.toThrow(/Unknown option `--online`/i);
612+
613+
await expect(
614+
tryRunPluginCommand(
615+
["plugin", "install", "--uri", "https://example.com/plugin.jar"],
616+
runtimeMock as never,
617+
),
618+
).rejects.toThrow(/Unknown option `--uri`/i);
612619
});
613620

614621
test("tryRunPluginCommand rejects invalid --all combinations", async () => {

src/commands/plugin/__test__/plugin.spec.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ test("resolvePluginInstallSource accepts urls", () => {
2020
});
2121
});
2222

23-
test("resolvePluginInstallSource accepts uri aliases", () => {
24-
expect(resolvePluginInstallSource({ uri: " https://example.com/plugin.jar " })).toEqual({
25-
url: "https://example.com/plugin.jar",
26-
file: undefined,
27-
});
28-
});
29-
3023
test("resolvePluginInstallSource accepts files", () => {
3124
expect(resolvePluginInstallSource({ file: " ./plugin.jar " })).toEqual({
3225
url: undefined,

src/commands/plugin/index.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ interface PluginCommandOptions {
3131
keyword?: string;
3232
enabled?: string;
3333
url?: string;
34-
uri?: string;
3534
file?: string;
3635
online?: boolean;
3736
all?: boolean;
@@ -89,9 +88,9 @@ export function resolvePluginUpgradeTarget(
8988
throw new CliError("`halo plugin upgrade --all` does not accept a plugin name.");
9089
}
9190

92-
if (options.url || options.uri || options.file) {
91+
if (options.url || options.file) {
9392
throw new CliError(
94-
"`halo plugin upgrade --all` only supports App Store upgrades. Do not combine it with --url, --uri, or --file.",
93+
"`halo plugin upgrade --all` only supports App Store upgrades. Do not combine it with --url or --file.",
9594
);
9695
}
9796

@@ -195,7 +194,7 @@ export function resolvePluginInstallSource(options: PluginCommandOptions): {
195194
url?: string;
196195
file?: string;
197196
} {
198-
const url = options.url?.trim() || options.uri?.trim();
197+
const url = options.url?.trim();
199198
const file = options.file?.trim();
200199

201200
if (!url && !file) {
@@ -669,7 +668,6 @@ function buildPluginCli(runtime: RuntimeContext): CAC {
669668
.option("--profile <name>", "Halo profile name")
670669
.option("--json", "Output JSON")
671670
.option("--url <url>", "Remote JAR URL")
672-
.option("--uri <uri>", "Remote JAR URI")
673671
.option("--file <path>", "Local JAR file path")
674672
.option("-y, --yes", "Skip third-party URL confirmation")
675673
.action(async (options: PluginCommandOptions) => {
@@ -714,7 +712,6 @@ function buildPluginCli(runtime: RuntimeContext): CAC {
714712
.option("--profile <name>", "Halo profile name")
715713
.option("--json", "Output JSON")
716714
.option("--url <url>", "Remote JAR URL")
717-
.option("--uri <uri>", "Remote JAR URI")
718715
.option("--file <path>", "Local JAR file path")
719716
.option("--online", "Upgrade from the Halo App Store")
720717
.option("--all", "Upgrade all compatible App Store plugins")
@@ -820,7 +817,6 @@ function buildPluginCli(runtime: RuntimeContext): CAC {
820817
pluginCli.example((bin) => `${bin} enable PluginName --force`);
821818
pluginCli.example((bin) => `${bin} disable PluginName --force`);
822819
pluginCli.example((bin) => `${bin} uninstall PluginName --force`);
823-
pluginCli.example((bin) => `${bin} install --uri file:///tmp/example.jar`);
824820
pluginCli.example((bin) => `${bin} install --url https://example.com/plugin.jar`);
825821
pluginCli.example((bin) => `${bin} upgrade PluginName --online`);
826822
pluginCli.example((bin) => `${bin} upgrade --all --online --yes`);

src/commands/theme/__test__/theme-entry.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,13 @@ test("tryRunThemeCommand rejects unknown online install flags during parsing", a
286286
await expect(
287287
tryRunThemeCommand(["theme", "install", "--online"], runtimeMock as never),
288288
).rejects.toThrow(/Unknown option `--online`/i);
289+
290+
await expect(
291+
tryRunThemeCommand(
292+
["theme", "install", "--uri", "https://example.com/theme.zip"],
293+
runtimeMock as never,
294+
),
295+
).rejects.toThrow(/Unknown option `--uri`/i);
289296
});
290297

291298
test("tryRunThemeCommand dispatches activate subcommands", async () => {

src/commands/theme/__test__/theme.spec.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ test("resolveThemeInstallSource accepts urls", () => {
2020
});
2121
});
2222

23-
test("resolveThemeInstallSource accepts uri aliases", () => {
24-
expect(resolveThemeInstallSource({ uri: " https://example.com/theme.zip " })).toEqual({
25-
url: "https://example.com/theme.zip",
26-
file: undefined,
27-
});
28-
});
29-
3023
test("resolveThemeInstallSource accepts files", () => {
3124
expect(resolveThemeInstallSource({ file: " ./theme.zip " })).toEqual({
3225
url: undefined,

src/commands/theme/index.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ interface ThemeCommandOptions {
2626
page?: string;
2727
size?: string;
2828
url?: string;
29-
uri?: string;
3029
file?: string;
3130
online?: boolean;
3231
all?: boolean;
@@ -187,7 +186,7 @@ export function resolveThemeInstallSource(options: ThemeCommandOptions): {
187186
url?: string;
188187
file?: string;
189188
} {
190-
const url = options.url?.trim() || options.uri?.trim();
189+
const url = options.url?.trim();
191190
const file = options.file?.trim();
192191

193192
if (!url && !file) {
@@ -210,9 +209,9 @@ function resolveThemeUpgradeTarget(
210209
throw new CliError("`halo theme upgrade --all` does not accept a theme name.");
211210
}
212211

213-
if (options.url || options.uri || options.file) {
212+
if (options.url || options.file) {
214213
throw new CliError(
215-
"`halo theme upgrade --all` only supports App Store upgrades. Do not combine it with --url, --uri, or --file.",
214+
"`halo theme upgrade --all` only supports App Store upgrades. Do not combine it with --url or --file.",
216215
);
217216
}
218217

@@ -591,7 +590,6 @@ function buildThemeCli(runtime: RuntimeContext): CAC {
591590
.option("--profile <name>", "Halo profile name")
592591
.option("--json", "Output JSON")
593592
.option("--url <url>", "Remote ZIP URL")
594-
.option("--uri <uri>", "Remote ZIP URI")
595593
.option("--file <path>", "Local ZIP file path")
596594
.option("-y, --yes", "Skip third-party URL confirmation")
597595
.action(async (options: ThemeCommandOptions) => {
@@ -641,7 +639,6 @@ function buildThemeCli(runtime: RuntimeContext): CAC {
641639
.option("--profile <name>", "Halo profile name")
642640
.option("--json", "Output JSON")
643641
.option("--url <url>", "Remote ZIP URL")
644-
.option("--uri <uri>", "Remote ZIP URI")
645642
.option("--file <path>", "Local ZIP file path")
646643
.option("--online", "Upgrade from the Halo App Store")
647644
.option("--all", "Upgrade all compatible App Store themes")
@@ -801,7 +798,7 @@ function buildThemeCli(runtime: RuntimeContext): CAC {
801798
themeCli.example((bin) => `${bin} list`);
802799
themeCli.example((bin) => `${bin} get ThemeName`);
803800
themeCli.example((bin) => `${bin} current`);
804-
themeCli.example((bin) => `${bin} install --uri file:///tmp/example.zip`);
801+
themeCli.example((bin) => `${bin} install --url https://example.com/theme.zip`);
805802
themeCli.example((bin) => `${bin} install --url https://example.com/theme.zip`);
806803
themeCli.example((bin) => `${bin} upgrade ThemeName --online`);
807804
themeCli.example((bin) => `${bin} activate ThemeName`);

src/shared/integrations/__test__/app-store.spec.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ test("resolvePluginUpgradeSource accepts url source", () => {
3333
});
3434
});
3535

36-
test("resolvePluginUpgradeSource accepts uri alias", () => {
37-
expect(resolvePluginUpgradeSource({ uri: "https://example.com/plugin.jar" })).toEqual({
38-
kind: "url",
39-
url: "https://example.com/plugin.jar",
40-
});
41-
});
42-
4336
test("resolvePluginUpgradeSource accepts file source", () => {
4437
expect(resolvePluginUpgradeSource({ file: "./plugin.jar" })).toEqual({
4538
kind: "file",

src/shared/integrations/app-store.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ interface HaloProActivation {
104104

105105
export interface PluginUpgradeSourceOptions {
106106
url?: string;
107-
uri?: string;
108107
file?: string;
109108
online?: boolean;
110109
}
@@ -135,7 +134,7 @@ async function withTimeout<T>(promise: Promise<T>, timeoutMs: number): Promise<T
135134
export function resolvePluginUpgradeSource(
136135
options: PluginUpgradeSourceOptions,
137136
): PluginUpgradeSource {
138-
const url = options.url?.trim() || options.uri?.trim();
137+
const url = options.url?.trim();
139138
const file = options.file?.trim();
140139
const online = Boolean(options.online);
141140
const sourceCount = Number(Boolean(url)) + Number(Boolean(file)) + Number(online);

0 commit comments

Comments
 (0)