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.
- package/LICENSE +201 -0
- package/dist/bin.mjs +24025 -0
- package/dist/src/_virtual/_rolldown/runtime.mjs +35 -0
- package/dist/src/changelog.d.mts +71 -0
- package/dist/src/changelog.mjs +92 -0
- package/dist/src/changenote.d.mts +41 -0
- package/dist/src/changenote.mjs +184 -0
- package/dist/src/cli/commands/change.d.mts +4 -0
- package/dist/src/cli/commands/change.mjs +75 -0
- package/dist/src/formatter.d.mts +31 -0
- package/dist/src/formatter.mjs +50 -0
- package/dist/src/git.d.mts +20 -0
- package/dist/src/git.mjs +121 -0
- package/dist/src/index.d.mts +19 -0
- package/dist/src/index.mjs +20 -0
- package/dist/src/node_modules/.pnpm/@clack_core@1.2.0/node_modules/@clack/core/dist/index.mjs +530 -0
- package/dist/src/node_modules/.pnpm/@clack_prompts@1.2.0/node_modules/@clack/prompts/dist/index.mjs +110 -0
- package/dist/src/node_modules/.pnpm/@kwsites_file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/index.mjs +13 -0
- package/dist/src/node_modules/.pnpm/@kwsites_file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/src/index.mjs +59 -0
- package/dist/src/node_modules/.pnpm/@kwsites_promise-deferred@1.1.1/node_modules/@kwsites/promise-deferred/dist/index.mjs +55 -0
- package/dist/src/node_modules/.pnpm/@octokit_auth-token@6.0.0/node_modules/@octokit/auth-token/dist-bundle/index.mjs +32 -0
- package/dist/src/node_modules/.pnpm/@octokit_core@7.0.6/node_modules/@octokit/core/dist-src/index.mjs +94 -0
- package/dist/src/node_modules/.pnpm/@octokit_core@7.0.6/node_modules/@octokit/core/dist-src/version.mjs +4 -0
- package/dist/src/node_modules/.pnpm/@octokit_endpoint@11.0.3/node_modules/@octokit/endpoint/dist-bundle/index.mjs +223 -0
- package/dist/src/node_modules/.pnpm/@octokit_graphql@9.0.3/node_modules/@octokit/graphql/dist-bundle/index.mjs +90 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/src/node_modules/.pnpm/@octokit_request-error@7.1.0/node_modules/@octokit/request-error/dist-src/index.mjs +30 -0
- package/dist/src/node_modules/.pnpm/@octokit_request@10.0.8/node_modules/@octokit/request/dist-bundle/index.mjs +146 -0
- package/dist/src/node_modules/.pnpm/@octokit_rest@22.0.1/node_modules/@octokit/rest/dist-src/index.mjs +9 -0
- package/dist/src/node_modules/.pnpm/@octokit_rest@22.0.1/node_modules/@octokit/rest/dist-src/version.mjs +4 -0
- package/dist/src/node_modules/.pnpm/@simple-git_args-pathspec@1.0.2/node_modules/@simple-git/args-pathspec/dist/index.mjs +14 -0
- package/dist/src/node_modules/.pnpm/@simple-git_argv-parser@1.0.3/node_modules/@simple-git/argv-parser/dist/index.mjs +369 -0
- package/dist/src/node_modules/.pnpm/bail@2.0.2/node_modules/bail/index.mjs +13 -0
- package/dist/src/node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/index.mjs +43 -0
- package/dist/src/node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/lib/add.mjs +28 -0
- package/dist/src/node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/lib/register.mjs +16 -0
- package/dist/src/node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/lib/remove.mjs +11 -0
- package/dist/src/node_modules/.pnpm/character-entities@2.0.2/node_modules/character-entities/index.mjs +2135 -0
- package/dist/src/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.mjs +200 -0
- package/dist/src/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.mjs +206 -0
- package/dist/src/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/index.mjs +15 -0
- package/dist/src/node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/node.mjs +212 -0
- package/dist/src/node_modules/.pnpm/decode-named-character-reference@1.3.0/node_modules/decode-named-character-reference/index.mjs +19 -0
- package/dist/src/node_modules/.pnpm/devlop@1.1.0/node_modules/devlop/lib/default.mjs +4 -0
- package/dist/src/node_modules/.pnpm/escape-string-regexp@5.0.0/node_modules/escape-string-regexp/index.mjs +7 -0
- package/dist/src/node_modules/.pnpm/extend@3.0.2/node_modules/extend/index.mjs +76 -0
- package/dist/src/node_modules/.pnpm/fast-content-type-parse@3.0.0/node_modules/fast-content-type-parse/index.mjs +115 -0
- package/dist/src/node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.mjs +138 -0
- package/dist/src/node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.mjs +12 -0
- package/dist/src/node_modules/.pnpm/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.mjs +12 -0
- package/dist/src/node_modules/.pnpm/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.mjs +165 -0
- package/dist/src/node_modules/.pnpm/fault@2.0.1/node_modules/fault/index.mjs +38 -0
- package/dist/src/node_modules/.pnpm/format@0.2.2/node_modules/format/format.mjs +87 -0
- package/dist/src/node_modules/.pnpm/glob@13.0.6/node_modules/glob/dist/esm/index.min.mjs +3125 -0
- package/dist/src/node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.mjs +13 -0
- package/dist/src/node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.mjs +8 -0
- package/dist/src/node_modules/.pnpm/json-with-bigint@3.5.8/node_modules/json-with-bigint/json-with-bigint.mjs +137 -0
- package/dist/src/node_modules/.pnpm/localstorage-polyfill@1.0.1/node_modules/localstorage-polyfill/localStorage.mjs +39 -0
- package/dist/src/node_modules/.pnpm/longest-streak@3.1.0/node_modules/longest-streak/index.mjs +29 -0
- package/dist/src/node_modules/.pnpm/mdast-util-from-markdown@2.0.3/node_modules/mdast-util-from-markdown/lib/index.mjs +976 -0
- package/dist/src/node_modules/.pnpm/mdast-util-frontmatter@2.0.1/node_modules/mdast-util-frontmatter/lib/index.mjs +162 -0
- package/dist/src/node_modules/.pnpm/mdast-util-phrasing@4.1.0/node_modules/mdast-util-phrasing/lib/index.mjs +36 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/configure.mjs +48 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/index.mjs +161 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/join.mjs +18 -0
- package/dist/src/node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/unsafe.mjs +223 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/src/node_modules/.pnpm/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.mjs +83 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/attention.mjs +224 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/autolink.mjs +213 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/blank-line.mjs +60 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/block-quote.mjs +130 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/character-escape.mjs +62 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/character-reference.mjs +141 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/code-fenced.mjs +418 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/code-indented.mjs +147 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/code-text.mjs +187 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/content.mjs +137 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/definition.mjs +223 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/hard-break-escape.mjs +59 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/heading-atx.mjs +189 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/html-flow.mjs +777 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/html-text.mjs +617 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/label-end.mjs +479 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/label-start-image.mjs +95 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/label-start-link.mjs +50 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/line-ending.mjs +32 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/list.mjs +177 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/setext-underline.mjs +155 -0
- package/dist/src/node_modules/.pnpm/micromark-core-commonmark@2.0.3/node_modules/micromark-core-commonmark/lib/thematic-break.mjs +98 -0
- package/dist/src/node_modules/.pnpm/micromark-extension-frontmatter@2.0.0/node_modules/micromark-extension-frontmatter/lib/syntax.mjs +352 -0
- package/dist/src/node_modules/.pnpm/micromark-extension-frontmatter@2.0.0/node_modules/micromark-extension-frontmatter/lib/to-matters.mjs +109 -0
- package/dist/src/node_modules/.pnpm/micromark-factory-destination@2.0.1/node_modules/micromark-factory-destination/index.mjs +186 -0
- package/dist/src/node_modules/.pnpm/micromark-factory-label@2.0.1/node_modules/micromark-factory-label/index.mjs +134 -0
- package/dist/src/node_modules/.pnpm/micromark-factory-space@2.0.1/node_modules/micromark-factory-space/index.mjs +61 -0
- package/dist/src/node_modules/.pnpm/micromark-factory-title@2.0.1/node_modules/micromark-factory-title/index.mjs +148 -0
- package/dist/src/node_modules/.pnpm/micromark-factory-whitespace@2.0.1/node_modules/micromark-factory-whitespace/index.mjs +43 -0
- package/dist/src/node_modules/.pnpm/micromark-util-character@2.1.1/node_modules/micromark-util-character/index.mjs +229 -0
- package/dist/src/node_modules/.pnpm/micromark-util-chunked@2.0.1/node_modules/micromark-util-chunked/index.mjs +71 -0
- package/dist/src/node_modules/.pnpm/micromark-util-classify-character@2.0.1/node_modules/micromark-util-classify-character/index.mjs +25 -0
- package/dist/src/node_modules/.pnpm/micromark-util-combine-extensions@2.0.1/node_modules/micromark-util-combine-extensions/index.mjs +73 -0
- 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
- package/dist/src/node_modules/.pnpm/micromark-util-decode-string@2.0.1/node_modules/micromark-util-decode-string/index.mjs +40 -0
- 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
- package/dist/src/node_modules/.pnpm/micromark-util-normalize-identifier@2.0.1/node_modules/micromark-util-normalize-identifier/index.mjs +25 -0
- package/dist/src/node_modules/.pnpm/micromark-util-resolve-all@2.0.1/node_modules/micromark-util-resolve-all/index.mjs +31 -0
- package/dist/src/node_modules/.pnpm/micromark-util-subtokenize@2.1.0/node_modules/micromark-util-subtokenize/index.mjs +158 -0
- package/dist/src/node_modules/.pnpm/micromark-util-subtokenize@2.1.0/node_modules/micromark-util-subtokenize/lib/splice-buffer.mjs +231 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/constructs.mjs +101 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/create-tokenizer.mjs +473 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/content.mjs +70 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/document.mjs +220 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/flow.mjs +51 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/initialize/text.mjs +178 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/parse.mjs +52 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/postprocess.mjs +17 -0
- package/dist/src/node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/lib/preprocess.mjs +102 -0
- package/dist/src/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.mjs +121 -0
- package/dist/src/node_modules/.pnpm/remark-frontmatter@5.0.0/node_modules/remark-frontmatter/lib/index.mjs +35 -0
- package/dist/src/node_modules/.pnpm/remark-parse@11.0.0/node_modules/remark-parse/lib/index.mjs +37 -0
- package/dist/src/node_modules/.pnpm/remark-stringify@11.0.0/node_modules/remark-stringify/lib/index.mjs +36 -0
- package/dist/src/node_modules/.pnpm/simple-git@3.35.2/node_modules/simple-git/dist/esm/index.mjs +3563 -0
- package/dist/src/node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.mjs +57 -0
- package/dist/src/node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.mjs +72 -0
- package/dist/src/node_modules/.pnpm/trough@2.2.0/node_modules/trough/lib/index.mjs +157 -0
- package/dist/src/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/callable-instance.mjs +13 -0
- package/dist/src/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.mjs +1088 -0
- package/dist/src/node_modules/.pnpm/unist-util-is@6.0.1/node_modules/unist-util-is/lib/index.mjs +110 -0
- package/dist/src/node_modules/.pnpm/unist-util-stringify-position@4.0.0/node_modules/unist-util-stringify-position/lib/index.mjs +65 -0
- 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
- package/dist/src/node_modules/.pnpm/unist-util-visit-parents@6.0.2/node_modules/unist-util-visit-parents/lib/index.mjs +328 -0
- package/dist/src/node_modules/.pnpm/unist-util-visit@5.1.0/node_modules/unist-util-visit/lib/index.mjs +287 -0
- package/dist/src/node_modules/.pnpm/universal-user-agent@7.0.3/node_modules/universal-user-agent/index.mjs +8 -0
- package/dist/src/node_modules/.pnpm/vfile-message@4.0.3/node_modules/vfile-message/lib/index.mjs +247 -0
- package/dist/src/node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/lib/index.mjs +525 -0
- package/dist/src/node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/lib/minpath.mjs +2 -0
- package/dist/src/node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/lib/minproc.mjs +2 -0
- package/dist/src/node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/lib/minurl.mjs +3 -0
- package/dist/src/node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/lib/minurl.shared.mjs +24 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-collection.mjs +62 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-doc.mjs +49 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-node.mjs +98 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-scalar.mjs +66 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/composer.mjs +207 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-map.mjs +93 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-scalar.mjs +179 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-seq.mjs +48 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-end.mjs +41 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-collection.mjs +166 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-scalar.mjs +211 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-props.mjs +110 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-contains-newline.mjs +32 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-empty-scalar-position.mjs +30 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-flow-indent-check.mjs +16 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-map-includes.mjs +16 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/Document.mjs +295 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/anchors.mjs +67 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/applyReviver.mjs +43 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/createNode.mjs +69 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/directives.mjs +170 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/errors.mjs +56 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/index.mjs +67 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/log.mjs +17 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Alias.mjs +101 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Collection.mjs +127 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Node.mjs +40 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Pair.mjs +40 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Scalar.mjs +33 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLMap.mjs +118 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLSeq.mjs +115 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/addPairToJSMap.mjs +59 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/identity.mjs +53 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/toJS.mjs +41 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-scalar.mjs +274 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-stringify.mjs +54 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-visit.mjs +94 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst.mjs +85 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/lexer.mjs +523 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/line-counter.mjs +50 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/parser.mjs +861 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/public-api.mjs +97 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/Schema.mjs +36 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/map.mjs +22 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/null.mjs +19 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/seq.mjs +22 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/string.mjs +19 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/bool.mjs +23 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/float.mjs +46 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/int.mjs +45 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/schema.mjs +34 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/json/schema.mjs +68 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/tags.mjs +103 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/binary.mjs +53 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/bool.mjs +31 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/float.mjs +49 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/int.mjs +79 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/merge.mjs +45 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/omap.mjs +71 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/pairs.mjs +67 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/schema.mjs +56 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/set.mjs +74 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/timestamp.mjs +87 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/foldFlowLines.mjs +119 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringify.mjs +115 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyCollection.mjs +124 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyComment.mjs +23 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyDocument.mjs +67 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyNumber.mjs +24 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyPair.mjs +104 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyString.mjs +229 -0
- package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/visit.mjs +194 -0
- package/dist/src/node_modules/.pnpm/zwitch@2.0.4/node_modules/zwitch/index.mjs +106 -0
- package/dist/src/pkg.d.mts +24 -0
- package/dist/src/pkg.mjs +39 -0
- package/dist/src/prepare.d.mts +14 -0
- package/dist/src/prepare.mjs +41 -0
- package/dist/src/publishers/npm.d.mts +21 -0
- package/dist/src/publishers/npm.mjs +42 -0
- package/dist/src/releasers/github.d.mts +10 -0
- package/dist/src/releasers/github.mjs +20 -0
- package/dist/src/saver.d.mts +42 -0
- package/dist/src/saver.mjs +39 -0
- package/dist/src/types.d.mts +150 -0
- package/dist/src/utils.d.mts +7 -0
- package/dist/src/utils.mjs +47 -0
- package/dist/src/version.d.mts +9 -0
- package/dist/src/version.mjs +18 -0
- package/package.json +156 -0
- package/templates/cngpac.config.ts +33 -0
- package/templates/version.yml +30 -0
package/dist/src/git.mjs
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { simpleGit } from "./node_modules/.pnpm/simple-git@3.35.2/node_modules/simple-git/dist/esm/index.mjs";
|
|
2
|
+
//#region src/git.ts
|
|
3
|
+
/** Create a git operations instance for a repository */
|
|
4
|
+
function createGitOps(repoDir = ".") {
|
|
5
|
+
const git = simpleGit(repoDir);
|
|
6
|
+
/** Deepen a shallow clone until the add commit for a file is reachable */
|
|
7
|
+
async function deepenForFile(filePath) {
|
|
8
|
+
while (true) {
|
|
9
|
+
const addCommitHash = await git.raw([
|
|
10
|
+
"log",
|
|
11
|
+
"--diff-filter=A",
|
|
12
|
+
"--follow",
|
|
13
|
+
"--format=%H",
|
|
14
|
+
filePath
|
|
15
|
+
]).catch(() => "");
|
|
16
|
+
if (addCommitHash.trim()) {
|
|
17
|
+
const lastCommitHash = await git.raw([
|
|
18
|
+
"rev-list",
|
|
19
|
+
"--max-parents=0",
|
|
20
|
+
"HEAD"
|
|
21
|
+
]).catch(() => "");
|
|
22
|
+
if (addCommitHash.trim() !== lastCommitHash.trim()) return;
|
|
23
|
+
}
|
|
24
|
+
if (!((await git.raw(["rev-parse", "--is-shallow-repository"])).trim() === "true")) return;
|
|
25
|
+
try {
|
|
26
|
+
await git.fetch(["--deepen", "30"]);
|
|
27
|
+
} catch {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
async currentBranch() {
|
|
34
|
+
return (await git.raw(["branch", "--show-current"])).trim();
|
|
35
|
+
},
|
|
36
|
+
async getFileAuthors(file) {
|
|
37
|
+
await deepenForFile(file);
|
|
38
|
+
try {
|
|
39
|
+
const log = await git.log({
|
|
40
|
+
file,
|
|
41
|
+
format: {
|
|
42
|
+
name: "%an",
|
|
43
|
+
email: "%ae"
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const seen = /* @__PURE__ */ new Set();
|
|
47
|
+
const commitAuthors = [];
|
|
48
|
+
for (const entry of log.all.toReversed()) if (!seen.has(entry.email)) {
|
|
49
|
+
seen.add(entry.email);
|
|
50
|
+
commitAuthors.push({
|
|
51
|
+
name: entry.name,
|
|
52
|
+
email: entry.email
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return commitAuthors;
|
|
56
|
+
} catch {
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
async getFileAddCommit(filePath) {
|
|
61
|
+
await deepenForFile(filePath);
|
|
62
|
+
const rawLog = await git.raw([
|
|
63
|
+
"log",
|
|
64
|
+
"--diff-filter=A",
|
|
65
|
+
"--follow",
|
|
66
|
+
`--format={"hash": "%H", "subject": "%s"}`,
|
|
67
|
+
filePath
|
|
68
|
+
]);
|
|
69
|
+
const log = JSON.parse(rawLog.trim());
|
|
70
|
+
return {
|
|
71
|
+
hash: log.hash,
|
|
72
|
+
subject: log.subject
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
async getStagedFiles(pattern) {
|
|
76
|
+
try {
|
|
77
|
+
return (await git.diff(["--staged", "--name-only"])).trim().split("\n").filter((f) => f && (!pattern || pattern.test(f)));
|
|
78
|
+
} catch {
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
async getUnstagedFiles(pattern) {
|
|
83
|
+
try {
|
|
84
|
+
return (await git.diff(["--name-only"])).trim().split("\n").filter((f) => f && (!pattern || pattern.test(f)));
|
|
85
|
+
} catch {
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
async add(file) {
|
|
90
|
+
await git.add(file);
|
|
91
|
+
},
|
|
92
|
+
async commit(message) {
|
|
93
|
+
await git.commit(message);
|
|
94
|
+
},
|
|
95
|
+
async tag(name, message) {
|
|
96
|
+
if (message) await git.addAnnotatedTag(name, message);
|
|
97
|
+
else await git.addTag(name);
|
|
98
|
+
},
|
|
99
|
+
async push(branch) {
|
|
100
|
+
await git.push("origin", branch);
|
|
101
|
+
},
|
|
102
|
+
async pushSetUpstream(branch) {
|
|
103
|
+
await git.raw([
|
|
104
|
+
"push",
|
|
105
|
+
"--set-upstream",
|
|
106
|
+
"origin",
|
|
107
|
+
branch
|
|
108
|
+
]);
|
|
109
|
+
},
|
|
110
|
+
async pushTags(branch) {
|
|
111
|
+
await git.push("origin", branch, ["--tags"]);
|
|
112
|
+
},
|
|
113
|
+
async ensureGitIdentity() {
|
|
114
|
+
const [nameResult, emailResult] = await Promise.all([git.getConfig("user.name"), git.getConfig("user.email")]);
|
|
115
|
+
if (!nameResult.value) await git.addConfig("user.name", "github-actions[bot]");
|
|
116
|
+
if (!emailResult.value) await git.addConfig("user.email", "41898282+github-actions[bot]@users.noreply.github.com");
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
export { createGitOps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BumpType, ChangelogGenerator, ChangelogSaver, Changenote, ChangenoteCommit, ChangenoteMetadata, CngpacConfig, CommitAuthor, DirtyFileAbsPath, FormatterPlugin, NoteNameGenerator, Package, PkgFileAbsPath, PreStagePlugin, PrepareConfig, PublisherPlugin, ReleaserPlugin, VersionBump } from "./types.mjs";
|
|
2
|
+
import { createChangelogGenerator } from "./changelog.mjs";
|
|
3
|
+
import { consumePrepareConfig, parseChangenoteContent, parseChangenotefile, parseFrontmatter, readChangenotes, readPrepareConfig, updateFrontmatter, writeChangenote, writePrepareConfig } from "./changenote.mjs";
|
|
4
|
+
import { defaultGenerateNoteName } from "./cli/commands/change.mjs";
|
|
5
|
+
import { FormatterOptions, createFormatter, formatFiles } from "./formatter.mjs";
|
|
6
|
+
import { createGitOps } from "./git.mjs";
|
|
7
|
+
import { readPkg, updatePkgVersion } from "./pkg.mjs";
|
|
8
|
+
import { calculateVersionBump } from "./prepare.mjs";
|
|
9
|
+
import { NpmPublisherOptions, createNpmPublisher } from "./publishers/npm.mjs";
|
|
10
|
+
import { GitHubReleaserOptions, createGitHubReleaser } from "./releasers/github.mjs";
|
|
11
|
+
import { ChangelogSaverOptions, createChangelogSaver } from "./saver.mjs";
|
|
12
|
+
import { loadConfig } from "./utils.mjs";
|
|
13
|
+
import { applyVersionBump, consumeChangenotes } from "./version.mjs";
|
|
14
|
+
|
|
15
|
+
//#region src/index.d.ts
|
|
16
|
+
/** Type-safe helper for defining a Cngpac configuration object. */
|
|
17
|
+
declare function defineConfig(config: CngpacConfig): CngpacConfig;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { type BumpType, type ChangelogGenerator, type ChangelogSaver, type ChangelogSaverOptions, type Changenote, type ChangenoteCommit, type ChangenoteMetadata, type CngpacConfig, type CommitAuthor, type DirtyFileAbsPath, type FormatterOptions, type FormatterPlugin, type GitHubReleaserOptions, type NoteNameGenerator, type NpmPublisherOptions, type Package, type PkgFileAbsPath, type PreStagePlugin, type PrepareConfig, type PublisherPlugin, type ReleaserPlugin, type VersionBump, applyVersionBump, calculateVersionBump, consumeChangenotes, consumePrepareConfig, createChangelogGenerator, createChangelogSaver, createFormatter, createGitHubReleaser, createGitOps, createNpmPublisher, defaultGenerateNoteName, defineConfig, formatFiles, loadConfig, parseChangenoteContent, parseChangenotefile, parseFrontmatter, readChangenotes, readPkg, readPrepareConfig, updateFrontmatter, updatePkgVersion, writeChangenote, writePrepareConfig };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "./node_modules/.pnpm/localstorage-polyfill@1.0.1/node_modules/localstorage-polyfill/localStorage.mjs";
|
|
2
|
+
import { createChangelogGenerator } from "./changelog.mjs";
|
|
3
|
+
import { consumePrepareConfig, parseChangenoteContent, parseChangenotefile, parseFrontmatter, readChangenotes, readPrepareConfig, updateFrontmatter, writeChangenote, writePrepareConfig } from "./changenote.mjs";
|
|
4
|
+
import { defaultGenerateNoteName } from "./cli/commands/change.mjs";
|
|
5
|
+
import { createFormatter, formatFiles } from "./formatter.mjs";
|
|
6
|
+
import { createGitOps } from "./git.mjs";
|
|
7
|
+
import { loadConfig } from "./utils.mjs";
|
|
8
|
+
import { readPkg, updatePkgVersion } from "./pkg.mjs";
|
|
9
|
+
import { calculateVersionBump } from "./prepare.mjs";
|
|
10
|
+
import { createNpmPublisher } from "./publishers/npm.mjs";
|
|
11
|
+
import { createGitHubReleaser } from "./releasers/github.mjs";
|
|
12
|
+
import { createChangelogSaver } from "./saver.mjs";
|
|
13
|
+
import { applyVersionBump, consumeChangenotes } from "./version.mjs";
|
|
14
|
+
//#region src/index.ts
|
|
15
|
+
/** Type-safe helper for defining a Cngpac configuration object. */
|
|
16
|
+
function defineConfig(config) {
|
|
17
|
+
return config;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { applyVersionBump, calculateVersionBump, consumeChangenotes, consumePrepareConfig, createChangelogGenerator, createChangelogSaver, createFormatter, createGitHubReleaser, createGitOps, createNpmPublisher, defaultGenerateNoteName, defineConfig, formatFiles, loadConfig, parseChangenoteContent, parseChangenotefile, parseFrontmatter, readChangenotes, readPkg, readPrepareConfig, updateFrontmatter, updatePkgVersion, writeChangenote, writePrepareConfig };
|
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
import { wrapAnsi } from "../../../../../fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.mjs";
|
|
2
|
+
import { require_src } from "../../../../../sisteransi@1.0.5/node_modules/sisteransi/src/index.mjs";
|
|
3
|
+
import { stdin, stdout } from "node:process";
|
|
4
|
+
import { styleText } from "node:util";
|
|
5
|
+
import * as _ from "node:readline";
|
|
6
|
+
import P$1 from "node:readline";
|
|
7
|
+
import { ReadStream } from "node:tty";
|
|
8
|
+
//#region node_modules/.pnpm/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs
|
|
9
|
+
var import_src = require_src();
|
|
10
|
+
function d(r, t, e) {
|
|
11
|
+
if (!e.some((o) => !o.disabled)) return r;
|
|
12
|
+
const s = r + t, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
|
|
13
|
+
return e[n].disabled ? d(n, t < 0 ? -1 : 1, e) : n;
|
|
14
|
+
}
|
|
15
|
+
const u = {
|
|
16
|
+
actions: new Set([
|
|
17
|
+
"up",
|
|
18
|
+
"down",
|
|
19
|
+
"left",
|
|
20
|
+
"right",
|
|
21
|
+
"space",
|
|
22
|
+
"enter",
|
|
23
|
+
"cancel"
|
|
24
|
+
]),
|
|
25
|
+
aliases: new Map([
|
|
26
|
+
["k", "up"],
|
|
27
|
+
["j", "down"],
|
|
28
|
+
["h", "left"],
|
|
29
|
+
["l", "right"],
|
|
30
|
+
["", "cancel"],
|
|
31
|
+
["escape", "cancel"]
|
|
32
|
+
]),
|
|
33
|
+
messages: {
|
|
34
|
+
cancel: "Canceled",
|
|
35
|
+
error: "Something went wrong"
|
|
36
|
+
},
|
|
37
|
+
withGuide: !0,
|
|
38
|
+
date: {
|
|
39
|
+
monthNames: [...[
|
|
40
|
+
"January",
|
|
41
|
+
"February",
|
|
42
|
+
"March",
|
|
43
|
+
"April",
|
|
44
|
+
"May",
|
|
45
|
+
"June",
|
|
46
|
+
"July",
|
|
47
|
+
"August",
|
|
48
|
+
"September",
|
|
49
|
+
"October",
|
|
50
|
+
"November",
|
|
51
|
+
"December"
|
|
52
|
+
]],
|
|
53
|
+
messages: {
|
|
54
|
+
required: "Please enter a valid date",
|
|
55
|
+
invalidMonth: "There are only 12 months in a year",
|
|
56
|
+
invalidDay: (r, t) => `There are only ${r} days in ${t}`,
|
|
57
|
+
afterMin: (r) => `Date must be on or after ${r.toISOString().slice(0, 10)}`,
|
|
58
|
+
beforeMax: (r) => `Date must be on or before ${r.toISOString().slice(0, 10)}`
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
function V(r, t) {
|
|
63
|
+
if (typeof r == "string") return u.aliases.get(r) === t;
|
|
64
|
+
for (const e of r) if (e !== void 0 && V(e, t)) return !0;
|
|
65
|
+
return !1;
|
|
66
|
+
}
|
|
67
|
+
function j(r, t) {
|
|
68
|
+
if (r === t) return;
|
|
69
|
+
const e = r.split(`
|
|
70
|
+
`), s = t.split(`
|
|
71
|
+
`), i = Math.max(e.length, s.length), n = [];
|
|
72
|
+
for (let o = 0; o < i; o++) e[o] !== s[o] && n.push(o);
|
|
73
|
+
return {
|
|
74
|
+
lines: n,
|
|
75
|
+
numLinesBefore: e.length,
|
|
76
|
+
numLinesAfter: s.length,
|
|
77
|
+
numLines: i
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const Y = globalThis.process.platform.startsWith("win"), C = Symbol("clack:cancel");
|
|
81
|
+
function q(r) {
|
|
82
|
+
return r === C;
|
|
83
|
+
}
|
|
84
|
+
function w(r, t) {
|
|
85
|
+
const e = r;
|
|
86
|
+
e.isTTY && e.setRawMode(t);
|
|
87
|
+
}
|
|
88
|
+
function z({ input: r = stdin, output: t = stdout, overwrite: e = !0, hideCursor: s = !0 } = {}) {
|
|
89
|
+
const i = _.createInterface({
|
|
90
|
+
input: r,
|
|
91
|
+
output: t,
|
|
92
|
+
prompt: "",
|
|
93
|
+
tabSize: 1
|
|
94
|
+
});
|
|
95
|
+
_.emitKeypressEvents(r, i), r instanceof ReadStream && r.isTTY && r.setRawMode(!0);
|
|
96
|
+
const n = (o, { name: a, sequence: h }) => {
|
|
97
|
+
if (V([
|
|
98
|
+
String(o),
|
|
99
|
+
a,
|
|
100
|
+
h
|
|
101
|
+
], "cancel")) {
|
|
102
|
+
s && t.write(import_src.cursor.show), process.exit(0);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (!e) return;
|
|
106
|
+
const f = a === "return" ? 0 : -1, v = a === "return" ? -1 : 0;
|
|
107
|
+
_.moveCursor(t, f, v, () => {
|
|
108
|
+
_.clearLine(t, 1, () => {
|
|
109
|
+
r.once("keypress", n);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
return s && t.write(import_src.cursor.hide), r.once("keypress", n), () => {
|
|
114
|
+
r.off("keypress", n), s && t.write(import_src.cursor.show), r instanceof ReadStream && r.isTTY && !Y && r.setRawMode(!1), i.terminal = !1, i.close();
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
const O = (r) => "columns" in r && typeof r.columns == "number" ? r.columns : 80, A = (r) => "rows" in r && typeof r.rows == "number" ? r.rows : 20;
|
|
118
|
+
function R(r, t, e, s = e) {
|
|
119
|
+
return wrapAnsi(t, O(r ?? stdout) - e.length, {
|
|
120
|
+
hard: !0,
|
|
121
|
+
trim: !1
|
|
122
|
+
}).split(`
|
|
123
|
+
`).map((n, o) => `${o === 0 ? s : e}${n}`).join(`
|
|
124
|
+
`);
|
|
125
|
+
}
|
|
126
|
+
let p = class {
|
|
127
|
+
input;
|
|
128
|
+
output;
|
|
129
|
+
_abortSignal;
|
|
130
|
+
rl;
|
|
131
|
+
opts;
|
|
132
|
+
_render;
|
|
133
|
+
_track = !1;
|
|
134
|
+
_prevFrame = "";
|
|
135
|
+
_subscribers = /* @__PURE__ */ new Map();
|
|
136
|
+
_cursor = 0;
|
|
137
|
+
state = "initial";
|
|
138
|
+
error = "";
|
|
139
|
+
value;
|
|
140
|
+
userInput = "";
|
|
141
|
+
constructor(t, e = !0) {
|
|
142
|
+
const { input: s = stdin, output: i = stdout, render: n, signal: o, ...a } = t;
|
|
143
|
+
this.opts = a, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = e, this._abortSignal = o, this.input = s, this.output = i;
|
|
144
|
+
}
|
|
145
|
+
unsubscribe() {
|
|
146
|
+
this._subscribers.clear();
|
|
147
|
+
}
|
|
148
|
+
setSubscriber(t, e) {
|
|
149
|
+
const s = this._subscribers.get(t) ?? [];
|
|
150
|
+
s.push(e), this._subscribers.set(t, s);
|
|
151
|
+
}
|
|
152
|
+
on(t, e) {
|
|
153
|
+
this.setSubscriber(t, { cb: e });
|
|
154
|
+
}
|
|
155
|
+
once(t, e) {
|
|
156
|
+
this.setSubscriber(t, {
|
|
157
|
+
cb: e,
|
|
158
|
+
once: !0
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
emit(t, ...e) {
|
|
162
|
+
const s = this._subscribers.get(t) ?? [], i = [];
|
|
163
|
+
for (const n of s) n.cb(...e), n.once && i.push(() => s.splice(s.indexOf(n), 1));
|
|
164
|
+
for (const n of i) n();
|
|
165
|
+
}
|
|
166
|
+
prompt() {
|
|
167
|
+
return new Promise((t) => {
|
|
168
|
+
if (this._abortSignal) {
|
|
169
|
+
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(C);
|
|
170
|
+
this._abortSignal.addEventListener("abort", () => {
|
|
171
|
+
this.state = "cancel", this.close();
|
|
172
|
+
}, { once: !0 });
|
|
173
|
+
}
|
|
174
|
+
this.rl = P$1.createInterface({
|
|
175
|
+
input: this.input,
|
|
176
|
+
tabSize: 2,
|
|
177
|
+
prompt: "",
|
|
178
|
+
escapeCodeTimeout: 50,
|
|
179
|
+
terminal: !0
|
|
180
|
+
}), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, !0), this.input.on("keypress", this.onKeypress), w(this.input, !0), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
181
|
+
this.output.write(import_src.cursor.show), this.output.off("resize", this.render), w(this.input, !1), t(this.value);
|
|
182
|
+
}), this.once("cancel", () => {
|
|
183
|
+
this.output.write(import_src.cursor.show), this.output.off("resize", this.render), w(this.input, !1), t(C);
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
_isActionKey(t, e) {
|
|
188
|
+
return t === " ";
|
|
189
|
+
}
|
|
190
|
+
_setValue(t) {
|
|
191
|
+
this.value = t, this.emit("value", this.value);
|
|
192
|
+
}
|
|
193
|
+
_setUserInput(t, e) {
|
|
194
|
+
this.userInput = t ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
|
|
195
|
+
}
|
|
196
|
+
_clearUserInput() {
|
|
197
|
+
this.rl?.write(null, {
|
|
198
|
+
ctrl: !0,
|
|
199
|
+
name: "u"
|
|
200
|
+
}), this._setUserInput("");
|
|
201
|
+
}
|
|
202
|
+
onKeypress(t, e) {
|
|
203
|
+
if (this._track && e.name !== "return" && (e.name && this._isActionKey(t, e) && this.rl?.write(null, {
|
|
204
|
+
ctrl: !0,
|
|
205
|
+
name: "h"
|
|
206
|
+
}), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && u.aliases.has(e.name) && this.emit("cursor", u.aliases.get(e.name)), u.actions.has(e.name) && this.emit("cursor", e.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t?.toLowerCase(), e), e?.name === "return") {
|
|
207
|
+
if (this.opts.validate) {
|
|
208
|
+
const s = this.opts.validate(this.value);
|
|
209
|
+
s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
|
|
210
|
+
}
|
|
211
|
+
this.state !== "error" && (this.state = "submit");
|
|
212
|
+
}
|
|
213
|
+
V([
|
|
214
|
+
t,
|
|
215
|
+
e?.name,
|
|
216
|
+
e?.sequence
|
|
217
|
+
], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
218
|
+
}
|
|
219
|
+
close() {
|
|
220
|
+
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
221
|
+
`), w(this.input, !1), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
222
|
+
}
|
|
223
|
+
restoreCursor() {
|
|
224
|
+
const t = wrapAnsi(this._prevFrame, process.stdout.columns, {
|
|
225
|
+
hard: !0,
|
|
226
|
+
trim: !1
|
|
227
|
+
}).split(`
|
|
228
|
+
`).length - 1;
|
|
229
|
+
this.output.write(import_src.cursor.move(-999, t * -1));
|
|
230
|
+
}
|
|
231
|
+
render() {
|
|
232
|
+
const t = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
|
|
233
|
+
hard: !0,
|
|
234
|
+
trim: !1
|
|
235
|
+
});
|
|
236
|
+
if (t !== this._prevFrame) {
|
|
237
|
+
if (this.state === "initial") this.output.write(import_src.cursor.hide);
|
|
238
|
+
else {
|
|
239
|
+
const e = j(this._prevFrame, t), s = A(this.output);
|
|
240
|
+
if (this.restoreCursor(), e) {
|
|
241
|
+
const i = Math.max(0, e.numLinesAfter - s), n = Math.max(0, e.numLinesBefore - s);
|
|
242
|
+
let o = e.lines.find((a) => a >= i);
|
|
243
|
+
if (o === void 0) {
|
|
244
|
+
this._prevFrame = t;
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
if (e.lines.length === 1) {
|
|
248
|
+
this.output.write(import_src.cursor.move(0, o - n)), this.output.write(import_src.erase.lines(1));
|
|
249
|
+
const a = t.split(`
|
|
250
|
+
`);
|
|
251
|
+
this.output.write(a[o]), this._prevFrame = t, this.output.write(import_src.cursor.move(0, a.length - o - 1));
|
|
252
|
+
return;
|
|
253
|
+
} else if (e.lines.length > 1) {
|
|
254
|
+
if (i < n) o = i;
|
|
255
|
+
else {
|
|
256
|
+
const h = o - n;
|
|
257
|
+
h > 0 && this.output.write(import_src.cursor.move(0, h));
|
|
258
|
+
}
|
|
259
|
+
this.output.write(import_src.erase.down());
|
|
260
|
+
const a = t.split(`
|
|
261
|
+
`).slice(o);
|
|
262
|
+
this.output.write(a.join(`
|
|
263
|
+
`)), this._prevFrame = t;
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
this.output.write(import_src.erase.down());
|
|
268
|
+
}
|
|
269
|
+
this.output.write(t), this.state === "initial" && (this.state = "active"), this._prevFrame = t;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
function W(r, t) {
|
|
274
|
+
if (r === void 0 || t.length === 0) return 0;
|
|
275
|
+
const e = t.findIndex((s) => s.value === r);
|
|
276
|
+
return e !== -1 ? e : 0;
|
|
277
|
+
}
|
|
278
|
+
function B(r, t) {
|
|
279
|
+
return (t.label ?? String(t.value)).toLowerCase().includes(r.toLowerCase());
|
|
280
|
+
}
|
|
281
|
+
function J(r, t) {
|
|
282
|
+
if (t) return r ? t : t[0];
|
|
283
|
+
}
|
|
284
|
+
let H = class extends p {
|
|
285
|
+
filteredOptions;
|
|
286
|
+
multiple;
|
|
287
|
+
isNavigating = !1;
|
|
288
|
+
selectedValues = [];
|
|
289
|
+
focusedValue;
|
|
290
|
+
#e = 0;
|
|
291
|
+
#o = "";
|
|
292
|
+
#t;
|
|
293
|
+
#n;
|
|
294
|
+
#a;
|
|
295
|
+
get cursor() {
|
|
296
|
+
return this.#e;
|
|
297
|
+
}
|
|
298
|
+
get userInputWithCursor() {
|
|
299
|
+
if (!this.userInput) return styleText(["inverse", "hidden"], "_");
|
|
300
|
+
if (this._cursor >= this.userInput.length) return `${this.userInput}\u2588`;
|
|
301
|
+
const t = this.userInput.slice(0, this._cursor), [e, ...s] = this.userInput.slice(this._cursor);
|
|
302
|
+
return `${t}${styleText("inverse", e)}${s.join("")}`;
|
|
303
|
+
}
|
|
304
|
+
get options() {
|
|
305
|
+
return typeof this.#n == "function" ? this.#n() : this.#n;
|
|
306
|
+
}
|
|
307
|
+
constructor(t) {
|
|
308
|
+
super(t), this.#n = t.options, this.#a = t.placeholder;
|
|
309
|
+
const e = this.options;
|
|
310
|
+
this.filteredOptions = [...e], this.multiple = t.multiple === !0, this.#t = typeof t.options == "function" ? t.filter : t.filter ?? B;
|
|
311
|
+
let s;
|
|
312
|
+
if (t.initialValue && Array.isArray(t.initialValue) ? this.multiple ? s = t.initialValue : s = t.initialValue.slice(0, 1) : !this.multiple && this.options.length > 0 && (s = [this.options[0].value]), s) for (const i of s) {
|
|
313
|
+
const n = e.findIndex((o) => o.value === i);
|
|
314
|
+
n !== -1 && (this.toggleSelected(i), this.#e = n);
|
|
315
|
+
}
|
|
316
|
+
this.focusedValue = this.options[this.#e]?.value, this.on("key", (i, n) => this.#s(i, n)), this.on("userInput", (i) => this.#i(i));
|
|
317
|
+
}
|
|
318
|
+
_isActionKey(t, e) {
|
|
319
|
+
return t === " " || this.multiple && this.isNavigating && e.name === "space" && t !== void 0 && t !== "";
|
|
320
|
+
}
|
|
321
|
+
#s(t, e) {
|
|
322
|
+
const s = e.name === "up", i = e.name === "down", n = e.name === "return", o = this.userInput === "" || this.userInput === " ", a = this.#a, h = this.options, l = a !== void 0 && a !== "" && h.some((f) => !f.disabled && (this.#t ? this.#t(a, f) : !0));
|
|
323
|
+
if (e.name === "tab" && o && l) {
|
|
324
|
+
this.userInput === " " && this._clearUserInput(), this._setUserInput(a, !0), this.isNavigating = !1;
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
s || i ? (this.#e = d(this.#e, s ? -1 : 1, this.filteredOptions), this.focusedValue = this.filteredOptions[this.#e]?.value, this.multiple || (this.selectedValues = [this.focusedValue]), this.isNavigating = !0) : n ? this.value = J(this.multiple, this.selectedValues) : this.multiple ? this.focusedValue !== void 0 && (e.name === "tab" || this.isNavigating && e.name === "space") ? this.toggleSelected(this.focusedValue) : this.isNavigating = !1 : (this.focusedValue && (this.selectedValues = [this.focusedValue]), this.isNavigating = !1);
|
|
328
|
+
}
|
|
329
|
+
deselectAll() {
|
|
330
|
+
this.selectedValues = [];
|
|
331
|
+
}
|
|
332
|
+
toggleSelected(t) {
|
|
333
|
+
this.filteredOptions.length !== 0 && (this.multiple ? this.selectedValues.includes(t) ? this.selectedValues = this.selectedValues.filter((e) => e !== t) : this.selectedValues = [...this.selectedValues, t] : this.selectedValues = [t]);
|
|
334
|
+
}
|
|
335
|
+
#i(t) {
|
|
336
|
+
if (t !== this.#o) {
|
|
337
|
+
this.#o = t;
|
|
338
|
+
const e = this.options;
|
|
339
|
+
t && this.#t ? this.filteredOptions = e.filter((n) => this.#t?.(t, n)) : this.filteredOptions = [...e];
|
|
340
|
+
this.#e = d(W(this.focusedValue, this.filteredOptions), 0, this.filteredOptions);
|
|
341
|
+
const i = this.filteredOptions[this.#e];
|
|
342
|
+
i && !i.disabled ? this.focusedValue = i.value : this.focusedValue = void 0, this.multiple || (this.focusedValue !== void 0 ? this.toggleSelected(this.focusedValue) : this.deselectAll());
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
var st = class extends p {
|
|
347
|
+
options;
|
|
348
|
+
cursor = 0;
|
|
349
|
+
#e;
|
|
350
|
+
getGroupItems(t) {
|
|
351
|
+
return this.options.filter((e) => e.group === t);
|
|
352
|
+
}
|
|
353
|
+
isGroupSelected(t) {
|
|
354
|
+
const e = this.getGroupItems(t), s = this.value;
|
|
355
|
+
return s === void 0 ? !1 : e.every((i) => s.includes(i.value));
|
|
356
|
+
}
|
|
357
|
+
toggleValue() {
|
|
358
|
+
const t = this.options[this.cursor];
|
|
359
|
+
if (this.value === void 0 && (this.value = []), t.group === !0) {
|
|
360
|
+
const e = t.value, s = this.getGroupItems(e);
|
|
361
|
+
this.isGroupSelected(e) ? this.value = this.value.filter((i) => s.findIndex((n) => n.value === i) === -1) : this.value = [...this.value, ...s.map((i) => i.value)], this.value = Array.from(new Set(this.value));
|
|
362
|
+
} else this.value = this.value.includes(t.value) ? this.value.filter((s) => s !== t.value) : [...this.value, t.value];
|
|
363
|
+
}
|
|
364
|
+
constructor(t) {
|
|
365
|
+
super(t, !1);
|
|
366
|
+
const { options: e } = t;
|
|
367
|
+
this.#e = t.selectableGroups !== !1, this.options = Object.entries(e).flatMap(([s, i]) => [{
|
|
368
|
+
value: s,
|
|
369
|
+
group: !0,
|
|
370
|
+
label: s
|
|
371
|
+
}, ...i.map((n) => ({
|
|
372
|
+
...n,
|
|
373
|
+
group: s
|
|
374
|
+
}))]), this.value = [...t.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: s }) => s === t.cursorAt), this.#e ? 0 : 1), this.on("cursor", (s) => {
|
|
375
|
+
switch (s) {
|
|
376
|
+
case "left":
|
|
377
|
+
case "up": {
|
|
378
|
+
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
379
|
+
const i = this.options[this.cursor]?.group === !0;
|
|
380
|
+
!this.#e && i && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
case "down":
|
|
384
|
+
case "right": {
|
|
385
|
+
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
386
|
+
const i = this.options[this.cursor]?.group === !0;
|
|
387
|
+
!this.#e && i && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
|
|
388
|
+
break;
|
|
389
|
+
}
|
|
390
|
+
case "space":
|
|
391
|
+
this.toggleValue();
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
let it = class extends p {
|
|
398
|
+
options;
|
|
399
|
+
cursor = 0;
|
|
400
|
+
get _value() {
|
|
401
|
+
return this.options[this.cursor].value;
|
|
402
|
+
}
|
|
403
|
+
get _enabledOptions() {
|
|
404
|
+
return this.options.filter((t) => t.disabled !== !0);
|
|
405
|
+
}
|
|
406
|
+
toggleAll() {
|
|
407
|
+
const t = this._enabledOptions;
|
|
408
|
+
this.value = this.value !== void 0 && this.value.length === t.length ? [] : t.map((s) => s.value);
|
|
409
|
+
}
|
|
410
|
+
toggleInvert() {
|
|
411
|
+
const t = this.value;
|
|
412
|
+
if (!t) return;
|
|
413
|
+
this.value = this._enabledOptions.filter((s) => !t.includes(s.value)).map((s) => s.value);
|
|
414
|
+
}
|
|
415
|
+
toggleValue() {
|
|
416
|
+
this.value === void 0 && (this.value = []);
|
|
417
|
+
this.value = this.value.includes(this._value) ? this.value.filter((e) => e !== this._value) : [...this.value, this._value];
|
|
418
|
+
}
|
|
419
|
+
constructor(t) {
|
|
420
|
+
super(t, !1), this.options = t.options, this.value = [...t.initialValues ?? []];
|
|
421
|
+
const e = Math.max(this.options.findIndex(({ value: s }) => s === t.cursorAt), 0);
|
|
422
|
+
this.cursor = this.options[e].disabled ? d(e, 1, this.options) : e, this.on("key", (s) => {
|
|
423
|
+
s === "a" && this.toggleAll(), s === "i" && this.toggleInvert();
|
|
424
|
+
}), this.on("cursor", (s) => {
|
|
425
|
+
switch (s) {
|
|
426
|
+
case "left":
|
|
427
|
+
case "up":
|
|
428
|
+
this.cursor = d(this.cursor, -1, this.options);
|
|
429
|
+
break;
|
|
430
|
+
case "down":
|
|
431
|
+
case "right":
|
|
432
|
+
this.cursor = d(this.cursor, 1, this.options);
|
|
433
|
+
break;
|
|
434
|
+
case "space":
|
|
435
|
+
this.toggleValue();
|
|
436
|
+
break;
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
var rt = class extends p {
|
|
442
|
+
_mask = "•";
|
|
443
|
+
get cursor() {
|
|
444
|
+
return this._cursor;
|
|
445
|
+
}
|
|
446
|
+
get masked() {
|
|
447
|
+
return this.userInput.replaceAll(/./g, this._mask);
|
|
448
|
+
}
|
|
449
|
+
get userInputWithCursor() {
|
|
450
|
+
if (this.state === "submit" || this.state === "cancel") return this.masked;
|
|
451
|
+
const t = this.userInput;
|
|
452
|
+
if (this.cursor >= t.length) return `${this.masked}${styleText(["inverse", "hidden"], "_")}`;
|
|
453
|
+
const e = this.masked, s = e.slice(0, this.cursor), i = e.slice(this.cursor);
|
|
454
|
+
return `${s}${styleText("inverse", i[0])}${i.slice(1)}`;
|
|
455
|
+
}
|
|
456
|
+
clear() {
|
|
457
|
+
this._clearUserInput();
|
|
458
|
+
}
|
|
459
|
+
constructor({ mask: t, ...e }) {
|
|
460
|
+
super(e), this._mask = t ?? "•", this.on("userInput", (s) => {
|
|
461
|
+
this._setValue(s);
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
var nt = class extends p {
|
|
466
|
+
options;
|
|
467
|
+
cursor = 0;
|
|
468
|
+
get _selectedValue() {
|
|
469
|
+
return this.options[this.cursor];
|
|
470
|
+
}
|
|
471
|
+
changeValue() {
|
|
472
|
+
this.value = this._selectedValue.value;
|
|
473
|
+
}
|
|
474
|
+
constructor(t) {
|
|
475
|
+
super(t, !1), this.options = t.options;
|
|
476
|
+
const e = this.options.findIndex(({ value: i }) => i === t.initialValue), s = e === -1 ? 0 : e;
|
|
477
|
+
this.cursor = this.options[s].disabled ? d(s, 1, this.options) : s, this.changeValue(), this.on("cursor", (i) => {
|
|
478
|
+
switch (i) {
|
|
479
|
+
case "left":
|
|
480
|
+
case "up":
|
|
481
|
+
this.cursor = d(this.cursor, -1, this.options);
|
|
482
|
+
break;
|
|
483
|
+
case "down":
|
|
484
|
+
case "right":
|
|
485
|
+
this.cursor = d(this.cursor, 1, this.options);
|
|
486
|
+
break;
|
|
487
|
+
}
|
|
488
|
+
this.changeValue();
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
var ot = class extends p {
|
|
493
|
+
options;
|
|
494
|
+
cursor = 0;
|
|
495
|
+
constructor(t) {
|
|
496
|
+
super(t, !1), this.options = t.options;
|
|
497
|
+
const e = t.caseSensitive === !0, s = this.options.map(({ value: [i] }) => e ? i : i?.toLowerCase());
|
|
498
|
+
this.cursor = Math.max(s.indexOf(t.initialValue), 0), this.on("key", (i, n) => {
|
|
499
|
+
if (!i) return;
|
|
500
|
+
const o = e && n.shift ? i.toUpperCase() : i;
|
|
501
|
+
if (!s.includes(o)) return;
|
|
502
|
+
const a = this.options.find(({ value: [h] }) => e ? h === o : h?.toLowerCase() === i);
|
|
503
|
+
a && (this.value = a.value, this.state = "submit", this.emit("submit"));
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
var at = class extends p {
|
|
508
|
+
get userInputWithCursor() {
|
|
509
|
+
if (this.state === "submit") return this.userInput;
|
|
510
|
+
const t = this.userInput;
|
|
511
|
+
if (this.cursor >= t.length) return `${this.userInput}\u2588`;
|
|
512
|
+
const e = t.slice(0, this.cursor), [s, ...i] = t.slice(this.cursor);
|
|
513
|
+
return `${e}${styleText("inverse", s)}${i.join("")}`;
|
|
514
|
+
}
|
|
515
|
+
get cursor() {
|
|
516
|
+
return this._cursor;
|
|
517
|
+
}
|
|
518
|
+
constructor(t) {
|
|
519
|
+
super({
|
|
520
|
+
...t,
|
|
521
|
+
initialUserInput: t.initialUserInput ?? t.initialValue
|
|
522
|
+
}), this.on("userInput", (e) => {
|
|
523
|
+
this._setValue(e);
|
|
524
|
+
}), this.on("finalize", () => {
|
|
525
|
+
this.value || (this.value = t.defaultValue), this.value === void 0 && (this.value = "");
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
};
|
|
529
|
+
//#endregion
|
|
530
|
+
export { A, H, O, R, at, it, nt, ot, q, rt, st, u, z };
|