@shell-shock/plugin-changelog 0.1.13 → 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,16 +1,13 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
3
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
4
+ let _stryke_path_join = require("@stryke/path/join");
5
5
  let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
6
6
  let _alloy_js_core = require("@alloy-js/core");
7
7
  let _alloy_js_typescript = require("@alloy-js/typescript");
8
- let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
9
- let _powerlines_plugin_alloy_core = require("@powerlines/plugin-alloy/core");
10
8
  let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
11
9
  let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
12
10
  let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
13
- let _stryke_path = require("@stryke/path");
14
11
 
15
12
  //#region src/components/changelog-command.tsx
16
13
  /**
@@ -20,11 +17,7 @@ function ChangelogCommand({ changelog }) {
20
17
  const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
21
18
  return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TypescriptFile, {
22
19
  get path() {
23
- return (0, _stryke_path.joinPaths)(context.entryPath, "changelog", "command.ts");
24
- },
25
- imports: {
26
- "node:os": "os",
27
- "node:fs/promises": ["readFile", "writeFile"]
20
+ return (0, _stryke_path_join.joinPaths)(context.entryPath, "changelog", "command.ts");
28
21
  },
29
22
  builtinImports: { console: [
30
23
  "textColors",
@@ -34,71 +27,22 @@ function ChangelogCommand({ changelog }) {
34
27
  "warn"
35
28
  ] },
36
29
  get children() {
37
- return [
38
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "Options for the Changelog command." }),
39
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.InterfaceDeclaration, {
40
- "export": true,
41
- name: "ChangelogOptions",
42
- get children() {
43
- return [
44
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "An optional starting version for the changelog. The command will attempt to display changes starting from the specified version. The version should be a valid semantic version string. If not specified, the changelog will start from the earliest version available." }),
45
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
46
- name: "start",
47
- optional: true,
48
- type: "string"
49
- }),
50
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
51
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
52
- heading: "An optional ending version for the changelog. The command will attempt to display changes up to the specified version. The version should be a valid semantic version string. If not specified, the changelog will display changes up to the latest version available.",
53
- get children() {
54
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
55
- get type() {
56
- return _powerlines_deepkit_vendor_type.ReflectionKind.string;
57
- },
58
- defaultValue: "latest"
59
- });
60
- }
61
- }),
62
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.InterfaceMember, {
63
- name: "end",
64
- optional: true,
65
- type: "string"
66
- })
67
- ];
68
- }
69
- }),
70
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core.Spacing, {}),
71
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
72
- get heading() {
73
- return `Display the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(context)} changelog.`;
74
- },
75
- get children() {
76
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
77
- name: "options",
78
- children: _alloy_js_core.code`An object containing options for displaying the changelog.`
79
- });
80
- }
81
- }),
82
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
83
- "export": true,
84
- "default": true,
85
- async: true,
86
- name: "handler",
87
- parameters: [{
88
- name: "options",
89
- type: "ChangelogOptions"
90
- }],
91
- get children() {
92
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
93
- get when() {
94
- return (0, _stryke_type_checks_is_set_string.isSetString)(changelog);
95
- },
96
- fallback: _alloy_js_core.code` return warn("There is no changelog available for display."); `,
97
- children: changelog
98
- });
99
- }
100
- })
101
- ];
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
+ })];
102
46
  }
103
47
  });
104
48
  }
@@ -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,14 +1,12 @@
1
1
  import { createComponent } from "@alloy-js/core/jsx-runtime";
2
2
  import { getAppTitle } from "@shell-shock/core/plugin-utils";
3
+ import { joinPaths } from "@stryke/path/join";
3
4
  import { isSetString } from "@stryke/type-checks/is-set-string";
4
5
  import { Show, code } from "@alloy-js/core";
5
- import { FunctionDeclaration, InterfaceDeclaration } from "@alloy-js/typescript";
6
- import { ReflectionKind } from "@powerlines/deepkit/vendor/type";
7
- import { Spacing } from "@powerlines/plugin-alloy/core";
6
+ import { FunctionDeclaration } from "@alloy-js/typescript";
8
7
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
9
- import { InterfaceMember, TypescriptFile } from "@powerlines/plugin-alloy/typescript";
10
- import { TSDoc, TSDocDefaultValue, TSDocParam } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
11
- import { joinPaths } from "@stryke/path";
8
+ import { TypescriptFile } from "@powerlines/plugin-alloy/typescript";
9
+ import { TSDoc } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
12
10
 
13
11
  //#region src/components/changelog-command.tsx
14
12
  /**
@@ -20,10 +18,6 @@ function ChangelogCommand({ changelog }) {
20
18
  get path() {
21
19
  return joinPaths(context.entryPath, "changelog", "command.ts");
22
20
  },
23
- imports: {
24
- "node:os": "os",
25
- "node:fs/promises": ["readFile", "writeFile"]
26
- },
27
21
  builtinImports: { console: [
28
22
  "textColors",
29
23
  "bold",
@@ -32,71 +26,22 @@ function ChangelogCommand({ changelog }) {
32
26
  "warn"
33
27
  ] },
34
28
  get children() {
35
- return [
36
- createComponent(TSDoc, { heading: "Options for the Changelog command." }),
37
- createComponent(InterfaceDeclaration, {
38
- "export": true,
39
- name: "ChangelogOptions",
40
- get children() {
41
- return [
42
- createComponent(TSDoc, { heading: "An optional starting version for the changelog. The command will attempt to display changes starting from the specified version. The version should be a valid semantic version string. If not specified, the changelog will start from the earliest version available." }),
43
- createComponent(InterfaceMember, {
44
- name: "start",
45
- optional: true,
46
- type: "string"
47
- }),
48
- createComponent(Spacing, {}),
49
- createComponent(TSDoc, {
50
- heading: "An optional ending version for the changelog. The command will attempt to display changes up to the specified version. The version should be a valid semantic version string. If not specified, the changelog will display changes up to the latest version available.",
51
- get children() {
52
- return createComponent(TSDocDefaultValue, {
53
- get type() {
54
- return ReflectionKind.string;
55
- },
56
- defaultValue: "latest"
57
- });
58
- }
59
- }),
60
- createComponent(InterfaceMember, {
61
- name: "end",
62
- optional: true,
63
- type: "string"
64
- })
65
- ];
66
- }
67
- }),
68
- createComponent(Spacing, {}),
69
- createComponent(TSDoc, {
70
- get heading() {
71
- return `Display the ${getAppTitle(context)} changelog.`;
72
- },
73
- get children() {
74
- return createComponent(TSDocParam, {
75
- name: "options",
76
- children: code`An object containing options for displaying the changelog.`
77
- });
78
- }
79
- }),
80
- createComponent(FunctionDeclaration, {
81
- "export": true,
82
- "default": true,
83
- async: true,
84
- name: "handler",
85
- parameters: [{
86
- name: "options",
87
- type: "ChangelogOptions"
88
- }],
89
- get children() {
90
- return createComponent(Show, {
91
- get when() {
92
- return isSetString(changelog);
93
- },
94
- fallback: code` return warn("There is no changelog available for display."); `,
95
- children: changelog
96
- });
97
- }
98
- })
99
- ];
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
+ })];
100
45
  }
101
46
  });
102
47
  }
@@ -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":";;;;;;;;;;;;;;;;AAgCA,SAAE,iBAAiB,EACjB,aACA;CACF,MAAQ,UAAC,eAAqB;AAC9B,QAAS,gBAAkB,gBAAa;EACxC,IAAQ,OAAC;AACH,UAAO,UAAC,QAAA,WAAyB,aAAe,aAAO;;EAE7D,SAAO;GACL,WAAW;GACb,oBAAA,CAAA,YAAA,YAAA;;EAEE,gBAAA,EACI,SAAC;GAAS;GAAW;GAAQ;GAAgB;GAAM;GAAM,EAC7D;EACF,IAAO,WAAS;AACd,UAAM;IAAA,gBAAwB,OAAA,iDAE9B,CAAM;IAAC,gBAAA,sBAAA;KACJ,UAAA;KACC,MAAM;KACN,IAAA,WAAS;AACN,aAAQ;OAAC,gBAAK,OAAA,EACd,SAAQ,2QACV,CAAA;OAAA,gBAAA,iBAAA;QACD,MAAA;QACE,UAAW;QACX,MAAA;QACD,CAAK;OAAC,gBAAiB,SAAQ,EAAA,CAAA;OAAA,gBAAqB,OAAA;QACpD,SAAA;QACE,IAAM,WAAY;AAClB,gBAAA,gBAA6B,mBAAe;UACrC,IAAE,OAAA;AACH,kBAAS,eAAY;;UAEpB,cAAE;UACN,CAAA;;QAEF,CAAA;OAAA,gBAAK,iBAAA;QACN,MAAA;QACD,UAAA;QACD,MAAS;QACT,CAAK;OAAC;;KAEN,CAAC;IAAE,gBAAgB,SAAW,EAAA,CAAA;IAAA,gBAAuB,OAAI;KACxD,IAAE,UAAU;AACZ,aAAK,eAAA,YAAA,QAAA,CAAA;;KAEL,IAAA,WAAA;AACA,aAAA,gBAAA,YAAA;OACA,MAAA;OACI,UAAS,IAAA;OACb,CAAA;;KAED,CAAC;IAAE,gBAAkB,qBAAU;KAC9B,UAAU;KACV,WAAG;KACH,OAAM;KACN,MAAA;KACF,YAAc,CAAA;MACjB,MAAA;MACH,MAAA"}
1
+ {"version":3,"file":"changelog-command.mjs","names":[],"sources":[],"mappings":""}
@@ -1,4 +1,3 @@
1
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
1
  let _stryke_path_join = require("@stryke/path/join");
3
2
  let powerlines_plugin_utils = require("powerlines/plugin-utils");
4
3
  let _stryke_path = require("@stryke/path");
@@ -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":";;;;;;AAsBA,MAAM,4BAAM;CAAA;CAAA;CAAA;CAAA;AACZ,MAAE,uBAAsB;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AACxB,SAAE,qBAAA,SAAA,UAAA;AACA,MAAK,MAAI,OAAM,uIAEX,QAAA,UAAA,UAA2B,gBAAS,UAAiB,IAAI,CAAA;;;;;;;;;AAa/D,SAAY,iBAAA,SAAA,SAAA;CACV,IAAC,gBAAS,qBAAA,SAAA,QAAA,KAAA;AACV,KAAC,cACA,QAAQ;AAET,MAAG,MAAK,QAAA,sBAAA;;AAEV,MAAQ,cACN,QAAS;;AAGT,QAAK"}
1
+ {"version":3,"file":"resolve-changelog.mjs","names":[],"sources":[],"mappings":""}
package/dist/index.cjs CHANGED
@@ -19,7 +19,7 @@ let powerlines_plugin_utils = require("powerlines/plugin-utils");
19
19
  */
