@rse/ase 0.0.31 → 0.0.32
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/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.github/plugin/plugin.json +1 -1
- package/plugin/etc/markdownlint.yaml +18 -0
- package/plugin/etc/stx.conf +23 -0
- package/plugin/meta/ase-plan.md +4 -4
- package/plugin/node_modules/.package-lock.json +1342 -0
- package/plugin/node_modules/@nodelib/fs.scandir/LICENSE +21 -0
- package/plugin/node_modules/@nodelib/fs.scandir/README.md +171 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +19 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/constants.d.ts +4 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/constants.js +17 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/index.d.ts +12 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/index.js +26 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/providers/async.js +104 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +1 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/providers/common.js +13 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +5 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/providers/sync.js +54 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/settings.d.ts +20 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/settings.js +24 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/types/index.js +2 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +2 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/utils/fs.js +19 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +2 -0
- package/plugin/node_modules/@nodelib/fs.scandir/out/utils/index.js +5 -0
- package/plugin/node_modules/@nodelib/fs.scandir/package.json +44 -0
- package/plugin/node_modules/@nodelib/fs.stat/LICENSE +21 -0
- package/plugin/node_modules/@nodelib/fs.stat/README.md +126 -0
- package/plugin/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
- package/plugin/node_modules/@nodelib/fs.stat/out/adapters/fs.js +17 -0
- package/plugin/node_modules/@nodelib/fs.stat/out/index.d.ts +12 -0
- package/plugin/node_modules/@nodelib/fs.stat/out/index.js +26 -0
- package/plugin/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
- package/plugin/node_modules/@nodelib/fs.stat/out/providers/async.js +36 -0
- package/plugin/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +3 -0
- package/plugin/node_modules/@nodelib/fs.stat/out/providers/sync.js +23 -0
- package/plugin/node_modules/@nodelib/fs.stat/out/settings.d.ts +16 -0
- package/plugin/node_modules/@nodelib/fs.stat/out/settings.js +16 -0
- package/plugin/node_modules/@nodelib/fs.stat/out/types/index.d.ts +4 -0
- package/plugin/node_modules/@nodelib/fs.stat/out/types/index.js +2 -0
- package/plugin/node_modules/@nodelib/fs.stat/package.json +37 -0
- package/plugin/node_modules/@nodelib/fs.walk/LICENSE +21 -0
- package/plugin/node_modules/@nodelib/fs.walk/README.md +215 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/index.d.ts +14 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/index.js +34 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/providers/async.js +30 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +4 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/providers/index.js +9 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +12 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/providers/stream.js +34 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +10 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/providers/sync.js +14 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/readers/async.js +97 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +7 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/readers/common.js +31 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/readers/reader.js +11 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +15 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/readers/sync.js +59 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/settings.d.ts +30 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/settings.js +26 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/types/index.d.ts +8 -0
- package/plugin/node_modules/@nodelib/fs.walk/out/types/index.js +2 -0
- package/plugin/node_modules/@nodelib/fs.walk/package.json +44 -0
- package/plugin/node_modules/@rse/stx/README.md +176 -0
- package/plugin/node_modules/@rse/stx/dst-stage2/stx.1 +206 -0
- package/plugin/node_modules/@rse/stx/dst-stage2/stx.js +205 -0
- package/plugin/node_modules/@rse/stx/etc/.markdownlint.yaml +11 -0
- package/plugin/node_modules/@rse/stx/etc/eslint.mjs +82 -0
- package/plugin/node_modules/@rse/stx/etc/stx-bootstrap.js +18 -0
- package/plugin/node_modules/@rse/stx/etc/stx.conf +59 -0
- package/plugin/node_modules/@rse/stx/etc/tsc.json +24 -0
- package/plugin/node_modules/@rse/stx/etc/vite.mts +69 -0
- package/plugin/node_modules/@rse/stx/package.json +71 -0
- package/plugin/node_modules/@rse/stx/src/stx-logo.ai +1466 -4
- package/plugin/node_modules/@rse/stx/src/stx-logo.svg +31 -0
- package/plugin/node_modules/@rse/stx/src/stx.md +293 -0
- package/plugin/node_modules/@rse/stx/src/stx.ts +708 -0
- package/plugin/node_modules/@rse/stx/src/tsconfig.json +3 -0
- package/plugin/node_modules/@sindresorhus/merge-streams/index.d.ts +44 -0
- package/plugin/node_modules/@sindresorhus/merge-streams/index.js +265 -0
- package/plugin/node_modules/@sindresorhus/merge-streams/license +9 -0
- package/plugin/node_modules/@sindresorhus/merge-streams/package.json +49 -0
- package/plugin/node_modules/@sindresorhus/merge-streams/readme.md +53 -0
- package/plugin/node_modules/@types/debug/LICENSE +21 -0
- package/plugin/node_modules/@types/debug/README.md +69 -0
- package/plugin/node_modules/@types/debug/index.d.ts +50 -0
- package/plugin/node_modules/@types/debug/package.json +58 -0
- package/plugin/node_modules/@types/katex/LICENSE +21 -0
- package/plugin/node_modules/@types/katex/README.md +15 -0
- package/plugin/node_modules/@types/katex/contrib/auto-render.d.ts +67 -0
- package/plugin/node_modules/@types/katex/index.d.ts +151 -0
- package/plugin/node_modules/@types/katex/package.json +46 -0
- package/plugin/node_modules/@types/ms/LICENSE +21 -0
- package/plugin/node_modules/@types/ms/README.md +82 -0
- package/plugin/node_modules/@types/ms/index.d.ts +63 -0
- package/plugin/node_modules/@types/ms/package.json +26 -0
- package/plugin/node_modules/@types/unist/LICENSE +21 -0
- package/plugin/node_modules/@types/unist/README.md +122 -0
- package/plugin/node_modules/@types/unist/index.d.ts +103 -0
- package/plugin/node_modules/@types/unist/package.json +55 -0
- package/plugin/node_modules/ansi-regex/index.d.ts +33 -0
- package/plugin/node_modules/ansi-regex/index.js +14 -0
- package/plugin/node_modules/ansi-regex/license +9 -0
- package/plugin/node_modules/ansi-regex/package.json +61 -0
- package/plugin/node_modules/ansi-regex/readme.md +66 -0
- package/plugin/node_modules/argparse/CHANGELOG.md +216 -0
- package/plugin/node_modules/argparse/LICENSE +254 -0
- package/plugin/node_modules/argparse/README.md +84 -0
- package/plugin/node_modules/argparse/argparse.js +3707 -0
- package/plugin/node_modules/argparse/lib/sub.js +67 -0
- package/plugin/node_modules/argparse/lib/textwrap.js +440 -0
- package/plugin/node_modules/argparse/package.json +31 -0
- package/plugin/node_modules/braces/LICENSE +21 -0
- package/plugin/node_modules/braces/README.md +586 -0
- package/plugin/node_modules/braces/index.js +170 -0
- package/plugin/node_modules/braces/lib/compile.js +60 -0
- package/plugin/node_modules/braces/lib/constants.js +57 -0
- package/plugin/node_modules/braces/lib/expand.js +113 -0
- package/plugin/node_modules/braces/lib/parse.js +331 -0
- package/plugin/node_modules/braces/lib/stringify.js +32 -0
- package/plugin/node_modules/braces/lib/utils.js +122 -0
- package/plugin/node_modules/braces/package.json +77 -0
- package/plugin/node_modules/character-entities/index.d.ts +6 -0
- package/plugin/node_modules/character-entities/index.js +2132 -0
- package/plugin/node_modules/character-entities/license +22 -0
- package/plugin/node_modules/character-entities/package.json +78 -0
- package/plugin/node_modules/character-entities/readme.md +152 -0
- package/plugin/node_modules/character-entities-legacy/index.d.ts +6 -0
- package/plugin/node_modules/character-entities-legacy/index.js +113 -0
- package/plugin/node_modules/character-entities-legacy/license +22 -0
- package/plugin/node_modules/character-entities-legacy/package.json +77 -0
- package/plugin/node_modules/character-entities-legacy/readme.md +157 -0
- package/plugin/node_modules/character-reference-invalid/index.d.ts +6 -0
- package/plugin/node_modules/character-reference-invalid/index.js +35 -0
- package/plugin/node_modules/character-reference-invalid/license +22 -0
- package/plugin/node_modules/character-reference-invalid/package.json +83 -0
- package/plugin/node_modules/character-reference-invalid/readme.md +156 -0
- package/plugin/node_modules/commander/LICENSE +22 -0
- package/plugin/node_modules/commander/Readme.md +1015 -0
- package/plugin/node_modules/commander/esm.mjs +15 -0
- package/plugin/node_modules/commander/index.js +27 -0
- package/plugin/node_modules/commander/lib/argument.js +147 -0
- package/plugin/node_modules/commander/lib/command.js +1944 -0
- package/plugin/node_modules/commander/lib/error.js +45 -0
- package/plugin/node_modules/commander/lib/help.js +396 -0
- package/plugin/node_modules/commander/lib/option.js +208 -0
- package/plugin/node_modules/commander/lib/suggestSimilar.js +100 -0
- package/plugin/node_modules/commander/package-support.json +16 -0
- package/plugin/node_modules/commander/package.json +69 -0
- package/plugin/node_modules/commander/typings/index.d.ts +774 -0
- package/plugin/node_modules/debug/LICENSE +20 -0
- package/plugin/node_modules/debug/README.md +481 -0
- package/plugin/node_modules/debug/package.json +64 -0
- package/plugin/node_modules/debug/src/browser.js +272 -0
- package/plugin/node_modules/debug/src/common.js +292 -0
- package/plugin/node_modules/debug/src/index.js +10 -0
- package/plugin/node_modules/debug/src/node.js +263 -0
- package/plugin/node_modules/decode-named-character-reference/index.d.ts +13 -0
- package/plugin/node_modules/decode-named-character-reference/index.d.ts.map +1 -0
- package/plugin/node_modules/decode-named-character-reference/index.dom.d.ts +6 -0
- package/plugin/node_modules/decode-named-character-reference/index.dom.d.ts.map +1 -0
- package/plugin/node_modules/decode-named-character-reference/index.dom.js +32 -0
- package/plugin/node_modules/decode-named-character-reference/index.js +19 -0
- package/plugin/node_modules/decode-named-character-reference/license +22 -0
- package/plugin/node_modules/decode-named-character-reference/package.json +90 -0
- package/plugin/node_modules/decode-named-character-reference/readme.md +136 -0
- package/plugin/node_modules/dequal/dist/index.js +86 -0
- package/plugin/node_modules/dequal/dist/index.min.js +1 -0
- package/plugin/node_modules/dequal/dist/index.mjs +84 -0
- package/plugin/node_modules/dequal/index.d.ts +1 -0
- package/plugin/node_modules/dequal/license +21 -0
- package/plugin/node_modules/dequal/lite/index.d.ts +1 -0
- package/plugin/node_modules/dequal/lite/index.js +31 -0
- package/plugin/node_modules/dequal/lite/index.min.js +1 -0
- package/plugin/node_modules/dequal/lite/index.mjs +29 -0
- package/plugin/node_modules/dequal/package.json +57 -0
- package/plugin/node_modules/dequal/readme.md +112 -0
- package/plugin/node_modules/devlop/lib/default.js +9 -0
- package/plugin/node_modules/devlop/lib/development.d.ts +84 -0
- package/plugin/node_modules/devlop/lib/development.js +238 -0
- package/plugin/node_modules/devlop/license +22 -0
- package/plugin/node_modules/devlop/package.json +80 -0
- package/plugin/node_modules/devlop/readme.md +360 -0
- package/plugin/node_modules/entities/LICENSE +11 -0
- package/plugin/node_modules/entities/lib/decode.d.ts +211 -0
- package/plugin/node_modules/entities/lib/decode.d.ts.map +1 -0
- package/plugin/node_modules/entities/lib/decode.js +536 -0
- package/plugin/node_modules/entities/lib/decode.js.map +1 -0
- package/plugin/node_modules/entities/lib/decode_codepoint.d.ts +19 -0
- package/plugin/node_modules/entities/lib/decode_codepoint.d.ts.map +1 -0
- package/plugin/node_modules/entities/lib/decode_codepoint.js +76 -0
- package/plugin/node_modules/entities/lib/decode_codepoint.js.map +1 -0
- package/plugin/node_modules/entities/lib/encode.d.ts +22 -0
- package/plugin/node_modules/entities/lib/encode.d.ts.map +1 -0
- package/plugin/node_modules/entities/lib/encode.js +77 -0
- package/plugin/node_modules/entities/lib/encode.js.map +1 -0
- package/plugin/node_modules/entities/lib/escape.d.ts +43 -0
- package/plugin/node_modules/entities/lib/escape.d.ts.map +1 -0
- package/plugin/node_modules/entities/lib/escape.js +122 -0
- package/plugin/node_modules/entities/lib/escape.js.map +1 -0
- package/plugin/node_modules/entities/lib/esm/decode.d.ts +211 -0
- package/plugin/node_modules/entities/lib/esm/decode.d.ts.map +1 -0
- package/plugin/node_modules/entities/lib/esm/decode.js +496 -0
- package/plugin/node_modules/entities/lib/esm/decode.js.map +1 -0
- package/plugin/node_modules/entities/lib/esm/decode_codepoint.d.ts +19 -0
- package/plugin/node_modules/entities/lib/esm/decode_codepoint.d.ts.map +1 -0
- package/plugin/node_modules/entities/lib/esm/decode_codepoint.js +71 -0
- package/plugin/node_modules/entities/lib/esm/decode_codepoint.js.map +1 -0
- package/plugin/node_modules/entities/lib/esm/encode.d.ts +22 -0
- package/plugin/node_modules/entities/lib/esm/encode.d.ts.map +1 -0
- package/plugin/node_modules/entities/lib/esm/encode.js +69 -0
- package/plugin/node_modules/entities/lib/esm/encode.js.map +1 -0
- package/plugin/node_modules/entities/lib/esm/escape.d.ts +43 -0
- package/plugin/node_modules/entities/lib/esm/escape.d.ts.map +1 -0
- package/plugin/node_modules/entities/lib/esm/escape.js +116 -0
- package/plugin/node_modules/entities/lib/esm/escape.js.map +1 -0
- package/plugin/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +3 -0
- package/plugin/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map +1 -0
- package/plugin/node_modules/entities/lib/esm/generated/decode-data-html.js +7 -0
- package/plugin/node_modules/entities/lib/esm/generated/decode-data-html.js.map +1 -0
- package/plugin/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +3 -0
- package/plugin/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map +1 -0
- package/plugin/node_modules/entities/lib/esm/generated/decode-data-xml.js +7 -0
- package/plugin/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +1 -0
- package/plugin/node_modules/entities/lib/esm/generated/encode-html.d.ts +8 -0
- package/plugin/node_modules/entities/lib/esm/generated/encode-html.d.ts.map +1 -0
- package/plugin/node_modules/entities/lib/esm/generated/encode-html.js +10 -0
- package/plugin/node_modules/entities/lib/esm/generated/encode-html.js.map +1 -0
- package/plugin/node_modules/entities/lib/esm/index.d.ts +96 -0
- package/plugin/node_modules/entities/lib/esm/index.d.ts.map +1 -0
- package/plugin/node_modules/entities/lib/esm/index.js +99 -0
- package/plugin/node_modules/entities/lib/esm/index.js.map +1 -0
- package/plugin/node_modules/entities/lib/esm/package.json +1 -0
- package/plugin/node_modules/entities/lib/generated/decode-data-html.d.ts +3 -0
- package/plugin/node_modules/entities/lib/generated/decode-data-html.d.ts.map +1 -0
- package/plugin/node_modules/entities/lib/generated/decode-data-html.js +9 -0
- package/plugin/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
- package/plugin/node_modules/entities/lib/generated/decode-data-xml.d.ts +3 -0
- package/plugin/node_modules/entities/lib/generated/decode-data-xml.d.ts.map +1 -0
- package/plugin/node_modules/entities/lib/generated/decode-data-xml.js +9 -0
- package/plugin/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
- package/plugin/node_modules/entities/lib/generated/encode-html.d.ts +8 -0
- package/plugin/node_modules/entities/lib/generated/encode-html.d.ts.map +1 -0
- package/plugin/node_modules/entities/lib/generated/encode-html.js +12 -0
- package/plugin/node_modules/entities/lib/generated/encode-html.js.map +1 -0
- package/plugin/node_modules/entities/lib/index.d.ts +96 -0
- package/plugin/node_modules/entities/lib/index.d.ts.map +1 -0
- package/plugin/node_modules/entities/lib/index.js +126 -0
- package/plugin/node_modules/entities/lib/index.js.map +1 -0
- package/plugin/node_modules/entities/package.json +90 -0
- package/plugin/node_modules/entities/readme.md +122 -0
- package/plugin/node_modules/fast-glob/LICENSE +21 -0
- package/plugin/node_modules/fast-glob/README.md +830 -0
- package/plugin/node_modules/fast-glob/out/index.d.ts +40 -0
- package/plugin/node_modules/fast-glob/out/index.js +102 -0
- package/plugin/node_modules/fast-glob/out/managers/tasks.d.ts +22 -0
- package/plugin/node_modules/fast-glob/out/managers/tasks.js +110 -0
- package/plugin/node_modules/fast-glob/out/providers/async.d.ts +9 -0
- package/plugin/node_modules/fast-glob/out/providers/async.js +23 -0
- package/plugin/node_modules/fast-glob/out/providers/filters/deep.d.ts +16 -0
- package/plugin/node_modules/fast-glob/out/providers/filters/deep.js +62 -0
- package/plugin/node_modules/fast-glob/out/providers/filters/entry.d.ts +17 -0
- package/plugin/node_modules/fast-glob/out/providers/filters/entry.js +85 -0
- package/plugin/node_modules/fast-glob/out/providers/filters/error.d.ts +8 -0
- package/plugin/node_modules/fast-glob/out/providers/filters/error.js +15 -0
- package/plugin/node_modules/fast-glob/out/providers/matchers/matcher.d.ts +33 -0
- package/plugin/node_modules/fast-glob/out/providers/matchers/matcher.js +45 -0
- package/plugin/node_modules/fast-glob/out/providers/matchers/partial.d.ts +4 -0
- package/plugin/node_modules/fast-glob/out/providers/matchers/partial.js +38 -0
- package/plugin/node_modules/fast-glob/out/providers/provider.d.ts +19 -0
- package/plugin/node_modules/fast-glob/out/providers/provider.js +48 -0
- package/plugin/node_modules/fast-glob/out/providers/stream.d.ts +11 -0
- package/plugin/node_modules/fast-glob/out/providers/stream.js +31 -0
- package/plugin/node_modules/fast-glob/out/providers/sync.d.ts +9 -0
- package/plugin/node_modules/fast-glob/out/providers/sync.js +23 -0
- package/plugin/node_modules/fast-glob/out/providers/transformers/entry.d.ts +8 -0
- package/plugin/node_modules/fast-glob/out/providers/transformers/entry.js +26 -0
- package/plugin/node_modules/fast-glob/out/readers/async.d.ts +10 -0
- package/plugin/node_modules/fast-glob/out/readers/async.js +35 -0
- package/plugin/node_modules/fast-glob/out/readers/reader.d.ts +15 -0
- package/plugin/node_modules/fast-glob/out/readers/reader.js +33 -0
- package/plugin/node_modules/fast-glob/out/readers/stream.d.ts +14 -0
- package/plugin/node_modules/fast-glob/out/readers/stream.js +55 -0
- package/plugin/node_modules/fast-glob/out/readers/sync.d.ts +12 -0
- package/plugin/node_modules/fast-glob/out/readers/sync.js +43 -0
- package/plugin/node_modules/fast-glob/out/settings.d.ts +164 -0
- package/plugin/node_modules/fast-glob/out/settings.js +59 -0
- package/plugin/node_modules/fast-glob/out/types/index.d.ts +31 -0
- package/plugin/node_modules/fast-glob/out/types/index.js +2 -0
- package/plugin/node_modules/fast-glob/out/utils/array.d.ts +2 -0
- package/plugin/node_modules/fast-glob/out/utils/array.js +22 -0
- package/plugin/node_modules/fast-glob/out/utils/errno.d.ts +2 -0
- package/plugin/node_modules/fast-glob/out/utils/errno.js +7 -0
- package/plugin/node_modules/fast-glob/out/utils/fs.d.ts +4 -0
- package/plugin/node_modules/fast-glob/out/utils/fs.js +19 -0
- package/plugin/node_modules/fast-glob/out/utils/index.d.ts +8 -0
- package/plugin/node_modules/fast-glob/out/utils/index.js +17 -0
- package/plugin/node_modules/fast-glob/out/utils/path.d.ts +13 -0
- package/plugin/node_modules/fast-glob/out/utils/path.js +68 -0
- package/plugin/node_modules/fast-glob/out/utils/pattern.d.ts +49 -0
- package/plugin/node_modules/fast-glob/out/utils/pattern.js +206 -0
- package/plugin/node_modules/fast-glob/out/utils/stream.d.ts +4 -0
- package/plugin/node_modules/fast-glob/out/utils/stream.js +17 -0
- package/plugin/node_modules/fast-glob/out/utils/string.d.ts +2 -0
- package/plugin/node_modules/fast-glob/out/utils/string.js +11 -0
- package/plugin/node_modules/fast-glob/package.json +81 -0
- package/plugin/node_modules/fastq/LICENSE +13 -0
- package/plugin/node_modules/fastq/README.md +310 -0
- package/plugin/node_modules/fastq/SECURITY.md +15 -0
- package/plugin/node_modules/fastq/bench.js +66 -0
- package/plugin/node_modules/fastq/eslint.config.js +11 -0
- package/plugin/node_modules/fastq/example.js +14 -0
- package/plugin/node_modules/fastq/example.mjs +9 -0
- package/plugin/node_modules/fastq/index.d.ts +59 -0
- package/plugin/node_modules/fastq/package.json +49 -0
- package/plugin/node_modules/fastq/queue.js +346 -0
- package/plugin/node_modules/fastq/test/example.ts +83 -0
- package/plugin/node_modules/fastq/test/promise.js +325 -0
- package/plugin/node_modules/fastq/test/test.js +733 -0
- package/plugin/node_modules/fastq/test/tsconfig.json +11 -0
- package/plugin/node_modules/fill-range/LICENSE +21 -0
- package/plugin/node_modules/fill-range/README.md +237 -0
- package/plugin/node_modules/fill-range/index.js +248 -0
- package/plugin/node_modules/fill-range/package.json +74 -0
- package/plugin/node_modules/get-east-asian-width/index.d.ts +60 -0
- package/plugin/node_modules/get-east-asian-width/index.js +30 -0
- package/plugin/node_modules/get-east-asian-width/license +9 -0
- package/plugin/node_modules/get-east-asian-width/lookup-data.js +21 -0
- package/plugin/node_modules/get-east-asian-width/lookup.js +138 -0
- package/plugin/node_modules/get-east-asian-width/package.json +71 -0
- package/plugin/node_modules/get-east-asian-width/readme.md +65 -0
- package/plugin/node_modules/get-east-asian-width/utilities.js +24 -0
- package/plugin/node_modules/glob-parent/CHANGELOG.md +110 -0
- package/plugin/node_modules/glob-parent/LICENSE +15 -0
- package/plugin/node_modules/glob-parent/README.md +137 -0
- package/plugin/node_modules/glob-parent/index.js +42 -0
- package/plugin/node_modules/glob-parent/package.json +48 -0
- package/plugin/node_modules/globby/ignore.js +868 -0
- package/plugin/node_modules/globby/index.d.ts +413 -0
- package/plugin/node_modules/globby/index.js +680 -0
- package/plugin/node_modules/globby/license +9 -0
- package/plugin/node_modules/globby/package.json +94 -0
- package/plugin/node_modules/globby/readme.md +401 -0
- package/plugin/node_modules/globby/utilities.js +382 -0
- package/plugin/node_modules/ignore/LICENSE-MIT +21 -0
- package/plugin/node_modules/ignore/README.md +452 -0
- package/plugin/node_modules/ignore/index.d.ts +81 -0
- package/plugin/node_modules/ignore/index.js +784 -0
- package/plugin/node_modules/ignore/legacy.js +681 -0
- package/plugin/node_modules/ignore/package.json +87 -0
- package/plugin/node_modules/is-alphabetical/index.d.ts +8 -0
- package/plugin/node_modules/is-alphabetical/index.js +16 -0
- package/plugin/node_modules/is-alphabetical/license +22 -0
- package/plugin/node_modules/is-alphabetical/package.json +73 -0
- package/plugin/node_modules/is-alphabetical/readme.md +141 -0
- package/plugin/node_modules/is-alphanumerical/index.d.ts +8 -0
- package/plugin/node_modules/is-alphanumerical/index.js +13 -0
- package/plugin/node_modules/is-alphanumerical/license +22 -0
- package/plugin/node_modules/is-alphanumerical/package.json +79 -0
- package/plugin/node_modules/is-alphanumerical/readme.md +142 -0
- package/plugin/node_modules/is-decimal/index.d.ts +8 -0
- package/plugin/node_modules/is-decimal/index.js +13 -0
- package/plugin/node_modules/is-decimal/license +22 -0
- package/plugin/node_modules/is-decimal/package.json +73 -0
- package/plugin/node_modules/is-decimal/readme.md +139 -0
- package/plugin/node_modules/is-extglob/LICENSE +21 -0
- package/plugin/node_modules/is-extglob/README.md +107 -0
- package/plugin/node_modules/is-extglob/index.js +20 -0
- package/plugin/node_modules/is-extglob/package.json +69 -0
- package/plugin/node_modules/is-glob/LICENSE +21 -0
- package/plugin/node_modules/is-glob/README.md +206 -0
- package/plugin/node_modules/is-glob/index.js +150 -0
- package/plugin/node_modules/is-glob/package.json +81 -0
- package/plugin/node_modules/is-hexadecimal/index.d.ts +8 -0
- package/plugin/node_modules/is-hexadecimal/index.js +17 -0
- package/plugin/node_modules/is-hexadecimal/license +22 -0
- package/plugin/node_modules/is-hexadecimal/package.json +73 -0
- package/plugin/node_modules/is-hexadecimal/readme.md +141 -0
- package/plugin/node_modules/is-number/LICENSE +21 -0
- package/plugin/node_modules/is-number/README.md +187 -0
- package/plugin/node_modules/is-number/index.js +18 -0
- package/plugin/node_modules/is-number/package.json +82 -0
- package/plugin/node_modules/is-path-inside/index.d.ts +25 -0
- package/plugin/node_modules/is-path-inside/index.js +12 -0
- package/plugin/node_modules/is-path-inside/license +9 -0
- package/plugin/node_modules/is-path-inside/package.json +38 -0
- package/plugin/node_modules/is-path-inside/readme.md +59 -0
- package/plugin/node_modules/js-yaml/LICENSE +21 -0
- package/plugin/node_modules/js-yaml/README.md +247 -0
- package/plugin/node_modules/js-yaml/bin/js-yaml.js +126 -0
- package/plugin/node_modules/js-yaml/dist/js-yaml.js +3880 -0
- package/plugin/node_modules/js-yaml/dist/js-yaml.min.js +2 -0
- package/plugin/node_modules/js-yaml/dist/js-yaml.mjs +3856 -0
- package/plugin/node_modules/js-yaml/index.js +47 -0
- package/plugin/node_modules/js-yaml/lib/common.js +59 -0
- package/plugin/node_modules/js-yaml/lib/dumper.js +965 -0
- package/plugin/node_modules/js-yaml/lib/exception.js +55 -0
- package/plugin/node_modules/js-yaml/lib/loader.js +1733 -0
- package/plugin/node_modules/js-yaml/lib/schema/core.js +11 -0
- package/plugin/node_modules/js-yaml/lib/schema/default.js +22 -0
- package/plugin/node_modules/js-yaml/lib/schema/failsafe.js +17 -0
- package/plugin/node_modules/js-yaml/lib/schema/json.js +19 -0
- package/plugin/node_modules/js-yaml/lib/schema.js +121 -0
- package/plugin/node_modules/js-yaml/lib/snippet.js +101 -0
- package/plugin/node_modules/js-yaml/lib/type/binary.js +125 -0
- package/plugin/node_modules/js-yaml/lib/type/bool.js +35 -0
- package/plugin/node_modules/js-yaml/lib/type/float.js +97 -0
- package/plugin/node_modules/js-yaml/lib/type/int.js +156 -0
- package/plugin/node_modules/js-yaml/lib/type/map.js +8 -0
- package/plugin/node_modules/js-yaml/lib/type/merge.js +12 -0
- package/plugin/node_modules/js-yaml/lib/type/null.js +35 -0
- package/plugin/node_modules/js-yaml/lib/type/omap.js +44 -0
- package/plugin/node_modules/js-yaml/lib/type/pairs.js +53 -0
- package/plugin/node_modules/js-yaml/lib/type/seq.js +8 -0
- package/plugin/node_modules/js-yaml/lib/type/set.js +29 -0
- package/plugin/node_modules/js-yaml/lib/type/str.js +8 -0
- package/plugin/node_modules/js-yaml/lib/type/timestamp.js +88 -0
- package/plugin/node_modules/js-yaml/lib/type.js +66 -0
- package/plugin/node_modules/js-yaml/package.json +66 -0
- package/plugin/node_modules/jsonc-parser/CHANGELOG.md +76 -0
- package/plugin/node_modules/jsonc-parser/LICENSE.md +21 -0
- package/plugin/node_modules/jsonc-parser/README.md +364 -0
- package/plugin/node_modules/jsonc-parser/SECURITY.md +41 -0
- package/plugin/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
- package/plugin/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
- package/plugin/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
- package/plugin/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
- package/plugin/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
- package/plugin/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
- package/plugin/node_modules/jsonc-parser/lib/esm/main.js +178 -0
- package/plugin/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
- package/plugin/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
- package/plugin/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
- package/plugin/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
- package/plugin/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
- package/plugin/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
- package/plugin/node_modules/jsonc-parser/lib/umd/main.js +194 -0
- package/plugin/node_modules/jsonc-parser/package.json +37 -0
- package/plugin/node_modules/jsonpointer/LICENSE.md +21 -0
- package/plugin/node_modules/jsonpointer/README.md +45 -0
- package/plugin/node_modules/jsonpointer/jsonpointer.d.ts +35 -0
- package/plugin/node_modules/jsonpointer/jsonpointer.js +100 -0
- package/plugin/node_modules/jsonpointer/package.json +48 -0
- package/plugin/node_modules/katex/LICENSE +21 -0
- package/plugin/node_modules/katex/README.md +125 -0
- package/plugin/node_modules/katex/cli.js +114 -0
- package/plugin/node_modules/katex/contrib/auto-render/README.md +8 -0
- package/plugin/node_modules/katex/contrib/auto-render/auto-render.ts +164 -0
- package/plugin/node_modules/katex/contrib/auto-render/index.html +57 -0
- package/plugin/node_modules/katex/contrib/auto-render/splitAtDelimiters.ts +99 -0
- package/plugin/node_modules/katex/contrib/auto-render/test/auto-render-spec.ts +371 -0
- package/plugin/node_modules/katex/contrib/copy-tex/README.md +39 -0
- package/plugin/node_modules/katex/contrib/copy-tex/copy-tex.ts +49 -0
- package/plugin/node_modules/katex/contrib/copy-tex/index.html +38 -0
- package/plugin/node_modules/katex/contrib/copy-tex/katex2tex.ts +60 -0
- package/plugin/node_modules/katex/contrib/mathtex-script-type/README.md +38 -0
- package/plugin/node_modules/katex/contrib/mathtex-script-type/mathtex-script-type.js +23 -0
- package/plugin/node_modules/katex/contrib/mhchem/README.md +23 -0
- package/plugin/node_modules/katex/contrib/mhchem/mhchem.js +1695 -0
- package/plugin/node_modules/katex/contrib/render-a11y-string/render-a11y-string.ts +729 -0
- package/plugin/node_modules/katex/contrib/render-a11y-string/test/render-a11y-string-spec.ts +561 -0
- package/plugin/node_modules/katex/dist/README.md +125 -0
- package/plugin/node_modules/katex/dist/contrib/auto-render.js +305 -0
- package/plugin/node_modules/katex/dist/contrib/auto-render.min.js +1 -0
- package/plugin/node_modules/katex/dist/contrib/auto-render.mjs +210 -0
- package/plugin/node_modules/katex/dist/contrib/copy-tex.js +113 -0
- package/plugin/node_modules/katex/dist/contrib/copy-tex.min.js +1 -0
- package/plugin/node_modules/katex/dist/contrib/copy-tex.mjs +85 -0
- package/plugin/node_modules/katex/dist/contrib/mathtex-script-type.js +107 -0
- package/plugin/node_modules/katex/dist/contrib/mathtex-script-type.min.js +1 -0
- package/plugin/node_modules/katex/dist/contrib/mathtex-script-type.mjs +22 -0
- package/plugin/node_modules/katex/dist/contrib/mhchem.js +2965 -0
- package/plugin/node_modules/katex/dist/contrib/mhchem.min.js +1 -0
- package/plugin/node_modules/katex/dist/contrib/mhchem.mjs +2864 -0
- package/plugin/node_modules/katex/dist/contrib/render-a11y-string.js +827 -0
- package/plugin/node_modules/katex/dist/contrib/render-a11y-string.min.js +1 -0
- package/plugin/node_modules/katex/dist/contrib/render-a11y-string.mjs +723 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Main-Bold.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Main-Italic.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Main-Regular.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Math-Italic.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Script-Regular.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/plugin/node_modules/katex/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/plugin/node_modules/katex/dist/katex-swap.css +1241 -0
- package/plugin/node_modules/katex/dist/katex-swap.min.css +1 -0
- package/plugin/node_modules/katex/dist/katex.css +1241 -0
- package/plugin/node_modules/katex/dist/katex.js +18010 -0
- package/plugin/node_modules/katex/dist/katex.min.css +1 -0
- package/plugin/node_modules/katex/dist/katex.min.js +1 -0
- package/plugin/node_modules/katex/dist/katex.mjs +16670 -0
- package/plugin/node_modules/katex/katex.ts +250 -0
- package/plugin/node_modules/katex/package.json +198 -0
- package/plugin/node_modules/katex/src/Lexer.ts +121 -0
- package/plugin/node_modules/katex/src/MacroExpander.ts +467 -0
- package/plugin/node_modules/katex/src/Namespace.ts +127 -0
- package/plugin/node_modules/katex/src/Options.ts +315 -0
- package/plugin/node_modules/katex/src/ParseError.ts +76 -0
- package/plugin/node_modules/katex/src/Parser.ts +1053 -0
- package/plugin/node_modules/katex/src/Settings.ts +477 -0
- package/plugin/node_modules/katex/src/SourceLocation.ts +41 -0
- package/plugin/node_modules/katex/src/Style.ts +129 -0
- package/plugin/node_modules/katex/src/Token.ts +49 -0
- package/plugin/node_modules/katex/src/atoms.ts +33 -0
- package/plugin/node_modules/katex/src/buildCommon.ts +783 -0
- package/plugin/node_modules/katex/src/buildHTML.ts +412 -0
- package/plugin/node_modules/katex/src/buildMathML.ts +332 -0
- package/plugin/node_modules/katex/src/buildTree.ts +66 -0
- package/plugin/node_modules/katex/src/defineEnvironment.ts +116 -0
- package/plugin/node_modules/katex/src/defineFunction.ts +228 -0
- package/plugin/node_modules/katex/src/defineMacro.ts +124 -0
- package/plugin/node_modules/katex/src/delimiter.ts +832 -0
- package/plugin/node_modules/katex/src/domTree.ts +641 -0
- package/plugin/node_modules/katex/src/environments/array.ts +1136 -0
- package/plugin/node_modules/katex/src/environments/cd.ts +318 -0
- package/plugin/node_modules/katex/src/environments.ts +8 -0
- package/plugin/node_modules/katex/src/fontMetrics.ts +267 -0
- package/plugin/node_modules/katex/src/fontMetricsData.d.ts +8 -0
- package/plugin/node_modules/katex/src/fontMetricsData.js +2077 -0
- package/plugin/node_modules/katex/src/fonts/Makefile +139 -0
- package/plugin/node_modules/katex/src/fonts/default.cfg +20 -0
- package/plugin/node_modules/katex/src/fonts/generate_fonts.py +58 -0
- package/plugin/node_modules/katex/src/fonts/lib/Extra.otf +0 -0
- package/plugin/node_modules/katex/src/fonts/lib/Space.ttx +234 -0
- package/plugin/node_modules/katex/src/fonts/makeBlacker +49 -0
- package/plugin/node_modules/katex/src/fonts/makeFF +2005 -0
- package/plugin/node_modules/katex/src/fonts/xbbold.mf +182 -0
- package/plugin/node_modules/katex/src/functions/accent.ts +285 -0
- package/plugin/node_modules/katex/src/functions/accentunder.ts +59 -0
- package/plugin/node_modules/katex/src/functions/arrow.ts +141 -0
- package/plugin/node_modules/katex/src/functions/char.ts +44 -0
- package/plugin/node_modules/katex/src/functions/color.ts +87 -0
- package/plugin/node_modules/katex/src/functions/cr.ts +60 -0
- package/plugin/node_modules/katex/src/functions/def.ts +212 -0
- package/plugin/node_modules/katex/src/functions/delimsizing.ts +366 -0
- package/plugin/node_modules/katex/src/functions/enclose.ts +345 -0
- package/plugin/node_modules/katex/src/functions/environment.ts +66 -0
- package/plugin/node_modules/katex/src/functions/font.ts +124 -0
- package/plugin/node_modules/katex/src/functions/genfrac.ts +470 -0
- package/plugin/node_modules/katex/src/functions/hbox.ts +38 -0
- package/plugin/node_modules/katex/src/functions/horizBrace.ts +134 -0
- package/plugin/node_modules/katex/src/functions/href.ts +93 -0
- package/plugin/node_modules/katex/src/functions/html.ts +105 -0
- package/plugin/node_modules/katex/src/functions/htmlmathml.ts +34 -0
- package/plugin/node_modules/katex/src/functions/includegraphics.ts +150 -0
- package/plugin/node_modules/katex/src/functions/kern.ts +55 -0
- package/plugin/node_modules/katex/src/functions/lap.ts +73 -0
- package/plugin/node_modules/katex/src/functions/math.ts +42 -0
- package/plugin/node_modules/katex/src/functions/mathchoice.ts +51 -0
- package/plugin/node_modules/katex/src/functions/mclass.ts +165 -0
- package/plugin/node_modules/katex/src/functions/op.ts +337 -0
- package/plugin/node_modules/katex/src/functions/operatorname.ts +161 -0
- package/plugin/node_modules/katex/src/functions/ordgroup.ts +20 -0
- package/plugin/node_modules/katex/src/functions/overline.ts +58 -0
- package/plugin/node_modules/katex/src/functions/phantom.ts +73 -0
- package/plugin/node_modules/katex/src/functions/pmb.ts +43 -0
- package/plugin/node_modules/katex/src/functions/raisebox.ts +45 -0
- package/plugin/node_modules/katex/src/functions/relax.ts +17 -0
- package/plugin/node_modules/katex/src/functions/rule.ts +76 -0
- package/plugin/node_modules/katex/src/functions/sizing.ts +90 -0
- package/plugin/node_modules/katex/src/functions/smash.ts +115 -0
- package/plugin/node_modules/katex/src/functions/sqrt.ts +124 -0
- package/plugin/node_modules/katex/src/functions/styling.ts +85 -0
- package/plugin/node_modules/katex/src/functions/supsub.ts +268 -0
- package/plugin/node_modules/katex/src/functions/symbolsOp.ts +32 -0
- package/plugin/node_modules/katex/src/functions/symbolsOrd.ts +61 -0
- package/plugin/node_modules/katex/src/functions/symbolsSpacing.ts +72 -0
- package/plugin/node_modules/katex/src/functions/tag.ts +38 -0
- package/plugin/node_modules/katex/src/functions/text.ts +81 -0
- package/plugin/node_modules/katex/src/functions/underline.ts +57 -0
- package/plugin/node_modules/katex/src/functions/utils/assembleSupSub.ts +119 -0
- package/plugin/node_modules/katex/src/functions/vcenter.ts +44 -0
- package/plugin/node_modules/katex/src/functions/verb.ts +57 -0
- package/plugin/node_modules/katex/src/functions.ts +54 -0
- package/plugin/node_modules/katex/src/macros.ts +1032 -0
- package/plugin/node_modules/katex/src/mathMLTree.ts +259 -0
- package/plugin/node_modules/katex/src/metrics/README.md +23 -0
- package/plugin/node_modules/katex/src/metrics/extract_tfms.py +114 -0
- package/plugin/node_modules/katex/src/metrics/extract_ttfs.py +122 -0
- package/plugin/node_modules/katex/src/metrics/format_json.py +28 -0
- package/plugin/node_modules/katex/src/metrics/mapping.pl +1224 -0
- package/plugin/node_modules/katex/src/metrics/parse_tfm.py +211 -0
- package/plugin/node_modules/katex/src/parseNode.ts +518 -0
- package/plugin/node_modules/katex/src/parseTree.ts +51 -0
- package/plugin/node_modules/katex/src/spacingData.ts +107 -0
- package/plugin/node_modules/katex/src/stretchy.ts +358 -0
- package/plugin/node_modules/katex/src/styles/fonts.scss +75 -0
- package/plugin/node_modules/katex/src/styles/katex-swap.scss +4 -0
- package/plugin/node_modules/katex/src/styles/katex.scss +683 -0
- package/plugin/node_modules/katex/src/svgGeometry.ts +561 -0
- package/plugin/node_modules/katex/src/symbols.ts +879 -0
- package/plugin/node_modules/katex/src/tree.ts +79 -0
- package/plugin/node_modules/katex/src/types/fonts.ts +73 -0
- package/plugin/node_modules/katex/src/types/index.ts +29 -0
- package/plugin/node_modules/katex/src/unicodeAccents.js +21 -0
- package/plugin/node_modules/katex/src/unicodeScripts.ts +124 -0
- package/plugin/node_modules/katex/src/unicodeSupOrSub.ts +108 -0
- package/plugin/node_modules/katex/src/unicodeSymbols.js +33 -0
- package/plugin/node_modules/katex/src/units.ts +104 -0
- package/plugin/node_modules/katex/src/utils.ts +89 -0
- package/plugin/node_modules/katex/src/wide-character.ts +155 -0
- package/plugin/node_modules/katex/types/katex.d.ts +259 -0
- package/plugin/node_modules/linkify-it/LICENSE +22 -0
- package/plugin/node_modules/linkify-it/README.md +196 -0
- package/plugin/node_modules/linkify-it/build/index.cjs.js +832 -0
- package/plugin/node_modules/linkify-it/index.mjs +642 -0
- package/plugin/node_modules/linkify-it/lib/re.mjs +189 -0
- package/plugin/node_modules/linkify-it/package.json +58 -0
- package/plugin/node_modules/markdown-it/LICENSE +22 -0
- package/plugin/node_modules/markdown-it/README.md +324 -0
- package/plugin/node_modules/markdown-it/bin/markdown-it.mjs +107 -0
- package/plugin/node_modules/markdown-it/dist/index.cjs.js +5547 -0
- package/plugin/node_modules/markdown-it/dist/markdown-it.js +6969 -0
- package/plugin/node_modules/markdown-it/dist/markdown-it.min.js +2 -0
- package/plugin/node_modules/markdown-it/index.mjs +1 -0
- package/plugin/node_modules/markdown-it/lib/common/html_blocks.mjs +67 -0
- package/plugin/node_modules/markdown-it/lib/common/html_re.mjs +25 -0
- package/plugin/node_modules/markdown-it/lib/common/utils.mjs +304 -0
- package/plugin/node_modules/markdown-it/lib/helpers/index.mjs +11 -0
- package/plugin/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs +77 -0
- package/plugin/node_modules/markdown-it/lib/helpers/parse_link_label.mjs +49 -0
- package/plugin/node_modules/markdown-it/lib/helpers/parse_link_title.mjs +66 -0
- package/plugin/node_modules/markdown-it/lib/index.mjs +565 -0
- package/plugin/node_modules/markdown-it/lib/parser_block.mjs +134 -0
- package/plugin/node_modules/markdown-it/lib/parser_core.mjs +62 -0
- package/plugin/node_modules/markdown-it/lib/parser_inline.mjs +197 -0
- package/plugin/node_modules/markdown-it/lib/presets/commonmark.mjs +88 -0
- package/plugin/node_modules/markdown-it/lib/presets/default.mjs +47 -0
- package/plugin/node_modules/markdown-it/lib/presets/zero.mjs +70 -0
- package/plugin/node_modules/markdown-it/lib/renderer.mjs +322 -0
- package/plugin/node_modules/markdown-it/lib/ruler.mjs +340 -0
- package/plugin/node_modules/markdown-it/lib/rules_block/blockquote.mjs +209 -0
- package/plugin/node_modules/markdown-it/lib/rules_block/code.mjs +30 -0
- package/plugin/node_modules/markdown-it/lib/rules_block/fence.mjs +94 -0
- package/plugin/node_modules/markdown-it/lib/rules_block/heading.mjs +51 -0
- package/plugin/node_modules/markdown-it/lib/rules_block/hr.mjs +40 -0
- package/plugin/node_modules/markdown-it/lib/rules_block/html_block.mjs +69 -0
- package/plugin/node_modules/markdown-it/lib/rules_block/lheading.mjs +82 -0
- package/plugin/node_modules/markdown-it/lib/rules_block/list.mjs +331 -0
- package/plugin/node_modules/markdown-it/lib/rules_block/paragraph.mjs +46 -0
- package/plugin/node_modules/markdown-it/lib/rules_block/reference.mjs +212 -0
- package/plugin/node_modules/markdown-it/lib/rules_block/state_block.mjs +220 -0
- package/plugin/node_modules/markdown-it/lib/rules_block/table.mjs +228 -0
- package/plugin/node_modules/markdown-it/lib/rules_core/block.mjs +13 -0
- package/plugin/node_modules/markdown-it/lib/rules_core/inline.mjs +11 -0
- package/plugin/node_modules/markdown-it/lib/rules_core/linkify.mjs +134 -0
- package/plugin/node_modules/markdown-it/lib/rules_core/normalize.mjs +17 -0
- package/plugin/node_modules/markdown-it/lib/rules_core/replacements.mjs +101 -0
- package/plugin/node_modules/markdown-it/lib/rules_core/smartquotes.mjs +193 -0
- package/plugin/node_modules/markdown-it/lib/rules_core/state_core.mjs +17 -0
- package/plugin/node_modules/markdown-it/lib/rules_core/text_join.mjs +43 -0
- package/plugin/node_modules/markdown-it/lib/rules_inline/autolink.mjs +72 -0
- package/plugin/node_modules/markdown-it/lib/rules_inline/backticks.mjs +60 -0
- package/plugin/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs +124 -0
- package/plugin/node_modules/markdown-it/lib/rules_inline/emphasis.mjs +123 -0
- package/plugin/node_modules/markdown-it/lib/rules_inline/entity.mjs +51 -0
- package/plugin/node_modules/markdown-it/lib/rules_inline/escape.mjs +69 -0
- package/plugin/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs +38 -0
- package/plugin/node_modules/markdown-it/lib/rules_inline/html_inline.mjs +50 -0
- package/plugin/node_modules/markdown-it/lib/rules_inline/image.mjs +138 -0
- package/plugin/node_modules/markdown-it/lib/rules_inline/link.mjs +139 -0
- package/plugin/node_modules/markdown-it/lib/rules_inline/linkify.mjs +63 -0
- package/plugin/node_modules/markdown-it/lib/rules_inline/newline.mjs +42 -0
- package/plugin/node_modules/markdown-it/lib/rules_inline/state_inline.mjs +123 -0
- package/plugin/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs +127 -0
- package/plugin/node_modules/markdown-it/lib/rules_inline/text.mjs +86 -0
- package/plugin/node_modules/markdown-it/lib/token.mjs +191 -0
- package/plugin/node_modules/markdown-it/package.json +92 -0
- package/plugin/node_modules/markdownlint/CHANGELOG.md +520 -0
- package/plugin/node_modules/markdownlint/CONTRIBUTING.md +92 -0
- package/plugin/node_modules/markdownlint/LICENSE +21 -0
- package/plugin/node_modules/markdownlint/README.md +1124 -0
- package/plugin/node_modules/markdownlint/doc/CustomRules.md +194 -0
- package/plugin/node_modules/markdownlint/doc/Prettier.md +27 -0
- package/plugin/node_modules/markdownlint/doc/ReleaseProcess.md +20 -0
- package/plugin/node_modules/markdownlint/doc/Rules.md +2814 -0
- package/plugin/node_modules/markdownlint/doc/md001.md +51 -0
- package/plugin/node_modules/markdownlint/doc/md003.md +59 -0
- package/plugin/node_modules/markdownlint/doc/md004.md +50 -0
- package/plugin/node_modules/markdownlint/doc/md005.md +53 -0
- package/plugin/node_modules/markdownlint/doc/md007.md +52 -0
- package/plugin/node_modules/markdownlint/doc/md009.md +50 -0
- package/plugin/node_modules/markdownlint/doc/md010.md +62 -0
- package/plugin/node_modules/markdownlint/doc/md011.md +30 -0
- package/plugin/node_modules/markdownlint/doc/md012.md +38 -0
- package/plugin/node_modules/markdownlint/doc/md013.md +58 -0
- package/plugin/node_modules/markdownlint/doc/md014.md +54 -0
- package/plugin/node_modules/markdownlint/doc/md018.md +27 -0
- package/plugin/node_modules/markdownlint/doc/md019.md +28 -0
- package/plugin/node_modules/markdownlint/doc/md020.md +29 -0
- package/plugin/node_modules/markdownlint/doc/md021.md +31 -0
- package/plugin/node_modules/markdownlint/doc/md022.md +52 -0
- package/plugin/node_modules/markdownlint/doc/md023.md +33 -0
- package/plugin/node_modules/markdownlint/doc/md024.md +44 -0
- package/plugin/node_modules/markdownlint/doc/md025.md +49 -0
- package/plugin/node_modules/markdownlint/doc/md026.md +40 -0
- package/plugin/node_modules/markdownlint/doc/md027.md +32 -0
- package/plugin/node_modules/markdownlint/doc/md028.md +40 -0
- package/plugin/node_modules/markdownlint/doc/md029.md +100 -0
- package/plugin/node_modules/markdownlint/doc/md030.md +82 -0
- package/plugin/node_modules/markdownlint/doc/md031.md +50 -0
- package/plugin/node_modules/markdownlint/doc/md032.md +55 -0
- package/plugin/node_modules/markdownlint/doc/md033.md +33 -0
- package/plugin/node_modules/markdownlint/doc/md034.md +55 -0
- package/plugin/node_modules/markdownlint/doc/md035.md +37 -0
- package/plugin/node_modules/markdownlint/doc/md036.md +45 -0
- package/plugin/node_modules/markdownlint/doc/md037.md +37 -0
- package/plugin/node_modules/markdownlint/doc/md038.md +52 -0
- package/plugin/node_modules/markdownlint/doc/md039.md +21 -0
- package/plugin/node_modules/markdownlint/doc/md040.md +52 -0
- package/plugin/node_modules/markdownlint/doc/md041.md +64 -0
- package/plugin/node_modules/markdownlint/doc/md042.md +32 -0
- package/plugin/node_modules/markdownlint/doc/md043.md +87 -0
- package/plugin/node_modules/markdownlint/doc/md044.md +45 -0
- package/plugin/node_modules/markdownlint/doc/md045.md +48 -0
- package/plugin/node_modules/markdownlint/doc/md046.md +40 -0
- package/plugin/node_modules/markdownlint/doc/md047.md +34 -0
- package/plugin/node_modules/markdownlint/doc/md048.md +42 -0
- package/plugin/node_modules/markdownlint/doc/md049.md +36 -0
- package/plugin/node_modules/markdownlint/doc/md050.md +35 -0
- package/plugin/node_modules/markdownlint/doc/md051.md +117 -0
- package/plugin/node_modules/markdownlint/doc/md052.md +52 -0
- package/plugin/node_modules/markdownlint/doc/md053.md +38 -0
- package/plugin/node_modules/markdownlint/doc/md054.md +100 -0
- package/plugin/node_modules/markdownlint/doc/md055.md +55 -0
- package/plugin/node_modules/markdownlint/doc/md056.md +37 -0
- package/plugin/node_modules/markdownlint/doc/md058.md +48 -0
- package/plugin/node_modules/markdownlint/doc/md059.md +33 -0
- package/plugin/node_modules/markdownlint/doc/md060.md +118 -0
- package/plugin/node_modules/markdownlint/helpers/LICENSE +21 -0
- package/plugin/node_modules/markdownlint/helpers/README.md +29 -0
- package/plugin/node_modules/markdownlint/helpers/helpers.cjs +696 -0
- package/plugin/node_modules/markdownlint/helpers/micromark-helpers.cjs +331 -0
- package/plugin/node_modules/markdownlint/helpers/package.json +26 -0
- package/plugin/node_modules/markdownlint/helpers/shared.cjs +16 -0
- package/plugin/node_modules/markdownlint/lib/cache.mjs +80 -0
- package/plugin/node_modules/markdownlint/lib/configuration-strict.d.ts +2409 -0
- package/plugin/node_modules/markdownlint/lib/configuration.d.ts +8 -0
- package/plugin/node_modules/markdownlint/lib/constants.mjs +14 -0
- package/plugin/node_modules/markdownlint/lib/defer-require.cjs +18 -0
- package/plugin/node_modules/markdownlint/lib/exports-async.d.mts +1 -0
- package/plugin/node_modules/markdownlint/lib/exports-async.mjs +3 -0
- package/plugin/node_modules/markdownlint/lib/exports-promise.d.mts +1 -0
- package/plugin/node_modules/markdownlint/lib/exports-promise.mjs +3 -0
- package/plugin/node_modules/markdownlint/lib/exports-sync.d.mts +1 -0
- package/plugin/node_modules/markdownlint/lib/exports-sync.mjs +3 -0
- package/plugin/node_modules/markdownlint/lib/exports.d.mts +29 -0
- package/plugin/node_modules/markdownlint/lib/exports.mjs +32 -0
- package/plugin/node_modules/markdownlint/lib/markdownit.cjs +170 -0
- package/plugin/node_modules/markdownlint/lib/markdownlint.d.mts +600 -0
- package/plugin/node_modules/markdownlint/lib/markdownlint.mjs +1660 -0
- package/plugin/node_modules/markdownlint/lib/md001.mjs +32 -0
- package/plugin/node_modules/markdownlint/lib/md003.mjs +47 -0
- package/plugin/node_modules/markdownlint/lib/md004.mjs +72 -0
- package/plugin/node_modules/markdownlint/lib/md005.mjs +69 -0
- package/plugin/node_modules/markdownlint/lib/md007.mjs +84 -0
- package/plugin/node_modules/markdownlint/lib/md009.mjs +96 -0
- package/plugin/node_modules/markdownlint/lib/md010.mjs +78 -0
- package/plugin/node_modules/markdownlint/lib/md011.mjs +56 -0
- package/plugin/node_modules/markdownlint/lib/md012.mjs +40 -0
- package/plugin/node_modules/markdownlint/lib/md013.mjs +91 -0
- package/plugin/node_modules/markdownlint/lib/md014.mjs +47 -0
- package/plugin/node_modules/markdownlint/lib/md018.mjs +43 -0
- package/plugin/node_modules/markdownlint/lib/md019-md021.mjs +77 -0
- package/plugin/node_modules/markdownlint/lib/md020.mjs +68 -0
- package/plugin/node_modules/markdownlint/lib/md022.mjs +100 -0
- package/plugin/node_modules/markdownlint/lib/md023.mjs +37 -0
- package/plugin/node_modules/markdownlint/lib/md024.mjs +45 -0
- package/plugin/node_modules/markdownlint/lib/md025.mjs +45 -0
- package/plugin/node_modules/markdownlint/lib/md026.mjs +46 -0
- package/plugin/node_modules/markdownlint/lib/md027.mjs +50 -0
- package/plugin/node_modules/markdownlint/lib/md028.mjs +39 -0
- package/plugin/node_modules/markdownlint/lib/md029.mjs +84 -0
- package/plugin/node_modules/markdownlint/lib/md030.mjs +57 -0
- package/plugin/node_modules/markdownlint/lib/md031.mjs +61 -0
- package/plugin/node_modules/markdownlint/lib/md032.mjs +78 -0
- package/plugin/node_modules/markdownlint/lib/md033.mjs +46 -0
- package/plugin/node_modules/markdownlint/lib/md034.mjs +92 -0
- package/plugin/node_modules/markdownlint/lib/md035.mjs +23 -0
- package/plugin/node_modules/markdownlint/lib/md036.mjs +54 -0
- package/plugin/node_modules/markdownlint/lib/md037.mjs +94 -0
- package/plugin/node_modules/markdownlint/lib/md038.mjs +73 -0
- package/plugin/node_modules/markdownlint/lib/md039.mjs +59 -0
- package/plugin/node_modules/markdownlint/lib/md040.mjs +32 -0
- package/plugin/node_modules/markdownlint/lib/md041.mjs +71 -0
- package/plugin/node_modules/markdownlint/lib/md042.mjs +58 -0
- package/plugin/node_modules/markdownlint/lib/md043.mjs +72 -0
- package/plugin/node_modules/markdownlint/lib/md044.mjs +110 -0
- package/plugin/node_modules/markdownlint/lib/md045.mjs +61 -0
- package/plugin/node_modules/markdownlint/lib/md046.mjs +31 -0
- package/plugin/node_modules/markdownlint/lib/md047.mjs +28 -0
- package/plugin/node_modules/markdownlint/lib/md048.mjs +47 -0
- package/plugin/node_modules/markdownlint/lib/md049-md050.mjs +115 -0
- package/plugin/node_modules/markdownlint/lib/md051.mjs +172 -0
- package/plugin/node_modules/markdownlint/lib/md052.mjs +40 -0
- package/plugin/node_modules/markdownlint/lib/md053.mjs +60 -0
- package/plugin/node_modules/markdownlint/lib/md054.mjs +122 -0
- package/plugin/node_modules/markdownlint/lib/md055.mjs +72 -0
- package/plugin/node_modules/markdownlint/lib/md056.mjs +50 -0
- package/plugin/node_modules/markdownlint/lib/md058.mjs +57 -0
- package/plugin/node_modules/markdownlint/lib/md059.mjs +71 -0
- package/plugin/node_modules/markdownlint/lib/md060.mjs +170 -0
- package/plugin/node_modules/markdownlint/lib/micromark-parse.mjs +322 -0
- package/plugin/node_modules/markdownlint/lib/micromark-types.d.mts +11 -0
- package/plugin/node_modules/markdownlint/lib/node-imports-browser.mjs +22 -0
- package/plugin/node_modules/markdownlint/lib/node-imports-node.mjs +11 -0
- package/plugin/node_modules/markdownlint/lib/parse-configuration.mjs +47 -0
- package/plugin/node_modules/markdownlint/lib/resolve-module.cjs +52 -0
- package/plugin/node_modules/markdownlint/lib/resolve-module.d.cts +34 -0
- package/plugin/node_modules/markdownlint/lib/rules.mjs +122 -0
- package/plugin/node_modules/markdownlint/lib/types.d.mts +13 -0
- package/plugin/node_modules/markdownlint/package.json +123 -0
- package/plugin/node_modules/markdownlint/schema/.markdownlint.jsonc +347 -0
- package/plugin/node_modules/markdownlint/schema/.markdownlint.yaml +308 -0
- package/plugin/node_modules/markdownlint/schema/ValidatingConfiguration.md +26 -0
- package/plugin/node_modules/markdownlint/schema/markdownlint-config-schema-strict.json +5128 -0
- package/plugin/node_modules/markdownlint/schema/markdownlint-config-schema.json +5133 -0
- package/plugin/node_modules/markdownlint/style/all.json +5 -0
- package/plugin/node_modules/markdownlint/style/cirosantilli.json +22 -0
- package/plugin/node_modules/markdownlint/style/prettier.json +27 -0
- package/plugin/node_modules/markdownlint/style/relaxed.json +12 -0
- package/plugin/node_modules/markdownlint-cli2/CHANGELOG.md +258 -0
- package/plugin/node_modules/markdownlint-cli2/LICENSE +21 -0
- package/plugin/node_modules/markdownlint-cli2/README.md +578 -0
- package/plugin/node_modules/markdownlint-cli2/append-to-array.mjs +24 -0
- package/plugin/node_modules/markdownlint-cli2/constants.mjs +30 -0
- package/plugin/node_modules/markdownlint-cli2/export-markdownlint-helpers.mjs +3 -0
- package/plugin/node_modules/markdownlint-cli2/export-markdownlint-promise.mjs +3 -0
- package/plugin/node_modules/markdownlint-cli2/export-markdownlint.mjs +3 -0
- package/plugin/node_modules/markdownlint-cli2/markdownlint-cli2-bin.mjs +18 -0
- package/plugin/node_modules/markdownlint-cli2/markdownlint-cli2.mjs +1165 -0
- package/plugin/node_modules/markdownlint-cli2/merge-options.mjs +27 -0
- package/plugin/node_modules/markdownlint-cli2/package.json +124 -0
- package/plugin/node_modules/markdownlint-cli2/parsers/jsonc-parse.mjs +22 -0
- package/plugin/node_modules/markdownlint-cli2/parsers/parsers.mjs +17 -0
- package/plugin/node_modules/markdownlint-cli2/parsers/toml-parse.mjs +11 -0
- package/plugin/node_modules/markdownlint-cli2/parsers/yaml-parse.mjs +16 -0
- package/plugin/node_modules/markdownlint-cli2/schema/ValidatingConfiguration.md +24 -0
- package/plugin/node_modules/markdownlint-cli2/schema/markdownlint-cli2-config-schema.json +138 -0
- package/plugin/node_modules/markdownlint-cli2/schema/markdownlint-config-schema.json +5133 -0
- package/plugin/node_modules/markdownlint-cli2-formatter-default/LICENSE +21 -0
- package/plugin/node_modules/markdownlint-cli2-formatter-default/README.md +54 -0
- package/plugin/node_modules/markdownlint-cli2-formatter-default/markdownlint-cli2-formatter-default.js +25 -0
- package/plugin/node_modules/markdownlint-cli2-formatter-default/package.json +27 -0
- package/plugin/node_modules/mdurl/LICENSE +45 -0
- package/plugin/node_modules/mdurl/README.md +102 -0
- package/plugin/node_modules/mdurl/build/index.cjs.js +534 -0
- package/plugin/node_modules/mdurl/index.mjs +11 -0
- package/plugin/node_modules/mdurl/lib/decode.mjs +112 -0
- package/plugin/node_modules/mdurl/lib/encode.mjs +89 -0
- package/plugin/node_modules/mdurl/lib/format.mjs +21 -0
- package/plugin/node_modules/mdurl/lib/parse.mjs +308 -0
- package/plugin/node_modules/mdurl/package.json +37 -0
- package/plugin/node_modules/merge2/LICENSE +21 -0
- package/plugin/node_modules/merge2/README.md +144 -0
- package/plugin/node_modules/merge2/index.js +144 -0
- package/plugin/node_modules/merge2/package.json +43 -0
- package/plugin/node_modules/micromark/dev/index.d.ts +82 -0
- package/plugin/node_modules/micromark/dev/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark/dev/index.js +68 -0
- package/plugin/node_modules/micromark/dev/lib/compile.d.ts +16 -0
- package/plugin/node_modules/micromark/dev/lib/compile.d.ts.map +1 -0
- package/plugin/node_modules/micromark/dev/lib/compile.js +1152 -0
- package/plugin/node_modules/micromark/dev/lib/constructs.d.ts +73 -0
- package/plugin/node_modules/micromark/dev/lib/constructs.d.ts.map +1 -0
- package/plugin/node_modules/micromark/dev/lib/constructs.js +101 -0
- package/plugin/node_modules/micromark/dev/lib/create-tokenizer.d.ts +46 -0
- package/plugin/node_modules/micromark/dev/lib/create-tokenizer.d.ts.map +1 -0
- package/plugin/node_modules/micromark/dev/lib/create-tokenizer.js +717 -0
- package/plugin/node_modules/micromark/dev/lib/initialize/content.d.ts +4 -0
- package/plugin/node_modules/micromark/dev/lib/initialize/content.d.ts.map +1 -0
- package/plugin/node_modules/micromark/dev/lib/initialize/content.js +99 -0
- package/plugin/node_modules/micromark/dev/lib/initialize/document.d.ts +10 -0
- package/plugin/node_modules/micromark/dev/lib/initialize/document.d.ts.map +1 -0
- package/plugin/node_modules/micromark/dev/lib/initialize/document.js +445 -0
- package/plugin/node_modules/micromark/dev/lib/initialize/flow.d.ts +4 -0
- package/plugin/node_modules/micromark/dev/lib/initialize/flow.d.ts.map +1 -0
- package/plugin/node_modules/micromark/dev/lib/initialize/flow.js +86 -0
- package/plugin/node_modules/micromark/dev/lib/initialize/text.d.ts +8 -0
- package/plugin/node_modules/micromark/dev/lib/initialize/text.d.ts.map +1 -0
- package/plugin/node_modules/micromark/dev/lib/initialize/text.js +244 -0
- package/plugin/node_modules/micromark/dev/lib/parse.d.ts +10 -0
- package/plugin/node_modules/micromark/dev/lib/parse.d.ts.map +1 -0
- package/plugin/node_modules/micromark/dev/lib/parse.js +58 -0
- package/plugin/node_modules/micromark/dev/lib/postprocess.d.ts +9 -0
- package/plugin/node_modules/micromark/dev/lib/postprocess.d.ts.map +1 -0
- package/plugin/node_modules/micromark/dev/lib/postprocess.js +19 -0
- package/plugin/node_modules/micromark/dev/lib/preprocess.d.ts +13 -0
- package/plugin/node_modules/micromark/dev/lib/preprocess.d.ts.map +1 -0
- package/plugin/node_modules/micromark/dev/lib/preprocess.js +141 -0
- package/plugin/node_modules/micromark/dev/stream.d.ts +35 -0
- package/plugin/node_modules/micromark/dev/stream.d.ts.map +1 -0
- package/plugin/node_modules/micromark/dev/stream.js +270 -0
- package/plugin/node_modules/micromark/index.d.ts +82 -0
- package/plugin/node_modules/micromark/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark/index.js +60 -0
- package/plugin/node_modules/micromark/lib/compile.d.ts +16 -0
- package/plugin/node_modules/micromark/lib/compile.d.ts.map +1 -0
- package/plugin/node_modules/micromark/lib/compile.js +1060 -0
- package/plugin/node_modules/micromark/lib/constructs.d.ts +73 -0
- package/plugin/node_modules/micromark/lib/constructs.d.ts.map +1 -0
- package/plugin/node_modules/micromark/lib/constructs.js +85 -0
- package/plugin/node_modules/micromark/lib/create-tokenizer.d.ts +46 -0
- package/plugin/node_modules/micromark/lib/create-tokenizer.d.ts.map +1 -0
- package/plugin/node_modules/micromark/lib/create-tokenizer.js +611 -0
- package/plugin/node_modules/micromark/lib/initialize/content.d.ts +4 -0
- package/plugin/node_modules/micromark/lib/initialize/content.d.ts.map +1 -0
- package/plugin/node_modules/micromark/lib/initialize/content.js +79 -0
- package/plugin/node_modules/micromark/lib/initialize/document.d.ts +10 -0
- package/plugin/node_modules/micromark/lib/initialize/document.d.ts.map +1 -0
- package/plugin/node_modules/micromark/lib/initialize/document.js +362 -0
- package/plugin/node_modules/micromark/lib/initialize/flow.d.ts +4 -0
- package/plugin/node_modules/micromark/lib/initialize/flow.d.ts.map +1 -0
- package/plugin/node_modules/micromark/lib/initialize/flow.js +58 -0
- package/plugin/node_modules/micromark/lib/initialize/text.d.ts +8 -0
- package/plugin/node_modules/micromark/lib/initialize/text.d.ts.map +1 -0
- package/plugin/node_modules/micromark/lib/initialize/text.js +212 -0
- package/plugin/node_modules/micromark/lib/parse.d.ts +10 -0
- package/plugin/node_modules/micromark/lib/parse.d.ts.map +1 -0
- package/plugin/node_modules/micromark/lib/parse.js +56 -0
- package/plugin/node_modules/micromark/lib/postprocess.d.ts +9 -0
- package/plugin/node_modules/micromark/lib/postprocess.d.ts.map +1 -0
- package/plugin/node_modules/micromark/lib/postprocess.js +18 -0
- package/plugin/node_modules/micromark/lib/preprocess.d.ts +13 -0
- package/plugin/node_modules/micromark/lib/preprocess.d.ts.map +1 -0
- package/plugin/node_modules/micromark/lib/preprocess.js +115 -0
- package/plugin/node_modules/micromark/license +22 -0
- package/plugin/node_modules/micromark/package.json +100 -0
- package/plugin/node_modules/micromark/readme.md +488 -0
- package/plugin/node_modules/micromark/stream.d.ts +35 -0
- package/plugin/node_modules/micromark/stream.d.ts.map +1 -0
- package/plugin/node_modules/micromark/stream.js +256 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/index.d.ts +23 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/index.js +22 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/attention.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/attention.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/attention.js +300 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/autolink.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/autolink.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/autolink.js +269 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/blank-line.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/blank-line.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/blank-line.js +62 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/block-quote.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/block-quote.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/block-quote.js +162 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/character-escape.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/character-escape.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/character-escape.js +69 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/character-reference.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/character-reference.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/character-reference.js +166 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/code-fenced.js +514 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/code-indented.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/code-indented.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/code-indented.js +202 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/code-text.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/code-text.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/code-text.js +257 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/content.d.ts +7 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/content.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/content.js +185 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/definition.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/definition.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/definition.js +295 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.js +65 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/heading-atx.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/heading-atx.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/heading-atx.js +233 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/html-flow.js +989 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/html-text.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/html-text.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/html-text.js +783 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/label-end.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/label-end.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/label-end.js +656 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/label-start-image.js +110 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/label-start-link.js +62 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/line-ending.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/line-ending.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/line-ending.js +34 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/list.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/list.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/list.js +306 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/setext-underline.js +210 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/thematic-break.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/thematic-break.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/dev/lib/thematic-break.js +120 -0
- package/plugin/node_modules/micromark-core-commonmark/index.d.ts +23 -0
- package/plugin/node_modules/micromark-core-commonmark/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/index.js +22 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/attention.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/attention.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/attention.js +241 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/autolink.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/autolink.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/autolink.js +233 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/blank-line.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/blank-line.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/blank-line.js +61 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/block-quote.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/block-quote.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/block-quote.js +143 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/character-escape.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/character-escape.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/character-escape.js +64 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/character-reference.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/character-reference.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/character-reference.js +149 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/code-fenced.js +460 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/code-indented.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/code-indented.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/code-indented.js +177 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/code-text.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/code-text.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/code-text.js +225 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/content.d.ts +7 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/content.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/content.js +163 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/definition.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/definition.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/definition.js +254 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/hard-break-escape.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/hard-break-escape.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +60 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/heading-atx.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/heading-atx.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/heading-atx.js +195 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/html-flow.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/html-flow.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/html-flow.js +876 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/html-text.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/html-text.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/html-text.js +678 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/label-end.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/label-end.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/label-end.js +560 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/label-start-image.js +102 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/label-start-link.js +55 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/line-ending.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/line-ending.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/line-ending.js +33 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/list.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/list.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/list.js +213 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/setext-underline.js +185 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/thematic-break.d.ts +4 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/thematic-break.d.ts.map +1 -0
- package/plugin/node_modules/micromark-core-commonmark/lib/thematic-break.js +102 -0
- package/plugin/node_modules/micromark-core-commonmark/license +22 -0
- package/plugin/node_modules/micromark-core-commonmark/package.json +74 -0
- package/plugin/node_modules/micromark-core-commonmark/readme.md +171 -0
- package/plugin/node_modules/micromark-extension-directive/dev/index.d.ts +156 -0
- package/plugin/node_modules/micromark-extension-directive/dev/index.js +3 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/directive-container.d.ts +4 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/directive-container.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/directive-container.js +323 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/directive-leaf.d.ts +4 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/directive-leaf.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/directive-leaf.js +124 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/directive-text.d.ts +4 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/directive-text.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/directive-text.js +113 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/factory-attributes.d.ts +23 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/factory-attributes.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/factory-attributes.js +348 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/factory-label.d.ts +15 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/factory-label.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/factory-label.js +135 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/factory-name.d.ts +14 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/factory-name.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/factory-name.js +59 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/html.d.ts +14 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/html.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/html.js +265 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/syntax.d.ts +10 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/syntax.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-directive/dev/lib/syntax.js +22 -0
- package/plugin/node_modules/micromark-extension-directive/index.d.ts +156 -0
- package/plugin/node_modules/micromark-extension-directive/index.js +3 -0
- package/plugin/node_modules/micromark-extension-directive/lib/directive-container.d.ts +4 -0
- package/plugin/node_modules/micromark-extension-directive/lib/directive-container.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-directive/lib/directive-container.js +259 -0
- package/plugin/node_modules/micromark-extension-directive/lib/directive-leaf.d.ts +4 -0
- package/plugin/node_modules/micromark-extension-directive/lib/directive-leaf.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-directive/lib/directive-leaf.js +91 -0
- package/plugin/node_modules/micromark-extension-directive/lib/directive-text.d.ts +4 -0
- package/plugin/node_modules/micromark-extension-directive/lib/directive-text.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-directive/lib/directive-text.js +82 -0
- package/plugin/node_modules/micromark-extension-directive/lib/factory-attributes.d.ts +23 -0
- package/plugin/node_modules/micromark-extension-directive/lib/factory-attributes.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-directive/lib/factory-attributes.js +238 -0
- package/plugin/node_modules/micromark-extension-directive/lib/factory-label.d.ts +15 -0
- package/plugin/node_modules/micromark-extension-directive/lib/factory-label.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-directive/lib/factory-label.js +107 -0
- package/plugin/node_modules/micromark-extension-directive/lib/factory-name.d.ts +14 -0
- package/plugin/node_modules/micromark-extension-directive/lib/factory-name.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-directive/lib/factory-name.js +36 -0
- package/plugin/node_modules/micromark-extension-directive/lib/html.d.ts +14 -0
- package/plugin/node_modules/micromark-extension-directive/lib/html.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-directive/lib/html.js +233 -0
- package/plugin/node_modules/micromark-extension-directive/lib/syntax.d.ts +10 -0
- package/plugin/node_modules/micromark-extension-directive/lib/syntax.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-directive/lib/syntax.js +25 -0
- package/plugin/node_modules/micromark-extension-directive/license +22 -0
- package/plugin/node_modules/micromark-extension-directive/package.json +124 -0
- package/plugin/node_modules/micromark-extension-directive/readme.md +451 -0
- package/plugin/node_modules/micromark-extension-gfm-autolink-literal/dev/index.d.ts +24 -0
- package/plugin/node_modules/micromark-extension-gfm-autolink-literal/dev/index.js +2 -0
- package/plugin/node_modules/micromark-extension-gfm-autolink-literal/dev/lib/html.d.ts +10 -0
- package/plugin/node_modules/micromark-extension-gfm-autolink-literal/dev/lib/html.js +56 -0
- package/plugin/node_modules/micromark-extension-gfm-autolink-literal/dev/lib/syntax.d.ts +10 -0
- package/plugin/node_modules/micromark-extension-gfm-autolink-literal/dev/lib/syntax.js +983 -0
- package/plugin/node_modules/micromark-extension-gfm-autolink-literal/index.d.ts +24 -0
- package/plugin/node_modules/micromark-extension-gfm-autolink-literal/index.js +2 -0
- package/plugin/node_modules/micromark-extension-gfm-autolink-literal/lib/html.d.ts +10 -0
- package/plugin/node_modules/micromark-extension-gfm-autolink-literal/lib/html.js +60 -0
- package/plugin/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.d.ts +10 -0
- package/plugin/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js +854 -0
- package/plugin/node_modules/micromark-extension-gfm-autolink-literal/license +22 -0
- package/plugin/node_modules/micromark-extension-gfm-autolink-literal/package.json +116 -0
- package/plugin/node_modules/micromark-extension-gfm-autolink-literal/readme.md +422 -0
- package/plugin/node_modules/micromark-extension-gfm-footnote/dev/index.d.ts +164 -0
- package/plugin/node_modules/micromark-extension-gfm-footnote/dev/index.js +3 -0
- package/plugin/node_modules/micromark-extension-gfm-footnote/dev/lib/html.d.ts +25 -0
- package/plugin/node_modules/micromark-extension-gfm-footnote/dev/lib/html.js +226 -0
- package/plugin/node_modules/micromark-extension-gfm-footnote/dev/lib/syntax.d.ts +9 -0
- package/plugin/node_modules/micromark-extension-gfm-footnote/dev/lib/syntax.js +558 -0
- package/plugin/node_modules/micromark-extension-gfm-footnote/index.d.ts +164 -0
- package/plugin/node_modules/micromark-extension-gfm-footnote/index.js +3 -0
- package/plugin/node_modules/micromark-extension-gfm-footnote/lib/html.d.ts +25 -0
- package/plugin/node_modules/micromark-extension-gfm-footnote/lib/html.js +154 -0
- package/plugin/node_modules/micromark-extension-gfm-footnote/lib/syntax.d.ts +9 -0
- package/plugin/node_modules/micromark-extension-gfm-footnote/lib/syntax.js +485 -0
- package/plugin/node_modules/micromark-extension-gfm-footnote/license +22 -0
- package/plugin/node_modules/micromark-extension-gfm-footnote/package.json +132 -0
- package/plugin/node_modules/micromark-extension-gfm-footnote/readme.md +656 -0
- package/plugin/node_modules/micromark-extension-gfm-table/dev/index.d.ts +55 -0
- package/plugin/node_modules/micromark-extension-gfm-table/dev/index.js +2 -0
- package/plugin/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.d.ts +38 -0
- package/plugin/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-gfm-table/dev/lib/edit-map.js +212 -0
- package/plugin/node_modules/micromark-extension-gfm-table/dev/lib/html.d.ts +11 -0
- package/plugin/node_modules/micromark-extension-gfm-table/dev/lib/html.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-gfm-table/dev/lib/html.js +148 -0
- package/plugin/node_modules/micromark-extension-gfm-table/dev/lib/infer.d.ts +14 -0
- package/plugin/node_modules/micromark-extension-gfm-table/dev/lib/infer.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-gfm-table/dev/lib/infer.js +64 -0
- package/plugin/node_modules/micromark-extension-gfm-table/dev/lib/syntax.d.ts +18 -0
- package/plugin/node_modules/micromark-extension-gfm-table/dev/lib/syntax.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-gfm-table/dev/lib/syntax.js +941 -0
- package/plugin/node_modules/micromark-extension-gfm-table/index.d.ts +55 -0
- package/plugin/node_modules/micromark-extension-gfm-table/index.js +2 -0
- package/plugin/node_modules/micromark-extension-gfm-table/lib/edit-map.d.ts +38 -0
- package/plugin/node_modules/micromark-extension-gfm-table/lib/edit-map.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-gfm-table/lib/edit-map.js +202 -0
- package/plugin/node_modules/micromark-extension-gfm-table/lib/html.d.ts +11 -0
- package/plugin/node_modules/micromark-extension-gfm-table/lib/html.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-gfm-table/lib/html.js +130 -0
- package/plugin/node_modules/micromark-extension-gfm-table/lib/infer.d.ts +14 -0
- package/plugin/node_modules/micromark-extension-gfm-table/lib/infer.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-gfm-table/lib/infer.js +52 -0
- package/plugin/node_modules/micromark-extension-gfm-table/lib/syntax.d.ts +18 -0
- package/plugin/node_modules/micromark-extension-gfm-table/lib/syntax.d.ts.map +1 -0
- package/plugin/node_modules/micromark-extension-gfm-table/lib/syntax.js +819 -0
- package/plugin/node_modules/micromark-extension-gfm-table/license +22 -0
- package/plugin/node_modules/micromark-extension-gfm-table/package.json +128 -0
- package/plugin/node_modules/micromark-extension-gfm-table/readme.md +515 -0
- package/plugin/node_modules/micromark-extension-math/dev/index.d.ts +61 -0
- package/plugin/node_modules/micromark-extension-math/dev/index.js +3 -0
- package/plugin/node_modules/micromark-extension-math/dev/lib/html.d.ts +15 -0
- package/plugin/node_modules/micromark-extension-math/dev/lib/html.js +82 -0
- package/plugin/node_modules/micromark-extension-math/dev/lib/math-flow.d.ts +3 -0
- package/plugin/node_modules/micromark-extension-math/dev/lib/math-flow.js +394 -0
- package/plugin/node_modules/micromark-extension-math/dev/lib/math-text.d.ts +9 -0
- package/plugin/node_modules/micromark-extension-math/dev/lib/math-text.js +267 -0
- package/plugin/node_modules/micromark-extension-math/dev/lib/syntax.d.ts +12 -0
- package/plugin/node_modules/micromark-extension-math/dev/lib/syntax.js +24 -0
- package/plugin/node_modules/micromark-extension-math/index.d.ts +61 -0
- package/plugin/node_modules/micromark-extension-math/index.js +3 -0
- package/plugin/node_modules/micromark-extension-math/lib/html.d.ts +15 -0
- package/plugin/node_modules/micromark-extension-math/lib/html.js +84 -0
- package/plugin/node_modules/micromark-extension-math/lib/math-flow.d.ts +3 -0
- package/plugin/node_modules/micromark-extension-math/lib/math-flow.js +345 -0
- package/plugin/node_modules/micromark-extension-math/lib/math-text.d.ts +9 -0
- package/plugin/node_modules/micromark-extension-math/lib/math-text.js +232 -0
- package/plugin/node_modules/micromark-extension-math/lib/syntax.d.ts +12 -0
- package/plugin/node_modules/micromark-extension-math/lib/syntax.js +27 -0
- package/plugin/node_modules/micromark-extension-math/license +22 -0
- package/plugin/node_modules/micromark-extension-math/package.json +121 -0
- package/plugin/node_modules/micromark-extension-math/readme.md +429 -0
- package/plugin/node_modules/micromark-factory-destination/dev/index.d.ts +42 -0
- package/plugin/node_modules/micromark-factory-destination/dev/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-factory-destination/dev/index.js +255 -0
- package/plugin/node_modules/micromark-factory-destination/index.d.ts +42 -0
- package/plugin/node_modules/micromark-factory-destination/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-factory-destination/index.js +206 -0
- package/plugin/node_modules/micromark-factory-destination/license +22 -0
- package/plugin/node_modules/micromark-factory-destination/package.json +57 -0
- package/plugin/node_modules/micromark-factory-destination/readme.md +234 -0
- package/plugin/node_modules/micromark-factory-label/dev/index.d.ts +37 -0
- package/plugin/node_modules/micromark-factory-label/dev/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-factory-label/dev/index.js +172 -0
- package/plugin/node_modules/micromark-factory-label/index.d.ts +37 -0
- package/plugin/node_modules/micromark-factory-label/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-factory-label/index.js +148 -0
- package/plugin/node_modules/micromark-factory-label/license +22 -0
- package/plugin/node_modules/micromark-factory-label/package.json +60 -0
- package/plugin/node_modules/micromark-factory-label/readme.md +224 -0
- package/plugin/node_modules/micromark-factory-space/dev/index.d.ts +37 -0
- package/plugin/node_modules/micromark-factory-space/dev/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-factory-space/dev/index.js +67 -0
- package/plugin/node_modules/micromark-factory-space/index.d.ts +37 -0
- package/plugin/node_modules/micromark-factory-space/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-factory-space/index.js +64 -0
- package/plugin/node_modules/micromark-factory-space/license +22 -0
- package/plugin/node_modules/micromark-factory-space/package.json +55 -0
- package/plugin/node_modules/micromark-factory-space/readme.md +225 -0
- package/plugin/node_modules/micromark-factory-title/dev/index.d.ts +36 -0
- package/plugin/node_modules/micromark-factory-title/dev/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-factory-title/dev/index.js +169 -0
- package/plugin/node_modules/micromark-factory-title/index.d.ts +36 -0
- package/plugin/node_modules/micromark-factory-title/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-factory-title/index.js +158 -0
- package/plugin/node_modules/micromark-factory-title/license +22 -0
- package/plugin/node_modules/micromark-factory-title/package.json +58 -0
- package/plugin/node_modules/micromark-factory-title/readme.md +229 -0
- package/plugin/node_modules/micromark-factory-whitespace/dev/index.d.ts +22 -0
- package/plugin/node_modules/micromark-factory-whitespace/dev/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-factory-whitespace/dev/index.js +53 -0
- package/plugin/node_modules/micromark-factory-whitespace/index.d.ts +22 -0
- package/plugin/node_modules/micromark-factory-whitespace/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-factory-whitespace/index.js +44 -0
- package/plugin/node_modules/micromark-factory-whitespace/license +22 -0
- package/plugin/node_modules/micromark-factory-whitespace/package.json +57 -0
- package/plugin/node_modules/micromark-factory-whitespace/readme.md +205 -0
- package/plugin/node_modules/micromark-util-character/dev/index.d.ts +195 -0
- package/plugin/node_modules/micromark-util-character/dev/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-character/dev/index.js +252 -0
- package/plugin/node_modules/micromark-util-character/index.d.ts +195 -0
- package/plugin/node_modules/micromark-util-character/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-character/index.js +246 -0
- package/plugin/node_modules/micromark-util-character/license +22 -0
- package/plugin/node_modules/micromark-util-character/package.json +57 -0
- package/plugin/node_modules/micromark-util-character/readme.md +446 -0
- package/plugin/node_modules/micromark-util-chunked/dev/index.d.ts +41 -0
- package/plugin/node_modules/micromark-util-chunked/dev/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-chunked/dev/index.js +89 -0
- package/plugin/node_modules/micromark-util-chunked/index.d.ts +41 -0
- package/plugin/node_modules/micromark-util-chunked/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-chunked/index.js +81 -0
- package/plugin/node_modules/micromark-util-chunked/license +22 -0
- package/plugin/node_modules/micromark-util-chunked/package.json +57 -0
- package/plugin/node_modules/micromark-util-chunked/readme.md +219 -0
- package/plugin/node_modules/micromark-util-classify-character/dev/index.d.ts +18 -0
- package/plugin/node_modules/micromark-util-classify-character/dev/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-classify-character/dev/index.js +38 -0
- package/plugin/node_modules/micromark-util-classify-character/index.d.ts +18 -0
- package/plugin/node_modules/micromark-util-classify-character/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-classify-character/index.js +27 -0
- package/plugin/node_modules/micromark-util-classify-character/license +22 -0
- package/plugin/node_modules/micromark-util-classify-character/package.json +59 -0
- package/plugin/node_modules/micromark-util-classify-character/readme.md +205 -0
- package/plugin/node_modules/micromark-util-combine-extensions/index.d.ts +22 -0
- package/plugin/node_modules/micromark-util-combine-extensions/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-combine-extensions/index.js +143 -0
- package/plugin/node_modules/micromark-util-combine-extensions/license +22 -0
- package/plugin/node_modules/micromark-util-combine-extensions/package.json +52 -0
- package/plugin/node_modules/micromark-util-combine-extensions/readme.md +201 -0
- package/plugin/node_modules/micromark-util-decode-numeric-character-reference/dev/index.d.ts +16 -0
- package/plugin/node_modules/micromark-util-decode-numeric-character-reference/dev/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-decode-numeric-character-reference/dev/index.js +42 -0
- package/plugin/node_modules/micromark-util-decode-numeric-character-reference/index.d.ts +16 -0
- package/plugin/node_modules/micromark-util-decode-numeric-character-reference/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-decode-numeric-character-reference/index.js +32 -0
- package/plugin/node_modules/micromark-util-decode-numeric-character-reference/license +22 -0
- package/plugin/node_modules/micromark-util-decode-numeric-character-reference/package.json +59 -0
- package/plugin/node_modules/micromark-util-decode-numeric-character-reference/readme.md +184 -0
- package/plugin/node_modules/micromark-util-encode/index.d.ts +14 -0
- package/plugin/node_modules/micromark-util-encode/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-encode/index.js +33 -0
- package/plugin/node_modules/micromark-util-encode/license +22 -0
- package/plugin/node_modules/micromark-util-encode/package.json +47 -0
- package/plugin/node_modules/micromark-util-encode/readme.md +176 -0
- package/plugin/node_modules/micromark-util-html-tag-name/index.d.ts +30 -0
- package/plugin/node_modules/micromark-util-html-tag-name/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-html-tag-name/index.js +93 -0
- package/plugin/node_modules/micromark-util-html-tag-name/license +22 -0
- package/plugin/node_modules/micromark-util-html-tag-name/package.json +47 -0
- package/plugin/node_modules/micromark-util-html-tag-name/readme.md +193 -0
- package/plugin/node_modules/micromark-util-normalize-identifier/dev/index.d.ts +21 -0
- package/plugin/node_modules/micromark-util-normalize-identifier/dev/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-normalize-identifier/dev/index.js +38 -0
- package/plugin/node_modules/micromark-util-normalize-identifier/index.d.ts +21 -0
- package/plugin/node_modules/micromark-util-normalize-identifier/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-normalize-identifier/index.js +33 -0
- package/plugin/node_modules/micromark-util-normalize-identifier/license +22 -0
- package/plugin/node_modules/micromark-util-normalize-identifier/package.json +58 -0
- package/plugin/node_modules/micromark-util-normalize-identifier/readme.md +187 -0
- package/plugin/node_modules/micromark-util-resolve-all/index.d.ts +22 -0
- package/plugin/node_modules/micromark-util-resolve-all/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-resolve-all/index.js +32 -0
- package/plugin/node_modules/micromark-util-resolve-all/license +22 -0
- package/plugin/node_modules/micromark-util-resolve-all/package.json +48 -0
- package/plugin/node_modules/micromark-util-resolve-all/readme.md +238 -0
- package/plugin/node_modules/micromark-util-sanitize-uri/dev/index.d.ts +36 -0
- package/plugin/node_modules/micromark-util-sanitize-uri/dev/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-sanitize-uri/dev/index.js +124 -0
- package/plugin/node_modules/micromark-util-sanitize-uri/index.d.ts +36 -0
- package/plugin/node_modules/micromark-util-sanitize-uri/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-sanitize-uri/index.js +107 -0
- package/plugin/node_modules/micromark-util-sanitize-uri/license +22 -0
- package/plugin/node_modules/micromark-util-sanitize-uri/package.json +59 -0
- package/plugin/node_modules/micromark-util-sanitize-uri/readme.md +214 -0
- package/plugin/node_modules/micromark-util-subtokenize/dev/index.d.ts +12 -0
- package/plugin/node_modules/micromark-util-subtokenize/dev/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-subtokenize/dev/index.js +284 -0
- package/plugin/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.d.ts +161 -0
- package/plugin/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-subtokenize/dev/lib/splice-buffer.js +288 -0
- package/plugin/node_modules/micromark-util-subtokenize/index.d.ts +12 -0
- package/plugin/node_modules/micromark-util-subtokenize/index.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-subtokenize/index.js +228 -0
- package/plugin/node_modules/micromark-util-subtokenize/lib/splice-buffer.d.ts +161 -0
- package/plugin/node_modules/micromark-util-subtokenize/lib/splice-buffer.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-subtokenize/lib/splice-buffer.js +251 -0
- package/plugin/node_modules/micromark-util-subtokenize/license +22 -0
- package/plugin/node_modules/micromark-util-subtokenize/package.json +60 -0
- package/plugin/node_modules/micromark-util-subtokenize/readme.md +181 -0
- package/plugin/node_modules/micromark-util-symbol/lib/codes.d.ts +139 -0
- package/plugin/node_modules/micromark-util-symbol/lib/codes.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-symbol/lib/codes.js +158 -0
- package/plugin/node_modules/micromark-util-symbol/lib/constants.d.ts +37 -0
- package/plugin/node_modules/micromark-util-symbol/lib/constants.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-symbol/lib/constants.js +44 -0
- package/plugin/node_modules/micromark-util-symbol/lib/default.d.ts +5 -0
- package/plugin/node_modules/micromark-util-symbol/lib/default.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-symbol/lib/default.js +4 -0
- package/plugin/node_modules/micromark-util-symbol/lib/types.d.ts +106 -0
- package/plugin/node_modules/micromark-util-symbol/lib/types.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-symbol/lib/types.js +453 -0
- package/plugin/node_modules/micromark-util-symbol/lib/values.d.ts +102 -0
- package/plugin/node_modules/micromark-util-symbol/lib/values.d.ts.map +1 -0
- package/plugin/node_modules/micromark-util-symbol/lib/values.js +109 -0
- package/plugin/node_modules/micromark-util-symbol/license +22 -0
- package/plugin/node_modules/micromark-util-symbol/package.json +43 -0
- package/plugin/node_modules/micromark-util-symbol/readme.md +168 -0
- package/plugin/node_modules/micromark-util-types/index.d.ts +1312 -0
- package/plugin/node_modules/micromark-util-types/index.js +2 -0
- package/plugin/node_modules/micromark-util-types/license +22 -0
- package/plugin/node_modules/micromark-util-types/package.json +71 -0
- package/plugin/node_modules/micromark-util-types/readme.md +151 -0
- package/plugin/node_modules/micromatch/LICENSE +21 -0
- package/plugin/node_modules/micromatch/README.md +1024 -0
- package/plugin/node_modules/micromatch/index.js +474 -0
- package/plugin/node_modules/micromatch/package.json +119 -0
- package/plugin/node_modules/ms/index.js +162 -0
- package/plugin/node_modules/ms/license.md +21 -0
- package/plugin/node_modules/ms/package.json +38 -0
- package/plugin/node_modules/ms/readme.md +59 -0
- package/plugin/node_modules/parse-entities/index.d.ts +126 -0
- package/plugin/node_modules/parse-entities/index.js +3 -0
- package/plugin/node_modules/parse-entities/lib/index.d.ts +9 -0
- package/plugin/node_modules/parse-entities/lib/index.d.ts.map +1 -0
- package/plugin/node_modules/parse-entities/lib/index.js +407 -0
- package/plugin/node_modules/parse-entities/license +22 -0
- package/plugin/node_modules/parse-entities/package.json +91 -0
- package/plugin/node_modules/parse-entities/readme.md +266 -0
- package/plugin/node_modules/picomatch/LICENSE +21 -0
- package/plugin/node_modules/picomatch/README.md +716 -0
- package/plugin/node_modules/picomatch/index.js +3 -0
- package/plugin/node_modules/picomatch/lib/constants.js +184 -0
- package/plugin/node_modules/picomatch/lib/parse.js +1392 -0
- package/plugin/node_modules/picomatch/lib/picomatch.js +342 -0
- package/plugin/node_modules/picomatch/lib/scan.js +391 -0
- package/plugin/node_modules/picomatch/lib/utils.js +64 -0
- package/plugin/node_modules/picomatch/package.json +81 -0
- package/plugin/node_modules/punycode.js/LICENSE-MIT.txt +20 -0
- package/plugin/node_modules/punycode.js/README.md +148 -0
- package/plugin/node_modules/punycode.js/package.json +58 -0
- package/plugin/node_modules/punycode.js/punycode.es6.js +444 -0
- package/plugin/node_modules/punycode.js/punycode.js +443 -0
- package/plugin/node_modules/queue-microtask/LICENSE +20 -0
- package/plugin/node_modules/queue-microtask/README.md +90 -0
- package/plugin/node_modules/queue-microtask/index.d.ts +2 -0
- package/plugin/node_modules/queue-microtask/index.js +9 -0
- package/plugin/node_modules/queue-microtask/package.json +55 -0
- package/plugin/node_modules/reusify/.github/dependabot.yml +7 -0
- package/plugin/node_modules/reusify/.github/workflows/ci.yml +96 -0
- package/plugin/node_modules/reusify/LICENSE +22 -0
- package/plugin/node_modules/reusify/README.md +139 -0
- package/plugin/node_modules/reusify/SECURITY.md +15 -0
- package/plugin/node_modules/reusify/benchmarks/createNoCodeFunction.js +30 -0
- package/plugin/node_modules/reusify/benchmarks/fib.js +13 -0
- package/plugin/node_modules/reusify/benchmarks/reuseNoCodeFunction.js +38 -0
- package/plugin/node_modules/reusify/eslint.config.js +14 -0
- package/plugin/node_modules/reusify/package.json +50 -0
- package/plugin/node_modules/reusify/reusify.d.ts +14 -0
- package/plugin/node_modules/reusify/reusify.js +33 -0
- package/plugin/node_modules/reusify/test.js +66 -0
- package/plugin/node_modules/reusify/tsconfig.json +11 -0
- package/plugin/node_modules/run-parallel/LICENSE +20 -0
- package/plugin/node_modules/run-parallel/README.md +85 -0
- package/plugin/node_modules/run-parallel/index.js +51 -0
- package/plugin/node_modules/run-parallel/package.json +58 -0
- package/plugin/node_modules/slash/index.d.ts +23 -0
- package/plugin/node_modules/slash/index.js +9 -0
- package/plugin/node_modules/slash/license +9 -0
- package/plugin/node_modules/slash/package.json +39 -0
- package/plugin/node_modules/slash/readme.md +36 -0
- package/plugin/node_modules/smol-toml/LICENSE +24 -0
- package/plugin/node_modules/smol-toml/README.md +239 -0
- package/plugin/node_modules/smol-toml/dist/date.d.ts +41 -0
- package/plugin/node_modules/smol-toml/dist/date.js +127 -0
- package/plugin/node_modules/smol-toml/dist/error.d.ts +38 -0
- package/plugin/node_modules/smol-toml/dist/error.js +63 -0
- package/plugin/node_modules/smol-toml/dist/extract.d.ts +30 -0
- package/plugin/node_modules/smol-toml/dist/extract.js +100 -0
- package/plugin/node_modules/smol-toml/dist/index.cjs +897 -0
- package/plugin/node_modules/smol-toml/dist/index.d.ts +43 -0
- package/plugin/node_modules/smol-toml/dist/index.js +33 -0
- package/plugin/node_modules/smol-toml/dist/parse.d.ts +37 -0
- package/plugin/node_modules/smol-toml/dist/parse.js +148 -0
- package/plugin/node_modules/smol-toml/dist/primitive.d.ts +31 -0
- package/plugin/node_modules/smol-toml/dist/primitive.js +179 -0
- package/plugin/node_modules/smol-toml/dist/stringify.d.ts +31 -0
- package/plugin/node_modules/smol-toml/dist/stringify.js +167 -0
- package/plugin/node_modules/smol-toml/dist/struct.d.ts +32 -0
- package/plugin/node_modules/smol-toml/dist/struct.js +184 -0
- package/plugin/node_modules/smol-toml/dist/util.d.ts +42 -0
- package/plugin/node_modules/smol-toml/dist/util.js +111 -0
- package/plugin/node_modules/smol-toml/package.json +54 -0
- package/plugin/node_modules/string-width/index.d.ts +39 -0
- package/plugin/node_modules/string-width/index.js +89 -0
- package/plugin/node_modules/string-width/license +9 -0
- package/plugin/node_modules/string-width/package.json +65 -0
- package/plugin/node_modules/string-width/readme.md +66 -0
- package/plugin/node_modules/strip-ansi/index.d.ts +15 -0
- package/plugin/node_modules/strip-ansi/index.js +19 -0
- package/plugin/node_modules/strip-ansi/license +9 -0
- package/plugin/node_modules/strip-ansi/package.json +59 -0
- package/plugin/node_modules/strip-ansi/readme.md +37 -0
- package/plugin/node_modules/to-regex-range/LICENSE +21 -0
- package/plugin/node_modules/to-regex-range/README.md +305 -0
- package/plugin/node_modules/to-regex-range/index.js +288 -0
- package/plugin/node_modules/to-regex-range/package.json +88 -0
- package/plugin/node_modules/uc.micro/LICENSE.txt +20 -0
- package/plugin/node_modules/uc.micro/README.md +14 -0
- package/plugin/node_modules/uc.micro/build/index.cjs.js +20 -0
- package/plugin/node_modules/uc.micro/categories/Cc/regex.mjs +1 -0
- package/plugin/node_modules/uc.micro/categories/Cf/regex.mjs +1 -0
- package/plugin/node_modules/uc.micro/categories/P/regex.mjs +1 -0
- package/plugin/node_modules/uc.micro/categories/S/regex.mjs +1 -0
- package/plugin/node_modules/uc.micro/categories/Z/regex.mjs +1 -0
- package/plugin/node_modules/uc.micro/index.mjs +8 -0
- package/plugin/node_modules/uc.micro/package.json +37 -0
- package/plugin/node_modules/uc.micro/properties/Any/regex.mjs +1 -0
- package/plugin/node_modules/unicorn-magic/default.d.ts +13 -0
- package/plugin/node_modules/unicorn-magic/default.js +14 -0
- package/plugin/node_modules/unicorn-magic/license +9 -0
- package/plugin/node_modules/unicorn-magic/node.d.ts +125 -0
- package/plugin/node_modules/unicorn-magic/node.js +49 -0
- package/plugin/node_modules/unicorn-magic/package.json +68 -0
- package/plugin/node_modules/unicorn-magic/readme.md +31 -0
- package/plugin/package.json +28 -0
- package/plugin/skills/ase-arch-analyze/SKILL.md +323 -316
- package/plugin/skills/ase-code-analyze/SKILL.md +2 -0
- package/plugin/skills/ase-code-explain/SKILL.md +2 -0
- package/plugin/skills/ase-meta-changes/SKILL.md +2 -0
- package/plugin/skills/ase-meta-chat/SKILL.md +2 -0
- package/plugin/skills/ase-task-list/SKILL.md +1 -0
- package/plugin/skills/ase-task-preflight/SKILL.md +3 -4
|
@@ -0,0 +1,1944 @@
|
|
|
1
|
+
const EventEmitter = require('events').EventEmitter;
|
|
2
|
+
const childProcess = require('child_process');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
|
|
6
|
+
const { Argument, humanReadableArgName } = require('./argument.js');
|
|
7
|
+
const { CommanderError } = require('./error.js');
|
|
8
|
+
const { Help } = require('./help.js');
|
|
9
|
+
const { Option, splitOptionFlags } = require('./option.js');
|
|
10
|
+
const { suggestSimilar } = require('./suggestSimilar');
|
|
11
|
+
|
|
12
|
+
// @ts-check
|
|
13
|
+
|
|
14
|
+
class Command extends EventEmitter {
|
|
15
|
+
/**
|
|
16
|
+
* Initialize a new `Command`.
|
|
17
|
+
*
|
|
18
|
+
* @param {string} [name]
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
constructor(name) {
|
|
22
|
+
super();
|
|
23
|
+
/** @type {Command[]} */
|
|
24
|
+
this.commands = [];
|
|
25
|
+
/** @type {Option[]} */
|
|
26
|
+
this.options = [];
|
|
27
|
+
this.parent = null;
|
|
28
|
+
this._allowUnknownOption = false;
|
|
29
|
+
this._allowExcessArguments = true;
|
|
30
|
+
/** @type {Argument[]} */
|
|
31
|
+
this._args = [];
|
|
32
|
+
/** @type {string[]} */
|
|
33
|
+
this.args = []; // cli args with options removed
|
|
34
|
+
this.rawArgs = [];
|
|
35
|
+
this.processedArgs = []; // like .args but after custom processing and collecting variadic
|
|
36
|
+
this._scriptPath = null;
|
|
37
|
+
this._name = name || '';
|
|
38
|
+
this._optionValues = {};
|
|
39
|
+
this._optionValueSources = {}; // default < config < env < cli
|
|
40
|
+
this._storeOptionsAsProperties = false;
|
|
41
|
+
this._actionHandler = null;
|
|
42
|
+
this._executableHandler = false;
|
|
43
|
+
this._executableFile = null; // custom name for executable
|
|
44
|
+
this._defaultCommandName = null;
|
|
45
|
+
this._exitCallback = null;
|
|
46
|
+
this._aliases = [];
|
|
47
|
+
this._combineFlagAndOptionalValue = true;
|
|
48
|
+
this._description = '';
|
|
49
|
+
this._argsDescription = undefined; // legacy
|
|
50
|
+
this._enablePositionalOptions = false;
|
|
51
|
+
this._passThroughOptions = false;
|
|
52
|
+
this._lifeCycleHooks = {}; // a hash of arrays
|
|
53
|
+
/** @type {boolean | string} */
|
|
54
|
+
this._showHelpAfterError = false;
|
|
55
|
+
this._showSuggestionAfterError = false;
|
|
56
|
+
|
|
57
|
+
// see .configureOutput() for docs
|
|
58
|
+
this._outputConfiguration = {
|
|
59
|
+
writeOut: (str) => process.stdout.write(str),
|
|
60
|
+
writeErr: (str) => process.stderr.write(str),
|
|
61
|
+
getOutHelpWidth: () => process.stdout.isTTY ? process.stdout.columns : undefined,
|
|
62
|
+
getErrHelpWidth: () => process.stderr.isTTY ? process.stderr.columns : undefined,
|
|
63
|
+
outputError: (str, write) => write(str)
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
this._hidden = false;
|
|
67
|
+
this._hasHelpOption = true;
|
|
68
|
+
this._helpFlags = '-h, --help';
|
|
69
|
+
this._helpDescription = 'display help for command';
|
|
70
|
+
this._helpShortFlag = '-h';
|
|
71
|
+
this._helpLongFlag = '--help';
|
|
72
|
+
this._addImplicitHelpCommand = undefined; // Deliberately undefined, not decided whether true or false
|
|
73
|
+
this._helpCommandName = 'help';
|
|
74
|
+
this._helpCommandnameAndArgs = 'help [command]';
|
|
75
|
+
this._helpCommandDescription = 'display help for command';
|
|
76
|
+
this._helpConfiguration = {};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Copy settings that are useful to have in common across root command and subcommands.
|
|
81
|
+
*
|
|
82
|
+
* (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)
|
|
83
|
+
*
|
|
84
|
+
* @param {Command} sourceCommand
|
|
85
|
+
* @return {Command} returns `this` for executable command
|
|
86
|
+
*/
|
|
87
|
+
copyInheritedSettings(sourceCommand) {
|
|
88
|
+
this._outputConfiguration = sourceCommand._outputConfiguration;
|
|
89
|
+
this._hasHelpOption = sourceCommand._hasHelpOption;
|
|
90
|
+
this._helpFlags = sourceCommand._helpFlags;
|
|
91
|
+
this._helpDescription = sourceCommand._helpDescription;
|
|
92
|
+
this._helpShortFlag = sourceCommand._helpShortFlag;
|
|
93
|
+
this._helpLongFlag = sourceCommand._helpLongFlag;
|
|
94
|
+
this._helpCommandName = sourceCommand._helpCommandName;
|
|
95
|
+
this._helpCommandnameAndArgs = sourceCommand._helpCommandnameAndArgs;
|
|
96
|
+
this._helpCommandDescription = sourceCommand._helpCommandDescription;
|
|
97
|
+
this._helpConfiguration = sourceCommand._helpConfiguration;
|
|
98
|
+
this._exitCallback = sourceCommand._exitCallback;
|
|
99
|
+
this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;
|
|
100
|
+
this._combineFlagAndOptionalValue = sourceCommand._combineFlagAndOptionalValue;
|
|
101
|
+
this._allowExcessArguments = sourceCommand._allowExcessArguments;
|
|
102
|
+
this._enablePositionalOptions = sourceCommand._enablePositionalOptions;
|
|
103
|
+
this._showHelpAfterError = sourceCommand._showHelpAfterError;
|
|
104
|
+
this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;
|
|
105
|
+
|
|
106
|
+
return this;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Define a command.
|
|
111
|
+
*
|
|
112
|
+
* There are two styles of command: pay attention to where to put the description.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* // Command implemented using action handler (description is supplied separately to `.command`)
|
|
116
|
+
* program
|
|
117
|
+
* .command('clone <source> [destination]')
|
|
118
|
+
* .description('clone a repository into a newly created directory')
|
|
119
|
+
* .action((source, destination) => {
|
|
120
|
+
* console.log('clone command called');
|
|
121
|
+
* });
|
|
122
|
+
*
|
|
123
|
+
* // Command implemented using separate executable file (description is second parameter to `.command`)
|
|
124
|
+
* program
|
|
125
|
+
* .command('start <service>', 'start named service')
|
|
126
|
+
* .command('stop [service]', 'stop named service, or all if no name supplied');
|
|
127
|
+
*
|
|
128
|
+
* @param {string} nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
|
|
129
|
+
* @param {Object|string} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)
|
|
130
|
+
* @param {Object} [execOpts] - configuration options (for executable)
|
|
131
|
+
* @return {Command} returns new command for action handler, or `this` for executable command
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
command(nameAndArgs, actionOptsOrExecDesc, execOpts) {
|
|
135
|
+
let desc = actionOptsOrExecDesc;
|
|
136
|
+
let opts = execOpts;
|
|
137
|
+
if (typeof desc === 'object' && desc !== null) {
|
|
138
|
+
opts = desc;
|
|
139
|
+
desc = null;
|
|
140
|
+
}
|
|
141
|
+
opts = opts || {};
|
|
142
|
+
const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);
|
|
143
|
+
|
|
144
|
+
const cmd = this.createCommand(name);
|
|
145
|
+
if (desc) {
|
|
146
|
+
cmd.description(desc);
|
|
147
|
+
cmd._executableHandler = true;
|
|
148
|
+
}
|
|
149
|
+
if (opts.isDefault) this._defaultCommandName = cmd._name;
|
|
150
|
+
cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden
|
|
151
|
+
cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor
|
|
152
|
+
if (args) cmd.arguments(args);
|
|
153
|
+
this.commands.push(cmd);
|
|
154
|
+
cmd.parent = this;
|
|
155
|
+
cmd.copyInheritedSettings(this);
|
|
156
|
+
|
|
157
|
+
if (desc) return this;
|
|
158
|
+
return cmd;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Factory routine to create a new unattached command.
|
|
163
|
+
*
|
|
164
|
+
* See .command() for creating an attached subcommand, which uses this routine to
|
|
165
|
+
* create the command. You can override createCommand to customise subcommands.
|
|
166
|
+
*
|
|
167
|
+
* @param {string} [name]
|
|
168
|
+
* @return {Command} new command
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
createCommand(name) {
|
|
172
|
+
return new Command(name);
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* You can customise the help with a subclass of Help by overriding createHelp,
|
|
177
|
+
* or by overriding Help properties using configureHelp().
|
|
178
|
+
*
|
|
179
|
+
* @return {Help}
|
|
180
|
+
*/
|
|
181
|
+
|
|
182
|
+
createHelp() {
|
|
183
|
+
return Object.assign(new Help(), this.configureHelp());
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* You can customise the help by overriding Help properties using configureHelp(),
|
|
188
|
+
* or with a subclass of Help by overriding createHelp().
|
|
189
|
+
*
|
|
190
|
+
* @param {Object} [configuration] - configuration options
|
|
191
|
+
* @return {Command|Object} `this` command for chaining, or stored configuration
|
|
192
|
+
*/
|
|
193
|
+
|
|
194
|
+
configureHelp(configuration) {
|
|
195
|
+
if (configuration === undefined) return this._helpConfiguration;
|
|
196
|
+
|
|
197
|
+
this._helpConfiguration = configuration;
|
|
198
|
+
return this;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The default output goes to stdout and stderr. You can customise this for special
|
|
203
|
+
* applications. You can also customise the display of errors by overriding outputError.
|
|
204
|
+
*
|
|
205
|
+
* The configuration properties are all functions:
|
|
206
|
+
*
|
|
207
|
+
* // functions to change where being written, stdout and stderr
|
|
208
|
+
* writeOut(str)
|
|
209
|
+
* writeErr(str)
|
|
210
|
+
* // matching functions to specify width for wrapping help
|
|
211
|
+
* getOutHelpWidth()
|
|
212
|
+
* getErrHelpWidth()
|
|
213
|
+
* // functions based on what is being written out
|
|
214
|
+
* outputError(str, write) // used for displaying errors, and not used for displaying help
|
|
215
|
+
*
|
|
216
|
+
* @param {Object} [configuration] - configuration options
|
|
217
|
+
* @return {Command|Object} `this` command for chaining, or stored configuration
|
|
218
|
+
*/
|
|
219
|
+
|
|
220
|
+
configureOutput(configuration) {
|
|
221
|
+
if (configuration === undefined) return this._outputConfiguration;
|
|
222
|
+
|
|
223
|
+
Object.assign(this._outputConfiguration, configuration);
|
|
224
|
+
return this;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Display the help or a custom message after an error occurs.
|
|
229
|
+
*
|
|
230
|
+
* @param {boolean|string} [displayHelp]
|
|
231
|
+
* @return {Command} `this` command for chaining
|
|
232
|
+
*/
|
|
233
|
+
showHelpAfterError(displayHelp = true) {
|
|
234
|
+
if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;
|
|
235
|
+
this._showHelpAfterError = displayHelp;
|
|
236
|
+
return this;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Display suggestion of similar commands for unknown commands, or options for unknown options.
|
|
241
|
+
*
|
|
242
|
+
* @param {boolean} [displaySuggestion]
|
|
243
|
+
* @return {Command} `this` command for chaining
|
|
244
|
+
*/
|
|
245
|
+
showSuggestionAfterError(displaySuggestion = true) {
|
|
246
|
+
this._showSuggestionAfterError = !!displaySuggestion;
|
|
247
|
+
return this;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Add a prepared subcommand.
|
|
252
|
+
*
|
|
253
|
+
* See .command() for creating an attached subcommand which inherits settings from its parent.
|
|
254
|
+
*
|
|
255
|
+
* @param {Command} cmd - new subcommand
|
|
256
|
+
* @param {Object} [opts] - configuration options
|
|
257
|
+
* @return {Command} `this` command for chaining
|
|
258
|
+
*/
|
|
259
|
+
|
|
260
|
+
addCommand(cmd, opts) {
|
|
261
|
+
if (!cmd._name) throw new Error('Command passed to .addCommand() must have a name');
|
|
262
|
+
|
|
263
|
+
// To keep things simple, block automatic name generation for deeply nested executables.
|
|
264
|
+
// Fail fast and detect when adding rather than later when parsing.
|
|
265
|
+
function checkExplicitNames(commandArray) {
|
|
266
|
+
commandArray.forEach((cmd) => {
|
|
267
|
+
if (cmd._executableHandler && !cmd._executableFile) {
|
|
268
|
+
throw new Error(`Must specify executableFile for deeply nested executable: ${cmd.name()}`);
|
|
269
|
+
}
|
|
270
|
+
checkExplicitNames(cmd.commands);
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
checkExplicitNames(cmd.commands);
|
|
274
|
+
|
|
275
|
+
opts = opts || {};
|
|
276
|
+
if (opts.isDefault) this._defaultCommandName = cmd._name;
|
|
277
|
+
if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation
|
|
278
|
+
|
|
279
|
+
this.commands.push(cmd);
|
|
280
|
+
cmd.parent = this;
|
|
281
|
+
return this;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Factory routine to create a new unattached argument.
|
|
286
|
+
*
|
|
287
|
+
* See .argument() for creating an attached argument, which uses this routine to
|
|
288
|
+
* create the argument. You can override createArgument to return a custom argument.
|
|
289
|
+
*
|
|
290
|
+
* @param {string} name
|
|
291
|
+
* @param {string} [description]
|
|
292
|
+
* @return {Argument} new argument
|
|
293
|
+
*/
|
|
294
|
+
|
|
295
|
+
createArgument(name, description) {
|
|
296
|
+
return new Argument(name, description);
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Define argument syntax for command.
|
|
301
|
+
*
|
|
302
|
+
* The default is that the argument is required, and you can explicitly
|
|
303
|
+
* indicate this with <> around the name. Put [] around the name for an optional argument.
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
* program.argument('<input-file>');
|
|
307
|
+
* program.argument('[output-file]');
|
|
308
|
+
*
|
|
309
|
+
* @param {string} name
|
|
310
|
+
* @param {string} [description]
|
|
311
|
+
* @param {Function|*} [fn] - custom argument processing function
|
|
312
|
+
* @param {*} [defaultValue]
|
|
313
|
+
* @return {Command} `this` command for chaining
|
|
314
|
+
*/
|
|
315
|
+
argument(name, description, fn, defaultValue) {
|
|
316
|
+
const argument = this.createArgument(name, description);
|
|
317
|
+
if (typeof fn === 'function') {
|
|
318
|
+
argument.default(defaultValue).argParser(fn);
|
|
319
|
+
} else {
|
|
320
|
+
argument.default(fn);
|
|
321
|
+
}
|
|
322
|
+
this.addArgument(argument);
|
|
323
|
+
return this;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Define argument syntax for command, adding multiple at once (without descriptions).
|
|
328
|
+
*
|
|
329
|
+
* See also .argument().
|
|
330
|
+
*
|
|
331
|
+
* @example
|
|
332
|
+
* program.arguments('<cmd> [env]');
|
|
333
|
+
*
|
|
334
|
+
* @param {string} names
|
|
335
|
+
* @return {Command} `this` command for chaining
|
|
336
|
+
*/
|
|
337
|
+
|
|
338
|
+
arguments(names) {
|
|
339
|
+
names.split(/ +/).forEach((detail) => {
|
|
340
|
+
this.argument(detail);
|
|
341
|
+
});
|
|
342
|
+
return this;
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Define argument syntax for command, adding a prepared argument.
|
|
347
|
+
*
|
|
348
|
+
* @param {Argument} argument
|
|
349
|
+
* @return {Command} `this` command for chaining
|
|
350
|
+
*/
|
|
351
|
+
addArgument(argument) {
|
|
352
|
+
const previousArgument = this._args.slice(-1)[0];
|
|
353
|
+
if (previousArgument && previousArgument.variadic) {
|
|
354
|
+
throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);
|
|
355
|
+
}
|
|
356
|
+
if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {
|
|
357
|
+
throw new Error(`a default value for a required argument is never used: '${argument.name()}'`);
|
|
358
|
+
}
|
|
359
|
+
this._args.push(argument);
|
|
360
|
+
return this;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Override default decision whether to add implicit help command.
|
|
365
|
+
*
|
|
366
|
+
* addHelpCommand() // force on
|
|
367
|
+
* addHelpCommand(false); // force off
|
|
368
|
+
* addHelpCommand('help [cmd]', 'display help for [cmd]'); // force on with custom details
|
|
369
|
+
*
|
|
370
|
+
* @return {Command} `this` command for chaining
|
|
371
|
+
*/
|
|
372
|
+
|
|
373
|
+
addHelpCommand(enableOrNameAndArgs, description) {
|
|
374
|
+
if (enableOrNameAndArgs === false) {
|
|
375
|
+
this._addImplicitHelpCommand = false;
|
|
376
|
+
} else {
|
|
377
|
+
this._addImplicitHelpCommand = true;
|
|
378
|
+
if (typeof enableOrNameAndArgs === 'string') {
|
|
379
|
+
this._helpCommandName = enableOrNameAndArgs.split(' ')[0];
|
|
380
|
+
this._helpCommandnameAndArgs = enableOrNameAndArgs;
|
|
381
|
+
}
|
|
382
|
+
this._helpCommandDescription = description || this._helpCommandDescription;
|
|
383
|
+
}
|
|
384
|
+
return this;
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* @return {boolean}
|
|
389
|
+
* @api private
|
|
390
|
+
*/
|
|
391
|
+
|
|
392
|
+
_hasImplicitHelpCommand() {
|
|
393
|
+
if (this._addImplicitHelpCommand === undefined) {
|
|
394
|
+
return this.commands.length && !this._actionHandler && !this._findCommand('help');
|
|
395
|
+
}
|
|
396
|
+
return this._addImplicitHelpCommand;
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Add hook for life cycle event.
|
|
401
|
+
*
|
|
402
|
+
* @param {string} event
|
|
403
|
+
* @param {Function} listener
|
|
404
|
+
* @return {Command} `this` command for chaining
|
|
405
|
+
*/
|
|
406
|
+
|
|
407
|
+
hook(event, listener) {
|
|
408
|
+
const allowedValues = ['preAction', 'postAction'];
|
|
409
|
+
if (!allowedValues.includes(event)) {
|
|
410
|
+
throw new Error(`Unexpected value for event passed to hook : '${event}'.
|
|
411
|
+
Expecting one of '${allowedValues.join("', '")}'`);
|
|
412
|
+
}
|
|
413
|
+
if (this._lifeCycleHooks[event]) {
|
|
414
|
+
this._lifeCycleHooks[event].push(listener);
|
|
415
|
+
} else {
|
|
416
|
+
this._lifeCycleHooks[event] = [listener];
|
|
417
|
+
}
|
|
418
|
+
return this;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Register callback to use as replacement for calling process.exit.
|
|
423
|
+
*
|
|
424
|
+
* @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing
|
|
425
|
+
* @return {Command} `this` command for chaining
|
|
426
|
+
*/
|
|
427
|
+
|
|
428
|
+
exitOverride(fn) {
|
|
429
|
+
if (fn) {
|
|
430
|
+
this._exitCallback = fn;
|
|
431
|
+
} else {
|
|
432
|
+
this._exitCallback = (err) => {
|
|
433
|
+
if (err.code !== 'commander.executeSubCommandAsync') {
|
|
434
|
+
throw err;
|
|
435
|
+
} else {
|
|
436
|
+
// Async callback from spawn events, not useful to throw.
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
return this;
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Call process.exit, and _exitCallback if defined.
|
|
445
|
+
*
|
|
446
|
+
* @param {number} exitCode exit code for using with process.exit
|
|
447
|
+
* @param {string} code an id string representing the error
|
|
448
|
+
* @param {string} message human-readable description of the error
|
|
449
|
+
* @return never
|
|
450
|
+
* @api private
|
|
451
|
+
*/
|
|
452
|
+
|
|
453
|
+
_exit(exitCode, code, message) {
|
|
454
|
+
if (this._exitCallback) {
|
|
455
|
+
this._exitCallback(new CommanderError(exitCode, code, message));
|
|
456
|
+
// Expecting this line is not reached.
|
|
457
|
+
}
|
|
458
|
+
process.exit(exitCode);
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Register callback `fn` for the command.
|
|
463
|
+
*
|
|
464
|
+
* @example
|
|
465
|
+
* program
|
|
466
|
+
* .command('serve')
|
|
467
|
+
* .description('start service')
|
|
468
|
+
* .action(function() {
|
|
469
|
+
* // do work here
|
|
470
|
+
* });
|
|
471
|
+
*
|
|
472
|
+
* @param {Function} fn
|
|
473
|
+
* @return {Command} `this` command for chaining
|
|
474
|
+
*/
|
|
475
|
+
|
|
476
|
+
action(fn) {
|
|
477
|
+
const listener = (args) => {
|
|
478
|
+
// The .action callback takes an extra parameter which is the command or options.
|
|
479
|
+
const expectedArgsCount = this._args.length;
|
|
480
|
+
const actionArgs = args.slice(0, expectedArgsCount);
|
|
481
|
+
if (this._storeOptionsAsProperties) {
|
|
482
|
+
actionArgs[expectedArgsCount] = this; // backwards compatible "options"
|
|
483
|
+
} else {
|
|
484
|
+
actionArgs[expectedArgsCount] = this.opts();
|
|
485
|
+
}
|
|
486
|
+
actionArgs.push(this);
|
|
487
|
+
|
|
488
|
+
return fn.apply(this, actionArgs);
|
|
489
|
+
};
|
|
490
|
+
this._actionHandler = listener;
|
|
491
|
+
return this;
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Factory routine to create a new unattached option.
|
|
496
|
+
*
|
|
497
|
+
* See .option() for creating an attached option, which uses this routine to
|
|
498
|
+
* create the option. You can override createOption to return a custom option.
|
|
499
|
+
*
|
|
500
|
+
* @param {string} flags
|
|
501
|
+
* @param {string} [description]
|
|
502
|
+
* @return {Option} new option
|
|
503
|
+
*/
|
|
504
|
+
|
|
505
|
+
createOption(flags, description) {
|
|
506
|
+
return new Option(flags, description);
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Add an option.
|
|
511
|
+
*
|
|
512
|
+
* @param {Option} option
|
|
513
|
+
* @return {Command} `this` command for chaining
|
|
514
|
+
*/
|
|
515
|
+
addOption(option) {
|
|
516
|
+
const oname = option.name();
|
|
517
|
+
const name = option.attributeName();
|
|
518
|
+
|
|
519
|
+
let defaultValue = option.defaultValue;
|
|
520
|
+
|
|
521
|
+
// preassign default value for --no-*, [optional], <required>, or plain flag if boolean value
|
|
522
|
+
if (option.negate || option.optional || option.required || typeof defaultValue === 'boolean') {
|
|
523
|
+
// when --no-foo we make sure default is true, unless a --foo option is already defined
|
|
524
|
+
if (option.negate) {
|
|
525
|
+
const positiveLongFlag = option.long.replace(/^--no-/, '--');
|
|
526
|
+
defaultValue = this._findOption(positiveLongFlag) ? this.getOptionValue(name) : true;
|
|
527
|
+
}
|
|
528
|
+
// preassign only if we have a default
|
|
529
|
+
if (defaultValue !== undefined) {
|
|
530
|
+
this.setOptionValueWithSource(name, defaultValue, 'default');
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
// register the option
|
|
535
|
+
this.options.push(option);
|
|
536
|
+
|
|
537
|
+
// handler for cli and env supplied values
|
|
538
|
+
const handleOptionValue = (val, invalidValueMessage, valueSource) => {
|
|
539
|
+
// Note: using closure to access lots of lexical scoped variables.
|
|
540
|
+
const oldValue = this.getOptionValue(name);
|
|
541
|
+
|
|
542
|
+
// custom processing
|
|
543
|
+
if (val !== null && option.parseArg) {
|
|
544
|
+
try {
|
|
545
|
+
val = option.parseArg(val, oldValue === undefined ? defaultValue : oldValue);
|
|
546
|
+
} catch (err) {
|
|
547
|
+
if (err.code === 'commander.invalidArgument') {
|
|
548
|
+
const message = `${invalidValueMessage} ${err.message}`;
|
|
549
|
+
this._displayError(err.exitCode, err.code, message);
|
|
550
|
+
}
|
|
551
|
+
throw err;
|
|
552
|
+
}
|
|
553
|
+
} else if (val !== null && option.variadic) {
|
|
554
|
+
val = option._concatValue(val, oldValue);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// unassigned or boolean value
|
|
558
|
+
if (typeof oldValue === 'boolean' || typeof oldValue === 'undefined') {
|
|
559
|
+
// if no value, negate false, and we have a default, then use it!
|
|
560
|
+
if (val == null) {
|
|
561
|
+
this.setOptionValueWithSource(name, option.negate ? false : defaultValue || true, valueSource);
|
|
562
|
+
} else {
|
|
563
|
+
this.setOptionValueWithSource(name, val, valueSource);
|
|
564
|
+
}
|
|
565
|
+
} else if (val !== null) {
|
|
566
|
+
// reassign
|
|
567
|
+
this.setOptionValueWithSource(name, option.negate ? false : val, valueSource);
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
this.on('option:' + oname, (val) => {
|
|
572
|
+
const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;
|
|
573
|
+
handleOptionValue(val, invalidValueMessage, 'cli');
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
if (option.envVar) {
|
|
577
|
+
this.on('optionEnv:' + oname, (val) => {
|
|
578
|
+
const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;
|
|
579
|
+
handleOptionValue(val, invalidValueMessage, 'env');
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
return this;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Internal implementation shared by .option() and .requiredOption()
|
|
588
|
+
*
|
|
589
|
+
* @api private
|
|
590
|
+
*/
|
|
591
|
+
_optionEx(config, flags, description, fn, defaultValue) {
|
|
592
|
+
const option = this.createOption(flags, description);
|
|
593
|
+
option.makeOptionMandatory(!!config.mandatory);
|
|
594
|
+
if (typeof fn === 'function') {
|
|
595
|
+
option.default(defaultValue).argParser(fn);
|
|
596
|
+
} else if (fn instanceof RegExp) {
|
|
597
|
+
// deprecated
|
|
598
|
+
const regex = fn;
|
|
599
|
+
fn = (val, def) => {
|
|
600
|
+
const m = regex.exec(val);
|
|
601
|
+
return m ? m[0] : def;
|
|
602
|
+
};
|
|
603
|
+
option.default(defaultValue).argParser(fn);
|
|
604
|
+
} else {
|
|
605
|
+
option.default(fn);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
return this.addOption(option);
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Define option with `flags`, `description` and optional
|
|
613
|
+
* coercion `fn`.
|
|
614
|
+
*
|
|
615
|
+
* The `flags` string contains the short and/or long flags,
|
|
616
|
+
* separated by comma, a pipe or space. The following are all valid
|
|
617
|
+
* all will output this way when `--help` is used.
|
|
618
|
+
*
|
|
619
|
+
* "-p, --pepper"
|
|
620
|
+
* "-p|--pepper"
|
|
621
|
+
* "-p --pepper"
|
|
622
|
+
*
|
|
623
|
+
* @example
|
|
624
|
+
* // simple boolean defaulting to undefined
|
|
625
|
+
* program.option('-p, --pepper', 'add pepper');
|
|
626
|
+
*
|
|
627
|
+
* program.pepper
|
|
628
|
+
* // => undefined
|
|
629
|
+
*
|
|
630
|
+
* --pepper
|
|
631
|
+
* program.pepper
|
|
632
|
+
* // => true
|
|
633
|
+
*
|
|
634
|
+
* // simple boolean defaulting to true (unless non-negated option is also defined)
|
|
635
|
+
* program.option('-C, --no-cheese', 'remove cheese');
|
|
636
|
+
*
|
|
637
|
+
* program.cheese
|
|
638
|
+
* // => true
|
|
639
|
+
*
|
|
640
|
+
* --no-cheese
|
|
641
|
+
* program.cheese
|
|
642
|
+
* // => false
|
|
643
|
+
*
|
|
644
|
+
* // required argument
|
|
645
|
+
* program.option('-C, --chdir <path>', 'change the working directory');
|
|
646
|
+
*
|
|
647
|
+
* --chdir /tmp
|
|
648
|
+
* program.chdir
|
|
649
|
+
* // => "/tmp"
|
|
650
|
+
*
|
|
651
|
+
* // optional argument
|
|
652
|
+
* program.option('-c, --cheese [type]', 'add cheese [marble]');
|
|
653
|
+
*
|
|
654
|
+
* @param {string} flags
|
|
655
|
+
* @param {string} [description]
|
|
656
|
+
* @param {Function|*} [fn] - custom option processing function or default value
|
|
657
|
+
* @param {*} [defaultValue]
|
|
658
|
+
* @return {Command} `this` command for chaining
|
|
659
|
+
*/
|
|
660
|
+
|
|
661
|
+
option(flags, description, fn, defaultValue) {
|
|
662
|
+
return this._optionEx({}, flags, description, fn, defaultValue);
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* Add a required option which must have a value after parsing. This usually means
|
|
667
|
+
* the option must be specified on the command line. (Otherwise the same as .option().)
|
|
668
|
+
*
|
|
669
|
+
* The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.
|
|
670
|
+
*
|
|
671
|
+
* @param {string} flags
|
|
672
|
+
* @param {string} [description]
|
|
673
|
+
* @param {Function|*} [fn] - custom option processing function or default value
|
|
674
|
+
* @param {*} [defaultValue]
|
|
675
|
+
* @return {Command} `this` command for chaining
|
|
676
|
+
*/
|
|
677
|
+
|
|
678
|
+
requiredOption(flags, description, fn, defaultValue) {
|
|
679
|
+
return this._optionEx({ mandatory: true }, flags, description, fn, defaultValue);
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Alter parsing of short flags with optional values.
|
|
684
|
+
*
|
|
685
|
+
* @example
|
|
686
|
+
* // for `.option('-f,--flag [value]'):
|
|
687
|
+
* program.combineFlagAndOptionalValue(true); // `-f80` is treated like `--flag=80`, this is the default behaviour
|
|
688
|
+
* program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`
|
|
689
|
+
*
|
|
690
|
+
* @param {Boolean} [combine=true] - if `true` or omitted, an optional value can be specified directly after the flag.
|
|
691
|
+
*/
|
|
692
|
+
combineFlagAndOptionalValue(combine = true) {
|
|
693
|
+
this._combineFlagAndOptionalValue = !!combine;
|
|
694
|
+
return this;
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* Allow unknown options on the command line.
|
|
699
|
+
*
|
|
700
|
+
* @param {Boolean} [allowUnknown=true] - if `true` or omitted, no error will be thrown
|
|
701
|
+
* for unknown options.
|
|
702
|
+
*/
|
|
703
|
+
allowUnknownOption(allowUnknown = true) {
|
|
704
|
+
this._allowUnknownOption = !!allowUnknown;
|
|
705
|
+
return this;
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* Allow excess command-arguments on the command line. Pass false to make excess arguments an error.
|
|
710
|
+
*
|
|
711
|
+
* @param {Boolean} [allowExcess=true] - if `true` or omitted, no error will be thrown
|
|
712
|
+
* for excess arguments.
|
|
713
|
+
*/
|
|
714
|
+
allowExcessArguments(allowExcess = true) {
|
|
715
|
+
this._allowExcessArguments = !!allowExcess;
|
|
716
|
+
return this;
|
|
717
|
+
};
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* Enable positional options. Positional means global options are specified before subcommands which lets
|
|
721
|
+
* subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.
|
|
722
|
+
* The default behaviour is non-positional and global options may appear anywhere on the command line.
|
|
723
|
+
*
|
|
724
|
+
* @param {Boolean} [positional=true]
|
|
725
|
+
*/
|
|
726
|
+
enablePositionalOptions(positional = true) {
|
|
727
|
+
this._enablePositionalOptions = !!positional;
|
|
728
|
+
return this;
|
|
729
|
+
};
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Pass through options that come after command-arguments rather than treat them as command-options,
|
|
733
|
+
* so actual command-options come before command-arguments. Turning this on for a subcommand requires
|
|
734
|
+
* positional options to have been enabled on the program (parent commands).
|
|
735
|
+
* The default behaviour is non-positional and options may appear before or after command-arguments.
|
|
736
|
+
*
|
|
737
|
+
* @param {Boolean} [passThrough=true]
|
|
738
|
+
* for unknown options.
|
|
739
|
+
*/
|
|
740
|
+
passThroughOptions(passThrough = true) {
|
|
741
|
+
this._passThroughOptions = !!passThrough;
|
|
742
|
+
if (!!this.parent && passThrough && !this.parent._enablePositionalOptions) {
|
|
743
|
+
throw new Error('passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)');
|
|
744
|
+
}
|
|
745
|
+
return this;
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Whether to store option values as properties on command object,
|
|
750
|
+
* or store separately (specify false). In both cases the option values can be accessed using .opts().
|
|
751
|
+
*
|
|
752
|
+
* @param {boolean} [storeAsProperties=true]
|
|
753
|
+
* @return {Command} `this` command for chaining
|
|
754
|
+
*/
|
|
755
|
+
|
|
756
|
+
storeOptionsAsProperties(storeAsProperties = true) {
|
|
757
|
+
this._storeOptionsAsProperties = !!storeAsProperties;
|
|
758
|
+
if (this.options.length) {
|
|
759
|
+
throw new Error('call .storeOptionsAsProperties() before adding options');
|
|
760
|
+
}
|
|
761
|
+
return this;
|
|
762
|
+
};
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* Retrieve option value.
|
|
766
|
+
*
|
|
767
|
+
* @param {string} key
|
|
768
|
+
* @return {Object} value
|
|
769
|
+
*/
|
|
770
|
+
|
|
771
|
+
getOptionValue(key) {
|
|
772
|
+
if (this._storeOptionsAsProperties) {
|
|
773
|
+
return this[key];
|
|
774
|
+
}
|
|
775
|
+
return this._optionValues[key];
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* Store option value.
|
|
780
|
+
*
|
|
781
|
+
* @param {string} key
|
|
782
|
+
* @param {Object} value
|
|
783
|
+
* @return {Command} `this` command for chaining
|
|
784
|
+
*/
|
|
785
|
+
|
|
786
|
+
setOptionValue(key, value) {
|
|
787
|
+
if (this._storeOptionsAsProperties) {
|
|
788
|
+
this[key] = value;
|
|
789
|
+
} else {
|
|
790
|
+
this._optionValues[key] = value;
|
|
791
|
+
}
|
|
792
|
+
return this;
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* Store option value and where the value came from.
|
|
797
|
+
*
|
|
798
|
+
* @param {string} key
|
|
799
|
+
* @param {Object} value
|
|
800
|
+
* @param {string} source - expected values are default/config/env/cli
|
|
801
|
+
* @return {Command} `this` command for chaining
|
|
802
|
+
*/
|
|
803
|
+
|
|
804
|
+
setOptionValueWithSource(key, value, source) {
|
|
805
|
+
this.setOptionValue(key, value);
|
|
806
|
+
this._optionValueSources[key] = source;
|
|
807
|
+
return this;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* Get source of option value.
|
|
812
|
+
* Expected values are default | config | env | cli
|
|
813
|
+
*
|
|
814
|
+
* @param {string} key
|
|
815
|
+
* @return {string}
|
|
816
|
+
*/
|
|
817
|
+
|
|
818
|
+
getOptionValueSource(key) {
|
|
819
|
+
return this._optionValueSources[key];
|
|
820
|
+
};
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* Get user arguments implied or explicit arguments.
|
|
824
|
+
* Side-effects: set _scriptPath if args included application, and use that to set implicit command name.
|
|
825
|
+
*
|
|
826
|
+
* @api private
|
|
827
|
+
*/
|
|
828
|
+
|
|
829
|
+
_prepareUserArgs(argv, parseOptions) {
|
|
830
|
+
if (argv !== undefined && !Array.isArray(argv)) {
|
|
831
|
+
throw new Error('first parameter to parse must be array or undefined');
|
|
832
|
+
}
|
|
833
|
+
parseOptions = parseOptions || {};
|
|
834
|
+
|
|
835
|
+
// Default to using process.argv
|
|
836
|
+
if (argv === undefined) {
|
|
837
|
+
argv = process.argv;
|
|
838
|
+
// @ts-ignore: unknown property
|
|
839
|
+
if (process.versions && process.versions.electron) {
|
|
840
|
+
parseOptions.from = 'electron';
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
this.rawArgs = argv.slice();
|
|
844
|
+
|
|
845
|
+
// make it a little easier for callers by supporting various argv conventions
|
|
846
|
+
let userArgs;
|
|
847
|
+
switch (parseOptions.from) {
|
|
848
|
+
case undefined:
|
|
849
|
+
case 'node':
|
|
850
|
+
this._scriptPath = argv[1];
|
|
851
|
+
userArgs = argv.slice(2);
|
|
852
|
+
break;
|
|
853
|
+
case 'electron':
|
|
854
|
+
// @ts-ignore: unknown property
|
|
855
|
+
if (process.defaultApp) {
|
|
856
|
+
this._scriptPath = argv[1];
|
|
857
|
+
userArgs = argv.slice(2);
|
|
858
|
+
} else {
|
|
859
|
+
userArgs = argv.slice(1);
|
|
860
|
+
}
|
|
861
|
+
break;
|
|
862
|
+
case 'user':
|
|
863
|
+
userArgs = argv.slice(0);
|
|
864
|
+
break;
|
|
865
|
+
default:
|
|
866
|
+
throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`);
|
|
867
|
+
}
|
|
868
|
+
if (!this._scriptPath && require.main) {
|
|
869
|
+
this._scriptPath = require.main.filename;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
// Guess name, used in usage in help.
|
|
873
|
+
this._name = this._name || (this._scriptPath && path.basename(this._scriptPath, path.extname(this._scriptPath)));
|
|
874
|
+
|
|
875
|
+
return userArgs;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
/**
|
|
879
|
+
* Parse `argv`, setting options and invoking commands when defined.
|
|
880
|
+
*
|
|
881
|
+
* The default expectation is that the arguments are from node and have the application as argv[0]
|
|
882
|
+
* and the script being run in argv[1], with user parameters after that.
|
|
883
|
+
*
|
|
884
|
+
* @example
|
|
885
|
+
* program.parse(process.argv);
|
|
886
|
+
* program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions
|
|
887
|
+
* program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
|
888
|
+
*
|
|
889
|
+
* @param {string[]} [argv] - optional, defaults to process.argv
|
|
890
|
+
* @param {Object} [parseOptions] - optionally specify style of options with from: node/user/electron
|
|
891
|
+
* @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron'
|
|
892
|
+
* @return {Command} `this` command for chaining
|
|
893
|
+
*/
|
|
894
|
+
|
|
895
|
+
parse(argv, parseOptions) {
|
|
896
|
+
const userArgs = this._prepareUserArgs(argv, parseOptions);
|
|
897
|
+
this._parseCommand([], userArgs);
|
|
898
|
+
|
|
899
|
+
return this;
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* Parse `argv`, setting options and invoking commands when defined.
|
|
904
|
+
*
|
|
905
|
+
* Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise.
|
|
906
|
+
*
|
|
907
|
+
* The default expectation is that the arguments are from node and have the application as argv[0]
|
|
908
|
+
* and the script being run in argv[1], with user parameters after that.
|
|
909
|
+
*
|
|
910
|
+
* @example
|
|
911
|
+
* await program.parseAsync(process.argv);
|
|
912
|
+
* await program.parseAsync(); // implicitly use process.argv and auto-detect node vs electron conventions
|
|
913
|
+
* await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
|
914
|
+
*
|
|
915
|
+
* @param {string[]} [argv]
|
|
916
|
+
* @param {Object} [parseOptions]
|
|
917
|
+
* @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron'
|
|
918
|
+
* @return {Promise}
|
|
919
|
+
*/
|
|
920
|
+
|
|
921
|
+
async parseAsync(argv, parseOptions) {
|
|
922
|
+
const userArgs = this._prepareUserArgs(argv, parseOptions);
|
|
923
|
+
await this._parseCommand([], userArgs);
|
|
924
|
+
|
|
925
|
+
return this;
|
|
926
|
+
};
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* Execute a sub-command executable.
|
|
930
|
+
*
|
|
931
|
+
* @api private
|
|
932
|
+
*/
|
|
933
|
+
|
|
934
|
+
_executeSubCommand(subcommand, args) {
|
|
935
|
+
args = args.slice();
|
|
936
|
+
let launchWithNode = false; // Use node for source targets so do not need to get permissions correct, and on Windows.
|
|
937
|
+
const sourceExt = ['.js', '.ts', '.tsx', '.mjs', '.cjs'];
|
|
938
|
+
|
|
939
|
+
// Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command.
|
|
940
|
+
this._checkForMissingMandatoryOptions();
|
|
941
|
+
|
|
942
|
+
// Want the entry script as the reference for command name and directory for searching for other files.
|
|
943
|
+
let scriptPath = this._scriptPath;
|
|
944
|
+
// Fallback in case not set, due to how Command created or called.
|
|
945
|
+
if (!scriptPath && require.main) {
|
|
946
|
+
scriptPath = require.main.filename;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
let baseDir;
|
|
950
|
+
try {
|
|
951
|
+
const resolvedLink = fs.realpathSync(scriptPath);
|
|
952
|
+
baseDir = path.dirname(resolvedLink);
|
|
953
|
+
} catch (e) {
|
|
954
|
+
baseDir = '.'; // dummy, probably not going to find executable!
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
// name of the subcommand, like `pm-install`
|
|
958
|
+
let bin = path.basename(scriptPath, path.extname(scriptPath)) + '-' + subcommand._name;
|
|
959
|
+
if (subcommand._executableFile) {
|
|
960
|
+
bin = subcommand._executableFile;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
const localBin = path.join(baseDir, bin);
|
|
964
|
+
if (fs.existsSync(localBin)) {
|
|
965
|
+
// prefer local `./<bin>` to bin in the $PATH
|
|
966
|
+
bin = localBin;
|
|
967
|
+
} else {
|
|
968
|
+
// Look for source files.
|
|
969
|
+
sourceExt.forEach((ext) => {
|
|
970
|
+
if (fs.existsSync(`${localBin}${ext}`)) {
|
|
971
|
+
bin = `${localBin}${ext}`;
|
|
972
|
+
}
|
|
973
|
+
});
|
|
974
|
+
}
|
|
975
|
+
launchWithNode = sourceExt.includes(path.extname(bin));
|
|
976
|
+
|
|
977
|
+
let proc;
|
|
978
|
+
if (process.platform !== 'win32') {
|
|
979
|
+
if (launchWithNode) {
|
|
980
|
+
args.unshift(bin);
|
|
981
|
+
// add executable arguments to spawn
|
|
982
|
+
args = incrementNodeInspectorPort(process.execArgv).concat(args);
|
|
983
|
+
|
|
984
|
+
proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });
|
|
985
|
+
} else {
|
|
986
|
+
proc = childProcess.spawn(bin, args, { stdio: 'inherit' });
|
|
987
|
+
}
|
|
988
|
+
} else {
|
|
989
|
+
args.unshift(bin);
|
|
990
|
+
// add executable arguments to spawn
|
|
991
|
+
args = incrementNodeInspectorPort(process.execArgv).concat(args);
|
|
992
|
+
proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];
|
|
996
|
+
signals.forEach((signal) => {
|
|
997
|
+
// @ts-ignore
|
|
998
|
+
process.on(signal, () => {
|
|
999
|
+
if (proc.killed === false && proc.exitCode === null) {
|
|
1000
|
+
proc.kill(signal);
|
|
1001
|
+
}
|
|
1002
|
+
});
|
|
1003
|
+
});
|
|
1004
|
+
|
|
1005
|
+
// By default terminate process when spawned process terminates.
|
|
1006
|
+
// Suppressing the exit if exitCallback defined is a bit messy and of limited use, but does allow process to stay running!
|
|
1007
|
+
const exitCallback = this._exitCallback;
|
|
1008
|
+
if (!exitCallback) {
|
|
1009
|
+
proc.on('close', process.exit.bind(process));
|
|
1010
|
+
} else {
|
|
1011
|
+
proc.on('close', () => {
|
|
1012
|
+
exitCallback(new CommanderError(process.exitCode || 0, 'commander.executeSubCommandAsync', '(close)'));
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
1015
|
+
proc.on('error', (err) => {
|
|
1016
|
+
// @ts-ignore
|
|
1017
|
+
if (err.code === 'ENOENT') {
|
|
1018
|
+
const executableMissing = `'${bin}' does not exist
|
|
1019
|
+
- if '${subcommand._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
1020
|
+
- if the default executable name is not suitable, use the executableFile option to supply a custom name`;
|
|
1021
|
+
throw new Error(executableMissing);
|
|
1022
|
+
// @ts-ignore
|
|
1023
|
+
} else if (err.code === 'EACCES') {
|
|
1024
|
+
throw new Error(`'${bin}' not executable`);
|
|
1025
|
+
}
|
|
1026
|
+
if (!exitCallback) {
|
|
1027
|
+
process.exit(1);
|
|
1028
|
+
} else {
|
|
1029
|
+
const wrappedError = new CommanderError(1, 'commander.executeSubCommandAsync', '(error)');
|
|
1030
|
+
wrappedError.nestedError = err;
|
|
1031
|
+
exitCallback(wrappedError);
|
|
1032
|
+
}
|
|
1033
|
+
});
|
|
1034
|
+
|
|
1035
|
+
// Store the reference to the child process
|
|
1036
|
+
this.runningCommand = proc;
|
|
1037
|
+
};
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* @api private
|
|
1041
|
+
*/
|
|
1042
|
+
|
|
1043
|
+
_dispatchSubcommand(commandName, operands, unknown) {
|
|
1044
|
+
const subCommand = this._findCommand(commandName);
|
|
1045
|
+
if (!subCommand) this.help({ error: true });
|
|
1046
|
+
|
|
1047
|
+
if (subCommand._executableHandler) {
|
|
1048
|
+
this._executeSubCommand(subCommand, operands.concat(unknown));
|
|
1049
|
+
} else {
|
|
1050
|
+
return subCommand._parseCommand(operands, unknown);
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
|
|
1054
|
+
/**
|
|
1055
|
+
* Check this.args against expected this._args.
|
|
1056
|
+
*
|
|
1057
|
+
* @api private
|
|
1058
|
+
*/
|
|
1059
|
+
|
|
1060
|
+
_checkNumberOfArguments() {
|
|
1061
|
+
// too few
|
|
1062
|
+
this._args.forEach((arg, i) => {
|
|
1063
|
+
if (arg.required && this.args[i] == null) {
|
|
1064
|
+
this.missingArgument(arg.name());
|
|
1065
|
+
}
|
|
1066
|
+
});
|
|
1067
|
+
// too many
|
|
1068
|
+
if (this._args.length > 0 && this._args[this._args.length - 1].variadic) {
|
|
1069
|
+
return;
|
|
1070
|
+
}
|
|
1071
|
+
if (this.args.length > this._args.length) {
|
|
1072
|
+
this._excessArguments(this.args);
|
|
1073
|
+
}
|
|
1074
|
+
};
|
|
1075
|
+
|
|
1076
|
+
/**
|
|
1077
|
+
* Process this.args using this._args and save as this.processedArgs!
|
|
1078
|
+
*
|
|
1079
|
+
* @api private
|
|
1080
|
+
*/
|
|
1081
|
+
|
|
1082
|
+
_processArguments() {
|
|
1083
|
+
const myParseArg = (argument, value, previous) => {
|
|
1084
|
+
// Extra processing for nice error message on parsing failure.
|
|
1085
|
+
let parsedValue = value;
|
|
1086
|
+
if (value !== null && argument.parseArg) {
|
|
1087
|
+
try {
|
|
1088
|
+
parsedValue = argument.parseArg(value, previous);
|
|
1089
|
+
} catch (err) {
|
|
1090
|
+
if (err.code === 'commander.invalidArgument') {
|
|
1091
|
+
const message = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'. ${err.message}`;
|
|
1092
|
+
this._displayError(err.exitCode, err.code, message);
|
|
1093
|
+
}
|
|
1094
|
+
throw err;
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
return parsedValue;
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1100
|
+
this._checkNumberOfArguments();
|
|
1101
|
+
|
|
1102
|
+
const processedArgs = [];
|
|
1103
|
+
this._args.forEach((declaredArg, index) => {
|
|
1104
|
+
let value = declaredArg.defaultValue;
|
|
1105
|
+
if (declaredArg.variadic) {
|
|
1106
|
+
// Collect together remaining arguments for passing together as an array.
|
|
1107
|
+
if (index < this.args.length) {
|
|
1108
|
+
value = this.args.slice(index);
|
|
1109
|
+
if (declaredArg.parseArg) {
|
|
1110
|
+
value = value.reduce((processed, v) => {
|
|
1111
|
+
return myParseArg(declaredArg, v, processed);
|
|
1112
|
+
}, declaredArg.defaultValue);
|
|
1113
|
+
}
|
|
1114
|
+
} else if (value === undefined) {
|
|
1115
|
+
value = [];
|
|
1116
|
+
}
|
|
1117
|
+
} else if (index < this.args.length) {
|
|
1118
|
+
value = this.args[index];
|
|
1119
|
+
if (declaredArg.parseArg) {
|
|
1120
|
+
value = myParseArg(declaredArg, value, declaredArg.defaultValue);
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
processedArgs[index] = value;
|
|
1124
|
+
});
|
|
1125
|
+
this.processedArgs = processedArgs;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
/**
|
|
1129
|
+
* Once we have a promise we chain, but call synchronously until then.
|
|
1130
|
+
*
|
|
1131
|
+
* @param {Promise|undefined} promise
|
|
1132
|
+
* @param {Function} fn
|
|
1133
|
+
* @return {Promise|undefined}
|
|
1134
|
+
* @api private
|
|
1135
|
+
*/
|
|
1136
|
+
|
|
1137
|
+
_chainOrCall(promise, fn) {
|
|
1138
|
+
// thenable
|
|
1139
|
+
if (promise && promise.then && typeof promise.then === 'function') {
|
|
1140
|
+
// already have a promise, chain callback
|
|
1141
|
+
return promise.then(() => fn());
|
|
1142
|
+
}
|
|
1143
|
+
// callback might return a promise
|
|
1144
|
+
return fn();
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
/**
|
|
1148
|
+
*
|
|
1149
|
+
* @param {Promise|undefined} promise
|
|
1150
|
+
* @param {string} event
|
|
1151
|
+
* @return {Promise|undefined}
|
|
1152
|
+
* @api private
|
|
1153
|
+
*/
|
|
1154
|
+
|
|
1155
|
+
_chainOrCallHooks(promise, event) {
|
|
1156
|
+
let result = promise;
|
|
1157
|
+
const hooks = [];
|
|
1158
|
+
getCommandAndParents(this)
|
|
1159
|
+
.reverse()
|
|
1160
|
+
.filter(cmd => cmd._lifeCycleHooks[event] !== undefined)
|
|
1161
|
+
.forEach(hookedCommand => {
|
|
1162
|
+
hookedCommand._lifeCycleHooks[event].forEach((callback) => {
|
|
1163
|
+
hooks.push({ hookedCommand, callback });
|
|
1164
|
+
});
|
|
1165
|
+
});
|
|
1166
|
+
if (event === 'postAction') {
|
|
1167
|
+
hooks.reverse();
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
hooks.forEach((hookDetail) => {
|
|
1171
|
+
result = this._chainOrCall(result, () => {
|
|
1172
|
+
return hookDetail.callback(hookDetail.hookedCommand, this);
|
|
1173
|
+
});
|
|
1174
|
+
});
|
|
1175
|
+
return result;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* Process arguments in context of this command.
|
|
1180
|
+
* Returns action result, in case it is a promise.
|
|
1181
|
+
*
|
|
1182
|
+
* @api private
|
|
1183
|
+
*/
|
|
1184
|
+
|
|
1185
|
+
_parseCommand(operands, unknown) {
|
|
1186
|
+
const parsed = this.parseOptions(unknown);
|
|
1187
|
+
this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env
|
|
1188
|
+
operands = operands.concat(parsed.operands);
|
|
1189
|
+
unknown = parsed.unknown;
|
|
1190
|
+
this.args = operands.concat(unknown);
|
|
1191
|
+
|
|
1192
|
+
if (operands && this._findCommand(operands[0])) {
|
|
1193
|
+
return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);
|
|
1194
|
+
}
|
|
1195
|
+
if (this._hasImplicitHelpCommand() && operands[0] === this._helpCommandName) {
|
|
1196
|
+
if (operands.length === 1) {
|
|
1197
|
+
this.help();
|
|
1198
|
+
}
|
|
1199
|
+
return this._dispatchSubcommand(operands[1], [], [this._helpLongFlag]);
|
|
1200
|
+
}
|
|
1201
|
+
if (this._defaultCommandName) {
|
|
1202
|
+
outputHelpIfRequested(this, unknown); // Run the help for default command from parent rather than passing to default command
|
|
1203
|
+
return this._dispatchSubcommand(this._defaultCommandName, operands, unknown);
|
|
1204
|
+
}
|
|
1205
|
+
if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) {
|
|
1206
|
+
// probably missing subcommand and no handler, user needs help (and exit)
|
|
1207
|
+
this.help({ error: true });
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
outputHelpIfRequested(this, parsed.unknown);
|
|
1211
|
+
this._checkForMissingMandatoryOptions();
|
|
1212
|
+
|
|
1213
|
+
// We do not always call this check to avoid masking a "better" error, like unknown command.
|
|
1214
|
+
const checkForUnknownOptions = () => {
|
|
1215
|
+
if (parsed.unknown.length > 0) {
|
|
1216
|
+
this.unknownOption(parsed.unknown[0]);
|
|
1217
|
+
}
|
|
1218
|
+
};
|
|
1219
|
+
|
|
1220
|
+
const commandEvent = `command:${this.name()}`;
|
|
1221
|
+
if (this._actionHandler) {
|
|
1222
|
+
checkForUnknownOptions();
|
|
1223
|
+
this._processArguments();
|
|
1224
|
+
|
|
1225
|
+
let actionResult;
|
|
1226
|
+
actionResult = this._chainOrCallHooks(actionResult, 'preAction');
|
|
1227
|
+
actionResult = this._chainOrCall(actionResult, () => this._actionHandler(this.processedArgs));
|
|
1228
|
+
if (this.parent) this.parent.emit(commandEvent, operands, unknown); // legacy
|
|
1229
|
+
actionResult = this._chainOrCallHooks(actionResult, 'postAction');
|
|
1230
|
+
return actionResult;
|
|
1231
|
+
}
|
|
1232
|
+
if (this.parent && this.parent.listenerCount(commandEvent)) {
|
|
1233
|
+
checkForUnknownOptions();
|
|
1234
|
+
this._processArguments();
|
|
1235
|
+
this.parent.emit(commandEvent, operands, unknown); // legacy
|
|
1236
|
+
} else if (operands.length) {
|
|
1237
|
+
if (this._findCommand('*')) { // legacy default command
|
|
1238
|
+
return this._dispatchSubcommand('*', operands, unknown);
|
|
1239
|
+
}
|
|
1240
|
+
if (this.listenerCount('command:*')) {
|
|
1241
|
+
// skip option check, emit event for possible misspelling suggestion
|
|
1242
|
+
this.emit('command:*', operands, unknown);
|
|
1243
|
+
} else if (this.commands.length) {
|
|
1244
|
+
this.unknownCommand();
|
|
1245
|
+
} else {
|
|
1246
|
+
checkForUnknownOptions();
|
|
1247
|
+
this._processArguments();
|
|
1248
|
+
}
|
|
1249
|
+
} else if (this.commands.length) {
|
|
1250
|
+
checkForUnknownOptions();
|
|
1251
|
+
// This command has subcommands and nothing hooked up at this level, so display help (and exit).
|
|
1252
|
+
this.help({ error: true });
|
|
1253
|
+
} else {
|
|
1254
|
+
checkForUnknownOptions();
|
|
1255
|
+
this._processArguments();
|
|
1256
|
+
// fall through for caller to handle after calling .parse()
|
|
1257
|
+
}
|
|
1258
|
+
};
|
|
1259
|
+
|
|
1260
|
+
/**
|
|
1261
|
+
* Find matching command.
|
|
1262
|
+
*
|
|
1263
|
+
* @api private
|
|
1264
|
+
*/
|
|
1265
|
+
_findCommand(name) {
|
|
1266
|
+
if (!name) return undefined;
|
|
1267
|
+
return this.commands.find(cmd => cmd._name === name || cmd._aliases.includes(name));
|
|
1268
|
+
};
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* Return an option matching `arg` if any.
|
|
1272
|
+
*
|
|
1273
|
+
* @param {string} arg
|
|
1274
|
+
* @return {Option}
|
|
1275
|
+
* @api private
|
|
1276
|
+
*/
|
|
1277
|
+
|
|
1278
|
+
_findOption(arg) {
|
|
1279
|
+
return this.options.find(option => option.is(arg));
|
|
1280
|
+
};
|
|
1281
|
+
|
|
1282
|
+
/**
|
|
1283
|
+
* Display an error message if a mandatory option does not have a value.
|
|
1284
|
+
* Lazy calling after checking for help flags from leaf subcommand.
|
|
1285
|
+
*
|
|
1286
|
+
* @api private
|
|
1287
|
+
*/
|
|
1288
|
+
|
|
1289
|
+
_checkForMissingMandatoryOptions() {
|
|
1290
|
+
// Walk up hierarchy so can call in subcommand after checking for displaying help.
|
|
1291
|
+
for (let cmd = this; cmd; cmd = cmd.parent) {
|
|
1292
|
+
cmd.options.forEach((anOption) => {
|
|
1293
|
+
if (anOption.mandatory && (cmd.getOptionValue(anOption.attributeName()) === undefined)) {
|
|
1294
|
+
cmd.missingMandatoryOptionValue(anOption);
|
|
1295
|
+
}
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
|
|
1300
|
+
/**
|
|
1301
|
+
* Parse options from `argv` removing known options,
|
|
1302
|
+
* and return argv split into operands and unknown arguments.
|
|
1303
|
+
*
|
|
1304
|
+
* Examples:
|
|
1305
|
+
*
|
|
1306
|
+
* argv => operands, unknown
|
|
1307
|
+
* --known kkk op => [op], []
|
|
1308
|
+
* op --known kkk => [op], []
|
|
1309
|
+
* sub --unknown uuu op => [sub], [--unknown uuu op]
|
|
1310
|
+
* sub -- --unknown uuu op => [sub --unknown uuu op], []
|
|
1311
|
+
*
|
|
1312
|
+
* @param {String[]} argv
|
|
1313
|
+
* @return {{operands: String[], unknown: String[]}}
|
|
1314
|
+
*/
|
|
1315
|
+
|
|
1316
|
+
parseOptions(argv) {
|
|
1317
|
+
const operands = []; // operands, not options or values
|
|
1318
|
+
const unknown = []; // first unknown option and remaining unknown args
|
|
1319
|
+
let dest = operands;
|
|
1320
|
+
const args = argv.slice();
|
|
1321
|
+
|
|
1322
|
+
function maybeOption(arg) {
|
|
1323
|
+
return arg.length > 1 && arg[0] === '-';
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
// parse options
|
|
1327
|
+
let activeVariadicOption = null;
|
|
1328
|
+
while (args.length) {
|
|
1329
|
+
const arg = args.shift();
|
|
1330
|
+
|
|
1331
|
+
// literal
|
|
1332
|
+
if (arg === '--') {
|
|
1333
|
+
if (dest === unknown) dest.push(arg);
|
|
1334
|
+
dest.push(...args);
|
|
1335
|
+
break;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
if (activeVariadicOption && !maybeOption(arg)) {
|
|
1339
|
+
this.emit(`option:${activeVariadicOption.name()}`, arg);
|
|
1340
|
+
continue;
|
|
1341
|
+
}
|
|
1342
|
+
activeVariadicOption = null;
|
|
1343
|
+
|
|
1344
|
+
if (maybeOption(arg)) {
|
|
1345
|
+
const option = this._findOption(arg);
|
|
1346
|
+
// recognised option, call listener to assign value with possible custom processing
|
|
1347
|
+
if (option) {
|
|
1348
|
+
if (option.required) {
|
|
1349
|
+
const value = args.shift();
|
|
1350
|
+
if (value === undefined) this.optionMissingArgument(option);
|
|
1351
|
+
this.emit(`option:${option.name()}`, value);
|
|
1352
|
+
} else if (option.optional) {
|
|
1353
|
+
let value = null;
|
|
1354
|
+
// historical behaviour is optional value is following arg unless an option
|
|
1355
|
+
if (args.length > 0 && !maybeOption(args[0])) {
|
|
1356
|
+
value = args.shift();
|
|
1357
|
+
}
|
|
1358
|
+
this.emit(`option:${option.name()}`, value);
|
|
1359
|
+
} else { // boolean flag
|
|
1360
|
+
this.emit(`option:${option.name()}`);
|
|
1361
|
+
}
|
|
1362
|
+
activeVariadicOption = option.variadic ? option : null;
|
|
1363
|
+
continue;
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
// Look for combo options following single dash, eat first one if known.
|
|
1368
|
+
if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {
|
|
1369
|
+
const option = this._findOption(`-${arg[1]}`);
|
|
1370
|
+
if (option) {
|
|
1371
|
+
if (option.required || (option.optional && this._combineFlagAndOptionalValue)) {
|
|
1372
|
+
// option with value following in same argument
|
|
1373
|
+
this.emit(`option:${option.name()}`, arg.slice(2));
|
|
1374
|
+
} else {
|
|
1375
|
+
// boolean option, emit and put back remainder of arg for further processing
|
|
1376
|
+
this.emit(`option:${option.name()}`);
|
|
1377
|
+
args.unshift(`-${arg.slice(2)}`);
|
|
1378
|
+
}
|
|
1379
|
+
continue;
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
// Look for known long flag with value, like --foo=bar
|
|
1384
|
+
if (/^--[^=]+=/.test(arg)) {
|
|
1385
|
+
const index = arg.indexOf('=');
|
|
1386
|
+
const option = this._findOption(arg.slice(0, index));
|
|
1387
|
+
if (option && (option.required || option.optional)) {
|
|
1388
|
+
this.emit(`option:${option.name()}`, arg.slice(index + 1));
|
|
1389
|
+
continue;
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
// Not a recognised option by this command.
|
|
1394
|
+
// Might be a command-argument, or subcommand option, or unknown option, or help command or option.
|
|
1395
|
+
|
|
1396
|
+
// An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.
|
|
1397
|
+
if (maybeOption(arg)) {
|
|
1398
|
+
dest = unknown;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
// If using positionalOptions, stop processing our options at subcommand.
|
|
1402
|
+
if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) {
|
|
1403
|
+
if (this._findCommand(arg)) {
|
|
1404
|
+
operands.push(arg);
|
|
1405
|
+
if (args.length > 0) unknown.push(...args);
|
|
1406
|
+
break;
|
|
1407
|
+
} else if (arg === this._helpCommandName && this._hasImplicitHelpCommand()) {
|
|
1408
|
+
operands.push(arg);
|
|
1409
|
+
if (args.length > 0) operands.push(...args);
|
|
1410
|
+
break;
|
|
1411
|
+
} else if (this._defaultCommandName) {
|
|
1412
|
+
unknown.push(arg);
|
|
1413
|
+
if (args.length > 0) unknown.push(...args);
|
|
1414
|
+
break;
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
// If using passThroughOptions, stop processing options at first command-argument.
|
|
1419
|
+
if (this._passThroughOptions) {
|
|
1420
|
+
dest.push(arg);
|
|
1421
|
+
if (args.length > 0) dest.push(...args);
|
|
1422
|
+
break;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
// add arg
|
|
1426
|
+
dest.push(arg);
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
return { operands, unknown };
|
|
1430
|
+
};
|
|
1431
|
+
|
|
1432
|
+
/**
|
|
1433
|
+
* Return an object containing options as key-value pairs
|
|
1434
|
+
*
|
|
1435
|
+
* @return {Object}
|
|
1436
|
+
*/
|
|
1437
|
+
opts() {
|
|
1438
|
+
if (this._storeOptionsAsProperties) {
|
|
1439
|
+
// Preserve original behaviour so backwards compatible when still using properties
|
|
1440
|
+
const result = {};
|
|
1441
|
+
const len = this.options.length;
|
|
1442
|
+
|
|
1443
|
+
for (let i = 0; i < len; i++) {
|
|
1444
|
+
const key = this.options[i].attributeName();
|
|
1445
|
+
result[key] = key === this._versionOptionName ? this._version : this[key];
|
|
1446
|
+
}
|
|
1447
|
+
return result;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
return this._optionValues;
|
|
1451
|
+
};
|
|
1452
|
+
|
|
1453
|
+
/**
|
|
1454
|
+
* Internal bottleneck for handling of parsing errors.
|
|
1455
|
+
*
|
|
1456
|
+
* @api private
|
|
1457
|
+
*/
|
|
1458
|
+
_displayError(exitCode, code, message) {
|
|
1459
|
+
this._outputConfiguration.outputError(`${message}\n`, this._outputConfiguration.writeErr);
|
|
1460
|
+
if (typeof this._showHelpAfterError === 'string') {
|
|
1461
|
+
this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`);
|
|
1462
|
+
} else if (this._showHelpAfterError) {
|
|
1463
|
+
this._outputConfiguration.writeErr('\n');
|
|
1464
|
+
this.outputHelp({ error: true });
|
|
1465
|
+
}
|
|
1466
|
+
this._exit(exitCode, code, message);
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
/**
|
|
1470
|
+
* Apply any option related environment variables, if option does
|
|
1471
|
+
* not have a value from cli or client code.
|
|
1472
|
+
*
|
|
1473
|
+
* @api private
|
|
1474
|
+
*/
|
|
1475
|
+
_parseOptionsEnv() {
|
|
1476
|
+
this.options.forEach((option) => {
|
|
1477
|
+
if (option.envVar && option.envVar in process.env) {
|
|
1478
|
+
const optionKey = option.attributeName();
|
|
1479
|
+
// Priority check. Do not overwrite cli or options from unknown source (client-code).
|
|
1480
|
+
if (this.getOptionValue(optionKey) === undefined || ['default', 'config', 'env'].includes(this.getOptionValueSource(optionKey))) {
|
|
1481
|
+
if (option.required || option.optional) { // option can take a value
|
|
1482
|
+
// keep very simple, optional always takes value
|
|
1483
|
+
this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);
|
|
1484
|
+
} else { // boolean
|
|
1485
|
+
// keep very simple, only care that envVar defined and not the value
|
|
1486
|
+
this.emit(`optionEnv:${option.name()}`);
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
/**
|
|
1494
|
+
* Argument `name` is missing.
|
|
1495
|
+
*
|
|
1496
|
+
* @param {string} name
|
|
1497
|
+
* @api private
|
|
1498
|
+
*/
|
|
1499
|
+
|
|
1500
|
+
missingArgument(name) {
|
|
1501
|
+
const message = `error: missing required argument '${name}'`;
|
|
1502
|
+
this._displayError(1, 'commander.missingArgument', message);
|
|
1503
|
+
};
|
|
1504
|
+
|
|
1505
|
+
/**
|
|
1506
|
+
* `Option` is missing an argument.
|
|
1507
|
+
*
|
|
1508
|
+
* @param {Option} option
|
|
1509
|
+
* @api private
|
|
1510
|
+
*/
|
|
1511
|
+
|
|
1512
|
+
optionMissingArgument(option) {
|
|
1513
|
+
const message = `error: option '${option.flags}' argument missing`;
|
|
1514
|
+
this._displayError(1, 'commander.optionMissingArgument', message);
|
|
1515
|
+
};
|
|
1516
|
+
|
|
1517
|
+
/**
|
|
1518
|
+
* `Option` does not have a value, and is a mandatory option.
|
|
1519
|
+
*
|
|
1520
|
+
* @param {Option} option
|
|
1521
|
+
* @api private
|
|
1522
|
+
*/
|
|
1523
|
+
|
|
1524
|
+
missingMandatoryOptionValue(option) {
|
|
1525
|
+
const message = `error: required option '${option.flags}' not specified`;
|
|
1526
|
+
this._displayError(1, 'commander.missingMandatoryOptionValue', message);
|
|
1527
|
+
};
|
|
1528
|
+
|
|
1529
|
+
/**
|
|
1530
|
+
* Unknown option `flag`.
|
|
1531
|
+
*
|
|
1532
|
+
* @param {string} flag
|
|
1533
|
+
* @api private
|
|
1534
|
+
*/
|
|
1535
|
+
|
|
1536
|
+
unknownOption(flag) {
|
|
1537
|
+
if (this._allowUnknownOption) return;
|
|
1538
|
+
let suggestion = '';
|
|
1539
|
+
|
|
1540
|
+
if (flag.startsWith('--') && this._showSuggestionAfterError) {
|
|
1541
|
+
// Looping to pick up the global options too
|
|
1542
|
+
let candidateFlags = [];
|
|
1543
|
+
let command = this;
|
|
1544
|
+
do {
|
|
1545
|
+
const moreFlags = command.createHelp().visibleOptions(command)
|
|
1546
|
+
.filter(option => option.long)
|
|
1547
|
+
.map(option => option.long);
|
|
1548
|
+
candidateFlags = candidateFlags.concat(moreFlags);
|
|
1549
|
+
command = command.parent;
|
|
1550
|
+
} while (command && !command._enablePositionalOptions);
|
|
1551
|
+
suggestion = suggestSimilar(flag, candidateFlags);
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
const message = `error: unknown option '${flag}'${suggestion}`;
|
|
1555
|
+
this._displayError(1, 'commander.unknownOption', message);
|
|
1556
|
+
};
|
|
1557
|
+
|
|
1558
|
+
/**
|
|
1559
|
+
* Excess arguments, more than expected.
|
|
1560
|
+
*
|
|
1561
|
+
* @param {string[]} receivedArgs
|
|
1562
|
+
* @api private
|
|
1563
|
+
*/
|
|
1564
|
+
|
|
1565
|
+
_excessArguments(receivedArgs) {
|
|
1566
|
+
if (this._allowExcessArguments) return;
|
|
1567
|
+
|
|
1568
|
+
const expected = this._args.length;
|
|
1569
|
+
const s = (expected === 1) ? '' : 's';
|
|
1570
|
+
const forSubcommand = this.parent ? ` for '${this.name()}'` : '';
|
|
1571
|
+
const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;
|
|
1572
|
+
this._displayError(1, 'commander.excessArguments', message);
|
|
1573
|
+
};
|
|
1574
|
+
|
|
1575
|
+
/**
|
|
1576
|
+
* Unknown command.
|
|
1577
|
+
*
|
|
1578
|
+
* @api private
|
|
1579
|
+
*/
|
|
1580
|
+
|
|
1581
|
+
unknownCommand() {
|
|
1582
|
+
const unknownName = this.args[0];
|
|
1583
|
+
let suggestion = '';
|
|
1584
|
+
|
|
1585
|
+
if (this._showSuggestionAfterError) {
|
|
1586
|
+
const candidateNames = [];
|
|
1587
|
+
this.createHelp().visibleCommands(this).forEach((command) => {
|
|
1588
|
+
candidateNames.push(command.name());
|
|
1589
|
+
// just visible alias
|
|
1590
|
+
if (command.alias()) candidateNames.push(command.alias());
|
|
1591
|
+
});
|
|
1592
|
+
suggestion = suggestSimilar(unknownName, candidateNames);
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
const message = `error: unknown command '${unknownName}'${suggestion}`;
|
|
1596
|
+
this._displayError(1, 'commander.unknownCommand', message);
|
|
1597
|
+
};
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* Set the program version to `str`.
|
|
1601
|
+
*
|
|
1602
|
+
* This method auto-registers the "-V, --version" flag
|
|
1603
|
+
* which will print the version number when passed.
|
|
1604
|
+
*
|
|
1605
|
+
* You can optionally supply the flags and description to override the defaults.
|
|
1606
|
+
*
|
|
1607
|
+
* @param {string} str
|
|
1608
|
+
* @param {string} [flags]
|
|
1609
|
+
* @param {string} [description]
|
|
1610
|
+
* @return {this | string} `this` command for chaining, or version string if no arguments
|
|
1611
|
+
*/
|
|
1612
|
+
|
|
1613
|
+
version(str, flags, description) {
|
|
1614
|
+
if (str === undefined) return this._version;
|
|
1615
|
+
this._version = str;
|
|
1616
|
+
flags = flags || '-V, --version';
|
|
1617
|
+
description = description || 'output the version number';
|
|
1618
|
+
const versionOption = this.createOption(flags, description);
|
|
1619
|
+
this._versionOptionName = versionOption.attributeName();
|
|
1620
|
+
this.options.push(versionOption);
|
|
1621
|
+
this.on('option:' + versionOption.name(), () => {
|
|
1622
|
+
this._outputConfiguration.writeOut(`${str}\n`);
|
|
1623
|
+
this._exit(0, 'commander.version', str);
|
|
1624
|
+
});
|
|
1625
|
+
return this;
|
|
1626
|
+
};
|
|
1627
|
+
|
|
1628
|
+
/**
|
|
1629
|
+
* Set the description to `str`.
|
|
1630
|
+
*
|
|
1631
|
+
* @param {string} [str]
|
|
1632
|
+
* @param {Object} [argsDescription]
|
|
1633
|
+
* @return {string|Command}
|
|
1634
|
+
*/
|
|
1635
|
+
description(str, argsDescription) {
|
|
1636
|
+
if (str === undefined && argsDescription === undefined) return this._description;
|
|
1637
|
+
this._description = str;
|
|
1638
|
+
if (argsDescription) {
|
|
1639
|
+
this._argsDescription = argsDescription;
|
|
1640
|
+
}
|
|
1641
|
+
return this;
|
|
1642
|
+
};
|
|
1643
|
+
|
|
1644
|
+
/**
|
|
1645
|
+
* Set an alias for the command.
|
|
1646
|
+
*
|
|
1647
|
+
* You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.
|
|
1648
|
+
*
|
|
1649
|
+
* @param {string} [alias]
|
|
1650
|
+
* @return {string|Command}
|
|
1651
|
+
*/
|
|
1652
|
+
|
|
1653
|
+
alias(alias) {
|
|
1654
|
+
if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility
|
|
1655
|
+
|
|
1656
|
+
/** @type {Command} */
|
|
1657
|
+
let command = this;
|
|
1658
|
+
if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) {
|
|
1659
|
+
// assume adding alias for last added executable subcommand, rather than this
|
|
1660
|
+
command = this.commands[this.commands.length - 1];
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
if (alias === command._name) throw new Error('Command alias can\'t be the same as its name');
|
|
1664
|
+
|
|
1665
|
+
command._aliases.push(alias);
|
|
1666
|
+
return this;
|
|
1667
|
+
};
|
|
1668
|
+
|
|
1669
|
+
/**
|
|
1670
|
+
* Set aliases for the command.
|
|
1671
|
+
*
|
|
1672
|
+
* Only the first alias is shown in the auto-generated help.
|
|
1673
|
+
*
|
|
1674
|
+
* @param {string[]} [aliases]
|
|
1675
|
+
* @return {string[]|Command}
|
|
1676
|
+
*/
|
|
1677
|
+
|
|
1678
|
+
aliases(aliases) {
|
|
1679
|
+
// Getter for the array of aliases is the main reason for having aliases() in addition to alias().
|
|
1680
|
+
if (aliases === undefined) return this._aliases;
|
|
1681
|
+
|
|
1682
|
+
aliases.forEach((alias) => this.alias(alias));
|
|
1683
|
+
return this;
|
|
1684
|
+
};
|
|
1685
|
+
|
|
1686
|
+
/**
|
|
1687
|
+
* Set / get the command usage `str`.
|
|
1688
|
+
*
|
|
1689
|
+
* @param {string} [str]
|
|
1690
|
+
* @return {String|Command}
|
|
1691
|
+
*/
|
|
1692
|
+
|
|
1693
|
+
usage(str) {
|
|
1694
|
+
if (str === undefined) {
|
|
1695
|
+
if (this._usage) return this._usage;
|
|
1696
|
+
|
|
1697
|
+
const args = this._args.map((arg) => {
|
|
1698
|
+
return humanReadableArgName(arg);
|
|
1699
|
+
});
|
|
1700
|
+
return [].concat(
|
|
1701
|
+
(this.options.length || this._hasHelpOption ? '[options]' : []),
|
|
1702
|
+
(this.commands.length ? '[command]' : []),
|
|
1703
|
+
(this._args.length ? args : [])
|
|
1704
|
+
).join(' ');
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
this._usage = str;
|
|
1708
|
+
return this;
|
|
1709
|
+
};
|
|
1710
|
+
|
|
1711
|
+
/**
|
|
1712
|
+
* Get or set the name of the command
|
|
1713
|
+
*
|
|
1714
|
+
* @param {string} [str]
|
|
1715
|
+
* @return {string|Command}
|
|
1716
|
+
*/
|
|
1717
|
+
|
|
1718
|
+
name(str) {
|
|
1719
|
+
if (str === undefined) return this._name;
|
|
1720
|
+
this._name = str;
|
|
1721
|
+
return this;
|
|
1722
|
+
};
|
|
1723
|
+
|
|
1724
|
+
/**
|
|
1725
|
+
* Return program help documentation.
|
|
1726
|
+
*
|
|
1727
|
+
* @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout
|
|
1728
|
+
* @return {string}
|
|
1729
|
+
*/
|
|
1730
|
+
|
|
1731
|
+
helpInformation(contextOptions) {
|
|
1732
|
+
const helper = this.createHelp();
|
|
1733
|
+
if (helper.helpWidth === undefined) {
|
|
1734
|
+
helper.helpWidth = (contextOptions && contextOptions.error) ? this._outputConfiguration.getErrHelpWidth() : this._outputConfiguration.getOutHelpWidth();
|
|
1735
|
+
}
|
|
1736
|
+
return helper.formatHelp(this, helper);
|
|
1737
|
+
};
|
|
1738
|
+
|
|
1739
|
+
/**
|
|
1740
|
+
* @api private
|
|
1741
|
+
*/
|
|
1742
|
+
|
|
1743
|
+
_getHelpContext(contextOptions) {
|
|
1744
|
+
contextOptions = contextOptions || {};
|
|
1745
|
+
const context = { error: !!contextOptions.error };
|
|
1746
|
+
let write;
|
|
1747
|
+
if (context.error) {
|
|
1748
|
+
write = (arg) => this._outputConfiguration.writeErr(arg);
|
|
1749
|
+
} else {
|
|
1750
|
+
write = (arg) => this._outputConfiguration.writeOut(arg);
|
|
1751
|
+
}
|
|
1752
|
+
context.write = contextOptions.write || write;
|
|
1753
|
+
context.command = this;
|
|
1754
|
+
return context;
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
/**
|
|
1758
|
+
* Output help information for this command.
|
|
1759
|
+
*
|
|
1760
|
+
* Outputs built-in help, and custom text added using `.addHelpText()`.
|
|
1761
|
+
*
|
|
1762
|
+
* @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout
|
|
1763
|
+
*/
|
|
1764
|
+
|
|
1765
|
+
outputHelp(contextOptions) {
|
|
1766
|
+
let deprecatedCallback;
|
|
1767
|
+
if (typeof contextOptions === 'function') {
|
|
1768
|
+
deprecatedCallback = contextOptions;
|
|
1769
|
+
contextOptions = undefined;
|
|
1770
|
+
}
|
|
1771
|
+
const context = this._getHelpContext(contextOptions);
|
|
1772
|
+
|
|
1773
|
+
getCommandAndParents(this).reverse().forEach(command => command.emit('beforeAllHelp', context));
|
|
1774
|
+
this.emit('beforeHelp', context);
|
|
1775
|
+
|
|
1776
|
+
let helpInformation = this.helpInformation(context);
|
|
1777
|
+
if (deprecatedCallback) {
|
|
1778
|
+
helpInformation = deprecatedCallback(helpInformation);
|
|
1779
|
+
if (typeof helpInformation !== 'string' && !Buffer.isBuffer(helpInformation)) {
|
|
1780
|
+
throw new Error('outputHelp callback must return a string or a Buffer');
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
context.write(helpInformation);
|
|
1784
|
+
|
|
1785
|
+
this.emit(this._helpLongFlag); // deprecated
|
|
1786
|
+
this.emit('afterHelp', context);
|
|
1787
|
+
getCommandAndParents(this).forEach(command => command.emit('afterAllHelp', context));
|
|
1788
|
+
};
|
|
1789
|
+
|
|
1790
|
+
/**
|
|
1791
|
+
* You can pass in flags and a description to override the help
|
|
1792
|
+
* flags and help description for your command. Pass in false to
|
|
1793
|
+
* disable the built-in help option.
|
|
1794
|
+
*
|
|
1795
|
+
* @param {string | boolean} [flags]
|
|
1796
|
+
* @param {string} [description]
|
|
1797
|
+
* @return {Command} `this` command for chaining
|
|
1798
|
+
*/
|
|
1799
|
+
|
|
1800
|
+
helpOption(flags, description) {
|
|
1801
|
+
if (typeof flags === 'boolean') {
|
|
1802
|
+
this._hasHelpOption = flags;
|
|
1803
|
+
return this;
|
|
1804
|
+
}
|
|
1805
|
+
this._helpFlags = flags || this._helpFlags;
|
|
1806
|
+
this._helpDescription = description || this._helpDescription;
|
|
1807
|
+
|
|
1808
|
+
const helpFlags = splitOptionFlags(this._helpFlags);
|
|
1809
|
+
this._helpShortFlag = helpFlags.shortFlag;
|
|
1810
|
+
this._helpLongFlag = helpFlags.longFlag;
|
|
1811
|
+
|
|
1812
|
+
return this;
|
|
1813
|
+
};
|
|
1814
|
+
|
|
1815
|
+
/**
|
|
1816
|
+
* Output help information and exit.
|
|
1817
|
+
*
|
|
1818
|
+
* Outputs built-in help, and custom text added using `.addHelpText()`.
|
|
1819
|
+
*
|
|
1820
|
+
* @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout
|
|
1821
|
+
*/
|
|
1822
|
+
|
|
1823
|
+
help(contextOptions) {
|
|
1824
|
+
this.outputHelp(contextOptions);
|
|
1825
|
+
let exitCode = process.exitCode || 0;
|
|
1826
|
+
if (exitCode === 0 && contextOptions && typeof contextOptions !== 'function' && contextOptions.error) {
|
|
1827
|
+
exitCode = 1;
|
|
1828
|
+
}
|
|
1829
|
+
// message: do not have all displayed text available so only passing placeholder.
|
|
1830
|
+
this._exit(exitCode, 'commander.help', '(outputHelp)');
|
|
1831
|
+
};
|
|
1832
|
+
|
|
1833
|
+
/**
|
|
1834
|
+
* Add additional text to be displayed with the built-in help.
|
|
1835
|
+
*
|
|
1836
|
+
* Position is 'before' or 'after' to affect just this command,
|
|
1837
|
+
* and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.
|
|
1838
|
+
*
|
|
1839
|
+
* @param {string} position - before or after built-in help
|
|
1840
|
+
* @param {string | Function} text - string to add, or a function returning a string
|
|
1841
|
+
* @return {Command} `this` command for chaining
|
|
1842
|
+
*/
|
|
1843
|
+
addHelpText(position, text) {
|
|
1844
|
+
const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];
|
|
1845
|
+
if (!allowedValues.includes(position)) {
|
|
1846
|
+
throw new Error(`Unexpected value for position to addHelpText.
|
|
1847
|
+
Expecting one of '${allowedValues.join("', '")}'`);
|
|
1848
|
+
}
|
|
1849
|
+
const helpEvent = `${position}Help`;
|
|
1850
|
+
this.on(helpEvent, (context) => {
|
|
1851
|
+
let helpStr;
|
|
1852
|
+
if (typeof text === 'function') {
|
|
1853
|
+
helpStr = text({ error: context.error, command: context.command });
|
|
1854
|
+
} else {
|
|
1855
|
+
helpStr = text;
|
|
1856
|
+
}
|
|
1857
|
+
// Ignore falsy value when nothing to output.
|
|
1858
|
+
if (helpStr) {
|
|
1859
|
+
context.write(`${helpStr}\n`);
|
|
1860
|
+
}
|
|
1861
|
+
});
|
|
1862
|
+
return this;
|
|
1863
|
+
}
|
|
1864
|
+
};
|
|
1865
|
+
|
|
1866
|
+
/**
|
|
1867
|
+
* Output help information if help flags specified
|
|
1868
|
+
*
|
|
1869
|
+
* @param {Command} cmd - command to output help for
|
|
1870
|
+
* @param {Array} args - array of options to search for help flags
|
|
1871
|
+
* @api private
|
|
1872
|
+
*/
|
|
1873
|
+
|
|
1874
|
+
function outputHelpIfRequested(cmd, args) {
|
|
1875
|
+
const helpOption = cmd._hasHelpOption && args.find(arg => arg === cmd._helpLongFlag || arg === cmd._helpShortFlag);
|
|
1876
|
+
if (helpOption) {
|
|
1877
|
+
cmd.outputHelp();
|
|
1878
|
+
// (Do not have all displayed text available so only passing placeholder.)
|
|
1879
|
+
cmd._exit(0, 'commander.helpDisplayed', '(outputHelp)');
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
/**
|
|
1884
|
+
* Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).
|
|
1885
|
+
*
|
|
1886
|
+
* @param {string[]} args - array of arguments from node.execArgv
|
|
1887
|
+
* @returns {string[]}
|
|
1888
|
+
* @api private
|
|
1889
|
+
*/
|
|
1890
|
+
|
|
1891
|
+
function incrementNodeInspectorPort(args) {
|
|
1892
|
+
// Testing for these options:
|
|
1893
|
+
// --inspect[=[host:]port]
|
|
1894
|
+
// --inspect-brk[=[host:]port]
|
|
1895
|
+
// --inspect-port=[host:]port
|
|
1896
|
+
return args.map((arg) => {
|
|
1897
|
+
if (!arg.startsWith('--inspect')) {
|
|
1898
|
+
return arg;
|
|
1899
|
+
}
|
|
1900
|
+
let debugOption;
|
|
1901
|
+
let debugHost = '127.0.0.1';
|
|
1902
|
+
let debugPort = '9229';
|
|
1903
|
+
let match;
|
|
1904
|
+
if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
|
|
1905
|
+
// e.g. --inspect
|
|
1906
|
+
debugOption = match[1];
|
|
1907
|
+
} else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
|
|
1908
|
+
debugOption = match[1];
|
|
1909
|
+
if (/^\d+$/.test(match[3])) {
|
|
1910
|
+
// e.g. --inspect=1234
|
|
1911
|
+
debugPort = match[3];
|
|
1912
|
+
} else {
|
|
1913
|
+
// e.g. --inspect=localhost
|
|
1914
|
+
debugHost = match[3];
|
|
1915
|
+
}
|
|
1916
|
+
} else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
|
|
1917
|
+
// e.g. --inspect=localhost:1234
|
|
1918
|
+
debugOption = match[1];
|
|
1919
|
+
debugHost = match[3];
|
|
1920
|
+
debugPort = match[4];
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
if (debugOption && debugPort !== '0') {
|
|
1924
|
+
return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;
|
|
1925
|
+
}
|
|
1926
|
+
return arg;
|
|
1927
|
+
});
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
/**
|
|
1931
|
+
* @param {Command} startCommand
|
|
1932
|
+
* @returns {Command[]}
|
|
1933
|
+
* @api private
|
|
1934
|
+
*/
|
|
1935
|
+
|
|
1936
|
+
function getCommandAndParents(startCommand) {
|
|
1937
|
+
const result = [];
|
|
1938
|
+
for (let command = startCommand; command; command = command.parent) {
|
|
1939
|
+
result.push(command);
|
|
1940
|
+
}
|
|
1941
|
+
return result;
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
exports.Command = Command;
|