repopo 0.12.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 (333) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +50 -90
  3. package/THIRD-PARTY-LICENSES.txt +169 -11
  4. package/bin/dev.js +0 -0
  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.map +1 -1
  14. package/esm/baseCommand.js +2 -2
  15. package/esm/baseCommand.js.map +1 -1
  16. package/esm/commands/check-native.d.ts +3 -3
  17. package/esm/commands/check-native.d.ts.map +1 -1
  18. package/esm/commands/check-native.js +26 -7
  19. package/esm/commands/check-native.js.map +1 -1
  20. package/esm/commands/check.d.ts +6 -21
  21. package/esm/commands/check.d.ts.map +1 -1
  22. package/esm/commands/check.js +73 -153
  23. package/esm/commands/check.js.map +1 -1
  24. package/esm/commands/list.d.ts.map +1 -1
  25. package/esm/commands/list.js +2 -1
  26. package/esm/commands/list.js.map +1 -1
  27. package/esm/concurrency.d.ts +3 -0
  28. package/esm/concurrency.d.ts.map +1 -0
  29. package/esm/concurrency.js +8 -0
  30. package/esm/concurrency.js.map +1 -0
  31. package/esm/config.d.ts +5 -39
  32. package/esm/config.d.ts.map +1 -1
  33. package/esm/config.js +3 -7
  34. package/esm/config.js.map +1 -1
  35. package/esm/context.d.ts +8 -1
  36. package/esm/context.d.ts.map +1 -1
  37. package/esm/context.js +8 -1
  38. package/esm/context.js.map +1 -1
  39. package/esm/executionContractError.d.ts +4 -0
  40. package/esm/executionContractError.d.ts.map +1 -0
  41. package/esm/executionContractError.js +4 -0
  42. package/esm/executionContractError.js.map +1 -0
  43. package/esm/fileCache.d.ts +12 -0
  44. package/esm/fileCache.d.ts.map +1 -0
  45. package/esm/fileCache.js +37 -0
  46. package/esm/fileCache.js.map +1 -0
  47. package/esm/filePaths.d.ts +2 -0
  48. package/esm/filePaths.d.ts.map +1 -0
  49. package/esm/filePaths.js +9 -0
  50. package/esm/filePaths.js.map +1 -0
  51. package/esm/generators.d.ts +0 -20
  52. package/esm/generators.d.ts.map +1 -1
  53. package/esm/generators.js.map +1 -1
  54. package/esm/index.d.ts +3 -16
  55. package/esm/index.d.ts.map +1 -1
  56. package/esm/index.js +3 -17
  57. package/esm/index.js.map +1 -1
  58. package/esm/makePolicy.d.ts +20 -100
  59. package/esm/makePolicy.d.ts.map +1 -1
  60. package/esm/makePolicy.js +44 -132
  61. package/esm/makePolicy.js.map +1 -1
  62. package/esm/perf.d.ts +5 -2
  63. package/esm/perf.d.ts.map +1 -1
  64. package/esm/perf.js +10 -9
  65. package/esm/perf.js.map +1 -1
  66. package/esm/policies/CargoLicenceValidated.d.ts +4 -4
  67. package/esm/policies/CargoLicenceValidated.d.ts.map +1 -1
  68. package/esm/policies/CargoLicenceValidated.js +9 -7
  69. package/esm/policies/CargoLicenceValidated.js.map +1 -1
  70. package/esm/policies/CargoLintsConfigured.d.ts +4 -4
  71. package/esm/policies/CargoLintsConfigured.d.ts.map +1 -1
  72. package/esm/policies/CargoLintsConfigured.js +19 -15
  73. package/esm/policies/CargoLintsConfigured.js.map +1 -1
  74. package/esm/policies/CargoLockPolicy.d.ts +4 -4
  75. package/esm/policies/CargoLockPolicy.d.ts.map +1 -1
  76. package/esm/policies/CargoLockPolicy.js +15 -11
  77. package/esm/policies/CargoLockPolicy.js.map +1 -1
  78. package/esm/policies/CargoTomlRequired.d.ts +5 -5
  79. package/esm/policies/CargoTomlRequired.d.ts.map +1 -1
  80. package/esm/policies/CargoTomlRequired.js +7 -7
  81. package/esm/policies/CargoTomlRequired.js.map +1 -1
  82. package/esm/policies/CargoTomlSorted.d.ts +4 -4
  83. package/esm/policies/CargoTomlSorted.d.ts.map +1 -1
  84. package/esm/policies/CargoTomlSorted.js +21 -17
  85. package/esm/policies/CargoTomlSorted.js.map +1 -1
  86. package/esm/policies/ConditionalScripts.d.ts +10 -8
  87. package/esm/policies/ConditionalScripts.d.ts.map +1 -1
  88. package/esm/policies/ConditionalScripts.js +24 -22
  89. package/esm/policies/ConditionalScripts.js.map +1 -1
  90. package/esm/policies/ExactScripts.d.ts +8 -6
  91. package/esm/policies/ExactScripts.d.ts.map +1 -1
  92. package/esm/policies/ExactScripts.js +15 -18
  93. package/esm/policies/ExactScripts.js.map +1 -1
  94. package/esm/policies/GleamDepVersions.d.ts +5 -5
  95. package/esm/policies/GleamDepVersions.d.ts.map +1 -1
  96. package/esm/policies/GleamDepVersions.js +5 -5
  97. package/esm/policies/GleamDepVersions.js.map +1 -1
  98. package/esm/policies/GleamDocExists.d.ts +4 -4
  99. package/esm/policies/GleamDocExists.d.ts.map +1 -1
  100. package/esm/policies/GleamDocExists.js +6 -6
  101. package/esm/policies/GleamDocExists.js.map +1 -1
  102. package/esm/policies/GleamInternalModulesConfigured.d.ts +4 -4
  103. package/esm/policies/GleamInternalModulesConfigured.d.ts.map +1 -1
  104. package/esm/policies/GleamInternalModulesConfigured.js +8 -6
  105. package/esm/policies/GleamInternalModulesConfigured.js.map +1 -1
  106. package/esm/policies/GleamLicenceConfigured.d.ts +4 -4
  107. package/esm/policies/GleamLicenceConfigured.d.ts.map +1 -1
  108. package/esm/policies/GleamLicenceConfigured.js +8 -6
  109. package/esm/policies/GleamLicenceConfigured.js.map +1 -1
  110. package/esm/policies/GleamManifestCommitted.d.ts +10 -3
  111. package/esm/policies/GleamManifestCommitted.d.ts.map +1 -1
  112. package/esm/policies/GleamManifestCommitted.js +10 -9
  113. package/esm/policies/GleamManifestCommitted.js.map +1 -1
  114. package/esm/policies/GleamMonorepoConsistency.d.ts +13 -5
  115. package/esm/policies/GleamMonorepoConsistency.d.ts.map +1 -1
  116. package/esm/policies/GleamMonorepoConsistency.js +10 -10
  117. package/esm/policies/GleamMonorepoConsistency.js.map +1 -1
  118. package/esm/policies/GleamNameRestrictions.d.ts +4 -4
  119. package/esm/policies/GleamNameRestrictions.d.ts.map +1 -1
  120. package/esm/policies/GleamNameRestrictions.js +6 -6
  121. package/esm/policies/GleamNameRestrictions.js.map +1 -1
  122. package/esm/policies/GleamNoPathDepsInPublished.d.ts +4 -4
  123. package/esm/policies/GleamNoPathDepsInPublished.d.ts.map +1 -1
  124. package/esm/policies/GleamNoPathDepsInPublished.js +6 -6
  125. package/esm/policies/GleamNoPathDepsInPublished.js.map +1 -1
  126. package/esm/policies/GleamPathDepsValid.d.ts +3 -3
  127. package/esm/policies/GleamPathDepsValid.d.ts.map +1 -1
  128. package/esm/policies/GleamPathDepsValid.js +5 -5
  129. package/esm/policies/GleamPathDepsValid.js.map +1 -1
  130. package/esm/policies/GleamProjectStructure.d.ts +11 -4
  131. package/esm/policies/GleamProjectStructure.d.ts.map +1 -1
  132. package/esm/policies/GleamProjectStructure.js +7 -8
  133. package/esm/policies/GleamProjectStructure.js.map +1 -1
  134. package/esm/policies/GleamSharedDependencyVersions.d.ts +12 -4
  135. package/esm/policies/GleamSharedDependencyVersions.d.ts.map +1 -1
  136. package/esm/policies/GleamSharedDependencyVersions.js +10 -10
  137. package/esm/policies/GleamSharedDependencyVersions.js.map +1 -1
  138. package/esm/policies/GleamTomlRequired.d.ts +4 -4
  139. package/esm/policies/GleamTomlRequired.d.ts.map +1 -1
  140. package/esm/policies/GleamTomlRequired.js +5 -5
  141. package/esm/policies/GleamTomlRequired.js.map +1 -1
  142. package/esm/policies/GleamTomlSorted.d.ts +4 -4
  143. package/esm/policies/GleamTomlSorted.d.ts.map +1 -1
  144. package/esm/policies/GleamTomlSorted.js +21 -17
  145. package/esm/policies/GleamTomlSorted.js.map +1 -1
  146. package/esm/policies/GleamVersionConstraint.d.ts +4 -4
  147. package/esm/policies/GleamVersionConstraint.d.ts.map +1 -1
  148. package/esm/policies/GleamVersionConstraint.js +14 -10
  149. package/esm/policies/GleamVersionConstraint.js.map +1 -1
  150. package/esm/policies/HtmlFileHeaders.d.ts +4 -2
  151. package/esm/policies/HtmlFileHeaders.d.ts.map +1 -1
  152. package/esm/policies/HtmlFileHeaders.js +1 -1
  153. package/esm/policies/HtmlFileHeaders.js.map +1 -1
  154. package/esm/policies/JsTsFileHeaders.d.ts +4 -2
  155. package/esm/policies/JsTsFileHeaders.d.ts.map +1 -1
  156. package/esm/policies/JsTsFileHeaders.js +1 -1
  157. package/esm/policies/JsTsFileHeaders.js.map +1 -1
  158. package/esm/policies/LicenseFileExists.d.ts +10 -4
  159. package/esm/policies/LicenseFileExists.d.ts.map +1 -1
  160. package/esm/policies/LicenseFileExists.js +27 -20
  161. package/esm/policies/LicenseFileExists.js.map +1 -1
  162. package/esm/policies/MutuallyExclusiveScripts.d.ts +8 -6
  163. package/esm/policies/MutuallyExclusiveScripts.d.ts.map +1 -1
  164. package/esm/policies/MutuallyExclusiveScripts.js +9 -13
  165. package/esm/policies/MutuallyExclusiveScripts.js.map +1 -1
  166. package/esm/policies/NoBuildDirectory.d.ts +9 -3
  167. package/esm/policies/NoBuildDirectory.d.ts.map +1 -1
  168. package/esm/policies/NoBuildDirectory.js +8 -13
  169. package/esm/policies/NoBuildDirectory.js.map +1 -1
  170. package/esm/policies/NoJsFileExtensions.d.ts +9 -3
  171. package/esm/policies/NoJsFileExtensions.d.ts.map +1 -1
  172. package/esm/policies/NoJsFileExtensions.js +9 -14
  173. package/esm/policies/NoJsFileExtensions.js.map +1 -1
  174. package/esm/policies/NoLargeBinaryFiles.d.ts +9 -4
  175. package/esm/policies/NoLargeBinaryFiles.d.ts.map +1 -1
  176. package/esm/policies/NoLargeBinaryFiles.js +10 -16
  177. package/esm/policies/NoLargeBinaryFiles.js.map +1 -1
  178. package/esm/policies/NoPrivateWorkspaceDependencies.d.ts +10 -6
  179. package/esm/policies/NoPrivateWorkspaceDependencies.d.ts.map +1 -1
  180. package/esm/policies/NoPrivateWorkspaceDependencies.js +12 -14
  181. package/esm/policies/NoPrivateWorkspaceDependencies.js.map +1 -1
  182. package/esm/policies/NoTargetArtifacts.d.ts +9 -3
  183. package/esm/policies/NoTargetArtifacts.d.ts.map +1 -1
  184. package/esm/policies/NoTargetArtifacts.js +9 -14
  185. package/esm/policies/NoTargetArtifacts.js.map +1 -1
  186. package/esm/policies/NoUnsafeWithoutJustification.d.ts +11 -4
  187. package/esm/policies/NoUnsafeWithoutJustification.d.ts.map +1 -1
  188. package/esm/policies/NoUnsafeWithoutJustification.js +8 -9
  189. package/esm/policies/NoUnsafeWithoutJustification.js.map +1 -1
  190. package/esm/policies/NoWildcardDependencies.d.ts +5 -5
  191. package/esm/policies/NoWildcardDependencies.d.ts.map +1 -1
  192. package/esm/policies/NoWildcardDependencies.js +6 -6
  193. package/esm/policies/NoWildcardDependencies.js.map +1 -1
  194. package/esm/policies/PackageAllowedScopes.d.ts +9 -5
  195. package/esm/policies/PackageAllowedScopes.d.ts.map +1 -1
  196. package/esm/policies/PackageAllowedScopes.js +15 -16
  197. package/esm/policies/PackageAllowedScopes.js.map +1 -1
  198. package/esm/policies/PackageEsmType.d.ts +7 -5
  199. package/esm/policies/PackageEsmType.d.ts.map +1 -1
  200. package/esm/policies/PackageEsmType.js +31 -31
  201. package/esm/policies/PackageEsmType.js.map +1 -1
  202. package/esm/policies/PackageFolderName.d.ts +8 -6
  203. package/esm/policies/PackageFolderName.d.ts.map +1 -1
  204. package/esm/policies/PackageFolderName.js +13 -16
  205. package/esm/policies/PackageFolderName.js.map +1 -1
  206. package/esm/policies/PackageJsonProperties.d.ts +5 -3
  207. package/esm/policies/PackageJsonProperties.d.ts.map +1 -1
  208. package/esm/policies/PackageJsonProperties.js +6 -17
  209. package/esm/policies/PackageJsonProperties.js.map +1 -1
  210. package/esm/policies/PackageJsonRepoDirectoryProperty.d.ts +2 -7
  211. package/esm/policies/PackageJsonRepoDirectoryProperty.d.ts.map +1 -1
  212. package/esm/policies/PackageJsonRepoDirectoryProperty.js +28 -42
  213. package/esm/policies/PackageJsonRepoDirectoryProperty.js.map +1 -1
  214. package/esm/policies/PackageJsonSorted.d.ts +2 -2
  215. package/esm/policies/PackageJsonSorted.d.ts.map +1 -1
  216. package/esm/policies/PackageJsonSorted.js +15 -30
  217. package/esm/policies/PackageJsonSorted.js.map +1 -1
  218. package/esm/policies/PackageLicense.d.ts +4 -4
  219. package/esm/policies/PackageLicense.d.ts.map +1 -1
  220. package/esm/policies/PackageLicense.js +31 -52
  221. package/esm/policies/PackageLicense.js.map +1 -1
  222. package/esm/policies/PackagePrivateField.d.ts +12 -8
  223. package/esm/policies/PackagePrivateField.d.ts.map +1 -1
  224. package/esm/policies/PackagePrivateField.js +31 -23
  225. package/esm/policies/PackagePrivateField.js.map +1 -1
  226. package/esm/policies/PackageReadme.d.ts +6 -5
  227. package/esm/policies/PackageReadme.d.ts.map +1 -1
  228. package/esm/policies/PackageReadme.js +22 -59
  229. package/esm/policies/PackageReadme.js.map +1 -1
  230. package/esm/policies/PackageScripts.d.ts +26 -22
  231. package/esm/policies/PackageScripts.d.ts.map +1 -1
  232. package/esm/policies/PackageScripts.js +39 -36
  233. package/esm/policies/PackageScripts.js.map +1 -1
  234. package/esm/policies/PackageTestScripts.d.ts +10 -6
  235. package/esm/policies/PackageTestScripts.d.ts.map +1 -1
  236. package/esm/policies/PackageTestScripts.js +14 -16
  237. package/esm/policies/PackageTestScripts.js.map +1 -1
  238. package/esm/policies/PublicApiDocumented.d.ts +4 -4
  239. package/esm/policies/PublicApiDocumented.d.ts.map +1 -1
  240. package/esm/policies/PublicApiDocumented.js +10 -8
  241. package/esm/policies/PublicApiDocumented.js.map +1 -1
  242. package/esm/policies/RequiredGitignorePatterns.d.ts +11 -4
  243. package/esm/policies/RequiredGitignorePatterns.d.ts.map +1 -1
  244. package/esm/policies/RequiredGitignorePatterns.js +29 -36
  245. package/esm/policies/RequiredGitignorePatterns.js.map +1 -1
  246. package/esm/policies/RequiredScripts.d.ts +9 -7
  247. package/esm/policies/RequiredScripts.d.ts.map +1 -1
  248. package/esm/policies/RequiredScripts.js +24 -24
  249. package/esm/policies/RequiredScripts.js.map +1 -1
  250. package/esm/policies/RustDocExists.d.ts +4 -4
  251. package/esm/policies/RustDocExists.d.ts.map +1 -1
  252. package/esm/policies/RustDocExists.js +6 -6
  253. package/esm/policies/RustDocExists.js.map +1 -1
  254. package/esm/policies/RustToolchainExists.d.ts +11 -4
  255. package/esm/policies/RustToolchainExists.d.ts.map +1 -1
  256. package/esm/policies/RustToolchainExists.js +10 -9
  257. package/esm/policies/RustToolchainExists.js.map +1 -1
  258. package/esm/policies/RustfmtConfigExists.d.ts +11 -4
  259. package/esm/policies/RustfmtConfigExists.d.ts.map +1 -1
  260. package/esm/policies/RustfmtConfigExists.js +10 -9
  261. package/esm/policies/RustfmtConfigExists.js.map +1 -1
  262. package/esm/policies/ScriptContains.d.ts +9 -7
  263. package/esm/policies/ScriptContains.d.ts.map +1 -1
  264. package/esm/policies/ScriptContains.js +9 -13
  265. package/esm/policies/ScriptContains.js.map +1 -1
  266. package/esm/policies/SharedDependencyVersions.d.ts +9 -4
  267. package/esm/policies/SharedDependencyVersions.d.ts.map +1 -1
  268. package/esm/policies/SharedDependencyVersions.js +28 -20
  269. package/esm/policies/SharedDependencyVersions.js.map +1 -1
  270. package/esm/policies/WorkspaceInheritance.d.ts +11 -4
  271. package/esm/policies/WorkspaceInheritance.d.ts.map +1 -1
  272. package/esm/policies/WorkspaceInheritance.js +10 -11
  273. package/esm/policies/WorkspaceInheritance.js.map +1 -1
  274. package/esm/policies/WorkspaceMembersValid.d.ts +11 -4
  275. package/esm/policies/WorkspaceMembersValid.d.ts.map +1 -1
  276. package/esm/policies/WorkspaceMembersValid.js +10 -11
  277. package/esm/policies/WorkspaceMembersValid.js.map +1 -1
  278. package/esm/policies/constants.d.ts.map +1 -1
  279. package/esm/policies/constants.js +1 -1
  280. package/esm/policies/constants.js.map +1 -1
  281. package/esm/policies.d.ts +13 -5
  282. package/esm/policies.d.ts.map +1 -1
  283. package/esm/policies.js +12 -5
  284. package/esm/policies.js.map +1 -1
  285. package/esm/policy.d.ts +61 -289
  286. package/esm/policy.d.ts.map +1 -1
  287. package/esm/policy.js +1 -122
  288. package/esm/policy.js.map +1 -1
  289. package/esm/policyDefiners/defineCargoPolicy.d.ts +25 -9
  290. package/esm/policyDefiners/defineCargoPolicy.d.ts.map +1 -1
  291. package/esm/policyDefiners/defineCargoPolicy.js +10 -28
  292. package/esm/policyDefiners/defineCargoPolicy.js.map +1 -1
  293. package/esm/policyDefiners/defineFileHeaderPolicy.d.ts +27 -14
  294. package/esm/policyDefiners/defineFileHeaderPolicy.d.ts.map +1 -1
  295. package/esm/policyDefiners/defineFileHeaderPolicy.js +16 -35
  296. package/esm/policyDefiners/defineFileHeaderPolicy.js.map +1 -1
  297. package/esm/policyDefiners/defineGleamPolicy.d.ts +25 -9
  298. package/esm/policyDefiners/defineGleamPolicy.d.ts.map +1 -1
  299. package/esm/policyDefiners/defineGleamPolicy.js +10 -27
  300. package/esm/policyDefiners/defineGleamPolicy.js.map +1 -1
  301. package/esm/policyDefiners/definePackagePolicy.d.ts +24 -13
  302. package/esm/policyDefiners/definePackagePolicy.d.ts.map +1 -1
  303. package/esm/policyDefiners/definePackagePolicy.js +9 -32
  304. package/esm/policyDefiners/definePackagePolicy.js.map +1 -1
  305. package/esm/policyDefiners/spdxValidator.d.ts +4 -12
  306. package/esm/policyDefiners/spdxValidator.d.ts.map +1 -1
  307. package/esm/policyDefiners/spdxValidator.js +26 -14
  308. package/esm/policyDefiners/spdxValidator.js.map +1 -1
  309. package/esm/policyExecution.d.ts +19 -0
  310. package/esm/policyExecution.d.ts.map +1 -0
  311. package/esm/policyExecution.js +224 -0
  312. package/esm/policyExecution.js.map +1 -0
  313. package/esm/repositoryFiles.d.ts +4 -0
  314. package/esm/repositoryFiles.d.ts.map +1 -0
  315. package/esm/repositoryFiles.js +8 -0
  316. package/esm/repositoryFiles.js.map +1 -0
  317. package/esm/runner.d.ts +72 -47
  318. package/esm/runner.d.ts.map +1 -1
  319. package/esm/runner.js +153 -138
  320. package/esm/runner.js.map +1 -1
  321. package/esm/settlePolicyPromise.d.ts +4 -0
  322. package/esm/settlePolicyPromise.d.ts.map +1 -0
  323. package/esm/settlePolicyPromise.js +10 -0
  324. package/esm/settlePolicyPromise.js.map +1 -0
  325. package/esm/tsdoc-metadata.json +1 -1
  326. package/esm/utils/safePaths.d.ts +9 -0
  327. package/esm/utils/safePaths.d.ts.map +1 -0
  328. package/esm/utils/safePaths.js +40 -0
  329. package/esm/utils/safePaths.js.map +1 -0
  330. package/oclif.manifest.json +19 -2
  331. package/package.json +42 -27
  332. package/scripts/benchmark.mjs +341 -0
  333. package/sidecar/sidecar.mjs +348 -417