20
20
  const plugin = (options = {}) => {
21
21
  return {
22
- name: "shell-shock:changelog",
22
+ name: "shell-shock/changelog",
23
23
  config() {
24
24
  this.debug("Providing default configuration for the Shell Shock `changelog` plugin.");
25
25
  return { changelog: (0, defu.default)({ command: { name: (0, _stryke_type_checks_is_set_string.isSetString)(options.command) ? options.command : "changelog" } }, options) };
@@ -35,27 +35,28 @@ const plugin = (options = {}) => {
35
35
  this.inputs ??= [];
36
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
37
  else {
38
- this.inputs.push({
39
- id: this.config.changelog.command.name,
40
- path: this.config.changelog.command.name,
41
- segments: [this.config.changelog.command.name],
42
- title: "Changelog",
43
- icon: "🗃",
44
- tags: ["Utility"],
45
- description: `Display the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this)} changelog.`,
46
- entry: {
47
- file: (0, _stryke_path_join.joinPaths)(this.entryPath, "changelog", "index.ts"),
48
- input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "changelog", "command.ts") }
49
- },
50
- isVirtual: false,
51
- source: "changelog-plugin",
52
- ...this.config.changelog.command
53
- });
54
- this.debug("Rendering changelog command module for the Shell Shock `changelog` plugin.");
55
38
  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
- } }));
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.`);
59
60
  }
60
61
  }
61
62
  };
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
@@ -16,7 +16,7 @@ import { replacePathTokens } from "powerlines/plugin-utils";
16
16
  */
17
17
  const plugin = (options = {}) => {
18
18
  return {
19
- name: "shell-shock:changelog",
19
+ name: "shell-shock/changelog",
20
20
  config() {
21
21
  this.debug("Providing default configuration for the Shell Shock `changelog` plugin.");
22
22
  return { changelog: defu({ command: { name: isSetString(options.command) ? options.command : "changelog" } }, options) };
@@ -32,27 +32,28 @@ const plugin = (options = {}) => {
32
32
  this.inputs ??= [];
33
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
34
  else {
35
- this.inputs.push({
36
- id: this.config.changelog.command.name,
37
- path: this.config.changelog.command.name,
38
- segments: [this.config.changelog.command.name],
39
- title: "Changelog",
40
- icon: "🗃",
41
- tags: ["Utility"],
42
- description: `Display the ${getAppTitle(this)} changelog.`,
43
- entry: {
44
- file: joinPaths(this.entryPath, "changelog", "index.ts"),
45
- input: { file: joinPaths(this.entryPath, "changelog", "command.ts") }
46
- },
47
- isVirtual: false,
48
- source: "changelog-plugin",
49
- ...this.config.changelog.command
50
- });
51
- this.debug("Rendering changelog command module for the Shell Shock `changelog` plugin.");
52
35
  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
- } }));
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.`);
56
57
  }
