@shell-shock/preset-script 0.1.1
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/builtin/console.cjs +1232 -0
- package/dist/components/builtin/console.cjs.map +1 -0
- package/dist/components/builtin/console.d.cts +37 -0
- package/dist/components/builtin/console.d.mts +37 -0
- package/dist/components/builtin/console.mjs +1225 -0
- package/dist/components/builtin/console.mjs.map +1 -0
- package/dist/components/builtin/index.cjs +9 -0
- package/dist/components/builtin/index.d.cts +2 -0
- package/dist/components/builtin/index.d.mts +2 -0
- package/dist/components/builtin/index.mjs +3 -0
- package/dist/components/command-router.cjs +103 -0
- package/dist/components/command-router.cjs.map +1 -0
- package/dist/components/command-router.d.cts +8 -0
- package/dist/components/command-router.d.mts +8 -0
- package/dist/components/command-router.mjs +101 -0
- package/dist/components/command-router.mjs.map +1 -0
- package/dist/components/entry/bin.cjs +92 -0
- package/dist/components/entry/bin.cjs.map +1 -0
- package/dist/components/entry/bin.d.cts +15 -0
- package/dist/components/entry/bin.d.mts +15 -0
- package/dist/components/entry/bin.mjs +91 -0
- package/dist/components/entry/bin.mjs.map +1 -0
- package/dist/components/entry/command.cjs +54 -0
- package/dist/components/entry/command.cjs.map +1 -0
- package/dist/components/entry/command.d.cts +15 -0
- package/dist/components/entry/command.d.mts +15 -0
- package/dist/components/entry/command.mjs +53 -0
- package/dist/components/entry/command.mjs.map +1 -0
- package/dist/components/entry/index.cjs +3 -0
- package/dist/components/entry/index.d.cts +2 -0
- package/dist/components/entry/index.d.mts +2 -0
- package/dist/components/entry/index.mjs +3 -0
- package/dist/components/index.cjs +19 -0
- package/dist/components/index.d.cts +7 -0
- package/dist/components/index.d.mts +7 -0
- package/dist/components/index.mjs +8 -0
- package/dist/components/shutdown.cjs +93 -0
- package/dist/components/shutdown.cjs.map +1 -0
- package/dist/components/shutdown.d.cts +14 -0
- package/dist/components/shutdown.d.mts +14 -0
- package/dist/components/shutdown.mjs +91 -0
- package/dist/components/shutdown.mjs.map +1 -0
- package/dist/contexts/command.cjs +21 -0
- package/dist/contexts/command.cjs.map +1 -0
- package/dist/contexts/command.mjs +19 -0
- package/dist/contexts/command.mjs.map +1 -0
- package/dist/contexts/theme.cjs +29 -0
- package/dist/contexts/theme.cjs.map +1 -0
- package/dist/contexts/theme.mjs +27 -0
- package/dist/contexts/theme.mjs.map +1 -0
- package/dist/helpers/ansi-utils.cjs +484 -0
- package/dist/helpers/ansi-utils.cjs.map +1 -0
- package/dist/helpers/ansi-utils.mjs +483 -0
- package/dist/helpers/ansi-utils.mjs.map +1 -0
- package/dist/helpers/get-default-options.cjs +57 -0
- package/dist/helpers/get-default-options.cjs.map +1 -0
- package/dist/helpers/get-default-options.mjs +56 -0
- package/dist/helpers/get-default-options.mjs.map +1 -0
- package/dist/index.cjs +65 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +12 -0
- package/dist/index.d.mts +12 -0
- package/dist/index.mjs +59 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/index.cjs +0 -0
- package/dist/types/index.d.cts +2 -0
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/plugin.cjs +0 -0
- package/dist/types/plugin.d.cts +32 -0
- package/dist/types/plugin.d.mts +32 -0
- package/dist/types/plugin.mjs +1 -0
- package/package.json +181 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
+
const require_components_builtin_console = require('./components/builtin/console.cjs');
|
|
4
|
+
const require_components_entry_bin = require('./components/entry/bin.cjs');
|
|
5
|
+
const require_components_entry_command = require('./components/entry/command.cjs');
|
|
6
|
+
const require_components_shutdown = require('./components/shutdown.cjs');
|
|
7
|
+
const require_get_default_options = require('./helpers/get-default-options.cjs');
|
|
8
|
+
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
9
|
+
let __alloy_js_core_components = require("@alloy-js/core/components");
|
|
10
|
+
let __powerlines_plugin_nodejs = require("@powerlines/plugin-nodejs");
|
|
11
|
+
__powerlines_plugin_nodejs = require_rolldown_runtime.__toESM(__powerlines_plugin_nodejs);
|
|
12
|
+
let __shell_shock_core_components_utils_builtin = require("@shell-shock/core/components/utils-builtin");
|
|
13
|
+
let __shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
|
|
14
|
+
let __shell_shock_core_powerlines = require("@shell-shock/core/powerlines");
|
|
15
|
+
__shell_shock_core_powerlines = require_rolldown_runtime.__toESM(__shell_shock_core_powerlines);
|
|
16
|
+
let __shell_shock_plugin_theme = require("@shell-shock/plugin-theme");
|
|
17
|
+
__shell_shock_plugin_theme = require_rolldown_runtime.__toESM(__shell_shock_plugin_theme);
|
|
18
|
+
|
|
19
|
+
//#region src/index.tsx
|
|
20
|
+
/**
|
|
21
|
+
* The Shell Shock base plugin.
|
|
22
|
+
*/
|
|
23
|
+
const plugin = (options = {}) => {
|
|
24
|
+
return [
|
|
25
|
+
...(0, __shell_shock_core_powerlines.default)(options),
|
|
26
|
+
(0, __powerlines_plugin_nodejs.default)(options),
|
|
27
|
+
(0, __shell_shock_plugin_theme.default)({ theme: options.theme }),
|
|
28
|
+
{
|
|
29
|
+
name: "shell-shock:script-preset",
|
|
30
|
+
config() {
|
|
31
|
+
this.trace("Providing default configuration for the Shell Shock `script` preset.");
|
|
32
|
+
return {
|
|
33
|
+
defaultOptions: require_get_default_options.getDefaultOptions,
|
|
34
|
+
...options
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
async prepare() {
|
|
38
|
+
this.trace("Rendering source code with the Shell Shock `script` preset.");
|
|
39
|
+
const commands = this.inputs.map((input) => (0, __shell_shock_core_plugin_utils.getCommandTree)(this, input.path)).filter(Boolean);
|
|
40
|
+
return this.render([
|
|
41
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(require_components_entry_bin.BinEntry, {
|
|
42
|
+
get prefix() {
|
|
43
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_shutdown.ShutdownFunctionDeclaration, {});
|
|
44
|
+
},
|
|
45
|
+
get postfix() {
|
|
46
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_shutdown.ShutdownFunctionUsage, {});
|
|
47
|
+
}
|
|
48
|
+
}),
|
|
49
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core_components.For, {
|
|
50
|
+
each: commands,
|
|
51
|
+
children: (command) => (0, __alloy_js_core_jsx_runtime.createComponent)(require_components_entry_command.CommandEntry, { command })
|
|
52
|
+
}),
|
|
53
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__shell_shock_core_components_utils_builtin.UtilsBuiltin, {}),
|
|
54
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(require_components_builtin_console.ConsoleBuiltin, {})
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
};
|
|
60
|
+
var src_default = plugin;
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
exports.default = src_default;
|
|
64
|
+
exports.plugin = plugin;
|
|
65
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["For","nodejs","UtilsBuiltin","getCommandTree","core","theme","ConsoleBuiltin","BinEntry","CommandEntry","ShutdownFunctionDeclaration","ShutdownFunctionUsage","getDefaultOptions","plugin","options","name","config","trace","defaultOptions","prepare","commands","inputs","map","input","path","filter","Boolean","render","_$createComponent","prefix","postfix","each","children","command"],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { For } from \"@alloy-js/core/components\";\nimport nodejs from \"@powerlines/plugin-nodejs\";\nimport { UtilsBuiltin } from \"@shell-shock/core/components/utils-builtin\";\nimport { getCommandTree } from \"@shell-shock/core/plugin-utils\";\nimport core from \"@shell-shock/core/powerlines\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport theme from \"@shell-shock/plugin-theme\";\nimport type { Plugin } from \"powerlines/types/plugin\";\nimport { ConsoleBuiltin } from \"./components/builtin/console\";\nimport { BinEntry } from \"./components/entry/bin\";\nimport { CommandEntry } from \"./components/entry/command\";\nimport {\n ShutdownFunctionDeclaration,\n ShutdownFunctionUsage\n} from \"./components/shutdown\";\nimport { getDefaultOptions } from \"./helpers/get-default-options\";\nimport type { ScriptPresetContext, ScriptPresetOptions } from \"./types/plugin\";\n\n/**\n * The Shell Shock base plugin.\n */\nexport const plugin = <\n TContext extends ScriptPresetContext = ScriptPresetContext\n>(\n options: ScriptPresetOptions = {}\n) => {\n return [\n ...core(options),\n nodejs(options),\n theme({\n theme: options.theme\n }),\n {\n name: \"shell-shock:script-preset\",\n config() {\n this.trace(\n \"Providing default configuration for the Shell Shock `script` preset.\"\n );\n\n return {\n defaultOptions: getDefaultOptions,\n ...options\n };\n },\n async prepare() {\n this.trace(\n \"Rendering source code with the Shell Shock `script` preset.\"\n );\n\n const commands = this.inputs\n .map(input => getCommandTree(this, input.path))\n .filter(Boolean) as CommandTree[];\n\n return this.render<TContext>(\n <>\n <BinEntry\n prefix={<ShutdownFunctionDeclaration />}\n postfix={<ShutdownFunctionUsage />}\n />\n <For each={commands}>\n {command => <CommandEntry command={command} />}\n </For>\n <UtilsBuiltin />\n <ConsoleBuiltin />\n </>\n );\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAaY,UAGXC,UAA+B,EAAE,KAC9B;AACH,QAAO;EACL,8CAAQA,QAAQ;0CACTA,QAAQ;0CACT,EACJR,OAAOQ,QAAQR,OAChB,CAAC;EACF;GACES,MAAM;GACNC,SAAS;AACP,SAAKC,MACH,uEACD;AAED,WAAO;KACLC,gBAAgBN;KAChB,GAAGE;KACJ;;GAEH,MAAMK,UAAU;AACd,SAAKF,MACH,8DACD;IAED,MAAMG,WAAW,KAAKC,OACnBC,KAAIC,8DAAwB,MAAMA,MAAMC,KAAK,CAAC,CAC9CC,OAAOC,QAAyB;AAEnC,WAAO,KAAKC,OAAM;sDAEbnB,uCAAQ;MAAA,IACPqB,SAAM;AAAA,+DAAGnB,yDAA2B,EAAA,CAAA;;MAAA,IACpCoB,UAAO;AAAA,+DAAGnB,mDAAqB,EAAA,CAAA;;MAAA,CAAA;sDAEhCV,gCAAG;MAAC8B,MAAMX;MAAQY,WAChBC,6DAAYxB,+CAAY,EAAUwB,SAAO,CAAA;MAAI,CAAA;sDAE/C9B,0DAAY,EAAA,CAAA;sDACZI,mDAAc,EAAA,CAAA;KAEnB,CAAC;;GAEJ;EACF;;AAGH,kBAAeM"}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ScriptPresetContext, ScriptPresetOptions } from "./types/plugin.cjs";
|
|
2
|
+
import { Plugin } from "powerlines/types/plugin";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The Shell Shock base plugin.
|
|
8
|
+
*/
|
|
9
|
+
declare const plugin: <TContext extends ScriptPresetContext = ScriptPresetContext>(options?: ScriptPresetOptions) => Plugin<TContext>[];
|
|
10
|
+
//#endregion
|
|
11
|
+
export { plugin as default, plugin };
|
|
12
|
+
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ScriptPresetContext, ScriptPresetOptions } from "./types/plugin.mjs";
|
|
2
|
+
import { Plugin } from "powerlines/types/plugin";
|
|
3
|
+
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The Shell Shock base plugin.
|
|
8
|
+
*/
|
|
9
|
+
declare const plugin: <TContext extends ScriptPresetContext = ScriptPresetContext>(options?: ScriptPresetOptions) => Plugin<TContext>[];
|
|
10
|
+
//#endregion
|
|
11
|
+
export { plugin as default, plugin };
|
|
12
|
+
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ConsoleBuiltin } from "./components/builtin/console.mjs";
|
|
2
|
+
import { BinEntry } from "./components/entry/bin.mjs";
|
|
3
|
+
import { CommandEntry } from "./components/entry/command.mjs";
|
|
4
|
+
import { ShutdownFunctionDeclaration, ShutdownFunctionUsage } from "./components/shutdown.mjs";
|
|
5
|
+
import { getDefaultOptions } from "./helpers/get-default-options.mjs";
|
|
6
|
+
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
7
|
+
import { For } from "@alloy-js/core/components";
|
|
8
|
+
import nodejs from "@powerlines/plugin-nodejs";
|
|
9
|
+
import { UtilsBuiltin } from "@shell-shock/core/components/utils-builtin";
|
|
10
|
+
import { getCommandTree } from "@shell-shock/core/plugin-utils";
|
|
11
|
+
import core from "@shell-shock/core/powerlines";
|
|
12
|
+
import theme from "@shell-shock/plugin-theme";
|
|
13
|
+
|
|
14
|
+
//#region src/index.tsx
|
|
15
|
+
/**
|
|
16
|
+
* The Shell Shock base plugin.
|
|
17
|
+
*/
|
|
18
|
+
const plugin = (options = {}) => {
|
|
19
|
+
return [
|
|
20
|
+
...core(options),
|
|
21
|
+
nodejs(options),
|
|
22
|
+
theme({ theme: options.theme }),
|
|
23
|
+
{
|
|
24
|
+
name: "shell-shock:script-preset",
|
|
25
|
+
config() {
|
|
26
|
+
this.trace("Providing default configuration for the Shell Shock `script` preset.");
|
|
27
|
+
return {
|
|
28
|
+
defaultOptions: getDefaultOptions,
|
|
29
|
+
...options
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
async prepare() {
|
|
33
|
+
this.trace("Rendering source code with the Shell Shock `script` preset.");
|
|
34
|
+
const commands = this.inputs.map((input) => getCommandTree(this, input.path)).filter(Boolean);
|
|
35
|
+
return this.render([
|
|
36
|
+
createComponent(BinEntry, {
|
|
37
|
+
get prefix() {
|
|
38
|
+
return createComponent(ShutdownFunctionDeclaration, {});
|
|
39
|
+
},
|
|
40
|
+
get postfix() {
|
|
41
|
+
return createComponent(ShutdownFunctionUsage, {});
|
|
42
|
+
}
|
|
43
|
+
}),
|
|
44
|
+
createComponent(For, {
|
|
45
|
+
each: commands,
|
|
46
|
+
children: (command) => createComponent(CommandEntry, { command })
|
|
47
|
+
}),
|
|
48
|
+
createComponent(UtilsBuiltin, {}),
|
|
49
|
+
createComponent(ConsoleBuiltin, {})
|
|
50
|
+
]);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
];
|
|
54
|
+
};
|
|
55
|
+
var src_default = plugin;
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
export { src_default as default, plugin };
|
|
59
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["For","nodejs","UtilsBuiltin","getCommandTree","core","theme","ConsoleBuiltin","BinEntry","CommandEntry","ShutdownFunctionDeclaration","ShutdownFunctionUsage","getDefaultOptions","plugin","options","name","config","trace","defaultOptions","prepare","commands","inputs","map","input","path","filter","Boolean","render","_$createComponent","prefix","postfix","each","children","command"],"sources":["../src/index.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { For } from \"@alloy-js/core/components\";\nimport nodejs from \"@powerlines/plugin-nodejs\";\nimport { UtilsBuiltin } from \"@shell-shock/core/components/utils-builtin\";\nimport { getCommandTree } from \"@shell-shock/core/plugin-utils\";\nimport core from \"@shell-shock/core/powerlines\";\nimport type { CommandTree } from \"@shell-shock/core/types/command\";\nimport theme from \"@shell-shock/plugin-theme\";\nimport type { Plugin } from \"powerlines/types/plugin\";\nimport { ConsoleBuiltin } from \"./components/builtin/console\";\nimport { BinEntry } from \"./components/entry/bin\";\nimport { CommandEntry } from \"./components/entry/command\";\nimport {\n ShutdownFunctionDeclaration,\n ShutdownFunctionUsage\n} from \"./components/shutdown\";\nimport { getDefaultOptions } from \"./helpers/get-default-options\";\nimport type { ScriptPresetContext, ScriptPresetOptions } from \"./types/plugin\";\n\n/**\n * The Shell Shock base plugin.\n */\nexport const plugin = <\n TContext extends ScriptPresetContext = ScriptPresetContext\n>(\n options: ScriptPresetOptions = {}\n) => {\n return [\n ...core(options),\n nodejs(options),\n theme({\n theme: options.theme\n }),\n {\n name: \"shell-shock:script-preset\",\n config() {\n this.trace(\n \"Providing default configuration for the Shell Shock `script` preset.\"\n );\n\n return {\n defaultOptions: getDefaultOptions,\n ...options\n };\n },\n async prepare() {\n this.trace(\n \"Rendering source code with the Shell Shock `script` preset.\"\n );\n\n const commands = this.inputs\n .map(input => getCommandTree(this, input.path))\n .filter(Boolean) as CommandTree[];\n\n return this.render<TContext>(\n <>\n <BinEntry\n prefix={<ShutdownFunctionDeclaration />}\n postfix={<ShutdownFunctionUsage />}\n />\n <For each={commands}>\n {command => <CommandEntry command={command} />}\n </For>\n <UtilsBuiltin />\n <ConsoleBuiltin />\n </>\n );\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;AAuCA,MAAaY,UAGXC,UAA+B,EAAE,KAC9B;AACH,QAAO;EACL,GAAGT,KAAKS,QAAQ;EAChBZ,OAAOY,QAAQ;EACfR,MAAM,EACJA,OAAOQ,QAAQR,OAChB,CAAC;EACF;GACES,MAAM;GACNC,SAAS;AACP,SAAKC,MACH,uEACD;AAED,WAAO;KACLC,gBAAgBN;KAChB,GAAGE;KACJ;;GAEH,MAAMK,UAAU;AACd,SAAKF,MACH,8DACD;IAED,MAAMG,WAAW,KAAKC,OACnBC,KAAIC,UAASnB,eAAe,MAAMmB,MAAMC,KAAK,CAAC,CAC9CC,OAAOC,QAAyB;AAEnC,WAAO,KAAKC,OAAM;KAAAC,gBAEbpB,UAAQ;MAAA,IACPqB,SAAM;AAAA,cAAAD,gBAAGlB,6BAA2B,EAAA,CAAA;;MAAA,IACpCoB,UAAO;AAAA,cAAAF,gBAAGjB,uBAAqB,EAAA,CAAA;;MAAA,CAAA;KAAAiB,gBAEhC3B,KAAG;MAAC8B,MAAMX;MAAQY,WAChBC,YAAOL,gBAAKnB,cAAY,EAAUwB,SAAO,CAAA;MAAI,CAAA;KAAAL,gBAE/CzB,cAAY,EAAA,CAAA;KAAAyB,gBACZrB,gBAAc,EAAA,CAAA;KAEnB,CAAC;;GAEJ;EACF;;AAGH,kBAAeM"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CommandBase, CommandOption } from "@shell-shock/core/types/command";
|
|
2
|
+
import { AlloyPluginContext, AlloyPluginOptions } from "@powerlines/plugin-alloy/types/plugin";
|
|
3
|
+
import { Options, ResolvedConfig, UserConfig } from "@shell-shock/core/types/config";
|
|
4
|
+
import { Context } from "@shell-shock/core/types/context";
|
|
5
|
+
import { ThemePluginContext, ThemePluginOptions, ThemePluginResolvedConfig } from "@shell-shock/plugin-theme/types/plugin";
|
|
6
|
+
|
|
7
|
+
//#region src/types/plugin.d.ts
|
|
8
|
+
interface ScriptPresetOptions extends Omit<Options, "defaultOptions">, Partial<ThemePluginOptions> {
|
|
9
|
+
/**
|
|
10
|
+
* A set of default command options to apply to each command.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* By default, Shell Shock adds the following set of default arguments to each command:
|
|
14
|
+
* - `--help` (`-h`, `-?`): Show help information.
|
|
15
|
+
* - `--version` (`-v`): Show the version of the application.
|
|
16
|
+
* - `--no-banner`: Hide the banner displayed while running the CLI application.
|
|
17
|
+
* - `--verbose`: Enable verbose output.
|
|
18
|
+
*
|
|
19
|
+
* To disable the addition of these default options, set this property to `false`, or provide a custom set of options/a function that returns them.
|
|
20
|
+
*/
|
|
21
|
+
defaultOptions?: CommandOption[] | ((context: Context, input: CommandBase) => CommandOption[]) | false;
|
|
22
|
+
/**
|
|
23
|
+
* Configuration options for the Alloy plugin.
|
|
24
|
+
*/
|
|
25
|
+
alloy?: AlloyPluginOptions;
|
|
26
|
+
}
|
|
27
|
+
type ScriptPresetUserConfig = UserConfig & ScriptPresetOptions;
|
|
28
|
+
type ScriptPresetResolvedConfig = ResolvedConfig & Required<Omit<ScriptPresetOptions, "theme">> & ThemePluginResolvedConfig;
|
|
29
|
+
type ScriptPresetContext<TResolvedConfig extends ScriptPresetResolvedConfig = ScriptPresetResolvedConfig> = AlloyPluginContext<TResolvedConfig> & ThemePluginContext<TResolvedConfig> & Context<TResolvedConfig>;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { ScriptPresetContext, ScriptPresetOptions, ScriptPresetResolvedConfig, ScriptPresetUserConfig };
|
|
32
|
+
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CommandBase, CommandOption } from "@shell-shock/core/types/command";
|
|
2
|
+
import { AlloyPluginContext, AlloyPluginOptions } from "@powerlines/plugin-alloy/types/plugin";
|
|
3
|
+
import { Options, ResolvedConfig, UserConfig } from "@shell-shock/core/types/config";
|
|
4
|
+
import { Context } from "@shell-shock/core/types/context";
|
|
5
|
+
import { ThemePluginContext, ThemePluginOptions, ThemePluginResolvedConfig } from "@shell-shock/plugin-theme/types/plugin";
|
|
6
|
+
|
|
7
|
+
//#region src/types/plugin.d.ts
|
|
8
|
+
interface ScriptPresetOptions extends Omit<Options, "defaultOptions">, Partial<ThemePluginOptions> {
|
|
9
|
+
/**
|
|
10
|
+
* A set of default command options to apply to each command.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* By default, Shell Shock adds the following set of default arguments to each command:
|
|
14
|
+
* - `--help` (`-h`, `-?`): Show help information.
|
|
15
|
+
* - `--version` (`-v`): Show the version of the application.
|
|
16
|
+
* - `--no-banner`: Hide the banner displayed while running the CLI application.
|
|
17
|
+
* - `--verbose`: Enable verbose output.
|
|
18
|
+
*
|
|
19
|
+
* To disable the addition of these default options, set this property to `false`, or provide a custom set of options/a function that returns them.
|
|
20
|
+
*/
|
|
21
|
+
defaultOptions?: CommandOption[] | ((context: Context, input: CommandBase) => CommandOption[]) | false;
|
|
22
|
+
/**
|
|
23
|
+
* Configuration options for the Alloy plugin.
|
|
24
|
+
*/
|
|
25
|
+
alloy?: AlloyPluginOptions;
|
|
26
|
+
}
|
|
27
|
+
type ScriptPresetUserConfig = UserConfig & ScriptPresetOptions;
|
|
28
|
+
type ScriptPresetResolvedConfig = ResolvedConfig & Required<Omit<ScriptPresetOptions, "theme">> & ThemePluginResolvedConfig;
|
|
29
|
+
type ScriptPresetContext<TResolvedConfig extends ScriptPresetResolvedConfig = ScriptPresetResolvedConfig> = AlloyPluginContext<TResolvedConfig> & ThemePluginContext<TResolvedConfig> & Context<TResolvedConfig>;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { ScriptPresetContext, ScriptPresetOptions, ScriptPresetResolvedConfig, ScriptPresetUserConfig };
|
|
32
|
+
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/package.json
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@shell-shock/preset-script",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A Shell Shock preset that generates a fully-featured script application.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "github",
|
|
8
|
+
"url": "https://github.com/storm-software/shell-shock.git",
|
|
9
|
+
"directory": "packages/preset-script"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://stormsoftware.com",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://stormsoftware.com/support",
|
|
14
|
+
"email": "support@stormsoftware.com"
|
|
15
|
+
},
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "Storm Software",
|
|
18
|
+
"email": "contact@stormsoftware.com",
|
|
19
|
+
"url": "https://stormsoftware.com"
|
|
20
|
+
},
|
|
21
|
+
"maintainers": [
|
|
22
|
+
{
|
|
23
|
+
"name": "Storm Software",
|
|
24
|
+
"email": "contact@stormsoftware.com",
|
|
25
|
+
"url": "https://stormsoftware.com"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"contributors": [
|
|
29
|
+
{
|
|
30
|
+
"name": "Storm Software",
|
|
31
|
+
"email": "contact@stormsoftware.com",
|
|
32
|
+
"url": "https://stormsoftware.com"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"funding": {
|
|
36
|
+
"type": "github",
|
|
37
|
+
"url": "https://github.com/sponsors/storm-software"
|
|
38
|
+
},
|
|
39
|
+
"license": "Apache-2.0",
|
|
40
|
+
"private": false,
|
|
41
|
+
"main": "dist/index.cjs",
|
|
42
|
+
"module": "dist/index.mjs",
|
|
43
|
+
"typings": "dist/index.d.mts",
|
|
44
|
+
"exports": {
|
|
45
|
+
"./package.json": "./package.json",
|
|
46
|
+
".": {
|
|
47
|
+
"import": {
|
|
48
|
+
"types": "./dist/index.d.mts",
|
|
49
|
+
"default": "./dist/index.mjs"
|
|
50
|
+
},
|
|
51
|
+
"require": {
|
|
52
|
+
"types": "./dist/index.d.cts",
|
|
53
|
+
"default": "./dist/index.cjs"
|
|
54
|
+
},
|
|
55
|
+
"default": {
|
|
56
|
+
"types": "./dist/index.d.mts",
|
|
57
|
+
"default": "./dist/index.mjs"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"./index": {
|
|
61
|
+
"import": {
|
|
62
|
+
"types": "./dist/index.d.mts",
|
|
63
|
+
"default": "./dist/index.mjs"
|
|
64
|
+
},
|
|
65
|
+
"require": {
|
|
66
|
+
"types": "./dist/index.d.cts",
|
|
67
|
+
"default": "./dist/index.cjs"
|
|
68
|
+
},
|
|
69
|
+
"default": {
|
|
70
|
+
"types": "./dist/index.d.mts",
|
|
71
|
+
"default": "./dist/index.mjs"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"./types": {
|
|
75
|
+
"import": {
|
|
76
|
+
"types": "./dist/types/index.d.mts",
|
|
77
|
+
"default": "./dist/types/index.mjs"
|
|
78
|
+
},
|
|
79
|
+
"require": {
|
|
80
|
+
"types": "./dist/types/index.d.cts",
|
|
81
|
+
"default": "./dist/types/index.cjs"
|
|
82
|
+
},
|
|
83
|
+
"default": {
|
|
84
|
+
"types": "./dist/types/index.d.mts",
|
|
85
|
+
"default": "./dist/types/index.mjs"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"./types/*": {
|
|
89
|
+
"import": {
|
|
90
|
+
"types": "./dist/types/*.d.mts",
|
|
91
|
+
"default": "./dist/types/*.mjs"
|
|
92
|
+
},
|
|
93
|
+
"require": {
|
|
94
|
+
"types": "./dist/types/*.d.cts",
|
|
95
|
+
"default": "./dist/types/*.cjs"
|
|
96
|
+
},
|
|
97
|
+
"default": {
|
|
98
|
+
"types": "./dist/types/*.d.mts",
|
|
99
|
+
"default": "./dist/types/*.mjs"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"./components": {
|
|
103
|
+
"import": {
|
|
104
|
+
"types": "./dist/components/index.d.mts",
|
|
105
|
+
"default": "./dist/components/index.mjs"
|
|
106
|
+
},
|
|
107
|
+
"require": {
|
|
108
|
+
"types": "./dist/components/index.d.cts",
|
|
109
|
+
"default": "./dist/components/index.cjs"
|
|
110
|
+
},
|
|
111
|
+
"default": {
|
|
112
|
+
"types": "./dist/components/index.d.mts",
|
|
113
|
+
"default": "./dist/components/index.mjs"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"./components/*": {
|
|
117
|
+
"import": {
|
|
118
|
+
"types": "./dist/components/*.d.mts",
|
|
119
|
+
"default": "./dist/components/*.mjs"
|
|
120
|
+
},
|
|
121
|
+
"require": {
|
|
122
|
+
"types": "./dist/components/*.d.cts",
|
|
123
|
+
"default": "./dist/components/*.cjs"
|
|
124
|
+
},
|
|
125
|
+
"default": {
|
|
126
|
+
"types": "./dist/components/*.d.mts",
|
|
127
|
+
"default": "./dist/components/*.mjs"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"./components/entry": {
|
|
131
|
+
"import": {
|
|
132
|
+
"types": "./dist/components/entry/index.d.mts",
|
|
133
|
+
"default": "./dist/components/entry/index.mjs"
|
|
134
|
+
},
|
|
135
|
+
"require": {
|
|
136
|
+
"types": "./dist/components/entry/index.d.cts",
|
|
137
|
+
"default": "./dist/components/entry/index.cjs"
|
|
138
|
+
},
|
|
139
|
+
"default": {
|
|
140
|
+
"types": "./dist/components/entry/index.d.mts",
|
|
141
|
+
"default": "./dist/components/entry/index.mjs"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"./components/entry/*": {
|
|
145
|
+
"import": {
|
|
146
|
+
"types": "./dist/components/entry/*.d.mts",
|
|
147
|
+
"default": "./dist/components/entry/*.mjs"
|
|
148
|
+
},
|
|
149
|
+
"require": {
|
|
150
|
+
"types": "./dist/components/entry/*.d.cts",
|
|
151
|
+
"default": "./dist/components/entry/*.cjs"
|
|
152
|
+
},
|
|
153
|
+
"default": {
|
|
154
|
+
"types": "./dist/components/entry/*.d.mts",
|
|
155
|
+
"default": "./dist/components/entry/*.mjs"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"files": ["dist/**/*"],
|
|
160
|
+
"keywords": [
|
|
161
|
+
"shell-shock",
|
|
162
|
+
"shell-shock-plugin",
|
|
163
|
+
"powerlines",
|
|
164
|
+
"storm-software"
|
|
165
|
+
],
|
|
166
|
+
"dependencies": {
|
|
167
|
+
"@alloy-js/core": "^0.22.0",
|
|
168
|
+
"@alloy-js/typescript": "^0.22.0",
|
|
169
|
+
"@powerlines/deepkit": "^0.5.56",
|
|
170
|
+
"@powerlines/plugin-alloy": "^0.18.24",
|
|
171
|
+
"@powerlines/plugin-plugin": "^0.12.92",
|
|
172
|
+
"@shell-shock/core": "^0.2.1",
|
|
173
|
+
"@shell-shock/plugin-theme": "^0.0.6",
|
|
174
|
+
"@stryke/string-format": "^0.12.30",
|
|
175
|
+
"powerlines": "^0.37.14",
|
|
176
|
+
"@powerlines/plugin-nodejs": "^0.1.22"
|
|
177
|
+
},
|
|
178
|
+
"devDependencies": { "@babel/core": "^7.28.5", "@types/node": "^22.19.3" },
|
|
179
|
+
"publishConfig": { "access": "public" },
|
|
180
|
+
"gitHead": "5a8ce9d8f2cefeec8df5147bf80b5c3af71c6c16"
|
|
181
|
+
}
|