@emulsify/cli 1.5.0 → 1.7.1
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/README.md +89 -1
- package/dist/handlers/componentInstall.js +9 -5
- package/dist/handlers/componentList.js +1 -1
- package/dist/handlers/init.js +1 -1
- package/dist/handlers/systemInstall.js +27 -11
- package/dist/index.js +13 -21
- package/dist/node_modules/.package-lock.json +34 -43
- package/dist/node_modules/@types/node/LICENSE +0 -0
- package/dist/node_modules/@types/node/README.md +3 -3
- package/dist/node_modules/@types/node/assert.d.ts +33 -31
- package/dist/node_modules/@types/node/async_hooks.d.ts +29 -21
- package/dist/node_modules/@types/node/buffer.d.ts +67 -3
- package/dist/node_modules/@types/node/child_process.d.ts +230 -62
- package/dist/node_modules/@types/node/cluster.d.ts +62 -27
- package/dist/node_modules/@types/node/console.d.ts +6 -6
- package/dist/node_modules/@types/node/constants.d.ts +12 -11
- package/dist/node_modules/@types/node/crypto.d.ts +338 -240
- package/dist/node_modules/@types/node/dgram.d.ts +50 -14
- package/dist/node_modules/@types/node/dns.d.ts +183 -54
- package/dist/node_modules/@types/node/domain.d.ts +4 -4
- package/dist/node_modules/@types/node/events.d.ts +4 -4
- package/dist/node_modules/@types/node/fs/promises.d.ts +105 -39
- package/dist/node_modules/@types/node/fs.d.ts +440 -126
- package/dist/node_modules/@types/node/globals.d.ts +176 -24
- package/dist/node_modules/@types/node/globals.global.d.ts +0 -0
- package/dist/node_modules/@types/node/http.d.ts +309 -218
- package/dist/node_modules/@types/node/http2.d.ts +345 -98
- package/dist/node_modules/@types/node/https.d.ts +250 -118
- package/dist/node_modules/@types/node/index.d.ts +1 -2
- package/dist/node_modules/@types/node/inspector.d.ts +2 -3
- package/dist/node_modules/@types/node/module.d.ts +4 -4
- package/dist/node_modules/@types/node/net.d.ts +42 -14
- package/dist/node_modules/@types/node/os.d.ts +5 -4
- package/dist/node_modules/@types/node/package.json +10 -8
- package/dist/node_modules/@types/node/path.d.ts +35 -24
- package/dist/node_modules/@types/node/perf_hooks.d.ts +5 -5
- package/dist/node_modules/@types/node/process.d.ts +62 -23
- package/dist/node_modules/@types/node/punycode.d.ts +3 -3
- package/dist/node_modules/@types/node/querystring.d.ts +15 -5
- package/dist/node_modules/@types/node/readline.d.ts +16 -6
- package/dist/node_modules/@types/node/repl.d.ts +13 -7
- package/dist/node_modules/@types/node/stream.d.ts +190 -31
- package/dist/node_modules/@types/node/string_decoder.d.ts +3 -3
- package/dist/node_modules/@types/node/timers.d.ts +6 -6
- package/dist/node_modules/@types/node/tls.d.ts +113 -30
- package/dist/node_modules/@types/node/trace_events.d.ts +3 -3
- package/dist/node_modules/@types/node/ts4.8/assert.d.ts +130 -0
- package/dist/node_modules/@types/node/ts4.8/async_hooks.d.ts +237 -0
- package/dist/node_modules/@types/node/ts4.8/buffer.d.ts +89 -0
- package/dist/node_modules/@types/node/ts4.8/child_process.d.ts +682 -0
- package/dist/node_modules/@types/node/ts4.8/cluster.d.ts +300 -0
- package/dist/node_modules/@types/node/ts4.8/console.d.ts +142 -0
- package/dist/node_modules/@types/node/ts4.8/constants.d.ts +19 -0
- package/dist/node_modules/@types/node/ts4.8/crypto.d.ts +1287 -0
- package/dist/node_modules/@types/node/ts4.8/dgram.d.ts +180 -0
- package/dist/node_modules/@types/node/ts4.8/dns.d.ts +516 -0
- package/dist/node_modules/@types/node/ts4.8/domain.d.ts +27 -0
- package/dist/node_modules/@types/node/ts4.8/events.d.ts +82 -0
- package/dist/node_modules/@types/node/ts4.8/fs/promises.d.ts +634 -0
- package/dist/node_modules/@types/node/ts4.8/fs.d.ts +2587 -0
- package/dist/node_modules/@types/node/ts4.8/globals.d.ts +763 -0
- package/dist/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
- package/dist/node_modules/@types/node/ts4.8/http.d.ts +580 -0
- package/dist/node_modules/@types/node/ts4.8/http2.d.ts +1208 -0
- package/dist/node_modules/@types/node/ts4.8/https.d.ts +274 -0
- package/dist/node_modules/@types/node/ts4.8/index.d.ts +53 -0
- package/dist/node_modules/@types/node/ts4.8/inspector.d.ts +3050 -0
- package/dist/node_modules/@types/node/ts4.8/module.d.ts +56 -0
- package/dist/node_modules/@types/node/ts4.8/net.d.ts +324 -0
- package/dist/node_modules/@types/node/ts4.8/os.d.ts +243 -0
- package/dist/node_modules/@types/node/ts4.8/path.d.ts +168 -0
- package/dist/node_modules/@types/node/ts4.8/perf_hooks.d.ts +274 -0
- package/dist/node_modules/@types/node/ts4.8/process.d.ts +452 -0
- package/dist/node_modules/@types/node/ts4.8/punycode.d.ts +78 -0
- package/dist/node_modules/@types/node/ts4.8/querystring.d.ts +41 -0
- package/dist/node_modules/@types/node/ts4.8/readline.d.ts +184 -0
- package/dist/node_modules/@types/node/ts4.8/repl.d.ts +404 -0
- package/dist/node_modules/@types/node/ts4.8/stream.d.ts +518 -0
- package/dist/node_modules/@types/node/ts4.8/string_decoder.d.ts +10 -0
- package/dist/node_modules/@types/node/ts4.8/timers.d.ts +19 -0
- package/dist/node_modules/@types/node/ts4.8/tls.d.ts +866 -0
- package/dist/node_modules/@types/node/ts4.8/trace_events.d.ts +64 -0
- package/dist/node_modules/@types/node/ts4.8/tty.d.ts +69 -0
- package/dist/node_modules/@types/node/ts4.8/url.d.ts +187 -0
- package/dist/node_modules/@types/node/ts4.8/util.d.ts +278 -0
- package/dist/node_modules/@types/node/ts4.8/v8.d.ts +189 -0
- package/dist/node_modules/@types/node/ts4.8/vm.d.ts +155 -0
- package/dist/node_modules/@types/node/ts4.8/wasi.d.ts +88 -0
- package/dist/node_modules/@types/node/ts4.8/worker_threads.d.ts +241 -0
- package/dist/node_modules/@types/node/ts4.8/zlib.d.ts +364 -0
- package/dist/node_modules/@types/node/tty.d.ts +4 -4
- package/dist/node_modules/@types/node/url.d.ts +75 -7
- package/dist/node_modules/@types/node/util.d.ts +103 -41
- package/dist/node_modules/@types/node/v8.d.ts +4 -5
- package/dist/node_modules/@types/node/vm.d.ts +7 -7
- package/dist/node_modules/@types/node/wasi.d.ts +3 -4
- package/dist/node_modules/@types/node/worker_threads.d.ts +8 -8
- package/dist/node_modules/@types/node/zlib.d.ts +13 -13
- package/dist/node_modules/@types/progress/LICENSE +0 -0
- package/dist/node_modules/@types/progress/README.md +2 -3
- package/dist/node_modules/@types/progress/index.d.ts +0 -5
- package/dist/node_modules/@types/progress/package.json +6 -6
- package/dist/node_modules/ajv-formats/node_modules/ajv/README.md +20 -5
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2019.d.ts +3 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2019.js +7 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2019.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2020.d.ts +3 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2020.js +7 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2020.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/ajv.d.ts +3 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/ajv.js +7 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/ajv.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.d.ts +6 -5
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js +9 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/index.d.ts +2 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/index.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/scope.d.ts +5 -5
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/scope.js +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/errors.js +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/errors.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/index.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/index.js +9 -10
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/index.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/parse.js +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/serialize.js +19 -8
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/types.d.ts +2 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/names.js +6 -6
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/names.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/ref_error.d.ts +2 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/ref_error.js +3 -3
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/ref_error.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.d.ts +6 -6
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.js +16 -14
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/rules.d.ts +2 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/util.d.ts +2 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/util.js +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/util.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/dataType.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/dataType.js +2 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/index.js +12 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/index.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/subschema.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/core.d.ts +7 -5
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/core.js +22 -18
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/core.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/jtd.d.ts +4 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/jtd.js +7 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/jtd.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/equal.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/parseJson.js +2 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/parseJson.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/re2.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.d.ts +6 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.js +6 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/standalone/index.js +8 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/standalone/index.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/index.d.ts +25 -19
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/json-schema.d.ts +15 -14
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/jtd-schema.d.ts +31 -25
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +2 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/code.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/ref.js +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js +10 -3
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/types.js +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/errors.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/format.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +3 -3
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/properties.js +8 -5
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/ref.js +3 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +3 -3
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/type.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/values.js +10 -7
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/const.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/enum.js +4 -3
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/index.d.ts +2 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +3 -3
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/required.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/2019.ts +4 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/2020.ts +4 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/ajv.ts +4 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/codegen/code.ts +8 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/codegen/index.ts +25 -5
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/index.ts +8 -8
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/jtd/parse.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/jtd/serialize.ts +21 -15
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/jtd/types.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/ref_error.ts +4 -3
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/resolve.ts +18 -15
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/rules.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/validate/dataType.ts +1 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/validate/index.ts +11 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/core.ts +13 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/jtd.ts +4 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/runtime/parseJson.ts +2 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/runtime/uri.ts +6 -0
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/standalone/index.ts +9 -2
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/types/index.ts +14 -3
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/types/json-schema.ts +2 -4
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/types/jtd-schema.ts +25 -16
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/core/ref.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/discriminator/index.ts +11 -3
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/properties.ts +13 -6
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/ref.ts +3 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/values.ts +10 -7
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/enum.ts +5 -3
- package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/package.json +40 -38
- package/dist/node_modules/commander/Readme.md +407 -169
- package/dist/node_modules/commander/esm.mjs +13 -1
- package/dist/node_modules/commander/index.js +13 -2206
- package/dist/node_modules/commander/lib/argument.js +145 -0
- package/dist/node_modules/commander/lib/command.js +2299 -0
- package/dist/node_modules/commander/lib/error.js +43 -0
- package/dist/node_modules/commander/lib/help.js +457 -0
- package/dist/node_modules/commander/lib/option.js +327 -0
- package/dist/node_modules/commander/lib/suggestSimilar.js +100 -0
- package/dist/node_modules/commander/package.json +46 -34
- package/dist/node_modules/commander/typings/esm.d.mts +3 -0
- package/dist/node_modules/commander/typings/index.d.ts +889 -617
- package/dist/node_modules/debug/README.md +3 -0
- package/dist/node_modules/debug/package.json +1 -1
- package/dist/node_modules/debug/src/common.js +1 -1
- package/dist/node_modules/fs-extra/README.md +3 -5
- package/dist/node_modules/fs-extra/lib/{copy-sync → copy}/copy-sync.js +11 -8
- package/dist/node_modules/fs-extra/lib/copy/copy.js +12 -9
- package/dist/node_modules/fs-extra/lib/copy/index.js +2 -1
- package/dist/node_modules/fs-extra/lib/empty/index.js +10 -19
- package/dist/node_modules/fs-extra/lib/ensure/index.js +15 -15
- package/dist/node_modules/fs-extra/lib/ensure/link.js +10 -7
- package/dist/node_modules/fs-extra/lib/ensure/symlink.js +34 -15
- package/dist/node_modules/fs-extra/lib/fs/index.js +8 -10
- package/dist/node_modules/fs-extra/lib/index.js +1 -12
- package/dist/node_modules/fs-extra/lib/json/output-json-sync.js +1 -1
- package/dist/node_modules/fs-extra/lib/json/output-json.js +1 -1
- package/dist/node_modules/fs-extra/lib/mkdirs/make-dir.js +16 -130
- package/dist/node_modules/fs-extra/lib/mkdirs/utils.js +21 -0
- package/dist/node_modules/fs-extra/lib/move/index.js +2 -1
- package/dist/node_modules/fs-extra/lib/{move-sync → move}/move-sync.js +12 -5
- package/dist/node_modules/fs-extra/lib/move/move.js +14 -4
- package/dist/node_modules/fs-extra/lib/remove/index.js +15 -2
- package/dist/node_modules/fs-extra/lib/util/stat.js +60 -45
- package/dist/node_modules/fs-extra/package.json +7 -10
- package/dist/node_modules/graceful-fs/LICENSE +1 -1
- package/dist/node_modules/graceful-fs/graceful-fs.js +23 -4
- package/dist/node_modules/graceful-fs/package.json +6 -3
- package/dist/node_modules/graceful-fs/polyfills.js +39 -30
- package/dist/node_modules/punycode/README.md +29 -3
- package/dist/node_modules/punycode/package.json +7 -7
- package/dist/node_modules/punycode/punycode.es6.js +25 -22
- package/dist/node_modules/punycode/punycode.js +25 -22
- package/dist/node_modules/ramda/dist/ramda.js +4 -4
- package/dist/node_modules/ramda/dist/ramda.min.js +1 -1
- package/dist/node_modules/ramda/es/trim.js +1 -1
- package/dist/node_modules/ramda/package.json +1 -1
- package/dist/node_modules/ramda/src/trim.js +1 -1
- package/dist/node_modules/universalify/README.md +1 -1
- package/dist/node_modules/universalify/index.js +6 -6
- package/dist/node_modules/universalify/package.json +2 -2
- package/dist/package.json +5 -6
- package/dist/schemas/variant.json +28 -5
- package/dist/util/cache/cloneIntoCache.js +1 -1
- package/dist/util/cache/getCachedItemPath.js +4 -2
- package/dist/util/cache/getJsonFromCachedFile.js +2 -2
- package/dist/util/getGitRepoNameFromUrl.js +1 -1
- package/dist/util/getRepositoryLatestTag.js +16 -0
- package/dist/util/platform/getInitSuccessMessageForPlatform.js +4 -3
- package/dist/util/project/buildComponentDependencyList.js +20 -0
- package/package.json +6 -7
- package/dist/node_modules/at-least-node/LICENSE +0 -6
- package/dist/node_modules/at-least-node/README.md +0 -25
- package/dist/node_modules/at-least-node/index.js +0 -5
- package/dist/node_modules/at-least-node/package.json +0 -32
- package/dist/node_modules/commander/CHANGELOG.md +0 -440
- package/dist/node_modules/fs-extra/CHANGELOG.md +0 -902
- package/dist/node_modules/fs-extra/lib/copy-sync/index.js +0 -5
- package/dist/node_modules/fs-extra/lib/move-sync/index.js +0 -5
- /package/dist/node_modules/fs-extra/lib/{output → output-file}/index.js +0 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
const { InvalidArgumentError } = require('./error.js');
|
|
2
|
+
|
|
3
|
+
class Option {
|
|
4
|
+
/**
|
|
5
|
+
* Initialize a new `Option` with the given `flags` and `description`.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} flags
|
|
8
|
+
* @param {string} [description]
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
constructor(flags, description) {
|
|
12
|
+
this.flags = flags;
|
|
13
|
+
this.description = description || '';
|
|
14
|
+
|
|
15
|
+
this.required = flags.includes('<'); // A value must be supplied when the option is specified.
|
|
16
|
+
this.optional = flags.includes('['); // A value is optional when the option is specified.
|
|
17
|
+
// variadic test ignores <value,...> et al which might be used to describe custom splitting of single argument
|
|
18
|
+
this.variadic = /\w\.\.\.[>\]]$/.test(flags); // The option can take multiple values.
|
|
19
|
+
this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.
|
|
20
|
+
const optionFlags = splitOptionFlags(flags);
|
|
21
|
+
this.short = optionFlags.shortFlag;
|
|
22
|
+
this.long = optionFlags.longFlag;
|
|
23
|
+
this.negate = false;
|
|
24
|
+
if (this.long) {
|
|
25
|
+
this.negate = this.long.startsWith('--no-');
|
|
26
|
+
}
|
|
27
|
+
this.defaultValue = undefined;
|
|
28
|
+
this.defaultValueDescription = undefined;
|
|
29
|
+
this.presetArg = undefined;
|
|
30
|
+
this.envVar = undefined;
|
|
31
|
+
this.parseArg = undefined;
|
|
32
|
+
this.hidden = false;
|
|
33
|
+
this.argChoices = undefined;
|
|
34
|
+
this.conflictsWith = [];
|
|
35
|
+
this.implied = undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Set the default value, and optionally supply the description to be displayed in the help.
|
|
40
|
+
*
|
|
41
|
+
* @param {*} value
|
|
42
|
+
* @param {string} [description]
|
|
43
|
+
* @return {Option}
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
default(value, description) {
|
|
47
|
+
this.defaultValue = value;
|
|
48
|
+
this.defaultValueDescription = description;
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Preset to use when option used without option-argument, especially optional but also boolean and negated.
|
|
54
|
+
* The custom processing (parseArg) is called.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* new Option('--color').default('GREYSCALE').preset('RGB');
|
|
58
|
+
* new Option('--donate [amount]').preset('20').argParser(parseFloat);
|
|
59
|
+
*
|
|
60
|
+
* @param {*} arg
|
|
61
|
+
* @return {Option}
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
preset(arg) {
|
|
65
|
+
this.presetArg = arg;
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Add option name(s) that conflict with this option.
|
|
71
|
+
* An error will be displayed if conflicting options are found during parsing.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* new Option('--rgb').conflicts('cmyk');
|
|
75
|
+
* new Option('--js').conflicts(['ts', 'jsx']);
|
|
76
|
+
*
|
|
77
|
+
* @param {(string | string[])} names
|
|
78
|
+
* @return {Option}
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
conflicts(names) {
|
|
82
|
+
this.conflictsWith = this.conflictsWith.concat(names);
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Specify implied option values for when this option is set and the implied options are not.
|
|
88
|
+
*
|
|
89
|
+
* The custom processing (parseArg) is not called on the implied values.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* program
|
|
93
|
+
* .addOption(new Option('--log', 'write logging information to file'))
|
|
94
|
+
* .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));
|
|
95
|
+
*
|
|
96
|
+
* @param {Object} impliedOptionValues
|
|
97
|
+
* @return {Option}
|
|
98
|
+
*/
|
|
99
|
+
implies(impliedOptionValues) {
|
|
100
|
+
let newImplied = impliedOptionValues;
|
|
101
|
+
if (typeof impliedOptionValues === 'string') {
|
|
102
|
+
// string is not documented, but easy mistake and we can do what user probably intended.
|
|
103
|
+
newImplied = { [impliedOptionValues]: true };
|
|
104
|
+
}
|
|
105
|
+
this.implied = Object.assign(this.implied || {}, newImplied);
|
|
106
|
+
return this;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Set environment variable to check for option value.
|
|
111
|
+
*
|
|
112
|
+
* An environment variable is only used if when processed the current option value is
|
|
113
|
+
* undefined, or the source of the current value is 'default' or 'config' or 'env'.
|
|
114
|
+
*
|
|
115
|
+
* @param {string} name
|
|
116
|
+
* @return {Option}
|
|
117
|
+
*/
|
|
118
|
+
|
|
119
|
+
env(name) {
|
|
120
|
+
this.envVar = name;
|
|
121
|
+
return this;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Set the custom handler for processing CLI option arguments into option values.
|
|
126
|
+
*
|
|
127
|
+
* @param {Function} [fn]
|
|
128
|
+
* @return {Option}
|
|
129
|
+
*/
|
|
130
|
+
|
|
131
|
+
argParser(fn) {
|
|
132
|
+
this.parseArg = fn;
|
|
133
|
+
return this;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Whether the option is mandatory and must have a value after parsing.
|
|
138
|
+
*
|
|
139
|
+
* @param {boolean} [mandatory=true]
|
|
140
|
+
* @return {Option}
|
|
141
|
+
*/
|
|
142
|
+
|
|
143
|
+
makeOptionMandatory(mandatory = true) {
|
|
144
|
+
this.mandatory = !!mandatory;
|
|
145
|
+
return this;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Hide option in help.
|
|
150
|
+
*
|
|
151
|
+
* @param {boolean} [hide=true]
|
|
152
|
+
* @return {Option}
|
|
153
|
+
*/
|
|
154
|
+
|
|
155
|
+
hideHelp(hide = true) {
|
|
156
|
+
this.hidden = !!hide;
|
|
157
|
+
return this;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* @package internal use only
|
|
162
|
+
*/
|
|
163
|
+
|
|
164
|
+
_concatValue(value, previous) {
|
|
165
|
+
if (previous === this.defaultValue || !Array.isArray(previous)) {
|
|
166
|
+
return [value];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return previous.concat(value);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Only allow option value to be one of choices.
|
|
174
|
+
*
|
|
175
|
+
* @param {string[]} values
|
|
176
|
+
* @return {Option}
|
|
177
|
+
*/
|
|
178
|
+
|
|
179
|
+
choices(values) {
|
|
180
|
+
this.argChoices = values.slice();
|
|
181
|
+
this.parseArg = (arg, previous) => {
|
|
182
|
+
if (!this.argChoices.includes(arg)) {
|
|
183
|
+
throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(', ')}.`);
|
|
184
|
+
}
|
|
185
|
+
if (this.variadic) {
|
|
186
|
+
return this._concatValue(arg, previous);
|
|
187
|
+
}
|
|
188
|
+
return arg;
|
|
189
|
+
};
|
|
190
|
+
return this;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Return option name.
|
|
195
|
+
*
|
|
196
|
+
* @return {string}
|
|
197
|
+
*/
|
|
198
|
+
|
|
199
|
+
name() {
|
|
200
|
+
if (this.long) {
|
|
201
|
+
return this.long.replace(/^--/, '');
|
|
202
|
+
}
|
|
203
|
+
return this.short.replace(/^-/, '');
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Return option name, in a camelcase format that can be used
|
|
208
|
+
* as a object attribute key.
|
|
209
|
+
*
|
|
210
|
+
* @return {string}
|
|
211
|
+
*/
|
|
212
|
+
|
|
213
|
+
attributeName() {
|
|
214
|
+
return camelcase(this.name().replace(/^no-/, ''));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Check if `arg` matches the short or long flag.
|
|
219
|
+
*
|
|
220
|
+
* @param {string} arg
|
|
221
|
+
* @return {boolean}
|
|
222
|
+
* @package internal use only
|
|
223
|
+
*/
|
|
224
|
+
|
|
225
|
+
is(arg) {
|
|
226
|
+
return this.short === arg || this.long === arg;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Return whether a boolean option.
|
|
231
|
+
*
|
|
232
|
+
* Options are one of boolean, negated, required argument, or optional argument.
|
|
233
|
+
*
|
|
234
|
+
* @return {boolean}
|
|
235
|
+
* @package internal use only
|
|
236
|
+
*/
|
|
237
|
+
|
|
238
|
+
isBoolean() {
|
|
239
|
+
return !this.required && !this.optional && !this.negate;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* This class is to make it easier to work with dual options, without changing the existing
|
|
245
|
+
* implementation. We support separate dual options for separate positive and negative options,
|
|
246
|
+
* like `--build` and `--no-build`, which share a single option value. This works nicely for some
|
|
247
|
+
* use cases, but is tricky for others where we want separate behaviours despite
|
|
248
|
+
* the single shared option value.
|
|
249
|
+
*/
|
|
250
|
+
class DualOptions {
|
|
251
|
+
/**
|
|
252
|
+
* @param {Option[]} options
|
|
253
|
+
*/
|
|
254
|
+
constructor(options) {
|
|
255
|
+
this.positiveOptions = new Map();
|
|
256
|
+
this.negativeOptions = new Map();
|
|
257
|
+
this.dualOptions = new Set();
|
|
258
|
+
options.forEach(option => {
|
|
259
|
+
if (option.negate) {
|
|
260
|
+
this.negativeOptions.set(option.attributeName(), option);
|
|
261
|
+
} else {
|
|
262
|
+
this.positiveOptions.set(option.attributeName(), option);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
this.negativeOptions.forEach((value, key) => {
|
|
266
|
+
if (this.positiveOptions.has(key)) {
|
|
267
|
+
this.dualOptions.add(key);
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Did the value come from the option, and not from possible matching dual option?
|
|
274
|
+
*
|
|
275
|
+
* @param {*} value
|
|
276
|
+
* @param {Option} option
|
|
277
|
+
* @returns {boolean}
|
|
278
|
+
*/
|
|
279
|
+
valueFromOption(value, option) {
|
|
280
|
+
const optionKey = option.attributeName();
|
|
281
|
+
if (!this.dualOptions.has(optionKey)) return true;
|
|
282
|
+
|
|
283
|
+
// Use the value to deduce if (probably) came from the option.
|
|
284
|
+
const preset = this.negativeOptions.get(optionKey).presetArg;
|
|
285
|
+
const negativeValue = (preset !== undefined) ? preset : false;
|
|
286
|
+
return option.negate === (negativeValue === value);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Convert string from kebab-case to camelCase.
|
|
292
|
+
*
|
|
293
|
+
* @param {string} str
|
|
294
|
+
* @return {string}
|
|
295
|
+
* @private
|
|
296
|
+
*/
|
|
297
|
+
|
|
298
|
+
function camelcase(str) {
|
|
299
|
+
return str.split('-').reduce((str, word) => {
|
|
300
|
+
return str + word[0].toUpperCase() + word.slice(1);
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Split the short and long flag out of something like '-m,--mixed <value>'
|
|
306
|
+
*
|
|
307
|
+
* @private
|
|
308
|
+
*/
|
|
309
|
+
|
|
310
|
+
function splitOptionFlags(flags) {
|
|
311
|
+
let shortFlag;
|
|
312
|
+
let longFlag;
|
|
313
|
+
// Use original very loose parsing to maintain backwards compatibility for now,
|
|
314
|
+
// which allowed for example unintended `-sw, --short-word` [sic].
|
|
315
|
+
const flagParts = flags.split(/[ |,]+/);
|
|
316
|
+
if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1])) shortFlag = flagParts.shift();
|
|
317
|
+
longFlag = flagParts.shift();
|
|
318
|
+
// Add support for lone short flag without significantly changing parsing!
|
|
319
|
+
if (!shortFlag && /^-[^-]$/.test(longFlag)) {
|
|
320
|
+
shortFlag = longFlag;
|
|
321
|
+
longFlag = undefined;
|
|
322
|
+
}
|
|
323
|
+
return { shortFlag, longFlag };
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
exports.Option = Option;
|
|
327
|
+
exports.DualOptions = DualOptions;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
const maxDistance = 3;
|
|
2
|
+
|
|
3
|
+
function editDistance(a, b) {
|
|
4
|
+
// https://en.wikipedia.org/wiki/Damerau–Levenshtein_distance
|
|
5
|
+
// Calculating optimal string alignment distance, no substring is edited more than once.
|
|
6
|
+
// (Simple implementation.)
|
|
7
|
+
|
|
8
|
+
// Quick early exit, return worst case.
|
|
9
|
+
if (Math.abs(a.length - b.length) > maxDistance) return Math.max(a.length, b.length);
|
|
10
|
+
|
|
11
|
+
// distance between prefix substrings of a and b
|
|
12
|
+
const d = [];
|
|
13
|
+
|
|
14
|
+
// pure deletions turn a into empty string
|
|
15
|
+
for (let i = 0; i <= a.length; i++) {
|
|
16
|
+
d[i] = [i];
|
|
17
|
+
}
|
|
18
|
+
// pure insertions turn empty string into b
|
|
19
|
+
for (let j = 0; j <= b.length; j++) {
|
|
20
|
+
d[0][j] = j;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// fill matrix
|
|
24
|
+
for (let j = 1; j <= b.length; j++) {
|
|
25
|
+
for (let i = 1; i <= a.length; i++) {
|
|
26
|
+
let cost = 1;
|
|
27
|
+
if (a[i - 1] === b[j - 1]) {
|
|
28
|
+
cost = 0;
|
|
29
|
+
} else {
|
|
30
|
+
cost = 1;
|
|
31
|
+
}
|
|
32
|
+
d[i][j] = Math.min(
|
|
33
|
+
d[i - 1][j] + 1, // deletion
|
|
34
|
+
d[i][j - 1] + 1, // insertion
|
|
35
|
+
d[i - 1][j - 1] + cost // substitution
|
|
36
|
+
);
|
|
37
|
+
// transposition
|
|
38
|
+
if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
|
|
39
|
+
d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return d[a.length][b.length];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Find close matches, restricted to same number of edits.
|
|
49
|
+
*
|
|
50
|
+
* @param {string} word
|
|
51
|
+
* @param {string[]} candidates
|
|
52
|
+
* @returns {string}
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
function suggestSimilar(word, candidates) {
|
|
56
|
+
if (!candidates || candidates.length === 0) return '';
|
|
57
|
+
// remove possible duplicates
|
|
58
|
+
candidates = Array.from(new Set(candidates));
|
|
59
|
+
|
|
60
|
+
const searchingOptions = word.startsWith('--');
|
|
61
|
+
if (searchingOptions) {
|
|
62
|
+
word = word.slice(2);
|
|
63
|
+
candidates = candidates.map(candidate => candidate.slice(2));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
let similar = [];
|
|
67
|
+
let bestDistance = maxDistance;
|
|
68
|
+
const minSimilarity = 0.4;
|
|
69
|
+
candidates.forEach((candidate) => {
|
|
70
|
+
if (candidate.length <= 1) return; // no one character guesses
|
|
71
|
+
|
|
72
|
+
const distance = editDistance(word, candidate);
|
|
73
|
+
const length = Math.max(word.length, candidate.length);
|
|
74
|
+
const similarity = (length - distance) / length;
|
|
75
|
+
if (similarity > minSimilarity) {
|
|
76
|
+
if (distance < bestDistance) {
|
|
77
|
+
// better edit distance, throw away previous worse matches
|
|
78
|
+
bestDistance = distance;
|
|
79
|
+
similar = [candidate];
|
|
80
|
+
} else if (distance === bestDistance) {
|
|
81
|
+
similar.push(candidate);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
similar.sort((a, b) => a.localeCompare(b));
|
|
87
|
+
if (searchingOptions) {
|
|
88
|
+
similar = similar.map(candidate => `--${candidate}`);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (similar.length > 1) {
|
|
92
|
+
return `\n(Did you mean one of ${similar.join(', ')}?)`;
|
|
93
|
+
}
|
|
94
|
+
if (similar.length === 1) {
|
|
95
|
+
return `\n(Did you mean ${similar[0]}?)`;
|
|
96
|
+
}
|
|
97
|
+
return '';
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
exports.suggestSimilar = suggestSimilar;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "commander",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "the complete solution for node.js command-line programs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commander",
|
|
@@ -16,53 +16,65 @@
|
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "https://github.com/tj/commander.js.git"
|
|
19
|
+
"url": "git+https://github.com/tj/commander.js.git"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
|
-
"lint": "
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"test
|
|
26
|
-
"test-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
22
|
+
"lint": "npm run lint:javascript && npm run lint:typescript",
|
|
23
|
+
"lint:javascript": "eslint index.js esm.mjs \"lib/*.js\" \"tests/**/*.js\"",
|
|
24
|
+
"lint:typescript": "eslint typings/*.ts tests/*.ts",
|
|
25
|
+
"test": "jest && npm run typecheck-ts",
|
|
26
|
+
"test-esm": "node ./tests/esm-imports-test.mjs",
|
|
27
|
+
"typecheck-ts": "tsd && tsc -p tsconfig.ts.json",
|
|
28
|
+
"typecheck-js": "tsc -p tsconfig.js.json",
|
|
29
|
+
"test-all": "npm run test && npm run lint && npm run typecheck-js && npm run test-esm"
|
|
29
30
|
},
|
|
30
|
-
"main": "./index.js",
|
|
31
31
|
"files": [
|
|
32
32
|
"index.js",
|
|
33
|
+
"lib/*.js",
|
|
33
34
|
"esm.mjs",
|
|
34
35
|
"typings/index.d.ts",
|
|
36
|
+
"typings/esm.d.mts",
|
|
35
37
|
"package-support.json"
|
|
36
38
|
],
|
|
37
39
|
"type": "commonjs",
|
|
38
|
-
"
|
|
40
|
+
"main": "./index.js",
|
|
41
|
+
"exports": {
|
|
42
|
+
".": {
|
|
43
|
+
"require": {
|
|
44
|
+
"types": "./typings/index.d.ts",
|
|
45
|
+
"default": "./index.js"
|
|
46
|
+
},
|
|
47
|
+
"import": {
|
|
48
|
+
"types": "./typings/esm.d.mts",
|
|
49
|
+
"default": "./esm.mjs"
|
|
50
|
+
},
|
|
51
|
+
"default": "./index.js"
|
|
52
|
+
},
|
|
53
|
+
"./esm.mjs": {
|
|
54
|
+
"types": "./typings/esm.d.mts",
|
|
55
|
+
"import": "./esm.mjs"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
39
58
|
"devDependencies": {
|
|
40
|
-
"@types/jest": "^
|
|
41
|
-
"@types/node": "^
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
43
|
-
"@typescript-eslint/parser": "^
|
|
44
|
-
"eslint": "^
|
|
45
|
-
"eslint-config-standard": "^
|
|
46
|
-
"eslint-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
59
|
+
"@types/jest": "^29.2.4",
|
|
60
|
+
"@types/node": "^20.2.5",
|
|
61
|
+
"@typescript-eslint/eslint-plugin": "^6.7.5",
|
|
62
|
+
"@typescript-eslint/parser": "^6.7.5",
|
|
63
|
+
"eslint": "^8.30.0",
|
|
64
|
+
"eslint-config-standard": "^17.0.0",
|
|
65
|
+
"eslint-config-standard-with-typescript": "^40.0.0",
|
|
66
|
+
"eslint-plugin-import": "^2.26.0",
|
|
67
|
+
"eslint-plugin-jest": "^27.1.7",
|
|
68
|
+
"eslint-plugin-n": "^16.2.0",
|
|
69
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
70
|
+
"jest": "^29.3.1",
|
|
71
|
+
"ts-jest": "^29.0.3",
|
|
72
|
+
"tsd": "^0.30.4",
|
|
73
|
+
"typescript": "^5.0.4"
|
|
52
74
|
},
|
|
53
75
|
"types": "typings/index.d.ts",
|
|
54
|
-
"jest": {
|
|
55
|
-
"testEnvironment": "node",
|
|
56
|
-
"collectCoverage": true,
|
|
57
|
-
"transform": {
|
|
58
|
-
"^.+\\.tsx?$": "ts-jest"
|
|
59
|
-
},
|
|
60
|
-
"testPathIgnorePatterns": [
|
|
61
|
-
"/node_modules/"
|
|
62
|
-
]
|
|
63
|
-
},
|
|
64
76
|
"engines": {
|
|
65
|
-
"node": ">=
|
|
77
|
+
"node": ">=18"
|
|
66
78
|
},
|
|
67
79
|
"support": true
|
|
68
80
|
}
|