renovate 41.72.0 → 42.0.0-next.2

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.
Files changed (220) hide show
  1. package/dist/modules/datasource/aws-eks-addon/schema.d.ts +8 -1
  2. package/dist/modules/datasource/aws-eks-addon/schema.js +5 -7
  3. package/dist/modules/datasource/aws-eks-addon/schema.js.map +1 -1
  4. package/dist/modules/datasource/buildpacks-registry/index.js +1 -1
  5. package/dist/modules/datasource/buildpacks-registry/index.js.map +1 -1
  6. package/dist/modules/datasource/buildpacks-registry/schema.d.ts +1 -1
  7. package/dist/modules/datasource/buildpacks-registry/schema.js +2 -2
  8. package/dist/modules/datasource/buildpacks-registry/schema.js.map +1 -1
  9. package/dist/modules/datasource/cdnjs/index.js +2 -2
  10. package/dist/modules/datasource/cdnjs/index.js.map +1 -1
  11. package/dist/modules/datasource/cdnjs/schema.d.ts +2 -2
  12. package/dist/modules/datasource/cdnjs/schema.js +3 -3
  13. package/dist/modules/datasource/cdnjs/schema.js.map +1 -1
  14. package/dist/modules/datasource/conda/prefix-dev.js +1 -1
  15. package/dist/modules/datasource/conda/prefix-dev.js.map +1 -1
  16. package/dist/modules/datasource/conda/schema/prefix-dev.d.ts +1 -1
  17. package/dist/modules/datasource/conda/schema/prefix-dev.js +2 -2
  18. package/dist/modules/datasource/conda/schema/prefix-dev.js.map +1 -1
  19. package/dist/modules/datasource/cpan/schema.js +2 -2
  20. package/dist/modules/datasource/cpan/schema.js.map +1 -1
  21. package/dist/modules/datasource/crate/index.js +1 -1
  22. package/dist/modules/datasource/crate/index.js.map +1 -1
  23. package/dist/modules/datasource/crate/schema.d.ts +1 -1
  24. package/dist/modules/datasource/crate/schema.js +2 -2
  25. package/dist/modules/datasource/crate/schema.js.map +1 -1
  26. package/dist/modules/datasource/custom/index.d.ts +1 -1
  27. package/dist/modules/datasource/custom/index.js +2 -2
  28. package/dist/modules/datasource/custom/index.js.map +1 -1
  29. package/dist/modules/datasource/custom/schema.d.ts +1 -1
  30. package/dist/modules/datasource/custom/schema.js +2 -2
  31. package/dist/modules/datasource/custom/schema.js.map +1 -1
  32. package/dist/modules/datasource/forgejo-releases/index.js +3 -3
  33. package/dist/modules/datasource/forgejo-releases/index.js.map +1 -1
  34. package/dist/modules/datasource/forgejo-releases/schema.d.ts +2 -2
  35. package/dist/modules/datasource/forgejo-releases/schema.js +3 -3
  36. package/dist/modules/datasource/forgejo-releases/schema.js.map +1 -1
  37. package/dist/modules/datasource/forgejo-tags/index.js +3 -3
  38. package/dist/modules/datasource/forgejo-tags/index.js.map +1 -1
  39. package/dist/modules/datasource/forgejo-tags/schema.d.ts +4 -4
  40. package/dist/modules/datasource/forgejo-tags/schema.js +7 -7
  41. package/dist/modules/datasource/forgejo-tags/schema.js.map +1 -1
  42. package/dist/modules/datasource/gitea-releases/index.js +3 -3
  43. package/dist/modules/datasource/gitea-releases/index.js.map +1 -1
  44. package/dist/modules/datasource/gitea-releases/schema.d.ts +2 -2
  45. package/dist/modules/datasource/gitea-releases/schema.js +3 -3
  46. package/dist/modules/datasource/gitea-releases/schema.js.map +1 -1
  47. package/dist/modules/datasource/gitea-tags/index.js +3 -3
  48. package/dist/modules/datasource/gitea-tags/index.js.map +1 -1
  49. package/dist/modules/datasource/gitea-tags/schema.d.ts +4 -4
  50. package/dist/modules/datasource/gitea-tags/schema.js +7 -7
  51. package/dist/modules/datasource/gitea-tags/schema.js.map +1 -1
  52. package/dist/modules/datasource/helm/index.js +1 -1
  53. package/dist/modules/datasource/helm/index.js.map +1 -1
  54. package/dist/modules/datasource/helm/schema.d.ts +2 -2
  55. package/dist/modules/datasource/helm/schema.js +4 -4
  56. package/dist/modules/datasource/helm/schema.js.map +1 -1
  57. package/dist/modules/manager/argocd/extract.js +1 -1
  58. package/dist/modules/manager/argocd/extract.js.map +1 -1
  59. package/dist/modules/manager/argocd/schema.d.ts +1 -1
  60. package/dist/modules/manager/argocd/schema.js +2 -2
  61. package/dist/modules/manager/argocd/schema.js.map +1 -1
  62. package/dist/modules/manager/batect/extract.js +1 -1
  63. package/dist/modules/manager/batect/extract.js.map +1 -1
  64. package/dist/modules/manager/batect/schema.d.ts +2 -2
  65. package/dist/modules/manager/batect/schema.js +2 -2
  66. package/dist/modules/manager/batect/schema.js.map +1 -1
  67. package/dist/modules/manager/bazel-module/parser/fragments.d.ts +21 -21
  68. package/dist/modules/manager/bazel-module/parser/fragments.js +32 -32
  69. package/dist/modules/manager/bazel-module/parser/fragments.js.map +1 -1
  70. package/dist/modules/manager/bazel-module/parser/maven.js +7 -7
  71. package/dist/modules/manager/bazel-module/parser/maven.js.map +1 -1
  72. package/dist/modules/manager/bazel-module/parser/oci.js +5 -5
  73. package/dist/modules/manager/bazel-module/parser/oci.js.map +1 -1
  74. package/dist/modules/manager/bazel-module/rules.js +18 -18
  75. package/dist/modules/manager/bazel-module/rules.js.map +1 -1
  76. package/dist/modules/manager/cargo/extract.js +2 -2
  77. package/dist/modules/manager/cargo/extract.js.map +1 -1
  78. package/dist/modules/manager/cargo/locked-version.d.ts +2 -2
  79. package/dist/modules/manager/cargo/locked-version.js +1 -1
  80. package/dist/modules/manager/cargo/locked-version.js.map +1 -1
  81. package/dist/modules/manager/cargo/schema.d.ts +32 -5
  82. package/dist/modules/manager/cargo/schema.js +8 -7
  83. package/dist/modules/manager/cargo/schema.js.map +1 -1
  84. package/dist/modules/manager/crossplane/extract.js +1 -1
  85. package/dist/modules/manager/crossplane/extract.js.map +1 -1
  86. package/dist/modules/manager/crossplane/schema.d.ts +2 -2
  87. package/dist/modules/manager/crossplane/schema.js +2 -2
  88. package/dist/modules/manager/crossplane/schema.js.map +1 -1
  89. package/dist/modules/manager/custom/jsonata/schema.d.ts +1 -1
  90. package/dist/modules/manager/custom/jsonata/schema.js +4 -4
  91. package/dist/modules/manager/custom/jsonata/schema.js.map +1 -1
  92. package/dist/modules/manager/custom/jsonata/utils.js +1 -1
  93. package/dist/modules/manager/custom/jsonata/utils.js.map +1 -1
  94. package/dist/modules/manager/devbox/extract.js +1 -1
  95. package/dist/modules/manager/devbox/extract.js.map +1 -1
  96. package/dist/modules/manager/devbox/schema.d.ts +1 -1
  97. package/dist/modules/manager/devbox/schema.js +2 -2
  98. package/dist/modules/manager/devbox/schema.js.map +1 -1
  99. package/dist/modules/manager/fingerprint.generated.js +2 -2
  100. package/dist/modules/manager/fingerprint.generated.js.map +1 -1
  101. package/dist/modules/manager/github-actions/community.js +10 -10
  102. package/dist/modules/manager/github-actions/community.js.map +1 -1
  103. package/dist/modules/manager/github-actions/extract.js +1 -1
  104. package/dist/modules/manager/github-actions/extract.js.map +1 -1
  105. package/dist/modules/manager/github-actions/schema.d.ts +3 -3
  106. package/dist/modules/manager/github-actions/schema.js +7 -7
  107. package/dist/modules/manager/github-actions/schema.js.map +1 -1
  108. package/dist/modules/manager/helmfile/extract.js.map +1 -1
  109. package/dist/modules/manager/mise/backends.d.ts +2 -2
  110. package/dist/modules/manager/mise/backends.js.map +1 -1
  111. package/dist/modules/manager/mise/extract.js.map +1 -1
  112. package/dist/modules/manager/mise/schema.d.ts +29 -6
  113. package/dist/modules/manager/mise/schema.js +8 -7
  114. package/dist/modules/manager/mise/schema.js.map +1 -1
  115. package/dist/modules/manager/mise/utils.d.ts +2 -2
  116. package/dist/modules/manager/mise/utils.js +1 -1
  117. package/dist/modules/manager/mise/utils.js.map +1 -1
  118. package/dist/modules/manager/npm/extract/index.js.map +1 -1
  119. package/dist/modules/manager/npm/extract/pnpm.d.ts +3 -4
  120. package/dist/modules/manager/npm/extract/pnpm.js +1 -1
  121. package/dist/modules/manager/npm/extract/pnpm.js.map +1 -1
  122. package/dist/modules/manager/npm/extract/yarnrc.d.ts +4 -4
  123. package/dist/modules/manager/npm/extract/yarnrc.js +2 -1
  124. package/dist/modules/manager/npm/extract/yarnrc.js.map +1 -1
  125. package/dist/modules/manager/npm/post-update/types.d.ts +5 -5
  126. package/dist/modules/manager/npm/post-update/types.js.map +1 -1
  127. package/dist/modules/manager/npm/post-update/utils.d.ts +4 -4
  128. package/dist/modules/manager/npm/post-update/utils.js.map +1 -1
  129. package/dist/modules/manager/npm/schema.d.ts +92 -10
  130. package/dist/modules/manager/npm/schema.js +16 -15
  131. package/dist/modules/manager/npm/schema.js.map +1 -1
  132. package/dist/modules/manager/npm/update/dependency/pnpm.js +1 -1
  133. package/dist/modules/manager/npm/update/dependency/pnpm.js.map +1 -1
  134. package/dist/modules/manager/nuget/schema.d.ts +55 -2
  135. package/dist/modules/manager/nuget/schema.js +6 -5
  136. package/dist/modules/manager/nuget/schema.js.map +1 -1
  137. package/dist/modules/manager/ocb/extract.js +1 -1
  138. package/dist/modules/manager/ocb/extract.js.map +1 -1
  139. package/dist/modules/manager/ocb/schema.d.ts +4 -4
  140. package/dist/modules/manager/ocb/schema.js +9 -9
  141. package/dist/modules/manager/ocb/schema.js.map +1 -1
  142. package/dist/modules/manager/pep621/extract.d.ts +1 -1
  143. package/dist/modules/manager/pep621/extract.js +1 -1
  144. package/dist/modules/manager/pep621/extract.js.map +1 -1
  145. package/dist/modules/manager/pep621/processors/pdm.js +1 -1
  146. package/dist/modules/manager/pep621/processors/pdm.js.map +1 -1
  147. package/dist/modules/manager/pep621/processors/uv.js +1 -1
  148. package/dist/modules/manager/pep621/processors/uv.js.map +1 -1
  149. package/dist/modules/manager/pep621/schema.d.ts +247 -9
  150. package/dist/modules/manager/pep621/schema.js +12 -10
  151. package/dist/modules/manager/pep621/schema.js.map +1 -1
  152. package/dist/modules/manager/pep723/extract.js +1 -1
  153. package/dist/modules/manager/pep723/extract.js.map +1 -1
  154. package/dist/modules/manager/pep723/schema.d.ts +1 -1
  155. package/dist/modules/manager/pep723/schema.js +2 -2
  156. package/dist/modules/manager/pep723/schema.js.map +1 -1
  157. package/dist/modules/manager/pixi/extract.js +7 -4
  158. package/dist/modules/manager/pixi/extract.js.map +1 -1
  159. package/dist/modules/manager/pixi/schema.d.ts +4 -296
  160. package/dist/modules/manager/pixi/schema.js +4 -11
  161. package/dist/modules/manager/pixi/schema.js.map +1 -1
  162. package/dist/modules/manager/poetry/artifacts.js +2 -2
  163. package/dist/modules/manager/poetry/artifacts.js.map +1 -1
  164. package/dist/modules/manager/poetry/extract.js +1 -1
  165. package/dist/modules/manager/poetry/extract.js.map +1 -1
  166. package/dist/modules/manager/poetry/schema.d.ts +107 -4
  167. package/dist/modules/manager/poetry/schema.js +6 -5
  168. package/dist/modules/manager/poetry/schema.js.map +1 -1
  169. package/dist/modules/manager/poetry/update-locked.js +2 -2
  170. package/dist/modules/manager/poetry/update-locked.js.map +1 -1
  171. package/dist/modules/manager/pub/extract.js.map +1 -1
  172. package/dist/modules/manager/pub/schema.d.ts +82 -4
  173. package/dist/modules/manager/pub/schema.js +10 -8
  174. package/dist/modules/manager/pub/schema.js.map +1 -1
  175. package/dist/modules/manager/pub/utils.d.ts +3 -3
  176. package/dist/modules/manager/pub/utils.js +2 -2
  177. package/dist/modules/manager/pub/utils.js.map +1 -1
  178. package/dist/modules/manager/renovate-config-presets/extract.js +1 -1
  179. package/dist/modules/manager/renovate-config-presets/extract.js.map +1 -1
  180. package/dist/modules/manager/renovate-config-presets/schema.d.ts +1 -1
  181. package/dist/modules/manager/renovate-config-presets/schema.js +2 -2
  182. package/dist/modules/manager/renovate-config-presets/schema.js.map +1 -1
  183. package/dist/modules/platform/azure/azure-helper.js +1 -1
  184. package/dist/modules/platform/azure/azure-helper.js.map +1 -1
  185. package/dist/modules/platform/azure/schema.d.ts +3 -3
  186. package/dist/modules/platform/azure/schema.js +4 -4
  187. package/dist/modules/platform/azure/schema.js.map +1 -1
  188. package/dist/modules/platform/bitbucket/schema.d.ts +1 -1
  189. package/dist/modules/platform/bitbucket/schema.js +7 -7
  190. package/dist/modules/platform/bitbucket/schema.js.map +1 -1
  191. package/dist/modules/platform/bitbucket-server/index.js +2 -2
  192. package/dist/modules/platform/bitbucket-server/index.js.map +1 -1
  193. package/dist/modules/platform/bitbucket-server/schema.d.ts +2 -2
  194. package/dist/modules/platform/bitbucket-server/schema.js +6 -6
  195. package/dist/modules/platform/bitbucket-server/schema.js.map +1 -1
  196. package/dist/modules/platform/gitea/schema.d.ts +3 -3
  197. package/dist/modules/platform/gitea/schema.js +3 -3
  198. package/dist/modules/platform/gitea/schema.js.map +1 -1
  199. package/dist/modules/platform/github/index.js +1 -1
  200. package/dist/modules/platform/github/index.js.map +1 -1
  201. package/dist/modules/platform/github/schema.d.ts +1 -2
  202. package/dist/modules/platform/github/schema.js +8 -8
  203. package/dist/modules/platform/github/schema.js.map +1 -1
  204. package/dist/util/cache/repository/http-cache.js +1 -1
  205. package/dist/util/cache/repository/http-cache.js.map +1 -1
  206. package/dist/util/emoji.js +2 -2
  207. package/dist/util/emoji.js.map +1 -1
  208. package/dist/util/http/cache/abstract-http-cache-provider.d.ts +1 -1
  209. package/dist/util/http/cache/abstract-http-cache-provider.js +2 -2
  210. package/dist/util/http/cache/abstract-http-cache-provider.js.map +1 -1
  211. package/dist/util/http/cache/schema.d.ts +2 -2
  212. package/dist/util/http/cache/schema.js +2 -2
  213. package/dist/util/http/cache/schema.js.map +1 -1
  214. package/dist/workers/repository/update/pr/changelog/bitbucket/index.js +1 -1
  215. package/dist/workers/repository/update/pr/changelog/bitbucket/index.js.map +1 -1
  216. package/dist/workers/repository/update/pr/changelog/forgejo/index.js +3 -3
  217. package/dist/workers/repository/update/pr/changelog/forgejo/index.js.map +1 -1
  218. package/dist/workers/repository/update/pr/changelog/gitea/index.js +3 -3
  219. package/dist/workers/repository/update/pr/changelog/gitea/index.js.map +1 -1
  220. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export declare const PnpmCatalogs: z.ZodObject<{
2
+ export declare const PnpmCatalogsSchema: z.ZodObject<{
3
3
  catalog: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
4
4
  catalogs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>>;
5
5
  }, "strip", z.ZodTypeAny, {
@@ -9,7 +9,7 @@ export declare const PnpmCatalogs: z.ZodObject<{
9
9
  catalog?: Record<string, string> | undefined;
10
10
  catalogs?: Record<string, Record<string, string>> | undefined;
11
11
  }>;
12
- export declare const YarnConfig: z.ZodPipeline<z.ZodEffects<z.ZodString, string | number | boolean | import("type-fest").JsonObject | import("type-fest").JsonValue[] | readonly import("type-fest").JsonValue[] | null, string>, z.ZodObject<{
12
+ export declare const YarnrcSchema: z.ZodObject<{
13
13
  npmRegistryServer: z.ZodOptional<z.ZodString>;
14
14
  npmScopes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
15
15
  npmRegistryServer: z.ZodOptional<z.ZodString>;
@@ -28,9 +28,9 @@ export declare const YarnConfig: z.ZodPipeline<z.ZodEffects<z.ZodString, string
28
28
  npmScopes?: Record<string, {
29
29
  npmRegistryServer?: string | undefined;
30
30
  }> | undefined;
31
- }>>;
32
- export type YarnConfig = z.infer<typeof YarnConfig>;
33
- export declare const PnpmWorkspaceFile: z.ZodIntersection<z.ZodObject<{
31
+ }>;
32
+ export type YarnrcConfig = z.infer<typeof YarnrcSchema>;
33
+ export declare const PnpmWorkspaceFileSchema: z.ZodIntersection<z.ZodObject<{
34
34
  packages: z.ZodArray<z.ZodString, "many">;
35
35
  }, "strip", z.ZodTypeAny, {
36
36
  packages: string[];
@@ -46,11 +46,94 @@ export declare const PnpmWorkspaceFile: z.ZodIntersection<z.ZodObject<{
46
46
  catalog?: Record<string, string> | undefined;
47
47
  catalogs?: Record<string, Record<string, string>> | undefined;
48
48
  }>>;
49
- export type PnpmWorkspaceFile = z.infer<typeof PnpmWorkspaceFile>;
50
- export declare const PackageManager: z.ZodEffects<z.ZodEffects<z.ZodString, string[], string>, {
49
+ export declare const PackageManagerSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string[], string>, {
51
50
  name: string;
52
51
  version: string;
53
52
  }, string>;
53
+ export declare const PackageJsonSchema: z.ZodObject<{
54
+ devEngines: z.ZodOptional<z.ZodObject<{
55
+ packageManager: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
56
+ name: z.ZodString;
57
+ version: z.ZodOptional<z.ZodString>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ name: string;
60
+ version?: string | undefined;
61
+ }, {
62
+ name: string;
63
+ version?: string | undefined;
64
+ }>, z.ZodArray<z.ZodObject<{
65
+ name: z.ZodString;
66
+ version: z.ZodOptional<z.ZodString>;
67
+ }, "strip", z.ZodTypeAny, {
68
+ name: string;
69
+ version?: string | undefined;
70
+ }, {
71
+ name: string;
72
+ version?: string | undefined;
73
+ }>, "many">]>>;
74
+ }, "strip", z.ZodTypeAny, {
75
+ packageManager?: {
76
+ name: string;
77
+ version?: string | undefined;
78
+ } | {
79
+ name: string;
80
+ version?: string | undefined;
81
+ }[] | undefined;
82
+ }, {
83
+ packageManager?: {
84
+ name: string;
85
+ version?: string | undefined;
86
+ } | {
87
+ name: string;
88
+ version?: string | undefined;
89
+ }[] | undefined;
90
+ }>>;
91
+ engines: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodAny>, Record<string, string>, Record<string, any>>>;
92
+ dependencies: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodAny>, Record<string, string>, Record<string, any>>>;
93
+ devDependencies: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodAny>, Record<string, string>, Record<string, any>>>;
94
+ peerDependencies: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodAny>, Record<string, string>, Record<string, any>>>;
95
+ packageManager: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string[], string>, {
96
+ name: string;
97
+ version: string;
98
+ }, string>>;
99
+ volta: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodAny>, Record<string, string>, Record<string, any>>>;
100
+ }, "strip", z.ZodTypeAny, {
101
+ dependencies?: Record<string, string> | undefined;
102
+ devDependencies?: Record<string, string> | undefined;
103
+ peerDependencies?: Record<string, string> | undefined;
104
+ engines?: Record<string, string> | undefined;
105
+ packageManager?: {
106
+ name: string;
107
+ version: string;
108
+ } | undefined;
109
+ volta?: Record<string, string> | undefined;
110
+ devEngines?: {
111
+ packageManager?: {
112
+ name: string;
113
+ version?: string | undefined;
114
+ } | {
115
+ name: string;
116
+ version?: string | undefined;
117
+ }[] | undefined;
118
+ } | undefined;
119
+ }, {
120
+ dependencies?: Record<string, any> | undefined;
121
+ devDependencies?: Record<string, any> | undefined;
122
+ peerDependencies?: Record<string, any> | undefined;
123
+ engines?: Record<string, any> | undefined;
124
+ packageManager?: string | undefined;
125
+ volta?: Record<string, any> | undefined;
126
+ devEngines?: {
127
+ packageManager?: {
128
+ name: string;
129
+ version?: string | undefined;
130
+ } | {
131
+ name: string;
132
+ version?: string | undefined;
133
+ }[] | undefined;
134
+ } | undefined;
135
+ }>;
136
+ export type PackageJsonSchema = z.infer<typeof PackageJsonSchema>;
54
137
  export declare const PackageJson: z.ZodPipeline<z.ZodEffects<z.ZodString, string | number | boolean | import("type-fest").JsonObject | import("type-fest").JsonValue[] | readonly import("type-fest").JsonValue[] | null, string>, z.ZodObject<{
55
138
  devEngines: z.ZodOptional<z.ZodObject<{
56
139
  packageManager: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
@@ -134,8 +217,7 @@ export declare const PackageJson: z.ZodPipeline<z.ZodEffects<z.ZodString, string
134
217
  }[] | undefined;
135
218
  } | undefined;
136
219
  }>>;
137
- export type PackageJson = z.infer<typeof PackageJson>;
138
- export declare const PackageLockV3: z.ZodObject<{
220
+ export declare const PackageLockV3Schema: z.ZodObject<{
139
221
  lockfileVersion: z.ZodLiteral<3>;
140
222
  packages: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodAny>, Record<string, {
141
223
  version: string;
@@ -149,7 +231,7 @@ export declare const PackageLockV3: z.ZodObject<{
149
231
  lockfileVersion: 3;
150
232
  packages: Record<string, any>;
151
233
  }>;
152
- export declare const PackageLockPreV3: z.ZodEffects<z.ZodObject<{
234
+ export declare const PackageLockPreV3Schema: z.ZodEffects<z.ZodObject<{
153
235
  lockfileVersion: z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<1>]>;
154
236
  dependencies: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodAny>, Record<string, {
155
237
  version: string;
@@ -1,26 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PackageLock = exports.PackageLockPreV3 = exports.PackageLockV3 = exports.PackageJson = exports.PackageManager = exports.PnpmWorkspaceFile = exports.YarnConfig = exports.PnpmCatalogs = void 0;
3
+ exports.PackageLock = exports.PackageLockPreV3Schema = exports.PackageLockV3Schema = exports.PackageJson = exports.PackageJsonSchema = exports.PackageManagerSchema = exports.PnpmWorkspaceFileSchema = exports.YarnrcSchema = exports.PnpmCatalogsSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const schema_utils_1 = require("../../../util/schema-utils");
6
- exports.PnpmCatalogs = zod_1.z.object({
6
+ exports.PnpmCatalogsSchema = zod_1.z.object({
7
7
  catalog: zod_1.z.optional(zod_1.z.record(zod_1.z.string())),
8
8
  catalogs: zod_1.z.optional(zod_1.z.record(zod_1.z.record(zod_1.z.string()))),
9
9
  });
10
- exports.YarnConfig = schema_utils_1.Yaml.pipe(zod_1.z.object({
10
+ exports.YarnrcSchema = zod_1.z.object({
11
11
  npmRegistryServer: zod_1.z.string().optional(),
12
12
  npmScopes: zod_1.z
13
13
  .record(zod_1.z.object({
14
14
  npmRegistryServer: zod_1.z.string().optional(),
15
15
  }))
16
16
  .optional(),
17
- }));
18
- exports.PnpmWorkspaceFile = zod_1.z
17
+ });
18
+ exports.PnpmWorkspaceFileSchema = zod_1.z
19
19
  .object({
20
20
  packages: zod_1.z.array(zod_1.z.string()),
21
21
  })
22
- .and(exports.PnpmCatalogs);
23
- exports.PackageManager = zod_1.z
22
+ .and(exports.PnpmCatalogsSchema);
23
+ exports.PackageManagerSchema = zod_1.z
24
24
  .string()
25
25
  .transform((val) => val.split('@'))
26
26
  .transform(([name, ...version]) => ({ name, version: version.join('@') }));
@@ -28,26 +28,27 @@ const DevEngineDependency = zod_1.z.object({
28
28
  name: zod_1.z.string(),
29
29
  version: zod_1.z.string().optional(),
30
30
  });
31
- const DevEngine = zod_1.z.object({
31
+ const DevEngineSchema = zod_1.z.object({
32
32
  packageManager: DevEngineDependency.or(zod_1.z.array(DevEngineDependency)).optional(),
33
33
  });
34
- exports.PackageJson = schema_utils_1.Json.pipe(zod_1.z.object({
35
- devEngines: DevEngine.optional(),
34
+ exports.PackageJsonSchema = zod_1.z.object({
35
+ devEngines: DevEngineSchema.optional(),
36
36
  engines: (0, schema_utils_1.LooseRecord)(zod_1.z.string()).optional(),
37
37
  dependencies: (0, schema_utils_1.LooseRecord)(zod_1.z.string()).optional(),
38
38
  devDependencies: (0, schema_utils_1.LooseRecord)(zod_1.z.string()).optional(),
39
39
  peerDependencies: (0, schema_utils_1.LooseRecord)(zod_1.z.string()).optional(),
40
- packageManager: exports.PackageManager.optional(),
40
+ packageManager: exports.PackageManagerSchema.optional(),
41
41
  volta: (0, schema_utils_1.LooseRecord)(zod_1.z.string()).optional(),
42
- }));
43
- exports.PackageLockV3 = zod_1.z.object({
42
+ });
43
+ exports.PackageJson = schema_utils_1.Json.pipe(exports.PackageJsonSchema);
44
+ exports.PackageLockV3Schema = zod_1.z.object({
44
45
  lockfileVersion: zod_1.z.literal(3),
45
46
  packages: (0, schema_utils_1.LooseRecord)(zod_1.z
46
47
  .string()
47
48
  .transform((x) => x.replace(/^node_modules\//, ''))
48
49
  .refine((x) => x.trim() !== ''), zod_1.z.object({ version: zod_1.z.string() })),
49
50
  });
50
- exports.PackageLockPreV3 = zod_1.z
51
+ exports.PackageLockPreV3Schema = zod_1.z
51
52
  .object({
52
53
  lockfileVersion: zod_1.z.union([zod_1.z.literal(2), zod_1.z.literal(1)]),
53
54
  dependencies: (0, schema_utils_1.LooseRecord)(zod_1.z.object({ version: zod_1.z.string() })),
@@ -56,7 +57,7 @@ exports.PackageLockPreV3 = zod_1.z
56
57
  lockfileVersion,
57
58
  packages,
58
59
  }));
59
- exports.PackageLock = schema_utils_1.Json.pipe(zod_1.z.union([exports.PackageLockV3, exports.PackageLockPreV3])).transform(({ packages, lockfileVersion }) => {
60
+ exports.PackageLock = schema_utils_1.Json.pipe(zod_1.z.union([exports.PackageLockV3Schema, exports.PackageLockPreV3Schema])).transform(({ packages, lockfileVersion }) => {
60
61
  const lockedVersions = {};
61
62
  for (const [entry, val] of Object.entries(packages)) {
62
63
  lockedVersions[entry] = val.version;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../lib/modules/manager/npm/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,6DAAqE;AAExD,QAAA,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IACnC,OAAO,EAAE,OAAC,CAAC,QAAQ,CAAC,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACzC,QAAQ,EAAE,OAAC,CAAC,QAAQ,CAAC,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;CACrD,CAAC,CAAC;AAEU,QAAA,UAAU,GAAG,mBAAI,CAAC,IAAI,CACjC,OAAC,CAAC,MAAM,CAAC;IACP,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,SAAS,EAAE,OAAC;SACT,MAAM,CACL,OAAC,CAAC,MAAM,CAAC;QACP,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACzC,CAAC,CACH;SACA,QAAQ,EAAE;CACd,CAAC,CACH,CAAC;AAIW,QAAA,iBAAiB,GAAG,OAAC;KAC/B,MAAM,CAAC;IACN,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC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E;IAC5C,MAAM,cAAc,GAA2B,EAAE,CAAC;IAClD,KAAK,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpD,cAAc,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC;IACtC,CAAC;IACD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC;AAC7C,CAAC,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { Json, LooseRecord, Yaml } from '../../../util/schema-utils';\n\nexport const PnpmCatalogs = z.object({\n catalog: z.optional(z.record(z.string())),\n catalogs: z.optional(z.record(z.record(z.string()))),\n});\n\nexport const YarnConfig = Yaml.pipe(\n z.object({\n npmRegistryServer: z.string().optional(),\n npmScopes: z\n .record(\n z.object({\n npmRegistryServer: z.string().optional(),\n }),\n )\n .optional(),\n }),\n);\n\nexport type YarnConfig = z.infer<typeof YarnConfig>;\n\nexport const PnpmWorkspaceFile = z\n .object({\n packages: z.array(z.string()),\n })\n .and(PnpmCatalogs);\nexport type PnpmWorkspaceFile = z.infer<typeof PnpmWorkspaceFile>;\n\nexport const PackageManager = z\n .string()\n .transform((val) => val.split('@'))\n .transform(([name, ...version]) => ({ name, version: version.join('@') }));\n\nconst DevEngineDependency = z.object({\n name: z.string(),\n version: z.string().optional(),\n});\n\nconst DevEngine = z.object({\n packageManager: DevEngineDependency.or(\n z.array(DevEngineDependency),\n ).optional(),\n});\n\nexport const PackageJson = Json.pipe(\n z.object({\n devEngines: DevEngine.optional(),\n engines: LooseRecord(z.string()).optional(),\n dependencies: LooseRecord(z.string()).optional(),\n devDependencies: LooseRecord(z.string()).optional(),\n peerDependencies: LooseRecord(z.string()).optional(),\n packageManager: PackageManager.optional(),\n volta: LooseRecord(z.string()).optional(),\n }),\n);\n\nexport type PackageJson = z.infer<typeof PackageJson>;\n\nexport const PackageLockV3 = z.object({\n lockfileVersion: z.literal(3),\n packages: LooseRecord(\n z\n .string()\n .transform((x) => x.replace(/^node_modules\\//, ''))\n .refine((x) => x.trim() !== ''),\n z.object({ version: z.string() }),\n ),\n});\n\nexport const PackageLockPreV3 = z\n .object({\n lockfileVersion: z.union([z.literal(2), z.literal(1)]),\n dependencies: LooseRecord(z.object({ version: z.string() })),\n })\n .transform(({ lockfileVersion, dependencies: packages }) => ({\n lockfileVersion,\n packages,\n }));\n\nexport const PackageLock = Json.pipe(\n z.union([PackageLockV3, PackageLockPreV3]),\n).transform(({ packages, lockfileVersion }) => {\n const lockedVersions: Record<string, string> = {};\n for (const [entry, val] of Object.entries(packages)) {\n lockedVersions[entry] = val.version;\n }\n return { lockedVersions, lockfileVersion };\n});\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../lib/modules/manager/npm/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,6DAA+D;AAElD,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,OAAO,EAAE,OAAC,CAAC,QAAQ,CAAC,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACzC,QAAQ,EAAE,OAAC,CAAC,QAAQ,CAAC,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;CACrD,CAAC,CAAC;AAEU,QAAA,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IACnC,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,SAAS,EAAE,OAAC;SACT,MAAM,CACL,OAAC,CAAC,MAAM,CAAC;QACP,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACzC,CAAC,CACH;SACA,QAAQ,EAAE;CACd,CAAC,CAAC;AAIU,QAAA,uBAAuB,GAAG,OAAC;KACrC,MAAM,CAAC;IACN,QAAQ,EAAE,OAAC,CAAC,KAAK,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ACvD,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,EAAE,EAAE;IAC5C,MAAM,cAAc,GAA2B,EAAE,CAAC;IAClD,KAAK,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpD,cAAc,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC;IACtC,CAAC;IACD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC;AAC7C,CAAC,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { Json, LooseRecord } from '../../../util/schema-utils';\n\nexport const PnpmCatalogsSchema = z.object({\n catalog: z.optional(z.record(z.string())),\n catalogs: z.optional(z.record(z.record(z.string()))),\n});\n\nexport const YarnrcSchema = z.object({\n npmRegistryServer: z.string().optional(),\n npmScopes: z\n .record(\n z.object({\n npmRegistryServer: z.string().optional(),\n }),\n )\n .optional(),\n});\n\nexport type YarnrcConfig = z.infer<typeof YarnrcSchema>;\n\nexport const PnpmWorkspaceFileSchema = z\n .object({\n packages: z.array(z.string()),\n })\n .and(PnpmCatalogsSchema);\n\nexport const PackageManagerSchema = z\n .string()\n .transform((val) => val.split('@'))\n .transform(([name, ...version]) => ({ name, version: version.join('@') }));\n\nconst DevEngineDependency = z.object({\n name: z.string(),\n version: z.string().optional(),\n});\n\nconst DevEngineSchema = z.object({\n packageManager: DevEngineDependency.or(\n z.array(DevEngineDependency),\n ).optional(),\n});\n\nexport const PackageJsonSchema = z.object({\n devEngines: DevEngineSchema.optional(),\n engines: LooseRecord(z.string()).optional(),\n dependencies: LooseRecord(z.string()).optional(),\n devDependencies: LooseRecord(z.string()).optional(),\n peerDependencies: LooseRecord(z.string()).optional(),\n packageManager: PackageManagerSchema.optional(),\n volta: LooseRecord(z.string()).optional(),\n});\n\nexport type PackageJsonSchema = z.infer<typeof PackageJsonSchema>;\n\nexport const PackageJson = Json.pipe(PackageJsonSchema);\n\nexport const PackageLockV3Schema = z.object({\n lockfileVersion: z.literal(3),\n packages: LooseRecord(\n z\n .string()\n .transform((x) => x.replace(/^node_modules\\//, ''))\n .refine((x) => x.trim() !== ''),\n z.object({ version: z.string() }),\n ),\n});\n\nexport const PackageLockPreV3Schema = z\n .object({\n lockfileVersion: z.union([z.literal(2), z.literal(1)]),\n dependencies: LooseRecord(z.object({ version: z.string() })),\n })\n .transform(({ lockfileVersion, dependencies: packages }) => ({\n lockfileVersion,\n packages,\n }));\n\nexport const PackageLock = Json.pipe(\n z.union([PackageLockV3Schema, PackageLockPreV3Schema]),\n).transform(({ packages, lockfileVersion }) => {\n const lockedVersions: Record<string, string> = {};\n for (const [entry, val] of Object.entries(packages)) {\n lockedVersions[entry] = val.version;\n }\n return { lockedVersions, lockfileVersion };\n});\n"]}
@@ -29,7 +29,7 @@ function updatePnpmCatalogDependency({ fileContent, upgrade, }) {
29
29
  // values. Thus, we use both an annotated AST and a JS representation; the
30
30
  // former for manipulation, and the latter for querying/validation.
31
31
  document = (0, yaml_1.parseDocument)(fileContent, { keepSourceTokens: true });
32
- parsedContents = schema_1.PnpmCatalogs.parse(document.toJS());
32
+ parsedContents = schema_1.PnpmCatalogsSchema.parse(document.toJS());
33
33
  }
34
34
  catch (err) {
35
35
  logger_1.logger.debug({ err }, 'Could not parse pnpm-workspace YAML file.');
@@ -1 +1 @@
1
- {"version":3,"file":"pnpm.js","sourceRoot":"","sources":["../../../../../../lib/modules/manager/npm/update/dependency/pnpm.ts"],"names":[],"mappings":";;AAQA,kEAkFC;;AA1FD,kEAAkC;AAElC,+BAA0E;AAC1E,kDAA+C;AAE/C,yCAA4C;AAC5C,qCAA+D;AAE/D,SAAgB,2BAA2B,CAAC,EAC1C,WAAW,EACX,OAAO,GACgB;IACvB,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAElD,MAAM,WAAW,GAAG,OAAO,EAAE,KAAK,CAAC,GAA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O,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport type { Document } from 'yaml';\nimport { CST, isCollection, isPair, isScalar, parseDocument } from 'yaml';\nimport { logger } from '../../../../../logger';\nimport type { UpdateDependencyConfig } from '../../../types';\nimport { PnpmCatalogs } from '../../schema';\nimport { getNewGitValue, getNewNpmAliasValue } from './common';\n\nexport function updatePnpmCatalogDependency({\n fileContent,\n upgrade,\n}: UpdateDependencyConfig): string | null {\n const { depType, managerData, depName } = upgrade;\n\n const catalogName = depType?.split('.').at(-1);\n\n /* v8 ignore start -- needs test */\n if (!is.string(catalogName)) {\n logger.error(\n 'No catalogName was found; this is likely an extraction error.',\n );\n return null;\n } /* v8 ignore stop -- needs test */\n\n let { newValue } = upgrade;\n\n newValue = getNewGitValue(upgrade) ?? newValue;\n newValue = getNewNpmAliasValue(newValue, upgrade) ?? newValue;\n\n logger.trace(\n `npm.updatePnpmCatalogDependency(): ${depType}:${/* v8 ignore next -- needs test */ managerData?.catalogName}.${depName} = ${newValue}`,\n );\n\n let document;\n let parsedContents;\n\n try {\n // In order to preserve the original formatting as much as possible, we want\n // manipulate the CST directly. Using the AST (the result of parseDocument)\n // does not guarantee that formatting would be the same after\n // stringification. However, the CST is more annoying to query for certain\n // values. Thus, we use both an annotated AST and a JS representation; the\n // former for manipulation, and the latter for querying/validation.\n document = parseDocument(fileContent, { keepSourceTokens: true });\n parsedContents = PnpmCatalogs.parse(document.toJS());\n } catch (err) {\n logger.debug({ err }, 'Could not parse pnpm-workspace YAML file.');\n return null;\n }\n\n // In pnpm-workspace.yaml, the default catalog can be either `catalog` or\n // `catalog.default`, but not both (pnpm throws outright with a config error).\n // Thus, we must check which entry is being used, to reference it from / set\n // it in the right place.\n const usesImplicitDefaultCatalog = parsedContents.catalog !== undefined;\n\n const oldVersion =\n catalogName === 'default' && usesImplicitDefaultCatalog\n ? parsedContents.catalog?.[depName!]\n : parsedContents.catalogs?.[catalogName]?.[depName!];\n\n if (oldVersion === newValue) {\n logger.trace('Version is already updated');\n return fileContent;\n }\n\n // Update the value\n const path = getDepPath({\n depName: depName!,\n catalogName,\n usesImplicitDefaultCatalog,\n });\n\n const modifiedDocument = changeDependencyIn(document, path, {\n newValue,\n newName: upgrade.newName,\n });\n\n if (!modifiedDocument) {\n // Case where we are explicitly unable to substitute the key/value, for\n // example if the value was an alias.\n return null;\n }\n\n /* v8 ignore next 3 -- this should not happen in practice, but we must satisfy the types */\n if (!modifiedDocument.contents?.srcToken) {\n return null;\n }\n\n return CST.stringify(modifiedDocument.contents.srcToken);\n}\n\n/**\n * Change the scalar name and/or value of a collection item in a YAML document,\n * while keeping formatting consistent. Mutates the given document.\n */\nfunction changeDependencyIn(\n document: Document,\n path: string[],\n { newName, newValue }: { newName?: string; newValue?: string },\n): Document | null {\n const parentPath = path.slice(0, -1);\n const relevantItemKey = path.at(-1);\n\n const parentNode = document.getIn(parentPath);\n\n if (!parentNode || !isCollection(parentNode)) {\n return null;\n }\n\n const relevantNode = parentNode.items.find(\n (item) =>\n isPair(item) && isScalar(item.key) && item.key.value === relevantItemKey,\n );\n\n if (!relevantNode || !isPair(relevantNode)) {\n return null;\n }\n\n if (newName) {\n /* v8 ignore next 3 -- the try..catch block above already throws if a key is an alias */\n if (!CST.isScalar(relevantNode.srcToken?.key)) {\n return null;\n }\n CST.setScalarValue(relevantNode.srcToken.key, newName);\n }\n\n if (newValue) {\n // We only support scalar values when substituting. This explicitly avoids\n // substituting aliases, since those can be resolved from a shared location,\n // and replacing either the referrent anchor or the alias would be wrong in\n // the general case. We leave this up to the user, e.g. via a Regex custom\n // manager.\n if (!CST.isScalar(relevantNode.srcToken?.value)) {\n return null;\n }\n CST.setScalarValue(relevantNode.srcToken.value, newValue);\n }\n\n return document;\n}\n\nfunction getDepPath({\n catalogName,\n depName,\n usesImplicitDefaultCatalog,\n}: {\n usesImplicitDefaultCatalog: boolean;\n catalogName: string;\n depName: string;\n}): string[] {\n if (catalogName === 'default' && usesImplicitDefaultCatalog) {\n return ['catalog', depName];\n } else {\n return ['catalogs', catalogName, depName];\n }\n}\n"]}
1
+ {"version":3,"file":"pnpm.js","sourceRoot":"","sources":["../../../../../../lib/modules/manager/npm/update/dependency/pnpm.ts"],"names":[],"mappings":";;AAQA,kEAkFC;;AA1FD,kEAAkC;AAElC,+BAA0E;AAC1E,kDAA+C;AAE/C,yCAAkD;AAClD,qCAA+D;AAE/D,SAAgB,2BAA2B,CAAC,EAC1C,WAAW,EACX,OAAO,GACgB;IACvB,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAElD,MAAM,WAAW,GAAG,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAE/C,mCAAmC;IACnC,IAAI,CAAC,YAAE,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QAC5B,eAAM,CAAC,KAAK,CACV,+DAA+D,CAChE,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,kCAAkC;IAEpC,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAE3B,QAAQ,GAAG,IAAA,uBAAc,EAAC,OAAO,CAAC,IAAI,QAAQ,CAAC;IAC/C,QAAQ,GAAG,IAAA,4BAAmB,EAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,QAAQ,CAAC;IAE9D,eAAM,CAAC,KAAK,CACV,sCAAsC,OAAO,IAAI,CAAA,kCAAmC,WAAW,EAAE,WAAW,IAAI,OAAO,MAAM,QAAQ,EAAE,CACxI,CAAC;IAEF,IAAI,QAAQ,CAAC;IACb,IAAI,cAAc,CAAC;IAEnB,IAAI,CAAC;QACH,4EAA4E;QAC5E,2EAA2E;QAC3E,6DAA6D;QAC7D,0EAA0E;QAC1E,0EAA0E;QAC1E,mEAAmE;QACnE,QAAQ,GAAG,IAAA,oBA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0E;QAC1E,WAAW;QACX,IAAI,CAAC,UAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;YAChD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,UAAG,CAAC,cAAc,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,UAAU,CAAC,EAClB,WAAW,EACX,OAAO,EACP,0BAA0B,GAK3B;IACC,IAAI,WAAW,KAAK,SAAS,IAAI,0BAA0B,EAAE,CAAC;QAC5D,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport type { Document } from 'yaml';\nimport { CST, isCollection, isPair, isScalar, parseDocument } from 'yaml';\nimport { logger } from '../../../../../logger';\nimport type { UpdateDependencyConfig } from '../../../types';\nimport { PnpmCatalogsSchema } from '../../schema';\nimport { getNewGitValue, getNewNpmAliasValue } from './common';\n\nexport function updatePnpmCatalogDependency({\n fileContent,\n upgrade,\n}: UpdateDependencyConfig): string | null {\n const { depType, managerData, depName } = upgrade;\n\n const catalogName = depType?.split('.').at(-1);\n\n /* v8 ignore start -- needs test */\n if (!is.string(catalogName)) {\n logger.error(\n 'No catalogName was found; this is likely an extraction error.',\n );\n return null;\n } /* v8 ignore stop -- needs test */\n\n let { newValue } = upgrade;\n\n newValue = getNewGitValue(upgrade) ?? newValue;\n newValue = getNewNpmAliasValue(newValue, upgrade) ?? newValue;\n\n logger.trace(\n `npm.updatePnpmCatalogDependency(): ${depType}:${/* v8 ignore next -- needs test */ managerData?.catalogName}.${depName} = ${newValue}`,\n );\n\n let document;\n let parsedContents;\n\n try {\n // In order to preserve the original formatting as much as possible, we want\n // manipulate the CST directly. Using the AST (the result of parseDocument)\n // does not guarantee that formatting would be the same after\n // stringification. However, the CST is more annoying to query for certain\n // values. Thus, we use both an annotated AST and a JS representation; the\n // former for manipulation, and the latter for querying/validation.\n document = parseDocument(fileContent, { keepSourceTokens: true });\n parsedContents = PnpmCatalogsSchema.parse(document.toJS());\n } catch (err) {\n logger.debug({ err }, 'Could not parse pnpm-workspace YAML file.');\n return null;\n }\n\n // In pnpm-workspace.yaml, the default catalog can be either `catalog` or\n // `catalog.default`, but not both (pnpm throws outright with a config error).\n // Thus, we must check which entry is being used, to reference it from / set\n // it in the right place.\n const usesImplicitDefaultCatalog = parsedContents.catalog !== undefined;\n\n const oldVersion =\n catalogName === 'default' && usesImplicitDefaultCatalog\n ? parsedContents.catalog?.[depName!]\n : parsedContents.catalogs?.[catalogName]?.[depName!];\n\n if (oldVersion === newValue) {\n logger.trace('Version is already updated');\n return fileContent;\n }\n\n // Update the value\n const path = getDepPath({\n depName: depName!,\n catalogName,\n usesImplicitDefaultCatalog,\n });\n\n const modifiedDocument = changeDependencyIn(document, path, {\n newValue,\n newName: upgrade.newName,\n });\n\n if (!modifiedDocument) {\n // Case where we are explicitly unable to substitute the key/value, for\n // example if the value was an alias.\n return null;\n }\n\n /* v8 ignore next 3 -- this should not happen in practice, but we must satisfy the types */\n if (!modifiedDocument.contents?.srcToken) {\n return null;\n }\n\n return CST.stringify(modifiedDocument.contents.srcToken);\n}\n\n/**\n * Change the scalar name and/or value of a collection item in a YAML document,\n * while keeping formatting consistent. Mutates the given document.\n */\nfunction changeDependencyIn(\n document: Document,\n path: string[],\n { newName, newValue }: { newName?: string; newValue?: string },\n): Document | null {\n const parentPath = path.slice(0, -1);\n const relevantItemKey = path.at(-1);\n\n const parentNode = document.getIn(parentPath);\n\n if (!parentNode || !isCollection(parentNode)) {\n return null;\n }\n\n const relevantNode = parentNode.items.find(\n (item) =>\n isPair(item) && isScalar(item.key) && item.key.value === relevantItemKey,\n );\n\n if (!relevantNode || !isPair(relevantNode)) {\n return null;\n }\n\n if (newName) {\n /* v8 ignore next 3 -- the try..catch block above already throws if a key is an alias */\n if (!CST.isScalar(relevantNode.srcToken?.key)) {\n return null;\n }\n CST.setScalarValue(relevantNode.srcToken.key, newName);\n }\n\n if (newValue) {\n // We only support scalar values when substituting. This explicitly avoids\n // substituting aliases, since those can be resolved from a shared location,\n // and replacing either the referrent anchor or the alias would be wrong in\n // the general case. We leave this up to the user, e.g. via a Regex custom\n // manager.\n if (!CST.isScalar(relevantNode.srcToken?.value)) {\n return null;\n }\n CST.setScalarValue(relevantNode.srcToken.value, newValue);\n }\n\n return document;\n}\n\nfunction getDepPath({\n catalogName,\n depName,\n usesImplicitDefaultCatalog,\n}: {\n usesImplicitDefaultCatalog: boolean;\n catalogName: string;\n depName: string;\n}): string[] {\n if (catalogName === 'default' && usesImplicitDefaultCatalog) {\n return ['catalog', depName];\n } else {\n return ['catalogs', catalogName, depName];\n }\n}\n"]}
@@ -4,13 +4,66 @@ import { z } from 'zod';
4
4
  *
5
5
  * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#rollforward
6
6
  */
7
- declare const RollForward: z.ZodEnum<["patch", "feature", "minor", "major", "latestPatch", "latestFeature", "latestMinor", "latestMajor", "disable"]>;
8
- export type RollForward = z.infer<typeof RollForward>;
7
+ declare const RollForwardSchema: z.ZodEnum<["patch", "feature", "minor", "major", "latestPatch", "latestFeature", "latestMinor", "latestMajor", "disable"]>;
8
+ export type RollForward = z.infer<typeof RollForwardSchema>;
9
9
  /**
10
10
  * global.json schema
11
11
  *
12
12
  * https://learn.microsoft.com/en-us/dotnet/core/tools/global-json#allowprerelease
13
13
  */
14
+ export declare const GlobalJsonSchema: z.ZodObject<{
15
+ /**
16
+ * Specifies information about the .NET SDK to select.
17
+ */
18
+ sdk: z.ZodOptional<z.ZodObject<{
19
+ /**
20
+ * The version of the .NET SDK to use.
21
+ *
22
+ * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#version
23
+ */
24
+ version: z.ZodOptional<z.ZodString>;
25
+ /**
26
+ * The roll-forward policy to use when selecting an SDK version, either as a fallback when a specific SDK version is missing or as a directive to use a later version. A version must be specified with a rollForward value, unless you're setting it to latestMajor. The default roll forward behavior is determined by the matching rules.
27
+ *
28
+ * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#rollforward
29
+ */
30
+ rollForward: z.ZodOptional<z.ZodEnum<["patch", "feature", "minor", "major", "latestPatch", "latestFeature", "latestMinor", "latestMajor", "disable"]>>;
31
+ /**
32
+ * Indicates whether the SDK resolver should consider prerelease versions when selecting the SDK version to use.
33
+ *
34
+ * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#allowprerelease
35
+ */
36
+ allowPrerelease: z.ZodOptional<z.ZodBoolean>;
37
+ }, "strip", z.ZodTypeAny, {
38
+ version?: string | undefined;
39
+ rollForward?: "major" | "minor" | "patch" | "feature" | "latestPatch" | "latestFeature" | "latestMinor" | "latestMajor" | "disable" | undefined;
40
+ allowPrerelease?: boolean | undefined;
41
+ }, {
42
+ version?: string | undefined;
43
+ rollForward?: "major" | "minor" | "patch" | "feature" | "latestPatch" | "latestFeature" | "latestMinor" | "latestMajor" | "disable" | undefined;
44
+ allowPrerelease?: boolean | undefined;
45
+ }>>;
46
+ /**
47
+ * Lets you control the project SDK version in one place rather than in each individual project. For more information, see How project SDKs are resolved.
48
+ *
49
+ * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#msbuild-sdks
50
+ */
51
+ 'msbuild-sdks': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ sdk?: {
54
+ version?: string | undefined;
55
+ rollForward?: "major" | "minor" | "patch" | "feature" | "latestPatch" | "latestFeature" | "latestMinor" | "latestMajor" | "disable" | undefined;
56
+ allowPrerelease?: boolean | undefined;
57
+ } | undefined;
58
+ 'msbuild-sdks'?: Record<string, string> | undefined;
59
+ }, {
60
+ sdk?: {
61
+ version?: string | undefined;
62
+ rollForward?: "major" | "minor" | "patch" | "feature" | "latestPatch" | "latestFeature" | "latestMinor" | "latestMajor" | "disable" | undefined;
63
+ allowPrerelease?: boolean | undefined;
64
+ } | undefined;
65
+ 'msbuild-sdks'?: Record<string, string> | undefined;
66
+ }>;
14
67
  export declare const GlobalJson: z.ZodPipeline<z.ZodEffects<z.ZodString, string | number | boolean | import("type-fest").JsonObject | import("type-fest").JsonValue[] | readonly import("type-fest").JsonValue[] | null, string>, z.ZodObject<{
15
68
  /**
16
69
  * Specifies information about the .NET SDK to select.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GlobalJson = void 0;
3
+ exports.GlobalJson = exports.GlobalJsonSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const schema_utils_1 = require("../../../util/schema-utils");
6
6
  /**
@@ -8,7 +8,7 @@ const schema_utils_1 = require("../../../util/schema-utils");
8
8
  *
9
9
  * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#rollforward
10
10
  */
11
- const RollForward = zod_1.z.enum([
11
+ const RollForwardSchema = zod_1.z.enum([
12
12
  'patch',
13
13
  'feature',
14
14
  'minor',
@@ -24,7 +24,7 @@ const RollForward = zod_1.z.enum([
24
24
  *
25
25
  * https://learn.microsoft.com/en-us/dotnet/core/tools/global-json#allowprerelease
26
26
  */
27
- exports.GlobalJson = schema_utils_1.Jsonc.pipe(zod_1.z.object({
27
+ exports.GlobalJsonSchema = zod_1.z.object({
28
28
  /**
29
29
  * Specifies information about the .NET SDK to select.
30
30
  */
@@ -41,7 +41,7 @@ exports.GlobalJson = schema_utils_1.Jsonc.pipe(zod_1.z.object({
41
41
  *
42
42
  * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#rollforward
43
43
  */
44
- rollForward: RollForward.optional(),
44
+ rollForward: RollForwardSchema.optional(),
45
45
  /**
46
46
  * Indicates whether the SDK resolver should consider prerelease versions when selecting the SDK version to use.
47
47
  *
@@ -56,5 +56,6 @@ exports.GlobalJson = schema_utils_1.Jsonc.pipe(zod_1.z.object({
56
56
  * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#msbuild-sdks
57
57
  */
58
58
  'msbuild-sdks': zod_1.z.record(zod_1.z.string()).optional(),
59
- }));
59
+ });
60
+ exports.GlobalJson = schema_utils_1.Jsonc.pipe(exports.GlobalJsonSchema);
60
61
  //# sourceMappingURL=schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../lib/modules/manager/nuget/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,6DAAmD;AAEnD;;;;GAIG;AACH,MAAM,WAAW,GAAG,OAAC,CAAC,IAAI,CAAC;IACzB,OAAO;IACP,SAAS;IACT,OAAO;IACP,OAAO;IACP,aAAa;IACb,eAAe;IACf,aAAa;IACb,aAAa;IACb,SAAS;CACV,CAAC,CAAC;AAGH;;;;GAIG;AACU,QAAA,UAAU,GAAG,oBAAK,CAAC,IAAI,CAClC,OAAC,CAAC,MAAM,CAAC;IACP;;OAEG;IACH,GAAG,EAAE,OAAC;SACH,MAAM,CAAC;QACN;;;;WAIG;QACH,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC9B;;;;WAIG;QACH,WAAW,EAAE,WAAW,CAAC,QAAQ,EAAE;QACnC;;;;WAIG;QACH,eAAe,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;KACxC,CAAC;SACD,QAAQ,EAAE;IAEb;;;;OAIG;IACH,cAAc,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAChD,CAAC,CACH,CAAC","sourcesContent":["import { z } from 'zod';\nimport { Jsonc } from '../../../util/schema-utils';\n\n/**\n * The roll-forward policy to use when selecting an SDK version, either as a fallback when a specific SDK version is missing or as a directive to use a later version. A version must be specified with a rollForward value, unless you're setting it to latestMajor. The default roll forward behavior is determined by the matching rules.\n *\n * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#rollforward\n */\nconst RollForward = z.enum([\n 'patch',\n 'feature',\n 'minor',\n 'major',\n 'latestPatch',\n 'latestFeature',\n 'latestMinor',\n 'latestMajor',\n 'disable',\n]);\nexport type RollForward = z.infer<typeof RollForward>;\n\n/**\n * global.json schema\n *\n * https://learn.microsoft.com/en-us/dotnet/core/tools/global-json#allowprerelease\n */\nexport const GlobalJson = Jsonc.pipe(\n z.object({\n /**\n * Specifies information about the .NET SDK to select.\n */\n sdk: z\n .object({\n /**\n * The version of the .NET SDK to use.\n *\n * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#version\n */\n version: z.string().optional(),\n /**\n * The roll-forward policy to use when selecting an SDK version, either as a fallback when a specific SDK version is missing or as a directive to use a later version. A version must be specified with a rollForward value, unless you're setting it to latestMajor. The default roll forward behavior is determined by the matching rules.\n *\n * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#rollforward\n */\n rollForward: RollForward.optional(),\n /**\n * Indicates whether the SDK resolver should consider prerelease versions when selecting the SDK version to use.\n *\n * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#allowprerelease\n */\n allowPrerelease: z.boolean().optional(),\n })\n .optional(),\n\n /**\n * Lets you control the project SDK version in one place rather than in each individual project. For more information, see How project SDKs are resolved.\n *\n * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#msbuild-sdks\n */\n 'msbuild-sdks': z.record(z.string()).optional(),\n }),\n);\n\nexport type GlobalJson = z.infer<typeof GlobalJson>;\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../lib/modules/manager/nuget/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,6DAAmD;AAEnD;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,OAAC,CAAC,IAAI,CAAC;IAC/B,OAAO;IACP,SAAS;IACT,OAAO;IACP,OAAO;IACP,aAAa;IACb,eAAe;IACf,aAAa;IACb,aAAa;IACb,SAAS;CACV,CAAC,CAAC;AAGH;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC;;OAEG;IACH,GAAG,EAAE,OAAC;SACH,MAAM,CAAC;QACN;;;;WAIG;QACH,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC9B;;;;WAIG;QACH,WAAW,EAAE,iBAAiB,CAAC,QAAQ,EAAE;QACzC;;;;WAIG;QACH,eAAe,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;KACxC,CAAC;SACD,QAAQ,EAAE;IAEb;;;;OAIG;IACH,cAAc,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC;AAEU,QAAA,UAAU,GAAG,oBAAK,CAAC,IAAI,CAAC,wBAAgB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { Jsonc } from '../../../util/schema-utils';\n\n/**\n * The roll-forward policy to use when selecting an SDK version, either as a fallback when a specific SDK version is missing or as a directive to use a later version. A version must be specified with a rollForward value, unless you're setting it to latestMajor. The default roll forward behavior is determined by the matching rules.\n *\n * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#rollforward\n */\nconst RollForwardSchema = z.enum([\n 'patch',\n 'feature',\n 'minor',\n 'major',\n 'latestPatch',\n 'latestFeature',\n 'latestMinor',\n 'latestMajor',\n 'disable',\n]);\nexport type RollForward = z.infer<typeof RollForwardSchema>;\n\n/**\n * global.json schema\n *\n * https://learn.microsoft.com/en-us/dotnet/core/tools/global-json#allowprerelease\n */\nexport const GlobalJsonSchema = z.object({\n /**\n * Specifies information about the .NET SDK to select.\n */\n sdk: z\n .object({\n /**\n * The version of the .NET SDK to use.\n *\n * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#version\n */\n version: z.string().optional(),\n /**\n * The roll-forward policy to use when selecting an SDK version, either as a fallback when a specific SDK version is missing or as a directive to use a later version. A version must be specified with a rollForward value, unless you're setting it to latestMajor. The default roll forward behavior is determined by the matching rules.\n *\n * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#rollforward\n */\n rollForward: RollForwardSchema.optional(),\n /**\n * Indicates whether the SDK resolver should consider prerelease versions when selecting the SDK version to use.\n *\n * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#allowprerelease\n */\n allowPrerelease: z.boolean().optional(),\n })\n .optional(),\n\n /**\n * Lets you control the project SDK version in one place rather than in each individual project. For more information, see How project SDKs are resolved.\n *\n * https://learn.microsoft.com/de-de/dotnet/core/tools/global-json#msbuild-sdks\n */\n 'msbuild-sdks': z.record(z.string()).optional(),\n});\n\nexport const GlobalJson = Jsonc.pipe(GlobalJsonSchema);\nexport type GlobalJson = z.infer<typeof GlobalJson>;\n"]}
@@ -13,7 +13,7 @@ function extractPackageFile(content, packageFile, _config) {
13
13
  let definition = null;
14
14
  try {
15
15
  const yaml = (0, yaml_1.parseSingleYaml)(content);
16
- const parsed = schema_1.OCBConfig.safeParse(yaml);
16
+ const parsed = schema_1.OCBConfigSchema.safeParse(yaml);
17
17
  if (!parsed.success) {
18
18
  logger_1.logger.trace({ packageFile, error: parsed.error }, 'Failed to parse OCB schema');
19
19
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/ocb/extract.ts"],"names":[],"mappings":";;AAYA,gDAgDC;AAED,sCAoBC;;AAlFD,kEAAkC;AAClC,4CAAyC;AACzC,+CAA4C;AAC5C,6CAAqD;AACrD,4CAAmD;AAMnD,qCAAkD;AAElD,SAAgB,kBAAkB,CAChC,OAAe,EACf,WAAmB,EACnB,OAAuB;IAEvB,IAAI,UAAU,GAAqB,IAAI,CAAC;IACxC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAA,sBAAe,EAAC,OAAO,CAAC,CAAC;QACtC,MAAM,MAAM,GAAG,kBAAS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D,IAAI,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,UAAU,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;IAE/D,OAAO;QACL,kBAAkB,EAAE,UAAU,CAAC,IAAI,CAAC,OAAO;QAC3C,IAAI;KACL,CAAC;AACJ,CAAC;AAED,SAAgB,aAAa,CAC3B,MAAc,EACd,OAAe;IAEf,MAAM,IAAI,GAAwB,EAAE,CAAC;IACrC,IAAI,YAAE,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,MAAM,EAAE,CAAC;QAC7B,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAA,aAAK,EAAC,KAAK,CAAC,CAAC,CAAC;QACzE,IAAI,CAAC,IAAI,CAAC;YACR,UAAU,EAAE,iBAAY,CAAC,EAAE;YAC3B,OAAO;YACP,OAAO;YACP,YAAY;SACb,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { logger } from '../../../logger';\nimport { regEx } from '../../../util/regex';\nimport { parseSingleYaml } from '../../../util/yaml';\nimport { GoDatasource } from '../../datasource/go';\nimport type {\n ExtractConfig,\n PackageDependency,\n PackageFileContent,\n} from '../types';\nimport { type Module, OCBConfig } from './schema';\n\nexport function extractPackageFile(\n content: string,\n packageFile: string,\n _config?: ExtractConfig,\n): PackageFileContent | null {\n let definition: OCBConfig | null = null;\n try {\n const yaml = parseSingleYaml(content);\n const parsed = OCBConfig.safeParse(yaml);\n if (!parsed.success) {\n logger.trace(\n { packageFile, error: parsed.error },\n 'Failed to parse OCB schema',\n );\n return null;\n }\n\n definition = parsed.data;\n } catch (error) {\n logger.debug(\n { packageFile, error },\n 'OCB manager failed to parse file as YAML',\n );\n return null;\n }\n\n const deps: PackageDependency[] = [];\n if (definition.dist.otelcol_version) {\n deps.push({\n datasource: GoDatasource.id,\n depType: 'collector',\n depName: 'go.opentelemetry.io/collector',\n currentValue: definition.dist.otelcol_version,\n extractVersion: '^v(?<version>\\\\S+)',\n });\n }\n\n deps.push(...processModule(definition.connectors, 'connectors'));\n deps.push(...processModule(definition.exporters, 'exports'));\n deps.push(...processModule(definition.extensions, 'extensions'));\n deps.push(...processModule(definition.processors, 'processors'));\n deps.push(...processModule(definition.providers, 'providers'));\n deps.push(...processModule(definition.receivers, 'receivers'));\n\n return {\n packageFileVersion: definition.dist.version,\n deps,\n };\n}\n\nexport function processModule(\n module: Module,\n depType: string,\n): PackageDependency[] {\n const deps: PackageDependency[] = [];\n if (is.nullOrUndefined(module)) {\n return deps;\n }\n\n for (const element of module) {\n const [depName, currentValue] = element.gomod.trim().split(regEx(/\\s+/));\n deps.push({\n datasource: GoDatasource.id,\n depType,\n depName,\n currentValue,\n });\n }\n\n return deps;\n}\n"]}
1
+ {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/ocb/extract.ts"],"names":[],"mappings":";;AAYA,gDAgDC;AAED,sCAoBC;;AAlFD,kEAAkC;AAClC,4CAAyC;AACzC,+CAA4C;AAC5C,6CAAqD;AACrD,4CAAmD;AAMnD,qCAAwE;AAExE,SAAgB,kBAAkB,CAChC,OAAe,EACf,WAAmB,EACnB,OAAuB;IAEvB,IAAI,UAAU,GAAqB,IAAI,CAAC;IACxC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAA,sBAAe,EAAC,OAAO,CAAC,CAAC;QACtC,MAAM,MAAM,GAAG,wBAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,eAAM,CAAC,KAAK,CACV,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,EACpC,4BAA4B,CAC7B,CAAC;YACF,OA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aAAa,CAC3B,MAAc,EACd,OAAe;IAEf,MAAM,IAAI,GAAwB,EAAE,CAAC;IACrC,IAAI,YAAE,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,MAAM,EAAE,CAAC;QAC7B,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAA,aAAK,EAAC,KAAK,CAAC,CAAC,CAAC;QACzE,IAAI,CAAC,IAAI,CAAC;YACR,UAAU,EAAE,iBAAY,CAAC,EAAE;YAC3B,OAAO;YACP,OAAO;YACP,YAAY;SACb,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { logger } from '../../../logger';\nimport { regEx } from '../../../util/regex';\nimport { parseSingleYaml } from '../../../util/yaml';\nimport { GoDatasource } from '../../datasource/go';\nimport type {\n ExtractConfig,\n PackageDependency,\n PackageFileContent,\n} from '../types';\nimport { type Module, type OCBConfig, OCBConfigSchema } from './schema';\n\nexport function extractPackageFile(\n content: string,\n packageFile: string,\n _config?: ExtractConfig,\n): PackageFileContent | null {\n let definition: OCBConfig | null = null;\n try {\n const yaml = parseSingleYaml(content);\n const parsed = OCBConfigSchema.safeParse(yaml);\n if (!parsed.success) {\n logger.trace(\n { packageFile, error: parsed.error },\n 'Failed to parse OCB schema',\n );\n return null;\n }\n\n definition = parsed.data;\n } catch (error) {\n logger.debug(\n { packageFile, error },\n 'OCB manager failed to parse file as YAML',\n );\n return null;\n }\n\n const deps: PackageDependency[] = [];\n if (definition.dist.otelcol_version) {\n deps.push({\n datasource: GoDatasource.id,\n depType: 'collector',\n depName: 'go.opentelemetry.io/collector',\n currentValue: definition.dist.otelcol_version,\n extractVersion: '^v(?<version>\\\\S+)',\n });\n }\n\n deps.push(...processModule(definition.connectors, 'connectors'));\n deps.push(...processModule(definition.exporters, 'exports'));\n deps.push(...processModule(definition.extensions, 'extensions'));\n deps.push(...processModule(definition.processors, 'processors'));\n deps.push(...processModule(definition.providers, 'providers'));\n deps.push(...processModule(definition.receivers, 'receivers'));\n\n return {\n packageFileVersion: definition.dist.version,\n deps,\n };\n}\n\nexport function processModule(\n module: Module,\n depType: string,\n): PackageDependency[] {\n const deps: PackageDependency[] = [];\n if (is.nullOrUndefined(module)) {\n return deps;\n }\n\n for (const element of module) {\n const [depName, currentValue] = element.gomod.trim().split(regEx(/\\s+/));\n deps.push({\n datasource: GoDatasource.id,\n depType,\n depName,\n currentValue,\n });\n }\n\n return deps;\n}\n"]}
@@ -1,13 +1,13 @@
1
1
  import { z } from 'zod';
2
- declare const Module: z.ZodOptional<z.ZodArray<z.ZodObject<{
2
+ declare const ModuleSchema: z.ZodOptional<z.ZodArray<z.ZodObject<{
3
3
  gomod: z.ZodString;
4
4
  }, "strip", z.ZodTypeAny, {
5
5
  gomod: string;
6
6
  }, {
7
7
  gomod: string;
8
8
  }>, "many">>;
9
- export type Module = z.infer<typeof Module>;
10
- export declare const OCBConfig: z.ZodObject<{
9
+ export type Module = z.infer<typeof ModuleSchema>;
10
+ export declare const OCBConfigSchema: z.ZodObject<{
11
11
  dist: z.ZodObject<{
12
12
  otelcol_version: z.ZodOptional<z.ZodString>;
13
13
  module: z.ZodOptional<z.ZodString>;
@@ -112,5 +112,5 @@ export declare const OCBConfig: z.ZodObject<{
112
112
  gomod: string;
113
113
  }[] | undefined;
114
114
  }>;
115
- export type OCBConfig = z.infer<typeof OCBConfig>;
115
+ export type OCBConfig = z.infer<typeof OCBConfigSchema>;
116
116
  export {};
@@ -1,22 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OCBConfig = void 0;
3
+ exports.OCBConfigSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const Entry = zod_1.z.object({
6
6
  gomod: zod_1.z.string(),
7
7
  });
8
- const Module = zod_1.z.array(Entry).optional();
9
- exports.OCBConfig = zod_1.z.object({
8
+ const ModuleSchema = zod_1.z.array(Entry).optional();
9
+ exports.OCBConfigSchema = zod_1.z.object({
10
10
  dist: zod_1.z.object({
11
11
  otelcol_version: zod_1.z.string().optional(),
12
12
  module: zod_1.z.string().optional(),
13
13
  version: zod_1.z.string().optional(),
14
14
  }),
15
- extensions: Module,
16
- exporters: Module,
17
- receivers: Module,
18
- processors: Module,
19
- providers: Module,
20
- connectors: Module,
15
+ extensions: ModuleSchema,
16
+ exporters: ModuleSchema,
17
+ receivers: ModuleSchema,
18
+ processors: ModuleSchema,
19
+ providers: ModuleSchema,
20
+ connectors: ModuleSchema,
21
21
  });
22
22
  //# sourceMappingURL=schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../lib/modules/manager/ocb/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,KAAK,GAAG,OAAC,CAAC,MAAM,CAAC;IACrB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,OAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;AAG5B,QAAA,SAAS,GAAG,OAAC,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC;QACb,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACtC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC/B,CAAC;IACF,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,MAAM;CACnB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\nconst Entry = z.object({\n gomod: z.string(),\n});\n\nconst Module = z.array(Entry).optional();\nexport type Module = z.infer<typeof Module>;\n\nexport const OCBConfig = z.object({\n dist: z.object({\n otelcol_version: z.string().optional(),\n module: z.string().optional(),\n version: z.string().optional(),\n }),\n extensions: Module,\n exporters: Module,\n receivers: Module,\n processors: Module,\n providers: Module,\n connectors: Module,\n});\nexport type OCBConfig = z.infer<typeof OCBConfig>;\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../lib/modules/manager/ocb/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,KAAK,GAAG,OAAC,CAAC,MAAM,CAAC;IACrB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,OAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;AAGlC,QAAA,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC;QACb,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACtC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC/B,CAAC;IACF,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE,YAAY;CACzB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\n\nconst Entry = z.object({\n gomod: z.string(),\n});\n\nconst ModuleSchema = z.array(Entry).optional();\nexport type Module = z.infer<typeof ModuleSchema>;\n\nexport const OCBConfigSchema = z.object({\n dist: z.object({\n otelcol_version: z.string().optional(),\n module: z.string().optional(),\n version: z.string().optional(),\n }),\n extensions: ModuleSchema,\n exporters: ModuleSchema,\n receivers: ModuleSchema,\n processors: ModuleSchema,\n providers: ModuleSchema,\n connectors: ModuleSchema,\n});\nexport type OCBConfig = z.infer<typeof OCBConfigSchema>;\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ExtractConfig, PackageFileContent } from '../types';
2
- import { PyProject } from './schema';
2
+ import { type PyProject } from './schema';
3
3
  export declare function parsePyProject(content: string, packageFile?: string): PyProject | null;
4
4
  export declare function extractPackageFile(content: string, packageFile: string, _config?: ExtractConfig): Promise<PackageFileContent | null>;
@@ -12,7 +12,7 @@ const schema_1 = require("./schema");
12
12
  function parsePyProject(content, packageFile) {
13
13
  try {
14
14
  const jsonMap = (0, toml_1.parse)((0, toml_1.massage)(content));
15
- return schema_1.PyProject.parse(jsonMap);
15
+ return schema_1.PyProjectSchema.parse(jsonMap);
16
16
  }
17
17
  catch (err) {
18
18
  logger_1.logger.debug({ packageFile, err }, `Failed to parse and validate pyproject file`);
@@ -1 +1 @@
1
- {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pep621/extract.ts"],"names":[],"mappings":";;AAYA,wCAcC;AAED,gDA+DC;;AA3FD,4CAAyC;AACzC,6CAAgF;AAChF,oEAA0E;AAC1E,wEAAkD;AAMlD,6CAA0C;AAC1C,qCAAqC;AAErC,SAAgB,cAAc,CAC5B,OAAe,EACf,WAAoB;IAEpB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAA,YAAS,EAAC,IAAA,cAAW,EAAC,OAAO,CAAC,CAAC,CAAC;QAChD,OAAO,kBAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,eAAM,CAAC,KAAK,CACV,EAAE,WAAW,EAAE,GAAG,EAAE,EACpB,6CAA6C,CAC9C,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAEM,KAAK,U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,MAAM,mBAAmB,GAAG,GAAG,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1D,IAAI,mBAAmB,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC,CAAC;IACpC,CAAC;IAED,6BAA6B;IAC7B,IAAI,aAAa,GAAG,IAAI,CAAC;IACzB,KAAK,MAAM,SAAS,IAAI,uBAAU,EAAE,CAAC;QACnC,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;QACtD,aAAa,GAAG,MAAM,SAAS,CAAC,qBAAqB,CACnD,GAAG,EACH,aAAa,EACb,WAAW,CACZ,CAAC;IACJ,CAAC;IAED,MAAM,kBAAkB,GAAG,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC;IAChD,OAAO,aAAa,CAAC,MAAM;QACzB,CAAC,CAAC,EAAE,oBAAoB,EAAE,IAAI,EAAE,aAAa,EAAE,kBAAkB,EAAE;QACnE,CAAC,CAAC,IAAI,CAAC;AACX,CAAC","sourcesContent":["import { logger } from '../../../logger';\nimport { massage as massageToml, parse as parseToml } from '../../../util/toml';\nimport { PythonVersionDatasource } from '../../datasource/python-version';\nimport * as pep440 from '../../versioning/pep440';\nimport type {\n ExtractConfig,\n PackageDependency,\n PackageFileContent,\n} from '../types';\nimport { processors } from './processors';\nimport { PyProject } from './schema';\n\nexport function parsePyProject(\n content: string,\n packageFile?: string,\n): PyProject | null {\n try {\n const jsonMap = parseToml(massageToml(content));\n return PyProject.parse(jsonMap);\n } catch (err) {\n logger.debug(\n { packageFile, err },\n `Failed to parse and validate pyproject file`,\n );\n return null;\n }\n}\n\nexport async function extractPackageFile(\n content: string,\n packageFile: string,\n _config?: ExtractConfig,\n): Promise<PackageFileContent | null> {\n logger.trace(`pep621.extractPackageFile(${packageFile})`);\n\n const def = parsePyProject(content, packageFile);\n if (!def) {\n return null;\n }\n\n const deps: PackageDependency[] = [];\n\n const pythonConstraint = def.project?.['requires-python'];\n const extractedConstraints: Record<string, string> = {};\n if (pythonConstraint) {\n extractedConstraints.python = pythonConstraint;\n deps.push({\n packageName: 'python',\n depType: 'requires-python',\n currentValue: pythonConstraint,\n commitMessageTopic: 'Python',\n datasource: PythonVersionDatasource.id,\n versioning: pep440.id,\n });\n }\n\n const projectDependencies = def.project?.dependencies;\n if (projectDependencies) {\n deps.push(...projectDependencies);\n }\n\n const dependencyGroups = def['dependency-groups'];\n if (dependencyGroups) {\n deps.push(...dependencyGroups);\n }\n\n const projectOptionalDependencies = def.project?.['optional-dependencies'];\n if (projectOptionalDependencies) {\n deps.push(...projectOptionalDependencies);\n }\n\n const buildSystemRequires = def['build-system']?.requires;\n if (buildSystemRequires) {\n deps.push(...buildSystemRequires);\n }\n\n // process specific tool sets\n let processedDeps = deps;\n for (const processor of processors) {\n processedDeps = processor.process(def, processedDeps);\n processedDeps = await processor.extractLockedVersions(\n def,\n processedDeps,\n packageFile,\n );\n }\n\n const packageFileVersion = def.project?.version;\n return processedDeps.length\n ? { extractedConstraints, deps: processedDeps, packageFileVersion }\n : null;\n}\n"]}
1
+ {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pep621/extract.ts"],"names":[],"mappings":";;AAYA,wCAcC;AAED,gDA+DC;;AA3FD,4CAAyC;AACzC,6CAAgF;AAChF,oEAA0E;AAC1E,wEAAkD;AAMlD,6CAA0C;AAC1C,qCAA2D;AAE3D,SAAgB,cAAc,CAC5B,OAAe,EACf,WAAoB;IAEpB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAA,YAAS,EAAC,IAAA,cAAW,EAAC,OAAO,CAAC,CAAC,CAAC;QAChD,OAAO,wBAAe,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,eAAM,CAAC,KAAK,CACV,EAAE,WAAW,EAAE,GAAG,EAAE,EACpB,6CAA6C,CAC9C,CAAC;QACF,OAAO,IAAI,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AG,2BAA2B,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,mBAAmB,GAAG,GAAG,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1D,IAAI,mBAAmB,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC,CAAC;IACpC,CAAC;IAED,6BAA6B;IAC7B,IAAI,aAAa,GAAG,IAAI,CAAC;IACzB,KAAK,MAAM,SAAS,IAAI,uBAAU,EAAE,CAAC;QACnC,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;QACtD,aAAa,GAAG,MAAM,SAAS,CAAC,qBAAqB,CACnD,GAAG,EACH,aAAa,EACb,WAAW,CACZ,CAAC;IACJ,CAAC;IAED,MAAM,kBAAkB,GAAG,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC;IAChD,OAAO,aAAa,CAAC,MAAM;QACzB,CAAC,CAAC,EAAE,oBAAoB,EAAE,IAAI,EAAE,aAAa,EAAE,kBAAkB,EAAE;QACnE,CAAC,CAAC,IAAI,CAAC;AACX,CAAC","sourcesContent":["import { logger } from '../../../logger';\nimport { massage as massageToml, parse as parseToml } from '../../../util/toml';\nimport { PythonVersionDatasource } from '../../datasource/python-version';\nimport * as pep440 from '../../versioning/pep440';\nimport type {\n ExtractConfig,\n PackageDependency,\n PackageFileContent,\n} from '../types';\nimport { processors } from './processors';\nimport { type PyProject, PyProjectSchema } from './schema';\n\nexport function parsePyProject(\n content: string,\n packageFile?: string,\n): PyProject | null {\n try {\n const jsonMap = parseToml(massageToml(content));\n return PyProjectSchema.parse(jsonMap);\n } catch (err) {\n logger.debug(\n { packageFile, err },\n `Failed to parse and validate pyproject file`,\n );\n return null;\n }\n}\n\nexport async function extractPackageFile(\n content: string,\n packageFile: string,\n _config?: ExtractConfig,\n): Promise<PackageFileContent | null> {\n logger.trace(`pep621.extractPackageFile(${packageFile})`);\n\n const def = parsePyProject(content, packageFile);\n if (!def) {\n return null;\n }\n\n const deps: PackageDependency[] = [];\n\n const pythonConstraint = def.project?.['requires-python'];\n const extractedConstraints: Record<string, string> = {};\n if (pythonConstraint) {\n extractedConstraints.python = pythonConstraint;\n deps.push({\n packageName: 'python',\n depType: 'requires-python',\n currentValue: pythonConstraint,\n commitMessageTopic: 'Python',\n datasource: PythonVersionDatasource.id,\n versioning: pep440.id,\n });\n }\n\n const projectDependencies = def.project?.dependencies;\n if (projectDependencies) {\n deps.push(...projectDependencies);\n }\n\n const dependencyGroups = def['dependency-groups'];\n if (dependencyGroups) {\n deps.push(...dependencyGroups);\n }\n\n const projectOptionalDependencies = def.project?.['optional-dependencies'];\n if (projectOptionalDependencies) {\n deps.push(...projectOptionalDependencies);\n }\n\n const buildSystemRequires = def['build-system']?.requires;\n if (buildSystemRequires) {\n deps.push(...buildSystemRequires);\n }\n\n // process specific tool sets\n let processedDeps = deps;\n for (const processor of processors) {\n processedDeps = processor.process(def, processedDeps);\n processedDeps = await processor.extractLockedVersions(\n def,\n processedDeps,\n packageFile,\n );\n }\n\n const packageFileVersion = def.project?.version;\n return processedDeps.length\n ? { extractedConstraints, deps: processedDeps, packageFileVersion }\n : null;\n}\n"]}
@@ -36,7 +36,7 @@ class PdmProcessor {
36
36
  const lockFileName = (0, fs_1.getSiblingFileName)(packageFile, 'pdm.lock');
37
37
  const lockFileContent = await (0, fs_1.readLocalFile)(lockFileName, 'utf8');
38
38
  if (lockFileContent) {
39
- const lockFileMapping = result_1.Result.parse(lockFileContent, schema_1.PdmLockfile.transform(({ lock }) => lock)).unwrapOr({});
39
+ const lockFileMapping = result_1.Result.parse(lockFileContent, schema_1.PdmLockfileSchema.transform(({ lock }) => lock)).unwrapOr({});
40
40
  for (const dep of deps) {
41
41
  const packageName = dep.packageName;
42
42
  if (packageName && packageName in lockFileMapping) {