@shell-shock/preset-cli 0.9.24 → 0.9.25
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/components/banner-builtin.cjs +13 -3
- package/dist/components/banner-builtin.d.cts.map +1 -1
- package/dist/components/banner-builtin.mjs +11 -3
- package/dist/components/command-entry.cjs +4 -4
- package/dist/components/command-entry.mjs +3 -3
- package/dist/components/index.cjs +3 -3
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +2 -2
- package/dist/components/{upgrade-builtin.cjs → update-builtin.cjs} +22 -22
- package/dist/components/update-builtin.d.cts +14 -0
- package/dist/components/update-builtin.d.cts.map +1 -0
- package/dist/components/update-builtin.d.mts +14 -0
- package/dist/components/update-builtin.d.mts.map +1 -0
- package/dist/components/{upgrade-builtin.mjs → update-builtin.mjs} +22 -22
- package/dist/components/update-builtin.mjs.map +1 -0
- package/dist/components/virtual-command-entry.cjs +1 -1
- package/dist/components/virtual-command-entry.mjs +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +7 -7
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/plugin.d.cts +117 -15
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +117 -15
- package/package.json +24 -24
- package/dist/components/upgrade-builtin.d.cts +0 -14
- package/dist/components/upgrade-builtin.d.cts.map +0 -1
- package/dist/components/upgrade-builtin.d.mts +0 -14
- package/dist/components/upgrade-builtin.d.mts.map +0 -1
- package/dist/components/upgrade-builtin.mjs.map +0 -1
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
3
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
3
4
|
let _alloy_js_core = require("@alloy-js/core");
|
|
4
5
|
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
6
|
+
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
5
7
|
let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
6
8
|
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
7
9
|
let _shell_shock_plugin_banner_components_banner_builtin = require("@shell-shock/plugin-banner/components/banner-builtin");
|
|
8
10
|
let _shell_shock_plugin_banner_components_banner_function_declaration = require("@shell-shock/plugin-banner/components/banner-function-declaration");
|
|
9
11
|
let _shell_shock_plugin_theme_contexts_theme = require("@shell-shock/plugin-theme/contexts/theme");
|
|
12
|
+
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
10
13
|
let cfonts = require("cfonts");
|
|
14
|
+
let defu = require("defu");
|
|
15
|
+
defu = require_runtime.__toESM(defu);
|
|
11
16
|
|
|
12
17
|
//#region src/components/banner-builtin.tsx
|
|
13
18
|
/**
|
|
@@ -22,7 +27,7 @@ function BannerFunctionBodyDeclaration(props) {
|
|
|
22
27
|
const title = (0, _alloy_js_core.computed)(() => (0, _shell_shock_core_plugin_utils.getAppTitle)(context, true).replace(`v${context.packageJson.version || "1.0.0"}`, ""));
|
|
23
28
|
const description = (0, _alloy_js_core.computed)(() => command?.description || (0, _shell_shock_core_plugin_utils.getAppDescription)(context));
|
|
24
29
|
const titleLines = (0, _alloy_js_core.computed)(() => {
|
|
25
|
-
const result = (0, cfonts.render)((0, _shell_shock_core_plugin_utils.getAppTitle)(context, true), {
|
|
30
|
+
const result = (0, cfonts.render)((0, _stryke_type_checks_is_set_string.isSetString)(context.config.banner) ? context.config.banner : (0, _stryke_type_checks_is_set_object.isSetObject)(context.config.banner) && (0, _stryke_type_checks_is_set_string.isSetString)(context.config.banner.text) ? context.config.banner.text : (0, _shell_shock_core_plugin_utils.getAppTitle)(context, true), (0, defu.default)((0, _stryke_type_checks_is_set_object.isSetObject)(context.config.banner) ? context.config.banner : {}, {
|
|
26
31
|
font: "tiny",
|
|
27
32
|
align: "left",
|
|
28
33
|
background: "transparent",
|
|
@@ -31,7 +36,7 @@ function BannerFunctionBodyDeclaration(props) {
|
|
|
31
36
|
gradient: false,
|
|
32
37
|
transitionGradient: false,
|
|
33
38
|
env: "node"
|
|
34
|
-
});
|
|
39
|
+
}));
|
|
35
40
|
if (!result) return [`${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} Command-Line Interface`];
|
|
36
41
|
return result.array;
|
|
37
42
|
});
|
|
@@ -49,7 +54,12 @@ function BannerFunctionBodyDeclaration(props) {
|
|
|
49
54
|
},
|
|
50
55
|
variant,
|
|
51
56
|
consoleFnName,
|
|
52
|
-
command
|
|
57
|
+
get command() {
|
|
58
|
+
return {
|
|
59
|
+
...command,
|
|
60
|
+
title: command?.path ? command.title : ""
|
|
61
|
+
};
|
|
62
|
+
},
|
|
53
63
|
insertNewlineAfterDescription: true,
|
|
54
64
|
get children() {
|
|
55
65
|
return _alloy_js_core.code`const titleLines = [${titleLines.value.map((line) => JSON.stringify(line.trim())).join(", ")}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner-builtin.d.cts","names":[],"sources":["../../src/components/banner-builtin.tsx"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"banner-builtin.d.cts","names":[],"sources":["../../src/components/banner-builtin.tsx"],"mappings":";;;;;;;AAwCA;iBAAgB,6BAAA,CACd,KAAA,EAAO,IAAI,CACT,kCAAA,kEAED,QAAA;AAAA,KA+FS,kBAAA,GAAqB,IAAA,CAC/B,gBAAA;EAnGW;;;EAyGX,OAAA,EAAS,WAAA;AAAA;;AAtGR;AA+FH;iBAagB,aAAA,CAAc,KAAA,EAAO,kBAAkB,4BAAA,QAAA"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
2
|
import { Show, code, computed, splitProps } from "@alloy-js/core";
|
|
3
3
|
import { getAppDescription, getAppTitle } from "@shell-shock/core/plugin-utils";
|
|
4
|
+
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
4
5
|
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
5
6
|
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
6
7
|
import { BannerBuiltin as BannerBuiltin$1 } from "@shell-shock/plugin-banner/components/banner-builtin";
|
|
7
8
|
import { BannerFunctionBodyDeclaration as BannerFunctionBodyDeclaration$1, BannerFunctionDeclarationWrapper } from "@shell-shock/plugin-banner/components/banner-function-declaration";
|
|
8
9
|
import { useTheme } from "@shell-shock/plugin-theme/contexts/theme";
|
|
10
|
+
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
9
11
|
import { render } from "cfonts";
|
|
12
|
+
import defu from "defu";
|
|
10
13
|
|
|
11
14
|
//#region src/components/banner-builtin.tsx
|
|
12
15
|
/**
|
|
@@ -21,7 +24,7 @@ function BannerFunctionBodyDeclaration(props) {
|
|
|
21
24
|
const title = computed(() => getAppTitle(context, true).replace(`v${context.packageJson.version || "1.0.0"}`, ""));
|
|
22
25
|
const description = computed(() => command?.description || getAppDescription(context));
|
|
23
26
|
const titleLines = computed(() => {
|
|
24
|
-
const result = render(getAppTitle(context, true), {
|
|
27
|
+
const result = render(isSetString(context.config.banner) ? context.config.banner : isSetObject(context.config.banner) && isSetString(context.config.banner.text) ? context.config.banner.text : getAppTitle(context, true), defu(isSetObject(context.config.banner) ? context.config.banner : {}, {
|
|
25
28
|
font: "tiny",
|
|
26
29
|
align: "left",
|
|
27
30
|
background: "transparent",
|
|
@@ -30,7 +33,7 @@ function BannerFunctionBodyDeclaration(props) {
|
|
|
30
33
|
gradient: false,
|
|
31
34
|
transitionGradient: false,
|
|
32
35
|
env: "node"
|
|
33
|
-
});
|
|
36
|
+
}));
|
|
34
37
|
if (!result) return [`${getAppTitle(context, true)} Command-Line Interface`];
|
|
35
38
|
return result.array;
|
|
36
39
|
});
|
|
@@ -48,7 +51,12 @@ function BannerFunctionBodyDeclaration(props) {
|
|
|
48
51
|
},
|
|
49
52
|
variant,
|
|
50
53
|
consoleFnName,
|
|
51
|
-
command
|
|
54
|
+
get command() {
|
|
55
|
+
return {
|
|
56
|
+
...command,
|
|
57
|
+
title: command?.path ? command.title : ""
|
|
58
|
+
};
|
|
59
|
+
},
|
|
52
60
|
insertNewlineAfterDescription: true,
|
|
53
61
|
get children() {
|
|
54
62
|
return code`const titleLines = [${titleLines.value.map((line) => JSON.stringify(line.trim())).join(", ")}];
|
|
@@ -8,6 +8,8 @@ let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
|
8
8
|
let _stryke_path_join = require("@stryke/path/join");
|
|
9
9
|
let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
10
10
|
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
11
|
+
let defu = require("defu");
|
|
12
|
+
defu = require_runtime.__toESM(defu);
|
|
11
13
|
let _powerlines_plugin_alloy_typescript_components_entry_file = require("@powerlines/plugin-alloy/typescript/components/entry-file");
|
|
12
14
|
let _shell_shock_core_components_command_validation_logic = require("@shell-shock/core/components/command-validation-logic");
|
|
13
15
|
let _shell_shock_preset_script_components_command_entry = require("@shell-shock/preset-script/components/command-entry");
|
|
@@ -15,8 +17,6 @@ let _stryke_path_find = require("@stryke/path/find");
|
|
|
15
17
|
let _stryke_path_replace = require("@stryke/path/replace");
|
|
16
18
|
let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
|
|
17
19
|
let _stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
18
|
-
let defu = require("defu");
|
|
19
|
-
defu = require_runtime.__toESM(defu);
|
|
20
20
|
|
|
21
21
|
//#region src/components/command-entry.tsx
|
|
22
22
|
/**
|
|
@@ -93,14 +93,14 @@ function CommandEntry(props) {
|
|
|
93
93
|
],
|
|
94
94
|
[(0, _stryke_path_join.joinPaths)("help", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)))]: ["showHelp"],
|
|
95
95
|
[(0, _stryke_path_join.joinPaths)("banner", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)))]: ["showBanner"],
|
|
96
|
-
|
|
96
|
+
update: ["executeUpdate"]
|
|
97
97
|
});
|
|
98
98
|
},
|
|
99
99
|
get children() {
|
|
100
100
|
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}), (0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_preset_script_components_command_entry.CommandHandlerDeclaration, {
|
|
101
101
|
command,
|
|
102
102
|
banner: _alloy_js_core.code`await showBanner();
|
|
103
|
-
await
|
|
103
|
+
await executeUpdate(); `,
|
|
104
104
|
get children() {
|
|
105
105
|
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
106
106
|
condition: _alloy_js_core.code`!isInteractive`,
|
|
@@ -6,6 +6,7 @@ import { formatDescription, formatShortDescription, isDynamicPathSegment } from
|
|
|
6
6
|
import { joinPaths } from "@stryke/path/join";
|
|
7
7
|
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
8
8
|
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
9
|
+
import defu from "defu";
|
|
9
10
|
import { EntryFile } from "@powerlines/plugin-alloy/typescript/components/entry-file";
|
|
10
11
|
import { CommandValidationLogic } from "@shell-shock/core/components/command-validation-logic";
|
|
11
12
|
import { CommandHandlerDeclaration } from "@shell-shock/preset-script/components/command-entry";
|
|
@@ -13,7 +14,6 @@ import { findFilePath, relativePath } from "@stryke/path/find";
|
|
|
13
14
|
import { replaceExtension } from "@stryke/path/replace";
|
|
14
15
|
import { camelCase } from "@stryke/string-format/camel-case";
|
|
15
16
|
import { pascalCase } from "@stryke/string-format/pascal-case";
|
|
16
|
-
import defu from "defu";
|
|
17
17
|
|
|
18
18
|
//#region src/components/command-entry.tsx
|
|
19
19
|
/**
|
|
@@ -90,14 +90,14 @@ function CommandEntry(props) {
|
|
|
90
90
|
],
|
|
91
91
|
[joinPaths("help", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)))]: ["showHelp"],
|
|
92
92
|
[joinPaths("banner", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)))]: ["showBanner"],
|
|
93
|
-
|
|
93
|
+
update: ["executeUpdate"]
|
|
94
94
|
});
|
|
95
95
|
},
|
|
96
96
|
get children() {
|
|
97
97
|
return [createComponent(Spacing, {}), createComponent(CommandHandlerDeclaration, {
|
|
98
98
|
command,
|
|
99
99
|
banner: code`await showBanner();
|
|
100
|
-
await
|
|
100
|
+
await executeUpdate(); `,
|
|
101
101
|
get children() {
|
|
102
102
|
return [createComponent(IfStatement, {
|
|
103
103
|
condition: code`!isInteractive`,
|
|
@@ -3,13 +3,13 @@ const require_components_banner_builtin = require('./banner-builtin.cjs');
|
|
|
3
3
|
const require_components_command_router = require('./command-router.cjs');
|
|
4
4
|
const require_components_virtual_command_entry = require('./virtual-command-entry.cjs');
|
|
5
5
|
const require_components_command_entry = require('./command-entry.cjs');
|
|
6
|
-
const
|
|
6
|
+
const require_components_update_builtin = require('./update-builtin.cjs');
|
|
7
7
|
|
|
8
8
|
exports.BannerBuiltin = require_components_banner_builtin.BannerBuiltin;
|
|
9
9
|
exports.BannerFunctionBodyDeclaration = require_components_banner_builtin.BannerFunctionBodyDeclaration;
|
|
10
10
|
exports.CommandEntry = require_components_command_entry.CommandEntry;
|
|
11
11
|
exports.CommandRouter = require_components_command_router.CommandRouter;
|
|
12
12
|
exports.CommandRouterSelectOptions = require_components_command_router.CommandRouterSelectOptions;
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
13
|
+
exports.ExecuteUpdateFunctionDeclaration = require_components_update_builtin.ExecuteUpdateFunctionDeclaration;
|
|
14
|
+
exports.UpdateBuiltin = require_components_update_builtin.UpdateBuiltin;
|
|
15
15
|
exports.VirtualCommandEntry = require_components_virtual_command_entry.VirtualCommandEntry;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BannerBuiltin, BannerBuiltinProps, BannerFunctionBodyDeclaration } from "./banner-builtin.cjs";
|
|
2
2
|
import { CommandEntry, CommandEntryProps } from "./command-entry.cjs";
|
|
3
3
|
import { CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps } from "./command-router.cjs";
|
|
4
|
-
import {
|
|
4
|
+
import { ExecuteUpdateFunctionDeclaration, UpdateBuiltin } from "./update-builtin.cjs";
|
|
5
5
|
import { VirtualCommandEntry, VirtualCommandEntryProps } from "./virtual-command-entry.cjs";
|
|
6
|
-
export { BannerBuiltin, BannerBuiltinProps, BannerFunctionBodyDeclaration, CommandEntry, CommandEntryProps, CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps,
|
|
6
|
+
export { BannerBuiltin, BannerBuiltinProps, BannerFunctionBodyDeclaration, CommandEntry, CommandEntryProps, CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps, ExecuteUpdateFunctionDeclaration, UpdateBuiltin, VirtualCommandEntry, VirtualCommandEntryProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BannerBuiltin, BannerBuiltinProps, BannerFunctionBodyDeclaration } from "./banner-builtin.mjs";
|
|
2
2
|
import { CommandEntry, CommandEntryProps } from "./command-entry.mjs";
|
|
3
3
|
import { CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps } from "./command-router.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { ExecuteUpdateFunctionDeclaration, UpdateBuiltin } from "./update-builtin.mjs";
|
|
5
5
|
import { VirtualCommandEntry, VirtualCommandEntryProps } from "./virtual-command-entry.mjs";
|
|
6
|
-
export { BannerBuiltin, BannerBuiltinProps, BannerFunctionBodyDeclaration, CommandEntry, CommandEntryProps, CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps,
|
|
6
|
+
export { BannerBuiltin, BannerBuiltinProps, BannerFunctionBodyDeclaration, CommandEntry, CommandEntryProps, CommandRouter, CommandRouterSelectOptions, CommandRouterSelectOptionsProps, ExecuteUpdateFunctionDeclaration, UpdateBuiltin, VirtualCommandEntry, VirtualCommandEntryProps };
|
|
@@ -2,6 +2,6 @@ import { BannerBuiltin, BannerFunctionBodyDeclaration } from "./banner-builtin.m
|
|
|
2
2
|
import { CommandRouter, CommandRouterSelectOptions } from "./command-router.mjs";
|
|
3
3
|
import { VirtualCommandEntry } from "./virtual-command-entry.mjs";
|
|
4
4
|
import { CommandEntry } from "./command-entry.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { ExecuteUpdateFunctionDeclaration, UpdateBuiltin } from "./update-builtin.mjs";
|
|
6
6
|
|
|
7
|
-
export { BannerBuiltin, BannerFunctionBodyDeclaration, CommandEntry, CommandRouter, CommandRouterSelectOptions,
|
|
7
|
+
export { BannerBuiltin, BannerFunctionBodyDeclaration, CommandEntry, CommandRouter, CommandRouterSelectOptions, ExecuteUpdateFunctionDeclaration, UpdateBuiltin, VirtualCommandEntry };
|
|
@@ -6,25 +6,25 @@ let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
|
6
6
|
let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
7
7
|
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
8
8
|
let defu = require("defu");
|
|
9
|
-
let
|
|
9
|
+
let _shell_shock_plugin_update_components_update_builtin = require("@shell-shock/plugin-update/components/update-builtin");
|
|
10
10
|
|
|
11
|
-
//#region src/components/
|
|
11
|
+
//#region src/components/update-builtin.tsx
|
|
12
12
|
/**
|
|
13
|
-
* A component to generate the `
|
|
13
|
+
* A component to generate the `executeUpdate` function in the `shell-shock:update` builtin module.
|
|
14
14
|
*/
|
|
15
|
-
function
|
|
15
|
+
function ExecuteUpdateFunctionDeclaration() {
|
|
16
16
|
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
17
17
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
18
18
|
get when() {
|
|
19
|
-
return context.config.
|
|
19
|
+
return context.config.updateType !== false;
|
|
20
20
|
},
|
|
21
21
|
get children() {
|
|
22
22
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
23
23
|
"export": true,
|
|
24
24
|
async: true,
|
|
25
|
-
name: "
|
|
25
|
+
name: "executeUpdate",
|
|
26
26
|
get doc() {
|
|
27
|
-
return `Run
|
|
27
|
+
return `Run update processing for the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} application.`;
|
|
28
28
|
},
|
|
29
29
|
get children() {
|
|
30
30
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
@@ -55,14 +55,14 @@ function ExecuteUpgradeFunctionDeclaration() {
|
|
|
55
55
|
get children() {
|
|
56
56
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
57
57
|
get when() {
|
|
58
|
-
return context.config.
|
|
58
|
+
return context.config.updateType !== false && (context.config.updateType === "confirm" || context.config.updateType === "manual");
|
|
59
59
|
},
|
|
60
60
|
get fallback() {
|
|
61
61
|
return [(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`spinner.stop();
|
|
62
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})\`) : ""}\`);
|
|
63
63
|
|
|
64
64
|
try {
|
|
65
|
-
await
|
|
65
|
+
await update();
|
|
66
66
|
spinner.success("Update successful! Please restart the application to apply the update.");
|
|
67
67
|
|
|
68
68
|
writeLine("");
|
|
@@ -81,27 +81,27 @@ function ExecuteUpgradeFunctionDeclaration() {
|
|
|
81
81
|
get children() {
|
|
82
82
|
return [
|
|
83
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.
|
|
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.updateType !== false && context.config.updateType === "manual" ? ` \\nPlease run \`${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} update\` to update to the latest version.` : ""}\`); `),
|
|
85
85
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
86
86
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
87
87
|
get when() {
|
|
88
|
-
return context.config.
|
|
88
|
+
return context.config.updateType !== false && context.config.updateType === "confirm";
|
|
89
89
|
},
|
|
90
90
|
get children() {
|
|
91
|
-
return _alloy_js_core.code`const
|
|
91
|
+
return _alloy_js_core.code`const willUpdateNow = await confirm({
|
|
92
92
|
message: \`Would you like to update to v\${(result as CheckForUpdatesSuccessResult).latestVersion} now?\`,
|
|
93
93
|
initialValue: true
|
|
94
94
|
});
|
|
95
|
-
if (isCancel(
|
|
95
|
+
if (isCancel(willUpdateNow)) {
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
if (
|
|
99
|
+
if (willUpdateNow) {
|
|
100
100
|
spinner.text = \`Updating ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} to v\${(result as CheckForUpdatesSuccessResult).latestVersion}...\`;
|
|
101
101
|
spinner.start();
|
|
102
102
|
|
|
103
103
|
try {
|
|
104
|
-
await
|
|
104
|
+
await update();
|
|
105
105
|
spinner.success("Update successful! Please restart the application to apply the update.");
|
|
106
106
|
|
|
107
107
|
writeLine("");
|
|
@@ -117,7 +117,7 @@ function ExecuteUpgradeFunctionDeclaration() {
|
|
|
117
117
|
return { error: err };
|
|
118
118
|
}
|
|
119
119
|
} else {
|
|
120
|
-
help("Updates can be performed at any time by running the \`${(0, _shell_shock_core_plugin_utils.getAppBin)(context)}
|
|
120
|
+
help("Updates can be performed at any time by running the \`${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} update\` 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
121
|
} `;
|
|
122
122
|
}
|
|
123
123
|
})
|
|
@@ -140,11 +140,11 @@ function ExecuteUpgradeFunctionDeclaration() {
|
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
|
-
* A built-in
|
|
143
|
+
* A built-in update module for Shell Shock.
|
|
144
144
|
*/
|
|
145
|
-
function
|
|
145
|
+
function UpdateBuiltin(props) {
|
|
146
146
|
const [{ children, builtinImports }, rest] = (0, _alloy_js_core.splitProps)(props, ["children", "builtinImports"]);
|
|
147
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
147
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_plugin_update_components_update_builtin.UpdateBuiltin, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
148
148
|
get builtinImports() {
|
|
149
149
|
return (0, defu.defu)(builtinImports ?? {}, {
|
|
150
150
|
console: [
|
|
@@ -157,7 +157,7 @@ function UpgradeBuiltin(props) {
|
|
|
157
157
|
},
|
|
158
158
|
get children() {
|
|
159
159
|
return [
|
|
160
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
160
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(ExecuteUpdateFunctionDeclaration, {}),
|
|
161
161
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
162
162
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
163
163
|
get when() {
|
|
@@ -171,5 +171,5 @@ function UpgradeBuiltin(props) {
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
//#endregion
|
|
174
|
-
exports.
|
|
175
|
-
exports.
|
|
174
|
+
exports.ExecuteUpdateFunctionDeclaration = ExecuteUpdateFunctionDeclaration;
|
|
175
|
+
exports.UpdateBuiltin = UpdateBuiltin;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UpdateBuiltinProps } from "@shell-shock/plugin-update/components/update-builtin";
|
|
2
|
+
|
|
3
|
+
//#region src/components/update-builtin.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A component to generate the `executeUpdate` function in the `shell-shock:update` builtin module.
|
|
6
|
+
*/
|
|
7
|
+
declare function ExecuteUpdateFunctionDeclaration(): import("@alloy-js/core").Children;
|
|
8
|
+
/**
|
|
9
|
+
* A built-in update module for Shell Shock.
|
|
10
|
+
*/
|
|
11
|
+
declare function UpdateBuiltin(props: UpdateBuiltinProps): import("@alloy-js/core").Children;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ExecuteUpdateFunctionDeclaration, UpdateBuiltin };
|
|
14
|
+
//# sourceMappingURL=update-builtin.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-builtin.d.cts","names":[],"sources":["../../src/components/update-builtin.tsx"],"mappings":";;;;;AAqCA;iBAAgB,gCAAA,6BAAgC,QAAA;;;AAAA;iBAuJhC,aAAA,CAAc,KAAA,EAAO,kBAAkB,4BAAA,QAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UpdateBuiltinProps } from "@shell-shock/plugin-update/components/update-builtin";
|
|
2
|
+
|
|
3
|
+
//#region src/components/update-builtin.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A component to generate the `executeUpdate` function in the `shell-shock:update` builtin module.
|
|
6
|
+
*/
|
|
7
|
+
declare function ExecuteUpdateFunctionDeclaration(): import("@alloy-js/core").Children;
|
|
8
|
+
/**
|
|
9
|
+
* A built-in update module for Shell Shock.
|
|
10
|
+
*/
|
|
11
|
+
declare function UpdateBuiltin(props: UpdateBuiltinProps): import("@alloy-js/core").Children;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ExecuteUpdateFunctionDeclaration, UpdateBuiltin };
|
|
14
|
+
//# sourceMappingURL=update-builtin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-builtin.d.mts","names":[],"sources":["../../src/components/update-builtin.tsx"],"mappings":""}
|
|
@@ -5,25 +5,25 @@ import { getAppBin, getAppTitle } from "@shell-shock/core/plugin-utils";
|
|
|
5
5
|
import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
6
6
|
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
7
7
|
import { defu as defu$1 } from "defu";
|
|
8
|
-
import {
|
|
8
|
+
import { UpdateBuiltin as UpdateBuiltin$1 } from "@shell-shock/plugin-update/components/update-builtin";
|
|
9
9
|
|
|
10
|
-
//#region src/components/
|
|
10
|
+
//#region src/components/update-builtin.tsx
|
|
11
11
|
/**
|
|
12
|
-
* A component to generate the `
|
|
12
|
+
* A component to generate the `executeUpdate` function in the `shell-shock:update` builtin module.
|
|
13
13
|
*/
|
|
14
|
-
function
|
|
14
|
+
function ExecuteUpdateFunctionDeclaration() {
|
|
15
15
|
const context = usePowerlines();
|
|
16
16
|
return createComponent(Show, {
|
|
17
17
|
get when() {
|
|
18
|
-
return context.config.
|
|
18
|
+
return context.config.updateType !== false;
|
|
19
19
|
},
|
|
20
20
|
get children() {
|
|
21
21
|
return createComponent(FunctionDeclaration, {
|
|
22
22
|
"export": true,
|
|
23
23
|
async: true,
|
|
24
|
-
name: "
|
|
24
|
+
name: "executeUpdate",
|
|
25
25
|
get doc() {
|
|
26
|
-
return `Run
|
|
26
|
+
return `Run update processing for the ${getAppTitle(context, true)} application.`;
|
|
27
27
|
},
|
|
28
28
|
get children() {
|
|
29
29
|
return createComponent(IfStatement, {
|
|
@@ -54,14 +54,14 @@ function ExecuteUpgradeFunctionDeclaration() {
|
|
|
54
54
|
get children() {
|
|
55
55
|
return createComponent(Show, {
|
|
56
56
|
get when() {
|
|
57
|
-
return context.config.
|
|
57
|
+
return context.config.updateType !== false && (context.config.updateType === "confirm" || context.config.updateType === "manual");
|
|
58
58
|
},
|
|
59
59
|
get fallback() {
|
|
60
60
|
return [memo(() => code`spinner.stop();
|
|
61
61
|
info(\`A new version of ${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})\`) : ""}\`);
|
|
62
62
|
|
|
63
63
|
try {
|
|
64
|
-
await
|
|
64
|
+
await update();
|
|
65
65
|
spinner.success("Update successful! Please restart the application to apply the update.");
|
|
66
66
|
|
|
67
67
|
writeLine("");
|
|
@@ -80,27 +80,27 @@ function ExecuteUpgradeFunctionDeclaration() {
|
|
|
80
80
|
get children() {
|
|
81
81
|
return [
|
|
82
82
|
memo(() => code`spinner.stop();
|
|
83
|
-
warn(\`A new version of ${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.
|
|
83
|
+
warn(\`A new version of ${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.updateType !== false && context.config.updateType === "manual" ? ` \\nPlease run \`${getAppBin(context)} update\` to update to the latest version.` : ""}\`); `),
|
|
84
84
|
createComponent(Spacing, {}),
|
|
85
85
|
createComponent(Show, {
|
|
86
86
|
get when() {
|
|
87
|
-
return context.config.
|
|
87
|
+
return context.config.updateType !== false && context.config.updateType === "confirm";
|
|
88
88
|
},
|
|
89
89
|
get children() {
|
|
90
|
-
return code`const
|
|
90
|
+
return code`const willUpdateNow = await confirm({
|
|
91
91
|
message: \`Would you like to update to v\${(result as CheckForUpdatesSuccessResult).latestVersion} now?\`,
|
|
92
92
|
initialValue: true
|
|
93
93
|
});
|
|
94
|
-
if (isCancel(
|
|
94
|
+
if (isCancel(willUpdateNow)) {
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
if (
|
|
98
|
+
if (willUpdateNow) {
|
|
99
99
|
spinner.text = \`Updating ${getAppTitle(context, true)} to v\${(result as CheckForUpdatesSuccessResult).latestVersion}...\`;
|
|
100
100
|
spinner.start();
|
|
101
101
|
|
|
102
102
|
try {
|
|
103
|
-
await
|
|
103
|
+
await update();
|
|
104
104
|
spinner.success("Update successful! Please restart the application to apply the update.");
|
|
105
105
|
|
|
106
106
|
writeLine("");
|
|
@@ -116,7 +116,7 @@ function ExecuteUpgradeFunctionDeclaration() {
|
|
|
116
116
|
return { error: err };
|
|
117
117
|
}
|
|
118
118
|
} else {
|
|
119
|
-
help("Updates can be performed at any time by running the \`${getAppBin(context)}
|
|
119
|
+
help("Updates can be performed at any time by running the \`${getAppBin(context)} update\` command. Please remember that keeping your application up to date is important for ensuring you have the latest features, performance improvements, and security patches.");
|
|
120
120
|
} `;
|
|
121
121
|
}
|
|
122
122
|
})
|
|
@@ -139,11 +139,11 @@ function ExecuteUpgradeFunctionDeclaration() {
|
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
|
-
* A built-in
|
|
142
|
+
* A built-in update module for Shell Shock.
|
|
143
143
|
*/
|
|
144
|
-
function
|
|
144
|
+
function UpdateBuiltin(props) {
|
|
145
145
|
const [{ children, builtinImports }, rest] = splitProps(props, ["children", "builtinImports"]);
|
|
146
|
-
return createComponent(
|
|
146
|
+
return createComponent(UpdateBuiltin$1, mergeProps(rest, {
|
|
147
147
|
get builtinImports() {
|
|
148
148
|
return defu$1(builtinImports ?? {}, {
|
|
149
149
|
console: [
|
|
@@ -156,7 +156,7 @@ function UpgradeBuiltin(props) {
|
|
|
156
156
|
},
|
|
157
157
|
get children() {
|
|
158
158
|
return [
|
|
159
|
-
createComponent(
|
|
159
|
+
createComponent(ExecuteUpdateFunctionDeclaration, {}),
|
|
160
160
|
createComponent(Spacing, {}),
|
|
161
161
|
createComponent(Show, {
|
|
162
162
|
get when() {
|
|
@@ -170,5 +170,5 @@ function UpgradeBuiltin(props) {
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
//#endregion
|
|
173
|
-
export {
|
|
174
|
-
//# sourceMappingURL=
|
|
173
|
+
export { ExecuteUpdateFunctionDeclaration, UpdateBuiltin };
|
|
174
|
+
//# sourceMappingURL=update-builtin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-builtin.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -8,9 +8,9 @@ let _powerlines_plugin_alloy_core_components = require("@powerlines/plugin-alloy
|
|
|
8
8
|
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
9
9
|
let _stryke_path_join = require("@stryke/path/join");
|
|
10
10
|
let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
11
|
-
let _stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
12
11
|
let defu = require("defu");
|
|
13
12
|
defu = require_runtime.__toESM(defu);
|
|
13
|
+
let _stryke_string_format_pascal_case = require("@stryke/string-format/pascal-case");
|
|
14
14
|
let _powerlines_plugin_alloy_typescript_components_typescript_file = require("@powerlines/plugin-alloy/typescript/components/typescript-file");
|
|
15
15
|
let _shell_shock_preset_script_components_virtual_command_entry = require("@shell-shock/preset-script/components/virtual-command-entry");
|
|
16
16
|
|
|
@@ -6,8 +6,8 @@ import { Spacing } from "@powerlines/plugin-alloy/core/components";
|
|
|
6
6
|
import { isDynamicPathSegment } from "@shell-shock/core/plugin-utils";
|
|
7
7
|
import { joinPaths } from "@stryke/path/join";
|
|
8
8
|
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
9
|
-
import { pascalCase } from "@stryke/string-format/pascal-case";
|
|
10
9
|
import defu from "defu";
|
|
10
|
+
import { pascalCase } from "@stryke/string-format/pascal-case";
|
|
11
11
|
import { TypescriptFile } from "@powerlines/plugin-alloy/typescript/components/typescript-file";
|
|
12
12
|
import { VirtualCommandHandlerDeclaration } from "@shell-shock/preset-script/components/virtual-command-entry";
|
|
13
13
|
|
package/dist/index.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const require_components_banner_builtin = require('./components/banner-builtin.c
|
|
|
4
4
|
const require_components_command_router = require('./components/command-router.cjs');
|
|
5
5
|
const require_components_virtual_command_entry = require('./components/virtual-command-entry.cjs');
|
|
6
6
|
const require_components_command_entry = require('./components/command-entry.cjs');
|
|
7
|
-
const
|
|
7
|
+
const require_components_update_builtin = require('./components/update-builtin.cjs');
|
|
8
8
|
const require_get_global_options = require('./helpers/get-global-options.cjs');
|
|
9
9
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
10
10
|
let _alloy_js_core = require("@alloy-js/core");
|
|
@@ -24,8 +24,8 @@ let _shell_shock_plugin_prompts = require("@shell-shock/plugin-prompts");
|
|
|
24
24
|
_shell_shock_plugin_prompts = require_runtime.__toESM(_shell_shock_plugin_prompts);
|
|
25
25
|
let _shell_shock_plugin_skills = require("@shell-shock/plugin-skills");
|
|
26
26
|
_shell_shock_plugin_skills = require_runtime.__toESM(_shell_shock_plugin_skills);
|
|
27
|
-
let
|
|
28
|
-
|
|
27
|
+
let _shell_shock_plugin_update = require("@shell-shock/plugin-update");
|
|
28
|
+
_shell_shock_plugin_update = require_runtime.__toESM(_shell_shock_plugin_update);
|
|
29
29
|
let _shell_shock_preset_script_components_bin_entry = require("@shell-shock/preset-script/components/bin-entry");
|
|
30
30
|
let _stryke_path_join = require("@stryke/path/join");
|
|
31
31
|
let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
@@ -37,7 +37,7 @@ let powerlines = require("powerlines");
|
|
|
37
37
|
* The Shell Shock CLI Preset plugin.
|
|
38
38
|
*
|
|
39
39
|
* @remarks
|
|
40
|
-
* This preset includes a set of built-in modules and commands to create a CLI application, as well as configuration options to customize the generated code. It also includes the `prompts` plugin to provide interactive prompts in the CLI application, and the `
|
|
40
|
+
* This preset includes a set of built-in modules and commands to create a CLI application, as well as configuration options to customize the generated code. It also includes the `prompts` plugin to provide interactive prompts in the CLI application, and the `update` plugin to manage upgrading the local application's version.
|
|
41
41
|
*/
|
|
42
42
|
const plugin = (options = {}) => {
|
|
43
43
|
return [
|
|
@@ -47,7 +47,7 @@ const plugin = (options = {}) => {
|
|
|
47
47
|
...(0, powerlines.enable)((0, _shell_shock_plugin_changelog.default)(options.changelog), options.changelog !== false),
|
|
48
48
|
...(0, powerlines.enable)((0, _shell_shock_plugin_completions.default)(options.completions), options.completions !== false),
|
|
49
49
|
...(0, powerlines.enable)((0, _shell_shock_plugin_skills.default)(options.skills), options.skills !== false && (0, node_fs.existsSync)((0, _stryke_type_checks_is_set_object.isSetObject)(options.skills) && options.skills.path ? options.skills.path : (0, _stryke_path_join.joinPaths)(process.cwd(), "skills"))),
|
|
50
|
-
(0,
|
|
50
|
+
(0, _shell_shock_plugin_update.default)(options),
|
|
51
51
|
{
|
|
52
52
|
name: "shell-shock/cli-preset:main",
|
|
53
53
|
config() {
|
|
@@ -57,7 +57,7 @@ const plugin = (options = {}) => {
|
|
|
57
57
|
isCaseSensitive: false,
|
|
58
58
|
...options,
|
|
59
59
|
env: {
|
|
60
|
-
config: "@shell-shock/plugin-
|
|
60
|
+
config: "@shell-shock/plugin-update/types/env#ShellShockUpdateEnv",
|
|
61
61
|
validate: false
|
|
62
62
|
}
|
|
63
63
|
};
|
|
@@ -70,7 +70,7 @@ const plugin = (options = {}) => {
|
|
|
70
70
|
const commands = await (0, _shell_shock_core_plugin_utils.getCommandList)(this);
|
|
71
71
|
this.debug(`Rendering \`banner\` built-ins for each of the ${commands.length} command modules.`);
|
|
72
72
|
return (0, _powerlines_plugin_alloy_render.render)(this, [
|
|
73
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
73
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_update_builtin.UpdateBuiltin, {}),
|
|
74
74
|
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_banner_builtin.BannerBuiltin, { get command() {
|
|
75
75
|
return (0, _shell_shock_core_plugin_utils.computeBin)(_self$);
|
|
76
76
|
} }),
|
|
@@ -117,7 +117,7 @@ const plugin = (options = {}) => {
|
|
|
117
117
|
"isCancel"
|
|
118
118
|
],
|
|
119
119
|
env: ["env", "paths"],
|
|
120
|
-
|
|
120
|
+
update: ["executeUpdate"]
|
|
121
121
|
},
|
|
122
122
|
get children() {
|
|
123
123
|
return [
|
package/dist/index.d.cts
CHANGED
|
@@ -6,7 +6,7 @@ import { Plugin } from "powerlines";
|
|
|
6
6
|
* The Shell Shock CLI Preset plugin.
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
|
-
* This preset includes a set of built-in modules and commands to create a CLI application, as well as configuration options to customize the generated code. It also includes the `prompts` plugin to provide interactive prompts in the CLI application, and the `
|
|
9
|
+
* This preset includes a set of built-in modules and commands to create a CLI application, as well as configuration options to customize the generated code. It also includes the `prompts` plugin to provide interactive prompts in the CLI application, and the `update` plugin to manage upgrading the local application's version.
|
|
10
10
|
*/
|
|
11
11
|
declare const plugin: <TContext extends CLIPresetContext = CLIPresetContext>(options?: CLIPresetOptions) => Plugin<TContext>[];
|
|
12
12
|
//#endregion
|
package/dist/index.d.mts
CHANGED
|
@@ -6,7 +6,7 @@ import { Plugin } from "powerlines";
|
|
|
6
6
|
* The Shell Shock CLI Preset plugin.
|
|
7
7
|
*
|
|
8
8
|
* @remarks
|
|
9
|
-
* This preset includes a set of built-in modules and commands to create a CLI application, as well as configuration options to customize the generated code. It also includes the `prompts` plugin to provide interactive prompts in the CLI application, and the `
|
|
9
|
+
* This preset includes a set of built-in modules and commands to create a CLI application, as well as configuration options to customize the generated code. It also includes the `prompts` plugin to provide interactive prompts in the CLI application, and the `update` plugin to manage upgrading the local application's version.
|
|
10
10
|
*/
|
|
11
11
|
declare const plugin: <TContext extends CLIPresetContext = CLIPresetContext>(options?: CLIPresetOptions) => Plugin<TContext>[];
|
|
12
12
|
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { BannerBuiltin } from "./components/banner-builtin.mjs";
|
|
|
2
2
|
import { CommandRouter } from "./components/command-router.mjs";
|
|
3
3
|
import { VirtualCommandEntry } from "./components/virtual-command-entry.mjs";
|
|
4
4
|
import { CommandEntry } from "./components/command-entry.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { UpdateBuiltin } from "./components/update-builtin.mjs";
|
|
6
6
|
import { getGlobalOptions } from "./helpers/get-global-options.mjs";
|
|
7
7
|
import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
|
|
8
8
|
import { For, Show, code } from "@alloy-js/core";
|
|
@@ -16,7 +16,7 @@ import console from "@shell-shock/plugin-console";
|
|
|
16
16
|
import help from "@shell-shock/plugin-help";
|
|
17
17
|
import prompts from "@shell-shock/plugin-prompts";
|
|
18
18
|
import skills from "@shell-shock/plugin-skills";
|
|
19
|
-
import
|
|
19
|
+
import update from "@shell-shock/plugin-update";
|
|
20
20
|
import { BinEntry } from "@shell-shock/preset-script/components/bin-entry";
|
|
21
21
|
import { joinPaths } from "@stryke/path/join";
|
|
22
22
|
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
@@ -28,7 +28,7 @@ import { enable } from "powerlines";
|
|
|
28
28
|
* The Shell Shock CLI Preset plugin.
|
|
29
29
|
*
|
|
30
30
|
* @remarks
|
|
31
|
-
* This preset includes a set of built-in modules and commands to create a CLI application, as well as configuration options to customize the generated code. It also includes the `prompts` plugin to provide interactive prompts in the CLI application, and the `
|
|
31
|
+
* This preset includes a set of built-in modules and commands to create a CLI application, as well as configuration options to customize the generated code. It also includes the `prompts` plugin to provide interactive prompts in the CLI application, and the `update` plugin to manage upgrading the local application's version.
|
|
32
32
|
*/
|
|
33
33
|
const plugin = (options = {}) => {
|
|
34
34
|
return [
|
|
@@ -38,7 +38,7 @@ const plugin = (options = {}) => {
|
|
|
38
38
|
...enable(changelog(options.changelog), options.changelog !== false),
|
|
39
39
|
...enable(completions(options.completions), options.completions !== false),
|
|
40
40
|
...enable(skills(options.skills), options.skills !== false && existsSync(isSetObject(options.skills) && options.skills.path ? options.skills.path : joinPaths(process.cwd(), "skills"))),
|
|
41
|
-
|
|
41
|
+
update(options),
|
|
42
42
|
{
|
|
43
43
|
name: "shell-shock/cli-preset:main",
|
|
44
44
|
config() {
|
|
@@ -48,7 +48,7 @@ const plugin = (options = {}) => {
|
|
|
48
48
|
isCaseSensitive: false,
|
|
49
49
|
...options,
|
|
50
50
|
env: {
|
|
51
|
-
config: "@shell-shock/plugin-
|
|
51
|
+
config: "@shell-shock/plugin-update/types/env#ShellShockUpdateEnv",
|
|
52
52
|
validate: false
|
|
53
53
|
}
|
|
54
54
|
};
|
|
@@ -61,7 +61,7 @@ const plugin = (options = {}) => {
|
|
|
61
61
|
const commands = await getCommandList(this);
|
|
62
62
|
this.debug(`Rendering \`banner\` built-ins for each of the ${commands.length} command modules.`);
|
|
63
63
|
return render(this, [
|
|
64
|
-
createComponent(
|
|
64
|
+
createComponent(UpdateBuiltin, {}),
|
|
65
65
|
createComponent(BannerBuiltin, { get command() {
|
|
66
66
|
return computeBin(_self$);
|
|
67
67
|
} }),
|
|
@@ -108,7 +108,7 @@ const plugin = (options = {}) => {
|
|
|
108
108
|
"isCancel"
|
|
109
109
|
],
|
|
110
110
|
env: ["env", "paths"],
|
|
111
|
-
|
|
111
|
+
update: ["executeUpdate"]
|
|
112
112
|
},
|
|
113
113
|
get children() {
|
|
114
114
|
return [
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig,
|
|
2
|
-
export { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig,
|
|
1
|
+
import { CLIPresetBannerFontOption, CLIPresetBannerOption, CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig, UpdateType } from "./plugin.cjs";
|
|
2
|
+
export { CLIPresetBannerFontOption, CLIPresetBannerOption, CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig, UpdateType };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig,
|
|
2
|
-
export { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig,
|
|
1
|
+
import { CLIPresetBannerFontOption, CLIPresetBannerOption, CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig, UpdateType } from "./plugin.mjs";
|
|
2
|
+
export { CLIPresetBannerFontOption, CLIPresetBannerOption, CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig, UpdateType };
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommandBase, CommandOption, Context, UserConfig } from "@shell-shock/core";
|
|
2
2
|
import { ResolvedConfig } from "powerlines";
|
|
3
|
-
import { BannerPluginContext,
|
|
3
|
+
import { BannerPluginContext, BannerPluginResolvedConfig, BannerPluginUserConfig } from "@shell-shock/plugin-banner";
|
|
4
4
|
import { ChangelogPluginContext, ChangelogPluginOptions, ChangelogPluginResolvedConfig, ChangelogPluginUserConfig } from "@shell-shock/plugin-changelog";
|
|
5
5
|
import { CompletionsPluginContext, CompletionsPluginOptions, CompletionsPluginResolvedConfig, CompletionsPluginUserConfig } from "@shell-shock/plugin-completions";
|
|
6
6
|
import { ConsolePluginContext, ConsolePluginResolvedConfig, ConsolePluginUserConfig } from "@shell-shock/plugin-console";
|
|
@@ -8,12 +8,114 @@ import { HelpPluginContext, HelpPluginOptions, HelpPluginResolvedConfig, HelpPlu
|
|
|
8
8
|
import { PromptsPluginContext, PromptsPluginOptions, PromptsPluginResolvedConfig, PromptsPluginUserConfig } from "@shell-shock/plugin-prompts/types/plugin";
|
|
9
9
|
import { SkillsPluginContext, SkillsPluginOptions, SkillsPluginResolvedConfig, SkillsPluginUserConfig } from "@shell-shock/plugin-skills";
|
|
10
10
|
import { ThemePluginContext, ThemePluginResolvedConfig, ThemePluginUserConfig } from "@shell-shock/plugin-theme/types/plugin";
|
|
11
|
-
import {
|
|
11
|
+
import { UpdatePluginContext, UpdatePluginOptions, UpdatePluginResolvedConfig, UpdatePluginUserConfig } from "@shell-shock/plugin-update/types/plugin";
|
|
12
12
|
import { ScriptPresetOptions } from "@shell-shock/preset-script/types/plugin";
|
|
13
13
|
|
|
14
14
|
//#region src/types/plugin.d.ts
|
|
15
|
-
type
|
|
16
|
-
type
|
|
15
|
+
type UpdateType = "confirm" | "auto" | "manual";
|
|
16
|
+
type CLIPresetBannerFontOption = "console" | "block" | "simpleBlock" | "simple" | "3d" | "simple3d" | "chrome" | "huge" | "shade" | "slick" | "grid" | "pallet" | "tiny";
|
|
17
|
+
interface CLIPresetBannerOption {
|
|
18
|
+
/**
|
|
19
|
+
* The text to display in the banner header. If not specified, the application name will be used.
|
|
20
|
+
*/
|
|
21
|
+
text?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The font to use for the banner header.
|
|
24
|
+
*
|
|
25
|
+
* @see https://github.com/dominikwilkowski/cfonts
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* This option determines the visual style of the banner displayed when running the CLI application. The available fonts include:
|
|
29
|
+
* - `tiny` (default): A small, compact font that is ideal for minimalist banners or when space is limited.
|
|
30
|
+
* 
|
|
31
|
+
* - `console`: A font that mimics the appearance of text in a console or terminal.
|
|
32
|
+
* 
|
|
33
|
+
* - `block`: A bold, block-style font with thick lines and sharp edges.
|
|
34
|
+
* 
|
|
35
|
+
* - `simpleBlock`: A simpler version of the block font with less ornamentation.
|
|
36
|
+
* 
|
|
37
|
+
* - `simple`: A clean and straightforward font with minimal styling.
|
|
38
|
+
* 
|
|
39
|
+
* - `3d`: A three-dimensional font with shading and depth effects.
|
|
40
|
+
* 
|
|
41
|
+
* - `simple3d`: A simpler version of the 3D font with less shading and depth.
|
|
42
|
+
* 
|
|
43
|
+
* - `chrome`: A shiny, metallic font with a futuristic appearance.
|
|
44
|
+
* 
|
|
45
|
+
* - `huge`: An extra-large font that makes a bold statement.
|
|
46
|
+
* 
|
|
47
|
+
* - `shade`: A font with a shadow effect that adds depth and dimension.
|
|
48
|
+
* 
|
|
49
|
+
* - `slick`: A sleek and modern font with smooth curves and a polished look.
|
|
50
|
+
* 
|
|
51
|
+
* - `grid`: A monospaced font that resembles text on a grid or graph paper.
|
|
52
|
+
* 
|
|
53
|
+
* - `pallet`: A font with a hand-drawn, artistic style that adds a creative touch to the banner.
|
|
54
|
+
* 
|
|
55
|
+
*
|
|
56
|
+
* @defaultValue "tiny"
|
|
57
|
+
*/
|
|
58
|
+
font?: CLIPresetBannerFontOption;
|
|
59
|
+
/**
|
|
60
|
+
* Colors for the banner font.
|
|
61
|
+
*
|
|
62
|
+
* @defaultValue []
|
|
63
|
+
*/
|
|
64
|
+
colors?: string[];
|
|
65
|
+
/**
|
|
66
|
+
* Color string for the banner background.
|
|
67
|
+
*
|
|
68
|
+
* @defaultValue "Black"
|
|
69
|
+
*/
|
|
70
|
+
background?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Alias for `background`.
|
|
73
|
+
*/
|
|
74
|
+
backgroundColor?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Space between letters.
|
|
77
|
+
*
|
|
78
|
+
* @defaultValue set by selected font face
|
|
79
|
+
*/
|
|
80
|
+
letterSpacing?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Space between lines.
|
|
83
|
+
*
|
|
84
|
+
* @defaultValue 1
|
|
85
|
+
*/
|
|
86
|
+
lineHeight?: number;
|
|
87
|
+
/**
|
|
88
|
+
* Do not output spaces before and after the banner output.
|
|
89
|
+
*
|
|
90
|
+
* @defaultValue false
|
|
91
|
+
*/
|
|
92
|
+
spaceless?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Maximum number of characters per line.
|
|
95
|
+
*
|
|
96
|
+
* @defaultValue width of console window
|
|
97
|
+
*/
|
|
98
|
+
maxLength?: number;
|
|
99
|
+
/**
|
|
100
|
+
* Gradient color pair.
|
|
101
|
+
*
|
|
102
|
+
* @defaultValue false
|
|
103
|
+
*/
|
|
104
|
+
gradient?: string | string[] | boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Calculate gradients per line when enabled.
|
|
107
|
+
*/
|
|
108
|
+
independentGradient?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Enable transition gradients.
|
|
111
|
+
*/
|
|
112
|
+
transitionGradient?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* The environment cfonts is running in.
|
|
115
|
+
*/
|
|
116
|
+
env?: string;
|
|
117
|
+
}
|
|
118
|
+
type CLIPresetOptions = Omit<ScriptPresetOptions, "globalOptions"> & HelpPluginOptions & PromptsPluginOptions & UpdatePluginOptions & {
|
|
17
119
|
/**
|
|
18
120
|
* The default interactive mode to apply to commands.
|
|
19
121
|
*
|
|
@@ -42,21 +144,21 @@ type CLIPresetOptions = Omit<ScriptPresetOptions, "globalOptions"> & HelpPluginO
|
|
|
42
144
|
*/
|
|
43
145
|
globalOptions?: CommandOption[] | ((context: Context, input: CommandBase) => CommandOption[]) | false;
|
|
44
146
|
/**
|
|
45
|
-
* The type of
|
|
147
|
+
* The type of update to perform. This option determines how the update process will be handled.
|
|
46
148
|
*
|
|
47
149
|
* @remarks
|
|
48
|
-
* The
|
|
49
|
-
* - `"confirm"` - the user will be prompted to confirm the
|
|
50
|
-
* - `"auto"` - the
|
|
51
|
-
* - `"manual"` - the command will only display the latest available version without performing any
|
|
150
|
+
* The update logic will behave differently based on the value of this field:
|
|
151
|
+
* - `"confirm"` - the user will be prompted to confirm the update before it is performed. This is the default behavior and is recommended for most users, as it provides an extra layer of safety against unintended updates.
|
|
152
|
+
* - `"auto"` - the update will be performed automatically without any user confirmation. This option is suitable for advanced users who want a seamless update experience and are confident in the stability of new versions.
|
|
153
|
+
* - `"manual"` - the command will only display the latest available version without performing any update. This option is useful for users who want to check for updates without making any changes to their system.
|
|
52
154
|
*
|
|
53
155
|
* @defaultValue "confirm"
|
|
54
156
|
*/
|
|
55
|
-
|
|
157
|
+
updateType?: UpdateType | false;
|
|
56
158
|
/**
|
|
57
159
|
* The title to display in the banner for the CLI application. If not specified, the application name will be used.
|
|
58
160
|
*/
|
|
59
|
-
banner?:
|
|
161
|
+
banner?: string | CLIPresetBannerOption;
|
|
60
162
|
/**
|
|
61
163
|
* Configuration options for the `completions` plugin. This field allows you to customize the behavior of the `completions` plugin, which provides commands for generating shell completion scripts for the CLI application. You can specify which shells to generate completions for, and other related settings.
|
|
62
164
|
*/
|
|
@@ -73,9 +175,9 @@ type CLIPresetOptions = Omit<ScriptPresetOptions, "globalOptions"> & HelpPluginO
|
|
|
73
175
|
*/
|
|
74
176
|
skills?: SkillsPluginOptions | false;
|
|
75
177
|
};
|
|
76
|
-
type CLIPresetUserConfig = UserConfig & ThemePluginUserConfig & ConsolePluginUserConfig & PromptsPluginUserConfig & BannerPluginUserConfig & HelpPluginUserConfig & CompletionsPluginUserConfig & ChangelogPluginUserConfig & SkillsPluginUserConfig &
|
|
77
|
-
type CLIPresetResolvedConfig = ResolvedConfig & ThemePluginResolvedConfig & ConsolePluginResolvedConfig & PromptsPluginResolvedConfig & BannerPluginResolvedConfig & HelpPluginResolvedConfig & CompletionsPluginResolvedConfig & ChangelogPluginResolvedConfig & SkillsPluginResolvedConfig &
|
|
78
|
-
type CLIPresetContext<TResolvedConfig extends CLIPresetResolvedConfig = CLIPresetResolvedConfig> = Context<TResolvedConfig> & ThemePluginContext<TResolvedConfig> & ConsolePluginContext<TResolvedConfig> & PromptsPluginContext<TResolvedConfig> & BannerPluginContext<TResolvedConfig> & HelpPluginContext<TResolvedConfig> & CompletionsPluginContext<TResolvedConfig> & ChangelogPluginContext<TResolvedConfig> & SkillsPluginContext<TResolvedConfig> &
|
|
178
|
+
type CLIPresetUserConfig = UserConfig & ThemePluginUserConfig & ConsolePluginUserConfig & PromptsPluginUserConfig & BannerPluginUserConfig & HelpPluginUserConfig & CompletionsPluginUserConfig & ChangelogPluginUserConfig & SkillsPluginUserConfig & UpdatePluginUserConfig & CLIPresetOptions;
|
|
179
|
+
type CLIPresetResolvedConfig = ResolvedConfig & ThemePluginResolvedConfig & ConsolePluginResolvedConfig & PromptsPluginResolvedConfig & BannerPluginResolvedConfig & HelpPluginResolvedConfig & CompletionsPluginResolvedConfig & ChangelogPluginResolvedConfig & SkillsPluginResolvedConfig & UpdatePluginResolvedConfig & Required<CLIPresetOptions>;
|
|
180
|
+
type CLIPresetContext<TResolvedConfig extends CLIPresetResolvedConfig = CLIPresetResolvedConfig> = Context<TResolvedConfig> & ThemePluginContext<TResolvedConfig> & ConsolePluginContext<TResolvedConfig> & PromptsPluginContext<TResolvedConfig> & BannerPluginContext<TResolvedConfig> & HelpPluginContext<TResolvedConfig> & CompletionsPluginContext<TResolvedConfig> & ChangelogPluginContext<TResolvedConfig> & SkillsPluginContext<TResolvedConfig> & UpdatePluginContext<TResolvedConfig>;
|
|
79
181
|
//#endregion
|
|
80
|
-
export { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig,
|
|
182
|
+
export { CLIPresetBannerFontOption, CLIPresetBannerOption, CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig, UpdateType };
|
|
81
183
|
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;;;;;;KA8EY,UAAA;AAAA,KAEA,yBAAA;AAAA,UAeK,qBAAA;EAjBK;;;EAqBpB,IAAA;EAnBU;;;;AAAyB;AAerC;;;;;;;;;;;;;;;;;;;AA+GK;AAGL;;;;;;;;;;;EAxEE,IAAA,GAAO,yBAAyB;EAuHjB;;;;;EAhHf,MAAA;EAuI8B;;;;;EAhI9B,UAAA;EA6DA;;;EAxDA,eAAA;EAsFiB;;;;;EA/EjB,aAAA;EA6Fe;;;;;EAtFf,UAAA;EAqGE;;;;;EA9FF,SAAA;EAyGU;;;;;EAlGV,SAAA;EAqGA;;;;;EA9FA,QAAA;EAoGA;;;EA/FA,mBAAA;EAsFgC;;;EAjFhC,kBAAA;EAqFA;;;EAhFA,GAAA;AAAA;AAAA,KAGU,gBAAA,GAAmB,IAAA,CAAK,mBAAA,qBAClC,iBAAA,GACA,oBAAA,GACA,mBAAA;EAgFA;;AAAgB;AAElB;;;;;;;;EAtEI,WAAA;EA4EF;;;;;;;;;;;;;;EA5DE,aAAA,GACI,aAAA,OACE,OAAA,EAAS,OAAA,EAAS,KAAA,EAAO,WAAA,KAAgB,aAAA;EA2DjD;;;;;;AAGyB;AAE3B;;;;EAlDI,UAAA,GAAa,UAAA;EAoDL;;;EA/CR,MAAA,YAAkB,qBAAA;EAiDC;;;EA5CnB,WAAA,GAAc,IAAA,CAAK,wBAAA;EA8CD;;;EAzClB,SAAA,GAAY,sBAAA;EA2CW;;;;;;EAnCvB,MAAA,GAAS,mBAAA;AAAA;AAAA,KAGD,mBAAA,GAAsB,UAAA,GAChC,qBAAA,GACA,uBAAA,GACA,uBAAA,GACA,sBAAA,GACA,oBAAA,GACA,2BAAA,GACA,yBAAA,GACA,sBAAA,GACA,sBAAA,GACA,gBAAA;AAAA,KAEU,uBAAA,GAA0B,cAAA,GACpC,yBAAA,GACA,2BAAA,GACA,2BAAA,GACA,0BAAA,GACA,wBAAA,GACA,+BAAA,GACA,6BAAA,GACA,0BAAA,GACA,0BAAA,GACA,QAAA,CAAS,gBAAA;AAAA,KAEC,gBAAA,yBACc,uBAAA,GAA0B,uBAAA,IAChD,OAAA,CAAQ,eAAA,IACV,kBAAA,CAAmB,eAAA,IACnB,oBAAA,CAAqB,eAAA,IACrB,oBAAA,CAAqB,eAAA,IACrB,mBAAA,CAAoB,eAAA,IACpB,iBAAA,CAAkB,eAAA,IAClB,wBAAA,CAAyB,eAAA,IACzB,sBAAA,CAAuB,eAAA,IACvB,mBAAA,CAAoB,eAAA,IACpB,mBAAA,CAAoB,eAAA"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -5,15 +5,117 @@ import { HelpPluginContext, HelpPluginOptions, HelpPluginResolvedConfig, HelpPlu
|
|
|
5
5
|
import { SkillsPluginContext, SkillsPluginOptions, SkillsPluginResolvedConfig, SkillsPluginUserConfig } from "@shell-shock/plugin-skills";
|
|
6
6
|
import { ResolvedConfig } from "powerlines";
|
|
7
7
|
import { CommandBase, CommandOption, Context, UserConfig } from "@shell-shock/core";
|
|
8
|
-
import { BannerPluginContext,
|
|
8
|
+
import { BannerPluginContext, BannerPluginResolvedConfig, BannerPluginUserConfig } from "@shell-shock/plugin-banner";
|
|
9
9
|
import { PromptsPluginContext, PromptsPluginOptions, PromptsPluginResolvedConfig, PromptsPluginUserConfig } from "@shell-shock/plugin-prompts/types/plugin";
|
|
10
10
|
import { ThemePluginContext, ThemePluginResolvedConfig, ThemePluginUserConfig } from "@shell-shock/plugin-theme/types/plugin";
|
|
11
|
-
import {
|
|
11
|
+
import { UpdatePluginContext, UpdatePluginOptions, UpdatePluginResolvedConfig, UpdatePluginUserConfig } from "@shell-shock/plugin-update/types/plugin";
|
|
12
12
|
import { ScriptPresetOptions } from "@shell-shock/preset-script/types/plugin";
|
|
13
13
|
|
|
14
14
|
//#region src/types/plugin.d.ts
|
|
15
|
-
type
|
|
16
|
-
type
|
|
15
|
+
type UpdateType = "confirm" | "auto" | "manual";
|
|
16
|
+
type CLIPresetBannerFontOption = "console" | "block" | "simpleBlock" | "simple" | "3d" | "simple3d" | "chrome" | "huge" | "shade" | "slick" | "grid" | "pallet" | "tiny";
|
|
17
|
+
interface CLIPresetBannerOption {
|
|
18
|
+
/**
|
|
19
|
+
* The text to display in the banner header. If not specified, the application name will be used.
|
|
20
|
+
*/
|
|
21
|
+
text?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The font to use for the banner header.
|
|
24
|
+
*
|
|
25
|
+
* @see https://github.com/dominikwilkowski/cfonts
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* This option determines the visual style of the banner displayed when running the CLI application. The available fonts include:
|
|
29
|
+
* - `tiny` (default): A small, compact font that is ideal for minimalist banners or when space is limited.
|
|
30
|
+
* 
|
|
31
|
+
* - `console`: A font that mimics the appearance of text in a console or terminal.
|
|
32
|
+
* 
|
|
33
|
+
* - `block`: A bold, block-style font with thick lines and sharp edges.
|
|
34
|
+
* 
|
|
35
|
+
* - `simpleBlock`: A simpler version of the block font with less ornamentation.
|
|
36
|
+
* 
|
|
37
|
+
* - `simple`: A clean and straightforward font with minimal styling.
|
|
38
|
+
* 
|
|
39
|
+
* - `3d`: A three-dimensional font with shading and depth effects.
|
|
40
|
+
* 
|
|
41
|
+
* - `simple3d`: A simpler version of the 3D font with less shading and depth.
|
|
42
|
+
* 
|
|
43
|
+
* - `chrome`: A shiny, metallic font with a futuristic appearance.
|
|
44
|
+
* 
|
|
45
|
+
* - `huge`: An extra-large font that makes a bold statement.
|
|
46
|
+
* 
|
|
47
|
+
* - `shade`: A font with a shadow effect that adds depth and dimension.
|
|
48
|
+
* 
|
|
49
|
+
* - `slick`: A sleek and modern font with smooth curves and a polished look.
|
|
50
|
+
* 
|
|
51
|
+
* - `grid`: A monospaced font that resembles text on a grid or graph paper.
|
|
52
|
+
* 
|
|
53
|
+
* - `pallet`: A font with a hand-drawn, artistic style that adds a creative touch to the banner.
|
|
54
|
+
* 
|
|
55
|
+
*
|
|
56
|
+
* @defaultValue "tiny"
|
|
57
|
+
*/
|
|
58
|
+
font?: CLIPresetBannerFontOption;
|
|
59
|
+
/**
|
|
60
|
+
* Colors for the banner font.
|
|
61
|
+
*
|
|
62
|
+
* @defaultValue []
|
|
63
|
+
*/
|
|
64
|
+
colors?: string[];
|
|
65
|
+
/**
|
|
66
|
+
* Color string for the banner background.
|
|
67
|
+
*
|
|
68
|
+
* @defaultValue "Black"
|
|
69
|
+
*/
|
|
70
|
+
background?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Alias for `background`.
|
|
73
|
+
*/
|
|
74
|
+
backgroundColor?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Space between letters.
|
|
77
|
+
*
|
|
78
|
+
* @defaultValue set by selected font face
|
|
79
|
+
*/
|
|
80
|
+
letterSpacing?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Space between lines.
|
|
83
|
+
*
|
|
84
|
+
* @defaultValue 1
|
|
85
|
+
*/
|
|
86
|
+
lineHeight?: number;
|
|
87
|
+
/**
|
|
88
|
+
* Do not output spaces before and after the banner output.
|
|
89
|
+
*
|
|
90
|
+
* @defaultValue false
|
|
91
|
+
*/
|
|
92
|
+
spaceless?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Maximum number of characters per line.
|
|
95
|
+
*
|
|
96
|
+
* @defaultValue width of console window
|
|
97
|
+
*/
|
|
98
|
+
maxLength?: number;
|
|
99
|
+
/**
|
|
100
|
+
* Gradient color pair.
|
|
101
|
+
*
|
|
102
|
+
* @defaultValue false
|
|
103
|
+
*/
|
|
104
|
+
gradient?: string | string[] | boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Calculate gradients per line when enabled.
|
|
107
|
+
*/
|
|
108
|
+
independentGradient?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Enable transition gradients.
|
|
111
|
+
*/
|
|
112
|
+
transitionGradient?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* The environment cfonts is running in.
|
|
115
|
+
*/
|
|
116
|
+
env?: string;
|
|
117
|
+
}
|
|
118
|
+
type CLIPresetOptions = Omit<ScriptPresetOptions, "globalOptions"> & HelpPluginOptions & PromptsPluginOptions & UpdatePluginOptions & {
|
|
17
119
|
/**
|
|
18
120
|
* The default interactive mode to apply to commands.
|
|
19
121
|
*
|
|
@@ -42,21 +144,21 @@ type CLIPresetOptions = Omit<ScriptPresetOptions, "globalOptions"> & HelpPluginO
|
|
|
42
144
|
*/
|
|
43
145
|
globalOptions?: CommandOption[] | ((context: Context, input: CommandBase) => CommandOption[]) | false;
|
|
44
146
|
/**
|
|
45
|
-
* The type of
|
|
147
|
+
* The type of update to perform. This option determines how the update process will be handled.
|
|
46
148
|
*
|
|
47
149
|
* @remarks
|
|
48
|
-
* The
|
|
49
|
-
* - `"confirm"` - the user will be prompted to confirm the
|
|
50
|
-
* - `"auto"` - the
|
|
51
|
-
* - `"manual"` - the command will only display the latest available version without performing any
|
|
150
|
+
* The update logic will behave differently based on the value of this field:
|
|
151
|
+
* - `"confirm"` - the user will be prompted to confirm the update before it is performed. This is the default behavior and is recommended for most users, as it provides an extra layer of safety against unintended updates.
|
|
152
|
+
* - `"auto"` - the update will be performed automatically without any user confirmation. This option is suitable for advanced users who want a seamless update experience and are confident in the stability of new versions.
|
|
153
|
+
* - `"manual"` - the command will only display the latest available version without performing any update. This option is useful for users who want to check for updates without making any changes to their system.
|
|
52
154
|
*
|
|
53
155
|
* @defaultValue "confirm"
|
|
54
156
|
*/
|
|
55
|
-
|
|
157
|
+
updateType?: UpdateType | false;
|
|
56
158
|
/**
|
|
57
159
|
* The title to display in the banner for the CLI application. If not specified, the application name will be used.
|
|
58
160
|
*/
|
|
59
|
-
banner?:
|
|
161
|
+
banner?: string | CLIPresetBannerOption;
|
|
60
162
|
/**
|
|
61
163
|
* Configuration options for the `completions` plugin. This field allows you to customize the behavior of the `completions` plugin, which provides commands for generating shell completion scripts for the CLI application. You can specify which shells to generate completions for, and other related settings.
|
|
62
164
|
*/
|
|
@@ -73,9 +175,9 @@ type CLIPresetOptions = Omit<ScriptPresetOptions, "globalOptions"> & HelpPluginO
|
|
|
73
175
|
*/
|
|
74
176
|
skills?: SkillsPluginOptions | false;
|
|
75
177
|
};
|
|
76
|
-
type CLIPresetUserConfig = UserConfig & ThemePluginUserConfig & ConsolePluginUserConfig & PromptsPluginUserConfig & BannerPluginUserConfig & HelpPluginUserConfig & CompletionsPluginUserConfig & ChangelogPluginUserConfig & SkillsPluginUserConfig &
|
|
77
|
-
type CLIPresetResolvedConfig = ResolvedConfig & ThemePluginResolvedConfig & ConsolePluginResolvedConfig & PromptsPluginResolvedConfig & BannerPluginResolvedConfig & HelpPluginResolvedConfig & CompletionsPluginResolvedConfig & ChangelogPluginResolvedConfig & SkillsPluginResolvedConfig &
|
|
78
|
-
type CLIPresetContext<TResolvedConfig extends CLIPresetResolvedConfig = CLIPresetResolvedConfig> = Context<TResolvedConfig> & ThemePluginContext<TResolvedConfig> & ConsolePluginContext<TResolvedConfig> & PromptsPluginContext<TResolvedConfig> & BannerPluginContext<TResolvedConfig> & HelpPluginContext<TResolvedConfig> & CompletionsPluginContext<TResolvedConfig> & ChangelogPluginContext<TResolvedConfig> & SkillsPluginContext<TResolvedConfig> &
|
|
178
|
+
type CLIPresetUserConfig = UserConfig & ThemePluginUserConfig & ConsolePluginUserConfig & PromptsPluginUserConfig & BannerPluginUserConfig & HelpPluginUserConfig & CompletionsPluginUserConfig & ChangelogPluginUserConfig & SkillsPluginUserConfig & UpdatePluginUserConfig & CLIPresetOptions;
|
|
179
|
+
type CLIPresetResolvedConfig = ResolvedConfig & ThemePluginResolvedConfig & ConsolePluginResolvedConfig & PromptsPluginResolvedConfig & BannerPluginResolvedConfig & HelpPluginResolvedConfig & CompletionsPluginResolvedConfig & ChangelogPluginResolvedConfig & SkillsPluginResolvedConfig & UpdatePluginResolvedConfig & Required<CLIPresetOptions>;
|
|
180
|
+
type CLIPresetContext<TResolvedConfig extends CLIPresetResolvedConfig = CLIPresetResolvedConfig> = Context<TResolvedConfig> & ThemePluginContext<TResolvedConfig> & ConsolePluginContext<TResolvedConfig> & PromptsPluginContext<TResolvedConfig> & BannerPluginContext<TResolvedConfig> & HelpPluginContext<TResolvedConfig> & CompletionsPluginContext<TResolvedConfig> & ChangelogPluginContext<TResolvedConfig> & SkillsPluginContext<TResolvedConfig> & UpdatePluginContext<TResolvedConfig>;
|
|
79
181
|
//#endregion
|
|
80
|
-
export { CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig,
|
|
182
|
+
export { CLIPresetBannerFontOption, CLIPresetBannerOption, CLIPresetContext, CLIPresetOptions, CLIPresetResolvedConfig, CLIPresetUserConfig, UpdateType };
|
|
81
183
|
//# sourceMappingURL=plugin.d.mts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shell-shock/preset-cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.25",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing a Shell Shock plugin to generate source code given a list design tokens.",
|
|
6
6
|
"keywords": [
|
|
@@ -115,18 +115,18 @@
|
|
|
115
115
|
"default": "./dist/components/command-router.mjs"
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
|
-
"./components/
|
|
118
|
+
"./components/update-builtin": {
|
|
119
119
|
"require": {
|
|
120
|
-
"types": "./dist/components/
|
|
121
|
-
"default": "./dist/components/
|
|
120
|
+
"types": "./dist/components/update-builtin.d.cts",
|
|
121
|
+
"default": "./dist/components/update-builtin.cjs"
|
|
122
122
|
},
|
|
123
123
|
"import": {
|
|
124
|
-
"types": "./dist/components/
|
|
125
|
-
"default": "./dist/components/
|
|
124
|
+
"types": "./dist/components/update-builtin.d.mts",
|
|
125
|
+
"default": "./dist/components/update-builtin.mjs"
|
|
126
126
|
},
|
|
127
127
|
"default": {
|
|
128
|
-
"types": "./dist/components/
|
|
129
|
-
"default": "./dist/components/
|
|
128
|
+
"types": "./dist/components/update-builtin.d.mts",
|
|
129
|
+
"default": "./dist/components/update-builtin.mjs"
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
132
|
"./components/virtual-command-entry": {
|
|
@@ -181,29 +181,29 @@
|
|
|
181
181
|
"dependencies": {
|
|
182
182
|
"@alloy-js/core": "^0.23.1",
|
|
183
183
|
"@alloy-js/typescript": "^0.23.0",
|
|
184
|
-
"@powerlines/deepkit": "^0.9.
|
|
185
|
-
"@powerlines/plugin-alloy": "^0.26.
|
|
186
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
187
|
-
"@shell-shock/core": "0.17.
|
|
188
|
-
"@shell-shock/plugin-banner": "0.1.
|
|
189
|
-
"@shell-shock/plugin-changelog": "0.1.
|
|
190
|
-
"@shell-shock/plugin-completions": "0.4.
|
|
191
|
-
"@shell-shock/plugin-console": "0.2.
|
|
192
|
-
"@shell-shock/plugin-help": "0.2.
|
|
193
|
-
"@shell-shock/plugin-prompts": "0.3.
|
|
194
|
-
"@shell-shock/plugin-skills": "0.0.
|
|
195
|
-
"@shell-shock/plugin-theme": "0.4.
|
|
196
|
-
"@shell-shock/plugin-
|
|
197
|
-
"@shell-shock/preset-script": "0.6.
|
|
184
|
+
"@powerlines/deepkit": "^0.9.81",
|
|
185
|
+
"@powerlines/plugin-alloy": "^0.26.220",
|
|
186
|
+
"@powerlines/plugin-plugin": "^0.12.539",
|
|
187
|
+
"@shell-shock/core": "0.17.13",
|
|
188
|
+
"@shell-shock/plugin-banner": "0.1.40",
|
|
189
|
+
"@shell-shock/plugin-changelog": "0.1.16",
|
|
190
|
+
"@shell-shock/plugin-completions": "0.4.21",
|
|
191
|
+
"@shell-shock/plugin-console": "0.2.17",
|
|
192
|
+
"@shell-shock/plugin-help": "0.2.31",
|
|
193
|
+
"@shell-shock/plugin-prompts": "0.3.54",
|
|
194
|
+
"@shell-shock/plugin-skills": "0.0.4",
|
|
195
|
+
"@shell-shock/plugin-theme": "0.4.26",
|
|
196
|
+
"@shell-shock/plugin-update": "0.1.58",
|
|
197
|
+
"@shell-shock/preset-script": "0.6.68",
|
|
198
198
|
"@stryke/path": "^0.29.11",
|
|
199
199
|
"@stryke/string-format": "^0.17.26",
|
|
200
200
|
"@stryke/type-checks": "^0.6.17",
|
|
201
201
|
"@stryke/types": "^0.12.12",
|
|
202
202
|
"cfonts": "^3.3.1",
|
|
203
203
|
"defu": "^6.1.7",
|
|
204
|
-
"powerlines": "^0.47.
|
|
204
|
+
"powerlines": "^0.47.127"
|
|
205
205
|
},
|
|
206
206
|
"devDependencies": { "@stryke/types": "^0.12.12", "@types/node": "^25.9.1" },
|
|
207
207
|
"publishConfig": { "access": "public" },
|
|
208
|
-
"gitHead": "
|
|
208
|
+
"gitHead": "5e6228dd92f825a7e19988626b7b24bd0be08518"
|
|
209
209
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { UpgradeBuiltinProps } from "@shell-shock/plugin-upgrade/components/upgrade-builtin";
|
|
2
|
-
|
|
3
|
-
//#region src/components/upgrade-builtin.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* A component to generate the `executeUpgrade` function in the `shell-shock:upgrade` builtin module.
|
|
6
|
-
*/
|
|
7
|
-
declare function ExecuteUpgradeFunctionDeclaration(): import("@alloy-js/core").Children;
|
|
8
|
-
/**
|
|
9
|
-
* A built-in upgrade module for Shell Shock.
|
|
10
|
-
*/
|
|
11
|
-
declare function UpgradeBuiltin(props: UpgradeBuiltinProps): import("@alloy-js/core").Children;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { ExecuteUpgradeFunctionDeclaration, UpgradeBuiltin };
|
|
14
|
-
//# sourceMappingURL=upgrade-builtin.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,14 +0,0 @@
|
|
|
1
|
-
import { UpgradeBuiltinProps } from "@shell-shock/plugin-upgrade/components/upgrade-builtin";
|
|
2
|
-
|
|
3
|
-
//#region src/components/upgrade-builtin.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* A component to generate the `executeUpgrade` function in the `shell-shock:upgrade` builtin module.
|
|
6
|
-
*/
|
|
7
|
-
declare function ExecuteUpgradeFunctionDeclaration(): import("@alloy-js/core").Children;
|
|
8
|
-
/**
|
|
9
|
-
* A built-in upgrade module for Shell Shock.
|
|
10
|
-
*/
|
|
11
|
-
declare function UpgradeBuiltin(props: UpgradeBuiltinProps): import("@alloy-js/core").Children;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { ExecuteUpgradeFunctionDeclaration, UpgradeBuiltin };
|
|
14
|
-
//# sourceMappingURL=upgrade-builtin.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade-builtin.d.mts","names":[],"sources":["../../src/components/upgrade-builtin.tsx"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade-builtin.mjs","names":[],"sources":[],"mappings":""}
|