@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,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* class Namespace
|
|
3
|
+
*
|
|
4
|
+
* Simple object for storing attributes. Implements equality by attribute names
|
|
5
|
+
* and values, and provides a simple string representation.
|
|
6
|
+
*
|
|
7
|
+
* See also [original guide][1]
|
|
8
|
+
*
|
|
9
|
+
* [1]:http://docs.python.org/dev/library/argparse.html#the-namespace-object
|
|
10
|
+
**/
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
var $$ = require('./utils');
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* new Namespace(options)
|
|
17
|
+
* - options(object): predefined propertis for result object
|
|
18
|
+
*
|
|
19
|
+
**/
|
|
20
|
+
var Namespace = module.exports = function Namespace(options) {
|
|
21
|
+
$$.extend(this, options);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Namespace#isset(key) -> Boolean
|
|
26
|
+
* - key (string|number): property name
|
|
27
|
+
*
|
|
28
|
+
* Tells whenever `namespace` contains given `key` or not.
|
|
29
|
+
**/
|
|
30
|
+
Namespace.prototype.isset = function (key) {
|
|
31
|
+
return $$.has(this, key);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Namespace#set(key, value) -> self
|
|
36
|
+
* -key (string|number|object): propery name
|
|
37
|
+
* -value (mixed): new property value
|
|
38
|
+
*
|
|
39
|
+
* Set the property named key with value.
|
|
40
|
+
* If key object then set all key properties to namespace object
|
|
41
|
+
**/
|
|
42
|
+
Namespace.prototype.set = function (key, value) {
|
|
43
|
+
if (typeof (key) === 'object') {
|
|
44
|
+
$$.extend(this, key);
|
|
45
|
+
} else {
|
|
46
|
+
this[key] = value;
|
|
47
|
+
}
|
|
48
|
+
return this;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Namespace#get(key, defaultValue) -> mixed
|
|
53
|
+
* - key (string|number): property name
|
|
54
|
+
* - defaultValue (mixed): default value
|
|
55
|
+
*
|
|
56
|
+
* Return the property key or defaulValue if not set
|
|
57
|
+
**/
|
|
58
|
+
Namespace.prototype.get = function (key, defaultValue) {
|
|
59
|
+
return !this[key] ? defaultValue : this[key];
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Namespace#unset(key, defaultValue) -> mixed
|
|
64
|
+
* - key (string|number): property name
|
|
65
|
+
* - defaultValue (mixed): default value
|
|
66
|
+
*
|
|
67
|
+
* Return data[key](and delete it) or defaultValue
|
|
68
|
+
**/
|
|
69
|
+
Namespace.prototype.unset = function (key, defaultValue) {
|
|
70
|
+
var value = this[key];
|
|
71
|
+
if (value !== null) {
|
|
72
|
+
delete this[key];
|
|
73
|
+
return value;
|
|
74
|
+
}
|
|
75
|
+
return defaultValue;
|
|
76
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.repeat = function (str, num) {
|
|
4
|
+
var result = '';
|
|
5
|
+
for (var i = 0; i < num; i++) { result += str; }
|
|
6
|
+
return result;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
exports.arrayEqual = function (a, b) {
|
|
10
|
+
if (a.length !== b.length) { return false; }
|
|
11
|
+
for (var i = 0; i < a.length; i++) {
|
|
12
|
+
if (a[i] !== b[i]) { return false; }
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.trimChars = function (str, chars) {
|
|
18
|
+
var start = 0;
|
|
19
|
+
var end = str.length - 1;
|
|
20
|
+
while (chars.indexOf(str.charAt(start)) >= 0) { start++; }
|
|
21
|
+
while (chars.indexOf(str.charAt(end)) >= 0) { end--; }
|
|
22
|
+
return str.slice(start, end + 1);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.capitalize = function (str) {
|
|
26
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
exports.arrayUnion = function () {
|
|
30
|
+
var result = [];
|
|
31
|
+
for (var i = 0, values = {}; i < arguments.length; i++) {
|
|
32
|
+
var arr = arguments[i];
|
|
33
|
+
for (var j = 0; j < arr.length; j++) {
|
|
34
|
+
if (!values[arr[j]]) {
|
|
35
|
+
values[arr[j]] = true;
|
|
36
|
+
result.push(arr[j]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
function has(obj, key) {
|
|
44
|
+
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
exports.has = has;
|
|
48
|
+
|
|
49
|
+
exports.extend = function (dest, src) {
|
|
50
|
+
for (var i in src) {
|
|
51
|
+
if (has(src, i)) { dest[i] = src[i]; }
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
exports.trimEnd = function (str) {
|
|
56
|
+
return str.replace(/\s+$/g, '');
|
|
57
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "argparse",
|
|
3
|
+
"description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library",
|
|
4
|
+
"version": "1.0.10",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cli",
|
|
7
|
+
"parser",
|
|
8
|
+
"argparse",
|
|
9
|
+
"option",
|
|
10
|
+
"args"
|
|
11
|
+
],
|
|
12
|
+
"contributors": [
|
|
13
|
+
"Eugene Shkuropat",
|
|
14
|
+
"Paul Jacobson"
|
|
15
|
+
],
|
|
16
|
+
"files": [
|
|
17
|
+
"index.js",
|
|
18
|
+
"lib/"
|
|
19
|
+
],
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"repository": "nodeca/argparse",
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "make test"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"sprintf-js": "~1.0.2"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"eslint": "^2.13.1",
|
|
30
|
+
"istanbul": "^0.4.5",
|
|
31
|
+
"mocha": "^3.1.0",
|
|
32
|
+
"ndoc": "^5.0.1"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Copyright JS Foundation and other contributors, https://js.foundation/
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
* Redistributions of source code must retain the above copyright
|
|
7
|
+
notice, this list of conditions and the following disclaimer.
|
|
8
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
9
|
+
notice, this list of conditions and the following disclaimer in the
|
|
10
|
+
documentation and/or other materials provided with the distribution.
|
|
11
|
+
|
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
13
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
14
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
15
|
+
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
|
16
|
+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
17
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
18
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
19
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
20
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
21
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
[](https://www.npmjs.com/package/esprima)
|
|
2
|
+
[](https://www.npmjs.com/package/esprima)
|
|
3
|
+
[](https://travis-ci.org/jquery/esprima)
|
|
4
|
+
[](https://codecov.io/github/jquery/esprima)
|
|
5
|
+
|
|
6
|
+
**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance,
|
|
7
|
+
standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
|
|
8
|
+
parser written in ECMAScript (also popularly known as
|
|
9
|
+
[JavaScript](https://en.wikipedia.org/wiki/JavaScript)).
|
|
10
|
+
Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat),
|
|
11
|
+
with the help of [many contributors](https://github.com/jquery/esprima/contributors).
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- Full support for ECMAScript 2017 ([ECMA-262 8th Edition](http://www.ecma-international.org/publications/standards/Ecma-262.htm))
|
|
16
|
+
- Sensible [syntax tree format](https://github.com/estree/estree/blob/master/es5.md) as standardized by [ESTree project](https://github.com/estree/estree)
|
|
17
|
+
- Experimental support for [JSX](https://facebook.github.io/jsx/), a syntax extension for [React](https://facebook.github.io/react/)
|
|
18
|
+
- Optional tracking of syntax node location (index-based and line-column)
|
|
19
|
+
- [Heavily tested](http://esprima.org/test/ci.html) (~1500 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://codecov.io/github/jquery/esprima))
|
|
20
|
+
|
|
21
|
+
### API
|
|
22
|
+
|
|
23
|
+
Esprima can be used to perform [lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis) (tokenization) or [syntactic analysis](https://en.wikipedia.org/wiki/Parsing) (parsing) of a JavaScript program.
|
|
24
|
+
|
|
25
|
+
A simple example on Node.js REPL:
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
> var esprima = require('esprima');
|
|
29
|
+
> var program = 'const answer = 42';
|
|
30
|
+
|
|
31
|
+
> esprima.tokenize(program);
|
|
32
|
+
[ { type: 'Keyword', value: 'const' },
|
|
33
|
+
{ type: 'Identifier', value: 'answer' },
|
|
34
|
+
{ type: 'Punctuator', value: '=' },
|
|
35
|
+
{ type: 'Numeric', value: '42' } ]
|
|
36
|
+
|
|
37
|
+
> esprima.parseScript(program);
|
|
38
|
+
{ type: 'Program',
|
|
39
|
+
body:
|
|
40
|
+
[ { type: 'VariableDeclaration',
|
|
41
|
+
declarations: [Object],
|
|
42
|
+
kind: 'const' } ],
|
|
43
|
+
sourceType: 'script' }
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
For more information, please read the [complete documentation](http://esprima.org/doc).
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/*
|
|
3
|
+
Copyright JS Foundation and other contributors, https://js.foundation/
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
* Redistributions of source code must retain the above copyright
|
|
9
|
+
notice, this list of conditions and the following disclaimer.
|
|
10
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
11
|
+
notice, this list of conditions and the following disclaimer in the
|
|
12
|
+
documentation and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
15
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
16
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
17
|
+
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
|
18
|
+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
19
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
20
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
21
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
22
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
23
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/*jslint sloppy:true node:true rhino:true */
|
|
27
|
+
|
|
28
|
+
var fs, esprima, fname, forceFile, content, options, syntax;
|
|
29
|
+
|
|
30
|
+
if (typeof require === 'function') {
|
|
31
|
+
fs = require('fs');
|
|
32
|
+
try {
|
|
33
|
+
esprima = require('esprima');
|
|
34
|
+
} catch (e) {
|
|
35
|
+
esprima = require('../');
|
|
36
|
+
}
|
|
37
|
+
} else if (typeof load === 'function') {
|
|
38
|
+
try {
|
|
39
|
+
load('esprima.js');
|
|
40
|
+
} catch (e) {
|
|
41
|
+
load('../esprima.js');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Shims to Node.js objects when running under Rhino.
|
|
46
|
+
if (typeof console === 'undefined' && typeof process === 'undefined') {
|
|
47
|
+
console = { log: print };
|
|
48
|
+
fs = { readFileSync: readFile };
|
|
49
|
+
process = { argv: arguments, exit: quit };
|
|
50
|
+
process.argv.unshift('esparse.js');
|
|
51
|
+
process.argv.unshift('rhino');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function showUsage() {
|
|
55
|
+
console.log('Usage:');
|
|
56
|
+
console.log(' esparse [options] [file.js]');
|
|
57
|
+
console.log();
|
|
58
|
+
console.log('Available options:');
|
|
59
|
+
console.log();
|
|
60
|
+
console.log(' --comment Gather all line and block comments in an array');
|
|
61
|
+
console.log(' --loc Include line-column location info for each syntax node');
|
|
62
|
+
console.log(' --range Include index-based range for each syntax node');
|
|
63
|
+
console.log(' --raw Display the raw value of literals');
|
|
64
|
+
console.log(' --tokens List all tokens in an array');
|
|
65
|
+
console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)');
|
|
66
|
+
console.log(' -v, --version Shows program version');
|
|
67
|
+
console.log();
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
options = {};
|
|
72
|
+
|
|
73
|
+
process.argv.splice(2).forEach(function (entry) {
|
|
74
|
+
|
|
75
|
+
if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') {
|
|
76
|
+
if (typeof fname === 'string') {
|
|
77
|
+
console.log('Error: more than one input file.');
|
|
78
|
+
process.exit(1);
|
|
79
|
+
} else {
|
|
80
|
+
fname = entry;
|
|
81
|
+
}
|
|
82
|
+
} else if (entry === '-h' || entry === '--help') {
|
|
83
|
+
showUsage();
|
|
84
|
+
} else if (entry === '-v' || entry === '--version') {
|
|
85
|
+
console.log('ECMAScript Parser (using Esprima version', esprima.version, ')');
|
|
86
|
+
console.log();
|
|
87
|
+
process.exit(0);
|
|
88
|
+
} else if (entry === '--comment') {
|
|
89
|
+
options.comment = true;
|
|
90
|
+
} else if (entry === '--loc') {
|
|
91
|
+
options.loc = true;
|
|
92
|
+
} else if (entry === '--range') {
|
|
93
|
+
options.range = true;
|
|
94
|
+
} else if (entry === '--raw') {
|
|
95
|
+
options.raw = true;
|
|
96
|
+
} else if (entry === '--tokens') {
|
|
97
|
+
options.tokens = true;
|
|
98
|
+
} else if (entry === '--tolerant') {
|
|
99
|
+
options.tolerant = true;
|
|
100
|
+
} else if (entry === '--') {
|
|
101
|
+
forceFile = true;
|
|
102
|
+
} else {
|
|
103
|
+
console.log('Error: unknown option ' + entry + '.');
|
|
104
|
+
process.exit(1);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// Special handling for regular expression literal since we need to
|
|
109
|
+
// convert it to a string literal, otherwise it will be decoded
|
|
110
|
+
// as object "{}" and the regular expression would be lost.
|
|
111
|
+
function adjustRegexLiteral(key, value) {
|
|
112
|
+
if (key === 'value' && value instanceof RegExp) {
|
|
113
|
+
value = value.toString();
|
|
114
|
+
}
|
|
115
|
+
return value;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function run(content) {
|
|
119
|
+
syntax = esprima.parse(content, options);
|
|
120
|
+
console.log(JSON.stringify(syntax, adjustRegexLiteral, 4));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
try {
|
|
124
|
+
if (fname && (fname !== '-' || forceFile)) {
|
|
125
|
+
run(fs.readFileSync(fname, 'utf-8'));
|
|
126
|
+
} else {
|
|
127
|
+
var content = '';
|
|
128
|
+
process.stdin.resume();
|
|
129
|
+
process.stdin.on('data', function(chunk) {
|
|
130
|
+
content += chunk;
|
|
131
|
+
});
|
|
132
|
+
process.stdin.on('end', function() {
|
|
133
|
+
run(content);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
} catch (e) {
|
|
137
|
+
console.log('Error: ' + e.message);
|
|
138
|
+
process.exit(1);
|
|
139
|
+
}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/*
|
|
3
|
+
Copyright JS Foundation and other contributors, https://js.foundation/
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
* Redistributions of source code must retain the above copyright
|
|
9
|
+
notice, this list of conditions and the following disclaimer.
|
|
10
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
11
|
+
notice, this list of conditions and the following disclaimer in the
|
|
12
|
+
documentation and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
15
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
16
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
17
|
+
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
|
18
|
+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
19
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
20
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
21
|
+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
22
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
23
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/*jslint sloppy:true plusplus:true node:true rhino:true */
|
|
27
|
+
/*global phantom:true */
|
|
28
|
+
|
|
29
|
+
var fs, system, esprima, options, fnames, forceFile, count;
|
|
30
|
+
|
|
31
|
+
if (typeof esprima === 'undefined') {
|
|
32
|
+
// PhantomJS can only require() relative files
|
|
33
|
+
if (typeof phantom === 'object') {
|
|
34
|
+
fs = require('fs');
|
|
35
|
+
system = require('system');
|
|
36
|
+
esprima = require('./esprima');
|
|
37
|
+
} else if (typeof require === 'function') {
|
|
38
|
+
fs = require('fs');
|
|
39
|
+
try {
|
|
40
|
+
esprima = require('esprima');
|
|
41
|
+
} catch (e) {
|
|
42
|
+
esprima = require('../');
|
|
43
|
+
}
|
|
44
|
+
} else if (typeof load === 'function') {
|
|
45
|
+
try {
|
|
46
|
+
load('esprima.js');
|
|
47
|
+
} catch (e) {
|
|
48
|
+
load('../esprima.js');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Shims to Node.js objects when running under PhantomJS 1.7+.
|
|
54
|
+
if (typeof phantom === 'object') {
|
|
55
|
+
fs.readFileSync = fs.read;
|
|
56
|
+
process = {
|
|
57
|
+
argv: [].slice.call(system.args),
|
|
58
|
+
exit: phantom.exit,
|
|
59
|
+
on: function (evt, callback) {
|
|
60
|
+
callback();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
process.argv.unshift('phantomjs');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Shims to Node.js objects when running under Rhino.
|
|
67
|
+
if (typeof console === 'undefined' && typeof process === 'undefined') {
|
|
68
|
+
console = { log: print };
|
|
69
|
+
fs = { readFileSync: readFile };
|
|
70
|
+
process = {
|
|
71
|
+
argv: arguments,
|
|
72
|
+
exit: quit,
|
|
73
|
+
on: function (evt, callback) {
|
|
74
|
+
callback();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
process.argv.unshift('esvalidate.js');
|
|
78
|
+
process.argv.unshift('rhino');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function showUsage() {
|
|
82
|
+
console.log('Usage:');
|
|
83
|
+
console.log(' esvalidate [options] [file.js...]');
|
|
84
|
+
console.log();
|
|
85
|
+
console.log('Available options:');
|
|
86
|
+
console.log();
|
|
87
|
+
console.log(' --format=type Set the report format, plain (default) or junit');
|
|
88
|
+
console.log(' -v, --version Print program version');
|
|
89
|
+
console.log();
|
|
90
|
+
process.exit(1);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
options = {
|
|
94
|
+
format: 'plain'
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
fnames = [];
|
|
98
|
+
|
|
99
|
+
process.argv.splice(2).forEach(function (entry) {
|
|
100
|
+
|
|
101
|
+
if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') {
|
|
102
|
+
fnames.push(entry);
|
|
103
|
+
} else if (entry === '-h' || entry === '--help') {
|
|
104
|
+
showUsage();
|
|
105
|
+
} else if (entry === '-v' || entry === '--version') {
|
|
106
|
+
console.log('ECMAScript Validator (using Esprima version', esprima.version, ')');
|
|
107
|
+
console.log();
|
|
108
|
+
process.exit(0);
|
|
109
|
+
} else if (entry.slice(0, 9) === '--format=') {
|
|
110
|
+
options.format = entry.slice(9);
|
|
111
|
+
if (options.format !== 'plain' && options.format !== 'junit') {
|
|
112
|
+
console.log('Error: unknown report format ' + options.format + '.');
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
} else if (entry === '--') {
|
|
116
|
+
forceFile = true;
|
|
117
|
+
} else {
|
|
118
|
+
console.log('Error: unknown option ' + entry + '.');
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
if (fnames.length === 0) {
|
|
124
|
+
fnames.push('');
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (options.format === 'junit') {
|
|
128
|
+
console.log('<?xml version="1.0" encoding="UTF-8"?>');
|
|
129
|
+
console.log('<testsuites>');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
count = 0;
|
|
133
|
+
|
|
134
|
+
function run(fname, content) {
|
|
135
|
+
var timestamp, syntax, name;
|
|
136
|
+
try {
|
|
137
|
+
if (typeof content !== 'string') {
|
|
138
|
+
throw content;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (content[0] === '#' && content[1] === '!') {
|
|
142
|
+
content = '//' + content.substr(2, content.length);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
timestamp = Date.now();
|
|
146
|
+
syntax = esprima.parse(content, { tolerant: true });
|
|
147
|
+
|
|
148
|
+
if (options.format === 'junit') {
|
|
149
|
+
|
|
150
|
+
name = fname;
|
|
151
|
+
if (name.lastIndexOf('/') >= 0) {
|
|
152
|
+
name = name.slice(name.lastIndexOf('/') + 1);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
console.log('<testsuite name="' + fname + '" errors="0" ' +
|
|
156
|
+
' failures="' + syntax.errors.length + '" ' +
|
|
157
|
+
' tests="' + syntax.errors.length + '" ' +
|
|
158
|
+
' time="' + Math.round((Date.now() - timestamp) / 1000) +
|
|
159
|
+
'">');
|
|
160
|
+
|
|
161
|
+
syntax.errors.forEach(function (error) {
|
|
162
|
+
var msg = error.message;
|
|
163
|
+
msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
|
|
164
|
+
console.log(' <testcase name="Line ' + error.lineNumber + ': ' + msg + '" ' +
|
|
165
|
+
' time="0">');
|
|
166
|
+
console.log(' <error type="SyntaxError" message="' + error.message + '">' +
|
|
167
|
+
error.message + '(' + name + ':' + error.lineNumber + ')' +
|
|
168
|
+
'</error>');
|
|
169
|
+
console.log(' </testcase>');
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
console.log('</testsuite>');
|
|
173
|
+
|
|
174
|
+
} else if (options.format === 'plain') {
|
|
175
|
+
|
|
176
|
+
syntax.errors.forEach(function (error) {
|
|
177
|
+
var msg = error.message;
|
|
178
|
+
msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
|
|
179
|
+
msg = fname + ':' + error.lineNumber + ': ' + msg;
|
|
180
|
+
console.log(msg);
|
|
181
|
+
++count;
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
}
|
|
185
|
+
} catch (e) {
|
|
186
|
+
++count;
|
|
187
|
+
if (options.format === 'junit') {
|
|
188
|
+
console.log('<testsuite name="' + fname + '" errors="1" failures="0" tests="1" ' +
|
|
189
|
+
' time="' + Math.round((Date.now() - timestamp) / 1000) + '">');
|
|
190
|
+
console.log(' <testcase name="' + e.message + '" ' + ' time="0">');
|
|
191
|
+
console.log(' <error type="ParseError" message="' + e.message + '">' +
|
|
192
|
+
e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') +
|
|
193
|
+
')</error>');
|
|
194
|
+
console.log(' </testcase>');
|
|
195
|
+
console.log('</testsuite>');
|
|
196
|
+
} else {
|
|
197
|
+
console.log(fname + ':' + e.lineNumber + ': ' + e.message.replace(/^Line\ [0-9]*\:\ /, ''));
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
fnames.forEach(function (fname) {
|
|
203
|
+
var content = '';
|
|
204
|
+
try {
|
|
205
|
+
if (fname && (fname !== '-' || forceFile)) {
|
|
206
|
+
content = fs.readFileSync(fname, 'utf-8');
|
|
207
|
+
} else {
|
|
208
|
+
fname = '';
|
|
209
|
+
process.stdin.resume();
|
|
210
|
+
process.stdin.on('data', function(chunk) {
|
|
211
|
+
content += chunk;
|
|
212
|
+
});
|
|
213
|
+
process.stdin.on('end', function() {
|
|
214
|
+
run(fname, content);
|
|
215
|
+
});
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
} catch (e) {
|
|
219
|
+
content = e;
|
|
220
|
+
}
|
|
221
|
+
run(fname, content);
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
process.on('exit', function () {
|
|
225
|
+
if (options.format === 'junit') {
|
|
226
|
+
console.log('</testsuites>');
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (count > 0) {
|
|
230
|
+
process.exit(1);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (count === 0 && typeof phantom === 'object') {
|
|
234
|
+
process.exit(0);
|
|
235
|
+
}
|
|
236
|
+
});
|