@mannyc1/ts-release 0.0.7 → 0.3.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 (695) hide show
  1. package/ARCHITECTURE.md +184 -92
  2. package/CHANGELOG.md +197 -0
  3. package/LICENSE +21 -0
  4. package/README.md +404 -327
  5. package/SPEC.md +257 -310
  6. package/apps/release-ts/README.md +39 -0
  7. package/apps/release-ts/src/cli/command.ts +164 -0
  8. package/apps/release-ts/src/cli/commands.ts +351 -0
  9. package/apps/release-ts/src/cli/main.ts +43 -0
  10. package/apps/release-ts/src/cli/node-main.ts +49 -0
  11. package/apps/ts-release-agents/LICENSE +21 -0
  12. package/apps/ts-release-agents/README.md +21 -0
  13. package/apps/ts-release-agents/evals/cases.json +11 -0
  14. package/apps/ts-release-agents/manifests/claude.json +5 -0
  15. package/apps/ts-release-agents/manifests/codex.json +5 -0
  16. package/apps/ts-release-agents/package.json +11 -0
  17. package/apps/ts-release-agents/skills/release/SKILL.md +48 -0
  18. package/apps/ts-release-agents/skills/release/references/configuration.md +18 -0
  19. package/apps/ts-release-agents/skills/release/references/recovery.md +10 -0
  20. package/apps/ts-release-agents/skills/release/references/staged-workflow.md +12 -0
  21. package/apps/ts-release-agents/skills/release/references/target-selection.md +13 -0
  22. package/apps/ts-release-agents/skills/release/references/verification.md +14 -0
  23. package/apps/ts-release-agents/src/build.ts +105 -0
  24. package/apps/ts-release-agents/src/check.ts +122 -0
  25. package/apps/ts-release-agents/src/install.ts +121 -0
  26. package/apps/ts-release-agents/test/contract.test.ts +56 -0
  27. package/apps/ts-release-agents/tsconfig.json +5 -0
  28. package/dist/api/api.d.ts +15 -0
  29. package/dist/api/api.d.ts.map +1 -0
  30. package/dist/api/api.js +244 -0
  31. package/dist/api/api.js.map +1 -0
  32. package/dist/api/errors.d.ts +39 -0
  33. package/dist/api/errors.d.ts.map +1 -0
  34. package/dist/api/errors.js +32 -0
  35. package/dist/api/errors.js.map +1 -0
  36. package/dist/api/input.d.ts +10 -0
  37. package/dist/api/input.d.ts.map +1 -0
  38. package/dist/api/input.js +73 -0
  39. package/dist/api/input.js.map +1 -0
  40. package/dist/api/runtime.d.ts +18 -0
  41. package/dist/api/runtime.d.ts.map +1 -0
  42. package/dist/api/runtime.js +7 -0
  43. package/dist/api/runtime.js.map +1 -0
  44. package/dist/api/types.d.ts +76 -0
  45. package/dist/api/types.d.ts.map +1 -0
  46. package/dist/api/types.js +17 -0
  47. package/dist/api/types.js.map +1 -0
  48. package/dist/bin/ts-release.js +39346 -0
  49. package/dist/capabilities/bun-targets.d.ts +3 -0
  50. package/dist/capabilities/bun-targets.d.ts.map +1 -0
  51. package/dist/capabilities/bun-targets.js +3 -0
  52. package/dist/capabilities/bun-targets.js.map +1 -0
  53. package/dist/capabilities/field-ownership.d.ts +17 -0
  54. package/dist/capabilities/field-ownership.d.ts.map +1 -0
  55. package/dist/capabilities/field-ownership.js +40 -0
  56. package/dist/capabilities/field-ownership.js.map +1 -0
  57. package/dist/capabilities/module.d.ts +91 -0
  58. package/dist/capabilities/module.d.ts.map +1 -0
  59. package/dist/capabilities/module.js +2 -0
  60. package/dist/capabilities/module.js.map +1 -0
  61. package/dist/capabilities/registry.d.ts +829 -0
  62. package/dist/capabilities/registry.d.ts.map +1 -0
  63. package/dist/capabilities/registry.js +291 -0
  64. package/dist/capabilities/registry.js.map +1 -0
  65. package/dist/config/config.d.ts +6 -0
  66. package/dist/config/config.d.ts.map +1 -0
  67. package/dist/config/config.js +42 -0
  68. package/dist/config/config.js.map +1 -0
  69. package/dist/correction/coordinator.d.ts +248 -0
  70. package/dist/correction/coordinator.d.ts.map +1 -0
  71. package/dist/correction/coordinator.js +274 -0
  72. package/dist/correction/coordinator.js.map +1 -0
  73. package/dist/correction/index.d.ts +3 -0
  74. package/dist/correction/index.d.ts.map +1 -0
  75. package/dist/correction/index.js +3 -0
  76. package/dist/correction/index.js.map +1 -0
  77. package/dist/correction/intent.d.ts +111 -0
  78. package/dist/correction/intent.d.ts.map +1 -0
  79. package/dist/correction/intent.js +146 -0
  80. package/dist/correction/intent.js.map +1 -0
  81. package/dist/drivers/archive.d.ts +9 -0
  82. package/dist/drivers/archive.d.ts.map +1 -0
  83. package/dist/drivers/archive.js +105 -0
  84. package/dist/drivers/archive.js.map +1 -0
  85. package/dist/drivers/contain.d.ts +6 -0
  86. package/dist/drivers/contain.d.ts.map +1 -0
  87. package/dist/drivers/contain.js +17 -0
  88. package/dist/drivers/contain.js.map +1 -0
  89. package/dist/drivers/environment.d.ts +4 -0
  90. package/dist/drivers/environment.d.ts.map +1 -0
  91. package/dist/drivers/environment.js +18 -0
  92. package/dist/drivers/environment.js.map +1 -0
  93. package/dist/drivers/errors.d.ts +9 -0
  94. package/dist/drivers/errors.d.ts.map +1 -0
  95. package/dist/drivers/errors.js +6 -0
  96. package/dist/drivers/errors.js.map +1 -0
  97. package/dist/drivers/glob.d.ts +2 -0
  98. package/dist/drivers/glob.d.ts.map +1 -0
  99. package/dist/drivers/glob.js +162 -0
  100. package/dist/drivers/glob.js.map +1 -0
  101. package/dist/drivers/process.d.ts +48 -0
  102. package/dist/drivers/process.d.ts.map +1 -0
  103. package/dist/drivers/process.js +257 -0
  104. package/dist/drivers/process.js.map +1 -0
  105. package/dist/drivers/python-wheel.d.ts +21 -0
  106. package/dist/drivers/python-wheel.d.ts.map +1 -0
  107. package/dist/drivers/python-wheel.js +109 -0
  108. package/dist/drivers/python-wheel.js.map +1 -0
  109. package/dist/drivers/redact.d.ts +4 -0
  110. package/dist/drivers/redact.d.ts.map +1 -0
  111. package/dist/drivers/redact.js +24 -0
  112. package/dist/drivers/redact.js.map +1 -0
  113. package/dist/drivers/seccomp-helper-source.d.ts +7 -0
  114. package/dist/drivers/seccomp-helper-source.d.ts.map +1 -0
  115. package/dist/drivers/seccomp-helper-source.js +121 -0
  116. package/dist/drivers/seccomp-helper-source.js.map +1 -0
  117. package/dist/drivers/utils.d.ts +4 -0
  118. package/dist/drivers/utils.d.ts.map +1 -0
  119. package/dist/drivers/utils.js +5 -0
  120. package/dist/drivers/utils.js.map +1 -0
  121. package/dist/drivers/workspace.d.ts +9 -0
  122. package/dist/drivers/workspace.d.ts.map +1 -0
  123. package/dist/drivers/workspace.js +53 -0
  124. package/dist/drivers/workspace.js.map +1 -0
  125. package/dist/extensions/provider-adapter.d.ts +48 -0
  126. package/dist/extensions/provider-adapter.d.ts.map +1 -0
  127. package/dist/extensions/provider-adapter.js +64 -0
  128. package/dist/extensions/provider-adapter.js.map +1 -0
  129. package/dist/host.d.ts +33 -0
  130. package/dist/host.d.ts.map +1 -0
  131. package/dist/host.js +20 -0
  132. package/dist/host.js.map +1 -0
  133. package/dist/index.d.ts +19 -1
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +12 -1
  136. package/dist/index.js.map +1 -1
  137. package/dist/model/artifact-collection.d.ts +84 -0
  138. package/dist/model/artifact-collection.d.ts.map +1 -0
  139. package/dist/model/artifact-collection.js +185 -0
  140. package/dist/model/artifact-collection.js.map +1 -0
  141. package/dist/model/authority.d.ts +89 -0
  142. package/dist/model/authority.d.ts.map +1 -0
  143. package/dist/model/authority.js +80 -0
  144. package/dist/model/authority.js.map +1 -0
  145. package/dist/model/bun-targets.d.ts +34 -0
  146. package/dist/model/bun-targets.d.ts.map +1 -0
  147. package/dist/model/bun-targets.js +17 -0
  148. package/dist/model/bun-targets.js.map +1 -0
  149. package/dist/model/canonical.d.ts +8 -0
  150. package/dist/model/canonical.d.ts.map +1 -0
  151. package/dist/model/canonical.js +205 -0
  152. package/dist/model/canonical.js.map +1 -0
  153. package/dist/model/catalog.d.ts +76 -0
  154. package/dist/model/catalog.d.ts.map +1 -0
  155. package/dist/model/catalog.js +174 -0
  156. package/dist/model/catalog.js.map +1 -0
  157. package/dist/model/digest.d.ts +53 -0
  158. package/dist/model/digest.d.ts.map +1 -0
  159. package/dist/model/digest.js +127 -0
  160. package/dist/model/digest.js.map +1 -0
  161. package/dist/model/errors.d.ts +14 -0
  162. package/dist/model/errors.d.ts.map +1 -0
  163. package/dist/model/errors.js +8 -0
  164. package/dist/model/errors.js.map +1 -0
  165. package/dist/model/primitives.d.ts +19 -0
  166. package/dist/model/primitives.d.ts.map +1 -0
  167. package/dist/model/primitives.js +18 -0
  168. package/dist/model/primitives.js.map +1 -0
  169. package/dist/model/pypi.d.ts +12 -0
  170. package/dist/model/pypi.d.ts.map +1 -0
  171. package/dist/model/pypi.js +20 -0
  172. package/dist/model/pypi.js.map +1 -0
  173. package/dist/model/python-distribution.d.ts +33 -0
  174. package/dist/model/python-distribution.d.ts.map +1 -0
  175. package/dist/model/python-distribution.js +367 -0
  176. package/dist/model/python-distribution.js.map +1 -0
  177. package/dist/model/secret-patterns.d.ts +2 -0
  178. package/dist/model/secret-patterns.d.ts.map +1 -0
  179. package/dist/model/secret-patterns.js +12 -0
  180. package/dist/model/secret-patterns.js.map +1 -0
  181. package/dist/operation-journal/authority.d.ts +3 -0
  182. package/dist/operation-journal/authority.d.ts.map +1 -0
  183. package/dist/operation-journal/authority.js +147 -0
  184. package/dist/operation-journal/authority.js.map +1 -0
  185. package/dist/operation-journal/aws/deadline.d.ts +12 -0
  186. package/dist/operation-journal/aws/deadline.d.ts.map +1 -0
  187. package/dist/operation-journal/aws/deadline.js +38 -0
  188. package/dist/operation-journal/aws/deadline.js.map +1 -0
  189. package/dist/operation-journal/aws/oidc.d.ts +27 -0
  190. package/dist/operation-journal/aws/oidc.d.ts.map +1 -0
  191. package/dist/operation-journal/aws/oidc.js +361 -0
  192. package/dist/operation-journal/aws/oidc.js.map +1 -0
  193. package/dist/operation-journal/aws/policy.d.ts +42 -0
  194. package/dist/operation-journal/aws/policy.d.ts.map +1 -0
  195. package/dist/operation-journal/aws/policy.js +404 -0
  196. package/dist/operation-journal/aws/policy.js.map +1 -0
  197. package/dist/operation-journal/aws/s3-boundary.d.ts +17 -0
  198. package/dist/operation-journal/aws/s3-boundary.d.ts.map +1 -0
  199. package/dist/operation-journal/aws/s3-boundary.js +417 -0
  200. package/dist/operation-journal/aws/s3-boundary.js.map +1 -0
  201. package/dist/operation-journal/aws.d.ts +11 -0
  202. package/dist/operation-journal/aws.d.ts.map +1 -0
  203. package/dist/operation-journal/aws.js +50 -0
  204. package/dist/operation-journal/aws.js.map +1 -0
  205. package/dist/operation-journal/canonical.d.ts +52 -0
  206. package/dist/operation-journal/canonical.d.ts.map +1 -0
  207. package/dist/operation-journal/canonical.js +282 -0
  208. package/dist/operation-journal/canonical.js.map +1 -0
  209. package/dist/operation-journal/model.d.ts +251 -0
  210. package/dist/operation-journal/model.d.ts.map +1 -0
  211. package/dist/operation-journal/model.js +56 -0
  212. package/dist/operation-journal/model.js.map +1 -0
  213. package/dist/operation-journal/reducer.d.ts +28 -0
  214. package/dist/operation-journal/reducer.d.ts.map +1 -0
  215. package/dist/operation-journal/reducer.js +73 -0
  216. package/dist/operation-journal/reducer.js.map +1 -0
  217. package/dist/operation-journal/s3.d.ts +7 -0
  218. package/dist/operation-journal/s3.d.ts.map +1 -0
  219. package/dist/operation-journal/s3.js +667 -0
  220. package/dist/operation-journal/s3.js.map +1 -0
  221. package/dist/operation-journal.d.ts +14 -0
  222. package/dist/operation-journal.d.ts.map +1 -0
  223. package/dist/operation-journal.js +12 -0
  224. package/dist/operation-journal.js.map +1 -0
  225. package/dist/platform/bun.d.ts +7 -0
  226. package/dist/platform/bun.d.ts.map +1 -0
  227. package/dist/platform/bun.js +15 -0
  228. package/dist/platform/bun.js.map +1 -0
  229. package/dist/platform/credentials.d.ts +32 -0
  230. package/dist/platform/credentials.d.ts.map +1 -0
  231. package/dist/platform/credentials.js +834 -0
  232. package/dist/platform/credentials.js.map +1 -0
  233. package/dist/platform/host-support.d.ts +2 -0
  234. package/dist/platform/host-support.d.ts.map +1 -0
  235. package/dist/platform/host-support.js +4 -0
  236. package/dist/platform/host-support.js.map +1 -0
  237. package/dist/platform/node.d.ts +7 -0
  238. package/dist/platform/node.d.ts.map +1 -0
  239. package/dist/platform/node.js +15 -0
  240. package/dist/platform/node.js.map +1 -0
  241. package/dist/platform/release-runtime.d.ts +11 -0
  242. package/dist/platform/release-runtime.d.ts.map +1 -0
  243. package/dist/platform/release-runtime.js +34 -0
  244. package/dist/platform/release-runtime.js.map +1 -0
  245. package/dist/platform/services.d.ts +15 -0
  246. package/dist/platform/services.d.ts.map +1 -0
  247. package/dist/platform/services.js +30 -0
  248. package/dist/platform/services.js.map +1 -0
  249. package/dist/platform/source-observer.d.ts +5 -0
  250. package/dist/platform/source-observer.d.ts.map +1 -0
  251. package/dist/platform/source-observer.js +159 -0
  252. package/dist/platform/source-observer.js.map +1 -0
  253. package/dist/provider-sdk.d.ts +14 -0
  254. package/dist/provider-sdk.d.ts.map +1 -0
  255. package/dist/provider-sdk.js +10 -0
  256. package/dist/provider-sdk.js.map +1 -0
  257. package/dist/publication/adapter.d.ts +212 -0
  258. package/dist/publication/adapter.d.ts.map +1 -0
  259. package/dist/publication/adapter.js +83 -0
  260. package/dist/publication/adapter.js.map +1 -0
  261. package/dist/publication/authority.d.ts +137 -0
  262. package/dist/publication/authority.d.ts.map +1 -0
  263. package/dist/publication/authority.js +233 -0
  264. package/dist/publication/authority.js.map +1 -0
  265. package/dist/publication/catalog-git.d.ts +37 -0
  266. package/dist/publication/catalog-git.d.ts.map +1 -0
  267. package/dist/publication/catalog-git.js +451 -0
  268. package/dist/publication/catalog-git.js.map +1 -0
  269. package/dist/publication/claim.d.ts +39 -0
  270. package/dist/publication/claim.d.ts.map +1 -0
  271. package/dist/publication/claim.js +31 -0
  272. package/dist/publication/claim.js.map +1 -0
  273. package/dist/publication/coordinator.d.ts +246 -0
  274. package/dist/publication/coordinator.d.ts.map +1 -0
  275. package/dist/publication/coordinator.js +370 -0
  276. package/dist/publication/coordinator.js.map +1 -0
  277. package/dist/publication/github.d.ts +36 -0
  278. package/dist/publication/github.d.ts.map +1 -0
  279. package/dist/publication/github.js +695 -0
  280. package/dist/publication/github.js.map +1 -0
  281. package/dist/publication/http.d.ts +69 -0
  282. package/dist/publication/http.d.ts.map +1 -0
  283. package/dist/publication/http.js +29 -0
  284. package/dist/publication/http.js.map +1 -0
  285. package/dist/publication/index.d.ts +5 -0
  286. package/dist/publication/index.d.ts.map +1 -0
  287. package/dist/publication/index.js +5 -0
  288. package/dist/publication/index.js.map +1 -0
  289. package/dist/publication/npm.d.ts +40 -0
  290. package/dist/publication/npm.d.ts.map +1 -0
  291. package/dist/publication/npm.js +359 -0
  292. package/dist/publication/npm.js.map +1 -0
  293. package/dist/publication/profiles.d.ts +136 -0
  294. package/dist/publication/profiles.d.ts.map +1 -0
  295. package/dist/publication/profiles.js +90 -0
  296. package/dist/publication/profiles.js.map +1 -0
  297. package/dist/publication/publisher.d.ts +82 -0
  298. package/dist/publication/publisher.d.ts.map +1 -0
  299. package/dist/publication/publisher.js +53 -0
  300. package/dist/publication/publisher.js.map +1 -0
  301. package/dist/publication/pypi.d.ts +45 -0
  302. package/dist/publication/pypi.d.ts.map +1 -0
  303. package/dist/publication/pypi.js +369 -0
  304. package/dist/publication/pypi.js.map +1 -0
  305. package/dist/publication/recovery.d.ts +663 -0
  306. package/dist/publication/recovery.d.ts.map +1 -0
  307. package/dist/publication/recovery.js +252 -0
  308. package/dist/publication/recovery.js.map +1 -0
  309. package/dist/publication/report.d.ts +1061 -0
  310. package/dist/publication/report.d.ts.map +1 -0
  311. package/dist/publication/report.js +441 -0
  312. package/dist/publication/report.js.map +1 -0
  313. package/dist/recipes/config.d.ts +296 -0
  314. package/dist/recipes/config.d.ts.map +1 -0
  315. package/dist/recipes/config.js +325 -0
  316. package/dist/recipes/config.js.map +1 -0
  317. package/dist/release/capabilities.d.ts +12 -0
  318. package/dist/release/capabilities.d.ts.map +1 -0
  319. package/dist/release/capabilities.js +395 -0
  320. package/dist/release/capabilities.js.map +1 -0
  321. package/dist/release/compiler.d.ts +5 -0
  322. package/dist/release/compiler.d.ts.map +1 -0
  323. package/dist/release/compiler.js +19 -0
  324. package/dist/release/compiler.js.map +1 -0
  325. package/dist/release/config.d.ts +5 -0
  326. package/dist/release/config.d.ts.map +1 -0
  327. package/dist/release/config.js +10 -0
  328. package/dist/release/config.js.map +1 -0
  329. package/dist/release/context.d.ts +96 -0
  330. package/dist/release/context.d.ts.map +1 -0
  331. package/dist/release/context.js +168 -0
  332. package/dist/release/context.js.map +1 -0
  333. package/dist/release/graph.d.ts +271 -0
  334. package/dist/release/graph.d.ts.map +1 -0
  335. package/dist/release/graph.js +766 -0
  336. package/dist/release/graph.js.map +1 -0
  337. package/dist/release/inspect.d.ts +88 -0
  338. package/dist/release/inspect.d.ts.map +1 -0
  339. package/dist/release/inspect.js +75 -0
  340. package/dist/release/inspect.js.map +1 -0
  341. package/dist/release/prepare.d.ts +24 -0
  342. package/dist/release/prepare.d.ts.map +1 -0
  343. package/dist/release/prepare.js +1115 -0
  344. package/dist/release/prepare.js.map +1 -0
  345. package/dist/release/prepared-ref.d.ts +60 -0
  346. package/dist/release/prepared-ref.d.ts.map +1 -0
  347. package/dist/release/prepared-ref.js +131 -0
  348. package/dist/release/prepared-ref.js.map +1 -0
  349. package/dist/release/prepared-store.d.ts +90 -0
  350. package/dist/release/prepared-store.d.ts.map +1 -0
  351. package/dist/release/prepared-store.js +339 -0
  352. package/dist/release/prepared-store.js.map +1 -0
  353. package/dist/release/prepared.d.ts +172 -0
  354. package/dist/release/prepared.d.ts.map +1 -0
  355. package/dist/release/prepared.js +268 -0
  356. package/dist/release/prepared.js.map +1 -0
  357. package/dist/release/staging.d.ts +31 -0
  358. package/dist/release/staging.d.ts.map +1 -0
  359. package/dist/release/staging.js +218 -0
  360. package/dist/release/staging.js.map +1 -0
  361. package/dist/resolve/authored.d.ts +53 -0
  362. package/dist/resolve/authored.d.ts.map +1 -0
  363. package/dist/resolve/authored.js +55 -0
  364. package/dist/resolve/authored.js.map +1 -0
  365. package/dist/resolve/encode.d.ts +3 -0
  366. package/dist/resolve/encode.d.ts.map +1 -0
  367. package/dist/resolve/encode.js +21 -0
  368. package/dist/resolve/encode.js.map +1 -0
  369. package/dist/resolve/errors.d.ts +7 -0
  370. package/dist/resolve/errors.d.ts.map +1 -0
  371. package/dist/resolve/errors.js +17 -0
  372. package/dist/resolve/errors.js.map +1 -0
  373. package/dist/resolve/facts.d.ts +12 -0
  374. package/dist/resolve/facts.d.ts.map +1 -0
  375. package/dist/resolve/facts.js +18 -0
  376. package/dist/resolve/facts.js.map +1 -0
  377. package/dist/resolve/resolve.d.ts +10 -0
  378. package/dist/resolve/resolve.d.ts.map +1 -0
  379. package/dist/resolve/resolve.js +242 -0
  380. package/dist/resolve/resolve.js.map +1 -0
  381. package/dist/store.d.ts +11 -0
  382. package/dist/store.d.ts.map +1 -0
  383. package/dist/store.js +9 -0
  384. package/dist/store.js.map +1 -0
  385. package/examples/README.md +20 -30
  386. package/examples/github-release/release.config.json +11 -18
  387. package/examples/homebrew-tap/README.md +11 -0
  388. package/examples/homebrew-tap/release.config.json +40 -28
  389. package/examples/multi-target/release.config.json +28 -53
  390. package/examples/npm-first-publish/release.config.json +23 -25
  391. package/examples/npm-only/release.config.json +22 -30
  392. package/examples/portable-cli/README.md +17 -0
  393. package/examples/portable-cli/artifacts/portable-example-0.1.0-darwin-arm64 +1 -0
  394. package/examples/portable-cli/artifacts/portable-example-0.1.0-darwin-x64 +1 -0
  395. package/examples/portable-cli/artifacts/portable-example-0.1.0-linux-arm64 +1 -0
  396. package/examples/portable-cli/artifacts/portable-example-0.1.0-linux-x64 +1 -0
  397. package/examples/portable-cli/artifacts/portable-example-0.1.0-windows-x64.exe +1 -0
  398. package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-macosx_10_15_x86_64.whl +1 -0
  399. package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-macosx_11_0_arm64.whl +1 -0
  400. package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-manylinux2014_aarch64.whl +1 -0
  401. package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-manylinux2014_x86_64.whl +1 -0
  402. package/examples/portable-cli/artifacts/portable_example-0.1.0-py3-none-win_amd64.whl +1 -0
  403. package/examples/portable-cli/package.json +9 -0
  404. package/examples/portable-cli/release.config.json +53 -0
  405. package/examples/portable-cli/src/cli.ts +3 -0
  406. package/examples/pypi-registry/README.md +8 -0
  407. package/examples/scoop-bucket/README.md +10 -0
  408. package/examples/scoop-bucket/release.config.json +40 -30
  409. package/package.json +73 -154
  410. package/src/api/api.ts +365 -0
  411. package/src/api/errors.ts +36 -0
  412. package/src/api/input.ts +92 -0
  413. package/src/api/runtime.ts +14 -0
  414. package/src/api/types.ts +103 -0
  415. package/src/capabilities/bun-targets.ts +2 -0
  416. package/src/capabilities/field-ownership.ts +60 -0
  417. package/src/capabilities/module.ts +158 -0
  418. package/src/capabilities/registry.ts +333 -0
  419. package/src/config/config.ts +48 -0
  420. package/src/correction/coordinator.ts +336 -0
  421. package/src/correction/index.ts +2 -0
  422. package/src/correction/intent.ts +172 -0
  423. package/src/drivers/archive.ts +111 -0
  424. package/src/drivers/contain.ts +20 -0
  425. package/src/drivers/environment.ts +28 -0
  426. package/src/drivers/errors.ts +6 -0
  427. package/src/drivers/glob.ts +137 -0
  428. package/src/drivers/process.ts +339 -0
  429. package/src/drivers/python-wheel.ts +145 -0
  430. package/src/drivers/redact.ts +31 -0
  431. package/src/drivers/seccomp-helper-source.ts +121 -0
  432. package/src/drivers/utils.ts +10 -0
  433. package/src/drivers/workspace.ts +46 -0
  434. package/src/extensions/provider-adapter.ts +99 -0
  435. package/src/host.ts +140 -0
  436. package/src/index.ts +64 -0
  437. package/src/model/artifact-collection.ts +237 -0
  438. package/src/model/authority.ts +116 -0
  439. package/src/model/bun-targets.ts +34 -0
  440. package/src/model/canonical.ts +205 -0
  441. package/src/model/catalog.ts +220 -0
  442. package/src/model/digest.ts +172 -0
  443. package/src/model/errors.ts +6 -0
  444. package/src/model/primitives.ts +37 -0
  445. package/src/model/pypi.ts +30 -0
  446. package/src/model/python-distribution.ts +360 -0
  447. package/src/model/secret-patterns.ts +11 -0
  448. package/src/operation-journal/authority.ts +162 -0
  449. package/src/operation-journal/aws/deadline.ts +41 -0
  450. package/src/operation-journal/aws/oidc.ts +439 -0
  451. package/src/operation-journal/aws/policy.ts +491 -0
  452. package/src/operation-journal/aws/s3-boundary.ts +562 -0
  453. package/src/operation-journal/aws.ts +60 -0
  454. package/src/operation-journal/canonical.ts +373 -0
  455. package/src/operation-journal/model.ts +301 -0
  456. package/src/operation-journal/reducer.ts +112 -0
  457. package/src/operation-journal/s3.ts +884 -0
  458. package/src/operation-journal.ts +51 -0
  459. package/src/platform/bun.ts +38 -0
  460. package/src/platform/credentials.ts +1151 -0
  461. package/src/platform/host-support.ts +4 -0
  462. package/src/platform/node.ts +38 -0
  463. package/src/platform/release-runtime.ts +47 -0
  464. package/src/platform/services.ts +57 -0
  465. package/src/platform/source-observer.ts +193 -0
  466. package/src/provider-sdk.ts +48 -0
  467. package/src/publication/adapter.ts +132 -0
  468. package/src/publication/authority.ts +397 -0
  469. package/src/publication/catalog-git.ts +603 -0
  470. package/src/publication/claim.ts +51 -0
  471. package/src/publication/coordinator.ts +578 -0
  472. package/src/publication/github.ts +1022 -0
  473. package/src/publication/http.ts +101 -0
  474. package/src/publication/index.ts +4 -0
  475. package/src/publication/npm.ts +525 -0
  476. package/src/publication/profiles.ts +94 -0
  477. package/src/publication/publisher.ts +130 -0
  478. package/src/publication/pypi.ts +463 -0
  479. package/src/publication/recovery.ts +349 -0
  480. package/src/publication/report.ts +628 -0
  481. package/src/recipes/config.ts +395 -0
  482. package/src/release/capabilities.ts +460 -0
  483. package/src/release/compiler.ts +28 -0
  484. package/src/release/config.ts +12 -0
  485. package/src/release/context.ts +223 -0
  486. package/src/release/graph.ts +866 -0
  487. package/src/release/inspect.ts +83 -0
  488. package/src/release/prepare.ts +1329 -0
  489. package/src/release/prepared-ref.ts +193 -0
  490. package/src/release/prepared-store.ts +378 -0
  491. package/src/release/prepared.ts +299 -0
  492. package/src/release/staging.ts +257 -0
  493. package/src/resolve/authored.ts +64 -0
  494. package/src/resolve/encode.ts +22 -0
  495. package/src/resolve/errors.ts +15 -0
  496. package/src/resolve/facts.ts +18 -0
  497. package/src/resolve/resolve.ts +328 -0
  498. package/src/store.ts +28 -0
  499. package/templates/README.md +55 -72
  500. package/templates/bun-cli-github/README.md +7 -9
  501. package/templates/bun-cli-github/release.config.json +35 -73
  502. package/templates/github-actions/release.yml +74 -0
  503. package/templates/github-actions/reviewed-release.yml +115 -0
  504. package/templates/multi-target-homebrew/README.md +10 -0
  505. package/templates/multi-target-homebrew/release.config.json +43 -60
  506. package/templates/multi-target-scoop/README.md +10 -0
  507. package/templates/multi-target-scoop/release.config.json +43 -62
  508. package/templates/npm-github/release.config.json +25 -38
  509. package/templates/npm-github/reviewed-release.config.json +37 -0
  510. package/templates/npm-only/README.md +10 -0
  511. package/templates/npm-only/release.config.json +15 -30
  512. package/templates/portable-cli/README.md +13 -0
  513. package/templates/portable-cli/release.config.json +53 -0
  514. package/dist/artifacts/adapter.d.ts +0 -39
  515. package/dist/artifacts/adapter.d.ts.map +0 -1
  516. package/dist/artifacts/adapter.js +0 -23
  517. package/dist/artifacts/adapter.js.map +0 -1
  518. package/dist/artifacts/registry.d.ts +0 -21
  519. package/dist/artifacts/registry.d.ts.map +0 -1
  520. package/dist/artifacts/registry.js +0 -21
  521. package/dist/artifacts/registry.js.map +0 -1
  522. package/dist/config/errors.d.ts +0 -24
  523. package/dist/config/errors.d.ts.map +0 -1
  524. package/dist/config/errors.js +0 -19
  525. package/dist/config/errors.js.map +0 -1
  526. package/dist/config/load.d.ts +0 -9
  527. package/dist/config/load.d.ts.map +0 -1
  528. package/dist/config/load.js +0 -29
  529. package/dist/config/load.js.map +0 -1
  530. package/dist/config/schema.d.ts +0 -12
  531. package/dist/config/schema.d.ts.map +0 -1
  532. package/dist/config/schema.js +0 -19
  533. package/dist/config/schema.js.map +0 -1
  534. package/dist/domain/artifact.d.ts +0 -118
  535. package/dist/domain/artifact.d.ts.map +0 -1
  536. package/dist/domain/artifact.js +0 -197
  537. package/dist/domain/artifact.js.map +0 -1
  538. package/dist/domain/evidence.d.ts +0 -59
  539. package/dist/domain/evidence.d.ts.map +0 -1
  540. package/dist/domain/evidence.js +0 -51
  541. package/dist/domain/evidence.js.map +0 -1
  542. package/dist/domain/operation.d.ts +0 -143
  543. package/dist/domain/operation.d.ts.map +0 -1
  544. package/dist/domain/operation.js +0 -198
  545. package/dist/domain/operation.js.map +0 -1
  546. package/dist/domain/release.d.ts +0 -93
  547. package/dist/domain/release.d.ts.map +0 -1
  548. package/dist/domain/release.js +0 -82
  549. package/dist/domain/release.js.map +0 -1
  550. package/dist/domain/remote-state.d.ts +0 -58
  551. package/dist/domain/remote-state.d.ts.map +0 -1
  552. package/dist/domain/remote-state.js +0 -55
  553. package/dist/domain/remote-state.js.map +0 -1
  554. package/dist/domain/target.d.ts +0 -148
  555. package/dist/domain/target.d.ts.map +0 -1
  556. package/dist/domain/target.js +0 -151
  557. package/dist/domain/target.js.map +0 -1
  558. package/dist/host/host.d.ts +0 -32
  559. package/dist/host/host.d.ts.map +0 -1
  560. package/dist/host/host.js +0 -24
  561. package/dist/host/host.js.map +0 -1
  562. package/dist/host/http-live.d.ts +0 -6
  563. package/dist/host/http-live.d.ts.map +0 -1
  564. package/dist/host/http-live.js +0 -86
  565. package/dist/host/http-live.js.map +0 -1
  566. package/dist/host/http.d.ts +0 -43
  567. package/dist/host/http.d.ts.map +0 -1
  568. package/dist/host/http.js +0 -59
  569. package/dist/host/http.js.map +0 -1
  570. package/dist/host/platform.d.ts +0 -10
  571. package/dist/host/platform.d.ts.map +0 -1
  572. package/dist/host/platform.js +0 -114
  573. package/dist/host/platform.js.map +0 -1
  574. package/dist/host/test.d.ts +0 -23
  575. package/dist/host/test.d.ts.map +0 -1
  576. package/dist/host/test.js +0 -222
  577. package/dist/host/test.js.map +0 -1
  578. package/dist/internal/workspace-path.d.ts +0 -15
  579. package/dist/internal/workspace-path.d.ts.map +0 -1
  580. package/dist/internal/workspace-path.js +0 -36
  581. package/dist/internal/workspace-path.js.map +0 -1
  582. package/dist/planner/artifact-inventory.d.ts +0 -9
  583. package/dist/planner/artifact-inventory.d.ts.map +0 -1
  584. package/dist/planner/artifact-inventory.js +0 -86
  585. package/dist/planner/artifact-inventory.js.map +0 -1
  586. package/dist/planner/create-release-plan.d.ts +0 -5
  587. package/dist/planner/create-release-plan.d.ts.map +0 -1
  588. package/dist/planner/create-release-plan.js +0 -25
  589. package/dist/planner/create-release-plan.js.map +0 -1
  590. package/dist/planner/errors.d.ts +0 -67
  591. package/dist/planner/errors.d.ts.map +0 -1
  592. package/dist/planner/errors.js +0 -58
  593. package/dist/planner/errors.js.map +0 -1
  594. package/dist/planner/evidence-recorder.d.ts +0 -28
  595. package/dist/planner/evidence-recorder.d.ts.map +0 -1
  596. package/dist/planner/evidence-recorder.js +0 -362
  597. package/dist/planner/evidence-recorder.js.map +0 -1
  598. package/dist/planner/executor.d.ts +0 -58
  599. package/dist/planner/executor.d.ts.map +0 -1
  600. package/dist/planner/executor.js +0 -147
  601. package/dist/planner/executor.js.map +0 -1
  602. package/dist/planner/normalize-release.d.ts +0 -19
  603. package/dist/planner/normalize-release.d.ts.map +0 -1
  604. package/dist/planner/normalize-release.js +0 -342
  605. package/dist/planner/normalize-release.js.map +0 -1
  606. package/dist/planner/reconcile.d.ts +0 -17
  607. package/dist/planner/reconcile.d.ts.map +0 -1
  608. package/dist/planner/reconcile.js +0 -259
  609. package/dist/planner/reconcile.js.map +0 -1
  610. package/dist/planner/render-plan.d.ts +0 -15
  611. package/dist/planner/render-plan.d.ts.map +0 -1
  612. package/dist/planner/render-plan.js +0 -231
  613. package/dist/planner/render-plan.js.map +0 -1
  614. package/dist/targets/adapter-helpers.d.ts +0 -79
  615. package/dist/targets/adapter-helpers.d.ts.map +0 -1
  616. package/dist/targets/adapter-helpers.js +0 -194
  617. package/dist/targets/adapter-helpers.js.map +0 -1
  618. package/dist/targets/adapter.d.ts +0 -17
  619. package/dist/targets/adapter.d.ts.map +0 -1
  620. package/dist/targets/adapter.js +0 -2
  621. package/dist/targets/adapter.js.map +0 -1
  622. package/dist/targets/github-release.d.ts +0 -25
  623. package/dist/targets/github-release.d.ts.map +0 -1
  624. package/dist/targets/github-release.js +0 -82
  625. package/dist/targets/github-release.js.map +0 -1
  626. package/dist/targets/github.d.ts +0 -11
  627. package/dist/targets/github.d.ts.map +0 -1
  628. package/dist/targets/github.js +0 -117
  629. package/dist/targets/github.js.map +0 -1
  630. package/dist/targets/homebrew.d.ts +0 -11
  631. package/dist/targets/homebrew.d.ts.map +0 -1
  632. package/dist/targets/homebrew.js +0 -210
  633. package/dist/targets/homebrew.js.map +0 -1
  634. package/dist/targets/live.d.ts +0 -5
  635. package/dist/targets/live.d.ts.map +0 -1
  636. package/dist/targets/live.js +0 -50
  637. package/dist/targets/live.js.map +0 -1
  638. package/dist/targets/npm.d.ts +0 -10
  639. package/dist/targets/npm.d.ts.map +0 -1
  640. package/dist/targets/npm.js +0 -112
  641. package/dist/targets/npm.js.map +0 -1
  642. package/dist/targets/pypi.d.ts +0 -11
  643. package/dist/targets/pypi.d.ts.map +0 -1
  644. package/dist/targets/pypi.js +0 -141
  645. package/dist/targets/pypi.js.map +0 -1
  646. package/dist/targets/registry.d.ts +0 -25
  647. package/dist/targets/registry.d.ts.map +0 -1
  648. package/dist/targets/registry.js +0 -34
  649. package/dist/targets/registry.js.map +0 -1
  650. package/dist/targets/scoop.d.ts +0 -11
  651. package/dist/targets/scoop.d.ts.map +0 -1
  652. package/dist/targets/scoop.js +0 -88
  653. package/dist/targets/scoop.js.map +0 -1
  654. package/dist/types/effect-internal.d.ts +0 -5
  655. package/dist/types/effect-internal.d.ts.map +0 -1
  656. package/dist/types/effect-internal.js +0 -2
  657. package/dist/types/effect-internal.js.map +0 -1
  658. package/dist/workflows/config.d.ts +0 -202
  659. package/dist/workflows/config.d.ts.map +0 -1
  660. package/dist/workflows/config.js +0 -420
  661. package/dist/workflows/config.js.map +0 -1
  662. package/dist/workflows/diagnostics.d.ts +0 -62
  663. package/dist/workflows/diagnostics.d.ts.map +0 -1
  664. package/dist/workflows/diagnostics.js +0 -530
  665. package/dist/workflows/diagnostics.js.map +0 -1
  666. package/dist/workflows/distribution.d.ts +0 -25
  667. package/dist/workflows/distribution.d.ts.map +0 -1
  668. package/dist/workflows/distribution.js +0 -24
  669. package/dist/workflows/distribution.js.map +0 -1
  670. package/dist/workflows/evidence.d.ts +0 -17
  671. package/dist/workflows/evidence.d.ts.map +0 -1
  672. package/dist/workflows/evidence.js +0 -32
  673. package/dist/workflows/evidence.js.map +0 -1
  674. package/dist/workflows/index.d.ts +0 -8
  675. package/dist/workflows/index.d.ts.map +0 -1
  676. package/dist/workflows/index.js +0 -7
  677. package/dist/workflows/index.js.map +0 -1
  678. package/dist/workflows/init.d.ts +0 -84
  679. package/dist/workflows/init.d.ts.map +0 -1
  680. package/dist/workflows/init.js +0 -487
  681. package/dist/workflows/init.js.map +0 -1
  682. package/dist/workflows/live.d.ts +0 -9
  683. package/dist/workflows/live.d.ts.map +0 -1
  684. package/dist/workflows/live.js +0 -7
  685. package/dist/workflows/live.js.map +0 -1
  686. package/dist/workflows/options.d.ts +0 -30
  687. package/dist/workflows/options.d.ts.map +0 -1
  688. package/dist/workflows/options.js +0 -16
  689. package/dist/workflows/options.js.map +0 -1
  690. package/examples/non-strict-skips/artifacts/release-example-skips-0.1.0.tgz +0 -1
  691. package/examples/non-strict-skips/release.config.json +0 -31
  692. package/examples/pypi-registry/release.config.json +0 -31
  693. package/templates/github-actions/plan-and-approved-execute.yml +0 -58
  694. package/templates/github-actions/plan-only.yml +0 -33
  695. package/templates/github-actions/trusted-publishing.yml +0 -61
