@dev-sergeev/datalab-kit 0.1.2 → 0.1.4
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/CHANGELOG.md +14 -0
- package/README.md +23 -5
- package/THIRD_PARTY_NOTICES.md +6 -2
- package/docs/adr/0001-user-settings-priority.md +2 -0
- package/docs/adr/0002-package-delivery.md +8 -0
- package/node_modules/@pi-plugins/elapsed/LICENSE +21 -0
- package/node_modules/@pi-plugins/elapsed/README.md +45 -0
- package/node_modules/@pi-plugins/elapsed/dist/index.d.mts +8 -0
- package/node_modules/@pi-plugins/elapsed/dist/index.d.mts.map +1 -0
- package/node_modules/@pi-plugins/elapsed/dist/index.mjs +47 -0
- package/node_modules/@pi-plugins/elapsed/dist/index.mjs.map +1 -0
- package/node_modules/@pi-plugins/elapsed/package.json +65 -0
- package/node_modules/@tifan/pi-recap/README.md +61 -0
- package/node_modules/@tifan/pi-recap/package.json +43 -0
- package/node_modules/@tifan/pi-recap/src/index.ts +586 -0
- package/node_modules/@tifan/pi-recap/src/model-picker.ts +234 -0
- package/node_modules/@tifan/pi-recap/src/models.ts +180 -0
- package/node_modules/@tifan/pi-recap/src/sanitize.ts +119 -0
- package/node_modules/@tifan/pi-recap/src/tui.ts +155 -0
- package/node_modules/@zigai/pi-extension-internals/README.md +24 -0
- package/node_modules/@zigai/pi-extension-internals/dist/editor-enhancer-registry.d.ts +21 -0
- package/node_modules/@zigai/pi-extension-internals/dist/editor-enhancer-registry.js +233 -0
- package/node_modules/@zigai/pi-extension-internals/dist/index.d.ts +6 -0
- package/node_modules/@zigai/pi-extension-internals/dist/index.js +3 -0
- package/node_modules/@zigai/pi-extension-internals/dist/linked-method-patch.d.ts +34 -0
- package/node_modules/@zigai/pi-extension-internals/dist/linked-method-patch.js +272 -0
- package/node_modules/@zigai/pi-extension-internals/dist/pi-internal-import.d.ts +11 -0
- package/node_modules/@zigai/pi-extension-internals/dist/pi-internal-import.js +139 -0
- package/node_modules/@zigai/pi-extension-internals/package.json +41 -0
- package/node_modules/@zigai/pi-extension-settings/LICENSE +21 -0
- package/node_modules/@zigai/pi-extension-settings/README.md +36 -0
- package/node_modules/@zigai/pi-extension-settings/dist/artifacts.d.ts +23 -0
- package/node_modules/@zigai/pi-extension-settings/dist/artifacts.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/artifacts.js +75 -0
- package/node_modules/@zigai/pi-extension-settings/dist/artifacts.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.d.ts +3 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.js +5 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli.d.ts +6 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli.js +87 -0
- package/node_modules/@zigai/pi-extension-settings/dist/cli.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.d.ts +2 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.js +2 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition.d.ts +159 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition.js +248 -0
- package/node_modules/@zigai/pi-extension-settings/dist/definition.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/file-system.d.ts +10 -0
- package/node_modules/@zigai/pi-extension-settings/dist/file-system.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/file-system.js +115 -0
- package/node_modules/@zigai/pi-extension-settings/dist/file-system.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/index.d.ts +2 -0
- package/node_modules/@zigai/pi-extension-settings/dist/index.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/index.js +2 -0
- package/node_modules/@zigai/pi-extension-settings/dist/index.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/json-value.d.ts +18 -0
- package/node_modules/@zigai/pi-extension-settings/dist/json-value.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/json-value.js +56 -0
- package/node_modules/@zigai/pi-extension-settings/dist/json-value.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/paths.d.ts +11 -0
- package/node_modules/@zigai/pi-extension-settings/dist/paths.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/paths.js +23 -0
- package/node_modules/@zigai/pi-extension-settings/dist/paths.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.d.ts +5 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.js +21 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.d.ts +106 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.js +122 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.ts +2537 -0
- package/node_modules/@zigai/pi-extension-settings/dist/pi.ts.map +7 -0
- package/node_modules/@zigai/pi-extension-settings/dist/projects.d.ts +10 -0
- package/node_modules/@zigai/pi-extension-settings/dist/projects.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/projects.js +177 -0
- package/node_modules/@zigai/pi-extension-settings/dist/projects.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.d.ts +40 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.js +158 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.ts +158 -0
- package/node_modules/@zigai/pi-extension-settings/dist/runtime.ts.map +7 -0
- package/node_modules/@zigai/pi-extension-settings/dist/schema-document.d.ts +19 -0
- package/node_modules/@zigai/pi-extension-settings/dist/schema-document.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/schema-document.js +168 -0
- package/node_modules/@zigai/pi-extension-settings/dist/schema-document.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.d.ts +9 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.js +242 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.d.ts +59 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.js +98 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.d.ts +80 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.js +144 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.d.ts +5 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.js +30 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.d.ts +10 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.js +16 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.d.ts +54 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.js +202 -0
- package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.d.ts +5 -0
- package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.d.ts.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.js +9 -0
- package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.js.map +1 -0
- package/node_modules/@zigai/pi-extension-settings/docs/generation.md +71 -0
- package/node_modules/@zigai/pi-extension-settings/docs/manual-setup.md +98 -0
- package/node_modules/@zigai/pi-extension-settings/docs/runtime.md +100 -0
- package/node_modules/@zigai/pi-extension-settings/docs/ui-controls.md +31 -0
- package/node_modules/@zigai/pi-extension-settings/package.json +97 -0
- package/node_modules/@zigai/pi-mention-anything/README.md +113 -0
- package/node_modules/@zigai/pi-mention-anything/config.schema.json +313 -0
- package/node_modules/@zigai/pi-mention-anything/docs/command-protocol.md +106 -0
- package/node_modules/@zigai/pi-mention-anything/docs/providers.md +128 -0
- package/node_modules/@zigai/pi-mention-anything/examples/query-command.mjs +96 -0
- package/node_modules/@zigai/pi-mention-anything/examples/recursive-tree.ts +28 -0
- package/node_modules/@zigai/pi-mention-anything/examples/static.ts +28 -0
- package/node_modules/@zigai/pi-mention-anything/examples/tmux.ts +90 -0
- package/node_modules/@zigai/pi-mention-anything/examples/tree-settings.json +25 -0
- package/node_modules/@zigai/pi-mention-anything/package.json +58 -0
- package/node_modules/@zigai/pi-mention-anything/src/api.ts +75 -0
- package/node_modules/@zigai/pi-mention-anything/src/autocomplete.ts +231 -0
- package/node_modules/@zigai/pi-mention-anything/src/chain-autocomplete.ts +596 -0
- package/node_modules/@zigai/pi-mention-anything/src/chain-syntax.ts +345 -0
- package/node_modules/@zigai/pi-mention-anything/src/command-provider.ts +291 -0
- package/node_modules/@zigai/pi-mention-anything/src/configured-source.ts +66 -0
- package/node_modules/@zigai/pi-mention-anything/src/editor.ts +180 -0
- package/node_modules/@zigai/pi-mention-anything/src/expand-mentions.ts +162 -0
- package/node_modules/@zigai/pi-mention-anything/src/index.ts +54 -0
- package/node_modules/@zigai/pi-mention-anything/src/initial-suggestions.ts +190 -0
- package/node_modules/@zigai/pi-mention-anything/src/list-provider.ts +71 -0
- package/node_modules/@zigai/pi-mention-anything/src/mention-hub.ts +307 -0
- package/node_modules/@zigai/pi-mention-anything/src/mention-resolution.ts +374 -0
- package/node_modules/@zigai/pi-mention-anything/src/mention-syntax.ts +105 -0
- package/node_modules/@zigai/pi-mention-anything/src/register-mention.ts +89 -0
- package/node_modules/@zigai/pi-mention-anything/src/rendering.ts +53 -0
- package/node_modules/@zigai/pi-mention-anything/src/selected-items.ts +21 -0
- package/node_modules/@zigai/pi-mention-anything/src/selection-history.ts +135 -0
- package/node_modules/@zigai/pi-mention-anything/src/settings-input.ts +317 -0
- package/node_modules/@zigai/pi-mention-anything/src/settings.prevalidated.ts +57 -0
- package/node_modules/@zigai/pi-mention-anything/src/settings.ts +52 -0
- package/node_modules/@zigai/pi-mention-anything/src/source-contract.ts +174 -0
- package/node_modules/@zigai/pi-mention-anything/src/source-controller.ts +1070 -0
- package/node_modules/@zigai/pi-mention-anything/src/source-runtime.ts +99 -0
- package/node_modules/@zigai/pi-mention-skill/README.md +60 -0
- package/node_modules/@zigai/pi-mention-skill/config.schema.json +81 -0
- package/node_modules/@zigai/pi-mention-skill/package.json +56 -0
- package/node_modules/@zigai/pi-mention-skill/src/index.ts +60 -0
- package/node_modules/@zigai/pi-mention-skill/src/settings-input.ts +74 -0
- package/node_modules/@zigai/pi-mention-skill/src/settings.prevalidated.ts +18 -0
- package/node_modules/@zigai/pi-mention-skill/src/settings.ts +54 -0
- package/node_modules/@zigai/pi-mention-skill/src/skill-commands.ts +18 -0
- package/node_modules/@zigai/pi-mention-skill/src/skill-content.ts +60 -0
- package/node_modules/@zigai/pi-mention-skill/src/skill-provider.ts +105 -0
- package/node_modules/@zigai/pi-mention-skill/src/slash-skill-filter.ts +29 -0
- package/node_modules/argparse/LICENSE +21 -0
- package/node_modules/argparse/README.md +257 -0
- package/node_modules/argparse/index.js +3 -0
- package/node_modules/argparse/lib/action/append/constant.js +47 -0
- package/node_modules/argparse/lib/action/append.js +53 -0
- package/node_modules/argparse/lib/action/count.js +40 -0
- package/node_modules/argparse/lib/action/help.js +47 -0
- package/node_modules/argparse/lib/action/store/constant.js +43 -0
- package/node_modules/argparse/lib/action/store/false.js +27 -0
- package/node_modules/argparse/lib/action/store/true.js +26 -0
- package/node_modules/argparse/lib/action/store.js +50 -0
- package/node_modules/argparse/lib/action/subparsers.js +149 -0
- package/node_modules/argparse/lib/action/version.js +47 -0
- package/node_modules/argparse/lib/action.js +146 -0
- package/node_modules/argparse/lib/action_container.js +482 -0
- package/node_modules/argparse/lib/argparse.js +14 -0
- package/node_modules/argparse/lib/argument/error.js +50 -0
- package/node_modules/argparse/lib/argument/exclusive.js +54 -0
- package/node_modules/argparse/lib/argument/group.js +75 -0
- package/node_modules/argparse/lib/argument_parser.js +1161 -0
- package/node_modules/argparse/lib/const.js +21 -0
- package/node_modules/argparse/lib/help/added_formatters.js +87 -0
- package/node_modules/argparse/lib/help/formatter.js +795 -0
- package/node_modules/argparse/lib/namespace.js +76 -0
- package/node_modules/argparse/lib/utils.js +57 -0
- package/node_modules/argparse/package.json +34 -0
- package/node_modules/esprima/LICENSE.BSD +21 -0
- package/node_modules/esprima/README.md +46 -0
- package/node_modules/esprima/bin/esparse.js +139 -0
- package/node_modules/esprima/bin/esvalidate.js +236 -0
- package/node_modules/esprima/dist/esprima.js +6709 -0
- package/node_modules/esprima/package.json +112 -0
- package/node_modules/extend-shallow/LICENSE +21 -0
- package/node_modules/extend-shallow/README.md +61 -0
- package/node_modules/extend-shallow/index.js +33 -0
- package/node_modules/extend-shallow/package.json +56 -0
- package/node_modules/graceful-fs/LICENSE +15 -0
- package/node_modules/graceful-fs/README.md +143 -0
- package/node_modules/graceful-fs/clone.js +23 -0
- package/node_modules/graceful-fs/graceful-fs.js +448 -0
- package/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/node_modules/graceful-fs/package.json +53 -0
- package/node_modules/graceful-fs/polyfills.js +355 -0
- package/node_modules/gray-matter/LICENSE +21 -0
- package/node_modules/gray-matter/README.md +565 -0
- package/node_modules/gray-matter/gray-matter.d.ts +114 -0
- package/node_modules/gray-matter/index.js +228 -0
- package/node_modules/gray-matter/lib/defaults.js +18 -0
- package/node_modules/gray-matter/lib/engine.js +30 -0
- package/node_modules/gray-matter/lib/engines.js +54 -0
- package/node_modules/gray-matter/lib/excerpt.js +32 -0
- package/node_modules/gray-matter/lib/parse.js +13 -0
- package/node_modules/gray-matter/lib/stringify.js +56 -0
- package/node_modules/gray-matter/lib/to-file.js +43 -0
- package/node_modules/gray-matter/lib/utils.js +66 -0
- package/node_modules/gray-matter/package.json +127 -0
- package/node_modules/is-extendable/LICENSE +21 -0
- package/node_modules/is-extendable/README.md +72 -0
- package/node_modules/is-extendable/index.js +13 -0
- package/node_modules/is-extendable/package.json +51 -0
- package/node_modules/js-yaml/LICENSE +21 -0
- package/node_modules/js-yaml/README.md +302 -0
- package/node_modules/js-yaml/bin/js-yaml.js +132 -0
- package/node_modules/js-yaml/dist/js-yaml.js +4024 -0
- package/node_modules/js-yaml/dist/js-yaml.min.js +1 -0
- package/node_modules/js-yaml/index.js +7 -0
- package/node_modules/js-yaml/lib/js-yaml/common.js +59 -0
- package/node_modules/js-yaml/lib/js-yaml/dumper.js +850 -0
- package/node_modules/js-yaml/lib/js-yaml/exception.js +43 -0
- package/node_modules/js-yaml/lib/js-yaml/loader.js +1679 -0
- package/node_modules/js-yaml/lib/js-yaml/mark.js +76 -0
- package/node_modules/js-yaml/lib/js-yaml/schema/core.js +18 -0
- package/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +25 -0
- package/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +28 -0
- package/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +17 -0
- package/node_modules/js-yaml/lib/js-yaml/schema/json.js +25 -0
- package/node_modules/js-yaml/lib/js-yaml/schema.js +108 -0
- package/node_modules/js-yaml/lib/js-yaml/type/binary.js +138 -0
- package/node_modules/js-yaml/lib/js-yaml/type/bool.js +35 -0
- package/node_modules/js-yaml/lib/js-yaml/type/float.js +116 -0
- package/node_modules/js-yaml/lib/js-yaml/type/int.js +173 -0
- package/node_modules/js-yaml/lib/js-yaml/type/js/function.js +93 -0
- package/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +60 -0
- package/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +28 -0
- package/node_modules/js-yaml/lib/js-yaml/type/map.js +8 -0
- package/node_modules/js-yaml/lib/js-yaml/type/merge.js +12 -0
- package/node_modules/js-yaml/lib/js-yaml/type/null.js +34 -0
- package/node_modules/js-yaml/lib/js-yaml/type/omap.js +44 -0
- package/node_modules/js-yaml/lib/js-yaml/type/pairs.js +53 -0
- package/node_modules/js-yaml/lib/js-yaml/type/seq.js +8 -0
- package/node_modules/js-yaml/lib/js-yaml/type/set.js +29 -0
- package/node_modules/js-yaml/lib/js-yaml/type/str.js +8 -0
- package/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +88 -0
- package/node_modules/js-yaml/lib/js-yaml/type.js +61 -0
- package/node_modules/js-yaml/lib/js-yaml.js +39 -0
- package/node_modules/js-yaml/package.json +52 -0
- package/node_modules/kind-of/LICENSE +21 -0
- package/node_modules/kind-of/README.md +367 -0
- package/node_modules/kind-of/index.js +129 -0
- package/node_modules/kind-of/package.json +88 -0
- package/node_modules/node-addon-api/common 2.gypi +21 -0
- package/node_modules/node-addon-api/except 2.gypi +25 -0
- package/node_modules/node-addon-api/napi 2.h +3463 -0
- package/node_modules/node-addon-api/napi-inl 2.h +7250 -0
- package/node_modules/node-addon-api/napi-inl.deprecated 2.h +186 -0
- package/node_modules/node-addon-api/node_addon_api 2.gyp +42 -0
- package/node_modules/node-addon-api/node_api 2.gyp +9 -0
- package/node_modules/node-addon-api/noexcept 2.gypi +26 -0
- package/node_modules/node-addon-api/nothing 2.c +0 -0
- package/node_modules/pi-toggle-skills/README.md +213 -0
- package/node_modules/pi-toggle-skills/package.json +60 -0
- package/node_modules/pi-toggle-skills/src/index.ts +112 -0
- package/node_modules/pi-toggle-skills/src/skill-discovery.ts +258 -0
- package/node_modules/pi-toggle-skills/src/skill-selector.ts +435 -0
- package/node_modules/pi-toggle-skills/toggle-skills 2.ts +316 -0
- package/node_modules/pi-toggle-skills/toggle-skills.ts +316 -0
- package/node_modules/pi-toggle-skills/vitest.config 2.ts +15 -0
- package/node_modules/pi-toggle-skills/vitest.config.ts +15 -0
- package/node_modules/proper-lockfile/LICENSE +21 -0
- package/node_modules/proper-lockfile/README.md +183 -0
- package/node_modules/proper-lockfile/index.js +40 -0
- package/node_modules/proper-lockfile/lib/adapter.js +85 -0
- package/node_modules/proper-lockfile/lib/lockfile.js +342 -0
- package/node_modules/proper-lockfile/lib/mtime-precision.js +55 -0
- package/node_modules/proper-lockfile/node_modules/retry/.npmignore +3 -0
- package/node_modules/proper-lockfile/node_modules/retry/.travis.yml +15 -0
- package/node_modules/proper-lockfile/node_modules/retry/License +21 -0
- package/node_modules/proper-lockfile/node_modules/retry/Makefile +18 -0
- package/node_modules/proper-lockfile/node_modules/retry/README.md +227 -0
- package/node_modules/proper-lockfile/node_modules/retry/equation.gif +0 -0
- package/node_modules/proper-lockfile/node_modules/retry/example/dns.js +31 -0
- package/node_modules/proper-lockfile/node_modules/retry/example/stop.js +40 -0
- package/node_modules/proper-lockfile/node_modules/retry/index.js +1 -0
- package/node_modules/proper-lockfile/node_modules/retry/lib/retry.js +100 -0
- package/node_modules/proper-lockfile/node_modules/retry/lib/retry_operation.js +158 -0
- package/node_modules/proper-lockfile/node_modules/retry/package.json +32 -0
- package/node_modules/proper-lockfile/node_modules/retry/test/common.js +10 -0
- package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-forever.js +24 -0
- package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-retry-operation.js +258 -0
- package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-retry-wrap.js +101 -0
- package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-timeouts.js +69 -0
- package/node_modules/proper-lockfile/package.json +71 -0
- package/node_modules/section-matter/LICENSE +21 -0
- package/node_modules/section-matter/README.md +236 -0
- package/node_modules/section-matter/index.js +136 -0
- package/node_modules/section-matter/package.json +55 -0
- package/node_modules/signal-exit/LICENSE.txt +16 -0
- package/node_modules/signal-exit/README.md +39 -0
- package/node_modules/signal-exit/index.js +202 -0
- package/node_modules/signal-exit/package.json +38 -0
- package/node_modules/signal-exit/signals.js +53 -0
- package/node_modules/sprintf-js/.npmignore +1 -0
- package/node_modules/sprintf-js/.npmignore 2 +1 -0
- package/node_modules/sprintf-js/LICENSE +24 -0
- package/node_modules/sprintf-js/LICENSE 2 +24 -0
- package/node_modules/sprintf-js/README 2.md +88 -0
- package/node_modules/sprintf-js/README.md +88 -0
- package/node_modules/sprintf-js/bower 2.json +14 -0
- package/node_modules/sprintf-js/bower.json +14 -0
- package/node_modules/sprintf-js/demo/angular.html +20 -0
- package/node_modules/sprintf-js/dist/angular-sprintf.min.js +4 -0
- package/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +1 -0
- package/node_modules/sprintf-js/dist/angular-sprintf.min.map +1 -0
- package/node_modules/sprintf-js/dist/sprintf.min.js +4 -0
- package/node_modules/sprintf-js/dist/sprintf.min.js.map +1 -0
- package/node_modules/sprintf-js/dist/sprintf.min.map +1 -0
- package/node_modules/sprintf-js/gruntfile 2.js +36 -0
- package/node_modules/sprintf-js/gruntfile.js +36 -0
- package/node_modules/sprintf-js/package 2.json +22 -0
- package/node_modules/sprintf-js/package.json +22 -0
- package/node_modules/sprintf-js/src/angular-sprintf.js +18 -0
- package/node_modules/sprintf-js/src/sprintf.js +208 -0
- package/node_modules/sprintf-js/test/test.js +82 -0
- package/node_modules/strip-bom-string/LICENSE +21 -0
- package/node_modules/strip-bom-string/README.md +66 -0
- package/node_modules/strip-bom-string/index.js +15 -0
- package/node_modules/strip-bom-string/package.json +60 -0
- package/node_modules/tree-sitter-bash/tree-sitter-bash 2.wasm +0 -0
- package/node_modules/typebox/license 2 +23 -0
- package/node_modules/typebox/package 2.json +87 -0
- package/node_modules/typebox/readme 2.md +370 -0
- package/node_modules/zod/compile 2.cjs +96 -0
- package/node_modules/zod/compile 2.js +52 -0
- package/node_modules/zod/index 2.cjs +52 -0
- package/node_modules/zod/index 2.js +7 -0
- package/package.json +13 -4
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const sections = require('section-matter');
|
|
5
|
+
const defaults = require('./lib/defaults');
|
|
6
|
+
const stringify = require('./lib/stringify');
|
|
7
|
+
const excerpt = require('./lib/excerpt');
|
|
8
|
+
const engines = require('./lib/engines');
|
|
9
|
+
const toFile = require('./lib/to-file');
|
|
10
|
+
const parse = require('./lib/parse');
|
|
11
|
+
const utils = require('./lib/utils');
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Takes a string or object with `content` property, extracts
|
|
15
|
+
* and parses front-matter from the string, then returns an object
|
|
16
|
+
* with `data`, `content` and other [useful properties](#returned-object).
|
|
17
|
+
*
|
|
18
|
+
* ```js
|
|
19
|
+
* const matter = require('gray-matter');
|
|
20
|
+
* console.log(matter('---\ntitle: Home\n---\nOther stuff'));
|
|
21
|
+
* //=> { data: { title: 'Home'}, content: 'Other stuff' }
|
|
22
|
+
* ```
|
|
23
|
+
* @param {Object|String} `input` String, or object with `content` string
|
|
24
|
+
* @param {Object} `options`
|
|
25
|
+
* @return {Object}
|
|
26
|
+
* @api public
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
function matter(input, options) {
|
|
30
|
+
if (input === '') {
|
|
31
|
+
return { data: {}, content: input, excerpt: '', orig: input };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let file = toFile(input);
|
|
35
|
+
const cached = matter.cache[file.content];
|
|
36
|
+
|
|
37
|
+
if (!options) {
|
|
38
|
+
if (cached) {
|
|
39
|
+
file = Object.assign({}, cached);
|
|
40
|
+
file.orig = cached.orig;
|
|
41
|
+
return file;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// only cache if there are no options passed. if we cache when options
|
|
45
|
+
// are passed, we would need to also cache options values, which would
|
|
46
|
+
// negate any performance benefits of caching
|
|
47
|
+
matter.cache[file.content] = file;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return parseMatter(file, options);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Parse front matter
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
function parseMatter(file, options) {
|
|
58
|
+
const opts = defaults(options);
|
|
59
|
+
const open = opts.delimiters[0];
|
|
60
|
+
const close = '\n' + opts.delimiters[1];
|
|
61
|
+
let str = file.content;
|
|
62
|
+
|
|
63
|
+
if (opts.language) {
|
|
64
|
+
file.language = opts.language;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// get the length of the opening delimiter
|
|
68
|
+
const openLen = open.length;
|
|
69
|
+
if (!utils.startsWith(str, open, openLen)) {
|
|
70
|
+
excerpt(file, opts);
|
|
71
|
+
return file;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// if the next character after the opening delimiter is
|
|
75
|
+
// a character from the delimiter, then it's not a front-
|
|
76
|
+
// matter delimiter
|
|
77
|
+
if (str.charAt(openLen) === open.slice(-1)) {
|
|
78
|
+
return file;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// strip the opening delimiter
|
|
82
|
+
str = str.slice(openLen);
|
|
83
|
+
const len = str.length;
|
|
84
|
+
|
|
85
|
+
// use the language defined after first delimiter, if it exists
|
|
86
|
+
const language = matter.language(str, opts);
|
|
87
|
+
if (language.name) {
|
|
88
|
+
file.language = language.name;
|
|
89
|
+
str = str.slice(language.raw.length);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// get the index of the closing delimiter
|
|
93
|
+
let closeIndex = str.indexOf(close);
|
|
94
|
+
if (closeIndex === -1) {
|
|
95
|
+
closeIndex = len;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// get the raw front-matter block
|
|
99
|
+
file.matter = str.slice(0, closeIndex);
|
|
100
|
+
|
|
101
|
+
const block = file.matter.replace(/^\s*#[^\n]+/gm, '').trim();
|
|
102
|
+
if (block === '') {
|
|
103
|
+
file.isEmpty = true;
|
|
104
|
+
file.empty = file.content;
|
|
105
|
+
file.data = {};
|
|
106
|
+
} else {
|
|
107
|
+
|
|
108
|
+
// create file.data by parsing the raw file.matter block
|
|
109
|
+
file.data = parse(file.language, file.matter, opts);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// update file.content
|
|
113
|
+
if (closeIndex === len) {
|
|
114
|
+
file.content = '';
|
|
115
|
+
} else {
|
|
116
|
+
file.content = str.slice(closeIndex + close.length);
|
|
117
|
+
if (file.content[0] === '\r') {
|
|
118
|
+
file.content = file.content.slice(1);
|
|
119
|
+
}
|
|
120
|
+
if (file.content[0] === '\n') {
|
|
121
|
+
file.content = file.content.slice(1);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
excerpt(file, opts);
|
|
126
|
+
|
|
127
|
+
if (opts.sections === true || typeof opts.section === 'function') {
|
|
128
|
+
sections(file, opts.section);
|
|
129
|
+
}
|
|
130
|
+
return file;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Expose engines
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
matter.engines = engines;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Stringify an object to YAML or the specified language, and
|
|
141
|
+
* append it to the given string. By default, only YAML and JSON
|
|
142
|
+
* can be stringified. See the [engines](#engines) section to learn
|
|
143
|
+
* how to stringify other languages.
|
|
144
|
+
*
|
|
145
|
+
* ```js
|
|
146
|
+
* console.log(matter.stringify('foo bar baz', {title: 'Home'}));
|
|
147
|
+
* // results in:
|
|
148
|
+
* // ---
|
|
149
|
+
* // title: Home
|
|
150
|
+
* // ---
|
|
151
|
+
* // foo bar baz
|
|
152
|
+
* ```
|
|
153
|
+
* @param {String|Object} `file` The content string to append to stringified front-matter, or a file object with `file.content` string.
|
|
154
|
+
* @param {Object} `data` Front matter to stringify.
|
|
155
|
+
* @param {Object} `options` [Options](#options) to pass to gray-matter and [js-yaml].
|
|
156
|
+
* @return {String} Returns a string created by wrapping stringified yaml with delimiters, and appending that to the given string.
|
|
157
|
+
* @api public
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
matter.stringify = function(file, data, options) {
|
|
161
|
+
if (typeof file === 'string') file = matter(file, options);
|
|
162
|
+
return stringify(file, data, options);
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Synchronously read a file from the file system and parse
|
|
167
|
+
* front matter. Returns the same object as the [main function](#matter).
|
|
168
|
+
*
|
|
169
|
+
* ```js
|
|
170
|
+
* const file = matter.read('./content/blog-post.md');
|
|
171
|
+
* ```
|
|
172
|
+
* @param {String} `filepath` file path of the file to read.
|
|
173
|
+
* @param {Object} `options` [Options](#options) to pass to gray-matter.
|
|
174
|
+
* @return {Object} Returns [an object](#returned-object) with `data` and `content`
|
|
175
|
+
* @api public
|
|
176
|
+
*/
|
|
177
|
+
|
|
178
|
+
matter.read = function(filepath, options) {
|
|
179
|
+
const str = fs.readFileSync(filepath, 'utf8');
|
|
180
|
+
const file = matter(str, options);
|
|
181
|
+
file.path = filepath;
|
|
182
|
+
return file;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Returns true if the given `string` has front matter.
|
|
187
|
+
* @param {String} `string`
|
|
188
|
+
* @param {Object} `options`
|
|
189
|
+
* @return {Boolean} True if front matter exists.
|
|
190
|
+
* @api public
|
|
191
|
+
*/
|
|
192
|
+
|
|
193
|
+
matter.test = function(str, options) {
|
|
194
|
+
return utils.startsWith(str, defaults(options).delimiters[0]);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Detect the language to use, if one is defined after the
|
|
199
|
+
* first front-matter delimiter.
|
|
200
|
+
* @param {String} `string`
|
|
201
|
+
* @param {Object} `options`
|
|
202
|
+
* @return {Object} Object with `raw` (actual language string), and `name`, the language with whitespace trimmed
|
|
203
|
+
*/
|
|
204
|
+
|
|
205
|
+
matter.language = function(str, options) {
|
|
206
|
+
const opts = defaults(options);
|
|
207
|
+
const open = opts.delimiters[0];
|
|
208
|
+
|
|
209
|
+
if (matter.test(str)) {
|
|
210
|
+
str = str.slice(open.length);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const language = str.slice(0, str.search(/\r?\n/));
|
|
214
|
+
return {
|
|
215
|
+
raw: language,
|
|
216
|
+
name: language ? language.trim() : ''
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Expose `matter`
|
|
222
|
+
*/
|
|
223
|
+
|
|
224
|
+
matter.cache = {};
|
|
225
|
+
matter.clearCache = function() {
|
|
226
|
+
matter.cache = {};
|
|
227
|
+
};
|
|
228
|
+
module.exports = matter;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const engines = require('./engines');
|
|
4
|
+
const utils = require('./utils');
|
|
5
|
+
|
|
6
|
+
module.exports = function(options) {
|
|
7
|
+
const opts = Object.assign({}, options);
|
|
8
|
+
|
|
9
|
+
// ensure that delimiters are an array
|
|
10
|
+
opts.delimiters = utils.arrayify(opts.delims || opts.delimiters || '---');
|
|
11
|
+
if (opts.delimiters.length === 1) {
|
|
12
|
+
opts.delimiters.push(opts.delimiters[0]);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
opts.language = (opts.language || opts.lang || 'yaml').toLowerCase();
|
|
16
|
+
opts.engines = Object.assign({}, engines, opts.parsers, opts.engines);
|
|
17
|
+
return opts;
|
|
18
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = function(name, options) {
|
|
4
|
+
let engine = options.engines[name] || options.engines[aliase(name)];
|
|
5
|
+
if (typeof engine === 'undefined') {
|
|
6
|
+
throw new Error('gray-matter engine "' + name + '" is not registered');
|
|
7
|
+
}
|
|
8
|
+
if (typeof engine === 'function') {
|
|
9
|
+
engine = { parse: engine };
|
|
10
|
+
}
|
|
11
|
+
return engine;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
function aliase(name) {
|
|
15
|
+
switch (name.toLowerCase()) {
|
|
16
|
+
case 'js':
|
|
17
|
+
case 'javascript':
|
|
18
|
+
return 'javascript';
|
|
19
|
+
case 'coffee':
|
|
20
|
+
case 'coffeescript':
|
|
21
|
+
case 'cson':
|
|
22
|
+
return 'coffee';
|
|
23
|
+
case 'yaml':
|
|
24
|
+
case 'yml':
|
|
25
|
+
return 'yaml';
|
|
26
|
+
default: {
|
|
27
|
+
return name;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const yaml = require('js-yaml');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Default engines
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const engines = exports = module.exports;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* YAML
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
engines.yaml = {
|
|
16
|
+
parse: yaml.safeLoad.bind(yaml),
|
|
17
|
+
stringify: yaml.safeDump.bind(yaml)
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* JSON
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
engines.json = {
|
|
25
|
+
parse: JSON.parse.bind(JSON),
|
|
26
|
+
stringify: function(obj, options) {
|
|
27
|
+
const opts = Object.assign({replacer: null, space: 2}, options);
|
|
28
|
+
return JSON.stringify(obj, opts.replacer, opts.space);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* JavaScript
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
engines.javascript = {
|
|
37
|
+
parse: function parse(str, options, wrap) {
|
|
38
|
+
/* eslint no-eval: 0 */
|
|
39
|
+
try {
|
|
40
|
+
if (wrap !== false) {
|
|
41
|
+
str = '(function() {\nreturn ' + str.trim() + ';\n}());';
|
|
42
|
+
}
|
|
43
|
+
return eval(str) || {};
|
|
44
|
+
} catch (err) {
|
|
45
|
+
if (wrap !== false && /(unexpected|identifier)/i.test(err.message)) {
|
|
46
|
+
return parse(str, options, false);
|
|
47
|
+
}
|
|
48
|
+
throw new SyntaxError(err);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
stringify: function() {
|
|
52
|
+
throw new Error('stringifying JavaScript is not supported');
|
|
53
|
+
}
|
|
54
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const defaults = require('./defaults');
|
|
4
|
+
|
|
5
|
+
module.exports = function(file, options) {
|
|
6
|
+
const opts = defaults(options);
|
|
7
|
+
|
|
8
|
+
if (file.data == null) {
|
|
9
|
+
file.data = {};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (typeof opts.excerpt === 'function') {
|
|
13
|
+
return opts.excerpt(file, opts);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const sep = file.data.excerpt_separator || opts.excerpt_separator;
|
|
17
|
+
if (sep == null && (opts.excerpt === false || opts.excerpt == null)) {
|
|
18
|
+
return file;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const delimiter = typeof opts.excerpt === 'string'
|
|
22
|
+
? opts.excerpt
|
|
23
|
+
: (sep || opts.delimiters[0]);
|
|
24
|
+
|
|
25
|
+
// if enabled, get the excerpt defined after front-matter
|
|
26
|
+
const idx = file.content.indexOf(delimiter);
|
|
27
|
+
if (idx !== -1) {
|
|
28
|
+
file.excerpt = file.content.slice(0, idx);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return file;
|
|
32
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const getEngine = require('./engine');
|
|
4
|
+
const defaults = require('./defaults');
|
|
5
|
+
|
|
6
|
+
module.exports = function(language, str, options) {
|
|
7
|
+
const opts = defaults(options);
|
|
8
|
+
const engine = getEngine(language, opts);
|
|
9
|
+
if (typeof engine.parse !== 'function') {
|
|
10
|
+
throw new TypeError('expected "' + language + '.parse" to be a function');
|
|
11
|
+
}
|
|
12
|
+
return engine.parse(str, opts);
|
|
13
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const typeOf = require('kind-of');
|
|
4
|
+
const getEngine = require('./engine');
|
|
5
|
+
const defaults = require('./defaults');
|
|
6
|
+
|
|
7
|
+
module.exports = function(file, data, options) {
|
|
8
|
+
if (data == null && options == null) {
|
|
9
|
+
switch (typeOf(file)) {
|
|
10
|
+
case 'object':
|
|
11
|
+
data = file.data;
|
|
12
|
+
options = {};
|
|
13
|
+
break;
|
|
14
|
+
case 'string':
|
|
15
|
+
return file;
|
|
16
|
+
default: {
|
|
17
|
+
throw new TypeError('expected file to be a string or object');
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const str = file.content;
|
|
23
|
+
const opts = defaults(options);
|
|
24
|
+
if (data == null) {
|
|
25
|
+
if (!opts.data) return file;
|
|
26
|
+
data = opts.data;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const language = file.language || opts.language;
|
|
30
|
+
const engine = getEngine(language, opts);
|
|
31
|
+
if (typeof engine.stringify !== 'function') {
|
|
32
|
+
throw new TypeError('expected "' + language + '.stringify" to be a function');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
data = Object.assign({}, file.data, data);
|
|
36
|
+
const open = opts.delimiters[0];
|
|
37
|
+
const close = opts.delimiters[1];
|
|
38
|
+
const matter = engine.stringify(data, options).trim();
|
|
39
|
+
let buf = '';
|
|
40
|
+
|
|
41
|
+
if (matter !== '{}') {
|
|
42
|
+
buf = newline(open) + newline(matter) + newline(close);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (typeof file.excerpt === 'string' && file.excerpt !== '') {
|
|
46
|
+
if (str.indexOf(file.excerpt.trim()) === -1) {
|
|
47
|
+
buf += newline(file.excerpt) + newline(close);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return buf + newline(str);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
function newline(str) {
|
|
55
|
+
return str.slice(-1) !== '\n' ? str + '\n' : str;
|
|
56
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const typeOf = require('kind-of');
|
|
4
|
+
const stringify = require('./stringify');
|
|
5
|
+
const utils = require('./utils');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Normalize the given value to ensure an object is returned
|
|
9
|
+
* with the expected properties.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
module.exports = function(file) {
|
|
13
|
+
if (typeOf(file) !== 'object') {
|
|
14
|
+
file = { content: file };
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (typeOf(file.data) !== 'object') {
|
|
18
|
+
file.data = {};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// if file was passed as an object, ensure that
|
|
22
|
+
// "file.content" is set
|
|
23
|
+
if (file.contents && file.content == null) {
|
|
24
|
+
file.content = file.contents;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// set non-enumerable properties on the file object
|
|
28
|
+
utils.define(file, 'orig', utils.toBuffer(file.content));
|
|
29
|
+
utils.define(file, 'language', file.language || '');
|
|
30
|
+
utils.define(file, 'matter', file.matter || '');
|
|
31
|
+
utils.define(file, 'stringify', function(data, options) {
|
|
32
|
+
if (options && options.language) {
|
|
33
|
+
file.language = options.language;
|
|
34
|
+
}
|
|
35
|
+
return stringify(file, data, options);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// strip BOM and ensure that "file.content" is a string
|
|
39
|
+
file.content = utils.toString(file.content);
|
|
40
|
+
file.isEmpty = false;
|
|
41
|
+
file.excerpt = '';
|
|
42
|
+
return file;
|
|
43
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const stripBom = require('strip-bom-string');
|
|
4
|
+
const typeOf = require('kind-of');
|
|
5
|
+
|
|
6
|
+
exports.define = function(obj, key, val) {
|
|
7
|
+
Reflect.defineProperty(obj, key, {
|
|
8
|
+
enumerable: false,
|
|
9
|
+
configurable: true,
|
|
10
|
+
writable: true,
|
|
11
|
+
value: val
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Returns true if `val` is a buffer
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
exports.isBuffer = function(val) {
|
|
20
|
+
return typeOf(val) === 'buffer';
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Returns true if `val` is an object
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
exports.isObject = function(val) {
|
|
28
|
+
return typeOf(val) === 'object';
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Cast `input` to a buffer
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
exports.toBuffer = function(input) {
|
|
36
|
+
return typeof input === 'string' ? Buffer.from(input) : input;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Cast `val` to a string.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
exports.toString = function(input) {
|
|
44
|
+
if (exports.isBuffer(input)) return stripBom(String(input));
|
|
45
|
+
if (typeof input !== 'string') {
|
|
46
|
+
throw new TypeError('expected input to be a string or buffer');
|
|
47
|
+
}
|
|
48
|
+
return stripBom(input);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Cast `val` to an array.
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
exports.arrayify = function(val) {
|
|
56
|
+
return val ? (Array.isArray(val) ? val : [val]) : [];
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Returns true if `str` starts with `substr`.
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
exports.startsWith = function(str, substr, len) {
|
|
64
|
+
if (typeof len !== 'number') len = substr.length;
|
|
65
|
+
return str.slice(0, len) === substr;
|
|
66
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gray-matter",
|
|
3
|
+
"description": "Parse front-matter from a string or file. Fast, reliable and easy to use. Parses YAML front matter by default, but also has support for YAML, JSON, TOML or Coffee Front-Matter, with options to set custom delimiters. Used by metalsmith, assemble, verb and many other projects.",
|
|
4
|
+
"version": "4.0.3",
|
|
5
|
+
"homepage": "https://github.com/jonschlinkert/gray-matter",
|
|
6
|
+
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
|
7
|
+
"contributors": [
|
|
8
|
+
"Andrew Meyer (https://github.com/Ajedi32)",
|
|
9
|
+
"Brian Woodward (https://twitter.com/doowb)",
|
|
10
|
+
"Caesar Schinas (https://caesarschinas.com)",
|
|
11
|
+
"Ian Storm Taylor (http://ianstormtaylor.com)",
|
|
12
|
+
"Jon Schlinkert (http://twitter.com/jonschlinkert)",
|
|
13
|
+
"Osman Nuri Okumuş (http://onokumus.com)",
|
|
14
|
+
"Pawel Kadluczka (http://blog.3d-logic.com)",
|
|
15
|
+
"Rob Loach (http://robloach.net)",
|
|
16
|
+
"(https://github.com/heymind)",
|
|
17
|
+
"Zach Whaley (http://zachwhaleys.website)"
|
|
18
|
+
],
|
|
19
|
+
"repository": "jonschlinkert/gray-matter",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/jonschlinkert/gray-matter/issues"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"files": [
|
|
25
|
+
"gray-matter.d.ts",
|
|
26
|
+
"index.js",
|
|
27
|
+
"lib"
|
|
28
|
+
],
|
|
29
|
+
"main": "index.js",
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=6.0"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"test": "mocha"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"js-yaml": "^3.13.1",
|
|
38
|
+
"kind-of": "^6.0.2",
|
|
39
|
+
"section-matter": "^1.0.0",
|
|
40
|
+
"strip-bom-string": "^1.0.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"ansi-green": "^0.1.1",
|
|
44
|
+
"benchmarked": "^2.0.0",
|
|
45
|
+
"coffeescript": "^2.2.3",
|
|
46
|
+
"delimiter-regex": "^2.0.0",
|
|
47
|
+
"extend-shallow": "^3.0.2",
|
|
48
|
+
"front-matter": "^2.3.0",
|
|
49
|
+
"gulp-format-md": "^1.0.0",
|
|
50
|
+
"minimist": "^1.2.0",
|
|
51
|
+
"mocha": "^6.1.4",
|
|
52
|
+
"toml": "^2.3.3",
|
|
53
|
+
"vinyl": "^2.1.0",
|
|
54
|
+
"write": "^1.0.3"
|
|
55
|
+
},
|
|
56
|
+
"keywords": [
|
|
57
|
+
"assemble",
|
|
58
|
+
"coffee",
|
|
59
|
+
"coffee-script",
|
|
60
|
+
"data",
|
|
61
|
+
"docs",
|
|
62
|
+
"documentation",
|
|
63
|
+
"extract",
|
|
64
|
+
"extracting",
|
|
65
|
+
"front",
|
|
66
|
+
"front-matter",
|
|
67
|
+
"frontmatter",
|
|
68
|
+
"generate",
|
|
69
|
+
"generator",
|
|
70
|
+
"gh-pages",
|
|
71
|
+
"gray",
|
|
72
|
+
"javascript",
|
|
73
|
+
"jekyll",
|
|
74
|
+
"js",
|
|
75
|
+
"JSON",
|
|
76
|
+
"markdown",
|
|
77
|
+
"matter",
|
|
78
|
+
"parse",
|
|
79
|
+
"parser",
|
|
80
|
+
"parsing",
|
|
81
|
+
"site",
|
|
82
|
+
"static",
|
|
83
|
+
"template",
|
|
84
|
+
"toml",
|
|
85
|
+
"yaml",
|
|
86
|
+
"yfm"
|
|
87
|
+
],
|
|
88
|
+
"browser": {
|
|
89
|
+
"fs": false
|
|
90
|
+
},
|
|
91
|
+
"typings": "gray-matter.d.ts",
|
|
92
|
+
"eslintConfig": {
|
|
93
|
+
"rules": {
|
|
94
|
+
"no-console": 0
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"verb": {
|
|
98
|
+
"toc": false,
|
|
99
|
+
"layout": "default",
|
|
100
|
+
"tasks": [
|
|
101
|
+
"readme"
|
|
102
|
+
],
|
|
103
|
+
"plugins": [
|
|
104
|
+
"gulp-format-md"
|
|
105
|
+
],
|
|
106
|
+
"helpers": {
|
|
107
|
+
"examples": "./examples/helper.js"
|
|
108
|
+
},
|
|
109
|
+
"lint": {
|
|
110
|
+
"reflinks": true
|
|
111
|
+
},
|
|
112
|
+
"related": {
|
|
113
|
+
"list": [
|
|
114
|
+
"assemble",
|
|
115
|
+
"metalsmith",
|
|
116
|
+
"verb"
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
"reflinks": [
|
|
120
|
+
"coffe-script",
|
|
121
|
+
"generate",
|
|
122
|
+
"js-yaml",
|
|
123
|
+
"toml",
|
|
124
|
+
"update"
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015, Jon Schlinkert.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|