@dev-sergeev/datalab-kit 0.1.1 → 0.1.3
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 +26 -8
- package/THIRD_PARTY_NOTICES.md +6 -2
- package/dist/extension.js +8 -1
- package/dist/recap.d.ts +2 -0
- package/dist/recap.js +31 -0
- package/docs/adr/0002-package-delivery.md +2 -0
- package/node_modules/@gotgenes/pi-permission-system/src/authority/permission-prompt-component.ts +0 -11
- package/node_modules/@gotgenes/pi-permission-system/src/config/config-store.ts +0 -5
- package/node_modules/@gotgenes/pi-permission-system/src/index.ts +3 -15
- 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 +584 -0
- package/node_modules/@tifan/pi-recap/src/model-picker.ts +233 -0
- package/node_modules/@tifan/pi-recap/src/models.ts +183 -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/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.ts +316 -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/LICENSE +24 -0
- package/node_modules/sprintf-js/README.md +88 -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.js +36 -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/package.json +13 -4
- package/dist/confirmation.d.ts +0 -33
- package/dist/confirmation.js +0 -64
- package/dist/yolo.d.ts +0 -6
- package/dist/yolo.js +0 -33
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
var common = require('../common');
|
|
2
|
+
var assert = common.assert;
|
|
3
|
+
var fake = common.fake.create();
|
|
4
|
+
var retry = require(common.dir.lib + '/retry');
|
|
5
|
+
|
|
6
|
+
function getLib() {
|
|
7
|
+
return {
|
|
8
|
+
fn1: function() {},
|
|
9
|
+
fn2: function() {},
|
|
10
|
+
fn3: function() {}
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
(function wrapAll() {
|
|
15
|
+
var lib = getLib();
|
|
16
|
+
retry.wrap(lib);
|
|
17
|
+
assert.equal(lib.fn1.name, 'bound retryWrapper');
|
|
18
|
+
assert.equal(lib.fn2.name, 'bound retryWrapper');
|
|
19
|
+
assert.equal(lib.fn3.name, 'bound retryWrapper');
|
|
20
|
+
}());
|
|
21
|
+
|
|
22
|
+
(function wrapAllPassOptions() {
|
|
23
|
+
var lib = getLib();
|
|
24
|
+
retry.wrap(lib, {retries: 2});
|
|
25
|
+
assert.equal(lib.fn1.name, 'bound retryWrapper');
|
|
26
|
+
assert.equal(lib.fn2.name, 'bound retryWrapper');
|
|
27
|
+
assert.equal(lib.fn3.name, 'bound retryWrapper');
|
|
28
|
+
assert.equal(lib.fn1.options.retries, 2);
|
|
29
|
+
assert.equal(lib.fn2.options.retries, 2);
|
|
30
|
+
assert.equal(lib.fn3.options.retries, 2);
|
|
31
|
+
}());
|
|
32
|
+
|
|
33
|
+
(function wrapDefined() {
|
|
34
|
+
var lib = getLib();
|
|
35
|
+
retry.wrap(lib, ['fn2', 'fn3']);
|
|
36
|
+
assert.notEqual(lib.fn1.name, 'bound retryWrapper');
|
|
37
|
+
assert.equal(lib.fn2.name, 'bound retryWrapper');
|
|
38
|
+
assert.equal(lib.fn3.name, 'bound retryWrapper');
|
|
39
|
+
}());
|
|
40
|
+
|
|
41
|
+
(function wrapDefinedAndPassOptions() {
|
|
42
|
+
var lib = getLib();
|
|
43
|
+
retry.wrap(lib, {retries: 2}, ['fn2', 'fn3']);
|
|
44
|
+
assert.notEqual(lib.fn1.name, 'bound retryWrapper');
|
|
45
|
+
assert.equal(lib.fn2.name, 'bound retryWrapper');
|
|
46
|
+
assert.equal(lib.fn3.name, 'bound retryWrapper');
|
|
47
|
+
assert.equal(lib.fn2.options.retries, 2);
|
|
48
|
+
assert.equal(lib.fn3.options.retries, 2);
|
|
49
|
+
}());
|
|
50
|
+
|
|
51
|
+
(function runWrappedWithoutError() {
|
|
52
|
+
var callbackCalled;
|
|
53
|
+
var lib = {method: function(a, b, callback) {
|
|
54
|
+
assert.equal(a, 1);
|
|
55
|
+
assert.equal(b, 2);
|
|
56
|
+
assert.equal(typeof callback, 'function');
|
|
57
|
+
callback();
|
|
58
|
+
}};
|
|
59
|
+
retry.wrap(lib);
|
|
60
|
+
lib.method(1, 2, function() {
|
|
61
|
+
callbackCalled = true;
|
|
62
|
+
});
|
|
63
|
+
assert.ok(callbackCalled);
|
|
64
|
+
}());
|
|
65
|
+
|
|
66
|
+
(function runWrappedSeveralWithoutError() {
|
|
67
|
+
var callbacksCalled = 0;
|
|
68
|
+
var lib = {
|
|
69
|
+
fn1: function (a, callback) {
|
|
70
|
+
assert.equal(a, 1);
|
|
71
|
+
assert.equal(typeof callback, 'function');
|
|
72
|
+
callback();
|
|
73
|
+
},
|
|
74
|
+
fn2: function (a, callback) {
|
|
75
|
+
assert.equal(a, 2);
|
|
76
|
+
assert.equal(typeof callback, 'function');
|
|
77
|
+
callback();
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
retry.wrap(lib, {}, ['fn1', 'fn2']);
|
|
81
|
+
lib.fn1(1, function() {
|
|
82
|
+
callbacksCalled++;
|
|
83
|
+
});
|
|
84
|
+
lib.fn2(2, function() {
|
|
85
|
+
callbacksCalled++;
|
|
86
|
+
});
|
|
87
|
+
assert.equal(callbacksCalled, 2);
|
|
88
|
+
}());
|
|
89
|
+
|
|
90
|
+
(function runWrappedWithError() {
|
|
91
|
+
var callbackCalled;
|
|
92
|
+
var lib = {method: function(callback) {
|
|
93
|
+
callback(new Error('Some error'));
|
|
94
|
+
}};
|
|
95
|
+
retry.wrap(lib, {retries: 1});
|
|
96
|
+
lib.method(function(err) {
|
|
97
|
+
callbackCalled = true;
|
|
98
|
+
assert.ok(err instanceof Error);
|
|
99
|
+
});
|
|
100
|
+
assert.ok(!callbackCalled);
|
|
101
|
+
}());
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var common = require('../common');
|
|
2
|
+
var assert = common.assert;
|
|
3
|
+
var retry = require(common.dir.lib + '/retry');
|
|
4
|
+
|
|
5
|
+
(function testDefaultValues() {
|
|
6
|
+
var timeouts = retry.timeouts();
|
|
7
|
+
|
|
8
|
+
assert.equal(timeouts.length, 10);
|
|
9
|
+
assert.equal(timeouts[0], 1000);
|
|
10
|
+
assert.equal(timeouts[1], 2000);
|
|
11
|
+
assert.equal(timeouts[2], 4000);
|
|
12
|
+
})();
|
|
13
|
+
|
|
14
|
+
(function testDefaultValuesWithRandomize() {
|
|
15
|
+
var minTimeout = 5000;
|
|
16
|
+
var timeouts = retry.timeouts({
|
|
17
|
+
minTimeout: minTimeout,
|
|
18
|
+
randomize: true
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
assert.equal(timeouts.length, 10);
|
|
22
|
+
assert.ok(timeouts[0] > minTimeout);
|
|
23
|
+
assert.ok(timeouts[1] > timeouts[0]);
|
|
24
|
+
assert.ok(timeouts[2] > timeouts[1]);
|
|
25
|
+
})();
|
|
26
|
+
|
|
27
|
+
(function testPassedTimeoutsAreUsed() {
|
|
28
|
+
var timeoutsArray = [1000, 2000, 3000];
|
|
29
|
+
var timeouts = retry.timeouts(timeoutsArray);
|
|
30
|
+
assert.deepEqual(timeouts, timeoutsArray);
|
|
31
|
+
assert.notStrictEqual(timeouts, timeoutsArray);
|
|
32
|
+
})();
|
|
33
|
+
|
|
34
|
+
(function testTimeoutsAreWithinBoundaries() {
|
|
35
|
+
var minTimeout = 1000;
|
|
36
|
+
var maxTimeout = 10000;
|
|
37
|
+
var timeouts = retry.timeouts({
|
|
38
|
+
minTimeout: minTimeout,
|
|
39
|
+
maxTimeout: maxTimeout
|
|
40
|
+
});
|
|
41
|
+
for (var i = 0; i < timeouts; i++) {
|
|
42
|
+
assert.ok(timeouts[i] >= minTimeout);
|
|
43
|
+
assert.ok(timeouts[i] <= maxTimeout);
|
|
44
|
+
}
|
|
45
|
+
})();
|
|
46
|
+
|
|
47
|
+
(function testTimeoutsAreIncremental() {
|
|
48
|
+
var timeouts = retry.timeouts();
|
|
49
|
+
var lastTimeout = timeouts[0];
|
|
50
|
+
for (var i = 0; i < timeouts; i++) {
|
|
51
|
+
assert.ok(timeouts[i] > lastTimeout);
|
|
52
|
+
lastTimeout = timeouts[i];
|
|
53
|
+
}
|
|
54
|
+
})();
|
|
55
|
+
|
|
56
|
+
(function testTimeoutsAreIncrementalForFactorsLessThanOne() {
|
|
57
|
+
var timeouts = retry.timeouts({
|
|
58
|
+
retries: 3,
|
|
59
|
+
factor: 0.5
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
var expected = [250, 500, 1000];
|
|
63
|
+
assert.deepEqual(expected, timeouts);
|
|
64
|
+
})();
|
|
65
|
+
|
|
66
|
+
(function testRetries() {
|
|
67
|
+
var timeouts = retry.timeouts({retries: 2});
|
|
68
|
+
assert.strictEqual(timeouts.length, 2);
|
|
69
|
+
})();
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "proper-lockfile",
|
|
3
|
+
"version": "4.1.2",
|
|
4
|
+
"description": "A inter-process and inter-machine lockfile utility that works on a local or network file system",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"lock",
|
|
7
|
+
"locking",
|
|
8
|
+
"file",
|
|
9
|
+
"lockfile",
|
|
10
|
+
"fs",
|
|
11
|
+
"cross-process"
|
|
12
|
+
],
|
|
13
|
+
"author": "André Cruz <andre@moxy.studio>",
|
|
14
|
+
"homepage": "https://github.com/moxystudio/node-proper-lockfile",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git@github.com:moxystudio/node-proper-lockfile.git"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"main": "index.js",
|
|
21
|
+
"files": [
|
|
22
|
+
"lib"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"lint": "eslint .",
|
|
26
|
+
"test": "jest --env node --coverage --runInBand",
|
|
27
|
+
"prerelease": "npm t && npm run lint",
|
|
28
|
+
"release": "standard-version",
|
|
29
|
+
"postrelease": "git push --follow-tags origin HEAD && npm publish"
|
|
30
|
+
},
|
|
31
|
+
"husky": {
|
|
32
|
+
"hooks": {
|
|
33
|
+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
|
|
34
|
+
"pre-commit": "lint-staged"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"lint-staged": {
|
|
38
|
+
"*.js": [
|
|
39
|
+
"eslint --fix",
|
|
40
|
+
"git add"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"commitlint": {
|
|
44
|
+
"extends": [
|
|
45
|
+
"@commitlint/config-conventional"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"graceful-fs": "^4.2.4",
|
|
50
|
+
"retry": "^0.12.0",
|
|
51
|
+
"signal-exit": "^3.0.2"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@commitlint/cli": "^7.0.0",
|
|
55
|
+
"@commitlint/config-conventional": "^7.0.1",
|
|
56
|
+
"@segment/clear-timeouts": "^2.0.0",
|
|
57
|
+
"delay": "^4.1.0",
|
|
58
|
+
"eslint": "^5.3.0",
|
|
59
|
+
"eslint-config-moxy": "^7.1.0",
|
|
60
|
+
"execa": "^1.0.0",
|
|
61
|
+
"husky": "^1.1.4",
|
|
62
|
+
"jest": "^24.5.0",
|
|
63
|
+
"lint-staged": "^8.0.4",
|
|
64
|
+
"mkdirp": "^0.5.1",
|
|
65
|
+
"p-defer": "^2.1.0",
|
|
66
|
+
"rimraf": "^2.6.2",
|
|
67
|
+
"stable": "^0.1.8",
|
|
68
|
+
"standard-version": "^5.0.0",
|
|
69
|
+
"thread-sleep": "^2.1.0"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017, 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 all
|
|
13
|
+
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 THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# section-matter [](https://www.npmjs.com/package/section-matter) [](https://npmjs.org/package/section-matter) [](https://npmjs.org/package/section-matter) [](https://travis-ci.org/jonschlinkert/section-matter)
|
|
2
|
+
|
|
3
|
+
> Like front-matter, but supports multiple sections in a document.
|
|
4
|
+
|
|
5
|
+
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
Install with [npm](https://www.npmjs.com/):
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
$ npm install --save section-matter
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
**Params**
|
|
17
|
+
|
|
18
|
+
* `input` **{String|Buffer|Object}**: If input is an object, it's `content` property must be a string or buffer.
|
|
19
|
+
* **{Object}**: options
|
|
20
|
+
* `returns` **{Object}**: Returns an object with a `content` string and an array of `sections` objects.
|
|
21
|
+
|
|
22
|
+
**Example**
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
var sections = require('{%= name %}');
|
|
26
|
+
var result = sections(input, options);
|
|
27
|
+
// { content: 'Content before sections', sections: [] }
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
See available [options](#options).
|
|
31
|
+
|
|
32
|
+
## Example
|
|
33
|
+
|
|
34
|
+
_With the exception of front-matter, **which must be the very first thing in the string**, the opening delimiter of all other sections must be followed by a string to be used as the `key` for the section._
|
|
35
|
+
|
|
36
|
+
Given the following string:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
Content before the sections.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
More content.
|
|
44
|
+
|
|
45
|
+
---one
|
|
46
|
+
title: One
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
This is the first section.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The following code:
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
console.log(sections(input));
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Results in:
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
{
|
|
62
|
+
content: 'Content before the sections.\n\n---\n\nMore content.\n',
|
|
63
|
+
sections: [
|
|
64
|
+
{
|
|
65
|
+
key: 'one',
|
|
66
|
+
data: 'title: One',
|
|
67
|
+
content: '\nThis is the first section.'
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Options
|
|
74
|
+
|
|
75
|
+
### options.section_parse
|
|
76
|
+
|
|
77
|
+
**Type**: `function`
|
|
78
|
+
|
|
79
|
+
**Default**: `undefined`
|
|
80
|
+
|
|
81
|
+
Function to be called on each section after it's parsed from the string.
|
|
82
|
+
|
|
83
|
+
**Example**
|
|
84
|
+
|
|
85
|
+
Given the following string (`foo.md`):
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
This is content before the sections.
|
|
89
|
+
|
|
90
|
+
---one
|
|
91
|
+
title: First section
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
This is section one.
|
|
95
|
+
|
|
96
|
+
---two
|
|
97
|
+
title: Second section
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
This is section two.
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Using the following custom `section_parse` function:
|
|
104
|
+
|
|
105
|
+
```js
|
|
106
|
+
var fs = require('fs');
|
|
107
|
+
var path = require('path');
|
|
108
|
+
var yaml = require('js-yaml');
|
|
109
|
+
var sections = require('section-matter');
|
|
110
|
+
|
|
111
|
+
var str = fs.readFileSync('foo.md');
|
|
112
|
+
var options = {
|
|
113
|
+
section_parse: function(section) {
|
|
114
|
+
console.log(section)
|
|
115
|
+
section.key = 'section-' + section.key;
|
|
116
|
+
section.data = yaml.safeLoad(section.data);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
var result = sections(str, options);
|
|
121
|
+
console.log(result);
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Results in:
|
|
125
|
+
|
|
126
|
+
```js
|
|
127
|
+
{
|
|
128
|
+
content: 'This is content before the sections.\n',
|
|
129
|
+
sections: [
|
|
130
|
+
{
|
|
131
|
+
key: 'section-one',
|
|
132
|
+
data: { title: 'First section' },
|
|
133
|
+
content: '\nThis is section one.\n'
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
key: 'section-two',
|
|
137
|
+
data: { title: 'Second section' },
|
|
138
|
+
content: '\nThis is section two.\n'
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### options.section_delimiter
|
|
145
|
+
|
|
146
|
+
**Type**: `string`
|
|
147
|
+
|
|
148
|
+
**Default**: `---`
|
|
149
|
+
|
|
150
|
+
Delimiter to use as the separator for sections. _With the exception of front-matter, which must be the very first thing in the string, the opening delimiter of all other sections must be followed by a string to be used as the `key` for the section._
|
|
151
|
+
|
|
152
|
+
**Example**
|
|
153
|
+
|
|
154
|
+
```js
|
|
155
|
+
var input = '~~~\ntitle: bar\n~~~\n\nfoo\n~~~one\ntitle: One\n~~~\nThis is one';
|
|
156
|
+
console.log(sections(input, {section_delimiter: '~~~'}));
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Results in:
|
|
160
|
+
|
|
161
|
+
```js
|
|
162
|
+
{
|
|
163
|
+
content: '',
|
|
164
|
+
sections: [
|
|
165
|
+
{
|
|
166
|
+
key: '',
|
|
167
|
+
data: 'title: bar',
|
|
168
|
+
content: '\nfoo'
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
key: 'one',
|
|
172
|
+
data: 'title: One',
|
|
173
|
+
content: 'This is one'
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## About
|
|
180
|
+
<details>
|
|
181
|
+
<summary><strong>Contributing</strong></summary>
|
|
182
|
+
|
|
183
|
+
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
|
184
|
+
|
|
185
|
+
Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.
|
|
186
|
+
|
|
187
|
+
</details>
|
|
188
|
+
|
|
189
|
+
<details>
|
|
190
|
+
<summary><strong>Running Tests</strong></summary>
|
|
191
|
+
|
|
192
|
+
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
|
|
193
|
+
|
|
194
|
+
```sh
|
|
195
|
+
$ npm install && npm test
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
</details>
|
|
199
|
+
|
|
200
|
+
<details>
|
|
201
|
+
<summary><strong>Building docs</strong></summary>
|
|
202
|
+
|
|
203
|
+
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
|
|
204
|
+
|
|
205
|
+
To generate the readme, run the following command:
|
|
206
|
+
|
|
207
|
+
```sh
|
|
208
|
+
$ npm install -g verbose/verb#dev verb-generate-readme && verb
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
</details>
|
|
212
|
+
|
|
213
|
+
### Related projects
|
|
214
|
+
|
|
215
|
+
You might also be interested in these projects:
|
|
216
|
+
|
|
217
|
+
- [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit")
|
|
218
|
+
- [gray-matter](https://www.npmjs.com/package/gray-matter): Parse front-matter from a string or file. Fast, reliable and easy to use. Parses YAML… [more](https://github.com/jonschlinkert/gray-matter) | [homepage](https://github.com/jonschlinkert/gray-matter "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 ")
|
|
219
|
+
- [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.")
|
|
220
|
+
|
|
221
|
+
### Contributors
|
|
222
|
+
|
|
223
|
+
### Author
|
|
224
|
+
**Jon Schlinkert**
|
|
225
|
+
|
|
226
|
+
+ [github/jonschlinkert](https://github.com/jonschlinkert)
|
|
227
|
+
+ [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
|
|
228
|
+
|
|
229
|
+
### License
|
|
230
|
+
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
|
|
231
|
+
Released under the [MIT License](LICENSE).
|
|
232
|
+
|
|
233
|
+
***
|
|
234
|
+
|
|
235
|
+
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on October 23, 2017._
|
|
236
|
+
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var typeOf = require('kind-of');
|
|
4
|
+
var extend = require('extend-shallow');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Parse sections in `input` with the given `options`.
|
|
8
|
+
*
|
|
9
|
+
* ```js
|
|
10
|
+
* var sections = require('{%= name %}');
|
|
11
|
+
* var result = sections(input, options);
|
|
12
|
+
* // { content: 'Content before sections', sections: [] }
|
|
13
|
+
* ```
|
|
14
|
+
* @param {String|Buffer|Object} `input` If input is an object, it's `content` property must be a string or buffer.
|
|
15
|
+
* @param {Object} options
|
|
16
|
+
* @return {Object} Returns an object with a `content` string and an array of `sections` objects.
|
|
17
|
+
* @api public
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
module.exports = function(input, options) {
|
|
21
|
+
if (typeof options === 'function') {
|
|
22
|
+
options = { parse: options };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var file = toObject(input);
|
|
26
|
+
var defaults = {section_delimiter: '---', parse: identity};
|
|
27
|
+
var opts = extend({}, defaults, options);
|
|
28
|
+
var delim = opts.section_delimiter;
|
|
29
|
+
var lines = file.content.split(/\r?\n/);
|
|
30
|
+
var sections = null;
|
|
31
|
+
var section = createSection();
|
|
32
|
+
var content = [];
|
|
33
|
+
var stack = [];
|
|
34
|
+
|
|
35
|
+
function initSections(val) {
|
|
36
|
+
file.content = val;
|
|
37
|
+
sections = [];
|
|
38
|
+
content = [];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function closeSection(val) {
|
|
42
|
+
if (stack.length) {
|
|
43
|
+
section.key = getKey(stack[0], delim);
|
|
44
|
+
section.content = val;
|
|
45
|
+
opts.parse(section, sections);
|
|
46
|
+
sections.push(section);
|
|
47
|
+
section = createSection();
|
|
48
|
+
content = [];
|
|
49
|
+
stack = [];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
for (var i = 0; i < lines.length; i++) {
|
|
54
|
+
var line = lines[i];
|
|
55
|
+
var len = stack.length;
|
|
56
|
+
var ln = line.trim();
|
|
57
|
+
|
|
58
|
+
if (isDelimiter(ln, delim)) {
|
|
59
|
+
if (ln.length === 3 && i !== 0) {
|
|
60
|
+
if (len === 0 || len === 2) {
|
|
61
|
+
content.push(line);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
stack.push(ln);
|
|
65
|
+
section.data = content.join('\n');
|
|
66
|
+
content = [];
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (sections === null) {
|
|
71
|
+
initSections(content.join('\n'));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (len === 2) {
|
|
75
|
+
closeSection(content.join('\n'));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
stack.push(ln);
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
content.push(line);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (sections === null) {
|
|
86
|
+
initSections(content.join('\n'));
|
|
87
|
+
} else {
|
|
88
|
+
closeSection(content.join('\n'));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
file.sections = sections;
|
|
92
|
+
return file;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
function isDelimiter(line, delim) {
|
|
96
|
+
if (line.slice(0, delim.length) !== delim) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
if (line.charAt(delim.length + 1) === delim.slice(-1)) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function toObject(input) {
|
|
106
|
+
if (typeOf(input) !== 'object') {
|
|
107
|
+
input = { content: input };
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (typeof input.content !== 'string' && !isBuffer(input.content)) {
|
|
111
|
+
throw new TypeError('expected a buffer or string');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
input.content = input.content.toString();
|
|
115
|
+
input.sections = [];
|
|
116
|
+
return input;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function getKey(val, delim) {
|
|
120
|
+
return val ? val.slice(delim.length).trim() : '';
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function createSection() {
|
|
124
|
+
return { key: '', data: '', content: '' };
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function identity(val) {
|
|
128
|
+
return val;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function isBuffer(val) {
|
|
132
|
+
if (val && val.constructor && typeof val.constructor.isBuffer === 'function') {
|
|
133
|
+
return val.constructor.isBuffer(val);
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "section-matter",
|
|
3
|
+
"description": "Like front-matter, but supports multiple sections in a document.",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"homepage": "https://github.com/jonschlinkert/section-matter",
|
|
6
|
+
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
|
7
|
+
"repository": "jonschlinkert/section-matter",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://github.com/jonschlinkert/section-matter/issues"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"files": [
|
|
13
|
+
"index.js"
|
|
14
|
+
],
|
|
15
|
+
"main": "index.js",
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=4"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"test": "mocha"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"extend-shallow": "^2.0.1",
|
|
24
|
+
"kind-of": "^6.0.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"gulp-format-md": "^1.0.0",
|
|
28
|
+
"js-yaml": "^3.10.0",
|
|
29
|
+
"mocha": "^4.0.1"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"matter",
|
|
33
|
+
"section"
|
|
34
|
+
],
|
|
35
|
+
"verb": {
|
|
36
|
+
"toc": false,
|
|
37
|
+
"layout": "default",
|
|
38
|
+
"tasks": [
|
|
39
|
+
"readme"
|
|
40
|
+
],
|
|
41
|
+
"plugins": [
|
|
42
|
+
"gulp-format-md"
|
|
43
|
+
],
|
|
44
|
+
"related": {
|
|
45
|
+
"list": [
|
|
46
|
+
"gray-matter",
|
|
47
|
+
"assemble",
|
|
48
|
+
"verb"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"lint": {
|
|
52
|
+
"reflinks": true
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
The ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015, Contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software
|
|
6
|
+
for any purpose with or without fee is hereby granted, provided
|
|
7
|
+
that the above copyright notice and this permission notice
|
|
8
|
+
appear in all copies.
|
|
9
|
+
|
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
11
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
|
12
|
+
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
|
|
13
|
+
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
|
14
|
+
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
15
|
+
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
16
|
+
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|