@shell-shock/plugin-changelog 0.1.11 → 0.1.14

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 +1,29 @@
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
+ //#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 +1,51 @@
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
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
+ let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
4
+ let _stryke_path_join = require("@stryke/path/join");
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_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
9
+ let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
10
+ let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
11
+
12
+ //#region src/components/changelog-command.tsx
13
+ /**
14
+ * The Changelog command's handler wrapper for the Shell Shock project.
15
+ */
16
+ function ChangelogCommand({ changelog }) {
17
+ const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
18
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TypescriptFile, {
19
+ get path() {
20
+ return (0, _stryke_path_join.joinPaths)(context.entryPath, "changelog", "command.ts");
21
+ },
22
+ builtinImports: { console: [
23
+ "textColors",
24
+ "bold",
25
+ "writeLine",
26
+ "error",
27
+ "warn"
28
+ ] },
29
+ get children() {
30
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { get heading() {
31
+ return `Display the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)} changelog.`;
32
+ } }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
33
+ "export": true,
34
+ "default": true,
35
+ name: "handler",
36
+ get children() {
37
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
38
+ get when() {
39
+ return (0, _stryke_type_checks_is_set_string.isSetString)(changelog);
40
+ },
41
+ fallback: _alloy_js_core.code` return warn("There is no changelog available for display."); `,
42
+ children: _alloy_js_core.code`console.log(${changelog});`
43
+ });
44
+ }
45
+ })];
46
+ }
47
+ });
48
+ }
49
+
50
+ //#endregion
51
+ exports.ChangelogCommand = ChangelogCommand;
@@ -1,5 +1,3 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
-
3
1
  //#region src/components/changelog-command.d.ts
4
2
  interface ChangelogCommandProps {
5
3
  changelog: string;
@@ -9,7 +7,7 @@ interface ChangelogCommandProps {
9
7
  */
10
8
  declare function ChangelogCommand({
11
9
  changelog
12
- }: ChangelogCommandProps): _$_alloy_js_core0.Children;
10
+ }: ChangelogCommandProps): import("@alloy-js/core").Children;
13
11
  //#endregion
14
12
  export { ChangelogCommand, ChangelogCommandProps };
15
13
  //# sourceMappingURL=changelog-command.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"changelog-command.d.cts","names":[],"sources":["../../src/components/changelog-command.tsx"],"mappings":";;;UAwCiB,qBAAA;EACf,SAAA;AAAA;AADF;;;AAAA,iBAOgB,gBAAA,CAAA;EAAmB;AAAA,GAAa,qBAAA,GAAqB,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"changelog-command.d.cts","names":[],"sources":["../../src/components/changelog-command.tsx"],"mappings":";UA4BiB,qBAAA;EACf,SAAS;AAAA;;;AAAA;iBAMK,gBAAA;EAAmB;AAAA,GAAa,qBAAqB,4BAAA,QAAA"}
@@ -1,5 +1,3 @@
1
- import * as _$_alloy_js_core0 from "@alloy-js/core";
2
-
3
1
  //#region src/components/changelog-command.d.ts
4
2
  interface ChangelogCommandProps {
5
3
  changelog: string;
@@ -9,7 +7,7 @@ interface ChangelogCommandProps {
9
7
  */
10
8
  declare function ChangelogCommand({
11
9
  changelog
12
- }: ChangelogCommandProps): _$_alloy_js_core0.Children;
10
+ }: ChangelogCommandProps): import("@alloy-js/core").Children;
13
11
  //#endregion
14
12
  export { ChangelogCommand, ChangelogCommandProps };
15
13
  //# sourceMappingURL=changelog-command.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"changelog-command.d.mts","names":[],"sources":["../../src/components/changelog-command.tsx"],"mappings":";;;UAwCiB,qBAAA;EACf,SAAA;AAAA;AADF;;;AAAA,iBAOgB,gBAAA,CAAA;EAAmB;AAAA,GAAa,qBAAA,GAAqB,iBAAA,CAAA,QAAA"}
