repopo 0.9.0 → 0.12.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 (271) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/README.md +41 -2
  3. package/THIRD-PARTY-LICENSES.txt +71 -11
  4. package/bin/dev.js +5 -1
  5. package/esm/baseCommand.d.ts +1 -1
  6. package/esm/baseCommand.d.ts.map +1 -1
  7. package/esm/baseCommand.js +6 -9
  8. package/esm/baseCommand.js.map +1 -1
  9. package/esm/commands/check-native.d.ts +25 -0
  10. package/esm/commands/check-native.d.ts.map +1 -0
  11. package/esm/commands/check-native.js +137 -0
  12. package/esm/commands/check-native.js.map +1 -0
  13. package/esm/commands/check.d.ts +8 -19
  14. package/esm/commands/check.d.ts.map +1 -1
  15. package/esm/commands/check.js +97 -169
  16. package/esm/commands/check.js.map +1 -1
  17. package/esm/commands/list.d.ts.map +1 -1
  18. package/esm/commands/list.js +5 -6
  19. package/esm/commands/list.js.map +1 -1
  20. package/esm/config.d.ts +19 -4
  21. package/esm/config.d.ts.map +1 -1
  22. package/esm/config.js +2 -3
  23. package/esm/config.js.map +1 -1
  24. package/esm/context.d.ts +13 -3
  25. package/esm/context.d.ts.map +1 -1
  26. package/esm/context.js +11 -1
  27. package/esm/context.js.map +1 -1
  28. package/esm/index.d.ts +7 -2
  29. package/esm/index.d.ts.map +1 -1
  30. package/esm/index.js +9 -1
  31. package/esm/index.js.map +1 -1
  32. package/esm/makePolicy.d.ts +77 -8
  33. package/esm/makePolicy.d.ts.map +1 -1
  34. package/esm/makePolicy.js +108 -4
  35. package/esm/makePolicy.js.map +1 -1
  36. package/esm/perf.d.ts +7 -2
  37. package/esm/perf.d.ts.map +1 -1
  38. package/esm/perf.js.map +1 -1
  39. package/esm/policies/CargoLicenceValidated.d.ts +41 -0
  40. package/esm/policies/CargoLicenceValidated.d.ts.map +1 -0
  41. package/esm/policies/CargoLicenceValidated.js +45 -0
  42. package/esm/policies/CargoLicenceValidated.js.map +1 -0
  43. package/esm/policies/CargoLintsConfigured.d.ts +30 -0
  44. package/esm/policies/CargoLintsConfigured.d.ts.map +1 -0
  45. package/esm/policies/CargoLintsConfigured.js +61 -0
  46. package/esm/policies/CargoLintsConfigured.js.map +1 -0
  47. package/esm/policies/CargoLockPolicy.d.ts +34 -0
  48. package/esm/policies/CargoLockPolicy.d.ts.map +1 -0
  49. package/esm/policies/CargoLockPolicy.js +57 -0
  50. package/esm/policies/CargoLockPolicy.js.map +1 -0
  51. package/esm/policies/CargoTomlRequired.d.ts +34 -0
  52. package/esm/policies/CargoTomlRequired.d.ts.map +1 -0
  53. package/esm/policies/CargoTomlRequired.js +77 -0
  54. package/esm/policies/CargoTomlRequired.js.map +1 -0
  55. package/esm/policies/CargoTomlSorted.d.ts +20 -0
  56. package/esm/policies/CargoTomlSorted.d.ts.map +1 -0
  57. package/esm/policies/CargoTomlSorted.js +164 -0
  58. package/esm/policies/CargoTomlSorted.js.map +1 -0
  59. package/esm/policies/ConditionalScripts.d.ts +94 -0
  60. package/esm/policies/ConditionalScripts.d.ts.map +1 -0
  61. package/esm/policies/ConditionalScripts.js +145 -0
  62. package/esm/policies/ConditionalScripts.js.map +1 -0
  63. package/esm/policies/ExactScripts.d.ts +51 -0
  64. package/esm/policies/ExactScripts.d.ts.map +1 -0
  65. package/esm/policies/ExactScripts.js +108 -0
  66. package/esm/policies/ExactScripts.js.map +1 -0
  67. package/esm/policies/GleamDepVersions.d.ts +25 -0
  68. package/esm/policies/GleamDepVersions.d.ts.map +1 -0
  69. package/esm/policies/GleamDepVersions.js +67 -0
  70. package/esm/policies/GleamDepVersions.js.map +1 -0
  71. package/esm/policies/GleamDocExists.d.ts +24 -0
  72. package/esm/policies/GleamDocExists.d.ts.map +1 -0
  73. package/esm/policies/GleamDocExists.js +39 -0
  74. package/esm/policies/GleamDocExists.js.map +1 -0
  75. package/esm/policies/GleamInternalModulesConfigured.d.ts +21 -0
  76. package/esm/policies/GleamInternalModulesConfigured.d.ts.map +1 -0
  77. package/esm/policies/GleamInternalModulesConfigured.js +30 -0
  78. package/esm/policies/GleamInternalModulesConfigured.js.map +1 -0
  79. package/esm/policies/GleamLicenceConfigured.d.ts +29 -0
  80. package/esm/policies/GleamLicenceConfigured.d.ts.map +1 -0
  81. package/esm/policies/GleamLicenceConfigured.js +34 -0
  82. package/esm/policies/GleamLicenceConfigured.js.map +1 -0
  83. package/esm/policies/GleamManifestCommitted.d.ts +9 -0
  84. package/esm/policies/GleamManifestCommitted.d.ts.map +1 -0
  85. package/esm/policies/GleamManifestCommitted.js +26 -0
  86. package/esm/policies/GleamManifestCommitted.js.map +1 -0
  87. package/esm/policies/GleamMonorepoConsistency.d.ts +30 -0
  88. package/esm/policies/GleamMonorepoConsistency.d.ts.map +1 -0
  89. package/esm/policies/GleamMonorepoConsistency.js +74 -0
  90. package/esm/policies/GleamMonorepoConsistency.js.map +1 -0
  91. package/esm/policies/GleamNameRestrictions.d.ts +25 -0
  92. package/esm/policies/GleamNameRestrictions.d.ts.map +1 -0
  93. package/esm/policies/GleamNameRestrictions.js +44 -0
  94. package/esm/policies/GleamNameRestrictions.js.map +1 -0
  95. package/esm/policies/GleamNoPathDepsInPublished.d.ts +22 -0
  96. package/esm/policies/GleamNoPathDepsInPublished.d.ts.map +1 -0
  97. package/esm/policies/GleamNoPathDepsInPublished.js +43 -0
  98. package/esm/policies/GleamNoPathDepsInPublished.js.map +1 -0
  99. package/esm/policies/GleamPathDepsValid.d.ts +9 -0
  100. package/esm/policies/GleamPathDepsValid.d.ts.map +1 -0
  101. package/esm/policies/GleamPathDepsValid.js +59 -0
  102. package/esm/policies/GleamPathDepsValid.js.map +1 -0
  103. package/esm/policies/GleamProjectStructure.d.ts +25 -0
  104. package/esm/policies/GleamProjectStructure.d.ts.map +1 -0
  105. package/esm/policies/GleamProjectStructure.js +33 -0
  106. package/esm/policies/GleamProjectStructure.js.map +1 -0
  107. package/esm/policies/GleamSharedDependencyVersions.d.ts +29 -0
  108. package/esm/policies/GleamSharedDependencyVersions.d.ts.map +1 -0
  109. package/esm/policies/GleamSharedDependencyVersions.js +101 -0
  110. package/esm/policies/GleamSharedDependencyVersions.js.map +1 -0
  111. package/esm/policies/GleamTomlRequired.d.ts +30 -0
  112. package/esm/policies/GleamTomlRequired.d.ts.map +1 -0
  113. package/esm/policies/GleamTomlRequired.js +37 -0
  114. package/esm/policies/GleamTomlRequired.js.map +1 -0
  115. package/esm/policies/GleamTomlSorted.d.ts +20 -0
  116. package/esm/policies/GleamTomlSorted.d.ts.map +1 -0
  117. package/esm/policies/GleamTomlSorted.js +153 -0
  118. package/esm/policies/GleamTomlSorted.js.map +1 -0
  119. package/esm/policies/GleamVersionConstraint.d.ts +20 -0
  120. package/esm/policies/GleamVersionConstraint.d.ts.map +1 -0
  121. package/esm/policies/GleamVersionConstraint.js +64 -0
  122. package/esm/policies/GleamVersionConstraint.js.map +1 -0
  123. package/esm/policies/HtmlFileHeaders.d.ts +1 -1
  124. package/esm/policies/HtmlFileHeaders.d.ts.map +1 -1
  125. package/esm/policies/HtmlFileHeaders.js +1 -1
  126. package/esm/policies/HtmlFileHeaders.js.map +1 -1
  127. package/esm/policies/JsTsFileHeaders.d.ts +1 -1
  128. package/esm/policies/JsTsFileHeaders.d.ts.map +1 -1
  129. package/esm/policies/MutuallyExclusiveScripts.d.ts +46 -0
  130. package/esm/policies/MutuallyExclusiveScripts.d.ts.map +1 -0
  131. package/esm/policies/MutuallyExclusiveScripts.js +52 -0
  132. package/esm/policies/MutuallyExclusiveScripts.js.map +1 -0
  133. package/esm/policies/NoBuildDirectory.d.ts +9 -0
  134. package/esm/policies/NoBuildDirectory.d.ts.map +1 -0
  135. package/esm/policies/NoBuildDirectory.js +29 -0
  136. package/esm/policies/NoBuildDirectory.js.map +1 -0
  137. package/esm/policies/NoPrivateWorkspaceDependencies.d.ts +1 -1
  138. package/esm/policies/NoPrivateWorkspaceDependencies.d.ts.map +1 -1
  139. package/esm/policies/NoTargetArtifacts.d.ts +8 -0
  140. package/esm/policies/NoTargetArtifacts.d.ts.map +1 -0
  141. package/esm/policies/NoTargetArtifacts.js +42 -0
  142. package/esm/policies/NoTargetArtifacts.js.map +1 -0
  143. package/esm/policies/NoUnsafeWithoutJustification.d.ts +24 -0
  144. package/esm/policies/NoUnsafeWithoutJustification.d.ts.map +1 -0
  145. package/esm/policies/NoUnsafeWithoutJustification.js +80 -0
  146. package/esm/policies/NoUnsafeWithoutJustification.js.map +1 -0
  147. package/esm/policies/NoWildcardDependencies.d.ts +30 -0
  148. package/esm/policies/NoWildcardDependencies.d.ts.map +1 -0
  149. package/esm/policies/NoWildcardDependencies.js +83 -0
  150. package/esm/policies/NoWildcardDependencies.js.map +1 -0
  151. package/esm/policies/PackageAllowedScopes.d.ts +1 -1
  152. package/esm/policies/PackageAllowedScopes.d.ts.map +1 -1
  153. package/esm/policies/PackageEsmType.d.ts +1 -1
  154. package/esm/policies/PackageEsmType.d.ts.map +1 -1
  155. package/esm/policies/PackageEsmType.js +7 -5
  156. package/esm/policies/PackageEsmType.js.map +1 -1
  157. package/esm/policies/PackageFolderName.d.ts +1 -1
  158. package/esm/policies/PackageFolderName.d.ts.map +1 -1
  159. package/esm/policies/PackageJsonProperties.d.ts +1 -1
  160. package/esm/policies/PackageJsonProperties.d.ts.map +1 -1
  161. package/esm/policies/PackageJsonProperties.js +12 -4
  162. package/esm/policies/PackageJsonProperties.js.map +1 -1
  163. package/esm/policies/PackageJsonRepoDirectoryProperty.d.ts +1 -1
  164. package/esm/policies/PackageJsonRepoDirectoryProperty.d.ts.map +1 -1
  165. package/esm/policies/PackageJsonRepoDirectoryProperty.js +3 -2
  166. package/esm/policies/PackageJsonRepoDirectoryProperty.js.map +1 -1
  167. package/esm/policies/PackageJsonSorted.d.ts +1 -1
  168. package/esm/policies/PackageJsonSorted.d.ts.map +1 -1
  169. package/esm/policies/PackageJsonSorted.js +42 -7
  170. package/esm/policies/PackageJsonSorted.js.map +1 -1
  171. package/esm/policies/PackageLicense.d.ts +1 -1
  172. package/esm/policies/PackageLicense.d.ts.map +1 -1
  173. package/esm/policies/PackageLicense.js +1 -2
  174. package/esm/policies/PackageLicense.js.map +1 -1
  175. package/esm/policies/PackagePrivateField.d.ts +1 -1
  176. package/esm/policies/PackagePrivateField.d.ts.map +1 -1
  177. package/esm/policies/PackagePrivateField.js +3 -2
  178. package/esm/policies/PackagePrivateField.js.map +1 -1
  179. package/esm/policies/PackageReadme.d.ts +1 -1
  180. package/esm/policies/PackageReadme.d.ts.map +1 -1
  181. package/esm/policies/PackageReadme.js +2 -2
  182. package/esm/policies/PackageReadme.js.map +1 -1
  183. package/esm/policies/PackageScripts.d.ts +1 -1
  184. package/esm/policies/PackageScripts.d.ts.map +1 -1
  185. package/esm/policies/PackageScripts.js +3 -2
  186. package/esm/policies/PackageScripts.js.map +1 -1
  187. package/esm/policies/PackageTestScripts.d.ts +1 -1
  188. package/esm/policies/PackageTestScripts.d.ts.map +1 -1
  189. package/esm/policies/PackageTestScripts.js +3 -3
  190. package/esm/policies/PackageTestScripts.js.map +1 -1
  191. package/esm/policies/PublicApiDocumented.d.ts +21 -0
  192. package/esm/policies/PublicApiDocumented.d.ts.map +1 -0
  193. package/esm/policies/PublicApiDocumented.js +36 -0
  194. package/esm/policies/PublicApiDocumented.js.map +1 -0
  195. package/esm/policies/RequiredScripts.d.ts +71 -0
  196. package/esm/policies/RequiredScripts.d.ts.map +1 -0
  197. package/esm/policies/RequiredScripts.js +121 -0
  198. package/esm/policies/RequiredScripts.js.map +1 -0
  199. package/esm/policies/RustDocExists.d.ts +24 -0
  200. package/esm/policies/RustDocExists.d.ts.map +1 -0
  201. package/esm/policies/RustDocExists.js +49 -0
  202. package/esm/policies/RustDocExists.js.map +1 -0
  203. package/esm/policies/RustToolchainExists.d.ts +20 -0
  204. package/esm/policies/RustToolchainExists.d.ts.map +1 -0
  205. package/esm/policies/RustToolchainExists.js +27 -0
  206. package/esm/policies/RustToolchainExists.js.map +1 -0
  207. package/esm/policies/RustfmtConfigExists.d.ts +20 -0
  208. package/esm/policies/RustfmtConfigExists.d.ts.map +1 -0
  209. package/esm/policies/RustfmtConfigExists.js +27 -0
  210. package/esm/policies/RustfmtConfigExists.js.map +1 -0
  211. package/esm/policies/ScriptContains.d.ts +64 -0
  212. package/esm/policies/ScriptContains.d.ts.map +1 -0
  213. package/esm/policies/ScriptContains.js +62 -0
  214. package/esm/policies/ScriptContains.js.map +1 -0
  215. package/esm/policies/SharedDependencyVersions.d.ts +24 -0
  216. package/esm/policies/SharedDependencyVersions.d.ts.map +1 -0
  217. package/esm/policies/SharedDependencyVersions.js +135 -0
  218. package/esm/policies/SharedDependencyVersions.js.map +1 -0
  219. package/esm/policies/WorkspaceInheritance.d.ts +24 -0
  220. package/esm/policies/WorkspaceInheritance.d.ts.map +1 -0
  221. package/esm/policies/WorkspaceInheritance.js +94 -0
  222. package/esm/policies/WorkspaceInheritance.js.map +1 -0
  223. package/esm/policies/WorkspaceMembersValid.d.ts +20 -0
  224. package/esm/policies/WorkspaceMembersValid.d.ts.map +1 -0
  225. package/esm/policies/WorkspaceMembersValid.js +88 -0
  226. package/esm/policies/WorkspaceMembersValid.js.map +1 -0
  227. package/esm/policies/constants.d.ts +8 -0
  228. package/esm/policies/constants.d.ts.map +1 -1
  229. package/esm/policies/constants.js +8 -0
  230. package/esm/policies/constants.js.map +1 -1
  231. package/esm/policies.d.ts +36 -1
  232. package/esm/policies.d.ts.map +1 -1
  233. package/esm/policies.js +68 -0
  234. package/esm/policies.js.map +1 -1
  235. package/esm/policy.d.ts +202 -84
  236. package/esm/policy.d.ts.map +1 -1
  237. package/esm/policy.js +103 -21
  238. package/esm/policy.js.map +1 -1
  239. package/esm/policyDefiners/defineCargoPolicy.d.ts +66 -0
  240. package/esm/policyDefiners/defineCargoPolicy.d.ts.map +1 -0
  241. package/esm/policyDefiners/defineCargoPolicy.js +60 -0
  242. package/esm/policyDefiners/defineCargoPolicy.js.map +1 -0
  243. package/esm/policyDefiners/defineFileHeaderPolicy.d.ts +7 -2
  244. package/esm/policyDefiners/defineFileHeaderPolicy.d.ts.map +1 -1
  245. package/esm/policyDefiners/defineFileHeaderPolicy.js +11 -7
  246. package/esm/policyDefiners/defineFileHeaderPolicy.js.map +1 -1
  247. package/esm/policyDefiners/defineGleamPolicy.d.ts +65 -0
  248. package/esm/policyDefiners/defineGleamPolicy.d.ts.map +1 -0
  249. package/esm/policyDefiners/defineGleamPolicy.js +59 -0
  250. package/esm/policyDefiners/defineGleamPolicy.js.map +1 -0
  251. package/esm/policyDefiners/definePackagePolicy.d.ts +18 -5
  252. package/esm/policyDefiners/definePackagePolicy.d.ts.map +1 -1
  253. package/esm/policyDefiners/definePackagePolicy.js +14 -4
  254. package/esm/policyDefiners/definePackagePolicy.js.map +1 -1
  255. package/esm/policyDefiners/spdxValidator.d.ts +74 -0
  256. package/esm/policyDefiners/spdxValidator.d.ts.map +1 -0
  257. package/esm/policyDefiners/spdxValidator.js +127 -0
  258. package/esm/policyDefiners/spdxValidator.js.map +1 -0
  259. package/esm/policyDefiners/tomlParser.d.ts +8 -0
  260. package/esm/policyDefiners/tomlParser.d.ts.map +1 -0
  261. package/esm/policyDefiners/tomlParser.js +17 -0
  262. package/esm/policyDefiners/tomlParser.js.map +1 -0
  263. package/esm/runner.d.ts +60 -0
  264. package/esm/runner.d.ts.map +1 -0
  265. package/esm/runner.js +174 -0
  266. package/esm/runner.js.map +1 -0
  267. package/esm/tsdoc-metadata.json +1 -1
  268. package/oclif.manifest.json +100 -3
  269. package/package.json +46 -31
  270. package/scripts/postinstall.mjs +154 -0
  271. package/sidecar/sidecar.mjs +468 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkB,MAAM,WAAW,CAAC;AAEtD,OAAO,EACN,2BAA2B,GAE3B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,uBA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C,UAAU,EACjB,SAAS,EACT,KAAK,CAAC,SAAS,EACf,QAAQ,CAAC;YACR,MAAM,MAAM,GAAG,QAAQ,CAAC;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,MAAM,CAAC,MAAM;aACrB,CAAC,CAAC;YACH,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;gBAC/B,OAAO,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC;YAClC,CAAC;YACD,IAAI,WAAW,CAAkB,MAAM,CAAC,EAAE,CAAC;gBAC1C,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC;YACtB,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,oCAAoC,OAAO,MAAM,EAAE,CAAC,CAAC;QACtE,CAAC,CACD,CAAC;IACH,CAAC;CACD","sourcesContent":["import type { Logger } from \"@tylerbu/cli-api\";\nimport { all, call, type Operation } from \"effection\";\n\nimport {\n\tcreateExcludedPolicyFileMap,\n\ttype ExcludedPolicyFileMap,\n} from \"./context.js\";\nimport { identifyPolicyInstances } from \"./makePolicy.js\";\nimport {\n\tnewPerfStats,\n\ttype PolicyHandlerPerfStats,\n\trunWithPerf,\n} from \"./perf.js\";\nimport type {\n\tIdentifiedPolicy,\n\tPolicyFixResult,\n\tPolicyHandlerResult,\n\tPolicyInstance,\n\tPolicyInstanceId,\n\tPolicyName,\n\tPolicyStandaloneResolver,\n} from \"./policy.js\";\nimport { isPolicyError, isPolicyFixResult } from \"./policy.js\";\n\nfunction isOperation<T>(value: unknown): value is Operation<T> {\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\tvalue !== null &&\n\t\t\"next\" in value &&\n\t\ttypeof (value as { next: unknown }).next === \"function\"\n\t);\n}\n\nfunction matches(regex: RegExp, value: string): boolean {\n\tif (!(regex.global || regex.sticky)) {\n\t\treturn regex.test(value);\n\t}\n\n\tconst savedLastIndex = regex.lastIndex;\n\ttry {\n\t\tregex.lastIndex = 0;\n\t\treturn regex.test(value);\n\t} finally {\n\t\tregex.lastIndex = savedLastIndex;\n\t}\n}\n\n/**\n * Result of running a single policy on a single file.\n * @alpha\n */\nexport interface PolicyFileResult {\n\tfile: string;\n\tpolicy: PolicyName;\n\t/** Stable identity of the configured policy instance */\n\tpolicyId: PolicyInstanceId;\n\t/** The raw result from the policy handler */\n\toutcome: PolicyHandlerResult;\n\t/** Set when a standalone resolver was attempted (legacy resolver path) */\n\tresolution?: PolicyFixResult;\n}\n\n/**\n * Aggregated results from a full policy run.\n * @alpha\n */\nexport interface PolicyRunResults {\n\tresults: PolicyFileResult[];\n\tperfStats: PolicyHandlerPerfStats;\n}\n\ninterface PolicyRunState {\n\tresults: PolicyFileResult[];\n\tperfStats: PolicyHandlerPerfStats;\n}\n\n/**\n * Options for configuring a {@link PolicyRunner}.\n * @alpha\n */\nexport interface PolicyRunnerOptions {\n\tpolicies: PolicyInstance[];\n\texcludeFromAll: RegExp[];\n\texcludePoliciesForFiles: ExcludedPolicyFileMap;\n\tgitRoot: string;\n\tresolve: boolean;\n\tlogger?: Pick<Logger, \"verbose\">;\n}\n\n/**\n * Runs configured policies against files and collects results.\n * @alpha\n */\nexport class PolicyRunner {\n\tprivate readonly policies: IdentifiedPolicy[];\n\tprivate readonly excludeFromAll: RegExp[];\n\tprivate readonly excludePoliciesForFiles: ExcludedPolicyFileMap;\n\tprivate readonly gitRoot: string;\n\tprivate readonly resolve: boolean;\n\tprivate readonly logger: Pick<Logger, \"verbose\"> | undefined;\n\n\tpublic constructor(options: PolicyRunnerOptions) {\n\t\tthis.policies = identifyPolicyInstances(options.policies);\n\t\tthis.excludeFromAll = options.excludeFromAll;\n\t\tthis.excludePoliciesForFiles = createExcludedPolicyFileMap(this.policies);\n\t\tfor (const [instanceId, exclusions] of options.excludePoliciesForFiles) {\n\t\t\tthis.excludePoliciesForFiles.set(instanceId, exclusions);\n\t\t}\n\t\tthis.gitRoot = options.gitRoot;\n\t\tthis.resolve = options.resolve;\n\t\tthis.logger = options.logger;\n\t}\n\n\tpublic *run(filePaths: string[]): Operation<PolicyRunResults> {\n\t\tconst state: PolicyRunState = {\n\t\t\tresults: [],\n\t\t\tperfStats: newPerfStats(),\n\t\t};\n\n\t\tfor (const filePath of filePaths) {\n\t\t\tyield* this.checkOrExcludeFile(filePath, state);\n\t\t}\n\n\t\treturn {\n\t\t\tresults: state.results,\n\t\t\tperfStats: state.perfStats,\n\t\t};\n\t}\n\n\tprivate *checkOrExcludeFile(\n\t\trelPath: string,\n\t\tstate: PolicyRunState,\n\t): Operation<void> {\n\t\tstate.perfStats.count++;\n\t\ttry {\n\t\t\tyield* this.routeToPolicies(relPath, state);\n\t\t} catch (error: unknown) {\n\t\t\tthrow new Error(\n\t\t\t\t`Error routing ${relPath} to handler: ${error}\\nStack:\\n${(error as Error).stack}`,\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate *routeToPolicies(\n\t\trelPath: string,\n\t\tstate: PolicyRunState,\n\t): Operation<void> {\n\t\tif (this.excludeFromAll.some((regex) => matches(regex, relPath))) {\n\t\t\tthis.logger?.verbose(`Excluded all handlers: ${relPath}`);\n\t\t\treturn;\n\t\t}\n\n\t\tconst matchingPolicies = this.policies.filter((policy) =>\n\t\t\tmatches(policy.match, relPath),\n\t\t);\n\t\tif (this.resolve) {\n\t\t\t// Fixers can read and rewrite the same file.\n\t\t\tfor (const policy of matchingPolicies) {\n\t\t\t\tyield* this.runPolicyOnFile(relPath, policy, state);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tyield* all(\n\t\t\tmatchingPolicies.map((policy) => {\n\t\t\t\treturn this.runPolicyOnFile(relPath, policy, state);\n\t\t\t}),\n\t\t);\n\t}\n\n\tprivate *runPolicyOnFile(\n\t\trelPath: string,\n\t\tpolicy: IdentifiedPolicy,\n\t\tstate: PolicyRunState,\n\t): Operation<void> {\n\t\tif (this.isPolicyExcluded(relPath, policy)) {\n\t\t\tthis.logger?.verbose(\n\t\t\t\t`Excluded from '${policy.instanceId}' policy: ${relPath}`,\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst result = yield* this.executePolicyHandler(relPath, policy, state);\n\n\t\t\t// Success — nothing to report\n\t\t\tif (result === true) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileResult: PolicyFileResult = {\n\t\t\t\tfile: relPath,\n\t\t\t\tpolicy: policy.name,\n\t\t\t\tpolicyId: policy.instanceId,\n\t\t\t\toutcome: result,\n\t\t\t};\n\n\t\t\t// Check if resolution should be attempted: result is a failure that\n\t\t\t// wasn't already fixed, resolve mode is on, and a standalone resolver exists.\n\t\t\tconst alreadyFixed =\n\t\t\t\tisPolicyFixResult(result) ||\n\t\t\t\t(isPolicyError(result) && result.fixed !== undefined);\n\n\t\t\tif (!alreadyFixed && this.resolve && policy.resolver) {\n\t\t\t\tconst resolution = yield* this.attemptResolution(\n\t\t\t\t\trelPath,\n\t\t\t\t\tpolicy,\n\t\t\t\t\tpolicy.resolver,\n\t\t\t\t\tstate,\n\t\t\t\t);\n\t\t\t\tfileResult.resolution = resolution;\n\t\t\t}\n\n\t\t\tstate.results.push(fileResult);\n\t\t} catch (error: unknown) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\tstate.results.push({\n\t\t\t\tfile: relPath,\n\t\t\t\tpolicy: policy.name,\n\t\t\t\tpolicyId: policy.instanceId,\n\t\t\t\toutcome: {\n\t\t\t\t\terror: `System Error: Error executing policy '${policy.instanceId}' for file '${relPath}': ${message}`,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate isPolicyExcluded(relPath: string, policy: IdentifiedPolicy): boolean {\n\t\treturn (\n\t\t\tthis.excludePoliciesForFiles\n\t\t\t\t.get(policy.instanceId)\n\t\t\t\t?.some((regex) => matches(regex, relPath)) ?? false\n\t\t);\n\t}\n\n\tprivate *executePolicyHandler(\n\t\trelPath: string,\n\t\tpolicy: IdentifiedPolicy,\n\t\tstate: PolicyRunState,\n\t): Operation<PolicyHandlerResult> {\n\t\tconst { resolve, gitRoot } = this;\n\n\t\tconst result = yield* runWithPerf(\n\t\t\tpolicy.instanceId,\n\t\t\t\"handle\",\n\t\t\tstate.perfStats,\n\t\t\tfunction* () {\n\t\t\t\tconst args = {\n\t\t\t\t\tfile: relPath,\n\t\t\t\t\troot: gitRoot,\n\t\t\t\t\tresolve,\n\t\t\t\t\tconfig: policy.config,\n\t\t\t\t};\n\n\t\t\t\tif (policy._internalHandler) {\n\t\t\t\t\treturn yield* policy._internalHandler(args);\n\t\t\t\t}\n\n\t\t\t\tconst handlerResult = policy.handler(args);\n\t\t\t\tif (handlerResult instanceof Promise) {\n\t\t\t\t\treturn yield* call(() => handlerResult);\n\t\t\t\t}\n\t\t\t\tif (isOperation<PolicyHandlerResult>(handlerResult)) {\n\t\t\t\t\treturn yield* handlerResult;\n\t\t\t\t}\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Unexpected handler result type: ${typeof handlerResult}`,\n\t\t\t\t);\n\t\t\t},\n\t\t);\n\n\t\tif (result === undefined) {\n\t\t\tthrow new Error(\"Policy result was undefined.\");\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tprivate *attemptResolution(\n\t\trelPath: string,\n\t\tpolicy: IdentifiedPolicy,\n\t\tresolver: PolicyStandaloneResolver,\n\t\tstate: PolicyRunState,\n\t): Operation<PolicyFixResult> {\n\t\tconst { gitRoot } = this;\n\n\t\treturn yield* runWithPerf(\n\t\t\tpolicy.instanceId,\n\t\t\t\"resolve\",\n\t\t\tstate.perfStats,\n\t\t\tfunction* () {\n\t\t\t\tconst result = resolver({\n\t\t\t\t\tfile: relPath,\n\t\t\t\t\troot: gitRoot,\n\t\t\t\t\tconfig: policy.config,\n\t\t\t\t});\n\t\t\t\tif (result instanceof Promise) {\n\t\t\t\t\treturn yield* call(() => result);\n\t\t\t\t}\n\t\t\t\tif (isOperation<PolicyFixResult>(result)) {\n\t\t\t\t\treturn yield* result;\n\t\t\t\t}\n\t\t\t\tthrow new Error(`Unexpected resolver result type: ${typeof result}`);\n\t\t\t},\n\t\t);\n\t}\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.56.0"
