@uapkg/cli 1.3.0 → 1.3.2

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 (412) hide show
  1. package/dist/app/CompositionRoot.d.ts +36 -33
  2. package/dist/app/CompositionRoot.d.ts.map +1 -1
  3. package/dist/app/CompositionRoot.js +91 -109
  4. package/dist/app/CompositionRoot.js.map +1 -1
  5. package/dist/app/UAPKGApplication.d.ts +6 -3
  6. package/dist/app/UAPKGApplication.d.ts.map +1 -1
  7. package/dist/app/UAPKGApplication.js +155 -169
  8. package/dist/app/UAPKGApplication.js.map +1 -1
  9. package/dist/build/BuildMetadata.d.ts +9 -6
  10. package/dist/build/BuildMetadata.d.ts.map +1 -1
  11. package/dist/build/BuildMetadata.js +2 -2
  12. package/dist/cli/UAPKGCommandLine.d.ts +259 -257
  13. package/dist/cli/UAPKGCommandLine.d.ts.map +1 -1
  14. package/dist/cli/UAPKGCommandLine.js +248 -239
  15. package/dist/cli/UAPKGCommandLine.js.map +1 -1
  16. package/dist/cli/parseCommandLine.d.ts +5 -1
  17. package/dist/cli/parseCommandLine.d.ts.map +1 -1
  18. package/dist/cli/parseCommandLine.js +8 -3
  19. package/dist/cli/parseCommandLine.js.map +1 -1
  20. package/dist/cli/parsing/UAPKGCommandLineParser.d.ts +9 -6
  21. package/dist/cli/parsing/UAPKGCommandLineParser.d.ts.map +1 -1
  22. package/dist/cli/parsing/UAPKGCommandLineParser.js +23 -31
  23. package/dist/cli/parsing/UAPKGCommandLineParser.js.map +1 -1
  24. package/dist/cli/parsing/UAPKGParserRegistry.d.ts +12 -9
  25. package/dist/cli/parsing/UAPKGParserRegistry.d.ts.map +1 -1
  26. package/dist/cli/parsing/UAPKGParserRegistry.js +53 -50
  27. package/dist/cli/parsing/UAPKGParserRegistry.js.map +1 -1
  28. package/dist/cli/parsing/contracts/UAPKGCommandModule.d.ts +9 -6
  29. package/dist/cli/parsing/contracts/UAPKGCommandModule.d.ts.map +1 -1
  30. package/dist/cli/parsing/contracts/UAPKGCommandModule.js +1 -2
  31. package/dist/cli/parsing/modules/AddCommandModule.d.ts +8 -5
  32. package/dist/cli/parsing/modules/AddCommandModule.d.ts.map +1 -1
  33. package/dist/cli/parsing/modules/AddCommandModule.js +49 -36
  34. package/dist/cli/parsing/modules/AddCommandModule.js.map +1 -1
  35. package/dist/cli/parsing/modules/ConfigCommandModule.d.ts +8 -5
  36. package/dist/cli/parsing/modules/ConfigCommandModule.d.ts.map +1 -1
  37. package/dist/cli/parsing/modules/ConfigCommandModule.js +87 -83
  38. package/dist/cli/parsing/modules/ConfigCommandModule.js.map +1 -1
  39. package/dist/cli/parsing/modules/InitCommandModule.d.ts +8 -5
  40. package/dist/cli/parsing/modules/InitCommandModule.d.ts.map +1 -1
  41. package/dist/cli/parsing/modules/InitCommandModule.js +25 -22
  42. package/dist/cli/parsing/modules/InitCommandModule.js.map +1 -1
  43. package/dist/cli/parsing/modules/InstallCommandModule.d.ts +8 -5
  44. package/dist/cli/parsing/modules/InstallCommandModule.d.ts.map +1 -1
  45. package/dist/cli/parsing/modules/InstallCommandModule.js +36 -28
  46. package/dist/cli/parsing/modules/InstallCommandModule.js.map +1 -1
  47. package/dist/cli/parsing/modules/LifecycleCommandModule.d.ts +8 -5
  48. package/dist/cli/parsing/modules/LifecycleCommandModule.d.ts.map +1 -1
  49. package/dist/cli/parsing/modules/LifecycleCommandModule.js +78 -50
  50. package/dist/cli/parsing/modules/LifecycleCommandModule.js.map +1 -1
  51. package/dist/cli/parsing/modules/ListCommandModule.d.ts +8 -5
  52. package/dist/cli/parsing/modules/ListCommandModule.d.ts.map +1 -1
  53. package/dist/cli/parsing/modules/ListCommandModule.js +26 -15
  54. package/dist/cli/parsing/modules/ListCommandModule.js.map +1 -1
  55. package/dist/cli/parsing/modules/LoginCommandModule.d.ts +8 -5
  56. package/dist/cli/parsing/modules/LoginCommandModule.d.ts.map +1 -1
  57. package/dist/cli/parsing/modules/LoginCommandModule.js +34 -33
  58. package/dist/cli/parsing/modules/LoginCommandModule.js.map +1 -1
  59. package/dist/cli/parsing/modules/LogoutCommandModule.d.ts +8 -5
  60. package/dist/cli/parsing/modules/LogoutCommandModule.d.ts.map +1 -1
  61. package/dist/cli/parsing/modules/LogoutCommandModule.js +30 -28
  62. package/dist/cli/parsing/modules/LogoutCommandModule.js.map +1 -1
  63. package/dist/cli/parsing/modules/OutdatedCommandModule.d.ts +8 -5
  64. package/dist/cli/parsing/modules/OutdatedCommandModule.d.ts.map +1 -1
  65. package/dist/cli/parsing/modules/OutdatedCommandModule.js +21 -16
  66. package/dist/cli/parsing/modules/OutdatedCommandModule.js.map +1 -1
  67. package/dist/cli/parsing/modules/PackCommandModule.d.ts +8 -5
  68. package/dist/cli/parsing/modules/PackCommandModule.d.ts.map +1 -1
  69. package/dist/cli/parsing/modules/PackCommandModule.js +30 -28
  70. package/dist/cli/parsing/modules/PackCommandModule.js.map +1 -1
  71. package/dist/cli/parsing/modules/ProjectGetNameCommandModule.d.ts +8 -5
  72. package/dist/cli/parsing/modules/ProjectGetNameCommandModule.d.ts.map +1 -1
  73. package/dist/cli/parsing/modules/ProjectGetNameCommandModule.js +14 -11
  74. package/dist/cli/parsing/modules/ProjectGetNameCommandModule.js.map +1 -1
  75. package/dist/cli/parsing/modules/PublishCommandModule.d.ts +8 -5
  76. package/dist/cli/parsing/modules/PublishCommandModule.d.ts.map +1 -1
  77. package/dist/cli/parsing/modules/PublishCommandModule.js +63 -47
  78. package/dist/cli/parsing/modules/PublishCommandModule.js.map +1 -1
  79. package/dist/cli/parsing/modules/RegistryCommandModule.d.ts +8 -5
  80. package/dist/cli/parsing/modules/RegistryCommandModule.d.ts.map +1 -1
  81. package/dist/cli/parsing/modules/RegistryCommandModule.js +117 -120
  82. package/dist/cli/parsing/modules/RegistryCommandModule.js.map +1 -1
  83. package/dist/cli/parsing/modules/RemoveCommandModule.d.ts +8 -5
  84. package/dist/cli/parsing/modules/RemoveCommandModule.d.ts.map +1 -1
  85. package/dist/cli/parsing/modules/RemoveCommandModule.js +25 -14
  86. package/dist/cli/parsing/modules/RemoveCommandModule.js.map +1 -1
  87. package/dist/cli/parsing/modules/RequestsCommandModule.d.ts +8 -5
  88. package/dist/cli/parsing/modules/RequestsCommandModule.d.ts.map +1 -1
  89. package/dist/cli/parsing/modules/RequestsCommandModule.js +56 -60
  90. package/dist/cli/parsing/modules/RequestsCommandModule.js.map +1 -1
  91. package/dist/cli/parsing/modules/UpdateCommandModule.d.ts +8 -5
  92. package/dist/cli/parsing/modules/UpdateCommandModule.d.ts.map +1 -1
  93. package/dist/cli/parsing/modules/UpdateCommandModule.js +38 -25
  94. package/dist/cli/parsing/modules/UpdateCommandModule.js.map +1 -1
  95. package/dist/cli/parsing/modules/WhoamiCommandModule.d.ts +8 -5
  96. package/dist/cli/parsing/modules/WhoamiCommandModule.d.ts.map +1 -1
  97. package/dist/cli/parsing/modules/WhoamiCommandModule.js +30 -28
  98. package/dist/cli/parsing/modules/WhoamiCommandModule.js.map +1 -1
  99. package/dist/cli/parsing/modules/WhyCommandModule.d.ts +8 -5
  100. package/dist/cli/parsing/modules/WhyCommandModule.d.ts.map +1 -1
  101. package/dist/cli/parsing/modules/WhyCommandModule.js +25 -14
  102. package/dist/cli/parsing/modules/WhyCommandModule.js.map +1 -1
  103. package/dist/cli/parsing/modules/sharedOptions.d.ts +8 -5
  104. package/dist/cli/parsing/modules/sharedOptions.d.ts.map +1 -1
  105. package/dist/cli/parsing/modules/sharedOptions.js +18 -23
  106. package/dist/cli/parsing/modules/sharedOptions.js.map +1 -1
  107. package/dist/cli/runUAPKGCLI.d.ts +4 -1
  108. package/dist/cli/runUAPKGCLI.d.ts.map +1 -1
  109. package/dist/cli/runUAPKGCLI.js +10 -5
  110. package/dist/cli/runUAPKGCLI.js.map +1 -1
  111. package/dist/cli-bootstrap.d.ts +1 -2
  112. package/dist/cli-bootstrap.js +15 -12
  113. package/dist/cli-bootstrap.js.map +1 -1
  114. package/dist/commands/AddCommand.d.ts +19 -16
  115. package/dist/commands/AddCommand.d.ts.map +1 -1
  116. package/dist/commands/AddCommand.js +49 -53
  117. package/dist/commands/AddCommand.js.map +1 -1
  118. package/dist/commands/Command.d.ts +5 -2
  119. package/dist/commands/Command.d.ts.map +1 -1
  120. package/dist/commands/Command.js +1 -2
  121. package/dist/commands/ConfigCommand.d.ts +28 -25
  122. package/dist/commands/ConfigCommand.d.ts.map +1 -1
  123. package/dist/commands/ConfigCommand.js +165 -186
  124. package/dist/commands/ConfigCommand.js.map +1 -1
  125. package/dist/commands/InitCommand.d.ts +19 -16
  126. package/dist/commands/InitCommand.d.ts.map +1 -1
  127. package/dist/commands/InitCommand.js +65 -60
  128. package/dist/commands/InitCommand.js.map +1 -1
  129. package/dist/commands/InstallCommand.d.ts +16 -13
  130. package/dist/commands/InstallCommand.d.ts.map +1 -1
  131. package/dist/commands/InstallCommand.js +118 -110
  132. package/dist/commands/InstallCommand.js.map +1 -1
  133. package/dist/commands/ListCommand.d.ts +13 -10
  134. package/dist/commands/ListCommand.d.ts.map +1 -1
  135. package/dist/commands/ListCommand.js +76 -81
  136. package/dist/commands/ListCommand.js.map +1 -1
  137. package/dist/commands/LoginCommand.d.ts +17 -14
  138. package/dist/commands/LoginCommand.d.ts.map +1 -1
  139. package/dist/commands/LoginCommand.js +66 -72
  140. package/dist/commands/LoginCommand.js.map +1 -1
  141. package/dist/commands/LogoutCommand.d.ts +15 -12
  142. package/dist/commands/LogoutCommand.d.ts.map +1 -1
  143. package/dist/commands/LogoutCommand.js +36 -37
  144. package/dist/commands/LogoutCommand.js.map +1 -1
  145. package/dist/commands/OutdatedCommand.d.ts +12 -9
  146. package/dist/commands/OutdatedCommand.d.ts.map +1 -1
  147. package/dist/commands/OutdatedCommand.js +41 -40
  148. package/dist/commands/OutdatedCommand.js.map +1 -1
  149. package/dist/commands/PackCommand.d.ts +13 -10
  150. package/dist/commands/PackCommand.d.ts.map +1 -1
  151. package/dist/commands/PackCommand.js +26 -21
  152. package/dist/commands/PackCommand.js.map +1 -1
  153. package/dist/commands/PackageLifecycleCommand.d.ts +23 -19
  154. package/dist/commands/PackageLifecycleCommand.d.ts.map +1 -1
  155. package/dist/commands/PackageLifecycleCommand.js +144 -138
  156. package/dist/commands/PackageLifecycleCommand.js.map +1 -1
  157. package/dist/commands/PostinstallCandidateBuilder.d.ts +11 -8
  158. package/dist/commands/PostinstallCandidateBuilder.d.ts.map +1 -1
  159. package/dist/commands/PostinstallCandidateBuilder.js +42 -42
  160. package/dist/commands/PostinstallCandidateBuilder.js.map +1 -1
  161. package/dist/commands/ProjectGetNameCommand.d.ts +10 -7
  162. package/dist/commands/ProjectGetNameCommand.d.ts.map +1 -1
  163. package/dist/commands/ProjectGetNameCommand.js +25 -25
  164. package/dist/commands/ProjectGetNameCommand.js.map +1 -1
  165. package/dist/commands/PublishCommand.d.ts +29 -23
  166. package/dist/commands/PublishCommand.d.ts.map +1 -1
  167. package/dist/commands/PublishCommand.js +243 -254
  168. package/dist/commands/PublishCommand.js.map +1 -1
  169. package/dist/commands/RegistryCommand.d.ts +38 -35
  170. package/dist/commands/RegistryCommand.d.ts.map +1 -1
  171. package/dist/commands/RegistryCommand.js +195 -223
  172. package/dist/commands/RegistryCommand.js.map +1 -1
  173. package/dist/commands/RemoveCommand.d.ts +14 -11
  174. package/dist/commands/RemoveCommand.d.ts.map +1 -1
  175. package/dist/commands/RemoveCommand.js +47 -54
  176. package/dist/commands/RemoveCommand.js.map +1 -1
  177. package/dist/commands/RequestsCommand.d.ts +21 -18
  178. package/dist/commands/RequestsCommand.d.ts.map +1 -1
  179. package/dist/commands/RequestsCommand.js +82 -95
  180. package/dist/commands/RequestsCommand.js.map +1 -1
  181. package/dist/commands/UpdateCommand.d.ts +29 -26
  182. package/dist/commands/UpdateCommand.d.ts.map +1 -1
  183. package/dist/commands/UpdateCommand.js +111 -111
  184. package/dist/commands/UpdateCommand.js.map +1 -1
  185. package/dist/commands/WhoamiCommand.d.ts +30 -27
  186. package/dist/commands/WhoamiCommand.d.ts.map +1 -1
  187. package/dist/commands/WhoamiCommand.js +63 -72
  188. package/dist/commands/WhoamiCommand.js.map +1 -1
  189. package/dist/commands/WhyCommand.d.ts +13 -10
  190. package/dist/commands/WhyCommand.d.ts.map +1 -1
  191. package/dist/commands/WhyCommand.js +45 -44
  192. package/dist/commands/WhyCommand.js.map +1 -1
  193. package/dist/commands/add/DependencyAddResolver.d.ts +14 -11
  194. package/dist/commands/add/DependencyAddResolver.d.ts.map +1 -1
  195. package/dist/commands/add/DependencyAddResolver.js +36 -36
  196. package/dist/commands/add/DependencyAddResolver.js.map +1 -1
  197. package/dist/control-plane/AccountManager.d.ts +96 -94
  198. package/dist/control-plane/AccountManager.d.ts.map +1 -1
  199. package/dist/control-plane/AccountManager.js +775 -967
  200. package/dist/control-plane/AccountManager.js.map +1 -1
  201. package/dist/control-plane/ArtifactObserver.d.ts +19 -16
  202. package/dist/control-plane/ArtifactObserver.d.ts.map +1 -1
  203. package/dist/control-plane/ArtifactObserver.js +73 -59
  204. package/dist/control-plane/ArtifactObserver.js.map +1 -1
  205. package/dist/control-plane/AuthMetadataStore.d.ts +16 -13
  206. package/dist/control-plane/AuthMetadataStore.d.ts.map +1 -1
  207. package/dist/control-plane/AuthMetadataStore.js +111 -113
  208. package/dist/control-plane/AuthMetadataStore.js.map +1 -1
  209. package/dist/control-plane/AuthStoragePaths.d.ts +7 -4
  210. package/dist/control-plane/AuthStoragePaths.d.ts.map +1 -1
  211. package/dist/control-plane/AuthStoragePaths.js +19 -14
  212. package/dist/control-plane/AuthStoragePaths.js.map +1 -1
  213. package/dist/control-plane/AuthenticationSelector.d.ts +21 -18
  214. package/dist/control-plane/AuthenticationSelector.d.ts.map +1 -1
  215. package/dist/control-plane/AuthenticationSelector.js +69 -63
  216. package/dist/control-plane/AuthenticationSelector.js.map +1 -1
  217. package/dist/control-plane/ControlPlaneClient.d.ts +37 -28
  218. package/dist/control-plane/ControlPlaneClient.d.ts.map +1 -1
  219. package/dist/control-plane/ControlPlaneClient.js +265 -254
  220. package/dist/control-plane/ControlPlaneClient.js.map +1 -1
  221. package/dist/control-plane/ControlPlaneEndpoints.d.ts +9 -6
  222. package/dist/control-plane/ControlPlaneEndpoints.d.ts.map +1 -1
  223. package/dist/control-plane/ControlPlaneEndpoints.js +17 -12
  224. package/dist/control-plane/ControlPlaneEndpoints.js.map +1 -1
  225. package/dist/control-plane/ControlPlaneTypes.d.ts +176 -152
  226. package/dist/control-plane/ControlPlaneTypes.d.ts.map +1 -1
  227. package/dist/control-plane/ControlPlaneTypes.js +88 -81
  228. package/dist/control-plane/ControlPlaneTypes.js.map +1 -1
  229. package/dist/control-plane/CredentialStore.d.ts +20 -18
  230. package/dist/control-plane/CredentialStore.d.ts.map +1 -1
  231. package/dist/control-plane/CredentialStore.js +66 -83
  232. package/dist/control-plane/CredentialStore.js.map +1 -1
  233. package/dist/control-plane/DPoPKeyStore.d.ts +12 -9
  234. package/dist/control-plane/DPoPKeyStore.d.ts.map +1 -1
  235. package/dist/control-plane/DPoPKeyStore.js +57 -53
  236. package/dist/control-plane/DPoPKeyStore.js.map +1 -1
  237. package/dist/control-plane/GitHubActionsOidcCredentialProvider.d.ts +37 -4
  238. package/dist/control-plane/GitHubActionsOidcCredentialProvider.d.ts.map +1 -1
  239. package/dist/control-plane/GitHubActionsOidcCredentialProvider.js +197 -63
  240. package/dist/control-plane/GitHubActionsOidcCredentialProvider.js.map +1 -1
  241. package/dist/control-plane/PublishIdempotencyStore.d.ts +25 -9
  242. package/dist/control-plane/PublishIdempotencyStore.d.ts.map +1 -1
  243. package/dist/control-plane/PublishIdempotencyStore.js +97 -68
  244. package/dist/control-plane/PublishIdempotencyStore.js.map +1 -1
  245. package/dist/control-plane/PublishRequestErrorMapper.d.ts +155 -0
  246. package/dist/control-plane/PublishRequestErrorMapper.d.ts.map +1 -0
  247. package/dist/control-plane/PublishRequestErrorMapper.js +597 -0
  248. package/dist/control-plane/PublishRequestErrorMapper.js.map +1 -0
  249. package/dist/control-plane/RegistryGrantLock.d.ts +29 -26
  250. package/dist/control-plane/RegistryGrantLock.d.ts.map +1 -1
  251. package/dist/control-plane/RegistryGrantLock.js +149 -185
  252. package/dist/control-plane/RegistryGrantLock.js.map +1 -1
  253. package/dist/control-plane/RegistryTrustResolver.d.ts +13 -10
  254. package/dist/control-plane/RegistryTrustResolver.d.ts.map +1 -1
  255. package/dist/control-plane/RegistryTrustResolver.js +97 -132
  256. package/dist/control-plane/RegistryTrustResolver.js.map +1 -1
  257. package/dist/index.d.ts +62 -39
  258. package/dist/index.js +60 -53
  259. package/dist/postinstall/api/PostinstallDsl.d.ts +24 -21
  260. package/dist/postinstall/api/PostinstallDsl.d.ts.map +1 -1
  261. package/dist/postinstall/api/PostinstallDsl.js +32 -35
  262. package/dist/postinstall/api/PostinstallDsl.js.map +1 -1
  263. package/dist/postinstall/api/definePostinstall.d.ts +5 -2
  264. package/dist/postinstall/api/definePostinstall.d.ts.map +1 -1
  265. package/dist/postinstall/api/definePostinstall.js +20 -16
  266. package/dist/postinstall/api/definePostinstall.js.map +1 -1
  267. package/dist/postinstall/index.d.ts +25 -26
  268. package/dist/postinstall/index.js +25 -37
  269. package/dist/postinstall/loader/EntryResolver.d.ts +11 -9
  270. package/dist/postinstall/loader/EntryResolver.d.ts.map +1 -1
  271. package/dist/postinstall/loader/EntryResolver.js +36 -32
  272. package/dist/postinstall/loader/EntryResolver.js.map +1 -1
  273. package/dist/postinstall/loader/EsbuildTranspiler.d.ts +6 -3
  274. package/dist/postinstall/loader/EsbuildTranspiler.d.ts.map +1 -1
  275. package/dist/postinstall/loader/EsbuildTranspiler.js +52 -56
  276. package/dist/postinstall/loader/EsbuildTranspiler.js.map +1 -1
  277. package/dist/postinstall/loader/ExportValidator.d.ts +8 -5
  278. package/dist/postinstall/loader/ExportValidator.d.ts.map +1 -1
  279. package/dist/postinstall/loader/ExportValidator.js +36 -32
  280. package/dist/postinstall/loader/ExportValidator.js.map +1 -1
  281. package/dist/postinstall/loader/ModuleImporter.d.ts +17 -14
  282. package/dist/postinstall/loader/ModuleImporter.d.ts.map +1 -1
  283. package/dist/postinstall/loader/ModuleImporter.js +50 -58
  284. package/dist/postinstall/loader/ModuleImporter.js.map +1 -1
  285. package/dist/postinstall/loader/PostinstallLoader.d.ts +22 -19
  286. package/dist/postinstall/loader/PostinstallLoader.d.ts.map +1 -1
  287. package/dist/postinstall/loader/PostinstallLoader.js +62 -58
  288. package/dist/postinstall/loader/PostinstallLoader.js.map +1 -1
  289. package/dist/postinstall/markers/MarkerBlockEditor.d.ts +19 -16
  290. package/dist/postinstall/markers/MarkerBlockEditor.d.ts.map +1 -1
  291. package/dist/postinstall/markers/MarkerBlockEditor.js +48 -44
  292. package/dist/postinstall/markers/MarkerBlockEditor.js.map +1 -1
  293. package/dist/postinstall/markers/MarkerBlockService.d.ts +10 -7
  294. package/dist/postinstall/markers/MarkerBlockService.d.ts.map +1 -1
  295. package/dist/postinstall/markers/MarkerBlockService.js +44 -44
  296. package/dist/postinstall/markers/MarkerBlockService.js.map +1 -1
  297. package/dist/postinstall/markers/MarkerIntegrityValidator.d.ts +12 -9
  298. package/dist/postinstall/markers/MarkerIntegrityValidator.d.ts.map +1 -1
  299. package/dist/postinstall/markers/MarkerIntegrityValidator.js +47 -52
  300. package/dist/postinstall/markers/MarkerIntegrityValidator.js.map +1 -1
  301. package/dist/postinstall/policy/PostinstallPolicyGate.d.ts +25 -23
  302. package/dist/postinstall/policy/PostinstallPolicyGate.d.ts.map +1 -1
  303. package/dist/postinstall/policy/PostinstallPolicyGate.js +63 -52
  304. package/dist/postinstall/policy/PostinstallPolicyGate.js.map +1 -1
  305. package/dist/postinstall/runner/PostinstallOrchestrator.d.ts +48 -45
  306. package/dist/postinstall/runner/PostinstallOrchestrator.d.ts.map +1 -1
  307. package/dist/postinstall/runner/PostinstallOrchestrator.js +172 -170
  308. package/dist/postinstall/runner/PostinstallOrchestrator.js.map +1 -1
  309. package/dist/postinstall/unreal/BuildCsInjector.d.ts +16 -13
  310. package/dist/postinstall/unreal/BuildCsInjector.d.ts.map +1 -1
  311. package/dist/postinstall/unreal/BuildCsInjector.js +58 -53
  312. package/dist/postinstall/unreal/BuildCsInjector.js.map +1 -1
  313. package/dist/postinstall/unreal/CSharpInjectionEngine.d.ts +13 -10
  314. package/dist/postinstall/unreal/CSharpInjectionEngine.d.ts.map +1 -1
  315. package/dist/postinstall/unreal/CSharpInjectionEngine.js +56 -59
  316. package/dist/postinstall/unreal/CSharpInjectionEngine.js.map +1 -1
  317. package/dist/postinstall/unreal/CSharpStructureAnalyzer.d.ts +11 -8
  318. package/dist/postinstall/unreal/CSharpStructureAnalyzer.d.ts.map +1 -1
  319. package/dist/postinstall/unreal/CSharpStructureAnalyzer.js +123 -127
  320. package/dist/postinstall/unreal/CSharpStructureAnalyzer.js.map +1 -1
  321. package/dist/postinstall/unreal/CSharpStructures.d.ts +18 -15
  322. package/dist/postinstall/unreal/CSharpStructures.d.ts.map +1 -1
  323. package/dist/postinstall/unreal/CSharpStructures.js +1 -2
  324. package/dist/postinstall/unreal/CSharpWrapperFactory.d.ts +7 -4
  325. package/dist/postinstall/unreal/CSharpWrapperFactory.d.ts.map +1 -1
  326. package/dist/postinstall/unreal/CSharpWrapperFactory.js +54 -58
  327. package/dist/postinstall/unreal/CSharpWrapperFactory.js.map +1 -1
  328. package/dist/postinstall/unreal/PluginHash.d.ts +5 -2
  329. package/dist/postinstall/unreal/PluginHash.d.ts.map +1 -1
  330. package/dist/postinstall/unreal/PluginHash.js +13 -8
  331. package/dist/postinstall/unreal/PluginHash.js.map +1 -1
  332. package/dist/postinstall/unreal/PrettyParseError.d.ts +8 -5
  333. package/dist/postinstall/unreal/PrettyParseError.d.ts.map +1 -1
  334. package/dist/postinstall/unreal/PrettyParseError.js +37 -37
  335. package/dist/postinstall/unreal/PrettyParseError.js.map +1 -1
  336. package/dist/postinstall/unreal/ProjectFileLocator.d.ts +12 -9
  337. package/dist/postinstall/unreal/ProjectFileLocator.d.ts.map +1 -1
  338. package/dist/postinstall/unreal/ProjectFileLocator.js +49 -51
  339. package/dist/postinstall/unreal/ProjectFileLocator.js.map +1 -1
  340. package/dist/postinstall/unreal/TargetCsInjector.d.ts +16 -13
  341. package/dist/postinstall/unreal/TargetCsInjector.d.ts.map +1 -1
  342. package/dist/postinstall/unreal/TargetCsInjector.js +58 -53
  343. package/dist/postinstall/unreal/TargetCsInjector.js.map +1 -1
  344. package/dist/postinstall/unreal/UProjectInjector.d.ts +6 -3
  345. package/dist/postinstall/unreal/UProjectInjector.d.ts.map +1 -1
  346. package/dist/postinstall/unreal/UProjectInjector.js +56 -52
  347. package/dist/postinstall/unreal/UProjectInjector.js.map +1 -1
  348. package/dist/postinstall/unreal/UProjectMetadataReader.d.ts +5 -2
  349. package/dist/postinstall/unreal/UProjectMetadataReader.d.ts.map +1 -1
  350. package/dist/postinstall/unreal/UProjectMetadataReader.js +22 -18
  351. package/dist/postinstall/unreal/UProjectMetadataReader.js.map +1 -1
  352. package/dist/postinstall/unreal/UnrealSourceCatalog.d.ts +17 -14
  353. package/dist/postinstall/unreal/UnrealSourceCatalog.d.ts.map +1 -1
  354. package/dist/postinstall/unreal/UnrealSourceCatalog.js +50 -50
  355. package/dist/postinstall/unreal/UnrealSourceCatalog.js.map +1 -1
  356. package/dist/prompts/InkPromptService.d.ts +10 -7
  357. package/dist/prompts/InkPromptService.d.ts.map +1 -1
  358. package/dist/prompts/InkPromptService.js +100 -71
  359. package/dist/prompts/InkPromptService.js.map +1 -1
  360. package/dist/prompts/ProjectContextDetector.d.ts +10 -7
  361. package/dist/prompts/ProjectContextDetector.d.ts.map +1 -1
  362. package/dist/prompts/ProjectContextDetector.js +32 -26
  363. package/dist/prompts/ProjectContextDetector.js.map +1 -1
  364. package/dist/prompts/PromptService.d.ts +11 -8
  365. package/dist/prompts/PromptService.d.ts.map +1 -1
  366. package/dist/prompts/PromptService.js +1 -8
  367. package/dist/reporting/DiagnosticDeduplicator.d.ts +8 -5
  368. package/dist/reporting/DiagnosticDeduplicator.d.ts.map +1 -1
  369. package/dist/reporting/DiagnosticDeduplicator.js +36 -35
  370. package/dist/reporting/DiagnosticDeduplicator.js.map +1 -1
  371. package/dist/reporting/DiagnosticRenderer.d.ts +11 -8
  372. package/dist/reporting/DiagnosticRenderer.d.ts.map +1 -1
  373. package/dist/reporting/DiagnosticRenderer.js +1 -2
  374. package/dist/reporting/DiagnosticReporter.d.ts +12 -9
  375. package/dist/reporting/DiagnosticReporter.d.ts.map +1 -1
  376. package/dist/reporting/DiagnosticReporter.js +40 -39
  377. package/dist/reporting/DiagnosticReporter.js.map +1 -1
  378. package/dist/reporting/InkDiagnosticRenderer.d.ts +12 -9
  379. package/dist/reporting/InkDiagnosticRenderer.d.ts.map +1 -1
  380. package/dist/reporting/InkDiagnosticRenderer.js +50 -42
  381. package/dist/reporting/InkDiagnosticRenderer.js.map +1 -1
  382. package/dist/reporting/InstallProgressReporter.d.ts +23 -20
  383. package/dist/reporting/InstallProgressReporter.d.ts.map +1 -1
  384. package/dist/reporting/InstallProgressReporter.js +48 -47
  385. package/dist/reporting/InstallProgressReporter.js.map +1 -1
  386. package/dist/reporting/JsonReporter.d.ts +16 -13
  387. package/dist/reporting/JsonReporter.d.ts.map +1 -1
  388. package/dist/reporting/JsonReporter.js +34 -20
  389. package/dist/reporting/JsonReporter.js.map +1 -1
  390. package/dist/reporting/RegistryRequestTerminalFormatter.d.ts +36 -0
  391. package/dist/reporting/RegistryRequestTerminalFormatter.d.ts.map +1 -0
  392. package/dist/reporting/RegistryRequestTerminalFormatter.js +90 -0
  393. package/dist/reporting/RegistryRequestTerminalFormatter.js.map +1 -0
  394. package/dist/reporting/TextDiagnosticRenderer.d.ts +11 -8
  395. package/dist/reporting/TextDiagnosticRenderer.d.ts.map +1 -1
  396. package/dist/reporting/TextDiagnosticRenderer.js +36 -28
  397. package/dist/reporting/TextDiagnosticRenderer.js.map +1 -1
  398. package/dist/reporting/TextSink.d.ts +14 -11
  399. package/dist/reporting/TextSink.d.ts.map +1 -1
  400. package/dist/reporting/TextSink.js +24 -20
  401. package/dist/reporting/TextSink.js.map +1 -1
  402. package/package.json +31 -32
  403. package/dist/cli/parsing/contracts/UAPKGCommandModule.js.map +0 -1
  404. package/dist/cli-bootstrap.d.ts.map +0 -1
  405. package/dist/commands/Command.js.map +0 -1
  406. package/dist/index.d.ts.map +0 -1
  407. package/dist/index.js.map +0 -1
  408. package/dist/postinstall/index.d.ts.map +0 -1
  409. package/dist/postinstall/index.js.map +0 -1
  410. package/dist/postinstall/unreal/CSharpStructures.js.map +0 -1
  411. package/dist/prompts/PromptService.js.map +0 -1
  412. package/dist/reporting/DiagnosticRenderer.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"EntryResolver.js","sourceRoot":"","sources":["../../../src/postinstall/loader/EntryResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,yCAAyC,EAAE,IAAI,EAAE,EAAE,EAAe,MAAM,oBAAoB,CAAC;AAEtG,gEAAgE;AAChE,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAU,CAAC;AAQ1D;;;;;;GAMG;AACH,MAAM,OAAO,aAAa;IACjB,OAAO,CAAC,WAAmB,EAAE,UAAkB;QACpD,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC5C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;QAEzC,MAAM,KAAK,GAAoB,EAAE,CAAC;QAClC,KAAK,MAAM,IAAI,IAAI,oBAAoB,EAAE,CAAC;YACxC,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,IAAI,EAAE,CAAC,CAAC;YACxD,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;gBAChE,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;QAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,OAAO,IAAI,CAAC;gBACV,yCAAyC,CACvC,WAAW,EACX,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CACjC;aACF,CAAC,CAAC;QACL,CAAC;QACD,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC;CACF"}
