renovate 40.0.0-next.3 → 40.0.0-next.30
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/dist/config/decrypt/legacy.js +0 -1
- package/dist/config/decrypt/legacy.js.map +1 -1
- package/dist/config/decrypt.d.ts +3 -1
- package/dist/config/decrypt.js +56 -13
- package/dist/config/decrypt.js.map +1 -1
- package/dist/config/migrate-validate.js +3 -2
- package/dist/config/migrate-validate.js.map +1 -1
- package/dist/config/migration.js +2 -1
- package/dist/config/migration.js.map +1 -1
- package/dist/config/migrations/custom/rebase-stale-prs-migration.js +1 -1
- package/dist/config/migrations/custom/rebase-stale-prs-migration.js.map +1 -1
- package/dist/config/options/index.js +4 -3
- package/dist/config/options/index.js.map +1 -1
- package/dist/config/parse.js +2 -2
- package/dist/config/parse.js.map +1 -1
- package/dist/config/presets/gitea/index.js +0 -1
- package/dist/config/presets/gitea/index.js.map +1 -1
- package/dist/config/presets/github/index.js +0 -1
- package/dist/config/presets/github/index.js.map +1 -1
- package/dist/config/presets/gitlab/index.js +1 -1
- package/dist/config/presets/gitlab/index.js.map +1 -1
- package/dist/config/presets/http/index.js +1 -2
- package/dist/config/presets/http/index.js.map +1 -1
- package/dist/config/presets/index.js +0 -7
- package/dist/config/presets/index.js.map +1 -1
- package/dist/config/presets/internal/custom-managers.js +3 -4
- package/dist/config/presets/internal/custom-managers.js.map +1 -1
- package/dist/config/presets/internal/group.js +30 -1
- package/dist/config/presets/internal/group.js.map +1 -1
- package/dist/config/presets/internal/index.js +1 -3
- package/dist/config/presets/internal/index.js.map +1 -1
- package/dist/config/presets/internal/workarounds.js +1 -0
- package/dist/config/presets/internal/workarounds.js.map +1 -1
- package/dist/config/presets/parse.js +2 -1
- package/dist/config/presets/parse.js.map +1 -1
- package/dist/config/schema.d.ts +2 -2
- package/dist/config/types.d.ts +4 -1
- package/dist/config/types.js.map +1 -1
- package/dist/config/validation.js +3 -5
- package/dist/config/validation.js.map +1 -1
- package/dist/config-validator.js +0 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/constants/category.js +0 -1
- package/dist/constants/category.js.map +1 -1
- package/dist/data/monorepo.json +5 -1
- package/dist/data/source-urls.json +1 -0
- package/dist/instrumentation/index.js +17 -13
- package/dist/instrumentation/index.js.map +1 -1
- package/dist/instrumentation/utils.js +1 -1
- package/dist/instrumentation/utils.js.map +1 -1
- package/dist/logger/cmd-serializer.js +0 -1
- package/dist/logger/cmd-serializer.js.map +1 -1
- package/dist/logger/config-serializer.js +0 -1
- package/dist/logger/config-serializer.js.map +1 -1
- package/dist/logger/index.js +1 -4
- package/dist/logger/index.js.map +1 -1
- package/dist/logger/once.js +4 -2
- package/dist/logger/once.js.map +1 -1
- package/dist/logger/pretty-stdout.js +0 -1
- package/dist/logger/pretty-stdout.js.map +1 -1
- package/dist/logger/renovate-logger.js +1 -1
- package/dist/logger/renovate-logger.js.map +1 -1
- package/dist/logger/utils.js +6 -11
- package/dist/logger/utils.js.map +1 -1
- package/dist/modules/datasource/api.js +2 -0
- package/dist/modules/datasource/api.js.map +1 -1
- package/dist/modules/datasource/artifactory/index.js +1 -2
- package/dist/modules/datasource/artifactory/index.js.map +1 -1
- package/dist/modules/datasource/aws-eks-addon/index.d.ts +11 -0
- package/dist/modules/datasource/aws-eks-addon/index.js +75 -0
- package/dist/modules/datasource/aws-eks-addon/index.js.map +1 -0
- package/dist/modules/datasource/aws-eks-addon/schema.d.ts +40 -0
- package/dist/modules/datasource/aws-eks-addon/schema.js +31 -0
- package/dist/modules/datasource/aws-eks-addon/schema.js.map +1 -0
- package/dist/modules/datasource/aws-machine-image/index.js +6 -5
- package/dist/modules/datasource/aws-machine-image/index.js.map +1 -1
- package/dist/modules/datasource/azure-pipelines-tasks/index.js +11 -1
- package/dist/modules/datasource/azure-pipelines-tasks/index.js.map +1 -1
- package/dist/modules/datasource/azure-pipelines-tasks/schema.d.ts +16 -0
- package/dist/modules/datasource/azure-pipelines-tasks/schema.js +2 -0
- package/dist/modules/datasource/azure-pipelines-tasks/schema.js.map +1 -1
- package/dist/modules/datasource/bazel/index.js +0 -1
- package/dist/modules/datasource/bazel/index.js.map +1 -1
- package/dist/modules/datasource/bitrise/index.js +1 -1
- package/dist/modules/datasource/bitrise/index.js.map +1 -1
- package/dist/modules/datasource/cdnjs/schema.d.ts +2 -2
- package/dist/modules/datasource/conda/index.js +18 -1
- package/dist/modules/datasource/conda/index.js.map +1 -1
- package/dist/modules/datasource/conda/prefix-dev.d.ts +3 -0
- package/dist/modules/datasource/conda/prefix-dev.js +83 -0
- package/dist/modules/datasource/conda/prefix-dev.js.map +1 -0
- package/dist/modules/datasource/conda/schema/prefix-dev.d.ts +189 -0
- package/dist/modules/datasource/conda/schema/prefix-dev.js +31 -0
- package/dist/modules/datasource/conda/schema/prefix-dev.js.map +1 -0
- package/dist/modules/datasource/conda/types.d.ts +1 -20
- package/dist/modules/datasource/conda/types.js.map +1 -1
- package/dist/modules/datasource/cpan/index.js +1 -1
- package/dist/modules/datasource/cpan/index.js.map +1 -1
- package/dist/modules/datasource/crate/index.js +3 -3
- package/dist/modules/datasource/crate/index.js.map +1 -1
- package/dist/modules/datasource/custom/formats/html.js +1 -1
- package/dist/modules/datasource/custom/formats/html.js.map +1 -1
- package/dist/modules/datasource/custom/formats/yaml.js +1 -1
- package/dist/modules/datasource/custom/formats/yaml.js.map +1 -1
- package/dist/modules/datasource/custom/index.js +4 -2
- package/dist/modules/datasource/custom/index.js.map +1 -1
- package/dist/modules/datasource/custom/schema.d.ts +22 -22
- package/dist/modules/datasource/custom/utils.js +1 -0
- package/dist/modules/datasource/custom/utils.js.map +1 -1
- package/dist/modules/datasource/dart/index.js +1 -1
- package/dist/modules/datasource/dart/index.js.map +1 -1
- package/dist/modules/datasource/dart-version/index.js +1 -1
- package/dist/modules/datasource/dart-version/index.js.map +1 -1
- package/dist/modules/datasource/datasource.js +0 -1
- package/dist/modules/datasource/datasource.js.map +1 -1
- package/dist/modules/datasource/deb/index.js +2 -2
- package/dist/modules/datasource/deb/index.js.map +1 -1
- package/dist/modules/datasource/deno/index.js +1 -1
- package/dist/modules/datasource/deno/index.js.map +1 -1
- package/dist/modules/datasource/deno/schema.d.ts +1 -1
- package/dist/modules/datasource/devbox/index.js +0 -1
- package/dist/modules/datasource/devbox/index.js.map +1 -1
- package/dist/modules/datasource/docker/common.js +5 -2
- package/dist/modules/datasource/docker/common.js.map +1 -1
- package/dist/modules/datasource/docker/index.js +10 -8
- package/dist/modules/datasource/docker/index.js.map +1 -1
- package/dist/modules/datasource/docker/schema.d.ts +5 -5
- package/dist/modules/datasource/docker/schema.js +2 -1
- package/dist/modules/datasource/docker/schema.js.map +1 -1
- package/dist/modules/datasource/flutter-version/index.js +1 -1
- package/dist/modules/datasource/flutter-version/index.js.map +1 -1
- package/dist/modules/datasource/galaxy/schema.d.ts +1 -1
- package/dist/modules/datasource/galaxy-collection/schema.d.ts +8 -8
- package/dist/modules/datasource/git-refs/index.js +1 -1
- package/dist/modules/datasource/git-refs/index.js.map +1 -1
- package/dist/modules/datasource/gitea-releases/schema.d.ts +2 -2
- package/dist/modules/datasource/gitea-tags/schema.d.ts +4 -4
- package/dist/modules/datasource/github-release-attachments/index.js +2 -2
- package/dist/modules/datasource/github-release-attachments/index.js.map +1 -1
- package/dist/modules/datasource/gitlab-packages/index.js +1 -1
- package/dist/modules/datasource/gitlab-packages/index.js.map +1 -1
- package/dist/modules/datasource/gitlab-releases/index.js +1 -3
- package/dist/modules/datasource/gitlab-releases/index.js.map +1 -1
- package/dist/modules/datasource/go/base.js +1 -1
- package/dist/modules/datasource/go/base.js.map +1 -1
- package/dist/modules/datasource/go/index.js +1 -1
- package/dist/modules/datasource/go/index.js.map +1 -1
- package/dist/modules/datasource/go/releases-direct.js +7 -4
- package/dist/modules/datasource/go/releases-direct.js.map +1 -1
- package/dist/modules/datasource/go/releases-goproxy.js +1 -1
- package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
- package/dist/modules/datasource/golang-version/index.js +2 -2
- package/dist/modules/datasource/golang-version/index.js.map +1 -1
- package/dist/modules/datasource/gradle-version/index.js +1 -1
- package/dist/modules/datasource/gradle-version/index.js.map +1 -1
- package/dist/modules/datasource/helm/index.js +1 -1
- package/dist/modules/datasource/helm/index.js.map +1 -1
- package/dist/modules/datasource/hex/index.js +1 -1
- package/dist/modules/datasource/hex/index.js.map +1 -1
- package/dist/modules/datasource/hex/schema.d.ts +11 -11
- package/dist/modules/datasource/hexpm-bob/index.js +1 -1
- package/dist/modules/datasource/hexpm-bob/index.js.map +1 -1
- package/dist/modules/datasource/index.js +4 -4
- package/dist/modules/datasource/index.js.map +1 -1
- package/dist/modules/datasource/java-version/index.js +0 -1
- package/dist/modules/datasource/java-version/index.js.map +1 -1
- package/dist/modules/datasource/jenkins-plugins/index.js +1 -1
- package/dist/modules/datasource/jenkins-plugins/index.js.map +1 -1
- package/dist/modules/datasource/maven/index.js +35 -27
- package/dist/modules/datasource/maven/index.js.map +1 -1
- package/dist/modules/datasource/maven/types.d.ts +3 -6
- package/dist/modules/datasource/maven/types.js.map +1 -1
- package/dist/modules/datasource/maven/util.d.ts +4 -5
- package/dist/modules/datasource/maven/util.js +94 -157
- package/dist/modules/datasource/maven/util.js.map +1 -1
- package/dist/modules/datasource/node-version/index.js +1 -1
- package/dist/modules/datasource/node-version/index.js.map +1 -1
- package/dist/modules/datasource/npm/index.js +1 -1
- package/dist/modules/datasource/npm/index.js.map +1 -1
- package/dist/modules/datasource/npm/npmrc.js +1 -1
- package/dist/modules/datasource/npm/npmrc.js.map +1 -1
- package/dist/modules/datasource/nuget/index.js +1 -1
- package/dist/modules/datasource/nuget/index.js.map +1 -1
- package/dist/modules/datasource/nuget/v2.js +1 -1
- package/dist/modules/datasource/nuget/v2.js.map +1 -1
- package/dist/modules/datasource/nuget/v3.js +6 -6
- package/dist/modules/datasource/nuget/v3.js.map +1 -1
- package/dist/modules/datasource/orb/index.js +1 -1
- package/dist/modules/datasource/orb/index.js.map +1 -1
- package/dist/modules/datasource/packagist/index.js +2 -2
- package/dist/modules/datasource/packagist/index.js.map +1 -1
- package/dist/modules/datasource/packagist/schema.d.ts +25 -25
- package/dist/modules/datasource/pod/index.js +2 -2
- package/dist/modules/datasource/pod/index.js.map +1 -1
- package/dist/modules/datasource/postprocess-release.js +1 -1
- package/dist/modules/datasource/postprocess-release.js.map +1 -1
- package/dist/modules/datasource/pypi/index.js +1 -1
- package/dist/modules/datasource/pypi/index.js.map +1 -1
- package/dist/modules/datasource/python-version/index.js +1 -1
- package/dist/modules/datasource/python-version/index.js.map +1 -1
- package/dist/modules/datasource/repology/index.js +1 -1
- package/dist/modules/datasource/repology/index.js.map +1 -1
- package/dist/modules/datasource/ruby-version/index.js +1 -1
- package/dist/modules/datasource/ruby-version/index.js.map +1 -1
- package/dist/modules/datasource/rubygems/index.js +2 -2
- package/dist/modules/datasource/rubygems/index.js.map +1 -1
- package/dist/modules/datasource/rubygems/versions-endpoint-cache.js +2 -2
- package/dist/modules/datasource/rubygems/versions-endpoint-cache.js.map +1 -1
- package/dist/modules/datasource/sbt-package/index.js +1 -1
- package/dist/modules/datasource/sbt-package/index.js.map +1 -1
- package/dist/modules/datasource/sbt-plugin/index.js +1 -1
- package/dist/modules/datasource/sbt-plugin/index.js.map +1 -1
- package/dist/modules/datasource/schema.d.ts +4 -4
- package/dist/modules/datasource/terraform-module/index.js +1 -1
- package/dist/modules/datasource/terraform-module/index.js.map +1 -1
- package/dist/modules/datasource/terraform-provider/index.js +2 -3
- package/dist/modules/datasource/terraform-provider/index.js.map +1 -1
- package/dist/modules/datasource/types.d.ts +1 -0
- package/dist/modules/datasource/types.js.map +1 -1
- package/dist/modules/datasource/unity3d/index.d.ts +4 -1
- package/dist/modules/datasource/unity3d/index.js +36 -42
- package/dist/modules/datasource/unity3d/index.js.map +1 -1
- package/dist/modules/datasource/unity3d/schema.d.ts +47 -0
- package/dist/modules/datasource/unity3d/schema.js +17 -0
- package/dist/modules/datasource/unity3d/schema.js.map +1 -0
- package/dist/modules/manager/api.js +2 -0
- package/dist/modules/manager/api.js.map +1 -1
- package/dist/modules/manager/argocd/extract.js +1 -1
- package/dist/modules/manager/argocd/extract.js.map +1 -1
- package/dist/modules/manager/argocd/schema.d.ts +10 -10
- package/dist/modules/manager/asdf/upgradeable-tooling.js +94 -0
- package/dist/modules/manager/asdf/upgradeable-tooling.js.map +1 -1
- package/dist/modules/manager/azure-pipelines/schema.d.ts +32 -32
- package/dist/modules/manager/batect/schema.d.ts +4 -4
- package/dist/modules/manager/batect-wrapper/artifacts.js +1 -1
- package/dist/modules/manager/batect-wrapper/artifacts.js.map +1 -1
- package/dist/modules/manager/bazel/rules/docker.d.ts +6 -6
- package/dist/modules/manager/bazel/rules/git.d.ts +10 -10
- package/dist/modules/manager/bazel/rules/git.js +9 -2
- package/dist/modules/manager/bazel/rules/git.js.map +1 -1
- package/dist/modules/manager/bazel/rules/go.d.ts +5 -5
- package/dist/modules/manager/bazel/rules/maven.d.ts +7 -7
- package/dist/modules/manager/bazel/rules/oci.d.ts +6 -6
- package/dist/modules/manager/bazel-module/parser/fragments.d.ts +40 -40
- package/dist/modules/manager/bazel-module/parser/maven.d.ts +40 -40
- package/dist/modules/manager/bazel-module/parser/oci.d.ts +17 -17
- package/dist/modules/manager/bazel-module/rules.d.ts +40 -40
- package/dist/modules/manager/bun/artifacts.js +0 -1
- package/dist/modules/manager/bun/artifacts.js.map +1 -1
- package/dist/modules/manager/bundler/artifacts.js +0 -1
- package/dist/modules/manager/bundler/artifacts.js.map +1 -1
- package/dist/modules/manager/bundler/extract.js +2 -1
- package/dist/modules/manager/bundler/extract.js.map +1 -1
- package/dist/modules/manager/cake/index.js +4 -2
- package/dist/modules/manager/cake/index.js.map +1 -1
- package/dist/modules/manager/cargo/artifacts.js +5 -7
- package/dist/modules/manager/cargo/artifacts.js.map +1 -1
- package/dist/modules/manager/cargo/schema.d.ts +114 -114
- package/dist/modules/manager/cocoapods/artifacts.js +1 -2
- package/dist/modules/manager/cocoapods/artifacts.js.map +1 -1
- package/dist/modules/manager/composer/artifacts.js +1 -2
- package/dist/modules/manager/composer/artifacts.js.map +1 -1
- package/dist/modules/manager/composer/schema.d.ts +26 -26
- package/dist/modules/manager/composer/schema.js +1 -1
- package/dist/modules/manager/composer/schema.js.map +1 -1
- package/dist/modules/manager/composer/utils.d.ts +1 -0
- package/dist/modules/manager/composer/utils.js +18 -6
- package/dist/modules/manager/composer/utils.js.map +1 -1
- package/dist/modules/manager/copier/artifacts.js +0 -1
- package/dist/modules/manager/copier/artifacts.js.map +1 -1
- package/dist/modules/manager/crossplane/schema.d.ts +2 -2
- package/dist/modules/manager/custom/jsonata/index.js +4 -0
- package/dist/modules/manager/custom/jsonata/index.js.map +1 -1
- package/dist/modules/manager/custom/jsonata/schema.d.ts +21 -21
- package/dist/modules/manager/custom/regex/index.js +2 -0
- package/dist/modules/manager/custom/regex/index.js.map +1 -1
- package/dist/modules/manager/deps-edn/extract.js +2 -1
- package/dist/modules/manager/deps-edn/extract.js.map +1 -1
- package/dist/modules/manager/devbox/artifacts.d.ts +1 -1
- package/dist/modules/manager/devbox/artifacts.js +28 -11
- package/dist/modules/manager/devbox/artifacts.js.map +1 -1
- package/dist/modules/manager/devbox/schema.js +1 -1
- package/dist/modules/manager/devbox/schema.js.map +1 -1
- package/dist/modules/manager/devcontainer/extract.js +43 -1
- package/dist/modules/manager/devcontainer/extract.js.map +1 -1
- package/dist/modules/manager/devcontainer/index.js +11 -1
- package/dist/modules/manager/devcontainer/index.js.map +1 -1
- package/dist/modules/manager/devcontainer/schema.d.ts +7 -3
- package/dist/modules/manager/devcontainer/schema.js +3 -1
- package/dist/modules/manager/devcontainer/schema.js.map +1 -1
- package/dist/modules/manager/docker-compose/schema.d.ts +6 -6
- package/dist/modules/manager/fingerprint.generated.js +86 -85
- package/dist/modules/manager/fingerprint.generated.js.map +1 -1
- package/dist/modules/manager/flux/artifacts.js +0 -1
- package/dist/modules/manager/flux/artifacts.js.map +1 -1
- package/dist/modules/manager/flux/extract.js +27 -24
- package/dist/modules/manager/flux/extract.js.map +1 -1
- package/dist/modules/manager/flux/schema.d.ts +94 -94
- package/dist/modules/manager/github-actions/extract.js +60 -39
- package/dist/modules/manager/github-actions/extract.js.map +1 -1
- package/dist/modules/manager/github-actions/schema.d.ts +66 -0
- package/dist/modules/manager/github-actions/schema.js +38 -0
- package/dist/modules/manager/github-actions/schema.js.map +1 -0
- package/dist/modules/manager/gitlabci/extract.d.ts +1 -5
- package/dist/modules/manager/gitlabci/extract.js +27 -126
- package/dist/modules/manager/gitlabci/extract.js.map +1 -1
- package/dist/modules/manager/gitlabci/schema.d.ts +55 -0
- package/dist/modules/manager/gitlabci/schema.js +63 -0
- package/dist/modules/manager/gitlabci/schema.js.map +1 -0
- package/dist/modules/manager/gitlabci-include/extract.js +6 -54
- package/dist/modules/manager/gitlabci-include/extract.js.map +1 -1
- package/dist/modules/manager/gitlabci-include/schema.d.ts +13 -0
- package/dist/modules/manager/gitlabci-include/schema.js +46 -0
- package/dist/modules/manager/gitlabci-include/schema.js.map +1 -0
- package/dist/modules/manager/glasskube/schema.d.ts +8 -8
- package/dist/modules/manager/gomod/artifacts.js +24 -10
- package/dist/modules/manager/gomod/artifacts.js.map +1 -1
- package/dist/modules/manager/gomod/extract.js +23 -0
- package/dist/modules/manager/gomod/extract.js.map +1 -1
- package/dist/modules/manager/gomod/line-parser.js +16 -0
- package/dist/modules/manager/gomod/line-parser.js.map +1 -1
- package/dist/modules/manager/gomod/update.js +2 -2
- package/dist/modules/manager/gomod/update.js.map +1 -1
- package/dist/modules/manager/gradle/artifacts.js +0 -1
- package/dist/modules/manager/gradle/artifacts.js.map +1 -1
- package/dist/modules/manager/gradle/extract/catalog.js +1 -1
- package/dist/modules/manager/gradle/extract/catalog.js.map +1 -1
- package/dist/modules/manager/gradle/parser/assignments.js +2 -2
- package/dist/modules/manager/gradle/parser/assignments.js.map +1 -1
- package/dist/modules/manager/gradle/parser/handlers.d.ts +1 -2
- package/dist/modules/manager/gradle/parser/handlers.js +10 -25
- package/dist/modules/manager/gradle/parser/handlers.js.map +1 -1
- package/dist/modules/manager/gradle/parser/registry-urls.js +11 -3
- package/dist/modules/manager/gradle/parser/registry-urls.js.map +1 -1
- package/dist/modules/manager/gradle-wrapper/artifacts.js +1 -2
- package/dist/modules/manager/gradle-wrapper/artifacts.js.map +1 -1
- package/dist/modules/manager/helmfile/artifacts.js +0 -1
- package/dist/modules/manager/helmfile/artifacts.js.map +1 -1
- package/dist/modules/manager/helmfile/extract.js +4 -0
- package/dist/modules/manager/helmfile/extract.js.map +1 -1
- package/dist/modules/manager/helmfile/schema.d.ts +9 -9
- package/dist/modules/manager/helmv3/artifacts.js +0 -1
- package/dist/modules/manager/helmv3/artifacts.js.map +1 -1
- package/dist/modules/manager/helmv3/utils.js +3 -1
- package/dist/modules/manager/helmv3/utils.js.map +1 -1
- package/dist/modules/manager/hermit/artifacts.js +0 -1
- package/dist/modules/manager/hermit/artifacts.js.map +1 -1
- package/dist/modules/manager/homebrew/extract.js +0 -1
- package/dist/modules/manager/homebrew/extract.js.map +1 -1
- package/dist/modules/manager/jsonnet-bundler/artifacts.js +0 -1
- package/dist/modules/manager/jsonnet-bundler/artifacts.js.map +1 -1
- package/dist/modules/manager/kustomize/artifacts.d.ts +2 -0
- package/dist/modules/manager/kustomize/artifacts.js +154 -0
- package/dist/modules/manager/kustomize/artifacts.js.map +1 -0
- package/dist/modules/manager/kustomize/common.d.ts +3 -0
- package/dist/modules/manager/kustomize/common.js +22 -0
- package/dist/modules/manager/kustomize/common.js.map +1 -0
- package/dist/modules/manager/kustomize/index.d.ts +1 -0
- package/dist/modules/manager/kustomize/index.js +3 -1
- package/dist/modules/manager/kustomize/index.js.map +1 -1
- package/dist/modules/manager/kustomize/types.d.ts +4 -0
- package/dist/modules/manager/kustomize/types.js.map +1 -1
- package/dist/modules/manager/maven/extract.js +3 -1
- package/dist/modules/manager/maven/extract.js.map +1 -1
- package/dist/modules/manager/maven-wrapper/artifacts.js +0 -1
- package/dist/modules/manager/maven-wrapper/artifacts.js.map +1 -1
- package/dist/modules/manager/mise/extract.js +1 -1
- package/dist/modules/manager/mise/extract.js.map +1 -1
- package/dist/modules/manager/mix/artifacts.js +64 -14
- package/dist/modules/manager/mix/artifacts.js.map +1 -1
- package/dist/modules/manager/mix/index.d.ts +1 -0
- package/dist/modules/manager/mix/index.js +2 -1
- package/dist/modules/manager/mix/index.js.map +1 -1
- package/dist/modules/manager/nix/artifacts.js +0 -1
- package/dist/modules/manager/nix/artifacts.js.map +1 -1
- package/dist/modules/manager/nix/extract.js +1 -1
- package/dist/modules/manager/nix/extract.js.map +1 -1
- package/dist/modules/manager/nix/schema.d.ts +18 -18
- package/dist/modules/manager/npm/artifacts.js +0 -1
- package/dist/modules/manager/npm/artifacts.js.map +1 -1
- package/dist/modules/manager/npm/extract/yarn.js +2 -2
- package/dist/modules/manager/npm/extract/yarn.js.map +1 -1
- package/dist/modules/manager/npm/post-update/npm.js +0 -1
- package/dist/modules/manager/npm/post-update/npm.js.map +1 -1
- package/dist/modules/manager/npm/post-update/pnpm.js +13 -2
- package/dist/modules/manager/npm/post-update/pnpm.js.map +1 -1
- package/dist/modules/manager/npm/post-update/rules.js +11 -1
- package/dist/modules/manager/npm/post-update/rules.js.map +1 -1
- package/dist/modules/manager/npm/post-update/yarn.js +0 -1
- package/dist/modules/manager/npm/post-update/yarn.js.map +1 -1
- package/dist/modules/manager/npm/schema.d.ts +13 -13
- package/dist/modules/manager/npm/update/dependency/index.js +1 -1
- package/dist/modules/manager/npm/update/dependency/index.js.map +1 -1
- package/dist/modules/manager/nuget/artifacts.js +1 -2
- package/dist/modules/manager/nuget/artifacts.js.map +1 -1
- package/dist/modules/manager/nuget/package-tree.js +4 -0
- package/dist/modules/manager/nuget/package-tree.js.map +1 -1
- package/dist/modules/manager/nuget/schema.d.ts +8 -8
- package/dist/modules/manager/nuget/util.js +4 -1
- package/dist/modules/manager/nuget/util.js.map +1 -1
- package/dist/modules/manager/ocb/schema.d.ts +6 -6
- package/dist/modules/manager/pep621/processors/pdm.js +0 -1
- package/dist/modules/manager/pep621/processors/pdm.js.map +1 -1
- package/dist/modules/manager/pep621/processors/uv.js +0 -1
- package/dist/modules/manager/pep621/processors/uv.js.map +1 -1
- package/dist/modules/manager/pep621/schema.d.ts +59 -54
- package/dist/modules/manager/pep621/schema.js +2 -0
- package/dist/modules/manager/pep621/schema.js.map +1 -1
- package/dist/modules/manager/pep621/utils.js +1 -1
- package/dist/modules/manager/pep621/utils.js.map +1 -1
- package/dist/modules/manager/pip-compile/common.js +0 -1
- package/dist/modules/manager/pip-compile/common.js.map +1 -1
- package/dist/modules/manager/pip_requirements/artifacts.js +0 -1
- package/dist/modules/manager/pip_requirements/artifacts.js.map +1 -1
- package/dist/modules/manager/pipenv/artifacts.js +0 -1
- package/dist/modules/manager/pipenv/artifacts.js.map +1 -1
- package/dist/modules/manager/pixi/artifacts.d.ts +3 -0
- package/dist/modules/manager/pixi/artifacts.js +84 -0
- package/dist/modules/manager/pixi/artifacts.js.map +1 -0
- package/dist/modules/manager/pixi/extract.d.ts +2 -0
- package/dist/modules/manager/pixi/extract.js +53 -0
- package/dist/modules/manager/pixi/extract.js.map +1 -0
- package/dist/modules/manager/pixi/index.d.ts +11 -0
- package/dist/modules/manager/pixi/index.js +22 -0
- package/dist/modules/manager/pixi/index.js.map +1 -0
- package/dist/modules/manager/pixi/lockfile.d.ts +6 -0
- package/dist/modules/manager/pixi/lockfile.js +25 -0
- package/dist/modules/manager/pixi/lockfile.js.map +1 -0
- package/dist/modules/manager/pixi/schema.d.ts +14 -0
- package/dist/modules/manager/pixi/schema.js +14 -0
- package/dist/modules/manager/pixi/schema.js.map +1 -0
- package/dist/modules/manager/poetry/artifacts.js +3 -4
- package/dist/modules/manager/poetry/artifacts.js.map +1 -1
- package/dist/modules/manager/poetry/extract.js +2 -1
- package/dist/modules/manager/poetry/extract.js.map +1 -1
- package/dist/modules/manager/poetry/schema.d.ts +48 -48
- package/dist/modules/manager/pub/artifacts.js +0 -1
- package/dist/modules/manager/pub/artifacts.js.map +1 -1
- package/dist/modules/manager/pub/schema.d.ts +8 -8
- package/dist/modules/manager/scalafmt/extract.js +1 -1
- package/dist/modules/manager/scalafmt/extract.js.map +1 -1
- package/dist/modules/manager/sveltos/schema.d.ts +12 -12
- package/dist/modules/manager/terraform/lockfile/hash.d.ts +1 -1
- package/dist/modules/manager/types.d.ts +6 -2
- package/dist/modules/manager/types.js.map +1 -1
- package/dist/modules/manager/vendir/schema.d.ts +4 -4
- package/dist/modules/platform/api.d.ts +1 -1
- package/dist/modules/platform/azure/azure-helper.js +2 -2
- package/dist/modules/platform/azure/azure-helper.js.map +1 -1
- package/dist/modules/platform/azure/index.js +14 -14
- package/dist/modules/platform/azure/index.js.map +1 -1
- package/dist/modules/platform/bitbucket/comments.js +4 -4
- package/dist/modules/platform/bitbucket/comments.js.map +1 -1
- package/dist/modules/platform/bitbucket/index.d.ts +1 -0
- package/dist/modules/platform/bitbucket/index.js +54 -44
- package/dist/modules/platform/bitbucket/index.js.map +1 -1
- package/dist/modules/platform/bitbucket/schema.d.ts +11 -11
- package/dist/modules/platform/bitbucket/utils.js +3 -3
- package/dist/modules/platform/bitbucket/utils.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/index.d.ts +3 -3
- package/dist/modules/platform/bitbucket-server/index.js +81 -81
- package/dist/modules/platform/bitbucket-server/index.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/pr-cache.d.ts +23 -0
- package/dist/modules/platform/bitbucket-server/pr-cache.js +125 -0
- package/dist/modules/platform/bitbucket-server/pr-cache.js.map +1 -0
- package/dist/modules/platform/bitbucket-server/schema.d.ts +75 -0
- package/dist/modules/platform/bitbucket-server/schema.js +14 -1
- package/dist/modules/platform/bitbucket-server/schema.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/types.d.ts +8 -2
- package/dist/modules/platform/bitbucket-server/types.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/utils.d.ts +0 -2
- package/dist/modules/platform/bitbucket-server/utils.js +6 -52
- package/dist/modules/platform/bitbucket-server/utils.js.map +1 -1
- package/dist/modules/platform/codecommit/codecommit-client.js +6 -6
- package/dist/modules/platform/codecommit/codecommit-client.js.map +1 -1
- package/dist/modules/platform/codecommit/index.js +24 -24
- package/dist/modules/platform/codecommit/index.js.map +1 -1
- package/dist/modules/platform/gerrit/client.js +13 -2
- package/dist/modules/platform/gerrit/client.js.map +1 -1
- package/dist/modules/platform/gerrit/utils.js +1 -1
- package/dist/modules/platform/gerrit/utils.js.map +1 -1
- package/dist/modules/platform/gitea/gitea-helper.d.ts +1 -0
- package/dist/modules/platform/gitea/gitea-helper.js +16 -0
- package/dist/modules/platform/gitea/gitea-helper.js.map +1 -1
- package/dist/modules/platform/gitea/index.d.ts +1 -0
- package/dist/modules/platform/gitea/index.js +26 -7
- package/dist/modules/platform/gitea/index.js.map +1 -1
- package/dist/modules/platform/gitea/schema.d.ts +8 -8
- package/dist/modules/platform/gitea/types.d.ts +1 -1
- package/dist/modules/platform/gitea/types.js.map +1 -1
- package/dist/modules/platform/github/common.d.ts +2 -0
- package/dist/modules/platform/github/common.js +16 -0
- package/dist/modules/platform/github/common.js.map +1 -1
- package/dist/modules/platform/github/index.d.ts +1 -1
- package/dist/modules/platform/github/index.js +87 -82
- package/dist/modules/platform/github/index.js.map +1 -1
- package/dist/modules/platform/github/issue.d.ts +12 -12
- package/dist/modules/platform/github/massage-markdown-links.js +2 -2
- package/dist/modules/platform/github/massage-markdown-links.js.map +1 -1
- package/dist/modules/platform/github/pr.js +3 -3
- package/dist/modules/platform/github/pr.js.map +1 -1
- package/dist/modules/platform/github/schema.d.ts +76 -76
- package/dist/modules/platform/github/schema.js +3 -1
- package/dist/modules/platform/github/schema.js.map +1 -1
- package/dist/modules/platform/gitlab/index.d.ts +1 -0
- package/dist/modules/platform/gitlab/index.js +70 -43
- package/dist/modules/platform/gitlab/index.js.map +1 -1
- package/dist/modules/platform/index.js +0 -1
- package/dist/modules/platform/index.js.map +1 -1
- package/dist/modules/platform/scm.d.ts +1 -1
- package/dist/modules/versioning/api.js +2 -0
- package/dist/modules/versioning/api.js.map +1 -1
- package/dist/modules/versioning/composer/index.js +10 -0
- package/dist/modules/versioning/composer/index.js.map +1 -1
- package/dist/modules/versioning/conda/index.d.ts +41 -0
- package/dist/modules/versioning/conda/index.js +178 -0
- package/dist/modules/versioning/conda/index.js.map +1 -0
- package/dist/modules/versioning/hashicorp/convertor.d.ts +2 -1
- package/dist/modules/versioning/hashicorp/convertor.js +13 -8
- package/dist/modules/versioning/hashicorp/convertor.js.map +1 -1
- package/dist/modules/versioning/hex/index.js +3 -3
- package/dist/modules/versioning/hex/index.js.map +1 -1
- package/dist/modules/versioning/npm/index.js +2 -1
- package/dist/modules/versioning/npm/index.js.map +1 -1
- package/dist/modules/versioning/schema.js +1 -1
- package/dist/modules/versioning/schema.js.map +1 -1
- package/dist/modules/versioning/types.d.ts +4 -0
- package/dist/modules/versioning/types.js.map +1 -1
- package/dist/proxy.js +2 -1
- package/dist/proxy.js.map +1 -1
- package/dist/renovate.js +2 -2
- package/dist/renovate.js.map +1 -1
- package/dist/util/cache/package/decorator.js +2 -2
- package/dist/util/cache/package/decorator.js.map +1 -1
- package/dist/util/cache/package/redis.js +0 -1
- package/dist/util/cache/package/redis.js.map +1 -1
- package/dist/util/cache/package/types.d.ts +1 -1
- package/dist/util/cache/package/types.js.map +1 -1
- package/dist/util/cache/repository/impl/base.d.ts +1 -1
- package/dist/util/cache/repository/schema.d.ts +4 -4
- package/dist/util/cache/repository/types.d.ts +3 -0
- package/dist/util/cache/repository/types.js.map +1 -1
- package/dist/util/env.d.ts +4 -0
- package/dist/util/env.js +22 -0
- package/dist/util/env.js.map +1 -0
- package/dist/util/exec/containerbase.js +18 -12
- package/dist/util/exec/containerbase.js.map +1 -1
- package/dist/util/exec/index.js +5 -2
- package/dist/util/exec/index.js.map +1 -1
- package/dist/util/exec/types.d.ts +0 -2
- package/dist/util/exec/types.js.map +1 -1
- package/dist/util/exec/utils.d.ts +1 -1
- package/dist/util/exec/utils.js +6 -5
- package/dist/util/exec/utils.js.map +1 -1
- package/dist/util/git/author.js +1 -1
- package/dist/util/git/author.js.map +1 -1
- package/dist/util/git/config.js +0 -1
- package/dist/util/git/config.js.map +1 -1
- package/dist/util/git/error.js +4 -2
- package/dist/util/git/error.js.map +1 -1
- package/dist/util/git/index.js +73 -46
- package/dist/util/git/index.js.map +1 -1
- package/dist/util/git/private-key.js +1 -1
- package/dist/util/git/private-key.js.map +1 -1
- package/dist/util/github/graphql/query-adapters/releases-query-adapter.d.ts +2 -2
- package/dist/util/github/graphql/query-adapters/tags-query-adapter.d.ts +2 -2
- package/dist/util/http/auth.js +0 -1
- package/dist/util/http/auth.js.map +1 -1
- package/dist/util/http/bitbucket-server.d.ts +5 -4
- package/dist/util/http/bitbucket-server.js +21 -20
- package/dist/util/http/bitbucket-server.js.map +1 -1
- package/dist/util/http/bitbucket.d.ts +6 -5
- package/dist/util/http/bitbucket.js +34 -31
- package/dist/util/http/bitbucket.js.map +1 -1
- package/dist/util/http/cache/abstract-http-cache-provider.js +2 -2
- package/dist/util/http/cache/abstract-http-cache-provider.js.map +1 -1
- package/dist/util/http/cache/memory-http-cache-provider.d.ts +10 -0
- package/dist/util/http/cache/memory-http-cache-provider.js +29 -0
- package/dist/util/http/cache/memory-http-cache-provider.js.map +1 -0
- package/dist/util/http/cache/schema.d.ts +2 -2
- package/dist/util/http/errors.d.ts +2 -0
- package/dist/util/http/errors.js +8 -0
- package/dist/util/http/errors.js.map +1 -0
- package/dist/util/http/gerrit.d.ts +6 -4
- package/dist/util/http/gerrit.js +11 -12
- package/dist/util/http/gerrit.js.map +1 -1
- package/dist/util/http/gitea.d.ts +5 -4
- package/dist/util/http/gitea.js +14 -13
- package/dist/util/http/gitea.js.map +1 -1
- package/dist/util/http/github.d.ts +14 -8
- package/dist/util/http/github.js +65 -60
- package/dist/util/http/github.js.map +1 -1
- package/dist/util/http/gitlab.d.ts +7 -5
- package/dist/util/http/gitlab.js +58 -46
- package/dist/util/http/gitlab.js.map +1 -1
- package/dist/util/http/got.d.ts +9 -0
- package/dist/util/http/got.js +54 -0
- package/dist/util/http/got.js.map +1 -0
- package/dist/util/http/host-rules.d.ts +2 -1
- package/dist/util/http/host-rules.js +5 -4
- package/dist/util/http/host-rules.js.map +1 -1
- package/dist/util/http/http.d.ts +93 -0
- package/dist/util/http/http.js +346 -0
- package/dist/util/http/http.js.map +1 -0
- package/dist/util/http/index.d.ts +6 -74
- package/dist/util/http/index.js +5 -359
- package/dist/util/http/index.js.map +1 -1
- package/dist/util/http/legacy.js +4 -1
- package/dist/util/http/legacy.js.map +1 -1
- package/dist/util/http/types.d.ts +9 -16
- package/dist/util/http/types.js.map +1 -1
- package/dist/util/stats.d.ts +10 -0
- package/dist/util/stats.js +45 -1
- package/dist/util/stats.js.map +1 -1
- package/dist/util/string.d.ts +15 -0
- package/dist/util/string.js +75 -0
- package/dist/util/string.js.map +1 -1
- package/dist/util/toml.d.ts +1 -0
- package/dist/util/toml.js +6 -0
- package/dist/util/toml.js.map +1 -1
- package/dist/util/url.js +3 -8
- package/dist/util/url.js.map +1 -1
- package/dist/util/yaml.js +2 -6
- package/dist/util/yaml.js.map +1 -1
- package/dist/workers/global/config/parse/env.js +3 -2
- package/dist/workers/global/config/parse/env.js.map +1 -1
- package/dist/workers/global/config/parse/file.js +19 -9
- package/dist/workers/global/config/parse/file.js.map +1 -1
- package/dist/workers/global/config/parse/host-rules-from-env.js +6 -2
- package/dist/workers/global/config/parse/host-rules-from-env.js.map +1 -1
- package/dist/workers/global/config/parse/index.js +5 -0
- package/dist/workers/global/config/parse/index.js.map +1 -1
- package/dist/workers/repository/cache.js +1 -2
- package/dist/workers/repository/cache.js.map +1 -1
- package/dist/workers/repository/config-migration/branch/migrated-data.js +2 -0
- package/dist/workers/repository/config-migration/branch/migrated-data.js.map +1 -1
- package/dist/workers/repository/index.js +1 -0
- package/dist/workers/repository/index.js.map +1 -1
- package/dist/workers/repository/init/merge.js +6 -3
- package/dist/workers/repository/init/merge.js.map +1 -1
- package/dist/workers/repository/onboarding/pr/config-description.js +3 -1
- package/dist/workers/repository/onboarding/pr/config-description.js.map +1 -1
- package/dist/workers/repository/process/extract-update.js +0 -1
- package/dist/workers/repository/process/extract-update.js.map +1 -1
- package/dist/workers/repository/process/fingerprint-fields.js +0 -1
- package/dist/workers/repository/process/fingerprint-fields.js.map +1 -1
- package/dist/workers/repository/process/libyear.js +2 -2
- package/dist/workers/repository/process/libyear.js.map +1 -1
- package/dist/workers/repository/process/lookup/index.js +13 -4
- package/dist/workers/repository/process/lookup/index.js.map +1 -1
- package/dist/workers/repository/process/vulnerabilities.js +1 -1
- package/dist/workers/repository/process/vulnerabilities.js.map +1 -1
- package/dist/workers/repository/process/write.js +1 -8
- package/dist/workers/repository/process/write.js.map +1 -1
- package/dist/workers/repository/reconfigure/validate.js +1 -0
- package/dist/workers/repository/reconfigure/validate.js.map +1 -1
- package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js +10 -1
- package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/bitbucket/index.js +1 -1
- package/dist/workers/repository/update/pr/changelog/bitbucket/index.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/github/index.js +6 -3
- package/dist/workers/repository/update/pr/changelog/github/index.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/gitlab/index.js +1 -1
- package/dist/workers/repository/update/pr/changelog/gitlab/index.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/source.js +1 -0
- package/dist/workers/repository/update/pr/changelog/source.js.map +1 -1
- package/dist/workers/repository/updates/flatten.js +8 -4
- package/dist/workers/repository/updates/flatten.js.map +1 -1
- package/dist/workers/repository/updates/generate.js +1 -2
- package/dist/workers/repository/updates/generate.js.map +1 -1
- package/dist/workers/types.d.ts +1 -4
- package/dist/workers/types.js.map +1 -1
- package/package.json +69 -72
- package/renovate-schema.json +15 -1
- package/dist/modules/manager/github-actions/types.d.ts +0 -30
- package/dist/modules/manager/github-actions/types.js +0 -3
- package/dist/modules/manager/github-actions/types.js.map +0 -1
- package/dist/modules/manager/gitlabci/common.d.ts +0 -6
- package/dist/modules/manager/gitlabci/common.js +0 -30
- package/dist/modules/manager/gitlabci/common.js.map +0 -1
- package/dist/modules/manager/gitlabci/types.d.ts +0 -35
- package/dist/modules/manager/gitlabci/types.js +0 -3
- package/dist/modules/manager/gitlabci/types.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/versioning/composer/index.ts"],"names":[],"mappings":";;;AAyMA,0BAEC;AAED,8BAEC;;AA/MD,kEAAkC;AAClC,4DAA4B;AAC5B,+CAA0C;AAC1C,4CAAyC;AAEzC,+CAA4C;AAC5C,gCAAoC;AAGvB,QAAA,EAAE,GAAG,UAAU,CAAC;AAChB,QAAA,WAAW,GAAG,UAAU,CAAC;AACzB,QAAA,IAAI,GAAG;IAClB,kDAAkD;IAClD,gDAAgD;IAChD,sDAAsD;IACtD,uBAAuB;CACxB,CAAC;AACW,QAAA,cAAc,GAAG,IAAI,CAAC;AACtB,QAAA,wBAAwB,GAAoB;IACvD,MAAM;IACN,OAAO;IACP,KAAK;IACL,SAAS;IACT,iBAAiB;CAClB,CAAC;AAEF,SAAS,eAAe,CAAC,KAAa;IACpC,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACrB,CAAC;IAED,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,MAAM,CAAC,MAAM,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,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC,EACpE,CAAC;QACD,mLAAmL;QACnL,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;SAAM,CAAC;QACN,mDAAmD;QACnD,OAAO,SAAG,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,OAAe;IACnC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC;AAEY,QAAA,GAAG,GAAkB;IAChC,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,aAAa;IACb,eAAe;IACf,eAAe;IACf,QAAQ;IACR,OAAO;IACP,SAAS;IACT,OAAO;IACP,oBAAoB;IACpB,oBAAoB;IACpB,WAAW;IACX,YAAY;IACZ,MAAM;CACP,CAAC;AACF,kBAAe,WAAG,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport semver from 'semver';\nimport { parseRange } from 'semver-utils';\nimport { logger } from '../../../logger';\nimport type { RangeStrategy } from '../../../types/versioning';\nimport { regEx } from '../../../util/regex';\nimport { api as npm } from '../npm';\nimport type { NewValueConfig, VersioningApi } from '../types';\n\nexport const id = 'composer';\nexport const displayName = 'Composer';\nexport const urls = [\n 'https://getcomposer.org/doc/articles/versions.md',\n 'https://packagist.org/packages/composer/semver',\n 'https://madewithlove.be/tilde-and-caret-constraints/',\n 'https://semver.mwl.be',\n];\nexport const supportsRanges = true;\nexport const supportedRangeStrategies: RangeStrategy[] = [\n 'bump',\n 'widen',\n 'pin',\n 'replace',\n 'update-lockfile',\n];\n\nfunction getVersionParts(input: string): [string, string] {\n const versionParts = input.split('-');\n if (versionParts.length === 1) {\n return [input, ''];\n }\n\n return [versionParts[0], '-' + versionParts[1]];\n}\n\nfunction padZeroes(input: string): string {\n const [output, stability] = getVersionParts(input);\n\n const sections = output.split('.');\n while (sections.length < 3) {\n sections.push('0');\n }\n return sections.join('.') + stability;\n}\n\nfunction convertStabilityModifier(input: string): string {\n // Handle stability modifiers.\n const versionParts = input.split('@');\n if (versionParts.length === 1) {\n return input;\n }\n\n // 1.0@beta2 to 1.0-beta.2\n const stability = versionParts[1].replace(\n regEx(/(?:^|\\s)(beta|alpha|rc)([1-9][0-9]*)(?: |$)/gi),\n '$1.$2',\n );\n\n // If there is a stability part, npm semver expects the version\n // to be full\n return padZeroes(versionParts[0]) + '-' + stability;\n}\n\nfunction normalizeVersion(input: string): string {\n let output = input;\n output = output.replace(regEx(/(^|>|>=|\\^|~)v/i), '$1');\n return convertStabilityModifier(output);\n}\n\n/**\n * @param versions Version list in any format, it recognizes the specific patch format x.x.x-pXX\n * @param range Range in composer format\n * @param minMode If true, it will calculate minSatisfyingVersion, if false, it calculates the maxSatisfyingVersion\n * @returns min or max satisfyingVersion from the input\n */\nfunction calculateSatisfyingVersionIntenal(\n versions: string[],\n range: string,\n minMode: boolean,\n): string | null {\n // Because composer -p versions are considered stable, we have to remove the suffix for the npm.XXX functions.\n const versionsMapped = versions.map((x) => {\n return {\n origianl: x,\n cleaned: removeComposerSpecificPatchPart(x),\n npmVariant: composer2npm(removeComposerSpecificPatchPart(x)[0]),\n };\n });\n\n const npmVersions = versionsMapped.map((x) => x.npmVariant);\n const npmVersion = minMode\n ? npm.minSatisfyingVersion(npmVersions, composer2npm(range))\n : npm.getSatisfyingVersion(npmVersions, composer2npm(range));\n\n if (!npmVersion) {\n return null;\n }\n\n // After we find the npm versions, we select from them back in the mapping the possible patches.\n const candidates = versionsMapped\n .filter((x) => x.npmVariant === npmVersion)\n .sort((a, b) => (minMode ? 1 : -1) * sortVersions(a.origianl, b.origianl));\n\n return candidates[0].origianl;\n}\n\n/**\n * @param intput Version in any format, it recognizes the specific patch format x.x.x-pXX\n * @returns If input contains the specific patch, it returns the input with removed the patch and true, otherwise it retunrs the same string and false.\n */\nfunction removeComposerSpecificPatchPart(input: string): [string, boolean] {\n // the regex is based on the original from composer implementation https://github.com/composer/semver/blob/fa1ec24f0ab1efe642671ec15c51a3ab879f59bf/src/VersionParser.php#L137\n const pattern = /^v?\\d+(\\.\\d+(\\.\\d+(\\.\\d+)?)?)?(?<suffix>-p[1-9]\\d*)$/gi;\n const match = pattern.exec(input);\n\n return match\n ? [input.replace(match.groups!.suffix, ''), true]\n : [input, false];\n}\n\nfunction composer2npm(input: string): string {\n return input\n .split(regEx(/\\s*\\|\\|?\\s*/g))\n .map((part): string => {\n const cleanInput = normalizeVersion(part);\n if (npm.isVersion(cleanInput)) {\n return cleanInput;\n }\n if (npm.isVersion(padZeroes(cleanInput))) {\n return padZeroes(cleanInput);\n }\n const [versionId, stability] = getVersionParts(cleanInput);\n let output = versionId;\n\n // ~4 to ^4 and ~4.1 to ^4.1\n output = output.replace(\n regEx(/(?:^|\\s)~([1-9][0-9]*(?:\\.[0-9]*)?)(?: |$)/g),\n '^$1',\n );\n // ~0.4 to >=0.4 <1\n output = output.replace(\n regEx(/(?:^|\\s)~(0\\.[1-9][0-9]*)(?: |$)/g),\n '>=$1 <1',\n );\n\n // add extra digits to <8-DEV and <8.0-DEV\n output = output\n .replace(regEx(/^(<\\d+(\\.\\d+)?)$/g), '$1.0')\n .replace(regEx(/^(<\\d+(\\.\\d+)?)$/g), '$1.0');\n\n return output + stability;\n })\n .map((part) => part.replace(/([a-z])([0-9])/gi, '$1.$2'))\n .join(' || ');\n}\n\nfunction equals(a: string, b: string): boolean {\n return npm.equals(composer2npm(a), composer2npm(b));\n}\n\nfunction getMajor(version: string): number | null {\n const semverVersion = semver.coerce(composer2npm(version));\n return semverVersion ? npm.getMajor(semverVersion) : null;\n}\n\nfunction getMinor(version: string): number | null {\n const semverVersion = semver.coerce(composer2npm(version));\n return semverVersion ? npm.getMinor(semverVersion) : null;\n}\n\nfunction getPatch(version: string): number | null {\n const semverVersion = semver.coerce(composer2npm(version));\n\n // This returns only the numbers without the optional `-pXX` patch version supported by composer. Fixing that would require a bigger\n // refactoring, because the API supports only numbers.\n return semverVersion ? npm.getPatch(semverVersion) : null;\n}\n\nfunction isGreaterThan(a: string, b: string): boolean {\n return sortVersions(a, b) === 1;\n}\n\nfunction isLessThanRange(version: string, range: string): boolean {\n return !!npm.isLessThanRange?.(composer2npm(version), composer2npm(range));\n}\n\nfunction isSingleVersion(input: string): boolean {\n return !!input && npm.isSingleVersion(composer2npm(input));\n}\n\nfunction isStable(version: string): boolean {\n if (version) {\n // Composer considers patches `-pXX` as stable: https://github.com/composer/semver/blob/fa1ec24f0ab1efe642671ec15c51a3ab879f59bf/src/VersionParser.php#L568 but npm not.\n // In order to be able to use the standard npm.isStable function, we remove the potential patch version for the check.\n const [withoutPatch] = removeComposerSpecificPatchPart(version);\n return npm.isStable(composer2npm(withoutPatch));\n }\n\n return false;\n}\n\nexport function isValid(input: string): boolean {\n return !!input && npm.isValid(composer2npm(input));\n}\n\nexport function isVersion(input: string): boolean {\n return !!input && npm.isVersion(composer2npm(input));\n}\n\nfunction matches(version: string, range: string): boolean {\n return npm.matches(composer2npm(version), composer2npm(range));\n}\n\nfunction getSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n return calculateSatisfyingVersionIntenal(versions, range, false);\n}\n\nfunction minSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n return calculateSatisfyingVersionIntenal(versions, range, true);\n}\n\nfunction subset(subRange: string, superRange: string): boolean | undefined {\n try {\n return npm.subset!(composer2npm(subRange), composer2npm(superRange));\n } catch (err) {\n logger.trace({ err }, 'composer.subset error');\n return false;\n }\n}\n\nfunction getNewValue({\n currentValue,\n rangeStrategy,\n currentVersion,\n newVersion,\n}: NewValueConfig): string | null {\n if (rangeStrategy === 'pin') {\n return newVersion;\n }\n if (rangeStrategy === 'update-lockfile') {\n if (matches(newVersion, currentValue)) {\n return currentValue;\n }\n return getNewValue({\n currentValue,\n rangeStrategy: 'replace',\n currentVersion,\n newVersion,\n });\n }\n const currentMajor = currentVersion ? getMajor(currentVersion) : null;\n const toMajor = getMajor(newVersion);\n const toMinor = getMinor(newVersion);\n let newValue: string | null = null;\n if (isVersion(currentValue)) {\n newValue = newVersion;\n } else if (regEx(/^[~^](0\\.[1-9][0-9]*)$/).test(currentValue)) {\n const operator = currentValue.substring(0, 1);\n // handle ~0.4 case first\n if (toMajor === 0) {\n // TODO: types (#22198)\n newValue = `${operator}0.${toMinor!}`;\n } else {\n // TODO: types (#22198)\n newValue = `${operator}${toMajor!}.0`;\n }\n } else if (regEx(/^[~^]([0-9]*)$/).test(currentValue)) {\n // handle ~4 case\n const operator = currentValue.substring(0, 1);\n // TODO: types (#22198)\n newValue = `${operator}${toMajor!}`;\n } else if (\n toMajor &&\n regEx(/^[~^]([0-9]*(?:\\.[0-9]*)?)$/).test(currentValue)\n ) {\n const operator = currentValue.substring(0, 1);\n if (rangeStrategy === 'bump') {\n newValue = `${operator}${newVersion}`;\n } else if (\n (is.number(currentMajor) && toMajor > currentMajor) ||\n !toMinor\n ) {\n // handle ~4.1 case\n newValue = `${operator}${toMajor}.0`;\n } else {\n newValue = `${operator}${toMajor}.${toMinor}`;\n }\n } else if (\n currentVersion &&\n npm.isVersion(padZeroes(normalizeVersion(newVersion))) &&\n npm.isValid(normalizeVersion(currentValue)) &&\n composer2npm(currentValue) === normalizeVersion(currentValue)\n ) {\n newValue = npm.getNewValue({\n currentValue: normalizeVersion(currentValue),\n rangeStrategy,\n currentVersion: padZeroes(normalizeVersion(currentVersion)),\n newVersion: padZeroes(normalizeVersion(newVersion)),\n });\n }\n\n if (rangeStrategy === 'widen' && matches(newVersion, currentValue)) {\n newValue = currentValue;\n } else {\n const hasOr = currentValue.includes(' || ');\n if (hasOr || rangeStrategy === 'widen') {\n const splitValues = currentValue.split('||');\n const lastValue = splitValues[splitValues.length - 1];\n const replacementValue = getNewValue({\n currentValue: lastValue.trim(),\n rangeStrategy: 'replace',\n currentVersion,\n newVersion,\n });\n if (rangeStrategy === 'replace') {\n newValue = replacementValue;\n } else if (replacementValue) {\n const parsedRange = parseRange(replacementValue);\n const element = parsedRange[parsedRange.length - 1];\n if (element.operator?.startsWith('<')) {\n const splitCurrent = currentValue.split(element.operator);\n splitCurrent.pop();\n newValue = splitCurrent.join(element.operator) + replacementValue;\n } else {\n newValue = currentValue + ' || ' + replacementValue;\n }\n }\n }\n }\n\n if (!newValue) {\n logger.warn(\n { currentValue, rangeStrategy, currentVersion, newVersion },\n 'Unsupported composer value',\n );\n newValue = newVersion;\n }\n if (currentValue.split('.')[0].includes('v')) {\n newValue = newValue.replace(regEx(/([0-9])/), 'v$1');\n }\n\n // Preserve original min-stability specifier\n if (currentValue.includes('@')) {\n newValue += '@' + currentValue.split('@')[1];\n }\n\n return newValue;\n}\n\nfunction sortVersions(a: string, b: string): number {\n const [aWithoutPatch, aContainsPatch] = removeComposerSpecificPatchPart(a);\n const [bWithoutPatch, bContainsPatch] = removeComposerSpecificPatchPart(b);\n\n if (aContainsPatch === bContainsPatch) {\n // If both [a and b] contain patch version or both [a and b] do not contain patch version, then npm comparison deliveres correct results\n return npm.sortVersions(composer2npm(a), composer2npm(b));\n } else if (\n npm.equals(composer2npm(aWithoutPatch), composer2npm(bWithoutPatch))\n ) {\n // If only one [a or b] contains patch version and the parts without patch versions are equal, then the version with patch is greater (this is the case where npm comparison fails)\n return aContainsPatch ? 1 : -1;\n } else {\n // All other cases can be compared correctly by npm\n return npm.sortVersions(composer2npm(a), composer2npm(b));\n }\n}\n\nfunction isCompatible(version: string): boolean {\n return isVersion(version);\n}\n\nexport const api: VersioningApi = {\n equals,\n getMajor,\n getMinor,\n getPatch,\n isCompatible,\n isGreaterThan,\n isLessThanRange,\n isSingleVersion,\n isStable,\n isValid,\n isVersion,\n matches,\n getSatisfyingVersion,\n minSatisfyingVersion,\n getNewValue,\n sortVersions,\n subset,\n};\nexport default api;\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":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ACD,mLAAmL;QACnL,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;SAAM,CAAC;QACN,mDAAmD;QACnD,OAAO,SAAG,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,OAAe;IACnC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC;AAEY,QAAA,GAAG,GAAkB;IAChC,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,aAAa;IACb,eAAe;IACf,eAAe;IACf,QAAQ;IACR,OAAO;IACP,SAAS;IACT,OAAO;IACP,oBAAoB;IACpB,oBAAoB;IACpB,WAAW;IACX,YAAY;IACZ,MAAM;IACN,UAAU;CACX,CAAC;AACF,kBAAe,WAAG,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport semver from 'semver';\nimport { parseRange } from 'semver-utils';\nimport { logger } from '../../../logger';\nimport type { RangeStrategy } from '../../../types/versioning';\nimport { regEx } from '../../../util/regex';\nimport { api as npm } from '../npm';\nimport type { NewValueConfig, VersioningApi } from '../types';\n\nexport const id = 'composer';\nexport const displayName = 'Composer';\nexport const urls = [\n 'https://getcomposer.org/doc/articles/versions.md',\n 'https://packagist.org/packages/composer/semver',\n 'https://madewithlove.be/tilde-and-caret-constraints/',\n 'https://semver.mwl.be',\n];\nexport const supportsRanges = true;\nexport const supportedRangeStrategies: RangeStrategy[] = [\n 'bump',\n 'widen',\n 'pin',\n 'replace',\n 'update-lockfile',\n];\n\nfunction getVersionParts(input: string): [string, string] {\n const versionParts = input.split('-');\n if (versionParts.length === 1) {\n return [input, ''];\n }\n\n return [versionParts[0], '-' + versionParts[1]];\n}\n\nfunction padZeroes(input: string): string {\n const [output, stability] = getVersionParts(input);\n\n const sections = output.split('.');\n while (sections.length < 3) {\n sections.push('0');\n }\n return sections.join('.') + stability;\n}\n\nfunction convertStabilityModifier(input: string): string {\n // Handle stability modifiers.\n const versionParts = input.split('@');\n if (versionParts.length === 1) {\n return input;\n }\n\n // 1.0@beta2 to 1.0-beta.2\n const stability = versionParts[1].replace(\n regEx(/(?:^|\\s)(beta|alpha|rc)([1-9][0-9]*)(?: |$)/gi),\n '$1.$2',\n );\n\n // If there is a stability part, npm semver expects the version\n // to be full\n return padZeroes(versionParts[0]) + '-' + stability;\n}\n\nfunction normalizeVersion(input: string): string {\n let output = input;\n output = output.replace(regEx(/(^|>|>=|\\^|~)v/i), '$1');\n return convertStabilityModifier(output);\n}\n\n/**\n * @param versions Version list in any format, it recognizes the specific patch format x.x.x-pXX\n * @param range Range in composer format\n * @param minMode If true, it will calculate minSatisfyingVersion, if false, it calculates the maxSatisfyingVersion\n * @returns min or max satisfyingVersion from the input\n */\nfunction calculateSatisfyingVersionIntenal(\n versions: string[],\n range: string,\n minMode: boolean,\n): string | null {\n // Because composer -p versions are considered stable, we have to remove the suffix for the npm.XXX functions.\n const versionsMapped = versions.map((x) => {\n return {\n origianl: x,\n cleaned: removeComposerSpecificPatchPart(x),\n npmVariant: composer2npm(removeComposerSpecificPatchPart(x)[0]),\n };\n });\n\n const npmVersions = versionsMapped.map((x) => x.npmVariant);\n const npmVersion = minMode\n ? npm.minSatisfyingVersion(npmVersions, composer2npm(range))\n : npm.getSatisfyingVersion(npmVersions, composer2npm(range));\n\n if (!npmVersion) {\n return null;\n }\n\n // After we find the npm versions, we select from them back in the mapping the possible patches.\n const candidates = versionsMapped\n .filter((x) => x.npmVariant === npmVersion)\n .sort((a, b) => (minMode ? 1 : -1) * sortVersions(a.origianl, b.origianl));\n\n return candidates[0].origianl;\n}\n\n/**\n * @param intput Version in any format, it recognizes the specific patch format x.x.x-pXX\n * @returns If input contains the specific patch, it returns the input with removed the patch and true, otherwise it retunrs the same string and false.\n */\nfunction removeComposerSpecificPatchPart(input: string): [string, boolean] {\n // the regex is based on the original from composer implementation https://github.com/composer/semver/blob/fa1ec24f0ab1efe642671ec15c51a3ab879f59bf/src/VersionParser.php#L137\n const pattern = /^v?\\d+(\\.\\d+(\\.\\d+(\\.\\d+)?)?)?(?<suffix>-p[1-9]\\d*)$/gi;\n const match = pattern.exec(input);\n\n return match\n ? [input.replace(match.groups!.suffix, ''), true]\n : [input, false];\n}\n\nfunction composer2npm(input: string): string {\n return input\n .split(regEx(/\\s*\\|\\|?\\s*/g))\n .map((part): string => {\n const cleanInput = normalizeVersion(part);\n if (npm.isVersion(cleanInput)) {\n return cleanInput;\n }\n if (npm.isVersion(padZeroes(cleanInput))) {\n return padZeroes(cleanInput);\n }\n const [versionId, stability] = getVersionParts(cleanInput);\n let output = versionId;\n\n // ~4 to ^4 and ~4.1 to ^4.1\n output = output.replace(\n regEx(/(?:^|\\s)~([1-9][0-9]*(?:\\.[0-9]*)?)(?: |$)/g),\n '^$1',\n );\n // ~0.4 to >=0.4 <1\n output = output.replace(\n regEx(/(?:^|\\s)~(0\\.[1-9][0-9]*)(?: |$)/g),\n '>=$1 <1',\n );\n\n // add extra digits to <8-DEV and <8.0-DEV\n output = output\n .replace(regEx(/^(<\\d+(\\.\\d+)?)$/g), '$1.0')\n .replace(regEx(/^(<\\d+(\\.\\d+)?)$/g), '$1.0');\n\n return output + stability;\n })\n .map((part) => part.replace(/([a-z])([0-9])/gi, '$1.$2'))\n .join(' || ');\n}\n\nfunction equals(a: string, b: string): boolean {\n return npm.equals(composer2npm(a), composer2npm(b));\n}\n\nfunction getMajor(version: string): number | null {\n const semverVersion = semver.coerce(composer2npm(version));\n return semverVersion ? npm.getMajor(semverVersion) : null;\n}\n\nfunction getMinor(version: string): number | null {\n const semverVersion = semver.coerce(composer2npm(version));\n return semverVersion ? npm.getMinor(semverVersion) : null;\n}\n\nfunction getPatch(version: string): number | null {\n const semverVersion = semver.coerce(composer2npm(version));\n\n // This returns only the numbers without the optional `-pXX` patch version supported by composer. Fixing that would require a bigger\n // refactoring, because the API supports only numbers.\n return semverVersion ? npm.getPatch(semverVersion) : null;\n}\n\nfunction isGreaterThan(a: string, b: string): boolean {\n return sortVersions(a, b) === 1;\n}\n\nfunction isLessThanRange(version: string, range: string): boolean {\n return !!npm.isLessThanRange?.(composer2npm(version), composer2npm(range));\n}\n\nfunction isSingleVersion(input: string): boolean {\n return !!input && npm.isSingleVersion(composer2npm(input));\n}\n\nfunction isStable(version: string): boolean {\n if (version) {\n // Composer considers patches `-pXX` as stable: https://github.com/composer/semver/blob/fa1ec24f0ab1efe642671ec15c51a3ab879f59bf/src/VersionParser.php#L568 but npm not.\n // In order to be able to use the standard npm.isStable function, we remove the potential patch version for the check.\n const [withoutPatch] = removeComposerSpecificPatchPart(version);\n return npm.isStable(composer2npm(withoutPatch));\n }\n\n return false;\n}\n\nexport function isValid(input: string): boolean {\n return !!input && npm.isValid(composer2npm(input));\n}\n\nexport function isVersion(input: string): boolean {\n return !!input && npm.isVersion(composer2npm(input));\n}\n\nfunction matches(version: string, range: string): boolean {\n return npm.matches(composer2npm(version), composer2npm(range));\n}\n\nfunction getSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n return calculateSatisfyingVersionIntenal(versions, range, false);\n}\n\nfunction minSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n return calculateSatisfyingVersionIntenal(versions, range, true);\n}\n\nfunction subset(subRange: string, superRange: string): boolean | undefined {\n try {\n return npm.subset!(composer2npm(subRange), composer2npm(superRange));\n } catch (err) {\n logger.trace({ err }, 'composer.subset error');\n return false;\n }\n}\n\nfunction intersects(subRange: string, superRange: string): boolean {\n try {\n return npm.intersects!(composer2npm(subRange), composer2npm(superRange));\n } catch (err) {\n logger.trace({ err }, 'composer.intersects error');\n return false;\n }\n}\n\nfunction getNewValue({\n currentValue,\n rangeStrategy,\n currentVersion,\n newVersion,\n}: NewValueConfig): string | null {\n if (rangeStrategy === 'pin') {\n return newVersion;\n }\n if (rangeStrategy === 'update-lockfile') {\n if (matches(newVersion, currentValue)) {\n return currentValue;\n }\n return getNewValue({\n currentValue,\n rangeStrategy: 'replace',\n currentVersion,\n newVersion,\n });\n }\n const currentMajor = currentVersion ? getMajor(currentVersion) : null;\n const toMajor = getMajor(newVersion);\n const toMinor = getMinor(newVersion);\n let newValue: string | null = null;\n if (isVersion(currentValue)) {\n newValue = newVersion;\n } else if (regEx(/^[~^](0\\.[1-9][0-9]*)$/).test(currentValue)) {\n const operator = currentValue.substring(0, 1);\n // handle ~0.4 case first\n if (toMajor === 0) {\n // TODO: types (#22198)\n newValue = `${operator}0.${toMinor!}`;\n } else {\n // TODO: types (#22198)\n newValue = `${operator}${toMajor!}.0`;\n }\n } else if (regEx(/^[~^]([0-9]*)$/).test(currentValue)) {\n // handle ~4 case\n const operator = currentValue.substring(0, 1);\n // TODO: types (#22198)\n newValue = `${operator}${toMajor!}`;\n } else if (\n toMajor &&\n regEx(/^[~^]([0-9]*(?:\\.[0-9]*)?)$/).test(currentValue)\n ) {\n const operator = currentValue.substring(0, 1);\n if (rangeStrategy === 'bump') {\n newValue = `${operator}${newVersion}`;\n } else if (\n (is.number(currentMajor) && toMajor > currentMajor) ||\n !toMinor\n ) {\n // handle ~4.1 case\n newValue = `${operator}${toMajor}.0`;\n } else {\n newValue = `${operator}${toMajor}.${toMinor}`;\n }\n } else if (\n currentVersion &&\n npm.isVersion(padZeroes(normalizeVersion(newVersion))) &&\n npm.isValid(normalizeVersion(currentValue)) &&\n composer2npm(currentValue) === normalizeVersion(currentValue)\n ) {\n newValue = npm.getNewValue({\n currentValue: normalizeVersion(currentValue),\n rangeStrategy,\n currentVersion: padZeroes(normalizeVersion(currentVersion)),\n newVersion: padZeroes(normalizeVersion(newVersion)),\n });\n }\n\n if (rangeStrategy === 'widen' && matches(newVersion, currentValue)) {\n newValue = currentValue;\n } else {\n const hasOr = currentValue.includes(' || ');\n if (hasOr || rangeStrategy === 'widen') {\n const splitValues = currentValue.split('||');\n const lastValue = splitValues[splitValues.length - 1];\n const replacementValue = getNewValue({\n currentValue: lastValue.trim(),\n rangeStrategy: 'replace',\n currentVersion,\n newVersion,\n });\n if (rangeStrategy === 'replace') {\n newValue = replacementValue;\n } else if (replacementValue) {\n const parsedRange = parseRange(replacementValue);\n const element = parsedRange[parsedRange.length - 1];\n if (element.operator?.startsWith('<')) {\n const splitCurrent = currentValue.split(element.operator);\n splitCurrent.pop();\n newValue = splitCurrent.join(element.operator) + replacementValue;\n } else {\n newValue = currentValue + ' || ' + replacementValue;\n }\n }\n }\n }\n\n if (!newValue) {\n logger.warn(\n { currentValue, rangeStrategy, currentVersion, newVersion },\n 'Unsupported composer value',\n );\n newValue = newVersion;\n }\n if (currentValue.split('.')[0].includes('v')) {\n newValue = newValue.replace(regEx(/([0-9])/), 'v$1');\n }\n\n // Preserve original min-stability specifier\n if (currentValue.includes('@')) {\n newValue += '@' + currentValue.split('@')[1];\n }\n\n return newValue;\n}\n\nfunction sortVersions(a: string, b: string): number {\n const [aWithoutPatch, aContainsPatch] = removeComposerSpecificPatchPart(a);\n const [bWithoutPatch, bContainsPatch] = removeComposerSpecificPatchPart(b);\n\n if (aContainsPatch === bContainsPatch) {\n // If both [a and b] contain patch version or both [a and b] do not contain patch version, then npm comparison deliveres correct results\n return npm.sortVersions(composer2npm(a), composer2npm(b));\n } else if (\n npm.equals(composer2npm(aWithoutPatch), composer2npm(bWithoutPatch))\n ) {\n // If only one [a or b] contains patch version and the parts without patch versions are equal, then the version with patch is greater (this is the case where npm comparison fails)\n return aContainsPatch ? 1 : -1;\n } else {\n // All other cases can be compared correctly by npm\n return npm.sortVersions(composer2npm(a), composer2npm(b));\n }\n}\n\nfunction isCompatible(version: string): boolean {\n return isVersion(version);\n}\n\nexport const api: VersioningApi = {\n equals,\n getMajor,\n getMinor,\n getPatch,\n isCompatible,\n isGreaterThan,\n isLessThanRange,\n isSingleVersion,\n isStable,\n isValid,\n isVersion,\n matches,\n getSatisfyingVersion,\n minSatisfyingVersion,\n getNewValue,\n sortVersions,\n subset,\n intersects,\n};\nexport default api;\n"]}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import type { SemVer } from 'semver';
|
2
|
+
import type { RangeStrategy } from '../../../types/versioning';
|
3
|
+
import type { NewValueConfig } from '../types';
|
4
|
+
export declare const id = "conda";
|
5
|
+
export declare const displayName = "conda";
|
6
|
+
export declare const urls: string[];
|
7
|
+
export declare const supportsRanges = true;
|
8
|
+
export declare const supportedRangeStrategies: RangeStrategy[];
|
9
|
+
declare function isValidVersion(s: string): boolean;
|
10
|
+
declare function isValid(input: string): boolean;
|
11
|
+
declare function matches(version: string, range: string): boolean;
|
12
|
+
declare function isSingleVersion(input: string): boolean;
|
13
|
+
declare function getNewValue({ currentValue, rangeStrategy, currentVersion, newVersion, isReplacement, }: NewValueConfig): string | null;
|
14
|
+
declare function sortVersions(version: string, other: string): number;
|
15
|
+
declare function equals(version: string, other: string): boolean;
|
16
|
+
declare function isStable(version: string): boolean;
|
17
|
+
declare function isCompatible(version: string, current?: string): boolean;
|
18
|
+
declare function getMajor(version: string | SemVer): null | number;
|
19
|
+
declare function getMinor(version: string | SemVer): null | number;
|
20
|
+
declare function getPatch(version: string | SemVer): null | number;
|
21
|
+
declare function isGreaterThan(version: string, other: string): boolean;
|
22
|
+
declare function getSatisfyingVersion(versions: string[], range: string): string | null;
|
23
|
+
declare function minSatisfyingVersion(versions: string[], range: string): string | null;
|
24
|
+
export declare const api: {
|
25
|
+
equals: typeof equals;
|
26
|
+
isValid: typeof isValid;
|
27
|
+
isVersion: typeof isValidVersion;
|
28
|
+
isSingleVersion: typeof isSingleVersion;
|
29
|
+
isStable: typeof isStable;
|
30
|
+
isCompatible: typeof isCompatible;
|
31
|
+
getMajor: typeof getMajor;
|
32
|
+
getMinor: typeof getMinor;
|
33
|
+
getPatch: typeof getPatch;
|
34
|
+
isGreaterThan: typeof isGreaterThan;
|
35
|
+
getSatisfyingVersion: typeof getSatisfyingVersion;
|
36
|
+
minSatisfyingVersion: typeof minSatisfyingVersion;
|
37
|
+
getNewValue: typeof getNewValue;
|
38
|
+
matches: typeof matches;
|
39
|
+
sortVersions: typeof sortVersions;
|
40
|
+
};
|
41
|
+
export {};
|
@@ -0,0 +1,178 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.api = exports.supportedRangeStrategies = exports.supportsRanges = exports.urls = exports.displayName = exports.id = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const rattler_1 = require("@baszalmstra/rattler");
|
6
|
+
const pep440 = tslib_1.__importStar(require("../pep440"));
|
7
|
+
function parse(v) {
|
8
|
+
try {
|
9
|
+
return new rattler_1.Version(v);
|
10
|
+
}
|
11
|
+
catch {
|
12
|
+
return null;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
exports.id = 'conda';
|
16
|
+
exports.displayName = 'conda';
|
17
|
+
exports.urls = [
|
18
|
+
'https://docs.conda.io/projects/conda-build/en/stable/resources/package-spec.html#package-match-specifications',
|
19
|
+
];
|
20
|
+
exports.supportsRanges = true;
|
21
|
+
exports.supportedRangeStrategies = [
|
22
|
+
'bump',
|
23
|
+
'widen',
|
24
|
+
'pin',
|
25
|
+
'replace',
|
26
|
+
];
|
27
|
+
function isValidVersion(s) {
|
28
|
+
try {
|
29
|
+
new rattler_1.Version(s);
|
30
|
+
return true;
|
31
|
+
}
|
32
|
+
catch {
|
33
|
+
return false;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
function isValidVersionSpec(s) {
|
37
|
+
try {
|
38
|
+
new rattler_1.VersionSpec(s);
|
39
|
+
return true;
|
40
|
+
}
|
41
|
+
catch {
|
42
|
+
return false;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
function isValid(input) {
|
46
|
+
return isValidVersion(input) || isValidVersionSpec(input);
|
47
|
+
}
|
48
|
+
function matches(version, range) {
|
49
|
+
try {
|
50
|
+
return new rattler_1.VersionSpec(range).matches(new rattler_1.Version(version));
|
51
|
+
}
|
52
|
+
catch {
|
53
|
+
return false;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
function isSingleVersion(input) {
|
57
|
+
if (!input.startsWith('=')) {
|
58
|
+
return false;
|
59
|
+
}
|
60
|
+
return isValidVersion(input.replace(/^==/, '').trimStart());
|
61
|
+
}
|
62
|
+
function getNewValue({ currentValue, rangeStrategy, currentVersion, newVersion, isReplacement, }) {
|
63
|
+
if (rangeStrategy === 'pin') {
|
64
|
+
return '==' + newVersion;
|
65
|
+
}
|
66
|
+
if (currentValue === '*') {
|
67
|
+
if (rangeStrategy === 'bump') {
|
68
|
+
return '>=' + newVersion;
|
69
|
+
}
|
70
|
+
// don't think you can widen or replace `*`
|
71
|
+
return null;
|
72
|
+
}
|
73
|
+
const normalizedCurrentValue = new rattler_1.VersionSpec(currentValue).toString();
|
74
|
+
// it's valid range spec in conda to write `3.12.*`, translate to pep440 `==3.12.*`
|
75
|
+
if (/^(\d+\.)+\*$/.test(normalizedCurrentValue)) {
|
76
|
+
const newValue = pep440.api.getNewValue({
|
77
|
+
currentValue: '==' + normalizedCurrentValue,
|
78
|
+
rangeStrategy,
|
79
|
+
currentVersion,
|
80
|
+
newVersion,
|
81
|
+
isReplacement,
|
82
|
+
});
|
83
|
+
return newValue?.replace(/^==/, '') ?? null;
|
84
|
+
}
|
85
|
+
return pep440.api.getNewValue({
|
86
|
+
currentValue: normalizedCurrentValue,
|
87
|
+
rangeStrategy,
|
88
|
+
currentVersion,
|
89
|
+
newVersion,
|
90
|
+
isReplacement,
|
91
|
+
});
|
92
|
+
}
|
93
|
+
function sortVersions(version, other) {
|
94
|
+
return new rattler_1.Version(version).compare(new rattler_1.Version(other));
|
95
|
+
}
|
96
|
+
function equals(version, other) {
|
97
|
+
const v2 = parse(other);
|
98
|
+
if (!v2) {
|
99
|
+
return false;
|
100
|
+
}
|
101
|
+
return parse(version)?.equals(v2) ?? false;
|
102
|
+
}
|
103
|
+
function isStable(version) {
|
104
|
+
return !(parse(version)?.isDev ?? true);
|
105
|
+
}
|
106
|
+
function isCompatible(version, current) {
|
107
|
+
return true;
|
108
|
+
}
|
109
|
+
function getMajor(version) {
|
110
|
+
return parse(version)?.asMajorMinor?.()?.[0] ?? null;
|
111
|
+
}
|
112
|
+
function getMinor(version) {
|
113
|
+
return parse(version)?.asMajorMinor?.()?.[1] ?? null;
|
114
|
+
}
|
115
|
+
function getPatch(version) {
|
116
|
+
try {
|
117
|
+
return pep440.api.getPatch(version);
|
118
|
+
}
|
119
|
+
catch {
|
120
|
+
return null;
|
121
|
+
}
|
122
|
+
}
|
123
|
+
function isGreaterThan(version, other) {
|
124
|
+
return sortVersions(version, other) > 0;
|
125
|
+
}
|
126
|
+
function getSatisfyingVersion(versions, range) {
|
127
|
+
const spec = new rattler_1.VersionSpec(range);
|
128
|
+
const satisfiedVersions = versions
|
129
|
+
.map((v) => {
|
130
|
+
return [new rattler_1.Version(v), v];
|
131
|
+
})
|
132
|
+
.filter(([v, raw]) => spec.matches(v))
|
133
|
+
.sort((a, b) => {
|
134
|
+
return a[0].compare(b[0]);
|
135
|
+
});
|
136
|
+
if (satisfiedVersions.length === 0) {
|
137
|
+
return null;
|
138
|
+
}
|
139
|
+
return satisfiedVersions[satisfiedVersions.length - 1][1];
|
140
|
+
}
|
141
|
+
function minSatisfyingVersion(versions, range) {
|
142
|
+
const spec = new rattler_1.VersionSpec(range);
|
143
|
+
const satisfiedVersions = versions
|
144
|
+
.map((v) => {
|
145
|
+
return [new rattler_1.Version(v), v];
|
146
|
+
})
|
147
|
+
.filter(([v, raw]) => spec.matches(v))
|
148
|
+
.sort((a, b) => {
|
149
|
+
return a[0].compare(b[0]);
|
150
|
+
});
|
151
|
+
if (satisfiedVersions.length === 0) {
|
152
|
+
return null;
|
153
|
+
}
|
154
|
+
return satisfiedVersions[0][1];
|
155
|
+
}
|
156
|
+
exports.api = {
|
157
|
+
equals,
|
158
|
+
isValid,
|
159
|
+
isVersion: isValidVersion,
|
160
|
+
isSingleVersion,
|
161
|
+
// conda doesn't have stable version and non-stable version
|
162
|
+
// for example, tzdata has version 2024a but it's stable
|
163
|
+
isStable,
|
164
|
+
// conda use version are always compatible with each other.
|
165
|
+
isCompatible,
|
166
|
+
getMajor,
|
167
|
+
getMinor,
|
168
|
+
// sadly conda version doesn't have a concept of patch version
|
169
|
+
// so we try to use pep440 get a patch version.
|
170
|
+
getPatch,
|
171
|
+
isGreaterThan,
|
172
|
+
getSatisfyingVersion,
|
173
|
+
minSatisfyingVersion,
|
174
|
+
getNewValue,
|
175
|
+
matches,
|
176
|
+
sortVersions,
|
177
|
+
};
|
178
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/versioning/conda/index.ts"],"names":[],"mappings":";;;;AAAA,kDAA4D;AAI5D,0DAAoC;AAGpC,SAAS,KAAK,CAAC,CAAS;IACtB,IAAI,CAAC;QACH,OAAO,IAAI,iBAAO,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAEY,QAAA,EAAE,GAAG,OAAO,CAAC;AACb,QAAA,WAAW,GAAG,OAAO,CAAC;AACtB,QAAA,IAAI,GAAG;IAClB,+GAA+G;CAChH,CAAC;AACW,QAAA,cAAc,GAAG,IAAI,CAAC;AACtB,QAAA,wBAAwB,GAAoB;IACvD,MAAM;IACN,OAAO;IACP,KAAK;IACL,SAAS;CACV,CAAC;AAEF,SAAS,cAAc,CAAC,CAAS;IAC/B,IAAI,CAAC;QACH,IAAI,iBAAO,CAAC,CAAC,CAAC,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,CAAS;IACnC,IAAI,CAAC;QACH,IAAI,qBAAW,CAAC,CAAC,CAAC,CAAC;QACnB,OAAO,IAAI,CAA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M,iBAAiB,GAAG,QAAQ;SAC/B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACT,OAAO,CAAC,IAAI,iBAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAU,CAAC;IACtC,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;SACrC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACb,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEL,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACjC,CAAC;AAEY,QAAA,GAAG,GAAG;IACjB,MAAM;IACN,OAAO;IACP,SAAS,EAAE,cAAc;IACzB,eAAe;IAEf,2DAA2D;IAC3D,wDAAwD;IACxD,QAAQ;IAER,2DAA2D;IAC3D,YAAY;IAEZ,QAAQ;IACR,QAAQ;IACR,8DAA8D;IAC9D,+CAA+C;IAC/C,QAAQ;IAER,aAAa;IACb,oBAAoB;IAEpB,oBAAoB;IACpB,WAAW;IAEX,OAAO;IACP,YAAY;CACW,CAAC","sourcesContent":["import { Version, VersionSpec } from '@baszalmstra/rattler';\nimport type { SemVer } from 'semver';\n\nimport type { RangeStrategy } from '../../../types/versioning';\nimport * as pep440 from '../pep440';\nimport type { NewValueConfig, VersioningApi } from '../types';\n\nfunction parse(v: string): Version | null {\n try {\n return new Version(v);\n } catch {\n return null;\n }\n}\n\nexport const id = 'conda';\nexport const displayName = 'conda';\nexport const urls = [\n 'https://docs.conda.io/projects/conda-build/en/stable/resources/package-spec.html#package-match-specifications',\n];\nexport const supportsRanges = true;\nexport const supportedRangeStrategies: RangeStrategy[] = [\n 'bump',\n 'widen',\n 'pin',\n 'replace',\n];\n\nfunction isValidVersion(s: string): boolean {\n try {\n new Version(s);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isValidVersionSpec(s: string): boolean {\n try {\n new VersionSpec(s);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isValid(input: string): boolean {\n return isValidVersion(input) || isValidVersionSpec(input);\n}\n\nfunction matches(version: string, range: string): boolean {\n try {\n return new VersionSpec(range).matches(new Version(version));\n } catch {\n return false;\n }\n}\n\nfunction isSingleVersion(input: string): boolean {\n if (!input.startsWith('=')) {\n return false;\n }\n\n return isValidVersion(input.replace(/^==/, '').trimStart());\n}\n\nfunction getNewValue({\n currentValue,\n rangeStrategy,\n currentVersion,\n newVersion,\n isReplacement,\n}: NewValueConfig): string | null {\n if (rangeStrategy === 'pin') {\n return '==' + newVersion;\n }\n\n if (currentValue === '*') {\n if (rangeStrategy === 'bump') {\n return '>=' + newVersion;\n }\n\n // don't think you can widen or replace `*`\n return null;\n }\n\n const normalizedCurrentValue = new VersionSpec(currentValue).toString();\n\n // it's valid range spec in conda to write `3.12.*`, translate to pep440 `==3.12.*`\n if (/^(\\d+\\.)+\\*$/.test(normalizedCurrentValue)) {\n const newValue = pep440.api.getNewValue({\n currentValue: '==' + normalizedCurrentValue,\n rangeStrategy,\n currentVersion,\n newVersion,\n isReplacement,\n });\n\n return newValue?.replace(/^==/, '') ?? null;\n }\n\n return pep440.api.getNewValue({\n currentValue: normalizedCurrentValue,\n rangeStrategy,\n currentVersion,\n newVersion,\n isReplacement,\n });\n}\n\nfunction sortVersions(version: string, other: string): number {\n return new Version(version).compare(new Version(other));\n}\n\nfunction equals(version: string, other: string): boolean {\n const v2 = parse(other);\n if (!v2) {\n return false;\n }\n\n return parse(version)?.equals(v2) ?? false;\n}\n\nfunction isStable(version: string): boolean {\n return !(parse(version)?.isDev ?? true);\n}\n\nfunction isCompatible(version: string, current?: string): boolean {\n return true;\n}\n\nfunction getMajor(version: string | SemVer): null | number {\n return parse(version as string)?.asMajorMinor?.()?.[0] ?? null;\n}\nfunction getMinor(version: string | SemVer): null | number {\n return parse(version as string)?.asMajorMinor?.()?.[1] ?? null;\n}\n\nfunction getPatch(version: string | SemVer): null | number {\n try {\n return pep440.api.getPatch(version);\n } catch {\n return null;\n }\n}\n\nfunction isGreaterThan(version: string, other: string): boolean {\n return sortVersions(version, other) > 0;\n}\nfunction getSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n const spec = new VersionSpec(range);\n\n const satisfiedVersions = versions\n .map((v) => {\n return [new Version(v), v] as const;\n })\n .filter(([v, raw]) => spec.matches(v))\n .sort((a, b) => {\n return a[0].compare(b[0]);\n });\n\n if (satisfiedVersions.length === 0) {\n return null;\n }\n\n return satisfiedVersions[satisfiedVersions.length - 1][1];\n}\n\nfunction minSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n const spec = new VersionSpec(range);\n\n const satisfiedVersions = versions\n .map((v) => {\n return [new Version(v), v] as const;\n })\n .filter(([v, raw]) => spec.matches(v))\n .sort((a, b) => {\n return a[0].compare(b[0]);\n });\n\n if (satisfiedVersions.length === 0) {\n return null;\n }\n\n return satisfiedVersions[0][1];\n}\n\nexport const api = {\n equals,\n isValid,\n isVersion: isValidVersion,\n isSingleVersion,\n\n // conda doesn't have stable version and non-stable version\n // for example, tzdata has version 2024a but it's stable\n isStable,\n\n // conda use version are always compatible with each other.\n isCompatible,\n\n getMajor,\n getMinor,\n // sadly conda version doesn't have a concept of patch version\n // so we try to use pep440 get a patch version.\n getPatch,\n\n isGreaterThan,\n getSatisfyingVersion,\n\n minSatisfyingVersion,\n getNewValue,\n\n matches,\n sortVersions,\n} satisfies VersioningApi;\n"]}
|
@@ -2,7 +2,8 @@
|
|
2
2
|
* This can convert most hashicorp ranges to valid npm syntax
|
3
3
|
* The `!=` syntax is currently unsupported as there is no direct
|
4
4
|
* equivalent in npm and isn't widely used
|
5
|
-
*
|
5
|
+
* The version part of the constraint is parsed as a semver but with the minor and patch versions being optional.
|
6
|
+
* The prerelease syntax is less well-defined for hashicorp and will
|
6
7
|
* cause issues if it is not semvar compatible as no attempts to convert it
|
7
8
|
* are made
|
8
9
|
*/
|
@@ -4,11 +4,16 @@ exports.hashicorp2npm = hashicorp2npm;
|
|
4
4
|
exports.npm2hashicorp = npm2hashicorp;
|
5
5
|
const logger_1 = require("../../../logger");
|
6
6
|
const regex_1 = require("../../../util/regex");
|
7
|
+
// Taken from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string. Licensed under CC BY 3.0
|
8
|
+
// Removed the ^ and $.
|
9
|
+
// Made minor and patch versions optional by surrounding them in parentheses followed by a question mark.
|
10
|
+
const semverRegex = /(0|[1-9]\d*)(\.(0|[1-9]\d*))?(\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?/;
|
7
11
|
/**
|
8
12
|
* This can convert most hashicorp ranges to valid npm syntax
|
9
13
|
* The `!=` syntax is currently unsupported as there is no direct
|
10
14
|
* equivalent in npm and isn't widely used
|
11
|
-
*
|
15
|
+
* The version part of the constraint is parsed as a semver but with the minor and patch versions being optional.
|
16
|
+
* The prerelease syntax is less well-defined for hashicorp and will
|
12
17
|
* cause issues if it is not semvar compatible as no attempts to convert it
|
13
18
|
* are made
|
14
19
|
*/
|
@@ -19,18 +24,18 @@ function hashicorp2npm(input) {
|
|
19
24
|
return input
|
20
25
|
.split(',')
|
21
26
|
.map((single) => {
|
22
|
-
const r = single.match((0, regex_1.regEx)(
|
27
|
+
const r = single.match((0, regex_1.regEx)(`^\\s*(?<operator>(|=|!=|>|<|>=|<=|~>))\\s*v?(?<version>${semverRegex.source})\\s*$`));
|
23
28
|
if (!r) {
|
24
29
|
logger_1.logger.warn({ constraint: input, element: single }, 'Invalid hashicorp constraint');
|
25
30
|
throw new Error('Invalid hashicorp constraint');
|
26
31
|
}
|
27
|
-
if (r
|
32
|
+
if (r.groups.operator === '!=') {
|
28
33
|
logger_1.logger.warn({ constraint: input, element: single }, 'Unsupported hashicorp constraint');
|
29
34
|
throw new Error('Unsupported hashicorp constraint');
|
30
35
|
}
|
31
36
|
return {
|
32
|
-
operator: r
|
33
|
-
version: r
|
37
|
+
operator: r.groups.operator,
|
38
|
+
version: r.groups.version,
|
34
39
|
};
|
35
40
|
})
|
36
41
|
.map(({ operator, version }) => {
|
@@ -63,13 +68,13 @@ function npm2hashicorp(input) {
|
|
63
68
|
return input
|
64
69
|
.split(' ')
|
65
70
|
.map((single) => {
|
66
|
-
const r = single.match((0, regex_1.regEx)(
|
71
|
+
const r = single.match((0, regex_1.regEx)(`^(?<operator>(|>|<|>=|<=|~|\\^))v?(?<version>${semverRegex.source})$`));
|
67
72
|
if (!r) {
|
68
73
|
throw new Error('invalid npm constraint');
|
69
74
|
}
|
70
75
|
return {
|
71
|
-
operator: r
|
72
|
-
version: r
|
76
|
+
operator: r.groups.operator,
|
77
|
+
version: r.groups.version,
|
73
78
|
};
|
74
79
|
})
|
75
80
|
.map(({ operator, version }) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"convertor.js","sourceRoot":"","sources":["../../../../lib/modules/versioning/hashicorp/convertor.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"convertor.js","sourceRoot":"","sources":["../../../../lib/modules/versioning/hashicorp/convertor.ts"],"names":[],"mappings":";;AAkBA,sCAgDC;AAOD,sCAqDC;AA9HD,4CAAyC;AACzC,+CAA4C;AAE5C,kIAAkI;AAClI,uBAAuB;AACvB,yGAAyG;AACzG,MAAM,WAAW,GACf,yLAAyL,CAAC;AAE5L;;;;;;;;GAQG;AACH,SAAgB,aAAa,CAAC,KAAa;IACzC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,O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KAAK,CAAC,IAAA,aAAK,EAAC,mBAAmB,CAAC,CAAC,CAAC;gBAC1D,IAAI,OAAO,EAAE,CAAC;oBACZ,+DAA+D;oBAC/D,gCAAgC;oBAChC,OAAO,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC5B,CAAC;gBACD,OAAO,MAAM,OAAO,EAAE,CAAC;YACzB,CAAC;YACD,KAAK,GAAG;gBACN,IAAI,OAAO,CAAC,KAAK,CAAC,IAAA,aAAK,EAAC,OAAO,CAAC,CAAC,EAAE,CAAC;oBAClC,OAAO,MAAM,OAAO,IAAI,CAAC;gBAC3B,CAAC;gBACD,IAAI,OAAO,CAAC,KAAK,CAAC,IAAA,aAAK,EAAC,YAAY,CAAC,CAAC,EAAE,CAAC;oBACvC,OAAO,MAAM,OAAO,IAAI,CAAC;gBAC3B,CAAC;gBACD,OAAO,MAAM,OAAO,EAAE,CAAC;YACzB,KAAK,EAAE;gBACL,OAAO,GAAG,OAAO,EAAE,CAAC;YACtB;gBACE,OAAO,GAAG,QAAQ,IAAI,OAAO,EAAE,CAAC;QACpC,CAAC;IACH,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC","sourcesContent":["import { logger } from '../../../logger';\nimport { regEx } from '../../../util/regex';\n\n// Taken from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string. Licensed under CC BY 3.0\n// Removed the ^ and $.\n// Made minor and patch versions optional by surrounding them in parentheses followed by a question mark.\nconst semverRegex =\n /(0|[1-9]\\d*)(\\.(0|[1-9]\\d*))?(\\.(0|[1-9]\\d*))?(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?/;\n\n/**\n * This can convert most hashicorp ranges to valid npm syntax\n * The `!=` syntax is currently unsupported as there is no direct\n * equivalent in npm and isn't widely used\n * The version part of the constraint is parsed as a semver but with the minor and patch versions being optional.\n * The prerelease syntax is less well-defined for hashicorp and will\n * cause issues if it is not semvar compatible as no attempts to convert it\n * are made\n */\nexport function hashicorp2npm(input: string): string {\n if (!input) {\n return input;\n }\n return input\n .split(',')\n .map((single) => {\n const r = single.match(\n regEx(\n `^\\\\s*(?<operator>(|=|!=|>|<|>=|<=|~>))\\\\s*v?(?<version>${semverRegex.source})\\\\s*$`,\n ),\n );\n if (!r) {\n logger.warn(\n { constraint: input, element: single },\n 'Invalid hashicorp constraint',\n );\n throw new Error('Invalid hashicorp constraint');\n }\n if (r.groups!.operator === '!=') {\n logger.warn(\n { constraint: input, element: single },\n 'Unsupported hashicorp constraint',\n );\n throw new Error('Unsupported hashicorp constraint');\n }\n return {\n operator: r.groups!.operator,\n version: r.groups!.version,\n };\n })\n .map(({ operator, version }) => {\n switch (operator) {\n case '=':\n return version;\n case '~>':\n if (version.match(regEx(/^\\d+$/))) {\n return `>=${version}`;\n }\n if (version.match(regEx(/^\\d+\\.\\d+$/))) {\n return `^${version}`;\n }\n return `~${version}`;\n default:\n return `${operator}${version}`;\n }\n })\n .join(' ');\n}\n\n/**\n * This can convert a limited set of npm range syntax to hashicorp,\n * it supports all the syntax that hashicorp2npm can output\n * It cannot handle `*`, `1.x.x`, range with `-`, `||`\n */\nexport function npm2hashicorp(input: string): string {\n if (!input) {\n return input;\n }\n return input\n .split(' ')\n .map((single) => {\n const r = single.match(\n regEx(\n `^(?<operator>(|>|<|>=|<=|~|\\\\^))v?(?<version>${semverRegex.source})$`,\n ),\n );\n if (!r) {\n throw new Error('invalid npm constraint');\n }\n return {\n operator: r.groups!.operator,\n version: r.groups!.version,\n };\n })\n .map(({ operator, version }) => {\n switch (operator) {\n case '^': {\n if (version.match(regEx(/^\\d+$/))) {\n return `~> ${version}.0`;\n }\n const withZero = version.match(regEx(/^(\\d+\\.\\d+)\\.0$/));\n if (withZero) {\n return `~> ${withZero[1]}`;\n }\n const nonZero = version.match(regEx(/^(\\d+\\.\\d+)\\.\\d+$/));\n if (nonZero) {\n // not including`>= ${version}`, which makes this less accurate\n // but makes the results cleaner\n return `~> ${nonZero[1]}`;\n }\n return `~> ${version}`;\n }\n case '~':\n if (version.match(regEx(/^\\d+$/))) {\n return `~> ${version}.0`;\n }\n if (version.match(regEx(/^\\d+\\.\\d+$/))) {\n return `~> ${version}.0`;\n }\n return `~> ${version}`;\n case '':\n return `${version}`;\n default:\n return `${operator} ${version}`;\n }\n })\n .join(', ');\n}\n"]}
|
@@ -70,13 +70,13 @@ function getNewValue({ currentValue, rangeStrategy, currentVersion, newVersion,
|
|
70
70
|
if (newSemver) {
|
71
71
|
newSemver = npm2hex(newSemver);
|
72
72
|
if ((0, regex_1.regEx)(/~>\s*(\d+\.\d+\.\d+)$/).test(currentValue)) {
|
73
|
-
newSemver = newSemver.replace((0, regex_1.regEx)(/[\^~]\s*(\d+\.\d+\.\d+)/), (_str, p1) => `~> ${p1}`);
|
73
|
+
newSemver = newSemver.replace((0, regex_1.regEx)(/[\^~]\s*(\d+\.\d+\.\d+)/g), (_str, p1) => `~> ${p1}`);
|
74
74
|
}
|
75
75
|
else if ((0, regex_1.regEx)(/~>\s*(\d+\.\d+)$/).test(currentValue)) {
|
76
|
-
newSemver = newSemver.replace((0, regex_1.regEx)(/\^\s*(\d+\.\d+)(\.\d+)?/), (_str, p1) => `~> ${p1}`);
|
76
|
+
newSemver = newSemver.replace((0, regex_1.regEx)(/\^\s*(\d+\.\d+)(\.\d+)?/g), (_str, p1) => `~> ${p1}`);
|
77
77
|
}
|
78
78
|
else {
|
79
|
-
newSemver = newSemver.replace((0, regex_1.regEx)(/~\s*(\d+\.\d+\.\d)/), '~> $1');
|
79
|
+
newSemver = newSemver.replace((0, regex_1.regEx)(/~\s*(\d+\.\d+\.\d)/g), '~> $1');
|
80
80
|
}
|
81
81
|
if (npm_1.api.isVersion(newSemver)) {
|
82
82
|
newSemver = `== ${newS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,CAAC;QACnC,aAAa;QACb,cAAc;QACd,UAAU;KACX,CAAC,CAAC;IACH,IAAI,SAAS,EAAE,CAAC;QACd,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QAE/B,IAAI,IAAA,aAAK,EAAC,uBAAuB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;YACtD,SAAS,GAAG,SAAS,CAAC,OAAO,CAC3B,IAAA,aAAK,EAAC,0BAA0B,CAAC,EACjC,CAAC,IAAI,EAAE,EAAU,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE,CACjC,CAAC;QACJ,CAAC;aAAM,IAAI,IAAA,aAAK,EAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;YACxD,SAAS,GAAG,SAAS,CAAC,OAAO,CAC3B,IAAA,aAAK,EAAC,0BAA0B,CAAC,EACjC,CAAC,IAAI,EAAE,EAAU,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE,CACjC,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,IAAA,aAAK,EAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC,CAAC;QACvE,CAAC;QACD,IAAI,SAAG,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7B,SAAS,GAAG,MAAM,SAAS,EAAE,CAAC;QAChC,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAIY,QAAA,GAAG,GAAkB;IAChC,GAAG,SAAG;IACN,eAAe;IACf,OAAO;IACP,OAAO;IACP,oBAAoB;IACpB,oBAAoB;IACpB,WAAW;CACZ,CAAC;AAEF,kBAAe,WAAG,CAAC","sourcesContent":["import type { RangeStrategy } from '../../../types/versioning';\nimport { regEx } from '../../../util/regex';\nimport { api as npm } from '../npm';\nimport type { NewValueConfig, VersioningApi } from '../types';\n\nexport const id = 'hex';\nexport const displayName = 'Hex';\nexport const urls = ['https://hexdocs.pm/elixir/Version.html'];\nexport const supportsRanges = true;\nexport const supportedRangeStrategies: RangeStrategy[] = [\n 'bump',\n 'widen',\n 'pin',\n 'replace',\n 'update-lockfile',\n];\n\nfunction hex2npm(input: string): string {\n return input\n .replace(regEx(/~>\\s*(\\d+\\.\\d+)$/), '^$1')\n .replace(regEx(/~>\\s*(\\d+\\.\\d+\\.\\d+)/), '~$1')\n .replace(regEx(/==|and/), '')\n .replace('or', '||')\n .replace(regEx(/!=\\s*(\\d+\\.\\d+(\\.\\d+.*)?)/), '>$1 <$1')\n .trim();\n}\n\nfunction npm2hex(input: string): string {\n const res = input\n .split(' ')\n .map((str) => str.trim())\n .filter((str) => str !== '');\n let output = '';\n const operators = ['^', '=', '>', '<', '<=', '>=', '~>'];\n for (let i = 0; i < res.length; i += 1) {\n if (i === res.length - 1) {\n output += res[i];\n break;\n }\n if (i < res.length - 1 && res[i + 1].includes('||')) {\n output += res[i] + ' or ';\n i += 1;\n } else if (operators.includes(res[i])) {\n output += res[i] + ' ';\n } else {\n output += res[i] + ' and ';\n }\n }\n return output;\n}\n\nfunction isLessThanRange(version: string, range: string): boolean {\n return !!npm.isLessThanRange?.(hex2npm(version), hex2npm(range));\n}\n\nconst isValid = (input: string): boolean => !!npm.isValid(hex2npm(input));\n\nconst matches = (version: string, range: string): boolean =>\n npm.matches(hex2npm(version), hex2npm(range));\n\nfunction getSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n return npm.getSatisfyingVersion(versions.map(hex2npm), hex2npm(range));\n}\n\nfunction minSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n return npm.minSatisfyingVersion(versions.map(hex2npm), hex2npm(range));\n}\n\nfunction getNewValue({\n currentValue,\n rangeStrategy,\n currentVersion,\n newVersion,\n}: NewValueConfig): string | null {\n let newSemver = npm.getNewValue({\n currentValue: hex2npm(currentValue),\n rangeStrategy,\n currentVersion,\n newVersion,\n });\n if (newSemver) {\n newSemver = npm2hex(newSemver);\n\n if (regEx(/~>\\s*(\\d+\\.\\d+\\.\\d+)$/).test(currentValue)) {\n newSemver = newSemver.replace(\n regEx(/[\\^~]\\s*(\\d+\\.\\d+\\.\\d+)/g),\n (_str, p1: string) => `~> ${p1}`,\n );\n } else if (regEx(/~>\\s*(\\d+\\.\\d+)$/).test(currentValue)) {\n newSemver = newSemver.replace(\n regEx(/\\^\\s*(\\d+\\.\\d+)(\\.\\d+)?/g),\n (_str, p1: string) => `~> ${p1}`,\n );\n } else {\n newSemver = newSemver.replace(regEx(/~\\s*(\\d+\\.\\d+\\.\\d)/g), '~> $1');\n }\n if (npm.isVersion(newSemver)) {\n newSemver = `== ${newSemver}`;\n }\n }\n return newSemver;\n}\n\nexport { isValid };\n\nexport const api: VersioningApi = {\n ...npm,\n isLessThanRange,\n isValid,\n matches,\n getSatisfyingVersion,\n minSatisfyingVersion,\n getNewValue,\n};\n\nexport default api;\n"]}
|
@@ -20,7 +20,7 @@ exports.supportedRangeStrategies = [
|
|
20
20
|
'pin',
|
21
21
|
'replace',
|
22
22
|
];
|
23
|
-
const { compare: sortVersions, maxSatisfying: getSatisfyingVersion, minSatisfying: minSatisfyingVersion, major: getMajor, minor: getMinor, patch: getPatch, satisfies: matches, valid, validRange, ltr: isLessThanRange, gt: isGreaterThan, eq: equals, subset, } = semver_1.default;
|
23
|
+
const { compare: sortVersions, maxSatisfying: getSatisfyingVersion, minSatisfying: minSatisfyingVersion, major: getMajor, minor: getMinor, patch: getPatch, satisfies: matches, valid, validRange, ltr: isLessThanRange, gt: isGreaterThan, eq: equals, subset, intersects, } = semver_1.default;
|
24
24
|
// If this is left as an alias, inputs like "17.04.0" throw errors
|
25
25
|
const isValid = (input) => !!validRange(input);
|
26
26
|
exports.isValid = isValid;
|
@@ -48,6 +48,7 @@ exports.api = {
|
|
48
48
|
minSatisfyingVersion,
|
49
49
|
sortVersions,
|
50
50
|
subset,
|
51
|
+
intersects,
|
51
52
|
};
|
52
53
|
exports.default = exports.api;
|
53
54
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/versioning/npm/index.ts"],"names":[],"mappings":";;;;AAAA,4DAA4B;AAC5B,0EAAmC;AAGnC,mCAAsC;AAEzB,QAAA,EAAE,GAAG,KAAK,CAAC;AACX,QAAA,WAAW,GAAG,KAAK,CAAC;AACpB,QAAA,IAAI,GAAG;IAClB,qBAAqB;IACrB,sCAAsC;IACtC,kDAAkD;IAClD,2BAA2B;CAC5B,CAAC;AACW,QAAA,cAAc,GAAG,IAAI,CAAC;AACtB,QAAA,wBAAwB,GAAoB;IACvD,MAAM;IACN,OAAO;IACP,KAAK;IACL,SAAS;CACV,CAAC;AAEF,MAAM,EACJ,OAAO,EAAE,YAAY,EACrB,aAAa,EAAE,oBAAoB,EACnC,aAAa,EAAE,oBAAoB,EACnC,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE,OAAO,EAClB,KAAK,EACL,UAAU,EACV,GAAG,EAAE,eAAe,EACpB,EAAE,EAAE,aAAa,EACjB,EAAE,EAAE,MAAM,EACV,MAAM,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/versioning/npm/index.ts"],"names":[],"mappings":";;;;AAAA,4DAA4B;AAC5B,0EAAmC;AAGnC,mCAAsC;AAEzB,QAAA,EAAE,GAAG,KAAK,CAAC;AACX,QAAA,WAAW,GAAG,KAAK,CAAC;AACpB,QAAA,IAAI,GAAG;IAClB,qBAAqB;IACrB,sCAAsC;IACtC,kDAAkD;IAClD,2BAA2B;CAC5B,CAAC;AACW,QAAA,cAAc,GAAG,IAAI,CAAC;AACtB,QAAA,wBAAwB,GAAoB;IACvD,MAAM;IACN,OAAO;IACP,KAAK;IACL,SAAS;CACV,CAAC;AAEF,MAAM,EACJ,OAAO,EAAE,YAAY,EACrB,aAAa,EAAE,oBAAoB,EACnC,aAAa,EAAE,oBAAoB,EACnC,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE,OAAO,EAClB,KAAK,EACL,UAAU,EACV,GAAG,EAAE,eAAe,EACpB,EAAE,EAAE,aAAa,EACjB,EAAE,EAAE,MAAM,EACV,MAAM,EACN,UAAU,GACX,GAAG,gBAAM,CAAC;AAEX,kEAAkE;AAC3D,MAAM,OAAO,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AAA1D,QAAA,OAAO,WAAmD;AAChE,MAAM,SAAS,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAAvD,QAAA,SAAS,aAA8C;AAEpE,SAAS,eAAe,CAAC,UAAkB;IACzC,OAAO,CACL,IAAA,iBAAS,EAAC,UAAU,CAAC;QACrB,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,IAAI,IAAA,iBAAS,EAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAC3E,CAAC;AACJ,CAAC;AAEY,QAAA,GAAG,GAAkB;IAChC,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,WAAW,EAAX,mBAAW;IACX,QAAQ;IACR,YAAY,EAAE,iBAAS;IACvB,aAAa;IACb,eAAe;IACf,eAAe;IACf,QAAQ,EAAE,uBAAM,CAAC,EAAE;IACnB,OAAO,EAAP,eAAO;IACP,SAAS,EAAT,iBAAS;IACT,OAAO;IACP,oBAAoB;IACpB,oBAAoB;IACpB,YAAY;IACZ,MAAM;IACN,UAAU;CACX,CAAC;AAEF,kBAAe,WAAG,CAAC","sourcesContent":["import semver from 'semver';\nimport stable from 'semver-stable';\nimport type { RangeStrategy } from '../../../types/versioning';\nimport type { VersioningApi } from '../types';\nimport { getNewValue } from './range';\n\nexport const id = 'npm';\nexport const displayName = 'npm';\nexport const urls = [\n 'https://semver.org/',\n 'https://www.npmjs.com/package/semver',\n 'https://docs.npmjs.com/about-semantic-versioning',\n 'https://semver.npmjs.com/',\n];\nexport const supportsRanges = true;\nexport const supportedRangeStrategies: RangeStrategy[] = [\n 'bump',\n 'widen',\n 'pin',\n 'replace',\n];\n\nconst {\n compare: sortVersions,\n maxSatisfying: getSatisfyingVersion,\n minSatisfying: minSatisfyingVersion,\n major: getMajor,\n minor: getMinor,\n patch: getPatch,\n satisfies: matches,\n valid,\n validRange,\n ltr: isLessThanRange,\n gt: isGreaterThan,\n eq: equals,\n subset,\n intersects,\n} = semver;\n\n// If this is left as an alias, inputs like \"17.04.0\" throw errors\nexport const isValid = (input: string): boolean => !!validRange(input);\nexport const isVersion = (input: string): boolean => !!valid(input);\n\nfunction isSingleVersion(constraint: string): boolean {\n return (\n isVersion(constraint) ||\n (constraint?.startsWith('=') && isVersion(constraint.substring(1).trim()))\n );\n}\n\nexport const api: VersioningApi = {\n equals,\n getMajor,\n getMinor,\n getNewValue,\n getPatch,\n isCompatible: isVersion,\n isGreaterThan,\n isLessThanRange,\n isSingleVersion,\n isStable: stable.is,\n isValid,\n isVersion,\n matches,\n getSatisfyingVersion,\n minSatisfyingVersion,\n sortVersions,\n subset,\n intersects,\n};\n\nexport default api;\n"]}
|
@@ -16,7 +16,7 @@ exports.Versioning = zod_1.z
|
|
16
16
|
logger_1.logger.debug(`Versioning: '${versioningSpec}' not found, falling back to ${defaultVersioning.id}`);
|
17
17
|
return defaultVersioning.api;
|
18
18
|
}
|
19
|
-
if (is_1.default.
|
19
|
+
if (is_1.default.function(versioning)) {
|
20
20
|
const versioningConfig = versioningRest.length
|
21
21
|
? versioningRest.join(':')
|
22
22
|
: undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../lib/modules/versioning/schema.ts"],"names":[],"mappings":";;;;AAAA,kEAAkC;AAClC,6BAAwB;AACxB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cAAc,CAAC,IAAI,CAAC,GAAG,CAAC;YAC1B,CAAC,CAAC,SAAS,CAAC;QAEd,IAAI,CAAC;YACH,UAAU,GAAG,IAAI,UAAU,CAAC,gBAAgB,CAAC,CAAC;QAChD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,gBAAgB,cAAc,wBAAwB;gBAC/D,MAAM,EAAE,EAAE,KAAK,EAAE;aAClB,CAAC,CAAC;YACH,OAAO,OAAC,CAAC,KAAK,CAAC;QACjB,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { z } from 'zod';\nimport { logger } from '../../logger';\nimport versionings from './api';\nimport * as defaultVersioning from './semver-coerced';\nimport type { VersioningApi } from './types';\n\nexport const Versioning = z\n .string()\n .transform((versioningSpec, ctx): VersioningApi => {\n const [versioningName, ...versioningRest] = versioningSpec.split(':');\n\n let versioning = versionings.get(versioningName);\n if (!versioning) {\n logger.debug(\n `Versioning: '${versioningSpec}' not found, falling back to ${defaultVersioning.id}`,\n );\n return defaultVersioning.api;\n }\n\n if (is.function(versioning)) {\n const versioningConfig = versioningRest.length\n ? versioningRest.join(':')\n : undefined;\n\n try {\n versioning = new versioning(versioningConfig);\n } catch (error) {\n ctx.addIssue({\n code: 'custom',\n message: `Versioning: '${versioningSpec}' failed to initialize`,\n params: { error },\n });\n return z.NEVER;\n }\n }\n\n return versioning;\n });\n"]}
|
@@ -102,6 +102,10 @@ export interface VersioningApi {
|
|
102
102
|
* @param superRange - the dom range
|
103
103
|
*/
|
104
104
|
subset?(subRange: string, superRange: string): boolean | undefined;
|
105
|
+
/**
|
106
|
+
* Checks whether subRange intersects superRange.
|
107
|
+
*/
|
108
|
+
intersects?(subRange: string, superRange: string): boolean;
|
105
109
|
/**
|
106
110
|
* Return whether unstable-to-unstable upgrades within the same major version are allowed.
|
107
111
|
*/
|