@shell-shock/plugin-changelog 0.1.10 → 0.1.11

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.
@@ -1,29 +1 @@
1
- //#region \0rolldown/runtime.js
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) {
13
- __defProp(to, key, {
14
- get: ((k) => from[k]).bind(null, key),
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- }
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
- value: mod,
24
- enumerable: true
25
- }) : target, mod));
26
-
27
- //#endregion
28
-
29
- exports.__toESM = __toESM;
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
@@ -1,107 +1 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
- let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
5
- let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
6
- let _alloy_js_core = require("@alloy-js/core");
7
- let _alloy_js_typescript = require("@alloy-js/typescript");
8
- let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
9
- let _powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
10
- let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
11
- let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
12
- let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
13
- let _stryke_path = require("@stryke/path");
14
-
15
- //#region src/components/changelog-command.tsx
16
- /**
17
- * The Changelog command's handler wrapper for the Shell Shock project.
18
- */
19
- function ChangelogCommand({ changelog }) {
20
- const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
21
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TypescriptFile, {
22
- get path() {
23
- return (0, _stryke_path.joinPaths)(context.entryPath, "changelog", "command.ts");
24
- },
25
- imports: {
26
- "node:os": "os",
27
- "node:fs/promises": ["readFile", "writeFile"]
28
- },
29
- builtinImports: { console: [
30
- "textColors",
31
- "bold",
32
- "writeLine",
33
- "error",
34
- "warn"
35
- ] },
36
- get children() {
37
- return [
38
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Options for the Changelog command." }),
39
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
40
- "export": true,
41
- name: "ChangelogOptions",
42
- get children() {
43
- return [
44
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "An optional starting version for the changelog. The command will attempt to display changes starting from the specified version. The version should be a valid semantic version string. If not specified, the changelog will start from the earliest version available." }),
45
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
46
- name: "start",
47
- optional: true,
48
- type: "string"
49
- }),
50
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
51
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
52
- heading: "An optional ending version for the changelog. The command will attempt to display changes up to the specified version. The version should be a valid semantic version string. If not specified, the changelog will display changes up to the latest version available.",
53
- get children() {
54
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
55
- get type() {
56
- return _powerlines_deepkit_vendor_type.ReflectionKind.string;
57
- },
58
- defaultValue: "latest"
59
- });
60
- }
61
- }),
62
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
63
- name: "end",
64
- optional: true,
65
- type: "string"
66
- })
67
- ];
68
- }
69
- }),
70
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
71
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
72
- get heading() {
73
- return `Display the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)} changelog.`;
74
- },
75
- get children() {
76
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
77
- name: "options",
78
- children: _alloy_js_core.code`An object containing options for displaying the changelog.`
79
- });
80
- }
81
- }),
82
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
83
- "export": true,
84
- "default": true,
85
- async: true,
86
- name: "handler",
87
- parameters: [{
88
- name: "options",
89
- type: "ChangelogOptions"
90
- }],
91
- get children() {
92
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
93
- get when() {
94
- return (0, _stryke_type_checks_is_set_string.isSetString)(changelog);
95
- },
96
- fallback: _alloy_js_core.code` return warn("There is no changelog available for display."); `,
97
- children: changelog
98
- });
99
- }
100
- })
101
- ];
102
- }
103
- });
104
- }
105
-
106
- //#endregion
107
- exports.ChangelogCommand = ChangelogCommand;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@shell-shock/core/plugin-utils`),n=require(`@stryke/type-checks/is-set-string`),r=require(`@alloy-js/core`),i=require(`@alloy-js/typescript`),a=require(`@powerlines/deepkit/vendor/type`),o=require(`@powerlines/plugin-alloy/core`),s=require(`@powerlines/plugin-alloy/core/contexts/context`),c=require(`@powerlines/plugin-alloy/typescript`),l=require(`@powerlines/plugin-alloy/typescript/components/tsdoc`),u=require(`@stryke/path`);function d({changelog:d}){let f=(0,s.usePowerlines)();return(0,e.createComponent)(c.TypescriptFile,{get path(){return(0,u.joinPaths)(f.entryPath,`changelog`,`command.ts`)},imports:{"node:os":`os`,"node:fs/promises":[`readFile`,`writeFile`]},builtinImports:{console:[`textColors`,`bold`,`writeLine`,`error`,`warn`]},get children(){return[(0,e.createComponent)(l.TSDoc,{heading:`Options for the Changelog command.`}),(0,e.createComponent)(i.InterfaceDeclaration,{export:!0,name:`ChangelogOptions`,get children(){return[(0,e.createComponent)(l.TSDoc,{heading:`An optional starting version for the changelog. The command will attempt to display changes starting from the specified version. The version should be a valid semantic version string. If not specified, the changelog will start from the earliest version available.`}),(0,e.createComponent)(c.InterfaceMember,{name:`start`,optional:!0,type:`string`}),(0,e.createComponent)(o.Spacing,{}),(0,e.createComponent)(l.TSDoc,{heading:`An optional ending version for the changelog. The command will attempt to display changes up to the specified version. The version should be a valid semantic version string. If not specified, the changelog will display changes up to the latest version available.`,get children(){return(0,e.createComponent)(l.TSDocDefaultValue,{get type(){return a.ReflectionKind.string},defaultValue:`latest`})}}),(0,e.createComponent)(c.InterfaceMember,{name:`end`,optional:!0,type:`string`})]}}),(0,e.createComponent)(o.Spacing,{}),(0,e.createComponent)(l.TSDoc,{get heading(){return`Display the ${(0,t.getAppTitle)(f)} changelog.`},get children(){return(0,e.createComponent)(l.TSDocParam,{name:`options`,children:r.code`An object containing options for displaying the changelog.`})}}),(0,e.createComponent)(i.FunctionDeclaration,{export:!0,default:!0,async:!0,name:`handler`,parameters:[{name:`options`,type:`ChangelogOptions`}],get children(){return(0,e.createComponent)(r.Show,{get when(){return(0,n.isSetString)(d)},fallback:r.code` return warn("There is no changelog available for display."); `,children:d})}})]}})}exports.ChangelogCommand=d;
@@ -1,106 +1,2 @@
1
- import { createComponent } from "@alloy-js/core/jsx-runtime";
2
- import { getAppTitle } from "@shell-shock/core/plugin-utils";
3
- import { isSetString } from "@stryke/type-checks/is-set-string";
4
- import { Show, code } from "@alloy-js/core";
5
- import { FunctionDeclaration, InterfaceDeclaration } from "@alloy-js/typescript";
6
- import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
7
- import { Spacing } from "@powerlines/plugin-alloy/core";
8
- import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
9
- import { InterfaceMember, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
10
- import { TSDoc, TSDocDefaultValue, TSDocParam } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
11
- import { joinPaths } from "@stryke/path";
12
-
13
- //#region src/components/changelog-command.tsx
14
- /**
15
- * The Changelog command's handler wrapper for the Shell Shock project.
16
- */
17
- function ChangelogCommand({ changelog }) {
18
- const context = usePowerlines();
19
- return createComponent(TypescriptFile, {
20
- get path() {
21
- return joinPaths(context.entryPath, "changelog", "command.ts");
22
- },
23
- imports: {
24
- "node:os": "os",
25
- "node:fs/promises": ["readFile", "writeFile"]
26
- },
27
- builtinImports: { console: [
28
- "textColors",
29
- "bold",
30
- "writeLine",
31
- "error",
32
- "warn"
33
- ] },
34
- get children() {
35
- return [
36
- createComponent(TSDoc, { heading: "Options for the Changelog command." }),
37
- createComponent(InterfaceDeclaration, {
38
- "export": true,
39
- name: "ChangelogOptions",
40
- get children() {
41
- return [
42
- createComponent(TSDoc, { heading: "An optional starting version for the changelog. The command will attempt to display changes starting from the specified version. The version should be a valid semantic version string. If not specified, the changelog will start from the earliest version available." }),
43
- createComponent(InterfaceMember, {
44
- name: "start",
45
- optional: true,
46
- type: "string"
47
- }),
48
- createComponent(Spacing, {}),
49
- createComponent(TSDoc, {
50
- heading: "An optional ending version for the changelog. The command will attempt to display changes up to the specified version. The version should be a valid semantic version string. If not specified, the changelog will display changes up to the latest version available.",
51
- get children() {
52
- return createComponent(TSDocDefaultValue, {
53
- get type() {
54
- return ReflectionKind.string;
55
- },
56
- defaultValue: "latest"
57
- });
58
- }
59
- }),
60
- createComponent(InterfaceMember, {
61
- name: "end",
62
- optional: true,
63
- type: "string"
64
- })
65
- ];
66
- }
67
- }),
68
- createComponent(Spacing, {}),
69
- createComponent(TSDoc, {
70
- get heading() {
71
- return `Display the ${getAppTitle(context)} changelog.`;
72
- },
73
- get children() {
74
- return createComponent(TSDocParam, {
75
- name: "options",
76
- children: code`An object containing options for displaying the changelog.`
77
- });
78
- }
79
- }),
80
- createComponent(FunctionDeclaration, {
81
- "export": true,
82
- "default": true,
83
- async: true,
84
- name: "handler",
85
- parameters: [{
86
- name: "options",
87
- type: "ChangelogOptions"
88
- }],
89
- get children() {
90
- return createComponent(Show, {
91
- get when() {
92
- return isSetString(changelog);
93
- },
94
- fallback: code` return warn("There is no changelog available for display."); `,
95
- children: changelog
96
- });
97
- }
98
- })
99
- ];
100
- }
101
- });
102
- }
103
-
104
- //#endregion
105
- export { ChangelogCommand };
1
+ import{createComponent as e}from"@alloy-js/core/jsx-runtime";import{getAppTitle as t}from"@shell-shock/core/plugin-utils";import{isSetString as n}from"@stryke/type-checks/is-set-string";import{Show as r,code as i}from"@alloy-js/core";import{FunctionDeclaration as a,InterfaceDeclaration as o}from"@alloy-js/typescript";import{ReflectionKind as s}from"@powerlines/deepkit/vendor/type";import{Spacing as c}from"@powerlines/plugin-alloy/core";import{usePowerlines as l}from"@powerlines/plugin-alloy/core/contexts/context";import{InterfaceMember as u,TypescriptFile as d}from"@powerlines/plugin-alloy/typescript";import{TSDoc as f,TSDocDefaultValue as p,TSDocParam as m}from"@powerlines/plugin-alloy/typescript/components/tsdoc";import{joinPaths as h}from"@stryke/path";function g({changelog:g}){let _=l();return e(d,{get path(){return h(_.entryPath,`changelog`,`command.ts`)},imports:{"node:os":`os`,"node:fs/promises":[`readFile`,`writeFile`]},builtinImports:{console:[`textColors`,`bold`,`writeLine`,`error`,`warn`]},get children(){return[e(f,{heading:`Options for the Changelog command.`}),e(o,{export:!0,name:`ChangelogOptions`,get children(){return[e(f,{heading:`An optional starting version for the changelog. The command will attempt to display changes starting from the specified version. The version should be a valid semantic version string. If not specified, the changelog will start from the earliest version available.`}),e(u,{name:`start`,optional:!0,type:`string`}),e(c,{}),e(f,{heading:`An optional ending version for the changelog. The command will attempt to display changes up to the specified version. The version should be a valid semantic version string. If not specified, the changelog will display changes up to the latest version available.`,get children(){return e(p,{get type(){return s.string},defaultValue:`latest`})}}),e(u,{name:`end`,optional:!0,type:`string`})]}}),e(c,{}),e(f,{get heading(){return`Display the ${t(_)} changelog.`},get children(){return e(m,{name:`options`,children:i`An object containing options for displaying the changelog.`})}}),e(a,{export:!0,default:!0,async:!0,name:`handler`,parameters:[{name:`options`,type:`ChangelogOptions`}],get children(){return e(r,{get when(){return n(g)},fallback:i` return warn("There is no changelog available for display."); `,children:g})}})]}})}export{g as ChangelogCommand};
106
2
  //# sourceMappingURL=changelog-command.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"changelog-command.mjs","names":[],"sources":["../../src/components/changelog-command.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 { code, Show } from \"@alloy-js/core\";\nimport {\n FunctionDeclaration,\n InterfaceDeclaration\n} from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n InterfaceMember,\n TypescriptFile\n} from \"@powerlines/plugin-alloy/typescript\";\nimport {\n TSDoc,\n TSDocDefaultValue,\n TSDocParam\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport type { ChangelogPluginContext } from \"../types/plugin\";\n\nexport interface ChangelogCommandProps {\n changelog: string;\n}\n\n/**\n * The Changelog command's handler wrapper for the Shell Shock project.\n */\nexport function ChangelogCommand({ changelog }: ChangelogCommandProps) {\n const context = usePowerlines<ChangelogPluginContext>();\n\n return (\n <TypescriptFile\n path={joinPaths(context.entryPath, \"changelog\", \"command.ts\")}\n imports={{\n \"node:os\": \"os\",\n \"node:fs/promises\": [\"readFile\", \"writeFile\"]\n }}\n builtinImports={{\n console: [\"textColors\", \"bold\", \"writeLine\", \"error\", \"warn\"]\n }}>\n <TSDoc heading=\"Options for the Changelog command.\" />\n <InterfaceDeclaration export name=\"ChangelogOptions\">\n <TSDoc heading=\"An optional starting version for the changelog. The command will attempt to display changes starting from the specified version. The version should be a valid semantic version string. If not specified, the changelog will start from the earliest version available.\" />\n <InterfaceMember name=\"start\" optional type=\"string\" />\n <Spacing />\n <TSDoc heading=\"An optional ending version for the changelog. The command will attempt to display changes up to the specified version. The version should be a valid semantic version string. If not specified, the changelog will display changes up to the latest version available.\">\n <TSDocDefaultValue\n type={ReflectionKind.string}\n defaultValue=\"latest\"\n />\n </TSDoc>\n <InterfaceMember name=\"end\" optional type=\"string\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading={`Display the ${getAppTitle(context)} changelog.`}>\n <TSDocParam name=\"options\">\n {code`An object containing options for displaying the changelog.`}\n </TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[{ name: \"options\", type: \"ChangelogOptions\" }]}>\n <Show\n when={isSetString(changelog)}\n fallback={code` return warn(\"There is no changelog available for display.\"); `}>\n {changelog}\n </Show>\n </FunctionDeclaration>\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqCA,SAAS,iBAAqB,EAC9B;CAEA,MAAO,UAAU,eAAsB;AACrC,QAAA,gBAAiB,gBAAA;EACnB,IAAA,OAAA;;;EAGG,SAAI;GACL,WAAA;GACI,oBAAU,CAAA,YAAmB,YAAa;GAC9C;oBAEA,SAAO;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA,EACJ;EACD,IAAE,WAAM;AACN,UAAO;IAAC,gBAAC,OAAA,EACP,SAAS,sCACV,CAAC;IAAC,gBAAmB,sBAAc;KACnC,UAAA;KACD,MAAA;KACE,IAAA,WAAW;AACX,aAAA;OAAA,gBAAA,OAAA,EACI,SAAS,2QACd,CAAA;OAAA,gBAAqB,iBAAa;QAChC,MAAM;QACN,UAAA;QACA,MAAS;QACT,CAAA;OAAK,gBAAa,SAAS,EAAO,CAAA;OAAA,gBAAgB,OAAW;QAC3D,SAAA;QACC,IAAI,WAAE;AACN,gBAAA,gBAAoB,mBAAA;UACrB,IAAA,OAAA;AACI,kBAAA,eAAA;;UAEP,cAAoB;UACb,CAAC;;QAEP,CAAA;OAAA,gBAAiB,iBAAQ;QACvB,MAAO;QACR,UAAU;QACZ,MAAK;QACN,CAAA;OAAA;;KAEA,CAAC;IAAA,gBAAA,SAAA,EAAA,CAAA;IAAA,gBAAA,OAAA;KACA,IAAA,UAAA;AACA,aAAM,eAAO,YAAA,QAAA,CAAA;;KAEb,IAAC,WAAA;AACC,aAAM,gBAAY,YAAU;OAC5B,MAAQ;OACP,UAAS,IAAA;OACV,CAAA;;KAEJ,CAAA;IAAA,gBAAc,qBAAA;KACjB,UAAA;KACH,WAAA"}
