projen 0.91.16 → 0.91.18
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 +62 -18
- 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.js +1 -1
- package/lib/github/auto-queue.js +1 -1
- 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 +1 -1
- package/lib/github/mergify.js +1 -1
- package/lib/github/pr-template.js +1 -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.d.ts +10 -0
- package/lib/github/workflows.js +4 -2
- 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
|
@@ -24,7 +24,7 @@ common.register('tail', _tail, {
|
|
|
24
24
|
//@ var str = tail(['file1', 'file2']); // same as above
|
|
25
25
|
//@ ```
|
|
26
26
|
//@
|
|
27
|
-
//@ Read the end of a `file`.
|
|
27
|
+
//@ Read the end of a `file`. Returns a [ShellString](#shellstringstr).
|
|
28
28
|
function _tail(options, files) {
|
|
29
29
|
var tail = [];
|
|
30
30
|
var pipe = common.readFromPipe();
|
|
@@ -32,12 +32,20 @@ function _tail(options, files) {
|
|
|
32
32
|
if (!files && !pipe) common.error('no paths given');
|
|
33
33
|
|
|
34
34
|
var idx = 1;
|
|
35
|
+
var plusOption = false;
|
|
35
36
|
if (options.numLines === true) {
|
|
36
37
|
idx = 2;
|
|
38
|
+
if (arguments[1][0] === '+') {
|
|
39
|
+
plusOption = true;
|
|
40
|
+
}
|
|
37
41
|
options.numLines = Number(arguments[1]);
|
|
38
42
|
} else if (options.numLines === false) {
|
|
39
43
|
options.numLines = 10;
|
|
40
44
|
}
|
|
45
|
+
// arguments[0] is a json object
|
|
46
|
+
if (arguments[0].numLines[0] === '+') {
|
|
47
|
+
plusOption = true;
|
|
48
|
+
}
|
|
41
49
|
options.numLines = -1 * Math.abs(options.numLines);
|
|
42
50
|
files = [].slice.call(arguments, idx);
|
|
43
51
|
|
|
@@ -69,12 +77,14 @@ function _tail(options, files) {
|
|
|
69
77
|
shouldAppendNewline = false;
|
|
70
78
|
}
|
|
71
79
|
|
|
72
|
-
tail = tail.concat(lines.slice(options.numLines));
|
|
80
|
+
tail = tail.concat(plusOption ? lines.slice(-options.numLines - 1) : lines.slice(options.numLines));
|
|
73
81
|
});
|
|
74
82
|
|
|
75
83
|
if (shouldAppendNewline) {
|
|
76
84
|
tail.push(''); // to add a trailing newline once we join
|
|
77
85
|
}
|
|
86
|
+
|
|
78
87
|
return tail.join('\n');
|
|
79
88
|
}
|
|
89
|
+
|
|
80
90
|
module.exports = _tail;
|
|
@@ -35,10 +35,11 @@ common.register('test', _test, {
|
|
|
35
35
|
//@
|
|
36
36
|
//@ ```javascript
|
|
37
37
|
//@ if (test('-d', path)) { /* do something with dir */ };
|
|
38
|
-
//@ if (!test('-f', path)) continue; // skip if it's a regular file
|
|
38
|
+
//@ if (!test('-f', path)) continue; // skip if it's not a regular file
|
|
39
39
|
//@ ```
|
|
40
40
|
//@
|
|
41
|
-
//@ Evaluates `expression` using the available primaries and returns
|
|
41
|
+
//@ Evaluates `expression` using the available primaries and returns
|
|
42
|
+
//@ corresponding boolean value.
|
|
42
43
|
function _test(options, path) {
|
|
43
44
|
if (!path) common.error('no path given');
|
|
44
45
|
|
|
@@ -18,7 +18,8 @@ common.register('to', _to, {
|
|
|
18
18
|
//@
|
|
19
19
|
//@ Analogous to the redirection operator `>` in Unix, but works with
|
|
20
20
|
//@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.). _Like Unix
|
|
21
|
-
//@ redirections, `to()` will overwrite any existing file!_
|
|
21
|
+
//@ redirections, `to()` will overwrite any existing file!_ Returns the same
|
|
22
|
+
//@ [ShellString](#shellstringstr) this operated on, to support chaining.
|
|
22
23
|
function _to(options, file) {
|
|
23
24
|
if (!file) common.error('wrong arguments');
|
|
24
25
|
|
|
@@ -17,7 +17,8 @@ common.register('toEnd', _toEnd, {
|
|
|
17
17
|
//@ ```
|
|
18
18
|
//@
|
|
19
19
|
//@ Analogous to the redirect-and-append operator `>>` in Unix, but works with
|
|
20
|
-
//@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.).
|
|
20
|
+
//@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.). Returns the
|
|
21
|
+
//@ same [ShellString](#shellstringstr) this operated on, to support chaining.
|
|
21
22
|
function _toEnd(options, file) {
|
|
22
23
|
if (!file) common.error('wrong arguments');
|
|
23
24
|
|
|
@@ -20,20 +20,26 @@ common.register('touch', _touch, {
|
|
|
20
20
|
//@ + `-a`: Change only the access time
|
|
21
21
|
//@ + `-c`: Do not create any files
|
|
22
22
|
//@ + `-m`: Change only the modification time
|
|
23
|
-
//@ +
|
|
24
|
-
//@
|
|
23
|
+
//@ + `{'-d': someDate}`, `{date: someDate}`: Use a `Date` instance (ex. `someDate`)
|
|
24
|
+
//@ instead of current time
|
|
25
|
+
//@ + `{'-r': file}`, `{reference: file}`: Use `file`'s times instead of current
|
|
26
|
+
//@ time
|
|
25
27
|
//@
|
|
26
28
|
//@ Examples:
|
|
27
29
|
//@
|
|
28
30
|
//@ ```javascript
|
|
29
31
|
//@ touch('source.js');
|
|
30
|
-
//@ touch('-c', '
|
|
31
|
-
//@ touch({ '-r':
|
|
32
|
+
//@ touch('-c', 'path/to/file.js');
|
|
33
|
+
//@ touch({ '-r': 'referenceFile.txt' }, 'path/to/file.js');
|
|
34
|
+
//@ touch({ '-d': new Date('December 17, 1995 03:24:00'), '-m': true }, 'path/to/file.js');
|
|
35
|
+
//@ touch({ date: new Date('December 17, 1995 03:24:00') }, 'path/to/file.js');
|
|
32
36
|
//@ ```
|
|
33
37
|
//@
|
|
34
|
-
//@ Update the access and modification times of each
|
|
35
|
-
//@ A
|
|
36
|
-
//@ This is a partial implementation of
|
|
38
|
+
//@ Update the access and modification times of each file to the current time.
|
|
39
|
+
//@ A file argument that does not exist is created empty, unless `-c` is supplied.
|
|
40
|
+
//@ This is a partial implementation of
|
|
41
|
+
//@ [`touch(1)`](http://linux.die.net/man/1/touch). Returns a
|
|
42
|
+
//@ [ShellString](#shellstringstr) indicating success or failure.
|
|
37
43
|
function _touch(opts, files) {
|
|
38
44
|
if (!files) {
|
|
39
45
|
common.error('no files given');
|
|
@@ -36,7 +36,8 @@ common.register('uniq', _uniq, {
|
|
|
36
36
|
//@ uniq('-cd', 'foo.txt', 'bar.txt');
|
|
37
37
|
//@ ```
|
|
38
38
|
//@
|
|
39
|
-
//@ Filter adjacent matching lines from `input`.
|
|
39
|
+
//@ Filter adjacent matching lines from `input`. Returns a
|
|
40
|
+
//@ [ShellString](#shellstringstr).
|
|
40
41
|
function _uniq(options, input, output) {
|
|
41
42
|
// Check if this is coming from a pipe
|
|
42
43
|
var pipe = common.readFromPipe();
|
|
@@ -54,9 +55,9 @@ function _uniq(options, input, output) {
|
|
|
54
55
|
common.error(output + ': Is a directory');
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
var lines = (input ? fs.readFileSync(input, 'utf8') : pipe)
|
|
58
|
-
trimRight()
|
|
59
|
-
split('\n');
|
|
58
|
+
var lines = (input ? fs.readFileSync(input, 'utf8') : pipe)
|
|
59
|
+
.trimRight()
|
|
60
|
+
.split('\n');
|
|
60
61
|
|
|
61
62
|
var compare = function (a, b) {
|
|
62
63
|
return options.ignoreCase ?
|
|
@@ -53,7 +53,8 @@ function checkPath(pathName) {
|
|
|
53
53
|
//@
|
|
54
54
|
//@ Searches for `command` in the system's `PATH`. On Windows, this uses the
|
|
55
55
|
//@ `PATHEXT` variable to append the extension if it's not already executable.
|
|
56
|
-
//@ Returns
|
|
56
|
+
//@ Returns a [ShellString](#shellstringstr) containing the absolute path to
|
|
57
|
+
//@ `command`.
|
|
57
58
|
function _which(options, cmd) {
|
|
58
59
|
if (!cmd) common.error('must specify command');
|
|
59
60
|
|
|
@@ -63,7 +64,7 @@ function _which(options, cmd) {
|
|
|
63
64
|
var queryMatches = [];
|
|
64
65
|
|
|
65
66
|
// No relative/absolute paths provided?
|
|
66
|
-
if (cmd.
|
|
67
|
+
if (!cmd.includes('/')) {
|
|
67
68
|
// Assume that there are no extensions to append to queries (this is the
|
|
68
69
|
// case for unix)
|
|
69
70
|
var pathExtArray = [''];
|
|
@@ -85,8 +86,8 @@ function _which(options, cmd) {
|
|
|
85
86
|
attempt = attempt.toUpperCase();
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
var match = attempt.match(/\.[^<>:"
|
|
89
|
-
if (match && pathExtArray.
|
|
89
|
+
var match = attempt.match(/\.[^<>:"/|?*.]+$/);
|
|
90
|
+
if (match && pathExtArray.includes(match[0])) { // this is Windows-only
|
|
90
91
|
// The user typed a query with the file extension, like
|
|
91
92
|
// `which('node.exe')`
|
|
92
93
|
if (checkPath(attempt)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Shx
|
|
2
2
|
|
|
3
|
-
[](https://github.com/shelljs/shx/actions/workflows/main.yml)
|
|
4
|
+
[](https://codecov.io/gh/shelljs/shx)
|
|
5
5
|
[](https://www.npmjs.com/package/shx)
|
|
6
6
|
[](https://www.npmjs.com/package/shx)
|
|
7
7
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
commands, providing an easy solution for simple Unix-like, cross-platform
|
|
10
10
|
commands in npm package scripts.
|
|
11
11
|
|
|
12
|
-
`shx` is proudly tested on every node release since <!-- start minVersion -->`
|
|
12
|
+
`shx` is proudly tested on every LTS node release since <!-- start minVersion -->`v18`<!-- stop minVersion -->!
|
|
13
13
|
|
|
14
14
|
## Difference Between ShellJS and shx
|
|
15
15
|
|
|
@@ -59,6 +59,8 @@ sub
|
|
|
59
59
|
$ shx rm -r sub # options work as well
|
|
60
60
|
|
|
61
61
|
$ shx --silent ls fakeFileName # silence error output
|
|
62
|
+
|
|
63
|
+
$ shx --negate test -d dir # Negate status code output (e.g., failed commands will now have status 0)
|
|
62
64
|
```
|
|
63
65
|
|
|
64
66
|
All commands internally call the ShellJS corresponding function, guaranteeing
|
|
@@ -71,19 +73,26 @@ platform-independent scripts, we recommend you go with that.
|
|
|
71
73
|
|
|
72
74
|
However, `shx` is ideal for one-liners inside `package.json`:
|
|
73
75
|
|
|
74
|
-
```
|
|
76
|
+
```json
|
|
75
77
|
{
|
|
76
78
|
"scripts": {
|
|
77
|
-
"clean": "shx rm -rf build
|
|
79
|
+
"clean": "shx rm -rf \"build/**/*.js\" \"build/output\" && shx echo \"Done cleaning\""
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
82
|
```
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
recommend
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
It's safe to use `&&` and `||` operators in npm package scripts. These will be
|
|
85
|
+
interpreted by the operating system's shell (`sh` on Unix, `cmd.exe` on
|
|
86
|
+
Windows). If you're using glob operators like `*` or `**`, then we recommend to
|
|
87
|
+
**put these in double quotes**, which ensures that `shx` will expand the glob
|
|
88
|
+
rather than the operating system shell.
|
|
89
|
+
|
|
90
|
+
> [!IMPORTANT]
|
|
91
|
+
> Windows treats single quotes (ex. `'some string'`) differently than double
|
|
92
|
+
> quotes.
|
|
93
|
+
> [We recommend](https://github.com/shelljs/shx/issues/165#issuecomment-563127983)
|
|
94
|
+
> wrapping your arguments in **escaped double quotes** so that your code is
|
|
95
|
+
> compatible cross platform (ex. `"clean": "shx echo \"some string\""`).
|
|
87
96
|
|
|
88
97
|
## Command reference
|
|
89
98
|
|
|
@@ -114,7 +123,7 @@ characters in the file path.
|
|
|
114
123
|
|
|
115
124
|
### Unsupported Commands
|
|
116
125
|
|
|
117
|
-
As mentioned above, most ShellJS commands are supported in
|
|
126
|
+
As mentioned above, most ShellJS commands are supported in `shx`. Due to the
|
|
118
127
|
differences in execution environments between ShellJS and `shx` (JS vs CLI) the
|
|
119
128
|
following commands are not supported:
|
|
120
129
|
|
|
@@ -136,10 +145,13 @@ supported options:
|
|
|
136
145
|
|
|
137
146
|
| [`set`](https://github.com/shelljs/shelljs#setoptions) flag | [`shell.config`](https://github.com/shelljs/shelljs#configuration) setting | shx command | Effect |
|
|
138
147
|
|:---:| --- | --- | --- |
|
|
139
|
-
| `-e` | `config.fatal = true` | Not supported | Exit upon first error |
|
|
140
|
-
| `-v` | `config.verbose = true` | `shx --verbose cd foo` | Log the command as it's run |
|
|
141
|
-
| `-f` | `config.noglob = true` | `shx --noglob cat '*.txt'` | Don't expand wildcards |
|
|
142
|
-
| N/A | `config.silent = true` | `shx --silent cd noexist` | Don't show error output |
|
|
148
|
+
| `-e` | `config.fatal = true` | Not supported | Exit upon first error. |
|
|
149
|
+
| `-v` | `config.verbose = true` | `shx --verbose cd foo` | Log the command as it's run. |
|
|
150
|
+
| `-f` | `config.noglob = true` | `shx --noglob cat '*.txt'` | Don't expand wildcards. |
|
|
151
|
+
| N/A | `config.silent = true` | `shx --silent cd noexist` | Don't show error output. |
|
|
152
|
+
| N/A | N/A | `shx --negate test -d dir` | Runs the specified command but negates the exit status. Failed command = status 0, successful command = status 1. |
|
|
153
|
+
| N/A | N/A | `shx --help` | Show help text. |
|
|
154
|
+
| N/A | N/A | `shx --version` | Print the shx version. |
|
|
143
155
|
|
|
144
156
|
## Team
|
|
145
157
|
|
|
@@ -13,7 +13,7 @@ var _config = require('./config');
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
|
|
15
15
|
// Global options defined directly in shx.
|
|
16
|
-
var locallyDefinedOptions = ['version'];
|
|
16
|
+
var locallyDefinedOptions = ['version', 'negate'];
|
|
17
17
|
|
|
18
18
|
var shxOptions = Object.keys(_shelljs2.default.config).filter(function (key) {
|
|
19
19
|
return typeof _shelljs2.default.config[key] !== 'function';
|
|
@@ -5,14 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.shx = shx;
|
|
7
7
|
|
|
8
|
-
var _shelljs = require('shelljs');
|
|
9
|
-
|
|
10
|
-
var _shelljs2 = _interopRequireDefault(_shelljs);
|
|
11
|
-
|
|
12
|
-
var _minimist = require('minimist');
|
|
13
|
-
|
|
14
|
-
var _minimist2 = _interopRequireDefault(_minimist);
|
|
15
|
-
|
|
16
8
|
var _path = require('path');
|
|
17
9
|
|
|
18
10
|
var _path2 = _interopRequireDefault(_path);
|
|
@@ -21,6 +13,14 @@ var _fs = require('fs');
|
|
|
21
13
|
|
|
22
14
|
var _fs2 = _interopRequireDefault(_fs);
|
|
23
15
|
|
|
16
|
+
var _shelljs = require('shelljs');
|
|
17
|
+
|
|
18
|
+
var _shelljs2 = _interopRequireDefault(_shelljs);
|
|
19
|
+
|
|
20
|
+
var _minimist = require('minimist');
|
|
21
|
+
|
|
22
|
+
var _minimist2 = _interopRequireDefault(_minimist);
|
|
23
|
+
|
|
24
24
|
var _help = require('./help');
|
|
25
25
|
|
|
26
26
|
var _help2 = _interopRequireDefault(_help);
|
|
@@ -146,6 +146,11 @@ function shx(argv) {
|
|
|
146
146
|
code = ret ? 0 : 1;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
// Check for negation flag, and flip the code value
|
|
150
|
+
if (parsedArgs.negate === true) {
|
|
151
|
+
code = Number(!code);
|
|
152
|
+
}
|
|
153
|
+
|
|
149
154
|
if (typeof code === 'number') {
|
|
150
155
|
return code;
|
|
151
156
|
} else if (_shelljs2.default.error()) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Portable Shell Commands for Node",
|
|
5
5
|
"bin": {
|
|
6
6
|
"shx": "lib/cli.js"
|
|
@@ -12,20 +12,14 @@
|
|
|
12
12
|
"check-node-support": "node scripts/check-node-support",
|
|
13
13
|
"prebuild": "rimraf lib",
|
|
14
14
|
"build": "babel src -d lib",
|
|
15
|
-
"build:watch": "npm run build -- -w",
|
|
16
|
-
"dev": "concurrently -rk 'npm run build:watch' 'npm run lint:watch'",
|
|
17
15
|
"lint": "eslint .",
|
|
18
|
-
"lint:fix": "npm run lint --silent -- --fix",
|
|
19
|
-
"lint:watch": "watch 'npm run lint --silent' src test",
|
|
20
16
|
"prepublish": "npm run build",
|
|
21
|
-
"posttest": "npm run lint
|
|
17
|
+
"posttest": "npm run lint",
|
|
22
18
|
"release:major": "shelljs-release major",
|
|
23
19
|
"release:minor": "shelljs-release minor",
|
|
24
20
|
"release:patch": "shelljs-release patch",
|
|
25
21
|
"changelog": "shelljs-changelog",
|
|
26
|
-
"
|
|
27
|
-
"test": "nyc --reporter=text --reporter=lcov mocha",
|
|
28
|
-
"test:watch": "concurrently -rk 'npm run test --silent -- -w' 'npm run lint:watch'"
|
|
22
|
+
"test": "nyc --reporter=text --reporter=lcov mocha"
|
|
29
23
|
},
|
|
30
24
|
"repository": {
|
|
31
25
|
"type": "git",
|
|
@@ -55,26 +49,24 @@
|
|
|
55
49
|
"babel-cli": "^6.6.5",
|
|
56
50
|
"babel-preset-env": "^1.7.0",
|
|
57
51
|
"babel-register": "^6.7.2",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"eslint": "
|
|
61
|
-
"eslint-
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"rimraf": "^2.5.2",
|
|
52
|
+
"eslint": "^8.57.1",
|
|
53
|
+
"eslint-config-airbnb-base": "^15.0.0",
|
|
54
|
+
"eslint-import-resolver-node": "0.3.7",
|
|
55
|
+
"eslint-plugin-import": "^2.31.0",
|
|
56
|
+
"js-yaml": "^4.1.0",
|
|
57
|
+
"mocha": "^11.1.0",
|
|
58
|
+
"nyc": "^17.1.0",
|
|
59
|
+
"rimraf": "^5.0.10",
|
|
67
60
|
"shelljs-changelog": "^0.2.6",
|
|
68
|
-
"shelljs-plugin-open": "^0.
|
|
69
|
-
"shelljs-release": "^0.5.
|
|
70
|
-
"should": "^13.2.3"
|
|
71
|
-
"watch": "^1.0.2"
|
|
61
|
+
"shelljs-plugin-open": "^0.3.0",
|
|
62
|
+
"shelljs-release": "^0.5.3",
|
|
63
|
+
"should": "^13.2.3"
|
|
72
64
|
},
|
|
73
65
|
"dependencies": {
|
|
74
|
-
"minimist": "^1.2.
|
|
75
|
-
"shelljs": "^0.
|
|
66
|
+
"minimist": "^1.2.8",
|
|
67
|
+
"shelljs": "^0.9.2"
|
|
76
68
|
},
|
|
77
69
|
"engines": {
|
|
78
|
-
"node": ">=
|
|
70
|
+
"node": ">=18"
|
|
79
71
|
}
|
|
80
72
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
The ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015, Contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software
|
|
6
|
+
for any purpose with or without fee is hereby granted, provided
|
|
7
|
+
that the above copyright notice and this permission notice
|
|
8
|
+
appear in all copies.
|
|
9
|
+
|
|
10
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
11
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
|
12
|
+
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
|
|
13
|
+
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
|
14
|
+
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
15
|
+
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
16
|
+
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# signal-exit
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/tapjs/signal-exit)
|
|
4
|
+
[](https://coveralls.io/r/tapjs/signal-exit?branch=master)
|
|
5
|
+
[](https://www.npmjs.com/package/signal-exit)
|
|
6
|
+
[](https://github.com/conventional-changelog/standard-version)
|
|
7
|
+
|
|
8
|
+
When you want to fire an event no matter how a process exits:
|
|
9
|
+
|
|
10
|
+
* reaching the end of execution.
|
|
11
|
+
* explicitly having `process.exit(code)` called.
|
|
12
|
+
* having `process.kill(pid, sig)` called.
|
|
13
|
+
* receiving a fatal signal from outside the process
|
|
14
|
+
|
|
15
|
+
Use `signal-exit`.
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
var onExit = require('signal-exit')
|
|
19
|
+
|
|
20
|
+
onExit(function (code, signal) {
|
|
21
|
+
console.log('process exited!')
|
|
22
|
+
})
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## API
|
|
26
|
+
|
|
27
|
+
`var remove = onExit(function (code, signal) {}, options)`
|
|
28
|
+
|
|
29
|
+
The return value of the function is a function that will remove the
|
|
30
|
+
handler.
|
|
31
|
+
|
|
32
|
+
Note that the function *only* fires for signals if the signal would
|
|
33
|
+
cause the process to exit. That is, there are no other listeners, and
|
|
34
|
+
it is a fatal signal.
|
|
35
|
+
|
|
36
|
+
## Options
|
|
37
|
+
|
|
38
|
+
* `alwaysLast`: Run this handler after any other signal or exit
|
|
39
|
+
handlers. This causes `process.emit` to be monkeypatched.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
// Note: since nyc uses this module to output coverage, any lines
|
|
2
|
+
// that are in the direct sync flow of nyc's outputCoverage are
|
|
3
|
+
// ignored, since we can never get coverage for them.
|
|
4
|
+
// grab a reference to node's real process object right away
|
|
5
|
+
var process = global.process
|
|
6
|
+
|
|
7
|
+
const processOk = function (process) {
|
|
8
|
+
return process &&
|
|
9
|
+
typeof process === 'object' &&
|
|
10
|
+
typeof process.removeListener === 'function' &&
|
|
11
|
+
typeof process.emit === 'function' &&
|
|
12
|
+
typeof process.reallyExit === 'function' &&
|
|
13
|
+
typeof process.listeners === 'function' &&
|
|
14
|
+
typeof process.kill === 'function' &&
|
|
15
|
+
typeof process.pid === 'number' &&
|
|
16
|
+
typeof process.on === 'function'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// some kind of non-node environment, just no-op
|
|
20
|
+
/* istanbul ignore if */
|
|
21
|
+
if (!processOk(process)) {
|
|
22
|
+
module.exports = function () {
|
|
23
|
+
return function () {}
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
var assert = require('assert')
|
|
27
|
+
var signals = require('./signals.js')
|
|
28
|
+
var isWin = /^win/i.test(process.platform)
|
|
29
|
+
|
|
30
|
+
var EE = require('events')
|
|
31
|
+
/* istanbul ignore if */
|
|
32
|
+
if (typeof EE !== 'function') {
|
|
33
|
+
EE = EE.EventEmitter
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var emitter
|
|
37
|
+
if (process.__signal_exit_emitter__) {
|
|
38
|
+
emitter = process.__signal_exit_emitter__
|
|
39
|
+
} else {
|
|
40
|
+
emitter = process.__signal_exit_emitter__ = new EE()
|
|
41
|
+
emitter.count = 0
|
|
42
|
+
emitter.emitted = {}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Because this emitter is a global, we have to check to see if a
|
|
46
|
+
// previous version of this library failed to enable infinite listeners.
|
|
47
|
+
// I know what you're about to say. But literally everything about
|
|
48
|
+
// signal-exit is a compromise with evil. Get used to it.
|
|
49
|
+
if (!emitter.infinite) {
|
|
50
|
+
emitter.setMaxListeners(Infinity)
|
|
51
|
+
emitter.infinite = true
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
module.exports = function (cb, opts) {
|
|
55
|
+
/* istanbul ignore if */
|
|
56
|
+
if (!processOk(global.process)) {
|
|
57
|
+
return function () {}
|
|
58
|
+
}
|
|
59
|
+
assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
|
|
60
|
+
|
|
61
|
+
if (loaded === false) {
|
|
62
|
+
load()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
var ev = 'exit'
|
|
66
|
+
if (opts && opts.alwaysLast) {
|
|
67
|
+
ev = 'afterexit'
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
var remove = function () {
|
|
71
|
+
emitter.removeListener(ev, cb)
|
|
72
|
+
if (emitter.listeners('exit').length === 0 &&
|
|
73
|
+
emitter.listeners('afterexit').length === 0) {
|
|
74
|
+
unload()
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
emitter.on(ev, cb)
|
|
78
|
+
|
|
79
|
+
return remove
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
var unload = function unload () {
|
|
83
|
+
if (!loaded || !processOk(global.process)) {
|
|
84
|
+
return
|
|
85
|
+
}
|
|
86
|
+
loaded = false
|
|
87
|
+
|
|
88
|
+
signals.forEach(function (sig) {
|
|
89
|
+
try {
|
|
90
|
+
process.removeListener(sig, sigListeners[sig])
|
|
91
|
+
} catch (er) {}
|
|
92
|
+
})
|
|
93
|
+
process.emit = originalProcessEmit
|
|
94
|
+
process.reallyExit = originalProcessReallyExit
|
|
95
|
+
emitter.count -= 1
|
|
96
|
+
}
|
|
97
|
+
module.exports.unload = unload
|
|
98
|
+
|
|
99
|
+
var emit = function emit (event, code, signal) {
|
|
100
|
+
/* istanbul ignore if */
|
|
101
|
+
if (emitter.emitted[event]) {
|
|
102
|
+
return
|
|
103
|
+
}
|
|
104
|
+
emitter.emitted[event] = true
|
|
105
|
+
emitter.emit(event, code, signal)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// { <signal>: <listener fn>, ... }
|
|
109
|
+
var sigListeners = {}
|
|
110
|
+
signals.forEach(function (sig) {
|
|
111
|
+
sigListeners[sig] = function listener () {
|
|
112
|
+
/* istanbul ignore if */
|
|
113
|
+
if (!processOk(global.process)) {
|
|
114
|
+
return
|
|
115
|
+
}
|
|
116
|
+
// If there are no other listeners, an exit is coming!
|
|
117
|
+
// Simplest way: remove us and then re-send the signal.
|
|
118
|
+
// We know that this will kill the process, so we can
|
|
119
|
+
// safely emit now.
|
|
120
|
+
var listeners = process.listeners(sig)
|
|
121
|
+
if (listeners.length === emitter.count) {
|
|
122
|
+
unload()
|
|
123
|
+
emit('exit', null, sig)
|
|
124
|
+
/* istanbul ignore next */
|
|
125
|
+
emit('afterexit', null, sig)
|
|
126
|
+
/* istanbul ignore next */
|
|
127
|
+
if (isWin && sig === 'SIGHUP') {
|
|
128
|
+
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
129
|
+
// so use a supported signal instead
|
|
130
|
+
sig = 'SIGINT'
|
|
131
|
+
}
|
|
132
|
+
/* istanbul ignore next */
|
|
133
|
+
process.kill(process.pid, sig)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
module.exports.signals = function () {
|
|
139
|
+
return signals
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
var loaded = false
|
|
143
|
+
|
|
144
|
+
var load = function load () {
|
|
145
|
+
if (loaded || !processOk(global.process)) {
|
|
146
|
+
return
|
|
147
|
+
}
|
|
148
|
+
loaded = true
|
|
149
|
+
|
|
150
|
+
// This is the number of onSignalExit's that are in play.
|
|
151
|
+
// It's important so that we can count the correct number of
|
|
152
|
+
// listeners on signals, and don't wait for the other one to
|
|
153
|
+
// handle it instead of us.
|
|
154
|
+
emitter.count += 1
|
|
155
|
+
|
|
156
|
+
signals = signals.filter(function (sig) {
|
|
157
|
+
try {
|
|
158
|
+
process.on(sig, sigListeners[sig])
|
|
159
|
+
return true
|
|
160
|
+
} catch (er) {
|
|
161
|
+
return false
|
|
162
|
+
}
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
process.emit = processEmit
|
|
166
|
+
process.reallyExit = processReallyExit
|
|
167
|
+
}
|
|
168
|
+
module.exports.load = load
|
|
169
|
+
|
|
170
|
+
var originalProcessReallyExit = process.reallyExit
|
|
171
|
+
var processReallyExit = function processReallyExit (code) {
|
|
172
|
+
/* istanbul ignore if */
|
|
173
|
+
if (!processOk(global.process)) {
|
|
174
|
+
return
|
|
175
|
+
}
|
|
176
|
+
process.exitCode = code || /* istanbul ignore next */ 0
|
|
177
|
+
emit('exit', process.exitCode, null)
|
|
178
|
+
/* istanbul ignore next */
|
|
179
|
+
emit('afterexit', process.exitCode, null)
|
|
180
|
+
/* istanbul ignore next */
|
|
181
|
+
originalProcessReallyExit.call(process, process.exitCode)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
var originalProcessEmit = process.emit
|
|
185
|
+
var processEmit = function processEmit (ev, arg) {
|
|
186
|
+
if (ev === 'exit' && processOk(global.process)) {
|
|
187
|
+
/* istanbul ignore else */
|
|
188
|
+
if (arg !== undefined) {
|
|
189
|
+
process.exitCode = arg
|
|
190
|
+
}
|
|
191
|
+
var ret = originalProcessEmit.apply(this, arguments)
|
|
192
|
+
/* istanbul ignore next */
|
|
193
|
+
emit('exit', process.exitCode, null)
|
|
194
|
+
/* istanbul ignore next */
|
|
195
|
+
emit('afterexit', process.exitCode, null)
|
|
196
|
+
/* istanbul ignore next */
|
|
197
|
+
return ret
|
|
198
|
+
} else {
|
|
199
|
+
return originalProcessEmit.apply(this, arguments)
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|