1
+ {"version":3,"file":"changelog-command.d.mts","names":[],"sources":["../../src/components/changelog-command.tsx"],"mappings":""}
@@ -1,2 +1,51 @@
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};
1
+ import { createComponent } from "@alloy-js/core/jsx-runtime";
2
+ import { getAppTitle } from "@shell-shock/core/plugin-utils";
3
+ import { joinPaths } from "@stryke/path/join";
4
+ import { isSetString } from "@stryke/type-checks/is-set-string";
5
+ import { Show, code } from "@alloy-js/core";
6
+ import { FunctionDeclaration } from "@alloy-js/typescript";
7
+ import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
8
+ import { TypescriptFile } from "@powerlines/plugin-alloy/typescript";
9
+ import { TSDoc } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
10
+
11
+ //#region src/components/changelog-command.tsx
12
+ /**
13
+ * The Changelog command's handler wrapper for the Shell Shock project.
14
+ */
15
+ function ChangelogCommand({ changelog }) {
16
+ const context = usePowerlines();
17
+ return createComponent(TypescriptFile, {
18
+ get path() {
19
+ return joinPaths(context.entryPath, "changelog", "command.ts");
20
+ },
21
+ builtinImports: { console: [
22
+ "textColors",
23
+ "bold",
24
+ "writeLine",
25
+ "error",
26
+ "warn"
27
+ ] },
28
+ get children() {
29
+ return [createComponent(TSDoc, { get heading() {
30
+ return `Display the ${getAppTitle(context)} changelog.`;
31
+ } }), createComponent(FunctionDeclaration, {
32
+ "export": true,
33
+ "default": true,
34
+ name: "handler",
35
+ get children() {
36
+ return createComponent(Show, {
37
+ get when() {
38
+ return isSetString(changelog);
39
+ },
40
+ fallback: code` return warn("There is no changelog available for display."); `,
41
+ children: code`console.log(${changelog});`
42
+ });
43
+ }
44
+ })];
45
+ }
46
+ });
47
+ }
48
+
49
+ //#endregion
50
+ export { ChangelogCommand };
2
51
  //# 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":"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
+ {"version":3,"file":"changelog-command.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1,4 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./changelog-command.cjs`);exports.ChangelogCommand=e.ChangelogCommand;
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 +1,3 @@
1
- import{ChangelogCommand as e}from"./changelog-command.mjs";export{e as ChangelogCommand};
1
+ import { ChangelogCommand } from "./changelog-command.mjs";
2
+
3
+ export { ChangelogCommand };
@@ -1 +1,50 @@
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
+ let _stryke_path_join = require("@stryke/path/join");
2
+ let powerlines_plugin_utils = require("powerlines/plugin-utils");
3
+ let _stryke_path = require("@stryke/path");
4
+ let node_fs = require("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 && (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));
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
+ exports.resolveChangelog = resolveChangelog;
@@ -1,2 +1,51 @@
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};
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 };
2
51
  //# 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":"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"}
1
+ {"version":3,"file":"resolve-changelog.mjs","names":[],"sources":[],"mappings":""}
package/dist/index.cjs CHANGED
@@ -1 +1,67 @@
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;
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
+ const content = await this.fs.read(this.config.changelog.file);
39
+ if (content) {
40
+ this.inputs.push({
41
+ id: this.config.changelog.command.name,
42
+ path: this.config.changelog.command.name,
43
+ segments: [this.config.changelog.command.name],
44
+ title: "Changelog",
45
+ icon: "🗃",
46
+ tags: ["Utility"],
47
+ description: `Display the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this)} changelog.`,
48
+ entry: {
49
+ file: (0, _stryke_path_join.joinPaths)(this.entryPath, "changelog", "index.ts"),
50
+ input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "changelog", "command.ts") }
51
+ },
52
+ virtual: false,
53
+ ...this.config.changelog.command
54
+ });
55
+ this.debug("Rendering changelog command module for the Shell Shock `changelog` plugin.");
56
+ 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).split("\n").map((line) => (0, _stryke_type_checks_is_set_string.isSetString)(line) ? `\${${line}}` : "").join("\n")}\``;
58
+ } }));
59
+ } else this.warn(`The changelog file at the resolved path: ${this.config.changelog.file} could not be read or is empty. 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 and contains valid content.`);
60
+ }
61
+ }
62
+ };
63
+ };
64
+
65
+ //#endregion
66
+ exports.default = plugin;
67
+ exports.plugin = plugin;
package/dist/index.d.cts CHANGED
@@ -7,5 +7,5 @@ import { Plugin } from "powerlines";
7
7
  */