8
+ "packageVersion": "7.58.11"
9
9
  }
10
10
  ]
11
11
  }
@@ -1,5 +1,102 @@
1
1
  {
2
2
  "commands": {
3
+ "check-native": {
4
+ "aliases": [],
5
+ "args": {},
6
+ "description": "Runs the Rust-based repopo-core engine with the Node.js sidecar. This provides the same policy checking as 'check' but with Rust-based file enumeration, regex matching, and orchestration for better performance.",
7
+ "flags": {
8
+ "fix": {
9
+ "aliases": [
10
+ "resolve"
11
+ ],
12
+ "char": "f",
13
+ "description": "Fix errors if possible.",
14
+ "name": "fix",
15
+ "required": false,
16
+ "allowNo": false,
17
+ "type": "boolean"
18
+ },
19
+ "stdin": {
20
+ "description": "Read list of files from stdin.",
21
+ "name": "stdin",
22
+ "required": false,
23
+ "allowNo": false,
24
+ "type": "boolean"
25
+ },
26
+ "verbose": {
27
+ "char": "v",
28
+ "description": "Show verbose output including per-policy timing.",
29
+ "name": "verbose",
30
+ "required": false,
31
+ "allowNo": false,
32
+ "type": "boolean"
33
+ },
34
+ "quiet": {
35
+ "char": "q",
36
+ "description": "Suppress all output except errors.",
37
+ "name": "quiet",
38
+ "required": false,
39
+ "allowNo": false,
40
+ "type": "boolean"
41
+ },
42
+ "config": {
43
+ "char": "c",
44
+ "description": "Path to the config file.",
45
+ "name": "config",
46
+ "required": false,
47
+ "hasDynamicHelp": false,
48
+ "multiple": false,
49
+ "type": "option"
50
+ },
51
+ "sidecar-path": {
52
+ "description": "Path to the Node.js sidecar script.",
53
+ "env": "REPOPO_SIDECAR_PATH",
54
+ "name": "sidecar-path",
55
+ "required": false,
56
+ "hasDynamicHelp": false,
57
+ "multiple": false,
58
+ "type": "option"
59
+ },
60
+ "binary-path": {
61
+ "description": "Path to the repopo-core Rust binary.",
62
+ "env": "REPOPO_CORE_PATH",
63
+ "name": "binary-path",
64
+ "required": false,
65
+ "hasDynamicHelp": false,
66
+ "multiple": false,
67
+ "type": "option"
68
+ },
69
+ "runtime": {
70
+ "description": "JS runtime for the sidecar process (auto, node, bun).",
71
+ "env": "REPOPO_RUNTIME",
72
+ "name": "runtime",
73
+ "required": false,
74
+ "hasDynamicHelp": false,
75
+ "multiple": false,
76
+ "options": [
77
+ "auto",
78
+ "node",
79
+ "bun"
80
+ ],
81
+ "type": "option"
82
+ }
83
+ },
84
+ "hasDynamicHelp": false,
85
+ "hiddenAliases": [],
86
+ "id": "check-native",
87
+ "pluginAlias": "repopo",
88
+ "pluginName": "repopo",
89
+ "pluginType": "core",
90
+ "strict": true,
91
+ "summary": "Checks and applies policies using the Rust engine.",
92
+ "enableJsonFlag": false,
93
+ "isESM": true,
94
+ "relativePath": [
95
+ "esm",
96
+ "commands",
97
+ "check-native.js"
98
+ ]
99
+ },
3
100
  "check": {
4
101
  "aliases": [],
5
102
  "args": {},
@@ -46,7 +143,7 @@
46
143
  "type": "boolean"
47
144
  },
48
145
  "config": {
49
- "description": "The path to a configuration file.",
146
+ "description": "Path to configuration file.",
50
147
  "helpGroup": "CONFIGURATION",
51
148
  "hidden": true,
52
149
  "name": "config",
@@ -99,7 +196,7 @@
99
196
  "type": "boolean"
100
197
  },
101
198
  "config": {
102
- "description": "The path to a configuration file.",
199
+ "description": "Path to configuration file.",
103
200
  "helpGroup": "CONFIGURATION",
104
201
  "hidden": true,
105
202
  "name": "config",
@@ -125,5 +222,5 @@
125
222
  ]
126
223
  }
127
224
  },
