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,212 +0,0 @@
|
|
|
1
|
-
var isCore = require('is-core-module');
|
|
2
|
-
var fs = require('fs');
|
|
3
|
-
var path = require('path');
|
|
4
|
-
var getHomedir = require('./homedir');
|
|
5
|
-
var caller = require('./caller');
|
|
6
|
-
var nodeModulesPaths = require('./node-modules-paths');
|
|
7
|
-
var normalizeOptions = require('./normalize-options');
|
|
8
|
-
|
|
9
|
-
var realpathFS = process.platform !== 'win32' && fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync;
|
|
10
|
-
|
|
11
|
-
var relativePathRegex = /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/;
|
|
12
|
-
var windowsDriveRegex = /^\w:[/\\]*$/;
|
|
13
|
-
var nodeModulesRegex = /[/\\]node_modules[/\\]*$/;
|
|
14
|
-
|
|
15
|
-
var homedir = getHomedir();
|
|
16
|
-
var defaultPaths = function () {
|
|
17
|
-
return [
|
|
18
|
-
path.join(homedir, '.node_modules'),
|
|
19
|
-
path.join(homedir, '.node_libraries')
|
|
20
|
-
];
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
var defaultIsFile = function isFile(file) {
|
|
24
|
-
try {
|
|
25
|
-
var stat = fs.statSync(file, { throwIfNoEntry: false });
|
|
26
|
-
} catch (e) {
|
|
27
|
-
if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
|
|
28
|
-
throw e;
|
|
29
|
-
}
|
|
30
|
-
return !!stat && (stat.isFile() || stat.isFIFO());
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
var defaultIsDir = function isDirectory(dir) {
|
|
34
|
-
try {
|
|
35
|
-
var stat = fs.statSync(dir, { throwIfNoEntry: false });
|
|
36
|
-
} catch (e) {
|
|
37
|
-
if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
|
|
38
|
-
throw e;
|
|
39
|
-
}
|
|
40
|
-
return !!stat && stat.isDirectory();
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
var defaultRealpathSync = function realpathSync(x) {
|
|
44
|
-
try {
|
|
45
|
-
return realpathFS(x);
|
|
46
|
-
} catch (realpathErr) {
|
|
47
|
-
if (realpathErr.code !== 'ENOENT') {
|
|
48
|
-
throw realpathErr;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return x;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
var maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) {
|
|
55
|
-
if (opts && opts.preserveSymlinks === false) {
|
|
56
|
-
return realpathSync(x);
|
|
57
|
-
}
|
|
58
|
-
return x;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
var defaultReadPackageSync = function defaultReadPackageSync(readFileSync, pkgfile) {
|
|
62
|
-
var body = readFileSync(pkgfile);
|
|
63
|
-
try {
|
|
64
|
-
var pkg = JSON.parse(body);
|
|
65
|
-
return pkg;
|
|
66
|
-
} catch (jsonErr) {}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
var getPackageCandidates = function getPackageCandidates(x, start, opts) {
|
|
70
|
-
var dirs = nodeModulesPaths(start, opts, x);
|
|
71
|
-
for (var i = 0; i < dirs.length; i++) {
|
|
72
|
-
dirs[i] = path.join(dirs[i], x);
|
|
73
|
-
}
|
|
74
|
-
return dirs;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
module.exports = function resolveSync(x, options) {
|
|
78
|
-
if (typeof x !== 'string') {
|
|
79
|
-
throw new TypeError('Path must be a string.');
|
|
80
|
-
}
|
|
81
|
-
var opts = normalizeOptions(x, options);
|
|
82
|
-
|
|
83
|
-
var isFile = opts.isFile || defaultIsFile;
|
|
84
|
-
var readFileSync = opts.readFileSync || fs.readFileSync;
|
|
85
|
-
var isDirectory = opts.isDirectory || defaultIsDir;
|
|
86
|
-
var realpathSync = opts.realpathSync || defaultRealpathSync;
|
|
87
|
-
var readPackageSync = opts.readPackageSync || defaultReadPackageSync;
|
|
88
|
-
if (opts.readFileSync && opts.readPackageSync) {
|
|
89
|
-
throw new TypeError('`readFileSync` and `readPackageSync` are mutually exclusive.');
|
|
90
|
-
}
|
|
91
|
-
var packageIterator = opts.packageIterator;
|
|
92
|
-
|
|
93
|
-
var extensions = opts.extensions || ['.js'];
|
|
94
|
-
var includeCoreModules = opts.includeCoreModules !== false;
|
|
95
|
-
var basedir = opts.basedir || path.dirname(caller());
|
|
96
|
-
var parent = opts.filename || basedir;
|
|
97
|
-
|
|
98
|
-
opts.paths = opts.paths || defaultPaths();
|
|
99
|
-
|
|
100
|
-
// ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory
|
|
101
|
-
var absoluteStart = maybeRealpathSync(realpathSync, path.resolve(basedir), opts);
|
|
102
|
-
|
|
103
|
-
if (relativePathRegex.test(x)) {
|
|
104
|
-
var res = path.resolve(absoluteStart, x);
|
|
105
|
-
if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/';
|
|
106
|
-
var m = loadAsFileSync(res) || loadAsDirectorySync(res);
|
|
107
|
-
if (m) return maybeRealpathSync(realpathSync, m, opts);
|
|
108
|
-
} else if (includeCoreModules && isCore(x)) {
|
|
109
|
-
return x;
|
|
110
|
-
} else {
|
|
111
|
-
var n = loadNodeModulesSync(x, absoluteStart);
|
|
112
|
-
if (n) return maybeRealpathSync(realpathSync, n, opts);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
|
|
116
|
-
err.code = 'MODULE_NOT_FOUND';
|
|
117
|
-
throw err;
|
|
118
|
-
|
|
119
|
-
function loadAsFileSync(x) {
|
|
120
|
-
var pkg = loadpkg(path.dirname(x));
|
|
121
|
-
|
|
122
|
-
if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
|
|
123
|
-
var rfile = path.relative(pkg.dir, x);
|
|
124
|
-
var r = opts.pathFilter(pkg.pkg, x, rfile);
|
|
125
|
-
if (r) {
|
|
126
|
-
x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (isFile(x)) {
|
|
131
|
-
return x;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
for (var i = 0; i < extensions.length; i++) {
|
|
135
|
-
var file = x + extensions[i];
|
|
136
|
-
if (isFile(file)) {
|
|
137
|
-
return file;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
function loadpkg(dir) {
|
|
143
|
-
if (dir === '' || dir === '/') return;
|
|
144
|
-
if (process.platform === 'win32' && windowsDriveRegex.test(dir)) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
if (nodeModulesRegex.test(dir)) return;
|
|
148
|
-
|
|
149
|
-
var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json');
|
|
150
|
-
|
|
151
|
-
if (!isFile(pkgfile)) {
|
|
152
|
-
return loadpkg(path.dirname(dir));
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
var pkg = readPackageSync(readFileSync, pkgfile);
|
|
156
|
-
|
|
157
|
-
if (pkg && opts.packageFilter) {
|
|
158
|
-
// v2 will pass pkgfile
|
|
159
|
-
pkg = opts.packageFilter(pkg, /*pkgfile,*/ dir); // eslint-disable-line spaced-comment
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return { pkg: pkg, dir: dir };
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function loadAsDirectorySync(x) {
|
|
166
|
-
var pkgfile = path.join(maybeRealpathSync(realpathSync, x, opts), '/package.json');
|
|
167
|
-
if (isFile(pkgfile)) {
|
|
168
|
-
try {
|
|
169
|
-
var pkg = readPackageSync(readFileSync, pkgfile);
|
|
170
|
-
} catch (e) {}
|
|
171
|
-
|
|
172
|
-
if (pkg && opts.packageFilter) {
|
|
173
|
-
// v2 will pass pkgfile
|
|
174
|
-
pkg = opts.packageFilter(pkg, /*pkgfile,*/ x); // eslint-disable-line spaced-comment
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (pkg && pkg.main) {
|
|
178
|
-
if (typeof pkg.main !== 'string') {
|
|
179
|
-
var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');
|
|
180
|
-
mainError.code = 'INVALID_PACKAGE_MAIN';
|
|
181
|
-
throw mainError;
|
|
182
|
-
}
|
|
183
|
-
if (pkg.main === '.' || pkg.main === './') {
|
|
184
|
-
pkg.main = 'index';
|
|
185
|
-
}
|
|
186
|
-
try {
|
|
187
|
-
var m = loadAsFileSync(path.resolve(x, pkg.main));
|
|
188
|
-
if (m) return m;
|
|
189
|
-
var n = loadAsDirectorySync(path.resolve(x, pkg.main));
|
|
190
|
-
if (n) return n;
|
|
191
|
-
} catch (e) {}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
return loadAsFileSync(path.join(x, '/index'));
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function loadNodeModulesSync(x, start) {
|
|
199
|
-
var thunk = function () { return getPackageCandidates(x, start, opts); };
|
|
200
|
-
var dirs = packageIterator ? packageIterator(x, start, thunk, opts) : thunk();
|
|
201
|
-
|
|
202
|
-
for (var i = 0; i < dirs.length; i++) {
|
|
203
|
-
var dir = dirs[i];
|
|
204
|
-
if (isDirectory(path.dirname(dir))) {
|
|
205
|
-
var m = loadAsFileSync(dir);
|
|
206
|
-
if (m) return m;
|
|
207
|
-
var n = loadAsDirectorySync(dir);
|
|
208
|
-
if (n) return n;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "resolve",
|
|
3
|
-
"description": "resolve like require.resolve() on behalf of files asynchronously and synchronously",
|
|
4
|
-
"version": "1.22.11",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "ssh://github.com/browserify/resolve.git"
|
|
8
|
-
},
|
|
9
|
-
"bin": {
|
|
10
|
-
"resolve": "./bin/resolve"
|
|
11
|
-
},
|
|
12
|
-
"main": "index.js",
|
|
13
|
-
"keywords": [
|
|
14
|
-
"resolve",
|
|
15
|
-
"require",
|
|
16
|
-
"node",
|
|
17
|
-
"module"
|
|
18
|
-
],
|
|
19
|
-
"scripts": {
|
|
20
|
-
"prepack": "npmignore --auto --commentLines=autogenerated && cp node_modules/is-core-module/core.json ./lib/ ||:",
|
|
21
|
-
"prepublishOnly": "safe-publish-latest",
|
|
22
|
-
"prepublish": "not-in-publish || npm run prepublishOnly",
|
|
23
|
-
"prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')",
|
|
24
|
-
"lint": "eslint --ext=js,mjs --no-eslintrc -c .eslintrc . 'bin/**'",
|
|
25
|
-
"pretests-only": "cd ./test/resolver/nested_symlinks && node mylib/sync && node mylib/async",
|
|
26
|
-
"tests-only": "tape test/*.js",
|
|
27
|
-
"pretest": "npm run lint",
|
|
28
|
-
"test": "npm run --silent tests-only",
|
|
29
|
-
"posttest": "npm run test:multirepo && npx npm@'>= 10.2' audit --production",
|
|
30
|
-
"test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test"
|
|
31
|
-
},
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@ljharb/eslint-config": "^21.2.0",
|
|
34
|
-
"array.prototype.map": "^1.0.8",
|
|
35
|
-
"copy-dir": "^1.3.0",
|
|
36
|
-
"eclint": "^2.8.1",
|
|
37
|
-
"eslint": "=8.8.0",
|
|
38
|
-
"in-publish": "^2.0.1",
|
|
39
|
-
"mkdirp": "^0.5.5",
|
|
40
|
-
"mv": "^2.1.1",
|
|
41
|
-
"npmignore": "^0.3.1",
|
|
42
|
-
"object-keys": "^1.1.1",
|
|
43
|
-
"rimraf": "^2.7.1",
|
|
44
|
-
"safe-publish-latest": "^2.0.0",
|
|
45
|
-
"semver": "^6.3.1",
|
|
46
|
-
"tap": "0.4.13",
|
|
47
|
-
"tape": "^5.9.0",
|
|
48
|
-
"tmp": "^0.0.31"
|
|
49
|
-
},
|
|
50
|
-
"license": "MIT",
|
|
51
|
-
"author": {
|
|
52
|
-
"name": "James Halliday",
|
|
53
|
-
"email": "mail@substack.net",
|
|
54
|
-
"url": "http://substack.net"
|
|
55
|
-
},
|
|
56
|
-
"funding": {
|
|
57
|
-
"url": "https://github.com/sponsors/ljharb"
|
|
58
|
-
},
|
|
59
|
-
"dependencies": {
|
|
60
|
-
"is-core-module": "^2.16.1",
|
|
61
|
-
"path-parse": "^1.0.7",
|
|
62
|
-
"supports-preserve-symlinks-flag": "^1.0.0"
|
|
63
|
-
},
|
|
64
|
-
"publishConfig": {
|
|
65
|
-
"ignore": [
|
|
66
|
-
".github/workflows",
|
|
67
|
-
"appveyor.yml",
|
|
68
|
-
"test/resolver/malformed_package_json",
|
|
69
|
-
"test/list-exports"
|
|
70
|
-
]
|
|
71
|
-
},
|
|
72
|
-
"engines": {
|
|
73
|
-
"node": ">= 0.4"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
# resolve <sup>[![Version Badge][2]][1]</sup>
|
|
2
|
-
|
|
3
|
-
implements the [node `require.resolve()` algorithm](https://nodejs.org/api/modules.html#modules_all_together) such that you can `require.resolve()` on behalf of a file asynchronously and synchronously
|
|
4
|
-
|
|
5
|
-
[![github actions][actions-image]][actions-url]
|
|
6
|
-
[![coverage][codecov-image]][codecov-url]
|
|
7
|
-
[![dependency status][5]][6]
|
|
8
|
-
[![dev dependency status][7]][8]
|
|
9
|
-
[![License][license-image]][license-url]
|
|
10
|
-
[![Downloads][downloads-image]][downloads-url]
|
|
11
|
-
|
|
12
|
-
[![npm badge][11]][1]
|
|
13
|
-
|
|
14
|
-
# example
|
|
15
|
-
|
|
16
|
-
asynchronously resolve:
|
|
17
|
-
|
|
18
|
-
```js
|
|
19
|
-
var resolve = require('resolve/async'); // or, require('resolve')
|
|
20
|
-
resolve('tap', { basedir: __dirname }, function (err, res) {
|
|
21
|
-
if (err) console.error(err);
|
|
22
|
-
else console.log(res);
|
|
23
|
-
});
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
$ node example/async.js
|
|
28
|
-
/home/substack/projects/node-resolve/node_modules/tap/lib/main.js
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
synchronously resolve:
|
|
32
|
-
|
|
33
|
-
```js
|
|
34
|
-
var resolve = require('resolve/sync'); // or, `require('resolve').sync
|
|
35
|
-
var res = resolve('tap', { basedir: __dirname });
|
|
36
|
-
console.log(res);
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
$ node example/sync.js
|
|
41
|
-
/home/substack/projects/node-resolve/node_modules/tap/lib/main.js
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
# methods
|
|
45
|
-
|
|
46
|
-
```js
|
|
47
|
-
var resolve = require('resolve');
|
|
48
|
-
var async = require('resolve/async');
|
|
49
|
-
var sync = require('resolve/sync');
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
For both the synchronous and asynchronous methods, errors may have any of the following `err.code` values:
|
|
53
|
-
|
|
54
|
-
- `MODULE_NOT_FOUND`: the given path string (`id`) could not be resolved to a module
|
|
55
|
-
- `INVALID_BASEDIR`: the specified `opts.basedir` doesn't exist, or is not a directory
|
|
56
|
-
- `INVALID_PACKAGE_MAIN`: a `package.json` was encountered with an invalid `main` property (eg. not a string)
|
|
57
|
-
|
|
58
|
-
## resolve(id, opts={}, cb)
|
|
59
|
-
|
|
60
|
-
Asynchronously resolve the module path string `id` into `cb(err, res [, pkg])`, where `pkg` (if defined) is the data from `package.json`.
|
|
61
|
-
|
|
62
|
-
options are:
|
|
63
|
-
|
|
64
|
-
* opts.basedir - directory to begin resolving from
|
|
65
|
-
|
|
66
|
-
* opts.package - `package.json` data applicable to the module being loaded
|
|
67
|
-
|
|
68
|
-
* opts.extensions - array of file extensions to search in order
|
|
69
|
-
|
|
70
|
-
* opts.includeCoreModules - set to `false` to exclude node core modules (e.g. `fs`) from the search
|
|
71
|
-
|
|
72
|
-
* opts.readFile - how to read files asynchronously
|
|
73
|
-
|
|
74
|
-
* opts.isFile - function to asynchronously test whether a file exists
|
|
75
|
-
|
|
76
|
-
* opts.isDirectory - function to asynchronously test whether a file exists and is a directory
|
|
77
|
-
|
|
78
|
-
* opts.realpath - function to asynchronously resolve a potential symlink to its real path
|
|
79
|
-
|
|
80
|
-
* `opts.readPackage(readFile, pkgfile, cb)` - function to asynchronously read and parse a package.json file
|
|
81
|
-
* readFile - the passed `opts.readFile` or `fs.readFile` if not specified
|
|
82
|
-
* pkgfile - path to package.json
|
|
83
|
-
* cb - callback
|
|
84
|
-
|
|
85
|
-
* `opts.packageFilter(pkg, pkgfile, dir)` - transform the parsed package.json contents before looking at the "main" field
|
|
86
|
-
* pkg - package data
|
|
87
|
-
* pkgfile - path to package.json
|
|
88
|
-
* dir - directory that contains package.json
|
|
89
|
-
|
|
90
|
-
* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package
|
|
91
|
-
* pkg - package data
|
|
92
|
-
* path - the path being resolved
|
|
93
|
-
* relativePath - the path relative from the package.json location
|
|
94
|
-
* returns - a relative path that will be joined from the package.json location
|
|
95
|
-
|
|
96
|
-
* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this)
|
|
97
|
-
|
|
98
|
-
For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function
|
|
99
|
-
* request - the import specifier being resolved
|
|
100
|
-
* start - lookup path
|
|
101
|
-
* getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution
|
|
102
|
-
* opts - the resolution options
|
|
103
|
-
|
|
104
|
-
* `opts.packageIterator(request, start, opts)` - return the list of candidate paths where the packages sources may be found (probably don't use this)
|
|
105
|
-
* request - the import specifier being resolved
|
|
106
|
-
* start - lookup path
|
|
107
|
-
* getPackageCandidates - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution
|
|
108
|
-
* opts - the resolution options
|
|
109
|
-
|
|
110
|
-
* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"`
|
|
111
|
-
|
|
112
|
-
* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving.
|
|
113
|
-
This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag.
|
|
114
|
-
**Note:** this property is currently `true` by default but it will be changed to
|
|
115
|
-
`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*.
|
|
116
|
-
|
|
117
|
-
default `opts` values:
|
|
118
|
-
|
|
119
|
-
```js
|
|
120
|
-
{
|
|
121
|
-
paths: [],
|
|
122
|
-
basedir: __dirname,
|
|
123
|
-
extensions: ['.js'],
|
|
124
|
-
includeCoreModules: true,
|
|
125
|
-
readFile: fs.readFile,
|
|
126
|
-
isFile: function isFile(file, cb) {
|
|
127
|
-
fs.stat(file, function (err, stat) {
|
|
128
|
-
if (!err) {
|
|
129
|
-
return cb(null, stat.isFile() || stat.isFIFO());
|
|
130
|
-
}
|
|
131
|
-
if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
|
|
132
|
-
return cb(err);
|
|
133
|
-
});
|
|
134
|
-
},
|
|
135
|
-
isDirectory: function isDirectory(dir, cb) {
|
|
136
|
-
fs.stat(dir, function (err, stat) {
|
|
137
|
-
if (!err) {
|
|
138
|
-
return cb(null, stat.isDirectory());
|
|
139
|
-
}
|
|
140
|
-
if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
|
|
141
|
-
return cb(err);
|
|
142
|
-
});
|
|
143
|
-
},
|
|
144
|
-
realpath: function realpath(file, cb) {
|
|
145
|
-
var realpath = typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath;
|
|
146
|
-
realpath(file, function (realPathErr, realPath) {
|
|
147
|
-
if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr);
|
|
148
|
-
else cb(null, realPathErr ? file : realPath);
|
|
149
|
-
});
|
|
150
|
-
},
|
|
151
|
-
readPackage: function defaultReadPackage(readFile, pkgfile, cb) {
|
|
152
|
-
readFile(pkgfile, function (readFileErr, body) {
|
|
153
|
-
if (readFileErr) cb(readFileErr);
|
|
154
|
-
else {
|
|
155
|
-
try {
|
|
156
|
-
var pkg = JSON.parse(body);
|
|
157
|
-
cb(null, pkg);
|
|
158
|
-
} catch (jsonErr) {
|
|
159
|
-
cb(null);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
},
|
|
164
|
-
moduleDirectory: 'node_modules',
|
|
165
|
-
preserveSymlinks: true
|
|
166
|
-
}
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
## resolve.sync(id, opts)
|
|
170
|
-
|
|
171
|
-
Synchronously resolve the module path string `id`, returning the result and
|
|
172
|
-
throwing an error when `id` can't be resolved.
|
|
173
|
-
|
|
174
|
-
options are:
|
|
175
|
-
|
|
176
|
-
* opts.basedir - directory to begin resolving from
|
|
177
|
-
|
|
178
|
-
* opts.extensions - array of file extensions to search in order
|
|
179
|
-
|
|
180
|
-
* opts.includeCoreModules - set to `false` to exclude node core modules (e.g. `fs`) from the search
|
|
181
|
-
|
|
182
|
-
* opts.readFileSync - how to read files synchronously
|
|
183
|
-
|
|
184
|
-
* opts.isFile - function to synchronously test whether a file exists
|
|
185
|
-
|
|
186
|
-
* opts.isDirectory - function to synchronously test whether a file exists and is a directory
|
|
187
|
-
|
|
188
|
-
* opts.realpathSync - function to synchronously resolve a potential symlink to its real path
|
|
189
|
-
|
|
190
|
-
* `opts.readPackageSync(readFileSync, pkgfile)` - function to synchronously read and parse a package.json file
|
|
191
|
-
* readFileSync - the passed `opts.readFileSync` or `fs.readFileSync` if not specified
|
|
192
|
-
* pkgfile - path to package.json
|
|
193
|
-
|
|
194
|
-
* `opts.packageFilter(pkg, dir)` - transform the parsed package.json contents before looking at the "main" field
|
|
195
|
-
* pkg - package data
|
|
196
|
-
* dir - directory that contains package.json (Note: the second argument will change to "pkgfile" in v2)
|
|
197
|
-
|
|
198
|
-
* `opts.pathFilter(pkg, path, relativePath)` - transform a path within a package
|
|
199
|
-
* pkg - package data
|
|
200
|
-
* path - the path being resolved
|
|
201
|
-
* relativePath - the path relative from the package.json location
|
|
202
|
-
* returns - a relative path that will be joined from the package.json location
|
|
203
|
-
|
|
204
|
-
* opts.paths - require.paths array to use if nothing is found on the normal `node_modules` recursive walk (probably don't use this)
|
|
205
|
-
|
|
206
|
-
For advanced users, `paths` can also be a `opts.paths(request, start, opts)` function
|
|
207
|
-
* request - the import specifier being resolved
|
|
208
|
-
* start - lookup path
|
|
209
|
-
* getNodeModulesDirs - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution
|
|
210
|
-
* opts - the resolution options
|
|
211
|
-
|
|
212
|
-
* `opts.packageIterator(request, start, opts)` - return the list of candidate paths where the packages sources may be found (probably don't use this)
|
|
213
|
-
* request - the import specifier being resolved
|
|
214
|
-
* start - lookup path
|
|
215
|
-
* getPackageCandidates - a thunk (no-argument function) that returns the paths using standard `node_modules` resolution
|
|
216
|
-
* opts - the resolution options
|
|
217
|
-
|
|
218
|
-
* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"`
|
|
219
|
-
|
|
220
|
-
* opts.preserveSymlinks - if true, doesn't resolve `basedir` to real path before resolving.
|
|
221
|
-
This is the way Node resolves dependencies when executed with the [--preserve-symlinks](https://nodejs.org/api/all.html#cli_preserve_symlinks) flag.
|
|
222
|
-
**Note:** this property is currently `true` by default but it will be changed to
|
|
223
|
-
`false` in the next major version because *Node's resolution algorithm does not preserve symlinks by default*.
|
|
224
|
-
|
|
225
|
-
default `opts` values:
|
|
226
|
-
|
|
227
|
-
```js
|
|
228
|
-
{
|
|
229
|
-
paths: [],
|
|
230
|
-
basedir: __dirname,
|
|
231
|
-
extensions: ['.js'],
|
|
232
|
-
includeCoreModules: true,
|
|
233
|
-
readFileSync: fs.readFileSync,
|
|
234
|
-
isFile: function isFile(file) {
|
|
235
|
-
try {
|
|
236
|
-
var stat = fs.statSync(file);
|
|
237
|
-
} catch (e) {
|
|
238
|
-
if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
|
|
239
|
-
throw e;
|
|
240
|
-
}
|
|
241
|
-
return stat.isFile() || stat.isFIFO();
|
|
242
|
-
},
|
|
243
|
-
isDirectory: function isDirectory(dir) {
|
|
244
|
-
try {
|
|
245
|
-
var stat = fs.statSync(dir);
|
|
246
|
-
} catch (e) {
|
|
247
|
-
if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
|
|
248
|
-
throw e;
|
|
249
|
-
}
|
|
250
|
-
return stat.isDirectory();
|
|
251
|
-
},
|
|
252
|
-
realpathSync: function realpathSync(file) {
|
|
253
|
-
try {
|
|
254
|
-
var realpath = typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync;
|
|
255
|
-
return realpath(file);
|
|
256
|
-
} catch (realPathErr) {
|
|
257
|
-
if (realPathErr.code !== 'ENOENT') {
|
|
258
|
-
throw realPathErr;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
return file;
|
|
262
|
-
},
|
|
263
|
-
readPackageSync: function defaultReadPackageSync(readFileSync, pkgfile) {
|
|
264
|
-
var body = readFileSync(pkgfile);
|
|
265
|
-
try {
|
|
266
|
-
var pkg = JSON.parse(body);
|
|
267
|
-
return pkg;
|
|
268
|
-
} catch (jsonErr) {}
|
|
269
|
-
},
|
|
270
|
-
moduleDirectory: 'node_modules',
|
|
271
|
-
preserveSymlinks: true
|
|
272
|
-
}
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
# install
|
|
276
|
-
|
|
277
|
-
With [npm](https://npmjs.org) do:
|
|
278
|
-
|
|
279
|
-
```sh
|
|
280
|
-
npm install resolve
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
# license
|
|
284
|
-
|
|
285
|
-
MIT
|
|
286
|
-
|
|
287
|
-
[1]: https://npmjs.org/package/resolve
|
|
288
|
-
[2]: https://versionbadg.es/browserify/resolve.svg
|
|
289
|
-
[5]: https://david-dm.org/browserify/resolve.svg
|
|
290
|
-
[6]: https://david-dm.org/browserify/resolve
|
|
291
|
-
[7]: https://david-dm.org/browserify/resolve/dev-status.svg
|
|
292
|
-
[8]: https://david-dm.org/browserify/resolve#info=devDependencies
|
|
293
|
-
[11]: https://nodei.co/npm/resolve.png?downloads=true&stars=true
|
|
294
|
-
[license-image]: https://img.shields.io/npm/l/resolve.svg
|
|
295
|
-
[license-url]: LICENSE
|
|
296
|
-
[downloads-image]: https://img.shields.io/npm/dm/resolve.svg
|
|
297
|
-
[downloads-url]: https://npm-stat.com/charts.html?package=resolve
|
|
298
|
-
[codecov-image]: https://codecov.io/gh/browserify/resolve/branch/main/graphs/badge.svg
|
|
299
|
-
[codecov-url]: https://app.codecov.io/gh/browserify/resolve/
|
|
300
|
-
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/browserify/resolve
|
|
301
|
-
[actions-url]: https://github.com/browserify/resolve/actions
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
var test = require('tape');
|
|
2
|
-
var keys = require('object-keys');
|
|
3
|
-
var semver = require('semver');
|
|
4
|
-
|
|
5
|
-
var resolve = require('../');
|
|
6
|
-
|
|
7
|
-
var brokenNode = semver.satisfies(process.version, '11.11 - 11.13');
|
|
8
|
-
|
|
9
|
-
test('core modules', function (t) {
|
|
10
|
-
t.test('isCore()', function (st) {
|
|
11
|
-
st.ok(resolve.isCore('fs'));
|
|
12
|
-
st.ok(resolve.isCore('net'));
|
|
13
|
-
st.ok(resolve.isCore('http'));
|
|
14
|
-
|
|
15
|
-
st.ok(!resolve.isCore('seq'));
|
|
16
|
-
st.ok(!resolve.isCore('../'));
|
|
17
|
-
|
|
18
|
-
st.ok(!resolve.isCore('toString'));
|
|
19
|
-
|
|
20
|
-
st.end();
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
t.test('core list', function (st) {
|
|
24
|
-
var cores = keys(resolve.core);
|
|
25
|
-
st.plan(cores.length);
|
|
26
|
-
|
|
27
|
-
for (var i = 0; i < cores.length; ++i) {
|
|
28
|
-
var mod = cores[i];
|
|
29
|
-
// note: this must be require, not require.resolve, due to https://github.com/nodejs/node/issues/43274
|
|
30
|
-
var requireFunc = function () { require(mod); }; // eslint-disable-line no-loop-func
|
|
31
|
-
t.comment(mod + ': ' + resolve.core[mod]);
|
|
32
|
-
if (resolve.core[mod]) {
|
|
33
|
-
st.doesNotThrow(requireFunc, mod + ' supported; requiring does not throw');
|
|
34
|
-
} else if (brokenNode) {
|
|
35
|
-
st.ok(true, 'this version of node is broken: attempting to require things that fail to resolve breaks "home_paths" tests');
|
|
36
|
-
} else {
|
|
37
|
-
st.throws(requireFunc, mod + ' not supported; requiring throws');
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
st.end();
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
t.test('core via repl module', { skip: !resolve.core.repl }, function (st) {
|
|
45
|
-
var libs = require('repl')._builtinLibs; // eslint-disable-line no-underscore-dangle
|
|
46
|
-
if (!libs) {
|
|
47
|
-
st.skip('module.builtinModules does not exist');
|
|
48
|
-
return st.end();
|
|
49
|
-
}
|
|
50
|
-
for (var i = 0; i < libs.length; ++i) {
|
|
51
|
-
var mod = libs[i];
|
|
52
|
-
st.ok(resolve.core[mod], mod + ' is a core module');
|
|
53
|
-
st.doesNotThrow(
|
|
54
|
-
function () { require(mod); }, // eslint-disable-line no-loop-func
|
|
55
|
-
'requiring ' + mod + ' does not throw'
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
st.end();
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
t.test('core via builtinModules list', { skip: !resolve.core.module }, function (st) {
|
|
62
|
-
var libs = require('module').builtinModules;
|
|
63
|
-
if (!libs) {
|
|
64
|
-
st.skip('module.builtinModules does not exist');
|
|
65
|
-
return st.end();
|
|
66
|
-
}
|
|
67
|
-
var blacklist = [
|
|
68
|
-
'_debug_agent',
|
|
69
|
-
'v8/tools/tickprocessor-driver',
|
|
70
|
-
'v8/tools/SourceMap',
|
|
71
|
-
'v8/tools/tickprocessor',
|
|
72
|
-
'v8/tools/profile'
|
|
73
|
-
];
|
|
74
|
-
for (var i = 0; i < libs.length; ++i) {
|
|
75
|
-
var mod = libs[i];
|
|
76
|
-
if (blacklist.indexOf(mod) === -1) {
|
|
77
|
-
st.ok(resolve.core[mod], mod + ' is a core module');
|
|
78
|
-
st.doesNotThrow(
|
|
79
|
-
function () { require(mod); }, // eslint-disable-line no-loop-func
|
|
80
|
-
'requiring ' + mod + ' does not throw'
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
st.end();
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
t.end();
|
|
88
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = 'whatever';
|