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
|
@@ -16,7 +16,7 @@ common.register('popd', _popd, {
|
|
|
16
16
|
var _dirStack = [];
|
|
17
17
|
|
|
18
18
|
function _isStackIndex(index) {
|
|
19
|
-
return (/^[
|
|
19
|
+
return (/^[-+]\d+$/).test(index);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
function _parseStackIndex(index) {
|
|
@@ -40,7 +40,7 @@ function _actualDirStack() {
|
|
|
40
40
|
//@ Available options:
|
|
41
41
|
//@
|
|
42
42
|
//@ + `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated.
|
|
43
|
-
//@ + `-q`:
|
|
43
|
+
//@ + `-q`: Suppresses output to the console.
|
|
44
44
|
//@
|
|
45
45
|
//@ Arguments:
|
|
46
46
|
//@
|
|
@@ -81,12 +81,10 @@ function _pushd(options, dir) {
|
|
|
81
81
|
} else if (_isStackIndex(dir)) {
|
|
82
82
|
var n = _parseStackIndex(dir);
|
|
83
83
|
dirs = dirs.slice(n).concat(dirs.slice(0, n));
|
|
84
|
+
} else if (options['no-cd']) {
|
|
85
|
+
dirs.splice(1, 0, dir);
|
|
84
86
|
} else {
|
|
85
|
-
|
|
86
|
-
dirs.splice(1, 0, dir);
|
|
87
|
-
} else {
|
|
88
|
-
dirs.unshift(dir);
|
|
89
|
-
}
|
|
87
|
+
dirs.unshift(dir);
|
|
90
88
|
}
|
|
91
89
|
|
|
92
90
|
if (options['no-cd']) {
|
|
@@ -108,7 +106,7 @@ exports.pushd = _pushd;
|
|
|
108
106
|
//@ Available options:
|
|
109
107
|
//@
|
|
110
108
|
//@ + `-n`: Suppress the normal directory change when removing directories from the stack, so that only the stack is manipulated.
|
|
111
|
-
//@ + `-q`:
|
|
109
|
+
//@ + `-q`: Suppresses output to the console.
|
|
112
110
|
//@
|
|
113
111
|
//@ Arguments:
|
|
114
112
|
//@
|
|
@@ -162,7 +160,7 @@ exports.popd = _popd;
|
|
|
162
160
|
//@ Available options:
|
|
163
161
|
//@
|
|
164
162
|
//@ + `-c`: Clears the directory stack by deleting all of the elements.
|
|
165
|
-
//@ + `-q`:
|
|
163
|
+
//@ + `-q`: Suppresses output to the console.
|
|
166
164
|
//@
|
|
167
165
|
//@ Arguments:
|
|
168
166
|
//@
|
|
@@ -22,8 +22,7 @@ common.register('echo', _echo, {
|
|
|
22
22
|
//@ echo('-n', 'no newline at end');
|
|
23
23
|
//@ ```
|
|
24
24
|
//@
|
|
25
|
-
//@ Prints `string` to stdout, and returns
|
|
26
|
-
//@ like `.to()`.
|
|
25
|
+
//@ Prints `string` to stdout, and returns a [ShellString](#shellstringstr).
|
|
27
26
|
function _echo(opts) {
|
|
28
27
|
// allow strings starting with '-', see issue #20
|
|
29
28
|
var messages = [].slice.call(arguments, opts ? 0 : 1);
|
|
@@ -1,39 +1,71 @@
|
|
|
1
|
-
if (require.main !== module) {
|
|
2
|
-
throw new Error('This file should not be required');
|
|
3
|
-
}
|
|
4
|
-
|
|
5
1
|
var childProcess = require('child_process');
|
|
6
2
|
var fs = require('fs');
|
|
7
3
|
|
|
8
|
-
|
|
4
|
+
function main() {
|
|
5
|
+
var paramFilePath = process.argv[2];
|
|
6
|
+
|
|
7
|
+
var serializedParams = fs.readFileSync(paramFilePath, 'utf8');
|
|
8
|
+
var params = JSON.parse(serializedParams);
|
|
9
|
+
|
|
10
|
+
var cmd = params.command;
|
|
11
|
+
var execOptions = params.execOptions;
|
|
12
|
+
var pipe = params.pipe;
|
|
13
|
+
var stdoutFile = params.stdoutFile;
|
|
14
|
+
var stderrFile = params.stderrFile;
|
|
9
15
|
|
|
10
|
-
|
|
11
|
-
var
|
|
16
|
+
function isMaxBufferError(err) {
|
|
17
|
+
var maxBufferErrorPattern = /^.*\bmaxBuffer\b.*exceeded.*$/;
|
|
18
|
+
if (err instanceof Error && err.message &&
|
|
19
|
+
err.message.match(maxBufferErrorPattern)) {
|
|
20
|
+
// < v10
|
|
21
|
+
// Error: stdout maxBuffer exceeded
|
|
22
|
+
return true;
|
|
23
|
+
} else if (err instanceof RangeError && err.message &&
|
|
24
|
+
err.message.match(maxBufferErrorPattern)) {
|
|
25
|
+
// >= v10
|
|
26
|
+
// RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length
|
|
27
|
+
// exceeded
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
12
32
|
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var pipe = params.pipe;
|
|
16
|
-
var stdoutFile = params.stdoutFile;
|
|
17
|
-
var stderrFile = params.stderrFile;
|
|
33
|
+
var stdoutStream = fs.createWriteStream(stdoutFile);
|
|
34
|
+
var stderrStream = fs.createWriteStream(stderrFile);
|
|
18
35
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
process.exitCode =
|
|
22
|
-
} else if (err.code === undefined) {
|
|
23
|
-
process.exitCode = 1;
|
|
24
|
-
} else {
|
|
25
|
-
process.exitCode = err.code;
|
|
36
|
+
function appendError(message, code) {
|
|
37
|
+
stderrStream.write(message);
|
|
38
|
+
process.exitCode = code;
|
|
26
39
|
}
|
|
27
|
-
});
|
|
28
40
|
|
|
29
|
-
var
|
|
30
|
-
|
|
41
|
+
var c = childProcess.exec(cmd, execOptions, function (err) {
|
|
42
|
+
if (!err) {
|
|
43
|
+
process.exitCode = 0;
|
|
44
|
+
} else if (isMaxBufferError(err)) {
|
|
45
|
+
appendError('maxBuffer exceeded', 1);
|
|
46
|
+
} else if (err.code === undefined && err.message) {
|
|
47
|
+
/* istanbul ignore next */
|
|
48
|
+
appendError(err.message, 1);
|
|
49
|
+
} else if (err.code === undefined) {
|
|
50
|
+
/* istanbul ignore next */
|
|
51
|
+
appendError('Unknown issue', 1);
|
|
52
|
+
} else {
|
|
53
|
+
process.exitCode = err.code;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
c.stdout.pipe(stdoutStream);
|
|
58
|
+
c.stderr.pipe(stderrStream);
|
|
59
|
+
c.stdout.pipe(process.stdout);
|
|
60
|
+
c.stderr.pipe(process.stderr);
|
|
31
61
|
|
|
32
|
-
|
|
33
|
-
c.
|
|
34
|
-
|
|
35
|
-
|
|
62
|
+
if (pipe) {
|
|
63
|
+
c.stdin.end(pipe);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
36
66
|
|
|
37
|
-
|
|
38
|
-
|
|
67
|
+
// This file should only be executed. This module does not export anything.
|
|
68
|
+
/* istanbul ignore else */
|
|
69
|
+
if (require.main === module) {
|
|
70
|
+
main();
|
|
39
71
|
}
|
|
@@ -12,22 +12,32 @@ common.register('exec', _exec, {
|
|
|
12
12
|
unix: false,
|
|
13
13
|
canReceivePipe: true,
|
|
14
14
|
wrapOutput: false,
|
|
15
|
+
handlesFatalDynamically: true,
|
|
15
16
|
});
|
|
16
17
|
|
|
17
18
|
// We use this function to run `exec` synchronously while also providing realtime
|
|
18
19
|
// output.
|
|
19
20
|
function execSync(cmd, opts, pipe) {
|
|
20
21
|
if (!common.config.execPath) {
|
|
21
|
-
|
|
22
|
+
try {
|
|
23
|
+
common.error('Unable to find a path to the node binary. Please manually set config.execPath');
|
|
24
|
+
} catch (e) {
|
|
25
|
+
if (opts.fatal) {
|
|
26
|
+
throw e;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
22
31
|
}
|
|
23
32
|
|
|
24
33
|
var tempDir = _tempDir();
|
|
25
|
-
var paramsFile = path.
|
|
26
|
-
var stderrFile = path.
|
|
27
|
-
var stdoutFile = path.
|
|
34
|
+
var paramsFile = path.join(tempDir, common.randomFileName());
|
|
35
|
+
var stderrFile = path.join(tempDir, common.randomFileName());
|
|
36
|
+
var stdoutFile = path.join(tempDir, common.randomFileName());
|
|
28
37
|
|
|
29
38
|
opts = common.extend({
|
|
30
39
|
silent: common.config.silent,
|
|
40
|
+
fatal: common.config.fatal, // TODO(nfischer): this and the line above are probably unnecessary
|
|
31
41
|
cwd: _pwd().toString(),
|
|
32
42
|
env: process.env,
|
|
33
43
|
maxBuffer: DEFAULT_MAXBUFFER_SIZE,
|
|
@@ -117,7 +127,7 @@ function execSync(cmd, opts, pipe) {
|
|
|
117
127
|
// Note: `silent` should be unconditionally true to avoid double-printing
|
|
118
128
|
// the command's stderr, and to avoid printing any stderr when the user has
|
|
119
129
|
// set `shell.config.silent`.
|
|
120
|
-
common.error(stderr, code, { continue: true, silent: true });
|
|
130
|
+
common.error(stderr, code, { continue: true, silent: true, fatal: opts.fatal });
|
|
121
131
|
}
|
|
122
132
|
var obj = common.ShellString(stdout, stderr, code);
|
|
123
133
|
return obj;
|
|
@@ -127,6 +137,7 @@ function execSync(cmd, opts, pipe) {
|
|
|
127
137
|
function execAsync(cmd, opts, pipe, callback) {
|
|
128
138
|
opts = common.extend({
|
|
129
139
|
silent: common.config.silent,
|
|
140
|
+
fatal: common.config.fatal, // TODO(nfischer): this and the line above are probably unnecessary
|
|
130
141
|
cwd: _pwd().toString(),
|
|
131
142
|
env: process.env,
|
|
132
143
|
maxBuffer: DEFAULT_MAXBUFFER_SIZE,
|
|
@@ -164,6 +175,7 @@ function execAsync(cmd, opts, pipe, callback) {
|
|
|
164
175
|
//@
|
|
165
176
|
//@ + `async`: Asynchronous execution. If a callback is provided, it will be set to
|
|
166
177
|
//@ `true`, regardless of the passed value (default: `false`).
|
|
178
|
+
//@ + `fatal`: Exit upon error (default: `false`).
|
|
167
179
|
//@ + `silent`: Do not echo program output to console (default: `false`).
|
|
168
180
|
//@ + `encoding`: Character encoding to use. Affects the values returned to stdout and stderr, and
|
|
169
181
|
//@ what is written to stdout and stderr when not in silent mode (default: `'utf8'`).
|
|
@@ -187,17 +199,21 @@ function execAsync(cmd, opts, pipe, callback) {
|
|
|
187
199
|
//@ });
|
|
188
200
|
//@ ```
|
|
189
201
|
//@
|
|
190
|
-
//@ Executes the given `command` _synchronously_, unless otherwise specified.
|
|
191
|
-
//@ mode, this returns a
|
|
192
|
-
//@
|
|
193
|
-
//@
|
|
202
|
+
//@ Executes the given `command` _synchronously_, unless otherwise specified.
|
|
203
|
+
//@ When in synchronous mode, this returns a [ShellString](#shellstringstr).
|
|
204
|
+
//@ Otherwise, this returns the child process object, and the `callback`
|
|
205
|
+
//@ receives the arguments `(code, stdout, stderr)`.
|
|
194
206
|
//@
|
|
195
207
|
//@ Not seeing the behavior you want? `exec()` runs everything through `sh`
|
|
196
208
|
//@ by default (or `cmd.exe` on Windows), which differs from `bash`. If you
|
|
197
209
|
//@ need bash-specific behavior, try out the `{shell: 'path/to/bash'}` option.
|
|
210
|
+
//@
|
|
211
|
+
//@ **Security note:** as `shell.exec()` executes an arbitrary string in the
|
|
212
|
+
//@ system shell, it is **critical** to properly sanitize user input to avoid
|
|
213
|
+
//@ **command injection**. For more context, consult the [Security
|
|
214
|
+
//@ Guidelines](https://github.com/shelljs/shelljs/wiki/Security-guidelines).
|
|
198
215
|
function _exec(command, options, callback) {
|
|
199
216
|
options = options || {};
|
|
200
|
-
if (!command) common.error('must specify command');
|
|
201
217
|
|
|
202
218
|
var pipe = common.readFromPipe();
|
|
203
219
|
|
|
@@ -214,9 +230,22 @@ function _exec(command, options, callback) {
|
|
|
214
230
|
|
|
215
231
|
options = common.extend({
|
|
216
232
|
silent: common.config.silent,
|
|
233
|
+
fatal: common.config.fatal,
|
|
217
234
|
async: false,
|
|
218
235
|
}, options);
|
|
219
236
|
|
|
237
|
+
if (!command) {
|
|
238
|
+
try {
|
|
239
|
+
common.error('must specify command');
|
|
240
|
+
} catch (e) {
|
|
241
|
+
if (options.fatal) {
|
|
242
|
+
throw e;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
220
249
|
if (options.async) {
|
|
221
250
|
return execAsync(command, options, pipe, callback);
|
|
222
251
|
} else {
|
|
@@ -2,7 +2,11 @@ var path = require('path');
|
|
|
2
2
|
var common = require('./common');
|
|
3
3
|
var _ls = require('./ls');
|
|
4
4
|
|
|
5
|
-
common.register('find', _find, {
|
|
5
|
+
common.register('find', _find, {
|
|
6
|
+
cmdOptions: {
|
|
7
|
+
'L': 'link',
|
|
8
|
+
},
|
|
9
|
+
});
|
|
6
10
|
|
|
7
11
|
//@
|
|
8
12
|
//@ ### find(path [, path ...])
|
|
@@ -16,7 +20,8 @@ common.register('find', _find, {});
|
|
|
16
20
|
//@ find('.').filter(function(file) { return file.match(/\.js$/); });
|
|
17
21
|
//@ ```
|
|
18
22
|
//@
|
|
19
|
-
//@ Returns
|
|
23
|
+
//@ Returns a [ShellString](#shellstringstr) (with array-like properties) of all
|
|
24
|
+
//@ files (however deep) in the given paths.
|
|
20
25
|
//@
|
|
21
26
|
//@ The main difference from `ls('-R', path)` is that the resulting file names
|
|
22
27
|
//@ include the base directories (e.g., `lib/resources/file1` instead of just `file1`).
|
|
@@ -50,7 +55,7 @@ function _find(options, paths) {
|
|
|
50
55
|
pushFile(file);
|
|
51
56
|
|
|
52
57
|
if (stat.isDirectory()) {
|
|
53
|
-
_ls({ recursive: true, all: true }, file).forEach(function (subfile) {
|
|
58
|
+
_ls({ recursive: true, all: true, link: options.link }, file).forEach(function (subfile) {
|
|
54
59
|
pushFile(path.join(file, subfile));
|
|
55
60
|
});
|
|
56
61
|
}
|
|
@@ -8,6 +8,7 @@ common.register('grep', _grep, {
|
|
|
8
8
|
'v': 'inverse',
|
|
9
9
|
'l': 'nameOnly',
|
|
10
10
|
'i': 'ignoreCase',
|
|
11
|
+
'n': 'lineNumber',
|
|
11
12
|
},
|
|
12
13
|
});
|
|
13
14
|
|
|
@@ -20,6 +21,7 @@ common.register('grep', _grep, {
|
|
|
20
21
|
//@ + `-v`: Invert `regex_filter` (only print non-matching lines).
|
|
21
22
|
//@ + `-l`: Print only filenames of matching files.
|
|
22
23
|
//@ + `-i`: Ignore case.
|
|
24
|
+
//@ + `-n`: Print line numbers.
|
|
23
25
|
//@
|
|
24
26
|
//@ Examples:
|
|
25
27
|
//@
|
|
@@ -28,8 +30,9 @@ common.register('grep', _grep, {
|
|
|
28
30
|
//@ grep('GLOBAL_VARIABLE', '*.js');
|
|
29
31
|
//@ ```
|
|
30
32
|
//@
|
|
31
|
-
//@ Reads input string from given files and returns a
|
|
32
|
-
//@
|
|
33
|
+
//@ Reads input string from given files and returns a
|
|
34
|
+
//@ [ShellString](#shellstringstr) containing all lines of the @ file that match
|
|
35
|
+
//@ the given `regex_filter`.
|
|
33
36
|
function _grep(options, regex, files) {
|
|
34
37
|
// Check if this is coming from a pipe
|
|
35
38
|
var pipe = common.readFromPipe();
|
|
@@ -59,15 +62,23 @@ function _grep(options, regex, files) {
|
|
|
59
62
|
}
|
|
60
63
|
} else {
|
|
61
64
|
var lines = contents.split('\n');
|
|
62
|
-
lines.forEach(function (line) {
|
|
65
|
+
lines.forEach(function (line, index) {
|
|
63
66
|
var matched = line.match(regex);
|
|
64
67
|
if ((options.inverse && !matched) || (!options.inverse && matched)) {
|
|
65
|
-
|
|
68
|
+
var result = line;
|
|
69
|
+
if (options.lineNumber) {
|
|
70
|
+
result = '' + (index + 1) + ':' + line;
|
|
71
|
+
}
|
|
72
|
+
grep.push(result);
|
|
66
73
|
}
|
|
67
74
|
});
|
|
68
75
|
}
|
|
69
76
|
});
|
|
70
77
|
|
|
78
|
+
if (grep.length === 0 && common.state.errorCode !== 2) {
|
|
79
|
+
// We didn't hit the error above, but pattern didn't match
|
|
80
|
+
common.error('', { silent: true });
|
|
81
|
+
}
|
|
71
82
|
return grep.join('\n') + '\n';
|
|
72
83
|
}
|
|
73
84
|
module.exports = _grep;
|
|
@@ -46,7 +46,7 @@ function readSomeLines(file, numLines) {
|
|
|
46
46
|
//@ var str = head(['file1', 'file2']); // same as above
|
|
47
47
|
//@ ```
|
|
48
48
|
//@
|
|
49
|
-
//@ Read the start of a file.
|
|
49
|
+
//@ Read the start of a `file`. Returns a [ShellString](#shellstringstr).
|
|
50
50
|
function _head(options, files) {
|
|
51
51
|
var head = [];
|
|
52
52
|
var pipe = common.readFromPipe();
|
|
@@ -24,7 +24,9 @@ common.register('ln', _ln, {
|
|
|
24
24
|
//@ ln('-sf', 'file', 'existing');
|
|
25
25
|
//@ ```
|
|
26
26
|
//@
|
|
27
|
-
//@ Links `source` to `dest`. Use `-f` to force the link, should `dest` already
|
|
27
|
+
//@ Links `source` to `dest`. Use `-f` to force the link, should `dest` already
|
|
28
|
+
//@ exist. Returns a [ShellString](#shellstringstr) indicating success or
|
|
29
|
+
//@ failure.
|
|
28
30
|
function _ln(options, source, dest) {
|
|
29
31
|
if (!source || !dest) {
|
|
30
32
|
common.error('Missing <source> and/or <dest>');
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
var path = require('path');
|
|
2
2
|
var fs = require('fs');
|
|
3
3
|
var common = require('./common');
|
|
4
|
-
var glob = require('glob');
|
|
4
|
+
var glob = require('fast-glob');
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// glob patterns use the UNIX path seperator
|
|
7
|
+
var globPatternRecursive = '/**';
|
|
7
8
|
|
|
8
9
|
common.register('ls', _ls, {
|
|
9
10
|
cmdOptions: {
|
|
@@ -26,22 +27,28 @@ common.register('ls', _ls, {
|
|
|
26
27
|
//@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`)
|
|
27
28
|
//@ + `-L`: follow symlinks
|
|
28
29
|
//@ + `-d`: list directories themselves, not their contents
|
|
29
|
-
//@ + `-l`:
|
|
30
|
-
//@
|
|
31
|
-
//@
|
|
32
|
-
//@
|
|
30
|
+
//@ + `-l`: provides more details for each file. Specifically, each file is
|
|
31
|
+
//@ represented by a structured object with separate fields for file
|
|
32
|
+
//@ metadata (see
|
|
33
|
+
//@ [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats)). The
|
|
34
|
+
//@ return value also overrides `.toString()` to resemble `ls -l`'s
|
|
35
|
+
//@ output format for human readability, but programmatic usage should
|
|
36
|
+
//@ depend on the stable object format rather than the `.toString()`
|
|
37
|
+
//@ representation.
|
|
33
38
|
//@
|
|
34
39
|
//@ Examples:
|
|
35
40
|
//@
|
|
36
41
|
//@ ```javascript
|
|
37
42
|
//@ ls('projs/*.js');
|
|
43
|
+
//@ ls('projs/**/*.js'); // Find all js files recursively in projs
|
|
38
44
|
//@ ls('-R', '/users/me', '/tmp');
|
|
39
45
|
//@ ls('-R', ['/users/me', '/tmp']); // same as above
|
|
40
46
|
//@ ls('-l', 'file.txt'); // { name: 'file.txt', mode: 33188, nlink: 1, ...}
|
|
41
47
|
//@ ```
|
|
42
48
|
//@
|
|
43
|
-
//@ Returns
|
|
44
|
-
//@ the current directory if no
|
|
49
|
+
//@ Returns a [ShellString](#shellstringstr) (with array-like properties) of all
|
|
50
|
+
//@ the files in the given `path`, or files in the current directory if no
|
|
51
|
+
//@ `path` is provided.
|
|
45
52
|
function _ls(options, paths) {
|
|
46
53
|
if (options.all_deprecated) {
|
|
47
54
|
// We won't support the -a option as it's hard to image why it's useful
|
|
@@ -99,13 +106,20 @@ function _ls(options, paths) {
|
|
|
99
106
|
if (stat.isDirectory() && !options.directory) {
|
|
100
107
|
if (options.recursive) {
|
|
101
108
|
// use glob, because it's simple
|
|
102
|
-
glob.sync(p + globPatternRecursive, {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
glob.sync(p + globPatternRecursive, {
|
|
110
|
+
// These options are just to make fast-glob be compatible with POSIX
|
|
111
|
+
// (bash) wildcard behavior.
|
|
112
|
+
onlyFiles: false,
|
|
113
|
+
|
|
114
|
+
// These options depend on the cmdOptions provided to ls.
|
|
115
|
+
dot: options.all,
|
|
116
|
+
followSymbolicLinks: options.link,
|
|
117
|
+
}).forEach(function (item) {
|
|
118
|
+
// Glob pattern returns the directory itself and needs to be filtered out.
|
|
119
|
+
if (path.relative(p, item)) {
|
|
120
|
+
pushFile(item, path.relative(p, item));
|
|
121
|
+
}
|
|
122
|
+
});
|
|
109
123
|
} else if (options.all) {
|
|
110
124
|
// use fs.readdirSync, because it's fast
|
|
111
125
|
fs.readdirSync(p).forEach(function (item) {
|
|
@@ -19,17 +19,18 @@ function mkdirSyncRecursive(dir) {
|
|
|
19
19
|
common.error('dirname() failed: [' + dir + ']');
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
// Base dir exists, no recursion necessary
|
|
23
|
-
if (fs.existsSync(baseDir)) {
|
|
24
|
-
fs.mkdirSync(dir, parseInt('0777', 8));
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
22
|
// Base dir does not exist, go recursive
|
|
29
|
-
|
|
23
|
+
if (!fs.existsSync(baseDir)) {
|
|
24
|
+
mkdirSyncRecursive(baseDir);
|
|
25
|
+
}
|
|
30
26
|
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
try {
|
|
28
|
+
// Base dir created, can create dir
|
|
29
|
+
fs.mkdirSync(dir, parseInt('0777', 8));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
// swallow error if dir already exists
|
|
32
|
+
if (e.code !== 'EEXIST' || common.statNoFollowLinks(dir).isFile()) { throw e; }
|
|
33
|
+
}
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
//@
|
|
@@ -47,7 +48,8 @@ function mkdirSyncRecursive(dir) {
|
|
|
47
48
|
//@ mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above
|
|
48
49
|
//@ ```
|
|
49
50
|
//@
|
|
50
|
-
//@ Creates directories.
|
|
51
|
+
//@ Creates directories. Returns a [ShellString](#shellstringstr) indicating
|
|
52
|
+
//@ success or failure.
|
|
51
53
|
function _mkdir(options, dirs) {
|
|
52
54
|
if (!dirs) common.error('no paths given');
|
|
53
55
|
|
|
@@ -96,5 +98,5 @@ function _mkdir(options, dirs) {
|
|
|
96
98
|
}
|
|
97
99
|
});
|
|
98
100
|
return '';
|
|
99
|
-
} //
|
|
101
|
+
} // man arraykdir
|
|
100
102
|
module.exports = _mkdir;
|
|
@@ -36,7 +36,8 @@ function checkRecentCreated(sources, index) {
|
|
|
36
36
|
//@ mv(['file1', 'file2'], 'dir/'); // same as above
|
|
37
37
|
//@ ```
|
|
38
38
|
//@
|
|
39
|
-
//@ Moves `source` file(s) to `dest`.
|
|
39
|
+
//@ Moves `source` file(s) to `dest`. Returns a [ShellString](#shellstringstr)
|
|
40
|
+
//@ indicating success or failure.
|
|
40
41
|
function _mv(options, sources, dest) {
|
|
41
42
|
// Get sources, dest
|
|
42
43
|
if (arguments.length < 3) {
|
|
@@ -108,8 +109,8 @@ function _mv(options, sources, dest) {
|
|
|
108
109
|
// to perform a copy and then clean up the original file. If either the
|
|
109
110
|
// copy or the rm fails with an exception, we should allow this
|
|
110
111
|
// exception to pass up to the top level.
|
|
111
|
-
cp(
|
|
112
|
-
rm(
|
|
112
|
+
cp({ recursive: true }, src, thisDest);
|
|
113
|
+
rm({ recursive: true, force: true }, src);
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
}); // forEach(src)
|
|
@@ -29,16 +29,15 @@ function rmdirSyncRecursive(dir, force, fromSymlink) {
|
|
|
29
29
|
|
|
30
30
|
if (currFile.isDirectory()) { // Recursive function back to the beginning
|
|
31
31
|
rmdirSyncRecursive(file, force);
|
|
32
|
-
} else
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
32
|
+
} else if (force || isWriteable(file)) {
|
|
33
|
+
// Assume it's a file - perhaps a try/catch belongs here?
|
|
34
|
+
try {
|
|
35
|
+
common.unlinkSync(file);
|
|
36
|
+
} catch (e) {
|
|
37
|
+
/* istanbul ignore next */
|
|
38
|
+
common.error('could not remove file (code ' + e.code + '): ' + file, {
|
|
39
|
+
continue: true,
|
|
40
|
+
});
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
}
|
|
@@ -163,7 +162,8 @@ function handleFIFO(file) {
|
|
|
163
162
|
//@ rm(['some_file.txt', 'another_file.txt']); // same as above
|
|
164
163
|
//@ ```
|
|
165
164
|
//@
|
|
166
|
-
//@ Removes files.
|
|
165
|
+
//@ Removes files. Returns a [ShellString](#shellstringstr) indicating success
|
|
166
|
+
//@ or failure.
|
|
167
167
|
function _rm(options, files) {
|
|
168
168
|
if (!files) common.error('no paths given');
|
|
169
169
|
|
|
@@ -21,11 +21,11 @@ common.register('sed', _sed, {
|
|
|
21
21
|
//@
|
|
22
22
|
//@ ```javascript
|
|
23
23
|
//@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js');
|
|
24
|
-
//@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js');
|
|
25
24
|
//@ ```
|
|
26
25
|
//@
|
|
27
|
-
//@ Reads an input string from `file`s, and performs a JavaScript `replace()` on
|
|
28
|
-
//@ using the given `search_regex` and `replacement` string or
|
|
26
|
+
//@ Reads an input string from `file`s, line by line, and performs a JavaScript `replace()` on
|
|
27
|
+
//@ each of the lines from the input string using the given `search_regex` and `replacement` string or
|
|
28
|
+
//@ function. Returns the new [ShellString](#shellstringstr) after replacement.
|
|
29
29
|
//@
|
|
30
30
|
//@ Note:
|
|
31
31
|
//@
|
|
@@ -35,6 +35,10 @@ common.register('sed', _sed, {
|
|
|
35
35
|
//@ ```javascript
|
|
36
36
|
//@ sed(/(\w+)\s(\w+)/, '$2, $1', 'file.txt');
|
|
37
37
|
//@ ```
|
|
38
|
+
//@
|
|
39
|
+
//@ Also, like unix `sed`, ShellJS `sed` runs replacements on each line from the input file
|
|
40
|
+
//@ (split by '\n') separately, so `search_regex`es that span more than one line (or include '\n')
|
|
41
|
+
//@ will not match anything and nothing will be replaced.
|
|
38
42
|
function _sed(options, regex, replacement, files) {
|
|
39
43
|
// Check if this is coming from a pipe
|
|
40
44
|
var pipe = common.readFromPipe();
|
|
@@ -82,6 +86,10 @@ function _sed(options, regex, replacement, files) {
|
|
|
82
86
|
}
|
|
83
87
|
});
|
|
84
88
|
|
|
85
|
-
|
|
89
|
+
if (options.inplace) {
|
|
90
|
+
return '';
|
|
91
|
+
} else {
|
|
92
|
+
return sed.join('\n');
|
|
93
|
+
}
|
|
86
94
|
}
|
|
87
95
|
module.exports = _sed;
|
|
@@ -54,8 +54,9 @@ function numericalCmp(a, b) {
|
|
|
54
54
|
//@ sort('-r', 'foo.txt');
|
|
55
55
|
//@ ```
|
|
56
56
|
//@
|
|
57
|
-
//@ Return the contents of the `file`s, sorted line-by-line
|
|
58
|
-
//@ files mixes their content
|
|
57
|
+
//@ Return the contents of the `file`s, sorted line-by-line as a
|
|
58
|
+
//@ [ShellString](#shellstringstr). Sorting multiple files mixes their content
|
|
59
|
+
//@ (just as unix `sort` does).
|
|
59
60
|
function _sort(options, files) {
|
|
60
61
|
// Check if this is coming from a pipe
|
|
61
62
|
var pipe = common.readFromPipe();
|