128
- "version": "0.9.0"
225
+ "version": "0.12.0"
129
226
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repopo",
3
- "version": "0.9.0",
3
+ "version": "0.12.0",
4
4
  "description": "Enforce policies on all or some of the files in a git repository.",
5
5
  "keywords": [
6
6
  "policy",
@@ -39,6 +39,8 @@
39
39
  "/bin",
40
40
  "/oclif.manifest.json",
41
41
  "/esm",
42
+ "/scripts",
43
+ "/sidecar",
42
44
  "/THIRD-PARTY-LICENSES.txt"
43
45
  ],
44
46
  "oclif": {
@@ -61,54 +63,64 @@
61
63
  "repositoryPrefix": "<%- repo %>/blob/main/packages/repopo/<%- commandPath %>"
62
64
  },
63
65
  "dependencies": {
64
- "@fluid-tools/build-infrastructure": "~0.63.0",
65
- "@oclif/core": "^4.8.0",
66
- "@oclif/plugin-help": "^6.2.36",
67
- "@rushstack/node-core-library": "^5.19.0",
68
- "consola": "^3.4.0",
69
- "defu": "^6.1.4",
70
- "effection": "^4.0.0",
71
- "jsonfile": "^6.2.0",
66
+ "@fluid-tools/build-infrastructure": "~0.65.0",
67
+ "@oclif/core": "^4.11.14",
68
+ "@oclif/plugin-help": "^6.2.53",
69
+ "@rushstack/node-core-library": "^5.23.1",
70
+ "consola": "^3.4.2",
71
+ "defu": "^6.1.7",
72
+ "effection": "^4.0.3",
73
+ "jsonfile": "^6.2.1",
74
+ "lilconfig": "^3.1.3",
72
75
  "microdiff": "^1.5.0",
73
76
  "pathe": "^2.0.3",
74
77
  "picocolors": "^1.1.1",
75
- "picomatch": "^4.0.3",
76
- "resolve-workspace-root": "^2.0.0",
77
- "simple-git": "^3.30.0",
78
- "tinyglobby": "^0.2.15",
79
- "@tylerbu/cli-api": "^0.10.1",
80
- "@tylerbu/fundamentals": "^0.3.0"
78
+ "picomatch": "^4.0.5",
79
+ "resolve-workspace-root": "^2.0.1",
80
+ "simple-git": "^3.36.0",
81
+ "tinyglobby": "^0.2.17",
82
+ "@tylerbu/cli-api": "^0.11.0",
83
+ "@tylerbu/fundamentals": "^0.3.0",
84
+ "@tylerbu/lilconfig-loader-ts": "^0.1.3"
81
85
  },