8
8
  declare const plugin: <TContext extends ChangelogPluginContext = ChangelogPluginContext>(options?: ChangelogPluginOptions) => Plugin<TContext>;
9
9
  //#endregion
10
- export { ChangelogPluginContext, ChangelogPluginOptions, ChangelogPluginResolvedConfig, ChangelogPluginUserConfig, plugin as default, plugin };
10
+ export { type ChangelogPluginContext, type ChangelogPluginOptions, type ChangelogPluginResolvedConfig, type ChangelogPluginUserConfig, plugin as default, plugin };
11
11
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.mts CHANGED
@@ -7,5 +7,5 @@ import { Plugin } from "powerlines";
7
7
  */
8
8
  declare const plugin: <TContext extends ChangelogPluginContext = ChangelogPluginContext>(options?: ChangelogPluginOptions) => Plugin<TContext>;
9
9
  //#endregion
10
- export { ChangelogPluginContext, ChangelogPluginOptions, ChangelogPluginResolvedConfig, ChangelogPluginUserConfig, plugin as default, plugin };
10
+ export { type ChangelogPluginContext, type ChangelogPluginOptions, type ChangelogPluginResolvedConfig, type ChangelogPluginUserConfig, plugin as default, plugin };
11
11
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AAsCA;cAAa,MAAA,oBACM,sBAAA,GAAyB,sBAAA,EAE1C,OAAA,GAAS,sBAAA,KACR,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":""}
package/dist/index.mjs CHANGED
@@ -1,2 +1,64 @@
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};
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
+ const content = await this.fs.read(this.config.changelog.file);
36
+ if (content) {
37
+ this.inputs.push({
38
+ id: this.config.changelog.command.name,
39
+ path: this.config.changelog.command.name,
40
+ segments: [this.config.changelog.command.name],
41
+ title: "Changelog",
42
+ icon: "🗃",
43
+ tags: ["Utility"],
44
+ description: `Display the ${getAppTitle(this)} changelog.`,
45
+ entry: {
46
+ file: joinPaths(this.entryPath, "changelog", "index.ts"),
47
+ input: { file: joinPaths(this.entryPath, "changelog", "command.ts") }
48
+ },
49
+ virtual: false,
50
+ ...this.config.changelog.command
51
+ });
52
+ this.debug("Rendering changelog command module for the Shell Shock `changelog` plugin.");
53
+ await render(this, createComponent(ChangelogCommand, { get changelog() {
54
+ return `\`${renderMarkdown(content).split("\n").map((line) => isSetString(line) ? `\${${line}}` : "").join("\n")}\``;
55
+ } }));
56
+ } else this.warn(`The changelog file at the resolved path: ${this.config.changelog.file} could not be read or is empty. 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 and contains valid content.`);
57
+ }
58
+ }
59
+ };
60
+ };
61
+
62
+ //#endregion
63
+ export { plugin as default, plugin };
2
64
  //# 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":"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
