@shell-shock/plugin-changelog 0.1.8 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -249,7 +249,7 @@ generation of development tools, please reach out on our
249
249
 
250
250
  <div align="center"><a href="https://stormsoftware.com" target="_blank"><img src="https://public.storm-cdn.com/storm-software/icon-circle-fill-dark.png" alt="Storm Software" width="200px"/></a></div>
251
251
  <br />
252
- <div align="center"><a href="https://stormsoftware.com" target="_blank"><img src="https://public.storm-cdn.com/visit-us-text.svg" alt="Visit us at stormsoftware.com" height="90px"/></a></div>
252
+ <div align="center"><a href="https://stormsoftware.com" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/misc/text/visit-us-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/misc/text/visit-us-light.png"><img src="https://public.storm-cdn.com/misc/text/visit-us-dark.png" height="90px" alt="Visit us at stormsoftware.com" /></picture></a></div>
253
253
 
254
254
  <br />
255
255
 
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
3
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
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");
5
6
  let _alloy_js_core = require("@alloy-js/core");
6
7
  let _alloy_js_typescript = require("@alloy-js/typescript");
7
8
  let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
@@ -9,20 +10,14 @@ let _powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
9
10
  let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
10
11
  let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
11
12
  let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
12
- let _shell_shock_unified_markdown = require("@shell-shock/unified/markdown");
13
13
  let _stryke_path = require("@stryke/path");
14
14
 
15
15
  //#region src/components/changelog-command.tsx
16
16
  /**
17
17
  * The Changelog command's handler wrapper for the Shell Shock project.
18
18
  */
19
- function ChangelogCommand() {
19
+ function ChangelogCommand({ changelog }) {
20
20
  const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
21
- const result = (0, _alloy_js_core.createResource)(async () => {
22
- const content = await context.fs.read(context.config.changelog.file);
23
- if (!content) return null;
24
- return (0, _shell_shock_unified_markdown.renderMarkdown)(content);
25
- });
26
21
  return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TypescriptFile, {
27
22
  get path() {
28
23
  return (0, _stryke_path.joinPaths)(context.entryPath, "changelog", "command.ts");
@@ -96,29 +91,10 @@ function ChangelogCommand() {
96
91
  get children() {
97
92
  return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
98
93
  get when() {
99
- return !result.loading && !result.error;
100
- },
101
- get fallback() {
102
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
103
- get when() {
104
- return !!result.error;
105
- },
106
- get children() {
107
- return _alloy_js_core.code` return error(\`Failed to load changelog: ${result.error.message.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${").replaceAll("\n", "\\n").replaceAll("\r", "\\r").replaceAll(" ", "\\t")}\`); `;
108
- }
109
- });
94
+ return (0, _stryke_type_checks_is_set_string.isSetString)(changelog);
110
95
  },
111
- get children() {
112
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
113
- get when() {
114
- return !!result.data;
115
- },
116
- fallback: _alloy_js_core.code` return warn("There is no changelog available for display."); `,
117
- get children() {
118
- return result.data;
119
- }
120
- });
121
- }
96
+ fallback: _alloy_js_core.code` return warn("There is no changelog available for display."); `,
97
+ children: changelog
122
98
  });
123
99
  }
124
100
  })
@@ -1,10 +1,15 @@
1
1
  import * as _$_alloy_js_core0 from "@alloy-js/core";
2
2
 
3
3
  //#region src/components/changelog-command.d.ts
4
+ interface ChangelogCommandProps {
5
+ changelog: string;
6
+ }
4
7
  /**
5
8
  * The Changelog command's handler wrapper for the Shell Shock project.
6
9
  */
7
- declare function ChangelogCommand(): _$_alloy_js_core0.Children;
10
+ declare function ChangelogCommand({
11
+ changelog
12
+ }: ChangelogCommandProps): _$_alloy_js_core0.Children;
8
13
  //#endregion
9
- export { ChangelogCommand };
14
+ export { ChangelogCommand, ChangelogCommandProps };
10
15
  //# sourceMappingURL=changelog-command.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"changelog-command.d.cts","names":[],"sources":["../../src/components/changelog-command.tsx"],"mappings":";;;;;;iBA2CgB,gBAAA,CAAA,GAAgB,iBAAA,CAAA,QAAA"}
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,10 +1,15 @@
1
1
  import * as _$_alloy_js_core0 from "@alloy-js/core";
2
2
 
3
3
  //#region src/components/changelog-command.d.ts
4
+ interface ChangelogCommandProps {
5
+ changelog: string;
6
+ }
4
7
  /**
5
8
  * The Changelog command's handler wrapper for the Shell Shock project.
6
9
  */
