repopo 0.10.0 → 0.13.0

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 (340) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/README.md +76 -77
  3. package/THIRD-PARTY-LICENSES.txt +232 -14
  4. package/bin/dev.js +5 -1
  5. package/esm/adapters/fluidFramework.d.ts +13 -9
  6. package/esm/adapters/fluidFramework.d.ts.map +1 -1
  7. package/esm/adapters/fluidFramework.js +20 -43
  8. package/esm/adapters/fluidFramework.js.map +1 -1
  9. package/esm/api.d.ts +64 -1
  10. package/esm/api.d.ts.map +1 -1
  11. package/esm/api.js +17 -1
  12. package/esm/api.js.map +1 -1
  13. package/esm/baseCommand.d.ts +1 -1
  14. package/esm/baseCommand.d.ts.map +1 -1
  15. package/esm/baseCommand.js +7 -10
  16. package/esm/baseCommand.js.map +1 -1
  17. package/esm/commands/check-native.d.ts +25 -0
  18. package/esm/commands/check-native.d.ts.map +1 -0
  19. package/esm/commands/check-native.js +156 -0
  20. package/esm/commands/check-native.js.map +1 -0
  21. package/esm/commands/check.d.ts +7 -34
  22. package/esm/commands/check.d.ts.map +1 -1
  23. package/esm/commands/check.js +76 -265
  24. package/esm/commands/check.js.map +1 -1
  25. package/esm/commands/list.d.ts.map +1 -1
  26. package/esm/commands/list.js +6 -6
  27. package/esm/commands/list.js.map +1 -1
  28. package/esm/concurrency.d.ts +3 -0
  29. package/esm/concurrency.d.ts.map +1 -0
  30. package/esm/concurrency.js +8 -0
  31. package/esm/concurrency.js.map +1 -0
  32. package/esm/config.d.ts +5 -39
  33. package/esm/config.d.ts.map +1 -1
  34. package/esm/config.js +3 -7
  35. package/esm/config.js.map +1 -1
  36. package/esm/context.d.ts +20 -3
  37. package/esm/context.d.ts.map +1 -1
  38. package/esm/context.js +18 -1
  39. package/esm/context.js.map +1 -1
  40. package/esm/executionContractError.d.ts +4 -0
  41. package/esm/executionContractError.d.ts.map +1 -0
  42. package/esm/executionContractError.js +4 -0
  43. package/esm/executionContractError.js.map +1 -0
  44. package/esm/fileCache.d.ts +12 -0
  45. package/esm/fileCache.d.ts.map +1 -0
  46. package/esm/fileCache.js +37 -0
  47. package/esm/fileCache.js.map +1 -0
  48. package/esm/filePaths.d.ts +2 -0
  49. package/esm/filePaths.d.ts.map +1 -0
  50. package/esm/filePaths.js +9 -0
  51. package/esm/filePaths.js.map +1 -0
  52. package/esm/generators.d.ts +0 -20
  53. package/esm/generators.d.ts.map +1 -1
  54. package/esm/generators.js.map +1 -1
  55. package/esm/index.d.ts +3 -11
  56. package/esm/index.d.ts.map +1 -1
  57. package/esm/index.js +3 -14
  58. package/esm/index.js.map +1 -1
  59. package/esm/makePolicy.d.ts +26 -79
  60. package/esm/makePolicy.d.ts.map +1 -1
  61. package/esm/makePolicy.js +51 -95
  62. package/esm/makePolicy.js.map +1 -1
  63. package/esm/perf.d.ts +10 -2
  64. package/esm/perf.d.ts.map +1 -1
  65. package/esm/perf.js +10 -9
  66. package/esm/perf.js.map +1 -1
  67. package/esm/policies/CargoLicenceValidated.d.ts +41 -0
  68. package/esm/policies/CargoLicenceValidated.d.ts.map +1 -0
  69. package/esm/policies/CargoLicenceValidated.js +47 -0
  70. package/esm/policies/CargoLicenceValidated.js.map +1 -0
  71. package/esm/policies/CargoLintsConfigured.d.ts +30 -0
  72. package/esm/policies/CargoLintsConfigured.d.ts.map +1 -0
  73. package/esm/policies/CargoLintsConfigured.js +65 -0
  74. package/esm/policies/CargoLintsConfigured.js.map +1 -0
  75. package/esm/policies/CargoLockPolicy.d.ts +34 -0
  76. package/esm/policies/CargoLockPolicy.d.ts.map +1 -0
  77. package/esm/policies/CargoLockPolicy.js +61 -0
  78. package/esm/policies/CargoLockPolicy.js.map +1 -0
  79. package/esm/policies/CargoTomlRequired.d.ts +34 -0
  80. package/esm/policies/CargoTomlRequired.d.ts.map +1 -0
  81. package/esm/policies/CargoTomlRequired.js +77 -0
  82. package/esm/policies/CargoTomlRequired.js.map +1 -0
  83. package/esm/policies/CargoTomlSorted.d.ts +20 -0
  84. package/esm/policies/CargoTomlSorted.d.ts.map +1 -0
  85. package/esm/policies/CargoTomlSorted.js +168 -0
  86. package/esm/policies/CargoTomlSorted.js.map +1 -0
  87. package/esm/policies/ConditionalScripts.d.ts +10 -8
  88. package/esm/policies/ConditionalScripts.d.ts.map +1 -1
  89. package/esm/policies/ConditionalScripts.js +27 -24
  90. package/esm/policies/ConditionalScripts.js.map +1 -1
  91. package/esm/policies/ExactScripts.d.ts +8 -6
  92. package/esm/policies/ExactScripts.d.ts.map +1 -1
  93. package/esm/policies/ExactScripts.js +18 -20
  94. package/esm/policies/ExactScripts.js.map +1 -1
  95. package/esm/policies/GleamDepVersions.d.ts +25 -0
  96. package/esm/policies/GleamDepVersions.d.ts.map +1 -0
  97. package/esm/policies/GleamDepVersions.js +67 -0
  98. package/esm/policies/GleamDepVersions.js.map +1 -0
  99. package/esm/policies/GleamDocExists.d.ts +24 -0
  100. package/esm/policies/GleamDocExists.d.ts.map +1 -0
  101. package/esm/policies/GleamDocExists.js +39 -0
  102. package/esm/policies/GleamDocExists.js.map +1 -0
  103. package/esm/policies/GleamInternalModulesConfigured.d.ts +21 -0
  104. package/esm/policies/GleamInternalModulesConfigured.d.ts.map +1 -0
  105. package/esm/policies/GleamInternalModulesConfigured.js +32 -0
  106. package/esm/policies/GleamInternalModulesConfigured.js.map +1 -0
  107. package/esm/policies/GleamLicenceConfigured.d.ts +29 -0
  108. package/esm/policies/GleamLicenceConfigured.d.ts.map +1 -0
  109. package/esm/policies/GleamLicenceConfigured.js +36 -0
  110. package/esm/policies/GleamLicenceConfigured.js.map +1 -0
  111. package/esm/policies/GleamManifestCommitted.d.ts +16 -0
  112. package/esm/policies/GleamManifestCommitted.d.ts.map +1 -0
  113. package/esm/policies/GleamManifestCommitted.js +27 -0
  114. package/esm/policies/GleamManifestCommitted.js.map +1 -0
  115. package/esm/policies/GleamMonorepoConsistency.d.ts +38 -0
  116. package/esm/policies/GleamMonorepoConsistency.d.ts.map +1 -0
  117. package/esm/policies/GleamMonorepoConsistency.js +74 -0
  118. package/esm/policies/GleamMonorepoConsistency.js.map +1 -0
  119. package/esm/policies/GleamNameRestrictions.d.ts +25 -0
  120. package/esm/policies/GleamNameRestrictions.d.ts.map +1 -0
  121. package/esm/policies/GleamNameRestrictions.js +44 -0
  122. package/esm/policies/GleamNameRestrictions.js.map +1 -0
  123. package/esm/policies/GleamNoPathDepsInPublished.d.ts +22 -0
  124. package/esm/policies/GleamNoPathDepsInPublished.d.ts.map +1 -0
  125. package/esm/policies/GleamNoPathDepsInPublished.js +43 -0
  126. package/esm/policies/GleamNoPathDepsInPublished.js.map +1 -0
  127. package/esm/policies/GleamPathDepsValid.d.ts +9 -0
  128. package/esm/policies/GleamPathDepsValid.d.ts.map +1 -0
  129. package/esm/policies/GleamPathDepsValid.js +59 -0
  130. package/esm/policies/GleamPathDepsValid.js.map +1 -0
  131. package/esm/policies/GleamProjectStructure.d.ts +32 -0
  132. package/esm/policies/GleamProjectStructure.d.ts.map +1 -0
  133. package/esm/policies/GleamProjectStructure.js +32 -0
  134. package/esm/policies/GleamProjectStructure.js.map +1 -0
  135. package/esm/policies/GleamSharedDependencyVersions.d.ts +37 -0
  136. package/esm/policies/GleamSharedDependencyVersions.d.ts.map +1 -0
  137. package/esm/policies/GleamSharedDependencyVersions.js +101 -0
  138. package/esm/policies/GleamSharedDependencyVersions.js.map +1 -0
  139. package/esm/policies/GleamTomlRequired.d.ts +30 -0
  140. package/esm/policies/GleamTomlRequired.d.ts.map +1 -0
  141. package/esm/policies/GleamTomlRequired.js +37 -0
  142. package/esm/policies/GleamTomlRequired.js.map +1 -0
  143. package/esm/policies/GleamTomlSorted.d.ts +20 -0
  144. package/esm/policies/GleamTomlSorted.d.ts.map +1 -0
  145. package/esm/policies/GleamTomlSorted.js +157 -0
  146. package/esm/policies/GleamTomlSorted.js.map +1 -0
  147. package/esm/policies/GleamVersionConstraint.d.ts +20 -0
  148. package/esm/policies/GleamVersionConstraint.d.ts.map +1 -0
  149. package/esm/policies/GleamVersionConstraint.js +68 -0
  150. package/esm/policies/GleamVersionConstraint.js.map +1 -0
  151. package/esm/policies/HtmlFileHeaders.d.ts +4 -2
  152. package/esm/policies/HtmlFileHeaders.d.ts.map +1 -1
  153. package/esm/policies/HtmlFileHeaders.js +2 -2
  154. package/esm/policies/HtmlFileHeaders.js.map +1 -1
  155. package/esm/policies/JsTsFileHeaders.d.ts +4 -2
  156. package/esm/policies/JsTsFileHeaders.d.ts.map +1 -1
  157. package/esm/policies/JsTsFileHeaders.js +1 -1
  158. package/esm/policies/JsTsFileHeaders.js.map +1 -1
  159. package/esm/policies/LicenseFileExists.d.ts +10 -4
  160. package/esm/policies/LicenseFileExists.d.ts.map +1 -1
  161. package/esm/policies/LicenseFileExists.js +27 -20
  162. package/esm/policies/LicenseFileExists.js.map +1 -1
  163. package/esm/policies/MutuallyExclusiveScripts.d.ts +8 -6
  164. package/esm/policies/MutuallyExclusiveScripts.d.ts.map +1 -1
  165. package/esm/policies/MutuallyExclusiveScripts.js +9 -13
  166. package/esm/policies/MutuallyExclusiveScripts.js.map +1 -1
  167. package/esm/policies/NoBuildDirectory.d.ts +15 -0
  168. package/esm/policies/NoBuildDirectory.d.ts.map +1 -0
  169. package/esm/policies/NoBuildDirectory.js +24 -0
  170. package/esm/policies/NoBuildDirectory.js.map +1 -0
  171. package/esm/policies/NoJsFileExtensions.d.ts +9 -3
  172. package/esm/policies/NoJsFileExtensions.d.ts.map +1 -1
  173. package/esm/policies/NoJsFileExtensions.js +9 -14
  174. package/esm/policies/NoJsFileExtensions.js.map +1 -1
  175. package/esm/policies/NoLargeBinaryFiles.d.ts +9 -4
  176. package/esm/policies/NoLargeBinaryFiles.d.ts.map +1 -1
  177. package/esm/policies/NoLargeBinaryFiles.js +10 -16
  178. package/esm/policies/NoLargeBinaryFiles.js.map +1 -1
  179. package/esm/policies/NoPrivateWorkspaceDependencies.d.ts +10 -6
  180. package/esm/policies/NoPrivateWorkspaceDependencies.d.ts.map +1 -1
  181. package/esm/policies/NoPrivateWorkspaceDependencies.js +12 -14
  182. package/esm/policies/NoPrivateWorkspaceDependencies.js.map +1 -1
  183. package/esm/policies/NoTargetArtifacts.d.ts +14 -0
  184. package/esm/policies/NoTargetArtifacts.d.ts.map +1 -0
  185. package/esm/policies/NoTargetArtifacts.js +37 -0
  186. package/esm/policies/NoTargetArtifacts.js.map +1 -0
  187. package/esm/policies/NoUnsafeWithoutJustification.d.ts +31 -0
  188. package/esm/policies/NoUnsafeWithoutJustification.d.ts.map +1 -0
  189. package/esm/policies/NoUnsafeWithoutJustification.js +79 -0
  190. package/esm/policies/NoUnsafeWithoutJustification.js.map +1 -0
  191. package/esm/policies/NoWildcardDependencies.d.ts +30 -0
  192. package/esm/policies/NoWildcardDependencies.d.ts.map +1 -0
  193. package/esm/policies/NoWildcardDependencies.js +83 -0
  194. package/esm/policies/NoWildcardDependencies.js.map +1 -0
  195. package/esm/policies/PackageAllowedScopes.d.ts +9 -5
  196. package/esm/policies/PackageAllowedScopes.d.ts.map +1 -1
  197. package/esm/policies/PackageAllowedScopes.js +15 -16
  198. package/esm/policies/PackageAllowedScopes.js.map +1 -1
  199. package/esm/policies/PackageEsmType.d.ts +7 -5
  200. package/esm/policies/PackageEsmType.d.ts.map +1 -1
  201. package/esm/policies/PackageEsmType.js +38 -36
  202. package/esm/policies/PackageEsmType.js.map +1 -1
  203. package/esm/policies/PackageFolderName.d.ts +8 -6
  204. package/esm/policies/PackageFolderName.d.ts.map +1 -1
  205. package/esm/policies/PackageFolderName.js +13 -16
  206. package/esm/policies/PackageFolderName.js.map +1 -1
  207. package/esm/policies/PackageJsonProperties.d.ts +5 -3
  208. package/esm/policies/PackageJsonProperties.d.ts.map +1 -1
  209. package/esm/policies/PackageJsonProperties.js +18 -21
  210. package/esm/policies/PackageJsonProperties.js.map +1 -1
  211. package/esm/policies/PackageJsonRepoDirectoryProperty.d.ts +2 -7
  212. package/esm/policies/PackageJsonRepoDirectoryProperty.d.ts.map +1 -1
  213. package/esm/policies/PackageJsonRepoDirectoryProperty.js +29 -42
  214. package/esm/policies/PackageJsonRepoDirectoryProperty.js.map +1 -1
  215. package/esm/policies/PackageJsonSorted.d.ts +2 -2
  216. package/esm/policies/PackageJsonSorted.d.ts.map +1 -1
  217. package/esm/policies/PackageJsonSorted.js +51 -31
  218. package/esm/policies/PackageJsonSorted.js.map +1 -1
  219. package/esm/policies/PackageLicense.d.ts +4 -4
  220. package/esm/policies/PackageLicense.d.ts.map +1 -1
  221. package/esm/policies/PackageLicense.js +32 -54
  222. package/esm/policies/PackageLicense.js.map +1 -1
  223. package/esm/policies/PackagePrivateField.d.ts +12 -8
  224. package/esm/policies/PackagePrivateField.d.ts.map +1 -1
  225. package/esm/policies/PackagePrivateField.js +34 -25
  226. package/esm/policies/PackagePrivateField.js.map +1 -1
  227. package/esm/policies/PackageReadme.d.ts +6 -5
  228. package/esm/policies/PackageReadme.d.ts.map +1 -1
  229. package/esm/policies/PackageReadme.js +24 -61
  230. package/esm/policies/PackageReadme.js.map +1 -1
  231. package/esm/policies/PackageScripts.d.ts +26 -22
  232. package/esm/policies/PackageScripts.d.ts.map +1 -1
  233. package/esm/policies/PackageScripts.js +42 -38
  234. package/esm/policies/PackageScripts.js.map +1 -1
  235. package/esm/policies/PackageTestScripts.d.ts +10 -6
  236. package/esm/policies/PackageTestScripts.d.ts.map +1 -1
  237. package/esm/policies/PackageTestScripts.js +17 -19
  238. package/esm/policies/PackageTestScripts.js.map +1 -1
  239. package/esm/policies/PublicApiDocumented.d.ts +21 -0
  240. package/esm/policies/PublicApiDocumented.d.ts.map +1 -0
  241. package/esm/policies/PublicApiDocumented.js +38 -0
  242. package/esm/policies/PublicApiDocumented.js.map +1 -0
  243. package/esm/policies/RequiredGitignorePatterns.d.ts +11 -4
  244. package/esm/policies/RequiredGitignorePatterns.d.ts.map +1 -1
  245. package/esm/policies/RequiredGitignorePatterns.js +29 -36
  246. package/esm/policies/RequiredGitignorePatterns.js.map +1 -1
  247. package/esm/policies/RequiredScripts.d.ts +9 -7
  248. package/esm/policies/RequiredScripts.d.ts.map +1 -1
  249. package/esm/policies/RequiredScripts.js +27 -26
  250. package/esm/policies/RequiredScripts.js.map +1 -1
  251. package/esm/policies/RustDocExists.d.ts +24 -0
  252. package/esm/policies/RustDocExists.d.ts.map +1 -0
  253. package/esm/policies/RustDocExists.js +49 -0
  254. package/esm/policies/RustDocExists.js.map +1 -0
  255. package/esm/policies/RustToolchainExists.d.ts +27 -0
  256. package/esm/policies/RustToolchainExists.d.ts.map +1 -0
  257. package/esm/policies/RustToolchainExists.js +28 -0
  258. package/esm/policies/RustToolchainExists.js.map +1 -0
  259. package/esm/policies/RustfmtConfigExists.d.ts +27 -0
  260. package/esm/policies/RustfmtConfigExists.d.ts.map +1 -0
  261. package/esm/policies/RustfmtConfigExists.js +28 -0
  262. package/esm/policies/RustfmtConfigExists.js.map +1 -0
  263. package/esm/policies/ScriptContains.d.ts +9 -7
  264. package/esm/policies/ScriptContains.d.ts.map +1 -1
  265. package/esm/policies/ScriptContains.js +9 -13
  266. package/esm/policies/ScriptContains.js.map +1 -1
  267. package/esm/policies/SharedDependencyVersions.d.ts +29 -0
  268. package/esm/policies/SharedDependencyVersions.d.ts.map +1 -0
  269. package/esm/policies/SharedDependencyVersions.js +143 -0
  270. package/esm/policies/SharedDependencyVersions.js.map +1 -0
  271. package/esm/policies/WorkspaceInheritance.d.ts +31 -0
  272. package/esm/policies/WorkspaceInheritance.d.ts.map +1 -0
  273. package/esm/policies/WorkspaceInheritance.js +93 -0
  274. package/esm/policies/WorkspaceInheritance.js.map +1 -0
  275. package/esm/policies/WorkspaceMembersValid.d.ts +27 -0
  276. package/esm/policies/WorkspaceMembersValid.d.ts.map +1 -0
  277. package/esm/policies/WorkspaceMembersValid.js +87 -0
  278. package/esm/policies/WorkspaceMembersValid.js.map +1 -0
  279. package/esm/policies/constants.d.ts +8 -0
  280. package/esm/policies/constants.d.ts.map +1 -1
  281. package/esm/policies/constants.js +9 -1
  282. package/esm/policies/constants.js.map +1 -1
  283. package/esm/policies.d.ts +43 -5
  284. package/esm/policies.d.ts.map +1 -1
  285. package/esm/policies.js +63 -6
  286. package/esm/policies.js.map +1 -1
  287. package/esm/policy.d.ts +65 -269
  288. package/esm/policy.d.ts.map +1 -1
  289. package/esm/policy.js +1 -122
  290. package/esm/policy.js.map +1 -1
  291. package/esm/policyDefiners/defineCargoPolicy.d.ts +82 -0
  292. package/esm/policyDefiners/defineCargoPolicy.d.ts.map +1 -0
  293. package/esm/policyDefiners/defineCargoPolicy.js +42 -0
  294. package/esm/policyDefiners/defineCargoPolicy.js.map +1 -0
  295. package/esm/policyDefiners/defineFileHeaderPolicy.d.ts +27 -14
  296. package/esm/policyDefiners/defineFileHeaderPolicy.d.ts.map +1 -1
  297. package/esm/policyDefiners/defineFileHeaderPolicy.js +19 -39
  298. package/esm/policyDefiners/defineFileHeaderPolicy.js.map +1 -1
  299. package/esm/policyDefiners/defineGleamPolicy.d.ts +81 -0
  300. package/esm/policyDefiners/defineGleamPolicy.d.ts.map +1 -0
  301. package/esm/policyDefiners/defineGleamPolicy.js +42 -0
  302. package/esm/policyDefiners/defineGleamPolicy.js.map +1 -0
  303. package/esm/policyDefiners/definePackagePolicy.d.ts +24 -13
  304. package/esm/policyDefiners/definePackagePolicy.d.ts.map +1 -1
  305. package/esm/policyDefiners/definePackagePolicy.js +9 -32
  306. package/esm/policyDefiners/definePackagePolicy.js.map +1 -1
  307. package/esm/policyDefiners/spdxValidator.d.ts +66 -0
  308. package/esm/policyDefiners/spdxValidator.d.ts.map +1 -0
  309. package/esm/policyDefiners/spdxValidator.js +139 -0
  310. package/esm/policyDefiners/spdxValidator.js.map +1 -0
  311. package/esm/policyDefiners/tomlParser.d.ts +8 -0
  312. package/esm/policyDefiners/tomlParser.d.ts.map +1 -0
  313. package/esm/policyDefiners/tomlParser.js +17 -0
  314. package/esm/policyDefiners/tomlParser.js.map +1 -0
  315. package/esm/policyExecution.d.ts +19 -0
  316. package/esm/policyExecution.d.ts.map +1 -0
  317. package/esm/policyExecution.js +224 -0
  318. package/esm/policyExecution.js.map +1 -0
  319. package/esm/repositoryFiles.d.ts +4 -0
  320. package/esm/repositoryFiles.d.ts.map +1 -0
  321. package/esm/repositoryFiles.js +8 -0
  322. package/esm/repositoryFiles.js.map +1 -0
  323. package/esm/runner.d.ts +85 -0
  324. package/esm/runner.d.ts.map +1 -0
  325. package/esm/runner.js +189 -0
  326. package/esm/runner.js.map +1 -0
  327. package/esm/settlePolicyPromise.d.ts +4 -0
  328. package/esm/settlePolicyPromise.d.ts.map +1 -0
  329. package/esm/settlePolicyPromise.js +10 -0
  330. package/esm/settlePolicyPromise.js.map +1 -0
  331. package/esm/tsdoc-metadata.json +1 -1
  332. package/esm/utils/safePaths.d.ts +9 -0
  333. package/esm/utils/safePaths.d.ts.map +1 -0
  334. package/esm/utils/safePaths.js +40 -0
  335. package/esm/utils/safePaths.js.map +1 -0
  336. package/oclif.manifest.json +117 -3
  337. package/package.json +66 -36
  338. package/scripts/benchmark.mjs +341 -0
  339. package/scripts/postinstall.mjs +154 -0
  340. package/sidecar/sidecar.mjs +399 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GleamMonorepoConsistency.js","sourceRoot":"","sources":["../../src/policies/GleamMonorepoConsistency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,OAAO,CAAC;AAEzB,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AA2B5D,MAAM,mBAAmB,GAAG,CAAC,UAAU,CAAC,CAAC;AAEzC,KAAK,UAAU,aAAa,CAC3B,QAAgB;IAEhB,IAAI,CAAC;QACJ,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAClD,OAAO,MAAM,SAAS,CAAC,OAAO,CAAC,C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cesContent":["import { readFile } from \"node:fs/promises\";\nimport path from \"pathe\";\nimport type { FilePolicyDefinition } from \"../policy.js\";\nimport { parseToml } from \"../policyDefiners/tomlParser.js\";\n\n/**\n * Configuration for the GleamMonorepoConsistency policy.\n *\n * @public\n */\nexport interface GleamMonorepoConsistencyConfig {\n\t/**\n\t * Top-level fields that should be consistent across all packages.\n\t * @defaultValue [\"licences\"]\n\t */\n\tsyncFields?: string[];\n\n\t/**\n\t * If true, ensure the `gleam` version constraint is consistent.\n\t * @defaultValue true\n\t */\n\tsyncGleamVersion?: boolean;\n\n\t/**\n\t * Paths to gleam.toml files to compare (relative to repo root).\n\t * With fewer than two paths, the policy reports no findings.\n\t */\n\tpackages?: string[];\n}\n\nconst DEFAULT_SYNC_FIELDS = [\"licences\"];\n\nasync function loadGleamToml(\n\tfilePath: string,\n): Promise<Record<string, unknown> | undefined> {\n\ttry {\n\t\tconst content = await readFile(filePath, \"utf-8\");\n\t\treturn await parseToml(content);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nfunction checkFieldConsistency(\n\tpackages: Map<string, Record<string, unknown>>,\n\tfield: string,\n): string[] {\n\tconst values = new Map<string, string[]>();\n\n\tfor (const [pkg, toml] of packages) {\n\t\tconst value = JSON.stringify(toml[field] ?? null);\n\t\tif (!values.has(value)) {\n\t\t\tvalues.set(value, []);\n\t\t}\n\t\tvalues.get(value)?.push(pkg);\n\t}\n\n\tif (values.size <= 1) {\n\t\treturn [];\n\t}\n\n\tconst details = [...values.entries()]\n\t\t.map(([val, pkgs]) => `${val} in ${pkgs.join(\", \")}`)\n\t\t.join(\"; \");\n\treturn [`Inconsistent \"${field}\" across packages: ${details}`];\n}\n\n/**\n * A policy that enforces consistent metadata across Gleam packages in a monorepo.\n *\n * @public\n */\nexport const GleamMonorepoConsistency = {\n\tname: \"GleamMonorepoConsistency\",\n\trequiresConfig: true,\n\tdescription:\n\t\t\"Enforces consistent metadata (licences, gleam version, etc.) across Gleam packages in a monorepo.\",\n\tmatch: /^gleam\\.toml$/,\n\thandler: async ({ root, config }) => {\n\t\tconst packagePaths = config?.packages;\n\t\tif (!packagePaths || packagePaths.length < 2) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst syncFields = config?.syncFields ?? DEFAULT_SYNC_FIELDS;\n\t\tconst syncGleamVersion = config?.syncGleamVersion ?? true;\n\n\t\tconst packages = new Map<string, Record<string, unknown>>();\n\t\tfor (const pkgPath of packagePaths) {\n\t\t\tconst toml = await loadGleamToml(path.resolve(root, pkgPath));\n\t\t\tif (toml) {\n\t\t\t\tpackages.set(pkgPath, toml);\n\t\t\t}\n\t\t}\n\n\t\tif (packages.size < 2) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst errors: string[] = [];\n\n\t\tfor (const field of syncFields) {\n\t\t\terrors.push(...checkFieldConsistency(packages, field));\n\t\t}\n\n\t\tif (syncGleamVersion) {\n\t\t\terrors.push(...checkFieldConsistency(packages, \"gleam\"));\n\t\t}\n\n\t\tif (errors.length > 0) {\n\t\t\treturn errors.map((message) => ({\n\t\t\t\tmessage,\n\t\t\t\tmanualFix:\n\t\t\t\t\t\"Ensure all Gleam packages in the monorepo use consistent metadata values.\",\n\t\t\t}));\n\t\t}\n\t\treturn [];\n\t},\n} satisfies FilePolicyDefinition<GleamMonorepoConsistencyConfig>;\n"]}
