@shell-shock/preset-cli 0.9.14 → 0.9.16

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.
Files changed (40) hide show
  1. package/dist/components/command-entry.cjs +4 -7
  2. package/dist/components/command-entry.mjs +4 -7
  3. package/dist/components/command-entry.mjs.map +1 -1
  4. package/dist/components/command-router.cjs +4 -2
  5. package/dist/components/command-router.mjs +4 -2
  6. package/dist/components/command-router.mjs.map +1 -1
  7. package/dist/components/upgrade-builtin.cjs +6 -0
  8. package/dist/components/upgrade-builtin.d.cts.map +1 -1
  9. package/dist/components/upgrade-builtin.d.mts.map +1 -1
  10. package/dist/components/upgrade-builtin.mjs +6 -0
  11. package/dist/components/upgrade-builtin.mjs.map +1 -1
  12. package/dist/components/virtual-command-entry.cjs +2 -5
  13. package/dist/components/virtual-command-entry.mjs +2 -5
  14. package/dist/components/virtual-command-entry.mjs.map +1 -1
  15. package/dist/index.cjs +2 -5
  16. package/dist/index.mjs +2 -5
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/packages/plugin-changelog/dist/components/changelog-command.cjs +3 -3
  19. package/dist/packages/plugin-changelog/dist/components/changelog-command.mjs +2 -2
  20. package/dist/packages/plugin-changelog/dist/components/changelog-command.mjs.map +1 -1
  21. package/dist/packages/plugin-changelog/dist/helpers/resolve-changelog.cjs +51 -0
  22. package/dist/packages/plugin-changelog/dist/helpers/resolve-changelog.mjs +51 -0
  23. package/dist/packages/plugin-changelog/dist/helpers/resolve-changelog.mjs.map +1 -0
  24. package/dist/packages/plugin-changelog/dist/index.cjs +33 -21
  25. package/dist/packages/plugin-changelog/dist/index.mjs +32 -20
  26. package/dist/packages/plugin-changelog/dist/index.mjs.map +1 -1
  27. package/dist/packages/plugin-changelog/dist/types/plugin.d.cts +48 -0
  28. package/dist/packages/plugin-changelog/dist/types/plugin.d.cts.map +1 -1
  29. package/dist/packages/plugin-changelog/dist/types/plugin.d.mts +48 -0
  30. package/dist/packages/plugin-changelog/dist/types/plugin.d.mts.map +1 -1
  31. package/dist/packages/unified/dist/{html-Dw6VvFHa.cjs → html-BwC2s0z0.cjs} +44 -44
  32. package/dist/packages/unified/dist/{html-Dw6VvFHa.mjs → html-BwC2s0z0.mjs} +45 -45
  33. package/dist/packages/unified/dist/html-BwC2s0z0.mjs.map +1 -0
  34. package/dist/packages/unified/dist/markdown/index.cjs +1 -1
  35. package/dist/packages/unified/dist/markdown/index.mjs +1 -1
  36. package/dist/packages/unified/dist/{markdown-BGGlzivq.cjs → markdown-D89Le-_6.cjs} +3 -3
  37. package/dist/packages/unified/dist/{markdown-BGGlzivq.mjs → markdown-D89Le-_6.mjs} +4 -4
  38. package/dist/packages/unified/dist/{markdown-BGGlzivq.mjs.map → markdown-D89Le-_6.mjs.map} +1 -1
  39. package/package.json +15 -15
  40. package/dist/packages/unified/dist/html-Dw6VvFHa.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  const require_runtime = require('../../../../_virtual/_rolldown/runtime.cjs');
2
- const require_markdown_BGGlzivq = require('../../../unified/dist/markdown-BGGlzivq.cjs');
2
+ const require_markdown_D89Le__6 = require('../../../unified/dist/markdown-D89Le-_6.cjs');
3
3
  require('../../../unified/dist/markdown/index.cjs');
4
4
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
5
  let _alloy_js_core = require("@alloy-js/core");
@@ -21,7 +21,7 @@ function ChangelogCommand() {
21
21
  const result = (0, _alloy_js_core.createResource)(async () => {
22
22
  const content = await context.fs.read(context.config.changelog.file);
23
23
  if (!content) return null;
24
- return require_markdown_BGGlzivq.g(content);
24
+ return require_markdown_D89Le__6.g(content);
25
25
  });
26
26
  return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript.TypescriptFile, {
27
27
  get path() {
@@ -104,7 +104,7 @@ function ChangelogCommand() {
104
104
  return !!result.error;
105
105
  },
106
106
  get children() {
107
- return _alloy_js_core.code` return error(\`Failed to load changelog: ${result.error.message.replaceAll(/`/g, "\\`")}\`); `;
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
108
  }
109
109
  });
110
110
  },
@@ -1,4 +1,4 @@
1
- import { g } from "../../../unified/dist/markdown-BGGlzivq.mjs";
1
+ import { g } from "../../../unified/dist/markdown-D89Le-_6.mjs";
2
2
  import "../../../unified/dist/markdown/index.mjs";
3
3
  import { createComponent } from "@alloy-js/core/jsx-runtime";
4
4
  import { Show, code, createResource } from "@alloy-js/core";
@@ -103,7 +103,7 @@ function ChangelogCommand() {
103
103
  return !!result.error;
104
104
  },
105
105
  get children() {
106
- return code` return error(\`Failed to load changelog: ${result.error.message.replaceAll(/`/g, "\\`")}\`); `;
106
+ return code` return error(\`Failed to load changelog: ${result.error.message.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("${", "\\${").replaceAll("\n", "\\n").replaceAll("\r", "\\r").replaceAll(" ", "\\t")}\`); `;
107
107
  }
108
108
  });
109
109
  },
