@shell-shock/plugin-banner 0.1.0
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/_virtual/_rolldown/runtime.mjs +3 -0
- package/dist/components/banner-builtin.cjs +64 -0
- package/dist/components/banner-builtin.d.cts +18 -0
- package/dist/components/banner-builtin.d.cts.map +1 -0
- package/dist/components/banner-builtin.d.mts +18 -0
- package/dist/components/banner-builtin.d.mts.map +1 -0
- package/dist/components/banner-builtin.mjs +62 -0
- package/dist/components/banner-builtin.mjs.map +1 -0
- package/dist/components/banner-function-declaration.cjs +136 -0
- package/dist/components/banner-function-declaration.d.cts +47 -0
- package/dist/components/banner-function-declaration.d.cts.map +1 -0
- package/dist/components/banner-function-declaration.d.mts +47 -0
- package/dist/components/banner-function-declaration.d.mts.map +1 -0
- package/dist/components/banner-function-declaration.mjs +133 -0
- package/dist/components/banner-function-declaration.mjs.map +1 -0
- package/dist/components/index.cjs +8 -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/index.cjs +68 -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 +64 -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 +22 -0
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +22 -0
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.mjs +1 -0
- package/package.json +158 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { BannerBuiltin } from "./components/banner-builtin.mjs";
|
|
2
|
+
import "./components/index.mjs";
|
|
3
|
+
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
4
|
+
import { For, computed } from "@alloy-js/core";
|
|
5
|
+
import { Spacing } from "@powerlines/plugin-alloy/core/components";
|
|
6
|
+
import { render } from "@powerlines/plugin-alloy/render";
|
|
7
|
+
import { getAppDescription, getAppName, getAppTitle, getCommandList } from "@shell-shock/core/plugin-utils";
|
|
8
|
+
import console from "@shell-shock/plugin-console";
|
|
9
|
+
import theme from "@shell-shock/plugin-theme";
|
|
10
|
+
import { joinPaths } from "@stryke/path/join";
|
|
11
|
+
|
|
12
|
+
//#region src/index.tsx
|
|
13
|
+
/**
|
|
14
|
+
* The Banner - Shell Shock plugin to add a banner command to the application.
|
|
15
|
+
*/
|
|
16
|
+
const plugin = (options = {}) => {
|
|
17
|
+
return [
|
|
18
|
+
...theme(options.theme),
|
|
19
|
+
console(options.console),
|
|
20
|
+
{
|
|
21
|
+
name: "shell-shock:banner",
|
|
22
|
+
enforce: "post",
|
|
23
|
+
prepare: {
|
|
24
|
+
order: "post",
|
|
25
|
+
async handler() {
|
|
26
|
+
const commands = await getCommandList(this);
|
|
27
|
+
this.debug(`Rendering \`banner\` built-ins for each of the ${commands.length} command modules.`);
|
|
28
|
+
const bin = computed(() => ({
|
|
29
|
+
id: "",
|
|
30
|
+
name: getAppName(this),
|
|
31
|
+
title: getAppTitle(this),
|
|
32
|
+
description: getAppDescription(this),
|
|
33
|
+
isVirtual: true,
|
|
34
|
+
path: null,
|
|
35
|
+
segments: [],
|
|
36
|
+
alias: [],
|
|
37
|
+
options: Object.fromEntries(this.options.map((option) => [option.name, option])),
|
|
38
|
+
entry: { file: joinPaths(this.entryPath, "bin.ts") },
|
|
39
|
+
args: [],
|
|
40
|
+
parent: null,
|
|
41
|
+
children: this.commands
|
|
42
|
+
}));
|
|
43
|
+
return render(this, [
|
|
44
|
+
createComponent(BannerBuiltin, { get command() {
|
|
45
|
+
return bin.value;
|
|
46
|
+
} }),
|
|
47
|
+
createComponent(Spacing, {}),
|
|
48
|
+
createComponent(For, {
|
|
49
|
+
get each() {
|
|
50
|
+
return commands.sort((a, b) => a.name.localeCompare(b.name));
|
|
51
|
+
},
|
|
52
|
+
doubleHardline: true,
|
|
53
|
+
children: (command) => createComponent(BannerBuiltin, { command })
|
|
54
|
+
})
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
];
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
export { plugin as default, plugin };
|
|
64
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"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 { computed, For } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { render } from \"@powerlines/plugin-alloy/render\";\nimport {\n getAppDescription,\n getAppName,\n getAppTitle,\n getCommandList\n} from \"@shell-shock/core/plugin-utils\";\nimport console from \"@shell-shock/plugin-console\";\nimport theme from \"@shell-shock/plugin-theme\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport type { Plugin } from \"powerlines\";\nimport { BannerBuiltin } from \"./components\";\nimport type { BannerPluginContext, BannerPluginOptions } from \"./types/plugin\";\n\nexport type * from \"./types\";\n\n/**\n * The Banner - Shell Shock plugin to add a banner command to the application.\n */\nexport const plugin = <\n TContext extends BannerPluginContext = BannerPluginContext\n>(\n options: BannerPluginOptions = {}\n) => {\n return [\n ...theme(options.theme),\n console(options.console),\n {\n name: \"shell-shock:banner\",\n enforce: \"post\",\n prepare: {\n order: \"post\",\n async handler() {\n const commands = await getCommandList(this);\n this.debug(\n `Rendering \\`banner\\` built-ins for each of the ${\n commands.length\n } command modules.`\n );\n\n const bin = computed(() => ({\n id: \"\",\n name: getAppName(this),\n title: getAppTitle(this),\n description: getAppDescription(this),\n isVirtual: true,\n path: null,\n segments: [],\n alias: [],\n options: Object.fromEntries(\n this.options.map(option => [option.name, option])\n ),\n entry: {\n file: joinPaths(this.entryPath, \"bin.ts\")\n },\n args: [],\n parent: null,\n children: this.commands\n }));\n\n return render(\n this,\n <>\n <BannerBuiltin command={bin.value} />\n <Spacing />\n <For\n each={commands.sort((a, b) => a.name.localeCompare(b.name))}\n doubleHardline>\n {command => <BannerBuiltin command={command} />}\n </For>\n </>\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;AAkCA,MAAa,UAAe,UAAA,EAAA,KAAA;;;;;GAE1B,MAAA;GACC,SAAU;GACX,SAAA;IACI,OAAO;IACX,MAAS,UAAQ;KAClB,MAAA,WAAA,MAAA,eAAA,KAAA;AACC,UAAS,MAAA,kDAAuB,SAAA,OAAA,mBAAA;KAC7B,MAAA,MAAA,gBAAA;MACI,IAAA;MACF,MAAM,WAAc,KAAA;MACvB,OAAQ,YAAgB,KAAA;MACxB,aAAA,kBAAA,KAAA;MACM,WAAS;MACb,MAAU;MACV,UAAS,EAAA;MACP,OAAQ,EAAA;MACR,SAAM,OAAU,YAAA,KAAA,QAAA,KAAA,WAAA,CAAA,OAAA,MAAA,OAAA,CAAA,CAAA;MACd,OAAM,EACN,MAAK,UAAK,KAAA,WAAA,SAAA,EACT;MACD,MAAI,EAAA;MACJ,QAAI;MACJ,UAAC,KAAA;;AAEH,YAAO,OAAO,MAAA;MAAA,gBAAgB,eAAA,EAC5B,IAAI,UAAI;AACN,cAAM,IAAA;SAET,CAAC;MAAE,gBAAa,SAAA,EAAA,CAAiB;MAAC,gBAAK,KAAA;OACtC,IAAE,OAAS;AACT,eAAM,SAAI,MAAA,GAAA,MAAA,EAAA,KAAA,cAAA,EAAA,KAAA,CAAA;;OAEZ,gBAAW;OACX,WAAU,YAAQ,gBAAW,eAAA,EACpB,SACR,CAAC;OACH,CAAC;MAAC,CAAC;;IAEP;GACF;EAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ResolvedConfig, UserConfig } from "@shell-shock/core";
|
|
2
|
+
import { Context } from "@shell-shock/core/types/context";
|
|
3
|
+
import { ConsolePluginContext, ConsolePluginOptions, ConsolePluginResolvedConfig, ConsolePluginUserConfig } from "@shell-shock/plugin-console";
|
|
4
|
+
import { ThemePluginContext, ThemePluginOptions, ThemePluginResolvedConfig, ThemePluginUserConfig } from "@shell-shock/plugin-theme";
|
|
5
|
+
|
|
6
|
+
//#region src/types/plugin.d.ts
|
|
7
|
+
interface BannerPluginOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Theme plugin options.
|
|
10
|
+
*/
|
|
11
|
+
theme?: ThemePluginOptions;
|
|
12
|
+
/**
|
|
13
|
+
* Console plugin options.
|
|
14
|
+
*/
|
|
15
|
+
console?: ConsolePluginOptions;
|
|
16
|
+
}
|
|
17
|
+
type BannerPluginUserConfig = ThemePluginUserConfig & ConsolePluginUserConfig & UserConfig;
|
|
18
|
+
type BannerPluginResolvedConfig = ThemePluginResolvedConfig & ConsolePluginResolvedConfig & ResolvedConfig;
|
|
19
|
+
type BannerPluginContext<TResolvedConfig extends BannerPluginResolvedConfig = BannerPluginResolvedConfig> = ThemePluginContext<TResolvedConfig> & ConsolePluginContext<TResolvedConfig> & Context<TResolvedConfig>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { BannerPluginContext, BannerPluginOptions, BannerPluginResolvedConfig, BannerPluginUserConfig };
|
|
22
|
+
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;UAiCiB,mBAAA;;AAAjB;;EAIE,KAAA,GAAQ,kBAAA;EAKsB;;;EAA9B,OAAA,GAAU,oBAAA;AAAA;AAAA,KAGA,sBAAA,GAAyB,qBAAA,GACnC,uBAAA,GACA,UAAA;AAAA,KAEU,0BAAA,GAA6B,yBAAA,GACvC,2BAAA,GACA,cAAA;AAAA,KAEU,mBAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,kBAAA,CAAmB,eAAA,IACrB,oBAAA,CAAqB,eAAA,IACrB,OAAA,CAAQ,eAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ConsolePluginContext, ConsolePluginOptions, ConsolePluginResolvedConfig, ConsolePluginUserConfig } from "@shell-shock/plugin-console";
|
|
2
|
+
import { ThemePluginContext, ThemePluginOptions, ThemePluginResolvedConfig, ThemePluginUserConfig } from "@shell-shock/plugin-theme";
|
|
3
|
+
import { ResolvedConfig, UserConfig } from "@shell-shock/core";
|
|
4
|
+
import { Context } from "@shell-shock/core/types/context";
|
|
5
|
+
|
|
6
|
+
//#region src/types/plugin.d.ts
|
|
7
|
+
interface BannerPluginOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Theme plugin options.
|
|
10
|
+
*/
|
|
11
|
+
theme?: ThemePluginOptions;
|
|
12
|
+
/**
|
|
13
|
+
* Console plugin options.
|
|
14
|
+
*/
|
|
15
|
+
console?: ConsolePluginOptions;
|
|
16
|
+
}
|
|
17
|
+
type BannerPluginUserConfig = ThemePluginUserConfig & ConsolePluginUserConfig & UserConfig;
|
|
18
|
+
type BannerPluginResolvedConfig = ThemePluginResolvedConfig & ConsolePluginResolvedConfig & ResolvedConfig;
|
|
19
|
+
type BannerPluginContext<TResolvedConfig extends BannerPluginResolvedConfig = BannerPluginResolvedConfig> = ThemePluginContext<TResolvedConfig> & ConsolePluginContext<TResolvedConfig> & Context<TResolvedConfig>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { BannerPluginContext, BannerPluginOptions, BannerPluginResolvedConfig, BannerPluginUserConfig };
|
|
22
|
+
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;UAiCiB,mBAAA;;AAAjB;;EAIE,KAAA,GAAQ,kBAAA;EAKsB;;;EAA9B,OAAA,GAAU,oBAAA;AAAA;AAAA,KAGA,sBAAA,GAAyB,qBAAA,GACnC,uBAAA,GACA,UAAA;AAAA,KAEU,0BAAA,GAA6B,yBAAA,GACvC,2BAAA,GACA,cAAA;AAAA,KAEU,mBAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,kBAAA,CAAmB,eAAA,IACrB,oBAAA,CAAqB,eAAA,IACrB,OAAA,CAAQ,eAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/package.json
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@shell-shock/plugin-banner",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "A package containing a Shell Shock plugin to generate banner built-in modules that display information about the application.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"shell-shock",
|
|
8
|
+
"shell-shock-plugin",
|
|
9
|
+
"powerlines",
|
|
10
|
+
"storm-software"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://stormsoftware.com",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://stormsoftware.com/support",
|
|
15
|
+
"email": "support@stormsoftware.com"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "github",
|
|
19
|
+
"url": "https://github.com/storm-software/shell-shock.git",
|
|
20
|
+
"directory": "packages/plugin-banner"
|
|
21
|
+
},
|
|
22
|
+
"funding": {
|
|
23
|
+
"type": "github",
|
|
24
|
+
"url": "https://github.com/sponsors/storm-software"
|
|
25
|
+
},
|
|
26
|
+
"license": "Apache-2.0",
|
|
27
|
+
"author": {
|
|
28
|
+
"name": "Storm Software",
|
|
29
|
+
"email": "contact@stormsoftware.com",
|
|
30
|
+
"url": "https://stormsoftware.com"
|
|
31
|
+
},
|
|
32
|
+
"maintainers": [
|
|
33
|
+
{
|
|
34
|
+
"name": "Storm Software",
|
|
35
|
+
"email": "contact@stormsoftware.com",
|
|
36
|
+
"url": "https://stormsoftware.com"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"contributors": [
|
|
40
|
+
{
|
|
41
|
+
"name": "Storm Software",
|
|
42
|
+
"email": "contact@stormsoftware.com",
|
|
43
|
+
"url": "https://stormsoftware.com"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"type": "module",
|
|
47
|
+
"main": "./dist/index.cjs",
|
|
48
|
+
"module": "./dist/index.mjs",
|
|
49
|
+
"types": "./dist/index.d.cts",
|
|
50
|
+
"typings": "dist/index.d.mts",
|
|
51
|
+
"files": ["dist/**/*"],
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@alloy-js/core": "0.23.0-dev.8",
|
|
54
|
+
"@alloy-js/typescript": "0.23.0-dev.4",
|
|
55
|
+
"@powerlines/deepkit": "^0.6.146",
|
|
56
|
+
"@powerlines/plugin-alloy": "^0.25.53",
|
|
57
|
+
"@powerlines/plugin-plugin": "^0.12.318",
|
|
58
|
+
"@shell-shock/core": "^0.13.2",
|
|
59
|
+
"@shell-shock/plugin-theme": "^0.3.17",
|
|
60
|
+
"@shell-shock/plugin-console": "^0.1.13",
|
|
61
|
+
"@stryke/path": "^0.27.2",
|
|
62
|
+
"defu": "^6.1.4",
|
|
63
|
+
"powerlines": "^0.42.8"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@powerlines/plugin-deepkit": "^0.11.246",
|
|
67
|
+
"@types/node": "^25.5.0"
|
|
68
|
+
},
|
|
69
|
+
"publishConfig": { "access": "public" },
|
|
70
|
+
"exports": {
|
|
71
|
+
".": {
|
|
72
|
+
"require": {
|
|
73
|
+
"types": "./dist/index.d.cts",
|
|
74
|
+
"default": "./dist/index.cjs"
|
|
75
|
+
},
|
|
76
|
+
"import": {
|
|
77
|
+
"types": "./dist/index.d.mts",
|
|
78
|
+
"default": "./dist/index.mjs"
|
|
79
|
+
},
|
|
80
|
+
"default": {
|
|
81
|
+
"types": "./dist/index.d.mts",
|
|
82
|
+
"default": "./dist/index.mjs"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"./components": {
|
|
86
|
+
"require": {
|
|
87
|
+
"types": "./dist/components/index.d.cts",
|
|
88
|
+
"default": "./dist/components/index.cjs"
|
|
89
|
+
},
|
|
90
|
+
"import": {
|
|
91
|
+
"types": "./dist/components/index.d.mts",
|
|
92
|
+
"default": "./dist/components/index.mjs"
|
|
93
|
+
},
|
|
94
|
+
"default": {
|
|
95
|
+
"types": "./dist/components/index.d.mts",
|
|
96
|
+
"default": "./dist/components/index.mjs"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"./components/banner-builtin": {
|
|
100
|
+
"require": {
|
|
101
|
+
"types": "./dist/components/banner-builtin.d.cts",
|
|
102
|
+
"default": "./dist/components/banner-builtin.cjs"
|
|
103
|
+
},
|
|
104
|
+
"import": {
|
|
105
|
+
"types": "./dist/components/banner-builtin.d.mts",
|
|
106
|
+
"default": "./dist/components/banner-builtin.mjs"
|
|
107
|
+
},
|
|
108
|
+
"default": {
|
|
109
|
+
"types": "./dist/components/banner-builtin.d.mts",
|
|
110
|
+
"default": "./dist/components/banner-builtin.mjs"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"./components/banner-function-declaration": {
|
|
114
|
+
"require": {
|
|
115
|
+
"types": "./dist/components/banner-function-declaration.d.cts",
|
|
116
|
+
"default": "./dist/components/banner-function-declaration.cjs"
|
|
117
|
+
},
|
|
118
|
+
"import": {
|
|
119
|
+
"types": "./dist/components/banner-function-declaration.d.mts",
|
|
120
|
+
"default": "./dist/components/banner-function-declaration.mjs"
|
|
121
|
+
},
|
|
122
|
+
"default": {
|
|
123
|
+
"types": "./dist/components/banner-function-declaration.d.mts",
|
|
124
|
+
"default": "./dist/components/banner-function-declaration.mjs"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"./package.json": "./package.json",
|
|
128
|
+
"./types": {
|
|
129
|
+
"require": {
|
|
130
|
+
"types": "./dist/types/index.d.cts",
|
|
131
|
+
"default": "./dist/types/index.cjs"
|
|
132
|
+
},
|
|
133
|
+
"import": {
|
|
134
|
+
"types": "./dist/types/index.d.mts",
|
|
135
|
+
"default": "./dist/types/index.mjs"
|
|
136
|
+
},
|
|
137
|
+
"default": {
|
|
138
|
+
"types": "./dist/types/index.d.mts",
|
|
139
|
+
"default": "./dist/types/index.mjs"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"./types/plugin": {
|
|
143
|
+
"require": {
|
|
144
|
+
"types": "./dist/types/plugin.d.cts",
|
|
145
|
+
"default": "./dist/types/plugin.cjs"
|
|
146
|
+
},
|
|
147
|
+
"import": {
|
|
148
|
+
"types": "./dist/types/plugin.d.mts",
|
|
149
|
+
"default": "./dist/types/plugin.mjs"
|
|
150
|
+
},
|
|
151
|
+
"default": {
|
|
152
|
+
"types": "./dist/types/plugin.d.mts",
|
|
153
|
+
"default": "./dist/types/plugin.mjs"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"gitHead": "64e1ac187a12cd18acfd8134768bb793bbda3947"
|
|
158
|
+
}
|