1
+ {"version":3,"file":"changelog-command.mjs","names":[],"sources":["../../src/components/changelog-command.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 { code, Show } from \"@alloy-js/core\";\nimport {\n FunctionDeclaration,\n InterfaceDeclaration\n} from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts/context\";\nimport {\n InterfaceMember,\n TypescriptFile\n} from \"@powerlines/plugin-alloy/typescript\";\nimport {\n TSDoc,\n TSDocDefaultValue,\n TSDocParam\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { joinPaths } from \"@stryke/path\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport type { ChangelogPluginContext } from \"../types/plugin\";\n\nexport interface ChangelogCommandProps {\n changelog: string;\n}\n\n/**\n * The Changelog command's handler wrapper for the Shell Shock project.\n */\nexport function ChangelogCommand({ changelog }: ChangelogCommandProps) {\n const context = usePowerlines<ChangelogPluginContext>();\n\n return (\n <TypescriptFile\n path={joinPaths(context.entryPath, \"changelog\", \"command.ts\")}\n imports={{\n \"node:os\": \"os\",\n \"node:fs/promises\": [\"readFile\", \"writeFile\"]\n }}\n builtinImports={{\n console: [\"textColors\", \"bold\", \"writeLine\", \"error\", \"warn\"]\n }}>\n <TSDoc heading=\"Options for the Changelog command.\" />\n <InterfaceDeclaration export name=\"ChangelogOptions\">\n <TSDoc heading=\"An optional starting version for the changelog. The command will attempt to display changes starting from the specified version. The version should be a valid semantic version string. If not specified, the changelog will start from the earliest version available.\" />\n <InterfaceMember name=\"start\" optional type=\"string\" />\n <Spacing />\n <TSDoc heading=\"An optional ending version for the changelog. The command will attempt to display changes up to the specified version. The version should be a valid semantic version string. If not specified, the changelog will display changes up to the latest version available.\">\n <TSDocDefaultValue\n type={ReflectionKind.string}\n defaultValue=\"latest\"\n />\n </TSDoc>\n <InterfaceMember name=\"end\" optional type=\"string\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading={`Display the ${getAppTitle(context)} changelog.`}>\n <TSDocParam name=\"options\">\n {code`An object containing options for displaying the changelog.`}\n </TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n default\n async\n name=\"handler\"\n parameters={[{ name: \"options\", type: \"ChangelogOptions\" }]}>\n <Show\n when={isSetString(changelog)}\n fallback={code` return warn(\"There is no changelog available for display.\"); `}>\n {changelog}\n </Show>\n </FunctionDeclaration>\n </TypescriptFile>\n );\n}\n"],"mappings":"8vBAgCA,SAAE,EAAiB,CACjB,aACA,CACF,IAAQ,EAAC,GAAqB,CAC9B,OAAS,EAAkB,EAAa,CACxC,IAAQ,MAAC,CACH,OAAO,EAAC,EAAA,UAAyB,YAAe,aAAO,EAE7D,QAAO,CACL,UAAW,KACb,mBAAA,CAAA,WAAA,YAAA,EAEE,eAAA,CACI,QAAC,CAAS,aAAW,OAAQ,YAAgB,QAAM,OAAM,CAC7D,CACF,IAAO,UAAS,CACd,MAAM,CAAA,EAAwB,EAAA,CAAA,QAAA,qCAE9B,CAAM,CAAC,EAAA,EAAA,CACJ,OAAA,GACC,KAAM,mBACN,IAAA,UAAS,CACN,MAAQ,CAAC,EAAK,EAAA,CACd,QAAQ,0QACV,CAAA,CAAA,EAAA,EAAA,CACD,KAAA,QACE,SAAW,GACX,KAAA,SACD,CAAK,CAAC,EAAiB,EAAQ,EAAA,CAAA,CAAA,EAAqB,EAAA,CACpD,QAAA,yQACE,IAAM,UAAY,CAClB,OAAA,EAA6B,EAAe,CACrC,IAAE,MAAA,CACH,OAAS,EAAY,QAEpB,aAAE,SACN,CAAA,EAEF,CAAA,CAAA,EAAK,EAAA,CACN,KAAA,MACD,SAAA,GACD,KAAS,SACT,CAAK,CAAC,EAEN,CAAC,CAAE,EAAgB,EAAW,EAAA,CAAA,CAAA,EAAuB,EAAI,CACxD,IAAE,SAAU,CACZ,MAAK,eAAA,EAAA,EAAA,CAAA,cAEL,IAAA,UAAA,CACA,OAAA,EAAA,EAAA,CACA,KAAA,UACI,SAAS,CAAA,6DACb,CAAA,EAED,CAAC,CAAE,EAAkB,EAAU,CAC9B,OAAU,GACV,QAAG,GACH,MAAM,GACN,KAAA,UACF,WAAc,CAAA,CACjB,KAAA,UACH,KAAA"}
@@ -1,4 +1 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_components_changelog_command = require('./changelog-command.cjs');
3
-
4
- exports.ChangelogCommand = require_components_changelog_command.ChangelogCommand;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./changelog-command.cjs`);exports.ChangelogCommand=e.ChangelogCommand;
@@ -1,3 +1 @@
1
- import { ChangelogCommand } from "./changelog-command.mjs";
2
-
3
- export { ChangelogCommand };
1
+ import{ChangelogCommand as e}from"./changelog-command.mjs";export{e as ChangelogCommand};
@@ -1,51 +1 @@
1
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
- let _stryke_path_join = require("@stryke/path/join");
3
- let powerlines_plugin_utils = require("powerlines/plugin-utils");
4
- let _stryke_path = require("@stryke/path");
5
- let node_fs = require("node:fs");
6
-
7
- //#region src/helpers/resolve-changelog.ts
8
- const CHANGELOG_FILE_EXTENSIONS = [
9
- "md",
10
- "markdown",
11
- "txt"
12
- ];
13
- const CHANGELOG_FILE_NAMES = [
14
- "CHANGELOG",
15
- "changelog",
16
- "Changelog",
17
- "RELEASE-NOTES",
18
- "release-notes",
19
- "Release-Notes",
20
- "RELEASE_NOTES",
21
- "release_notes",
22
- "Release_Notes",
23
- "RELEASES",
24
- "releases",
25
- "Releases",
26
- "HISTORY",
27
- "history",
28
- "History"
29
- ];
30
- function resolveChangelogFile(context, fileName) {
31
- for (const ext of CHANGELOG_FILE_EXTENSIONS) if (fileName && (0, node_fs.existsSync)((0, powerlines_plugin_utils.replacePathTokens)(context, (0, _stryke_path_join.joinPaths)("{root}", (0, _stryke_path.appendExtension)(fileName, ext))))) return (0, _stryke_path_join.joinPaths)("{root}", (0, _stryke_path.appendExtension)(fileName, ext));
32
- }
33
- /**
34
- * Resolves the path to the changelog file based on the provided options and context. If a specific file is provided in the options, it will attempt to resolve that file first. If not, it will look for common changelog file names in the application's root directory.
35
- *
36
- * @param context - The unresolved context of the plugin, which includes information about the application's root directory and other relevant data for resolving paths.
37
- * @param options - The options provided for the changelog plugin, which may include a specific file name to look for.
38
- * @returns The resolved path to the changelog file if found, or undefined if no valid changelog file could be resolved.
39
- */
40
- function resolveChangelog(context, options) {
41
- let changelogFile = resolveChangelogFile(context, options.file);
42
- if (changelogFile) return changelogFile;
43
- for (const name of CHANGELOG_FILE_NAMES) {
44
- changelogFile = resolveChangelogFile(context, name);
45
- if (changelogFile) return changelogFile;
46
- }
47
- return changelogFile;
48
- }
49
-
50
- //#endregion
51
- exports.resolveChangelog = resolveChangelog;
1
+ require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`@stryke/path/join`),t=require(`powerlines/plugin-utils`),n=require(`@stryke/path`),r=require(`node:fs`);const i=[`md`,`markdown`,`txt`],a=[`CHANGELOG`,`changelog`,`Changelog`,`RELEASE-NOTES`,`release-notes`,`Release-Notes`,`RELEASE_NOTES`,`release_notes`,`Release_Notes`,`RELEASES`,`releases`,`Releases`,`HISTORY`,`history`,`History`];function o(a,o){for(let s of i)if(o&&(0,r.existsSync)((0,t.replacePathTokens)(a,(0,e.joinPaths)(`{root}`,(0,n.appendExtension)(o,s)))))return(0,e.joinPaths)(`{root}`,(0,n.appendExtension)(o,s))}function s(e,t){let n=o(e,t.file);if(n)return n;for(let t of a)if(n=o(e,t),n)return n;return n}exports.resolveChangelog=s;
@@ -1,51 +1,2 @@
1
- import { joinPaths } from "@stryke/path/join";
2
- import { replacePathTokens } from "powerlines/plugin-utils";
3
- import { appendExtension } from "@stryke/path";
4
- import { existsSync } from "node:fs";
5
-
6
- //#region src/helpers/resolve-changelog.ts
7
- const CHANGELOG_FILE_EXTENSIONS = [
8
- "md",
9
- "markdown",
10
- "txt"
11
- ];
12
- const CHANGELOG_FILE_NAMES = [
13
- "CHANGELOG",
14
- "changelog",
15
- "Changelog",
16
- "RELEASE-NOTES",
17
- "release-notes",
18
- "Release-Notes",
19
- "RELEASE_NOTES",
20
- "release_notes",
21
- "Release_Notes",
22
- "RELEASES",
23
- "releases",
24
- "Releases",
25
- "HISTORY",
26
- "history",
27
- "History"
28
- ];
29
- function resolveChangelogFile(context, fileName) {
30
- for (const ext of CHANGELOG_FILE_EXTENSIONS) if (fileName && existsSync(replacePathTokens(context, joinPaths("{root}", appendExtension(fileName, ext))))) return joinPaths("{root}", appendExtension(fileName, ext));
31
- }
32
- /**
33
- * Resolves the path to the changelog file based on the provided options and context. If a specific file is provided in the options, it will attempt to resolve that file first. If not, it will look for common changelog file names in the application's root directory.
34
- *
35
- * @param context - The unresolved context of the plugin, which includes information about the application's root directory and other relevant data for resolving paths.
36
- * @param options - The options provided for the changelog plugin, which may include a specific file name to look for.
37
- * @returns The resolved path to the changelog file if found, or undefined if no valid changelog file could be resolved.
38
- */
39
- function resolveChangelog(context, options) {
40
- let changelogFile = resolveChangelogFile(context, options.file);
41
- if (changelogFile) return changelogFile;
42
- for (const name of CHANGELOG_FILE_NAMES) {
43
- changelogFile = resolveChangelogFile(context, name);
44
- if (changelogFile) return changelogFile;
45
- }
46
- return changelogFile;
47
- }
48
-
49
- //#endregion
50
- export { resolveChangelog };
1
+ import{joinPaths as e}from"@stryke/path/join";import{replacePathTokens as t}from"powerlines/plugin-utils";import{appendExtension as n}from"@stryke/path";import{existsSync as r}from"node:fs";const i=[`md`,`markdown`,`txt`],a=[`CHANGELOG`,`changelog`,`Changelog`,`RELEASE-NOTES`,`release-notes`,`Release-Notes`,`RELEASE_NOTES`,`release_notes`,`Release_Notes`,`RELEASES`,`releases`,`Releases`,`HISTORY`,`history`,`History`];function o(a,o){for(let s of i)if(o&&r(t(a,e(`{root}`,n(o,s)))))return e(`{root}`,n(o,s))}function s(e,t){let n=o(e,t.file);if(n)return n;for(let t of a)if(n=o(e,t),n)return n;return n}export{s as resolveChangelog};
51
2
  //# sourceMappingURL=resolve-changelog.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-changelog.mjs","names":[],"sources":["../../src/helpers/resolve-changelog.ts"],"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 { appendExtension } from \"@stryke/path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { existsSync } from \"node:fs\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\nimport type {\n ChangelogPluginContext,\n ChangelogPluginOptions\n} from \"../types/plugin\";\n\nconst CHANGELOG_FILE_EXTENSIONS = [\"md\", \"markdown\", \"txt\"] as const;\n\nconst CHANGELOG_FILE_NAMES = [\n \"CHANGELOG\",\n \"changelog\",\n \"Changelog\",\n \"RELEASE-NOTES\",\n \"release-notes\",\n \"Release-Notes\",\n \"RELEASE_NOTES\",\n \"release_notes\",\n \"Release_Notes\",\n \"RELEASES\",\n \"releases\",\n \"Releases\",\n \"HISTORY\",\n \"history\",\n \"History\"\n] as const;\n\nfunction resolveChangelogFile(\n context: ChangelogPluginContext,\n fileName?: string\n): string | undefined {\n for (const ext of CHANGELOG_FILE_EXTENSIONS) {\n if (\n fileName &&\n existsSync(\n replacePathTokens(\n context,\n joinPaths(\"{root}\", appendExtension(fileName, ext))\n )\n )\n ) {\n return joinPaths(\"{root}\", appendExtension(fileName, ext));\n }\n }\n\n return undefined;\n}\n\n/**\n * Resolves the path to the changelog file based on the provided options and context. If a specific file is provided in the options, it will attempt to resolve that file first. If not, it will look for common changelog file names in the application's root directory.\n *\n * @param context - The unresolved context of the plugin, which includes information about the application's root directory and other relevant data for resolving paths.\n * @param options - The options provided for the changelog plugin, which may include a specific file name to look for.\n * @returns The resolved path to the changelog file if found, or undefined if no valid changelog file could be resolved.\n */\nexport function resolveChangelog(\n context: ChangelogPluginContext,\n options: ChangelogPluginOptions\n): string | undefined {\n let changelogFile = resolveChangelogFile(context, options.file);\n if (changelogFile) {\n return changelogFile;\n }\n\n for (const name of CHANGELOG_FILE_NAMES) {\n changelogFile = resolveChangelogFile(context, name);\n if (changelogFile) {\n return changelogFile;\n }\n }\n\n return changelogFile;\n}\n"],"mappings":";;;;;;AA2BA,MAAM,4BAA4B;CAAC;CAAM;CAAY;CAAM;AAE3D,MAAM,uBAAuB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,SAAS,qBACP,SACA,UACoB;AACpB,MAAK,MAAM,OAAO,0BAChB,KACE,YACA,WACE,kBACE,SACA,UAAU,UAAU,gBAAgB,UAAU,IAAI,CAAC,CACpD,CACF,CAED,QAAO,UAAU,UAAU,gBAAgB,UAAU,IAAI,CAAC;;;;;;;;;AAchE,SAAgB,iBACd,SACA,SACoB;CACpB,IAAI,gBAAgB,qBAAqB,SAAS,QAAQ,KAAK;AAC/D,KAAI,cACF,QAAO;AAGT,MAAK,MAAM,QAAQ,sBAAsB;AACvC,kBAAgB,qBAAqB,SAAS,KAAK;AACnD,MAAI,cACF,QAAO;;AAIX,QAAO"}
1
+ {"version":3,"file":"resolve-changelog.mjs","names":[],"sources":["../../src/helpers/resolve-changelog.ts"],"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 { appendExtension } from \"@stryke/path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { existsSync } from \"node:fs\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\nimport type {\n ChangelogPluginContext,\n ChangelogPluginOptions\n} from \"../types/plugin\";\n\nconst CHANGELOG_FILE_EXTENSIONS = [\"md\", \"markdown\", \"txt\"] as const;\n\nconst CHANGELOG_FILE_NAMES = [\n \"CHANGELOG\",\n \"changelog\",\n \"Changelog\",\n \"RELEASE-NOTES\",\n \"release-notes\",\n \"Release-Notes\",\n \"RELEASE_NOTES\",\n \"release_notes\",\n \"Release_Notes\",\n \"RELEASES\",\n \"releases\",\n \"Releases\",\n \"HISTORY\",\n \"history\",\n \"History\"\n] as const;\n\nfunction resolveChangelogFile(\n context: ChangelogPluginContext,\n fileName?: string\n): string | undefined {\n for (const ext of CHANGELOG_FILE_EXTENSIONS) {\n if (\n fileName &&\n existsSync(\n replacePathTokens(\n context,\n joinPaths(\"{root}\", appendExtension(fileName, ext))\n )\n )\n ) {\n return joinPaths(\"{root}\", appendExtension(fileName, ext));\n }\n }\n\n return undefined;\n}\n\n/**\n * Resolves the path to the changelog file based on the provided options and context. If a specific file is provided in the options, it will attempt to resolve that file first. If not, it will look for common changelog file names in the application's root directory.\n *\n * @param context - The unresolved context of the plugin, which includes information about the application's root directory and other relevant data for resolving paths.\n * @param options - The options provided for the changelog plugin, which may include a specific file name to look for.\n * @returns The resolved path to the changelog file if found, or undefined if no valid changelog file could be resolved.\n */\nexport function resolveChangelog(\n context: ChangelogPluginContext,\n options: ChangelogPluginOptions\n): string | undefined {\n let changelogFile = resolveChangelogFile(context, options.file);\n if (changelogFile) {\n return changelogFile;\n }\n\n for (const name of CHANGELOG_FILE_NAMES) {\n changelogFile = resolveChangelogFile(context, name);\n if (changelogFile) {\n return changelogFile;\n }\n }\n\n return changelogFile;\n}\n"],"mappings":"8LAsBA,MAAM,EAAM,CAAA,KAAA,WAAA,MAAA,CACV,EAAsB,CAAA,YAAA,YAAA,YAAA,gBAAA,gBAAA,gBAAA,gBAAA,gBAAA,gBAAA,WAAA,WAAA,WAAA,UAAA,UAAA,UAAA,CACxB,SAAE,EAAA,EAAA,EAAA,CACA,IAAK,IAAI,KAAM,EAAA,GAAA,GAAA,EAAA,EAAA,EAAA,EAAA,SAAA,EAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAEX,OAAA,EAAA,SAA2B,EAAS,EAAiB,EAAI,CAAA,CAa/D,SAAY,EAAA,EAAA,EAAA,CACV,IAAC,EAAS,EAAA,EAAA,EAAA,KAAA,CACV,GAAC,EACA,OAAQ,EAET,IAAG,IAAK,KAAA,EAEV,YAAQ,EACN,OAAS,EAGT,OAAK"}
package/dist/index.cjs CHANGED
@@ -1,66 +1 @@
1
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- const require_components_changelog_command = require('./components/changelog-command.cjs');
4
- require('./components/index.cjs');
5
- const require_resolve_changelog = require('./helpers/resolve-changelog.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 _shell_shock_unified_markdown = require("@shell-shock/unified/markdown");
10
- let _stryke_path_join = require("@stryke/path/join");
11
- let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
12
- let defu = require("defu");
13
- defu = require_runtime.__toESM(defu);
14
- let powerlines_plugin_utils = require("powerlines/plugin-utils");
15
-
16
- //#region src/index.tsx
17
- /**
18
- * The Changelog - Shell Shock plugin to add version check functionality and changelog commands to a Shell Shock application.
19
- */
20
- const plugin = (options = {}) => {
21
- return {
22
- name: "shell-shock:changelog",
23
- config() {
24
- this.debug("Providing default configuration for the Shell Shock `changelog` plugin.");
25
- return { changelog: (0, defu.default)({ command: { name: (0, _stryke_type_checks_is_set_string.isSetString)(options.command) ? options.command : "changelog" } }, options) };
26
- },
27
- async configResolved() {
28
- this.debug("Adding the CLI changelog commands to the application context.");
29
- if (!(0, _stryke_type_checks_is_set_string.isSetString)(this.config.changelog.file)) this.config.changelog.file = require_resolve_changelog.resolveChangelog(this, options);
30
- if ((0, _stryke_type_checks_is_set_string.isSetString)(this.config.changelog.file)) this.config.changelog.file = (0, powerlines_plugin_utils.replacePathTokens)(this, this.config.changelog.file);
31
- if (!(0, _stryke_type_checks_is_set_string.isSetString)(this.config.changelog.file) || !this.fs.existsSync(this.config.changelog.file)) {
32
- this.warn(`The changelog file could not be found at the resolved path: ${this.config.changelog.file}. The \`${this.config.changelog.command.name}\` command will not be added to the application. Please ensure that the changelog file exists at the specified path or adjust the \`changelog.file\` option to point to the correct location.`);
33
- return;
34
- }
35
- this.inputs ??= [];
36
- if (this.inputs.some((input) => input.id === this.config.changelog.command.name)) this.info("The `changelog` command already exists in the commands list. If you would like the changelog command to be managed by the `@shell-shock/plugin-changelog` package, please remove or rename the command.");
37
- else {
38
- this.inputs.push({
39
- id: this.config.changelog.command.name,
40
- path: this.config.changelog.command.name,
41
- segments: [this.config.changelog.command.name],
42
- title: "Changelog",
43
- icon: "🗃",
44
- tags: ["Utility"],
45
- description: `Display the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this)} changelog.`,
46
- entry: {
47
- file: (0, _stryke_path_join.joinPaths)(this.entryPath, "changelog", "index.ts"),
48
- input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "changelog", "command.ts") }
49
- },
50
- isVirtual: false,
51
- source: "changelog-plugin",
52
- ...this.config.changelog.command
53
- });
54
- this.debug("Rendering changelog command module for the Shell Shock `changelog` plugin.");
55
- const content = await this.fs.read(this.config.changelog.file);
56
- if (content) await (0, _powerlines_plugin_alloy_render.render)(this, (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_changelog_command.ChangelogCommand, { get changelog() {
57
- return (0, _shell_shock_unified_markdown.renderMarkdown)(content);
58
- } }));
59
- }
60
- }
61
- };
62
- };
63
-
64
- //#endregion
65
- exports.default = plugin;
66
- exports.plugin = plugin;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./_virtual/_rolldown/runtime.cjs`),t=require(`./components/changelog-command.cjs`);require(`./components/index.cjs`);const n=require(`./helpers/resolve-changelog.cjs`);let r=require(`@alloy-js/core/jsx-runtime`),i=require(`@powerlines/plugin-alloy/render`),a=require(`@shell-shock/core/plugin-utils`),o=require(`@shell-shock/unified/markdown`),s=require(`@stryke/path/join`),c=require(`@stryke/type-checks/is-set-string`),l=require(`defu`);l=e.__toESM(l);let u=require(`powerlines/plugin-utils`);const d=(e={})=>({name:`shell-shock:changelog`,config(){return this.debug("Providing default configuration for the Shell Shock `changelog` plugin."),{changelog:(0,l.default)({command:{name:(0,c.isSetString)(e.command)?e.command:`changelog`}},e)}},async configResolved(){if(this.debug(`Adding the CLI changelog commands to the application context.`),(0,c.isSetString)(this.config.changelog.file)||(this.config.changelog.file=n.resolveChangelog(this,e)),(0,c.isSetString)(this.config.changelog.file)&&(this.config.changelog.file=(0,u.replacePathTokens)(this,this.config.changelog.file)),!(0,c.isSetString)(this.config.changelog.file)||!this.fs.existsSync(this.config.changelog.file)){this.warn(`The changelog file could not be found at the resolved path: ${this.config.changelog.file}. The \`${this.config.changelog.command.name}\` command will not be added to the application. Please ensure that the changelog file exists at the specified path or adjust the \`changelog.file\` option to point to the correct location.`);return}if(this.inputs??=[],this.inputs.some(e=>e.id===this.config.changelog.command.name))this.info("The `changelog` command already exists in the commands list. If you would like the changelog command to be managed by the `@shell-shock/plugin-changelog` package, please remove or rename the command.");else{this.inputs.push({id:this.config.changelog.command.name,path:this.config.changelog.command.name,segments:[this.config.changelog.command.name],title:`Changelog`,icon:`🗃`,tags:[`Utility`],description:`Display the ${(0,a.getAppTitle)(this)} changelog.`,entry:{file:(0,s.joinPaths)(this.entryPath,`changelog`,`index.ts`),input:{file:(0,s.joinPaths)(this.entryPath,`changelog`,`command.ts`)}},isVirtual:!1,source:`changelog-plugin`,...this.config.changelog.command}),this.debug("Rendering changelog command module for the Shell Shock `changelog` plugin.");let e=await this.fs.read(this.config.changelog.file);e&&await(0,i.render)(this,(0,r.createComponent)(t.ChangelogCommand,{get changelog(){return(0,o.renderMarkdown)(e)}}))}}});exports.default=d,exports.plugin=d;
package/dist/index.mjs CHANGED
@@ -1,63 +1,2 @@
1
- import { ChangelogCommand } from "./components/changelog-command.mjs";
2
- import "./components/index.mjs";
3
- import { resolveChangelog } from "./helpers/resolve-changelog.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 { renderMarkdown } from "@shell-shock/unified/markdown";
8
- import { joinPaths } from "@stryke/path/join";
9
- import { isSetString } from "@stryke/type-checks/is-set-string";
10
- import defu from "defu";
11
- import { replacePathTokens } from "powerlines/plugin-utils";
12
-
13
- //#region src/index.tsx
14
- /**
15
- * The Changelog - Shell Shock plugin to add version check functionality and changelog commands to a Shell Shock application.
16
- */
17
- const plugin = (options = {}) => {
18
- return {
19
- name: "shell-shock:changelog",
20
- config() {
21
- this.debug("Providing default configuration for the Shell Shock `changelog` plugin.");
22
- return { changelog: defu({ command: { name: isSetString(options.command) ? options.command : "changelog" } }, options) };
23
- },
24
- async configResolved() {
25
- this.debug("Adding the CLI changelog commands to the application context.");
26
- if (!isSetString(this.config.changelog.file)) this.config.changelog.file = resolveChangelog(this, options);
27
- if (isSetString(this.config.changelog.file)) this.config.changelog.file = replacePathTokens(this, this.config.changelog.file);
28
- if (!isSetString(this.config.changelog.file) || !this.fs.existsSync(this.config.changelog.file)) {
29
- this.warn(`The changelog file could not be found at the resolved path: ${this.config.changelog.file}. The \`${this.config.changelog.command.name}\` command will not be added to the application. Please ensure that the changelog file exists at the specified path or adjust the \`changelog.file\` option to point to the correct location.`);
30
- return;
31
- }
32
- this.inputs ??= [];
33
- if (this.inputs.some((input) => input.id === this.config.changelog.command.name)) this.info("The `changelog` command already exists in the commands list. If you would like the changelog command to be managed by the `@shell-shock/plugin-changelog` package, please remove or rename the command.");
34
- else {
35
- this.inputs.push({
36
- id: this.config.changelog.command.name,
37
- path: this.config.changelog.command.name,
38
- segments: [this.config.changelog.command.name],
39
- title: "Changelog",
40
- icon: "🗃",
41
- tags: ["Utility"],
42
- description: `Display the ${getAppTitle(this)} changelog.`,
43
- entry: {
44
- file: joinPaths(this.entryPath, "changelog", "index.ts"),
45
- input: { file: joinPaths(this.entryPath, "changelog", "command.ts") }
46
- },
47
- isVirtual: false,
48
- source: "changelog-plugin",
49
- ...this.config.changelog.command
50
- });
51
- this.debug("Rendering changelog command module for the Shell Shock `changelog` plugin.");
52
- const content = await this.fs.read(this.config.changelog.file);
53
- if (content) await render(this, createComponent(ChangelogCommand, { get changelog() {
54
- return renderMarkdown(content);
55
- } }));
56
- }
57
- }
58
- };
59
- };
60
-
61
- //#endregion
62
- export { plugin as default, plugin };
1
+ import{ChangelogCommand as e}from"./components/changelog-command.mjs";import"./components/index.mjs";import{resolveChangelog as t}from"./helpers/resolve-changelog.mjs";import{createComponent as n}from"@alloy-js/core/jsx-runtime";import{render as r}from"@powerlines/plugin-alloy/render";import{getAppTitle as i}from"@shell-shock/core/plugin-utils";import{renderMarkdown as a}from"@shell-shock/unified/markdown";import{joinPaths as o}from"@stryke/path/join";import{isSetString as s}from"@stryke/type-checks/is-set-string";import c from"defu";import{replacePathTokens as l}from"powerlines/plugin-utils";const u=(u={})=>({name:`shell-shock:changelog`,config(){return this.debug("Providing default configuration for the Shell Shock `changelog` plugin."),{changelog:c({command:{name:s(u.command)?u.command:`changelog`}},u)}},async configResolved(){if(this.debug(`Adding the CLI changelog commands to the application context.`),s(this.config.changelog.file)||(this.config.changelog.file=t(this,u)),s(this.config.changelog.file)&&(this.config.changelog.file=l(this,this.config.changelog.file)),!s(this.config.changelog.file)||!this.fs.existsSync(this.config.changelog.file)){this.warn(`The changelog file could not be found at the resolved path: ${this.config.changelog.file}. The \`${this.config.changelog.command.name}\` command will not be added to the application. Please ensure that the changelog file exists at the specified path or adjust the \`changelog.file\` option to point to the correct location.`);return}if(this.inputs??=[],this.inputs.some(e=>e.id===this.config.changelog.command.name))this.info("The `changelog` command already exists in the commands list. If you would like the changelog command to be managed by the `@shell-shock/plugin-changelog` package, please remove or rename the command.");else{this.inputs.push({id:this.config.changelog.command.name,path:this.config.changelog.command.name,segments:[this.config.changelog.command.name],title:`Changelog`,icon:`🗃`,tags:[`Utility`],description:`Display the ${i(this)} changelog.`,entry:{file:o(this.entryPath,`changelog`,`index.ts`),input:{file:o(this.entryPath,`changelog`,`command.ts`)}},isVirtual:!1,source:`changelog-plugin`,...this.config.changelog.command}),this.debug("Rendering changelog command module for the Shell Shock `changelog` plugin.");let t=await this.fs.read(this.config.changelog.file);t&&await r(this,n(e,{get changelog(){return a(t)}}))}}});export{u as default,u as plugin};
63
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +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 { render } from \"@powerlines/plugin-alloy/render\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { renderMarkdown } from \"@shell-shock/unified/markdown\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport type { Plugin } from \"powerlines\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\nimport { ChangelogCommand } from \"./components\";\nimport { resolveChangelog } from \"./helpers/resolve-changelog\";\nimport type {\n ChangelogPluginContext,\n ChangelogPluginOptions\n} from \"./types/plugin\";\n\nexport type * from \"./types\";\n\n/**\n * The Changelog - Shell Shock plugin to add version check functionality and changelog commands to a Shell Shock application.\n */\nexport const plugin = <\n TContext extends ChangelogPluginContext = ChangelogPluginContext\n>(\n options: ChangelogPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"shell-shock:changelog\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `changelog` plugin.\"\n );\n\n return {\n changelog: defu(\n {\n command: {\n name: isSetString(options.command) ? options.command : \"changelog\"\n }\n },\n options\n )\n };\n },\n async configResolved() {\n this.debug(\n \"Adding the CLI changelog commands to the application context.\"\n );\n\n if (!isSetString(this.config.changelog.file)) {\n this.config.changelog.file = resolveChangelog(this, options)!;\n }\n\n if (isSetString(this.config.changelog.file)) {\n this.config.changelog.file = replacePathTokens(\n this,\n this.config.changelog.file\n );\n }\n\n if (\n !isSetString(this.config.changelog.file) ||\n !this.fs.existsSync(this.config.changelog.file)\n ) {\n this.warn(\n `The changelog file could not be found at the resolved path: ${\n this.config.changelog.file\n }. The \\`${\n this.config.changelog.command.name\n }\\` command will not be added to the application. Please ensure that the changelog file exists at the specified path or adjust the \\`changelog.file\\` option to point to the correct location.`\n );\n return;\n }\n\n this.inputs ??= [];\n if (\n this.inputs.some(\n input => input.id === this.config.changelog.command.name\n )\n ) {\n this.info(\n \"The `changelog` command already exists in the commands list. If you would like the changelog command to be managed by the `@shell-shock/plugin-changelog` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: this.config.changelog.command.name,\n path: this.config.changelog.command.name,\n segments: [this.config.changelog.command.name],\n title: \"Changelog\",\n icon: \"🗃\",\n tags: [\"Utility\"],\n description: `Display the ${getAppTitle(this)} changelog.`,\n entry: {\n file: joinPaths(this.entryPath, \"changelog\", \"index.ts\"),\n input: {\n file: joinPaths(this.entryPath, \"changelog\", \"command.ts\")\n }\n },\n isVirtual: false,\n source: \"changelog-plugin\",\n ...this.config.changelog.command\n });\n\n this.debug(\n \"Rendering changelog command module for the Shell Shock `changelog` plugin.\"\n );\n\n const content = await this.fs.read(this.config.changelog.file);\n if (content) {\n await render(\n this,\n <ChangelogCommand changelog={renderMarkdown(content)} />\n );\n }\n }\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;AAmCA,MAAE,UAAA,UAAA,EAAA,KAAA;AACA,QAAK;EACL,MAAA;EACF,SAAa;AACX,QAAS,MAAA,0EAAiC;AAC3C,UAAA,EACC,WAAS,KAAA,EACD,SAAS,EACV,MAAA,YAAA,QAAA,QAAA,GAAA,QAAA,UAAA,aACE,EACP,EAAO,QAAE,EACP;;EAEF,MAAG,iBAAA;;AAED,OAAA,CAAA,YAAO,KAAA,OAAA,UAAA,KAAA,CACL,MAAA,OAAW,UAAI,OAAA,iBAAA,MAAA,QAAA;AAEjB,OAAI,YAAW,KAAA,OAAA,UAAA,KAAA,CACb,MAAK,OAAO,UAAA,OAAY,kBAAmB,MAAQ,KAAO,OAAI,UAAS,KAAA;AAEzE,OAAI,CAAC,YAAA,KAAA,OAAA,UAAA,KAAA,IAAA,CAAA,KAAA,GAAA,WAAA,KAAA,OAAA,UAAA,KAAA,EAAA;AACH,SAAE,KAAA,+DAAA,KAAA,OAAA,UAAA,KAAA,UAAA,KAAA,OAAA,UAAA,QAAA,KAAA,+LAAA;AACF;;AAEH,QAAA,WAAA,EAAA;AACD,OAAM,KAAA,OAAA,MAAiB,UAAA,MAAA,OAAA,KAAA,OAAA,UAAA,QAAA,KAAA,CACrB,MAAK,KAAK,0MAAA;QACP;AACF,SAAA,OAAA,KAAA;;KAEG,MAAC,KAAA,OAAiB,UAAO,QAAU;KACrC,UAAY,CAAA,KAAA,OAAU,UAAO,QAAA,KAAiB;KAChD,OAAA;;KAEI,MAAA,CAAA,UAAiB;KACnB,aAAY,eAAiB,YAAA,KAAiB,CAAA;KAC5C,OAAI;MACJ,MAAK,UAAO,KAAU,WAAA,aAAA,WAAA;MACvB,OAAA,EACH,MAAA,UAAA,KAAA,WAAA,aAAA,aAAA;MAEG;KACA,WAAY;KACZ,QAAQ;KACT,GAAA,KAAA,OAAA,UAAA;KACA,CAAA;AACA,SAAG,MAAI,6EAAyD;IAChE,MAAI,UAAY,MAAA,KAAU,GAAA,KAAA,KAAA,OAAA,UAAA,KAAA;AAC1B,QAAI,QACF,OAAM,OAAO,MAAC,gBAAkB,kBAAA,EAC9B,IAAE,YAAa;AAClB,YAAA,eAAA,QAAA;OAEH,CAAA,CAAA;;;EAIH"}
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 { render } from \"@powerlines/plugin-alloy/render\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { renderMarkdown } from \"@shell-shock/unified/markdown\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport type { Plugin } from \"powerlines\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\nimport { ChangelogCommand } from \"./components\";\nimport { resolveChangelog } from \"./helpers/resolve-changelog\";\nimport type {\n ChangelogPluginContext,\n ChangelogPluginOptions\n} from \"./types/plugin\";\n\nexport type * from \"./types\";\n\n/**\n * The Changelog - Shell Shock plugin to add version check functionality and changelog commands to a Shell Shock application.\n */\nexport const plugin = <\n TContext extends ChangelogPluginContext = ChangelogPluginContext\n>(\n options: ChangelogPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"shell-shock:changelog\",\n config() {\n this.debug(\n \"Providing default configuration for the Shell Shock `changelog` plugin.\"\n );\n\n return {\n changelog: defu(\n {\n command: {\n name: isSetString(options.command) ? options.command : \"changelog\"\n }\n },\n options\n )\n };\n },\n async configResolved() {\n this.debug(\n \"Adding the CLI changelog commands to the application context.\"\n );\n\n if (!isSetString(this.config.changelog.file)) {\n this.config.changelog.file = resolveChangelog(this, options)!;\n }\n\n if (isSetString(this.config.changelog.file)) {\n this.config.changelog.file = replacePathTokens(\n this,\n this.config.changelog.file\n );\n }\n\n if (\n !isSetString(this.config.changelog.file) ||\n !this.fs.existsSync(this.config.changelog.file)\n ) {\n this.warn(\n `The changelog file could not be found at the resolved path: ${\n this.config.changelog.file\n }. The \\`${\n this.config.changelog.command.name\n }\\` command will not be added to the application. Please ensure that the changelog file exists at the specified path or adjust the \\`changelog.file\\` option to point to the correct location.`\n );\n return;\n }\n\n this.inputs ??= [];\n if (\n this.inputs.some(\n input => input.id === this.config.changelog.command.name\n )\n ) {\n this.info(\n \"The `changelog` command already exists in the commands list. If you would like the changelog command to be managed by the `@shell-shock/plugin-changelog` package, please remove or rename the command.\"\n );\n } else {\n this.inputs.push({\n id: this.config.changelog.command.name,\n path: this.config.changelog.command.name,\n segments: [this.config.changelog.command.name],\n title: \"Changelog\",\n icon: \"🗃\",\n tags: [\"Utility\"],\n description: `Display the ${getAppTitle(this)} changelog.`,\n entry: {\n file: joinPaths(this.entryPath, \"changelog\", \"index.ts\"),\n input: {\n file: joinPaths(this.entryPath, \"changelog\", \"command.ts\")\n }\n },\n isVirtual: false,\n source: \"changelog-plugin\",\n ...this.config.changelog.command\n });\n\n this.debug(\n \"Rendering changelog command module for the Shell Shock `changelog` plugin.\"\n );\n\n const content = await this.fs.read(this.config.changelog.file);\n if (content) {\n await render(\n this,\n <ChangelogCommand changelog={renderMarkdown(content)} />\n );\n }\n }\n }\n };\n};\n\nexport default plugin;\n"],"mappings":"wlBA+BA,MAAU,GAAa,EAAA,EAAA,KAEvB,KAAO,iCAGD,OADJ,KAAA,MAAA,0EAAA,CACK,CACL,UAAA,EAAA,CACK,QAAY,CACR,KAAO,EAAC,EAAA,QAAyB,CAAA,EAAA,QAAA,YAC3C,CACQ,CAAE,EAAA,CACR,EAEC,MAAM,gBAAa,CAQjB,GAPF,KAAO,MAAE,gEAAA,CACF,EAAK,KAAA,OAAA,UAAA,KAAA,GACR,KAAC,OAAU,UAAQ,KAAA,EAA2B,KAAM,EAAE,kCAGxD,KAAO,OAAA,UAAA,KAAA,EAAA,KAAA,KAAA,OAAA,UAAA,KAAA,EAEH,CAAA,EAAA,KAAA,OAAA,UAAA,KAAA,EAAA,CAAA,KAAA,GAAA,WAAA,KAAA,OAAA,UAAA,KAAA,CAAA,CACF,KAAI,KAAA,+DAAS,KAAA,OAAA,UAAA,KAAA,UAAA,KAAA,OAAA,UAAA,QAAA,KAAA,+LAAA,CACb,OAGF,GADA,KAAK,SAAA,EAAA,CACD,KAAA,OAAA,KAAA,GAAA,EAAA,KAAA,KAAA,OAAA,UAAA,QAAA,KAAA,CACF,KAAA,KAAA,0MAAA,KACD,CACF,KAAA,OAAA,KAAA,CACK,GAAA,KAAA,OAAgB,UAAC,QAAA,KACjB,KAAM,KAAA,OAAA,UAAA,QAAA,KACP,SAAW,CAAA,KAAI,OAAS,UAAU,QAAO,KAAA,CAC3C,MAAA,sBAEG,KAAC,CAAA,UAAgB,CACnB,YAAY,eAAiB,EAAA,KAAiB,CAAA,aAChD,MAAA,+CAEI,MAAA,CACG,KAAO,EAAU,KAAK,UAAE,YAAiB,aAAA,CAC5C,CACA,CACD,UAAA,GACH,OAAA,oDAEG,CAAA,CACD,KAAC,MAAA,6EAAyC,CAC1C,IAAM,EAAG,MAAW,KAAK,GAAA,KAAO,KAAA,OAAc,UAAA,KAAA,CAC9C,GACA,MAAK,EAAI,KAAA,EAAA,EAAA,CACN,IAAI,WAAU,CACb,OAAK,EAAiB,EAAA,EAEvB,CAAC,CAAA,GAIT"}
@@ -1 +1 @@
1
- export { };
1
+ export{};
@@ -1 +1 @@
1
- export { };
1
+ export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/plugin-changelog",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "private": false,
5
5
  "description": "A package containing a Shell Shock plugin to manage upgrading the local application's version.",