82
86
  "devDependencies": {
83
87
  "@biomejs/biome": "2.3.8",
84
- "@microsoft/api-extractor": "^7.56.0",
85
- "@oclif/plugin-command-snapshot": "^5.3.8",
86
- "@oclif/test": "^4.1.15",
88
+ "@microsoft/api-extractor": "^7.58.9",
89
+ "@oclif/plugin-command-snapshot": "^5.3.30",
90
+ "@oclif/test": "^4.1.20",
87
91
  "@types/jsonfile": "^6.1.4",
88
- "@types/node": "^20.19.25",
89
- "@types/picomatch": "^4.0.2",
92
+ "@types/node": "^22.20.1",
93
+ "@types/picomatch": "^4.0.3",
94
+ "@types/spdx-correct": "^3.1.3",
90
95
  "@types/tmp": "^0.2.6",
91
- "@vitest/coverage-v8": "^4.0.17",
92
- "generate-license-file": "^4.1.1",
93
- "oclif": "^4.22.50",
94
- "rimraf": "^6.1.2",
96
+ "@vitest/coverage-v8": "^4.1.10",
97
+ "generate-license-file": "^4.2.1",
98
+ "oclif": "^4.23.27",
99
+ "rimraf": "^6.1.3",
100
+ "smol-toml": "^1.7.0",
101
+ "spdx-correct": "^3.2.0",
95
102
  "tmp-promise": "^3.0.3",
96
103
  "ts-node": "^10.9.2",
97
- "type-fest": "^5.4.1",
98
- "typescript": "~5.9.3",
99
- "vitest": "^4.0.17"
104
+ "type-fest": "^5.8.0",
105
+ "typescript": "~6.0.3",
106
+ "vitest": "^4.1.10"
100
107
  },