1
+ {"version":3,"file":"EntryResolver.js","names":["path"],"sources":["../../../src/postinstall/loader/EntryResolver.ts"],"sourcesContent":["import fs from 'node:fs';\nimport * as path from 'node:path';\nimport { createPostinstallDuplicateEntryDiagnostic, fail, ok, type Result } from '@uapkg/diagnostics';\n\n/** Candidate extensions in resolution order (spec-mandated). */\nconst CANDIDATE_EXTENSIONS = ['ts', 'js', 'mjs'] as const;\nexport type PostinstallEntryKind = (typeof CANDIDATE_EXTENSIONS)[number];\n\nexport interface ResolvedEntry {\n readonly path: string;\n readonly kind: PostinstallEntryKind;\n}\n\n/**\n * Locates `.uapkg/postinstall.<ext>` inside a plugin root, enforcing the\n * order `ts → js → mjs`. If the plugin has two or more candidate files an\n * error diagnostic `POSTINSTALL_DUPLICATE_ENTRY` is returned so the user can\n * clean up ambiguity. `ok(null)` means \"no postinstall defined\" — a valid,\n * silent state.\n */\nexport class EntryResolver {\n public resolve(packageName: string, pluginRoot: string): Result<ResolvedEntry | null> {\n const dir = path.join(pluginRoot, '.uapkg');\n if (!fs.existsSync(dir)) return ok(null);\n\n const found: ResolvedEntry[] = [];\n for (const kind of CANDIDATE_EXTENSIONS) {\n const candidate = path.join(dir, `postinstall.${kind}`);\n if (fs.existsSync(candidate) && fs.statSync(candidate).isFile()) {\n found.push({ path: candidate, kind });\n }\n }\n\n if (found.length === 0) return ok(null);\n if (found.length > 1) {\n return fail([\n createPostinstallDuplicateEntryDiagnostic(\n packageName,\n found.map((entry) => entry.path),\n ),\n ]);\n }\n return ok(found[0]);\n }\n}\n"],"mappings":";;;;;;AAKA,MAAM,uBAAuB;CAAC;CAAM;CAAM;AAAK;;;;;;;;AAe/C,IAAa,gBAAb,MAA2B;CACzB,AAAO,QAAQ,aAAqB,YAAkD;EACpF,MAAM,MAAMA,OAAK,KAAK,YAAY,QAAQ;EAC1C,IAAI,CAAC,GAAG,WAAW,GAAG,GAAG,OAAO,GAAG,IAAI;EAEvC,MAAM,QAAyB,CAAC;EAChC,KAAK,MAAM,QAAQ,sBAAsB;GACvC,MAAM,YAAYA,OAAK,KAAK,KAAK,eAAe,MAAM;GACtD,IAAI,GAAG,WAAW,SAAS,KAAK,GAAG,SAAS,SAAS,CAAC,CAAC,OAAO,GAC5D,MAAM,KAAK;IAAE,MAAM;IAAW;GAAK,CAAC;EAExC;EAEA,IAAI,MAAM,WAAW,GAAG,OAAO,GAAG,IAAI;EACtC,IAAI,MAAM,SAAS,GACjB,OAAO,KAAK,CACV,0CACE,aACA,MAAM,KAAK,UAAU,MAAM,IAAI,CACjC,CACF,CAAC;EAEH,OAAO,GAAG,MAAM,EAAE;CACpB;AACF"}
@@ -1,4 +1,5 @@
1
- import { type Result } from '@uapkg/diagnostics';
1
+ import { Result } from "@uapkg/diagnostics";
2
+ //#region src/postinstall/loader/EsbuildTranspiler.d.ts
2
3
  /**
3
4
  * Transpiles a single `.ts` postinstall entry into an in-memory ESM bundle.
4
5
  *
@@ -12,7 +13,9 @@ import { type Result } from '@uapkg/diagnostics';
12
13
  *
13
14
  * On failure returns a `POSTINSTALL_ESBUILD_ERROR` diagnostic.
14
15
  */