6
6
  "keywords": [
@@ -125,35 +125,21 @@
125
125
  "dependencies": {
126
126
  "@alloy-js/core": "0.23.0-dev.8",
127
127
  "@alloy-js/typescript": "0.23.0-dev.4",
128
- "@powerlines/deepkit": "^0.8.2",
129
- "@powerlines/plugin-alloy": "^0.26.18",
130
- "@powerlines/plugin-plugin": "^0.12.350",
131
- "@shell-shock/core": "^0.17.7",
132
- "@shell-shock/unified": "^0.2.5",
133
- "@stryke/path": "^0.27.4",
134
- "@stryke/type-checks": "^0.6.1",
135
- "@stryke/types": "^0.11.3",
128
+ "@powerlines/deepkit": "^0.8.49",
129
+ "@powerlines/plugin-alloy": "^0.26.67",
130
+ "@powerlines/plugin-plugin": "^0.12.399",
131
+ "@shell-shock/core": "^0.17.8",
132
+ "@shell-shock/unified": "^0.2.6",
133
+ "@stryke/path": "^0.28.1",
134
+ "@stryke/type-checks": "^0.6.4",
135
+ "@stryke/types": "^0.11.6",
136
136
  "defu": "^6.1.7",
137
- "powerlines": "^0.42.40"
137
+ "powerlines": "^0.44.12"
138
138
  },
139
139
  "devDependencies": {
140
- "@powerlines/plugin-deepkit": "^0.11.280",
140
+ "@powerlines/plugin-deepkit": "^0.11.330",
141
141
  "@types/node": "^25.6.0"
142
142
  },
143
- "publishConfig": {
144
- "access": "public",
145
- "exports": {
146
- ".": { "require": "./dist/index.cjs", "import": "./dist/index.mjs" },
147
- "./types": {
148
- "require": "./dist/types/index.cjs",
149
- "import": "./dist/types/index.mjs"
150
- },
151
- "./types/plugin": {
152
- "require": "./dist/types/plugin.cjs",
153
- "import": "./dist/types/plugin.mjs"
154
- },
155
- "./package.json": "./package.json"
156
- }
157
- },
158
- "gitHead": "dcc6ef2c66de17416af3242b25b977c49974b4a1"
143
+ "publishConfig": { "access": "public" },
144
+ "gitHead": "832c19e668deb4d29b5e0219a7708d111790f607"
159
145
  }