@@ -0,0 +1,25 @@
1
+ import type { FilePolicyDefinition } from "../policy.js";
2
+ /**
3
+ * Configuration for the GleamNameRestrictions policy.
4
+ *
5
+ * @public
6
+ */
7
+ export interface GleamNameRestrictionsConfig {
8
+ /**
9
+ * Prefixes that are denied for package names.
10
+ * @defaultValue ["gleam_"]
11
+ */
12
+ denyPrefixes?: string[];
13
+ /**
14
+ * If true, require snake_case naming.
15
+ * @defaultValue true
16
+ */
17
+ requireSnakeCase?: boolean;
18
+ }
19
+ /**
20
+ * A policy that enforces naming conventions for Gleam packages.
21
+ *
22
+ * @public
23
+ */
24
+ export declare const GleamNameRestrictions: FilePolicyDefinition<GleamNameRestrictionsConfig>;
25
+ //# sourceMappingURL=GleamNameRestrictions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GleamNameRestrictions.d.ts","sourceRoot":"","sources":["../../src/policies/GleamNameRestrictions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAMzD;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC3C;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B;AAiBD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,mDAkC4B,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { defineGleamPolicy, } from "../policyDefiners/defineGleamPolicy.js";
2
+ const DEFAULT_DENY_PREFIXES = ["gleam_"];
3
+ const SNAKE_CASE_REGEX = /^[a-z][a-z0-9]*(_[a-z0-9]+)*$/;
4
+ function checkDeniedPrefixes(name, prefixes) {
5
+ for (const prefix of prefixes) {
6
+ if (name.startsWith(prefix)) {
7
+ return `Package name "${name}" uses reserved prefix "${prefix}". The "gleam_" prefix is reserved for official Gleam packages.`;
8
+ }
9
+ }
10
+ return undefined;
11
+ }
12
+ /**
13
+ * A policy that enforces naming conventions for Gleam packages.
14
+ *
15
+ * @public
16
+ */
17
+ export const GleamNameRestrictions = defineGleamPolicy({
18
+ name: "GleamNameRestrictions",
19
+ description: 'Enforces Gleam package naming conventions: no "gleam_" prefix, snake_case required.',
20
+ handler: async (toml, { config }) => {
21
+ const name = toml.name;
22
+ if (!name) {
23
+ return [];
24
+ }
25
+ const errors = [];
26
+ const denyPrefixes = config?.denyPrefixes ?? DEFAULT_DENY_PREFIXES;
27
+ const requireSnakeCase = config?.requireSnakeCase ?? true;
28
+ const prefixError = checkDeniedPrefixes(name, denyPrefixes);
29
+ if (prefixError) {
30
+ errors.push(prefixError);
31
+ }
32
+ if (requireSnakeCase && !SNAKE_CASE_REGEX.test(name)) {
33
+ errors.push(`Package name "${name}" is not snake_case. Gleam package names should use lowercase letters, digits, and underscores.`);
34
+ }
35
+ if (errors.length > 0) {
36
+ return errors.map((message) => ({
37
+ message,
38
+ manualFix: "Rename the package to follow Gleam naming conventions (snake_case, no gleam_ prefix).",
39
+ }));
40
+ }
41
+ return [];
42
+ },
43
+ });
44
+ //# sourceMappingURL=GleamNameRestrictions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GleamNameRestrictions.js","sourceRoot":"","sources":["../../src/policies/GleamNameRestrictions.ts"],"names":[],"mappings":"AACA,OAAO,EACN,iBAAiB,GAEjB,MAAM,wCAAwC,CAAC;AAqBhD,MAAM,qBAAqB,GAAG,CAAC,QAAQ,CAAC,CAAC;AACzC,MAAM,gBAAgB,GAAG,+BAA+B,CAAC;AAEzD,SAAS,mBAAmB,CAC3B,IAAY,EACZ,QAAkB;IAElB,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC7B,OAAO,iBAAiB,IAAI,2BAA2B,MAAM,iEAAiE,CAAC;QAChI,CAAC;IACF,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;IACtD,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EACV,qFAAqF;IACtF,OAAO,EAAE,KAAK,EAAE,IAAe,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QAC9C,MAAM,IAAI,GAAG,IAAI,CAAC,IAA0B,CAAC;QAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;YACX,OAAO,EAAE,CAAC;QACX,CAAC;QAED,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,MAAM,YAAY,GAAG,MAAM,EAAE,YAAY,IAAI,qBAAqB,CAAC;QACnE,MAAM,gBAAgB,GAAG,MAAM,EAAE,gBAAgB,IAAI,IAAI,CAAC;QAE1D,MAAM,WAAW,GAAG,mBAAmB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAC5D,IAAI,WAAW,EAAE,CAAC;YACjB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC1B,CAAC;QAED,IAAI,gBAAgB,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACtD,MAAM,CAAC,IAAI,CACV,iBAAiB,IAAI,iGAAiG,CACtH,CAAC;QACH,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC/B,OAAO;gBACP,SAAS,EACR,uFAAuF;aACxF,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,EAAE,CAAC;IACX,CAAC;CACD,CAA6D,CAAC","sourcesContent":["import type { FilePolicyDefinition } from \"../policy.js\";\nimport {\n\tdefineGleamPolicy,\n\ttype GleamToml,\n} from \"../policyDefiners/defineGleamPolicy.js\";\n\n/**\n * Configuration for the GleamNameRestrictions policy.\n *\n * @public\n */\nexport interface GleamNameRestrictionsConfig {\n\t/**\n\t * Prefixes that are denied for package names.\n\t * @defaultValue [\"gleam_\"]\n\t */\n\tdenyPrefixes?: string[];\n\n\t/**\n\t * If true, require snake_case naming.\n\t * @defaultValue true\n\t */\n\trequireSnakeCase?: boolean;\n}\n\nconst DEFAULT_DENY_PREFIXES = [\"gleam_\"];\nconst SNAKE_CASE_REGEX = /^[a-z][a-z0-9]*(_[a-z0-9]+)*$/;\n\nfunction checkDeniedPrefixes(\n\tname: string,\n\tprefixes: string[],\n): string | undefined {\n\tfor (const prefix of prefixes) {\n\t\tif (name.startsWith(prefix)) {\n\t\t\treturn `Package name \"${name}\" uses reserved prefix \"${prefix}\". The \"gleam_\" prefix is reserved for official Gleam packages.`;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/**\n * A policy that enforces naming conventions for Gleam packages.\n *\n * @public\n */\nexport const GleamNameRestrictions = defineGleamPolicy({\n\tname: \"GleamNameRestrictions\",\n\tdescription:\n\t\t'Enforces Gleam package naming conventions: no \"gleam_\" prefix, snake_case required.',\n\thandler: async (toml: GleamToml, { config }) => {\n\t\tconst name = toml.name as string | undefined;\n\t\tif (!name) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst errors: string[] = [];\n\t\tconst denyPrefixes = config?.denyPrefixes ?? DEFAULT_DENY_PREFIXES;\n\t\tconst requireSnakeCase = config?.requireSnakeCase ?? true;\n\n\t\tconst prefixError = checkDeniedPrefixes(name, denyPrefixes);\n\t\tif (prefixError) {\n\t\t\terrors.push(prefixError);\n\t\t}\n\n\t\tif (requireSnakeCase && !SNAKE_CASE_REGEX.test(name)) {\n\t\t\terrors.push(\n\t\t\t\t`Package name \"${name}\" is not snake_case. Gleam package names should use lowercase letters, digits, and underscores.`,\n\t\t\t);\n\t\t}\n\n\t\tif (errors.length > 0) {\n\t\t\treturn errors.map((message) => ({\n\t\t\t\tmessage,\n\t\t\t\tmanualFix:\n\t\t\t\t\t\"Rename the package to follow Gleam naming conventions (snake_case, no gleam_ prefix).\",\n\t\t\t}));\n\t\t}\n\t\treturn [];\n\t},\n}) satisfies FilePolicyDefinition<GleamNameRestrictionsConfig>;\n"]}
@@ -0,0 +1,22 @@
1
+ import type { FilePolicyDefinition } from "../policy.js";
2
+ /**
3
+ * Configuration for the GleamNoPathDepsInPublished policy.
4
+ *
5
+ * @public
6
+ */
7
+ export interface GleamNoPathDepsInPublishedConfig {
8
+ /**
9
+ * If true, only check packages that don't have a "private" marker.
10
+ * Since Gleam doesn't have a native "private" field, this checks for
11
+ * the absence of a description (unpublished packages often lack one).
12
+ * @defaultValue false
13
+ */
14
+ onlyPublishable?: boolean;
15
+ }
16
+ /**
17
+ * A policy that warns when path dependencies are used in packages intended for publishing.
18
+ *
19
+ * @public
20
+ */
21
+ export declare const GleamNoPathDepsInPublished: FilePolicyDefinition<GleamNoPathDepsInPublishedConfig>;
22
+ //# sourceMappingURL=GleamNoPathDepsInPublished.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GleamNoPathDepsInPublished.d.ts","sourceRoot":"","sources":["../../src/policies/GleamNoPathDepsInPublished.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAMzD;;;;GAIG;AACH,MAAM,WAAW,gCAAgC;IAChD;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B;AAeD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,wDA8B4B,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { defineGleamPolicy, } from "../policyDefiners/defineGleamPolicy.js";
2
+ function findPathDeps(deps) {
3
+ const pathDeps = [];
4
+ for (const [name, value] of Object.entries(deps)) {
5
+ if (typeof value === "object" && value !== null) {
6
+ const record = value;
7
+ if (typeof record.path === "string") {
8
+ pathDeps.push(name);
9
+ }
10
+ }
11
+ }
12
+ return pathDeps;
13
+ }
14
+ /**
15
+ * A policy that warns when path dependencies are used in packages intended for publishing.
16
+ *
17
+ * @public
18
+ */
19
+ export const GleamNoPathDepsInPublished = defineGleamPolicy({
20
+ name: "GleamNoPathDepsInPublished",
21
+ description: "Warns when path dependencies are used in packages intended for publishing to Hex.",
22
+ handler: async (toml, { config }) => {
23
+ if (config?.onlyPublishable && !toml.description) {
24
+ return [];
25
+ }
26
+ const errors = [];
27
+ const deps = toml.dependencies;
28
+ if (deps) {
29
+ const pathDeps = findPathDeps(deps);
30
+ for (const dep of pathDeps) {
31
+ errors.push(`[dependencies] "${dep}" uses a path dependency, which will break when published to Hex`);
32
+ }
33
+ }
34
+ if (errors.length > 0) {
35
+ return errors.map((message) => ({
36
+ message,
37
+ manualFix: "Replace path dependencies with version constraints before publishing.",
38
+ }));
39
+ }
40
+ return [];
41
+ },
42
+ });
43
+ //# sourceMappingURL=GleamNoPathDepsInPublished.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GleamNoPathDepsInPublished.js","sourceRoot":"","sources":["../../src/policies/GleamNoPathDepsInPublished.ts"],"names":[],"mappings":"AACA,OAAO,EACN,iBAAiB,GAEjB,MAAM,wCAAwC,CAAC;AAiBhD,SAAS,YAAY,CAAC,IAA6B;IAClD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACjD,MAAM,MAAM,GAAG,KAAgC,CAAC;YAChD,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACrC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC;QACF,CAAC;IACF,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CAAC;IAC3D,IAAI,EAAE,4BAA4B;IAClC,WAAW,EACV,mFAAmF;IACpF,OAAO,EAAE,KAAK,EAAE,IAAe,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QAC9C,IAAI,MAAM,EAAE,eAAe,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YAClD,OAAO,EAAE,CAAC;QACX,CAAC;QAED,MAAM,MAAM,GAAa,EAAE,CAAC;QAE5B,MAAM,IAAI,GAAG,IAAI,CAAC,YAAmD,CAAC;QACtE,IAAI,IAAI,EAAE,CAAC;YACV,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;YACpC,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;gBAC5B,MAAM,CAAC,IAAI,CACV,mBAAmB,GAAG,kEAAkE,CACxF,CAAC;YACH,CAAC;QACF,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC/B,OAAO;gBACP,SAAS,EACR,uEAAuE;aACxE,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,EAAE,CAAC;IACX,CAAC;CACD,CAAkE,CAAC","sourcesContent":["import type { FilePolicyDefinition } from \"../policy.js\";\nimport {\n\tdefineGleamPolicy,\n\ttype GleamToml,\n} from \"../policyDefiners/defineGleamPolicy.js\";\n\n/**\n * Configuration for the GleamNoPathDepsInPublished policy.\n *\n * @public\n */\nexport interface GleamNoPathDepsInPublishedConfig {\n\t/**\n\t * If true, only check packages that don't have a \"private\" marker.\n\t * Since Gleam doesn't have a native \"private\" field, this checks for\n\t * the absence of a description (unpublished packages often lack one).\n\t * @defaultValue false\n\t */\n\tonlyPublishable?: boolean;\n}\n\nfunction findPathDeps(deps: Record<string, unknown>): string[] {\n\tconst pathDeps: string[] = [];\n\tfor (const [name, value] of Object.entries(deps)) {\n\t\tif (typeof value === \"object\" && value !== null) {\n\t\t\tconst record = value as Record<string, unknown>;\n\t\t\tif (typeof record.path === \"string\") {\n\t\t\t\tpathDeps.push(name);\n\t\t\t}\n\t\t}\n\t}\n\treturn pathDeps;\n}\n\n/**\n * A policy that warns when path dependencies are used in packages intended for publishing.\n *\n * @public\n */\nexport const GleamNoPathDepsInPublished = defineGleamPolicy({\n\tname: \"GleamNoPathDepsInPublished\",\n\tdescription:\n\t\t\"Warns when path dependencies are used in packages intended for publishing to Hex.\",\n\thandler: async (toml: GleamToml, { config }) => {\n\t\tif (config?.onlyPublishable && !toml.description) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst errors: string[] = [];\n\n\t\tconst deps = toml.dependencies as Record<string, unknown> | undefined;\n\t\tif (deps) {\n\t\t\tconst pathDeps = findPathDeps(deps);\n\t\t\tfor (const dep of pathDeps) {\n\t\t\t\terrors.push(\n\t\t\t\t\t`[dependencies] \"${dep}\" uses a path dependency, which will break when published to Hex`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (errors.length > 0) {\n\t\t\treturn errors.map((message) => ({\n\t\t\t\tmessage,\n\t\t\t\tmanualFix:\n\t\t\t\t\t\"Replace path dependencies with version constraints before publishing.\",\n\t\t\t}));\n\t\t}\n\t\treturn [];\n\t},\n}) satisfies FilePolicyDefinition<GleamNoPathDepsInPublishedConfig>;\n"]}
@@ -0,0 +1,9 @@
1
+ import type { FilePolicyDefinition } from "../policy.js";
2
+ /**
3
+ * A policy that validates all path dependency targets in gleam.toml exist
4
+ * and contain a gleam.toml file.
5
+ *
6
+ * @public
7
+ */
8
+ export declare const GleamPathDepsValid: FilePolicyDefinition<void>;
9
+ //# sourceMappingURL=GleamPathDepsValid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GleamPathDepsValid.d.ts","sourceRoot":"","sources":["../../src/policies/GleamPathDepsValid.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAkDzD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,4BAoBE,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { existsSync } from "node:fs";
2
+ import path from "pathe";
3
+ import { defineGleamPolicy, } from "../policyDefiners/defineGleamPolicy.js";
4
+ function validatePathDep(depName, depValue, sectionName, baseDir) {
5
+ if (typeof depValue !== "object" || depValue === null) {
6
+ return undefined;
7
+ }
8
+ const record = depValue;
9
+ if (typeof record.path !== "string") {
10
+ return undefined;
11
+ }
12
+ const depDir = path.resolve(baseDir, record.path);
13
+ if (!existsSync(depDir)) {
14
+ return `[${sectionName}] "${depName}" path "${record.path}" does not exist`;
15
+ }
16
+ if (!existsSync(path.join(depDir, "gleam.toml"))) {
17
+ return `[${sectionName}] "${depName}" path "${record.path}" exists but has no gleam.toml`;
18
+ }
19
+ return undefined;
20
+ }
21
+ function checkSection(sectionName, data, baseDir) {
22
+ if (!data || typeof data !== "object") {
23
+ return [];
24
+ }
25
+ const deps = data;
26
+ const errors = [];
27
+ for (const [depName, depValue] of Object.entries(deps)) {
28
+ const error = validatePathDep(depName, depValue, sectionName, baseDir);
29
+ if (error) {
30
+ errors.push(error);
31
+ }
32
+ }
33
+ return errors;
34
+ }
35
+ /**
36
+ * A policy that validates all path dependency targets in gleam.toml exist
37
+ * and contain a gleam.toml file.
38
+ *
39
+ * @public
40
+ */
41
+ export const GleamPathDepsValid = defineGleamPolicy({
42
+ name: "GleamPathDepsValid",
43
+ description: "Validates that all path dependency targets exist and contain a gleam.toml file.",
44
+ handler: async (toml, { file, root }) => {
45
+ const baseDir = path.resolve(root, path.dirname(file));
46
+ const errors = [
47
+ ...checkSection("dependencies", toml.dependencies, baseDir),
48
+ ...checkSection("dev-dependencies", toml["dev-dependencies"], baseDir),
49
+ ];
50
+ if (errors.length > 0) {
51
+ return errors.map((message) => ({
52
+ message,
53
+ manualFix: "Fix the path dependencies to point to valid Gleam project directories.",
54
+ }));
55
+ }
56
+ return [];
57
+ },
58
+ });
59
+ //# sourceMappingURL=GleamPathDepsValid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GleamPathDepsValid.js","sourceRoot":"","sources":["../../src/policies/GleamPathDepsValid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,OAAO,CAAC;AAEzB,OAAO,EACN,iBAAiB,GAEjB,MAAM,wCAAwC,CAAC;AAEhD,SAAS,eAAe,CACvB,OAAe,EACf,QAAiB,EACjB,WAAmB,EACnB,OAAe;IAEf,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACvD,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,MAAM,GAAG,QAAm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;IAClF,OAAO,EAAE,KAAK,EAAE,IAAe,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE;QAClD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,MAAM,MAAM,GAAa;YACxB,GAAG,YAAY,CAAC,cAAc,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC;YAC3D,GAAG,YAAY,CAAC,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;SACtE,CAAC;QAEF,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC/B,OAAO;gBACP,SAAS,EACR,wEAAwE;aACzE,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,EAAE,CAAC;IACX,CAAC;CACD,CAAgC,CAAC","sourcesContent":["import { existsSync } from \"node:fs\";\nimport path from \"pathe\";\nimport type { FilePolicyDefinition } from \"../policy.js\";\nimport {\n\tdefineGleamPolicy,\n\ttype GleamToml,\n} from \"../policyDefiners/defineGleamPolicy.js\";\n\nfunction validatePathDep(\n\tdepName: string,\n\tdepValue: unknown,\n\tsectionName: string,\n\tbaseDir: string,\n): string | undefined {\n\tif (typeof depValue !== \"object\" || depValue === null) {\n\t\treturn undefined;\n\t}\n\tconst record = depValue as Record<string, unknown>;\n\tif (typeof record.path !== \"string\") {\n\t\treturn undefined;\n\t}\n\n\tconst depDir = path.resolve(baseDir, record.path);\n\n\tif (!existsSync(depDir)) {\n\t\treturn `[${sectionName}] \"${depName}\" path \"${record.path}\" does not exist`;\n\t}\n\tif (!existsSync(path.join(depDir, \"gleam.toml\"))) {\n\t\treturn `[${sectionName}] \"${depName}\" path \"${record.path}\" exists but has no gleam.toml`;\n\t}\n\treturn undefined;\n}\n\nfunction checkSection(\n\tsectionName: string,\n\tdata: unknown,\n\tbaseDir: string,\n): string[] {\n\tif (!data || typeof data !== \"object\") {\n\t\treturn [];\n\t}\n\tconst deps = data as Record<string, unknown>;\n\tconst errors: string[] = [];\n\tfor (const [depName, depValue] of Object.entries(deps)) {\n\t\tconst error = validatePathDep(depName, depValue, sectionName, baseDir);\n\t\tif (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t}\n\treturn errors;\n}\n\n/**\n * A policy that validates all path dependency targets in gleam.toml exist\n * and contain a gleam.toml file.\n *\n * @public\n */\nexport const GleamPathDepsValid = defineGleamPolicy({\n\tname: \"GleamPathDepsValid\",\n\tdescription:\n\t\t\"Validates that all path dependency targets exist and contain a gleam.toml file.\",\n\thandler: async (toml: GleamToml, { file, root }) => {\n\t\tconst baseDir = path.resolve(root, path.dirname(file));\n\t\tconst errors: string[] = [\n\t\t\t...checkSection(\"dependencies\", toml.dependencies, baseDir),\n\t\t\t...checkSection(\"dev-dependencies\", toml[\"dev-dependencies\"], baseDir),\n\t\t];\n\n\t\tif (errors.length > 0) {\n\t\t\treturn errors.map((message) => ({\n\t\t\t\tmessage,\n\t\t\t\tmanualFix:\n\t\t\t\t\t\"Fix the path dependencies to point to valid Gleam project directories.\",\n\t\t\t}));\n\t\t}\n\t\treturn [];\n\t},\n}) satisfies FilePolicyDefinition;\n"]}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Configuration for the GleamProjectStructure policy.
3
+ *
4
+ * @public
5
+ */
6
+ export interface GleamProjectStructureConfig {
7
+ /**
8
+ * If true, require the src/ directory to exist.
9
+ * @defaultValue true
10
+ */
11
+ requireSrcDir?: boolean;
12
+ /**
13
+ * If true, require the test/ directory to exist.
14
+ * @defaultValue false
15
+ */
16
+ requireTestDir?: boolean;
17
+ }
18
+ /**
19
+ * A policy that validates standard Gleam project structure.
20
+ *
21
+ * @public
22
+ */
23
+ export declare const GleamProjectStructure: {
24
+ name: string;
25
+ description: string;
26
+ match: RegExp;
27
+ handler: ({ file, root, config }: import("../policy.js").PolicyArgs<GleamProjectStructureConfig>) => Promise<{
28
+ message: string;
29
+ manualFix: string;
30
+ }[]>;
31
+ };
32
+ //# sourceMappingURL=GleamProjectStructure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GleamProjectStructure.d.ts","sourceRoot":"","sources":["../../src/policies/GleamProjectStructure.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC3C;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;CA6B2B,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { existsSync } from "node:fs";
2
+ import path from "pathe";
3
+ /**
4
+ * A policy that validates standard Gleam project structure.
5
+ *
6
+ * @public
7
+ */
8
+ export const GleamProjectStructure = {
9
+ name: "GleamProjectStructure",
10
+ description: "Validates that Gleam projects have the standard directory structure (src/, test/).",
11
+ match: /gleam\.toml$/,
12
+ handler: async ({ file, root, config }) => {
13
+ const dir = path.dirname(path.resolve(root, file));
14
+ const requireSrc = config?.requireSrcDir ?? true;
15
+ const requireTest = config?.requireTestDir ?? false;
16
+ const errors = [];
17
+ if (requireSrc && !existsSync(path.join(dir, "src"))) {
18
+ errors.push("Missing src/ directory. Gleam projects require a src/ directory for source modules.");
19
+ }
20
+ if (requireTest && !existsSync(path.join(dir, "test"))) {
21
+ errors.push("Missing test/ directory.");
22
+ }
23
+ if (errors.length > 0) {
24
+ return errors.map((message) => ({
25
+ message,
26
+ manualFix: "Create the missing directories in your Gleam project.",
27
+ }));
28
+ }
29
+ return [];
30
+ },
31
+ };
32
+ //# sourceMappingURL=GleamProjectStructure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GleamProjectStructure.js","sourceRoot":"","sources":["../../src/policies/GleamProjectStructure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,OAAO,CAAC;AAqBzB;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACpC,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EACV,oFAAoF;IACrF,KAAK,EAAE,cAAc;IACrB,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;QACzC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QACnD,MAAM,UAAU,GAAG,MAAM,EAAE,aAAa,IAAI,IAAI,CAAC;QACjD,MAAM,WAAW,GAAG,MAAM,EAAE,cAAc,IAAI,KAAK,CAAC;QACpD,MAAM,MAAM,GAAa,EAAE,CAAC;QAE5B,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC;YACtD,MAAM,CAAC,IAAI,CACV,qFAAqF,CACrF,CAAC;QACH,CAAC;QAED,IAAI,WAAW,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;YACxD,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACzC,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC/B,OAAO;gBACP,SAAS,EAAE,uDAAuD;aAClE,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,EAAE,CAAC;IACX,CAAC;CAC2D,CAAC","sourcesContent":["import { existsSync } from \"node:fs\";\nimport path from \"pathe\";\nimport type { FilePolicyDefinition } from \"../policy.js\";\n/**\n * Configuration for the GleamProjectStructure policy.\n *\n * @public\n */\nexport interface GleamProjectStructureConfig {\n\t/**\n\t * If true, require the src/ directory to exist.\n\t * @defaultValue true\n\t */\n\trequireSrcDir?: boolean;\n\n\t/**\n\t * If true, require the test/ directory to exist.\n\t * @defaultValue false\n\t */\n\trequireTestDir?: boolean;\n}\n\n/**\n * A policy that validates standard Gleam project structure.\n *\n * @public\n */\nexport const GleamProjectStructure = {\n\tname: \"GleamProjectStructure\",\n\tdescription:\n\t\t\"Validates that Gleam projects have the standard directory structure (src/, test/).\",\n\tmatch: /gleam\\.toml$/,\n\thandler: async ({ file, root, config }) => {\n\t\tconst dir = path.dirname(path.resolve(root, file));\n\t\tconst requireSrc = config?.requireSrcDir ?? true;\n\t\tconst requireTest = config?.requireTestDir ?? false;\n\t\tconst errors: string[] = [];\n\n\t\tif (requireSrc && !existsSync(path.join(dir, \"src\"))) {\n\t\t\terrors.push(\n\t\t\t\t\"Missing src/ directory. Gleam projects require a src/ directory for source modules.\",\n\t\t\t);\n\t\t}\n\n\t\tif (requireTest && !existsSync(path.join(dir, \"test\"))) {\n\t\t\terrors.push(\"Missing test/ directory.\");\n\t\t}\n\n\t\tif (errors.length > 0) {\n\t\t\treturn errors.map((message) => ({\n\t\t\t\tmessage,\n\t\t\t\tmanualFix: \"Create the missing directories in your Gleam project.\",\n\t\t\t}));\n\t\t}\n\t\treturn [];\n\t},\n} satisfies FilePolicyDefinition<GleamProjectStructureConfig>;\n"]}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Configuration for the GleamSharedDependencyVersions policy.
3
+ *
4
+ * @public
5
+ */
6
+ export interface GleamSharedDependencyVersionsConfig {
7
+ /**
8
+ * If true, detect version mismatches across packages.
9
+ * @defaultValue true
10
+ */
11
+ detectMismatches?: boolean;
12
+ /**
13
+ * If true, also check dev-dependencies for mismatches.
14
+ * @defaultValue false
15
+ */
16
+ includeDev?: boolean;
17
+ /**
18
+ * Paths to gleam.toml files to compare (relative to repo root).
19
+ */
20
+ packages?: string[];
21
+ }
22
+ /**
23
+ * A policy that detects dependency version mismatches across Gleam packages in a monorepo.
24
+ *
25
+ * @public
26
+ */
27
+ export declare const GleamSharedDependencyVersions: {
28
+ name: string;
29
+ requiresConfig: true;
30
+ description: string;
31
+ match: RegExp;
32
+ handler: ({ root, config }: import("../policy.js").PolicyArgs<GleamSharedDependencyVersionsConfig>) => Promise<{
33
+ message: string;
34
+ manualFix: string;
35
+ }[]>;
36
+ };
37
+ //# sourceMappingURL=GleamSharedDependencyVersions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GleamSharedDependencyVersions.d.ts","sourceRoot":"","sources":["../../src/policies/GleamSharedDependencyVersions.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,MAAM,WAAW,mCAAmC;IACnD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AA2DD;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;CAqD2B,CAAC"}
@@ -0,0 +1,101 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import path from "pathe";
3
+ import { parseToml } from "../policyDefiners/tomlParser.js";
4
+ function extractVersion(dep) {
5
+ if (typeof dep === "string") {
6
+ return dep;
7
+ }
8
+ if (typeof dep === "object" && dep !== null) {
9
+ const record = dep;
10
+ if (typeof record.version === "string") {
11
+ return record.version;
12
+ }
13
+ }
14
+ return undefined;
15
+ }
16
+ function collectDeps(toml, includeDev) {
17
+ const deps = new Map();
18
+ const sections = ["dependencies"];
19
+ if (includeDev) {
20
+ sections.push("dev-dependencies");
21
+ }
22
+ for (const section of sections) {
23
+ const sectionDeps = toml[section];
24
+ if (!sectionDeps) {
25
+ continue;
26
+ }
27
+ for (const [name, value] of Object.entries(sectionDeps)) {
28
+ const version = extractVersion(value);
29
+ if (version) {
30
+ deps.set(name, version);
31
+ }
32
+ }
33
+ }
34
+ return deps;
35
+ }
36
+ function recordDependency(allDeps, depName, version, pkgPath) {
37
+ if (!allDeps.has(depName)) {
38
+ allDeps.set(depName, new Map());
39
+ }
40
+ const versionMap = allDeps.get(depName);
41
+ if (versionMap === undefined) {
42
+ return;
43
+ }
44
+ if (!versionMap.has(version)) {
45
+ versionMap.set(version, []);
46
+ }
47
+ versionMap.get(version)?.push(pkgPath);
48
+ }
49
+ /**
50
+ * A policy that detects dependency version mismatches across Gleam packages in a monorepo.
51
+ *
52
+ * @public
53
+ */
54
+ export const GleamSharedDependencyVersions = {
55
+ name: "GleamSharedDependencyVersions",
56
+ requiresConfig: true,
57
+ description: "Detects dependency version mismatches across Gleam packages in a monorepo.",
58
+ match: /^gleam\.toml$/,
59
+ handler: async ({ root, config }) => {
60
+ const packagePaths = config?.packages;
61
+ if (!packagePaths || packagePaths.length < 2) {
62
+ return [];
63
+ }
64
+ const detectMismatches = config?.detectMismatches ?? true;
65
+ if (!detectMismatches) {
66
+ return [];
67
+ }
68
+ const includeDev = config?.includeDev ?? false;
69
+ const allDeps = new Map();
70
+ for (const pkgPath of packagePaths) {
71
+ try {
72
+ const content = await readFile(path.resolve(root, pkgPath), "utf-8");
73
+ const toml = await parseToml(content);
74
+ const deps = collectDeps(toml, includeDev);
75
+ for (const [name, version] of deps) {
76
+ recordDependency(allDeps, name, version, pkgPath);
77
+ }
78
+ }
79
+ catch {
80
+ // Package might not exist
81
+ }
82
+ }
83
+ const errors = [];
84
+ for (const [dep, versionMap] of allDeps) {
85
+ if (versionMap.size > 1) {
86
+ const details = [...versionMap.entries()]
87
+ .map(([ver, pkgs]) => `"${ver}" in ${pkgs.join(", ")}`)
88
+ .join("; ");
89
+ errors.push(`Version mismatch for "${dep}": ${details}`);
90
+ }
91
+ }
92
+ if (errors.length > 0) {
93
+ return errors.map((message) => ({
94
+ message,
95
+ manualFix: "Align dependency versions across all Gleam packages in the monorepo.",
96
+ }));
97
+ }
98
+ return [];
99
+ },
100
+ };
101
+ //# sourceMappingURL=GleamSharedDependencyVersions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GleamSharedDependencyVersions.js","sourceRoot":"","sources":["../../src/policies/GleamSharedDependencyVersions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,OAAO,CAAC;AAEzB,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AA0B5D,SAAS,cAAc,CAAC,GAAY;IACnC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,GAAG,CAAC;IACZ,CAAC;IACD,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QAC7C,MAAM,MAAM,GAAG,GAA8B,CAAC;QAC9C,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YACxC,OAAO,MAAM,CAAC,OAAO,CAAC;QACvB,CAAC;IACF,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,SAAS,WAAW,CACnB,IAA6B,EAC7B,UAAmB;IAEnB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAkB,CAAC;IACvC,MAAM,QAAQ,GAAG,CAAC,cAAc,CAAC,CAAC;IAClC,IAAI,UAAU,EAAE,CAAC;QAChB,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAChC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAwC,CAAC;QACzE,IAAI,CAAC,WAAW,EAAE,CAAC;YAClB,SAAS;QACV,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YACzD,MAAM,OAAO,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,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC/B,OAAO;gBACP,SAAS,EACR,sEAAsE;aACvE,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,EAAE,CAAC;IACX,CAAC;CACmE,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport path from \"pathe\";\nimport type { FilePolicyDefinition } from \"../policy.js\";\nimport { parseToml } from \"../policyDefiners/tomlParser.js\";\n\n/**\n * Configuration for the GleamSharedDependencyVersions policy.\n *\n * @public\n */\nexport interface GleamSharedDependencyVersionsConfig {\n\t/**\n\t * If true, detect version mismatches across packages.\n\t * @defaultValue true\n\t */\n\tdetectMismatches?: boolean;\n\n\t/**\n\t * If true, also check dev-dependencies for mismatches.\n\t * @defaultValue false\n\t */\n\tincludeDev?: boolean;\n\n\t/**\n\t * Paths to gleam.toml files to compare (relative to repo root).\n\t */\n\tpackages?: string[];\n}\n\nfunction extractVersion(dep: unknown): string | undefined {\n\tif (typeof dep === \"string\") {\n\t\treturn dep;\n\t}\n\tif (typeof dep === \"object\" && dep !== null) {\n\t\tconst record = dep as Record<string, unknown>;\n\t\tif (typeof record.version === \"string\") {\n\t\t\treturn record.version;\n\t\t}\n\t}\n\treturn undefined;\n}\n\nfunction collectDeps(\n\ttoml: Record<string, unknown>,\n\tincludeDev: boolean,\n): Map<string, string> {\n\tconst deps = new Map<string, string>();\n\tconst sections = [\"dependencies\"];\n\tif (includeDev) {\n\t\tsections.push(\"dev-dependencies\");\n\t}\n\n\tfor (const section of sections) {\n\t\tconst sectionDeps = toml[section] as Record<string, unknown> | undefined;\n\t\tif (!sectionDeps) {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const [name, value] of Object.entries(sectionDeps)) {\n\t\t\tconst version = extractVersion(value);\n\t\t\tif (version) {\n\t\t\t\tdeps.set(name, version);\n\t\t\t}\n\t\t}\n\t}\n\treturn deps;\n}\n\nfunction recordDependency(\n\tallDeps: Map<string, Map<string, string[]>>,\n\tdepName: string,\n\tversion: string,\n\tpkgPath: string,\n): void {\n\tif (!allDeps.has(depName)) {\n\t\tallDeps.set(depName, new Map());\n\t}\n\tconst versionMap = allDeps.get(depName);\n\tif (versionMap === undefined) {\n\t\treturn;\n\t}\n\tif (!versionMap.has(version)) {\n\t\tversionMap.set(version, []);\n\t}\n\tversionMap.get(version)?.push(pkgPath);\n}\n\n/**\n * A policy that detects dependency version mismatches across Gleam packages in a monorepo.\n *\n * @public\n */\nexport const GleamSharedDependencyVersions = {\n\tname: \"GleamSharedDependencyVersions\",\n\trequiresConfig: true,\n\tdescription:\n\t\t\"Detects dependency version mismatches across Gleam packages in a monorepo.\",\n\tmatch: /^gleam\\.toml$/,\n\thandler: async ({ root, config }) => {\n\t\tconst packagePaths = config?.packages;\n\t\tif (!packagePaths || packagePaths.length < 2) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst detectMismatches = config?.detectMismatches ?? true;\n\t\tif (!detectMismatches) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst includeDev = config?.includeDev ?? false;\n\t\tconst allDeps = new Map<string, Map<string, string[]>>();\n\n\t\tfor (const pkgPath of packagePaths) {\n\t\t\ttry {\n\t\t\t\tconst content = await readFile(path.resolve(root, pkgPath), \"utf-8\");\n\t\t\t\tconst toml = await parseToml(content);\n\t\t\t\tconst deps = collectDeps(toml, includeDev);\n\n\t\t\t\tfor (const [name, version] of deps) {\n\t\t\t\t\trecordDependency(allDeps, name, version, pkgPath);\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// Package might not exist\n\t\t\t}\n\t\t}\n\n\t\tconst errors: string[] = [];\n\t\tfor (const [dep, versionMap] of allDeps) {\n\t\t\tif (versionMap.size > 1) {\n\t\t\t\tconst details = [...versionMap.entries()]\n\t\t\t\t\t.map(([ver, pkgs]) => `\"${ver}\" in ${pkgs.join(\", \")}`)\n\t\t\t\t\t.join(\"; \");\n\t\t\t\terrors.push(`Version mismatch for \"${dep}\": ${details}`);\n\t\t\t}\n\t\t}\n\n\t\tif (errors.length > 0) {\n\t\t\treturn errors.map((message) => ({\n\t\t\t\tmessage,\n\t\t\t\tmanualFix:\n\t\t\t\t\t\"Align dependency versions across all Gleam packages in the monorepo.\",\n\t\t\t}));\n\t\t}\n\t\treturn [];\n\t},\n} satisfies FilePolicyDefinition<GleamSharedDependencyVersionsConfig>;\n"]}
@@ -0,0 +1,30 @@
1
+ import type { FilePolicyDefinition } from "../policy.js";
2
+ /**
3
+ * Configuration for the GleamTomlRequired policy.
4
+ *
5
+ * @public
6
+ */
7
+ export interface GleamTomlRequiredConfig {
8
+ /**
9
+ * Top-level fields that must exist in gleam.toml.
10
+ * @defaultValue ["name", "version"]
11
+ */
12
+ required?: string[];
13
+ /**
14
+ * If true, require the `gleam` compiler version constraint.
15
+ * @defaultValue false
16
+ */
17
+ requireGleamVersion?: boolean;
18
+ /**
19
+ * If true, require the `[repository]` section.
20
+ * @defaultValue false
21
+ */
22
+ requireRepository?: boolean;
23
+ }
24
+ /**
25
+ * A policy that enforces required fields exist in gleam.toml.
26
+ *
27
+ * @public
28
+ */
29
+ export declare const GleamTomlRequired: FilePolicyDefinition<GleamTomlRequiredConfig>;
30
+ //# sourceMappingURL=GleamTomlRequired.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GleamTomlRequired.d.ts","sourceRoot":"","sources":["../../src/policies/GleamTomlRequired.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAMzD;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAcD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,+CA4B4B,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { defineGleamPolicy, } from "../policyDefiners/defineGleamPolicy.js";
2
+ const DEFAULT_REQUIRED_FIELDS = ["name", "version"];
3
+ function checkRequiredFields(toml, fields) {
4
+ const errors = [];
5
+ for (const field of fields) {
6
+ if (toml[field] === undefined || toml[field] === "") {
7
+ errors.push(`Missing required field: ${field}`);
8
+ }
9
+ }
10
+ return errors;
11
+ }
12
+ /**
13
+ * A policy that enforces required fields exist in gleam.toml.
14
+ *
15
+ * @public
16
+ */
17
+ export const GleamTomlRequired = defineGleamPolicy({
18
+ name: "GleamTomlRequired",
19
+ description: "Ensures gleam.toml files contain required fields for proper project configuration.",
20
+ handler: async (toml, { config }) => {
21
+ const errors = checkRequiredFields(toml, config?.required ?? DEFAULT_REQUIRED_FIELDS);
22
+ if (config?.requireGleamVersion && toml.gleam === undefined) {
23
+ errors.push('Missing gleam version constraint. Add gleam = ">= x.y.z" to gleam.toml.');
24
+ }
25
+ if (config?.requireRepository && toml.repository === undefined) {
26
+ errors.push("Missing [repository] section in gleam.toml.");
27
+ }
28
+ if (errors.length > 0) {
29
+ return errors.map((message) => ({
30
+ message,
31
+ manualFix: "Add the missing fields to your gleam.toml file.",
32
+ }));
33
+ }
34
+ return [];
35
+ },
36
+ });
37
+ //# sourceMappingURL=GleamTomlRequired.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GleamTomlRequired.js","sourceRoot":"","sources":["../../src/policies/GleamTomlRequired.ts"],"names":[],"mappings":"AACA,OAAO,EACN,iBAAiB,GAEjB,MAAM,wCAAwC,CAAC;AA2BhD,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAEpD,SAAS,mBAAmB,CAAC,IAAe,EAAE,MAAgB;IAC7D,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC5B,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;YACrD,MAAM,CAAC,IAAI,CAAC,2BAA2B,KAAK,EAAE,CAAC,CAAC;QACjD,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;IAClD,IAAI,EAAE,mBAAmB;IACzB,WAAW,EACV,oFAAoF;IACrF,OAAO,EAAE,KAAK,EAAE,IAAe,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QAC9C,MAAM,MAAM,GAAG,mBAAmB,CACjC,IAAI,EACJ,MAAM,EAAE,QAAQ,IAAI,uBAAuB,CAC3C,CAAC;QAEF,IAAI,MAAM,EAAE,mBAAmB,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC7D,MAAM,CAAC,IAAI,CACV,yEAAyE,CACzE,CAAC;QACH,CAAC;QAED,IAAI,MAAM,EAAE,iBAAiB,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAChE,MAAM,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;QAC5D,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC/B,OAAO;gBACP,SAAS,EAAE,iDAAiD;aAC5D,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,EAAE,CAAC;IACX,CAAC;CACD,CAAyD,CAAC","sourcesContent":["import type { FilePolicyDefinition } from \"../policy.js\";\nimport {\n\tdefineGleamPolicy,\n\ttype GleamToml,\n} from \"../policyDefiners/defineGleamPolicy.js\";\n\n/**\n * Configuration for the GleamTomlRequired policy.\n *\n * @public\n */\nexport interface GleamTomlRequiredConfig {\n\t/**\n\t * Top-level fields that must exist in gleam.toml.\n\t * @defaultValue [\"name\", \"version\"]\n\t */\n\trequired?: string[];\n\n\t/**\n\t * If true, require the `gleam` compiler version constraint.\n\t * @defaultValue false\n\t */\n\trequireGleamVersion?: boolean;\n\n\t/**\n\t * If true, require the `[repository]` section.\n\t * @defaultValue false\n\t */\n\trequireRepository?: boolean;\n}\n\nconst DEFAULT_REQUIRED_FIELDS = [\"name\", \"version\"];\n\nfunction checkRequiredFields(toml: GleamToml, fields: string[]): string[] {\n\tconst errors: string[] = [];\n\tfor (const field of fields) {\n\t\tif (toml[field] === undefined || toml[field] === \"\") {\n\t\t\terrors.push(`Missing required field: ${field}`);\n\t\t}\n\t}\n\treturn errors;\n}\n\n/**\n * A policy that enforces required fields exist in gleam.toml.\n *\n * @public\n */\nexport const GleamTomlRequired = defineGleamPolicy({\n\tname: \"GleamTomlRequired\",\n\tdescription:\n\t\t\"Ensures gleam.toml files contain required fields for proper project configuration.\",\n\thandler: async (toml: GleamToml, { config }) => {\n\t\tconst errors = checkRequiredFields(\n\t\t\ttoml,\n\t\t\tconfig?.required ?? DEFAULT_REQUIRED_FIELDS,\n\t\t);\n\n\t\tif (config?.requireGleamVersion && toml.gleam === undefined) {\n\t\t\terrors.push(\n\t\t\t\t'Missing gleam version constraint. Add gleam = \">= x.y.z\" to gleam.toml.',\n\t\t\t);\n\t\t}\n\n\t\tif (config?.requireRepository && toml.repository === undefined) {\n\t\t\terrors.push(\"Missing [repository] section in gleam.toml.\");\n\t\t}\n\n\t\tif (errors.length > 0) {\n\t\t\treturn errors.map((message) => ({\n\t\t\t\tmessage,\n\t\t\t\tmanualFix: \"Add the missing fields to your gleam.toml file.\",\n\t\t\t}));\n\t\t}\n\t\treturn [];\n\t},\n}) satisfies FilePolicyDefinition<GleamTomlRequiredConfig>;\n"]}
@@ -0,0 +1,20 @@
1
+ import type { FilePolicyDefinition } from "../policy.js";
2
+ /**
3
+ * Configuration for the GleamTomlSorted policy.
4
+ *
5
+ * @public
6
+ */
7
+ export interface GleamTomlSortedConfig {
8
+ /**
9
+ * Sections whose keys should be sorted alphabetically.
10
+ * @defaultValue ["dependencies", "dev-dependencies"]
11
+ */
12
+ sections?: string[];
13
+ }
14
+ /**
15
+ * A policy that ensures dependency sections in gleam.toml are sorted alphabetically.
16
+ *
17
+ * @public
18
+ */
19
+ export declare const GleamTomlSorted: FilePolicyDefinition<GleamTomlSortedConfig>;
20
+ //# sourceMappingURL=GleamTomlSorted.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GleamTomlSorted.d.ts","sourceRoot":"","sources":["../../src/policies/GleamTomlSorted.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAMzD;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AA2ID;;;;GAIG;AACH,eAAO,MAAM,eAAe,6CAoD4B,CAAC"}