@shell-shock/core 0.17.7 → 0.17.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +1 -29
- package/dist/api.cjs +1 -95
- package/dist/api.d.cts +52 -4
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts +52 -4
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +1 -92
- package/dist/api.mjs.map +1 -1
- package/dist/components/command-validation-logic.cjs +1 -292
- package/dist/components/command-validation-logic.mjs +1 -289
- package/dist/components/command-validation-logic.mjs.map +1 -1
- package/dist/components/docs.cjs +1 -265
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts.map +1 -1
- package/dist/components/docs.mjs +1 -256
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/exec-builtin.cjs +13 -429
- package/dist/components/exec-builtin.mjs +13 -425
- package/dist/components/exec-builtin.mjs.map +1 -1
- package/dist/components/helpers.cjs +1 -120
- package/dist/components/helpers.mjs +1 -112
- package/dist/components/helpers.mjs.map +1 -1
- package/dist/components/index.cjs +1 -58
- package/dist/components/index.mjs +1 -10
- package/dist/components/options-parser-logic.cjs +5 -960
- package/dist/components/options-parser-logic.d.cts +1 -1
- package/dist/components/options-parser-logic.mjs +5 -945
- package/dist/components/options-parser-logic.mjs.map +1 -1
- package/dist/components/state-builtin.cjs +8 -629
- package/dist/components/state-builtin.d.cts.map +1 -1
- package/dist/components/state-builtin.d.mts.map +1 -1
- package/dist/components/state-builtin.mjs +8 -622
- package/dist/components/state-builtin.mjs.map +1 -1
- package/dist/components/usage.cjs +1 -117
- package/dist/components/usage.mjs +1 -114
- package/dist/components/usage.mjs.map +1 -1
- package/dist/components/utils-builtin.cjs +33 -838
- package/dist/components/utils-builtin.d.cts.map +1 -1
- package/dist/components/utils-builtin.d.mts.map +1 -1
- package/dist/components/utils-builtin.mjs +33 -828
- package/dist/components/utils-builtin.mjs.map +1 -1
- package/dist/config.cjs +1 -31
- package/dist/config.mjs +1 -29
- package/dist/config.mjs.map +1 -1
- package/dist/contexts/command.cjs +1 -26
- package/dist/contexts/command.mjs +1 -23
- package/dist/contexts/command.mjs.map +1 -1
- package/dist/contexts/index.cjs +1 -9
- package/dist/contexts/index.mjs +1 -4
- package/dist/contexts/options.cjs +1 -63
- package/dist/contexts/options.mjs +1 -58
- package/dist/contexts/options.mjs.map +1 -1
- package/dist/helpers/automd.cjs +1 -71
- package/dist/helpers/automd.mjs +1 -70
- package/dist/helpers/automd.mjs.map +1 -1
- package/dist/helpers/docs-helpers.cjs +1 -23
- package/dist/helpers/docs-helpers.mjs +1 -22
- package/dist/helpers/docs-helpers.mjs.map +1 -1
- package/dist/helpers/paths.cjs +1 -137
- package/dist/helpers/paths.mjs +1 -133
- package/dist/helpers/paths.mjs.map +1 -1
- package/dist/helpers/persistence.cjs +1 -113
- package/dist/helpers/persistence.mjs +1 -110
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/update-package-json.cjs +1 -59
- package/dist/helpers/update-package-json.mjs +1 -57
- package/dist/helpers/update-package-json.mjs.map +1 -1
- package/dist/helpers/utilities.cjs +1 -95
- package/dist/helpers/utilities.mjs +1 -93
- package/dist/helpers/utilities.mjs.map +1 -1
- package/dist/helpers/validations.cjs +1 -71
- package/dist/helpers/validations.mjs +1 -71
- package/dist/helpers/validations.mjs.map +1 -1
- package/dist/index.cjs +1 -52
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -7
- package/dist/plugin-utils/compute-bin.cjs +1 -50
- package/dist/plugin-utils/compute-bin.mjs +1 -49
- package/dist/plugin-utils/compute-bin.mjs.map +1 -1
- package/dist/plugin-utils/context-helpers.cjs +1 -231
- package/dist/plugin-utils/context-helpers.mjs +1 -221
- package/dist/plugin-utils/context-helpers.mjs.map +1 -1
- package/dist/plugin-utils/deepkit.cjs +1 -71
- package/dist/plugin-utils/deepkit.mjs +1 -69
- package/dist/plugin-utils/deepkit.mjs.map +1 -1
- package/dist/plugin-utils/description-helpers.cjs +2 -111
- package/dist/plugin-utils/description-helpers.mjs +2 -107
- package/dist/plugin-utils/description-helpers.mjs.map +1 -1
- package/dist/plugin-utils/get-command-tree.cjs +1 -117
- package/dist/plugin-utils/get-command-tree.mjs +1 -114
- package/dist/plugin-utils/get-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/index.cjs +1 -39
- package/dist/plugin-utils/index.mjs +1 -10
- package/dist/plugin-utils/reflect.cjs +1 -52
- package/dist/plugin-utils/reflect.mjs +1 -52
- package/dist/plugin-utils/reflect.mjs.map +1 -1
- package/dist/plugin-utils/traverse-command-tree.cjs +1 -64
- package/dist/plugin-utils/traverse-command-tree.mjs +1 -62
- package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -1
- package/dist/plugin-utils/type-checks.cjs +1 -93
- package/dist/plugin-utils/type-checks.mjs +1 -88
- package/dist/plugin-utils/type-checks.mjs.map +1 -1
- package/dist/plugin.cjs +4 -429
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +4 -423
- package/dist/plugin.mjs.map +1 -1
- package/dist/resolver/deepkit.cjs +1 -135
- package/dist/resolver/deepkit.mjs +1 -134
- package/dist/resolver/deepkit.mjs.map +1 -1
- package/dist/resolver/helpers.cjs +1 -173
- package/dist/resolver/helpers.mjs +1 -168
- package/dist/resolver/helpers.mjs.map +1 -1
- package/dist/resolver/module.cjs +1 -145
- package/dist/resolver/module.mjs +1 -144
- package/dist/resolver/module.mjs.map +1 -1
- package/dist/resolver/resolve.cjs +1 -222
- package/dist/resolver/resolve.mjs +1 -221
- package/dist/resolver/resolve.mjs.map +1 -1
- package/dist/types/command.cjs +1 -441
- package/dist/types/command.mjs +1 -405
- package/dist/types/command.mjs.map +1 -1
- package/dist/types/config.cjs +1 -144
- package/dist/types/config.d.cts +3 -2
- package/dist/types/config.d.cts.map +1 -1
- package/dist/types/config.d.mts +3 -2
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/config.mjs +1 -138
- package/dist/types/config.mjs.map +1 -1
- package/dist/types/context.cjs +1 -37
- package/dist/types/context.d.cts +3 -2
- package/dist/types/context.d.cts.map +1 -1
- package/dist/types/context.d.mts +3 -2
- package/dist/types/context.d.mts.map +1 -1
- package/dist/types/context.mjs +1 -34
- package/dist/types/context.mjs.map +1 -1
- package/dist/types/env.cjs +1 -52
- package/dist/types/env.mjs +1 -50
- package/dist/types/env.mjs.map +1 -1
- package/dist/types/index.cjs +1 -49
- package/dist/types/index.mjs +1 -6
- package/dist/types/options.cjs +1 -12
- package/dist/types/options.mjs +1 -10
- package/package.json +23 -23
package/dist/plugin.cjs
CHANGED
|
@@ -1,429 +1,4 @@
|
|
|
1
|
-
Object.defineProperties(exports, {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const require_components_exec_builtin = require('./components/exec-builtin.cjs');
|
|
6
|
-
const require_traverse_command_tree = require('./plugin-utils/traverse-command-tree.cjs');
|
|
7
|
-
const require_get_command_tree = require('./plugin-utils/get-command-tree.cjs');
|
|
8
|
-
const require_components_state_builtin = require('./components/state-builtin.cjs');
|
|
9
|
-
const require_components_utils_builtin = require('./components/utils-builtin.cjs');
|
|
10
|
-
const require_automd = require('./helpers/automd.cjs');
|
|
11
|
-
const require_paths = require('./helpers/paths.cjs');
|
|
12
|
-
const require_persistence = require('./helpers/persistence.cjs');
|
|
13
|
-
const require_update_package_json = require('./helpers/update-package-json.cjs');
|
|
14
|
-
const require_utilities = require('./helpers/utilities.cjs');
|
|
15
|
-
const require_validations = require('./helpers/validations.cjs');
|
|
16
|
-
const require_resolve = require('./resolver/resolve.cjs');
|
|
17
|
-
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
18
|
-
let _alloy_js_core_components = require("@alloy-js/core/components");
|
|
19
|
-
let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
|
|
20
|
-
let _powerlines_plugin_automd = require("@powerlines/plugin-automd");
|
|
21
|
-
_powerlines_plugin_automd = require_runtime.__toESM(_powerlines_plugin_automd);
|
|
22
|
-
let _powerlines_plugin_nodejs = require("@powerlines/plugin-nodejs");
|
|
23
|
-
_powerlines_plugin_nodejs = require_runtime.__toESM(_powerlines_plugin_nodejs);
|
|
24
|
-
let _powerlines_plugin_tsdown = require("@powerlines/plugin-tsdown");
|
|
25
|
-
_powerlines_plugin_tsdown = require_runtime.__toESM(_powerlines_plugin_tsdown);
|
|
26
|
-
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
27
|
-
let _stryke_fs_chmod_x = require("@stryke/fs/chmod-x");
|
|
28
|
-
let _stryke_path_append = require("@stryke/path/append");
|
|
29
|
-
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
30
|
-
let _stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
|
|
31
|
-
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
32
|
-
let _stryke_path_replace = require("@stryke/path/replace");
|
|
33
|
-
let _stryke_path_resolve_parent_path = require("@stryke/path/resolve-parent-path");
|
|
34
|
-
let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
|
|
35
|
-
let _stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
|
|
36
|
-
let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
37
|
-
let _stryke_type_checks_is_object = require("@stryke/type-checks/is-object");
|
|
38
|
-
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
39
|
-
let defu = require("defu");
|
|
40
|
-
let powerlines_utils = require("powerlines/utils");
|
|
41
|
-
|
|
42
|
-
//#region src/plugin.tsx
|
|
43
|
-
function __assignType(fn, args) {
|
|
44
|
-
fn.__type = args;
|
|
45
|
-
return fn;
|
|
46
|
-
}
|
|
47
|
-
const MAX_DEPTH = 50;
|
|
48
|
-
/**
|
|
49
|
-
* The core Powerlines plugin to build Shell Shock projects.
|
|
50
|
-
*/
|
|
51
|
-
const plugin = __assignType((options = {}) => {
|
|
52
|
-
return [
|
|
53
|
-
(_powerlines_plugin_tsdown.default.Ω = [["Context", "\"w!"]], (0, _powerlines_plugin_tsdown.default)()),
|
|
54
|
-
(_powerlines_plugin_automd.default.Ω = [["Context", "\"w!"]], (0, _powerlines_plugin_automd.default)()),
|
|
55
|
-
{
|
|
56
|
-
name: "shell-shock:config",
|
|
57
|
-
config: __assignType(async function config() {
|
|
58
|
-
this.debug("Resolving the Shell Shock configuration.");
|
|
59
|
-
await require_update_package_json.updatePackageJsonBinary(this);
|
|
60
|
-
return (0, defu.defu)({ output: { path: (0, _stryke_path_join_paths.joinPaths)(this.config.root, "dist") } }, options, {
|
|
61
|
-
name: require_context_helpers.getAppName(this),
|
|
62
|
-
title: require_context_helpers.getAppTitle(this),
|
|
63
|
-
description: require_context_helpers.getAppDescription(this),
|
|
64
|
-
platform: "node",
|
|
65
|
-
projectType: "application",
|
|
66
|
-
framework: "shell-shock",
|
|
67
|
-
isCaseSensitive: false,
|
|
68
|
-
output: {
|
|
69
|
-
format: "esm",
|
|
70
|
-
dts: false
|
|
71
|
-
},
|
|
72
|
-
input: !this.config.input || Array.isArray(this.config.input) && this.config.input.length === 0 || (0, _stryke_type_checks_is_object.isObject)(this.config.input) && Object.keys(this.config.input).length === 0 ? [(0, _stryke_path_join_paths.joinPaths)(this.config.root, "src/**/command.ts"), (0, _stryke_path_join_paths.joinPaths)(this.config.root, "src/**/command.tsx")] : void 0,
|
|
73
|
-
resolve: {
|
|
74
|
-
external: ["@powerlines/deepkit"],
|
|
75
|
-
skipNodeModulesBundle: true
|
|
76
|
-
},
|
|
77
|
-
tsdown: {
|
|
78
|
-
dts: false,
|
|
79
|
-
nodeProtocol: true,
|
|
80
|
-
unbundle: false
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
}, ["config", "P\"/!"]),
|
|
84
|
-
configResolved: {
|
|
85
|
-
order: "pre",
|
|
86
|
-
async handler() {
|
|
87
|
-
this.debug("Shell Shock configuration has been resolved.");
|
|
88
|
-
this.config.appSpecificEnvPrefix = (0, _stryke_type_checks_is_set_string.isSetString)(this.config.autoAssignEnv) ? this.config.autoAssignEnv : (0, _stryke_string_format_constant_case.constantCase)(require_context_helpers.getAppName(this));
|
|
89
|
-
if (!this.config.env.prefix || !Array.isArray(this.config.env.prefix)) this.config.env.prefix = (0, _stryke_convert_to_array.toArray)(this.config.env.prefix);
|
|
90
|
-
if (!this.config.env.prefix.includes(this.config.appSpecificEnvPrefix)) this.config.env.prefix.push(this.config.appSpecificEnvPrefix);
|
|
91
|
-
this.config.bin = ((0, _stryke_type_checks_is_set_string.isSetString)(this.packageJson.bin) ? { [(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name)]: this.packageJson.bin } : this.packageJson.bin) ?? { [(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name)]: require_update_package_json.formatBinaryPath(this.config.output.format) };
|
|
92
|
-
if ((0, _stryke_type_checks_is_set_string.isSetString)(this.config.reference)) if (this.config.reference.includes("{command}")) this.config.reference = {
|
|
93
|
-
app: this.config.reference.substring(0, this.config.reference.indexOf("{command}")).replace(/\/?$/, "/"),
|
|
94
|
-
commands: this.config.reference
|
|
95
|
-
};
|
|
96
|
-
else if (this.config.reference.includes("{commands}")) this.config.reference = {
|
|
97
|
-
app: this.config.reference.substring(0, this.config.reference.indexOf("{commands}")).replace(/\/?$/, "/"),
|
|
98
|
-
commands: this.config.reference
|
|
99
|
-
};
|
|
100
|
-
else this.config.reference = { app: this.config.reference };
|
|
101
|
-
this.inputs ??= [];
|
|
102
|
-
this.options = Object.values(require_utilities.getGlobalOptions(this, {
|
|
103
|
-
id: null,
|
|
104
|
-
name: this.config.name,
|
|
105
|
-
path: null,
|
|
106
|
-
segments: [],
|
|
107
|
-
title: this.config.title,
|
|
108
|
-
description: this.config.description,
|
|
109
|
-
alias: [],
|
|
110
|
-
isVirtual: false
|
|
111
|
-
}));
|
|
112
|
-
this.options = this.options.map(__assignType((option) => ({
|
|
113
|
-
...option,
|
|
114
|
-
name: (0, _stryke_string_format_camel_case.camelCase)(option.name),
|
|
115
|
-
alias: option.alias ?? [],
|
|
116
|
-
optional: option.optional ?? false
|
|
117
|
-
}), [
|
|
118
|
-
"option",
|
|
119
|
-
"",
|
|
120
|
-
"P\"2!\"/\""
|
|
121
|
-
]));
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
...(_powerlines_plugin_nodejs.default.Ω = [["Context", "\"w!"]], (0, _powerlines_plugin_nodejs.default)((0, defu.defu)(options ?? {}, { env: {
|
|
126
|
-
types: "@shell-shock/core/types/env#ShellShockEnv",
|
|
127
|
-
validate: false
|
|
128
|
-
} }))),
|
|
129
|
-
{
|
|
130
|
-
name: "shell-shock:inputs",
|
|
131
|
-
async configResolved() {
|
|
132
|
-
this.debug("Finding command entry point files.");
|
|
133
|
-
this.debug(`Checking for commands using input: ${JSON.stringify(this.config.input)}`);
|
|
134
|
-
this.commandsPath = await require_paths.findCommandsRoot(this);
|
|
135
|
-
this.debug(`Resolved commands root path: ${this.commandsPath}`);
|
|
136
|
-
const inputs = await (0, powerlines_utils.resolveInputs)(this, this.config.input);
|
|
137
|
-
this.debug(`Found ${inputs.length} entry points specified in the configuration options.`);
|
|
138
|
-
this.inputs = inputs.reduce(__assignType((ret, entry) => {
|
|
139
|
-
if (entry.file !== this.commandsPath && !(0, _stryke_path_is_parent_path.isParentPath)(entry.file, this.commandsPath)) throw new Error(`Command entry point "${entry.file}" is not located within the commands root "${this.commandsPath}". Please ensure that all command entry points are located within the current project.`);
|
|
140
|
-
const id = require_paths.resolveCommandId(this, entry.file);
|
|
141
|
-
if (!ret.some(__assignType((existing) => existing.id === id, [
|
|
142
|
-
"existing",
|
|
143
|
-
"",
|
|
144
|
-
"P\"2!\"/\""
|
|
145
|
-
]))) {
|
|
146
|
-
const name = require_paths.resolveCommandName(entry.file);
|
|
147
|
-
let segments = require_paths.resolveCommandPath(this, entry.file).split("/").filter(Boolean);
|
|
148
|
-
segments = segments.map(__assignType((segment, index) => {
|
|
149
|
-
const found = segments.findIndex(__assignType((existing) => existing === segment, [
|
|
150
|
-
"existing",
|
|
151
|
-
"",
|
|
152
|
-
"P\"2!\"/\""
|
|
153
|
-
]));
|
|
154
|
-
if (found !== -1 && found !== index) segment += `_${segments.filter(__assignType((segment) => require_context_helpers.isDynamicPathSegment(segment) && require_context_helpers.getDynamicPathSegmentName(segment).replace(/_\d+$/, "") === segment, [
|
|
155
|
-
"segment",
|
|
156
|
-
"",
|
|
157
|
-
"P\"2!\"/\""
|
|
158
|
-
])).length}`;
|
|
159
|
-
return segment;
|
|
160
|
-
}, [
|
|
161
|
-
"segment",
|
|
162
|
-
"index",
|
|
163
|
-
"",
|
|
164
|
-
"P\"2!\"2\"\"/#"
|
|
165
|
-
]));
|
|
166
|
-
ret.push({
|
|
167
|
-
id,
|
|
168
|
-
path: segments.join("/"),
|
|
169
|
-
segments,
|
|
170
|
-
name,
|
|
171
|
-
alias: [],
|
|
172
|
-
tags: [],
|
|
173
|
-
isVirtual: false,
|
|
174
|
-
source: "file",
|
|
175
|
-
entry: {
|
|
176
|
-
...entry,
|
|
177
|
-
file: entry.file,
|
|
178
|
-
input: {
|
|
179
|
-
file: entry.file,
|
|
180
|
-
name: entry.name
|
|
181
|
-
},
|
|
182
|
-
output: name
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
return ret;
|
|
187
|
-
}, [
|
|
188
|
-
"ret",
|
|
189
|
-
"entry",
|
|
190
|
-
"",
|
|
191
|
-
"P\"2!\"2\"\"/#"
|
|
192
|
-
]), this.inputs);
|
|
193
|
-
this.debug(`Shell Shock will process ${this.inputs.length} command entry files: \n${this.inputs.map(__assignType((command) => ` - ${command.id}: ${(0, _stryke_path_replace.replacePath)(command.entry.file, this.commandsPath)}`, [
|
|
194
|
-
"command",
|
|
195
|
-
"",
|
|
196
|
-
"P\"2!\"/\""
|
|
197
|
-
])).join("\n")}`);
|
|
198
|
-
},
|
|
199
|
-
prepare: __assignType(async function prepare() {
|
|
200
|
-
this.debug("Rendering base built-in modules for the Shell Shock application.");
|
|
201
|
-
return (0, _powerlines_plugin_alloy_render.render)(this, [
|
|
202
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_state_builtin.StateBuiltin, {}),
|
|
203
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_utils_builtin.UtilsBuiltin, {}),
|
|
204
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(require_components_exec_builtin.ExecBuiltin, {})
|
|
205
|
-
]);
|
|
206
|
-
}, ["prepare", "P\"/!"])
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
name: "shell-shock:virtual-inputs",
|
|
210
|
-
configResolved: {
|
|
211
|
-
order: "post",
|
|
212
|
-
async handler() {
|
|
213
|
-
if (this.inputs.length === 0) this.warn("No commands were found in the project. Please ensure at least one command exists.");
|
|
214
|
-
else {
|
|
215
|
-
this.debug("Finding and adding virtual command inputs for each command previously found.");
|
|
216
|
-
this.inputs = this.inputs.reduce(__assignType((ret, command) => {
|
|
217
|
-
let depth = 0;
|
|
218
|
-
let parentPath = (0, _stryke_path_resolve_parent_path.resolveParentPath)((0, _stryke_path_file_path_fns.findFilePath)(command.entry.file));
|
|
219
|
-
if ((0, _stryke_path_is_parent_path.isParentPath)(parentPath, this.commandsPath)) while (parentPath !== this.commandsPath) {
|
|
220
|
-
if (depth++ > MAX_DEPTH) throw new Error(`Unable to process virtual commands for ${command.name} \n\nPlease ensure ${command.entry.file} is a valid command entry file and does not have an invalid path.`);
|
|
221
|
-
if (!ret.some(__assignType((existing) => (0, _stryke_path_file_path_fns.findFilePath)(existing.entry.file) === parentPath, [
|
|
222
|
-
"existing",
|
|
223
|
-
"",
|
|
224
|
-
"P\"2!\"/\""
|
|
225
|
-
]))) {
|
|
226
|
-
const file = (0, _stryke_path_join_paths.joinPaths)(parentPath, "command.ts");
|
|
227
|
-
const id = require_paths.resolveCommandId(this, file);
|
|
228
|
-
if (!ret.some(__assignType((existing) => existing.id === id, [
|
|
229
|
-
"existing",
|
|
230
|
-
"",
|
|
231
|
-
"P\"2!\"/\""
|
|
232
|
-
]))) {
|
|
233
|
-
const name = require_paths.resolveCommandName(file);
|
|
234
|
-
let segments = require_paths.resolveCommandPath(this, file).split("/").filter(Boolean);
|
|
235
|
-
segments = segments.map(__assignType((segment, index) => {
|
|
236
|
-
const found = segments.findIndex(__assignType((existing) => existing === segment, [
|
|
237
|
-
"existing",
|
|
238
|
-
"",
|
|
239
|
-
"P\"2!\"/\""
|
|
240
|
-
]));
|
|
241
|
-
if (found !== -1 && found !== index) segment += `_${segments.filter(__assignType((segment) => require_context_helpers.isDynamicPathSegment(segment) && require_context_helpers.getDynamicPathSegmentName(segment).replace(/_\d+$/, "") === segment, [
|
|
242
|
-
"segment",
|
|
243
|
-
"",
|
|
244
|
-
"P\"2!\"/\""
|
|
245
|
-
])).length}`;
|
|
246
|
-
return segment;
|
|
247
|
-
}, [
|
|
248
|
-
"segment",
|
|
249
|
-
"index",
|
|
250
|
-
"",
|
|
251
|
-
"P\"2!\"2\"\"/#"
|
|
252
|
-
]));
|
|
253
|
-
ret.push({
|
|
254
|
-
id,
|
|
255
|
-
path: segments.join("/"),
|
|
256
|
-
segments,
|
|
257
|
-
name,
|
|
258
|
-
alias: [],
|
|
259
|
-
tags: [],
|
|
260
|
-
isVirtual: true,
|
|
261
|
-
entry: { file },
|
|
262
|
-
source: "file"
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
parentPath = (0, _stryke_path_resolve_parent_path.resolveParentPath)(parentPath);
|
|
267
|
-
}
|
|
268
|
-
return ret;
|
|
269
|
-
}, [
|
|
270
|
-
"ret",
|
|
271
|
-
"command",
|
|
272
|
-
"",
|
|
273
|
-
"P\"2!\"2\"\"/#"
|
|
274
|
-
]), this.inputs).sort(__assignType((a, b) => a.segments.length - b.segments.length, [
|
|
275
|
-
"a",
|
|
276
|
-
"b",
|
|
277
|
-
"",
|
|
278
|
-
"P\"2!\"2\"\"/#"
|
|
279
|
-
]));
|
|
280
|
-
this.debug(`Final command input list: \n${this.inputs.map(__assignType((command) => ` - ${command.id}${command.isVirtual ? " (virtual)" : ""}: ${command.source === "file" ? (0, _stryke_path_replace.replacePath)(command.entry.file, this.commandsPath) : `added by ${command.source}`}`, [
|
|
281
|
-
"command",
|
|
282
|
-
"",
|
|
283
|
-
"P\"2!\"/\""
|
|
284
|
-
])).join("\n")}`);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
name: "shell-shock:resolve-commands",
|
|
291
|
-
prepare: {
|
|
292
|
-
order: "post",
|
|
293
|
-
async handler() {
|
|
294
|
-
this.debug("Initializing the CLI application's command tree.");
|
|
295
|
-
this.commands = {};
|
|
296
|
-
if (this.config.command !== "prepare" && this.config.skipCache !== true && this.persistedMeta?.checksum === this.meta.checksum && this.fs.existsSync(require_persistence.getCommandsPersistencePath(this))) {
|
|
297
|
-
this.debug(`Skipping command resolution as the meta checksum has not changed.`);
|
|
298
|
-
await require_persistence.readCommandsPersistence(this);
|
|
299
|
-
} else {
|
|
300
|
-
for (const input of this.inputs.filter(__assignType((input) => input.segments.filter(__assignType((segment) => !require_context_helpers.isDynamicPathSegment(segment) && !require_context_helpers.isPathSegmentGroup(segment), [
|
|
301
|
-
"segment",
|
|
302
|
-
"",
|
|
303
|
-
"P\"2!\"/\""
|
|
304
|
-
])).length === 1, [
|
|
305
|
-
"input",
|
|
306
|
-
"",
|
|
307
|
-
"P\"2!\"/\""
|
|
308
|
-
]))) this.commands[input.name] = await require_resolve.resolve({
|
|
309
|
-
context: this,
|
|
310
|
-
command: input
|
|
311
|
-
});
|
|
312
|
-
this.debug("Post-processing commands to ensure proper reflection.");
|
|
313
|
-
await require_traverse_command_tree.traverseCommands(this, __assignType((command) => {
|
|
314
|
-
command.options = Object.fromEntries(Object.entries(command.options).map(__assignType(([name, option]) => [(0, _stryke_string_format_camel_case.camelCase)(name), {
|
|
315
|
-
...option,
|
|
316
|
-
name: (0, _stryke_string_format_camel_case.camelCase)(name),
|
|
317
|
-
alias: option.alias ?? [],
|
|
318
|
-
optional: option.optional ?? false
|
|
319
|
-
}], [
|
|
320
|
-
"param0",
|
|
321
|
-
"",
|
|
322
|
-
"P\"2!\"/\""
|
|
323
|
-
])));
|
|
324
|
-
}, [
|
|
325
|
-
"command",
|
|
326
|
-
"",
|
|
327
|
-
"P\"2!\"/\""
|
|
328
|
-
]));
|
|
329
|
-
await require_persistence.writeCommandsPersistence(this);
|
|
330
|
-
}
|
|
331
|
-
this.debug("Validating the CLI applications command tree.");
|
|
332
|
-
let isValid = true;
|
|
333
|
-
await require_traverse_command_tree.traverseCommands(this, __assignType((command) => {
|
|
334
|
-
const failures = require_validations.validateCommand(command);
|
|
335
|
-
if (failures.length > 0) {
|
|
336
|
-
this.error(`Found ${failures.length} issue${failures.length > 1 ? "s" : ""} with the ${command.title} command: \n${failures.map(__assignType((failure) => ` - ${failure.code}: ${failure.details}`, [
|
|
337
|
-
"failure",
|
|
338
|
-
"",
|
|
339
|
-
"P\"2!\"/\""
|
|
340
|
-
])).join("\n")}\n`);
|
|
341
|
-
isValid = false;
|
|
342
|
-
}
|
|
343
|
-
}, [
|
|
344
|
-
"command",
|
|
345
|
-
"",
|
|
346
|
-
"P\"2!\"/\""
|
|
347
|
-
]));
|
|
348
|
-
if (!isValid) throw new Error(`One or more commands in the command tree are invalid. Please review the errors above and correct them before proceeding.`);
|
|
349
|
-
this.info(`\nCreating an application with the following command tree: \n${require_utilities.formatCommandTree(this)}\n`);
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
name: "shell-shock:chmod+x",
|
|
355
|
-
configResolved() {
|
|
356
|
-
this.config.tsdown.hooks ??= {};
|
|
357
|
-
this.config.tsdown.hooks["build:done"] = __assignType(async (_) => {
|
|
358
|
-
await Promise.all(Object.values(this.config.bin).map(__assignType(async (bin) => {
|
|
359
|
-
const path = (0, _stryke_path_append.appendPath)(bin, (0, _stryke_path_join_paths.joinPaths)(this.workspaceConfig.workspaceRoot, this.config.root));
|
|
360
|
-
if (this.fs.existsSync(path)) {
|
|
361
|
-
this.debug(`Adding hashbang to binary executable output file: ${path}`);
|
|
362
|
-
const content = await this.fs.read(path);
|
|
363
|
-
if (content && !content.startsWith("#!")) await this.fs.write(path, `#!/usr/bin/env ${this.config.mode === "development" ? "-S NODE_OPTIONS=--enable-source-maps" : ""} node\n\n${content}`);
|
|
364
|
-
this.debug(`Adding executable permissions (chmod+x) to binary executable output file: ${path}`);
|
|
365
|
-
await (0, _stryke_fs_chmod_x.chmodX)(path);
|
|
366
|
-
} else this.warn(`Expected binary output file not found at path: ${path}. Skipping adding hashbang and executable permissions (chmod+x).`);
|
|
367
|
-
}, [
|
|
368
|
-
"bin",
|
|
369
|
-
"",
|
|
370
|
-
"P\"2!\"/\""
|
|
371
|
-
])));
|
|
372
|
-
}, [
|
|
373
|
-
"chunks",
|
|
374
|
-
"_",
|
|
375
|
-
"",
|
|
376
|
-
"PP!P!F4!MK2\"\"/#"
|
|
377
|
-
]);
|
|
378
|
-
}
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
name: "shell-shock:docs",
|
|
382
|
-
configResolved: __assignType(function configResolved() {
|
|
383
|
-
this.config.automd ??= {};
|
|
384
|
-
this.config.automd.generators = {
|
|
385
|
-
...this.config.automd.generators ?? {},
|
|
386
|
-
commands: require_automd.commands(this)
|
|
387
|
-
};
|
|
388
|
-
}, ["configResolved", "P\"/!"]),
|
|
389
|
-
async docs() {
|
|
390
|
-
this.debug("Rendering entrypoint modules for the Shell Shock `script` preset.");
|
|
391
|
-
const commands = this.inputs.map(__assignType((input) => require_get_command_tree.getCommandTree(this, input.segments), [
|
|
392
|
-
"input",
|
|
393
|
-
"",
|
|
394
|
-
"P\"2!\"/\""
|
|
395
|
-
])).filter(Boolean);
|
|
396
|
-
return (0, _powerlines_plugin_alloy_render.render)(this, (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core_components.For, {
|
|
397
|
-
get each() {
|
|
398
|
-
return Object.values(commands);
|
|
399
|
-
},
|
|
400
|
-
doubleHardline: true,
|
|
401
|
-
get children() {
|
|
402
|
-
return __assignType((child) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core_components.Show, {
|
|
403
|
-
get when() {
|
|
404
|
-
return !child.isVirtual;
|
|
405
|
-
},
|
|
406
|
-
get children() {
|
|
407
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_docs.CommandDocsFile, { command: child });
|
|
408
|
-
}
|
|
409
|
-
}), [
|
|
410
|
-
"child",
|
|
411
|
-
"",
|
|
412
|
-
"P\"2!\"/\""
|
|
413
|
-
]);
|
|
414
|
-
}
|
|
415
|
-
}));
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
];
|
|
419
|
-
}, [
|
|
420
|
-
"Options",
|
|
421
|
-
"options",
|
|
422
|
-
() => ({}),
|
|
423
|
-
"",
|
|
424
|
-
"P\"w!2\">#!F/$"
|
|
425
|
-
]);
|
|
426
|
-
|
|
427
|
-
//#endregion
|
|
428
|
-
exports.default = plugin;
|
|
429
|
-
exports.plugin = plugin;
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./_virtual/_rolldown/runtime.cjs`),t=require(`./plugin-utils/context-helpers.cjs`),n=require(`./components/docs.cjs`),r=require(`./components/exec-builtin.cjs`),i=require(`./plugin-utils/deepkit.cjs`),a=require(`./plugin-utils/traverse-command-tree.cjs`),o=require(`./plugin-utils/get-command-tree.cjs`);require(`./plugin-utils/index.cjs`);const s=require(`./components/state-builtin.cjs`),c=require(`./components/utils-builtin.cjs`),l=require(`./helpers/automd.cjs`),u=require(`./helpers/paths.cjs`),d=require(`./helpers/persistence.cjs`),f=require(`./helpers/update-package-json.cjs`),p=require(`./helpers/utilities.cjs`),m=require(`./helpers/validations.cjs`),h=require(`./resolver/resolve.cjs`);let g=require(`@alloy-js/core/jsx-runtime`),_=require(`@alloy-js/core/components`),v=require(`@powerlines/deepkit/vendor/type`),y=require(`@powerlines/plugin-alloy`);y=e.__toESM(y);let b=require(`@powerlines/plugin-alloy/render`),x=require(`@powerlines/plugin-automd`);x=e.__toESM(x);let S=require(`@powerlines/plugin-env/helpers`),C=require(`@powerlines/plugin-nodejs`);C=e.__toESM(C);let w=require(`@powerlines/plugin-tsdown`);w=e.__toESM(w);let T=require(`@stryke/convert/to-array`),E=require(`@stryke/fs/chmod-x`),D=require(`@stryke/path/append`),O=require(`@stryke/path/file-path-fns`),k=require(`@stryke/path/is-parent-path`),A=require(`@stryke/path/join-paths`),j=require(`@stryke/path/replace`),M=require(`@stryke/path/resolve-parent-path`),N=require(`@stryke/string-format/camel-case`),P=require(`@stryke/string-format/constant-case`),F=require(`@stryke/string-format/kebab-case`),I=require(`@stryke/type-checks/is-object`),L=require(`@stryke/type-checks/is-set-string`),R=require(`defu`),z=require(`powerlines/utils`);function B(e,t){return e.__type=t,e}const V=B((e={})=>[...(y.default.Ω=[[`Context`,`"w!`]],(0,y.default)()),(w.default.Ω=[[`Context`,`"w!`]],(0,w.default)()),(x.default.Ω=[[`Context`,`"w!`]],(0,x.default)()),{name:`shell-shock:config`,config:B(async function(){return this.debug(`Resolving the Shell Shock configuration.`),(0,R.defu)(e,{name:t.getAppName(this),title:t.getAppTitle(this),description:t.getAppDescription(this),platform:`node`,projectType:`application`,framework:`shell-shock`,isCaseSensitive:!1,output:{format:`esm`,dts:!1},input:!this.config.input||Array.isArray(this.config.input)&&this.config.input.length===0||(0,I.isObject)(this.config.input)&&Object.keys(this.config.input).length===0?[`src/**/command.ts`,`src/**/command.tsx`]:void 0,resolve:{external:[`@powerlines/deepkit`],skipNodeModulesBundle:!0},tsdown:{dts:!1,nodeProtocol:!0,unbundle:!1}})},[`config`,`P"/!`]),configResolved:{order:`pre`,async handler(){this.debug(`Shell Shock configuration has been resolved.`),await f.updatePackageJsonBinary(this),this.config.appSpecificEnvPrefix=(0,L.isSetString)(this.config.autoAssignEnv)?this.config.autoAssignEnv:(0,P.constantCase)(t.getAppName(this)),(!this.config.env.prefix||!Array.isArray(this.config.env.prefix))&&(this.config.env.prefix=(0,T.toArray)(this.config.env.prefix)),this.config.env.prefix.includes(this.config.appSpecificEnvPrefix)||this.config.env.prefix.push(this.config.appSpecificEnvPrefix),this.config.bin=((0,L.isSetString)(this.packageJson.bin)?{[(0,F.kebabCase)(this.config.name)]:this.packageJson.bin}:this.packageJson.bin)??{[(0,F.kebabCase)(this.config.name)]:f.formatBinaryPath(this.config.output.format)},(0,L.isSetString)(this.config.reference)&&(this.config.reference.includes(`{command}`)?this.config.reference={app:this.config.reference.substring(0,this.config.reference.indexOf(`{command}`)).replace(/\/?$/,`/`),commands:this.config.reference}:this.config.reference.includes(`{commands}`)?this.config.reference={app:this.config.reference.substring(0,this.config.reference.indexOf(`{commands}`)).replace(/\/?$/,`/`),commands:this.config.reference}:this.config.reference={app:this.config.reference}),this.inputs??=[],this.globalOptions=Object.values(p.getGlobalOptions(this,{id:null,name:this.config.name,path:null,segments:[],title:this.config.title,description:this.config.description,alias:[],isVirtual:!1})),this.globalOptions=this.globalOptions.map(B(e=>({...e,name:(0,N.camelCase)(e.name),alias:e.alias??[],optional:e.optional??!1}),[`option`,``,`P"2!"/"`]))}}},...(C.default.Ω=[[`Context`,`"w!`]],(0,C.default)((0,R.defu)(e??{},{env:{types:`@shell-shock/core/types/env#ShellShockEnv`,validate:!1}}))),{name:`shell-shock:inputs`,async configResolved(){this.debug(`Checking for commands using input: ${JSON.stringify(this.config.input)}`),this.commandsPath=await u.findCommandsRoot(this),this.debug(`Resolved commands root path: ${this.commandsPath}`);let e=await(0,z.resolveInputs)(this,this.config.input);this.debug(`Found ${e.length} entry points specified in the configuration options.`),this.inputs=e.reduce(B((e,n)=>{if(n.file!==this.commandsPath&&!(0,k.isParentPath)(n.file,this.commandsPath))throw Error(`Command entry point "${n.file}" is not located within the commands root "${this.commandsPath}". Please ensure that all command entry points are located within the current project.`);let r=u.resolveCommandId(this,n.file);if(!e.some(B(e=>e.id===r,[`existing`,``,`P"2!"/"`]))){let i=u.resolveCommandName(n.file),a=u.resolveCommandPath(this,n.file).split(`/`).filter(Boolean);a=a.map(B((e,n)=>{let r=a.findIndex(B(t=>t===e,[`existing`,``,`P"2!"/"`]));return r!==-1&&r!==n&&(e+=`_${a.filter(B(e=>t.isDynamicPathSegment(e)&&t.getDynamicPathSegmentName(e).replace(/_\d+$/,``)===e,[`segment`,``,`P"2!"/"`])).length}`),e},[`segment`,`index`,``,`P"2!"2""/#`])),e.push({id:r,path:a.join(`/`),segments:a,name:i,alias:[],tags:[],isVirtual:!1,source:`file`,entry:{...n,file:n.file,input:{file:n.file,name:n.name},output:i}})}return e},[`ret`,`entry`,``,`P"2!"2""/#`]),this.inputs),this.debug(`Shell Shock will process ${this.inputs.length} command entry files: \n${this.inputs.map(B(e=>` - ${e.id}: ${(0,j.replacePath)(e.entry.file,this.commandsPath)}`,[`command`,``,`P"2!"/"`])).join(`
|
|
2
|
+
`)}`)},prepare:B(async function(){return this.debug(`Rendering base built-in modules for the Shell Shock application.`),(0,b.render)(this,[(0,g.createComponent)(s.StateBuiltin,{}),(0,g.createComponent)(c.UtilsBuiltin,{}),(0,g.createComponent)(r.ExecBuiltin,{})])},[`prepare`,`P"/!`])},{name:`shell-shock:virtual-inputs`,configResolved:{order:`post`,async handler(){this.inputs.length===0?this.warn(`No commands were found in the project. Please ensure at least one command exists.`):(this.debug(`Finding and adding virtual command inputs for each command previously found.`),this.inputs=this.inputs.reduce(B((e,n)=>{let r=0,i=(0,M.resolveParentPath)((0,O.findFilePath)(n.entry.file));if((0,k.isParentPath)(i,this.commandsPath))for(;i!==this.commandsPath;){if(r++>50)throw Error(`Unable to process virtual commands for ${n.name} \n\nPlease ensure ${n.entry.file} is a valid command entry file and does not have an invalid path.`);if(!e.some(B(e=>(0,O.findFilePath)(e.entry.file)===i,[`existing`,``,`P"2!"/"`]))){let n=(0,A.joinPaths)(i,`command.ts`),r=u.resolveCommandId(this,n);if(!e.some(B(e=>e.id===r,[`existing`,``,`P"2!"/"`]))){let i=u.resolveCommandName(n),a=u.resolveCommandPath(this,n).split(`/`).filter(Boolean);a=a.map(B((e,n)=>{let r=a.findIndex(B(t=>t===e,[`existing`,``,`P"2!"/"`]));return r!==-1&&r!==n&&(e+=`_${a.filter(B(e=>t.isDynamicPathSegment(e)&&t.getDynamicPathSegmentName(e).replace(/_\d+$/,``)===e,[`segment`,``,`P"2!"/"`])).length}`),e},[`segment`,`index`,``,`P"2!"2""/#`])),e.push({id:r,path:a.join(`/`),segments:a,name:i,alias:[],tags:[],isVirtual:!0,entry:{file:n},source:`file`})}}i=(0,M.resolveParentPath)(i)}return e},[`ret`,`command`,``,`P"2!"2""/#`]),this.inputs).sort(B((e,t)=>e.segments.length-t.segments.length,[`a`,`b`,``,`P"2!"2""/#`])),this.debug(`Final command input list: \n${this.inputs.map(B(e=>` - ${e.id}${e.isVirtual?` (virtual)`:``}: ${e.source===`file`?(0,j.replacePath)(e.entry.file,this.commandsPath):`added by ${e.source}`}`,[`command`,``,`P"2!"/"`])).join(`
|
|
3
|
+
`)}`))}}},{name:`shell-shock:update-env`,configResolved:{order:`post`,async handler(){this.debug(`Adding global options to the CLI application's environment variables.`);for(let e of Object.values(this.globalOptions).filter(B(e=>!!e.env,[`option`,``,`P"2!"/"`])).filter(B(e=>!this.env.types.env.getPropertyOrUndefined(e.env),[`option`,``,`P"2!"/"`])))this.env.types.env.addProperty({name:e.env,optional:e.optional?!0:void 0,description:e.description,visibility:v.ReflectionVisibility.public,type:i.extractType(e),default:e.default,tags:{title:e.title,alias:e.alias.filter(B(e=>e.length>1,[`alias`,``,`P"2!"/"`])).map(B(e=>(0,P.constantCase)(e),[`alias`,``,`P"2!"/"`])),domain:`cli`}});await(0,S.writeEnvTypeReflection)(this,this.env.types.env,`env`)}}},{name:`shell-shock:resolve-commands`,prepare:{order:`post`,async handler(){if(this.debug(`Initializing the CLI application's command tree.`),this.commands={},this.config.command!==`prepare`&&this.config.skipCache!==!0&&this.persistedMeta?.checksum===this.meta.checksum&&this.fs.existsSync(d.getCommandsPersistencePath(this)))this.debug(`Skipping command resolution as the meta checksum has not changed.`),await d.readCommandsPersistence(this);else{for(let e of this.inputs.filter(B(e=>e.segments.filter(B(e=>!t.isDynamicPathSegment(e)&&!t.isPathSegmentGroup(e),[`segment`,``,`P"2!"/"`])).length===1,[`input`,``,`P"2!"/"`])))this.commands[e.name]=await h.resolve({context:this,command:e});this.debug(`Post-processing commands to ensure proper reflection.`),await a.traverseCommands(this,B(e=>{e.options=Object.fromEntries(Object.entries(e.options).map(B(([e,t])=>[(0,N.camelCase)(e),{...t,name:(0,N.camelCase)(e),alias:t.alias??[],optional:t.optional??!1}],[`param0`,``,`P"2!"/"`])))},[`command`,``,`P"2!"/"`])),await d.writeCommandsPersistence(this)}this.debug(`Validating the CLI applications command tree.`);let e=!0;if(await a.traverseCommands(this,B(t=>{let n=m.validateCommand(t);n.length>0&&(this.error(`Found ${n.length} issue${n.length>1?`s`:``} with the ${t.title} command: \n${n.map(B(e=>` - ${e.code}: ${e.details}`,[`failure`,``,`P"2!"/"`])).join(`
|
|
4
|
+
`)}\n`),e=!1)},[`command`,``,`P"2!"/"`])),!e)throw Error(`One or more commands in the command tree are invalid. Please review the errors above and correct them before proceeding.`);this.info(`\nCreating an application with the following command tree: \n${p.formatCommandTree(this)}\n`)}}},{name:`shell-shock:chmod+x`,configResolved(){this.config.tsdown.hooks??={},this.config.tsdown.hooks[`build:done`]=B(async e=>{await Promise.all(Object.values(this.config.bin).map(B(async e=>{let t=(0,D.appendPath)(e,(0,A.joinPaths)(this.config.cwd,this.config.root));if(this.fs.existsSync(t)){this.debug(`Adding hashbang to binary executable output file: ${t}`);let e=await this.fs.read(t);e&&!e.startsWith(`#!`)&&await this.fs.write(t,`#!/usr/bin/env ${this.config.mode===`development`?`-S NODE_OPTIONS=--enable-source-maps`:``} node\n\n${e}`),this.debug(`Adding executable permissions (chmod+x) to binary executable output file: ${t}`),await(0,E.chmodX)(t)}else this.warn(`Expected binary output file not found at path: ${t}. Skipping adding hashbang and executable permissions (chmod+x).`)},[`bin`,``,`P"2!"/"`])))},[`chunks`,`_`,``,`PP!P!F4!MK2""/#`])}},{name:`shell-shock:docs`,configResolved:B(function(){this.config.automd??={},this.config.automd.generators={...this.config.automd.generators??{},commands:l.commands(this)}},[`configResolved`,`P"/!`]),async docs(){this.debug("Rendering entrypoint modules for the Shell Shock `script` preset.");let e=this.inputs.map(B(e=>o.getCommandTree(this,e.segments),[`input`,``,`P"2!"/"`])).filter(Boolean);return(0,b.render)(this,(0,g.createComponent)(_.For,{get each(){return Object.values(e)},doubleHardline:!0,get children(){return B(e=>(0,g.createComponent)(_.Show,{get when(){return!e.isVirtual},get children(){return(0,g.createComponent)(n.CommandDocsFile,{command:e})}}),[`child`,``,`P"2!"/"`])}}))}}],[`Options`,`options`,()=>({}),``,`P"w!2">#!F/$`]);exports.default=V,exports.plugin=V;
|
package/dist/plugin.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../src/plugin.tsx"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../src/plugin.tsx"],"mappings":";;;;;;;AAsFA;cAAa,MAAA,oBAA2B,OAAA,GAAU,OAAA,EAChD,OAAA,GAAS,OAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/plugin.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.tsx"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.tsx"],"mappings":";;;;;;;AAsFA;cAAa,MAAA,oBAA2B,OAAA,GAAU,OAAA,EAChD,OAAA,GAAS,OAAA,KACR,MAAA,CAAO,QAAA"}
|