@shell-shock/plugin-update 0.1.58
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/LICENSE +201 -0
- package/README.md +264 -0
- package/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/components/index.cjs +18 -0
- package/dist/components/index.d.cts +3 -0
- package/dist/components/index.d.mts +3 -0
- package/dist/components/index.mjs +4 -0
- package/dist/components/update-builtin.cjs +1301 -0
- package/dist/components/update-builtin.d.cts +55 -0
- package/dist/components/update-builtin.d.cts.map +1 -0
- package/dist/components/update-builtin.d.mts +55 -0
- package/dist/components/update-builtin.d.mts.map +1 -0
- package/dist/components/update-builtin.mjs +1287 -0
- package/dist/components/update-builtin.mjs.map +1 -0
- package/dist/components/update-command.cjs +95 -0
- package/dist/components/update-command.d.cts +8 -0
- package/dist/components/update-command.d.cts.map +1 -0
- package/dist/components/update-command.d.mts +8 -0
- package/dist/components/update-command.d.mts.map +1 -0
- package/dist/components/update-command.mjs +95 -0
- package/dist/components/update-command.mjs.map +1 -0
- package/dist/index.cjs +78 -0
- package/dist/index.d.cts +11 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +11 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +75 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/env.cjs +12 -0
- package/dist/types/env.d.cts +12 -0
- package/dist/types/env.d.cts.map +1 -0
- package/dist/types/env.d.mts +12 -0
- package/dist/types/env.d.mts.map +1 -0
- package/dist/types/env.mjs +11 -0
- package/dist/types/env.mjs.map +1 -0
- package/dist/types/index.cjs +11 -0
- package/dist/types/index.d.cts +3 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/index.mjs +4 -0
- package/dist/types/package-manager.cjs +31 -0
- package/dist/types/package-manager.d.cts +7 -0
- package/dist/types/package-manager.d.cts.map +1 -0
- package/dist/types/package-manager.d.mts +7 -0
- package/dist/types/package-manager.d.mts.map +1 -0
- package/dist/types/package-manager.mjs +28 -0
- package/dist/types/package-manager.mjs.map +1 -0
- package/dist/types/plugin.cjs +75 -0
- package/dist/types/plugin.d.cts +45 -0
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +45 -0
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.mjs +71 -0
- package/dist/types/plugin.mjs.map +1 -0
- package/package.json +200 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-builtin.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,95 @@
|
|
|
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 _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
|
|
6
|
+
let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
|
|
7
|
+
let _powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
|
|
8
|
+
let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
9
|
+
let _stryke_path = require("@stryke/path");
|
|
10
|
+
|
|
11
|
+
//#region src/components/update-command.tsx
|
|
12
|
+
/**
|
|
13
|
+
* The Update command's handler wrapper for the Shell Shock project.
|
|
14
|
+
*/
|
|
15
|
+
function UpdateCommand() {
|
|
16
|
+
const context = (_powerlines_plugin_alloy_core_contexts_context.usePowerlines.Ω = [["UpdatePluginContext", "\"w!"]], (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)());
|
|
17
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TypescriptFile, {
|
|
18
|
+
get path() {
|
|
19
|
+
return (0, _stryke_path.joinPaths)(context.entryPath, "update", "command.ts");
|
|
20
|
+
},
|
|
21
|
+
imports: {
|
|
22
|
+
"node:os": "os",
|
|
23
|
+
"node:fs/promises": ["readFile", "writeFile"]
|
|
24
|
+
},
|
|
25
|
+
builtinImports: { console: [
|
|
26
|
+
"textColors",
|
|
27
|
+
"bold",
|
|
28
|
+
"writeLine",
|
|
29
|
+
"success",
|
|
30
|
+
"warn",
|
|
31
|
+
"stripAnsi"
|
|
32
|
+
] },
|
|
33
|
+
get children() {
|
|
34
|
+
return [
|
|
35
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Options for the Update command." }),
|
|
36
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
|
|
37
|
+
"export": true,
|
|
38
|
+
name: "UpdateOptions",
|
|
39
|
+
get children() {
|
|
40
|
+
return [
|
|
41
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
42
|
+
heading: "Whether to update to the latest version.",
|
|
43
|
+
get children() {
|
|
44
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `If set to \`true\`, the command will attempt to update to the latest version. This option takes precedence over the \`version\` option.` }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
45
|
+
type: "boolean",
|
|
46
|
+
defaultValue: false
|
|
47
|
+
})];
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
|
|
51
|
+
name: "latest",
|
|
52
|
+
type: "boolean"
|
|
53
|
+
}),
|
|
54
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
|
|
55
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
56
|
+
heading: "A specific application version to update to.",
|
|
57
|
+
get children() {
|
|
58
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The command will attempt to update to the specified version. The version should be a valid semantic version string, or \`latest\` to update to the latest version.` }), (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
59
|
+
type: "string",
|
|
60
|
+
defaultValue: "latest"
|
|
61
|
+
})];
|
|
62
|
+
}
|
|
63
|
+
}),
|
|
64
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
|
|
65
|
+
name: "version",
|
|
66
|
+
type: "string"
|
|
67
|
+
})
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
}),
|
|
71
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
|
|
72
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Handler logic for the \\`update\\` command." }),
|
|
73
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
74
|
+
"export": true,
|
|
75
|
+
"default": true,
|
|
76
|
+
async: true,
|
|
77
|
+
name: "handler",
|
|
78
|
+
parameters: [{
|
|
79
|
+
name: "options",
|
|
80
|
+
type: "UpdateOptions"
|
|
81
|
+
}],
|
|
82
|
+
children: _alloy_js_core.code` return;`
|
|
83
|
+
})
|
|
84
|
+
];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
UpdateCommand.__type = [
|
|
89
|
+
"UpdateCommand",
|
|
90
|
+
"The Update command's handler wrapper for the Shell Shock project.",
|
|
91
|
+
"P\"/!?\""
|
|
92
|
+
];
|
|
93
|
+
|
|
94
|
+
//#endregion
|
|
95
|
+
exports.UpdateCommand = UpdateCommand;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/components/update-command.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The Update command's handler wrapper for the Shell Shock project.
|
|
4
|
+
*/
|
|
5
|
+
declare function UpdateCommand(): import("@alloy-js/core").Children;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { UpdateCommand };
|
|
8
|
+
//# sourceMappingURL=update-command.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-command.d.cts","names":[],"sources":["../../src/components/update-command.tsx"],"mappings":";;AAwCA;;iBAAgB,aAAA,6BAAa,QAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/components/update-command.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The Update command's handler wrapper for the Shell Shock project.
|
|
4
|
+
*/
|
|
5
|
+
declare function UpdateCommand(): import("@alloy-js/core").Children;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { UpdateCommand };
|
|
8
|
+
//# sourceMappingURL=update-command.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-command.d.mts","names":[],"sources":["../../src/components/update-command.tsx"],"mappings":""}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { code } from "@alloy-js/core";
|
|
3
|
+
import { FunctionDeclaration, InterfaceDeclaration } from "@alloy-js/typescript";
|
|
4
|
+
import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
|
|
5
|
+
import { InterfaceMember, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
|
|
6
|
+
import { Spacing } from "@powerlines/plugin-alloy/core";
|
|
7
|
+
import { TSDoc as TSDoc$1, TSDocDefaultValue, TSDocRemarks as TSDocRemarks$1 } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
|
|
8
|
+
import { joinPaths } from "@stryke/path";
|
|
9
|
+
|
|
10
|
+
//#region src/components/update-command.tsx
|
|
11
|
+
/**
|
|
12
|
+
* The Update command's handler wrapper for the Shell Shock project.
|
|
13
|
+
*/
|
|
14
|
+
function UpdateCommand() {
|
|
15
|
+
const context = (usePowerlines.Ω = [["UpdatePluginContext", "\"w!"]], usePowerlines());
|
|
16
|
+
return createComponent(TypescriptFile, {
|
|
17
|
+
get path() {
|
|
18
|
+
return joinPaths(context.entryPath, "update", "command.ts");
|
|
19
|
+
},
|
|
20
|
+
imports: {
|
|
21
|
+
"node:os": "os",
|
|
22
|
+
"node:fs/promises": ["readFile", "writeFile"]
|
|
23
|
+
},
|
|
24
|
+
builtinImports: { console: [
|
|
25
|
+
"textColors",
|
|
26
|
+
"bold",
|
|
27
|
+
"writeLine",
|
|
28
|
+
"success",
|
|
29
|
+
"warn",
|
|
30
|
+
"stripAnsi"
|
|
31
|
+
] },
|
|
32
|
+
get children() {
|
|
33
|
+
return [
|
|
34
|
+
createComponent(TSDoc$1, { heading: "Options for the Update command." }),
|
|
35
|
+
createComponent(InterfaceDeclaration, {
|
|
36
|
+
"export": true,
|
|
37
|
+
name: "UpdateOptions",
|
|
38
|
+
get children() {
|
|
39
|
+
return [
|
|
40
|
+
createComponent(TSDoc$1, {
|
|
41
|
+
heading: "Whether to update to the latest version.",
|
|
42
|
+
get children() {
|
|
43
|
+
return [createComponent(TSDocRemarks$1, { children: `If set to \`true\`, the command will attempt to update to the latest version. This option takes precedence over the \`version\` option.` }), createComponent(TSDocDefaultValue, {
|
|
44
|
+
type: "boolean",
|
|
45
|
+
defaultValue: false
|
|
46
|
+
})];
|
|
47
|
+
}
|
|
48
|
+
}),
|
|
49
|
+
createComponent(InterfaceMember, {
|
|
50
|
+
name: "latest",
|
|
51
|
+
type: "boolean"
|
|
52
|
+
}),
|
|
53
|
+
createComponent(Spacing, {}),
|
|
54
|
+
createComponent(TSDoc$1, {
|
|
55
|
+
heading: "A specific application version to update to.",
|
|
56
|
+
get children() {
|
|
57
|
+
return [createComponent(TSDocRemarks$1, { children: `The command will attempt to update to the specified version. The version should be a valid semantic version string, or \`latest\` to update to the latest version.` }), createComponent(TSDocDefaultValue, {
|
|
58
|
+
type: "string",
|
|
59
|
+
defaultValue: "latest"
|
|
60
|
+
})];
|
|
61
|
+
}
|
|
62
|
+
}),
|
|
63
|
+
createComponent(InterfaceMember, {
|
|
64
|
+
name: "version",
|
|
65
|
+
type: "string"
|
|
66
|
+
})
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
}),
|
|
70
|
+
createComponent(Spacing, {}),
|
|
71
|
+
createComponent(TSDoc$1, { heading: "Handler logic for the \\`update\\` command." }),
|
|
72
|
+
createComponent(FunctionDeclaration, {
|
|
73
|
+
"export": true,
|
|
74
|
+
"default": true,
|
|
75
|
+
async: true,
|
|
76
|
+
name: "handler",
|
|
77
|
+
parameters: [{
|
|
78
|
+
name: "options",
|
|
79
|
+
type: "UpdateOptions"
|
|
80
|
+
}],
|
|
81
|
+
children: code` return;`
|
|
82
|
+
})
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
UpdateCommand.__type = [
|
|
88
|
+
"UpdateCommand",
|
|
89
|
+
"The Update command's handler wrapper for the Shell Shock project.",
|
|
90
|
+
"P\"/!?\""
|
|
91
|
+
];
|
|
92
|
+
|
|
93
|
+
//#endregion
|
|
94
|
+
export { UpdateCommand };
|
|
95
|
+
//# sourceMappingURL=update-command.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-command.mjs","names":[],"sources":[],"mappings":""}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_components_update_builtin = require('./components/update-builtin.cjs');
|
|
4
|
+
const require_components_update_command = require('./components/update-command.cjs');
|
|
5
|
+
require('./components/index.cjs');
|
|
6
|
+
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
7
|
+
let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
|
|
8
|
+
let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
9
|
+
let _stryke_path_join = require("@stryke/path/join");
|
|
10
|
+
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
11
|
+
let defu = require("defu");
|
|
12
|
+
defu = require_runtime.__toESM(defu);
|
|
13
|
+
|
|
14
|
+
//#region src/index.tsx
|
|
15
|
+
function __assignType(fn, args) {
|
|
16
|
+
fn.__type = args;
|
|
17
|
+
return fn;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The Update - Shell Shock plugin to add version check functionality and update commands to a Shell Shock application.
|
|
21
|
+
*/
|
|
22
|
+
const plugin = __assignType((options = {}) => {
|
|
23
|
+
return {
|
|
24
|
+
name: "shell-shock/update",
|
|
25
|
+
config: __assignType(function config() {
|
|
26
|
+
this.debug("Providing default configuration for the Shell Shock `update` plugin.");
|
|
27
|
+
return {
|
|
28
|
+
update: (0, defu.default)({ command: { name: (0, _stryke_type_checks_is_set_string.isSetString)(options.command) ? options.command : "update" } }, options, {
|
|
29
|
+
type: "confirm",
|
|
30
|
+
staleTime: 2160 * 60 * 1e3
|
|
31
|
+
}),
|
|
32
|
+
env: {
|
|
33
|
+
config: "@shell-shock/plugin-update/types/env#ShellShockUpdateEnv",
|
|
34
|
+
validate: false
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}, ["config", "P\"/!"]),
|
|
38
|
+
configResolved() {
|
|
39
|
+
this.debug("Adding the CLI update commands to the application context.");
|
|
40
|
+
this.inputs ??= [];
|
|
41
|
+
if (this.inputs.some(__assignType((input) => input.id === this.config.update.command.name, [
|
|
42
|
+
"input",
|
|
43
|
+
"",
|
|
44
|
+
"P\"2!\"/\""
|
|
45
|
+
]))) this.info("The `update` command already exists in the commands list. If you would like the update command to be managed by the `@shell-shock/plugin-update` package, please remove or rename the command.");
|
|
46
|
+
else this.inputs.push({
|
|
47
|
+
id: this.config.update.command.name,
|
|
48
|
+
alias: ["up"],
|
|
49
|
+
path: this.config.update.command.name,
|
|
50
|
+
segments: [this.config.update.command.name],
|
|
51
|
+
title: "Update",
|
|
52
|
+
icon: "🖒",
|
|
53
|
+
tags: ["Utility"],
|
|
54
|
+
description: `A command for checking and updating the version of the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this, true)} command-line interface application.`,
|
|
55
|
+
entry: {
|
|
56
|
+
file: (0, _stryke_path_join.joinPaths)(this.entryPath, "update", "index.ts"),
|
|
57
|
+
input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "update", "command.ts") }
|
|
58
|
+
},
|
|
59
|
+
virtual: false,
|
|
60
|
+
...this.config.update.command
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
prepare: __assignType(async function prepare() {
|
|
64
|
+
this.debug("Rendering update built-in and command modules for the Shell Shock `update` plugin.");
|
|
65
|
+
return (0, _powerlines_plugin_alloy_render.render)(this, [(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_update_builtin.UpdateBuiltin, {}), (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_update_command.UpdateCommand, {})]);
|
|
66
|
+
}, ["prepare", "P\"/!"])
|
|
67
|
+
};
|
|
68
|
+
}, [
|
|
69
|
+
"UpdatePluginOptions",
|
|
70
|
+
"options",
|
|
71
|
+
() => ({}),
|
|
72
|
+
"",
|
|
73
|
+
"P\"w!2\">#!/$"
|
|
74
|
+
]);
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
exports.default = plugin;
|
|
78
|
+
exports.plugin = plugin;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UpdatePluginContext, UpdatePluginOptions } from "./types/plugin.cjs";
|
|
2
|
+
import { Plugin } from "powerlines";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The Update - Shell Shock plugin to add version check functionality and update commands to a Shell Shock application.
|
|
7
|
+
*/
|
|
8
|
+
declare const plugin: <TContext extends UpdatePluginContext = UpdatePluginContext>(options?: UpdatePluginOptions) => Plugin<TContext>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { plugin as default, plugin };
|
|
11
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AA8BA;cAAa,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UpdatePluginContext, UpdatePluginOptions } from "./types/plugin.mjs";
|
|
2
|
+
import { Plugin } from "powerlines";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The Update - Shell Shock plugin to add version check functionality and update commands to a Shell Shock application.
|
|
7
|
+
*/
|
|
8
|
+
declare const plugin: <TContext extends UpdatePluginContext = UpdatePluginContext>(options?: UpdatePluginOptions) => Plugin<TContext>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { plugin as default, plugin };
|
|
11
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":""}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { UpdateBuiltin } from "./components/update-builtin.mjs";
|
|
2
|
+
import { UpdateCommand } from "./components/update-command.mjs";
|
|
3
|
+
import "./components/index.mjs";
|
|
4
|
+
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
5
|
+
import { render } from "@powerlines/plugin-alloy/render";
|
|
6
|
+
import { getAppTitle } from "@shell-shock/core/plugin-utils";
|
|
7
|
+
import { joinPaths } from "@stryke/path/join";
|
|
8
|
+
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
9
|
+
import defu from "defu";
|
|
10
|
+
|
|
11
|
+
//#region src/index.tsx
|
|
12
|
+
function __assignType(fn, args) {
|
|
13
|
+
fn.__type = args;
|
|
14
|
+
return fn;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The Update - Shell Shock plugin to add version check functionality and update commands to a Shell Shock application.
|
|
18
|
+
*/
|
|
19
|
+
const plugin = __assignType((options = {}) => {
|
|
20
|
+
return {
|
|
21
|
+
name: "shell-shock/update",
|
|
22
|
+
config: __assignType(function config() {
|
|
23
|
+
this.debug("Providing default configuration for the Shell Shock `update` plugin.");
|
|
24
|
+
return {
|
|
25
|
+
update: defu({ command: { name: isSetString(options.command) ? options.command : "update" } }, options, {
|
|
26
|
+
type: "confirm",
|
|
27
|
+
staleTime: 2160 * 60 * 1e3
|
|
28
|
+
}),
|
|
29
|
+
env: {
|
|
30
|
+
config: "@shell-shock/plugin-update/types/env#ShellShockUpdateEnv",
|
|
31
|
+
validate: false
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}, ["config", "P\"/!"]),
|
|
35
|
+
configResolved() {
|
|
36
|
+
this.debug("Adding the CLI update commands to the application context.");
|
|
37
|
+
this.inputs ??= [];
|
|
38
|
+
if (this.inputs.some(__assignType((input) => input.id === this.config.update.command.name, [
|
|
39
|
+
"input",
|
|
40
|
+
"",
|
|
41
|
+
"P\"2!\"/\""
|
|
42
|
+
]))) this.info("The `update` command already exists in the commands list. If you would like the update command to be managed by the `@shell-shock/plugin-update` package, please remove or rename the command.");
|
|
43
|
+
else this.inputs.push({
|
|
44
|
+
id: this.config.update.command.name,
|
|
45
|
+
alias: ["up"],
|
|
46
|
+
path: this.config.update.command.name,
|
|
47
|
+
segments: [this.config.update.command.name],
|
|
48
|
+
title: "Update",
|
|
49
|
+
icon: "🖒",
|
|
50
|
+
tags: ["Utility"],
|
|
51
|
+
description: `A command for checking and updating the version of the ${getAppTitle(this, true)} command-line interface application.`,
|
|
52
|
+
entry: {
|
|
53
|
+
file: joinPaths(this.entryPath, "update", "index.ts"),
|
|
54
|
+
input: { file: joinPaths(this.entryPath, "update", "command.ts") }
|
|
55
|
+
},
|
|
56
|
+
virtual: false,
|
|
57
|
+
...this.config.update.command
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
prepare: __assignType(async function prepare() {
|
|
61
|
+
this.debug("Rendering update built-in and command modules for the Shell Shock `update` plugin.");
|
|
62
|
+
return render(this, [createComponent(UpdateBuiltin, {}), createComponent(UpdateCommand, {})]);
|
|
63
|
+
}, ["prepare", "P\"/!"])
|
|
64
|
+
};
|
|
65
|
+
}, [
|
|
66
|
+
"UpdatePluginOptions",
|
|
67
|
+
"options",
|
|
68
|
+
() => ({}),
|
|
69
|
+
"",
|
|
70
|
+
"P\"w!2\">#!/$"
|
|
71
|
+
]);
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
export { plugin as default, plugin };
|
|
75
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
//#region src/types/env.ts
|
|
4
|
+
const __ΩShellShockUpdateEnv = [
|
|
5
|
+
"SKIP_UPDATE_CHECK",
|
|
6
|
+
"An environment variable that can be set to skip the version check when determining if a check for updates is required. If this variable is set to any value, the `isCheckForUpdatesRequired` function will return `false`, indicating that a check for updates is not required. This can be useful in CI environments or other non-interactive contexts where you want to avoid performing a version check, which may involve file system operations or network requests. By setting this environment variable, you can ensure that the update process proceeds without checking for updates, which can help speed up the process in certain scenarios.",
|
|
7
|
+
"ShellShockUpdateEnv",
|
|
8
|
+
"P!P)4!8?\"MKw#y"
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.__ΩShellShockUpdateEnv = __ΩShellShockUpdateEnv;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ShellShockEnv } from "@shell-shock/core/types/env";
|
|
2
|
+
|
|
3
|
+
//#region src/types/env.d.ts
|
|
4
|
+
type ShellShockUpdateEnv = ShellShockEnv & {
|
|
5
|
+
/**
|
|
6
|
+
* An environment variable that can be set to skip the version check when determining if a check for updates is required. If this variable is set to any value, the `isCheckForUpdatesRequired` function will return `false`, indicating that a check for updates is not required. This can be useful in CI environments or other non-interactive contexts where you want to avoid performing a version check, which may involve file system operations or network requests. By setting this environment variable, you can ensure that the update process proceeds without checking for updates, which can help speed up the process in certain scenarios.
|
|
7
|
+
*/
|
|
8
|
+
SKIP_UPDATE_CHECK?: boolean;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ShellShockUpdateEnv };
|
|
12
|
+
//# sourceMappingURL=env.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.cts","names":[],"sources":["../../src/types/env.ts"],"mappings":";;;KAqBY,mBAAA,GAAsB,aAAa;;AAA/C;;EAIE,iBAAiB;AAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ShellShockEnv } from "@shell-shock/core/types/env";
|
|
2
|
+
|
|
3
|
+
//#region src/types/env.d.ts
|
|
4
|
+
type ShellShockUpdateEnv = ShellShockEnv & {
|
|
5
|
+
/**
|
|
6
|
+
* An environment variable that can be set to skip the version check when determining if a check for updates is required. If this variable is set to any value, the `isCheckForUpdatesRequired` function will return `false`, indicating that a check for updates is not required. This can be useful in CI environments or other non-interactive contexts where you want to avoid performing a version check, which may involve file system operations or network requests. By setting this environment variable, you can ensure that the update process proceeds without checking for updates, which can help speed up the process in certain scenarios.
|
|
7
|
+
*/
|
|
8
|
+
SKIP_UPDATE_CHECK?: boolean;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ShellShockUpdateEnv };
|
|
12
|
+
//# sourceMappingURL=env.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.mts","names":[],"sources":["../../src/types/env.ts"],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/types/env.ts
|
|
2
|
+
const __ΩShellShockUpdateEnv = [
|
|
3
|
+
"SKIP_UPDATE_CHECK",
|
|
4
|
+
"An environment variable that can be set to skip the version check when determining if a check for updates is required. If this variable is set to any value, the `isCheckForUpdatesRequired` function will return `false`, indicating that a check for updates is not required. This can be useful in CI environments or other non-interactive contexts where you want to avoid performing a version check, which may involve file system operations or network requests. By setting this environment variable, you can ensure that the update process proceeds without checking for updates, which can help speed up the process in certain scenarios.",
|
|
5
|
+
"ShellShockUpdateEnv",
|
|
6
|
+
"P!P)4!8?\"MKw#y"
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { __ΩShellShockUpdateEnv };
|
|
11
|
+
//# sourceMappingURL=env.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_types_plugin = require('./plugin.cjs');
|
|
3
|
+
const require_types_package_manager = require('./package-manager.cjs');
|
|
4
|
+
|
|
5
|
+
exports.PACKAGE_MANAGERS = require_types_package_manager.PACKAGE_MANAGERS;
|
|
6
|
+
exports.PACKAGE_MANAGER_LOCKFILE_MAP = require_types_package_manager.PACKAGE_MANAGER_LOCKFILE_MAP;
|
|
7
|
+
exports.__ΩPackageManager = require_types_package_manager.__ΩPackageManager;
|
|
8
|
+
exports.__ΩUpdatePluginContext = require_types_plugin.__ΩUpdatePluginContext;
|
|
9
|
+
exports.__ΩUpdatePluginOptions = require_types_plugin.__ΩUpdatePluginOptions;
|
|
10
|
+
exports.__ΩUpdatePluginResolvedConfig = require_types_plugin.__ΩUpdatePluginResolvedConfig;
|
|
11
|
+
exports.__ΩUpdatePluginUserConfig = require_types_plugin.__ΩUpdatePluginUserConfig;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { UpdatePluginContext, UpdatePluginOptions, UpdatePluginResolvedConfig, UpdatePluginUserConfig } from "./plugin.cjs";
|
|
2
|
+
import { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, PackageManager } from "./package-manager.cjs";
|
|
3
|
+
export { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, PackageManager, UpdatePluginContext, UpdatePluginOptions, UpdatePluginResolvedConfig, UpdatePluginUserConfig };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { UpdatePluginContext, UpdatePluginOptions, UpdatePluginResolvedConfig, UpdatePluginUserConfig } from "./plugin.mjs";
|
|
2
|
+
import { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, PackageManager } from "./package-manager.mjs";
|
|
3
|
+
export { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, PackageManager, UpdatePluginContext, UpdatePluginOptions, UpdatePluginResolvedConfig, UpdatePluginUserConfig };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { __ΩUpdatePluginContext, __ΩUpdatePluginOptions, __ΩUpdatePluginResolvedConfig, __ΩUpdatePluginUserConfig } from "./plugin.mjs";
|
|
2
|
+
import { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, __ΩPackageManager } from "./package-manager.mjs";
|
|
3
|
+
|
|
4
|
+
export { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, __ΩPackageManager, __ΩUpdatePluginContext, __ΩUpdatePluginOptions, __ΩUpdatePluginResolvedConfig, __ΩUpdatePluginUserConfig };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
//#region src/types/package-manager.ts
|
|
4
|
+
const __ΩPackageManager = [
|
|
5
|
+
"npm",
|
|
6
|
+
"yarn",
|
|
7
|
+
"pnpm",
|
|
8
|
+
"deno",
|
|
9
|
+
"bun",
|
|
10
|
+
"PackageManager",
|
|
11
|
+
"P.!.\".#.$.%Jw&y"
|
|
12
|
+
];
|
|
13
|
+
const PACKAGE_MANAGERS = [
|
|
14
|
+
"npm",
|
|
15
|
+
"yarn",
|
|
16
|
+
"pnpm",
|
|
17
|
+
"deno",
|
|
18
|
+
"bun"
|
|
19
|
+
];
|
|
20
|
+
const PACKAGE_MANAGER_LOCKFILE_MAP = {
|
|
21
|
+
"package-lock": "npm",
|
|
22
|
+
yarn: "yarn",
|
|
23
|
+
"pnpm-lock": "pnpm",
|
|
24
|
+
deno: "deno",
|
|
25
|
+
bun: "bun"
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.PACKAGE_MANAGERS = PACKAGE_MANAGERS;
|
|
30
|
+
exports.PACKAGE_MANAGER_LOCKFILE_MAP = PACKAGE_MANAGER_LOCKFILE_MAP;
|
|
31
|
+
exports.__ΩPackageManager = __ΩPackageManager;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/types/package-manager.d.ts
|
|
2
|
+
type PackageManager = "npm" | "yarn" | "pnpm" | "deno" | "bun";
|
|
3
|
+
declare const PACKAGE_MANAGERS: readonly PackageManager[];
|
|
4
|
+
declare const PACKAGE_MANAGER_LOCKFILE_MAP: Record<string, PackageManager>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, PackageManager };
|
|
7
|
+
//# sourceMappingURL=package-manager.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-manager.d.cts","names":[],"sources":["../../src/types/package-manager.ts"],"mappings":";KAkBY,cAAA;AAAA,cAEC,gBAAA,WAA2B,cAAc;AAAA,cAQzC,4BAAA,EAA8B,MAAM,SAAS,cAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/types/package-manager.d.ts
|
|
2
|
+
type PackageManager = "npm" | "yarn" | "pnpm" | "deno" | "bun";
|
|
3
|
+
declare const PACKAGE_MANAGERS: readonly PackageManager[];
|
|
4
|
+
declare const PACKAGE_MANAGER_LOCKFILE_MAP: Record<string, PackageManager>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, PackageManager };
|
|
7
|
+
//# sourceMappingURL=package-manager.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-manager.d.mts","names":[],"sources":["../../src/types/package-manager.ts"],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/types/package-manager.ts
|
|
2
|
+
const __ΩPackageManager = [
|
|
3
|
+
"npm",
|
|
4
|
+
"yarn",
|
|
5
|
+
"pnpm",
|
|
6
|
+
"deno",
|
|
7
|
+
"bun",
|
|
8
|
+
"PackageManager",
|
|
9
|
+
"P.!.\".#.$.%Jw&y"
|
|
10
|
+
];
|
|
11
|
+
const PACKAGE_MANAGERS = [
|
|
12
|
+
"npm",
|
|
13
|
+
"yarn",
|
|
14
|
+
"pnpm",
|
|
15
|
+
"deno",
|
|
16
|
+
"bun"
|
|
17
|
+
];
|
|
18
|
+
const PACKAGE_MANAGER_LOCKFILE_MAP = {
|
|
19
|
+
"package-lock": "npm",
|
|
20
|
+
yarn: "yarn",
|
|
21
|
+
"pnpm-lock": "pnpm",
|
|
22
|
+
deno: "deno",
|
|
23
|
+
bun: "bun"
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { PACKAGE_MANAGERS, PACKAGE_MANAGER_LOCKFILE_MAP, __ΩPackageManager };
|
|
28
|
+
//# sourceMappingURL=package-manager.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-manager.mjs","names":[],"sources":[],"mappings":""}
|