@@ -0,0 +1,328 @@
1
+ // Authored configuration plus observed facts → the canonical config, by total
2
+ // rules and nothing else. This is the ONLY place authored-to-canonical
3
+ // semantics may live: no recipe and no compiler may infer anything, because
4
+ // plan bytes are a function of the canonical value alone.
5
+ //
6
+ // Every rule is one of three shapes: the authored value wins, a fact fills an
7
+ // omission, or the two disagree and the resolver REFUSES naming both values and
8
+ // where each came from. Silence is never an option — a release that guesses its
9
+ // own identity is the defect this module exists to prevent.
10
+ import * as Schema from "effect/Schema"
11
+ import * as Semver from "semver"
12
+ import { MISSING_COMMIT } from "../model/errors.js"
13
+ import { NonEmptyName, OutputId, Version } from "../model/primitives.js"
14
+ import {
15
+ CandidateConfig,
16
+ type CandidateNpmPublish,
17
+ type CandidatePyPiPublish,
18
+ CanonicalNpmRegistryEndpoint,
19
+ NpmDistTag,
20
+ PyPiProjectName,
21
+ canonicalizeNpmRegistryEndpoint,
22
+ normalizePyPiProjectName
23
+ } from "../recipes/config.js"
24
+ import { AuthoredConfig } from "./authored.js"
25
+ import { toPlainJson } from "./encode.js"
26
+ import { ResolveError } from "./errors.js"
27
+ import { ObservedFacts } from "./facts.js"
28
+
29
+ const refuse = (field: string, reason: string): never => {
30
+ throw new ResolveError(field, reason)
31
+ }
32
+ const disagreement = (
33
+ field: string, authored: string, observed: string, source: string
34
+ ): never =>
35
+ refuse(
36
+ `project.${field}`,
37
+ `project.${field} is ${JSON.stringify(authored)} in the config but ${
38
+ JSON.stringify(observed)
39
+ } ${source}. Remove the authored value or correct the source; the resolver never picks.`
40
+ )
41
+
42
+ const decodeAuthored = Schema.decodeUnknownSync(AuthoredConfig, { onExcessProperty: "error" })
43
+ const decodeFacts = Schema.decodeUnknownSync(ObservedFacts, { onExcessProperty: "error" })
44
+ const decodeCandidate = Schema.decodeUnknownSync(CandidateConfig, { onExcessProperty: "error" })
45
+
46
+ const version = (
47
+ authored: AuthoredConfig, facts: ObservedFacts
48
+ ): Version => {
49
+ const directive = authored.versionFrom
50
+ const observed = directive === "manifest"
51
+ ? facts.manifestVersion
52
+ : directive === "git-tag"
53
+ ? facts.headTagVersion
54
+ : undefined
55
+ const source = directive === "manifest" ? "in the package manifest" : "on the tag at HEAD"
56
+ if (authored.project.version !== undefined) {
57
+ if (observed !== undefined && observed !== authored.project.version) {
58
+ disagreement("version", authored.project.version, observed, source)
59
+ }
60
+ return authored.project.version
61
+ }
62
+ if (directive === undefined) {
63
+ return refuse(
64
+ "project.version",
65
+ "project.version is required. State it, or set versionFrom to \"manifest\" or \"git-tag\" so it can be observed."
66
+ )
67
+ }
68
+ if (observed === undefined) {
69
+ return refuse(
70
+ "project.version",
71
+ `versionFrom is ${JSON.stringify(directive)} but no version was observed ${source}.`
72
+ )
73
+ }
74
+ return observed
75
+ }
76
+
77
+ // `{version}` is the whole grammar. An unrecognized token is a refusal, exactly
78
+ // as the checksum name filter treats one.
79
+ const tag = (authored: AuthoredConfig, resolved: Version): NonEmptyName => {
80
+ if (authored.project.tag !== undefined) return authored.project.tag
81
+ const template = authored.project.tagTemplate ?? "v{version}"
82
+ const rendered = template.replaceAll("{version}", resolved)
83
+ if (rendered.includes("{") || rendered.includes("}")) {
84
+ return refuse(
85
+ "project.tagTemplate",
86
+ `project.tagTemplate supports only the {version} token, got ${JSON.stringify(template)}.`
87
+ )
88
+ }
89
+ return NonEmptyName.make(rendered)
90
+ }
91
+
92
+ const requireObservedCommit = (facts: ObservedFacts): void => {
93
+ if (facts.commit === undefined) refuse("source.commit", MISSING_COMMIT)
94
+ }
95
+
96
+ const names = (
97
+ authored: AuthoredConfig, facts: ObservedFacts
98
+ ): { readonly name: string, readonly packageName?: string } => {
99
+ const manifest = facts.manifestName
100
+ if (manifest !== undefined && authored.project.packageName !== undefined &&
101
+ manifest !== authored.project.packageName) {
102
+ disagreement("packageName", authored.project.packageName, manifest, "in the package manifest")
103
+ }
104
+ const name = authored.project.name ?? manifest
105
+ if (name === undefined) {
106
+ return refuse("project.name", "project.name is required when no package manifest is observed.")
107
+ }
108
+ const packageName = authored.project.packageName ?? manifest
109
+ return { name, ...(packageName === undefined ? {} : { packageName }) }
110
+ }
111
+
112
+ const repository = (authored: AuthoredConfig, facts: ObservedFacts): string | undefined => {
113
+ if (authored.project.repository !== undefined && facts.repository !== undefined && authored.project.repository !== facts.repository) {
114
+ disagreement("repository", authored.project.repository, facts.repository, "in the observed repository")
115
+ }
116
+ return authored.project.repository ?? facts.repository
117
+ }
118
+
119
+ const canonicalRegistry = (value: string | undefined): CanonicalNpmRegistryEndpoint => {
120
+ try {
121
+ return CanonicalNpmRegistryEndpoint.make(
122
+ canonicalizeNpmRegistryEndpoint(value ?? "https://registry.npmjs.org")
123
+ )
124
+ } catch (cause) {
125
+ return refuse(
126
+ "publish.npm.registry",
127
+ cause instanceof Error ? cause.message : String(cause)
128
+ )
129
+ }
130
+ }
131
+
132
+ const distTag = (versionValue: Version, authored: string | undefined): NpmDistTag => {
133
+ const normalized = Semver.valid(versionValue.toString())
134
+ if (normalized === null || normalized !== versionValue.toString()) {
135
+ return refuse(
136
+ "project.version",
137
+ `npm publication requires a canonical semantic version, got ${JSON.stringify(versionValue)}.`
138
+ )
139
+ }
140
+ const prerelease = Semver.prerelease(normalized) !== null
141
+ if (authored === undefined) {
142
+ if (prerelease) {
143
+ return refuse(
144
+ "publish.npm.distTag",
145
+ "Prerelease npm versions require an explicit non-latest distTag."
146
+ )
147
+ }
148
+ return NpmDistTag.make("latest")
149
+ }
150
+ let tag: NpmDistTag
151
+ try { tag = NpmDistTag.make(authored) } catch (cause) {
152
+ return refuse(
153
+ "publish.npm.distTag",
154
+ cause instanceof Error ? cause.message : String(cause)
155
+ )
156
+ }
157
+ if (prerelease && tag === "latest") {
158
+ return refuse(
159
+ "publish.npm.distTag",
160
+ "Prerelease npm versions cannot publish under the latest dist-tag."
161
+ )
162
+ }
163
+ return tag
164
+ }
165
+
166
+ type ResolvedProject = {
167
+ readonly name: string
168
+ readonly packageName?: string
169
+ readonly version: Version
170
+ readonly repository?: string
171
+ }
172
+
173
+ const npmPublish = (
174
+ authored: AuthoredConfig,
175
+ project: ResolvedProject
176
+ ): CandidateNpmPublish | undefined => {
177
+ const npm = authored.publish?.npm
178
+ if (npm === undefined) return undefined
179
+ if (authored.npmPackage === undefined) {
180
+ return refuse(
181
+ "npmPackage",
182
+ "publish.npm requires npmPackage to declare the exact package artifact prepared by npm pack."
183
+ )
184
+ }
185
+ const packageName = project.packageName ?? project.name
186
+ if (npm.access === "restricted" && !packageName.startsWith("@")) {
187
+ return refuse(
188
+ "publish.npm.access",
189
+ "npm restricted access is valid only for scoped package names."
190
+ )
191
+ }
192
+ const registry = canonicalRegistry(npm.registry)
193
+ const authentication = npm.authentication
194
+ if (authentication.strategy === "trusted-publishing") {
195
+ if (registry !== "https://registry.npmjs.org/") {
196
+ return refuse(
197
+ "publish.npm.authentication",
198
+ "npm trusted publishing is certified only for https://registry.npmjs.org/."
199
+ )
200
+ }
201
+ if (project.repository === undefined) {
202
+ return refuse(
203
+ "project.repository",
204
+ "npm trusted publishing requires the exact GitHub owner/repository coordinate."
205
+ )
206
+ }
207
+ if (authentication.attestation.repository !== project.repository) {
208
+ return refuse(
209
+ "publish.npm.authentication.attestation.repository",
210
+ `The attested repository ${JSON.stringify(authentication.attestation.repository)} does not match ${
211
+ JSON.stringify(project.repository)
212
+ } resolved for the package.`
213
+ )
214
+ }
215
+ }
216
+ const provenance = npm.provenance ??
217
+ (authentication.strategy === "trusted-publishing" ? "automatic" : "disabled")
218
+ if (authentication.strategy === "token" && provenance === "automatic") {
219
+ return refuse(
220
+ "publish.npm.provenance",
221
+ "Automatic provenance is an npm trusted-publishing behavior; token mode must choose required or disabled."
222
+ )
223
+ }
224
+ return {
225
+ packageArtifact: OutputId.make("npm-package"),
226
+ packageName: NonEmptyName.make(packageName),
227
+ registry,
228
+ distTag: distTag(project.version, npm.distTag),
229
+ access: npm.access ?? "public",
230
+ authentication,
231
+ provenance
232
+ }
233
+ }
234
+
235
+ const pypiPublish = (
236
+ authored: AuthoredConfig,
237
+ project: ResolvedProject
238
+ ): CandidatePyPiPublish | undefined => {
239
+ const pypi = authored.publish?.pypi
240
+ if (pypi === undefined) return undefined
241
+ const artifacts = pypi.artifacts.map((id) => OutputId.make(id)) as [OutputId, ...Array<OutputId>]
242
+ if (new Set(artifacts).size !== artifacts.length) {
243
+ return refuse("publish.pypi.artifacts", "PyPI publication cannot repeat one distribution artifact.")
244
+ }
245
+ if (pypi.authentication.strategy === "trusted-publishing") {
246
+ if (project.repository === undefined) {
247
+ return refuse("project.repository", "External PyPI trusted publishing requires the exact GitHub owner/repository coordinate.")
248
+ }
249
+ if (pypi.authentication.repository !== project.repository) {
250
+ return refuse(
251
+ "publish.pypi.authentication.repository",
252
+ `The external PyPI publisher repository ${JSON.stringify(pypi.authentication.repository)} does not match ${JSON.stringify(project.repository)}.`
253
+ )
254
+ }
255
+ let projectName: string
256
+ let projects: ReadonlyArray<string>
257
+ try {
258
+ projectName = normalizePyPiProjectName(project.name)
259
+ projects = pypi.authentication.projects.map(normalizePyPiProjectName)
260
+ } catch (cause) {
261
+ return refuse("publish.pypi", cause instanceof Error ? cause.message : String(cause))
262
+ }
263
+ if (!projects.includes(projectName)) {
264
+ return refuse(
265
+ "publish.pypi.authentication.projects",
266
+ `The external PyPI publisher authority set does not include ${JSON.stringify(projectName)}.`
267
+ )
268
+ }
269
+ if (new Set(projects).size !== projects.length) {
270
+ return refuse("publish.pypi.authentication.projects", "External PyPI publisher project coordinates must be unique after normalization.")
271
+ }
272
+ }
273
+ let projectName: PyPiProjectName
274
+ try { projectName = PyPiProjectName.make(normalizePyPiProjectName(project.name)) } catch (cause) {
275
+ return refuse("publish.pypi", cause instanceof Error ? cause.message : String(cause))
276
+ }
277
+ return {
278
+ artifacts,
279
+ project: projectName,
280
+ version: project.version,
281
+ repository: pypi.repository ?? "pypi",
282
+ authentication: pypi.authentication
283
+ }
284
+ }
285
+
286
+ /**
287
+ * Resolve an authored configuration and observed facts into the canonical
288
+ * configuration. Pure and total: the same inputs always produce the same value,
289
+ * and every unfillable or contradicted field raises `ResolveError`.
290
+ */
291
+ export { MISSING_COMMIT }
292
+
293
+ export const resolveConfig = (authored: unknown, facts: unknown): CandidateConfig => {
294
+ const config = decodeAuthored(authored)
295
+ const observed = decodeFacts(facts)
296
+ const resolvedVersion = version(config, observed)
297
+ // The directives are CONSUMED here: they describe how to resolve, and the
298
+ // canonical world has never heard of them.
299
+ const { project, versionFrom: _directive, $schema: _schema, ...rest } = config
300
+ const { tagTemplate: _template, ...projectRest } = project
301
+ const resolvedNames = names(config, observed)
302
+ const resolvedRepository = repository(config, observed)
303
+ // Verified source identity is observation-owned. It must exist, but is not a
304
+ // human-authored config field and is not copied into canonical release intent.
305
+ requireObservedCommit(observed)
306
+ const resolvedProject = {
307
+ ...projectRest,
308
+ ...resolvedNames,
309
+ ...(resolvedRepository === undefined ? {} : { repository: resolvedRepository }),
310
+ version: resolvedVersion,
311
+ tag: tag(config, resolvedVersion)
312
+ }
313
+ const npm = npmPublish(config, resolvedProject)
314
+ const pypi = pypiPublish(config, resolvedProject)
315
+ const publish = config.publish === undefined ? undefined : {
316
+ ...config.publish,
317
+ ...(config.publish.npm === undefined ? {} : { npm }),
318
+ ...(config.publish.pypi === undefined ? {} : { pypi })
319
+ }
320
+ // Plain JSON, not class instances: this value goes straight to `plan`, whose
321
+ // decoder refuses anything with a prototype.
322
+ const plain = toPlainJson({
323
+ ...rest,
324
+ project: resolvedProject,
325
+ ...(publish === undefined ? {} : { publish })
326
+ })
327
+ return toPlainJson(decodeCandidate(plain)) as CandidateConfig
328
+ }
package/src/store.ts ADDED
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Supported durable-store library boundary.
3
+ *
4
+ * The store service tag remains private. Hosts pass this structural value to
5
+ * one of the public layer constructors instead of assembling Effect contexts.
6
+ */
7
+ export {
8
+ GitHubActionsPreparedStoreProvenance,
9
+ LocalPreparedStoreProvenance,
10
+ PreparedCommitHandoffError,
11
+ PreparedStoreError,
12
+ PreparedStoreProvenanceError,
13
+ verifyPreparedStoreProvenance,
14
+ makeLocalPreparedReleaseStore
15
+ } from "./release/prepared-store.js"
16
+ export type {
17
+ CommittedPreparedRelease,
18
+ PreparedBundle,
19
+ PreparedStoreProvenance,
20
+ PreparedReleaseStoreShape
21
+ } from "./release/prepared-store.js"
22
+ export {
23
+ PreparedManifestError,
24
+ PreparedReleaseV2,
25
+ decodePreparedRelease,
26
+ encodePreparedRelease
27
+ } from "./release/prepared.js"
28
+ export type { CompletePreparedReleaseRef } from "./release/prepared-ref.js"
@@ -1,72 +1,55 @@
1
- # Release Templates
2
-
3
- Templates are copyable starting points for new repositories. They use
4
- placeholder names and may reference artifacts that you still need to build or
5
- stage before package-manager targets can consume them.
6
- The checked-in JSON templates are the same policy shape produced by `release
7
- init`.
8
-
9
- After copying a template, stage declared artifacts when the template has
10
- `artifactRecipes`, then preview the distribution plan:
11
-
12
- ```sh
13
- bun run cli plan --config release.config.json --format text
14
- ```
15
-
16
- Runnable fixtures live in `examples/`; templates are for authoring your own
17
- `release.config.json`.
18
-
19
- The CLI can preview or write these configs:
20
-
21
- ```sh
22
- bun run cli init --template npm-github --package @scope/pkg --repo owner/repo
23
- bun run cli init --template bun-cli-github --package @scope/pkg --repo owner/repo
24
- bun run cli init --template npm-github --package @scope/pkg --repo owner/repo --github-actions --write
25
- bun run cli init --template npm-github --package @scope/pkg --repo owner/repo --github-actions --package-manager npm --write
26
- ```
27
-
28
- Available config templates:
29
-
30
- - `npm-only`: existing npm package with GitHub Actions trusted publishing.
31
- - `npm-github`: npm plus GitHub Releases.
32
- - `bun-cli-github`: binary-first distribution with a Bun executable artifact recipe, npm package publishing, and GitHub Release assets.
33
- - `multi-target-homebrew`: npm, GitHub Releases, and a Homebrew tap.
34
- - `multi-target-scoop`: npm, GitHub Releases, and a Scoop bucket.
35
-
36
- Templates with `artifactRecipes` require an explicit staging step before target
37
- planning expects those files to exist. The Bun CLI template derives
38
- installable variant metadata such as operating system, architecture, Linux libc,
39
- and Windows `.exe` extension from each compile target:
40
-
41
- ```sh
42
- bun run cli stage-artifacts --config release.config.json
43
- ```
44
-
45
- The npm templates enable provenance, require `packageExists: true`, and set
46
- `verifyPackageExists: true` so planning includes a read-only `npm view` check
47
- before trusted publishing.
48
-
49
- GitHub Actions templates are action-first:
50
-
51
- - `github-actions/plan-only.yml`
52
- - `github-actions/plan-and-approved-execute.yml`
53
- - `github-actions/trusted-publishing.yml`
54
-
55
- They use `mannyc2/ts-release-action@v1`; the action source lives in this repo at
56
- `apps/ts-release-action` until the first action release is cut or mirrored.
57
- The action currently defaults to `runtime: bundled`.
58
-
59
- Generated workflows support Bun, npm, pnpm, and yarn setup presets. Static
60
- checked-in workflow templates use npm setup by default; setup, install, and
61
- build commands are workflow scaffolding rather than release config policy.
62
-
63
- The trusted-publishing templates do not use `NPM_TOKEN`; configure npm trusted
64
- publishing and a protected GitHub environment named `release` before approving
65
- the execute job.
66
-
67
- After writing a workflow, run static diagnostics before executing a release:
68
-
69
- ```sh
70
- bun run cli doctor --config release.config.json --format text
71
- bun run cli check-ci --config release.config.json --workflow .github/workflows/release.yml --format markdown
72
- ```
1
+ # Release templates
2
+
3
+ Templates are complete starting points for authored configuration and GitHub
4
+ Actions. Replace package, repository, artifact, and provider values before use.
5
+
6
+ The smallest workflow path is automatic: one job invokes the Action once. On
7
+ a fresh run it selects `release`, and the Action durably commits the complete
8
+ bundle before publication. Copy
9
+ `github-actions/release.yml` with `npm-github/release.config.json`. If a host
10
+ gate is required, copy the two-job `github-actions/reviewed-release.yml` and
11
+ its paired `npm-github/reviewed-release.config.json`; its prepare job emits one
12
+ exact hosted reference and only its publish job has the protected environment
13
+ and mutation permissions. Every Action step uploads only its redacted
14
+ `report-ref` as a workflow artifact. Prepared bytes stay in the dedicated
15
+ content-addressed Action store and are not duplicated by a generic artifact
16
+ step.
17
+
18
+ Both templates expose only `workflow_dispatch` and require `candidate_sha`.
19
+ Dispatch at `refs/heads/main` and pass the exact current commit; a ref or SHA
20
+ mismatch rejects the entire job before checkout. The automatic template also
21
+ accepts optional `prepared_ref`. Leave it empty for the fresh `release` path.
22
+ To recover a prior automatic run, pass its exact `prepared:gha:` value: the
23
+ same job selects `publish`, passes no config, uses `actions: read` to load the
24
+ prior artifact, and never rebuilds. Config and prepared reference are mutually
25
+ exclusive.
26
+
27
+ The reviewed template retains the same candidate admission on both jobs. If
28
+ its publish job fails after preparation, rerun that failed job in the same
29
+ workflow run so `${{ needs.prepare.outputs.prepared-ref }}` continues to name
30
+ the original bundle. Do not create a new prepare run as recovery.
31
+
32
+ The trusted-publishing job installs the Node 22.22.2 and npm 11.11.0
33
+ publisher boundary explicitly. The reviewed prepare job has no OIDC or publish
34
+ authority; only its publish job installs that publisher toolchain.
35
+ Trusted configuration must name the invoking workflow and exact ref: the
36
+ automatic pair uses `release.yml`, while the reviewed pair uses
37
+ `reviewed-release.yml`. Keep those filenames when copying the pair, dispatch
38
+ it from `refs/heads/main`, or update the exact config fields deliberately. A
39
+ repository, workflow path/ref, hosted-runner, direct action, or certified-sink
40
+ mismatch fails before OIDC request material is read.
41
+
42
+ Runnable configuration templates cover npm, GitHub Releases, portable
43
+ binaries, typed Homebrew formulas, and typed Scoop manifests. Templates are schema-checked;
44
+ support still requires a default-layer vertical test and clean-candidate
45
+ evidence, not merely a field appearing in a template.
46
+
47
+ `npm-github` is the GitHub-hosted trusted-publishing default. `npm-only` is the
48
+ explicit token-mode migration template for non-OIDC hosts; it names a
49
+ credential reference but never contains a credential value.
50
+
51
+ All public Action templates use the exact intended monorepo coordinate
52
+ `mannyc2/ts-release/apps/ts-release-action@v0.3.0`. Do not switch it to a
53
+ floating branch. Candidate certification must stop unless the immutable tag
54
+ can exist at the exact result commit before a package README naming it is
55
+ published.
@@ -1,14 +1,12 @@
1
- # Bun CLI + GitHub Releases
1
+ # Bun CLI and GitHub Releases
2
2
 
