@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.
Files changed (339) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +26 -8
  3. package/THIRD_PARTY_NOTICES.md +6 -2
  4. package/dist/extension.js +8 -1
  5. package/dist/recap.d.ts +2 -0
  6. package/dist/recap.js +31 -0
  7. package/docs/adr/0002-package-delivery.md +2 -0
  8. package/node_modules/@gotgenes/pi-permission-system/src/authority/permission-prompt-component.ts +0 -11
  9. package/node_modules/@gotgenes/pi-permission-system/src/config/config-store.ts +0 -5
  10. package/node_modules/@gotgenes/pi-permission-system/src/index.ts +3 -15
  11. package/node_modules/@pi-plugins/elapsed/LICENSE +21 -0
  12. package/node_modules/@pi-plugins/elapsed/README.md +45 -0
  13. package/node_modules/@pi-plugins/elapsed/dist/index.d.mts +8 -0
  14. package/node_modules/@pi-plugins/elapsed/dist/index.d.mts.map +1 -0
  15. package/node_modules/@pi-plugins/elapsed/dist/index.mjs +47 -0
  16. package/node_modules/@pi-plugins/elapsed/dist/index.mjs.map +1 -0
  17. package/node_modules/@pi-plugins/elapsed/package.json +65 -0
  18. package/node_modules/@tifan/pi-recap/README.md +61 -0
  19. package/node_modules/@tifan/pi-recap/package.json +43 -0
  20. package/node_modules/@tifan/pi-recap/src/index.ts +584 -0
  21. package/node_modules/@tifan/pi-recap/src/model-picker.ts +233 -0
  22. package/node_modules/@tifan/pi-recap/src/models.ts +183 -0
  23. package/node_modules/@tifan/pi-recap/src/sanitize.ts +119 -0
  24. package/node_modules/@tifan/pi-recap/src/tui.ts +155 -0
  25. package/node_modules/@zigai/pi-extension-internals/README.md +24 -0
  26. package/node_modules/@zigai/pi-extension-internals/dist/editor-enhancer-registry.d.ts +21 -0
  27. package/node_modules/@zigai/pi-extension-internals/dist/editor-enhancer-registry.js +233 -0
  28. package/node_modules/@zigai/pi-extension-internals/dist/index.d.ts +6 -0
  29. package/node_modules/@zigai/pi-extension-internals/dist/index.js +3 -0
  30. package/node_modules/@zigai/pi-extension-internals/dist/linked-method-patch.d.ts +34 -0
  31. package/node_modules/@zigai/pi-extension-internals/dist/linked-method-patch.js +272 -0
  32. package/node_modules/@zigai/pi-extension-internals/dist/pi-internal-import.d.ts +11 -0
  33. package/node_modules/@zigai/pi-extension-internals/dist/pi-internal-import.js +139 -0
  34. package/node_modules/@zigai/pi-extension-internals/package.json +41 -0
  35. package/node_modules/@zigai/pi-extension-settings/LICENSE +21 -0
  36. package/node_modules/@zigai/pi-extension-settings/README.md +36 -0
  37. package/node_modules/@zigai/pi-extension-settings/dist/artifacts.d.ts +23 -0
  38. package/node_modules/@zigai/pi-extension-settings/dist/artifacts.d.ts.map +1 -0
  39. package/node_modules/@zigai/pi-extension-settings/dist/artifacts.js +75 -0
  40. package/node_modules/@zigai/pi-extension-settings/dist/artifacts.js.map +1 -0
  41. package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.d.ts +3 -0
  42. package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.d.ts.map +1 -0
  43. package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.js +5 -0
  44. package/node_modules/@zigai/pi-extension-settings/dist/cli-entry.js.map +1 -0
  45. package/node_modules/@zigai/pi-extension-settings/dist/cli.d.ts +6 -0
  46. package/node_modules/@zigai/pi-extension-settings/dist/cli.d.ts.map +1 -0
  47. package/node_modules/@zigai/pi-extension-settings/dist/cli.js +87 -0
  48. package/node_modules/@zigai/pi-extension-settings/dist/cli.js.map +1 -0
  49. package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.d.ts +2 -0
  50. package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.d.ts.map +1 -0
  51. package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.js +2 -0
  52. package/node_modules/@zigai/pi-extension-settings/dist/definition-marker.js.map +1 -0
  53. package/node_modules/@zigai/pi-extension-settings/dist/definition.d.ts +159 -0
  54. package/node_modules/@zigai/pi-extension-settings/dist/definition.d.ts.map +1 -0
  55. package/node_modules/@zigai/pi-extension-settings/dist/definition.js +248 -0
  56. package/node_modules/@zigai/pi-extension-settings/dist/definition.js.map +1 -0
  57. package/node_modules/@zigai/pi-extension-settings/dist/file-system.d.ts +10 -0
  58. package/node_modules/@zigai/pi-extension-settings/dist/file-system.d.ts.map +1 -0
  59. package/node_modules/@zigai/pi-extension-settings/dist/file-system.js +115 -0
  60. package/node_modules/@zigai/pi-extension-settings/dist/file-system.js.map +1 -0
  61. package/node_modules/@zigai/pi-extension-settings/dist/index.d.ts +2 -0
  62. package/node_modules/@zigai/pi-extension-settings/dist/index.d.ts.map +1 -0
  63. package/node_modules/@zigai/pi-extension-settings/dist/index.js +2 -0
  64. package/node_modules/@zigai/pi-extension-settings/dist/index.js.map +1 -0
  65. package/node_modules/@zigai/pi-extension-settings/dist/json-value.d.ts +18 -0
  66. package/node_modules/@zigai/pi-extension-settings/dist/json-value.d.ts.map +1 -0
  67. package/node_modules/@zigai/pi-extension-settings/dist/json-value.js +56 -0
  68. package/node_modules/@zigai/pi-extension-settings/dist/json-value.js.map +1 -0
  69. package/node_modules/@zigai/pi-extension-settings/dist/paths.d.ts +11 -0
  70. package/node_modules/@zigai/pi-extension-settings/dist/paths.d.ts.map +1 -0
  71. package/node_modules/@zigai/pi-extension-settings/dist/paths.js +23 -0
  72. package/node_modules/@zigai/pi-extension-settings/dist/paths.js.map +1 -0
  73. package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.d.ts +5 -0
  74. package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.d.ts.map +1 -0
  75. package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.js +21 -0
  76. package/node_modules/@zigai/pi-extension-settings/dist/pi-host-paths.js.map +1 -0
  77. package/node_modules/@zigai/pi-extension-settings/dist/pi.d.ts +106 -0
  78. package/node_modules/@zigai/pi-extension-settings/dist/pi.d.ts.map +1 -0
  79. package/node_modules/@zigai/pi-extension-settings/dist/pi.js +122 -0
  80. package/node_modules/@zigai/pi-extension-settings/dist/pi.js.map +1 -0
  81. package/node_modules/@zigai/pi-extension-settings/dist/pi.ts +2537 -0
  82. package/node_modules/@zigai/pi-extension-settings/dist/pi.ts.map +7 -0
  83. package/node_modules/@zigai/pi-extension-settings/dist/projects.d.ts +10 -0
  84. package/node_modules/@zigai/pi-extension-settings/dist/projects.d.ts.map +1 -0
  85. package/node_modules/@zigai/pi-extension-settings/dist/projects.js +177 -0
  86. package/node_modules/@zigai/pi-extension-settings/dist/projects.js.map +1 -0
  87. package/node_modules/@zigai/pi-extension-settings/dist/runtime.d.ts +40 -0
  88. package/node_modules/@zigai/pi-extension-settings/dist/runtime.d.ts.map +1 -0
  89. package/node_modules/@zigai/pi-extension-settings/dist/runtime.js +158 -0
  90. package/node_modules/@zigai/pi-extension-settings/dist/runtime.js.map +1 -0
  91. package/node_modules/@zigai/pi-extension-settings/dist/runtime.ts +158 -0
  92. package/node_modules/@zigai/pi-extension-settings/dist/runtime.ts.map +7 -0
  93. package/node_modules/@zigai/pi-extension-settings/dist/schema-document.d.ts +19 -0
  94. package/node_modules/@zigai/pi-extension-settings/dist/schema-document.d.ts.map +1 -0
  95. package/node_modules/@zigai/pi-extension-settings/dist/schema-document.js +168 -0
  96. package/node_modules/@zigai/pi-extension-settings/dist/schema-document.js.map +1 -0
  97. package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.d.ts +9 -0
  98. package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.d.ts.map +1 -0
  99. package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.js +242 -0
  100. package/node_modules/@zigai/pi-extension-settings/dist/settings-documentation.js.map +1 -0
  101. package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.d.ts +59 -0
  102. package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.d.ts.map +1 -0
  103. package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.js +98 -0
  104. package/node_modules/@zigai/pi-extension-settings/dist/settings-layer.js.map +1 -0
  105. package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.d.ts +80 -0
  106. package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.d.ts.map +1 -0
  107. package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.js +144 -0
  108. package/node_modules/@zigai/pi-extension-settings/dist/settings-loader.js.map +1 -0
  109. package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.d.ts +5 -0
  110. package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.d.ts.map +1 -0
  111. package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.js +30 -0
  112. package/node_modules/@zigai/pi-extension-settings/dist/settings-merge.js.map +1 -0
  113. package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.d.ts +10 -0
  114. package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.d.ts.map +1 -0
  115. package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.js +16 -0
  116. package/node_modules/@zigai/pi-extension-settings/dist/settings-revision.js.map +1 -0
  117. package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.d.ts +54 -0
  118. package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.d.ts.map +1 -0
  119. package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.js +202 -0
  120. package/node_modules/@zigai/pi-extension-settings/dist/settings-transaction.js.map +1 -0
  121. package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.d.ts +5 -0
  122. package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.d.ts.map +1 -0
  123. package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.js +9 -0
  124. package/node_modules/@zigai/pi-extension-settings/dist/typebox-runtime.js.map +1 -0
  125. package/node_modules/@zigai/pi-extension-settings/docs/generation.md +71 -0
  126. package/node_modules/@zigai/pi-extension-settings/docs/manual-setup.md +98 -0
  127. package/node_modules/@zigai/pi-extension-settings/docs/runtime.md +100 -0
  128. package/node_modules/@zigai/pi-extension-settings/docs/ui-controls.md +31 -0
  129. package/node_modules/@zigai/pi-extension-settings/package.json +97 -0
  130. package/node_modules/@zigai/pi-mention-anything/README.md +113 -0
  131. package/node_modules/@zigai/pi-mention-anything/config.schema.json +313 -0
  132. package/node_modules/@zigai/pi-mention-anything/docs/command-protocol.md +106 -0
  133. package/node_modules/@zigai/pi-mention-anything/docs/providers.md +128 -0
  134. package/node_modules/@zigai/pi-mention-anything/examples/query-command.mjs +96 -0
  135. package/node_modules/@zigai/pi-mention-anything/examples/recursive-tree.ts +28 -0
  136. package/node_modules/@zigai/pi-mention-anything/examples/static.ts +28 -0
  137. package/node_modules/@zigai/pi-mention-anything/examples/tmux.ts +90 -0
  138. package/node_modules/@zigai/pi-mention-anything/examples/tree-settings.json +25 -0
  139. package/node_modules/@zigai/pi-mention-anything/package.json +58 -0
  140. package/node_modules/@zigai/pi-mention-anything/src/api.ts +75 -0
  141. package/node_modules/@zigai/pi-mention-anything/src/autocomplete.ts +231 -0
  142. package/node_modules/@zigai/pi-mention-anything/src/chain-autocomplete.ts +596 -0
  143. package/node_modules/@zigai/pi-mention-anything/src/chain-syntax.ts +345 -0
  144. package/node_modules/@zigai/pi-mention-anything/src/command-provider.ts +291 -0
  145. package/node_modules/@zigai/pi-mention-anything/src/configured-source.ts +66 -0
  146. package/node_modules/@zigai/pi-mention-anything/src/editor.ts +180 -0
  147. package/node_modules/@zigai/pi-mention-anything/src/expand-mentions.ts +162 -0
  148. package/node_modules/@zigai/pi-mention-anything/src/index.ts +54 -0
  149. package/node_modules/@zigai/pi-mention-anything/src/initial-suggestions.ts +190 -0
  150. package/node_modules/@zigai/pi-mention-anything/src/list-provider.ts +71 -0
  151. package/node_modules/@zigai/pi-mention-anything/src/mention-hub.ts +307 -0
  152. package/node_modules/@zigai/pi-mention-anything/src/mention-resolution.ts +374 -0
  153. package/node_modules/@zigai/pi-mention-anything/src/mention-syntax.ts +105 -0
  154. package/node_modules/@zigai/pi-mention-anything/src/register-mention.ts +89 -0
  155. package/node_modules/@zigai/pi-mention-anything/src/rendering.ts +53 -0
  156. package/node_modules/@zigai/pi-mention-anything/src/selected-items.ts +21 -0
  157. package/node_modules/@zigai/pi-mention-anything/src/selection-history.ts +135 -0
  158. package/node_modules/@zigai/pi-mention-anything/src/settings-input.ts +317 -0
  159. package/node_modules/@zigai/pi-mention-anything/src/settings.prevalidated.ts +57 -0
  160. package/node_modules/@zigai/pi-mention-anything/src/settings.ts +52 -0
  161. package/node_modules/@zigai/pi-mention-anything/src/source-contract.ts +174 -0
  162. package/node_modules/@zigai/pi-mention-anything/src/source-controller.ts +1070 -0
  163. package/node_modules/@zigai/pi-mention-anything/src/source-runtime.ts +99 -0
  164. package/node_modules/@zigai/pi-mention-skill/README.md +60 -0
  165. package/node_modules/@zigai/pi-mention-skill/config.schema.json +81 -0
  166. package/node_modules/@zigai/pi-mention-skill/package.json +56 -0
  167. package/node_modules/@zigai/pi-mention-skill/src/index.ts +60 -0
  168. package/node_modules/@zigai/pi-mention-skill/src/settings-input.ts +74 -0
  169. package/node_modules/@zigai/pi-mention-skill/src/settings.prevalidated.ts +18 -0
  170. package/node_modules/@zigai/pi-mention-skill/src/settings.ts +54 -0
  171. package/node_modules/@zigai/pi-mention-skill/src/skill-commands.ts +18 -0
  172. package/node_modules/@zigai/pi-mention-skill/src/skill-content.ts +60 -0
  173. package/node_modules/@zigai/pi-mention-skill/src/skill-provider.ts +105 -0
  174. package/node_modules/@zigai/pi-mention-skill/src/slash-skill-filter.ts +29 -0
  175. package/node_modules/argparse/LICENSE +21 -0
  176. package/node_modules/argparse/README.md +257 -0
  177. package/node_modules/argparse/index.js +3 -0
  178. package/node_modules/argparse/lib/action/append/constant.js +47 -0
  179. package/node_modules/argparse/lib/action/append.js +53 -0
  180. package/node_modules/argparse/lib/action/count.js +40 -0
  181. package/node_modules/argparse/lib/action/help.js +47 -0
  182. package/node_modules/argparse/lib/action/store/constant.js +43 -0
  183. package/node_modules/argparse/lib/action/store/false.js +27 -0
  184. package/node_modules/argparse/lib/action/store/true.js +26 -0
  185. package/node_modules/argparse/lib/action/store.js +50 -0
  186. package/node_modules/argparse/lib/action/subparsers.js +149 -0
  187. package/node_modules/argparse/lib/action/version.js +47 -0
  188. package/node_modules/argparse/lib/action.js +146 -0
  189. package/node_modules/argparse/lib/action_container.js +482 -0
  190. package/node_modules/argparse/lib/argparse.js +14 -0
  191. package/node_modules/argparse/lib/argument/error.js +50 -0
  192. package/node_modules/argparse/lib/argument/exclusive.js +54 -0
  193. package/node_modules/argparse/lib/argument/group.js +75 -0
  194. package/node_modules/argparse/lib/argument_parser.js +1161 -0
  195. package/node_modules/argparse/lib/const.js +21 -0
  196. package/node_modules/argparse/lib/help/added_formatters.js +87 -0
  197. package/node_modules/argparse/lib/help/formatter.js +795 -0
  198. package/node_modules/argparse/lib/namespace.js +76 -0
  199. package/node_modules/argparse/lib/utils.js +57 -0
  200. package/node_modules/argparse/package.json +34 -0
  201. package/node_modules/esprima/LICENSE.BSD +21 -0
  202. package/node_modules/esprima/README.md +46 -0
  203. package/node_modules/esprima/bin/esparse.js +139 -0
  204. package/node_modules/esprima/bin/esvalidate.js +236 -0
  205. package/node_modules/esprima/dist/esprima.js +6709 -0
  206. package/node_modules/esprima/package.json +112 -0
  207. package/node_modules/extend-shallow/LICENSE +21 -0
  208. package/node_modules/extend-shallow/README.md +61 -0
  209. package/node_modules/extend-shallow/index.js +33 -0
  210. package/node_modules/extend-shallow/package.json +56 -0
  211. package/node_modules/graceful-fs/LICENSE +15 -0
  212. package/node_modules/graceful-fs/README.md +143 -0
  213. package/node_modules/graceful-fs/clone.js +23 -0
  214. package/node_modules/graceful-fs/graceful-fs.js +448 -0
  215. package/node_modules/graceful-fs/legacy-streams.js +118 -0
  216. package/node_modules/graceful-fs/package.json +53 -0
  217. package/node_modules/graceful-fs/polyfills.js +355 -0
  218. package/node_modules/gray-matter/LICENSE +21 -0
  219. package/node_modules/gray-matter/README.md +565 -0
  220. package/node_modules/gray-matter/gray-matter.d.ts +114 -0
  221. package/node_modules/gray-matter/index.js +228 -0
  222. package/node_modules/gray-matter/lib/defaults.js +18 -0
  223. package/node_modules/gray-matter/lib/engine.js +30 -0
  224. package/node_modules/gray-matter/lib/engines.js +54 -0
  225. package/node_modules/gray-matter/lib/excerpt.js +32 -0
  226. package/node_modules/gray-matter/lib/parse.js +13 -0
  227. package/node_modules/gray-matter/lib/stringify.js +56 -0
  228. package/node_modules/gray-matter/lib/to-file.js +43 -0
  229. package/node_modules/gray-matter/lib/utils.js +66 -0
  230. package/node_modules/gray-matter/package.json +127 -0
  231. package/node_modules/is-extendable/LICENSE +21 -0
  232. package/node_modules/is-extendable/README.md +72 -0
  233. package/node_modules/is-extendable/index.js +13 -0
  234. package/node_modules/is-extendable/package.json +51 -0
  235. package/node_modules/js-yaml/LICENSE +21 -0
  236. package/node_modules/js-yaml/README.md +302 -0
  237. package/node_modules/js-yaml/bin/js-yaml.js +132 -0
  238. package/node_modules/js-yaml/dist/js-yaml.js +4024 -0
  239. package/node_modules/js-yaml/dist/js-yaml.min.js +1 -0
  240. package/node_modules/js-yaml/index.js +7 -0
  241. package/node_modules/js-yaml/lib/js-yaml/common.js +59 -0
  242. package/node_modules/js-yaml/lib/js-yaml/dumper.js +850 -0
  243. package/node_modules/js-yaml/lib/js-yaml/exception.js +43 -0
  244. package/node_modules/js-yaml/lib/js-yaml/loader.js +1679 -0
  245. package/node_modules/js-yaml/lib/js-yaml/mark.js +76 -0
  246. package/node_modules/js-yaml/lib/js-yaml/schema/core.js +18 -0
  247. package/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +25 -0
  248. package/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +28 -0
  249. package/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +17 -0
  250. package/node_modules/js-yaml/lib/js-yaml/schema/json.js +25 -0
  251. package/node_modules/js-yaml/lib/js-yaml/schema.js +108 -0
  252. package/node_modules/js-yaml/lib/js-yaml/type/binary.js +138 -0
  253. package/node_modules/js-yaml/lib/js-yaml/type/bool.js +35 -0
  254. package/node_modules/js-yaml/lib/js-yaml/type/float.js +116 -0
  255. package/node_modules/js-yaml/lib/js-yaml/type/int.js +173 -0
  256. package/node_modules/js-yaml/lib/js-yaml/type/js/function.js +93 -0
  257. package/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +60 -0
  258. package/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +28 -0
  259. package/node_modules/js-yaml/lib/js-yaml/type/map.js +8 -0
  260. package/node_modules/js-yaml/lib/js-yaml/type/merge.js +12 -0
  261. package/node_modules/js-yaml/lib/js-yaml/type/null.js +34 -0
  262. package/node_modules/js-yaml/lib/js-yaml/type/omap.js +44 -0
  263. package/node_modules/js-yaml/lib/js-yaml/type/pairs.js +53 -0
  264. package/node_modules/js-yaml/lib/js-yaml/type/seq.js +8 -0
  265. package/node_modules/js-yaml/lib/js-yaml/type/set.js +29 -0
  266. package/node_modules/js-yaml/lib/js-yaml/type/str.js +8 -0
  267. package/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +88 -0
  268. package/node_modules/js-yaml/lib/js-yaml/type.js +61 -0
  269. package/node_modules/js-yaml/lib/js-yaml.js +39 -0
  270. package/node_modules/js-yaml/package.json +52 -0
  271. package/node_modules/kind-of/LICENSE +21 -0
  272. package/node_modules/kind-of/README.md +367 -0
  273. package/node_modules/kind-of/index.js +129 -0
  274. package/node_modules/kind-of/package.json +88 -0
  275. package/node_modules/pi-toggle-skills/README.md +213 -0
  276. package/node_modules/pi-toggle-skills/package.json +60 -0
  277. package/node_modules/pi-toggle-skills/src/index.ts +112 -0
  278. package/node_modules/pi-toggle-skills/src/skill-discovery.ts +258 -0
  279. package/node_modules/pi-toggle-skills/src/skill-selector.ts +435 -0
  280. package/node_modules/pi-toggle-skills/toggle-skills.ts +316 -0
  281. package/node_modules/pi-toggle-skills/vitest.config.ts +15 -0
  282. package/node_modules/proper-lockfile/LICENSE +21 -0
  283. package/node_modules/proper-lockfile/README.md +183 -0
  284. package/node_modules/proper-lockfile/index.js +40 -0
  285. package/node_modules/proper-lockfile/lib/adapter.js +85 -0
  286. package/node_modules/proper-lockfile/lib/lockfile.js +342 -0
  287. package/node_modules/proper-lockfile/lib/mtime-precision.js +55 -0
  288. package/node_modules/proper-lockfile/node_modules/retry/.npmignore +3 -0
  289. package/node_modules/proper-lockfile/node_modules/retry/.travis.yml +15 -0
  290. package/node_modules/proper-lockfile/node_modules/retry/License +21 -0
  291. package/node_modules/proper-lockfile/node_modules/retry/Makefile +18 -0
  292. package/node_modules/proper-lockfile/node_modules/retry/README.md +227 -0
  293. package/node_modules/proper-lockfile/node_modules/retry/equation.gif +0 -0
  294. package/node_modules/proper-lockfile/node_modules/retry/example/dns.js +31 -0
  295. package/node_modules/proper-lockfile/node_modules/retry/example/stop.js +40 -0
  296. package/node_modules/proper-lockfile/node_modules/retry/index.js +1 -0
  297. package/node_modules/proper-lockfile/node_modules/retry/lib/retry.js +100 -0
  298. package/node_modules/proper-lockfile/node_modules/retry/lib/retry_operation.js +158 -0
  299. package/node_modules/proper-lockfile/node_modules/retry/package.json +32 -0
  300. package/node_modules/proper-lockfile/node_modules/retry/test/common.js +10 -0
  301. package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-forever.js +24 -0
  302. package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-retry-operation.js +258 -0
  303. package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-retry-wrap.js +101 -0
  304. package/node_modules/proper-lockfile/node_modules/retry/test/integration/test-timeouts.js +69 -0
  305. package/node_modules/proper-lockfile/package.json +71 -0
  306. package/node_modules/section-matter/LICENSE +21 -0
  307. package/node_modules/section-matter/README.md +236 -0
  308. package/node_modules/section-matter/index.js +136 -0
  309. package/node_modules/section-matter/package.json +55 -0
  310. package/node_modules/signal-exit/LICENSE.txt +16 -0
  311. package/node_modules/signal-exit/README.md +39 -0
  312. package/node_modules/signal-exit/index.js +202 -0
  313. package/node_modules/signal-exit/package.json +38 -0
  314. package/node_modules/signal-exit/signals.js +53 -0
  315. package/node_modules/sprintf-js/.npmignore +1 -0
  316. package/node_modules/sprintf-js/LICENSE +24 -0
  317. package/node_modules/sprintf-js/README.md +88 -0
  318. package/node_modules/sprintf-js/bower.json +14 -0
  319. package/node_modules/sprintf-js/demo/angular.html +20 -0
  320. package/node_modules/sprintf-js/dist/angular-sprintf.min.js +4 -0
  321. package/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +1 -0
  322. package/node_modules/sprintf-js/dist/angular-sprintf.min.map +1 -0
  323. package/node_modules/sprintf-js/dist/sprintf.min.js +4 -0
  324. package/node_modules/sprintf-js/dist/sprintf.min.js.map +1 -0
  325. package/node_modules/sprintf-js/dist/sprintf.min.map +1 -0
  326. package/node_modules/sprintf-js/gruntfile.js +36 -0
  327. package/node_modules/sprintf-js/package.json +22 -0
  328. package/node_modules/sprintf-js/src/angular-sprintf.js +18 -0
  329. package/node_modules/sprintf-js/src/sprintf.js +208 -0
  330. package/node_modules/sprintf-js/test/test.js +82 -0
  331. package/node_modules/strip-bom-string/LICENSE +21 -0
  332. package/node_modules/strip-bom-string/README.md +66 -0
  333. package/node_modules/strip-bom-string/index.js +15 -0
  334. package/node_modules/strip-bom-string/package.json +60 -0
  335. package/package.json +13 -4
  336. package/dist/confirmation.d.ts +0 -33
  337. package/dist/confirmation.js +0 -64
  338. package/dist/yolo.d.ts +0 -6
  339. package/dist/yolo.js +0 -33
