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,110 @@
1
+ //#region node_modules/.pnpm/unist-util-is@6.0.1/node_modules/unist-util-is/lib/index.js
2
+ /**
3
+ * Generate an assertion from a test.
4
+ *
5
+ * Useful if you’re going to test many nodes, for example when creating a
6
+ * utility where something else passes a compatible test.
7
+ *
8
+ * The created function is a bit faster because it expects valid input only:
9
+ * a `node`, `index`, and `parent`.
10
+ *
11
+ * @param {Test} test
12
+ * * when nullish, checks if `node` is a `Node`.
13
+ * * when `string`, works like passing `(node) => node.type === test`.
14
+ * * when `function` checks if function passed the node is true.
15
+ * * when `object`, checks that all keys in test are in node, and that they have (strictly) equal values.
16
+ * * when `array`, checks if any one of the subtests pass.
17
+ * @returns {Check}
18
+ * An assertion.
19
+ */
20
+ const convert = (function(test) {
21
+ if (test === null || test === void 0) return ok;
22
+ if (typeof test === "function") return castFactory(test);
23
+ if (typeof test === "object") return Array.isArray(test) ? anyFactory(test) : propertiesFactory(test);
24
+ if (typeof test === "string") return typeFactory(test);
25
+ throw new Error("Expected function, string, or object as test");
26
+ });
27
+ /**
28
+ * @param {Array<Props | TestFunction | string>} tests
29
+ * @returns {Check}
30
+ */
31
+ function anyFactory(tests) {
32
+ /** @type {Array<Check>} */
33
+ const checks = [];
34
+ let index = -1;
35
+ while (++index < tests.length) checks[index] = convert(tests[index]);
36
+ return castFactory(any);
37
+ /**
38
+ * @this {unknown}
39
+ * @type {TestFunction}
40
+ */
41
+ function any(...parameters) {
42
+ let index = -1;
43
+ while (++index < checks.length) if (checks[index].apply(this, parameters)) return true;
44
+ return false;
45
+ }
46
+ }
47
+ /**
48
+ * Turn an object into a test for a node with a certain fields.
49
+ *
50
+ * @param {Props} check
51
+ * @returns {Check}
52
+ */
53
+ function propertiesFactory(check) {
54
+ const checkAsRecord = check;
55
+ return castFactory(all);
56
+ /**
57
+ * @param {Node} node
58
+ * @returns {boolean}
59
+ */
60
+ function all(node) {
61
+ const nodeAsRecord = node;
62
+ /** @type {string} */
63
+ let key;
64
+ for (key in check) if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
65
+ return true;
66
+ }
67
+ }
68
+ /**
69
+ * Turn a string into a test for a node with a certain type.
70
+ *
71
+ * @param {string} check
72
+ * @returns {Check}
73
+ */
74
+ function typeFactory(check) {
75
+ return castFactory(type);
76
+ /**
77
+ * @param {Node} node
78
+ */
79
+ function type(node) {
80
+ return node && node.type === check;
81
+ }
82
+ }
83
+ /**
84
+ * Turn a custom test into a test for a node that passes that test.
85
+ *
86
+ * @param {TestFunction} testFunction
87
+ * @returns {Check}
88
+ */
89
+ function castFactory(testFunction) {
90
+ return check;
91
+ /**
92
+ * @this {unknown}
93
+ * @type {Check}
94
+ */
95
+ function check(value, index, parent) {
96
+ return Boolean(looksLikeANode(value) && testFunction.call(this, value, typeof index === "number" ? index : void 0, parent || void 0));
97
+ }
98
+ }
99
+ function ok() {
100
+ return true;
101
+ }
102
+ /**
103
+ * @param {unknown} value
104
+ * @returns {value is Node}
105
+ */
106
+ function looksLikeANode(value) {
107
+ return value !== null && typeof value === "object" && "type" in value;
108
+ }
109
+ //#endregion
110
+ export { convert };
@@ -0,0 +1,65 @@
1
+ //#region node_modules/.pnpm/unist-util-stringify-position@4.0.0/node_modules/unist-util-stringify-position/lib/index.js
2
+ /**
3
+ * @typedef {import('unist').Node} Node
4
+ * @typedef {import('unist').Point} Point
5
+ * @typedef {import('unist').Position} Position
6
+ */
7
+ /**
8
+ * @typedef NodeLike
9
+ * @property {string} type
10
+ * @property {PositionLike | null | undefined} [position]
11
+ *
12
+ * @typedef PointLike
13
+ * @property {number | null | undefined} [line]
14
+ * @property {number | null | undefined} [column]
15
+ * @property {number | null | undefined} [offset]
16
+ *
17
+ * @typedef PositionLike
18
+ * @property {PointLike | null | undefined} [start]
19
+ * @property {PointLike | null | undefined} [end]
20
+ */
21
+ /**
22
+ * Serialize the positional info of a point, position (start and end points),
23
+ * or node.
24
+ *
25
+ * @param {Node | NodeLike | Point | PointLike | Position | PositionLike | null | undefined} [value]
26
+ * Node, position, or point.
27
+ * @returns {string}
28
+ * Pretty printed positional info of a node (`string`).
29
+ *
30
+ * In the format of a range `ls:cs-le:ce` (when given `node` or `position`)
31
+ * or a point `l:c` (when given `point`), where `l` stands for line, `c` for
32
+ * column, `s` for `start`, and `e` for end.
33
+ * An empty string (`''`) is returned if the given value is neither `node`,
34
+ * `position`, nor `point`.
35
+ */
36
+ function stringifyPosition(value) {
37
+ if (!value || typeof value !== "object") return "";
38
+ if ("position" in value || "type" in value) return position(value.position);
39
+ if ("start" in value || "end" in value) return position(value);
40
+ if ("line" in value || "column" in value) return point(value);
41
+ return "";
42
+ }
43
+ /**
44
+ * @param {Point | PointLike | null | undefined} point
45
+ * @returns {string}
46
+ */
47
+ function point(point) {
48
+ return index(point && point.line) + ":" + index(point && point.column);
49
+ }
50
+ /**
51
+ * @param {Position | PositionLike | null | undefined} pos
52
+ * @returns {string}
53
+ */
54
+ function position(pos) {
55
+ return point(pos && pos.start) + "-" + point(pos && pos.end);
56
+ }
57
+ /**
58
+ * @param {number | null | undefined} value
59
+ * @returns {number}
60
+ */
61
+ function index(value) {
62
+ return value && typeof value === "number" ? value : 1;
63
+ }
64
+ //#endregion
65
+ export { stringifyPosition };
@@ -0,0 +1,10 @@
1
+ //#region node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/color.node.js
2
+ /**
3
+ * @param {string} d
4
+ * @returns {string}
5
+ */
6
+ function color(d) {
7
+ return "\x1B[33m" + d + "\x1B[39m";
8
+ }
9
+ //#endregion
10
+ export { color };
@@ -0,0 +1,328 @@
1
+ import { convert } from "../../../../unist-util-is@6.0.1/node_modules/unist-util-is/lib/index.mjs";
2
+ import { color } from "./color.node.mjs";
3
+ //#region node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/index.js
4
+ /**
5
+ * @import {Node as UnistNode, Parent as UnistParent} from 'unist'
6
+ */
7
+ /**
8
+ * @typedef {Exclude<import('unist-util-is').Test, undefined> | undefined} Test
9
+ * Test from `unist-util-is`.
10
+ *
11
+ * Note: we have remove and add `undefined`, because otherwise when generating
12
+ * automatic `.d.ts` files, TS tries to flatten paths from a local perspective,
13
+ * which doesn’t work when publishing on npm.
14
+ */
15
+ /**
16
+ * @typedef {(
17
+ * Fn extends (value: any) => value is infer Thing
18
+ * ? Thing
19
+ * : Fallback
20
+ * )} Predicate
21
+ * Get the value of a type guard `Fn`.
22
+ * @template Fn
23
+ * Value; typically function that is a type guard (such as `(x): x is Y`).
24
+ * @template Fallback
25
+ * Value to yield if `Fn` is not a type guard.
26
+ */
27
+ /**
28
+ * @typedef {(
29
+ * Check extends null | undefined // No test.
30
+ * ? Value
31
+ * : Value extends {type: Check} // String (type) test.
32
+ * ? Value
33
+ * : Value extends Check // Partial test.
34
+ * ? Value
35
+ * : Check extends Function // Function test.
36
+ * ? Predicate<Check, Value> extends Value
37
+ * ? Predicate<Check, Value>
38
+ * : never
39
+ * : never // Some other test?
40
+ * )} MatchesOne
41
+ * Check whether a node matches a primitive check in the type system.
42
+ * @template Value
43
+ * Value; typically unist `Node`.
44
+ * @template Check
45
+ * Value; typically `unist-util-is`-compatible test, but not arrays.
46
+ */
47
+ /**
48
+ * @typedef {(
49
+ * Check extends ReadonlyArray<infer T>
50
+ * ? MatchesOne<Value, T>
51
+ * : Check extends Array<infer T>
52
+ * ? MatchesOne<Value, T>
53
+ * : MatchesOne<Value, Check>
54
+ * )} Matches
55
+ * Check whether a node matches a check in the type system.
56
+ * @template Value
57
+ * Value; typically unist `Node`.
58
+ * @template Check
59
+ * Value; typically `unist-util-is`-compatible test.
60
+ */
61
+ /**
62
+ * @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint
63
+ * Number; capped reasonably.
64
+ */
65
+ /**
66
+ * @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment
67
+ * Increment a number in the type system.
68
+ * @template {Uint} [I=0]
69
+ * Index.
70
+ */
71
+ /**
72
+ * @typedef {(
73
+ * Node extends UnistParent
74
+ * ? Node extends {children: Array<infer Children>}
75
+ * ? Child extends Children ? Node : never
76
+ * : never
77
+ * : never
78
+ * )} InternalParent
79
+ * Collect nodes that can be parents of `Child`.
80
+ * @template {UnistNode} Node
81
+ * All node types in a tree.
82
+ * @template {UnistNode} Child
83
+ * Node to search for.
84
+ */
85
+ /**
86
+ * @typedef {InternalParent<InclusiveDescendant<Tree>, Child>} Parent
87
+ * Collect nodes in `Tree` that can be parents of `Child`.
88
+ * @template {UnistNode} Tree
89
+ * All node types in a tree.
90
+ * @template {UnistNode} Child
91
+ * Node to search for.
92
+ */
93
+ /**
94
+ * @typedef {(
95
+ * Depth extends Max
96
+ * ? never
97
+ * :
98
+ * | InternalParent<Node, Child>
99
+ * | InternalAncestor<Node, InternalParent<Node, Child>, Max, Increment<Depth>>
100
+ * )} InternalAncestor
101
+ * Collect nodes in `Tree` that can be ancestors of `Child`.
102
+ * @template {UnistNode} Node
103
+ * All node types in a tree.
104
+ * @template {UnistNode} Child
105
+ * Node to search for.
106
+ * @template {Uint} [Max=10]
107
+ * Max; searches up to this depth.
108
+ * @template {Uint} [Depth=0]
109
+ * Current depth.
110
+ */
111
+ /**
112
+ * @typedef {InternalAncestor<InclusiveDescendant<Tree>, Child>} Ancestor
113
+ * Collect nodes in `Tree` that can be ancestors of `Child`.
114
+ * @template {UnistNode} Tree
115
+ * All node types in a tree.
116
+ * @template {UnistNode} Child
117
+ * Node to search for.
118
+ */
119
+ /**
120
+ * @typedef {(
121
+ * Tree extends UnistParent
122
+ * ? Depth extends Max
123
+ * ? Tree
124
+ * : Tree | InclusiveDescendant<Tree['children'][number], Max, Increment<Depth>>
125
+ * : Tree
126
+ * )} InclusiveDescendant
127
+ * Collect all (inclusive) descendants of `Tree`.
128
+ *
129
+ * > 👉 **Note**: for performance reasons, this seems to be the fastest way to
130
+ * > recurse without actually running into an infinite loop, which the
131
+ * > previous version did.
132
+ * >
133
+ * > Practically, a max of `2` is typically enough assuming a `Root` is
134
+ * > passed, but it doesn’t improve performance.
135
+ * > It gets higher with `List > ListItem > Table > TableRow > TableCell`.
136
+ * > Using up to `10` doesn’t hurt or help either.
137
+ * @template {UnistNode} Tree
138
+ * Tree type.
139
+ * @template {Uint} [Max=10]
140
+ * Max; searches up to this depth.
141
+ * @template {Uint} [Depth=0]
142
+ * Current depth.
143
+ */
144
+ /**
145
+ * @typedef {'skip' | boolean} Action
146
+ * Union of the action types.
147
+ *
148
+ * @typedef {number} Index
149
+ * Move to the sibling at `index` next (after node itself is completely
150
+ * traversed).
151
+ *
152
+ * Useful if mutating the tree, such as removing the node the visitor is
153
+ * currently on, or any of its previous siblings.
154
+ * Results less than 0 or greater than or equal to `children.length` stop
155
+ * traversing the parent.
156
+ *
157
+ * @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple
158
+ * List with one or two values, the first an action, the second an index.
159
+ *
160
+ * @typedef {Action | ActionTuple | Index | null | undefined | void} VisitorResult
161
+ * Any value that can be returned from a visitor.
162
+ */
163
+ /**
164
+ * @callback Visitor
165
+ * Handle a node (matching `test`, if given).
166
+ *
167
+ * Visitors are free to transform `node`.
168
+ * They can also transform the parent of node (the last of `ancestors`).
169
+ *
170
+ * Replacing `node` itself, if `SKIP` is not returned, still causes its
171
+ * descendants to be walked (which is a bug).
172
+ *
173
+ * When adding or removing previous siblings of `node` (or next siblings, in
174
+ * case of reverse), the `Visitor` should return a new `Index` to specify the
175
+ * sibling to traverse after `node` is traversed.
176
+ * Adding or removing next siblings of `node` (or previous siblings, in case
177
+ * of reverse) is handled as expected without needing to return a new `Index`.
178
+ *
179
+ * Removing the children property of an ancestor still results in them being
180
+ * traversed.
181
+ * @param {Visited} node
182
+ * Found node.
183
+ * @param {Array<VisitedParents>} ancestors
184
+ * Ancestors of `node`.
185
+ * @returns {VisitorResult}
186
+ * What to do next.
187
+ *
188
+ * An `Index` is treated as a tuple of `[CONTINUE, Index]`.
189
+ * An `Action` is treated as a tuple of `[Action]`.
190
+ *
191
+ * Passing a tuple back only makes sense if the `Action` is `SKIP`.
192
+ * When the `Action` is `EXIT`, that action can be returned.
193
+ * When the `Action` is `CONTINUE`, `Index` can be returned.
194
+ * @template {UnistNode} [Visited=UnistNode]
195
+ * Visited node type.
196
+ * @template {UnistParent} [VisitedParents=UnistParent]
197
+ * Ancestor type.
198
+ */
199
+ /**
200
+ * @typedef {Visitor<Matches<InclusiveDescendant<Tree>, Check>, Ancestor<Tree, Matches<InclusiveDescendant<Tree>, Check>>>} BuildVisitor
201
+ * Build a typed `Visitor` function from a tree and a test.
202
+ *
203
+ * It will infer which values are passed as `node` and which as `parents`.
204
+ * @template {UnistNode} [Tree=UnistNode]
205
+ * Tree type.
206
+ * @template {Test} [Check=Test]
207
+ * Test type.
208
+ */
209
+ /** @type {Readonly<ActionTuple>} */
210
+ const empty = [];
211
+ /**
212
+ * Do not traverse this node’s children.
213
+ */
214
+ const SKIP = "skip";
215
+ /**
216
+ * Visit nodes, with ancestral information.
217
+ *
218
+ * This algorithm performs *depth-first* *tree traversal* in *preorder*
219
+ * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).
220
+ *
221
+ * You can choose for which nodes `visitor` is called by passing a `test`.
222
+ * For complex tests, you should test yourself in `visitor`, as it will be
223
+ * faster and will have improved type information.
224
+ *
225
+ * Walking the tree is an intensive task.
226
+ * Make use of the return values of the visitor when possible.
227
+ * Instead of walking a tree multiple times, walk it once, use `unist-util-is`
228
+ * to check if a node matches, and then perform different operations.
229
+ *
230
+ * You can change the tree.
231
+ * See `Visitor` for more info.
232
+ *
233
+ * @overload
234
+ * @param {Tree} tree
235
+ * @param {Check} check
236
+ * @param {BuildVisitor<Tree, Check>} visitor
237
+ * @param {boolean | null | undefined} [reverse]
238
+ * @returns {undefined}
239
+ *
240
+ * @overload
241
+ * @param {Tree} tree
242
+ * @param {BuildVisitor<Tree>} visitor
243
+ * @param {boolean | null | undefined} [reverse]
244
+ * @returns {undefined}
245
+ *
246
+ * @param {UnistNode} tree
247
+ * Tree to traverse.
248
+ * @param {Visitor | Test} test
249
+ * `unist-util-is`-compatible test
250
+ * @param {Visitor | boolean | null | undefined} [visitor]
251
+ * Handle each node.
252
+ * @param {boolean | null | undefined} [reverse]
253
+ * Traverse in reverse preorder (NRL) instead of the default preorder (NLR).
254
+ * @returns {undefined}
255
+ * Nothing.
256
+ *
257
+ * @template {UnistNode} Tree
258
+ * Node type.
259
+ * @template {Test} Check
260
+ * `unist-util-is`-compatible test.
261
+ */
262
+ function visitParents(tree, test, visitor, reverse) {
263
+ /** @type {Test} */
264
+ let check;
265
+ if (typeof test === "function" && typeof visitor !== "function") {
266
+ reverse = visitor;
267
+ visitor = test;
268
+ } else check = test;
269
+ const is = convert(check);
270
+ const step = reverse ? -1 : 1;
271
+ factory(tree, void 0, [])();
272
+ /**
273
+ * @param {UnistNode} node
274
+ * @param {number | undefined} index
275
+ * @param {Array<UnistParent>} parents
276
+ */
277
+ function factory(node, index, parents) {
278
+ const value = node && typeof node === "object" ? node : {};
279
+ if (typeof value.type === "string") {
280
+ const name = typeof value.tagName === "string" ? value.tagName : typeof value.name === "string" ? value.name : void 0;
281
+ Object.defineProperty(visit, "name", { value: "node (" + color(node.type + (name ? "<" + name + ">" : "")) + ")" });
282
+ }
283
+ return visit;
284
+ function visit() {
285
+ /** @type {Readonly<ActionTuple>} */
286
+ let result = empty;
287
+ /** @type {Readonly<ActionTuple>} */
288
+ let subresult;
289
+ /** @type {number} */
290
+ let offset;
291
+ /** @type {Array<UnistParent>} */
292
+ let grandparents;
293
+ if (!test || is(node, index, parents[parents.length - 1] || void 0)) {
294
+ result = toResult(visitor(node, parents));
295
+ if (result[0] === false) return result;
296
+ }
297
+ if ("children" in node && node.children) {
298
+ const nodeAsParent = node;
299
+ if (nodeAsParent.children && result[0] !== "skip") {
300
+ offset = (reverse ? nodeAsParent.children.length : -1) + step;
301
+ grandparents = parents.concat(nodeAsParent);
302
+ while (offset > -1 && offset < nodeAsParent.children.length) {
303
+ const child = nodeAsParent.children[offset];
304
+ subresult = factory(child, offset, grandparents)();
305
+ if (subresult[0] === false) return subresult;
306
+ offset = typeof subresult[1] === "number" ? subresult[1] : offset + step;
307
+ }
308
+ }
309
+ }
310
+ return result;
311
+ }
312
+ }
313
+ }
314
+ /**
315
+ * Turn a return value into a clean result.
316
+ *
317
+ * @param {VisitorResult} value
318
+ * Valid return values from visitors.
319
+ * @returns {Readonly<ActionTuple>}
320
+ * Clean result.
321
+ */
322
+ function toResult(value) {
323
+ if (Array.isArray(value)) return value;
324
+ if (typeof value === "number") return [true, value];
325
+ return value === null || value === void 0 ? empty : [value];
326
+ }
327
+ //#endregion
328
+ export { SKIP, visitParents };