7
- declare function ChangelogCommand(): _$_alloy_js_core0.Children;
10
+ declare function ChangelogCommand({
11
+ changelog
12
+ }: ChangelogCommandProps): _$_alloy_js_core0.Children;
8
13
  //#endregion
9
- export { ChangelogCommand };
14
+ export { ChangelogCommand, ChangelogCommandProps };
10
15
  //# sourceMappingURL=changelog-command.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"changelog-command.d.mts","names":[],"sources":["../../src/components/changelog-command.tsx"],"mappings":";;;;;;iBA2CgB,gBAAA,CAAA,GAAgB,iBAAA,CAAA,QAAA"}
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,26 +1,21 @@
1
1
  import { createComponent } from "@alloy-js/core/jsx-runtime";
2
2
  import { getAppTitle } from "@shell-shock/core/plugin-utils";
3
- import { Show, code, createResource } from "@alloy-js/core";
3
+ import { isSetString } from "@stryke/type-checks/is-set-string";
4
+ import { Show, code } from "@alloy-js/core";
4
5
  import { FunctionDeclaration, InterfaceDeclaration } from "@alloy-js/typescript";
5
6
  import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
6
7
  import { Spacing } from "@powerlines/plugin-alloy/core";
7
8
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
8
9
  import { InterfaceMember, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
9
10
  import { TSDoc, TSDocDefaultValue, TSDocParam } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
10
- import { renderMarkdown } from "@shell-shock/unified/markdown";
11
11
  import { joinPaths } from "@stryke/path";
12
12
 
13
13
  //#region src/components/changelog-command.tsx
14
14
  /**
15
15
  * The Changelog command's handler wrapper for the Shell Shock project.
16
16
  */
17
- function ChangelogCommand() {
17
+ function ChangelogCommand({ changelog }) {
18
18
  const context = usePowerlines();
19
- const result = createResource(async () => {
20
- const content = await context.fs.read(context.config.changelog.file);
21
- if (!content) return null;
22
- return renderMarkdown(content);
23
- });
24
19
  return createComponent(TypescriptFile, {
25
20
  get path() {
26
21
  return joinPaths(context.entryPath, "changelog", "command.ts");
@@ -94,29 +89,10 @@ function ChangelogCommand() {
94
89
  get children() {
95
90
  return createComponent(Show, {
96
91
  get when() {
97
- return !result.loading && !result.error;
98
- },
99
- get fallback() {
100
- return createComponent(Show, {
101
- get when() {
102
- return !!result.error;
103
- },
104
- get children() {
105
- return code` return error(\`Failed to load changelog: ${result.error.message.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${").replaceAll("\n", "\\n").replaceAll("\r", "\\r").replaceAll(" ", "\\t")}\`); `;
106
- }
107
- });
92
+ return isSetString(changelog);
108
93
  },
109
- get children() {
110
- return createComponent(Show, {
111
- get when() {
112
- return !!result.data;
113
- },
114
- fallback: code` return warn("There is no changelog available for display."); `,
115
- get children() {
116
- return result.data;
117
- }
118
- });
119
- }
94
+ fallback: code` return warn("There is no changelog available for display."); `,
95
+ children: changelog
120
96
  });
121
97
  }
122
98
  })
@@ -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, createResource, 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 { renderMarkdown } from \"@shell-shock/unified/markdown\";\nimport { joinPaths } from \"@stryke/path\";\nimport type { ChangelogPluginContext } from \"../types/plugin\";\n\n/**\n * The Changelog command's handler wrapper for the Shell Shock project.\n */\nexport function ChangelogCommand() {\n const context = usePowerlines<ChangelogPluginContext>();\n\n const result = createResource(async () => {\n const content = await context.fs.read(context.config.changelog.file);\n if (!content) {\n return null;\n }\n\n return renderMarkdown(content);\n });\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={!result.loading && !result.error}\n fallback={\n <Show when={!!result.error}>\n {code` return error(\\`Failed to load changelog: ${result\n .error!.message.replaceAll(\"\\\\\", \"\\\\\\\\\")\n .replaceAll(\"`\", \"\\\\`\")\n .replaceAll(\"${\", \"\\\\${\")\n .replaceAll(\"\\n\", \"\\\\n\")\n .replaceAll(\"\\r\", \"\\\\r\")\n .replaceAll(\"\\t\", \"\\\\t\")}\\`); `}\n </Show>\n }>\n <Show\n when={!!result.data}\n fallback={code` return warn(\"There is no changelog available for display.\"); `}>\n {result.data}\n </Show>\n </Show>\n </FunctionDeclaration>\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkCA,SAAS,mBAAwB;CACjC,MAAQ,UAAC,eAA6C;CACtD,MAAQ,SAAC,eAAuB,YAAY;EAC5C,MAAS,UAAW,MAAM,QAAQ,GAAC,KAAK,QAAA,OAAA,UAAA,KAAA;AACxC,MAAO,CAAA;AAGJ,SAAI,eAAmB,QAAQ;GAChC;AACF,QAAO,gBAAS,gBAAmB;EACjC,IAAM,OAAO;;;EAGX,SAAM;GACJ,WAAW;GACX,oBAAW,CAAA,YAAA,YAAA;GACb;oBAEA,SAAO;GAAA;GAAe;GAAQ;GAAA;GAAA;GAAA,EAC9B;;AAEF,UAAO;IAAA,gBAAA,OAAA,EACJ,SAAA,sCACC,CAAA;IAAI,gBAAY,sBAAoB;KACpC,UAAS;KACP,MAAM;KACN,IAAC,WAAQ;AACV,aAAA;OAAA,gBAAA,OAAA,EACD,SAAe,2QACb,CAAA;OAAA,gBAAwB,iBAAS;QACjC,MAAA;QACI,UAAU;QACf,MAAA;QACE,CAAA;OAAK,gBAAa,SAAS,EAAA,CAAQ;OAAC,gBAAgB,OAAU;QAC9D,SAAA;QACA,IAAO,WAAE;AACJ,gBAAC,gBAAqB,mBAAsB;UAC/C,IAAA,OAAA;AACO,kBAAA,eAAqB;;UAE5B,cAAA;UACI,CAAA;;QAEP,CAAA;OAAA,gBAAoB,iBAAA;QACrB,MAAS;QACJ,UAAU;QACb,MAAA;QACE,CAAA;OAAA;;KAEJ,CAAC;IAAA,gBAAK,SAAA,EAAA,CAAA;IAAA,gBAAA,OAAA;KACN,IAAA,UAAA;AACC,aAAA,eAAA,YAAA,QAAA,CAAA;;KAEA,IAAA,WAAA;AACA,aAAM,gBAAO,YAAA;OACb,MAAU;OACT,UAAA,IAAA;OACC,CAAA;;KAEH,CAAC;IAAE,gBAAgB,qBAAa;KAC/B,UAAO;KACP,WAAS;KACT,OAAO;KACP,MAAM;KACN,YAAS,CAAA;MACP,MAAM;MACN,MAAM;MACP,CAAC;KACF,IAAG,WAAA;AACD,aAAC,gBAAA,MAAA;OACC,IAAI,OAAI;AACR,eAAS,CAAC,OAAM,WAAY,CAAC,OAAM;;OAEnC,IAAI,WAAA;AACF,eAAA,gBAAA,MAAA;SACN,IAAA,OAAmB;AACrB,iBAAc,CAAA,CAAA,OAAA;;SAEpB,IAAA,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":";;;;;;;;;;;;;;;;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,2 +1,2 @@
1
- import { ChangelogCommand } from "./changelog-command.cjs";
2
- export { ChangelogCommand };
1
+ import { ChangelogCommand, ChangelogCommandProps } from "./changelog-command.cjs";
2
+ export { ChangelogCommand, ChangelogCommandProps };
@@ -1,2 +1,2 @@
1
- import { ChangelogCommand } from "./changelog-command.mjs";
2
- export { ChangelogCommand };
1
+ import { ChangelogCommand, ChangelogCommandProps } from "./changelog-command.mjs";
2
+ export { ChangelogCommand, ChangelogCommandProps };
@@ -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 type { UnresolvedContext } from \"@shell-shock/core\";\nimport { appendExtension } from \"@stryke/path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { existsSync } from \"node:fs\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\nimport type { ChangelogPluginOptions } 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: UnresolvedContext,\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: UnresolvedContext,\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":";;;;;;AAyBA,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":";;;;;;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"}
package/dist/index.cjs CHANGED
@@ -6,6 +6,7 @@ const require_resolve_changelog = require('./helpers/resolve-changelog.cjs');
6
6
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
7
  let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
8
8
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
9
+ let _shell_shock_unified_markdown = require("@shell-shock/unified/markdown");
9
10
  let _stryke_path_join = require("@stryke/path/join");
10
11
  let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
11
12
  let defu = require("defu");
@@ -21,22 +22,20 @@ const plugin = (options = {}) => {
21
22
  name: "shell-shock:changelog",
22
23
  config() {
23
24
  this.debug("Providing default configuration for the Shell Shock `changelog` plugin.");
24
- return { changelog: (0, defu.default)({
25
- file: require_resolve_changelog.resolveChangelog(this, options),
26
- command: { name: (0, _stryke_type_checks_is_set_string.isSetString)(options.command) ? options.command : "changelog" }
27
- }, options) };
25
+ return { changelog: (0, defu.default)({ command: { name: (0, _stryke_type_checks_is_set_string.isSetString)(options.command) ? options.command : "changelog" } }, options) };
28
26
  },
29
- configResolved() {
27
+ async configResolved() {
30
28
  this.debug("Adding the CLI changelog commands to the application context.");
31
- if ((0, _stryke_type_checks_is_set_string.isSetString)(this.config.changelog.file)) {
32
- this.config.changelog.file = (0, powerlines_plugin_utils.replacePathTokens)(this, this.config.changelog.file);
33
- if (!this.fs.existsSync(this.config.changelog.file)) {
34
- 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.`);
35
- return;
36
- }
37
- this.inputs ??= [];
38
- 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.");
39
- else this.inputs.push({
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({
40
39
  id: this.config.changelog.command.name,
41
40
  path: this.config.changelog.command.name,
42
41
  segments: [this.config.changelog.command.name],
@@ -52,12 +51,12 @@ const plugin = (options = {}) => {
52
51
  source: "changelog-plugin",
53
52
  ...this.config.changelog.command
54
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
+ } }));
55
59
  }
56
- },
57
- async prepare() {
58
- if ((0, _stryke_type_checks_is_set_string.isSetString)(this.config.changelog.file) && !this.fs.existsSync(this.config.changelog.file)) return;
59
- this.debug("Rendering changelog command module for the Shell Shock `changelog` plugin.");
60
- return (0, _powerlines_plugin_alloy_render.render)(this, (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_changelog_command.ChangelogCommand, {}));
61
60
  }
62
61
  };
63
62
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AAqCA;cAAa,MAAA,oBACM,sBAAA,GAAyB,sBAAA,EAE1C,OAAA,GAAS,sBAAA,KACR,MAAA,CAAO,QAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AAsCA;cAAa,MAAA,oBACM,sBAAA,GAAyB,sBAAA,EAE1C,OAAA,GAAS,sBAAA,KACR,MAAA,CAAO,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.tsx"],"mappings":";;;;;;AAqCA;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":";;;;;;AAsCA;cAAa,MAAA,oBACM,sBAAA,GAAyB,sBAAA,EAE1C,OAAA,GAAS,sBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.mjs CHANGED
@@ -4,6 +4,7 @@ import { resolveChangelog } from "./helpers/resolve-changelog.mjs";
4
4
  import { createComponent } from "@alloy-js/core/jsx-runtime";
5
5
  import { render } from "@powerlines/plugin-alloy/render";
6
6
  import { getAppTitle } from "@shell-shock/core/plugin-utils";
7
+ import { renderMarkdown } from "@shell-shock/unified/markdown";
7
8
  import { joinPaths } from "@stryke/path/join";
8
9
  import { isSetString } from "@stryke/type-checks/is-set-string";
9
10
  import defu from "defu";
@@ -18,22 +19,20 @@ const plugin = (options = {}) => {
18
19
  name: "shell-shock:changelog",
19
20
  config() {
20
21
  this.debug("Providing default configuration for the Shell Shock `changelog` plugin.");
21
- return { changelog: defu({
22
- file: resolveChangelog(this, options),
23
- command: { name: isSetString(options.command) ? options.command : "changelog" }
24
- }, options) };
22
+ return { changelog: defu({ command: { name: isSetString(options.command) ? options.command : "changelog" } }, options) };
25
23
  },
26
- configResolved() {
24
+ async configResolved() {
27
25
  this.debug("Adding the CLI changelog commands to the application context.");
28
- if (isSetString(this.config.changelog.file)) {
29
- this.config.changelog.file = replacePathTokens(this, this.config.changelog.file);
30
- if (!this.fs.existsSync(this.config.changelog.file)) {
31
- 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.`);
32
- return;
33
- }
34
- this.inputs ??= [];
35
- 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.");
36
- else this.inputs.push({
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({
37
36
  id: this.config.changelog.command.name,
38
37
  path: this.config.changelog.command.name,
39
38
  segments: [this.config.changelog.command.name],
@@ -49,12 +48,12 @@ const plugin = (options = {}) => {
49
48
  source: "changelog-plugin",
50
49
  ...this.config.changelog.command
51
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
+ } }));
52
56
  }
53
- },
54
- async prepare() {
55
- if (isSetString(this.config.changelog.file) && !this.fs.existsSync(this.config.changelog.file)) return;
56
- this.debug("Rendering changelog command module for the Shell Shock `changelog` plugin.");
57
- return render(this, createComponent(ChangelogCommand, {}));
58
57
  }
59
58
  };
60
59
  };
@@ -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 { 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 file: resolveChangelog(this, options),\n command: {\n name: isSetString(options.command) ? options.command : \"changelog\"\n }\n },\n options\n )\n };\n },\n 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 = replacePathTokens(\n this,\n this.config.changelog.file\n );\n\n if (!this.fs.existsSync(this.config.changelog.file)) {\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 }\n },\n async prepare() {\n if (\n isSetString(this.config.changelog.file) &&\n !this.fs.existsSync(this.config.changelog.file)\n ) {\n return;\n }\n\n this.debug(\n \"Rendering changelog command module for the Shell Shock `changelog` plugin.\"\n );\n\n return render(this, <ChangelogCommand />);\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;AAkCA,MAAE,UAAA,UAAA,EAAA,KAAA;AACA,QAAK;EACL,MAAA;EACF,SAAa;AACX,QAAS,MAAA,0EAAiC;AAC3C,UAAA,EACC,WAAS,KAAA;IACD,MAAA,iBAAa,MAAA,QAAA;IACd,SAAA,EACE,MAAM,YAAM,QAAU,QAAA,GAAA,QAAA,UAAA,aACtB;IACL,EAAK,QAAK,EACT;;;AAGD,QAAA,MAAO,gEAAA;AACP,OAAE,YAAW,KAAI,OAAA,UAAA,KAAA,EAAA;AACf,SAAE,OAAA,UAAA,OAAA,kBAAA,MAAA,KAAA,OAAA,UAAA,KAAA;AACF,QAAI,CAAA,KAAM,GAAA,WAAA,KAAiB,OAAM,UAAQ,KAAA,EAAA;AACvC,UAAE,KAAQ,+DAAC,KAAA,OAAA,UAAA,KAAA,UAAA,KAAA,OAAA,UAAA,QAAA,KAAA,+LAAA;AACX;;AAEF,SAAG,WAAA,EAAA;AACH,QAAE,KAAA,OAAA,MAAA,UAAA,MAAA,OAAA,KAAA,OAAA,UAAA,QAAA,KAAA,CACF,MAAA,KAAA,0MAAA;QAEH,MAAA,OAAA,KAAA;KACD,IAAA,KAAiB,OAAA,UAAA,QAAA;KACV,MAAK,KAAA,OAAA,UAAA,QAAA;KACP,UAAW,CAAG,KAAC,OAAU,UAAW,QAAK,KAAA;KAC3C,OAAA;;KAEG,MAAA,CAAA,UAAiB;KACf,aAAQ,eAAiB,YAAA,KAAiB,CAAA;KAC5C,OAAI;MACA,MAAC,UAAO,KAAU,WAAA,aAAA,WAAA;MACvB,OAAA,8DAEI;MACH;KACE,WAAK;KACL,QAAO;KACP,GAAG,KAAK,OAAE,UAAA;KACX,CAAC;;;EAIR,MAAI,UAAA;kGAEA;AAEF,QAAI,MAAK,6EAAW;AACpB,UAAM,OAAQ,MAAM,gBAAa,kBAAiB,EAAQ,CAAA,CAAA;;EAE7D"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/plugin-changelog",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
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,19 +125,19 @@
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.1",
129
- "@powerlines/plugin-alloy": "^0.26.16",
130
- "@powerlines/plugin-plugin": "^0.12.348",
131
- "@shell-shock/core": "^0.17.5",
132
- "@shell-shock/unified": "^0.2.3",
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
133
  "@stryke/path": "^0.27.4",
134
134
  "@stryke/type-checks": "^0.6.1",
135
135
  "@stryke/types": "^0.11.3",
136
136
  "defu": "^6.1.7",
137
- "powerlines": "^0.42.38"
137
+ "powerlines": "^0.42.40"
138
138
  },
139
139
  "devDependencies": {
140
- "@powerlines/plugin-deepkit": "^0.11.278",
140
+ "@powerlines/plugin-deepkit": "^0.11.280",
141
141
  "@types/node": "^25.6.0"
142
142
  },
143
143
  "publishConfig": {
@@ -155,5 +155,5 @@
155
155
  "./package.json": "./package.json"
156
156
  }
157
157
  },
158
- "gitHead": "6ef904ba0c05e26d17cc27465a09c535d6fd6b3c"
158
+ "gitHead": "dcc6ef2c66de17416af3242b25b977c49974b4a1"
159
159
  }