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/compose/compose-node.mjs
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_identity } from "../nodes/identity.mjs";
|
|
3
|
+
import { require_Alias } from "../nodes/Alias.mjs";
|
|
4
|
+
import { require_resolve_end } from "./resolve-end.mjs";
|
|
5
|
+
import { require_compose_collection } from "./compose-collection.mjs";
|
|
6
|
+
import { require_compose_scalar } from "./compose-scalar.mjs";
|
|
7
|
+
import { require_util_empty_scalar_position } from "./util-empty-scalar-position.mjs";
|
|
8
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-node.js
|
|
9
|
+
var require_compose_node = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
10
|
+
var Alias = require_Alias();
|
|
11
|
+
var identity = require_identity();
|
|
12
|
+
var composeCollection = require_compose_collection();
|
|
13
|
+
var composeScalar = require_compose_scalar();
|
|
14
|
+
var resolveEnd = require_resolve_end();
|
|
15
|
+
var utilEmptyScalarPosition = require_util_empty_scalar_position();
|
|
16
|
+
const CN = {
|
|
17
|
+
composeNode,
|
|
18
|
+
composeEmptyNode
|
|
19
|
+
};
|
|
20
|
+
function composeNode(ctx, token, props, onError) {
|
|
21
|
+
const atKey = ctx.atKey;
|
|
22
|
+
const { spaceBefore, comment, anchor, tag } = props;
|
|
23
|
+
let node;
|
|
24
|
+
let isSrcToken = true;
|
|
25
|
+
switch (token.type) {
|
|
26
|
+
case "alias":
|
|
27
|
+
node = composeAlias(ctx, token, onError);
|
|
28
|
+
if (anchor || tag) onError(token, "ALIAS_PROPS", "An alias node must not specify any properties");
|
|
29
|
+
break;
|
|
30
|
+
case "scalar":
|
|
31
|
+
case "single-quoted-scalar":
|
|
32
|
+
case "double-quoted-scalar":
|
|
33
|
+
case "block-scalar":
|
|
34
|
+
node = composeScalar.composeScalar(ctx, token, tag, onError);
|
|
35
|
+
if (anchor) node.anchor = anchor.source.substring(1);
|
|
36
|
+
break;
|
|
37
|
+
case "block-map":
|
|
38
|
+
case "block-seq":
|
|
39
|
+
case "flow-collection":
|
|
40
|
+
try {
|
|
41
|
+
node = composeCollection.composeCollection(CN, ctx, token, props, onError);
|
|
42
|
+
if (anchor) node.anchor = anchor.source.substring(1);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
onError(token, "RESOURCE_EXHAUSTION", error instanceof Error ? error.message : String(error));
|
|
45
|
+
}
|
|
46
|
+
break;
|
|
47
|
+
default:
|
|
48
|
+
onError(token, "UNEXPECTED_TOKEN", token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`);
|
|
49
|
+
isSrcToken = false;
|
|
50
|
+
}
|
|
51
|
+
node ?? (node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError));
|
|
52
|
+
if (anchor && node.anchor === "") onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
|
|
53
|
+
if (atKey && ctx.options.stringKeys && (!identity.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) onError(tag ?? token, "NON_STRING_KEY", "With stringKeys, all keys must be strings");
|
|
54
|
+
if (spaceBefore) node.spaceBefore = true;
|
|
55
|
+
if (comment) if (token.type === "scalar" && token.source === "") node.comment = comment;
|
|
56
|
+
else node.commentBefore = comment;
|
|
57
|
+
if (ctx.options.keepSourceTokens && isSrcToken) node.srcToken = token;
|
|
58
|
+
return node;
|
|
59
|
+
}
|
|
60
|
+
function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {
|
|
61
|
+
const token = {
|
|
62
|
+
type: "scalar",
|
|
63
|
+
offset: utilEmptyScalarPosition.emptyScalarPosition(offset, before, pos),
|
|
64
|
+
indent: -1,
|
|
65
|
+
source: ""
|
|
66
|
+
};
|
|
67
|
+
const node = composeScalar.composeScalar(ctx, token, tag, onError);
|
|
68
|
+
if (anchor) {
|
|
69
|
+
node.anchor = anchor.source.substring(1);
|
|
70
|
+
if (node.anchor === "") onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
|
|
71
|
+
}
|
|
72
|
+
if (spaceBefore) node.spaceBefore = true;
|
|
73
|
+
if (comment) {
|
|
74
|
+
node.comment = comment;
|
|
75
|
+
node.range[2] = end;
|
|
76
|
+
}
|
|
77
|
+
return node;
|
|
78
|
+
}
|
|
79
|
+
function composeAlias({ options }, { offset, source, end }, onError) {
|
|
80
|
+
const alias = new Alias.Alias(source.substring(1));
|
|
81
|
+
if (alias.source === "") onError(offset, "BAD_ALIAS", "Alias cannot be an empty string");
|
|
82
|
+
if (alias.source.endsWith(":")) onError(offset + source.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", true);
|
|
83
|
+
const valueEnd = offset + source.length;
|
|
84
|
+
const re = resolveEnd.resolveEnd(end, valueEnd, options.strict, onError);
|
|
85
|
+
alias.range = [
|
|
86
|
+
offset,
|
|
87
|
+
valueEnd,
|
|
88
|
+
re.offset
|
|
89
|
+
];
|
|
90
|
+
if (re.comment) alias.comment = re.comment;
|
|
91
|
+
return alias;
|
|
92
|
+
}
|
|
93
|
+
exports.composeEmptyNode = composeEmptyNode;
|
|
94
|
+
exports.composeNode = composeNode;
|
|
95
|
+
}));
|
|
96
|
+
//#endregion
|
|
97
|
+
export default require_compose_node();
|
|
98
|
+
export { require_compose_node };
|
package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-scalar.mjs
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_identity } from "../nodes/identity.mjs";
|
|
3
|
+
import { require_Scalar } from "../nodes/Scalar.mjs";
|
|
4
|
+
import { require_resolve_block_scalar } from "./resolve-block-scalar.mjs";
|
|
5
|
+
import { require_resolve_flow_scalar } from "./resolve-flow-scalar.mjs";
|
|
6
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-scalar.js
|
|
7
|
+
var require_compose_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
8
|
+
var identity = require_identity();
|
|
9
|
+
var Scalar = require_Scalar();
|
|
10
|
+
var resolveBlockScalar = require_resolve_block_scalar();
|
|
11
|
+
var resolveFlowScalar = require_resolve_flow_scalar();
|
|
12
|
+
function composeScalar(ctx, token, tagToken, onError) {
|
|
13
|
+
const { value, type, comment, range } = token.type === "block-scalar" ? resolveBlockScalar.resolveBlockScalar(ctx, token, onError) : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError);
|
|
14
|
+
const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null;
|
|
15
|
+
let tag;
|
|
16
|
+
if (ctx.options.stringKeys && ctx.atKey) tag = ctx.schema[identity.SCALAR];
|
|
17
|
+
else if (tagName) tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
|
|
18
|
+
else if (token.type === "scalar") tag = findScalarTagByTest(ctx, value, token, onError);
|
|
19
|
+
else tag = ctx.schema[identity.SCALAR];
|
|
20
|
+
let scalar;
|
|
21
|
+
try {
|
|
22
|
+
const res = tag.resolve(value, (msg) => onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options);
|
|
23
|
+
scalar = identity.isScalar(res) ? res : new Scalar.Scalar(res);
|
|
24
|
+
} catch (error) {
|
|
25
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
26
|
+
onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg);
|
|
27
|
+
scalar = new Scalar.Scalar(value);
|
|
28
|
+
}
|
|
29
|
+
scalar.range = range;
|
|
30
|
+
scalar.source = value;
|
|
31
|
+
if (type) scalar.type = type;
|
|
32
|
+
if (tagName) scalar.tag = tagName;
|
|
33
|
+
if (tag.format) scalar.format = tag.format;
|
|
34
|
+
if (comment) scalar.comment = comment;
|
|
35
|
+
return scalar;
|
|
36
|
+
}
|
|
37
|
+
function findScalarTagByName(schema, value, tagName, tagToken, onError) {
|
|
38
|
+
if (tagName === "!") return schema[identity.SCALAR];
|
|
39
|
+
const matchWithTest = [];
|
|
40
|
+
for (const tag of schema.tags) if (!tag.collection && tag.tag === tagName) if (tag.default && tag.test) matchWithTest.push(tag);
|
|
41
|
+
else return tag;
|
|
42
|
+
for (const tag of matchWithTest) if (tag.test?.test(value)) return tag;
|
|
43
|
+
const kt = schema.knownTags[tagName];
|
|
44
|
+
if (kt && !kt.collection) {
|
|
45
|
+
schema.tags.push(Object.assign({}, kt, {
|
|
46
|
+
default: false,
|
|
47
|
+
test: void 0
|
|
48
|
+
}));
|
|
49
|
+
return kt;
|
|
50
|
+
}
|
|
51
|
+
onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
|
|
52
|
+
return schema[identity.SCALAR];
|
|
53
|
+
}
|
|
54
|
+
function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
|
|
55
|
+
const tag = schema.tags.find((tag) => (tag.default === true || atKey && tag.default === "key") && tag.test?.test(value)) || schema[identity.SCALAR];
|
|
56
|
+
if (schema.compat) {
|
|
57
|
+
const compat = schema.compat.find((tag) => tag.default && tag.test?.test(value)) ?? schema[identity.SCALAR];
|
|
58
|
+
if (tag.tag !== compat.tag) onError(token, "TAG_RESOLVE_FAILED", `Value may be parsed as either ${directives.tagString(tag.tag)} or ${directives.tagString(compat.tag)}`, true);
|
|
59
|
+
}
|
|
60
|
+
return tag;
|
|
61
|
+
}
|
|
62
|
+
exports.composeScalar = composeScalar;
|
|
63
|
+
}));
|
|
64
|
+
//#endregion
|
|
65
|
+
export default require_compose_scalar();
|
|
66
|
+
export { require_compose_scalar };
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { __commonJSMin, __require } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_identity } from "../nodes/identity.mjs";
|
|
3
|
+
import { require_directives } from "../doc/directives.mjs";
|
|
4
|
+
import { require_Document } from "../doc/Document.mjs";
|
|
5
|
+
import { require_errors } from "../errors.mjs";
|
|
6
|
+
import { require_resolve_end } from "./resolve-end.mjs";
|
|
7
|
+
import { require_compose_doc } from "./compose-doc.mjs";
|
|
8
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/composer.js
|
|
9
|
+
var require_composer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
10
|
+
var node_process = __require("process");
|
|
11
|
+
var directives = require_directives();
|
|
12
|
+
var Document = require_Document();
|
|
13
|
+
var errors = require_errors();
|
|
14
|
+
var identity = require_identity();
|
|
15
|
+
var composeDoc = require_compose_doc();
|
|
16
|
+
var resolveEnd = require_resolve_end();
|
|
17
|
+
function getErrorPos(src) {
|
|
18
|
+
if (typeof src === "number") return [src, src + 1];
|
|
19
|
+
if (Array.isArray(src)) return src.length === 2 ? src : [src[0], src[1]];
|
|
20
|
+
const { offset, source } = src;
|
|
21
|
+
return [offset, offset + (typeof source === "string" ? source.length : 1)];
|
|
22
|
+
}
|
|
23
|
+
function parsePrelude(prelude) {
|
|
24
|
+
let comment = "";
|
|
25
|
+
let atComment = false;
|
|
26
|
+
let afterEmptyLine = false;
|
|
27
|
+
for (let i = 0; i < prelude.length; ++i) {
|
|
28
|
+
const source = prelude[i];
|
|
29
|
+
switch (source[0]) {
|
|
30
|
+
case "#":
|
|
31
|
+
comment += (comment === "" ? "" : afterEmptyLine ? "\n\n" : "\n") + (source.substring(1) || " ");
|
|
32
|
+
atComment = true;
|
|
33
|
+
afterEmptyLine = false;
|
|
34
|
+
break;
|
|
35
|
+
case "%":
|
|
36
|
+
if (prelude[i + 1]?.[0] !== "#") i += 1;
|
|
37
|
+
atComment = false;
|
|
38
|
+
break;
|
|
39
|
+
default:
|
|
40
|
+
if (!atComment) afterEmptyLine = true;
|
|
41
|
+
atComment = false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
comment,
|
|
46
|
+
afterEmptyLine
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Compose a stream of CST nodes into a stream of YAML Documents.
|
|
51
|
+
*
|
|
52
|
+
* ```ts
|
|
53
|
+
* import { Composer, Parser } from 'yaml'
|
|
54
|
+
*
|
|
55
|
+
* const src: string = ...
|
|
56
|
+
* const tokens = new Parser().parse(src)
|
|
57
|
+
* const docs = new Composer().compose(tokens)
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
var Composer = class {
|
|
61
|
+
constructor(options = {}) {
|
|
62
|
+
this.doc = null;
|
|
63
|
+
this.atDirectives = false;
|
|
64
|
+
this.prelude = [];
|
|
65
|
+
this.errors = [];
|
|
66
|
+
this.warnings = [];
|
|
67
|
+
this.onError = (source, code, message, warning) => {
|
|
68
|
+
const pos = getErrorPos(source);
|
|
69
|
+
if (warning) this.warnings.push(new errors.YAMLWarning(pos, code, message));
|
|
70
|
+
else this.errors.push(new errors.YAMLParseError(pos, code, message));
|
|
71
|
+
};
|
|
72
|
+
this.directives = new directives.Directives({ version: options.version || "1.2" });
|
|
73
|
+
this.options = options;
|
|
74
|
+
}
|
|
75
|
+
decorate(doc, afterDoc) {
|
|
76
|
+
const { comment, afterEmptyLine } = parsePrelude(this.prelude);
|
|
77
|
+
if (comment) {
|
|
78
|
+
const dc = doc.contents;
|
|
79
|
+
if (afterDoc) doc.comment = doc.comment ? `${doc.comment}\n${comment}` : comment;
|
|
80
|
+
else if (afterEmptyLine || doc.directives.docStart || !dc) doc.commentBefore = comment;
|
|
81
|
+
else if (identity.isCollection(dc) && !dc.flow && dc.items.length > 0) {
|
|
82
|
+
let it = dc.items[0];
|
|
83
|
+
if (identity.isPair(it)) it = it.key;
|
|
84
|
+
const cb = it.commentBefore;
|
|
85
|
+
it.commentBefore = cb ? `${comment}\n${cb}` : comment;
|
|
86
|
+
} else {
|
|
87
|
+
const cb = dc.commentBefore;
|
|
88
|
+
dc.commentBefore = cb ? `${comment}\n${cb}` : comment;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (afterDoc) {
|
|
92
|
+
Array.prototype.push.apply(doc.errors, this.errors);
|
|
93
|
+
Array.prototype.push.apply(doc.warnings, this.warnings);
|
|
94
|
+
} else {
|
|
95
|
+
doc.errors = this.errors;
|
|
96
|
+
doc.warnings = this.warnings;
|
|
97
|
+
}
|
|
98
|
+
this.prelude = [];
|
|
99
|
+
this.errors = [];
|
|
100
|
+
this.warnings = [];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Current stream status information.
|
|
104
|
+
*
|
|
105
|
+
* Mostly useful at the end of input for an empty stream.
|
|
106
|
+
*/
|
|
107
|
+
streamInfo() {
|
|
108
|
+
return {
|
|
109
|
+
comment: parsePrelude(this.prelude).comment,
|
|
110
|
+
directives: this.directives,
|
|
111
|
+
errors: this.errors,
|
|
112
|
+
warnings: this.warnings
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Compose tokens into documents.
|
|
117
|
+
*
|
|
118
|
+
* @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.
|
|
119
|
+
* @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.
|
|
120
|
+
*/
|
|
121
|
+
*compose(tokens, forceDoc = false, endOffset = -1) {
|
|
122
|
+
for (const token of tokens) yield* this.next(token);
|
|
123
|
+
yield* this.end(forceDoc, endOffset);
|
|
124
|
+
}
|
|
125
|
+
/** Advance the composer by one CST token. */
|
|
126
|
+
*next(token) {
|
|
127
|
+
if (node_process.env.LOG_STREAM) console.dir(token, { depth: null });
|
|
128
|
+
switch (token.type) {
|
|
129
|
+
case "directive":
|
|
130
|
+
this.directives.add(token.source, (offset, message, warning) => {
|
|
131
|
+
const pos = getErrorPos(token);
|
|
132
|
+
pos[0] += offset;
|
|
133
|
+
this.onError(pos, "BAD_DIRECTIVE", message, warning);
|
|
134
|
+
});
|
|
135
|
+
this.prelude.push(token.source);
|
|
136
|
+
this.atDirectives = true;
|
|
137
|
+
break;
|
|
138
|
+
case "document": {
|
|
139
|
+
const doc = composeDoc.composeDoc(this.options, this.directives, token, this.onError);
|
|
140
|
+
if (this.atDirectives && !doc.directives.docStart) this.onError(token, "MISSING_CHAR", "Missing directives-end/doc-start indicator line");
|
|
141
|
+
this.decorate(doc, false);
|
|
142
|
+
if (this.doc) yield this.doc;
|
|
143
|
+
this.doc = doc;
|
|
144
|
+
this.atDirectives = false;
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
case "byte-order-mark":
|
|
148
|
+
case "space": break;
|
|
149
|
+
case "comment":
|
|
150
|
+
case "newline":
|
|
151
|
+
this.prelude.push(token.source);
|
|
152
|
+
break;
|
|
153
|
+
case "error": {
|
|
154
|
+
const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message;
|
|
155
|
+
const error = new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
|
|
156
|
+
if (this.atDirectives || !this.doc) this.errors.push(error);
|
|
157
|
+
else this.doc.errors.push(error);
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
case "doc-end": {
|
|
161
|
+
if (!this.doc) {
|
|
162
|
+
this.errors.push(new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", "Unexpected doc-end without preceding document"));
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
this.doc.directives.docEnd = true;
|
|
166
|
+
const end = resolveEnd.resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError);
|
|
167
|
+
this.decorate(this.doc, true);
|
|
168
|
+
if (end.comment) {
|
|
169
|
+
const dc = this.doc.comment;
|
|
170
|
+
this.doc.comment = dc ? `${dc}\n${end.comment}` : end.comment;
|
|
171
|
+
}
|
|
172
|
+
this.doc.range[2] = end.offset;
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
default: this.errors.push(new errors.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Call at end of input to yield any remaining document.
|
|
180
|
+
*
|
|
181
|
+
* @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.
|
|
182
|
+
* @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.
|
|
183
|
+
*/
|
|
184
|
+
*end(forceDoc = false, endOffset = -1) {
|
|
185
|
+
if (this.doc) {
|
|
186
|
+
this.decorate(this.doc, true);
|
|
187
|
+
yield this.doc;
|
|
188
|
+
this.doc = null;
|
|
189
|
+
} else if (forceDoc) {
|
|
190
|
+
const opts = Object.assign({ _directives: this.directives }, this.options);
|
|
191
|
+
const doc = new Document.Document(void 0, opts);
|
|
192
|
+
if (this.atDirectives) this.onError(endOffset, "MISSING_CHAR", "Missing directives-end indicator line");
|
|
193
|
+
doc.range = [
|
|
194
|
+
0,
|
|
195
|
+
endOffset,
|
|
196
|
+
endOffset
|
|
197
|
+
];
|
|
198
|
+
this.decorate(doc, false);
|
|
199
|
+
yield doc;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
exports.Composer = Composer;
|
|
204
|
+
}));
|
|
205
|
+
//#endregion
|
|
206
|
+
export default require_composer();
|
|
207
|
+
export { require_composer };
|
package/dist/src/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-map.mjs
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_Pair } from "../nodes/Pair.mjs";
|
|
3
|
+
import { require_YAMLMap } from "../nodes/YAMLMap.mjs";
|
|
4
|
+
import { require_resolve_props } from "./resolve-props.mjs";
|
|
5
|
+
import { require_util_contains_newline } from "./util-contains-newline.mjs";
|
|
6
|
+
import { require_util_flow_indent_check } from "./util-flow-indent-check.mjs";
|
|
7
|
+
import { require_util_map_includes } from "./util-map-includes.mjs";
|
|
8
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-map.js
|
|
9
|
+
var require_resolve_block_map = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
10
|
+
var Pair = require_Pair();
|
|
11
|
+
var YAMLMap = require_YAMLMap();
|
|
12
|
+
var resolveProps = require_resolve_props();
|
|
13
|
+
var utilContainsNewline = require_util_contains_newline();
|
|
14
|
+
var utilFlowIndentCheck = require_util_flow_indent_check();
|
|
15
|
+
var utilMapIncludes = require_util_map_includes();
|
|
16
|
+
const startColMsg = "All mapping items must start at the same column";
|
|
17
|
+
function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) {
|
|
18
|
+
const map = new (tag?.nodeClass ?? YAMLMap.YAMLMap)(ctx.schema);
|
|
19
|
+
if (ctx.atRoot) ctx.atRoot = false;
|
|
20
|
+
let offset = bm.offset;
|
|
21
|
+
let commentEnd = null;
|
|
22
|
+
for (const collItem of bm.items) {
|
|
23
|
+
const { start, key, sep, value } = collItem;
|
|
24
|
+
const keyProps = resolveProps.resolveProps(start, {
|
|
25
|
+
indicator: "explicit-key-ind",
|
|
26
|
+
next: key ?? sep?.[0],
|
|
27
|
+
offset,
|
|
28
|
+
onError,
|
|
29
|
+
parentIndent: bm.indent,
|
|
30
|
+
startOnNewline: true
|
|
31
|
+
});
|
|
32
|
+
const implicitKey = !keyProps.found;
|
|
33
|
+
if (implicitKey) {
|
|
34
|
+
if (key) {
|
|
35
|
+
if (key.type === "block-seq") onError(offset, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key");
|
|
36
|
+
else if ("indent" in key && key.indent !== bm.indent) onError(offset, "BAD_INDENT", startColMsg);
|
|
37
|
+
}
|
|
38
|
+
if (!keyProps.anchor && !keyProps.tag && !sep) {
|
|
39
|
+
commentEnd = keyProps.end;
|
|
40
|
+
if (keyProps.comment) if (map.comment) map.comment += "\n" + keyProps.comment;
|
|
41
|
+
else map.comment = keyProps.comment;
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) onError(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
|
45
|
+
} else if (keyProps.found?.indent !== bm.indent) onError(offset, "BAD_INDENT", startColMsg);
|
|
46
|
+
ctx.atKey = true;
|
|
47
|
+
const keyStart = keyProps.end;
|
|
48
|
+
const keyNode = key ? composeNode(ctx, key, keyProps, onError) : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
|
|
49
|
+
if (ctx.schema.compat) utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError);
|
|
50
|
+
ctx.atKey = false;
|
|
51
|
+
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode)) onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
52
|
+
const valueProps = resolveProps.resolveProps(sep ?? [], {
|
|
53
|
+
indicator: "map-value-ind",
|
|
54
|
+
next: value,
|
|
55
|
+
offset: keyNode.range[2],
|
|
56
|
+
onError,
|
|
57
|
+
parentIndent: bm.indent,
|
|
58
|
+
startOnNewline: !key || key.type === "block-scalar"
|
|
59
|
+
});
|
|
60
|
+
offset = valueProps.end;
|
|
61
|
+
if (valueProps.found) {
|
|
62
|
+
if (implicitKey) {
|
|
63
|
+
if (value?.type === "block-map" && !valueProps.hasNewline) onError(offset, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings");
|
|
64
|
+
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024) onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
|
|
65
|
+
}
|
|
66
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep, null, valueProps, onError);
|
|
67
|
+
if (ctx.schema.compat) utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
|
|
68
|
+
offset = valueNode.range[2];
|
|
69
|
+
const pair = new Pair.Pair(keyNode, valueNode);
|
|
70
|
+
if (ctx.options.keepSourceTokens) pair.srcToken = collItem;
|
|
71
|
+
map.items.push(pair);
|
|
72
|
+
} else {
|
|
73
|
+
if (implicitKey) onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values");
|
|
74
|
+
if (valueProps.comment) if (keyNode.comment) keyNode.comment += "\n" + valueProps.comment;
|
|
75
|
+
else keyNode.comment = valueProps.comment;
|
|
76
|
+
const pair = new Pair.Pair(keyNode);
|
|
77
|
+
if (ctx.options.keepSourceTokens) pair.srcToken = collItem;
|
|
78
|
+
map.items.push(pair);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (commentEnd && commentEnd < offset) onError(commentEnd, "IMPOSSIBLE", "Map comment with trailing content");
|
|
82
|
+
map.range = [
|
|
83
|
+
bm.offset,
|
|
84
|
+
offset,
|
|
85
|
+
commentEnd ?? offset
|
|
86
|
+
];
|
|
87
|
+
return map;
|
|
88
|
+
}
|
|
89
|
+
exports.resolveBlockMap = resolveBlockMap;
|
|
90
|
+
}));
|
|
91
|
+
//#endregion
|
|
92
|
+
export default require_resolve_block_map();
|
|
93
|
+
export { require_resolve_block_map };
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_Scalar } from "../nodes/Scalar.mjs";
|
|
3
|
+
//#region node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-scalar.js
|
|
4
|
+
var require_resolve_block_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5
|
+
var Scalar = require_Scalar();
|
|
6
|
+
function resolveBlockScalar(ctx, scalar, onError) {
|
|
7
|
+
const start = scalar.offset;
|
|
8
|
+
const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);
|
|
9
|
+
if (!header) return {
|
|
10
|
+
value: "",
|
|
11
|
+
type: null,
|
|
12
|
+
comment: "",
|
|
13
|
+
range: [
|
|
14
|
+
start,
|
|
15
|
+
start,
|
|
16
|
+
start
|
|
17
|
+
]
|
|
18
|
+
};
|
|
19
|
+
const type = header.mode === ">" ? Scalar.Scalar.BLOCK_FOLDED : Scalar.Scalar.BLOCK_LITERAL;
|
|
20
|
+
const lines = scalar.source ? splitLines(scalar.source) : [];
|
|
21
|
+
let chompStart = lines.length;
|
|
22
|
+
for (let i = lines.length - 1; i >= 0; --i) {
|
|
23
|
+
const content = lines[i][1];
|
|
24
|
+
if (content === "" || content === "\r") chompStart = i;
|
|
25
|
+
else break;
|
|
26
|
+
}
|
|
27
|
+
if (chompStart === 0) {
|
|
28
|
+
const value = header.chomp === "+" && lines.length > 0 ? "\n".repeat(Math.max(1, lines.length - 1)) : "";
|
|
29
|
+
let end = start + header.length;
|
|
30
|
+
if (scalar.source) end += scalar.source.length;
|
|
31
|
+
return {
|
|
32
|
+
value,
|
|
33
|
+
type,
|
|
34
|
+
comment: header.comment,
|
|
35
|
+
range: [
|
|
36
|
+
start,
|
|
37
|
+
end,
|
|
38
|
+
end
|
|
39
|
+
]
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
let trimIndent = scalar.indent + header.indent;
|
|
43
|
+
let offset = scalar.offset + header.length;
|
|
44
|
+
let contentStart = 0;
|
|
45
|
+
for (let i = 0; i < chompStart; ++i) {
|
|
46
|
+
const [indent, content] = lines[i];
|
|
47
|
+
if (content === "" || content === "\r") {
|
|
48
|
+
if (header.indent === 0 && indent.length > trimIndent) trimIndent = indent.length;
|
|
49
|
+
} else {
|
|
50
|
+
if (indent.length < trimIndent) onError(offset + indent.length, "MISSING_CHAR", "Block scalars with more-indented leading empty lines must use an explicit indentation indicator");
|
|
51
|
+
if (header.indent === 0) trimIndent = indent.length;
|
|
52
|
+
contentStart = i;
|
|
53
|
+
if (trimIndent === 0 && !ctx.atRoot) onError(offset, "BAD_INDENT", "Block scalar values in collections must be indented");
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
offset += indent.length + content.length + 1;
|
|
57
|
+
}
|
|
58
|
+
for (let i = lines.length - 1; i >= chompStart; --i) if (lines[i][0].length > trimIndent) chompStart = i + 1;
|
|
59
|
+
let value = "";
|
|
60
|
+
let sep = "";
|
|
61
|
+
let prevMoreIndented = false;
|
|
62
|
+
for (let i = 0; i < contentStart; ++i) value += lines[i][0].slice(trimIndent) + "\n";
|
|
63
|
+
for (let i = contentStart; i < chompStart; ++i) {
|
|
64
|
+
let [indent, content] = lines[i];
|
|
65
|
+
offset += indent.length + content.length + 1;
|
|
66
|
+
const crlf = content[content.length - 1] === "\r";
|
|
67
|
+
if (crlf) content = content.slice(0, -1);
|
|
68
|
+
/* istanbul ignore if already caught in lexer */
|
|
69
|
+
if (content && indent.length < trimIndent) {
|
|
70
|
+
const message = `Block scalar lines must not be less indented than their ${header.indent ? "explicit indentation indicator" : "first line"}`;
|
|
71
|
+
onError(offset - content.length - (crlf ? 2 : 1), "BAD_INDENT", message);
|
|
72
|
+
indent = "";
|
|
73
|
+
}
|
|
74
|
+
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
75
|
+
value += sep + indent.slice(trimIndent) + content;
|
|
76
|
+
sep = "\n";
|
|
77
|
+
} else if (indent.length > trimIndent || content[0] === " ") {
|
|
78
|
+
if (sep === " ") sep = "\n";
|
|
79
|
+
else if (!prevMoreIndented && sep === "\n") sep = "\n\n";
|
|
80
|
+
value += sep + indent.slice(trimIndent) + content;
|
|
81
|
+
sep = "\n";
|
|
82
|
+
prevMoreIndented = true;
|
|
83
|
+
} else if (content === "") if (sep === "\n") value += "\n";
|
|
84
|
+
else sep = "\n";
|
|
85
|
+
else {
|
|
86
|
+
value += sep + content;
|
|
87
|
+
sep = " ";
|
|
88
|
+
prevMoreIndented = false;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
switch (header.chomp) {
|
|
92
|
+
case "-": break;
|
|
93
|
+
case "+":
|
|
94
|
+
for (let i = chompStart; i < lines.length; ++i) value += "\n" + lines[i][0].slice(trimIndent);
|
|
95
|
+
if (value[value.length - 1] !== "\n") value += "\n";
|
|
96
|
+
break;
|
|
97
|
+
default: value += "\n";
|
|
98
|
+
}
|
|
99
|
+
const end = start + header.length + scalar.source.length;
|
|
100
|
+
return {
|
|
101
|
+
value,
|
|
102
|
+
type,
|
|
103
|
+
comment: header.comment,
|
|
104
|
+
range: [
|
|
105
|
+
start,
|
|
106
|
+
end,
|
|
107
|
+
end
|
|
108
|
+
]
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function parseBlockScalarHeader({ offset, props }, strict, onError) {
|
|
112
|
+
/* istanbul ignore if should not happen */
|
|
113
|
+
if (props[0].type !== "block-scalar-header") {
|
|
114
|
+
onError(props[0], "IMPOSSIBLE", "Block scalar header not found");
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
const { source } = props[0];
|
|
118
|
+
const mode = source[0];
|
|
119
|
+
let indent = 0;
|
|
120
|
+
let chomp = "";
|
|
121
|
+
let error = -1;
|
|
122
|
+
for (let i = 1; i < source.length; ++i) {
|
|
123
|
+
const ch = source[i];
|
|
124
|
+
if (!chomp && (ch === "-" || ch === "+")) chomp = ch;
|
|
125
|
+
else {
|
|
126
|
+
const n = Number(ch);
|
|
127
|
+
if (!indent && n) indent = n;
|
|
128
|
+
else if (error === -1) error = offset + i;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (error !== -1) onError(error, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${source}`);
|
|
132
|
+
let hasSpace = false;
|
|
133
|
+
let comment = "";
|
|
134
|
+
let length = source.length;
|
|
135
|
+
for (let i = 1; i < props.length; ++i) {
|
|
136
|
+
const token = props[i];
|
|
137
|
+
switch (token.type) {
|
|
138
|
+
case "space": hasSpace = true;
|
|
139
|
+
case "newline":
|
|
140
|
+
length += token.source.length;
|
|
141
|
+
break;
|
|
142
|
+
case "comment":
|
|
143
|
+
if (strict && !hasSpace) onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
|
|
144
|
+
length += token.source.length;
|
|
145
|
+
comment = token.source.substring(1);
|
|
146
|
+
break;
|
|
147
|
+
case "error":
|
|
148
|
+
onError(token, "UNEXPECTED_TOKEN", token.message);
|
|
149
|
+
length += token.source.length;
|
|
150
|
+
break;
|
|
151
|
+
default: {
|
|
152
|
+
onError(token, "UNEXPECTED_TOKEN", `Unexpected token in block scalar header: ${token.type}`);
|
|
153
|
+
const ts = token.source;
|
|
154
|
+
if (ts && typeof ts === "string") length += ts.length;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
mode,
|
|
160
|
+
indent,
|
|
161
|
+
chomp,
|
|
162
|
+
comment,
|
|
163
|
+
length
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/** @returns Array of lines split up as `[indent, content]` */
|
|
167
|
+
function splitLines(source) {
|
|
168
|
+
const split = source.split(/\n( *)/);
|
|
169
|
+
const first = split[0];
|
|
170
|
+
const m = first.match(/^( *)/);
|
|
171
|
+
const lines = [m?.[1] ? [m[1], first.slice(m[1].length)] : ["", first]];
|
|
172
|
+
for (let i = 1; i < split.length; i += 2) lines.push([split[i], split[i + 1]]);
|
|
173
|
+
return lines;
|
|
174
|
+
}
|
|
175
|
+
exports.resolveBlockScalar = resolveBlockScalar;
|
|
176
|
+
}));
|
|
177
|
+
//#endregion
|
|
178
|
+
export default require_resolve_block_scalar();
|
|
179
|
+
export { require_resolve_block_scalar };
|