101
108
  "peerDependencies": {
102
- "sort-package-json": "*"
109
+ "smol-toml": "^1.0.0",
110
+ "sort-package-json": "*",
111
+ "spdx-correct": "^3.0.0"
103
112
  },
104
113
  "peerDependenciesMeta": {
114
+ "smol-toml": {
115
+ "optional": true
116
+ },
105
117
  "sort-package-json": {
106
118
  "optional": true
119
+ },
120
+ "spdx-correct": {
121
+ "optional": true
107
122
  }
108
123
  },
109
- "engines": {
110
- "node": ">=18.0.0"
111
- },
112
124
  "nx": {
113
125
  "targets": {
114
126
  "build": {
@@ -123,12 +135,15 @@
123
135
  "build:compile": "tsc --project ./tsconfig.json",
124
136
  "build:manifest": "oclif manifest",
125
137
  "build:readme": "concurrently npm:readme:*",
138
+ "build:rust": "cargo build --manifest-path crates/core/Cargo.toml",
139
+ "build:rust:release": "cargo build --release --manifest-path crates/core/Cargo.toml",
126
140
  "check": "concurrently npm:check:format",
127
141
  "check:format": "biome check . --linter-enabled=false",
128
142
  "clean": "concurrently npm:clean:build npm:clean:manifest",
129
143
  "clean:build": "rimraf esm *.tsbuildinfo *.done.build.log",
130
144
  "clean:manifest": "rimraf oclif.manifest.json",
131
145
  "format": "biome check . --linter-enabled=false --write",
146
+ "postinstall": "node scripts/postinstall.mjs",
132
147
  "lint": "biome lint .",
133
148
  "lint:fix": "biome lint . --write",
134
149
  "readme:docs": "oclif readme --no-aliases --readme-path=../repopo-docs/src/content/docs/cli-reference.md",
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Postinstall script for repopo - downloads pre-built repopo-core binary.
3
+ *
4
+ * This script uses only Node.js built-ins (no workspace dependencies).
5
+ * It gracefully handles all errors — a missing binary is not fatal since
6
+ * the Rust engine is optional.
7
+ */
8
+
9
+ import { execFileSync } from "node:child_process";
10
+ import { createHash } from "node:crypto";
11
+ import {
12
+ chmodSync,
13
+ createWriteStream,
14
+ existsSync,
15
+ mkdirSync,
16
+ unlinkSync,
17
+ } from "node:fs";
18
+ import { readFile } from "node:fs/promises";
19
+ import { dirname, join } from "node:path";
20
+ import { pipeline } from "node:stream/promises";
21
+ import { fileURLToPath } from "node:url";
22
+
23
+ const __dirname = dirname(fileURLToPath(import.meta.url));
24
+ const packageRoot = join(__dirname, "..");
25
+
26
+ // Skip in source checkout (development)
27
+ if (existsSync(join(packageRoot, "crates", "core", "Cargo.toml"))) {
28
+ console.log("repopo: source checkout detected, skipping binary download.");
29
+ process.exit(0);
30
+ }
31
+
32
+ // Skip if explicitly disabled
33
+ // biome-ignore lint/style/noProcessEnv: Postinstall environment check
34
+ if (process.env.REPOPO_SKIP_POSTINSTALL === "1") {
35
+ console.log("repopo: REPOPO_SKIP_POSTINSTALL=1, skipping binary download.");
36
+ process.exit(0);
37
+ }
38
+
39
+ const PLATFORM_MAP = {
40
+ "linux-x64": "repopo-core-linux-x64",
41
+ "linux-arm64": "repopo-core-linux-arm64",
42
+ "darwin-x64": "repopo-core-darwin-x64",
43
+ "darwin-arm64": "repopo-core-darwin-arm64",
44
+ "win32-x64": "repopo-core-win32-x64",
45
+ };
46
+
47
+ const platformKey = `${process.platform}-${process.arch}`;
48
+ const assetName = PLATFORM_MAP[platformKey];
49
+
50
+ if (!assetName) {
51
+ console.warn(
52
+ `repopo: unsupported platform ${platformKey}, skipping binary download.`,
53
+ );
54
+ process.exit(0);
55
+ }
56
+
57
+ try {
58
+ const pkg = JSON.parse(
59
+ await readFile(join(packageRoot, "package.json"), "utf-8"),
60
+ );
61
+ const version = pkg.version;
62
+ const isWindows = process.platform === "win32";
63
+ const ext = isWindows ? ".zip" : ".tar.gz";
64
+ const binaryName = isWindows ? "repopo-core.exe" : "repopo-core";
65
+ const baseUrl = `https://github.com/tylerbutler/tools-monorepo/releases/download/repopo-core-v${version}`;
66
+ const archiveUrl = `${baseUrl}/${assetName}${ext}`;
67
+ const checksumUrl = `${archiveUrl}.sha256`;
68
+
69
+ const nativeDir = join(packageRoot, "native");
70
+ const binaryDest = join(nativeDir, binaryName);
71
+
72
+ // Skip if binary already exists
73
+ if (existsSync(binaryDest)) {
74
+ console.log("repopo: binary already exists, skipping download.");
75
+ process.exit(0);
76
+ }
77
+
78
+ mkdirSync(nativeDir, { recursive: true });
79
+
80
+ console.log(`repopo: downloading ${assetName}${ext}...`);
81
+
82
+ // Download checksum
83
+ const checksumText = await fetchText(checksumUrl);
84
+ const expectedHash = checksumText.trim().split(/\s+/)[0];
85
+
86
+ // Download archive
87
+ const archivePath = join(nativeDir, `${assetName}${ext}`);
88
+ await downloadFile(archiveUrl, archivePath);
89
+
90
+ // Verify checksum
91
+ const fileBuffer = await readFile(archivePath);
92
+ const actualHash = createHash("sha256").update(fileBuffer).digest("hex");
93
+
94
+ if (actualHash !== expectedHash) {
95
+ unlinkSync(archivePath);
96
+ throw new Error(
97
+ `Checksum mismatch: expected ${expectedHash}, got ${actualHash}`,
98
+ );
99
+ }
100
+
101
+ // Extract — uses execFileSync with explicit argument arrays to avoid shell injection
102
+ if (isWindows) {
103
+ execFileSync(
104
+ "powershell",
105
+ [
106
+ "-Command",
107
+ `Expand-Archive -Path '${archivePath}' -DestinationPath '${nativeDir}' -Force`,
108
+ ],
109
+ { stdio: "pipe" },
110
+ );
111
+ } else {
112
+ execFileSync("tar", ["xzf", archivePath, "-C", nativeDir], {
113
+ stdio: "pipe",
114
+ });
115
+ }
116
+
117
+ // Clean up archive
118
+ unlinkSync(archivePath);
119
+
120
+ // Set executable permission (non-Windows)
121
+ if (!isWindows) {
122
+ chmodSync(binaryDest, 0o755);
123
+ }
124
+
125
+ console.log("repopo: binary installed successfully.");
126
+ } catch (err) {
127
+ console.warn(
128
+ `repopo: failed to download binary (${err.message}). The Rust engine will be unavailable.`,
129
+ );
130
+ process.exit(0);
131
+ }
132
+
133
+ /**
134
+ * Fetch text content from a URL using Node.js built-in fetch.
135
+ */
136
+ async function fetchText(url) {
137
+ const res = await fetch(url);
138
+ if (!res.ok) {
139
+ throw new Error(`HTTP ${res.status} fetching ${url}`);
140
+ }
141
+ return res.text();
142
+ }
143
+
144
+ /**
145
+ * Download a file from a URL to a local path using Node.js built-in fetch.
146
+ */
147
+ async function downloadFile(url, dest) {
148
+ const res = await fetch(url);
149
+ if (!res.ok) {
150
+ throw new Error(`HTTP ${res.status} fetching ${url}`);
151
+ }
152
+ const fileStream = createWriteStream(dest);
153
+ await pipeline(res.body, fileStream);
154
+ }