@seasb/metafab 0.0.1 → 2.0.0-next.1

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 (414) hide show
  1. package/README.md +46 -1
  2. package/dist/cli.d.ts +11 -0
  3. package/dist/cli.js +419 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/commands/build.d.ts +31 -0
  6. package/dist/commands/build.js +156 -0
  7. package/dist/commands/build.js.map +1 -0
  8. package/dist/commands/check.d.ts +2 -0
  9. package/dist/commands/check.js +52 -0
  10. package/dist/commands/check.js.map +1 -0
  11. package/dist/commands/create.d.ts +2 -0
  12. package/dist/commands/create.js +75 -0
  13. package/dist/commands/create.js.map +1 -0
  14. package/dist/commands/detach.d.ts +2 -0
  15. package/dist/commands/detach.js +24 -0
  16. package/dist/commands/detach.js.map +1 -0
  17. package/dist/commands/diff.d.ts +2 -0
  18. package/dist/commands/diff.js +35 -0
  19. package/dist/commands/diff.js.map +1 -0
  20. package/dist/commands/env.d.ts +4 -0
  21. package/dist/commands/env.js +362 -0
  22. package/dist/commands/env.js.map +1 -0
  23. package/dist/commands/import.d.ts +2 -0
  24. package/dist/commands/import.js +107 -0
  25. package/dist/commands/import.js.map +1 -0
  26. package/dist/commands/init.d.ts +2 -0
  27. package/dist/commands/init.js +77 -0
  28. package/dist/commands/init.js.map +1 -0
  29. package/dist/commands/map.d.ts +2 -0
  30. package/dist/commands/map.js +42 -0
  31. package/dist/commands/map.js.map +1 -0
  32. package/dist/commands/pipeline-add.d.ts +2 -0
  33. package/dist/commands/pipeline-add.js +68 -0
  34. package/dist/commands/pipeline-add.js.map +1 -0
  35. package/dist/commands/pipeline-remove.d.ts +2 -0
  36. package/dist/commands/pipeline-remove.js +45 -0
  37. package/dist/commands/pipeline-remove.js.map +1 -0
  38. package/dist/commands/publish.d.ts +2 -0
  39. package/dist/commands/publish.js +153 -0
  40. package/dist/commands/publish.js.map +1 -0
  41. package/dist/commands/types.d.ts +45 -0
  42. package/dist/commands/types.js +2 -0
  43. package/dist/commands/types.js.map +1 -0
  44. package/dist/commands/update.d.ts +2 -0
  45. package/dist/commands/update.js +97 -0
  46. package/dist/commands/update.js.map +1 -0
  47. package/dist/core/adopt.d.ts +53 -0
  48. package/dist/core/adopt.js +676 -0
  49. package/dist/core/adopt.js.map +1 -0
  50. package/dist/core/build/agents.d.ts +26 -0
  51. package/dist/core/build/agents.js +67 -0
  52. package/dist/core/build/agents.js.map +1 -0
  53. package/dist/core/build/index.d.ts +5 -0
  54. package/dist/core/build/index.js +6 -0
  55. package/dist/core/build/index.js.map +1 -0
  56. package/dist/core/build/markers.d.ts +34 -0
  57. package/dist/core/build/markers.js +97 -0
  58. package/dist/core/build/markers.js.map +1 -0
  59. package/dist/core/build/plan.d.ts +82 -0
  60. package/dist/core/build/plan.js +912 -0
  61. package/dist/core/build/plan.js.map +1 -0
  62. package/dist/core/build/preview.d.ts +39 -0
  63. package/dist/core/build/preview.js +344 -0
  64. package/dist/core/build/preview.js.map +1 -0
  65. package/dist/core/build/skill.d.ts +99 -0
  66. package/dist/core/build/skill.js +354 -0
  67. package/dist/core/build/skill.js.map +1 -0
  68. package/dist/core/check/drift.d.ts +13 -0
  69. package/dist/core/check/drift.js +205 -0
  70. package/dist/core/check/drift.js.map +1 -0
  71. package/dist/core/check/index.d.ts +16 -0
  72. package/dist/core/check/index.js +84 -0
  73. package/dist/core/check/index.js.map +1 -0
  74. package/dist/core/check/markers.d.ts +9 -0
  75. package/dist/core/check/markers.js +220 -0
  76. package/dist/core/check/markers.js.map +1 -0
  77. package/dist/core/config/destinations.d.ts +5 -0
  78. package/dist/core/config/destinations.js +20 -0
  79. package/dist/core/config/destinations.js.map +1 -0
  80. package/dist/core/config/load.d.ts +4 -0
  81. package/dist/core/config/load.js +41 -0
  82. package/dist/core/config/load.js.map +1 -0
  83. package/dist/core/config/parse.d.ts +8 -0
  84. package/dist/core/config/parse.js +201 -0
  85. package/dist/core/config/parse.js.map +1 -0
  86. package/dist/core/config/source.d.ts +25 -0
  87. package/dist/core/config/source.js +67 -0
  88. package/dist/core/config/source.js.map +1 -0
  89. package/dist/core/config/types.d.ts +48 -0
  90. package/dist/core/config/types.js +2 -0
  91. package/dist/core/config/types.js.map +1 -0
  92. package/dist/core/config/validate.d.ts +11 -0
  93. package/dist/core/config/validate.js +389 -0
  94. package/dist/core/config/validate.js.map +1 -0
  95. package/dist/core/config/writers.d.ts +14 -0
  96. package/dist/core/config/writers.js +269 -0
  97. package/dist/core/config/writers.js.map +1 -0
  98. package/dist/core/config.d.ts +7 -0
  99. package/dist/core/config.js +8 -0
  100. package/dist/core/config.js.map +1 -0
  101. package/dist/core/discovery.d.ts +34 -0
  102. package/dist/core/discovery.js +272 -0
  103. package/dist/core/discovery.js.map +1 -0
  104. package/dist/core/edit/create.d.ts +18 -0
  105. package/dist/core/edit/create.js +190 -0
  106. package/dist/core/edit/create.js.map +1 -0
  107. package/dist/core/edit/document.d.ts +4 -0
  108. package/dist/core/edit/document.js +16 -0
  109. package/dist/core/edit/document.js.map +1 -0
  110. package/dist/core/edit/factory-yaml.d.ts +17 -0
  111. package/dist/core/edit/factory-yaml.js +213 -0
  112. package/dist/core/edit/factory-yaml.js.map +1 -0
  113. package/dist/core/edit/files.d.ts +6 -0
  114. package/dist/core/edit/files.js +47 -0
  115. package/dist/core/edit/files.js.map +1 -0
  116. package/dist/core/edit/index.d.ts +9 -0
  117. package/dist/core/edit/index.js +10 -0
  118. package/dist/core/edit/index.js.map +1 -0
  119. package/dist/core/edit/map.d.ts +24 -0
  120. package/dist/core/edit/map.js +82 -0
  121. package/dist/core/edit/map.js.map +1 -0
  122. package/dist/core/edit/names.d.ts +2 -0
  123. package/dist/core/edit/names.js +17 -0
  124. package/dist/core/edit/names.js.map +1 -0
  125. package/dist/core/edit/paths.d.ts +8 -0
  126. package/dist/core/edit/paths.js +81 -0
  127. package/dist/core/edit/paths.js.map +1 -0
  128. package/dist/core/edit/pipeline.d.ts +19 -0
  129. package/dist/core/edit/pipeline.js +152 -0
  130. package/dist/core/edit/pipeline.js.map +1 -0
  131. package/dist/core/edit/skill.d.ts +1 -0
  132. package/dist/core/edit/skill.js +10 -0
  133. package/dist/core/edit/skill.js.map +1 -0
  134. package/dist/core/env/condition.d.ts +40 -0
  135. package/dist/core/env/condition.js +283 -0
  136. package/dist/core/env/condition.js.map +1 -0
  137. package/dist/core/env/declarations.d.ts +16 -0
  138. package/dist/core/env/declarations.js +328 -0
  139. package/dist/core/env/declarations.js.map +1 -0
  140. package/dist/core/env/directives.d.ts +75 -0
  141. package/dist/core/env/directives.js +429 -0
  142. package/dist/core/env/directives.js.map +1 -0
  143. package/dist/core/env/git-config.d.ts +15 -0
  144. package/dist/core/env/git-config.js +110 -0
  145. package/dist/core/env/git-config.js.map +1 -0
  146. package/dist/core/env/imports.d.ts +60 -0
  147. package/dist/core/env/imports.js +217 -0
  148. package/dist/core/env/imports.js.map +1 -0
  149. package/dist/core/env/index.d.ts +6 -0
  150. package/dist/core/env/index.js +7 -0
  151. package/dist/core/env/index.js.map +1 -0
  152. package/dist/core/env/markdown.d.ts +22 -0
  153. package/dist/core/env/markdown.js +33 -0
  154. package/dist/core/env/markdown.js.map +1 -0
  155. package/dist/core/env/render.d.ts +13 -0
  156. package/dist/core/env/render.js +65 -0
  157. package/dist/core/env/render.js.map +1 -0
  158. package/dist/core/env/report.d.ts +29 -0
  159. package/dist/core/env/report.js +39 -0
  160. package/dist/core/env/report.js.map +1 -0
  161. package/dist/core/env/scenarios.d.ts +40 -0
  162. package/dist/core/env/scenarios.js +124 -0
  163. package/dist/core/env/scenarios.js.map +1 -0
  164. package/dist/core/env/select.d.ts +30 -0
  165. package/dist/core/env/select.js +191 -0
  166. package/dist/core/env/select.js.map +1 -0
  167. package/dist/core/env/types.d.ts +38 -0
  168. package/dist/core/env/types.js +2 -0
  169. package/dist/core/env/types.js.map +1 -0
  170. package/dist/core/env/validate.d.ts +25 -0
  171. package/dist/core/env/validate.js +212 -0
  172. package/dist/core/env/validate.js.map +1 -0
  173. package/dist/core/factory/discovery.d.ts +9 -0
  174. package/dist/core/factory/discovery.js +139 -0
  175. package/dist/core/factory/discovery.js.map +1 -0
  176. package/dist/core/factory/factory-yaml.d.ts +29 -0
  177. package/dist/core/factory/factory-yaml.js +538 -0
  178. package/dist/core/factory/factory-yaml.js.map +1 -0
  179. package/dist/core/factory/index.d.ts +5 -0
  180. package/dist/core/factory/index.js +6 -0
  181. package/dist/core/factory/index.js.map +1 -0
  182. package/dist/core/factory/lines.d.ts +8 -0
  183. package/dist/core/factory/lines.js +11 -0
  184. package/dist/core/factory/lines.js.map +1 -0
  185. package/dist/core/factory/load.d.ts +4 -0
  186. package/dist/core/factory/load.js +83 -0
  187. package/dist/core/factory/load.js.map +1 -0
  188. package/dist/core/factory/requires.d.ts +9 -0
  189. package/dist/core/factory/requires.js +123 -0
  190. package/dist/core/factory/requires.js.map +1 -0
  191. package/dist/core/factory/types.d.ts +58 -0
  192. package/dist/core/factory/types.js +2 -0
  193. package/dist/core/factory/types.js.map +1 -0
  194. package/dist/core/factory/validate.d.ts +44 -0
  195. package/dist/core/factory/validate.js +460 -0
  196. package/dist/core/factory/validate.js.map +1 -0
  197. package/dist/core/hooks/index.d.ts +8 -0
  198. package/dist/core/hooks/index.js +15 -0
  199. package/dist/core/hooks/index.js.map +1 -0
  200. package/dist/core/hooks/script.d.ts +21 -0
  201. package/dist/core/hooks/script.js +34 -0
  202. package/dist/core/hooks/script.js.map +1 -0
  203. package/dist/core/hooks/sync.d.ts +17 -0
  204. package/dist/core/hooks/sync.js +262 -0
  205. package/dist/core/hooks/sync.js.map +1 -0
  206. package/dist/core/import/conflicts.d.ts +82 -0
  207. package/dist/core/import/conflicts.js +256 -0
  208. package/dist/core/import/conflicts.js.map +1 -0
  209. package/dist/core/import/copy.d.ts +10 -0
  210. package/dist/core/import/copy.js +76 -0
  211. package/dist/core/import/copy.js.map +1 -0
  212. package/dist/core/import/file-tree.d.ts +43 -0
  213. package/dist/core/import/file-tree.js +107 -0
  214. package/dist/core/import/file-tree.js.map +1 -0
  215. package/dist/core/import/index.d.ts +5 -0
  216. package/dist/core/import/index.js +6 -0
  217. package/dist/core/import/index.js.map +1 -0
  218. package/dist/core/import/pipeline-changes.d.ts +8 -0
  219. package/dist/core/import/pipeline-changes.js +89 -0
  220. package/dist/core/import/pipeline-changes.js.map +1 -0
  221. package/dist/core/import/run.d.ts +76 -0
  222. package/dist/core/import/run.js +275 -0
  223. package/dist/core/import/run.js.map +1 -0
  224. package/dist/core/init/gitattributes.d.ts +20 -0
  225. package/dist/core/init/gitattributes.js +89 -0
  226. package/dist/core/init/gitattributes.js.map +1 -0
  227. package/dist/core/init/index.d.ts +4 -0
  228. package/dist/core/init/index.js +5 -0
  229. package/dist/core/init/index.js.map +1 -0
  230. package/dist/core/init/name.d.ts +1 -0
  231. package/dist/core/init/name.js +4 -0
  232. package/dist/core/init/name.js.map +1 -0
  233. package/dist/core/init/run.d.ts +51 -0
  234. package/dist/core/init/run.js +261 -0
  235. package/dist/core/init/run.js.map +1 -0
  236. package/dist/core/init/targets.d.ts +17 -0
  237. package/dist/core/init/targets.js +87 -0
  238. package/dist/core/init/targets.js.map +1 -0
  239. package/dist/core/merge.d.ts +88 -0
  240. package/dist/core/merge.js +239 -0
  241. package/dist/core/merge.js.map +1 -0
  242. package/dist/core/publish/exclude.d.ts +9 -0
  243. package/dist/core/publish/exclude.js +32 -0
  244. package/dist/core/publish/exclude.js.map +1 -0
  245. package/dist/core/publish/git-target.d.ts +32 -0
  246. package/dist/core/publish/git-target.js +460 -0
  247. package/dist/core/publish/git-target.js.map +1 -0
  248. package/dist/core/publish/index.d.ts +10 -0
  249. package/dist/core/publish/index.js +11 -0
  250. package/dist/core/publish/index.js.map +1 -0
  251. package/dist/core/publish/npm-target.d.ts +15 -0
  252. package/dist/core/publish/npm-target.js +177 -0
  253. package/dist/core/publish/npm-target.js.map +1 -0
  254. package/dist/core/publish/package-json.d.ts +31 -0
  255. package/dist/core/publish/package-json.js +74 -0
  256. package/dist/core/publish/package-json.js.map +1 -0
  257. package/dist/core/publish/prepare.d.ts +35 -0
  258. package/dist/core/publish/prepare.js +102 -0
  259. package/dist/core/publish/prepare.js.map +1 -0
  260. package/dist/core/publish/provenance.d.ts +1 -0
  261. package/dist/core/publish/provenance.js +20 -0
  262. package/dist/core/publish/provenance.js.map +1 -0
  263. package/dist/core/publish/publish.d.ts +13 -0
  264. package/dist/core/publish/publish.js +143 -0
  265. package/dist/core/publish/publish.js.map +1 -0
  266. package/dist/core/publish/readme.d.ts +22 -0
  267. package/dist/core/publish/readme.js +109 -0
  268. package/dist/core/publish/readme.js.map +1 -0
  269. package/dist/core/publish/stage.d.ts +19 -0
  270. package/dist/core/publish/stage.js +333 -0
  271. package/dist/core/publish/stage.js.map +1 -0
  272. package/dist/core/publish/types.d.ts +71 -0
  273. package/dist/core/publish/types.js +2 -0
  274. package/dist/core/publish/types.js.map +1 -0
  275. package/dist/core/requires/check.d.ts +15 -0
  276. package/dist/core/requires/check.js +83 -0
  277. package/dist/core/requires/check.js.map +1 -0
  278. package/dist/core/requires/index.d.ts +4 -0
  279. package/dist/core/requires/index.js +5 -0
  280. package/dist/core/requires/index.js.map +1 -0
  281. package/dist/core/requires/inspect.d.ts +44 -0
  282. package/dist/core/requires/inspect.js +114 -0
  283. package/dist/core/requires/inspect.js.map +1 -0
  284. package/dist/core/requires/paths.d.ts +29 -0
  285. package/dist/core/requires/paths.js +83 -0
  286. package/dist/core/requires/paths.js.map +1 -0
  287. package/dist/core/requires/setup.d.ts +37 -0
  288. package/dist/core/requires/setup.js +147 -0
  289. package/dist/core/requires/setup.js.map +1 -0
  290. package/dist/core/setup.d.ts +27 -0
  291. package/dist/core/setup.js +84 -0
  292. package/dist/core/setup.js.map +1 -0
  293. package/dist/core/sources/cache.d.ts +38 -0
  294. package/dist/core/sources/cache.js +264 -0
  295. package/dist/core/sources/cache.js.map +1 -0
  296. package/dist/core/sources/containment.d.ts +21 -0
  297. package/dist/core/sources/containment.js +50 -0
  298. package/dist/core/sources/containment.js.map +1 -0
  299. package/dist/core/sources/env.d.ts +12 -0
  300. package/dist/core/sources/env.js +28 -0
  301. package/dist/core/sources/env.js.map +1 -0
  302. package/dist/core/sources/extract.d.ts +25 -0
  303. package/dist/core/sources/extract.js +639 -0
  304. package/dist/core/sources/extract.js.map +1 -0
  305. package/dist/core/sources/git-process.d.ts +26 -0
  306. package/dist/core/sources/git-process.js +51 -0
  307. package/dist/core/sources/git-process.js.map +1 -0
  308. package/dist/core/sources/git.d.ts +41 -0
  309. package/dist/core/sources/git.js +525 -0
  310. package/dist/core/sources/git.js.map +1 -0
  311. package/dist/core/sources/https.d.ts +21 -0
  312. package/dist/core/sources/https.js +218 -0
  313. package/dist/core/sources/https.js.map +1 -0
  314. package/dist/core/sources/index.d.ts +13 -0
  315. package/dist/core/sources/index.js +14 -0
  316. package/dist/core/sources/index.js.map +1 -0
  317. package/dist/core/sources/npm-cli.d.ts +19 -0
  318. package/dist/core/sources/npm-cli.js +51 -0
  319. package/dist/core/sources/npm-cli.js.map +1 -0
  320. package/dist/core/sources/npm.d.ts +29 -0
  321. package/dist/core/sources/npm.js +411 -0
  322. package/dist/core/sources/npm.js.map +1 -0
  323. package/dist/core/sources/parse.d.ts +46 -0
  324. package/dist/core/sources/parse.js +446 -0
  325. package/dist/core/sources/parse.js.map +1 -0
  326. package/dist/core/sources/path.d.ts +10 -0
  327. package/dist/core/sources/path.js +331 -0
  328. package/dist/core/sources/path.js.map +1 -0
  329. package/dist/core/sources/problems.d.ts +29 -0
  330. package/dist/core/sources/problems.js +36 -0
  331. package/dist/core/sources/problems.js.map +1 -0
  332. package/dist/core/sources/redact.d.ts +2 -0
  333. package/dist/core/sources/redact.js +70 -0
  334. package/dist/core/sources/redact.js.map +1 -0
  335. package/dist/core/sources/resolve.d.ts +9 -0
  336. package/dist/core/sources/resolve.js +29 -0
  337. package/dist/core/sources/resolve.js.map +1 -0
  338. package/dist/core/sources/types.d.ts +86 -0
  339. package/dist/core/sources/types.js +2 -0
  340. package/dist/core/sources/types.js.map +1 -0
  341. package/dist/core/sources/validate.d.ts +9 -0
  342. package/dist/core/sources/validate.js +116 -0
  343. package/dist/core/sources/validate.js.map +1 -0
  344. package/dist/core/summary.d.ts +79 -0
  345. package/dist/core/summary.js +411 -0
  346. package/dist/core/summary.js.map +1 -0
  347. package/dist/core/update/clashes.d.ts +63 -0
  348. package/dist/core/update/clashes.js +192 -0
  349. package/dist/core/update/clashes.js.map +1 -0
  350. package/dist/core/update/detach.d.ts +21 -0
  351. package/dist/core/update/detach.js +38 -0
  352. package/dist/core/update/detach.js.map +1 -0
  353. package/dist/core/update/diff.d.ts +58 -0
  354. package/dist/core/update/diff.js +180 -0
  355. package/dist/core/update/diff.js.map +1 -0
  356. package/dist/core/update/fetch.d.ts +34 -0
  357. package/dist/core/update/fetch.js +73 -0
  358. package/dist/core/update/fetch.js.map +1 -0
  359. package/dist/core/update/index.d.ts +6 -0
  360. package/dist/core/update/index.js +7 -0
  361. package/dist/core/update/index.js.map +1 -0
  362. package/dist/core/update/restore.d.ts +20 -0
  363. package/dist/core/update/restore.js +195 -0
  364. package/dist/core/update/restore.js.map +1 -0
  365. package/dist/core/update/run.d.ts +113 -0
  366. package/dist/core/update/run.js +1135 -0
  367. package/dist/core/update/run.js.map +1 -0
  368. package/dist/core/update/select.d.ts +39 -0
  369. package/dist/core/update/select.js +157 -0
  370. package/dist/core/update/select.js.map +1 -0
  371. package/dist/core/update/spelling.d.ts +51 -0
  372. package/dist/core/update/spelling.js +185 -0
  373. package/dist/core/update/spelling.js.map +1 -0
  374. package/dist/core/update/trees.d.ts +24 -0
  375. package/dist/core/update/trees.js +72 -0
  376. package/dist/core/update/trees.js.map +1 -0
  377. package/dist/errors.d.ts +39 -0
  378. package/dist/errors.js +24 -0
  379. package/dist/errors.js.map +1 -0
  380. package/dist/help.d.ts +51 -0
  381. package/dist/help.js +117 -0
  382. package/dist/help.js.map +1 -0
  383. package/dist/input.d.ts +25 -0
  384. package/dist/input.js +174 -0
  385. package/dist/input.js.map +1 -0
  386. package/dist/output.d.ts +21 -0
  387. package/dist/output.js +37 -0
  388. package/dist/output.js.map +1 -0
  389. package/dist/util/frontmatter.d.ts +12 -0
  390. package/dist/util/frontmatter.js +58 -0
  391. package/dist/util/frontmatter.js.map +1 -0
  392. package/dist/util/fs.d.ts +38 -0
  393. package/dist/util/fs.js +135 -0
  394. package/dist/util/fs.js.map +1 -0
  395. package/dist/util/git-names.d.ts +8 -0
  396. package/dist/util/git-names.js +25 -0
  397. package/dist/util/git-names.js.map +1 -0
  398. package/dist/util/git.d.ts +12 -0
  399. package/dist/util/git.js +33 -0
  400. package/dist/util/git.js.map +1 -0
  401. package/dist/util/suggest.d.ts +6 -0
  402. package/dist/util/suggest.js +48 -0
  403. package/dist/util/suggest.js.map +1 -0
  404. package/dist/util/text.d.ts +8 -0
  405. package/dist/util/text.js +19 -0
  406. package/dist/util/text.js.map +1 -0
  407. package/dist/util/version.d.ts +7 -0
  408. package/dist/util/version.js +13 -0
  409. package/dist/util/version.js.map +1 -0
  410. package/dist/util/yaml.d.ts +30 -0
  411. package/dist/util/yaml.js +201 -0
  412. package/dist/util/yaml.js.map +1 -0
  413. package/package.json +51 -3
  414. package/resources/metafab-skill/SKILL.md +173 -0