15
- export declare class EsbuildTranspiler {
16
- transpile(packageName: string, entryFile: string): Promise<Result<string>>;
16
+ declare class EsbuildTranspiler {
17
+ transpile(packageName: string, entryFile: string): Promise<Result<string>>;
17
18
  }
19
+ //#endregion
20
+ export { EsbuildTranspiler };
18
21
  //# sourceMappingURL=EsbuildTranspiler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EsbuildTranspiler.d.ts","sourceRoot":"","sources":["../../../src/postinstall/loader/EsbuildTranspiler.ts"],"names":[],"mappings":"AACA,OAAO,EAAqD,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGpG;;;;;;;;;;;;GAYG;AACH,qBAAa,iBAAiB;IACf,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;CA+CxF"}
1
+ {"version":3,"file":"EsbuildTranspiler.d.ts","names":[],"sources":["../../../src/postinstall/loader/EsbuildTranspiler.ts"],"mappings":";;;;;;;;;;;;;;;cAiBa;EACE,UAAU,qBAAqB,oBAAoB,QAAQ"}
@@ -1,58 +1,54 @@
1
- import fs from 'node:fs';
2
- import { createPostinstallEsbuildErrorDiagnostic, fail, ok } from '@uapkg/diagnostics';
3
- import { build } from 'esbuild';
1
+ import { createPostinstallEsbuildErrorDiagnostic, fail, ok } from "@uapkg/diagnostics";
2
+ import fs from "node:fs";
3
+ import { build } from "esbuild";
4
+
5
+ //#region src/postinstall/loader/EsbuildTranspiler.ts
4
6
  /**
5
- * Transpiles a single `.ts` postinstall entry into an in-memory ESM bundle.
6
- *
7
- * Constraints:
8
- * * `bundle: false` — we only lower TypeScript to JS; users are expected to
9
- * import shared modules via `node_modules` which the loader's dynamic
10
- * import handles natively.
11
- * * No type-checking. The user's IDE / CI catches type errors; `uapkg` only
12
- * needs a runnable module.
13
- * * `platform: node`, `format: esm`, `target: node20`.
14
- *
15
- * On failure returns a `POSTINSTALL_ESBUILD_ERROR` diagnostic.
16
- */
17
- export class EsbuildTranspiler {
18
- async transpile(packageName, entryFile) {
19
- let source;
20
- try {
21
- source = fs.readFileSync(entryFile, 'utf-8');
22
- }
23
- catch (error) {
24
- return fail([
25
- createPostinstallEsbuildErrorDiagnostic(packageName, entryFile, error instanceof Error ? error.message : String(error)),
26
- ]);
27
- }
28
- const options = {
29
- stdin: {
30
- contents: source,
31
- loader: 'ts',
32
- sourcefile: entryFile,
33
- resolveDir: entryFile.replace(/[\\/][^\\/]+$/, ''),
34
- },
35
- bundle: false,
36
- write: false,
37
- format: 'esm',
38
- platform: 'node',
39
- target: 'node20',
40
- sourcemap: false,
41
- logLevel: 'silent',
42
- };
43
- try {
44
- const result = await build(options);
45
- const file = result.outputFiles?.[0];
46
- if (!file) {
47
- return fail([createPostinstallEsbuildErrorDiagnostic(packageName, entryFile, 'esbuild produced no output')]);
48
- }
49
- return ok(file.text);
50
- }
51
- catch (error) {
52
- return fail([
53
- createPostinstallEsbuildErrorDiagnostic(packageName, entryFile, error instanceof Error ? error.message : String(error)),
54
- ]);
55
- }
56
- }
57
- }
7
+ * Transpiles a single `.ts` postinstall entry into an in-memory ESM bundle.
8
+ *
9
+ * Constraints:
10
+ * * `bundle: false` — we only lower TypeScript to JS; users are expected to
11
+ * import shared modules via `node_modules` which the loader's dynamic
12
+ * import handles natively.
13
+ * * No type-checking. The user's IDE / CI catches type errors; `uapkg` only
14
+ * needs a runnable module.
15
+ * * `platform: node`, `format: esm`, `target: node20`.
16
+ *
17
+ * On failure returns a `POSTINSTALL_ESBUILD_ERROR` diagnostic.
18
+ */
19
+ var EsbuildTranspiler = class {
20
+ async transpile(packageName, entryFile) {
21
+ let source;
22
+ try {
23
+ source = fs.readFileSync(entryFile, "utf-8");
24
+ } catch (error) {
25
+ return fail([createPostinstallEsbuildErrorDiagnostic(packageName, entryFile, error instanceof Error ? error.message : String(error))]);
26
+ }
27
+ const options = {
28
+ stdin: {
29
+ contents: source,
30
+ loader: "ts",
31
+ sourcefile: entryFile,
32
+ resolveDir: entryFile.replace(/[\\/][^\\/]+$/, "")
33
+ },
34
+ bundle: false,
35
+ write: false,
36
+ format: "esm",
37
+ platform: "node",
38
+ target: "node20",
39
+ sourcemap: false,
40
+ logLevel: "silent"
41
+ };
42
+ try {
43
+ const file = (await build(options)).outputFiles?.[0];
44
+ if (!file) return fail([createPostinstallEsbuildErrorDiagnostic(packageName, entryFile, "esbuild produced no output")]);
45
+ return ok(file.text);
46
+ } catch (error) {
47
+ return fail([createPostinstallEsbuildErrorDiagnostic(packageName, entryFile, error instanceof Error ? error.message : String(error))]);
48
+ }
49
+ }
50
+ };
51
+
52
+ //#endregion
53
+ export { EsbuildTranspiler };
58
54
  //# sourceMappingURL=EsbuildTranspiler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EsbuildTranspiler.js","sourceRoot":"","sources":["../../../src/postinstall/loader/EsbuildTranspiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,uCAAuC,EAAE,IAAI,EAAE,EAAE,EAAe,MAAM,oBAAoB,CAAC;AACpG,OAAO,EAAqB,KAAK,EAAE,MAAM,SAAS,CAAC;AAEnD;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,iBAAiB;IACrB,KAAK,CAAC,SAAS,CAAC,WAAmB,EAAE,SAAiB;QAC3D,IAAI,MAAc,CAAC;QACnB,IAAI,CAAC;YACH,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC/C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC;gBACV,uCAAuC,CACrC,WAAW,EACX,SAAS,EACT,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACvD;aACF,CAAC,CAAC;QACL,CAAC;QAED,MAAM,OAAO,GAAiB;YAC5B,KAAK,EAAE;gBACL,QAAQ,EAAE,MAAM;gBAChB,MAAM,EAAE,IAAI;gBACZ,UAAU,EAAE,SAAS;gBACrB,UAAU,EAAE,SAAS,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;aACnD;YACD,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,QAAQ;YAChB,SAAS,EAAE,KAAK;YAChB,QAAQ,EAAE,QAAQ;SACnB,CAAC;QAEF,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC;YACpC,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;YACrC,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,IAAI,CAAC,CAAC,uCAAuC,CAAC,WAAW,EAAE,SAAS,EAAE,4BAA4B,CAAC,CAAC,CAAC,CAAC;YAC/G,CAAC;YACD,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC;gBACV,uCAAuC,CACrC,WAAW,EACX,SAAS,EACT,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACvD;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"EsbuildTranspiler.js","names":[],"sources":["../../../src/postinstall/loader/EsbuildTranspiler.ts"],"sourcesContent":["import fs from 'node:fs';\nimport { createPostinstallEsbuildErrorDiagnostic, fail, ok, type Result } from '@uapkg/diagnostics';\nimport { type BuildOptions, build } from 'esbuild';\n\n/**\n * Transpiles a single `.ts` postinstall entry into an in-memory ESM bundle.\n *\n * Constraints:\n * * `bundle: false` — we only lower TypeScript to JS; users are expected to\n * import shared modules via `node_modules` which the loader's dynamic\n * import handles natively.\n * * No type-checking. The user's IDE / CI catches type errors; `uapkg` only\n * needs a runnable module.\n * * `platform: node`, `format: esm`, `target: node20`.\n *\n * On failure returns a `POSTINSTALL_ESBUILD_ERROR` diagnostic.\n */\nexport class EsbuildTranspiler {\n public async transpile(packageName: string, entryFile: string): Promise<Result<string>> {\n let source: string;\n try {\n source = fs.readFileSync(entryFile, 'utf-8');\n } catch (error) {\n return fail([\n createPostinstallEsbuildErrorDiagnostic(\n packageName,\n entryFile,\n error instanceof Error ? error.message : String(error),\n ),\n ]);\n }\n\n const options: BuildOptions = {\n stdin: {\n contents: source,\n loader: 'ts',\n sourcefile: entryFile,\n resolveDir: entryFile.replace(/[\\\\/][^\\\\/]+$/, ''),\n },\n bundle: false,\n write: false,\n format: 'esm',\n platform: 'node',\n target: 'node20',\n sourcemap: false,\n logLevel: 'silent',\n };\n\n try {\n const result = await build(options);\n const file = result.outputFiles?.[0];\n if (!file) {\n return fail([createPostinstallEsbuildErrorDiagnostic(packageName, entryFile, 'esbuild produced no output')]);\n }\n return ok(file.text);\n } catch (error) {\n return fail([\n createPostinstallEsbuildErrorDiagnostic(\n packageName,\n entryFile,\n error instanceof Error ? error.message : String(error),\n ),\n ]);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,IAAa,oBAAb,MAA+B;CAC7B,MAAa,UAAU,aAAqB,WAA4C;EACtF,IAAI;EACJ,IAAI;GACF,SAAS,GAAG,aAAa,WAAW,OAAO;EAC7C,SAAS,OAAO;GACd,OAAO,KAAK,CACV,wCACE,aACA,WACA,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CACvD,CACF,CAAC;EACH;EAEA,MAAM,UAAwB;GAC5B,OAAO;IACL,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,YAAY,UAAU,QAAQ,iBAAiB,EAAE;GACnD;GACA,QAAQ;GACR,OAAO;GACP,QAAQ;GACR,UAAU;GACV,QAAQ;GACR,WAAW;GACX,UAAU;EACZ;EAEA,IAAI;GAEF,MAAM,QAAO,MADQ,MAAM,OAAO,EACf,CAAC,cAAc;GAClC,IAAI,CAAC,MACH,OAAO,KAAK,CAAC,wCAAwC,aAAa,WAAW,4BAA4B,CAAC,CAAC;GAE7G,OAAO,GAAG,KAAK,IAAI;EACrB,SAAS,OAAO;GACd,OAAO,KAAK,CACV,wCACE,aACA,WACA,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CACvD,CACF,CAAC;EACH;CACF;AACF"}
@@ -1,5 +1,6 @@
1
- import { type Result } from '@uapkg/diagnostics';
2
- import { type PostinstallDefinition } from '../api/PostinstallDsl.js';
1
+ import { PostinstallDefinition } from "../api/PostinstallDsl.js";
2
+ import { Result } from "@uapkg/diagnostics";
3
+ //#region src/postinstall/loader/ExportValidator.d.ts
3
4
  /**
4
5
  * Normalizes an imported module to its default export (or the module object
5
6
  * itself for CommonJS-style returns) and validates against
@@ -8,8 +9,10 @@ import { type PostinstallDefinition } from '../api/PostinstallDsl.js';
8
9
  * Emits `POSTINSTALL_INVALID_EXPORT` with flattened Zod issue messages when
9
10
  * the shape is wrong.
10
11
  */
11
- export declare class ExportValidator {
12
- validate(packageName: string, entryFile: string, moduleValue: unknown): Result<PostinstallDefinition>;
13
- private unwrap;
12
+ declare class ExportValidator {
13
+ validate(packageName: string, entryFile: string, moduleValue: unknown): Result<PostinstallDefinition>;
14
+ private unwrap;
14
15
  }
16
+ //#endregion
17
+ export { ExportValidator };
15
18
  //# sourceMappingURL=ExportValidator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExportValidator.d.ts","sourceRoot":"","sources":["../../../src/postinstall/loader/ExportValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsD,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACrG,OAAO,EAAE,KAAK,qBAAqB,EAA+B,MAAM,0BAA0B,CAAC;AAEnG;;;;;;;GAOG;AACH,qBAAa,eAAe;IACnB,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAa5G,OAAO,CAAC,MAAM;CAQf"}
1
+ {"version":3,"file":"ExportValidator.d.ts","names":[],"sources":["../../../src/postinstall/loader/ExportValidator.ts"],"mappings":";;;;;;;;;;;cAWa;EACJ,SAAS,qBAAqB,mBAAmB,uBAAuB,OAAO;UAa9E"}
@@ -1,34 +1,38 @@
1
- import { createPostinstallInvalidExportDiagnostic, fail, ok } from '@uapkg/diagnostics';
2
- import { PostinstallDefinitionSchema } from '../api/PostinstallDsl.js';
1
+ import { PostinstallDefinitionSchema } from "../api/PostinstallDsl.js";
2
+ import { createPostinstallInvalidExportDiagnostic, fail, ok } from "@uapkg/diagnostics";
3
+
4
+ //#region src/postinstall/loader/ExportValidator.ts
3
5
  /**
4
- * Normalizes an imported module to its default export (or the module object
5
- * itself for CommonJS-style returns) and validates against
6
- * {@link PostinstallDefinitionSchema}.
7
- *
8
- * Emits `POSTINSTALL_INVALID_EXPORT` with flattened Zod issue messages when
9
- * the shape is wrong.
10
- */
11
- export class ExportValidator {
12
- validate(packageName, entryFile, moduleValue) {
13
- const unwrapped = this.unwrap(moduleValue);
14
- const parsed = PostinstallDefinitionSchema.safeParse(unwrapped);
15
- if (!parsed.success) {
16
- const issues = parsed.error.issues.map((issue) => {
17
- const where = issue.path.length > 0 ? ` at ${issue.path.join('.')}` : '';
18
- return `${issue.message}${where}`;
19
- });
20
- return fail([createPostinstallInvalidExportDiagnostic(packageName, entryFile, issues)]);
21
- }
22
- return ok(parsed.data);
23
- }
24
- unwrap(moduleValue) {
25
- if (moduleValue && typeof moduleValue === 'object') {
26
- const record = moduleValue;
27
- if ('default' in record)
28
- return record.default;
29
- return record;
30
- }
31
- return moduleValue;
32
- }
33
- }
6
+ * Normalizes an imported module to its default export (or the module object
7
+ * itself for CommonJS-style returns) and validates against
8
+ * {@link PostinstallDefinitionSchema}.
9
+ *
10
+ * Emits `POSTINSTALL_INVALID_EXPORT` with flattened Zod issue messages when
11
+ * the shape is wrong.
12
+ */
13
+ var ExportValidator = class {
14
+ validate(packageName, entryFile, moduleValue) {
15
+ const unwrapped = this.unwrap(moduleValue);
16
+ const parsed = PostinstallDefinitionSchema.safeParse(unwrapped);
17
+ if (!parsed.success) {
18
+ const issues = parsed.error.issues.map((issue) => {
19
+ const where = issue.path.length > 0 ? ` at ${issue.path.join(".")}` : "";
20
+ return `${issue.message}${where}`;
21
+ });
22
+ return fail([createPostinstallInvalidExportDiagnostic(packageName, entryFile, issues)]);
23
+ }
24
+ return ok(parsed.data);
25
+ }
26
+ unwrap(moduleValue) {
27
+ if (moduleValue && typeof moduleValue === "object") {
28
+ const record = moduleValue;
29
+ if ("default" in record) return record.default;
30
+ return record;
31
+ }
32
+ return moduleValue;
33
+ }
34
+ };
35
+
36
+ //#endregion
37
+ export { ExportValidator };
34
38
  //# sourceMappingURL=ExportValidator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExportValidator.js","sourceRoot":"","sources":["../../../src/postinstall/loader/ExportValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wCAAwC,EAAE,IAAI,EAAE,EAAE,EAAe,MAAM,oBAAoB,CAAC;AACrG,OAAO,EAA8B,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAEnG;;;;;;;GAOG;AACH,MAAM,OAAO,eAAe;IACnB,QAAQ,CAAC,WAAmB,EAAE,SAAiB,EAAE,WAAoB;QAC1E,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC3C,MAAM,MAAM,GAAG,2BAA2B,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAChE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;gBAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACzE,OAAO,GAAG,KAAK,CAAC,OAAO,GAAG,KAAK,EAAE,CAAC;YACpC,CAAC,CAAC,CAAC;YACH,OAAO,IAAI,CAAC,CAAC,wCAAwC,CAAC,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QAC1F,CAAC;QACD,OAAO,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAEO,MAAM,CAAC,WAAoB;QACjC,IAAI,WAAW,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;YACnD,MAAM,MAAM,GAAG,WAAsC,CAAC;YACtD,IAAI,SAAS,IAAI,MAAM;gBAAE,OAAO,MAAM,CAAC,OAAO,CAAC;YAC/C,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;CACF"}
1
+ {"version":3,"file":"ExportValidator.js","names":[],"sources":["../../../src/postinstall/loader/ExportValidator.ts"],"sourcesContent":["import { createPostinstallInvalidExportDiagnostic, fail, ok, type Result } from '@uapkg/diagnostics';\nimport { type PostinstallDefinition, PostinstallDefinitionSchema } from '../api/PostinstallDsl.js';\n\n/**\n * Normalizes an imported module to its default export (or the module object\n * itself for CommonJS-style returns) and validates against\n * {@link PostinstallDefinitionSchema}.\n *\n * Emits `POSTINSTALL_INVALID_EXPORT` with flattened Zod issue messages when\n * the shape is wrong.\n */\nexport class ExportValidator {\n public validate(packageName: string, entryFile: string, moduleValue: unknown): Result<PostinstallDefinition> {\n const unwrapped = this.unwrap(moduleValue);\n const parsed = PostinstallDefinitionSchema.safeParse(unwrapped);\n if (!parsed.success) {\n const issues = parsed.error.issues.map((issue) => {\n const where = issue.path.length > 0 ? ` at ${issue.path.join('.')}` : '';\n return `${issue.message}${where}`;\n });\n return fail([createPostinstallInvalidExportDiagnostic(packageName, entryFile, issues)]);\n }\n return ok(parsed.data);\n }\n\n private unwrap(moduleValue: unknown): unknown {\n if (moduleValue && typeof moduleValue === 'object') {\n const record = moduleValue as Record<string, unknown>;\n if ('default' in record) return record.default;\n return record;\n }\n return moduleValue;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAWA,IAAa,kBAAb,MAA6B;CAC3B,AAAO,SAAS,aAAqB,WAAmB,aAAqD;EAC3G,MAAM,YAAY,KAAK,OAAO,WAAW;EACzC,MAAM,SAAS,4BAA4B,UAAU,SAAS;EAC9D,IAAI,CAAC,OAAO,SAAS;GACnB,MAAM,SAAS,OAAO,MAAM,OAAO,KAAK,UAAU;IAChD,MAAM,QAAQ,MAAM,KAAK,SAAS,IAAI,OAAO,MAAM,KAAK,KAAK,GAAG,MAAM;IACtE,OAAO,GAAG,MAAM,UAAU;GAC5B,CAAC;GACD,OAAO,KAAK,CAAC,yCAAyC,aAAa,WAAW,MAAM,CAAC,CAAC;EACxF;EACA,OAAO,GAAG,OAAO,IAAI;CACvB;CAEA,AAAQ,OAAO,aAA+B;EAC5C,IAAI,eAAe,OAAO,gBAAgB,UAAU;GAClD,MAAM,SAAS;GACf,IAAI,aAAa,QAAQ,OAAO,OAAO;GACvC,OAAO;EACT;EACA,OAAO;CACT;AACF"}
@@ -1,13 +1,14 @@
1
- import { type Result } from '@uapkg/diagnostics';
2
- export type ModuleSource = {
3
- readonly kind: 'file';
4
- readonly path: string;
5
- }
1
+ import { Result } from "@uapkg/diagnostics";
2
+ //#region src/postinstall/loader/ModuleImporter.d.ts
3
+ type ModuleSource = {
4
+ readonly kind: 'file';
5
+ readonly path: string;
6
+ } |
6
7
  /** ESM source already transpiled by {@link EsbuildTranspiler}. */
7
- | {
8
- readonly kind: 'transpiled';
9
- readonly code: string;
10
- readonly originalPath: string;
8
+ {
9
+ readonly kind: 'transpiled';
10
+ readonly code: string;
11
+ readonly originalPath: string;
11
12
  };
12
13
  /**
13
14
  * Imports a postinstall module.
@@ -20,10 +21,12 @@ export type ModuleSource = {
20
21
  * it on best-effort basis after import. The file lives in the OS tmp dir
21
22
  * keyed by a timestamp+pid, avoiding collisions across concurrent installs.
22
23
  */
23
- export declare class ModuleImporter {
24
- import(packageName: string, source: ModuleSource): Promise<Result<unknown>>;
25
- private importFileUrl;
26
- private createTempFile;
27
- private safeUnlink;
24
+ declare class ModuleImporter {
25
+ import(packageName: string, source: ModuleSource): Promise<Result<unknown>>;
26
+ private importFileUrl;
27
+ private createTempFile;
28
+ private safeUnlink;
28
29
  }
30
+ //#endregion
31
+ export { ModuleImporter, ModuleSource };
29
32
  //# sourceMappingURL=ModuleImporter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleImporter.d.ts","sourceRoot":"","sources":["../../../src/postinstall/loader/ModuleImporter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmD,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAElG,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AAClD,kEAAkE;GAChE;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1F;;;;;;;;;;GAUG;AACH,qBAAa,cAAc;IACZ,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAY1E,aAAa;IAkB3B,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,UAAU;CAOnB"}
1
+ {"version":3,"file":"ModuleImporter.d.ts","names":[],"sources":["../../../src/postinstall/loader/ModuleImporter.ts"],"mappings":";;KAMY;WACG;WAAuB;;;;WAEvB;WAA6B;WAAuB;;;;;;;;;;;;;cAatD;EACE,OAAO,qBAAqB,QAAQ,eAAe,QAAQ;UAY1D;UAkBN;UAQA"}
@@ -1,60 +1,52 @@
1
- import fs from 'node:fs';
2
- import * as os from 'node:os';
3
- import * as path from 'node:path';
4
- import { pathToFileURL } from 'node:url';
5
- import { createPostinstallLoadFailedDiagnostic, fail, ok } from '@uapkg/diagnostics';
1
+ import { createPostinstallLoadFailedDiagnostic, fail, ok } from "@uapkg/diagnostics";
2
+ import * as path$1 from "node:path";
3
+ import fs from "node:fs";
4
+ import * as os from "node:os";
5
+ import { pathToFileURL } from "node:url";
6
+
7
+ //#region src/postinstall/loader/ModuleImporter.ts
6
8
  /**
7
- * Imports a postinstall module.
8
- *
9
- * For `.js`/`.mjs` files we use the file URL directly so relative imports and
10
- * `node_modules` resolution work.
11
- *
12
- * For transpiled `.ts` code we write to a sibling temp file next to the
13
- * original entry — data: URLs cannot resolve relative specifiers — and delete
14
- * it on best-effort basis after import. The file lives in the OS tmp dir
15
- * keyed by a timestamp+pid, avoiding collisions across concurrent installs.
16
- */
17
- export class ModuleImporter {
18
- async import(packageName, source) {
19
- if (source.kind === 'file') {
20
- return this.importFileUrl(packageName, source.path, source.path);
21
- }
22
- const tmpFile = this.createTempFile(source.originalPath, source.code);
23
- try {
24
- return await this.importFileUrl(packageName, tmpFile, source.originalPath);
25
- }
26
- finally {
27
- this.safeUnlink(tmpFile);
28
- }
29
- }
30
- async importFileUrl(packageName, filePath, reportedPath) {
31
- try {
32
- // Cache-bust with a query parameter so repeated postinstall runs in the
33
- // same process (e.g. tests) always reload the latest bytes on disk.
34
- const url = `${pathToFileURL(filePath).href}?t=${Date.now()}`;
35
- const moduleValue = await import(url);
36
- return ok(moduleValue);
37
- }
38
- catch (error) {
39
- return fail([
40
- createPostinstallLoadFailedDiagnostic(packageName, reportedPath, error instanceof Error ? error.message : String(error)),
41
- ]);
42
- }
43
- }
44
- createTempFile(originalPath, code) {
45
- const base = path.basename(originalPath, path.extname(originalPath));
46
- const fileName = `uapkg-postinstall-${base}-${process.pid}-${Date.now()}.mjs`;
47
- const tmpFile = path.join(os.tmpdir(), fileName);
48
- fs.writeFileSync(tmpFile, code, 'utf-8');
49
- return tmpFile;
50
- }
51
- safeUnlink(filePath) {
52
- try {
53
- fs.unlinkSync(filePath);
54
- }
55
- catch {
56
- // Best-effort cleanup; OS tmp dir is rotated anyway.
57
- }
58
- }
59
- }
9
+ * Imports a postinstall module.
10
+ *
11
+ * For `.js`/`.mjs` files we use the file URL directly so relative imports and
12
+ * `node_modules` resolution work.
13
+ *
14
+ * For transpiled `.ts` code we write to a sibling temp file next to the
15
+ * original entry — data: URLs cannot resolve relative specifiers — and delete
16
+ * it on best-effort basis after import. The file lives in the OS tmp dir
17
+ * keyed by a timestamp+pid, avoiding collisions across concurrent installs.
18
+ */
19
+ var ModuleImporter = class {
20
+ async import(packageName, source) {
21
+ if (source.kind === "file") return this.importFileUrl(packageName, source.path, source.path);
22
+ const tmpFile = this.createTempFile(source.originalPath, source.code);
23
+ try {
24
+ return await this.importFileUrl(packageName, tmpFile, source.originalPath);
25
+ } finally {
26
+ this.safeUnlink(tmpFile);
27
+ }
28
+ }
29
+ async importFileUrl(packageName, filePath, reportedPath) {
30
+ try {
31
+ const moduleValue = await import(`${pathToFileURL(filePath).href}?t=${Date.now()}`);
32
+ return ok(moduleValue);
33
+ } catch (error) {
34
+ return fail([createPostinstallLoadFailedDiagnostic(packageName, reportedPath, error instanceof Error ? error.message : String(error))]);
35
+ }
36
+ }
37
+ createTempFile(originalPath, code) {
38
+ const fileName = `uapkg-postinstall-${path$1.basename(originalPath, path$1.extname(originalPath))}-${process.pid}-${Date.now()}.mjs`;
39
+ const tmpFile = path$1.join(os.tmpdir(), fileName);
40
+ fs.writeFileSync(tmpFile, code, "utf-8");
41
+ return tmpFile;
42
+ }
43
+ safeUnlink(filePath) {
44
+ try {
45
+ fs.unlinkSync(filePath);
46
+ } catch {}
47
+ }
48
+ };
49
+
50
+ //#endregion
51
+ export { ModuleImporter };
60
52
  //# sourceMappingURL=ModuleImporter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleImporter.js","sourceRoot":"","sources":["../../../src/postinstall/loader/ModuleImporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,qCAAqC,EAAE,IAAI,EAAE,EAAE,EAAe,MAAM,oBAAoB,CAAC;AAOlG;;;;;;;;;;GAUG;AACH,MAAM,OAAO,cAAc;IAClB,KAAK,CAAC,MAAM,CAAC,WAAmB,EAAE,MAAoB;QAC3D,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QACnE,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QACtE,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;QAC7E,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,aAAa,CAAC,WAAmB,EAAE,QAAgB,EAAE,YAAoB;QACrF,IAAI,CAAC;YACH,wEAAwE;YACxE,oEAAoE;YACpE,MAAM,GAAG,GAAG,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC,IAAI,MAAM,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YAC9D,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC;YACtC,OAAO,EAAE,CAAC,WAAW,CAAC,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC;gBACV,qCAAqC,CACnC,WAAW,EACX,YAAY,EACZ,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACvD;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAEO,cAAc,CAAC,YAAoB,EAAE,IAAY;QACvD,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;QACrE,MAAM,QAAQ,GAAG,qBAAqB,IAAI,IAAI,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC;QAC9E,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC,CAAC;QACjD,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QACzC,OAAO,OAAO,CAAC;IACjB,CAAC;IAEO,UAAU,CAAC,QAAgB;QACjC,IAAI,CAAC;YACH,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC1B,CAAC;QAAC,MAAM,CAAC;YACP,qDAAqD;QACvD,CAAC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"ModuleImporter.js","names":["path"],"sources":["../../../src/postinstall/loader/ModuleImporter.ts"],"sourcesContent":["import fs from 'node:fs';\nimport * as os from 'node:os';\nimport * as path from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { createPostinstallLoadFailedDiagnostic, fail, ok, type Result } from '@uapkg/diagnostics';\n\nexport type ModuleSource =\n | { readonly kind: 'file'; readonly path: string }\n /** ESM source already transpiled by {@link EsbuildTranspiler}. */\n | { readonly kind: 'transpiled'; readonly code: string; readonly originalPath: string };\n\n/**\n * Imports a postinstall module.\n *\n * For `.js`/`.mjs` files we use the file URL directly so relative imports and\n * `node_modules` resolution work.\n *\n * For transpiled `.ts` code we write to a sibling temp file next to the\n * original entry — data: URLs cannot resolve relative specifiers — and delete\n * it on best-effort basis after import. The file lives in the OS tmp dir\n * keyed by a timestamp+pid, avoiding collisions across concurrent installs.\n */\nexport class ModuleImporter {\n public async import(packageName: string, source: ModuleSource): Promise<Result<unknown>> {\n if (source.kind === 'file') {\n return this.importFileUrl(packageName, source.path, source.path);\n }\n const tmpFile = this.createTempFile(source.originalPath, source.code);\n try {\n return await this.importFileUrl(packageName, tmpFile, source.originalPath);\n } finally {\n this.safeUnlink(tmpFile);\n }\n }\n\n private async importFileUrl(packageName: string, filePath: string, reportedPath: string): Promise<Result<unknown>> {\n try {\n // Cache-bust with a query parameter so repeated postinstall runs in the\n // same process (e.g. tests) always reload the latest bytes on disk.\n const url = `${pathToFileURL(filePath).href}?t=${Date.now()}`;\n const moduleValue = await import(url);\n return ok(moduleValue);\n } catch (error) {\n return fail([\n createPostinstallLoadFailedDiagnostic(\n packageName,\n reportedPath,\n error instanceof Error ? error.message : String(error),\n ),\n ]);\n }\n }\n\n private createTempFile(originalPath: string, code: string): string {\n const base = path.basename(originalPath, path.extname(originalPath));\n const fileName = `uapkg-postinstall-${base}-${process.pid}-${Date.now()}.mjs`;\n const tmpFile = path.join(os.tmpdir(), fileName);\n fs.writeFileSync(tmpFile, code, 'utf-8');\n return tmpFile;\n }\n\n private safeUnlink(filePath: string): void {\n try {\n fs.unlinkSync(filePath);\n } catch {\n // Best-effort cleanup; OS tmp dir is rotated anyway.\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA,IAAa,iBAAb,MAA4B;CAC1B,MAAa,OAAO,aAAqB,QAAgD;EACvF,IAAI,OAAO,SAAS,QAClB,OAAO,KAAK,cAAc,aAAa,OAAO,MAAM,OAAO,IAAI;EAEjE,MAAM,UAAU,KAAK,eAAe,OAAO,cAAc,OAAO,IAAI;EACpE,IAAI;GACF,OAAO,MAAM,KAAK,cAAc,aAAa,SAAS,OAAO,YAAY;EAC3E,UAAU;GACR,KAAK,WAAW,OAAO;EACzB;CACF;CAEA,MAAc,cAAc,aAAqB,UAAkB,cAAgD;EACjH,IAAI;GAIF,MAAM,cAAc,MAAM,OAAO,GADlB,cAAc,QAAQ,CAAC,CAAC,KAAK,KAAK,KAAK,IAAI;GAE1D,OAAO,GAAG,WAAW;EACvB,SAAS,OAAO;GACd,OAAO,KAAK,CACV,sCACE,aACA,cACA,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CACvD,CACF,CAAC;EACH;CACF;CAEA,AAAQ,eAAe,cAAsB,MAAsB;EAEjE,MAAM,WAAW,qBADJA,OAAK,SAAS,cAAcA,OAAK,QAAQ,YAAY,CACzB,EAAE,GAAG,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE;EACxE,MAAM,UAAUA,OAAK,KAAK,GAAG,OAAO,GAAG,QAAQ;EAC/C,GAAG,cAAc,SAAS,MAAM,OAAO;EACvC,OAAO;CACT;CAEA,AAAQ,WAAW,UAAwB;EACzC,IAAI;GACF,GAAG,WAAW,QAAQ;EACxB,QAAQ,CAER;CACF;AACF"}
@@ -1,14 +1,15 @@
1
- import { type Result } from '@uapkg/diagnostics';
2
- import type { PostinstallDefinition } from '../api/PostinstallDsl.js';
3
- import { EntryResolver } from './EntryResolver.js';
4
- import { EsbuildTranspiler } from './EsbuildTranspiler.js';
5
- import { ExportValidator } from './ExportValidator.js';
6
- import { ModuleImporter } from './ModuleImporter.js';
7
- export interface LoadedPostinstall {
8
- readonly packageName: string;
9
- readonly pluginRoot: string;
10
- readonly entryFile: string;
11
- readonly definition: PostinstallDefinition;
1
+ import { PostinstallDefinition } from "../api/PostinstallDsl.js";
2
+ import { EntryResolver } from "./EntryResolver.js";
3
+ import { EsbuildTranspiler } from "./EsbuildTranspiler.js";
4
+ import { ExportValidator } from "./ExportValidator.js";
5
+ import { ModuleImporter } from "./ModuleImporter.js";
6
+ import { Result } from "@uapkg/diagnostics";
7
+ //#region src/postinstall/loader/PostinstallLoader.d.ts
8
+ interface LoadedPostinstall {
9
+ readonly packageName: string;
10
+ readonly pluginRoot: string;
11
+ readonly entryFile: string;
12
+ readonly definition: PostinstallDefinition;
12
13
  }
13
14
  /**
14
15
  * Facade that composes the four loader stages:
@@ -20,13 +21,15 @@ export interface LoadedPostinstall {
20
21
  * Returns `ok(null)` when a plugin has no postinstall — a valid, silent state.
21
22
  * Never throws: every stage returns `Result`.
22
23
  */
23
- export declare class PostinstallLoader {
24
- private readonly entryResolver;
25
- private readonly transpiler;
26
- private readonly importer;
27
- private readonly validator;
28
- constructor(entryResolver?: EntryResolver, transpiler?: EsbuildTranspiler, importer?: ModuleImporter, validator?: ExportValidator);
29
- load(packageName: string, pluginRoot: string): Promise<Result<LoadedPostinstall | null>>;
30
- private buildModuleSource;
24
+ declare class PostinstallLoader {
25
+ private readonly entryResolver;
26
+ private readonly transpiler;
27
+ private readonly importer;
28
+ private readonly validator;
29
+ constructor(entryResolver?: EntryResolver, transpiler?: EsbuildTranspiler, importer?: ModuleImporter, validator?: ExportValidator);
30
+ load(packageName: string, pluginRoot: string): Promise<Result<LoadedPostinstall | null>>;
31
+ private buildModuleSource;
31
32
  }
33
+ //#endregion
34
+ export { LoadedPostinstall, PostinstallLoader };
32
35
  //# sourceMappingURL=PostinstallLoader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PostinstallLoader.d.ts","sourceRoot":"","sources":["../../../src/postinstall/loader/PostinstallLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAsB,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAqB,MAAM,qBAAqB,CAAC;AAExE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,qBAAqB,CAAC;CAC5C;AAED;;;;;;;;;GASG;AACH,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAHT,aAAa,GAAE,aAAmC,EAClD,UAAU,GAAE,iBAA2C,EACvD,QAAQ,GAAE,cAAqC,EAC/C,SAAS,GAAE,eAAuC;IAGxD,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;YAuBvF,iBAAiB;CAQhC"}
1
+ {"version":3,"file":"PostinstallLoader.d.ts","names":[],"sources":["../../../src/postinstall/loader/PostinstallLoader.ts"],"mappings":";;;;;;;UAOiB;WACN;WACA;WACA;WACA,YAAY;;;;;;;;;;;;cAaV;mBAEQ;mBACA;mBACA;mBACA;EAJnB,YACmB,gBAAe,eACf,aAAY,mBACZ,WAAU,gBACV,YAAW;EAGjB,KAAK,qBAAqB,qBAAqB,QAAQ,OAAO;UAuB7D"}