@shell-shock/preset-cli 0.9.20 → 0.9.23
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/dist/_virtual/_rolldown/runtime.cjs +29 -1
- package/dist/components/banner-builtin.cjs +92 -5
- package/dist/components/banner-builtin.d.cts +2 -3
- package/dist/components/banner-builtin.d.cts.map +1 -1
- package/dist/components/banner-builtin.d.mts +3 -4
- package/dist/components/banner-builtin.d.mts.map +1 -1
- package/dist/components/banner-builtin.mjs +90 -5
- package/dist/components/banner-builtin.mjs.map +1 -1
- package/dist/components/command-entry.cjs +358 -56
- package/dist/components/command-entry.d.cts +1 -2
- package/dist/components/command-entry.d.cts.map +1 -1
- package/dist/components/command-entry.d.mts +1 -2
- package/dist/components/command-entry.d.mts.map +1 -1
- package/dist/components/command-entry.mjs +355 -56
- package/dist/components/command-entry.mjs.map +1 -1
- package/dist/components/command-router.cjs +59 -4
- package/dist/components/command-router.d.cts +2 -3
- package/dist/components/command-router.d.cts.map +1 -1
- package/dist/components/command-router.d.mts +3 -4
- package/dist/components/command-router.d.mts.map +1 -1
- package/dist/components/command-router.mjs +57 -4
- package/dist/components/command-router.mjs.map +1 -1
- package/dist/components/index.cjs +15 -1
- package/dist/components/index.mjs +7 -1
- package/dist/components/upgrade-builtin.cjs +134 -14
- package/dist/components/upgrade-builtin.d.cts +2 -3
- package/dist/components/upgrade-builtin.d.cts.map +1 -1
- package/dist/components/upgrade-builtin.d.mts +2 -3
- package/dist/components/upgrade-builtin.d.mts.map +1 -1
- package/dist/components/upgrade-builtin.mjs +132 -14
- package/dist/components/upgrade-builtin.mjs.map +1 -1
- package/dist/components/virtual-command-entry.cjs +116 -1
- package/dist/components/virtual-command-entry.d.cts +1 -2
- package/dist/components/virtual-command-entry.d.cts.map +1 -1
- package/dist/components/virtual-command-entry.d.mts +1 -2
- package/dist/components/virtual-command-entry.d.mts.map +1 -1
- package/dist/components/virtual-command-entry.mjs +113 -1
- package/dist/components/virtual-command-entry.mjs.map +1 -1
- package/dist/helpers/get-global-options.cjs +37 -1
- package/dist/helpers/get-global-options.mjs +37 -1
- package/dist/helpers/get-global-options.mjs.map +1 -1
- package/dist/index.cjs +185 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +175 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/plugin.d.cts +11 -3
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +12 -4
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/types/plugin.mjs +1 -1
- package/package.json +24 -23
|
@@ -1,8 +1,49 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
3
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
4
|
+
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
5
|
+
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
6
|
+
let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
7
|
+
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
8
|
+
let _shell_shock_preset_script_components = require("@shell-shock/preset-script/components");
|
|
9
|
+
|
|
10
|
+
//#region src/components/command-router.tsx
|
|
11
|
+
function CommandRouterSelectOptions(props) {
|
|
12
|
+
const { commands } = props;
|
|
13
|
+
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
14
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
15
|
+
get each() {
|
|
16
|
+
return Object.values(commands ?? {});
|
|
17
|
+
},
|
|
18
|
+
joiner: ",",
|
|
19
|
+
hardline: true,
|
|
20
|
+
children: (command) => command.virtual ? (0, _alloy_js_core_jsx_runtime.createComponent)(CommandRouterSelectOptions, { get commands() {
|
|
21
|
+
return command.children ?? {};
|
|
22
|
+
} }) : _alloy_js_core.code`{ value: [${command.segments.map((segment) => `"${segment}"`).join(", ")}], label: "${command.title}", description: \`(${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} ${command.segments.join(" ")})\`${command.icon ? `, icon: "${command.icon.trim()}"` : ""} }`
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A component that renders a command router interface, allowing users to select and execute commands from a provided list of commands and segments. This component serves as a wrapper around the base CommandRouter, adding additional UI elements and logic for command selection.
|
|
27
|
+
*/
|
|
28
|
+
function CommandRouter(props) {
|
|
29
|
+
const { segments, commands } = props;
|
|
30
|
+
return [
|
|
31
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_preset_script_components.CommandRouter, (0, _alloy_js_core_jsx_runtime.mergeProps)(props, {
|
|
32
|
+
segments,
|
|
33
|
+
commands
|
|
34
|
+
})),
|
|
35
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
36
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
37
|
+
condition: _alloy_js_core.code`isInteractive && !isHelp()`,
|
|
38
|
+
get children() {
|
|
39
|
+
return [
|
|
40
|
+
_alloy_js_core.code`await showBanner();
|
|
2
41
|
|
|
3
42
|
let segments = await select({
|
|
4
43
|
message: "Which command would you like to execute?",
|
|
5
|
-
options: [ `,
|
|
44
|
+
options: [ `,
|
|
45
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(CommandRouterSelectOptions, { commands }),
|
|
46
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => ` ],
|
|
6
47
|
});
|
|
7
48
|
if (isCancel(segments)) {
|
|
8
49
|
return;
|
|
@@ -22,8 +63,22 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_
|
|
|
22
63
|
segments = segments.map(segment => dynamics[segment] || segment);
|
|
23
64
|
const context = useGlobal();
|
|
24
65
|
if (context) {
|
|
25
|
-
context.inputArgs = [args.length > 0 ? args[0] : undefined, args.length > 1 ? args[1] : undefined, ...segments, ...args.slice(${
|
|
66
|
+
context.inputArgs = [args.length > 0 ? args[0] : undefined, args.length > 1 ? args[1] : undefined, ...segments, ...args.slice(${segments.length + 2})].filter(Boolean) as string[];
|
|
26
67
|
}
|
|
27
68
|
|
|
28
69
|
command = segments[0];
|
|
29
|
-
args = context.inputArgs; `),
|
|
70
|
+
args = context.inputArgs; `),
|
|
71
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_preset_script_components.CommandRouterBody, (0, _alloy_js_core_jsx_runtime.mergeProps)(props, {
|
|
72
|
+
segments,
|
|
73
|
+
commands
|
|
74
|
+
}))
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
}),
|
|
78
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
exports.CommandRouter = CommandRouter;
|
|
84
|
+
exports.CommandRouterSelectOptions = CommandRouterSelectOptions;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
2
1
|
import { CommandTree } from "@shell-shock/core";
|
|
3
2
|
import { CommandRouterProps } from "@shell-shock/preset-script/components";
|
|
4
3
|
|
|
@@ -6,11 +5,11 @@ import { CommandRouterProps } from "@shell-shock/preset-script/components";
|
|
|
6
5
|
interface CommandRouterSelectOptionsProps {
|
|
7
6
|
commands?: Record<string, CommandTree>;
|
|
8
7
|
}
|
|
9
|
-
declare function CommandRouterSelectOptions(props: CommandRouterSelectOptionsProps):
|
|
8
|
+
declare function CommandRouterSelectOptions(props: CommandRouterSelectOptionsProps): import("@alloy-js/core").Children;
|
|
10
9
|
/**
|
|
11
10
|
* A component that renders a command router interface, allowing users to select and execute commands from a provided list of commands and segments. This component serves as a wrapper around the base CommandRouter, adding additional UI elements and logic for command selection.
|
|
12
11
|
*/
|
|
13
|
-
declare function CommandRouter(props: CommandRouterProps):
|
|
12
|
+
declare function CommandRouter(props: CommandRouterProps): import("@alloy-js/core").Children;
|
|
14
13
|
//#endregion
|
|
15
14
|
export { CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps };
|
|
16
15
|
//# sourceMappingURL=command-router.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-router.d.cts","names":[],"sources":["../../src/components/command-router.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-router.d.cts","names":[],"sources":["../../src/components/command-router.tsx"],"mappings":";;;;UA+BiB,+BAAA;EACf,QAAA,GAAW,MAAM,SAAS,WAAA;AAAA;AAAA,iBAGZ,0BAAA,CACd,KAAA,EAAO,+BAA+B,4BAAA,QAAA;;;;iBA8BxB,aAAA,CAAc,KAAA,EAAO,kBAAkB,4BAAA,QAAA"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
2
|
-
import { CommandTree } from "@shell-shock/core";
|
|
3
1
|
import { CommandRouterProps } from "@shell-shock/preset-script/components";
|
|
2
|
+
import { CommandTree } from "@shell-shock/core";
|
|
4
3
|
|
|
5
4
|
//#region src/components/command-router.d.ts
|
|
6
5
|
interface CommandRouterSelectOptionsProps {
|
|
7
6
|
commands?: Record<string, CommandTree>;
|
|
8
7
|
}
|
|
9
|
-
declare function CommandRouterSelectOptions(props: CommandRouterSelectOptionsProps):
|
|
8
|
+
declare function CommandRouterSelectOptions(props: CommandRouterSelectOptionsProps): import("@alloy-js/core").Children;
|
|
10
9
|
/**
|
|
11
10
|
* A component that renders a command router interface, allowing users to select and execute commands from a provided list of commands and segments. This component serves as a wrapper around the base CommandRouter, adding additional UI elements and logic for command selection.
|
|
12
11
|
*/
|
|
13
|
-
declare function CommandRouter(props: CommandRouterProps):
|
|
12
|
+
declare function CommandRouter(props: CommandRouterProps): import("@alloy-js/core").Children;
|
|
14
13
|
//#endregion
|
|
15
14
|
export { CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps };
|
|
16
15
|
//# sourceMappingURL=command-router.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-router.d.mts","names":[],"sources":["../../src/components/command-router.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-router.d.mts","names":[],"sources":["../../src/components/command-router.tsx"],"mappings":""}
|
|
@@ -1,8 +1,48 @@
|
|
|
1
|
-
import{createComponent
|
|
1
|
+
import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { For, code } from "@alloy-js/core";
|
|
3
|
+
import { IfStatement } from "@alloy-js/typescript";
|
|
4
|
+
import { getAppBin } from "@shell-shock/core/plugin-utils";
|
|
5
|
+
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
6
|
+
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
7
|
+
import { CommandRouter as CommandRouter$1, CommandRouterBody } from "@shell-shock/preset-script/components";
|
|
8
|
+
|
|
9
|
+
//#region src/components/command-router.tsx
|
|
10
|
+
function CommandRouterSelectOptions(props) {
|
|
11
|
+
const { commands } = props;
|
|
12
|
+
const context = usePowerlines();
|
|
13
|
+
return createComponent(For, {
|
|
14
|
+
get each() {
|
|
15
|
+
return Object.values(commands ?? {});
|
|
16
|
+
},
|
|
17
|
+
joiner: ",",
|
|
18
|
+
hardline: true,
|
|
19
|
+
children: (command) => command.virtual ? createComponent(CommandRouterSelectOptions, { get commands() {
|
|
20
|
+
return command.children ?? {};
|
|
21
|
+
} }) : code`{ value: [${command.segments.map((segment) => `"${segment}"`).join(", ")}], label: "${command.title}", description: \`(${getAppBin(context)} ${command.segments.join(" ")})\`${command.icon ? `, icon: "${command.icon.trim()}"` : ""} }`
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A component that renders a command router interface, allowing users to select and execute commands from a provided list of commands and segments. This component serves as a wrapper around the base CommandRouter, adding additional UI elements and logic for command selection.
|
|
26
|
+
*/
|
|
27
|
+
function CommandRouter(props) {
|
|
28
|
+
const { segments, commands } = props;
|
|
29
|
+
return [
|
|
30
|
+
createComponent(CommandRouter$1, mergeProps(props, {
|
|
31
|
+
segments,
|
|
32
|
+
commands
|
|
33
|
+
})),
|
|
34
|
+
createComponent(Spacing, {}),
|
|
35
|
+
createComponent(IfStatement, {
|
|
36
|
+
condition: code`isInteractive && !isHelp()`,
|
|
37
|
+
get children() {
|
|
38
|
+
return [
|
|
39
|
+
code`await showBanner();
|
|
2
40
|
|
|
3
41
|
let segments = await select({
|
|
4
42
|
message: "Which command would you like to execute?",
|
|
5
|
-
options: [ `,
|
|
43
|
+
options: [ `,
|
|
44
|
+
createComponent(CommandRouterSelectOptions, { commands }),
|
|
45
|
+
memo(() => ` ],
|
|
6
46
|
});
|
|
7
47
|
if (isCancel(segments)) {
|
|
8
48
|
return;
|
|
@@ -22,9 +62,22 @@ import{createComponent as e,memo as t,mergeProps as n}from"@alloy-js/core/jsx-ru
|
|
|
22
62
|
segments = segments.map(segment => dynamics[segment] || segment);
|
|
23
63
|
const context = useGlobal();
|
|
24
64
|
if (context) {
|
|
25
|
-
context.inputArgs = [args.length > 0 ? args[0] : undefined, args.length > 1 ? args[1] : undefined, ...segments, ...args.slice(${
|
|
65
|
+
context.inputArgs = [args.length > 0 ? args[0] : undefined, args.length > 1 ? args[1] : undefined, ...segments, ...args.slice(${segments.length + 2})].filter(Boolean) as string[];
|
|
26
66
|
}
|
|
27
67
|
|
|
28
68
|
command = segments[0];
|
|
29
|
-
args = context.inputArgs; `),
|
|
69
|
+
args = context.inputArgs; `),
|
|
70
|
+
createComponent(CommandRouterBody, mergeProps(props, {
|
|
71
|
+
segments,
|
|
72
|
+
commands
|
|
73
|
+
}))
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
}),
|
|
77
|
+
createComponent(Spacing, {})
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
//#endregion
|
|
82
|
+
export { CommandRouter, CommandRouterSelectOptions };
|
|
30
83
|
//# sourceMappingURL=command-router.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-router.mjs","names":[],"sources":[
|
|
1
|
+
{"version":3,"file":"command-router.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_components_banner_builtin = require('./banner-builtin.cjs');
|
|
3
|
+
const require_components_command_router = require('./command-router.cjs');
|
|
4
|
+
const require_components_virtual_command_entry = require('./virtual-command-entry.cjs');
|
|
5
|
+
const require_components_command_entry = require('./command-entry.cjs');
|
|
6
|
+
const require_components_upgrade_builtin = require('./upgrade-builtin.cjs');
|
|
7
|
+
|
|
8
|
+
exports.BannerBuiltin = require_components_banner_builtin.BannerBuiltin;
|
|
9
|
+
exports.BannerFunctionBodyDeclaration = require_components_banner_builtin.BannerFunctionBodyDeclaration;
|
|
10
|
+
exports.CommandEntry = require_components_command_entry.CommandEntry;
|
|
11
|
+
exports.CommandRouter = require_components_command_router.CommandRouter;
|
|
12
|
+
exports.CommandRouterSelectOptions = require_components_command_router.CommandRouterSelectOptions;
|
|
13
|
+
exports.ExecuteUpgradeFunctionDeclaration = require_components_upgrade_builtin.ExecuteUpgradeFunctionDeclaration;
|
|
14
|
+
exports.UpgradeBuiltin = require_components_upgrade_builtin.UpgradeBuiltin;
|
|
15
|
+
exports.VirtualCommandEntry = require_components_virtual_command_entry.VirtualCommandEntry;
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BannerBuiltin, BannerFunctionBodyDeclaration } from "./banner-builtin.mjs";
|
|
2
|
+
import { CommandRouter, CommandRouterSelectOptions } from "./command-router.mjs";
|
|
3
|
+
import { VirtualCommandEntry } from "./virtual-command-entry.mjs";
|
|
4
|
+
import { CommandEntry } from "./command-entry.mjs";
|
|
5
|
+
import { ExecuteUpgradeFunctionDeclaration, UpgradeBuiltin } from "./upgrade-builtin.mjs";
|
|
6
|
+
|
|
7
|
+
export { BannerBuiltin, BannerFunctionBodyDeclaration, CommandEntry, CommandRouter, CommandRouterSelectOptions, ExecuteUpgradeFunctionDeclaration, UpgradeBuiltin, VirtualCommandEntry };
|
|
@@ -1,15 +1,72 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
3
|
+
let _alloy_js_core = require("@alloy-js/core");
|
|
4
|
+
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
5
|
+
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
6
|
+
let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
7
|
+
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
8
|
+
let defu = require("defu");
|
|
9
|
+
let _shell_shock_plugin_upgrade_components_upgrade_builtin = require("@shell-shock/plugin-upgrade/components/upgrade-builtin");
|
|
10
|
+
|
|
11
|
+
//#region src/components/upgrade-builtin.tsx
|
|
12
|
+
/**
|
|
13
|
+
* A component to generate the `executeUpgrade` function in the `shell-shock:upgrade` builtin module.
|
|
14
|
+
*/
|
|
15
|
+
function ExecuteUpgradeFunctionDeclaration() {
|
|
16
|
+
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
17
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
18
|
+
get when() {
|
|
19
|
+
return context.config.upgradeType !== false;
|
|
20
|
+
},
|
|
21
|
+
get children() {
|
|
22
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
23
|
+
"export": true,
|
|
24
|
+
async: true,
|
|
25
|
+
name: "executeUpgrade",
|
|
26
|
+
get doc() {
|
|
27
|
+
return `Run upgrade processing for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} application.`;
|
|
28
|
+
},
|
|
29
|
+
get children() {
|
|
30
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
31
|
+
condition: _alloy_js_core.code`await isCheckForUpdatesRequired()`,
|
|
32
|
+
get children() {
|
|
33
|
+
return [
|
|
34
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
35
|
+
"const": true,
|
|
36
|
+
name: "spinner",
|
|
37
|
+
initializer: _alloy_js_core.code`createSpinner({
|
|
2
38
|
message: "Checking for updates..."
|
|
3
|
-
}).start(); `
|
|
4
|
-
|
|
5
|
-
|
|
39
|
+
}).start(); `
|
|
40
|
+
}),
|
|
41
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
42
|
+
"const": true,
|
|
43
|
+
name: "result",
|
|
44
|
+
initializer: _alloy_js_core.code`await checkForUpdates({ force: true }); `
|
|
45
|
+
}),
|
|
46
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
47
|
+
condition: _alloy_js_core.code`(result as CheckForUpdatesErrorResult)?.isError`,
|
|
48
|
+
get children() {
|
|
49
|
+
return _alloy_js_core.code`spinner.error(\`An error occurred while checking for ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} application updates. Please try again later - if the problem persists, please contact support.\`);
|
|
50
|
+
debug((result as CheckForUpdatesErrorResult).error); `;
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseIfClause, {
|
|
54
|
+
condition: _alloy_js_core.code`!(result as CheckForUpdatesSuccessResult)?.isUpToDate`,
|
|
55
|
+
get children() {
|
|
56
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
57
|
+
get when() {
|
|
58
|
+
return context.config.upgradeType !== false && (context.config.upgradeType === "confirm" || context.config.upgradeType === "manual");
|
|
59
|
+
},
|
|
60
|
+
get fallback() {
|
|
61
|
+
return [(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`spinner.stop();
|
|
62
|
+
info(\`A new version of ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} is available: \${red(\`v\${(result as CheckForUpdatesSuccessResult).currentVersion}\`)} \${textColors.body.tertiary("➜")} \${green(\`v\${(result as CheckForUpdatesSuccessResult).latestVersion}\`)}\${(result as CheckForUpdatesSuccessResult).package?.date ? textColors.body.tertiary(\` (updated on \${(result as CheckForUpdatesSuccessResult).package?.date})\`) : ""}\`);
|
|
6
63
|
|
|
7
64
|
try {
|
|
8
65
|
await upgrade();
|
|
9
66
|
spinner.success("Update successful! Please restart the application to apply the update.");
|
|
10
67
|
|
|
11
68
|
writeLine("");
|
|
12
|
-
help(\`
|
|
69
|
+
help(\`The changelog for this release can be viewed by running the \${inlineCode("${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} changelog")} command.\`);
|
|
13
70
|
|
|
14
71
|
writeLine("");
|
|
15
72
|
writeLine("Press any key to exit the application...");
|
|
@@ -17,10 +74,21 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_
|
|
|
17
74
|
await waitForKeyPress();
|
|
18
75
|
return;
|
|
19
76
|
} catch (err) {
|
|
20
|
-
spinner.error(\`An error occurred while updating ${(0,
|
|
77
|
+
spinner.error(\`An error occurred while updating ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} to v\${(result as CheckForUpdatesSuccessResult).latestVersion}. Please try again later - if the problem persists, please contact support.\`);
|
|
21
78
|
debug(err);
|
|
22
|
-
} `),(0,
|
|
23
|
-
|
|
79
|
+
} `), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})];
|
|
80
|
+
},
|
|
81
|
+
get children() {
|
|
82
|
+
return [
|
|
83
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`spinner.stop();
|
|
84
|
+
warn(\`A new version of ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} is available: \${red(\`v\${(result as CheckForUpdatesSuccessResult).currentVersion}\`)} \${textColors.body.tertiary("➜")} \${green(\`v\${(result as CheckForUpdatesSuccessResult).latestVersion}\`)}\${(result as CheckForUpdatesSuccessResult).package.date ? textColors.body.tertiary(\` (updated on \${(result as CheckForUpdatesSuccessResult).package.date})\`) : ""}${context.config.upgradeType !== false && context.config.upgradeType === "manual" ? ` \\nPlease run \`${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} upgrade\` to upgrade to the latest version.` : ""}\`); `),
|
|
85
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
86
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
87
|
+
get when() {
|
|
88
|
+
return context.config.upgradeType !== false && context.config.upgradeType === "confirm";
|
|
89
|
+
},
|
|
90
|
+
get children() {
|
|
91
|
+
return _alloy_js_core.code`const willUpgradeNow = await confirm({
|
|
24
92
|
message: \`Would you like to update to v\${(result as CheckForUpdatesSuccessResult).latestVersion} now?\`,
|
|
25
93
|
initialValue: true
|
|
26
94
|
});
|
|
@@ -29,7 +97,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_
|
|
|
29
97
|
}
|
|
30
98
|
|
|
31
99
|
if (willUpgradeNow) {
|
|
32
|
-
spinner.text = \`Updating ${(0,
|
|
100
|
+
spinner.text = \`Updating ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} to v\${(result as CheckForUpdatesSuccessResult).latestVersion}...\`;
|
|
33
101
|
spinner.start();
|
|
34
102
|
|
|
35
103
|
try {
|
|
@@ -37,7 +105,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_
|
|
|
37
105
|
spinner.success("Update successful! Please restart the application to apply the update.");
|
|
38
106
|
|
|
39
107
|
writeLine("");
|
|
40
|
-
help(\`
|
|
108
|
+
help(\`The changelog for this release can be viewed by running the \${inlineCode("${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} changelog")} command.\`);
|
|
41
109
|
|
|
42
110
|
writeLine("");
|
|
43
111
|
writeLine("Press any key to exit the application...");
|
|
@@ -45,11 +113,63 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_
|
|
|
45
113
|
await waitForKeyPress();
|
|
46
114
|
return;
|
|
47
115
|
} catch (err) {
|
|
48
|
-
spinner.error(\`An error occurred while updating ${(0,
|
|
116
|
+
spinner.error(\`An error occurred while updating ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} to v\${(result as CheckForUpdatesSuccessResult).latestVersion}. Please try again later - if the problem persists, please contact support.\`);
|
|
49
117
|
return { error: err };
|
|
50
118
|
}
|
|
51
119
|
} else {
|
|
52
|
-
help("Updates can be performed at any time by running the \`${(0,
|
|
53
|
-
}
|
|
120
|
+
help("Updates can be performed at any time by running the \`${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} upgrade\` command. Please remember that keeping your application up to date is important for ensuring you have the latest features, performance improvements, and security patches.");
|
|
121
|
+
} `;
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
];
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}),
|
|
129
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseClause, { get children() {
|
|
130
|
+
return _alloy_js_core.code`spinner.success("Currently running the latest version of ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)}.");
|
|
54
131
|
writeLine("");
|
|
55
|
-
|
|
132
|
+
`;
|
|
133
|
+
} })
|
|
134
|
+
];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* A built-in upgrade module for Shell Shock.
|
|
144
|
+
*/
|
|
145
|
+
function UpgradeBuiltin(props) {
|
|
146
|
+
const [{ children, builtinImports }, rest] = (0, _alloy_js_core.splitProps)(props, ["children", "builtinImports"]);
|
|
147
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_plugin_upgrade_components_upgrade_builtin.UpgradeBuiltin, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
148
|
+
get builtinImports() {
|
|
149
|
+
return (0, defu.defu)(builtinImports ?? {}, {
|
|
150
|
+
console: [
|
|
151
|
+
"createSpinner",
|
|
152
|
+
"debug",
|
|
153
|
+
"info"
|
|
154
|
+
],
|
|
155
|
+
prompts: ["waitForKeyPress"]
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
get children() {
|
|
159
|
+
return [
|
|
160
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(ExecuteUpgradeFunctionDeclaration, {}),
|
|
161
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
162
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
163
|
+
get when() {
|
|
164
|
+
return Boolean(children);
|
|
165
|
+
},
|
|
166
|
+
children
|
|
167
|
+
})
|
|
168
|
+
];
|
|
169
|
+
}
|
|
170
|
+
}));
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
//#endregion
|
|
174
|
+
exports.ExecuteUpgradeFunctionDeclaration = ExecuteUpgradeFunctionDeclaration;
|
|
175
|
+
exports.UpgradeBuiltin = UpgradeBuiltin;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
2
1
|
import { UpgradeBuiltinProps } from "@shell-shock/plugin-upgrade/components/upgrade-builtin";
|
|
3
2
|
|
|
4
3
|
//#region src/components/upgrade-builtin.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* A component to generate the `executeUpgrade` function in the `shell-shock:upgrade` builtin module.
|
|
7
6
|
*/
|
|
8
|
-
declare function ExecuteUpgradeFunctionDeclaration():
|
|
7
|
+
declare function ExecuteUpgradeFunctionDeclaration(): import("@alloy-js/core").Children;
|
|
9
8
|
/**
|
|
10
9
|
* A built-in upgrade module for Shell Shock.
|
|
11
10
|
*/
|
|
12
|
-
declare function UpgradeBuiltin(props: UpgradeBuiltinProps):
|
|
11
|
+
declare function UpgradeBuiltin(props: UpgradeBuiltinProps): import("@alloy-js/core").Children;
|
|
13
12
|
//#endregion
|
|
14
13
|
export { ExecuteUpgradeFunctionDeclaration, UpgradeBuiltin };
|
|
15
14
|
//# sourceMappingURL=upgrade-builtin.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade-builtin.d.cts","names":[],"sources":["../../src/components/upgrade-builtin.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"upgrade-builtin.d.cts","names":[],"sources":["../../src/components/upgrade-builtin.tsx"],"mappings":";;;;;AAqCA;iBAAgB,iCAAA,6BAAiC,QAAA;;;AAAA;iBAuJjC,cAAA,CAAe,KAAA,EAAO,mBAAmB,4BAAA,QAAA"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import * as _$_alloy_js_core0 from "@alloy-js/core";
|
|
2
1
|
import { UpgradeBuiltinProps } from "@shell-shock/plugin-upgrade/components/upgrade-builtin";
|
|
3
2
|
|
|
4
3
|
//#region src/components/upgrade-builtin.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* A component to generate the `executeUpgrade` function in the `shell-shock:upgrade` builtin module.
|
|
7
6
|
*/
|
|
8
|
-
declare function ExecuteUpgradeFunctionDeclaration():
|
|
7
|
+
declare function ExecuteUpgradeFunctionDeclaration(): import("@alloy-js/core").Children;
|
|
9
8
|
/**
|
|
10
9
|
* A built-in upgrade module for Shell Shock.
|
|
11
10
|
*/
|
|
12
|
-
declare function UpgradeBuiltin(props: UpgradeBuiltinProps):
|
|
11
|
+
declare function UpgradeBuiltin(props: UpgradeBuiltinProps): import("@alloy-js/core").Children;
|
|
13
12
|
//#endregion
|
|
14
13
|
export { ExecuteUpgradeFunctionDeclaration, UpgradeBuiltin };
|
|
15
14
|
//# sourceMappingURL=upgrade-builtin.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade-builtin.d.mts","names":[],"sources":["../../src/components/upgrade-builtin.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"upgrade-builtin.d.mts","names":[],"sources":["../../src/components/upgrade-builtin.tsx"],"mappings":""}
|