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/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyString.mjs
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_Scalar } from "../nodes/Scalar.mjs";
|
|
3
|
+
import { require_foldFlowLines } from "./foldFlowLines.mjs";
|
|
4
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyString.js
|
|
5
|
+
var require_stringifyString = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
6
|
+
var Scalar = require_Scalar();
|
|
7
|
+
var foldFlowLines = require_foldFlowLines();
|
|
8
|
+
const getFoldOptions = (ctx, isBlock) => ({
|
|
9
|
+
indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,
|
|
10
|
+
lineWidth: ctx.options.lineWidth,
|
|
11
|
+
minContentWidth: ctx.options.minContentWidth
|
|
12
|
+
});
|
|
13
|
+
const containsDocumentMarker = (str) => /^(%|---|\.\.\.)/m.test(str);
|
|
14
|
+
function lineLengthOverLimit(str, lineWidth, indentLength) {
|
|
15
|
+
if (!lineWidth || lineWidth < 0) return false;
|
|
16
|
+
const limit = lineWidth - indentLength;
|
|
17
|
+
const strLen = str.length;
|
|
18
|
+
if (strLen <= limit) return false;
|
|
19
|
+
for (let i = 0, start = 0; i < strLen; ++i) if (str[i] === "\n") {
|
|
20
|
+
if (i - start > limit) return true;
|
|
21
|
+
start = i + 1;
|
|
22
|
+
if (strLen - start <= limit) return false;
|
|
23
|
+
}
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
function doubleQuotedString(value, ctx) {
|
|
27
|
+
const json = JSON.stringify(value);
|
|
28
|
+
if (ctx.options.doubleQuotedAsJSON) return json;
|
|
29
|
+
const { implicitKey } = ctx;
|
|
30
|
+
const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
|
|
31
|
+
const indent = ctx.indent || (containsDocumentMarker(value) ? " " : "");
|
|
32
|
+
let str = "";
|
|
33
|
+
let start = 0;
|
|
34
|
+
for (let i = 0, ch = json[i]; ch; ch = json[++i]) {
|
|
35
|
+
if (ch === " " && json[i + 1] === "\\" && json[i + 2] === "n") {
|
|
36
|
+
str += json.slice(start, i) + "\\ ";
|
|
37
|
+
i += 1;
|
|
38
|
+
start = i;
|
|
39
|
+
ch = "\\";
|
|
40
|
+
}
|
|
41
|
+
if (ch === "\\") switch (json[i + 1]) {
|
|
42
|
+
case "u":
|
|
43
|
+
{
|
|
44
|
+
str += json.slice(start, i);
|
|
45
|
+
const code = json.substr(i + 2, 4);
|
|
46
|
+
switch (code) {
|
|
47
|
+
case "0000":
|
|
48
|
+
str += "\\0";
|
|
49
|
+
break;
|
|
50
|
+
case "0007":
|
|
51
|
+
str += "\\a";
|
|
52
|
+
break;
|
|
53
|
+
case "000b":
|
|
54
|
+
str += "\\v";
|
|
55
|
+
break;
|
|
56
|
+
case "001b":
|
|
57
|
+
str += "\\e";
|
|
58
|
+
break;
|
|
59
|
+
case "0085":
|
|
60
|
+
str += "\\N";
|
|
61
|
+
break;
|
|
62
|
+
case "00a0":
|
|
63
|
+
str += "\\_";
|
|
64
|
+
break;
|
|
65
|
+
case "2028":
|
|
66
|
+
str += "\\L";
|
|
67
|
+
break;
|
|
68
|
+
case "2029":
|
|
69
|
+
str += "\\P";
|
|
70
|
+
break;
|
|
71
|
+
default: if (code.substr(0, 2) === "00") str += "\\x" + code.substr(2);
|
|
72
|
+
else str += json.substr(i, 6);
|
|
73
|
+
}
|
|
74
|
+
i += 5;
|
|
75
|
+
start = i + 1;
|
|
76
|
+
}
|
|
77
|
+
break;
|
|
78
|
+
case "n":
|
|
79
|
+
if (implicitKey || json[i + 2] === "\"" || json.length < minMultiLineLength) i += 1;
|
|
80
|
+
else {
|
|
81
|
+
str += json.slice(start, i) + "\n\n";
|
|
82
|
+
while (json[i + 2] === "\\" && json[i + 3] === "n" && json[i + 4] !== "\"") {
|
|
83
|
+
str += "\n";
|
|
84
|
+
i += 2;
|
|
85
|
+
}
|
|
86
|
+
str += indent;
|
|
87
|
+
if (json[i + 2] === " ") str += "\\";
|
|
88
|
+
i += 1;
|
|
89
|
+
start = i + 1;
|
|
90
|
+
}
|
|
91
|
+
break;
|
|
92
|
+
default: i += 1;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
str = start ? str + json.slice(start) : json;
|
|
96
|
+
return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_QUOTED, getFoldOptions(ctx, false));
|
|
97
|
+
}
|
|
98
|
+
function singleQuotedString(value, ctx) {
|
|
99
|
+
if (ctx.options.singleQuote === false || ctx.implicitKey && value.includes("\n") || /[ \t]\n|\n[ \t]/.test(value)) return doubleQuotedString(value, ctx);
|
|
100
|
+
const indent = ctx.indent || (containsDocumentMarker(value) ? " " : "");
|
|
101
|
+
const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&\n${indent}`) + "'";
|
|
102
|
+
return ctx.implicitKey ? res : foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
|
|
103
|
+
}
|
|
104
|
+
function quotedString(value, ctx) {
|
|
105
|
+
const { singleQuote } = ctx.options;
|
|
106
|
+
let qs;
|
|
107
|
+
if (singleQuote === false) qs = doubleQuotedString;
|
|
108
|
+
else {
|
|
109
|
+
const hasDouble = value.includes("\"");
|
|
110
|
+
const hasSingle = value.includes("'");
|
|
111
|
+
if (hasDouble && !hasSingle) qs = singleQuotedString;
|
|
112
|
+
else if (hasSingle && !hasDouble) qs = doubleQuotedString;
|
|
113
|
+
else qs = singleQuote ? singleQuotedString : doubleQuotedString;
|
|
114
|
+
}
|
|
115
|
+
return qs(value, ctx);
|
|
116
|
+
}
|
|
117
|
+
let blockEndNewlines;
|
|
118
|
+
try {
|
|
119
|
+
blockEndNewlines = /* @__PURE__ */ new RegExp("(^|(?<!\n))\n+(?!\n|$)", "g");
|
|
120
|
+
} catch {
|
|
121
|
+
blockEndNewlines = /\n+(?!\n|$)/g;
|
|
122
|
+
}
|
|
123
|
+
function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
|
|
124
|
+
const { blockQuote, commentString, lineWidth } = ctx.options;
|
|
125
|
+
if (!blockQuote || /\n[\t ]+$/.test(value)) return quotedString(value, ctx);
|
|
126
|
+
const indent = ctx.indent || (ctx.forceBlockIndent || containsDocumentMarker(value) ? " " : "");
|
|
127
|
+
const literal = blockQuote === "literal" ? true : blockQuote === "folded" || type === Scalar.Scalar.BLOCK_FOLDED ? false : type === Scalar.Scalar.BLOCK_LITERAL ? true : !lineLengthOverLimit(value, lineWidth, indent.length);
|
|
128
|
+
if (!value) return literal ? "|\n" : ">\n";
|
|
129
|
+
let chomp;
|
|
130
|
+
let endStart;
|
|
131
|
+
for (endStart = value.length; endStart > 0; --endStart) {
|
|
132
|
+
const ch = value[endStart - 1];
|
|
133
|
+
if (ch !== "\n" && ch !== " " && ch !== " ") break;
|
|
134
|
+
}
|
|
135
|
+
let end = value.substring(endStart);
|
|
136
|
+
const endNlPos = end.indexOf("\n");
|
|
137
|
+
if (endNlPos === -1) chomp = "-";
|
|
138
|
+
else if (value === end || endNlPos !== end.length - 1) {
|
|
139
|
+
chomp = "+";
|
|
140
|
+
if (onChompKeep) onChompKeep();
|
|
141
|
+
} else chomp = "";
|
|
142
|
+
if (end) {
|
|
143
|
+
value = value.slice(0, -end.length);
|
|
144
|
+
if (end[end.length - 1] === "\n") end = end.slice(0, -1);
|
|
145
|
+
end = end.replace(blockEndNewlines, `$&${indent}`);
|
|
146
|
+
}
|
|
147
|
+
let startWithSpace = false;
|
|
148
|
+
let startEnd;
|
|
149
|
+
let startNlPos = -1;
|
|
150
|
+
for (startEnd = 0; startEnd < value.length; ++startEnd) {
|
|
151
|
+
const ch = value[startEnd];
|
|
152
|
+
if (ch === " ") startWithSpace = true;
|
|
153
|
+
else if (ch === "\n") startNlPos = startEnd;
|
|
154
|
+
else break;
|
|
155
|
+
}
|
|
156
|
+
let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);
|
|
157
|
+
if (start) {
|
|
158
|
+
value = value.substring(start.length);
|
|
159
|
+
start = start.replace(/\n+/g, `$&${indent}`);
|
|
160
|
+
}
|
|
161
|
+
let header = (startWithSpace ? indent ? "2" : "1" : "") + chomp;
|
|
162
|
+
if (comment) {
|
|
163
|
+
header += " " + commentString(comment.replace(/ ?[\r\n]+/g, " "));
|
|
164
|
+
if (onComment) onComment();
|
|
165
|
+
}
|
|
166
|
+
if (!literal) {
|
|
167
|
+
const foldedValue = value.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`);
|
|
168
|
+
let literalFallback = false;
|
|
169
|
+
const foldOptions = getFoldOptions(ctx, true);
|
|
170
|
+
if (blockQuote !== "folded" && type !== Scalar.Scalar.BLOCK_FOLDED) foldOptions.onOverflow = () => {
|
|
171
|
+
literalFallback = true;
|
|
172
|
+
};
|
|
173
|
+
const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions);
|
|
174
|
+
if (!literalFallback) return `>${header}\n${indent}${body}`;
|
|
175
|
+
}
|
|
176
|
+
value = value.replace(/\n+/g, `$&${indent}`);
|
|
177
|
+
return `|${header}\n${indent}${start}${value}${end}`;
|
|
178
|
+
}
|
|
179
|
+
function plainString(item, ctx, onComment, onChompKeep) {
|
|
180
|
+
const { type, value } = item;
|
|
181
|
+
const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;
|
|
182
|
+
if (implicitKey && value.includes("\n") || inFlow && /[[\]{},]/.test(value)) return quotedString(value, ctx);
|
|
183
|
+
if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) return implicitKey || inFlow || !value.includes("\n") ? quotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep);
|
|
184
|
+
if (!implicitKey && !inFlow && type !== Scalar.Scalar.PLAIN && value.includes("\n")) return blockString(item, ctx, onComment, onChompKeep);
|
|
185
|
+
if (containsDocumentMarker(value)) {
|
|
186
|
+
if (indent === "") {
|
|
187
|
+
ctx.forceBlockIndent = true;
|
|
188
|
+
return blockString(item, ctx, onComment, onChompKeep);
|
|
189
|
+
} else if (implicitKey && indent === indentStep) return quotedString(value, ctx);
|
|
190
|
+
}
|
|
191
|
+
const str = value.replace(/\n+/g, `$&\n${indent}`);
|
|
192
|
+
if (actualString) {
|
|
193
|
+
const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str);
|
|
194
|
+
const { compat, tags } = ctx.doc.schema;
|
|
195
|
+
if (tags.some(test) || compat?.some(test)) return quotedString(value, ctx);
|
|
196
|
+
}
|
|
197
|
+
return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
|
|
198
|
+
}
|
|
199
|
+
function stringifyString(item, ctx, onComment, onChompKeep) {
|
|
200
|
+
const { implicitKey, inFlow } = ctx;
|
|
201
|
+
const ss = typeof item.value === "string" ? item : Object.assign({}, item, { value: String(item.value) });
|
|
202
|
+
let { type } = item;
|
|
203
|
+
if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
|
|
204
|
+
if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value)) type = Scalar.Scalar.QUOTE_DOUBLE;
|
|
205
|
+
}
|
|
206
|
+
const _stringify = (_type) => {
|
|
207
|
+
switch (_type) {
|
|
208
|
+
case Scalar.Scalar.BLOCK_FOLDED:
|
|
209
|
+
case Scalar.Scalar.BLOCK_LITERAL: return implicitKey || inFlow ? quotedString(ss.value, ctx) : blockString(ss, ctx, onComment, onChompKeep);
|
|
210
|
+
case Scalar.Scalar.QUOTE_DOUBLE: return doubleQuotedString(ss.value, ctx);
|
|
211
|
+
case Scalar.Scalar.QUOTE_SINGLE: return singleQuotedString(ss.value, ctx);
|
|
212
|
+
case Scalar.Scalar.PLAIN: return plainString(ss, ctx, onComment, onChompKeep);
|
|
213
|
+
default: return null;
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
let res = _stringify(type);
|
|
217
|
+
if (res === null) {
|
|
218
|
+
const { defaultKeyType, defaultStringType } = ctx.options;
|
|
219
|
+
const t = implicitKey && defaultKeyType || defaultStringType;
|
|
220
|
+
res = _stringify(t);
|
|
221
|
+
if (res === null) throw new Error(`Unsupported default string type ${t}`);
|
|
222
|
+
}
|
|
223
|
+
return res;
|
|
224
|
+
}
|
|
225
|
+
exports.stringifyString = stringifyString;
|
|
226
|
+
}));
|
|
227
|
+
//#endregion
|
|
228
|
+
export default require_stringifyString();
|
|
229
|
+
export { require_stringifyString };
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_identity } from "./nodes/identity.mjs";
|
|
3
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/visit.js
|
|
4
|
+
var require_visit = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5
|
+
var identity = require_identity();
|
|
6
|
+
const BREAK = Symbol("break visit");
|
|
7
|
+
const SKIP = Symbol("skip children");
|
|
8
|
+
const REMOVE = Symbol("remove node");
|
|
9
|
+
/**
|
|
10
|
+
* Apply a visitor to an AST node or document.
|
|
11
|
+
*
|
|
12
|
+
* Walks through the tree (depth-first) starting from `node`, calling a
|
|
13
|
+
* `visitor` function with three arguments:
|
|
14
|
+
* - `key`: For sequence values and map `Pair`, the node's index in the
|
|
15
|
+
* collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.
|
|
16
|
+
* `null` for the root node.
|
|
17
|
+
* - `node`: The current node.
|
|
18
|
+
* - `path`: The ancestry of the current node.
|
|
19
|
+
*
|
|
20
|
+
* The return value of the visitor may be used to control the traversal:
|
|
21
|
+
* - `undefined` (default): Do nothing and continue
|
|
22
|
+
* - `visit.SKIP`: Do not visit the children of this node, continue with next
|
|
23
|
+
* sibling
|
|
24
|
+
* - `visit.BREAK`: Terminate traversal completely
|
|
25
|
+
* - `visit.REMOVE`: Remove the current node, then continue with the next one
|
|
26
|
+
* - `Node`: Replace the current node, then continue by visiting it
|
|
27
|
+
* - `number`: While iterating the items of a sequence or map, set the index
|
|
28
|
+
* of the next step. This is useful especially if the index of the current
|
|
29
|
+
* node has changed.
|
|
30
|
+
*
|
|
31
|
+
* If `visitor` is a single function, it will be called with all values
|
|
32
|
+
* encountered in the tree, including e.g. `null` values. Alternatively,
|
|
33
|
+
* separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,
|
|
34
|
+
* `Alias` and `Scalar` node. To define the same visitor function for more than
|
|
35
|
+
* one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)
|
|
36
|
+
* and `Node` (alias, map, seq & scalar) targets. Of all these, only the most
|
|
37
|
+
* specific defined one will be used for each node.
|
|
38
|
+
*/
|
|
39
|
+
function visit(node, visitor) {
|
|
40
|
+
const visitor_ = initVisitor(visitor);
|
|
41
|
+
if (identity.isDocument(node)) {
|
|
42
|
+
if (visit_(null, node.contents, visitor_, Object.freeze([node])) === REMOVE) node.contents = null;
|
|
43
|
+
} else visit_(null, node, visitor_, Object.freeze([]));
|
|
44
|
+
}
|
|
45
|
+
/** Terminate visit traversal completely */
|
|
46
|
+
visit.BREAK = BREAK;
|
|
47
|
+
/** Do not visit the children of the current node */
|
|
48
|
+
visit.SKIP = SKIP;
|
|
49
|
+
/** Remove the current node */
|
|
50
|
+
visit.REMOVE = REMOVE;
|
|
51
|
+
function visit_(key, node, visitor, path) {
|
|
52
|
+
const ctrl = callVisitor(key, node, visitor, path);
|
|
53
|
+
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
54
|
+
replaceNode(key, path, ctrl);
|
|
55
|
+
return visit_(key, ctrl, visitor, path);
|
|
56
|
+
}
|
|
57
|
+
if (typeof ctrl !== "symbol") {
|
|
58
|
+
if (identity.isCollection(node)) {
|
|
59
|
+
path = Object.freeze(path.concat(node));
|
|
60
|
+
for (let i = 0; i < node.items.length; ++i) {
|
|
61
|
+
const ci = visit_(i, node.items[i], visitor, path);
|
|
62
|
+
if (typeof ci === "number") i = ci - 1;
|
|
63
|
+
else if (ci === BREAK) return BREAK;
|
|
64
|
+
else if (ci === REMOVE) {
|
|
65
|
+
node.items.splice(i, 1);
|
|
66
|
+
i -= 1;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
} else if (identity.isPair(node)) {
|
|
70
|
+
path = Object.freeze(path.concat(node));
|
|
71
|
+
const ck = visit_("key", node.key, visitor, path);
|
|
72
|
+
if (ck === BREAK) return BREAK;
|
|
73
|
+
else if (ck === REMOVE) node.key = null;
|
|
74
|
+
const cv = visit_("value", node.value, visitor, path);
|
|
75
|
+
if (cv === BREAK) return BREAK;
|
|
76
|
+
else if (cv === REMOVE) node.value = null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return ctrl;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Apply an async visitor to an AST node or document.
|
|
83
|
+
*
|
|
84
|
+
* Walks through the tree (depth-first) starting from `node`, calling a
|
|
85
|
+
* `visitor` function with three arguments:
|
|
86
|
+
* - `key`: For sequence values and map `Pair`, the node's index in the
|
|
87
|
+
* collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.
|
|
88
|
+
* `null` for the root node.
|
|
89
|
+
* - `node`: The current node.
|
|
90
|
+
* - `path`: The ancestry of the current node.
|
|
91
|
+
*
|
|
92
|
+
* The return value of the visitor may be used to control the traversal:
|
|
93
|
+
* - `Promise`: Must resolve to one of the following values
|
|
94
|
+
* - `undefined` (default): Do nothing and continue
|
|
95
|
+
* - `visit.SKIP`: Do not visit the children of this node, continue with next
|
|
96
|
+
* sibling
|
|
97
|
+
* - `visit.BREAK`: Terminate traversal completely
|
|
98
|
+
* - `visit.REMOVE`: Remove the current node, then continue with the next one
|
|
99
|
+
* - `Node`: Replace the current node, then continue by visiting it
|
|
100
|
+
* - `number`: While iterating the items of a sequence or map, set the index
|
|
101
|
+
* of the next step. This is useful especially if the index of the current
|
|
102
|
+
* node has changed.
|
|
103
|
+
*
|
|
104
|
+
* If `visitor` is a single function, it will be called with all values
|
|
105
|
+
* encountered in the tree, including e.g. `null` values. Alternatively,
|
|
106
|
+
* separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,
|
|
107
|
+
* `Alias` and `Scalar` node. To define the same visitor function for more than
|
|
108
|
+
* one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)
|
|
109
|
+
* and `Node` (alias, map, seq & scalar) targets. Of all these, only the most
|
|
110
|
+
* specific defined one will be used for each node.
|
|
111
|
+
*/
|
|
112
|
+
async function visitAsync(node, visitor) {
|
|
113
|
+
const visitor_ = initVisitor(visitor);
|
|
114
|
+
if (identity.isDocument(node)) {
|
|
115
|
+
if (await visitAsync_(null, node.contents, visitor_, Object.freeze([node])) === REMOVE) node.contents = null;
|
|
116
|
+
} else await visitAsync_(null, node, visitor_, Object.freeze([]));
|
|
117
|
+
}
|
|
118
|
+
/** Terminate visit traversal completely */
|
|
119
|
+
visitAsync.BREAK = BREAK;
|
|
120
|
+
/** Do not visit the children of the current node */
|
|
121
|
+
visitAsync.SKIP = SKIP;
|
|
122
|
+
/** Remove the current node */
|
|
123
|
+
visitAsync.REMOVE = REMOVE;
|
|
124
|
+
async function visitAsync_(key, node, visitor, path) {
|
|
125
|
+
const ctrl = await callVisitor(key, node, visitor, path);
|
|
126
|
+
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
127
|
+
replaceNode(key, path, ctrl);
|
|
128
|
+
return visitAsync_(key, ctrl, visitor, path);
|
|
129
|
+
}
|
|
130
|
+
if (typeof ctrl !== "symbol") {
|
|
131
|
+
if (identity.isCollection(node)) {
|
|
132
|
+
path = Object.freeze(path.concat(node));
|
|
133
|
+
for (let i = 0; i < node.items.length; ++i) {
|
|
134
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path);
|
|
135
|
+
if (typeof ci === "number") i = ci - 1;
|
|
136
|
+
else if (ci === BREAK) return BREAK;
|
|
137
|
+
else if (ci === REMOVE) {
|
|
138
|
+
node.items.splice(i, 1);
|
|
139
|
+
i -= 1;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
} else if (identity.isPair(node)) {
|
|
143
|
+
path = Object.freeze(path.concat(node));
|
|
144
|
+
const ck = await visitAsync_("key", node.key, visitor, path);
|
|
145
|
+
if (ck === BREAK) return BREAK;
|
|
146
|
+
else if (ck === REMOVE) node.key = null;
|
|
147
|
+
const cv = await visitAsync_("value", node.value, visitor, path);
|
|
148
|
+
if (cv === BREAK) return BREAK;
|
|
149
|
+
else if (cv === REMOVE) node.value = null;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return ctrl;
|
|
153
|
+
}
|
|
154
|
+
function initVisitor(visitor) {
|
|
155
|
+
if (typeof visitor === "object" && (visitor.Collection || visitor.Node || visitor.Value)) return Object.assign({
|
|
156
|
+
Alias: visitor.Node,
|
|
157
|
+
Map: visitor.Node,
|
|
158
|
+
Scalar: visitor.Node,
|
|
159
|
+
Seq: visitor.Node
|
|
160
|
+
}, visitor.Value && {
|
|
161
|
+
Map: visitor.Value,
|
|
162
|
+
Scalar: visitor.Value,
|
|
163
|
+
Seq: visitor.Value
|
|
164
|
+
}, visitor.Collection && {
|
|
165
|
+
Map: visitor.Collection,
|
|
166
|
+
Seq: visitor.Collection
|
|
167
|
+
}, visitor);
|
|
168
|
+
return visitor;
|
|
169
|
+
}
|
|
170
|
+
function callVisitor(key, node, visitor, path) {
|
|
171
|
+
if (typeof visitor === "function") return visitor(key, node, path);
|
|
172
|
+
if (identity.isMap(node)) return visitor.Map?.(key, node, path);
|
|
173
|
+
if (identity.isSeq(node)) return visitor.Seq?.(key, node, path);
|
|
174
|
+
if (identity.isPair(node)) return visitor.Pair?.(key, node, path);
|
|
175
|
+
if (identity.isScalar(node)) return visitor.Scalar?.(key, node, path);
|
|
176
|
+
if (identity.isAlias(node)) return visitor.Alias?.(key, node, path);
|
|
177
|
+
}
|
|
178
|
+
function replaceNode(key, path, node) {
|
|
179
|
+
const parent = path[path.length - 1];
|
|
180
|
+
if (identity.isCollection(parent)) parent.items[key] = node;
|
|
181
|
+
else if (identity.isPair(parent)) if (key === "key") parent.key = node;
|
|
182
|
+
else parent.value = node;
|
|
183
|
+
else if (identity.isDocument(parent)) parent.contents = node;
|
|
184
|
+
else {
|
|
185
|
+
const pt = identity.isAlias(parent) ? "alias" : "scalar";
|
|
186
|
+
throw new Error(`Cannot replace node with ${pt} parent`);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
exports.visit = visit;
|
|
190
|
+
exports.visitAsync = visitAsync;
|
|
191
|
+
}));
|
|
192
|
+
//#endregion
|
|
193
|
+
export default require_visit();
|
|
194
|
+
export { require_visit };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//#region node_modules/.pnpm/zwitch@2.0.4/node_modules/zwitch/index.js
|
|
2
|
+
/**
|
|
3
|
+
* @callback Handler
|
|
4
|
+
* Handle a value, with a certain ID field set to a certain value.
|
|
5
|
+
* The ID field is passed to `zwitch`, and it’s value is this function’s
|
|
6
|
+
* place on the `handlers` record.
|
|
7
|
+
* @param {...any} parameters
|
|
8
|
+
* Arbitrary parameters passed to the zwitch.
|
|
9
|
+
* The first will be an object with a certain ID field set to a certain value.
|
|
10
|
+
* @returns {any}
|
|
11
|
+
* Anything!
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* @callback UnknownHandler
|
|
15
|
+
* Handle values that do have a certain ID field, but it’s set to a value
|
|
16
|
+
* that is not listed in the `handlers` record.
|
|
17
|
+
* @param {unknown} value
|
|
18
|
+
* An object with a certain ID field set to an unknown value.
|
|
19
|
+
* @param {...any} rest
|
|
20
|
+
* Arbitrary parameters passed to the zwitch.
|
|
21
|
+
* @returns {any}
|
|
22
|
+
* Anything!
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* @callback InvalidHandler
|
|
26
|
+
* Handle values that do not have a certain ID field.
|
|
27
|
+
* @param {unknown} value
|
|
28
|
+
* Any unknown value.
|
|
29
|
+
* @param {...any} rest
|
|
30
|
+
* Arbitrary parameters passed to the zwitch.
|
|
31
|
+
* @returns {void|null|undefined|never}
|
|
32
|
+
* This should crash or return nothing.
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* @template {InvalidHandler} [Invalid=InvalidHandler]
|
|
36
|
+
* @template {UnknownHandler} [Unknown=UnknownHandler]
|
|
37
|
+
* @template {Record<string, Handler>} [Handlers=Record<string, Handler>]
|
|
38
|
+
* @typedef Options
|
|
39
|
+
* Configuration (required).
|
|
40
|
+
* @property {Invalid} [invalid]
|
|
41
|
+
* Handler to use for invalid values.
|
|
42
|
+
* @property {Unknown} [unknown]
|
|
43
|
+
* Handler to use for unknown values.
|
|
44
|
+
* @property {Handlers} [handlers]
|
|
45
|
+
* Handlers to use.
|
|
46
|
+
*/
|
|
47
|
+
const own = {}.hasOwnProperty;
|
|
48
|
+
/**
|
|
49
|
+
* Handle values based on a field.
|
|
50
|
+
*
|
|
51
|
+
* @template {InvalidHandler} [Invalid=InvalidHandler]
|
|
52
|
+
* @template {UnknownHandler} [Unknown=UnknownHandler]
|
|
53
|
+
* @template {Record<string, Handler>} [Handlers=Record<string, Handler>]
|
|
54
|
+
* @param {string} key
|
|
55
|
+
* Field to switch on.
|
|
56
|
+
* @param {Options<Invalid, Unknown, Handlers>} [options]
|
|
57
|
+
* Configuration (required).
|
|
58
|
+
* @returns {{unknown: Unknown, invalid: Invalid, handlers: Handlers, (...parameters: Parameters<Handlers[keyof Handlers]>): ReturnType<Handlers[keyof Handlers]>, (...parameters: Parameters<Unknown>): ReturnType<Unknown>}}
|
|
59
|
+
*/
|
|
60
|
+
function zwitch(key, options) {
|
|
61
|
+
const settings = options || {};
|
|
62
|
+
/**
|
|
63
|
+
* Handle one value.
|
|
64
|
+
*
|
|
65
|
+
* Based on the bound `key`, a respective handler will be called.
|
|
66
|
+
* If `value` is not an object, or doesn’t have a `key` property, the special
|
|
67
|
+
* “invalid” handler will be called.
|
|
68
|
+
* If `value` has an unknown `key`, the special “unknown” handler will be
|
|
69
|
+
* called.
|
|
70
|
+
*
|
|
71
|
+
* All arguments, and the context object, are passed through to the handler,
|
|
72
|
+
* and it’s result is returned.
|
|
73
|
+
*
|
|
74
|
+
* @this {unknown}
|
|
75
|
+
* Any context object.
|
|
76
|
+
* @param {unknown} [value]
|
|
77
|
+
* Any value.
|
|
78
|
+
* @param {...unknown} parameters
|
|
79
|
+
* Arbitrary parameters passed to the zwitch.
|
|
80
|
+
* @property {Handler} invalid
|
|
81
|
+
* Handle for values that do not have a certain ID field.
|
|
82
|
+
* @property {Handler} unknown
|
|
83
|
+
* Handle values that do have a certain ID field, but it’s set to a value
|
|
84
|
+
* that is not listed in the `handlers` record.
|
|
85
|
+
* @property {Handlers} handlers
|
|
86
|
+
* Record of handlers.
|
|
87
|
+
* @returns {unknown}
|
|
88
|
+
* Anything.
|
|
89
|
+
*/
|
|
90
|
+
function one(value, ...parameters) {
|
|
91
|
+
/** @type {Handler|undefined} */
|
|
92
|
+
let fn = one.invalid;
|
|
93
|
+
const handlers = one.handlers;
|
|
94
|
+
if (value && own.call(value, key)) {
|
|
95
|
+
const id = String(value[key]);
|
|
96
|
+
fn = own.call(handlers, id) ? handlers[id] : one.unknown;
|
|
97
|
+
}
|
|
98
|
+
if (fn) return fn.call(this, value, ...parameters);
|
|
99
|
+
}
|
|
100
|
+
one.handlers = settings.handlers || {};
|
|
101
|
+
one.invalid = settings.invalid;
|
|
102
|
+
one.unknown = settings.unknown;
|
|
103
|
+
return one;
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { zwitch };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DirtyFileAbsPath, Package, PkgFileAbsPath } from "./types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/pkg.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Read the name and version of a package from its package.json.
|
|
6
|
+
*
|
|
7
|
+
* @param pkgFilePath - The package descriptor (name + file path)
|
|
8
|
+
* @param rootDir - The root directory of the monorepo
|
|
9
|
+
* @returns Pack
|
|
10
|
+
* @throws If the package.json is missing or has no valid name or version
|
|
11
|
+
*/
|
|
12
|
+
declare function readPkg(pkgFilePath: PkgFileAbsPath, rootDir: string): Package;
|
|
13
|
+
/**
|
|
14
|
+
* Update the version of a package in its package.json,
|
|
15
|
+
* preserving the original indentation style.
|
|
16
|
+
*
|
|
17
|
+
* @param pkgFilePath - The package descriptor (name + file path)
|
|
18
|
+
* @param rootDir - The root directory of the monorepo
|
|
19
|
+
* @param newVersion - The new version string to set
|
|
20
|
+
* @throws If the package.json is missing or cannot be written
|
|
21
|
+
*/
|
|
22
|
+
declare function updatePkgVersion(pkgFilePath: PkgFileAbsPath, rootDir: string, newVersion: string): DirtyFileAbsPath[];
|
|
23
|
+
//#endregion
|
|
24
|
+
export { readPkg, updatePkgVersion };
|
package/dist/src/pkg.mjs
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { detectIndentation } from "./utils.mjs";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
//#region src/pkg.ts
|
|
4
|
+
/**
|
|
5
|
+
* Read the name and version of a package from its package.json.
|
|
6
|
+
*
|
|
7
|
+
* @param pkgFilePath - The package descriptor (name + file path)
|
|
8
|
+
* @param rootDir - The root directory of the monorepo
|
|
9
|
+
* @returns Pack
|
|
10
|
+
* @throws If the package.json is missing or has no valid name or version
|
|
11
|
+
*/
|
|
12
|
+
function readPkg(pkgFilePath, rootDir) {
|
|
13
|
+
const content = fs.readFileSync(pkgFilePath, "utf-8");
|
|
14
|
+
const pkg = JSON.parse(content);
|
|
15
|
+
if (!pkg.name || !pkg.version) throw new Error(`Invalid package.json: ${pkgFilePath}`);
|
|
16
|
+
return {
|
|
17
|
+
name: pkg.name,
|
|
18
|
+
version: pkg.version
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Update the version of a package in its package.json,
|
|
23
|
+
* preserving the original indentation style.
|
|
24
|
+
*
|
|
25
|
+
* @param pkgFilePath - The package descriptor (name + file path)
|
|
26
|
+
* @param rootDir - The root directory of the monorepo
|
|
27
|
+
* @param newVersion - The new version string to set
|
|
28
|
+
* @throws If the package.json is missing or cannot be written
|
|
29
|
+
*/
|
|
30
|
+
function updatePkgVersion(pkgFilePath, rootDir, newVersion) {
|
|
31
|
+
const packageJsonRaw = fs.readFileSync(pkgFilePath, "utf-8");
|
|
32
|
+
const indent = detectIndentation(packageJsonRaw);
|
|
33
|
+
const pkgJson = JSON.parse(packageJsonRaw);
|
|
34
|
+
pkgJson.version = newVersion;
|
|
35
|
+
fs.writeFileSync(pkgFilePath, `${JSON.stringify(pkgJson, null, indent)}\n`, "utf-8");
|
|
36
|
+
return [pkgFilePath];
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { readPkg, updatePkgVersion };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Changenote, ChangenoteCommit, PkgFileAbsPath, VersionBump } from "./types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/prepare.d.ts
|
|
4
|
+
/** Calculate version bump from changenotes */
|
|
5
|
+
declare function calculateVersionBump(pkgFilePath: PkgFileAbsPath, changenotes: (Changenote & {
|
|
6
|
+
commit?: ChangenoteCommit;
|
|
7
|
+
})[], rootDir: string, prepareConfig?: {
|
|
8
|
+
type: "release";
|
|
9
|
+
} | {
|
|
10
|
+
type: "prerelease" | "prepatch" | "preminor" | "premajor";
|
|
11
|
+
tag: string;
|
|
12
|
+
}): Promise<VersionBump>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { calculateVersionBump };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { readPkg } from "./pkg.mjs";
|
|
2
|
+
import * as semver from "semver";
|
|
3
|
+
//#region src/prepare.ts
|
|
4
|
+
const BUMP_PRIORITY = {
|
|
5
|
+
major: 3,
|
|
6
|
+
minor: 2,
|
|
7
|
+
patch: 1
|
|
8
|
+
};
|
|
9
|
+
/** Get the highest priority bump from a list */
|
|
10
|
+
function highestBump(bumps) {
|
|
11
|
+
let max = "patch";
|
|
12
|
+
for (const b of bumps) if (BUMP_PRIORITY[b] > BUMP_PRIORITY[max]) max = b;
|
|
13
|
+
return max;
|
|
14
|
+
}
|
|
15
|
+
/** Calculate version bump from changenotes */
|
|
16
|
+
async function calculateVersionBump(pkgFilePath, changenotes, rootDir, prepareConfig) {
|
|
17
|
+
const pkgJson = readPkg(pkgFilePath, rootDir);
|
|
18
|
+
const currentVersion = pkgJson.version;
|
|
19
|
+
const packageName = pkgJson.name;
|
|
20
|
+
if (!currentVersion || !semver.valid(currentVersion)) throw new Error(`Package "${packageName}" has invalid version: ${currentVersion}`);
|
|
21
|
+
const bumps = /* @__PURE__ */ new Set();
|
|
22
|
+
for (const cn of changenotes) bumps.add(cn.meta.bump);
|
|
23
|
+
const bump = highestBump(Array.from(bumps));
|
|
24
|
+
let newVersion;
|
|
25
|
+
if (prepareConfig?.type === "prerelease") {
|
|
26
|
+
const tag = prepareConfig.tag;
|
|
27
|
+
const pre = semver.prerelease(currentVersion);
|
|
28
|
+
if (pre && pre[0] === tag) newVersion = semver.inc(currentVersion, "prerelease", tag);
|
|
29
|
+
else newVersion = semver.inc(currentVersion, `pre${bump}`, tag);
|
|
30
|
+
} else if (prepareConfig?.type === "prepatch" || prepareConfig?.type === "preminor" || prepareConfig?.type === "premajor") newVersion = semver.inc(currentVersion, prepareConfig.type, prepareConfig.tag);
|
|
31
|
+
else newVersion = semver.inc(currentVersion, bump);
|
|
32
|
+
if (!newVersion) throw new Error(`Failed to increment version ${currentVersion} with bump ${bump}`);
|
|
33
|
+
return {
|
|
34
|
+
packageName,
|
|
35
|
+
currentVersion,
|
|
36
|
+
newVersion,
|
|
37
|
+
bump
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { calculateVersionBump };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PublisherPlugin } from "../types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/publishers/npm.d.ts
|
|
4
|
+
interface NpmPublisherOptions {
|
|
5
|
+
/** NPM registry URL (defaults to https://registry.npmjs.org) */
|
|
6
|
+
registry?: string;
|
|
7
|
+
/** Environment variables to pass to the npm publish command */
|
|
8
|
+
env?: Record<string, string>;
|
|
9
|
+
/** Custom publish arguments (e.g., ['--access', 'public'] for scoped packages) */
|
|
10
|
+
args?: string[];
|
|
11
|
+
/** Whether to enable GitHub Actions Provenance (SLSA attestation) (defaults to true) */
|
|
12
|
+
provenance?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Creates an npm publisher plugin.
|
|
16
|
+
* Publishes the package to the npm registry.
|
|
17
|
+
* Supports GitHub Actions Provenance (SLSA attestation) for signed releases.
|
|
18
|
+
*/
|
|
19
|
+
declare function createNpmPublisher(options?: NpmPublisherOptions): PublisherPlugin;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { NpmPublisherOptions, createNpmPublisher };
|