@@ -0,0 +1,72 @@
1
+ # is-extendable [![NPM version](https://badge.fury.io/js/is-extendable.svg)](http://badge.fury.io/js/is-extendable)
2
+
3
+ > Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. "can the value have keys?"
4
+
5
+ ## Install
6
+
7
+ Install with [npm](https://www.npmjs.com/)
8
+
9
+ ```sh
10
+ $ npm i is-extendable --save
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```js
16
+ var isExtendable = require('is-extendable');
17
+ ```
18
+
19
+ Returns true if the value is any of the following:
20
+
21
+ * `array`
22
+ * `regexp`
23
+ * `plain object`
24
+ * `function`
25
+ * `date`
26
+ * `error`
27
+
28
+ ## Notes
29
+
30
+ All objects in JavaScript can have keys, but it's a pain to check for this, since we ether need to verify that the value is not `null` or `undefined` and:
31
+
32
+ * the value is not a primitive, or
33
+ * that the object is an `object`, `function`
34
+
35
+ Also note that an `extendable` object is not the same as an [extensible object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible), which is one that (in es6) is not sealed, frozen, or marked as non-extensible using `preventExtensions`.
36
+
37
+ ## Related projects
38
+
39
+ * [assign-deep](https://github.com/jonschlinkert/assign-deep): Deeply assign the enumerable properties of source objects to a destination object.
40
+ * [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util.
41
+ * [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null.
42
+ * [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor.
43
+ * [is-equal-shallow](https://github.com/jonschlinkert/is-equal-shallow): Does a shallow comparison of two objects, returning false if the keys or values differ.
44
+ * [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value.
45
+
46
+ ## Running tests
47
+
48
+ Install dev dependencies:
49
+
50
+ ```sh
51
+ $ npm i -d && npm test
52
+ ```
53
+
54
+ ## Contributing
55
+
56
+ Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-extendable/issues/new)
57
+
58
+ ## Author
59
+
60
+ **Jon Schlinkert**
61
+
62
+ + [github/jonschlinkert](https://github.com/jonschlinkert)
63
+ + [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
64
+
65
+ ## License
66
+
67
+ Copyright © 2015 Jon Schlinkert
68
+ Released under the MIT license.
69
+
70
+ ***
71
+
72
+ _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 04, 2015._
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * is-extendable <https://github.com/jonschlinkert/is-extendable>
3
+ *
4
+ * Copyright (c) 2015, Jon Schlinkert.
5
+ * Licensed under the MIT License.
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ module.exports = function isExtendable(val) {
11
+ return typeof val !== 'undefined' && val !== null
12
+ && (typeof val === 'object' || typeof val === 'function');
13
+ };
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "is-extendable",
3
+ "description": "Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. \"can the value have keys?\"",
4
+ "version": "0.1.1",
5
+ "homepage": "https://github.com/jonschlinkert/is-extendable",
6
+ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
7
+ "repository": "jonschlinkert/is-extendable",
8
+ "bugs": {
9
+ "url": "https://github.com/jonschlinkert/is-extendable/issues"
10
+ },
11
+ "license": "MIT",
12
+ "files": [
13
+ "index.js"
14
+ ],
15
+ "main": "index.js",
16
+ "engines": {
17
+ "node": ">=0.10.0"
18
+ },
19
+ "scripts": {
20
+ "test": "mocha"
21
+ },
22
+ "devDependencies": {
23
+ "mocha": "*"
24
+ },
25
+ "keywords": [
26
+ "array",
27
+ "assign",
28
+ "check",
29
+ "date",
30
+ "extend",
31
+ "extensible",
32
+ "function",
33
+ "is",
34
+ "object",
35
+ "regex",
36
+ "test"
37
+ ],
38
+ "verbiage": {
39
+ "related": {
40
+ "list": [
41
+ "isobject",
42
+ "is-plain-object",
43
+ "kind-of",
44
+ "is-extendable",
45
+ "is-equal-shallow",
46
+ "extend-shallow",
47
+ "assign-deep"
48
+ ]
49
+ }
50
+ }
51
+ }
@@ -0,0 +1,21 @@
1
+ (The MIT License)
2
+
3
+ Copyright (C) 2011-2015 by Vitaly Puzrin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,302 @@
1
+ JS-YAML - YAML 1.2 parser / writer for JavaScript
2
+ =================================================
3
+
4
+ [![Build Status](https://travis-ci.org/nodeca/js-yaml.svg?branch=master)](https://travis-ci.org/nodeca/js-yaml)
5
+ [![NPM version](https://img.shields.io/npm/v/js-yaml.svg)](https://www.npmjs.org/package/js-yaml)
6
+
7
+ __[Online Demo](http://nodeca.github.com/js-yaml/)__
8
+
9
+
10
+ This is an implementation of [YAML](http://yaml.org/), a human-friendly data
11
+ serialization language. Started as [PyYAML](http://pyyaml.org/) port, it was
12
+ completely rewritten from scratch. Now it's very fast, and supports 1.2 spec.
13
+
14
+
15
+ Installation
16
+ ------------
17
+
18
+ ### YAML module for node.js
19
+
20
+ ```
21
+ npm install js-yaml
22
+ ```
23
+
24
+
25
+ ### CLI executable
26
+
27
+ If you want to inspect your YAML files from CLI, install js-yaml globally:
28
+
29
+ ```
30
+ npm install -g js-yaml
31
+ ```
32
+
33
+ #### Usage
34
+
35
+ ```
36
+ usage: js-yaml [-h] [-v] [-c] [-t] file
37
+
38
+ Positional arguments:
39
+ file File with YAML document(s)
40
+
41
+ Optional arguments:
42
+ -h, --help Show this help message and exit.
43
+ -v, --version Show program's version number and exit.
44
+ -c, --compact Display errors in compact mode
45
+ -t, --trace Show stack trace on error
46
+ ```
47
+
48
+
49
+ ### Bundled YAML library for browsers
50
+
51
+ ``` html
52
+ <!-- esprima required only for !!js/function -->
53
+ <script src="esprima.js"></script>
54
+ <script src="js-yaml.min.js"></script>
55
+ <script type="text/javascript">
56
+ var doc = jsyaml.load('greeting: hello\nname: world');
57
+ </script>
58
+ ```
59
+
60
+ Browser support was done mostly for the online demo. If you find any errors - feel
61
+ free to send pull requests with fixes. Also note, that IE and other old browsers
62
+ needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate.
63
+
64
+ Notes:
65
+
66
+ 1. We have no resources to support browserified version. Don't expect it to be
67
+ well tested. Don't expect fast fixes if something goes wrong there.
68
+ 2. `!!js/function` in browser bundle will not work by default. If you really need
69
+ it - load `esprima` parser first (via amd or directly).
70
+ 3. `!!bin` in browser will return `Array`, because browsers do not support
71
+ node.js `Buffer` and adding Buffer shims is completely useless on practice.
72
+
73
+
74
+ API
75
+ ---
76
+
77
+ Here we cover the most 'useful' methods. If you need advanced details (creating
78
+ your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and
79
+ [examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more
80
+ info.
81
+
82
+ ``` javascript
83
+ const yaml = require('js-yaml');
84
+ const fs = require('fs');
85
+
86
+ // Get document, or throw exception on error
87
+ try {
88
+ const doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8'));
89
+ console.log(doc);
90
+ } catch (e) {
91
+ console.log(e);
92
+ }
93
+ ```
94
+
95
+
96
+ ### safeLoad (string [ , options ])
97
+
98
+ **Recommended loading way.** Parses `string` as single YAML document. Returns either a
99
+ plain object, a string or `undefined`, or throws `YAMLException` on error. By default, does
100
+ not support regexps, functions and undefined. This method is safe for untrusted data.
101
+
102
+ options:
103
+
104
+ - `filename` _(default: null)_ - string to be used as a file path in
105
+ error/warning messages.
106
+ - `onWarning` _(default: null)_ - function to call on warning messages.
107
+ Loader will call this function with an instance of `YAMLException` for each warning.
108
+ - `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use.
109
+ - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects:
110
+ http://www.yaml.org/spec/1.2/spec.html#id2802346
111
+ - `JSON_SCHEMA` - all JSON-supported types:
112
+ http://www.yaml.org/spec/1.2/spec.html#id2803231
113
+ - `CORE_SCHEMA` - same as `JSON_SCHEMA`:
114
+ http://www.yaml.org/spec/1.2/spec.html#id2804923
115
+ - `DEFAULT_SAFE_SCHEMA` - all supported YAML types, without unsafe ones
116
+ (`!!js/undefined`, `!!js/regexp` and `!!js/function`):
117
+ http://yaml.org/type/
118
+ - `DEFAULT_FULL_SCHEMA` - all supported YAML types.
119
+ - `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error.
120
+ - `maxTotalMergeKeys` _(default: 10000)_ - limits the total number of keys
121
+ processed by merge (`<<`) across one `safeLoad()` / `safeLoadAll()` call. Set
122
+ to `-1` to disable.
123
+
124
+ NOTE: This function **does not** understand multi-document sources, it throws
125
+ exception on those.
126
+
127
+ NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions.
128
+ So, the JSON schema is not as strictly defined in the YAML specification.
129
+ It allows numbers in any notation, use `Null` and `NULL` as `null`, etc.
130
+ The core schema also has no such restrictions. It allows binary notation for integers.
131
+
132
+
133
+ ### load (string [ , options ])
134
+
135
+ **Use with care with untrusted sources**. The same as `safeLoad()` but uses
136
+ `DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types:
137
+ `!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources, you
138
+ must additionally validate object structure to avoid injections:
139
+
140
+ ``` javascript
141
+ const untrusted_code = '"toString": !<tag:yaml.org,2002:js/function> "function (){very_evil_thing();}"';
142
+
143
+ // I'm just converting that string, what could possibly go wrong?
144
+ require('js-yaml').load(untrusted_code) + ''
145
+ ```
146
+
147
+
148
+ ### safeLoadAll (string [, iterator] [, options ])
149
+
150
+ Same as `safeLoad()`, but understands multi-document sources. Applies
151
+ `iterator` to each document if specified, or returns array of documents.
152
+
153
+ ``` javascript
154
+ const yaml = require('js-yaml');
155
+
156
+ yaml.safeLoadAll(data, function (doc) {
157
+ console.log(doc);
158
+ });
159
+ ```
160
+
161
+
162
+ ### loadAll (string [, iterator] [ , options ])
163
+
164
+ Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default.
165
+
166
+
167
+ ### safeDump (object [ , options ])
168
+
169
+ Serializes `object` as a YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will
170
+ throw an exception if you try to dump regexps or functions. However, you can
171
+ disable exceptions by setting the `skipInvalid` option to `true`.
172
+
173
+ options:
174
+
175
+ - `indent` _(default: 2)_ - indentation width to use (in spaces).
176
+ - `noArrayIndent` _(default: false)_ - when true, will not add an indentation level to array elements
177
+ - `skipInvalid` _(default: false)_ - do not throw on invalid types (like function
178
+ in the safe schema) and skip pairs and single values with such types.
179
+ - `flowLevel` (default: -1) - specifies level of nesting, when to switch from
180
+ block to flow style for collections. -1 means block style everwhere
181
+ - `styles` - "tag" => "style" map. Each tag may have own set of styles.
182
+ - `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use.
183
+ - `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a
184
+ function, use the function to sort the keys.
185
+ - `lineWidth` _(default: `80`)_ - set max line width.
186
+ - `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references
187
+ - `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older
188
+ yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1
189
+ - `condenseFlow` _(default: `false`)_ - if `true` flow sequences will be condensed, omitting the space between `a, b`. Eg. `'[a,b]'`, and omitting the space between `key: value` and quoting the key. Eg. `'{"a":b}'` Can be useful when using yaml for pretty URL query params as spaces are %-encoded.
190
+
191
+ The following table show availlable styles (e.g. "canonical",
192
+ "binary"...) available for each tag (.e.g. !!null, !!int ...). Yaml
193
+ output is shown on the right side after `=>` (default setting) or `->`:
194
+
195
+ ``` none
196
+ !!null
197
+ "canonical" -> "~"
198
+ "lowercase" => "null"
199
+ "uppercase" -> "NULL"
200
+ "camelcase" -> "Null"
201
+
202
+ !!int
203
+ "binary" -> "0b1", "0b101010", "0b1110001111010"
204
+ "octal" -> "01", "052", "016172"
205
+ "decimal" => "1", "42", "7290"
206
+ "hexadecimal" -> "0x1", "0x2A", "0x1C7A"
207
+
208
+ !!bool
209
+ "lowercase" => "true", "false"
210
+ "uppercase" -> "TRUE", "FALSE"
211
+ "camelcase" -> "True", "False"
212
+
213
+ !!float
214
+ "lowercase" => ".nan", '.inf'
215
+ "uppercase" -> ".NAN", '.INF'
216
+ "camelcase" -> ".NaN", '.Inf'
217
+ ```
218
+
219
+ Example:
220
+
221
+ ``` javascript
222
+ safeDump (object, {
223
+ 'styles': {
224
+ '!!null': 'canonical' // dump null as ~
225
+ },
226
+ 'sortKeys': true // sort object keys
227
+ });
228
+ ```
229
+
230
+ ### dump (object [ , options ])
231
+
232
+ Same as `safeDump()` but without limits (uses `DEFAULT_FULL_SCHEMA` by default).
233
+
234
+
235
+ Supported YAML types
236
+ --------------------
237
+
238
+ The list of standard YAML tags and corresponding JavaScipt types. See also
239
+ [YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and
240
+ [YAML types repository](http://yaml.org/type/).
241
+
242
+ ```
243
+ !!null '' # null
244
+ !!bool 'yes' # bool
245
+ !!int '3...' # number
246
+ !!float '3.14...' # number
247
+ !!binary '...base64...' # buffer
248
+ !!timestamp 'YYYY-...' # date
249
+ !!omap [ ... ] # array of key-value pairs
250
+ !!pairs [ ... ] # array or array pairs
251
+ !!set { ... } # array of objects with given keys and null values
252
+ !!str '...' # string
253
+ !!seq [ ... ] # array
254
+ !!map { ... } # object
255
+ ```
256
+
257
+ **JavaScript-specific tags**
258
+
259
+ ```
260
+ !!js/regexp /pattern/gim # RegExp
261
+ !!js/undefined '' # Undefined
262
+ !!js/function 'function () {...}' # Function
263
+ ```
264
+
265
+ Caveats
266
+ -------
267
+
268
+ Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects
269
+ or arrays as keys, and stringifies (by calling `toString()` method) them at the
270
+ moment of adding them.
271
+
272
+ ``` yaml
273
+ ---
274
+ ? [ foo, bar ]
275
+ : - baz
276
+ ? { foo: bar }
277
+ : - baz
278
+ - baz
279
+ ```
280
+
281
+ ``` javascript
282
+ { "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] }
283
+ ```
284
+
285
+ Also, reading of properties on implicit block mapping keys is not supported yet.
286
+ So, the following YAML document cannot be loaded.
287
+
288
+ ``` yaml
289
+ &anchor foo:
290
+ foo: bar
291
+ *anchor: duplicate key
292
+ baz: bat
293
+ *anchor: duplicate key
294
+ ```
295
+
296
+
297
+ js-yaml for enterprise
298
+ ----------------------
299
+
300
+ Available as part of the Tidelift Subscription
301
+
302
+ The maintainers of js-yaml and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-js-yaml?utm_source=npm-js-yaml&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
@@ -0,0 +1,132 @@
1
+ #!/usr/bin/env node
2
+
3
+
4
+ 'use strict';
5
+
6
+ /*eslint-disable no-console*/
7
+
8
+
9
+ // stdlib
10
+ var fs = require('fs');
11
+
12
+
13
+ // 3rd-party
14
+ var argparse = require('argparse');
15
+
16
+
17
+ // internal
18
+ var yaml = require('..');
19
+
20
+
21
+ ////////////////////////////////////////////////////////////////////////////////
22
+
23
+
24
+ var cli = new argparse.ArgumentParser({
25
+ prog: 'js-yaml',
26
+ version: require('../package.json').version,
27
+ addHelp: true
28
+ });
29
+
30
+
31
+ cli.addArgument([ '-c', '--compact' ], {
32
+ help: 'Display errors in compact mode',
33
+ action: 'storeTrue'
34
+ });
35
+
36
+
37
+ // deprecated (not needed after we removed output colors)
38
+ // option suppressed, but not completely removed for compatibility
39
+ cli.addArgument([ '-j', '--to-json' ], {
40
+ help: argparse.Const.SUPPRESS,
41
+ dest: 'json',
42
+ action: 'storeTrue'
43
+ });
44
+
45
+
46
+ cli.addArgument([ '-t', '--trace' ], {
47
+ help: 'Show stack trace on error',
48
+ action: 'storeTrue'
49
+ });
50
+
51
+ cli.addArgument([ 'file' ], {
52
+ help: 'File to read, utf-8 encoded without BOM',
53
+ nargs: '?',
54
+ defaultValue: '-'
55
+ });
56
+
57
+
58
+ ////////////////////////////////////////////////////////////////////////////////
59
+
60
+
61
+ var options = cli.parseArgs();
62
+
63
+
64
+ ////////////////////////////////////////////////////////////////////////////////
65
+
66
+ function readFile(filename, encoding, callback) {
67
+ if (options.file === '-') {
68
+ // read from stdin
69
+
70
+ var chunks = [];
71
+
72
+ process.stdin.on('data', function (chunk) {
73
+ chunks.push(chunk);
74
+ });
75
+
76
+ process.stdin.on('end', function () {
77
+ return callback(null, Buffer.concat(chunks).toString(encoding));
78
+ });
79
+ } else {
80
+ fs.readFile(filename, encoding, callback);
81
+ }
82
+ }
83
+
84
+ readFile(options.file, 'utf8', function (error, input) {
85
+ var output, isYaml;
86
+
87
+ if (error) {
88
+ if (error.code === 'ENOENT') {
89
+ console.error('File not found: ' + options.file);
90
+ process.exit(2);
91
+ }
92
+
93
+ console.error(
94
+ options.trace && error.stack ||
95
+ error.message ||
96
+ String(error));
97
+
98
+ process.exit(1);
99
+ }
100
+
101
+ try {
102
+ output = JSON.parse(input);
103
+ isYaml = false;
104
+ } catch (err) {
105
+ if (err instanceof SyntaxError) {
106
+ try {
107
+ output = [];
108
+ yaml.loadAll(input, function (doc) { output.push(doc); }, {});
109
+ isYaml = true;
110
+
111
+ if (output.length === 0) output = null;
112
+ else if (output.length === 1) output = output[0];
113
+
114
+ } catch (e) {
115
+ if (options.trace && err.stack) console.error(e.stack);
116
+ else console.error(e.toString(options.compact));
117
+
118
+ process.exit(1);
119
+ }
120
+ } else {
121
+ console.error(
122
+ options.trace && err.stack ||
123
+ err.message ||
124
+ String(err));
125
+
126
+ process.exit(1);
127
+ }
128
+ }
129
+
130
+ if (isYaml) console.log(JSON.stringify(output, null, ' '));
131
+ else console.log(yaml.dump(output));
132
+ });