3
- This template publishes an npm package and attaches a Bun-compiled CLI matrix
4
- to a GitHub Release.
5
-
6
- Before planning or running the release, stage the executable artifacts:
3
+ This complete fixture prepares an npm package plus a Bun-compiled CLI matrix
4
+ attached to a GitHub Release. Build outputs are captured in the prepared bundle.
7
5
 
8
6
  ```sh
9
- bun run cli stage-artifacts --config release.config.json
7
+ ts-release inspect --config release.config.json
8
+ ts-release release --config release.config.json
10
9
  ```
11
10
 
12
- The `id` fields are project-local identifiers. Rename the recipe, outputs,
13
- entrypoint, and paths to match your CLI; ts-release uses those values as data
14
- when it builds the release plan.
11
+ Rename the project-local ids, entrypoint, target matrix, and output template
12
+ before releasing.
@@ -1,89 +1,51 @@
1
1
  {
2
- "$schema": "https://mannyc2.github.io/ts-release/schema/release-config.schema.json",
3
- "identity": {
2
+ "$schema": "https://raw.githubusercontent.com/mannyc2/ts-release/main/schema/release-config.schema.json",
3
+ "project": {
4
4
  "name": "@scope/pkg",
5
+ "packageName": "@scope/pkg",
6
+ "repository": "owner/repo",
5
7
  "version": "0.1.0",
6
- "commit": "abc123",
7
8
  "tag": "v0.1.0"
8
9
  },
9
- "artifacts": [
10
- {
11
- "id": "package",
12
- "path": ".",
13
- "format": "directory",
14
- "consumers": ["npm"]
15
- }
16
- ],
17
- "artifactRecipes": [
10
+ "npmPackage": {
11
+ "path": "."
12
+ },
13
+ "builds": [
18
14
  {
19
- "_tag": "BunExecutableArtifactRecipe",
15
+ "builder": "bun",
20
16
  "id": "cli",
21
- "entrypoint": "src/cli.ts",
22
- "outputs": [
23
- {
24
- "id": "cli-linux-x64",
25
- "target": "bun-linux-x64-baseline",
26
- "path": "artifacts/pkg-{version}-linux-x64",
27
- "consumers": ["github"]
28
- },
29
- {
30
- "id": "cli-linux-arm64",
31
- "target": "bun-linux-arm64",
32
- "path": "artifacts/pkg-{version}-linux-arm64",
33
- "consumers": ["github"]
34
- },
35
- {
36
- "id": "cli-darwin-x64",
37
- "target": "bun-darwin-x64",
38
- "path": "artifacts/pkg-{version}-darwin-x64",
39
- "consumers": ["github"]
40
- },
41
- {
42
- "id": "cli-darwin-arm64",
43
- "target": "bun-darwin-arm64",
44
- "path": "artifacts/pkg-{version}-darwin-arm64",
45
- "consumers": ["github"]
46
- },
47
- {
48
- "id": "cli-windows-x64",
49
- "target": "bun-windows-x64-baseline",
50
- "path": "artifacts/pkg-{version}-windows-x64.exe",
51
- "consumers": ["github"]
52
- }
53
- ]
17
+ "entry": "src/cli.ts",
18
+ "targets": [
19
+ "linux-x64",
20
+ "linux-arm64",
21
+ "darwin-x64",
22
+ "darwin-arm64"
23
+ ],
24
+ "output": "artifacts/pkg-{version}-{targetTriple}{ext}"
54
25
  }
55
26
  ],
56
- "targets": [
57
- {
58
- "_tag": "NpmRegistryTarget",
59
- "id": "npm",
60
- "registry": "https://registry.npmjs.org",
61
- "packageName": "@scope/pkg",
62
- "packagePath": ".",
63
- "trustedPublishing": {
64
- "provider": "github-actions",
65
- "workflow": "release.yml",
66
- "packageExists": true,
67
- "verifyPackageExists": true
27
+ "publish": {
28
+ "npm": {
29
+ "registry": "https://registry.npmjs.org/",
30
+ "authentication": {
31
+ "strategy": "trusted-publishing",
32
+ "attestation": {
33
+ "provider": "github-actions",
34
+ "runner": "github-hosted",
35
+ "repository": "owner/repo",
36
+ "workflow": "release.yml",
37
+ "workflowRef": "refs/heads/main",
38
+ "allowedAction": "npm-publish-direct"
39
+ }
68
40
  },
69
41
  "access": "public",
70
- "provenance": true,
71
- "dryRunSupport": "native",
72
- "mutability": "immutable",
73
- "recovery": "publish-new-version"
42
+ "provenance": "automatic"
74
43
  },
75
- {
76
- "_tag": "GitHubReleaseTarget",
77
- "id": "github",
44
+ "github": {
78
45
  "repository": "owner/repo",
79
- "tokenEnv": "GH_TOKEN",
46
+ "tokenEnv": "GITHUB_TOKEN",
80
47
  "draft": true,
81
- "prerelease": false,
82
- "dryRunSupport": "simulated",
83
- "mutability": "mutable-release",
84
- "recovery": "delete-and-recreate"
48
+ "prerelease": false
85
49
  }
86
- ],
87
- "strict": true,
88
- "evidenceDirectory": ".release/evidence/{version}"
50
+ }
89
51
  }