57
58
  }
58
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 { 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":";;;;;;;;;;;;;;;;AA+BA,MAAU,UAAa,UAAA,EAAA,KAAA;;EAEvB,MAAO;;AAEL,QAAA,MAAA,0EAAA;AACI,UAAC,EACL,WAAA,KAAA,EACK,SAAY,EACR,MAAO,YAAC,QAAA,QAAyB,GAAA,QAAA,UAAA,aAC3C,EACQ,EAAE,QAAA,EACR;;EAEC,MAAM,iBAAa;AACnB,QAAO,MAAE,gEAAA;AACP,OAAI,CAAC,YAAK,KAAA,OAAA,UAAA,KAAA,CACR,MAAC,OAAU,UAAQ,OAAA,iBAA2B,MAAM,QAAE;+CAGxD,MAAO,OAAA,UAAA,OAAA,kBAAA,MAAA,KAAA,OAAA,UAAA,KAAA;AAEP,OAAI,CAAA,YAAA,KAAA,OAAA,UAAA,KAAA,IAAA,CAAA,KAAA,GAAA,WAAA,KAAA,OAAA,UAAA,KAAA,EAAA;AACF,SAAI,KAAA,+DAAS,KAAA,OAAA,UAAA,KAAA,UAAA,KAAA,OAAA,UAAA,QAAA,KAAA,+LAAA;AACb;;AAEF,QAAK,WAAA,EAAA;AACL,OAAI,KAAA,OAAA,MAAA,UAAA,MAAA,OAAA,KAAA,OAAA,UAAA,QAAA,KAAA,CACF,MAAA,KAAA,0MAAA;QACD;AACF,SAAA,OAAA,KAAA;KACK,IAAA,KAAA,OAAgB,UAAC,QAAA;KACjB,MAAM,KAAA,OAAA,UAAA,QAAA;KACP,UAAW,CAAA,KAAI,OAAS,UAAU,QAAO,KAAA;KAC3C,OAAA;;KAEG,MAAC,CAAA,UAAgB;KACnB,aAAY,eAAiB,YAAA,KAAiB,CAAA;KAChD,OAAA;;MAEI,OAAA,EACG,MAAO,UAAU,KAAK,WAAE,aAAiB,aAAA,EAC5C;MACA;KACD,WAAA;KACH,QAAA;;KAEG,CAAA;AACD,SAAC,MAAA,6EAAyC;IAC1C,MAAM,UAAG,MAAW,KAAK,GAAA,KAAO,KAAA,OAAc,UAAA,KAAA;AAC9C,QAAA,QACA,OAAK,OAAI,MAAA,gBAAA,kBAAA,EACN,IAAI,YAAU;AACb,YAAK,eAAiB,QAAA;OAEvB,CAAC,CAAA;;;EAIT"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":[],"mappings":""}
@@ -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":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/plugin-changelog",
3
- "version": "0.1.13",
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.64",
129
- "@powerlines/plugin-alloy": "^0.26.84",
130
- "@powerlines/plugin-plugin": "^0.12.416",
131
- "@shell-shock/core": "^0.17.10",
132
- "@shell-shock/unified": "^0.2.8",
133
- "@stryke/path": "^0.28.2",
134
- "@stryke/type-checks": "^0.6.5",
135
- "@stryke/types": "^0.12.0",
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.47.4"
135
+ "powerlines": "^0.47.124"
138
136
  },
139
137
  "devDependencies": {
140
- "@powerlines/plugin-deepkit": "^0.11.347",
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": "7b4030fd6be000c960e8cc4c4f7b4db205054e69"
142
+ "gitHead": "9401c1de122d800040306fc89ad1835930c1a826"
145
143
  }