projen 0.91.17 → 0.91.19
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/.jsii +39 -15
- package/lib/awscdk/auto-discover.js +5 -5
- package/lib/awscdk/awscdk-app-java.js +1 -1
- package/lib/awscdk/awscdk-app-py.js +1 -1
- package/lib/awscdk/awscdk-app-ts.js +1 -1
- package/lib/awscdk/awscdk-construct.js +2 -2
- package/lib/awscdk/awscdk-deps-java.js +1 -1
- package/lib/awscdk/awscdk-deps-js.js +1 -1
- package/lib/awscdk/awscdk-deps-py.js +1 -1
- package/lib/awscdk/awscdk-deps.js +1 -1
- package/lib/awscdk/cdk-config.js +1 -1
- package/lib/awscdk/cdk-tasks.js +1 -1
- package/lib/awscdk/integration-test.js +1 -1
- package/lib/awscdk/lambda-extension.js +1 -1
- package/lib/awscdk/lambda-function.js +2 -2
- package/lib/build/build-workflow.js +1 -1
- package/lib/cdk/auto-discover-base.js +2 -2
- package/lib/cdk/construct-lib.js +1 -1
- package/lib/cdk/integration-test-base.js +1 -1
- package/lib/cdk/jsii-docgen.js +1 -1
- package/lib/cdk/jsii-project.js +1 -1
- package/lib/cdk8s/auto-discover.js +2 -2
- package/lib/cdk8s/cdk8s-app-py.js +1 -1
- package/lib/cdk8s/cdk8s-app-ts.js +1 -1
- package/lib/cdk8s/cdk8s-construct.js +1 -1
- package/lib/cdk8s/cdk8s-deps-py.js +1 -1
- package/lib/cdk8s/cdk8s-deps.js +1 -1
- package/lib/cdk8s/integration-test.js +1 -1
- package/lib/cdktf/cdktf-construct.js +1 -1
- package/lib/circleci/circleci.js +1 -1
- package/lib/component.js +1 -1
- package/lib/dependencies.js +1 -1
- package/lib/dev-env.js +1 -1
- package/lib/docker-compose/docker-compose-service.js +1 -1
- package/lib/docker-compose/docker-compose.js +1 -1
- package/lib/file.js +1 -1
- package/lib/gitattributes.js +1 -1
- package/lib/github/actions-provider.js +1 -1
- package/lib/github/auto-approve.js +1 -1
- package/lib/github/auto-merge.d.ts +7 -1
- package/lib/github/auto-merge.js +9 -3
- package/lib/github/auto-queue.d.ts +31 -0
- package/lib/github/auto-queue.js +25 -6
- package/lib/github/dependabot.js +1 -1
- package/lib/github/github-credentials.js +1 -1
- package/lib/github/github-project.js +1 -1
- package/lib/github/github.js +1 -1
- package/lib/github/merge-queue.js +26 -3
- package/lib/github/mergify.js +1 -1
- package/lib/github/pr-template.js +1 -1
- package/lib/github/private/util.d.ts +4 -0
- package/lib/github/private/util.js +22 -1
- package/lib/github/pull-request-backport.js +1 -1
- package/lib/github/pull-request-lint.js +1 -1
- package/lib/github/stale.js +1 -1
- package/lib/github/task-workflow-job.js +1 -1
- package/lib/github/task-workflow.js +1 -1
- package/lib/github/workflow-actions.js +1 -1
- package/lib/github/workflow-jobs.js +1 -1
- package/lib/github/workflow-steps.js +1 -1
- package/lib/github/workflows.js +1 -1
- package/lib/gitlab/configuration.js +1 -1
- package/lib/gitlab/gitlab-configuration.js +1 -1
- package/lib/gitlab/nested-configuration.js +1 -1
- package/lib/gitpod.js +1 -1
- package/lib/ignore-file.js +1 -1
- package/lib/ini.js +1 -1
- package/lib/java/java-project.js +1 -1
- package/lib/java/junit.js +1 -1
- package/lib/java/maven-compile.js +1 -1
- package/lib/java/maven-packaging.js +1 -1
- package/lib/java/maven-sample.js +1 -1
- package/lib/java/pom.js +2 -2
- package/lib/java/projenrc.js +1 -1
- package/lib/javascript/bundler.js +1 -1
- package/lib/javascript/eslint.js +1 -1
- package/lib/javascript/jest.js +4 -4
- package/lib/javascript/license-checker.js +1 -1
- package/lib/javascript/node-package.js +1 -1
- package/lib/javascript/node-project.js +1 -1
- package/lib/javascript/npm-config.js +1 -1
- package/lib/javascript/prettier.js +1 -1
- package/lib/javascript/projenrc.js +1 -1
- package/lib/javascript/typescript-config.js +2 -2
- package/lib/javascript/upgrade-dependencies.js +2 -2
- package/lib/javascript/yarnrc.js +1 -1
- package/lib/json-patch.js +1 -1
- package/lib/json.js +1 -1
- package/lib/license.js +1 -1
- package/lib/logger.js +1 -1
- package/lib/makefile.js +1 -1
- package/lib/object-file.js +1 -1
- package/lib/project-build.js +1 -1
- package/lib/project-tree.js +1 -1
- package/lib/project.js +1 -1
- package/lib/projects.js +1 -1
- package/lib/projenrc-json.js +2 -2
- package/lib/projenrc.js +1 -1
- package/lib/python/pip.js +1 -1
- package/lib/python/poetry.js +2 -2
- package/lib/python/projenrc.js +1 -1
- package/lib/python/pytest-sample.js +1 -1
- package/lib/python/pytest.js +1 -1
- package/lib/python/python-project.js +1 -1
- package/lib/python/python-sample.js +1 -1
- package/lib/python/requirements-file.js +1 -1
- package/lib/python/setuppy.js +1 -1
- package/lib/python/setuptools.js +1 -1
- package/lib/python/venv.js +1 -1
- package/lib/readme.js +1 -1
- package/lib/release/publisher.js +1 -1
- package/lib/release/release-trigger.js +1 -1
- package/lib/release/release.js +1 -1
- package/lib/renovatebot.js +1 -1
- package/lib/sample-file.js +2 -2
- package/lib/semver.js +1 -1
- package/lib/source-code.js +1 -1
- package/lib/task-runtime.js +1 -1
- package/lib/task.js +1 -1
- package/lib/tasks.js +1 -1
- package/lib/testing.js +1 -1
- package/lib/textfile.js +1 -1
- package/lib/toml.js +1 -1
- package/lib/typescript/projenrc-ts.js +1 -1
- package/lib/typescript/projenrc.js +1 -1
- package/lib/typescript/typescript-typedoc.js +1 -1
- package/lib/typescript/typescript.js +6 -6
- package/lib/version.js +2 -2
- package/lib/vscode/devcontainer.js +1 -1
- package/lib/vscode/extensions.js +1 -1
- package/lib/vscode/launch-config.js +1 -1
- package/lib/vscode/settings.js +1 -1
- package/lib/vscode/vscode.js +1 -1
- package/lib/web/next.js +3 -3
- package/lib/web/postcss.js +1 -1
- package/lib/web/react.js +4 -4
- package/lib/web/tailwind.js +1 -1
- package/lib/xmlfile.js +1 -1
- package/lib/yaml.js +1 -1
- package/node_modules/{minimatch/node_modules/brace-expansion → @nodelib/fs.scandir}/LICENSE +2 -2
- package/node_modules/@nodelib/fs.scandir/README.md +171 -0
- package/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
- package/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +19 -0
- package/node_modules/@nodelib/fs.scandir/out/constants.d.ts +4 -0
- package/node_modules/@nodelib/fs.scandir/out/constants.js +17 -0
- package/node_modules/@nodelib/fs.scandir/out/index.d.ts +12 -0
- package/node_modules/@nodelib/fs.scandir/out/index.js +26 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/async.js +104 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +1 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/common.js +13 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +5 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/sync.js +54 -0
- package/node_modules/@nodelib/fs.scandir/out/settings.d.ts +20 -0
- package/node_modules/@nodelib/fs.scandir/out/settings.js +24 -0
- package/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
- package/node_modules/@nodelib/fs.scandir/out/types/index.js +2 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +2 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/fs.js +19 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +2 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/index.js +5 -0
- package/node_modules/@nodelib/fs.scandir/package.json +44 -0
- package/node_modules/@nodelib/fs.stat/LICENSE +21 -0
- package/node_modules/@nodelib/fs.stat/README.md +126 -0
- package/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
- package/node_modules/@nodelib/fs.stat/out/adapters/fs.js +17 -0
- package/node_modules/@nodelib/fs.stat/out/index.d.ts +12 -0
- package/node_modules/@nodelib/fs.stat/out/index.js +26 -0
- package/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
- package/node_modules/@nodelib/fs.stat/out/providers/async.js +36 -0
- package/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +3 -0
- package/node_modules/@nodelib/fs.stat/out/providers/sync.js +23 -0
- package/node_modules/@nodelib/fs.stat/out/settings.d.ts +16 -0
- package/node_modules/@nodelib/fs.stat/out/settings.js +16 -0
- package/node_modules/@nodelib/fs.stat/out/types/index.d.ts +4 -0
- package/node_modules/@nodelib/fs.stat/out/types/index.js +2 -0
- package/node_modules/@nodelib/fs.stat/package.json +37 -0
- package/node_modules/@nodelib/fs.walk/LICENSE +21 -0
- package/node_modules/@nodelib/fs.walk/README.md +215 -0
- package/node_modules/@nodelib/fs.walk/out/index.d.ts +14 -0
- package/node_modules/@nodelib/fs.walk/out/index.js +34 -0
- package/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
- package/node_modules/@nodelib/fs.walk/out/providers/async.js +30 -0
- package/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +4 -0
- package/node_modules/@nodelib/fs.walk/out/providers/index.js +9 -0
- package/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +12 -0
- package/node_modules/@nodelib/fs.walk/out/providers/stream.js +34 -0
- package/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +10 -0
- package/node_modules/@nodelib/fs.walk/out/providers/sync.js +14 -0
- package/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
- package/node_modules/@nodelib/fs.walk/out/readers/async.js +97 -0
- package/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +7 -0
- package/node_modules/@nodelib/fs.walk/out/readers/common.js +31 -0
- package/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
- package/node_modules/@nodelib/fs.walk/out/readers/reader.js +11 -0
- package/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +15 -0
- package/node_modules/@nodelib/fs.walk/out/readers/sync.js +59 -0
- package/node_modules/@nodelib/fs.walk/out/settings.d.ts +30 -0
- package/node_modules/@nodelib/fs.walk/out/settings.js +26 -0
- package/node_modules/@nodelib/fs.walk/out/types/index.d.ts +8 -0
- package/node_modules/@nodelib/fs.walk/out/types/index.js +2 -0
- package/node_modules/@nodelib/fs.walk/package.json +44 -0
- package/node_modules/braces/LICENSE +21 -0
- package/node_modules/braces/README.md +586 -0
- package/node_modules/braces/index.js +170 -0
- package/node_modules/braces/lib/compile.js +60 -0
- package/node_modules/braces/lib/constants.js +57 -0
- package/node_modules/braces/lib/expand.js +113 -0
- package/node_modules/braces/lib/parse.js +331 -0
- package/node_modules/braces/lib/stringify.js +32 -0
- package/node_modules/braces/lib/utils.js +122 -0
- package/node_modules/braces/package.json +77 -0
- package/node_modules/end-of-stream/LICENSE +21 -0
- package/node_modules/end-of-stream/README.md +54 -0
- package/node_modules/end-of-stream/index.js +94 -0
- package/node_modules/end-of-stream/package.json +37 -0
- package/node_modules/execa/index.js +361 -0
- package/node_modules/execa/lib/errname.js +39 -0
- package/node_modules/execa/lib/stdio.js +41 -0
- package/node_modules/execa/license +9 -0
- package/node_modules/execa/node_modules/cross-spawn/LICENSE +21 -0
- package/node_modules/execa/node_modules/cross-spawn/README.md +94 -0
- package/node_modules/execa/node_modules/cross-spawn/index.js +39 -0
- package/node_modules/execa/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/node_modules/execa/node_modules/cross-spawn/lib/parse.js +125 -0
- package/node_modules/execa/node_modules/cross-spawn/lib/util/escape.js +47 -0
- package/node_modules/execa/node_modules/cross-spawn/lib/util/readShebang.js +32 -0
- package/node_modules/execa/node_modules/cross-spawn/lib/util/resolveCommand.js +51 -0
- package/node_modules/execa/node_modules/cross-spawn/package.json +75 -0
- package/node_modules/execa/node_modules/semver/README.md +412 -0
- package/node_modules/execa/node_modules/semver/bin/semver +160 -0
- package/node_modules/execa/node_modules/semver/package.json +38 -0
- package/node_modules/execa/node_modules/semver/range.bnf +16 -0
- package/node_modules/execa/node_modules/semver/semver.js +1525 -0
- package/node_modules/execa/node_modules/shebang-command/index.js +19 -0
- package/node_modules/execa/node_modules/shebang-command/license +21 -0
- package/node_modules/execa/node_modules/shebang-command/package.json +39 -0
- package/node_modules/execa/node_modules/shebang-command/readme.md +39 -0
- package/node_modules/execa/node_modules/shebang-regex/index.js +2 -0
- package/node_modules/execa/node_modules/shebang-regex/package.json +32 -0
- package/node_modules/execa/node_modules/shebang-regex/readme.md +29 -0
- package/node_modules/{shelljs/node_modules/glob → execa/node_modules/which}/LICENSE +0 -6
- package/node_modules/execa/node_modules/which/README.md +51 -0
- package/node_modules/execa/node_modules/which/bin/which +52 -0
- package/node_modules/execa/node_modules/which/package.json +30 -0
- package/node_modules/execa/node_modules/which/which.js +135 -0
- package/node_modules/execa/package.json +69 -0
- package/node_modules/execa/readme.md +327 -0
- package/node_modules/fast-glob/LICENSE +21 -0
- package/node_modules/fast-glob/README.md +830 -0
- package/node_modules/fast-glob/node_modules/glob-parent/LICENSE +15 -0
- package/node_modules/fast-glob/node_modules/glob-parent/README.md +137 -0
- package/node_modules/fast-glob/node_modules/glob-parent/index.js +42 -0
- package/node_modules/fast-glob/node_modules/glob-parent/package.json +48 -0
- package/node_modules/fast-glob/out/index.d.ts +40 -0
- package/node_modules/fast-glob/out/index.js +102 -0
- package/node_modules/fast-glob/out/managers/tasks.d.ts +22 -0
- package/node_modules/fast-glob/out/managers/tasks.js +110 -0
- package/node_modules/fast-glob/out/providers/async.d.ts +9 -0
- package/node_modules/fast-glob/out/providers/async.js +23 -0
- package/node_modules/fast-glob/out/providers/filters/deep.d.ts +16 -0
- package/node_modules/fast-glob/out/providers/filters/deep.js +62 -0
- package/node_modules/fast-glob/out/providers/filters/entry.d.ts +17 -0
- package/node_modules/fast-glob/out/providers/filters/entry.js +85 -0
- package/node_modules/fast-glob/out/providers/filters/error.d.ts +8 -0
- package/node_modules/fast-glob/out/providers/filters/error.js +15 -0
- package/node_modules/fast-glob/out/providers/matchers/matcher.d.ts +33 -0
- package/node_modules/fast-glob/out/providers/matchers/matcher.js +45 -0
- package/node_modules/fast-glob/out/providers/matchers/partial.d.ts +4 -0
- package/node_modules/fast-glob/out/providers/matchers/partial.js +38 -0
- package/node_modules/fast-glob/out/providers/provider.d.ts +19 -0
- package/node_modules/fast-glob/out/providers/provider.js +48 -0
- package/node_modules/fast-glob/out/providers/stream.d.ts +11 -0
- package/node_modules/fast-glob/out/providers/stream.js +31 -0
- package/node_modules/fast-glob/out/providers/sync.d.ts +9 -0
- package/node_modules/fast-glob/out/providers/sync.js +23 -0
- package/node_modules/fast-glob/out/providers/transformers/entry.d.ts +8 -0
- package/node_modules/fast-glob/out/providers/transformers/entry.js +26 -0
- package/node_modules/fast-glob/out/readers/async.d.ts +10 -0
- package/node_modules/fast-glob/out/readers/async.js +35 -0
- package/node_modules/fast-glob/out/readers/reader.d.ts +15 -0
- package/node_modules/fast-glob/out/readers/reader.js +33 -0
- package/node_modules/fast-glob/out/readers/stream.d.ts +14 -0
- package/node_modules/fast-glob/out/readers/stream.js +55 -0
- package/node_modules/fast-glob/out/readers/sync.d.ts +12 -0
- package/node_modules/fast-glob/out/readers/sync.js +43 -0
- package/node_modules/fast-glob/out/settings.d.ts +164 -0
- package/node_modules/fast-glob/out/settings.js +59 -0
- package/node_modules/fast-glob/out/types/index.d.ts +31 -0
- package/node_modules/fast-glob/out/types/index.js +2 -0
- package/node_modules/fast-glob/out/utils/array.d.ts +2 -0
- package/node_modules/fast-glob/out/utils/array.js +22 -0
- package/node_modules/fast-glob/out/utils/errno.d.ts +2 -0
- package/node_modules/fast-glob/out/utils/errno.js +7 -0
- package/node_modules/fast-glob/out/utils/fs.d.ts +4 -0
- package/node_modules/fast-glob/out/utils/fs.js +19 -0
- package/node_modules/fast-glob/out/utils/index.d.ts +8 -0
- package/node_modules/fast-glob/out/utils/index.js +17 -0
- package/node_modules/fast-glob/out/utils/path.d.ts +13 -0
- package/node_modules/fast-glob/out/utils/path.js +68 -0
- package/node_modules/fast-glob/out/utils/pattern.d.ts +49 -0
- package/node_modules/fast-glob/out/utils/pattern.js +206 -0
- package/node_modules/fast-glob/out/utils/stream.d.ts +4 -0
- package/node_modules/fast-glob/out/utils/stream.js +17 -0
- package/node_modules/fast-glob/out/utils/string.d.ts +2 -0
- package/node_modules/fast-glob/out/utils/string.js +11 -0
- package/node_modules/fast-glob/package.json +81 -0
- package/node_modules/fastq/.github/dependabot.yml +11 -0
- package/node_modules/fastq/.github/workflows/ci.yml +75 -0
- package/node_modules/fastq/LICENSE +13 -0
- package/node_modules/fastq/README.md +312 -0
- package/node_modules/fastq/SECURITY.md +15 -0
- package/node_modules/fastq/bench.js +66 -0
- package/node_modules/fastq/example.js +14 -0
- package/node_modules/fastq/example.mjs +11 -0
- package/node_modules/fastq/index.d.ts +57 -0
- package/node_modules/fastq/package.json +53 -0
- package/node_modules/fastq/queue.js +311 -0
- package/node_modules/fastq/test/example.ts +83 -0
- package/node_modules/fastq/test/promise.js +291 -0
- package/node_modules/fastq/test/test.js +653 -0
- package/node_modules/fastq/test/tsconfig.json +11 -0
- package/node_modules/fill-range/LICENSE +21 -0
- package/node_modules/fill-range/README.md +237 -0
- package/node_modules/fill-range/index.js +248 -0
- package/node_modules/fill-range/package.json +74 -0
- package/node_modules/get-stream/buffer-stream.js +51 -0
- package/node_modules/get-stream/index.js +50 -0
- package/node_modules/get-stream/license +9 -0
- package/node_modules/get-stream/package.json +46 -0
- package/node_modules/get-stream/readme.md +123 -0
- package/node_modules/is-extglob/LICENSE +21 -0
- package/node_modules/is-extglob/README.md +107 -0
- package/node_modules/is-extglob/index.js +20 -0
- package/node_modules/is-extglob/package.json +69 -0
- package/node_modules/is-glob/LICENSE +21 -0
- package/node_modules/is-glob/README.md +206 -0
- package/node_modules/is-glob/index.js +150 -0
- package/node_modules/is-glob/package.json +81 -0
- package/node_modules/is-number/LICENSE +21 -0
- package/node_modules/is-number/README.md +187 -0
- package/node_modules/is-number/index.js +18 -0
- package/node_modules/is-number/package.json +82 -0
- package/node_modules/is-stream/index.js +21 -0
- package/node_modules/is-stream/license +21 -0
- package/node_modules/is-stream/package.json +38 -0
- package/node_modules/is-stream/readme.md +42 -0
- package/node_modules/isexe/.npmignore +2 -0
- package/node_modules/isexe/LICENSE +15 -0
- package/node_modules/isexe/README.md +51 -0
- package/node_modules/isexe/index.js +57 -0
- package/node_modules/isexe/mode.js +41 -0
- package/node_modules/isexe/package.json +31 -0
- package/node_modules/isexe/test/basic.js +221 -0
- package/node_modules/isexe/windows.js +42 -0
- package/node_modules/merge2/LICENSE +21 -0
- package/node_modules/merge2/README.md +144 -0
- package/node_modules/merge2/index.js +144 -0
- package/node_modules/merge2/package.json +43 -0
- package/node_modules/micromatch/LICENSE +21 -0
- package/node_modules/micromatch/README.md +1024 -0
- package/node_modules/micromatch/index.js +474 -0
- package/node_modules/micromatch/package.json +119 -0
- package/node_modules/nice-try/LICENSE +21 -0
- package/node_modules/nice-try/README.md +32 -0
- package/node_modules/nice-try/package.json +33 -0
- package/node_modules/nice-try/src/index.js +12 -0
- package/node_modules/npm-run-path/index.js +39 -0
- package/node_modules/npm-run-path/license +21 -0
- package/node_modules/npm-run-path/package.json +45 -0
- package/node_modules/npm-run-path/readme.md +81 -0
- package/node_modules/p-finally/index.js +15 -0
- package/node_modules/p-finally/license +21 -0
- package/node_modules/p-finally/package.json +42 -0
- package/node_modules/p-finally/readme.md +47 -0
- package/node_modules/path-key/index.js +13 -0
- package/node_modules/path-key/license +21 -0
- package/node_modules/path-key/package.json +39 -0
- package/node_modules/path-key/readme.md +51 -0
- package/node_modules/picomatch/LICENSE +21 -0
- package/node_modules/picomatch/README.md +708 -0
- package/node_modules/picomatch/index.js +3 -0
- package/node_modules/picomatch/lib/constants.js +179 -0
- package/node_modules/picomatch/lib/parse.js +1091 -0
- package/node_modules/picomatch/lib/picomatch.js +342 -0
- package/node_modules/picomatch/lib/scan.js +391 -0
- package/node_modules/picomatch/lib/utils.js +64 -0
- package/node_modules/picomatch/package.json +81 -0
- package/node_modules/pump/.github/FUNDING.yml +2 -0
- package/node_modules/pump/.travis.yml +5 -0
- package/node_modules/pump/LICENSE +21 -0
- package/node_modules/pump/README.md +74 -0
- package/node_modules/pump/SECURITY.md +5 -0
- package/node_modules/pump/index.js +86 -0
- package/node_modules/pump/package.json +24 -0
- package/node_modules/pump/test-browser.js +66 -0
- package/node_modules/pump/test-node.js +53 -0
- package/node_modules/{concat-map → queue-microtask}/LICENSE +3 -1
- package/node_modules/queue-microtask/README.md +90 -0
- package/node_modules/queue-microtask/index.d.ts +2 -0
- package/node_modules/queue-microtask/index.js +9 -0
- package/node_modules/queue-microtask/package.json +55 -0
- package/node_modules/reusify/.github/dependabot.yml +7 -0
- package/node_modules/reusify/.github/workflows/ci.yml +96 -0
- package/node_modules/reusify/LICENSE +22 -0
- package/node_modules/reusify/README.md +139 -0
- package/node_modules/reusify/SECURITY.md +15 -0
- package/node_modules/reusify/benchmarks/createNoCodeFunction.js +30 -0
- package/node_modules/reusify/benchmarks/fib.js +13 -0
- package/node_modules/reusify/benchmarks/reuseNoCodeFunction.js +38 -0
- package/node_modules/reusify/eslint.config.js +14 -0
- package/node_modules/reusify/package.json +50 -0
- package/node_modules/reusify/reusify.d.ts +14 -0
- package/node_modules/reusify/reusify.js +33 -0
- package/node_modules/reusify/test.js +66 -0
- package/node_modules/reusify/tsconfig.json +11 -0
- package/node_modules/run-parallel/LICENSE +20 -0
- package/node_modules/run-parallel/README.md +85 -0
- package/node_modules/run-parallel/index.js +51 -0
- package/node_modules/run-parallel/package.json +58 -0
- package/node_modules/shelljs/LICENSE +23 -20
- package/node_modules/shelljs/README.md +173 -65
- package/node_modules/shelljs/package.json +38 -22
- package/node_modules/shelljs/plugin.js +1 -1
- package/node_modules/shelljs/shell.js +70 -12
- package/node_modules/shelljs/src/cat.js +3 -3
- package/node_modules/shelljs/src/cd.js +2 -1
- package/node_modules/shelljs/src/chmod.js +17 -11
- package/node_modules/shelljs/src/cmd.js +122 -0
- package/node_modules/shelljs/src/common.js +103 -29
- package/node_modules/shelljs/src/cp.js +24 -14
- package/node_modules/shelljs/src/dirs.js +7 -9
- package/node_modules/shelljs/src/echo.js +1 -2
- package/node_modules/shelljs/src/errorCode.js +10 -0
- package/node_modules/shelljs/src/exec-child.js +60 -28
- package/node_modules/shelljs/src/exec.js +39 -10
- package/node_modules/shelljs/src/find.js +8 -3
- package/node_modules/shelljs/src/grep.js +15 -4
- package/node_modules/shelljs/src/head.js +1 -1
- package/node_modules/shelljs/src/ln.js +3 -1
- package/node_modules/shelljs/src/ls.js +29 -15
- package/node_modules/shelljs/src/mkdir.js +13 -11
- package/node_modules/shelljs/src/mv.js +4 -3
- package/node_modules/shelljs/src/pwd.js +1 -1
- package/node_modules/shelljs/src/rm.js +11 -11
- package/node_modules/shelljs/src/sed.js +12 -4
- package/node_modules/shelljs/src/set.js +0 -1
- package/node_modules/shelljs/src/sort.js +3 -2
- package/node_modules/shelljs/src/tail.js +12 -2
- package/node_modules/shelljs/src/test.js +3 -2
- package/node_modules/shelljs/src/to.js +2 -1
- package/node_modules/shelljs/src/toEnd.js +2 -1
- package/node_modules/shelljs/src/touch.js +13 -7
- package/node_modules/shelljs/src/uniq.js +5 -4
- package/node_modules/shelljs/src/which.js +5 -4
- package/node_modules/shx/README.md +27 -15
- package/node_modules/shx/lib/help.js +1 -1
- package/node_modules/shx/lib/shx.js +13 -8
- package/node_modules/shx/package.json +17 -25
- 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/strip-eof/index.js +15 -0
- package/node_modules/strip-eof/license +21 -0
- package/node_modules/strip-eof/package.json +39 -0
- package/node_modules/strip-eof/readme.md +28 -0
- package/node_modules/to-regex-range/LICENSE +21 -0
- package/node_modules/to-regex-range/README.md +305 -0
- package/node_modules/to-regex-range/index.js +288 -0
- package/node_modules/to-regex-range/package.json +88 -0
- package/package.json +2 -2
- package/node_modules/concat-map/.travis.yml +0 -4
- package/node_modules/concat-map/README.markdown +0 -62
- package/node_modules/concat-map/example/map.js +0 -6
- package/node_modules/concat-map/index.js +0 -13
- package/node_modules/concat-map/package.json +0 -43
- package/node_modules/concat-map/test/map.js +0 -39
- package/node_modules/minimatch/README.md +0 -230
- package/node_modules/minimatch/minimatch.js +0 -947
- package/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -129
- package/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -201
- package/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -47
- package/node_modules/minimatch/package.json +0 -33
- package/node_modules/path-is-absolute/index.js +0 -20
- package/node_modules/path-is-absolute/package.json +0 -43
- package/node_modules/path-is-absolute/readme.md +0 -59
- package/node_modules/shelljs/commands.js +0 -29
- package/node_modules/shelljs/node_modules/glob/README.md +0 -378
- package/node_modules/shelljs/node_modules/glob/common.js +0 -238
- package/node_modules/shelljs/node_modules/glob/glob.js +0 -790
- package/node_modules/shelljs/node_modules/glob/package.json +0 -55
- package/node_modules/shelljs/node_modules/glob/sync.js +0 -486
- /package/node_modules/{minimatch → execa/node_modules/semver}/LICENSE +0 -0
- /package/node_modules/{path-is-absolute → execa/node_modules/shebang-regex}/license +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var once = require('once');
|
|
2
|
+
|
|
3
|
+
var noop = function() {};
|
|
4
|
+
|
|
5
|
+
var isRequest = function(stream) {
|
|
6
|
+
return stream.setHeader && typeof stream.abort === 'function';
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
var isChildProcess = function(stream) {
|
|
10
|
+
return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
var eos = function(stream, opts, callback) {
|
|
14
|
+
if (typeof opts === 'function') return eos(stream, null, opts);
|
|
15
|
+
if (!opts) opts = {};
|
|
16
|
+
|
|
17
|
+
callback = once(callback || noop);
|
|
18
|
+
|
|
19
|
+
var ws = stream._writableState;
|
|
20
|
+
var rs = stream._readableState;
|
|
21
|
+
var readable = opts.readable || (opts.readable !== false && stream.readable);
|
|
22
|
+
var writable = opts.writable || (opts.writable !== false && stream.writable);
|
|
23
|
+
var cancelled = false;
|
|
24
|
+
|
|
25
|
+
var onlegacyfinish = function() {
|
|
26
|
+
if (!stream.writable) onfinish();
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var onfinish = function() {
|
|
30
|
+
writable = false;
|
|
31
|
+
if (!readable) callback.call(stream);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var onend = function() {
|
|
35
|
+
readable = false;
|
|
36
|
+
if (!writable) callback.call(stream);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var onexit = function(exitCode) {
|
|
40
|
+
callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var onerror = function(err) {
|
|
44
|
+
callback.call(stream, err);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var onclose = function() {
|
|
48
|
+
process.nextTick(onclosenexttick);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var onclosenexttick = function() {
|
|
52
|
+
if (cancelled) return;
|
|
53
|
+
if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
|
|
54
|
+
if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
var onrequest = function() {
|
|
58
|
+
stream.req.on('finish', onfinish);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
if (isRequest(stream)) {
|
|
62
|
+
stream.on('complete', onfinish);
|
|
63
|
+
stream.on('abort', onclose);
|
|
64
|
+
if (stream.req) onrequest();
|
|
65
|
+
else stream.on('request', onrequest);
|
|
66
|
+
} else if (writable && !ws) { // legacy streams
|
|
67
|
+
stream.on('end', onlegacyfinish);
|
|
68
|
+
stream.on('close', onlegacyfinish);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (isChildProcess(stream)) stream.on('exit', onexit);
|
|
72
|
+
|
|
73
|
+
stream.on('end', onend);
|
|
74
|
+
stream.on('finish', onfinish);
|
|
75
|
+
if (opts.error !== false) stream.on('error', onerror);
|
|
76
|
+
stream.on('close', onclose);
|
|
77
|
+
|
|
78
|
+
return function() {
|
|
79
|
+
cancelled = true;
|
|
80
|
+
stream.removeListener('complete', onfinish);
|
|
81
|
+
stream.removeListener('abort', onclose);
|
|
82
|
+
stream.removeListener('request', onrequest);
|
|
83
|
+
if (stream.req) stream.req.removeListener('finish', onfinish);
|
|
84
|
+
stream.removeListener('end', onlegacyfinish);
|
|
85
|
+
stream.removeListener('close', onlegacyfinish);
|
|
86
|
+
stream.removeListener('finish', onfinish);
|
|
87
|
+
stream.removeListener('exit', onexit);
|
|
88
|
+
stream.removeListener('end', onend);
|
|
89
|
+
stream.removeListener('error', onerror);
|
|
90
|
+
stream.removeListener('close', onclose);
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
module.exports = eos;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "end-of-stream",
|
|
3
|
+
"version": "1.4.4",
|
|
4
|
+
"description": "Call a callback when a readable/writable/duplex stream has completed or failed.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git://github.com/mafintosh/end-of-stream.git"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"once": "^1.4.0"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"test": "node test.js"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"index.js"
|
|
17
|
+
],
|
|
18
|
+
"keywords": [
|
|
19
|
+
"stream",
|
|
20
|
+
"streams",
|
|
21
|
+
"callback",
|
|
22
|
+
"finish",
|
|
23
|
+
"close",
|
|
24
|
+
"end",
|
|
25
|
+
"wait"
|
|
26
|
+
],
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/mafintosh/end-of-stream/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/mafintosh/end-of-stream",
|
|
31
|
+
"main": "index.js",
|
|
32
|
+
"author": "Mathias Buus <mathiasbuus@gmail.com>",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"tape": "^4.11.0"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const childProcess = require('child_process');
|
|
4
|
+
const crossSpawn = require('cross-spawn');
|
|
5
|
+
const stripEof = require('strip-eof');
|
|
6
|
+
const npmRunPath = require('npm-run-path');
|
|
7
|
+
const isStream = require('is-stream');
|
|
8
|
+
const _getStream = require('get-stream');
|
|
9
|
+
const pFinally = require('p-finally');
|
|
10
|
+
const onExit = require('signal-exit');
|
|
11
|
+
const errname = require('./lib/errname');
|
|
12
|
+
const stdio = require('./lib/stdio');
|
|
13
|
+
|
|
14
|
+
const TEN_MEGABYTES = 1000 * 1000 * 10;
|
|
15
|
+
|
|
16
|
+
function handleArgs(cmd, args, opts) {
|
|
17
|
+
let parsed;
|
|
18
|
+
|
|
19
|
+
opts = Object.assign({
|
|
20
|
+
extendEnv: true,
|
|
21
|
+
env: {}
|
|
22
|
+
}, opts);
|
|
23
|
+
|
|
24
|
+
if (opts.extendEnv) {
|
|
25
|
+
opts.env = Object.assign({}, process.env, opts.env);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (opts.__winShell === true) {
|
|
29
|
+
delete opts.__winShell;
|
|
30
|
+
parsed = {
|
|
31
|
+
command: cmd,
|
|
32
|
+
args,
|
|
33
|
+
options: opts,
|
|
34
|
+
file: cmd,
|
|
35
|
+
original: {
|
|
36
|
+
cmd,
|
|
37
|
+
args
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
} else {
|
|
41
|
+
parsed = crossSpawn._parse(cmd, args, opts);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
opts = Object.assign({
|
|
45
|
+
maxBuffer: TEN_MEGABYTES,
|
|
46
|
+
buffer: true,
|
|
47
|
+
stripEof: true,
|
|
48
|
+
preferLocal: true,
|
|
49
|
+
localDir: parsed.options.cwd || process.cwd(),
|
|
50
|
+
encoding: 'utf8',
|
|
51
|
+
reject: true,
|
|
52
|
+
cleanup: true
|
|
53
|
+
}, parsed.options);
|
|
54
|
+
|
|
55
|
+
opts.stdio = stdio(opts);
|
|
56
|
+
|
|
57
|
+
if (opts.preferLocal) {
|
|
58
|
+
opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (opts.detached) {
|
|
62
|
+
// #115
|
|
63
|
+
opts.cleanup = false;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
|
|
67
|
+
// #116
|
|
68
|
+
parsed.args.unshift('/q');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
cmd: parsed.command,
|
|
73
|
+
args: parsed.args,
|
|
74
|
+
opts,
|
|
75
|
+
parsed
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function handleInput(spawned, input) {
|
|
80
|
+
if (input === null || input === undefined) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (isStream(input)) {
|
|
85
|
+
input.pipe(spawned.stdin);
|
|
86
|
+
} else {
|
|
87
|
+
spawned.stdin.end(input);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function handleOutput(opts, val) {
|
|
92
|
+
if (val && opts.stripEof) {
|
|
93
|
+
val = stripEof(val);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return val;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function handleShell(fn, cmd, opts) {
|
|
100
|
+
let file = '/bin/sh';
|
|
101
|
+
let args = ['-c', cmd];
|
|
102
|
+
|
|
103
|
+
opts = Object.assign({}, opts);
|
|
104
|
+
|
|
105
|
+
if (process.platform === 'win32') {
|
|
106
|
+
opts.__winShell = true;
|
|
107
|
+
file = process.env.comspec || 'cmd.exe';
|
|
108
|
+
args = ['/s', '/c', `"${cmd}"`];
|
|
109
|
+
opts.windowsVerbatimArguments = true;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (opts.shell) {
|
|
113
|
+
file = opts.shell;
|
|
114
|
+
delete opts.shell;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return fn(file, args, opts);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function getStream(process, stream, {encoding, buffer, maxBuffer}) {
|
|
121
|
+
if (!process[stream]) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
let ret;
|
|
126
|
+
|
|
127
|
+
if (!buffer) {
|
|
128
|
+
// TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
|
|
129
|
+
ret = new Promise((resolve, reject) => {
|
|
130
|
+
process[stream]
|
|
131
|
+
.once('end', resolve)
|
|
132
|
+
.once('error', reject);
|
|
133
|
+
});
|
|
134
|
+
} else if (encoding) {
|
|
135
|
+
ret = _getStream(process[stream], {
|
|
136
|
+
encoding,
|
|
137
|
+
maxBuffer
|
|
138
|
+
});
|
|
139
|
+
} else {
|
|
140
|
+
ret = _getStream.buffer(process[stream], {maxBuffer});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return ret.catch(err => {
|
|
144
|
+
err.stream = stream;
|
|
145
|
+
err.message = `${stream} ${err.message}`;
|
|
146
|
+
throw err;
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function makeError(result, options) {
|
|
151
|
+
const {stdout, stderr} = result;
|
|
152
|
+
|
|
153
|
+
let err = result.error;
|
|
154
|
+
const {code, signal} = result;
|
|
155
|
+
|
|
156
|
+
const {parsed, joinedCmd} = options;
|
|
157
|
+
const timedOut = options.timedOut || false;
|
|
158
|
+
|
|
159
|
+
if (!err) {
|
|
160
|
+
let output = '';
|
|
161
|
+
|
|
162
|
+
if (Array.isArray(parsed.opts.stdio)) {
|
|
163
|
+
if (parsed.opts.stdio[2] !== 'inherit') {
|
|
164
|
+
output += output.length > 0 ? stderr : `\n${stderr}`;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (parsed.opts.stdio[1] !== 'inherit') {
|
|
168
|
+
output += `\n${stdout}`;
|
|
169
|
+
}
|
|
170
|
+
} else if (parsed.opts.stdio !== 'inherit') {
|
|
171
|
+
output = `\n${stderr}${stdout}`;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
err = new Error(`Command failed: ${joinedCmd}${output}`);
|
|
175
|
+
err.code = code < 0 ? errname(code) : code;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
err.stdout = stdout;
|
|
179
|
+
err.stderr = stderr;
|
|
180
|
+
err.failed = true;
|
|
181
|
+
err.signal = signal || null;
|
|
182
|
+
err.cmd = joinedCmd;
|
|
183
|
+
err.timedOut = timedOut;
|
|
184
|
+
|
|
185
|
+
return err;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function joinCmd(cmd, args) {
|
|
189
|
+
let joinedCmd = cmd;
|
|
190
|
+
|
|
191
|
+
if (Array.isArray(args) && args.length > 0) {
|
|
192
|
+
joinedCmd += ' ' + args.join(' ');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return joinedCmd;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
module.exports = (cmd, args, opts) => {
|
|
199
|
+
const parsed = handleArgs(cmd, args, opts);
|
|
200
|
+
const {encoding, buffer, maxBuffer} = parsed.opts;
|
|
201
|
+
const joinedCmd = joinCmd(cmd, args);
|
|
202
|
+
|
|
203
|
+
let spawned;
|
|
204
|
+
try {
|
|
205
|
+
spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
|
|
206
|
+
} catch (err) {
|
|
207
|
+
return Promise.reject(err);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
let removeExitHandler;
|
|
211
|
+
if (parsed.opts.cleanup) {
|
|
212
|
+
removeExitHandler = onExit(() => {
|
|
213
|
+
spawned.kill();
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
let timeoutId = null;
|
|
218
|
+
let timedOut = false;
|
|
219
|
+
|
|
220
|
+
const cleanup = () => {
|
|
221
|
+
if (timeoutId) {
|
|
222
|
+
clearTimeout(timeoutId);
|
|
223
|
+
timeoutId = null;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (removeExitHandler) {
|
|
227
|
+
removeExitHandler();
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
if (parsed.opts.timeout > 0) {
|
|
232
|
+
timeoutId = setTimeout(() => {
|
|
233
|
+
timeoutId = null;
|
|
234
|
+
timedOut = true;
|
|
235
|
+
spawned.kill(parsed.opts.killSignal);
|
|
236
|
+
}, parsed.opts.timeout);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
const processDone = new Promise(resolve => {
|
|
240
|
+
spawned.on('exit', (code, signal) => {
|
|
241
|
+
cleanup();
|
|
242
|
+
resolve({code, signal});
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
spawned.on('error', err => {
|
|
246
|
+
cleanup();
|
|
247
|
+
resolve({error: err});
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
if (spawned.stdin) {
|
|
251
|
+
spawned.stdin.on('error', err => {
|
|
252
|
+
cleanup();
|
|
253
|
+
resolve({error: err});
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
function destroy() {
|
|
259
|
+
if (spawned.stdout) {
|
|
260
|
+
spawned.stdout.destroy();
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
if (spawned.stderr) {
|
|
264
|
+
spawned.stderr.destroy();
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const handlePromise = () => pFinally(Promise.all([
|
|
269
|
+
processDone,
|
|
270
|
+
getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
|
|
271
|
+
getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
|
|
272
|
+
]).then(arr => {
|
|
273
|
+
const result = arr[0];
|
|
274
|
+
result.stdout = arr[1];
|
|
275
|
+
result.stderr = arr[2];
|
|
276
|
+
|
|
277
|
+
if (result.error || result.code !== 0 || result.signal !== null) {
|
|
278
|
+
const err = makeError(result, {
|
|
279
|
+
joinedCmd,
|
|
280
|
+
parsed,
|
|
281
|
+
timedOut
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
// TODO: missing some timeout logic for killed
|
|
285
|
+
// https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
|
|
286
|
+
// err.killed = spawned.killed || killed;
|
|
287
|
+
err.killed = err.killed || spawned.killed;
|
|
288
|
+
|
|
289
|
+
if (!parsed.opts.reject) {
|
|
290
|
+
return err;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
throw err;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
return {
|
|
297
|
+
stdout: handleOutput(parsed.opts, result.stdout),
|
|
298
|
+
stderr: handleOutput(parsed.opts, result.stderr),
|
|
299
|
+
code: 0,
|
|
300
|
+
failed: false,
|
|
301
|
+
killed: false,
|
|
302
|
+
signal: null,
|
|
303
|
+
cmd: joinedCmd,
|
|
304
|
+
timedOut: false
|
|
305
|
+
};
|
|
306
|
+
}), destroy);
|
|
307
|
+
|
|
308
|
+
crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
|
|
309
|
+
|
|
310
|
+
handleInput(spawned, parsed.opts.input);
|
|
311
|
+
|
|
312
|
+
spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
|
|
313
|
+
spawned.catch = onrejected => handlePromise().catch(onrejected);
|
|
314
|
+
|
|
315
|
+
return spawned;
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
// TODO: set `stderr: 'ignore'` when that option is implemented
|
|
319
|
+
module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
|
|
320
|
+
|
|
321
|
+
// TODO: set `stdout: 'ignore'` when that option is implemented
|
|
322
|
+
module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
|
|
323
|
+
|
|
324
|
+
module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
|
|
325
|
+
|
|
326
|
+
module.exports.sync = (cmd, args, opts) => {
|
|
327
|
+
const parsed = handleArgs(cmd, args, opts);
|
|
328
|
+
const joinedCmd = joinCmd(cmd, args);
|
|
329
|
+
|
|
330
|
+
if (isStream(parsed.opts.input)) {
|
|
331
|
+
throw new TypeError('The `input` option cannot be a stream in sync mode');
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
|
|
335
|
+
result.code = result.status;
|
|
336
|
+
|
|
337
|
+
if (result.error || result.status !== 0 || result.signal !== null) {
|
|
338
|
+
const err = makeError(result, {
|
|
339
|
+
joinedCmd,
|
|
340
|
+
parsed
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
if (!parsed.opts.reject) {
|
|
344
|
+
return err;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
throw err;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
return {
|
|
351
|
+
stdout: handleOutput(parsed.opts, result.stdout),
|
|
352
|
+
stderr: handleOutput(parsed.opts, result.stderr),
|
|
353
|
+
code: 0,
|
|
354
|
+
failed: false,
|
|
355
|
+
signal: null,
|
|
356
|
+
cmd: joinedCmd,
|
|
357
|
+
timedOut: false
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// Older verions of Node.js might not have `util.getSystemErrorName()`.
|
|
3
|
+
// In that case, fall back to a deprecated internal.
|
|
4
|
+
const util = require('util');
|
|
5
|
+
|
|
6
|
+
let uv;
|
|
7
|
+
|
|
8
|
+
if (typeof util.getSystemErrorName === 'function') {
|
|
9
|
+
module.exports = util.getSystemErrorName;
|
|
10
|
+
} else {
|
|
11
|
+
try {
|
|
12
|
+
uv = process.binding('uv');
|
|
13
|
+
|
|
14
|
+
if (typeof uv.errname !== 'function') {
|
|
15
|
+
throw new TypeError('uv.errname is not a function');
|
|
16
|
+
}
|
|
17
|
+
} catch (err) {
|
|
18
|
+
console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
|
|
19
|
+
uv = null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = code => errname(uv, code);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Used for testing the fallback behavior
|
|
26
|
+
module.exports.__test__ = errname;
|
|
27
|
+
|
|
28
|
+
function errname(uv, code) {
|
|
29
|
+
if (uv) {
|
|
30
|
+
return uv.errname(code);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (!(code < 0)) {
|
|
34
|
+
throw new Error('err >= 0');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return `Unknown system error ${code}`;
|
|
38
|
+
}
|
|
39
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const alias = ['stdin', 'stdout', 'stderr'];
|
|
3
|
+
|
|
4
|
+
const hasAlias = opts => alias.some(x => Boolean(opts[x]));
|
|
5
|
+
|
|
6
|
+
module.exports = opts => {
|
|
7
|
+
if (!opts) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (opts.stdio && hasAlias(opts)) {
|
|
12
|
+
throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (typeof opts.stdio === 'string') {
|
|
16
|
+
return opts.stdio;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const stdio = opts.stdio || [];
|
|
20
|
+
|
|
21
|
+
if (!Array.isArray(stdio)) {
|
|
22
|
+
throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const result = [];
|
|
26
|
+
const len = Math.max(stdio.length, alias.length);
|
|
27
|
+
|
|
28
|
+
for (let i = 0; i < len; i++) {
|
|
29
|
+
let value = null;
|
|
30
|
+
|
|
31
|
+
if (stdio[i] !== undefined) {
|
|
32
|
+
value = stdio[i];
|
|
33
|
+
} else if (opts[alias[i]] !== undefined) {
|
|
34
|
+
value = opts[alias[i]];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
result[i] = value;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Made With MOXY Lda <hello@moxy.studio>
|
|
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,94 @@
|
|
|
1
|
+
# cross-spawn
|
|
2
|
+
|
|
3
|
+
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Build status][appveyor-image]][appveyor-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url] [![Greenkeeper badge][greenkeeper-image]][greenkeeper-url]
|
|
4
|
+
|
|
5
|
+
[npm-url]:https://npmjs.org/package/cross-spawn
|
|
6
|
+
[downloads-image]:http://img.shields.io/npm/dm/cross-spawn.svg
|
|
7
|
+
[npm-image]:http://img.shields.io/npm/v/cross-spawn.svg
|
|
8
|
+
[travis-url]:https://travis-ci.org/moxystudio/node-cross-spawn
|
|
9
|
+
[travis-image]:http://img.shields.io/travis/moxystudio/node-cross-spawn/master.svg
|
|
10
|
+
[appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn
|
|
11
|
+
[appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn/master.svg
|
|
12
|
+
[codecov-url]:https://codecov.io/gh/moxystudio/node-cross-spawn
|
|
13
|
+
[codecov-image]:https://img.shields.io/codecov/c/github/moxystudio/node-cross-spawn/master.svg
|
|
14
|
+
[david-dm-url]:https://david-dm.org/moxystudio/node-cross-spawn
|
|
15
|
+
[david-dm-image]:https://img.shields.io/david/moxystudio/node-cross-spawn.svg
|
|
16
|
+
[david-dm-dev-url]:https://david-dm.org/moxystudio/node-cross-spawn?type=dev
|
|
17
|
+
[david-dm-dev-image]:https://img.shields.io/david/dev/moxystudio/node-cross-spawn.svg
|
|
18
|
+
[greenkeeper-image]:https://badges.greenkeeper.io/moxystudio/node-cross-spawn.svg
|
|
19
|
+
[greenkeeper-url]:https://greenkeeper.io/
|
|
20
|
+
|
|
21
|
+
A cross platform solution to node's spawn and spawnSync.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
`$ npm install cross-spawn`
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## Why
|
|
30
|
+
|
|
31
|
+
Node has issues when using spawn on Windows:
|
|
32
|
+
|
|
33
|
+
- It ignores [PATHEXT](https://github.com/joyent/node/issues/2318)
|
|
34
|
+
- It does not support [shebangs](https://en.wikipedia.org/wiki/Shebang_(Unix))
|
|
35
|
+
- Has problems running commands with [spaces](https://github.com/nodejs/node/issues/7367)
|
|
36
|
+
- Has problems running commands with posix relative paths (e.g.: `./my-folder/my-executable`)
|
|
37
|
+
- Has an [issue](https://github.com/moxystudio/node-cross-spawn/issues/82) with command shims (files in `node_modules/.bin/`), where arguments with quotes and parenthesis would result in [invalid syntax error](https://github.com/moxystudio/node-cross-spawn/blob/e77b8f22a416db46b6196767bcd35601d7e11d54/test/index.test.js#L149)
|
|
38
|
+
- No `options.shell` support on node `<v4.8`
|
|
39
|
+
|
|
40
|
+
All these issues are handled correctly by `cross-spawn`.
|
|
41
|
+
There are some known modules, such as [win-spawn](https://github.com/ForbesLindesay/win-spawn), that try to solve this but they are either broken or provide faulty escaping of shell arguments.
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
Exactly the same way as node's [`spawn`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) or [`spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options), so it's a drop in replacement.
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
const spawn = require('cross-spawn');
|
|
51
|
+
|
|
52
|
+
// Spawn NPM asynchronously
|
|
53
|
+
const child = spawn('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' });
|
|
54
|
+
|
|
55
|
+
// Spawn NPM synchronously
|
|
56
|
+
const result = spawn.sync('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' });
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## Caveats
|
|
61
|
+
|
|
62
|
+
### Using `options.shell` as an alternative to `cross-spawn`
|
|
63
|
+
|
|
64
|
+
Starting from node `v4.8`, `spawn` has a `shell` option that allows you run commands from within a shell. This new option solves
|
|
65
|
+
the [PATHEXT](https://github.com/joyent/node/issues/2318) issue but:
|
|
66
|
+
|
|
67
|
+
- It's not supported in node `<v4.8`
|
|
68
|
+
- You must manually escape the command and arguments which is very error prone, specially when passing user input
|
|
69
|
+
- There are a lot of other unresolved issues from the [Why](#why) section that you must take into account
|
|
70
|
+
|
|
71
|
+
If you are using the `shell` option to spawn a command in a cross platform way, consider using `cross-spawn` instead. You have been warned.
|
|
72
|
+
|
|
73
|
+
### `options.shell` support
|
|
74
|
+
|
|
75
|
+
While `cross-spawn` adds support for `options.shell` in node `<v4.8`, all of its enhancements are disabled.
|
|
76
|
+
|
|
77
|
+
This mimics the Node.js behavior. More specifically, the command and its arguments will not be automatically escaped nor shebang support will be offered. This is by design because if you are using `options.shell` you are probably targeting a specific platform anyway and you don't want things to get into your way.
|
|
78
|
+
|
|
79
|
+
### Shebangs support
|
|
80
|
+
|
|
81
|
+
While `cross-spawn` handles shebangs on Windows, its support is limited. More specifically, it just supports `#!/usr/bin/env <program>` where `<program>` must not contain any arguments.
|
|
82
|
+
If you would like to have the shebang support improved, feel free to contribute via a pull-request.
|
|
83
|
+
|
|
84
|
+
Remember to always test your code on Windows!
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## Tests
|
|
88
|
+
|
|
89
|
+
`$ npm test`
|
|
90
|
+
`$ npm test -- --watch` during development
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
|