cngpac 0.0.1

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 (278) hide show
  1. package/LICENSE +201 -0
  2. package/dist/bin.mjs +24025 -0
  3. package/dist/src/_virtual/_rolldown/runtime.mjs +35 -0
  4. package/dist/src/changelog.d.mts +71 -0
  5. package/dist/src/changelog.mjs +92 -0
  6. package/dist/src/changenote.d.mts +41 -0
  7. package/dist/src/changenote.mjs +184 -0
  8. package/dist/src/cli/commands/change.d.mts +4 -0
  9. package/dist/src/cli/commands/change.mjs +75 -0
  10. package/dist/src/formatter.d.mts +31 -0
  11. package/dist/src/formatter.mjs +50 -0
  12. package/dist/src/git.d.mts +20 -0
  13. package/dist/src/git.mjs +121 -0
  14. package/dist/src/index.d.mts +19 -0
  15. package/dist/src/index.mjs +20 -0
  16. package/dist/src/node_modules/.pnpm/@clack_core@1.2.0/node_modules/@clack/core/dist/index.mjs +530 -0
  17. package/dist/src/node_modules/.pnpm/@clack_prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs +110 -0
  18. package/dist/src/node_modules/.pnpm/@kwsites_file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/index.mjs +13 -0
  19. package/dist/src/node_modules/.pnpm/@kwsites_file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/src/index.mjs +59 -0
  20. package/dist/src/node_modules/.pnpm/@kwsites_promise-deferred@1.1.1/node_modules/@kwsites/promise-deferred/dist/index.mjs +55 -0
  21. package/dist/src/node_modules/.pnpm/@octokit_auth-token@6.0.0/node_modules/@octokit/auth-token/dist-bundle/index.mjs +32 -0
  22. package/dist/src/node_modules/.pnpm/@octokit_core@7.0.6/node_modules/@octokit/core/dist-src/index.mjs +94 -0
  23. package/dist/src/node_modules/.pnpm/@octokit_core@7.0.6/node_modules/@octokit/core/dist-src/version.mjs +4 -0
  24. package/dist/src/node_modules/.pnpm/@octokit_endpoint@11.0.3/node_modules/@octokit/endpoint/dist-bundle/index.mjs +223 -0
  25. package/dist/src/node_modules/.pnpm/@octokit_graphql@9.0.3/node_modules/@octokit/graphql/dist-bundle/index.mjs +90 -0
  26. package/dist/src/node_modules/.pnpm/@octokit_plugin-paginate-rest@14.0.0_@octokit_core@7.0.6/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.mjs +86 -0
  27. package/dist/src/node_modules/.pnpm/@octokit_plugin-request-log@6.0.0_@octokit_core@7.0.6/node_modules/@octokit/plugin-request-log/dist-src/index.mjs +22 -0
  28. package/dist/src/node_modules/.pnpm/@octokit_plugin-request-log@6.0.0_@octokit_core@7.0.6/node_modules/@octokit/plugin-request-log/dist-src/version.mjs +4 -0
  29. package/dist/src/node_modules/.pnpm/@octokit_plugin-rest-endpoint-methods@17.0.0_@octokit_core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.mjs +94 -0
  30. package/dist/src/node_modules/.pnpm/@octokit_plugin-rest-endpoint-methods@17.0.0_@octokit_core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.mjs +1295 -0
  31. package/dist/src/node_modules/.pnpm/@octokit_plugin-rest-endpoint-methods@17.0.0_@octokit_core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.mjs +17 -0
  32. package/dist/src/node_modules/.pnpm/@octokit_plugin-rest-endpoint-methods@17.0.0_@octokit_core@7.0.6/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.mjs +4 -0
  33. package/dist/src/node_modules/.pnpm/@octokit_request-error@7.1.0/node_modules/@octokit/request-error/dist-src/index.mjs +30 -0
  34. package/dist/src/node_modules/.pnpm/@octokit_request@10.0.8/node_modules/@octokit/request/dist-bundle/index.mjs +146 -0
  35. package/dist/src/node_modules/.pnpm/@octokit_rest@22.0.1/node_modules/@octokit/rest/dist-src/index.mjs +9 -0
  36. package/dist/src/node_modules/.pnpm/@octokit_rest@22.0.1/node_modules/@octokit/rest/dist-src/version.mjs +4 -0
  37. package/dist/src/node_modules/.pnpm/@simple-git_args-pathspec@1.0.2/node_modules/@simple-git/args-pathspec/dist/index.mjs +14 -0
  38. package/dist/src/node_modules/.pnpm/@simple-git_argv-parser@1.0.3/node_modules/@simple-git/argv-parser/dist/index.mjs +369 -0
  39. package/dist/src/node_modules/.pnpm/bail@2.0.2/node_modules/bail/index.mjs +13 -0
  40. package/dist/src/node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/index.mjs +43 -0
  41. package/dist/src/node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/lib/add.mjs +28 -0
  42. package/dist/src/node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/lib/register.mjs +16 -0
  43. package/dist/src/node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/lib/remove.mjs +11 -0
  44. package/dist/src/node_modules/.pnpm/character-entities@2.0.2/node_modules/character-entities/index.mjs +2135 -0
  45. package/dist/src/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.mjs +200 -0
  46. package/dist/src/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.mjs +206 -0
  47. package/dist/src/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.mjs +15 -0
  48. package/dist/src/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.mjs +212 -0
  49. package/dist/src/node_modules/.pnpm/decode-named-character-reference@1.3.0/node_modules/decode-named-character-reference/index.mjs +19 -0
  50. package/dist/src/node_modules/.pnpm/devlop@1.1.0/node_modules/devlop/lib/default.mjs +4 -0
  51. package/dist/src/node_modules/.pnpm/escape-string-regexp@5.0.0/node_modules/escape-string-regexp/index.mjs +7 -0
  52. package/dist/src/node_modules/.pnpm/extend@3.0.2/node_modules/extend/index.mjs +76 -0
  53. package/dist/src/node_modules/.pnpm/fast-content-type-parse@3.0.0/node_modules/fast-content-type-parse/index.mjs +115 -0
  54. package/dist/src/node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.mjs +138 -0
  55. package/dist/src/node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.mjs +12 -0
  56. package/dist/src/node_modules/.pnpm/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.mjs +12 -0
  57. package/dist/src/node_modules/.pnpm/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.mjs +165 -0
  58. package/dist/src/node_modules/.pnpm/fault@2.0.1/node_modules/fault/index.mjs +38 -0
  59. package/dist/src/node_modules/.pnpm/format@0.2.2/node_modules/format/format.mjs +87 -0
  60. package/dist/src/node_modules/.pnpm/glob@13.0.6/node_modules/glob/dist/esm/index.min.mjs +3125 -0
  61. package/dist/src/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.mjs +13 -0
  62. package/dist/src/node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.mjs +8 -0
  63. package/dist/src/node_modules/.pnpm/json-with-bigint@3.5.8/node_modules/json-with-bigint/json-with-bigint.mjs +137 -0
  64. package/dist/src/node_modules/.pnpm/localstorage-polyfill@1.0.1/node_modules/localstorage-polyfill/localStorage.mjs +39 -0
  65. package/dist/src/node_modules/.pnpm/longest-streak@3.1.0/node_modules/longest-streak/index.mjs +29 -0
  66. package/dist/src/node_modules/.pnpm/mdast-util-from-markdown@2.0.3/node_modules/mdast-util-from-markdown/lib/index.mjs +976 -0
  67. package/dist/src/node_modules/.pnpm/mdast-util-frontmatter@2.0.1/node_modules/mdast-util-frontmatter/lib/index.mjs +162 -0
  68. package/dist/src/node_modules/.pnpm/mdast-util-phrasing@4.1.0/node_modules/mdast-util-phrasing/lib/index.mjs +36 -0
  69. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/configure.mjs +48 -0
  70. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/blockquote.mjs +27 -0
  71. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/break.mjs +20 -0
  72. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/code.mjs +62 -0
  73. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/definition.mjs +61 -0
  74. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/emphasis.mjs +51 -0
  75. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/heading.mjs +47 -0
  76. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/html.mjs +20 -0
  77. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/image-reference.mjs +50 -0
  78. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/image.mjs +69 -0
  79. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/index.mjs +47 -0
  80. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/inline-code.mjs +40 -0
  81. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/link-reference.mjs +50 -0
  82. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/link.mjs +93 -0
  83. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/list-item.mjs +35 -0
  84. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/list.mjs +48 -0
  85. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/paragraph.mjs +22 -0
  86. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/root.mjs +20 -0
  87. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/strong.mjs +51 -0
  88. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/text.mjs +17 -0
  89. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.mjs +19 -0
  90. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/index.mjs +161 -0
  91. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/join.mjs +18 -0
  92. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/unsafe.mjs +223 -0
  93. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/association.mjs +31 -0
  94. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.mjs +15 -0
  95. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.mjs +19 -0
  96. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-bullet.mjs +15 -0
  97. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-emphasis.mjs +15 -0
  98. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-fence.mjs +15 -0
  99. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.mjs +15 -0
  100. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-quote.mjs +15 -0
  101. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.mjs +15 -0
  102. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-rule.mjs +15 -0
  103. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/check-strong.mjs +15 -0
  104. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/compile-pattern.mjs +16 -0
  105. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/container-flow.mjs +56 -0
  106. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/container-phrasing.mjs +75 -0
  107. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.mjs +14 -0
  108. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/encode-info.mjs +74 -0
  109. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.mjs +15 -0
  110. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.mjs +24 -0
  111. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.mjs +17 -0
  112. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/indent-lines.mjs +32 -0
  113. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.mjs +27 -0
  114. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/safe.mjs +116 -0
  115. package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/util/track.mjs +59 -0
  116. package/dist/src/node_modules/.pnpm/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.mjs +83 -0
  117. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/attention.mjs +224 -0
  118. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/autolink.mjs +213 -0
  119. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/blank-line.mjs +60 -0
  120. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/block-quote.mjs +130 -0
  121. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/character-escape.mjs +62 -0
  122. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/character-reference.mjs +141 -0
  123. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/code-fenced.mjs +418 -0
  124. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/code-indented.mjs +147 -0
  125. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/code-text.mjs +187 -0
  126. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/content.mjs +137 -0
  127. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/definition.mjs +223 -0
  128. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/hard-break-escape.mjs +59 -0
  129. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/heading-atx.mjs +189 -0
  130. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/html-flow.mjs +777 -0
  131. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/html-text.mjs +617 -0
  132. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/label-end.mjs +479 -0
  133. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/label-start-image.mjs +95 -0
  134. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/label-start-link.mjs +50 -0
  135. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/line-ending.mjs +32 -0
  136. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/list.mjs +177 -0
  137. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/setext-underline.mjs +155 -0
  138. package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/thematic-break.mjs +98 -0
  139. package/dist/src/node_modules/.pnpm/micromark-extension-frontmatter@2.0.0/node_modules/micromark-extension-frontmatter/lib/syntax.mjs +352 -0
  140. package/dist/src/node_modules/.pnpm/micromark-extension-frontmatter@2.0.0/node_modules/micromark-extension-frontmatter/lib/to-matters.mjs +109 -0
  141. package/dist/src/node_modules/.pnpm/micromark-factory-destination@2.0.1/node_modules/micromark-factory-destination/index.mjs +186 -0
  142. package/dist/src/node_modules/.pnpm/micromark-factory-label@2.0.1/node_modules/micromark-factory-label/index.mjs +134 -0
  143. package/dist/src/node_modules/.pnpm/micromark-factory-space@2.0.1/node_modules/micromark-factory-space/index.mjs +61 -0
  144. package/dist/src/node_modules/.pnpm/micromark-factory-title@2.0.1/node_modules/micromark-factory-title/index.mjs +148 -0
  145. package/dist/src/node_modules/.pnpm/micromark-factory-whitespace@2.0.1/node_modules/micromark-factory-whitespace/index.mjs +43 -0
  146. package/dist/src/node_modules/.pnpm/micromark-util-character@2.1.1/node_modules/micromark-util-character/index.mjs +229 -0
  147. package/dist/src/node_modules/.pnpm/micromark-util-chunked@2.0.1/node_modules/micromark-util-chunked/index.mjs +71 -0
  148. package/dist/src/node_modules/.pnpm/micromark-util-classify-character@2.0.1/node_modules/micromark-util-classify-character/index.mjs +25 -0
  149. package/dist/src/node_modules/.pnpm/micromark-util-combine-extensions@2.0.1/node_modules/micromark-util-combine-extensions/index.mjs +73 -0
  150. package/dist/src/node_modules/.pnpm/micromark-util-decode-numeric-character-reference@2.0.2/node_modules/micromark-util-decode-numeric-character-reference/index.mjs +22 -0
  151. package/dist/src/node_modules/.pnpm/micromark-util-decode-string@2.0.1/node_modules/micromark-util-decode-string/index.mjs +40 -0
  152. package/dist/src/node_modules/.pnpm/micromark-util-html-tag-name@2.0.1/node_modules/micromark-util-html-tag-name/index.mjs +100 -0
  153. package/dist/src/node_modules/.pnpm/micromark-util-normalize-identifier@2.0.1/node_modules/micromark-util-normalize-identifier/index.mjs +25 -0
  154. package/dist/src/node_modules/.pnpm/micromark-util-resolve-all@2.0.1/node_modules/micromark-util-resolve-all/index.mjs +31 -0
  155. package/dist/src/node_modules/.pnpm/micromark-util-subtokenize@2.1.0/node_modules/micromark-util-subtokenize/index.mjs +158 -0
  156. package/dist/src/node_modules/.pnpm/micromark-util-subtokenize@2.1.0/node_modules/micromark-util-subtokenize/lib/splice-buffer.mjs +231 -0
  157. package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/constructs.mjs +101 -0
  158. package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/create-tokenizer.mjs +473 -0
  159. package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/content.mjs +70 -0
  160. package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/document.mjs +220 -0
  161. package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/flow.mjs +51 -0
  162. package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/text.mjs +178 -0
  163. package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/parse.mjs +52 -0
  164. package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/postprocess.mjs +17 -0
  165. package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/preprocess.mjs +102 -0
  166. package/dist/src/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.mjs +121 -0
  167. package/dist/src/node_modules/.pnpm/remark-frontmatter@5.0.0/node_modules/remark-frontmatter/lib/index.mjs +35 -0
  168. package/dist/src/node_modules/.pnpm/remark-parse@11.0.0/node_modules/remark-parse/lib/index.mjs +37 -0
  169. package/dist/src/node_modules/.pnpm/remark-stringify@11.0.0/node_modules/remark-stringify/lib/index.mjs +36 -0
  170. package/dist/src/node_modules/.pnpm/simple-git@3.35.2/node_modules/simple-git/dist/esm/index.mjs +3563 -0
  171. package/dist/src/node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.mjs +57 -0
  172. package/dist/src/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.mjs +72 -0
  173. package/dist/src/node_modules/.pnpm/trough@2.2.0/node_modules/trough/lib/index.mjs +157 -0
  174. package/dist/src/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/callable-instance.mjs +13 -0
  175. package/dist/src/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.mjs +1088 -0
  176. package/dist/src/node_modules/.pnpm/unist-util-is@6.0.1/node_modules/unist-util-is/lib/index.mjs +110 -0
  177. package/dist/src/node_modules/.pnpm/unist-util-stringify-position@4.0.0/node_modules/unist-util-stringify-position/lib/index.mjs +65 -0
  178. package/dist/src/node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/color.node.mjs +10 -0
  179. package/dist/src/node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/index.mjs +328 -0
  180. package/dist/src/node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.mjs +287 -0
  181. package/dist/src/node_modules/.pnpm/universal-user-agent@7.0.3/node_modules/universal-user-agent/index.mjs +8 -0
  182. package/dist/src/node_modules/.pnpm/vfile-message@4.0.3/node_modules/vfile-message/lib/index.mjs +247 -0
  183. package/dist/src/node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/lib/index.mjs +525 -0
  184. package/dist/src/node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/lib/minpath.mjs +2 -0
  185. package/dist/src/node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/lib/minproc.mjs +2 -0
  186. package/dist/src/node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/lib/minurl.mjs +3 -0
  187. package/dist/src/node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/lib/minurl.shared.mjs +24 -0
  188. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-collection.mjs +62 -0
  189. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-doc.mjs +49 -0
  190. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-node.mjs +98 -0
  191. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-scalar.mjs +66 -0
  192. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/composer.mjs +207 -0
  193. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-map.mjs +93 -0
  194. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-scalar.mjs +179 -0
  195. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-seq.mjs +48 -0
  196. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-end.mjs +41 -0
  197. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-collection.mjs +166 -0
  198. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-scalar.mjs +211 -0
  199. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-props.mjs +110 -0
  200. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-contains-newline.mjs +32 -0
  201. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-empty-scalar-position.mjs +30 -0
  202. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-flow-indent-check.mjs +16 -0
  203. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-map-includes.mjs +16 -0
  204. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/Document.mjs +295 -0
  205. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/anchors.mjs +67 -0
  206. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/applyReviver.mjs +43 -0
  207. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/createNode.mjs +69 -0
  208. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/directives.mjs +170 -0
  209. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/errors.mjs +56 -0
  210. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/index.mjs +67 -0
  211. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/log.mjs +17 -0
  212. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Alias.mjs +101 -0
  213. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Collection.mjs +127 -0
  214. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Node.mjs +40 -0
  215. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Pair.mjs +40 -0
  216. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Scalar.mjs +33 -0
  217. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLMap.mjs +118 -0
  218. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLSeq.mjs +115 -0
  219. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/addPairToJSMap.mjs +59 -0
  220. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/identity.mjs +53 -0
  221. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/toJS.mjs +41 -0
  222. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-scalar.mjs +274 -0
  223. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-stringify.mjs +54 -0
  224. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-visit.mjs +94 -0
  225. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst.mjs +85 -0
  226. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/lexer.mjs +523 -0
  227. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/line-counter.mjs +50 -0
  228. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/parser.mjs +861 -0
  229. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/public-api.mjs +97 -0
  230. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/Schema.mjs +36 -0
  231. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/map.mjs +22 -0
  232. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/null.mjs +19 -0
  233. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/seq.mjs +22 -0
  234. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/string.mjs +19 -0
  235. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/bool.mjs +23 -0
  236. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/float.mjs +46 -0
  237. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/int.mjs +45 -0
  238. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/schema.mjs +34 -0
  239. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/json/schema.mjs +68 -0
  240. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/tags.mjs +103 -0
  241. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/binary.mjs +53 -0
  242. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/bool.mjs +31 -0
  243. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/float.mjs +49 -0
  244. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/int.mjs +79 -0
  245. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/merge.mjs +45 -0
  246. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/omap.mjs +71 -0
  247. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/pairs.mjs +67 -0
  248. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/schema.mjs +56 -0
  249. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/set.mjs +74 -0
  250. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/timestamp.mjs +87 -0
  251. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/foldFlowLines.mjs +119 -0
  252. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringify.mjs +115 -0
  253. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyCollection.mjs +124 -0
  254. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyComment.mjs +23 -0
  255. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyDocument.mjs +67 -0
  256. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyNumber.mjs +24 -0
  257. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyPair.mjs +104 -0
  258. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyString.mjs +229 -0
  259. package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/visit.mjs +194 -0
  260. package/dist/src/node_modules/.pnpm/zwitch@2.0.4/node_modules/zwitch/index.mjs +106 -0
  261. package/dist/src/pkg.d.mts +24 -0
  262. package/dist/src/pkg.mjs +39 -0
  263. package/dist/src/prepare.d.mts +14 -0
  264. package/dist/src/prepare.mjs +41 -0
  265. package/dist/src/publishers/npm.d.mts +21 -0
  266. package/dist/src/publishers/npm.mjs +42 -0
  267. package/dist/src/releasers/github.d.mts +10 -0
  268. package/dist/src/releasers/github.mjs +20 -0
  269. package/dist/src/saver.d.mts +42 -0
  270. package/dist/src/saver.mjs +39 -0
  271. package/dist/src/types.d.mts +150 -0
  272. package/dist/src/utils.d.mts +7 -0
  273. package/dist/src/utils.mjs +47 -0
  274. package/dist/src/version.d.mts +9 -0
  275. package/dist/src/version.mjs +18 -0
  276. package/package.json +156 -0
  277. package/templates/cngpac.config.ts +33 -0
  278. package/templates/version.yml +30 -0
