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
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_identity } from "./identity.mjs";
|
|
3
|
+
import { require_toJS } from "./toJS.mjs";
|
|
4
|
+
import { require_Scalar } from "./Scalar.mjs";
|
|
5
|
+
import { require_createNode } from "../doc/createNode.mjs";
|
|
6
|
+
import { require_Collection } from "./Collection.mjs";
|
|
7
|
+
import { require_stringifyCollection } from "../stringify/stringifyCollection.mjs";
|
|
8
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLSeq.js
|
|
9
|
+
var require_YAMLSeq = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
10
|
+
var createNode = require_createNode();
|
|
11
|
+
var stringifyCollection = require_stringifyCollection();
|
|
12
|
+
var Collection = require_Collection();
|
|
13
|
+
var identity = require_identity();
|
|
14
|
+
var Scalar = require_Scalar();
|
|
15
|
+
var toJS = require_toJS();
|
|
16
|
+
var YAMLSeq = class extends Collection.Collection {
|
|
17
|
+
static get tagName() {
|
|
18
|
+
return "tag:yaml.org,2002:seq";
|
|
19
|
+
}
|
|
20
|
+
constructor(schema) {
|
|
21
|
+
super(identity.SEQ, schema);
|
|
22
|
+
this.items = [];
|
|
23
|
+
}
|
|
24
|
+
add(value) {
|
|
25
|
+
this.items.push(value);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Removes a value from the collection.
|
|
29
|
+
*
|
|
30
|
+
* `key` must contain a representation of an integer for this to succeed.
|
|
31
|
+
* It may be wrapped in a `Scalar`.
|
|
32
|
+
*
|
|
33
|
+
* @returns `true` if the item was found and removed.
|
|
34
|
+
*/
|
|
35
|
+
delete(key) {
|
|
36
|
+
const idx = asItemIndex(key);
|
|
37
|
+
if (typeof idx !== "number") return false;
|
|
38
|
+
return this.items.splice(idx, 1).length > 0;
|
|
39
|
+
}
|
|
40
|
+
get(key, keepScalar) {
|
|
41
|
+
const idx = asItemIndex(key);
|
|
42
|
+
if (typeof idx !== "number") return void 0;
|
|
43
|
+
const it = this.items[idx];
|
|
44
|
+
return !keepScalar && identity.isScalar(it) ? it.value : it;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Checks if the collection includes a value with the key `key`.
|
|
48
|
+
*
|
|
49
|
+
* `key` must contain a representation of an integer for this to succeed.
|
|
50
|
+
* It may be wrapped in a `Scalar`.
|
|
51
|
+
*/
|
|
52
|
+
has(key) {
|
|
53
|
+
const idx = asItemIndex(key);
|
|
54
|
+
return typeof idx === "number" && idx < this.items.length;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
58
|
+
* boolean to add/remove the item from the set.
|
|
59
|
+
*
|
|
60
|
+
* If `key` does not contain a representation of an integer, this will throw.
|
|
61
|
+
* It may be wrapped in a `Scalar`.
|
|
62
|
+
*/
|
|
63
|
+
set(key, value) {
|
|
64
|
+
const idx = asItemIndex(key);
|
|
65
|
+
if (typeof idx !== "number") throw new Error(`Expected a valid index, not ${key}.`);
|
|
66
|
+
const prev = this.items[idx];
|
|
67
|
+
if (identity.isScalar(prev) && Scalar.isScalarValue(value)) prev.value = value;
|
|
68
|
+
else this.items[idx] = value;
|
|
69
|
+
}
|
|
70
|
+
toJSON(_, ctx) {
|
|
71
|
+
const seq = [];
|
|
72
|
+
if (ctx?.onCreate) ctx.onCreate(seq);
|
|
73
|
+
let i = 0;
|
|
74
|
+
for (const item of this.items) seq.push(toJS.toJS(item, String(i++), ctx));
|
|
75
|
+
return seq;
|
|
76
|
+
}
|
|
77
|
+
toString(ctx, onComment, onChompKeep) {
|
|
78
|
+
if (!ctx) return JSON.stringify(this);
|
|
79
|
+
return stringifyCollection.stringifyCollection(this, ctx, {
|
|
80
|
+
blockItemPrefix: "- ",
|
|
81
|
+
flowChars: {
|
|
82
|
+
start: "[",
|
|
83
|
+
end: "]"
|
|
84
|
+
},
|
|
85
|
+
itemIndent: (ctx.indent || "") + " ",
|
|
86
|
+
onChompKeep,
|
|
87
|
+
onComment
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
static from(schema, obj, ctx) {
|
|
91
|
+
const { replacer } = ctx;
|
|
92
|
+
const seq = new this(schema);
|
|
93
|
+
if (obj && Symbol.iterator in Object(obj)) {
|
|
94
|
+
let i = 0;
|
|
95
|
+
for (let it of obj) {
|
|
96
|
+
if (typeof replacer === "function") {
|
|
97
|
+
const key = obj instanceof Set ? it : String(i++);
|
|
98
|
+
it = replacer.call(obj, key, it);
|
|
99
|
+
}
|
|
100
|
+
seq.items.push(createNode.createNode(it, void 0, ctx));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return seq;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
function asItemIndex(key) {
|
|
107
|
+
let idx = identity.isScalar(key) ? key.value : key;
|
|
108
|
+
if (idx && typeof idx === "string") idx = Number(idx);
|
|
109
|
+
return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null;
|
|
110
|
+
}
|
|
111
|
+
exports.YAMLSeq = YAMLSeq;
|
|
112
|
+
}));
|
|
113
|
+
//#endregion
|
|
114
|
+
export default require_YAMLSeq();
|
|
115
|
+
export { require_YAMLSeq };
|
package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/addPairToJSMap.mjs
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_identity } from "./identity.mjs";
|
|
3
|
+
import { require_toJS } from "./toJS.mjs";
|
|
4
|
+
import { require_stringify } from "../stringify/stringify.mjs";
|
|
5
|
+
import { require_log } from "../log.mjs";
|
|
6
|
+
import { require_merge } from "../schema/yaml-1.1/merge.mjs";
|
|
7
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/addPairToJSMap.js
|
|
8
|
+
var require_addPairToJSMap = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
9
|
+
var log = require_log();
|
|
10
|
+
var merge = require_merge();
|
|
11
|
+
var stringify = require_stringify();
|
|
12
|
+
var identity = require_identity();
|
|
13
|
+
var toJS = require_toJS();
|
|
14
|
+
function addPairToJSMap(ctx, map, { key, value }) {
|
|
15
|
+
if (identity.isNode(key) && key.addToJSMap) key.addToJSMap(ctx, map, value);
|
|
16
|
+
else if (merge.isMergeKey(ctx, key)) merge.addMergeToJSMap(ctx, map, value);
|
|
17
|
+
else {
|
|
18
|
+
const jsKey = toJS.toJS(key, "", ctx);
|
|
19
|
+
if (map instanceof Map) map.set(jsKey, toJS.toJS(value, jsKey, ctx));
|
|
20
|
+
else if (map instanceof Set) map.add(jsKey);
|
|
21
|
+
else {
|
|
22
|
+
const stringKey = stringifyKey(key, jsKey, ctx);
|
|
23
|
+
const jsValue = toJS.toJS(value, stringKey, ctx);
|
|
24
|
+
if (stringKey in map) Object.defineProperty(map, stringKey, {
|
|
25
|
+
value: jsValue,
|
|
26
|
+
writable: true,
|
|
27
|
+
enumerable: true,
|
|
28
|
+
configurable: true
|
|
29
|
+
});
|
|
30
|
+
else map[stringKey] = jsValue;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return map;
|
|
34
|
+
}
|
|
35
|
+
function stringifyKey(key, jsKey, ctx) {
|
|
36
|
+
if (jsKey === null) return "";
|
|
37
|
+
if (typeof jsKey !== "object") return String(jsKey);
|
|
38
|
+
if (identity.isNode(key) && ctx?.doc) {
|
|
39
|
+
const strCtx = stringify.createStringifyContext(ctx.doc, {});
|
|
40
|
+
strCtx.anchors = /* @__PURE__ */ new Set();
|
|
41
|
+
for (const node of ctx.anchors.keys()) strCtx.anchors.add(node.anchor);
|
|
42
|
+
strCtx.inFlow = true;
|
|
43
|
+
strCtx.inStringifyKey = true;
|
|
44
|
+
const strKey = key.toString(strCtx);
|
|
45
|
+
if (!ctx.mapKeyWarned) {
|
|
46
|
+
let jsonStr = JSON.stringify(strKey);
|
|
47
|
+
if (jsonStr.length > 40) jsonStr = jsonStr.substring(0, 36) + "...\"";
|
|
48
|
+
log.warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`);
|
|
49
|
+
ctx.mapKeyWarned = true;
|
|
50
|
+
}
|
|
51
|
+
return strKey;
|
|
52
|
+
}
|
|
53
|
+
return JSON.stringify(jsKey);
|
|
54
|
+
}
|
|
55
|
+
exports.addPairToJSMap = addPairToJSMap;
|
|
56
|
+
}));
|
|
57
|
+
//#endregion
|
|
58
|
+
export default require_addPairToJSMap();
|
|
59
|
+
export { require_addPairToJSMap };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/identity.js
|
|
3
|
+
var require_identity = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4
|
+
const ALIAS = Symbol.for("yaml.alias");
|
|
5
|
+
const DOC = Symbol.for("yaml.document");
|
|
6
|
+
const MAP = Symbol.for("yaml.map");
|
|
7
|
+
const PAIR = Symbol.for("yaml.pair");
|
|
8
|
+
const SCALAR = Symbol.for("yaml.scalar");
|
|
9
|
+
const SEQ = Symbol.for("yaml.seq");
|
|
10
|
+
const NODE_TYPE = Symbol.for("yaml.node.type");
|
|
11
|
+
const isAlias = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === ALIAS;
|
|
12
|
+
const isDocument = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === DOC;
|
|
13
|
+
const isMap = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === MAP;
|
|
14
|
+
const isPair = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === PAIR;
|
|
15
|
+
const isScalar = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SCALAR;
|
|
16
|
+
const isSeq = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SEQ;
|
|
17
|
+
function isCollection(node) {
|
|
18
|
+
if (node && typeof node === "object") switch (node[NODE_TYPE]) {
|
|
19
|
+
case MAP:
|
|
20
|
+
case SEQ: return true;
|
|
21
|
+
}
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
function isNode(node) {
|
|
25
|
+
if (node && typeof node === "object") switch (node[NODE_TYPE]) {
|
|
26
|
+
case ALIAS:
|
|
27
|
+
case MAP:
|
|
28
|
+
case SCALAR:
|
|
29
|
+
case SEQ: return true;
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
const hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor;
|
|
34
|
+
exports.ALIAS = ALIAS;
|
|
35
|
+
exports.DOC = DOC;
|
|
36
|
+
exports.MAP = MAP;
|
|
37
|
+
exports.NODE_TYPE = NODE_TYPE;
|
|
38
|
+
exports.PAIR = PAIR;
|
|
39
|
+
exports.SCALAR = SCALAR;
|
|
40
|
+
exports.SEQ = SEQ;
|
|
41
|
+
exports.hasAnchor = hasAnchor;
|
|
42
|
+
exports.isAlias = isAlias;
|
|
43
|
+
exports.isCollection = isCollection;
|
|
44
|
+
exports.isDocument = isDocument;
|
|
45
|
+
exports.isMap = isMap;
|
|
46
|
+
exports.isNode = isNode;
|
|
47
|
+
exports.isPair = isPair;
|
|
48
|
+
exports.isScalar = isScalar;
|
|
49
|
+
exports.isSeq = isSeq;
|
|
50
|
+
}));
|
|
51
|
+
//#endregion
|
|
52
|
+
export default require_identity();
|
|
53
|
+
export { require_identity };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_identity } from "./identity.mjs";
|
|
3
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/toJS.js
|
|
4
|
+
var require_toJS = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5
|
+
var identity = require_identity();
|
|
6
|
+
/**
|
|
7
|
+
* Recursively convert any node or its contents to native JavaScript
|
|
8
|
+
*
|
|
9
|
+
* @param value - The input value
|
|
10
|
+
* @param arg - If `value` defines a `toJSON()` method, use this
|
|
11
|
+
* as its first argument
|
|
12
|
+
* @param ctx - Conversion context, originally set in Document#toJS(). If
|
|
13
|
+
* `{ keep: true }` is not set, output should be suitable for JSON
|
|
14
|
+
* stringification.
|
|
15
|
+
*/
|
|
16
|
+
function toJS(value, arg, ctx) {
|
|
17
|
+
if (Array.isArray(value)) return value.map((v, i) => toJS(v, String(i), ctx));
|
|
18
|
+
if (value && typeof value.toJSON === "function") {
|
|
19
|
+
if (!ctx || !identity.hasAnchor(value)) return value.toJSON(arg, ctx);
|
|
20
|
+
const data = {
|
|
21
|
+
aliasCount: 0,
|
|
22
|
+
count: 1,
|
|
23
|
+
res: void 0
|
|
24
|
+
};
|
|
25
|
+
ctx.anchors.set(value, data);
|
|
26
|
+
ctx.onCreate = (res) => {
|
|
27
|
+
data.res = res;
|
|
28
|
+
delete ctx.onCreate;
|
|
29
|
+
};
|
|
30
|
+
const res = value.toJSON(arg, ctx);
|
|
31
|
+
if (ctx.onCreate) ctx.onCreate(res);
|
|
32
|
+
return res;
|
|
33
|
+
}
|
|
34
|
+
if (typeof value === "bigint" && !ctx?.keep) return Number(value);
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
exports.toJS = toJS;
|
|
38
|
+
}));
|
|
39
|
+
//#endregion
|
|
40
|
+
export default require_toJS();
|
|
41
|
+
export { require_toJS };
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_stringifyString } from "../stringify/stringifyString.mjs";
|
|
3
|
+
import { require_errors } from "../errors.mjs";
|
|
4
|
+
import { require_resolve_block_scalar } from "../compose/resolve-block-scalar.mjs";
|
|
5
|
+
import { require_resolve_flow_scalar } from "../compose/resolve-flow-scalar.mjs";
|
|
6
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-scalar.js
|
|
7
|
+
var require_cst_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
8
|
+
var resolveBlockScalar = require_resolve_block_scalar();
|
|
9
|
+
var resolveFlowScalar = require_resolve_flow_scalar();
|
|
10
|
+
var errors = require_errors();
|
|
11
|
+
var stringifyString = require_stringifyString();
|
|
12
|
+
function resolveAsScalar(token, strict = true, onError) {
|
|
13
|
+
if (token) {
|
|
14
|
+
const _onError = (pos, code, message) => {
|
|
15
|
+
const offset = typeof pos === "number" ? pos : Array.isArray(pos) ? pos[0] : pos.offset;
|
|
16
|
+
if (onError) onError(offset, code, message);
|
|
17
|
+
else throw new errors.YAMLParseError([offset, offset + 1], code, message);
|
|
18
|
+
};
|
|
19
|
+
switch (token.type) {
|
|
20
|
+
case "scalar":
|
|
21
|
+
case "single-quoted-scalar":
|
|
22
|
+
case "double-quoted-scalar": return resolveFlowScalar.resolveFlowScalar(token, strict, _onError);
|
|
23
|
+
case "block-scalar": return resolveBlockScalar.resolveBlockScalar({ options: { strict } }, token, _onError);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Create a new scalar token with `value`
|
|
30
|
+
*
|
|
31
|
+
* Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,
|
|
32
|
+
* as this function does not support any schema operations and won't check for such conflicts.
|
|
33
|
+
*
|
|
34
|
+
* @param value The string representation of the value, which will have its content properly indented.
|
|
35
|
+
* @param context.end Comments and whitespace after the end of the value, or after the block scalar header. If undefined, a newline will be added.
|
|
36
|
+
* @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.
|
|
37
|
+
* @param context.indent The indent level of the token.
|
|
38
|
+
* @param context.inFlow Is this scalar within a flow collection? This may affect the resolved type of the token's value.
|
|
39
|
+
* @param context.offset The offset position of the token.
|
|
40
|
+
* @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.
|
|
41
|
+
*/
|
|
42
|
+
function createScalarToken(value, context) {
|
|
43
|
+
const { implicitKey = false, indent, inFlow = false, offset = -1, type = "PLAIN" } = context;
|
|
44
|
+
const source = stringifyString.stringifyString({
|
|
45
|
+
type,
|
|
46
|
+
value
|
|
47
|
+
}, {
|
|
48
|
+
implicitKey,
|
|
49
|
+
indent: indent > 0 ? " ".repeat(indent) : "",
|
|
50
|
+
inFlow,
|
|
51
|
+
options: {
|
|
52
|
+
blockQuote: true,
|
|
53
|
+
lineWidth: -1
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const end = context.end ?? [{
|
|
57
|
+
type: "newline",
|
|
58
|
+
offset: -1,
|
|
59
|
+
indent,
|
|
60
|
+
source: "\n"
|
|
61
|
+
}];
|
|
62
|
+
switch (source[0]) {
|
|
63
|
+
case "|":
|
|
64
|
+
case ">": {
|
|
65
|
+
const he = source.indexOf("\n");
|
|
66
|
+
const head = source.substring(0, he);
|
|
67
|
+
const body = source.substring(he + 1) + "\n";
|
|
68
|
+
const props = [{
|
|
69
|
+
type: "block-scalar-header",
|
|
70
|
+
offset,
|
|
71
|
+
indent,
|
|
72
|
+
source: head
|
|
73
|
+
}];
|
|
74
|
+
if (!addEndtoBlockProps(props, end)) props.push({
|
|
75
|
+
type: "newline",
|
|
76
|
+
offset: -1,
|
|
77
|
+
indent,
|
|
78
|
+
source: "\n"
|
|
79
|
+
});
|
|
80
|
+
return {
|
|
81
|
+
type: "block-scalar",
|
|
82
|
+
offset,
|
|
83
|
+
indent,
|
|
84
|
+
props,
|
|
85
|
+
source: body
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
case "\"": return {
|
|
89
|
+
type: "double-quoted-scalar",
|
|
90
|
+
offset,
|
|
91
|
+
indent,
|
|
92
|
+
source,
|
|
93
|
+
end
|
|
94
|
+
};
|
|
95
|
+
case "'": return {
|
|
96
|
+
type: "single-quoted-scalar",
|
|
97
|
+
offset,
|
|
98
|
+
indent,
|
|
99
|
+
source,
|
|
100
|
+
end
|
|
101
|
+
};
|
|
102
|
+
default: return {
|
|
103
|
+
type: "scalar",
|
|
104
|
+
offset,
|
|
105
|
+
indent,
|
|
106
|
+
source,
|
|
107
|
+
end
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Set the value of `token` to the given string `value`, overwriting any previous contents and type that it may have.
|
|
113
|
+
*
|
|
114
|
+
* Best efforts are made to retain any comments previously associated with the `token`,
|
|
115
|
+
* though all contents within a collection's `items` will be overwritten.
|
|
116
|
+
*
|
|
117
|
+
* Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,
|
|
118
|
+
* as this function does not support any schema operations and won't check for such conflicts.
|
|
119
|
+
*
|
|
120
|
+
* @param token Any token. If it does not include an `indent` value, the value will be stringified as if it were an implicit key.
|
|
121
|
+
* @param value The string representation of the value, which will have its content properly indented.
|
|
122
|
+
* @param context.afterKey In most cases, values after a key should have an additional level of indentation.
|
|
123
|
+
* @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.
|
|
124
|
+
* @param context.inFlow Being within a flow collection may affect the resolved type of the token's value.
|
|
125
|
+
* @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.
|
|
126
|
+
*/
|
|
127
|
+
function setScalarValue(token, value, context = {}) {
|
|
128
|
+
let { afterKey = false, implicitKey = false, inFlow = false, type } = context;
|
|
129
|
+
let indent = "indent" in token ? token.indent : null;
|
|
130
|
+
if (afterKey && typeof indent === "number") indent += 2;
|
|
131
|
+
if (!type) switch (token.type) {
|
|
132
|
+
case "single-quoted-scalar":
|
|
133
|
+
type = "QUOTE_SINGLE";
|
|
134
|
+
break;
|
|
135
|
+
case "double-quoted-scalar":
|
|
136
|
+
type = "QUOTE_DOUBLE";
|
|
137
|
+
break;
|
|
138
|
+
case "block-scalar": {
|
|
139
|
+
const header = token.props[0];
|
|
140
|
+
if (header.type !== "block-scalar-header") throw new Error("Invalid block scalar header");
|
|
141
|
+
type = header.source[0] === ">" ? "BLOCK_FOLDED" : "BLOCK_LITERAL";
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
default: type = "PLAIN";
|
|
145
|
+
}
|
|
146
|
+
const source = stringifyString.stringifyString({
|
|
147
|
+
type,
|
|
148
|
+
value
|
|
149
|
+
}, {
|
|
150
|
+
implicitKey: implicitKey || indent === null,
|
|
151
|
+
indent: indent !== null && indent > 0 ? " ".repeat(indent) : "",
|
|
152
|
+
inFlow,
|
|
153
|
+
options: {
|
|
154
|
+
blockQuote: true,
|
|
155
|
+
lineWidth: -1
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
switch (source[0]) {
|
|
159
|
+
case "|":
|
|
160
|
+
case ">":
|
|
161
|
+
setBlockScalarValue(token, source);
|
|
162
|
+
break;
|
|
163
|
+
case "\"":
|
|
164
|
+
setFlowScalarValue(token, source, "double-quoted-scalar");
|
|
165
|
+
break;
|
|
166
|
+
case "'":
|
|
167
|
+
setFlowScalarValue(token, source, "single-quoted-scalar");
|
|
168
|
+
break;
|
|
169
|
+
default: setFlowScalarValue(token, source, "scalar");
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function setBlockScalarValue(token, source) {
|
|
173
|
+
const he = source.indexOf("\n");
|
|
174
|
+
const head = source.substring(0, he);
|
|
175
|
+
const body = source.substring(he + 1) + "\n";
|
|
176
|
+
if (token.type === "block-scalar") {
|
|
177
|
+
const header = token.props[0];
|
|
178
|
+
if (header.type !== "block-scalar-header") throw new Error("Invalid block scalar header");
|
|
179
|
+
header.source = head;
|
|
180
|
+
token.source = body;
|
|
181
|
+
} else {
|
|
182
|
+
const { offset } = token;
|
|
183
|
+
const indent = "indent" in token ? token.indent : -1;
|
|
184
|
+
const props = [{
|
|
185
|
+
type: "block-scalar-header",
|
|
186
|
+
offset,
|
|
187
|
+
indent,
|
|
188
|
+
source: head
|
|
189
|
+
}];
|
|
190
|
+
if (!addEndtoBlockProps(props, "end" in token ? token.end : void 0)) props.push({
|
|
191
|
+
type: "newline",
|
|
192
|
+
offset: -1,
|
|
193
|
+
indent,
|
|
194
|
+
source: "\n"
|
|
195
|
+
});
|
|
196
|
+
for (const key of Object.keys(token)) if (key !== "type" && key !== "offset") delete token[key];
|
|
197
|
+
Object.assign(token, {
|
|
198
|
+
type: "block-scalar",
|
|
199
|
+
indent,
|
|
200
|
+
props,
|
|
201
|
+
source: body
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/** @returns `true` if last token is a newline */
|
|
206
|
+
function addEndtoBlockProps(props, end) {
|
|
207
|
+
if (end) for (const st of end) switch (st.type) {
|
|
208
|
+
case "space":
|
|
209
|
+
case "comment":
|
|
210
|
+
props.push(st);
|
|
211
|
+
break;
|
|
212
|
+
case "newline":
|
|
213
|
+
props.push(st);
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
function setFlowScalarValue(token, source, type) {
|
|
219
|
+
switch (token.type) {
|
|
220
|
+
case "scalar":
|
|
221
|
+
case "double-quoted-scalar":
|
|
222
|
+
case "single-quoted-scalar":
|
|
223
|
+
token.type = type;
|
|
224
|
+
token.source = source;
|
|
225
|
+
break;
|
|
226
|
+
case "block-scalar": {
|
|
227
|
+
const end = token.props.slice(1);
|
|
228
|
+
let oa = source.length;
|
|
229
|
+
if (token.props[0].type === "block-scalar-header") oa -= token.props[0].source.length;
|
|
230
|
+
for (const tok of end) tok.offset += oa;
|
|
231
|
+
delete token.props;
|
|
232
|
+
Object.assign(token, {
|
|
233
|
+
type,
|
|
234
|
+
source,
|
|
235
|
+
end
|
|
236
|
+
});
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
case "block-map":
|
|
240
|
+
case "block-seq": {
|
|
241
|
+
const nl = {
|
|
242
|
+
type: "newline",
|
|
243
|
+
offset: token.offset + source.length,
|
|
244
|
+
indent: token.indent,
|
|
245
|
+
source: "\n"
|
|
246
|
+
};
|
|
247
|
+
delete token.items;
|
|
248
|
+
Object.assign(token, {
|
|
249
|
+
type,
|
|
250
|
+
source,
|
|
251
|
+
end: [nl]
|
|
252
|
+
});
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
default: {
|
|
256
|
+
const indent = "indent" in token ? token.indent : -1;
|
|
257
|
+
const end = "end" in token && Array.isArray(token.end) ? token.end.filter((st) => st.type === "space" || st.type === "comment" || st.type === "newline") : [];
|
|
258
|
+
for (const key of Object.keys(token)) if (key !== "type" && key !== "offset") delete token[key];
|
|
259
|
+
Object.assign(token, {
|
|
260
|
+
type,
|
|
261
|
+
indent,
|
|
262
|
+
source,
|
|
263
|
+
end
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
exports.createScalarToken = createScalarToken;
|
|
269
|
+
exports.resolveAsScalar = resolveAsScalar;
|
|
270
|
+
exports.setScalarValue = setScalarValue;
|
|
271
|
+
}));
|
|
272
|
+
//#endregion
|
|
273
|
+
export default require_cst_scalar();
|
|
274
|
+
export { require_cst_scalar };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-stringify.js
|
|
3
|
+
var require_cst_stringify = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4
|
+
/**
|
|
5
|
+
* Stringify a CST document, token, or collection item
|
|
6
|
+
*
|
|
7
|
+
* Fair warning: This applies no validation whatsoever, and
|
|
8
|
+
* simply concatenates the sources in their logical order.
|
|
9
|
+
*/
|
|
10
|
+
const stringify = (cst) => "type" in cst ? stringifyToken(cst) : stringifyItem(cst);
|
|
11
|
+
function stringifyToken(token) {
|
|
12
|
+
switch (token.type) {
|
|
13
|
+
case "block-scalar": {
|
|
14
|
+
let res = "";
|
|
15
|
+
for (const tok of token.props) res += stringifyToken(tok);
|
|
16
|
+
return res + token.source;
|
|
17
|
+
}
|
|
18
|
+
case "block-map":
|
|
19
|
+
case "block-seq": {
|
|
20
|
+
let res = "";
|
|
21
|
+
for (const item of token.items) res += stringifyItem(item);
|
|
22
|
+
return res;
|
|
23
|
+
}
|
|
24
|
+
case "flow-collection": {
|
|
25
|
+
let res = token.start.source;
|
|
26
|
+
for (const item of token.items) res += stringifyItem(item);
|
|
27
|
+
for (const st of token.end) res += st.source;
|
|
28
|
+
return res;
|
|
29
|
+
}
|
|
30
|
+
case "document": {
|
|
31
|
+
let res = stringifyItem(token);
|
|
32
|
+
if (token.end) for (const st of token.end) res += st.source;
|
|
33
|
+
return res;
|
|
34
|
+
}
|
|
35
|
+
default: {
|
|
36
|
+
let res = token.source;
|
|
37
|
+
if ("end" in token && token.end) for (const st of token.end) res += st.source;
|
|
38
|
+
return res;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function stringifyItem({ start, key, sep, value }) {
|
|
43
|
+
let res = "";
|
|
44
|
+
for (const st of start) res += st.source;
|
|
45
|
+
if (key) res += stringifyToken(key);
|
|
46
|
+
if (sep) for (const st of sep) res += st.source;
|
|
47
|
+
if (value) res += stringifyToken(value);
|
|
48
|
+
return res;
|
|
49
|
+
}
|
|
50
|
+
exports.stringify = stringify;
|
|
51
|
+
}));
|
|
52
|
+
//#endregion
|
|
53
|
+
export default require_cst_stringify();
|
|
54
|
+
export { require_cst_stringify };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-visit.js
|
|
3
|
+
var require_cst_visit = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4
|
+
const BREAK = Symbol("break visit");
|
|
5
|
+
const SKIP = Symbol("skip children");
|
|
6
|
+
const REMOVE = Symbol("remove item");
|
|
7
|
+
/**
|
|
8
|
+
* Apply a visitor to a CST document or item.
|
|
9
|
+
*
|
|
10
|
+
* Walks through the tree (depth-first) starting from the root, calling a
|
|
11
|
+
* `visitor` function with two arguments when entering each item:
|
|
12
|
+
* - `item`: The current item, which included the following members:
|
|
13
|
+
* - `start: SourceToken[]` – Source tokens before the key or value,
|
|
14
|
+
* possibly including its anchor or tag.
|
|
15
|
+
* - `key?: Token | null` – Set for pair values. May then be `null`, if
|
|
16
|
+
* the key before the `:` separator is empty.
|
|
17
|
+
* - `sep?: SourceToken[]` – Source tokens between the key and the value,
|
|
18
|
+
* which should include the `:` map value indicator if `value` is set.
|
|
19
|
+
* - `value?: Token` – The value of a sequence item, or of a map pair.
|
|
20
|
+
* - `path`: The steps from the root to the current node, as an array of
|
|
21
|
+
* `['key' | 'value', number]` tuples.
|
|
22
|
+
*
|
|
23
|
+
* The return value of the visitor may be used to control the traversal:
|
|
24
|
+
* - `undefined` (default): Do nothing and continue
|
|
25
|
+
* - `visit.SKIP`: Do not visit the children of this token, continue with
|
|
26
|
+
* next sibling
|
|
27
|
+
* - `visit.BREAK`: Terminate traversal completely
|
|
28
|
+
* - `visit.REMOVE`: Remove the current item, then continue with the next one
|
|
29
|
+
* - `number`: Set the index of the next step. This is useful especially if
|
|
30
|
+
* the index of the current token has changed.
|
|
31
|
+
* - `function`: Define the next visitor for this item. After the original
|
|
32
|
+
* visitor is called on item entry, next visitors are called after handling
|
|
33
|
+
* a non-empty `key` and when exiting the item.
|
|
34
|
+
*/
|
|
35
|
+
function visit(cst, visitor) {
|
|
36
|
+
if ("type" in cst && cst.type === "document") cst = {
|
|
37
|
+
start: cst.start,
|
|
38
|
+
value: cst.value
|
|
39
|
+
};
|
|
40
|
+
_visit(Object.freeze([]), cst, visitor);
|
|
41
|
+
}
|
|
42
|
+
/** Terminate visit traversal completely */
|
|
43
|
+
visit.BREAK = BREAK;
|
|
44
|
+
/** Do not visit the children of the current item */
|
|
45
|
+
visit.SKIP = SKIP;
|
|
46
|
+
/** Remove the current item */
|
|
47
|
+
visit.REMOVE = REMOVE;
|
|
48
|
+
/** Find the item at `path` from `cst` as the root */
|
|
49
|
+
visit.itemAtPath = (cst, path) => {
|
|
50
|
+
let item = cst;
|
|
51
|
+
for (const [field, index] of path) {
|
|
52
|
+
const tok = item?.[field];
|
|
53
|
+
if (tok && "items" in tok) item = tok.items[index];
|
|
54
|
+
else return void 0;
|
|
55
|
+
}
|
|
56
|
+
return item;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Get the immediate parent collection of the item at `path` from `cst` as the root.
|
|
60
|
+
*
|
|
61
|
+
* Throws an error if the collection is not found, which should never happen if the item itself exists.
|
|
62
|
+
*/
|
|
63
|
+
visit.parentCollection = (cst, path) => {
|
|
64
|
+
const parent = visit.itemAtPath(cst, path.slice(0, -1));
|
|
65
|
+
const field = path[path.length - 1][0];
|
|
66
|
+
const coll = parent?.[field];
|
|
67
|
+
if (coll && "items" in coll) return coll;
|
|
68
|
+
throw new Error("Parent collection not found");
|
|
69
|
+
};
|
|
70
|
+
function _visit(path, item, visitor) {
|
|
71
|
+
let ctrl = visitor(item, path);
|
|
72
|
+
if (typeof ctrl === "symbol") return ctrl;
|
|
73
|
+
for (const field of ["key", "value"]) {
|
|
74
|
+
const token = item[field];
|
|
75
|
+
if (token && "items" in token) {
|
|
76
|
+
for (let i = 0; i < token.items.length; ++i) {
|
|
77
|
+
const ci = _visit(Object.freeze(path.concat([[field, i]])), token.items[i], visitor);
|
|
78
|
+
if (typeof ci === "number") i = ci - 1;
|
|
79
|
+
else if (ci === BREAK) return BREAK;
|
|
80
|
+
else if (ci === REMOVE) {
|
|
81
|
+
token.items.splice(i, 1);
|
|
82
|
+
i -= 1;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (typeof ctrl === "function" && field === "key") ctrl = ctrl(item, path);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return typeof ctrl === "function" ? ctrl(item, path) : ctrl;
|
|
89
|
+
}
|
|
90
|
+
exports.visit = visit;
|
|
91
|
+
}));
|
|
92
|
+
//#endregion
|
|
93
|
+
export default require_cst_visit();
|
|
94
|
+
export { require_cst_visit };
|