package/CHANGELOG.md CHANGED
@@ -1,5 +1,58 @@
1
1
  # repopo
2
2
 
3
+ ## 0.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Introduce a shared API for file and repository policies, with consistent check results and fix status reporting. _[`#811`](https://github.com/tylerbutler/tools-monorepo/pull/811) [`d76e9e7`](https://github.com/tylerbutler/tools-monorepo/commit/d76e9e72c8d75863a97517ca662001aa567207da) [@tylerbutler](https://github.com/tylerbutler)_
8
+
9
+
10
+ **Breaking change:** Update custom policies and configurations together.
11
+ This change is released as a minor version while the packages are pre-1.0.
12
+ See the [migration guide](https://repopo.tylerbutler.com/usage/migration/) for replacements for removed APIs and complete examples.
13
+
14
+ Key migration steps for `repopo`:
15
+
16
+ - Define policies as objects with `satisfies FilePolicyDefinition<C>` or `satisfies RepositoryPolicyDefinition<C>` instead of policy classes or factory aliases. Use `definePackagePolicy` instead of `generatePackagePolicy`.
17
+ - Configure policies with `makePolicy(definition, { config, exclude, instanceId })` instead of positional configuration or a third argument. Instance exclusions use `exclude`; global `RepopoConfig.excludeFiles` remains supported. Repeated instances of the same policy need unique `instanceId` values.
18
+ - Mark required configuration with `requiresConfig: true` and supply complete settings or a complete default. Omitted or `undefined` configuration selects the default; explicit configuration replaces it without merging.
19
+ - Return arrays of findings instead of the previous success and failure results. An empty handler result passes. Findings use `message`, optional `manualFix`, and optional `fixStatus: "available" | "fixed" | "failed"`. Only `"fixed"` resolves a finding; `"fixed"` and `"failed"` are valid only in fix mode. Standalone resolvers must return the findings they update; returning `[]` does not resolve the original findings.
20
+ - Run policies with `runPolicies(options)` for Promise-based code or `new PolicyRunner(options).run()` for Effection code. Results separate `findings`, `errors`, `skipped`, and `perfStats`. Input and registration errors throw; policy execution errors are collected.
21
+ - Supply the full repository `inventory` or an async inventory loader when running repository policies programmatically. Use a loader to refresh the inventory after file fixes and between repository fixes. `LicenseFileExists` and `SharedDependencyVersions` now check the whole repository, even with an empty file selection or `--stdin`. Repository fixes can modify files outside the selected list.
22
+
23
+ In fix mode, an execution error stops later work on the affected file and skips repository policies, or stops later repository policies if the error occurs in that phase.
24
+ Completed writes are not rolled back.
25
+ Both `check` and `check-native` follow these rules.
26
+
27
+ Import the programmatic API from `repopo/api` and built-in policies from `repopo/policies`.
28
+ The root `repopo` entry point also exports the CLI's `run` function.
29
+
30
+ For `sort-tsconfig`, the exported `SortTsconfigsPolicy` is now a file policy definition.
31
+ Configure it with the same `makePolicy` options object.
32
+ If you call its handler directly, update your code to handle finding arrays and fix statuses.
33
+
34
+ For `remark-repopo-policies`, generated policy tables now read instance exclusions from `exclude`, so exclusion details remain visible after migration.
35
+
36
+ ### Patch Changes
37
+
38
+ - Speed up read-only checks by processing up to eight files at a time and avoiding repeated parsing of `package.json`, `Cargo.toml`, and `gleam.toml` files. _[`#807`](https://github.com/tylerbutler/tools-monorepo/pull/807) [`5e6c97b`](https://github.com/tylerbutler/tools-monorepo/commit/5e6c97b9afa99c93b1728ee0e48b45fa0a130501) [@tylerbutler](https://github.com/tylerbutler)_
39
+
40
+ Each policy still receives an independent copy of the parsed data.
41
+
42
+ Set the file limit with `--concurrency` on `repopo check` or `repopo check-native`, or with `PolicyRunnerOptions.concurrency` in the programmatic API.
43
+ Use `--concurrency 1` for custom policies that must process files one at a time.
44
+ Automatic fixes still run one at a time and read fresh file contents.
45
+ - Correct the reported file counts so each file that passes global exclusions is counted once, regardless of how many policies run on it. _[`#779`](https://github.com/tylerbutler/tools-monorepo/pull/779) [`ca340db`](https://github.com/tylerbutler/tools-monorepo/commit/ca340dbefce4e967ecf73a043207ec13b0651213) [@tylerbutler](https://github.com/tylerbutler)_
46
+
47
+ Ignore empty entries in file lists from Git and `--stdin`, so blank records do not become file paths.
48
+ - Show a policy's manual fix instructions when `repopo check` or `repopo check-native` reports an unresolved violation, including after a failed automatic fix. _[`#803`](https://github.com/tylerbutler/tools-monorepo/pull/803) [`c401c9c`](https://github.com/tylerbutler/tools-monorepo/commit/c401c9c7ab783222afac4df6de0b421dbe215093) [@tylerbutler](https://github.com/tylerbutler)_
49
+
50
+ If the automatic fixer does not provide instructions, keep the policy's original guidance.
51
+ Do not show manual fix instructions for violations that were successfully fixed.
52
+ - Reject file paths that resolve outside the repository root in `repopo check`, including paths supplied with `--stdin`. _[`#665`](https://github.com/tylerbutler/tools-monorepo/pull/665) [`1333d28`](https://github.com/tylerbutler/tools-monorepo/commit/1333d287abdee51a01a22540914600877fe8f557) [@tylerbutler](https://github.com/tylerbutler)_
53
+
54
+ Apply the same validation to package and file-header policy helpers, so these checks and fixes reject paths such as `../outside.txt`.
55
+
3
56
  ## 0.12.0
4
57
 
5
58
  ### Minor Changes
package/README.md CHANGED
@@ -3,104 +3,55 @@
3
3
  repopo is a tool to apply policies to the files in your git repo. You can think of it as a sort of lint tool for any
4
4
  file in your git repo, with a straightforward way to write your own policies.
5
5
 
6
+ **Documentation: <https://repopo.tylerbutler.com>**
7
+
6
8
  <!-- toc -->
7
9
  * [repopo - police the files in your git repo with extensible policies](#repopo---police-the-files-in-your-git-repo-with-extensible-policies)
8
- * [Configuring policies](#configuring-policies)
9
- * [Included policies](#included-policies)
10
- * [Policy generators](#policy-generators)
10
+ * [Quick start](#quick-start)
11
+ * [Documentation](#documentation)
11
12
  * [CLI Usage](#cli-usage)
12
13
  <!-- tocstop -->
13
14
 
14
- # Configuring policies
15
-
16
- Repopo and its policies can be configured in a `repopo.config.ts` (or `.cjs`, or `.mjs`) file in the root of the repo. Using a
17
- TypeScript configuration file is recommended.
18
-
19
- The policy config must export a default object of the type `PolicyConfig`.
20
-
21
- Omit `policies` to use the default policies with either `check` or `check-native`.
22
- Set `policies: []` to disable them.
23
-
24
- With `check --fix`, policies run in configuration order for each file so that one
25
- fix does not overwrite another. Read-only checks can run policies concurrently.
26
-
27
- ## Excluding files from policy check
28
-
29
- By default, all files in the repo are checked. You can exclude files completely from the policy check by configuring the
30
- d `excludeFiles` setting. It should be an array of strings/regular expressions. Paths that match any of these
31
- expressions will be completely excluded from all policies.
32
-
33
- You can exclude files from individual policies as well by configuring the `excludeFiles` setting when calling
34
- `makePolicy`.
35
-
36
- ## Configuring individual policies
37
-
38
- Individual policies can be configured by passing configuration settings to a `PolicyDefinition` in `makePolicy`.
39
-
40
- # Included policies
41
-
42
- repopo includes the following policies. All of the included policies are enabled by default.
43
-
44
- ## HtmlFileHeaders and JsTsFileHeaders
15
+ # Quick start
45
16
 
46
- Use `HtmlFileHeaders` for `.html` and `.htm` files, and `JsTsFileHeaders` for
47
- JavaScript and TypeScript files.
17
+ Install repopo as a dev dependency:
48
18
 
49
- ### Configuration
50
-
51
- Pass `{ headerText: "Copyright Example" }` to `policy()` for either policy.
52
- Checks compare the file header with that configured text; `--fix` adds a missing header.
53
-
54
- ## NoJsFileExtensions
55
-
56
- The NoJsFileExtensions policy checks for JavaScript source files that just use the .js file extension. Such files may be
57
- interpreted by Node.js as either CommonJS or ESM based on the `type` field in the nearest package.json file. This can
58
- create unexpected behavior for JS files; changing the package.json nearest to one will change how the JS is processed by
59
- node. Using explicit file extensions reduces ambiguity and ensures a CJS file isn't suddenly treated like an ESM file.
60
-
61
- ## PackageJsonProperties
62
-
63
- The PackageJsonProperties policy is used to enforce fields in package.json files across the repo.
64
-
65
- ### Configuration
19
+ ```bash
20
+ pnpm add -D repopo
21
+ ```
66
22
 
67
- The `verbatim` setting requires that all the configured fields in package.json match the values in the configuration.
68
- Array values replace existing arrays rather than append to them. Unspecified object fields remain unchanged.
23
+ Create `repopo.config.ts` in the root of the repo:
69
24
 
70
25
  ```ts
71
- import type { PolicyConfig } from "@tylerbu/repopo";
72
- const config: PolicyConfig = {
73
- policySettings: {
74
- PackageJsonProperties: {
75
- // This setting will force all package.json files to contain these fields with the exact configured values.
76
- verbatim: {
77
- license: "MIT",
78
- author: "Tyler Butler <tyler@tylerbutler.com>",
79
- bugs: "https://github.com/tylerbutler/tools-monorepo/issues",
80
- repository: {
81
- type: "git",
82
- url: "git+https://github.com/tylerbutler/tools-monorepo.git",
83
- }
84
- }
85
- }
86
- }
87
- };
26
+ import { makePolicy, type RepopoConfig } from "repopo";
27
+ import { NoJsFileExtensions, PackageJsonProperties } from "repopo/policies";
28
+
29
+ export default {
30
+ policies: [
31
+ makePolicy(NoJsFileExtensions, { exclude: ["^bin/"] }),
32
+ makePolicy(PackageJsonProperties, {
33
+ config: { verbatim: { license: "MIT" } },
34
+ }),
35
+ ],
36
+ } satisfies RepopoConfig;
88
37
  ```
89
38
 
90
- ## PackageJsonRepoDirectoryProperty
39
+ Then check the repo, and fix what can be fixed automatically:
91
40
 
92
- A RepoPolicy that checks that the `repository.directory` property in package.json is set correctly. If the repository
93
- field is a string instead of an object the package will be ignored.
94
-
95
- # Policy generators
96
-
97
- There are some filetypes that often have policies applied to them, like package.json. You can use the policy generator
98
- functions to generate policies for those filetypes. Using the generators is not required; they simply reduce the amount
99
- of boilerplate code you have to write for a policy.
41
+ ```bash
42
+ repopo check
43
+ repopo check --fix
44
+ ```
100
45
 
101
- ## generatePackagePolicy
46
+ # Documentation
102
47
 
103
- Use `generatePackagePolicy` to generate policies for package.json files.
48
+ - [Configuration](https://repopo.tylerbutler.com/usage/config/): choosing policies, policy options, and file exclusions
49
+ - [Built-in policies](https://repopo.tylerbutler.com/policies/built-in/): every included policy and its options
50
+ - [Custom policies](https://repopo.tylerbutler.com/policies/custom/): writing file and repository policies
51
+ - [Programmatic API](https://repopo.tylerbutler.com/usage/programmatic-api/): running policies with `runPolicies` and `PolicyRunner`
52
+ - [Migrating to the 1.0 API](https://repopo.tylerbutler.com/usage/migration/): breaking changes to configuration, policy results, and runners
53
+ - [Benchmarking](https://repopo.tylerbutler.com/usage/benchmarking/): comparing the TypeScript and Rust engines
54
+ - [API reference](https://repopo.tylerbutler.com/api/readme/)
104
55
 
105
56
  # CLI Usage
106
57
 
@@ -115,15 +66,22 @@ Checks and applies policies to the files in the repository.
115
66
 
116
67
  ```
117
68
  USAGE
118
- $ repopo check [-v | --quiet] [-f] [--stdin]
69
+ $ repopo check [-v | --quiet] [--concurrency <value>] [-f] [--stdin]
119
70
 
120
71
  FLAGS
121
- -f, --fix Fix errors if possible.
122
- --stdin Read list of files from stdin.
72
+ -f, --fix Fix errors if possible.
73
+ --concurrency=<value> [default: 8] Maximum concurrent files in read-only checks. Fixes remain sequential.
74
+ --stdin Read list of files from stdin.
123
75
 
124
76
  LOGGING FLAGS
125
77
  -v, --verbose Enable verbose logging.
126
78
  --quiet Disable all logging.
79
+
80
+ DESCRIPTION
81
+ Checks and applies policies to the files in the repository.
82
+
83
+ File policies check selected files. Repository policies always run with the full repository file inventory, including
84
+ with --stdin. With --fix, repository policies can modify files outside the stdin selection.
127
85
  ```
128
86
 
129
87
  _See code: [src/commands/check.ts](https://github.com/tylerbutler/tools-monorepo/blob/main/packages/repopo/src/commands/check.ts)_
@@ -134,8 +92,8 @@ Checks and applies policies using the Rust engine.
134
92
 
135
93
  ```
136
94
  USAGE
137
- $ repopo check-native [-f] [--stdin] [-v] [-q] [-c <value>] [--sidecar-path <value>] [--binary-path <value>]
138
- [--runtime auto|node|bun]
95
+ $ repopo check-native [--concurrency <value>] [-f] [--stdin] [-v] [-q] [-c <value>] [--sidecar-path <value>]
96
+ [--binary-path <value>] [--runtime auto|node|bun]
139
97
 
140
98
  FLAGS
141
99
  -c, --config=<value> Path to the config file.
@@ -143,6 +101,7 @@ FLAGS
143
101
  -q, --quiet Suppress all output except errors.
144
102
  -v, --verbose Show verbose output including per-policy timing.
145
103
  --binary-path=<value> [env: REPOPO_CORE_PATH] Path to the repopo-core Rust binary.
104
+ --concurrency=<value> [default: 8] Maximum concurrent files in read-only checks. Fixes remain sequential.
146
105
  --runtime=<option> [env: REPOPO_RUNTIME] JS runtime for the sidecar process (auto, node, bun).
147
106
  <options: auto|node|bun>
148
107
  --sidecar-path=<value> [env: REPOPO_SIDECAR_PATH] Path to the Node.js sidecar script.
@@ -151,8 +110,9 @@ FLAGS
151
110
  DESCRIPTION
152
111
  Checks and applies policies using the Rust engine.
153
112
 
154
- Runs the Rust-based repopo-core engine with the Node.js sidecar. This provides the same policy checking as 'check' but
155
- with Rust-based file enumeration, regex matching, and orchestration for better performance.
113
+ Runs the Rust-based repopo-core engine with the Node.js sidecar. Rust handles file matching, scheduling and reporting;
114
+ the sidecar shares per-policy contracts with 'check'. Repository policies always run with the full repository
115
+ inventory, including with --stdin. With --fix, repository policies can modify files outside the stdin selection.
156
116
  ```
157
117
 
158
118
  _See code: [src/commands/check-native.ts](https://github.com/tylerbutler/tools-monorepo/blob/main/packages/repopo/src/commands/check-native.ts)_
@@ -27,7 +27,7 @@ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHE
27
27
 
28
28
  The following npm package may be included in this product:
29
29
 
30
- - @rushstack/node-core-library@5.23.1
30
+ - @rushstack/node-core-library@5.25.1
31
31
 
32
32
  This package contains the following license:
33
33
 
@@ -90,7 +90,7 @@ Copyright (c) 2024-present Cedric van Putten <me@cedric.dev>
90
90
 
91
91
  The following npm package may be included in this product:
92
92
 
93
- - @fluid-tools/build-infrastructure@0.65.0
93
+ - @fluid-tools/build-infrastructure@0.68.0
94
94
 
95
95
  This package contains the following license:
96
96
 
@@ -118,6 +118,136 @@ SOFTWARE.
118
118
 
119
119
  -----------
120
120
 
121
+ The following npm package may be included in this product:
122
+
123
+ - type-fest@5.10.0
124
+
125
+ This package contains the following license:
126
+
127
+ Creative Commons Legal Code
128
+
129
+ CC0 1.0 Universal
130
+
131
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
132
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
133
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
134
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
135
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
136
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
137
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
138
+ HEREUNDER.
139
+
140
+ Statement of Purpose
141
+
142
+ The laws of most jurisdictions throughout the world automatically confer
143
+ exclusive Copyright and Related Rights (defined below) upon the creator
144
+ and subsequent owner(s) (each and all, an "owner") of an original work of
145
+ authorship and/or a database (each, a "Work").
146
+
147
+ Certain owners wish to permanently relinquish those rights to a Work for
148
+ the purpose of contributing to a commons of creative, cultural and
149
+ scientific works ("Commons") that the public can reliably and without fear
150
+ of later claims of infringement build upon, modify, incorporate in other
151
+ works, reuse and redistribute as freely as possible in any form whatsoever
152
+ and for any purposes, including without limitation commercial purposes.
153
+ These owners may contribute to the Commons to promote the ideal of a free
154
+ culture and the further production of creative, cultural and scientific
155
+ works, or to gain reputation or greater distribution for their Work in
156
+ part through the use and efforts of others.
157
+
158
+ For these and/or other purposes and motivations, and without any
159
+ expectation of additional consideration or compensation, the person
160
+ associating CC0 with a Work (the "Affirmer"), to the extent that he or she
161
+ is an owner of Copyright and Related Rights in the Work, voluntarily
162
+ elects to apply CC0 to the Work and publicly distribute the Work under its
163
+ terms, with knowledge of his or her Copyright and Related Rights in the
164
+ Work and the meaning and intended legal effect of CC0 on those rights.
165
+
166
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
167
+ protected by copyright and related or neighboring rights ("Copyright and
168
+ Related Rights"). Copyright and Related Rights include, but are not
169
+ limited to, the following:
170
+
171
+ i. the right to reproduce, adapt, distribute, perform, display,
172
+ communicate, and translate a Work;
173
+ ii. moral rights retained by the original author(s) and/or performer(s);
174
+ iii. publicity and privacy rights pertaining to a person's image or
175
+ likeness depicted in a Work;
176
+ iv. rights protecting against unfair competition in regards to a Work,
177
+ subject to the limitations in paragraph 4(a), below;
178
+ v. rights protecting the extraction, dissemination, use and reuse of data
179
+ in a Work;
180
+ vi. database rights (such as those arising under Directive 96/9/EC of the
181
+ European Parliament and of the Council of 11 March 1996 on the legal
182
+ protection of databases, and under any national implementation
183
+ thereof, including any amended or successor version of such
184
+ directive); and
185
+ vii. other similar, equivalent or corresponding rights throughout the
186
+ world based on applicable law or treaty, and any national
187
+ implementations thereof.
188
+
189
+ 2. Waiver. To the greatest extent permitted by, but not in contravention
190
+ of, applicable law, Affirmer hereby overtly, fully, permanently,
191
+ irrevocably and unconditionally waives, abandons, and surrenders all of
192
+ Affirmer's Copyright and Related Rights and associated claims and causes
193
+ of action, whether now known or unknown (including existing as well as
194
+ future claims and causes of action), in the Work (i) in all territories
195
+ worldwide, (ii) for the maximum duration provided by applicable law or
196
+ treaty (including future time extensions), (iii) in any current or future
197
+ medium and for any number of copies, and (iv) for any purpose whatsoever,
198
+ including without limitation commercial, advertising or promotional
199
+ purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
200
+ member of the public at large and to the detriment of Affirmer's heirs and
201
+ successors, fully intending that such Waiver shall not be subject to
202
+ revocation, rescission, cancellation, termination, or any other legal or
203
+ equitable action to disrupt the quiet enjoyment of the Work by the public
204
+ as contemplated by Affirmer's express Statement of Purpose.
205
+
206
+ 3. Public License Fallback. Should any part of the Waiver for any reason
207
+ be judged legally invalid or ineffective under applicable law, then the
208
+ Waiver shall be preserved to the maximum extent permitted taking into
209
+ account Affirmer's express Statement of Purpose. In addition, to the
210
+ extent the Waiver is so judged Affirmer hereby grants to each affected
211
+ person a royalty-free, non transferable, non sublicensable, non exclusive,
212
+ irrevocable and unconditional license to exercise Affirmer's Copyright and
213
+ Related Rights in the Work (i) in all territories worldwide, (ii) for the
214
+ maximum duration provided by applicable law or treaty (including future
215
+ time extensions), (iii) in any current or future medium and for any number
216
+ of copies, and (iv) for any purpose whatsoever, including without
217
+ limitation commercial, advertising or promotional purposes (the
218
+ "License"). The License shall be deemed effective as of the date CC0 was
219
+ applied by Affirmer to the Work. Should any part of the License for any
220
+ reason be judged legally invalid or ineffective under applicable law, such
221
+ partial invalidity or ineffectiveness shall not invalidate the remainder
222
+ of the License, and in such case Affirmer hereby affirms that he or she
223
+ will not (i) exercise any of his or her remaining Copyright and Related
224
+ Rights in the Work or (ii) assert any associated claims and causes of
225
+ action with respect to the Work, in either case contrary to Affirmer's
226
+ express Statement of Purpose.
227
+
228
+ 4. Limitations and Disclaimers.
229
+
230
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
231
+ surrendered, licensed or otherwise affected by this document.
232
+ b. Affirmer offers the Work as-is and makes no representations or
233
+ warranties of any kind concerning the Work, express, implied,
234
+ statutory or otherwise, including without limitation warranties of
235
+ title, merchantability, fitness for a particular purpose, non
236
+ infringement, or the absence of latent or other defects, accuracy, or
237
+ the present or absence of errors, whether or not discoverable, all to
238
+ the greatest extent permissible under applicable law.
239
+ c. Affirmer disclaims responsibility for clearing rights of other persons
240
+ that may apply to the Work or any use thereof, including without
241
+ limitation any person's Copyright and Related Rights in the Work.
242
+ Further, Affirmer disclaims responsibility for obtaining any necessary
243
+ consents, permissions or other rights required for any use of the
244
+ Work.
245
+ d. Affirmer understands and acknowledges that Creative Commons is not a
246
+ party to this document and has no duty or obligation with respect to
247
+ this CC0 or use of the Work.
248
+
249
+ -----------
250
+
121
251
  The following npm package may be included in this product:
122
252
 
123
253
  - picocolors@1.1.1
@@ -142,12 +272,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
142
272
 
143
273
  -----------
144
274
 
145
- The following npm packages may be included in this product:
275
+ The following npm package may be included in this product:
146
276
 
147
- - effection@4.0.3
148
- - simple-git@3.36.0
277
+ - effection@4.2.0
149
278
 
150
- These packages each contain the following license:
279
+ This package contains the following license:
151
280
 
152
281
  MIT
153
282
 
@@ -155,8 +284,8 @@ MIT
155
284
 
156
285
  The following npm packages may be included in this product:
157
286
 
158
- - @oclif/core@4.11.14
159
- - @oclif/plugin-help@6.2.53
287
+ - @oclif/core@5.1.9
288
+ - @oclif/plugin-help@7.0.5
160
289
 
161
290
  These packages each contain the following license:
162
291
 
@@ -186,7 +315,7 @@ SOFTWARE.
186
315
 
187
316
  The following npm package may be included in this product:
188
317
 
189
- - microdiff@1.5.0
318
+ - microdiff@1.6.0
190
319
 
191
320
  This package contains the following license:
192
321
 
@@ -216,7 +345,7 @@ SOFTWARE.
216
345
 
217
346
  The following npm package may be included in this product:
218
347
 
219
- - lilconfig@3.1.3
348
+ - lilconfig@3.1.4
220
349
 
221
350
  This package contains the following license:
222
351
 
@@ -471,7 +600,7 @@ SOFTWARE.
471
600
 
472
601
  The following npm package may be included in this product:
473
602
 
474
- - picomatch@4.0.5
603
+ - picomatch@4.0.7
475
604
 
476
605
  This package contains the following license:
477
606
 
@@ -499,5 +628,34 @@ THE SOFTWARE.
499
628
 
500
629
  -----------
501
630
 
631
+ The following npm package may be included in this product:
632
+
633
+ - simple-git@4.0.2
634
+
635
+ This package contains the following license:
636
+
637
+ The MIT License (MIT)
638
+
639
+ Copyright (c) 2025 Steve King
640
+
641
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
642
+ this software and associated documentation files (the "Software"), to deal in
643
+ the Software without restriction, including without limitation the rights to
644
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
645
+ the Software, and to permit persons to whom the Software is furnished to do so,
646
+ subject to the following conditions:
647
+
648
+ The above copyright notice and this permission notice shall be included in all
649
+ copies or substantial portions of the Software.
650
+
651
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
652
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
653
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
654
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
655
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
656
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
657
+
658
+ -----------
659
+
502
660
  This file was generated with the generate-license-file npm package!
503
661
  https://www.npmjs.com/package/generate-license-file
package/bin/dev.js CHANGED
File without changes
@@ -1,10 +1,10 @@
1
- import type { PolicyDefinition } from "../policy.js";
1
+ import type { FilePolicyDefinition } from "../policy.js";
2
2
  /**
3
3
  * A FluidFramework build-tools policy handler interface.
4
4
  *
5
5
  * This interface matches the `Handler` interface from `@fluidframework/build-tools`.
6
6
  *
7
- * @alpha
7
+ * @public
8
8
  */
9
9
  export interface FluidHandler {
10
10
  /**
@@ -31,17 +31,21 @@ export interface FluidHandler {
31
31
  * @returns An object indicating whether the fix was successful.
32
32
  */
33
33
  resolver?: (file: string, root: string) => Promise<{
34
+ /** Whether the violation was fixed. */
34
35
  resolved: boolean;
36
+ /** Optional explanation of the fix result. */
35
37
  message?: string;
36
38
  }> | {
39
+ /** Whether the violation was fixed. */
37
40
  resolved: boolean;
41
+ /** Optional explanation of the fix result. */
38
42
  message?: string;
39
43
  };
40
44
  }
41
45
  /**
42
46
  * Options for converting FluidFramework handlers to repopo policies.
43
47
  *
44
- * @alpha
48
+ * @public
45
49
  */
46
50
  export interface FluidAdapterOptions {
47
51
  /**
@@ -62,19 +66,19 @@ export interface FluidAdapterOptions {
62
66
  * Key differences handled by this adapter:
63
67
  *
64
68
  * - **Handler signature**: Fluid uses `(file, root) => string | undefined`,
65
- * repopo uses `(args) => PolicyHandlerResult`
69
+ * repopo uses `(args) => Promise<PolicyResult> | Operation<PolicyResult>`
66
70
  *
67
71
  * - **File paths**: Fluid passes absolute paths, repopo passes repo-relative paths.
68
72
  * The adapter converts between the two.
69
73
  *
70
74
  * - **Return types**: Fluid returns `string | undefined` (error message or success),
71
- * repopo returns `true | PolicyFailure | PolicyFixResult`
75
+ * repopo returns `readonly PolicyFinding[]`
72
76
  *
73
77
  * For a single handler, wrap it in an array: `fromFluidHandlers([handler])`.
74
78
  *
75
79
  * @example
76
80
  * ```typescript
77
- * import { fromFluidHandlers, makePolicy } from "repopo";
81
+ * import { fromFluidHandlers, makePolicy, type RepopoConfig } from "repopo";
78
82
  * import { copyrightFileHeaderHandlers, fluidCaseHandler } from "@fluidframework/build-tools";
79
83
  *
80
84
  * // Convert multiple handlers with a namespace prefix
@@ -87,7 +91,7 @@ export interface FluidAdapterOptions {
87
91
  *
88
92
  * const config: RepopoConfig = {
89
93
  * policies: [
90
- * ...FluidCopyrightPolicies.map(p => makePolicy(p)),
94
+ * ...FluidCopyrightPolicies.map((p) => makePolicy(p)),
91
95
  * makePolicy(FluidCasePolicy),
92
96
  * ],
93
97
  * };
@@ -97,7 +101,7 @@ export interface FluidAdapterOptions {
97
101
  * @param options - Optional configuration applied to all conversions.
98
102
  * @returns An array of repopo PolicyDefinitions.
99
103
  *
100
- * @alpha
104
+ * @public
101
105
  */
102
- export declare function fromFluidHandlers(fluidHandlers: FluidHandler[], options?: FluidAdapterOptions): PolicyDefinition[];
106
+ export declare function fromFluidHandlers(fluidHandlers: FluidHandler[], options?: FluidAdapterOptions): FilePolicyDefinition[];
103
107
  //# sourceMappingURL=fluidFramework.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fluidFramework.d.ts","sourceRoot":"","sources":["../../src/adapters/fluidFramework.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,gBAAgB,EAIhB,MAAM,cAAc,CAAC;AAEtB;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAErE;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,CACV,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,KAEV,OAAO,CAAC;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAChD;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAwFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,iBAAiB,CAChC,aAAa,EAAE,YAAY,EAAE,EAC7B,OAAO,CAAC,EAAE,mBAAmB,GAC3B,gBAAgB,EAAE,CAEpB"}
1
+ {"version":3,"file":"fluidFramework.d.ts","sourceRoot":"","sources":["../../src/adapters/fluidFramework.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAiB,MAAM,cAAc,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAErE;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,CACV,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,KAEV,OAAO,CAAC;QACR,uCAAuC;QACvC,QAAQ,EAAE,OAAO,CAAC;QAClB,8CAA8C;QAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC,GACF;QACA,uCAAuC;QACvC,QAAQ,EAAE,OAAO,CAAC;QAClB,8CAA8C;QAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACL;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AA8DD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,iBAAiB,CAChC,aAAa,EAAE,YAAY,EAAE,EAC7B,OAAO,CAAC,EAAE,mBAAmB,GAC3B,oBAAoB,EAAE,CAExB"}