@@ -0,0 +1,42 @@
1
+ import { dirname } from "node:path";
2
+ import { execSync } from "node:child_process";
3
+ import * as semver from "semver";
4
+ //#region src/publishers/npm.ts
5
+ /**
6
+ * Creates an npm publisher plugin.
7
+ * Publishes the package to the npm registry.
8
+ * Supports GitHub Actions Provenance (SLSA attestation) for signed releases.
9
+ */
10
+ function createNpmPublisher(options = {}) {
11
+ return async ({ pkgJsonPath, versionBump }) => {
12
+ execSync("npm pack", {
13
+ cwd: dirname(pkgJsonPath),
14
+ stdio: "inherit"
15
+ });
16
+ const { registry, env = {}, args = [], provenance = true } = options;
17
+ const publishArgs = ["publish"];
18
+ if (registry) publishArgs.push("--registry", registry);
19
+ if (provenance) publishArgs.push("--provenance");
20
+ const ver = semver.parse(versionBump.newVersion);
21
+ if (ver?.prerelease?.length) {
22
+ const tag = String(ver.prerelease[0]);
23
+ publishArgs.push("--tag", tag);
24
+ }
25
+ publishArgs.push(...args);
26
+ const command = `npm ${publishArgs.join(" ")}`;
27
+ try {
28
+ execSync(command, {
29
+ cwd: dirname(pkgJsonPath),
30
+ stdio: "inherit",
31
+ env: {
32
+ ...process.env,
33
+ ...env
34
+ }
35
+ });
36
+ } catch (error) {
37
+ throw new Error(`Failed to publish ${versionBump.packageName}@${versionBump.newVersion} to npm: ${error instanceof Error ? error.message : String(error)}`);
38
+ }
39
+ };
40
+ }
41
+ //#endregion
42
+ export { createNpmPublisher };
@@ -0,0 +1,10 @@
1
+ import { ReleaserPlugin } from "../types.mjs";
2
+
3
+ //#region src/releasers/github.d.ts
4
+ interface GitHubReleaserOptions {
5
+ /** GitHub token for authentication */
6
+ token: string;
7
+ }
8
+ declare function createGitHubReleaser(options: GitHubReleaserOptions): ReleaserPlugin;
9
+ //#endregion
10
+ export { GitHubReleaserOptions, createGitHubReleaser };
@@ -0,0 +1,20 @@
1
+ import { Octokit } from "../node_modules/.pnpm/@octokit_rest@22.0.1/node_modules/@octokit/rest/dist-src/index.mjs";
2
+ import * as semver from "semver";
3
+ //#region src/releasers/github.ts
4
+ function createGitHubReleaser(options) {
5
+ const octokit = new Octokit({ auth: options.token });
6
+ return async ({ versionBump, tagName, changelog, config }) => {
7
+ const releaseName = `${versionBump.packageName}@${versionBump.newVersion}`;
8
+ await octokit.repos.createRelease({
9
+ owner: config.repository.owner,
10
+ repo: config.repository.name,
11
+ tag_name: tagName,
12
+ name: releaseName,
13
+ body: changelog,
14
+ draft: false,
15
+ prerelease: semver.parse(versionBump.newVersion)?.prerelease?.length !== 0
16
+ });
17
+ };
18
+ }
19
+ //#endregion
20
+ export { createGitHubReleaser };
@@ -0,0 +1,42 @@
1
+ import { ChangelogSaver, VersionBump } from "./types.mjs";
2
+
3
+ //#region src/saver.d.ts
4
+ interface ChangelogSaverOptions {
5
+ /**
6
+ * Filepath for saving the changelog.
7
+ * Can be a string (static path) or a function that receives the VersionBump
8
+ * and returns the filepath. Supports template variables:
9
+ * - {packageName}: The package name
10
+ * - {version}: The new version
11
+ *
12
+ * Examples:
13
+ * - "./CHANGELOG.md"
14
+ * - "./CHANGELOG-{packageName}.md"
15
+ * - (bump) => `./changelogs/{bump.packageName}-${bump.newVersion}.md`
16
+ */
17
+ filepath: string | ((bump: VersionBump) => string);
18
+ }
19
+ /**
20
+ * Creates a changelog saver that writes to the filesystem.
21
+ *
22
+ * @param options Configuration for the file saver
23
+ * @returns A ChangelogSaver plugin function
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const saver = createChangelogSaver({ filepath: "./CHANGELOG.md" });
28
+ *
29
+ * // Or with dynamic filepath:
30
+ * const saver = createChangelogSaver({
31
+ * filepath: (bump) => `./changelogs/CHANGELOG-${bump.packageName}.md`
32
+ * });
33
+ *
34
+ * // Or with template variables:
35
+ * const saver = createChangelogSaver({
36
+ * filepath: "./changelogs/CHANGELOG-{packageName}-{version}.md"
37
+ * });
38
+ * ```
39
+ */
40
+ declare function createChangelogSaver(options: ChangelogSaverOptions): ChangelogSaver;
41
+ //#endregion
42
+ export { ChangelogSaverOptions, createChangelogSaver };
@@ -0,0 +1,39 @@
1
+ import { escapePackageName } from "./utils.mjs";
2
+ import { dirname, join } from "node:path";
3
+ import { promises } from "node:fs";
4
+ //#region src/saver.ts
5
+ /**
6
+ * Creates a changelog saver that writes to the filesystem.
7
+ *
8
+ * @param options Configuration for the file saver
9
+ * @returns A ChangelogSaver plugin function
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const saver = createChangelogSaver({ filepath: "./CHANGELOG.md" });
14
+ *
15
+ * // Or with dynamic filepath:
16
+ * const saver = createChangelogSaver({
17
+ * filepath: (bump) => `./changelogs/CHANGELOG-${bump.packageName}.md`
18
+ * });
19
+ *
20
+ * // Or with template variables:
21
+ * const saver = createChangelogSaver({
22
+ * filepath: "./changelogs/CHANGELOG-{packageName}-{version}.md"
23
+ * });
24
+ * ```
25
+ */
26
+ function createChangelogSaver(options) {
27
+ return async ({ changelog, versionBump, configDir }) => {
28
+ let filepath;
29
+ if (typeof options.filepath === "function") filepath = options.filepath(versionBump);
30
+ else filepath = options.filepath.replace("{packageName}", escapePackageName(versionBump.packageName)).replace("{version}", versionBump.newVersion);
31
+ const absolutePath = filepath.startsWith("/") ? filepath : join(configDir, filepath);
32
+ const dir = dirname(absolutePath);
33
+ await promises.mkdir(dir, { recursive: true });
34
+ await promises.writeFile(absolutePath, changelog, "utf-8");
35
+ return absolutePath;
36
+ };
37
+ }
38
+ //#endregion
39
+ export { createChangelogSaver };
@@ -0,0 +1,150 @@
1
+ //#region src/types.d.ts
2
+ /** A package in the monorepo */
3
+ type Package = {
4
+ /** Package name */name: string; /** Package version */
5
+ version: string;
6
+ };
7
+ /** Branded string type representing a package file path */
8
+ type PkgFileAbsPath = string & {
9
+ readonly __brand: "PkgFileAbsPath";
10
+ };
11
+ /** Branded string type representing a dirty file path */
12
+ type DirtyFileAbsPath = string & {
13
+ readonly __brand: "DirtyFileAbsPath";
14
+ };
15
+ /** Semantic version bump type */
16
+ type BumpType = "major" | "minor" | "patch";
17
+ /** Parsed changenote from a markdown file */
18
+ type Changenote = {
19
+ /** Unique ID derived from the filename (without extension) */id: string; /** YAML frontmatter metadata */
20
+ meta: ChangenoteMetadata; /** Heading from the changenote markdown */
21
+ title: string; /** Markdown body content after the title heading */
22
+ body: string; /** Relative file path to the changenote markdown file */
23
+ filePath: string;
24
+ };
25
+ type ChangenoteMetadata = {
26
+ /** Semantic versioning bump information */bump: BumpType;
27
+ };
28
+ /** Commit metadata extracted from git history */
29
+ interface ChangenoteCommit {
30
+ /** Commit hash that introduced the changenote file */
31
+ hash: string;
32
+ /** Commit subject for the changenote file */
33
+ subject: string;
34
+ }
35
+ /** A Contributor who added/edited the changenote file */
36
+ interface CommitAuthor {
37
+ name: string;
38
+ email: string;
39
+ }
40
+ /** A resolved version bump for a single package */
41
+ interface VersionBump {
42
+ packageName: string;
43
+ /** Current version from package.json */
44
+ currentVersion: string;
45
+ /** New version after applying the bump */
46
+ newVersion: string;
47
+ /** The highest bump type applied */
48
+ bump: BumpType;
49
+ }
50
+ /** Prepare configuration written by the `prepare` command */
51
+ type PrepareConfig = {
52
+ newVersion: string;
53
+ attempt: number;
54
+ };
55
+ /**
56
+ * A changelog generator plugin function.
57
+ * Receives a VersionBump and returns formatted changelog content.
58
+ */
59
+ type ChangelogGenerator = (bump: VersionBump, changenotes: (Changenote & {
60
+ commit: ChangenoteCommit;
61
+ authors: CommitAuthor[];
62
+ })[], config: CngpacConfig) => Promise<string>;
63
+ /**
64
+ * A changelog saver plugin function.
65
+ * Called before git commit during the version command.
66
+ * Receives the generated changelog markdown and version bump info,
67
+ * and is responsible for persisting the changelog in the codebase.
68
+ */
69
+ type ChangelogSaver = (props: {
70
+ changelog: string;
71
+ versionBump: VersionBump;
72
+ configDir: string;
73
+ }) => Promise<DirtyFileAbsPath | DirtyFileAbsPath[] | undefined> | DirtyFileAbsPath | DirtyFileAbsPath[] | undefined;
74
+ /**
75
+ * A releaser plugin function.
76
+ * Called after the "Publisher" plugins during the version command.
77
+ * Responsible for publishing a release (e.g. creating a GitHub release).
78
+ */
79
+ type ReleaserPlugin = (props: {
80
+ versionBump: VersionBump;
81
+ tagName: string;
82
+ changelog: string;
83
+ config: CngpacConfig;
84
+ }) => Promise<void> | void;
85
+ /**
86
+ * A publisher plugin function.
87
+ * Called after the git push during the version command.
88
+ * Responsible for publishing the package to a registry (e.g. npm publish).
89
+ */
90
+ type PublisherPlugin = (props: {
91
+ pkgJsonPath: string;
92
+ versionBump: VersionBump;
93
+ config: CngpacConfig;
94
+ }) => Promise<void> | void;
95
+ /**
96
+ * A pre-stage plugin function.
97
+ * Called during the version command, before staging dirty files.
98
+ * Can perform side effects (e.g. copy docs to a versioned directory)
99
+ * and return additional file paths that need to be staged.
100
+ */
101
+ type PreStagePlugin = (props: {
102
+ versionBump: VersionBump;
103
+ config: CngpacConfig;
104
+ configDir: string;
105
+ }) => Promise<DirtyFileAbsPath | DirtyFileAbsPath[] | undefined> | DirtyFileAbsPath | DirtyFileAbsPath[] | undefined;
106
+ /**
107
+ * A changenote name generator function.
108
+ * Returns a unique string used as the changenote filename.
109
+ */
110
+ type NoteNameGenerator = () => string;
111
+ /**
112
+ * A formatter plugin.
113
+ * Declares which file extensions it handles and a function that formats them in place.
114
+ * Called after CLI commands create or modify files.
115
+ */
116
+ type FormatterPlugin = {
117
+ /** File extensions this formatter handles (without leading dot, e.g. ["json", "md"]) */extensions: string[]; /** Format the given files in place */
118
+ format: (filePaths: string[], rootDir: string) => Promise<void> | void;
119
+ };
120
+ /** Configuration for Cngpac */
121
+ interface CngpacConfig {
122
+ /** Relative path to the package file */
123
+ package: string;
124
+ repository: {
125
+ owner: string;
126
+ name: string;
127
+ };
128
+ changelog: {
129
+ /**
130
+ * A plugin that generates the changelog from changenotes.
131
+ */
132
+ generator: ChangelogGenerator;
133
+ /**`
134
+ * A plugin that saves the generated changelog in the codebase.
135
+ */
136
+ saver?: ChangelogSaver;
137
+ };
138
+ /** List of publisher plugins called after git push during the version command */
139
+ publishers?: PublisherPlugin[];
140
+ /** List of releaser plugins called after publishers during the version command */
141
+ releasers?: ReleaserPlugin[];
142
+ /** Formatter plugins called on files created/changed by CLI commands */
143
+ formatters?: FormatterPlugin[];
144
+ /** Pre-stage plugins called before staging dirty files during the version command */
145
+ preStage?: PreStagePlugin[];
146
+ /** Optional custom generator for changenote filenames */
147
+ noteNameGenerator?: NoteNameGenerator;
148
+ }
149
+ //#endregion
150
+ export { BumpType, ChangelogGenerator, ChangelogSaver, Changenote, ChangenoteCommit, ChangenoteMetadata, CngpacConfig, CommitAuthor, DirtyFileAbsPath, FormatterPlugin, NoteNameGenerator, Package, PkgFileAbsPath, PreStagePlugin, PrepareConfig, PublisherPlugin, ReleaserPlugin, VersionBump };
@@ -0,0 +1,7 @@
1
+ import { CngpacConfig } from "./types.mjs";
2
+
3
+ //#region src/utils.d.ts
4
+ /** Load the Cngpac config */
5
+ declare function loadConfig(path: string): Promise<CngpacConfig>;
6
+ //#endregion
7
+ export { loadConfig };
@@ -0,0 +1,47 @@
1
+ import { access } from "node:fs/promises";
2
+ import { extname } from "node:path";
3
+ //#region src/utils.ts
4
+ const CONFIG_EXTENSIONS = [
5
+ ".ts",
6
+ ".mts",
7
+ ".js",
8
+ ".mjs"
9
+ ];
10
+ /** Load the Cngpac config */
11
+ async function loadConfig(path) {
12
+ const ext = extname(path);
13
+ const base = ext ? path.slice(0, -ext.length) : path;
14
+ let resolvedPath;
15
+ for (const candidate of CONFIG_EXTENSIONS) {
16
+ const full = `${base}${candidate}`;
17
+ try {
18
+ await access(full);
19
+ resolvedPath = full;
20
+ break;
21
+ } catch {}
22
+ }
23
+ if (!resolvedPath) throw new Error(`Config file not found: tried ${CONFIG_EXTENSIONS.map((e) => `${base}${e}`).join(", ")}`);
24
+ const config = (await import(resolvedPath)).default;
25
+ if (!config || typeof config !== "object") throw new Error();
26
+ return config;
27
+ }
28
+ /**
29
+ * Escape a package name to a safe file system name.
30
+ *
31
+ * "@myapp/core" → "myapp-core"
32
+ *
33
+ * "my-app" → "my-app"
34
+ */
35
+ function escapePackageName(name) {
36
+ return name.replace(/^@/, "").replace(/\//g, "-");
37
+ }
38
+ /** Detect indentation from JSON content */
39
+ function detectIndentation(content) {
40
+ const match = content.match(/\n([ \t]+)["'{]/);
41
+ if (!match) return 2;
42
+ const indent = match[1];
43
+ if (indent.includes(" ")) return " ";
44
+ return indent.length;
45
+ }
46
+ //#endregion
47
+ export { detectIndentation, escapePackageName, loadConfig };
@@ -0,0 +1,9 @@
1
+ import { Changenote, VersionBump } from "./types.mjs";
2
+
3
+ //#region src/version.d.ts
4
+ /** Apply version bump to package.json */
5
+ declare function applyVersionBump(versionBump: VersionBump, pkgJsonPath: string): void;
6
+ /** Remove consumed changenote files */
7
+ declare function consumeChangenotes(changenotes: Changenote[]): void;
8
+ //#endregion
9
+ export { applyVersionBump, consumeChangenotes };
@@ -0,0 +1,18 @@
1
+ import { detectIndentation } from "./utils.mjs";
2
+ import fs from "node:fs";
3
+ //#region src/version.ts
4
+ /** Apply version bump to package.json */
5
+ function applyVersionBump(versionBump, pkgJsonPath) {
6
+ const { newVersion } = versionBump;
7
+ const packageJsonRaw = fs.readFileSync(pkgJsonPath, "utf-8");
8
+ const indent = detectIndentation(packageJsonRaw);
9
+ const pkgJson = JSON.parse(packageJsonRaw);
10
+ pkgJson.version = newVersion;
11
+ fs.writeFileSync(pkgJsonPath, `${JSON.stringify(pkgJson, null, indent)}\n`, "utf-8");
12
+ }
13
+ /** Remove consumed changenote files */
14
+ function consumeChangenotes(changenotes) {
15
+ for (const cn of changenotes) fs.unlinkSync(cn.filePath);
16
+ }
17
+ //#endregion
18
+ export { applyVersionBump, consumeChangenotes };
package/package.json ADDED
@@ -0,0 +1,156 @@
1
+ {
2
+ "name": "cngpac",
3
+ "version": "0.0.1",
4
+ "description": "A highly configurable package release manager",
5
+ "license": "Apache-2.0",
6
+ "homepage": "https://cngpac.dev",
7
+ "keywords": [],
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/cngpac/cngpac.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/cngpac/cngpac/issues"
14
+ },
15
+ "type": "module",
16
+ "engines": {
17
+ "node": ">=24.14.0"
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "templates"
22
+ ],
23
+ "types": "./dist/index.d.mts",
24
+ "exports": {
25
+ ".": "./dist/src/index.mjs",
26
+ "./publishers/npm": "./dist/src/publishers/npm.mjs",
27
+ "./releasers/github": "./dist/src/releasers/github.mjs",
28
+ "./package.json": "./package.json"
29
+ },
30
+ "bin": {
31
+ "cngpac": "dist/bin.mjs"
32
+ },
33
+ "scripts": {
34
+ "format": "biome format --write && oxfmt **/*.{md,yml,css}",
35
+ "format:check": "biome format --check && oxfmt --check **/*.{md,yml,css}",
36
+ "lint": "biome lint --write",
37
+ "typecheck-src": "tsc --noEmit --project tsconfig.json",
38
+ "typecheck-cli": "tsc --noEmit --project src/cli/tsconfig.json",
39
+ "typecheck-web": "tsc --noEmit --project website/tsconfig.json",
40
+ "typecheck": "npm run typecheck-src && npm run typecheck-cli && npm run typecheck-web",
41
+ "build-src": "tsdown --config tsdown.config.ts --exports",
42
+ "build-cli": "tsdown --config src/cli/tsdown.config.ts",
43
+ "build": "npm run build-src && npm run build-cli",
44
+ "test": "vitest run",
45
+ "test:watch": "vitest",
46
+ "web": "cd website && npm run start"
47
+ },
48
+ "dependencies": {
49
+ "semver": "^7.7.4"
50
+ },
51
+ "devDependencies": {
52
+ "@biomejs/biome": "^2.4.11",
53
+ "@clack/prompts": "^1.2.0",
54
+ "@octokit/rest": "^22.0.1",
55
+ "@prettier/plugin-xml": "^3.4.2",
56
+ "@types/mdast": "^4.0.4",
57
+ "@types/node": "^24.12.2",
58
+ "@types/semver": "^7.7.1",
59
+ "commander": "^14.0.3",
60
+ "glob": "^13.0.6",
61
+ "localstorage-polyfill": "^1.0.1",
62
+ "open": "^11.0.0",
63
+ "oxfmt": "^0.44.0",
64
+ "prettier": "^3.8.1",
65
+ "rehype-stringify": "^10.0.1",
66
+ "remark-frontmatter": "^5.0.0",
67
+ "remark-parse": "^11.0.0",
68
+ "remark-rehype": "^11.1.2",
69
+ "remark-stringify": "^11.0.0",
70
+ "simple-git": "^3.35.2",
71
+ "tsdown": "^0.21.7",
72
+ "typescript": "^6.0.2",
73
+ "unified": "^11.0.5",
74
+ "vitest": "^4.1.4",
75
+ "yaml": "^2.8.3"
76
+ },
77
+ "inlinedDependencies": {
78
+ "@clack/core": "1.2.0",
79
+ "@clack/prompts": "1.2.0",
80
+ "@kwsites/file-exists": "1.1.1",
81
+ "@kwsites/promise-deferred": "1.1.1",
82
+ "@octokit/auth-token": "6.0.0",
83
+ "@octokit/core": "7.0.6",
84
+ "@octokit/endpoint": "11.0.3",
85
+ "@octokit/graphql": "9.0.3",
86
+ "@octokit/plugin-paginate-rest": "14.0.0",
87
+ "@octokit/plugin-request-log": "6.0.0",
88
+ "@octokit/plugin-rest-endpoint-methods": "17.0.0",
89
+ "@octokit/request": "10.0.8",
90
+ "@octokit/request-error": "7.1.0",
91
+ "@octokit/rest": "22.0.1",
92
+ "@simple-git/args-pathspec": "1.0.2",
93
+ "@simple-git/argv-parser": "1.0.3",
94
+ "bail": "2.0.2",
95
+ "before-after-hook": "4.0.0",
96
+ "character-entities": "2.0.2",
97
+ "debug": "4.4.3",
98
+ "decode-named-character-reference": "1.3.0",
99
+ "devlop": "1.1.0",
100
+ "escape-string-regexp": "5.0.0",
101
+ "extend": "3.0.2",
102
+ "fast-content-type-parse": "3.0.0",
103
+ "fast-string-truncated-width": "1.2.1",
104
+ "fast-string-width": "1.1.0",
105
+ "fast-wrap-ansi": "0.1.6",
106
+ "fault": "2.0.1",
107
+ "format": "0.2.2",
108
+ "glob": "13.0.6",
109
+ "has-flag": "4.0.0",
110
+ "is-plain-obj": "4.1.0",
111
+ "json-with-bigint": "3.5.8",
112
+ "localstorage-polyfill": "1.0.1",
113
+ "longest-streak": "3.1.0",
114
+ "mdast-util-from-markdown": "2.0.3",
115
+ "mdast-util-frontmatter": "2.0.1",
116
+ "mdast-util-phrasing": "4.1.0",
117
+ "mdast-util-to-markdown": "2.1.2",
118
+ "mdast-util-to-string": "4.0.0",
119
+ "micromark": "4.0.2",
120
+ "micromark-core-commonmark": "2.0.3",
121
+ "micromark-extension-frontmatter": "2.0.0",
122
+ "micromark-factory-destination": "2.0.1",
123
+ "micromark-factory-label": "2.0.1",
124
+ "micromark-factory-space": "2.0.1",
125
+ "micromark-factory-title": "2.0.1",
126
+ "micromark-factory-whitespace": "2.0.1",
127
+ "micromark-util-character": "2.1.1",
128
+ "micromark-util-chunked": "2.0.1",
129
+ "micromark-util-classify-character": "2.0.1",
130
+ "micromark-util-combine-extensions": "2.0.1",
131
+ "micromark-util-decode-numeric-character-reference": "2.0.2",
132
+ "micromark-util-decode-string": "2.0.1",
133
+ "micromark-util-html-tag-name": "2.0.1",
134
+ "micromark-util-normalize-identifier": "2.0.1",
135
+ "micromark-util-resolve-all": "2.0.1",
136
+ "micromark-util-subtokenize": "2.1.0",
137
+ "ms": "2.1.3",
138
+ "remark-frontmatter": "5.0.0",
139
+ "remark-parse": "11.0.0",
140
+ "remark-stringify": "11.0.0",
141
+ "simple-git": "3.35.2",
142
+ "sisteransi": "1.0.5",
143
+ "supports-color": "7.2.0",
144
+ "trough": "2.2.0",
145
+ "unified": "11.0.5",
146
+ "unist-util-is": "6.0.1",
147
+ "unist-util-stringify-position": "4.0.0",
148
+ "unist-util-visit": "5.1.0",
149
+ "unist-util-visit-parents": "6.0.2",
150
+ "universal-user-agent": "7.0.3",
151
+ "vfile": "6.0.3",
152
+ "vfile-message": "4.0.3",
153
+ "yaml": "2.8.3",
154
+ "zwitch": "2.0.4"
155
+ }
156
+ }
@@ -0,0 +1,33 @@
1
+ import {
2
+ createChangelogGenerator,
3
+ createFormatter,
4
+ createGitHubReleaser,
5
+ createNpmPublisher,
6
+ defineConfig,
7
+ } from "cngpac";
8
+
9
+ export default defineConfig({
10
+ package: "__PACKAGE__",
11
+ repository: {
12
+ owner: "__OWNER__",
13
+ name: "__REPO__",
14
+ },
15
+ changelog: {
16
+ generator: createChangelogGenerator({
17
+ githubToken: process.env.GITHUB_TOKEN!,
18
+ }),
19
+ },
20
+ publishers: [
21
+ createNpmPublisher({
22
+ provenance: true,
23
+ }),
24
+ ],
25
+ releasers: [
26
+ createGitHubReleaser({
27
+ token: process.env.GITHUB_TOKEN!,
28
+ }),
29
+ ],
30
+ // formatters: [
31
+ // createFormatter({ extensions: ["json", "md"], command: "oxfmt" }),
32
+ // ],
33
+ });
@@ -0,0 +1,30 @@
1
+ name: Cngpac Version
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths:
7
+ - ".changenotes/prepare.json"
8
+
9
+ permissions:
10
+ id-token: write
11
+ contents: write
12
+
13
+ jobs:
14
+ version:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: Checkout repository
18
+ uses: actions/checkout@v4
19
+ - run: npm install -g corepack
20
+ - run: corepack enable
21
+ - name: Setup runtime
22
+ uses: __RUNTIME_ACTION__
23
+ - name: Install dependencies
24
+ run: __INSTALL__
25
+ - name: Build package
26
+ run: npm run build
27
+ - name: Version
28
+ run: npx cngpac version --commit --tag --push --publish --release
29
+ env:
30
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}