projen 0.99.71 → 0.99.73
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 +3 -3
- package/lib/ai-instructions.js +2 -2
- package/lib/awscdk/auto-discover.js +6 -6
- 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 +4 -4
- 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/awscdk/private/feature-flags-v2.const.d.ts +1 -1
- package/lib/awscdk/private/feature-flags-v2.const.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-build.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/dependency-review.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.js +1 -1
- package/lib/gitlab/configuration.js +1 -1
- package/lib/gitlab/gitlab-configuration.js +1 -1
- package/lib/gitlab/nested-configuration.js +1 -1
- package/lib/gitpod.js +1 -1
- package/lib/ignore-file.js +1 -1
- package/lib/ini.js +1 -1
- package/lib/java/java-project.js +1 -1
- package/lib/java/junit.js +1 -1
- package/lib/java/maven-compile.js +1 -1
- package/lib/java/maven-packaging.js +1 -1
- package/lib/java/maven-sample.js +1 -1
- package/lib/java/pom.js +2 -2
- package/lib/java/projenrc.js +1 -1
- package/lib/javascript/biome/biome.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/pyproject-toml-file.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/uv.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/{shelljs/node_modules/cross-spawn → cross-spawn}/README.md +10 -15
- package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/lib/enoent.js +1 -1
- package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/lib/parse.js +1 -35
- package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/lib/util/readShebang.js +1 -10
- package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/lib/util/resolveCommand.js +4 -3
- package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/package.json +23 -25
- package/node_modules/execa/index.d.ts +564 -0
- package/node_modules/execa/index.js +268 -0
- package/node_modules/execa/lib/command.js +52 -0
- package/node_modules/execa/lib/error.js +88 -0
- package/node_modules/execa/lib/kill.js +115 -0
- package/node_modules/execa/lib/promise.js +46 -0
- package/node_modules/execa/lib/stdio.js +52 -0
- package/node_modules/execa/lib/stream.js +97 -0
- package/node_modules/execa/license +9 -0
- package/node_modules/execa/package.json +74 -0
- package/node_modules/execa/readme.md +663 -0
- package/node_modules/fastq/README.md +0 -2
- package/node_modules/fastq/eslint.config.js +11 -0
- package/node_modules/fastq/example.mjs +0 -2
- package/node_modules/fastq/index.d.ts +2 -0
- package/node_modules/fastq/package.json +5 -9
- package/node_modules/fastq/queue.js +36 -1
- package/node_modules/fastq/test/promise.js +34 -0
- package/node_modules/fastq/test/test.js +80 -0
- package/node_modules/get-stream/buffer-stream.js +52 -0
- package/node_modules/get-stream/index.d.ts +105 -0
- package/node_modules/get-stream/index.js +61 -0
- package/node_modules/get-stream/license +9 -0
- package/node_modules/{shelljs/node_modules/get-stream → get-stream}/package.json +11 -10
- package/node_modules/{shelljs/node_modules/get-stream → get-stream}/readme.md +19 -18
- package/node_modules/human-signals/LICENSE +201 -0
- package/node_modules/human-signals/README.md +165 -0
- package/node_modules/human-signals/build/src/core.js +273 -0
- package/node_modules/human-signals/build/src/core.js.map +1 -0
- package/node_modules/human-signals/build/src/main.d.ts +52 -0
- package/node_modules/human-signals/build/src/main.js +71 -0
- package/node_modules/human-signals/build/src/main.js.map +1 -0
- package/node_modules/human-signals/build/src/realtime.js +19 -0
- package/node_modules/human-signals/build/src/realtime.js.map +1 -0
- package/node_modules/human-signals/build/src/signals.js +35 -0
- package/node_modules/human-signals/build/src/signals.js.map +1 -0
- package/node_modules/human-signals/package.json +64 -0
- package/node_modules/is-stream/index.d.ts +79 -0
- package/node_modules/is-stream/index.js +28 -0
- package/node_modules/is-stream/license +9 -0
- package/node_modules/is-stream/package.json +42 -0
- package/node_modules/is-stream/readme.md +60 -0
- package/node_modules/js-yaml/README.md +4 -20
- package/node_modules/js-yaml/bin/js-yaml.js +53 -62
- package/node_modules/js-yaml/dist/js-yaml.js +2404 -3880
- package/node_modules/js-yaml/dist/js-yaml.js.map +1 -0
- package/node_modules/js-yaml/dist/js-yaml.min.js +33 -2
- package/node_modules/js-yaml/dist/js-yaml.min.js.map +1 -0
- package/node_modules/js-yaml/dist/js-yaml.mjs +2381 -3855
- package/node_modules/js-yaml/dist/js-yaml.mjs.map +1 -0
- package/node_modules/js-yaml/index.js +32 -35
- package/node_modules/js-yaml/lib/common.js +28 -37
- package/node_modules/js-yaml/lib/dumper.js +450 -478
- package/node_modules/js-yaml/lib/exception.js +23 -27
- package/node_modules/js-yaml/lib/index_vite_proxy.tmp.mjs +37 -0
- package/node_modules/js-yaml/lib/loader.js +927 -866
- package/node_modules/js-yaml/lib/schema/core.js +2 -4
- package/node_modules/js-yaml/lib/schema/default.js +2 -4
- package/node_modules/js-yaml/lib/schema/failsafe.js +3 -6
- package/node_modules/js-yaml/lib/schema/json.js +2 -4
- package/node_modules/js-yaml/lib/schema.js +56 -68
- package/node_modules/js-yaml/lib/snippet.js +47 -52
- package/node_modules/js-yaml/lib/type/binary.js +61 -64
- package/node_modules/js-yaml/lib/type/bool.js +14 -14
- package/node_modules/js-yaml/lib/type/float.js +47 -45
- package/node_modules/js-yaml/lib/type/int.js +65 -79
- package/node_modules/js-yaml/lib/type/map.js +4 -4
- package/node_modules/js-yaml/lib/type/merge.js +5 -5
- package/node_modules/js-yaml/lib/type/null.js +16 -16
- package/node_modules/js-yaml/lib/type/omap.js +22 -21
- package/node_modules/js-yaml/lib/type/pairs.js +24 -27
- package/node_modules/js-yaml/lib/type/seq.js +4 -4
- package/node_modules/js-yaml/lib/type/set.js +12 -12
- package/node_modules/js-yaml/lib/type/str.js +4 -4
- package/node_modules/js-yaml/lib/type/timestamp.js +53 -53
- package/node_modules/js-yaml/lib/type.js +30 -30
- package/node_modules/js-yaml/package.json +32 -21
- package/node_modules/{nice-try → merge-stream}/LICENSE +1 -1
- package/node_modules/merge-stream/README.md +78 -0
- package/node_modules/merge-stream/index.js +41 -0
- package/node_modules/merge-stream/package.json +19 -0
- package/node_modules/mimic-fn/index.d.ts +54 -0
- package/node_modules/mimic-fn/index.js +13 -0
- package/node_modules/mimic-fn/package.json +42 -0
- package/node_modules/mimic-fn/readme.md +69 -0
- package/node_modules/npm-run-path/index.d.ts +89 -0
- package/node_modules/npm-run-path/index.js +47 -0
- package/node_modules/npm-run-path/package.json +44 -0
- package/node_modules/{shelljs/node_modules/npm-run-path → npm-run-path}/readme.md +39 -5
- package/node_modules/onetime/index.d.ts +64 -0
- package/node_modules/onetime/index.js +44 -0
- package/node_modules/onetime/license +9 -0
- package/node_modules/onetime/package.json +43 -0
- package/node_modules/onetime/readme.md +94 -0
- package/node_modules/path-key/index.d.ts +40 -0
- package/node_modules/path-key/index.js +16 -0
- package/node_modules/path-key/license +9 -0
- package/node_modules/path-key/package.json +39 -0
- package/node_modules/{shelljs/node_modules/path-key → path-key}/readme.md +15 -5
- package/node_modules/semver/classes/range.js +11 -2
- package/node_modules/semver/package.json +2 -2
- package/node_modules/shebang-command/index.js +19 -0
- package/node_modules/shebang-command/license +9 -0
- package/node_modules/shebang-command/package.json +34 -0
- package/node_modules/{shelljs/node_modules/shebang-command → shebang-command}/readme.md +1 -6
- package/node_modules/shebang-regex/index.d.ts +22 -0
- package/node_modules/shebang-regex/index.js +2 -0
- package/node_modules/shebang-regex/license +9 -0
- package/node_modules/shebang-regex/package.json +35 -0
- package/node_modules/shebang-regex/readme.md +33 -0
- package/node_modules/shelljs/README.md +7 -1
- package/node_modules/shelljs/global.js +4 -1
- package/node_modules/shelljs/package.json +8 -13
- package/node_modules/shelljs/shell.js +9 -7
- package/node_modules/shelljs/src/cat.js +1 -1
- package/node_modules/shelljs/src/chmod.js +1 -1
- package/node_modules/shelljs/src/cmd.js +25 -9
- package/node_modules/shelljs/src/common.js +11 -8
- package/node_modules/shelljs/src/dirs.js +1 -1
- package/node_modules/shelljs/src/exec.js +6 -6
- package/node_modules/shelljs/src/grep.js +121 -7
- package/node_modules/shelljs/src/head.js +1 -1
- package/node_modules/shelljs/src/ls.js +1 -1
- package/node_modules/shelljs/src/mkdir.js +1 -1
- package/node_modules/shelljs/src/rm.js +1 -1
- package/node_modules/shelljs/src/sed.js +1 -1
- package/node_modules/shelljs/src/sort.js +1 -1
- package/node_modules/shelljs/src/tail.js +1 -1
- package/node_modules/shelljs/src/tempdir.js +1 -1
- package/node_modules/shelljs/src/test.js +1 -1
- package/node_modules/shelljs/src/to.js +1 -1
- package/node_modules/shelljs/src/toEnd.js +1 -1
- package/node_modules/shelljs/src/touch.js +1 -1
- package/node_modules/shelljs/src/uniq.js +1 -1
- package/node_modules/shelljs/src/which.js +1 -1
- package/node_modules/strip-final-newline/index.js +16 -0
- package/node_modules/strip-final-newline/license +9 -0
- package/node_modules/strip-final-newline/package.json +40 -0
- package/node_modules/strip-final-newline/readme.md +30 -0
- package/node_modules/{shelljs/node_modules/which → which}/README.md +3 -0
- package/node_modules/which/package.json +43 -0
- package/node_modules/which/which.js +125 -0
- package/package.json +5 -2
- package/node_modules/end-of-stream/LICENSE +0 -21
- package/node_modules/end-of-stream/README.md +0 -54
- package/node_modules/end-of-stream/index.js +0 -96
- package/node_modules/end-of-stream/package.json +0 -37
- package/node_modules/fastq/.github/dependabot.yml +0 -11
- package/node_modules/fastq/.github/workflows/ci.yml +0 -75
- package/node_modules/function-bind/.eslintrc +0 -21
- package/node_modules/function-bind/.github/FUNDING.yml +0 -12
- package/node_modules/function-bind/.github/SECURITY.md +0 -3
- package/node_modules/function-bind/.nycrc +0 -13
- package/node_modules/function-bind/CHANGELOG.md +0 -136
- package/node_modules/function-bind/LICENSE +0 -20
- package/node_modules/function-bind/README.md +0 -46
- package/node_modules/function-bind/implementation.js +0 -84
- package/node_modules/function-bind/index.js +0 -5
- package/node_modules/function-bind/package.json +0 -87
- package/node_modules/function-bind/test/.eslintrc +0 -9
- package/node_modules/function-bind/test/index.js +0 -252
- package/node_modules/hasown/.eslintrc +0 -5
- package/node_modules/hasown/.github/FUNDING.yml +0 -12
- package/node_modules/hasown/.nycrc +0 -13
- package/node_modules/hasown/CHANGELOG.md +0 -40
- package/node_modules/hasown/LICENSE +0 -21
- package/node_modules/hasown/README.md +0 -40
- package/node_modules/hasown/index.d.ts +0 -3
- package/node_modules/hasown/index.js +0 -8
- package/node_modules/hasown/package.json +0 -92
- package/node_modules/hasown/tsconfig.json +0 -6
- package/node_modules/interpret/LICENSE +0 -22
- package/node_modules/interpret/README.md +0 -187
- package/node_modules/interpret/index.js +0 -168
- package/node_modules/interpret/mjs-stub.js +0 -1
- package/node_modules/interpret/package.json +0 -75
- package/node_modules/is-core-module/.eslintrc +0 -18
- package/node_modules/is-core-module/.nycrc +0 -9
- package/node_modules/is-core-module/CHANGELOG.md +0 -218
- package/node_modules/is-core-module/LICENSE +0 -20
- package/node_modules/is-core-module/README.md +0 -40
- package/node_modules/is-core-module/core.json +0 -162
- package/node_modules/is-core-module/index.js +0 -69
- package/node_modules/is-core-module/package.json +0 -76
- package/node_modules/is-core-module/test/index.js +0 -157
- package/node_modules/nice-try/README.md +0 -32
- package/node_modules/nice-try/package.json +0 -33
- package/node_modules/nice-try/src/index.js +0 -12
- package/node_modules/once/README.md +0 -79
- package/node_modules/once/once.js +0 -42
- package/node_modules/once/package.json +0 -33
- package/node_modules/p-finally/index.js +0 -15
- package/node_modules/p-finally/license +0 -21
- package/node_modules/p-finally/package.json +0 -42
- package/node_modules/p-finally/readme.md +0 -47
- package/node_modules/path-parse/LICENSE +0 -21
- package/node_modules/path-parse/README.md +0 -42
- package/node_modules/path-parse/index.js +0 -75
- package/node_modules/path-parse/package.json +0 -33
- package/node_modules/pump/.github/FUNDING.yml +0 -2
- package/node_modules/pump/.travis.yml +0 -5
- package/node_modules/pump/LICENSE +0 -21
- package/node_modules/pump/README.md +0 -74
- package/node_modules/pump/SECURITY.md +0 -5
- package/node_modules/pump/index.js +0 -86
- package/node_modules/pump/package.json +0 -24
- package/node_modules/pump/test-browser.js +0 -66
- package/node_modules/pump/test-node.js +0 -53
- package/node_modules/rechoir/.npmignore +0 -1
- package/node_modules/rechoir/.travis.yml +0 -24
- package/node_modules/rechoir/CHANGELOG +0 -38
- package/node_modules/rechoir/LICENSE +0 -22
- package/node_modules/rechoir/README.md +0 -42
- package/node_modules/rechoir/index.js +0 -59
- package/node_modules/rechoir/lib/extension.js +0 -11
- package/node_modules/rechoir/lib/normalize.js +0 -15
- package/node_modules/rechoir/lib/register.js +0 -15
- package/node_modules/rechoir/package.json +0 -88
- package/node_modules/resolve/.editorconfig +0 -37
- package/node_modules/resolve/.eslintrc +0 -65
- package/node_modules/resolve/.github/FUNDING.yml +0 -12
- package/node_modules/resolve/.github/INCIDENT_RESPONSE_PROCESS.md +0 -119
- package/node_modules/resolve/.github/THREAT_MODEL.md +0 -74
- package/node_modules/resolve/LICENSE +0 -21
- package/node_modules/resolve/SECURITY.md +0 -11
- package/node_modules/resolve/async.js +0 -3
- package/node_modules/resolve/bin/resolve +0 -50
- package/node_modules/resolve/example/async.js +0 -5
- package/node_modules/resolve/example/sync.js +0 -3
- package/node_modules/resolve/index.js +0 -6
- package/node_modules/resolve/lib/async.js +0 -333
- package/node_modules/resolve/lib/caller.js +0 -8
- package/node_modules/resolve/lib/core.js +0 -12
- package/node_modules/resolve/lib/core.json +0 -162
- package/node_modules/resolve/lib/homedir.js +0 -24
- package/node_modules/resolve/lib/is-core.js +0 -5
- package/node_modules/resolve/lib/node-modules-paths.js +0 -45
- package/node_modules/resolve/lib/normalize-options.js +0 -10
- package/node_modules/resolve/lib/sync.js +0 -212
- package/node_modules/resolve/package.json +0 -75
- package/node_modules/resolve/readme.markdown +0 -301
- package/node_modules/resolve/sync.js +0 -3
- package/node_modules/resolve/test/core.js +0 -88
- package/node_modules/resolve/test/dotdot/abc/index.js +0 -2
- package/node_modules/resolve/test/dotdot/index.js +0 -1
- package/node_modules/resolve/test/dotdot.js +0 -29
- package/node_modules/resolve/test/faulty_basedir.js +0 -29
- package/node_modules/resolve/test/filter.js +0 -34
- package/node_modules/resolve/test/filter_sync.js +0 -33
- package/node_modules/resolve/test/home_paths.js +0 -127
- package/node_modules/resolve/test/home_paths_sync.js +0 -114
- package/node_modules/resolve/test/mock.js +0 -315
- package/node_modules/resolve/test/mock_sync.js +0 -214
- package/node_modules/resolve/test/module_dir/xmodules/aaa/index.js +0 -1
- package/node_modules/resolve/test/module_dir/ymodules/aaa/index.js +0 -1
- package/node_modules/resolve/test/module_dir/zmodules/bbb/main.js +0 -1
- package/node_modules/resolve/test/module_dir/zmodules/bbb/package.json +0 -3
- package/node_modules/resolve/test/module_dir.js +0 -56
- package/node_modules/resolve/test/node-modules-paths.js +0 -143
- package/node_modules/resolve/test/node_path/x/aaa/index.js +0 -1
- package/node_modules/resolve/test/node_path/x/ccc/index.js +0 -1
- package/node_modules/resolve/test/node_path/y/bbb/index.js +0 -1
- package/node_modules/resolve/test/node_path/y/ccc/index.js +0 -1
- package/node_modules/resolve/test/node_path.js +0 -70
- package/node_modules/resolve/test/nonstring.js +0 -9
- package/node_modules/resolve/test/pathfilter/deep_ref/main.js +0 -0
- package/node_modules/resolve/test/pathfilter.js +0 -75
- package/node_modules/resolve/test/precedence/aaa/index.js +0 -1
- package/node_modules/resolve/test/precedence/aaa/main.js +0 -1
- package/node_modules/resolve/test/precedence/aaa.js +0 -1
- package/node_modules/resolve/test/precedence/bbb/main.js +0 -1
- package/node_modules/resolve/test/precedence/bbb.js +0 -1
- package/node_modules/resolve/test/precedence.js +0 -23
- package/node_modules/resolve/test/resolver/baz/doom.js +0 -0
- package/node_modules/resolve/test/resolver/baz/package.json +0 -4
- package/node_modules/resolve/test/resolver/baz/quux.js +0 -1
- package/node_modules/resolve/test/resolver/browser_field/a.js +0 -0
- package/node_modules/resolve/test/resolver/browser_field/b.js +0 -0
- package/node_modules/resolve/test/resolver/browser_field/package.json +0 -5
- package/node_modules/resolve/test/resolver/cup.coffee +0 -1
- package/node_modules/resolve/test/resolver/dot_main/index.js +0 -1
- package/node_modules/resolve/test/resolver/dot_main/package.json +0 -3
- package/node_modules/resolve/test/resolver/dot_slash_main/index.js +0 -1
- package/node_modules/resolve/test/resolver/dot_slash_main/package.json +0 -3
- package/node_modules/resolve/test/resolver/false_main/index.js +0 -0
- package/node_modules/resolve/test/resolver/false_main/package.json +0 -4
- package/node_modules/resolve/test/resolver/foo.js +0 -1
- package/node_modules/resolve/test/resolver/incorrect_main/index.js +0 -2
- package/node_modules/resolve/test/resolver/incorrect_main/package.json +0 -3
- package/node_modules/resolve/test/resolver/invalid_main/package.json +0 -7
- package/node_modules/resolve/test/resolver/mug.coffee +0 -0
- package/node_modules/resolve/test/resolver/mug.js +0 -0
- package/node_modules/resolve/test/resolver/multirepo/lerna.json +0 -6
- package/node_modules/resolve/test/resolver/multirepo/package.json +0 -20
- package/node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js +0 -35
- package/node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json +0 -14
- package/node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js +0 -0
- package/node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json +0 -14
- package/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js +0 -26
- package/node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json +0 -15
- package/node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js +0 -12
- package/node_modules/resolve/test/resolver/other_path/lib/other-lib.js +0 -0
- package/node_modules/resolve/test/resolver/other_path/root.js +0 -0
- package/node_modules/resolve/test/resolver/quux/foo/index.js +0 -1
- package/node_modules/resolve/test/resolver/same_names/foo/index.js +0 -1
- package/node_modules/resolve/test/resolver/same_names/foo.js +0 -1
- package/node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js +0 -0
- package/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep +0 -0
- package/node_modules/resolve/test/resolver/symlinked/package/bar.js +0 -1
- package/node_modules/resolve/test/resolver/symlinked/package/package.json +0 -3
- package/node_modules/resolve/test/resolver/without_basedir/main.js +0 -5
- package/node_modules/resolve/test/resolver.js +0 -597
- package/node_modules/resolve/test/resolver_sync.js +0 -730
- package/node_modules/resolve/test/shadowed_core/node_modules/util/index.js +0 -0
- package/node_modules/resolve/test/shadowed_core.js +0 -54
- package/node_modules/resolve/test/subdirs.js +0 -13
- package/node_modules/resolve/test/symlinks.js +0 -176
- package/node_modules/shelljs/bin/shjs +0 -48
- package/node_modules/shelljs/node_modules/execa/index.js +0 -361
- package/node_modules/shelljs/node_modules/execa/lib/errname.js +0 -39
- package/node_modules/shelljs/node_modules/execa/lib/stdio.js +0 -41
- package/node_modules/shelljs/node_modules/execa/package.json +0 -69
- package/node_modules/shelljs/node_modules/execa/readme.md +0 -327
- package/node_modules/shelljs/node_modules/get-stream/buffer-stream.js +0 -51
- package/node_modules/shelljs/node_modules/get-stream/index.js +0 -50
- package/node_modules/shelljs/node_modules/is-stream/index.js +0 -21
- package/node_modules/shelljs/node_modules/is-stream/license +0 -21
- package/node_modules/shelljs/node_modules/is-stream/package.json +0 -38
- package/node_modules/shelljs/node_modules/is-stream/readme.md +0 -42
- package/node_modules/shelljs/node_modules/npm-run-path/index.js +0 -39
- package/node_modules/shelljs/node_modules/npm-run-path/license +0 -21
- package/node_modules/shelljs/node_modules/npm-run-path/package.json +0 -45
- package/node_modules/shelljs/node_modules/path-key/index.js +0 -13
- package/node_modules/shelljs/node_modules/path-key/license +0 -21
- package/node_modules/shelljs/node_modules/path-key/package.json +0 -39
- package/node_modules/shelljs/node_modules/semver/LICENSE +0 -15
- package/node_modules/shelljs/node_modules/semver/README.md +0 -412
- package/node_modules/shelljs/node_modules/semver/bin/semver +0 -160
- package/node_modules/shelljs/node_modules/semver/package.json +0 -38
- package/node_modules/shelljs/node_modules/semver/range.bnf +0 -16
- package/node_modules/shelljs/node_modules/semver/semver.js +0 -1525
- package/node_modules/shelljs/node_modules/shebang-command/index.js +0 -19
- package/node_modules/shelljs/node_modules/shebang-command/license +0 -21
- package/node_modules/shelljs/node_modules/shebang-command/package.json +0 -39
- package/node_modules/shelljs/node_modules/shebang-regex/index.js +0 -2
- package/node_modules/shelljs/node_modules/shebang-regex/license +0 -21
- package/node_modules/shelljs/node_modules/shebang-regex/package.json +0 -32
- package/node_modules/shelljs/node_modules/shebang-regex/readme.md +0 -29
- package/node_modules/shelljs/node_modules/which/LICENSE +0 -15
- package/node_modules/shelljs/node_modules/which/package.json +0 -30
- package/node_modules/shelljs/node_modules/which/which.js +0 -135
- package/node_modules/strip-eof/index.js +0 -15
- package/node_modules/strip-eof/license +0 -21
- package/node_modules/strip-eof/package.json +0 -39
- package/node_modules/strip-eof/readme.md +0 -28
- package/node_modules/supports-preserve-symlinks-flag/.eslintrc +0 -14
- package/node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml +0 -12
- package/node_modules/supports-preserve-symlinks-flag/.nycrc +0 -9
- package/node_modules/supports-preserve-symlinks-flag/CHANGELOG.md +0 -22
- package/node_modules/supports-preserve-symlinks-flag/LICENSE +0 -21
- package/node_modules/supports-preserve-symlinks-flag/README.md +0 -42
- package/node_modules/supports-preserve-symlinks-flag/browser.js +0 -3
- package/node_modules/supports-preserve-symlinks-flag/index.js +0 -9
- package/node_modules/supports-preserve-symlinks-flag/package.json +0 -70
- package/node_modules/supports-preserve-symlinks-flag/test/index.js +0 -29
- package/node_modules/wrappy/LICENSE +0 -15
- package/node_modules/wrappy/README.md +0 -36
- package/node_modules/wrappy/package.json +0 -29
- package/node_modules/wrappy/wrappy.js +0 -33
- /package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/LICENSE +0 -0
- /package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/index.js +0 -0
- /package/node_modules/{shelljs/node_modules/cross-spawn → cross-spawn}/lib/util/escape.js +0 -0
- /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/LICENSE +0 -0
- /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/README.md +0 -0
- /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/index.js +0 -0
- /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/lib/constants.js +0 -0
- /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/lib/parse.js +0 -0
- /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/lib/picomatch.js +0 -0
- /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/lib/scan.js +0 -0
- /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/lib/utils.js +0 -0
- /package/node_modules/{picomatch → micromatch/node_modules/picomatch}/package.json +0 -0
- /package/node_modules/{shelljs/node_modules/execa → mimic-fn}/license +0 -0
- /package/node_modules/{shelljs/node_modules/get-stream → npm-run-path}/license +0 -0
- /package/node_modules/{once → which}/LICENSE +0 -0
- /package/node_modules/{shelljs/node_modules/which/bin/which → which/bin/node-which} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var common = require('./common');
|
|
2
1
|
var fs = require('fs');
|
|
2
|
+
var common = require('./common');
|
|
3
3
|
|
|
4
4
|
common.register('grep', _grep, {
|
|
5
5
|
globStart: 2, // don't glob-expand the regex
|
|
@@ -9,6 +9,9 @@ common.register('grep', _grep, {
|
|
|
9
9
|
'l': 'nameOnly',
|
|
10
10
|
'i': 'ignoreCase',
|
|
11
11
|
'n': 'lineNumber',
|
|
12
|
+
'B': 'beforeContext',
|
|
13
|
+
'A': 'afterContext',
|
|
14
|
+
'C': 'context',
|
|
12
15
|
},
|
|
13
16
|
});
|
|
14
17
|
|
|
@@ -22,12 +25,18 @@ common.register('grep', _grep, {
|
|
|
22
25
|
//@ + `-l`: Print only filenames of matching files.
|
|
23
26
|
//@ + `-i`: Ignore case.
|
|
24
27
|
//@ + `-n`: Print line numbers.
|
|
28
|
+
//@ + `-B <num>`: Show `<num>` lines before each result.
|
|
29
|
+
//@ + `-A <num>`: Show `<num>` lines after each result.
|
|
30
|
+
//@ + `-C <num>`: Show `<num>` lines before and after each result. -B and -A override this option.
|
|
25
31
|
//@
|
|
26
32
|
//@ Examples:
|
|
27
33
|
//@
|
|
28
34
|
//@ ```javascript
|
|
29
35
|
//@ grep('-v', 'GLOBAL_VARIABLE', '*.js');
|
|
30
36
|
//@ grep('GLOBAL_VARIABLE', '*.js');
|
|
37
|
+
//@ grep('-B', 3, 'GLOBAL_VARIABLE', '*.js');
|
|
38
|
+
//@ grep({ '-B': 3 }, 'GLOBAL_VARIABLE', '*.js');
|
|
39
|
+
//@ grep({ '-B': 3, '-C': 2 }, 'GLOBAL_VARIABLE', '*.js');
|
|
31
40
|
//@ ```
|
|
32
41
|
//@
|
|
33
42
|
//@ Reads input string from given files and returns a
|
|
@@ -39,7 +48,41 @@ function _grep(options, regex, files) {
|
|
|
39
48
|
|
|
40
49
|
if (!files && !pipe) common.error('no paths given', 2);
|
|
41
50
|
|
|
42
|
-
|
|
51
|
+
var idx = 2;
|
|
52
|
+
var contextError = ': invalid context length argument';
|
|
53
|
+
// If the option has been found but not read, copy value from arguments
|
|
54
|
+
if (options.beforeContext === true) {
|
|
55
|
+
idx = 3;
|
|
56
|
+
options.beforeContext = Number(arguments[1]);
|
|
57
|
+
if (options.beforeContext < 0) {
|
|
58
|
+
common.error(options.beforeContext + contextError, 2);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (options.afterContext === true) {
|
|
62
|
+
idx = 3;
|
|
63
|
+
options.afterContext = Number(arguments[1]);
|
|
64
|
+
if (options.afterContext < 0) {
|
|
65
|
+
common.error(options.afterContext + contextError, 2);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (options.context === true) {
|
|
69
|
+
idx = 3;
|
|
70
|
+
options.context = Number(arguments[1]);
|
|
71
|
+
if (options.context < 0) {
|
|
72
|
+
common.error(options.context + contextError, 2);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// If before or after not given but context is, update values
|
|
76
|
+
if (typeof options.context === 'number') {
|
|
77
|
+
if (options.beforeContext === false) {
|
|
78
|
+
options.beforeContext = options.context;
|
|
79
|
+
}
|
|
80
|
+
if (options.afterContext === false) {
|
|
81
|
+
options.afterContext = options.context;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
regex = arguments[idx - 1];
|
|
85
|
+
files = [].slice.call(arguments, idx);
|
|
43
86
|
|
|
44
87
|
if (pipe) {
|
|
45
88
|
files.unshift('-');
|
|
@@ -62,16 +105,79 @@ function _grep(options, regex, files) {
|
|
|
62
105
|
}
|
|
63
106
|
} else {
|
|
64
107
|
var lines = contents.split('\n');
|
|
108
|
+
var matches = [];
|
|
109
|
+
|
|
65
110
|
lines.forEach(function (line, index) {
|
|
66
111
|
var matched = line.match(regex);
|
|
67
112
|
if ((options.inverse && !matched) || (!options.inverse && matched)) {
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
|
|
113
|
+
var lineNumber = index + 1;
|
|
114
|
+
var result = {};
|
|
115
|
+
if (matches.length > 0) {
|
|
116
|
+
// If the last result intersects, combine them
|
|
117
|
+
var last = matches[matches.length - 1];
|
|
118
|
+
var minimumLineNumber = Math.max(
|
|
119
|
+
1,
|
|
120
|
+
lineNumber - options.beforeContext - 1,
|
|
121
|
+
);
|
|
122
|
+
if (
|
|
123
|
+
last.hasOwnProperty('' + lineNumber) ||
|
|
124
|
+
last.hasOwnProperty('' + minimumLineNumber)
|
|
125
|
+
) {
|
|
126
|
+
result = last;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
result[lineNumber] = {
|
|
130
|
+
line,
|
|
131
|
+
match: true,
|
|
132
|
+
};
|
|
133
|
+
if (options.beforeContext > 0) {
|
|
134
|
+
// Store the lines with their line numbers to check for overlap
|
|
135
|
+
lines
|
|
136
|
+
.slice(Math.max(index - options.beforeContext, 0), index)
|
|
137
|
+
.forEach(function (v, i, a) {
|
|
138
|
+
var lineNum = '' + (index - a.length + i + 1);
|
|
139
|
+
if (!result.hasOwnProperty(lineNum)) {
|
|
140
|
+
result[lineNum] = { line: v, match: false };
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
if (options.afterContext > 0) {
|
|
145
|
+
// Store the lines with their line numbers to check for overlap
|
|
146
|
+
lines
|
|
147
|
+
.slice(
|
|
148
|
+
index + 1,
|
|
149
|
+
Math.min(index + options.afterContext + 1, lines.length - 1),
|
|
150
|
+
)
|
|
151
|
+
.forEach(function (v, i) {
|
|
152
|
+
var lineNum = '' + (index + 1 + i + 1);
|
|
153
|
+
if (!result.hasOwnProperty(lineNum)) {
|
|
154
|
+
result[lineNum] = { line: v, match: false };
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
// Only add the result if it's new
|
|
159
|
+
if (!matches.includes(result)) {
|
|
160
|
+
matches.push(result);
|
|
71
161
|
}
|
|
72
|
-
grep.push(result);
|
|
73
162
|
}
|
|
74
163
|
});
|
|
164
|
+
|
|
165
|
+
// Loop through the matches and add them to the output
|
|
166
|
+
Array.prototype.push.apply(
|
|
167
|
+
grep,
|
|
168
|
+
matches.map(function (result) {
|
|
169
|
+
return Object.entries(result)
|
|
170
|
+
.map(function (entry) {
|
|
171
|
+
var lineNumber = entry[0];
|
|
172
|
+
var line = entry[1].line;
|
|
173
|
+
var match = entry[1].match;
|
|
174
|
+
return options.lineNumber
|
|
175
|
+
? lineNumber + (match ? ':' : '-') + line
|
|
176
|
+
: line;
|
|
177
|
+
})
|
|
178
|
+
.join('\n');
|
|
179
|
+
}),
|
|
180
|
+
);
|
|
75
181
|
}
|
|
76
182
|
});
|
|
77
183
|
|
|
@@ -79,6 +185,14 @@ function _grep(options, regex, files) {
|
|
|
79
185
|
// We didn't hit the error above, but pattern didn't match
|
|
80
186
|
common.error('', { silent: true });
|
|
81
187
|
}
|
|
82
|
-
|
|
188
|
+
|
|
189
|
+
var separator = '\n';
|
|
190
|
+
if (
|
|
191
|
+
typeof options.beforeContext === 'number' ||
|
|
192
|
+
typeof options.afterContext === 'number'
|
|
193
|
+
) {
|
|
194
|
+
separator = '\n--\n';
|
|
195
|
+
}
|
|
196
|
+
return grep.join(separator) + '\n';
|
|
83
197
|
}
|
|
84
198
|
module.exports = _grep;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = input => {
|
|
4
|
+
const LF = typeof input === 'string' ? '\n' : '\n'.charCodeAt();
|
|
5
|
+
const CR = typeof input === 'string' ? '\r' : '\r'.charCodeAt();
|
|
6
|
+
|
|
7
|
+
if (input[input.length - 1] === LF) {
|
|
8
|
+
input = input.slice(0, input.length - 1);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (input[input.length - 1] === CR) {
|
|
12
|
+
input = input.slice(0, input.length - 1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return input;
|
|
16
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "strip-final-newline",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Strip the final newline character from a string/buffer",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/strip-final-newline",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Sindre Sorhus",
|
|
9
|
+
"email": "sindresorhus@gmail.com",
|
|
10
|
+
"url": "sindresorhus.com"
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=6"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"test": "xo && ava"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"index.js"
|
|
20
|
+
],
|
|
21
|
+
"keywords": [
|
|
22
|
+
"strip",
|
|
23
|
+
"trim",
|
|
24
|
+
"remove",
|
|
25
|
+
"delete",
|
|
26
|
+
"final",
|
|
27
|
+
"last",
|
|
28
|
+
"end",
|
|
29
|
+
"file",
|
|
30
|
+
"newline",
|
|
31
|
+
"linebreak",
|
|
32
|
+
"character",
|
|
33
|
+
"string",
|
|
34
|
+
"buffer"
|
|
35
|
+
],
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"ava": "^0.25.0",
|
|
38
|
+
"xo": "^0.23.0"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# strip-final-newline [](https://travis-ci.com/sindresorhus/strip-final-newline)
|
|
2
|
+
|
|
3
|
+
> Strip the final [newline character](https://en.wikipedia.org/wiki/Newline) from a string/buffer
|
|
4
|
+
|
|
5
|
+
Can be useful when parsing the output of, for example, `ChildProcess#execFile`, as [binaries usually output a newline at the end](https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline). Normally, you would use `stdout.trim()`, but that would also remove newlines at the start and whitespace.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
$ npm install strip-final-newline
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
const stripFinalNewline = require('strip-final-newline');
|
|
19
|
+
|
|
20
|
+
stripFinalNewline('foo\nbar\n\n');
|
|
21
|
+
//=> 'foo\nbar\n'
|
|
22
|
+
|
|
23
|
+
stripFinalNewline(Buffer.from('foo\nbar\n\n')).toString();
|
|
24
|
+
//=> 'foo\nbar\n'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
|
|
30
|
+
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
|
@@ -17,6 +17,9 @@ which('node', function (er, resolvedPath) {
|
|
|
17
17
|
// if it is found, then the absolute path to the exec is returned
|
|
18
18
|
})
|
|
19
19
|
|
|
20
|
+
// or promise
|
|
21
|
+
which('node').then(resolvedPath => { ... }).catch(er => { ... not found ... })
|
|
22
|
+
|
|
20
23
|
// sync usage
|
|
21
24
|
// throws if not found
|
|
22
25
|
var resolved = which.sync('node')
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
|
|
3
|
+
"name": "which",
|
|
4
|
+
"description": "Like which(1) unix command. Find the first instance of an executable in the PATH.",
|
|
5
|
+
"version": "2.0.2",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git://github.com/isaacs/node-which.git"
|
|
9
|
+
},
|
|
10
|
+
"main": "which.js",
|
|
11
|
+
"bin": {
|
|
12
|
+
"node-which": "./bin/node-which"
|
|
13
|
+
},
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"isexe": "^2.0.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"mkdirp": "^0.5.0",
|
|
20
|
+
"rimraf": "^2.6.2",
|
|
21
|
+
"tap": "^14.6.9"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"test": "tap",
|
|
25
|
+
"preversion": "npm test",
|
|
26
|
+
"postversion": "npm publish",
|
|
27
|
+
"prepublish": "npm run changelog",
|
|
28
|
+
"prechangelog": "bash gen-changelog.sh",
|
|
29
|
+
"changelog": "git add CHANGELOG.md",
|
|
30
|
+
"postchangelog": "git commit -m 'update changelog - '${npm_package_version}",
|
|
31
|
+
"postpublish": "git push origin --follow-tags"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"which.js",
|
|
35
|
+
"bin/node-which"
|
|
36
|
+
],
|
|
37
|
+
"tap": {
|
|
38
|
+
"check-coverage": true
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">= 8"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
const isWindows = process.platform === 'win32' ||
|
|
2
|
+
process.env.OSTYPE === 'cygwin' ||
|
|
3
|
+
process.env.OSTYPE === 'msys'
|
|
4
|
+
|
|
5
|
+
const path = require('path')
|
|
6
|
+
const COLON = isWindows ? ';' : ':'
|
|
7
|
+
const isexe = require('isexe')
|
|
8
|
+
|
|
9
|
+
const getNotFoundError = (cmd) =>
|
|
10
|
+
Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })
|
|
11
|
+
|
|
12
|
+
const getPathInfo = (cmd, opt) => {
|
|
13
|
+
const colon = opt.colon || COLON
|
|
14
|
+
|
|
15
|
+
// If it has a slash, then we don't bother searching the pathenv.
|
|
16
|
+
// just check the file itself, and that's it.
|
|
17
|
+
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? ['']
|
|
18
|
+
: (
|
|
19
|
+
[
|
|
20
|
+
// windows always checks the cwd first
|
|
21
|
+
...(isWindows ? [process.cwd()] : []),
|
|
22
|
+
...(opt.path || process.env.PATH ||
|
|
23
|
+
/* istanbul ignore next: very unusual */ '').split(colon),
|
|
24
|
+
]
|
|
25
|
+
)
|
|
26
|
+
const pathExtExe = isWindows
|
|
27
|
+
? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'
|
|
28
|
+
: ''
|
|
29
|
+
const pathExt = isWindows ? pathExtExe.split(colon) : ['']
|
|
30
|
+
|
|
31
|
+
if (isWindows) {
|
|
32
|
+
if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
|
|
33
|
+
pathExt.unshift('')
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
pathEnv,
|
|
38
|
+
pathExt,
|
|
39
|
+
pathExtExe,
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const which = (cmd, opt, cb) => {
|
|
44
|
+
if (typeof opt === 'function') {
|
|
45
|
+
cb = opt
|
|
46
|
+
opt = {}
|
|
47
|
+
}
|
|
48
|
+
if (!opt)
|
|
49
|
+
opt = {}
|
|
50
|
+
|
|
51
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)
|
|
52
|
+
const found = []
|
|
53
|
+
|
|
54
|
+
const step = i => new Promise((resolve, reject) => {
|
|
55
|
+
if (i === pathEnv.length)
|
|
56
|
+
return opt.all && found.length ? resolve(found)
|
|
57
|
+
: reject(getNotFoundError(cmd))
|
|
58
|
+
|
|
59
|
+
const ppRaw = pathEnv[i]
|
|
60
|
+
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw
|
|
61
|
+
|
|
62
|
+
const pCmd = path.join(pathPart, cmd)
|
|
63
|
+
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd
|
|
64
|
+
: pCmd
|
|
65
|
+
|
|
66
|
+
resolve(subStep(p, i, 0))
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const subStep = (p, i, ii) => new Promise((resolve, reject) => {
|
|
70
|
+
if (ii === pathExt.length)
|
|
71
|
+
return resolve(step(i + 1))
|
|
72
|
+
const ext = pathExt[ii]
|
|
73
|
+
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
74
|
+
if (!er && is) {
|
|
75
|
+
if (opt.all)
|
|
76
|
+
found.push(p + ext)
|
|
77
|
+
else
|
|
78
|
+
return resolve(p + ext)
|
|
79
|
+
}
|
|
80
|
+
return resolve(subStep(p, i, ii + 1))
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
return cb ? step(0).then(res => cb(null, res), cb) : step(0)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const whichSync = (cmd, opt) => {
|
|
88
|
+
opt = opt || {}
|
|
89
|
+
|
|
90
|
+
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)
|
|
91
|
+
const found = []
|
|
92
|
+
|
|
93
|
+
for (let i = 0; i < pathEnv.length; i ++) {
|
|
94
|
+
const ppRaw = pathEnv[i]
|
|
95
|
+
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw
|
|
96
|
+
|
|
97
|
+
const pCmd = path.join(pathPart, cmd)
|
|
98
|
+
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd
|
|
99
|
+
: pCmd
|
|
100
|
+
|
|
101
|
+
for (let j = 0; j < pathExt.length; j ++) {
|
|
102
|
+
const cur = p + pathExt[j]
|
|
103
|
+
try {
|
|
104
|
+
const is = isexe.sync(cur, { pathExt: pathExtExe })
|
|
105
|
+
if (is) {
|
|
106
|
+
if (opt.all)
|
|
107
|
+
found.push(cur)
|
|
108
|
+
else
|
|
109
|
+
return cur
|
|
110
|
+
}
|
|
111
|
+
} catch (ex) {}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (opt.all && found.length)
|
|
116
|
+
return found
|
|
117
|
+
|
|
118
|
+
if (opt.nothrow)
|
|
119
|
+
return null
|
|
120
|
+
|
|
121
|
+
throw getNotFoundError(cmd)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
module.exports = which
|
|
125
|
+
which.sync = whichSync
|
package/package.json
CHANGED
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"fast-json-patch": "^3.1.1",
|
|
101
101
|
"ini": "^2.0.0",
|
|
102
102
|
"parse-conflict-json": "^4.0.0",
|
|
103
|
-
"semver": "^7.8.
|
|
103
|
+
"semver": "^7.8.3",
|
|
104
104
|
"shx": "^0.4.0",
|
|
105
105
|
"xmlbuilder2": "^4.0.3",
|
|
106
106
|
"yaml": "^2.2.2",
|
|
@@ -122,6 +122,9 @@
|
|
|
122
122
|
"yaml",
|
|
123
123
|
"yargs"
|
|
124
124
|
],
|
|
125
|
+
"overrides": {
|
|
126
|
+
"shelljs": "^0.10.0"
|
|
127
|
+
},
|
|
125
128
|
"keywords": [
|
|
126
129
|
"cdk",
|
|
127
130
|
"cicd",
|
|
@@ -144,7 +147,7 @@
|
|
|
144
147
|
"publishConfig": {
|
|
145
148
|
"access": "public"
|
|
146
149
|
},
|
|
147
|
-
"version": "0.99.
|
|
150
|
+
"version": "0.99.73",
|
|
148
151
|
"jest": {
|
|
149
152
|
"coverageProvider": "v8",
|
|
150
153
|
"coverageReporters": [
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2014 Mathias Buus
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|