@@ -1 +1 @@
1
- {"version":3,"file":"changelog-command.mjs","names":["renderMarkdown"],"sources":["../../../../../../plugin-changelog/dist/components/changelog-command.mjs"],"sourcesContent":["import { createComponent } from \"@alloy-js/core/jsx-runtime\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { Show, code, createResource } from \"@alloy-js/core\";\nimport { FunctionDeclaration, InterfaceDeclaration } 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 { InterfaceMember, TypescriptFile } from \"@powerlines/plugin-alloy/typescript\";\nimport { TSDoc, TSDocDefaultValue, TSDocParam } from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { renderMarkdown } from \"@shell-shock/unified/markdown\";\nimport { joinPaths } from \"@stryke/path\";\n\n//#region src/components/changelog-command.tsx\n/**\n* The Changelog command's handler wrapper for the Shell Shock project.\n*/\nfunction ChangelogCommand() {\n\tconst context = usePowerlines();\n\tconst result = createResource(async () => {\n\t\tconst content = await context.fs.read(context.config.changelog.file);\n\t\tif (!content) return null;\n\t\treturn renderMarkdown(content);\n\t});\n\treturn createComponent(TypescriptFile, {\n\t\tget path() {\n\t\t\treturn joinPaths(context.entryPath, \"changelog\", \"command.ts\");\n\t\t},\n\t\timports: {\n\t\t\t\"node:os\": \"os\",\n\t\t\t\"node:fs/promises\": [\"readFile\", \"writeFile\"]\n\t\t},\n\t\tbuiltinImports: { console: [\n\t\t\t\"textColors\",\n\t\t\t\"bold\",\n\t\t\t\"writeLine\",\n\t\t\t\"error\",\n\t\t\t\"warn\"\n\t\t] },\n\t\tget children() {\n\t\t\treturn [\n\t\t\t\tcreateComponent(TSDoc, { heading: \"Options for the Changelog command.\" }),\n\t\t\t\tcreateComponent(InterfaceDeclaration, {\n\t\t\t\t\t\"export\": true,\n\t\t\t\t\tname: \"ChangelogOptions\",\n\t\t\t\t\tget children() {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tcreateComponent(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\t\t\t\t\t\t\tcreateComponent(InterfaceMember, {\n\t\t\t\t\t\t\t\tname: \"start\",\n\t\t\t\t\t\t\t\toptional: true,\n\t\t\t\t\t\t\t\ttype: \"string\"\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\t\t\t\tcreateComponent(TSDoc, {\n\t\t\t\t\t\t\t\theading: \"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\t\t\t\t\t\t\t\tget children() {\n\t\t\t\t\t\t\t\t\treturn createComponent(TSDocDefaultValue, {\n\t\t\t\t\t\t\t\t\t\tget type() {\n\t\t\t\t\t\t\t\t\t\t\treturn ReflectionKind.string;\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tdefaultValue: \"latest\"\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcreateComponent(InterfaceMember, {\n\t\t\t\t\t\t\t\tname: \"end\",\n\t\t\t\t\t\t\t\toptional: true,\n\t\t\t\t\t\t\t\ttype: \"string\"\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\tcreateComponent(TSDoc, {\n\t\t\t\t\tget heading() {\n\t\t\t\t\t\treturn `Display the ${getAppTitle(context)} changelog.`;\n\t\t\t\t\t},\n\t\t\t\t\tget children() {\n\t\t\t\t\t\treturn createComponent(TSDocParam, {\n\t\t\t\t\t\t\tname: \"options\",\n\t\t\t\t\t\t\tchildren: code`An object containing options for displaying the changelog.`\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tcreateComponent(FunctionDeclaration, {\n\t\t\t\t\t\"export\": true,\n\t\t\t\t\t\"default\": true,\n\t\t\t\t\tasync: true,\n\t\t\t\t\tname: \"handler\",\n\t\t\t\t\tparameters: [{\n\t\t\t\t\t\tname: \"options\",\n\t\t\t\t\t\ttype: \"ChangelogOptions\"\n\t\t\t\t\t}],\n\t\t\t\t\tget children() {\n\t\t\t\t\t\treturn createComponent(Show, {\n\t\t\t\t\t\t\tget when() {\n\t\t\t\t\t\t\t\treturn !result.loading && !result.error;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tget fallback() {\n\t\t\t\t\t\t\t\treturn createComponent(Show, {\n\t\t\t\t\t\t\t\t\tget when() {\n\t\t\t\t\t\t\t\t\t\treturn !!result.error;\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tget children() {\n\t\t\t\t\t\t\t\t\t\treturn code` return error(\\`Failed to load changelog: ${result.error.message.replaceAll(/`/g, \"\\\\`\")}\\`); `;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tget children() {\n\t\t\t\t\t\t\t\treturn createComponent(Show, {\n\t\t\t\t\t\t\t\t\tget when() {\n\t\t\t\t\t\t\t\t\t\treturn !!result.data;\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tfallback: code` return warn(\"There is no changelog available for display.\"); `,\n\t\t\t\t\t\t\t\t\tget children() {\n\t\t\t\t\t\t\t\t\t\treturn result.data;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t];\n\t\t}\n\t});\n}\n\n//#endregion\nexport { ChangelogCommand };\n//# sourceMappingURL=changelog-command.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,SAAS,mBAAmB;CAC3B,MAAM,UAAU,eAAe;CAC/B,MAAM,SAAS,eAAe,YAAY;EACzC,MAAM,UAAU,MAAM,QAAQ,GAAG,KAAK,QAAQ,OAAO,UAAU,KAAK;AACpE,MAAI,CAAC,QAAS,QAAO;AACrB,SAAOA,EAAe,QAAQ;GAC7B;AACF,QAAO,gBAAgB,gBAAgB;EACtC,IAAI,OAAO;AACV,UAAO,UAAU,QAAQ,WAAW,aAAa,aAAa;;EAE/D,SAAS;GACR,WAAW;GACX,oBAAoB,CAAC,YAAY,YAAY;GAC7C;EACD,gBAAgB,EAAE,SAAS;GAC1B;GACA;GACA;GACA;GACA;GACA,EAAE;EACH,IAAI,WAAW;AACd,UAAO;IACN,gBAAgB,OAAO,EAAE,SAAS,sCAAsC,CAAC;IACzE,gBAAgB,sBAAsB;KACrC,UAAU;KACV,MAAM;KACN,IAAI,WAAW;AACd,aAAO;OACN,gBAAgB,OAAO,EAAE,SAAS,2QAA2Q,CAAC;OAC9S,gBAAgB,iBAAiB;QAChC,MAAM;QACN,UAAU;QACV,MAAM;QACN,CAAC;OACF,gBAAgB,SAAS,EAAE,CAAC;OAC5B,gBAAgB,OAAO;QACtB,SAAS;QACT,IAAI,WAAW;AACd,gBAAO,gBAAgB,mBAAmB;UACzC,IAAI,OAAO;AACV,kBAAO,eAAe;;UAEvB,cAAc;UACd,CAAC;;QAEH,CAAC;OACF,gBAAgB,iBAAiB;QAChC,MAAM;QACN,UAAU;QACV,MAAM;QACN,CAAC;OACF;;KAEF,CAAC;IACF,gBAAgB,SAAS,EAAE,CAAC;IAC5B,gBAAgB,OAAO;KACtB,IAAI,UAAU;AACb,aAAO,eAAe,YAAY,QAAQ,CAAC;;KAE5C,IAAI,WAAW;AACd,aAAO,gBAAgB,YAAY;OAClC,MAAM;OACN,UAAU,IAAI;OACd,CAAC;;KAEH,CAAC;IACF,gBAAgB,qBAAqB;KACpC,UAAU;KACV,WAAW;KACX,OAAO;KACP,MAAM;KACN,YAAY,CAAC;MACZ,MAAM;MACN,MAAM;MACN,CAAC;KACF,IAAI,WAAW;AACd,aAAO,gBAAgB,MAAM;OAC5B,IAAI,OAAO;AACV,eAAO,CAAC,OAAO,WAAW,CAAC,OAAO;;OAEnC,IAAI,WAAW;AACd,eAAO,gBAAgB,MAAM;SAC5B,IAAI,OAAO;AACV,iBAAO,CAAC,CAAC,OAAO;;SAEjB,IAAI,WAAW;AACd,iBAAO,IAAI,6CAA6C,OAAO,MAAM,QAAQ,WAAW,MAAM,MAAM,CAAC;;SAEtG,CAAC;;OAEH,IAAI,WAAW;AACd,eAAO,gBAAgB,MAAM;SAC5B,IAAI,OAAO;AACV,iBAAO,CAAC,CAAC,OAAO;;SAEjB,UAAU,IAAI;SACd,IAAI,WAAW;AACd,iBAAO,OAAO;;SAEf,CAAC;;OAEH,CAAC;;KAEH,CAAC;IACF;;EAEF,CAAC"}
1
+ {"version":3,"file":"changelog-command.mjs","names":["renderMarkdown"],"sources":["../../../../../../plugin-changelog/dist/components/changelog-command.mjs"],"sourcesContent":["import { createComponent } from \"@alloy-js/core/jsx-runtime\";\nimport { getAppTitle } from \"@shell-shock/core/plugin-utils\";\nimport { Show, code, createResource } from \"@alloy-js/core\";\nimport { FunctionDeclaration, InterfaceDeclaration } 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 { InterfaceMember, TypescriptFile } from \"@powerlines/plugin-alloy/typescript\";\nimport { TSDoc, TSDocDefaultValue, TSDocParam } from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { renderMarkdown } from \"@shell-shock/unified/markdown\";\nimport { joinPaths } from \"@stryke/path\";\n\n//#region src/components/changelog-command.tsx\n/**\n* The Changelog command's handler wrapper for the Shell Shock project.\n*/\nfunction ChangelogCommand() {\n\tconst context = usePowerlines();\n\tconst result = createResource(async () => {\n\t\tconst content = await context.fs.read(context.config.changelog.file);\n\t\tif (!content) return null;\n\t\treturn renderMarkdown(content);\n\t});\n\treturn createComponent(TypescriptFile, {\n\t\tget path() {\n\t\t\treturn joinPaths(context.entryPath, \"changelog\", \"command.ts\");\n\t\t},\n\t\timports: {\n\t\t\t\"node:os\": \"os\",\n\t\t\t\"node:fs/promises\": [\"readFile\", \"writeFile\"]\n\t\t},\n\t\tbuiltinImports: { console: [\n\t\t\t\"textColors\",\n\t\t\t\"bold\",\n\t\t\t\"writeLine\",\n\t\t\t\"error\",\n\t\t\t\"warn\"\n\t\t] },\n\t\tget children() {\n\t\t\treturn [\n\t\t\t\tcreateComponent(TSDoc, { heading: \"Options for the Changelog command.\" }),\n\t\t\t\tcreateComponent(InterfaceDeclaration, {\n\t\t\t\t\t\"export\": true,\n\t\t\t\t\tname: \"ChangelogOptions\",\n\t\t\t\t\tget children() {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tcreateComponent(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\t\t\t\t\t\t\tcreateComponent(InterfaceMember, {\n\t\t\t\t\t\t\t\tname: \"start\",\n\t\t\t\t\t\t\t\toptional: true,\n\t\t\t\t\t\t\t\ttype: \"string\"\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\t\t\t\tcreateComponent(TSDoc, {\n\t\t\t\t\t\t\t\theading: \"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\t\t\t\t\t\t\t\tget children() {\n\t\t\t\t\t\t\t\t\treturn createComponent(TSDocDefaultValue, {\n\t\t\t\t\t\t\t\t\t\tget type() {\n\t\t\t\t\t\t\t\t\t\t\treturn ReflectionKind.string;\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tdefaultValue: \"latest\"\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcreateComponent(InterfaceMember, {\n\t\t\t\t\t\t\t\tname: \"end\",\n\t\t\t\t\t\t\t\toptional: true,\n\t\t\t\t\t\t\t\ttype: \"string\"\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tcreateComponent(Spacing, {}),\n\t\t\t\tcreateComponent(TSDoc, {\n\t\t\t\t\tget heading() {\n\t\t\t\t\t\treturn `Display the ${getAppTitle(context)} changelog.`;\n\t\t\t\t\t},\n\t\t\t\t\tget children() {\n\t\t\t\t\t\treturn createComponent(TSDocParam, {\n\t\t\t\t\t\t\tname: \"options\",\n\t\t\t\t\t\t\tchildren: code`An object containing options for displaying the changelog.`\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tcreateComponent(FunctionDeclaration, {\n\t\t\t\t\t\"export\": true,\n\t\t\t\t\t\"default\": true,\n\t\t\t\t\tasync: true,\n\t\t\t\t\tname: \"handler\",\n\t\t\t\t\tparameters: [{\n\t\t\t\t\t\tname: \"options\",\n\t\t\t\t\t\ttype: \"ChangelogOptions\"\n\t\t\t\t\t}],\n\t\t\t\t\tget children() {\n\t\t\t\t\t\treturn createComponent(Show, {\n\t\t\t\t\t\t\tget when() {\n\t\t\t\t\t\t\t\treturn !result.loading && !result.error;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tget fallback() {\n\t\t\t\t\t\t\t\treturn createComponent(Show, {\n\t\t\t\t\t\t\t\t\tget when() {\n\t\t\t\t\t\t\t\t\t\treturn !!result.error;\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tget children() {\n\t\t\t\t\t\t\t\t\t\treturn code` return error(\\`Failed to load changelog: ${result.error.message.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll(\"`\", \"\\\\`\").replaceAll(\"${\", \"\\\\${\").replaceAll(\"\\n\", \"\\\\n\").replaceAll(\"\\r\", \"\\\\r\").replaceAll(\"\t\", \"\\\\t\")}\\`); `;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tget children() {\n\t\t\t\t\t\t\t\treturn createComponent(Show, {\n\t\t\t\t\t\t\t\t\tget when() {\n\t\t\t\t\t\t\t\t\t\treturn !!result.data;\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tfallback: code` return warn(\"There is no changelog available for display.\"); `,\n\t\t\t\t\t\t\t\t\tget children() {\n\t\t\t\t\t\t\t\t\t\treturn result.data;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t];\n\t\t}\n\t});\n}\n\n//#endregion\nexport { ChangelogCommand };\n//# sourceMappingURL=changelog-command.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,SAAS,mBAAmB;CAC3B,MAAM,UAAU,eAAe;CAC/B,MAAM,SAAS,eAAe,YAAY;EACzC,MAAM,UAAU,MAAM,QAAQ,GAAG,KAAK,QAAQ,OAAO,UAAU,KAAK;AACpE,MAAI,CAAC,QAAS,QAAO;AACrB,SAAOA,EAAe,QAAQ;GAC7B;AACF,QAAO,gBAAgB,gBAAgB;EACtC,IAAI,OAAO;AACV,UAAO,UAAU,QAAQ,WAAW,aAAa,aAAa;;EAE/D,SAAS;GACR,WAAW;GACX,oBAAoB,CAAC,YAAY,YAAY;GAC7C;EACD,gBAAgB,EAAE,SAAS;GAC1B;GACA;GACA;GACA;GACA;GACA,EAAE;EACH,IAAI,WAAW;AACd,UAAO;IACN,gBAAgB,OAAO,EAAE,SAAS,sCAAsC,CAAC;IACzE,gBAAgB,sBAAsB;KACrC,UAAU;KACV,MAAM;KACN,IAAI,WAAW;AACd,aAAO;OACN,gBAAgB,OAAO,EAAE,SAAS,2QAA2Q,CAAC;OAC9S,gBAAgB,iBAAiB;QAChC,MAAM;QACN,UAAU;QACV,MAAM;QACN,CAAC;OACF,gBAAgB,SAAS,EAAE,CAAC;OAC5B,gBAAgB,OAAO;QACtB,SAAS;QACT,IAAI,WAAW;AACd,gBAAO,gBAAgB,mBAAmB;UACzC,IAAI,OAAO;AACV,kBAAO,eAAe;;UAEvB,cAAc;UACd,CAAC;;QAEH,CAAC;OACF,gBAAgB,iBAAiB;QAChC,MAAM;QACN,UAAU;QACV,MAAM;QACN,CAAC;OACF;;KAEF,CAAC;IACF,gBAAgB,SAAS,EAAE,CAAC;IAC5B,gBAAgB,OAAO;KACtB,IAAI,UAAU;AACb,aAAO,eAAe,YAAY,QAAQ,CAAC;;KAE5C,IAAI,WAAW;AACd,aAAO,gBAAgB,YAAY;OAClC,MAAM;OACN,UAAU,IAAI;OACd,CAAC;;KAEH,CAAC;IACF,gBAAgB,qBAAqB;KACpC,UAAU;KACV,WAAW;KACX,OAAO;KACP,MAAM;KACN,YAAY,CAAC;MACZ,MAAM;MACN,MAAM;MACN,CAAC;KACF,IAAI,WAAW;AACd,aAAO,gBAAgB,MAAM;OAC5B,IAAI,OAAO;AACV,eAAO,CAAC,OAAO,WAAW,CAAC,OAAO;;OAEnC,IAAI,WAAW;AACd,eAAO,gBAAgB,MAAM;SAC5B,IAAI,OAAO;AACV,iBAAO,CAAC,CAAC,OAAO;;SAEjB,IAAI,WAAW;AACd,iBAAO,IAAI,6CAA6C,OAAO,MAAM,QAAQ,WAAW,MAAM,OAAO,CAAC,WAAW,KAAK,MAAM,CAAC,WAAW,MAAM,OAAO,CAAC,WAAW,MAAM,MAAM,CAAC,WAAW,MAAM,MAAM,CAAC,WAAW,KAAK,MAAM,CAAC;;SAE9N,CAAC;;OAEH,IAAI,WAAW;AACd,eAAO,gBAAgB,MAAM;SAC5B,IAAI,OAAO;AACV,iBAAO,CAAC,CAAC,OAAO;;SAEjB,UAAU,IAAI;SACd,IAAI,WAAW;AACd,iBAAO,OAAO;;SAEf,CAAC;;OAEH,CAAC;;KAEH,CAAC;IACF;;EAEF,CAAC"}
@@ -0,0 +1,51 @@
1
+ const require_runtime = require('../../../../_virtual/_rolldown/runtime.cjs');
2
+ let _stryke_path = require("@stryke/path");
3
+ let _stryke_path_join = require("@stryke/path/join");
4
+ let powerlines_plugin_utils = require("powerlines/plugin-utils");
5
+ let node_fs = require("node:fs");
6
+
7
+ //#region ../plugin-changelog/dist/helpers/resolve-changelog.mjs
8
+ const CHANGELOG_FILE_EXTENSIONS = [
9
+ "md",
10
+ "markdown",
11
+ "txt"
12
+ ];
13
+ const CHANGELOG_FILE_NAMES = [
14
+ "CHANGELOG",
15
+ "changelog",
16
+ "Changelog",
17
+ "RELEASE-NOTES",
18
+ "release-notes",
19
+ "Release-Notes",
20
+ "RELEASE_NOTES",
21
+ "release_notes",
22
+ "Release_Notes",
23
+ "RELEASES",
24
+ "releases",
25
+ "Releases",
26
+ "HISTORY",
27
+ "history",
28
+ "History"
29
+ ];
30
+ function resolveChangelogFile(context, fileName) {
31
+ for (const ext of CHANGELOG_FILE_EXTENSIONS) if (fileName && (0, node_fs.existsSync)((0, powerlines_plugin_utils.replacePathTokens)(context, (0, _stryke_path_join.joinPaths)("{root}", (0, _stryke_path.appendExtension)(fileName, ext))))) return (0, _stryke_path_join.joinPaths)("{root}", (0, _stryke_path.appendExtension)(fileName, ext));
32
+ }
33
+ /**
34
+ * Resolves the path to the changelog file based on the provided options and context. If a specific file is provided in the options, it will attempt to resolve that file first. If not, it will look for common changelog file names in the application's root directory.
35
+ *
36
+ * @param context - The unresolved context of the plugin, which includes information about the application's root directory and other relevant data for resolving paths.
37
+ * @param options - The options provided for the changelog plugin, which may include a specific file name to look for.
38
+ * @returns The resolved path to the changelog file if found, or undefined if no valid changelog file could be resolved.
39
+ */
40
+ function resolveChangelog(context, options) {
41
+ let changelogFile = resolveChangelogFile(context, options.file);
42
+ if (changelogFile) return changelogFile;
43
+ for (const name of CHANGELOG_FILE_NAMES) {
44
+ changelogFile = resolveChangelogFile(context, name);
45
+ if (changelogFile) return changelogFile;
46
+ }
47
+ return changelogFile;
48
+ }
49
+
50
+ //#endregion
51
+ exports.resolveChangelog = resolveChangelog;
@@ -0,0 +1,51 @@
1
+ import { appendExtension } from "@stryke/path";
2
+ import { joinPaths as joinPaths$1 } from "@stryke/path/join";
3
+ import { replacePathTokens } from "powerlines/plugin-utils";
4
+ import { existsSync } from "node:fs";
5
+
6
+ //#region ../plugin-changelog/dist/helpers/resolve-changelog.mjs
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$1("{root}", appendExtension(fileName, ext))))) return joinPaths$1("{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 };
51
+ //# sourceMappingURL=resolve-changelog.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-changelog.mjs","names":["joinPaths"],"sources":["../../../../../../plugin-changelog/dist/helpers/resolve-changelog.mjs"],"sourcesContent":["import { joinPaths } from \"@stryke/path/join\";\nimport { replacePathTokens } from \"powerlines/plugin-utils\";\nimport { appendExtension } from \"@stryke/path\";\nimport { existsSync } from \"node:fs\";\n\n//#region src/helpers/resolve-changelog.ts\nconst CHANGELOG_FILE_EXTENSIONS = [\n\t\"md\",\n\t\"markdown\",\n\t\"txt\"\n];\nconst CHANGELOG_FILE_NAMES = [\n\t\"CHANGELOG\",\n\t\"changelog\",\n\t\"Changelog\",\n\t\"RELEASE-NOTES\",\n\t\"release-notes\",\n\t\"Release-Notes\",\n\t\"RELEASE_NOTES\",\n\t\"release_notes\",\n\t\"Release_Notes\",\n\t\"RELEASES\",\n\t\"releases\",\n\t\"Releases\",\n\t\"HISTORY\",\n\t\"history\",\n\t\"History\"\n];\nfunction resolveChangelogFile(context, fileName) {\n\tfor (const ext of CHANGELOG_FILE_EXTENSIONS) if (fileName && existsSync(replacePathTokens(context, joinPaths(\"{root}\", appendExtension(fileName, ext))))) return joinPaths(\"{root}\", appendExtension(fileName, ext));\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*/\nfunction resolveChangelog(context, options) {\n\tlet changelogFile = resolveChangelogFile(context, options.file);\n\tif (changelogFile) return changelogFile;\n\tfor (const name of CHANGELOG_FILE_NAMES) {\n\t\tchangelogFile = resolveChangelogFile(context, name);\n\t\tif (changelogFile) return changelogFile;\n\t}\n\treturn changelogFile;\n}\n\n//#endregion\nexport { resolveChangelog };\n//# sourceMappingURL=resolve-changelog.mjs.map"],"mappings":";;;;;;AAMA,MAAM,4BAA4B;CACjC;CACA;CACA;CACA;AACD,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,SAAS,qBAAqB,SAAS,UAAU;AAChD,MAAK,MAAM,OAAO,0BAA2B,KAAI,YAAY,WAAW,kBAAkB,SAASA,YAAU,UAAU,gBAAgB,UAAU,IAAI,CAAC,CAAC,CAAC,CAAE,QAAOA,YAAU,UAAU,gBAAgB,UAAU,IAAI,CAAC;;;;;;;;;AASrN,SAAS,iBAAiB,SAAS,SAAS;CAC3C,IAAI,gBAAgB,qBAAqB,SAAS,QAAQ,KAAK;AAC/D,KAAI,cAAe,QAAO;AAC1B,MAAK,MAAM,QAAQ,sBAAsB;AACxC,kBAAgB,qBAAqB,SAAS,KAAK;AACnD,MAAI,cAAe,QAAO;;AAE3B,QAAO"}
@@ -1,14 +1,15 @@
1
1
  const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
2
2
  const require_changelog_command = require('./components/changelog-command.cjs');
3
3
  require('./components/index.cjs');
4
+ const require_resolve_changelog = require('./helpers/resolve-changelog.cjs');
4
5
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
6
  let _powerlines_plugin_alloy_render = require("@powerlines/plugin-alloy/render");
6
7
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
7
8
  let _stryke_path_join = require("@stryke/path/join");
9
+ let powerlines_plugin_utils = require("powerlines/plugin-utils");
8
10
  let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
9
11
  let defu = require("defu");
10
- defu = require_runtime.__toESM(defu);
11
- let powerlines_plugin_utils = require("powerlines/plugin-utils");
12
+ defu = require_runtime.__toESM(defu, 1);
12
13
 
13
14
  //#region ../plugin-changelog/dist/index.mjs
14
15
  /**
@@ -19,30 +20,41 @@ const plugin = (options = {}) => {
19
20
  name: "shell-shock:changelog",
20
21
  config() {
21
22
  this.debug("Providing default configuration for the Shell Shock `changelog` plugin.");
22
- return { changelog: (0, defu.default)({ command: { name: (0, _stryke_type_checks_is_set_string.isSetString)(options.command) ? options.command : "changelog" } }, options, { file: (0, _stryke_path_join.joinPaths)("{root}", "CHANGELOG.md") }) };
23
+ return { changelog: (0, defu.default)({
24
+ file: require_resolve_changelog.resolveChangelog(this, options),
25
+ command: { name: (0, _stryke_type_checks_is_set_string.isSetString)(options.command) ? options.command : "changelog" }
26
+ }, options) };
23
27
  },
24
28
  configResolved() {
25
29
  this.debug("Adding the CLI changelog commands to the application context.");
26
- this.config.changelog.file = (0, powerlines_plugin_utils.replacePathTokens)(this, this.config.changelog.file);
27
- this.inputs ??= [];
28
- 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.");
29
- else this.inputs.push({
30
- id: this.config.changelog.command.name,
31
- path: this.config.changelog.command.name,
32
- segments: [this.config.changelog.command.name],
33
- title: "Changelog",
34
- icon: "🗃",
35
- tags: ["Utility"],
36
- description: `Display the ${(0, _shell_shock_core_plugin_utils.getAppTitle)(this)} changelog.`,
37
- entry: {
38
- file: (0, _stryke_path_join.joinPaths)(this.entryPath, "changelog", "index.ts"),
39
- input: { file: (0, _stryke_path_join.joinPaths)(this.entryPath, "changelog", "command.ts") }
40
- },
41
- isVirtual: false,
42
- ...this.config.changelog.command
43
- });
30
+ if ((0, _stryke_type_checks_is_set_string.isSetString)(this.config.changelog.file)) {
31
+ this.config.changelog.file = (0, powerlines_plugin_utils.replacePathTokens)(this, this.config.changelog.file);
32
+ if (!this.fs.existsSync(this.config.changelog.file)) {
33
+ 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.`);
34
+ return;
35
+ }
36
+ this.inputs ??= [];
37
+ 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.");
38
+ else 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
+ }
44
55
  },
45
56
  async prepare() {
57
+ if ((0, _stryke_type_checks_is_set_string.isSetString)(this.config.changelog.file) && !this.fs.existsSync(this.config.changelog.file)) return;
46
58
  this.debug("Rendering changelog command module for the Shell Shock `changelog` plugin.");
47
59
  return (0, _powerlines_plugin_alloy_render.render)(this, (0, _alloy_js_core_jsx_runtime.createComponent)(require_changelog_command.ChangelogCommand, {}));
48
60
  }
@@ -1,12 +1,13 @@
1
1
  import { ChangelogCommand } from "./components/changelog-command.mjs";
2
2
  import "./components/index.mjs";
3
+ import { resolveChangelog } from "./helpers/resolve-changelog.mjs";
3
4
  import { createComponent } from "@alloy-js/core/jsx-runtime";
4
5
  import { render } from "@powerlines/plugin-alloy/render";
5
6
  import { getAppTitle } from "@shell-shock/core/plugin-utils";
6
7
  import { joinPaths } from "@stryke/path/join";
8
+ import { replacePathTokens } from "powerlines/plugin-utils";
7
9
  import { isSetString } from "@stryke/type-checks/is-set-string";
8
10
  import defu from "defu";
9
- import { replacePathTokens } from "powerlines/plugin-utils";
10
11
 
11
12
  //#region ../plugin-changelog/dist/index.mjs
12
13
  /**
@@ -17,30 +18,41 @@ const plugin = (options = {}) => {
17
18
  name: "shell-shock:changelog",
18
19
  config() {
19
20
  this.debug("Providing default configuration for the Shell Shock `changelog` plugin.");
20
- return { changelog: defu({ command: { name: isSetString(options.command) ? options.command : "changelog" } }, options, { file: joinPaths("{root}", "CHANGELOG.md") }) };
21
+ return { changelog: defu({
22
+ file: resolveChangelog(this, options),
23
+ command: { name: isSetString(options.command) ? options.command : "changelog" }
24
+ }, options) };
21
25
  },
22
26
  configResolved() {
23
27
  this.debug("Adding the CLI changelog commands to the application context.");
24
- this.config.changelog.file = replacePathTokens(this, this.config.changelog.file);
25
- this.inputs ??= [];
26
- 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.");
27
- else this.inputs.push({
28
- id: this.config.changelog.command.name,
29
- path: this.config.changelog.command.name,
30
- segments: [this.config.changelog.command.name],
31
- title: "Changelog",
32
- icon: "🗃",
33
- tags: ["Utility"],
34
- description: `Display the ${getAppTitle(this)} changelog.`,
35
- entry: {
36
- file: joinPaths(this.entryPath, "changelog", "index.ts"),
37
- input: { file: joinPaths(this.entryPath, "changelog", "command.ts") }
38
- },
39
- isVirtual: false,
40
- ...this.config.changelog.command
41
- });
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({
37
+ id: this.config.changelog.command.name,
38
+ path: this.config.changelog.command.name,
39
+ segments: [this.config.changelog.command.name],
40
+ title: "Changelog",
41
+ icon: "🗃",
42
+ tags: ["Utility"],
43
+ description: `Display the ${getAppTitle(this)} changelog.`,
44
+ entry: {
45
+ file: joinPaths(this.entryPath, "changelog", "index.ts"),
46
+ input: { file: joinPaths(this.entryPath, "changelog", "command.ts") }
47
+ },
48
+ isVirtual: false,
49
+ source: "changelog-plugin",
50
+ ...this.config.changelog.command
51
+ });
52
+ }
42
53
  },
43
54
  async prepare() {
55
+ if (isSetString(this.config.changelog.file) && !this.fs.existsSync(this.config.changelog.file)) return;
44
56
  this.debug("Rendering changelog command module for the Shell Shock `changelog` plugin.");
45
57
  return render(this, createComponent(ChangelogCommand, {}));
46
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../plugin-changelog/dist/index.mjs"],"sourcesContent":["import { ChangelogCommand } from \"./components/changelog-command.mjs\";\nimport \"./components/index.mjs\";\nimport { createComponent } from \"@alloy-js/core/jsx-runtime\";\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 { replacePathTokens } from \"powerlines/plugin-utils\";\n\n//#region src/index.tsx\n/**\n* The Changelog - Shell Shock plugin to add version check functionality and changelog commands to a Shell Shock application.\n*/\nconst plugin = (options = {}) => {\n\treturn {\n\t\tname: \"shell-shock:changelog\",\n\t\tconfig() {\n\t\t\tthis.debug(\"Providing default configuration for the Shell Shock `changelog` plugin.\");\n\t\t\treturn { changelog: defu({ command: { name: isSetString(options.command) ? options.command : \"changelog\" } }, options, { file: joinPaths(\"{root}\", \"CHANGELOG.md\") }) };\n\t\t},\n\t\tconfigResolved() {\n\t\t\tthis.debug(\"Adding the CLI changelog commands to the application context.\");\n\t\t\tthis.config.changelog.file = replacePathTokens(this, this.config.changelog.file);\n\t\t\tthis.inputs ??= [];\n\t\t\tif (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.\");\n\t\t\telse this.inputs.push({\n\t\t\t\tid: this.config.changelog.command.name,\n\t\t\t\tpath: this.config.changelog.command.name,\n\t\t\t\tsegments: [this.config.changelog.command.name],\n\t\t\t\ttitle: \"Changelog\",\n\t\t\t\ticon: \"🗃\",\n\t\t\t\ttags: [\"Utility\"],\n\t\t\t\tdescription: `Display the ${getAppTitle(this)} changelog.`,\n\t\t\t\tentry: {\n\t\t\t\t\tfile: joinPaths(this.entryPath, \"changelog\", \"index.ts\"),\n\t\t\t\t\tinput: { file: joinPaths(this.entryPath, \"changelog\", \"command.ts\") }\n\t\t\t\t},\n\t\t\t\tisVirtual: false,\n\t\t\t\t...this.config.changelog.command\n\t\t\t});\n\t\t},\n\t\tasync prepare() {\n\t\t\tthis.debug(\"Rendering changelog command module for the Shell Shock `changelog` plugin.\");\n\t\t\treturn render(this, createComponent(ChangelogCommand, {}));\n\t\t}\n\t};\n};\n\n//#endregion\nexport { plugin as default, plugin };\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,UAAU,UAAU,EAAE,KAAK;AAChC,QAAO;EACN,MAAM;EACN,SAAS;AACR,QAAK,MAAM,0EAA0E;AACrF,UAAO,EAAE,WAAW,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,QAAQ,QAAQ,GAAG,QAAQ,UAAU,aAAa,EAAE,EAAE,SAAS,EAAE,MAAM,UAAU,UAAU,eAAe,EAAE,CAAC,EAAE;;EAExK,iBAAiB;AAChB,QAAK,MAAM,gEAAgE;AAC3E,QAAK,OAAO,UAAU,OAAO,kBAAkB,MAAM,KAAK,OAAO,UAAU,KAAK;AAChF,QAAK,WAAW,EAAE;AAClB,OAAI,KAAK,OAAO,MAAM,UAAU,MAAM,OAAO,KAAK,OAAO,UAAU,QAAQ,KAAK,CAAE,MAAK,KAAK,0MAA0M;OACjS,MAAK,OAAO,KAAK;IACrB,IAAI,KAAK,OAAO,UAAU,QAAQ;IAClC,MAAM,KAAK,OAAO,UAAU,QAAQ;IACpC,UAAU,CAAC,KAAK,OAAO,UAAU,QAAQ,KAAK;IAC9C,OAAO;IACP,MAAM;IACN,MAAM,CAAC,UAAU;IACjB,aAAa,eAAe,YAAY,KAAK,CAAC;IAC9C,OAAO;KACN,MAAM,UAAU,KAAK,WAAW,aAAa,WAAW;KACxD,OAAO,EAAE,MAAM,UAAU,KAAK,WAAW,aAAa,aAAa,EAAE;KACrE;IACD,WAAW;IACX,GAAG,KAAK,OAAO,UAAU;IACzB,CAAC;;EAEH,MAAM,UAAU;AACf,QAAK,MAAM,6EAA6E;AACxF,UAAO,OAAO,MAAM,gBAAgB,kBAAkB,EAAE,CAAC,CAAC;;EAE3D"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../plugin-changelog/dist/index.mjs"],"sourcesContent":["import { ChangelogCommand } from \"./components/changelog-command.mjs\";\nimport \"./components/index.mjs\";\nimport { resolveChangelog } from \"./helpers/resolve-changelog.mjs\";\nimport { createComponent } from \"@alloy-js/core/jsx-runtime\";\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 { replacePathTokens } from \"powerlines/plugin-utils\";\n\n//#region src/index.tsx\n/**\n* The Changelog - Shell Shock plugin to add version check functionality and changelog commands to a Shell Shock application.\n*/\nconst plugin = (options = {}) => {\n\treturn {\n\t\tname: \"shell-shock:changelog\",\n\t\tconfig() {\n\t\t\tthis.debug(\"Providing default configuration for the Shell Shock `changelog` plugin.\");\n\t\t\treturn { changelog: defu({\n\t\t\t\tfile: resolveChangelog(this, options),\n\t\t\t\tcommand: { name: isSetString(options.command) ? options.command : \"changelog\" }\n\t\t\t}, options) };\n\t\t},\n\t\tconfigResolved() {\n\t\t\tthis.debug(\"Adding the CLI changelog commands to the application context.\");\n\t\t\tif (isSetString(this.config.changelog.file)) {\n\t\t\t\tthis.config.changelog.file = replacePathTokens(this, this.config.changelog.file);\n\t\t\t\tif (!this.fs.existsSync(this.config.changelog.file)) {\n\t\t\t\t\tthis.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.`);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.inputs ??= [];\n\t\t\t\tif (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.\");\n\t\t\t\telse this.inputs.push({\n\t\t\t\t\tid: this.config.changelog.command.name,\n\t\t\t\t\tpath: this.config.changelog.command.name,\n\t\t\t\t\tsegments: [this.config.changelog.command.name],\n\t\t\t\t\ttitle: \"Changelog\",\n\t\t\t\t\ticon: \"🗃\",\n\t\t\t\t\ttags: [\"Utility\"],\n\t\t\t\t\tdescription: `Display the ${getAppTitle(this)} changelog.`,\n\t\t\t\t\tentry: {\n\t\t\t\t\t\tfile: joinPaths(this.entryPath, \"changelog\", \"index.ts\"),\n\t\t\t\t\t\tinput: { file: joinPaths(this.entryPath, \"changelog\", \"command.ts\") }\n\t\t\t\t\t},\n\t\t\t\t\tisVirtual: false,\n\t\t\t\t\tsource: \"changelog-plugin\",\n\t\t\t\t\t...this.config.changelog.command\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tasync prepare() {\n\t\t\tif (isSetString(this.config.changelog.file) && !this.fs.existsSync(this.config.changelog.file)) return;\n\t\t\tthis.debug(\"Rendering changelog command module for the Shell Shock `changelog` plugin.\");\n\t\t\treturn render(this, createComponent(ChangelogCommand, {}));\n\t\t}\n\t};\n};\n\n//#endregion\nexport { plugin as default, plugin };\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;AAeA,MAAM,UAAU,UAAU,EAAE,KAAK;AAChC,QAAO;EACN,MAAM;EACN,SAAS;AACR,QAAK,MAAM,0EAA0E;AACrF,UAAO,EAAE,WAAW,KAAK;IACxB,MAAM,iBAAiB,MAAM,QAAQ;IACrC,SAAS,EAAE,MAAM,YAAY,QAAQ,QAAQ,GAAG,QAAQ,UAAU,aAAa;IAC/E,EAAE,QAAQ,EAAE;;EAEd,iBAAiB;AAChB,QAAK,MAAM,gEAAgE;AAC3E,OAAI,YAAY,KAAK,OAAO,UAAU,KAAK,EAAE;AAC5C,SAAK,OAAO,UAAU,OAAO,kBAAkB,MAAM,KAAK,OAAO,UAAU,KAAK;AAChF,QAAI,CAAC,KAAK,GAAG,WAAW,KAAK,OAAO,UAAU,KAAK,EAAE;AACpD,UAAK,KAAK,+DAA+D,KAAK,OAAO,UAAU,KAAK,UAAU,KAAK,OAAO,UAAU,QAAQ,KAAK,+LAA+L;AAChV;;AAED,SAAK,WAAW,EAAE;AAClB,QAAI,KAAK,OAAO,MAAM,UAAU,MAAM,OAAO,KAAK,OAAO,UAAU,QAAQ,KAAK,CAAE,MAAK,KAAK,0MAA0M;QACjS,MAAK,OAAO,KAAK;KACrB,IAAI,KAAK,OAAO,UAAU,QAAQ;KAClC,MAAM,KAAK,OAAO,UAAU,QAAQ;KACpC,UAAU,CAAC,KAAK,OAAO,UAAU,QAAQ,KAAK;KAC9C,OAAO;KACP,MAAM;KACN,MAAM,CAAC,UAAU;KACjB,aAAa,eAAe,YAAY,KAAK,CAAC;KAC9C,OAAO;MACN,MAAM,UAAU,KAAK,WAAW,aAAa,WAAW;MACxD,OAAO,EAAE,MAAM,UAAU,KAAK,WAAW,aAAa,aAAa,EAAE;MACrE;KACD,WAAW;KACX,QAAQ;KACR,GAAG,KAAK,OAAO,UAAU;KACzB,CAAC;;;EAGJ,MAAM,UAAU;AACf,OAAI,YAAY,KAAK,OAAO,UAAU,KAAK,IAAI,CAAC,KAAK,GAAG,WAAW,KAAK,OAAO,UAAU,KAAK,CAAE;AAChG,QAAK,MAAM,6EAA6E;AACxF,UAAO,OAAO,MAAM,gBAAgB,kBAAkB,EAAE,CAAC,CAAC;;EAE3D"}
@@ -7,6 +7,54 @@ interface ChangelogPluginOptions {
7
7
  /**
8
8
  * The path to the changelog file to read when executing the `changelog` command. This can be an absolute path or a path relative to the application's root directory.
9
9
  *
10
+ * @remarks
11
+ * If not provided, the plugin will attempt to resolve the changelog file by looking for common changelog file names (e.g., `CHANGELOG.md`, `RELEASE-NOTES.md`, etc.) in the application's root directory. If a specific file name is provided but cannot be found, it will fall back to looking for common changelog file names. If no valid changelog file can be resolved, the `changelog` command will not be added to the application. The following list of common changelog file names will be used for resolution:
12
+ * - `CHANGELOG.md`
13
+ * - `changelog.md`
14
+ * - `Changelog.md`
15
+ * - `CHANGELOG.markdown`
16
+ * - `changelog.markdown`
17
+ * - `Changelog.markdown`
18
+ * - `CHANGELOG.txt`
19
+ * - `changelog.txt`
20
+ * - `Changelog.txt`
21
+ * - `RELEASE-NOTES.md`
22
+ * - `release-notes.md`
23
+ * - `Release-Notes.md`
24
+ * - `RELEASE-NOTES.markdown`
25
+ * - `release-notes.markdown`
26
+ * - `Release-Notes.markdown`
27
+ * - `RELEASE-NOTES.txt`
28
+ * - `release-notes.txt`
29
+ * - `Release-Notes.txt`
30
+ * - `RELEASE_NOTES.md`
31
+ * - `release_notes.md`
32
+ * - `Release_Notes.md`
33
+ * - `RELEASE_NOTES.markdown`
34
+ * - `release_notes.markdown`
35
+ * - `Release_Notes.markdown`
36
+ * - `RELEASE_NOTES.txt`
37
+ * - `release_notes.txt`
38
+ * - `Release_Notes.txt`
39
+ * - `RELEASES.md`
40
+ * - `releases.md`
41
+ * - `Releases.md`
42
+ * - `RELEASES.markdown`
43
+ * - `releases.markdown`
44
+ * - `Releases.markdown`
45
+ * - `RELEASES.txt`
46
+ * - `releases.txt`
47
+ * - `Releases.txt`
48
+ * - `HISTORY.md`
49
+ * - `history.md`
50
+ * - `History.md`
51
+ * - `HISTORY.markdown`
52
+ * - `history.markdown`
53
+ * - `History.markdown`
54
+ * - `HISTORY.txt`
55
+ * - `history.txt`
56
+ * - `History.txt`
57
+ *
10
58
  * @defaultValue "\{root\}/CHANGELOG.md"
11
59
  */
12
60
  file?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":["CommandConfig","Context","ResolvedConfig","UserConfig","RequiredKeys","ChangelogPluginOptions","Partial","file","command","ChangelogPluginUserConfig","changelog","ChangelogPluginResolvedConfig","Omit","Required","ChangelogPluginContext","TResolvedConfig"],"sources":["../../../../../../plugin-changelog/dist/types/plugin.d.cts"],"mappings":";;;;;UAIUK,sBAAAA;EAAsB;;;;;EAM9BE,IAAAA;EASkBP;;;AAAa;;;;;EAA/BQ,OAAAA,GAAUF,OAAAA,CAAQN,aAAAA;AAAAA;AAAAA,KAEfS,yBAAAA,GAA4BN,UAAAA;EAIE;AAAA;;EAAjCO,SAAAA,EAAWL,sBAAAA;AAAAA;AAAAA,KAERM,6BAAAA,GAAgCT,cAAAA;EAIfU;;;EAApBF,SAAAA,EAAWG,QAAAA,CAASD,IAAAA,CAAKP,sBAAAA;IAIdD;;;IAATI,OAAAA,EAASJ,YAAAA,CAAaE,OAAAA,CAAQN,aAAAA;EAAAA;AAAAA;AAAAA,KAG7Bc,sBAAAA,yBAA+CH,6BAAAA,GAAgCA,6BAAAA,IAAiCV,OAAAA,CAAQc,eAAAA"}
1
+ {"version":3,"file":"plugin.d.cts","names":["CommandConfig","Context","ResolvedConfig","UserConfig","RequiredKeys","ChangelogPluginOptions","Partial","file","command","ChangelogPluginUserConfig","changelog","ChangelogPluginResolvedConfig","Omit","Required","ChangelogPluginContext","TResolvedConfig"],"sources":["../../../../../../plugin-changelog/dist/types/plugin.d.cts"],"mappings":";;;;;UAIUK,sBAAAA;EAAsB;;;;;;;;;AA+DC;;;;;;;;;AAME;;;;;;;;;;;;;;;;;;;;;;;AAUY;;;;;;;;;;;;EAzB7CE,IAAAA;EA4B2HQ;;;;;;;;EAnB3HP,OAAAA,GAAUF,OAAAA,CAAQN,aAAAA;AAAAA;AAAAA,KAEfS,yBAAAA,GAA4BN,UAAAA;;;;EAI/BO,SAAAA,EAAWL,sBAAAA;AAAAA;AAAAA,KAERM,6BAAAA,GAAgCT,cAAAA;;;;EAInCQ,SAAAA,EAAWG,QAAAA,CAASD,IAAAA,CAAKP,sBAAAA;;;;IAIvBG,OAAAA,EAASJ,YAAAA,CAAaE,OAAAA,CAAQN,aAAAA;EAAAA;AAAAA;AAAAA,KAG7Bc,sBAAAA,yBAA+CH,6BAAAA,GAAgCA,6BAAAA,IAAiCV,OAAAA,CAAQc,eAAAA"}
@@ -7,6 +7,54 @@ interface ChangelogPluginOptions {
7
7
  /**
8
8
  * The path to the changelog file to read when executing the `changelog` command. This can be an absolute path or a path relative to the application's root directory.
9
9
  *
10
+ * @remarks
11
+ * If not provided, the plugin will attempt to resolve the changelog file by looking for common changelog file names (e.g., `CHANGELOG.md`, `RELEASE-NOTES.md`, etc.) in the application's root directory. If a specific file name is provided but cannot be found, it will fall back to looking for common changelog file names. If no valid changelog file can be resolved, the `changelog` command will not be added to the application. The following list of common changelog file names will be used for resolution:
12
+ * - `CHANGELOG.md`
13
+ * - `changelog.md`
14
+ * - `Changelog.md`
15
+ * - `CHANGELOG.markdown`
16
+ * - `changelog.markdown`
17
+ * - `Changelog.markdown`
18
+ * - `CHANGELOG.txt`
19
+ * - `changelog.txt`
20
+ * - `Changelog.txt`
21
+ * - `RELEASE-NOTES.md`
22
+ * - `release-notes.md`
23
+ * - `Release-Notes.md`
24
+ * - `RELEASE-NOTES.markdown`
25
+ * - `release-notes.markdown`
26
+ * - `Release-Notes.markdown`
27
+ * - `RELEASE-NOTES.txt`
28
+ * - `release-notes.txt`
29
+ * - `Release-Notes.txt`
30
+ * - `RELEASE_NOTES.md`
31
+ * - `release_notes.md`
32
+ * - `Release_Notes.md`
33
+ * - `RELEASE_NOTES.markdown`
34
+ * - `release_notes.markdown`
35
+ * - `Release_Notes.markdown`
36
+ * - `RELEASE_NOTES.txt`
37
+ * - `release_notes.txt`
38
+ * - `Release_Notes.txt`
39
+ * - `RELEASES.md`
40
+ * - `releases.md`
41
+ * - `Releases.md`
42
+ * - `RELEASES.markdown`
43
+ * - `releases.markdown`
44
+ * - `Releases.markdown`
45
+ * - `RELEASES.txt`
46
+ * - `releases.txt`
47
+ * - `Releases.txt`
48
+ * - `HISTORY.md`
49
+ * - `history.md`
50
+ * - `History.md`
51
+ * - `HISTORY.markdown`
52
+ * - `history.markdown`
53
+ * - `History.markdown`
54
+ * - `HISTORY.txt`
55
+ * - `history.txt`
56
+ * - `History.txt`
57
+ *
10
58
  * @defaultValue "\{root\}/CHANGELOG.md"
11
59
  */
12
60
  file?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":["CommandConfig","Context","ResolvedConfig","UserConfig","RequiredKeys","ChangelogPluginOptions","Partial","file","command","ChangelogPluginUserConfig","changelog","ChangelogPluginResolvedConfig","Omit","Required","ChangelogPluginContext","TResolvedConfig"],"sources":["../../../../../../plugin-changelog/dist/types/plugin.d.cts"],"mappings":";;;;;UAIUK,sBAAAA;EAAsB;;;;;EAM9BE,IAAAA;EASkBP;;;AAAa;;;;;EAA/BQ,OAAAA,GAAUF,OAAAA,CAAQN,aAAAA;AAAAA;AAAAA,KAEfS,yBAAAA,GAA4BN,UAAAA;EAIE;AAAA;;EAAjCO,SAAAA,EAAWL,sBAAAA;AAAAA;AAAAA,KAERM,6BAAAA,GAAgCT,cAAAA;EAIfU;;;EAApBF,SAAAA,EAAWG,QAAAA,CAASD,IAAAA,CAAKP,sBAAAA;IAIdD;;;IAATI,OAAAA,EAASJ,YAAAA,CAAaE,OAAAA,CAAQN,aAAAA;EAAAA;AAAAA;AAAAA,KAG7Bc,sBAAAA,yBAA+CH,6BAAAA,GAAgCA,6BAAAA,IAAiCV,OAAAA,CAAQc,eAAAA"}
1
+ {"version":3,"file":"plugin.d.mts","names":["CommandConfig","Context","ResolvedConfig","UserConfig","RequiredKeys","ChangelogPluginOptions","Partial","file","command","ChangelogPluginUserConfig","changelog","ChangelogPluginResolvedConfig","Omit","Required","ChangelogPluginContext","TResolvedConfig"],"sources":["../../../../../../plugin-changelog/dist/types/plugin.d.cts"],"mappings":";;;;;UAIUK,sBAAAA;EAAsB;;;;;;;;;AA+DC;;;;;;;;;AAME;;;;;;;;;;;;;;;;;;;;;;;AAUY;;;;;;;;;;;;EAzB7CE,IAAAA;EA4B2HQ;;;;;;;;EAnB3HP,OAAAA,GAAUF,OAAAA,CAAQN,aAAAA;AAAAA;AAAAA,KAEfS,yBAAAA,GAA4BN,UAAAA;;;;EAI/BO,SAAAA,EAAWL,sBAAAA;AAAAA;AAAAA,KAERM,6BAAAA,GAAgCT,cAAAA;;;;EAInCQ,SAAAA,EAAWG,QAAAA,CAASD,IAAAA,CAAKP,sBAAAA;;;;IAIvBG,OAAAA,EAASJ,YAAAA,CAAaE,OAAAA,CAAQN,aAAAA;EAAAA;AAAAA;AAAAA,KAG7Bc,sBAAAA,yBAA+CH,6BAAAA,GAAgCA,6BAAAA,IAAiCV,OAAAA,CAAQc,eAAAA"}