+ {"version":3,"file":"index.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- export{};
1
+ export { };
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;UA0BiB,sBAAA;;AAAjB;;;;;;;;;;AAmEA;;;;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;AAYA;;;;;;;;;;EAhCE,IAAA;EAkCE;;;;;;;;EAxBF,OAAA,GAAU,OAAA,CAAQ,aAAA;AAAA;AAAA,KAGR,yBAAA,GAA4B,UAAA;;;;EAItC,SAAA,EAAW,sBAAA;AAAA;AAAA,KAGD,6BAAA,GAAgC,cAAA;;;;EAI1C,SAAA,EAAW,QAAA,CAAS,IAAA,CAAK,sBAAA;;;;IAIvB,OAAA,EAAS,YAAA,CAAa,OAAA,CAAQ,aAAA;EAAA;AAAA;AAAA,KAItB,sBAAA,yBACc,6BAAA,GACtB,6BAAA,IACA,OAAA,CAAQ,eAAA"}
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;UA0BiB,sBAAA;;AAAjB;;;;;;;;;AAgEiC;AAGjC;;;;;;;;AAImC;AAGnC;;;;;;;;;;;;;;;;;;;;;;AAQ+C;AAI/C;;;;;;;;;;EAhCE,IAAA;EAkCE;;;;AACuB;;;;EAzBzB,OAAA,GAAU,OAAO,CAAC,aAAA;AAAA;AAAA,KAGR,yBAAA,GAA4B,UAAA;;;;EAItC,SAAA,EAAW,sBAAsB;AAAA;AAAA,KAGvB,6BAAA,GAAgC,cAAA;;;;EAI1C,SAAA,EAAW,QAAA,CAAS,IAAA,CAAK,sBAAA;;;;IAIvB,OAAA,EAAS,YAAA,CAAa,OAAA,CAAQ,aAAA;EAAA;AAAA;AAAA,KAItB,sBAAA,yBACc,6BAAA,GACtB,6BAAA,IACA,OAAA,CAAQ,eAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;UA0BiB,sBAAA;;AAAjB;;;;;;;;;;AAmEA;;;;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;AAYA;;;;;;;;;;EAhCE,IAAA;EAkCE;;;;;;;;EAxBF,OAAA,GAAU,OAAA,CAAQ,aAAA;AAAA;AAAA,KAGR,yBAAA,GAA4B,UAAA;;;;EAItC,SAAA,EAAW,sBAAA;AAAA;AAAA,KAGD,6BAAA,GAAgC,cAAA;;;;EAI1C,SAAA,EAAW,QAAA,CAAS,IAAA,CAAK,sBAAA;;;;IAIvB,OAAA,EAAS,YAAA,CAAa,OAAA,CAAQ,aAAA;EAAA;AAAA;AAAA,KAItB,sBAAA,yBACc,6BAAA,GACtB,6BAAA,IACA,OAAA,CAAQ,eAAA"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":""}
@@ -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.11",
3
+ "version": "0.1.14",
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": [
@@ -121,25 +121,23 @@
121
121
  "module": "./dist/index.mjs",
122
122
  "types": "./dist/index.d.cts",
123
123
  "typings": "dist/index.d.mts",
124
- "files": ["dist/**/*"],
124
+ "files": ["dist"],
125
125
  "dependencies": {
126
- "@alloy-js/core": "0.23.0-dev.8",
127
- "@alloy-js/typescript": "0.23.0-dev.4",
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",
126
+ "@alloy-js/core": "^0.23.1",
127
+ "@alloy-js/typescript": "^0.23.0",
128
+ "@powerlines/plugin-alloy": "^0.26.217",
129
+ "@shell-shock/core": "0.17.11",
130
+ "@shell-shock/unified": "0.2.9",
131
+ "@stryke/path": "^0.29.11",
132
+ "@stryke/type-checks": "^0.6.17",
133
+ "@stryke/types": "^0.12.12",
136
134
  "defu": "^6.1.7",
137
- "powerlines": "^0.44.12"
135
+ "powerlines": "^0.47.124"
138
136
  },
139
137
  "devDependencies": {
140
- "@powerlines/plugin-deepkit": "^0.11.330",
141
- "@types/node": "^25.6.0"
138
+ "@powerlines/plugin-plugin": "^0.12.536",
139
+ "@types/node": "^25.9.1"
142
140
  },
143
141
  "publishConfig": { "access": "public" },
144
- "gitHead": "832c19e668deb4d29b5e0219a7708d111790f607"
142
+ "gitHead": "9401c1de122d800040306fc89ad1835930c1a826"
145
143
  }