@@ -0,0 +1,446 @@
1
+ import { homedir } from "node:os";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import validateNpmPackageName from "validate-npm-package-name";
5
+ import { ExitCode, MetafabError } from "../../errors.js";
6
+ import { sourceProblemFile } from "./problems.js";
7
+ import { redact, stripSourceCredentials } from "./redact.js";
8
+ const GITHUB_PATTERN = /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;
9
+ const DRIVE_PATH = /^[A-Za-z]:[\\/]/;
10
+ const UNC_PATH = /^\\\\/;
11
+ // Git's own test for the scp-like form: the first colon must come before any
12
+ // slash (so `host:path` is scp but `host/path:x` is not), and a Windows drive
13
+ // path is a path, never a host. The user is required so a drive-relative path
14
+ // such as `C:fab` is never mistaken for a repository.
15
+ const SCP_GIT = /^([A-Za-z0-9_.-]+@[A-Za-z0-9_.-]+):(.+)$/;
16
+ const SCHEME = /^([A-Za-z][A-Za-z0-9+.-]*):\/\//;
17
+ const ANY_SCHEME = /^([A-Za-z][A-Za-z0-9+.-]*):/;
18
+ const SUPPORTED_SOURCES = "an npm name, github:owner/repo, git+https://, git+ssh://, ssh://, git@host:path, git+file:///<path>, an https:// tarball, or a local path";
19
+ const GIT_SOURCE_FIX = "Use git+https://, git+ssh://, git+file://, ssh://, user@host:path or github:owner/repo for a Git repository, an https:// URL for a tarball, an npm name, or a local path";
20
+ const WINDOWS_PATH_FIX = "Write the path as C:\\fabs\\acme or C:/fabs/acme";
21
+ export function isScpGit(value) {
22
+ if (DRIVE_PATH.test(value))
23
+ return false;
24
+ const colon = value.indexOf(":");
25
+ if (colon <= 0)
26
+ return false;
27
+ const slash = value.indexOf("/");
28
+ if (slash !== -1 && slash < colon)
29
+ return false;
30
+ return SCP_GIT.test(value);
31
+ }
32
+ function invalidSource(input, reason) {
33
+ const message = `Invalid source "${redact(input)}": ${reason}`;
34
+ return new MetafabError(message, {
35
+ exitCode: ExitCode.Failed,
36
+ code: "invalid-source",
37
+ problems: [
38
+ {
39
+ level: "error",
40
+ file: sourceProblemFile(input),
41
+ message,
42
+ fix: `Use ${SUPPORTED_SOURCES}`,
43
+ },
44
+ ],
45
+ });
46
+ }
47
+ function isPathLike(value) {
48
+ return (value.startsWith(".") ||
49
+ value.startsWith("/") ||
50
+ value.startsWith("\\") ||
51
+ value.startsWith("~") ||
52
+ DRIVE_PATH.test(value) ||
53
+ UNC_PATH.test(value));
54
+ }
55
+ function expandHome(value) {
56
+ if (value === "~")
57
+ return homedir();
58
+ if (value.startsWith("~/") || value.startsWith("~\\")) {
59
+ return path.join(homedir(), value.slice(2));
60
+ }
61
+ return value;
62
+ }
63
+ function resolvePath(value, cwd) {
64
+ if (DRIVE_PATH.test(value) || UNC_PATH.test(value)) {
65
+ return path.win32.resolve(value);
66
+ }
67
+ if (/^file:\/\/[^/]/i.test(value)) {
68
+ throw invalidSource(value, "a file URL must use three slashes");
69
+ }
70
+ if (/^file:\/\//i.test(value)) {
71
+ try {
72
+ return fileURLToPath(new URL(value));
73
+ }
74
+ catch {
75
+ throw invalidSource(value, "the file URL is not valid");
76
+ }
77
+ }
78
+ return path.resolve(cwd, expandHome(value));
79
+ }
80
+ function parseGitRef(raw, input) {
81
+ if (raw === undefined)
82
+ return undefined;
83
+ if (raw === "")
84
+ throw invalidSource(input, "the Git ref is empty");
85
+ if (raw.startsWith("semver:")) {
86
+ const range = raw.slice("semver:".length);
87
+ if (range === "")
88
+ throw invalidSource(input, "the semver range is empty");
89
+ return { type: "range", range };
90
+ }
91
+ return { type: "name", name: raw };
92
+ }
93
+ function splitRef(value) {
94
+ const index = value.lastIndexOf("#");
95
+ if (index === -1)
96
+ return { base: value };
97
+ return { base: value.slice(0, index), ref: value.slice(index + 1) };
98
+ }
99
+ function parseGithub(input) {
100
+ const { base, ref } = splitRef(input);
101
+ const repository = base.slice("github:".length);
102
+ if (!GITHUB_PATTERN.test(repository)) {
103
+ throw invalidSource(input, "expected github:owner/repo");
104
+ }
105
+ const withoutGit = repository.endsWith(".git") ? repository.slice(0, -".git".length) : repository;
106
+ return {
107
+ kind: "git",
108
+ url: `https://github.com/${withoutGit}.git`,
109
+ source: `github:${repository}`,
110
+ ...(ref === undefined ? {} : { ref: parseGitRef(ref, input) }),
111
+ };
112
+ }
113
+ // A Windows drive path after the `file://` authority, with either slash:
114
+ // `C:\fabs\fab.git` or `/C:/fabs/fab.git`.
115
+ const DRIVE_AFTER_AUTHORITY = /^\/?([A-Za-z]:[\\/].*)$/;
116
+ /**
117
+ * The `file://` URL Git reads for the text after the authority. Git's parser
118
+ * needs a `/` after the authority: a backslash path gives it no path at all
119
+ * (`file://C:\fabs\fab.git` fails with "no path specified"). Both accepted
120
+ * Windows spellings therefore become the three-slash forward-slash form.
121
+ */
122
+ function drivePathFileUrl(after) {
123
+ const match = DRIVE_AFTER_AUTHORITY.exec(after);
124
+ if (match === null)
125
+ return undefined;
126
+ return `file:///${match[1].replace(/\\/g, "/")}`;
127
+ }
128
+ /**
129
+ * The three-slash `file://` URL Git reads for a `localhost` authority, with or
130
+ * without userinfo (`file://localhost/srv/fab.git` and the credential form
131
+ * `file://user:pw@localhost/srv/fab.git`). `localhost` names this machine, so
132
+ * the path after it is the local path and the userinfo has nothing to
133
+ * authenticate. Windows reads `file://host/…` as a UNC path, where `localhost`
134
+ * would be the server and a userinfo part of its name, so the authority cannot
135
+ * stay.
136
+ */
137
+ function localhostFileUrl(after) {
138
+ const withoutUserinfo = stripFileUserinfo(`file://${after}`).slice("file://".length);
139
+ if (!/^localhost\//i.test(withoutUserinfo))
140
+ return undefined;
141
+ const path = withoutUserinfo.slice("localhost".length);
142
+ const drive = DRIVE_AFTER_AUTHORITY.exec(path);
143
+ return drive === null
144
+ ? `file://${path}`
145
+ : `file:///${drive[1].replace(/\\/g, "/")}`;
146
+ }
147
+ /**
148
+ * What follows `//` in a `file:` or `git+file:` URL: a path, no path, or a
149
+ * host. `localhost` is Git's name for this machine, so `localhost` with nothing
150
+ * after it names no path at all, just as `""` and a run of slashes do. The
151
+ * authority rule lives here so `check` and `import` cannot disagree about it.
152
+ */
153
+ export function fileUrlAuthority(after) {
154
+ if (after === "" || /^\/+$/.test(after))
155
+ return "empty";
156
+ if (/^localhost$/i.test(after) || /^localhost\/+$/i.test(after))
157
+ return "empty";
158
+ if (after.startsWith("/"))
159
+ return "path";
160
+ if (/^localhost\//i.test(after))
161
+ return "path";
162
+ if (DRIVE_PATH.test(after))
163
+ return "path";
164
+ return "host";
165
+ }
166
+ /**
167
+ * A `git+file://` source is a Git repository on this machine or a mounted
168
+ * share, such as the bare fab repository `publish.git: file:///…` writes. The
169
+ * path must be absolute, so `update` can re-parse the recorded source from
170
+ * another working directory: three slashes, `localhost`, or a Windows drive.
171
+ * The URL Git is given is `file:` plus the text after `git+file:`, except that
172
+ * a Windows drive path becomes the three-slash form Git reads; re-serialising
173
+ * the rest through `new URL()` would change the recorded source and the mirror
174
+ * key.
175
+ */
176
+ function parseGitFileUrl(input) {
177
+ const { base, ref } = splitRef(input);
178
+ const rest = base.slice("git+file:".length);
179
+ if (!rest.startsWith("//")) {
180
+ throw invalidSource(input, "a Git file URL must be absolute, such as git+file:///srv/fabs/fab.git");
181
+ }
182
+ const after = rest.slice(2);
183
+ const authority = fileUrlAuthority(after);
184
+ if (authority === "empty") {
185
+ throw invalidSource(input, "the Git file URL has no path");
186
+ }
187
+ if (authority === "host") {
188
+ throw invalidSource(input, "a Git file URL cannot name a host; use git+file:///<absolute path>");
189
+ }
190
+ return {
191
+ kind: "git",
192
+ url: drivePathFileUrl(after) ?? `file:${rest}`,
193
+ source: base,
194
+ ...(ref === undefined ? {} : { ref: parseGitRef(ref, input) }),
195
+ };
196
+ }
197
+ function schemeHint(scheme) {
198
+ // A one-letter scheme is a Windows drive with no slash after it: `C:fab` is
199
+ // drive-relative, so it cannot name a repository.
200
+ if (/^[a-z]$/.test(scheme)) {
201
+ return "A Windows path needs a slash after the drive, such as C:\\fabs\\acme";
202
+ }
203
+ if (scheme === "http")
204
+ return "Use https:// for a tarball or git+https:// for a Git repository";
205
+ if (scheme === "git" || scheme === "git+http")
206
+ return "Use git+https:// or git+ssh://";
207
+ return undefined;
208
+ }
209
+ /**
210
+ * Every value that looks like a URL scheme but is not a supported source is
211
+ * refused with the list of forms `import` reads, instead of falling through to
212
+ * the npm package-name parser and its unhelpful error. Unlike `invalidSource`,
213
+ * this carries a problem with a fix line, so the CLI prints what to write
214
+ * instead.
215
+ */
216
+ function unsupportedScheme(input, rawScheme) {
217
+ const shown = redact(input);
218
+ const scheme = rawScheme.toLowerCase();
219
+ const hint = schemeHint(scheme);
220
+ const message = `Invalid source "${shown}": unsupported URL scheme "${scheme}:". ` +
221
+ `Supported sources: ${SUPPORTED_SOURCES}${hint === undefined ? "" : `. ${hint}`}`;
222
+ const fix = /^[a-z]$/.test(scheme) ? WINDOWS_PATH_FIX : GIT_SOURCE_FIX;
223
+ return new MetafabError(message, {
224
+ exitCode: ExitCode.Failed,
225
+ code: "invalid-source",
226
+ problems: [{ level: "error", file: sourceProblemFile(shown), message, fix }],
227
+ });
228
+ }
229
+ function parseGitUrl(input, prefix) {
230
+ const { base, ref } = splitRef(input);
231
+ const rawUrl = base.slice(prefix.length);
232
+ let parsed;
233
+ try {
234
+ parsed = new URL(rawUrl);
235
+ }
236
+ catch {
237
+ throw invalidSource(input, "the Git URL is not valid");
238
+ }
239
+ if (parsed.hostname === "")
240
+ throw invalidSource(input, "the Git URL has no host");
241
+ // Git compares the scheme of the URL it is handed case-sensitively, so a
242
+ // source typed as `git+HTTPS://…` would reach it as an unknown protocol.
243
+ // Lower-case only the scheme; keep the rest of the text byte for byte, and
244
+ // record `source` exactly as the user wrote it.
245
+ const schemeEnd = rawUrl.indexOf("://");
246
+ const url = `${rawUrl.slice(0, schemeEnd).toLowerCase()}${rawUrl.slice(schemeEnd)}`;
247
+ return {
248
+ kind: "git",
249
+ url,
250
+ source: base,
251
+ ...(ref === undefined ? {} : { ref: parseGitRef(ref, input) }),
252
+ };
253
+ }
254
+ function parseScpGit(input) {
255
+ const { base, ref } = splitRef(input);
256
+ if (!isScpGit(base)) {
257
+ throw invalidSource(input, "the Git URL is not valid");
258
+ }
259
+ // Keep the scp string as the URL: Git accepts it as written, and rewriting
260
+ // it to `ssh://host/path` would turn the scp form's home-relative path into
261
+ // an absolute one.
262
+ return {
263
+ kind: "git",
264
+ url: base,
265
+ source: base,
266
+ ...(ref === undefined ? {} : { ref: parseGitRef(ref, input) }),
267
+ };
268
+ }
269
+ function parseHttps(input) {
270
+ let parsed;
271
+ try {
272
+ parsed = new URL(input);
273
+ }
274
+ catch {
275
+ throw invalidSource(input, "the HTTPS URL is not valid");
276
+ }
277
+ if (parsed.protocol !== "https:" || parsed.hostname === "") {
278
+ throw invalidSource(input, "expected an https URL");
279
+ }
280
+ return { kind: "https", url: input };
281
+ }
282
+ function splitNpm(value, input) {
283
+ let name = value;
284
+ let requested;
285
+ if (value.startsWith("@")) {
286
+ const slash = value.indexOf("/");
287
+ if (slash === -1)
288
+ throw invalidSource(input, "expected an npm package name or @scope/name");
289
+ const at = value.indexOf("@", slash);
290
+ if (at !== -1) {
291
+ name = value.slice(0, at);
292
+ requested = value.slice(at + 1);
293
+ }
294
+ }
295
+ else {
296
+ const at = value.indexOf("@");
297
+ if (at > 0) {
298
+ name = value.slice(0, at);
299
+ requested = value.slice(at + 1);
300
+ }
301
+ }
302
+ if (name === "")
303
+ throw invalidSource(input, "the npm package name is empty");
304
+ const result = validateNpmPackageName(name);
305
+ if (!result.validForOldPackages) {
306
+ const reason = result.errors?.[0] ?? "the npm package name is not valid";
307
+ throw invalidSource(input, reason);
308
+ }
309
+ if (requested !== undefined) {
310
+ if (requested === "")
311
+ throw invalidSource(input, "the npm range is empty");
312
+ if (/[/\\:#]/.test(requested)) {
313
+ throw invalidSource(input, "the npm range is not valid");
314
+ }
315
+ }
316
+ return requested === undefined ? { name } : { name, requested };
317
+ }
318
+ export function parseSource(input, options) {
319
+ const value = input.trim();
320
+ if (value === "")
321
+ throw invalidSource(input, "the source is empty");
322
+ if (/^git\+file:/i.test(value))
323
+ return parseGitFileUrl(value);
324
+ if (/^file:/i.test(value)) {
325
+ const withoutProtocol = value.slice("file:".length);
326
+ if (withoutProtocol === "")
327
+ throw invalidSource(input, "the file source is empty");
328
+ return {
329
+ kind: "path",
330
+ path: resolvePath(/^file:\/\//i.test(value) ? value : withoutProtocol, options.cwd),
331
+ source: value,
332
+ };
333
+ }
334
+ if (isPathLike(value)) {
335
+ return { kind: "path", path: resolvePath(value, options.cwd), source: value };
336
+ }
337
+ if (/^github:/i.test(value))
338
+ return parseGithub(value);
339
+ if (isScpGit(value))
340
+ return parseScpGit(value);
341
+ if (/^ssh:\/\//i.test(value))
342
+ return parseGitUrl(value, "");
343
+ if (/^git\+ssh:\/\//i.test(value))
344
+ return parseGitUrl(value, "git+");
345
+ if (/^git\+https:\/\//i.test(value))
346
+ return parseGitUrl(value, "git+");
347
+ if (/^https:\/\//i.test(value))
348
+ return parseHttps(value);
349
+ // An npm name never contains `:`, and the scp and path forms above have
350
+ // already claimed `git@host:path` and `C:\…` or `C:/…`.
351
+ const scheme = ANY_SCHEME.exec(value);
352
+ if (scheme !== null)
353
+ throw unsupportedScheme(input, scheme[1]);
354
+ const npm = splitNpm(value, input);
355
+ return npm.requested === undefined
356
+ ? { kind: "npm", name: npm.name }
357
+ : { kind: "npm", name: npm.name, requested: npm.requested };
358
+ }
359
+ /**
360
+ * The URL to hand to Git: `git+https://`, `git+ssh://` and `git+file://` lose
361
+ * `git+`. The scheme is lower-cased because Git compares it case-sensitively,
362
+ * and the rest of the text is kept byte for byte. An scp form has no scheme
363
+ * with `//`, so it is returned unchanged. A `file://` URL that names this
364
+ * machine is turned into the three-slash form Git reads, as `parseGitFileUrl`
365
+ * does: a Windows drive path written after `//` (`file://C:/…`), and a
366
+ * `localhost` authority, which loses its userinfo
367
+ * (`file://user:pw@localhost/…`). Windows reads `file://host/…` as a UNC path,
368
+ * so there `localhost` would name a server and the userinfo its name.
369
+ */
370
+ export function gitTransportUrl(url) {
371
+ const match = SCHEME.exec(url);
372
+ if (match === null)
373
+ return url;
374
+ const scheme = match[1].replace(/^git\+/i, "").toLowerCase();
375
+ const after = url.slice(match[0].length);
376
+ const fileUrl = scheme === "file" ? (drivePathFileUrl(after) ?? localhostFileUrl(after)) : undefined;
377
+ return fileUrl ?? `${scheme}://${after}`;
378
+ }
379
+ // A `file:` URL whose text after `//` is a Windows drive path. Only here is the
380
+ // "authority" really the start of a path, so only here is a `@` not userinfo.
381
+ const FILE_DRIVE_AUTHORITY = /^(?:git\+)?file:\/\/[A-Za-z]:[\\/]/i;
382
+ const FILE_URL = /^(?:git\+)?file:\/\//i;
383
+ /**
384
+ * A `file:` URL that names an authority (`file://localhost/…`, and the form
385
+ * `file://user:pw@localhost/…` that carries credentials) loses the whole
386
+ * userinfo, not only the password: `parseGitFileUrl` accepts no host but an
387
+ * empty one, `localhost` or a drive, so a username left in place would make
388
+ * the recorded source, and the `import` line in a published README, fail to
389
+ * parse. The `@` kept for ssh is not useful here, and the username is not
390
+ * something to write down either.
391
+ */
392
+ function stripFileUserinfo(source) {
393
+ const file = FILE_URL.exec(source);
394
+ if (file === null)
395
+ return source;
396
+ const start = file[0].length;
397
+ const slash = source.indexOf("/", start);
398
+ const end = slash === -1 ? source.length : slash;
399
+ const at = source.lastIndexOf("@", end - 1);
400
+ if (at < start)
401
+ return source;
402
+ return source.slice(0, start) + source.slice(at + 1);
403
+ }
404
+ /**
405
+ * The source to record or key on: the value without credentials, except for a
406
+ * `file:` URL written with a Windows drive right after `//`
407
+ * (`file://C:\Users\bob@corp\fab.git`). There the authority is really the
408
+ * start of a path, so stripping would cut the `@` in the path as if it were
409
+ * userinfo and the recorded source would no longer parse. A `file:` URL that
410
+ * does name an authority (`file://user:pw@localhost/…`) loses all of its
411
+ * userinfo, so the recorded source stays a `file:` URL `import` accepts. Every
412
+ * other form keeps `stripSourceCredentials`.
413
+ */
414
+ export function sourceWithoutCredentials(source) {
415
+ if (FILE_DRIVE_AUTHORITY.test(source))
416
+ return source;
417
+ if (FILE_URL.test(source))
418
+ return stripFileUserinfo(source);
419
+ return stripSourceCredentials(source);
420
+ }
421
+ /**
422
+ * The source `import` accepts for a URL Git accepts: `https://` and `file://`
423
+ * gain `git+`, and a `#` in the text after `://` becomes `%23`, because a
424
+ * source splits a `#` off as the ref: the repository `/srv/my#fab.git` would
425
+ * otherwise be imported as `/srv/my` at ref `fab.git`. Git decodes `%23` in an
426
+ * `ssh://` and a `file://` URL, so the line names the repository publish wrote.
427
+ * An scp URL has no `://` and is returned unchanged, and a `%23` already there
428
+ * is left alone.
429
+ */
430
+ export function importSourceForGitUrl(url) {
431
+ const match = SCHEME.exec(url);
432
+ if (match === null)
433
+ return url;
434
+ const scheme = match[1].toLowerCase();
435
+ const bare = scheme.replace(/^git\+/, "");
436
+ const rest = url.slice(match[0].length);
437
+ const path = rest.replace(/#/g, "%23");
438
+ if (scheme !== "https" && bare !== "file") {
439
+ // Already a form `import` reads: only a `#` changes, so the text stays
440
+ // byte for byte when there is none.
441
+ return path === rest ? url : `${url.slice(0, match[0].length)}${path}`;
442
+ }
443
+ const imported = scheme.startsWith("git+") ? scheme : `git+${scheme}`;
444
+ return `${imported}://${path}`;
445
+ }
446
+ //# sourceMappingURL=parse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../src/core/sources/parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAO7D,MAAM,cAAc,GAAG,oCAAoC,CAAC;AAC5D,MAAM,UAAU,GAAG,iBAAiB,CAAC;AACrC,MAAM,QAAQ,GAAG,OAAO,CAAC;AACzB,6EAA6E;AAC7E,8EAA8E;AAC9E,8EAA8E;AAC9E,sDAAsD;AACtD,MAAM,OAAO,GAAG,0CAA0C,CAAC;AAC3D,MAAM,MAAM,GAAG,iCAAiC,CAAC;AACjD,MAAM,UAAU,GAAG,6BAA6B,CAAC;AAEjD,MAAM,iBAAiB,GACrB,2IAA2I,CAAC;AAC9I,MAAM,cAAc,GAClB,0KAA0K,CAAC;AAC7K,MAAM,gBAAgB,GAAG,kDAAkD,CAAC;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xEntries?: number;
7
+ maxTotalSize?: number;
8
+ }
9
+ export declare function locateFactoryDir(specPath: string): Promise<string>;
10
+ export declare function fetchPath(source: ResolvedPath, options?: PathOptions): Promise<FetchedFab>;